uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
dfab3e53-a1da-410c-a791-a3ea5f75897b | Seeed-Studio/Seeed_Studio_Courses | Seeed_Arduino_WioTerminal_TinyML_Course/Project_5/tensorflow_lite/src/tensorflow/lite/micro/kernels/ceil.cpp | #include "tensorflow/lite/kernels/internal/reference/ceil.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "tensorflow/lite/kernels/kernel_util.h"
#include "tensorflow/lite/micro/kernels/kernel_util.h"
namespace tflite {
namespace ops {
namespace micro {
na... | ALGO | 0.948184 | 7.805696 |
093ba8e8-4481-4e43-b7d0-3c437c042b23 | DDH2808/Data_Structures_and_Algorithms_Code_PTIT | CON2_31 - TỪ ĐIỂN.cpp | #include <bits/stdc++.h>
using namespace std;
int k, n, m, ok;
char b[4][4];
bool check[4][4];
vector<string> a;
map<string, int> c;
vector<pair<int, int>> p = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}, {-1, -1}, {-1, 1}, {1, -1}, {1, 1}};
void Try(int i1, int i2, string x)
{
if (c[x] > 0)
{
cout << x << " ";
... | ALGO | 0.999785 | 4.005482 |
96fefc25-2b6a-4a0a-a7b0-b5272522d1cb | sstuqtd/vocal | thridparty/boost/libs/asio/example/cpp03/http/server4/request_parser.cpp | #include "request_parser.hpp"
#include <algorithm>
#include <cctype>
#include <boost/lexical_cast.hpp>
#include "request.hpp"
namespace http {
namespace server4 {
// Enable the pseudo-keywords reenter, yield and fork.
#include <boost/asio/yield.hpp>
std::string request_parser::content_length_name_ = "Content-Length"... | WEB | 0.875463 | 5.997179 |
da7bd5cc-71c6-4474-bd8f-47990e3a901d | md1894/c-ds | Graphs/Graphs2/prims.cpp | /*
Code : Prim's Algorithm
Send Feedback
Given an undirected, connected and weighted graph G(V, E) with V number of vertices (which are numbered from 0 to V-1) and E number of edges.
Find and print the Minimum Spanning Tree (MST) using Prim's algorithm.
For printing MST follow the steps -
1. In one line, print an edge ... | ALGO | 0.99998 | 4.373618 |
ea5375d4-5c69-4291-8e9f-abc964cc572c | sharad4730/Codechef-feb-long-challenge-2019 | Deputy_chef.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t,n,value1,value2;
cin>>t;
for(int i=0;i<t;i++)
{
cin>>n;
vector<int>v1(n);
vector<int>v2(n);
for(int j=0;j<n;j++)
{
cin>>value1;
v1[j]=value1;
}
for(int j=0;j<n;... | ALGO | 0.999951 | 3.36094 |
9902f137-d434-4095-9bfc-ddf833499188 | AhmedMostafa79/problem-solving | Problem-Solving/SPOJ/DQUERY - D-query.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) ((v).begin()),((v).end())
#define rall(v) ((v).rbegin()),((v).rend())
#define Fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define close(n) return cout<<n,0;
#define files freopen("closing.in", "r", stdin); freopen("closing... | ALGO | 0.99993 | 4.236506 |
2a2c883e-318f-49cc-b965-84173ad03271 | ioana-manghiuc/computer-networks | RC_02/RC_02/TokenRingNetwork.cpp | #include "TokenRingNetwork.h"
#include <random>
TokenRingNetwork::TokenRingNetwork():
m_token(std::make_shared<Token>())
{
ReadComputers();
}
bool TokenRingNetwork::ValidateIP(const std::string& ip)
{
int part = 0;
int count = 1;
for (auto c : ip)
{
if (c != '.')
{
part = part * 10 + (c - '0');
}
else... | TOOL | 0.991333 | 4.895669 |
6f84f58b-5e01-49e2-966c-d584edecd74f | Shivanshu156/MyCodes | data_structures/Competitive/Rotated Sorted Array Search.cpp | int binary(const vector<int> &A,int start, int end, int B)
{
int mid;
while(start<=end)
{ mid = (start+end)/2;
if(A[mid]==B) return mid;
if(A[mid]>B) end = mid-1;
if(A[mid]<B) start = mid+1;
}
return -1;
}
int Solution::search(const vector<int> &A, int B) {
... | ALGO | 0.999991 | 5.673682 |
07d77df8-ba28-4b82-ae87-11fa25493e51 | OpenXRay/xray | SDK/MagicSoftware/FreeMagic/Source/Distance3D/MgcDist3DLinLin.cpp | #include "MgcDist3DLinLin.h"
using namespace Mgc;
static const Real gs_fTolerance = 1e-05f;
//----------------------------------------------------------------------------
Real Mgc::SqrDistance (const Line3& rkLine0, const Line3& rkLine1,
Real* pfLinP0, Real* pfLinP1)
{
Vector3 kDiff = rkLine0.Origin() - rkLin... | ALGO | 0.999783 | 5.238501 |
c3a332b8-ab63-4b35-beab-41178e02575d | guanqin-123/compareM | Marabou/tools/boost-1.84.0/libs/multiprecision/example/cpp_int_snips.cpp | #include <boost/multiprecision/cpp_int.hpp>
#include <iostream>
void t1()
{
//[cpp_int_eg
//=#include <boost/multiprecision/cpp_int.hpp>
//=#include <iostream>
//=
//=int main()
//={
using namespace boost::multiprecision;
int128_t v = 1;
// Do some fixed precision arithmetic:
for(unsigned i = 1; i <= 20;... | ALGO | 0.943298 | 4.529011 |
c10f8f9d-7ef5-41d6-bcf4-93ce497ac734 | msft-mirror-aosp/platform.packages.modules.NeuralNetworks | common/operations/L2Normalization.cpp | #define LOG_TAG "Operations"
#include <tensorflow/lite/kernels/internal/optimized/optimized_ops.h>
#include <tensorflow/lite/kernels/internal/reference/integer_ops/l2normalization.h>
#include <algorithm>
#include <vector>
#include "CpuOperationUtils.h"
#include "HalInterfaces.h"
#include "OperationResolver.h"
#inclu... | TOOL | 0.9504 | 4.19238 |
a01c4667-85ff-4656-85e7-c6c019106d3f | mahak0505/DSA-Practice | Binary Search/targetinrotated.cpp | //find the index where k is presend in a rotated array at some pivoted point
#include <iostream>
#include <vector>
using namespace std;
int binarySearch(vector<int>& arr,int start,int end,int key){
int mid = start + (end-start)/2;
while(start<=end){
if(arr[mid]==key){
return mid;
... | ALGO | 0.999956 | 5.159801 |
12adbee6-645b-41cc-a691-eab757ab12c5 | varunpandey29/Leetcode | 138-copy-list-with-random-pointer/copy-list-with-random-pointer.cpp |
class Solution {
private:
void insert(Node* &head, Node* &tail, int val)
{
Node* newNode = new Node(val);
if(head == NULL)
{
head = newNode;
tail = newNode;
}
else
{
tail->next = newNode;
tail = newNode;
}
... | ALGO | 0.999073 | 4.978592 |
48dcae75-db8f-4972-8947-84f352591205 | Intense-M/frameworks_av | media/libstagefright/codecs/avc/common/src/deblock.cpp | #include <string.h>
#include "avclib_common.h"
#define MAX_QP 51
#define MB_BLOCK_SIZE 16
// NOTE: these 3 tables are for funtion GetStrength() only
const static int ININT_STRENGTH[4] = {0x04040404, 0x03030303, 0x03030303, 0x03030303};
// NOTE: these 3 tables are for funtion EdgeLoop() only
// NOTE: to change the t... | ALGO | 0.989222 | 3.107922 |
26304572-99f5-4113-b56f-167d9667b2a0 | Nullray/ICT | software/workload/firesim/host/firesim-lib/lib/boost/libs/geometry/doc/src/examples/geometries/polygon.cpp | // Boost.Geometry
// QuickBook Example
//[polygon
//` Declaration and use of the Boost.Geometry model::polygon, modelling the Polygon Concept
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/geometries.hpp>
namespace bg = boost::geometry;
int main()
{
typedef bg::model::poin... | TOOL | 0.947684 | 7.581317 |
561efc56-0303-40e3-b1bb-99eb5d2b0839 | Hit301/Satellite | Dyn/deps/eigen-3.3.8/bench/spbench/sp_solver.cpp | // Small bench routine for Eigen available in Eigen
// (C) Desire NUENTSA WAKAM, INRIA
#include <iostream>
#include <fstream>
#include <iomanip>
#include <Eigen/Jacobi>
#include <Eigen/Householder>
#include <Eigen/IterativeLinearSolvers>
#include <Eigen/LU>
#include <unsupported/Eigen/SparseExtra>
//#include <Eigen/Sp... | ALGO | 0.995857 | 4.313793 |
7c9c2d7f-0430-4761-995e-38849f4bce85 | bitspill/slr-bitcoin | src/chainparams.cpp | #include "chainparams.h"
#include "consensus/merkle.h"
#include "tinyformat.h"
#include "util.h"
#include "utilstrencodings.h"
#include <assert.h>
#include <boost/assign/list_of.hpp>
#include "chainparamsseeds.h"
static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_... | CONFIG | 0.932588 | 5.95272 |
77e7225e-5f1f-4681-a723-408db4f18455 | AjaySingh8923/LLVM | llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp | #include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Debuginfod/Debuginfod.h"
#include "llvm/Debuginfod/HTTPClient.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/LLVMDriver.h"
#include "llvm/Support/ThreadPool... | TOOL | 0.961429 | 7.446461 |
1f979e5f-e6e9-4e00-b094-ac7e28934db9 | purnimamehta/Articles-n-Algorithms | Competitive Programming/DP practice/Contest 1/pj.cpp | #include<stdio.h>
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int t=0;
while(1)
{
t++;
string s;
cin>>s;
if(s=="bye")
return 0;
vector<vector<int> > DP(s.size()+1,vector<int>(s.size()*9+1));
for(int i=0;i<DP[s.size()].size();i++)
DP[s.size()][i]=1;
for(int i=... | ALGO | 0.998555 | 3.300626 |
f7279ad1-d7fa-4cd9-9fb9-24f97576b2a8 | michaeljs1990/clog | third_party/boost/upstream/math/example/root_finding_multiprecision_example.cpp | // Note that this file contains Quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
// Example of root finding using Boost.Multiprecision.
#include <boost/math/tools/roots.hpp>
//using boost::math::policies::policy;
//using boost::math::tools::newton_raphson_iterate;
/... | ALGO | 0.999444 | 3.604619 |
a6a914e5-3d26-4677-bd89-43a5d0046d1f | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/May/ModularEquation_20210509152904.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
int Modulo(int m,int a ,int b){
return (m % a) %b;
}
int main(){
int t;
cin >> t;
while(t--){
int n,m;
cin >> n >> m;
set<pair<int,int>> freq;
for(int i = 1; i < n; i++){
for(int j = i + 1; j <... | ALGO | 0.999924 | 4.184327 |
edf8879c-951f-401a-9acc-a714697df115 | BrunoReX/palemoon | gfx/angle/src/compiler/ForLoopUnroll.cpp | #include "compiler/ForLoopUnroll.h"
namespace {
class IntegerForLoopUnrollMarker : public TIntermTraverser {
public:
virtual bool visitLoop(Visit, TIntermLoop* node)
{
// This is called after ValidateLimitations pass, so all the ASSERT
// should never fail.
// See ValidateLimitations:... | ALGO | 0.990558 | 7.46367 |
1dc37d5f-7b88-4a2c-bdad-26dc23bf13cf | achmadlutfi96/Codewars-Challenge-CPP | 8kyu/023-Is-n-divisible-by-x-and-y.cpp | #include <iostream>
using namespace std;
bool isDivisible(int n, int x, int y) {
// your code here
return n%x==0 && n%y==0;
}
int main(){
cout<<isDivisible(3, 3, 4);
return 0;
} | ALGO | 0.999078 | 4.378054 |
8e175657-acc0-4234-8b96-fbc12c6d6174 | anushka369/30-Days-DSA-Bootcamp | DAY 12: MIXED PROBLEMS/Test Scores/solution.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n, q;
cin >> n >> q;
vector<int> a(n);
for (auto &x : a)
{
cin >> x;
}
sort(a.begin(), a.end()); // sort in non-decreasing order
while (q--)
{
int x;
cin >> x;
auto it = lower_bound(... | ALGO | 0.999983 | 4.362948 |
fce0d0db-b8f7-4d86-976b-a2024c7e81b9 | JJANGORITHM/Programmers | Week 3/stageFailure/ws.cpp | #include <string>
#include <vector>
#include <map>
#include <iostream>
using namespace std;
vector<int> solution(int N, vector<int> stages) {
vector<int> answer;
vector<double> stage_cnt;
stage_cnt.assign(N + 2, 0);
for (int i = 0; i < stages.size(); i++) {
stage_cnt[stages[i]]++;
}
... | ALGO | 0.999985 | 4.563179 |
b14af6d3-fddd-4551-bcce-5bb69be3370e | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_1669_4.cpp | #include <iostream>
using namespace std;
int main() {
int H, W;
while(1){
cin>>H>>W;
if(H==0&&W==0) break;
for(int i=0; i<H; i++){
for(int j=0; j<W; j++){
if(i==0||i==H-1||j==0||j==W-1){
cout<<"#";
}else{cout<<".";}
}
cout<<"\n";
}
cout<<endl;
}
// your code goes here
return 0;
} | ALGO | 0.999321 | 3.398197 |
6482dd1e-8118-49d7-a797-46a8f29f995e | ishandutta2007/codeforces | krijgertje/normal/808/D.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include... | ALGO | 0.999936 | 3.699772 |
4289e571-c612-4631-8807-2a303ef5bec5 | Sumit2595/Leetcode-Problems | 0652-find-duplicate-subtrees/0652-find-duplicate-subtrees.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999844 | 5.764199 |
f7137472-8327-4c9b-999c-6a1ccf9d7327 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_9302_2.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> g;
int i, n, d, l, j;
int main(int argc, const char* argv[]) {
cin >> n >> d >> l;
g.resize(n, 1);
int sum1 = 0, sum2 = 0;
sum1 = n / 2 + n % 2;
sum2 = n / 2;
for (j = 0; j <= abs(d); j++) {
if (sum1 - sum2 == d) {
break;
}
if (d > ... | ALGO | 0.999974 | 3.825796 |
a96dab0e-9dc5-4576-9e2f-664fb5a3fb77 | ishandutta2007/codeforces | heart_blue/normal/237/C.cpp |
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#in... | ALGO | 0.999982 | 3.349397 |
17a6cb54-1310-4764-817d-e9edc3a7ca66 | waldoalvarez00/LtcArmory | cppForSwig/Blockchain.cpp | #ifdef max
#undef max
#endif
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
// Start Blockchain methods
//
////////////////////////////////////////////////////////////////////////////////
/////////////... | TOOL | 0.930143 | 7.464084 |
d29d21e9-190b-4327-91c9-c3d61de16815 | mainul3195/SUST_LongDistance | String/palindrome_hashing.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<long long>> HASH, REV_HASH, POW;
vector<int> BASE = {1231, 1567}, MOD = {1000000000 + 7, 1000000000 + 9};
#define lim 1000006 string text, pattern;void init(){
POW = vector<vector<long long>>(2, vector<long long>(lim));
POW[0][0] = POW[1][0] = 1;for (int b = 0... | ALGO | 0.999976 | 4.124016 |
290934e0-394a-4dfc-9ec1-31e09bd97464 | RonakVadsak/html-css | C++/c11.cpp | #include <iostream>
using namespace std;
int main ()
{
int a,b;
cout<<"a=";
cin>>a;
cout<<"b=";
cin>>b;
b=a+b;
a=b-a;
b=b-a;
cout<<"a="<<a<<"\n";
cout<<"b="<<b<<"\n";
return 0;
} | ALGO | 0.999536 | 3.245238 |
f363fce1-6eed-47e0-bc0b-1880c9eb25e9 | abhishek2208/Code | Breadth First Traversal.cpp | #include<bits/stdc++.h>
using namespace std;
class graph
{
int V;
vector<int> *edge;
public:
graph(int v);
void addEdge(int u,int v);
void bfs(int s);
};
graph::graph(int V)
{
this->V=V;
edge = new vector<int>[V];
}
void graph::addEdge(int u,int v)
{
edge[u].push_back(v);
}
void graph::... | ALGO | 0.999888 | 4.356172 |
6c3bb52f-530b-46c1-91fd-dda55b6e6ce8 | ShivamSachdeva12/spam_detector | venv/lib/python3.11/site-packages/sklearn/utils/src/MurmurHash3.cpp | // Note - The x86 and x64 versions do _not_ produce the same results, as the
// algorithms are optimized for their respective platforms. You can still
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
#include "MurmurHash3.h"
//-------------... | ALGO | 0.998344 | 7.198757 |
31896c12-957e-44e6-a7c2-c950a388d17b | QuantumLeaps/qpcpp | src/qf/qep_hsm.cpp | // unnamed namespace for local definitions with internal linkage
namespace {
Q_DEFINE_THIS_MODULE("qep_hsm")
// maximum depth of state nesting in a QHsm (including the top level)
// must be >= 3
static constexpr std::int_fast8_t QHSM_MAX_NEST_DEPTH_ {6};
//! @cond INTERNAL
// array of immutable events corresponding... | ALGO | 0.859397 | 4.14542 |
020b7262-50be-4510-83ba-7a6b9124b5cc | Shawaal-Nadeem/Data-Structure---Algorithm | Lab 3/Task 3/ConsoleApplication1/List.cpp | #include "List.h"
char*List::deepCopy(char*p)
{
int length = strlen(p);
char*temp = new char[length + 1];
for (int i = 0; i < length; i++)
{
temp[i] = p[i];
}
temp[length] = '\0';
return temp;
}
List::List()
{
arr = nullptr;
size = 0;
top = -1;
}
List::List(char*arrP, int s)
{
arr = deepCopy(arrP);
size ... | ALGO | 0.992378 | 3.368144 |
a59dde67-77c9-4221-bd56-f8568da5a512 | sanketgautam/Hackerrank_Submissions | submissions/Day 3: Intro to Conditional Statements.cpp | /*-----------------------------------------------------------------------
Problem Title: Day 3: Intro to Conditional Statements
Problem Link: https://www.hackerrank.com/challenges/30-conditional-statements
Author: sanketgautam
Language : C++14
-----------------------------------------------------------------------*/
... | ALGO | 0.999807 | 3.548219 |
caba0d5a-3b96-464a-ade5-4e3db3a7fdf0 | AndersonRamos1803/Estrutura-de-Dados | Exercícios 27.03.2023/Cascata.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string mensagem;
cout << "Digite a mensagem: ";
getline(cin, mensagem);
int largura_tela = 80;
int largura_mensagem = mensagem.length();
int espacos_lado = (largura_tela - largura_mensagem) / 2;
int posicao_atual = 5... | ALGO | 0.896661 | 4.500339 |
8e3e8f92-0643-4723-bd23-7dbd9d5a7849 | bikashkumaryadav/LeetCode-ProblemSets | 0920-uncommon-words-from-two-sentences/0920-uncommon-words-from-two-sentences.cpp | class Solution {
public:
vector<string> uncommonFromSentences(string s1, string s2) {
// we need to find unique occurences
string s = s1 + " " + s2;
cout<<s1.max_size();
// store all words from s
unordered_map<string,int> um;
string tmp="";
for(auto& val : s... | ALGO | 0.999876 | 5.381732 |
9d13018a-81d7-4ed7-91d1-3cdb8eaa4710 | icarus0309/LcRecord | 位运算/190.颠倒二进制位.cpp | /*
* @lc app=leetcode.cn id=190 lang=cpp
*
* [190] 颠倒二进制位
*/
// @lc code=start
class Solution {
public:
uint32_t reverseBits(uint32_t n) {
n = (n>>16)|(n<<16);
n = (n&0xff00ff00)>>8 | (n&0x00ff00ff)<<8;
n = (n&0xf0f0f0f0)>>4 | (n&0x0f0f0f0f)<<4;
n = (n&0xcccccccc)>>2 | (n&0x3333... | ALGO | 0.999822 | 6.067381 |
2c471925-6aee-455d-951e-275f215871f5 | june505/SearchEngine | PreProcess/BuildIndex/BuildIndex1.cpp | /*************************************************************************
> File Name: BuildIndex.cpp
> Author:HOU_JUN
> Mail: <EMAIL>
> Created Time: Thu 10 Sep 2015 07:33:10 AM PDT
************************************************************************/
#include <iostream>
#include <fstream>
#include <map>
#... | DATA | 0.991947 | 3.188468 |
14e25d49-a600-4a01-98ce-6d28e8dcd0d0 | hikigaya113/leet_code | Minimum Platforms - GFG/minimum-platforms.cpp | // { Driver Code Starts
// Program to find minimum number of platforms
// required on a railway station
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
//Function to find the minimum number of platforms required at the
//railway station such that no train waits.... | ALGO | 0.999983 | 5.533053 |
a31d5d17-e9f0-4d69-a4d3-d9d7c4294c04 | megablazikenabhishek/CPP-DSA | Queues_DS/implementation.cpp | #include <bits/stdc++.h>
using namespace std;
#define n 20
class Queue
{
int *arr;
int front;
int back;
public:
Queue()
{
arr = new int[n];
front = -1;
back = -1;
}
void push(int x)
{
if (back == n - 1)
{
cout << "Queue Overflow" <<... | ALGO | 0.992709 | 3.960992 |
75071cb9-0e38-47ca-ae44-412f3d87ead1 | mohAhmadRaza/DSA-CPP | Singly Linked Lists/LinkedLists.cpp | #include <iostream>
using namespace std;
class ListNode
{
public:
int value;
ListNode *next;
ListNode(int data) : value(data), next(NULL) {};
};
class Solution
{
public:
ListNode *head;
Solution() : head(NULL) {};
void insertAtEnd(int value)
{
ListNode *newNode = new ListNode(va... | ALGO | 0.999431 | 4.82732 |
e352bc43-1dc1-4fc0-903f-2736ce29628b | lazarulian/leetcode | leetcode/insertinterval.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
vector<vector<int>> insert(vector<vector<int>> &intervals, vector<int> &newInterval)
{
size_t i = 0;
vector<vector<int>> results;
// Beginning
while (i < intervals.size() && intervals[i][1] < newInterval... | ALGO | 0.999919 | 5.508235 |
b3eb068d-3d09-4048-99bb-faca679a4171 | Manju567/coding_Leetcode-solutions | lcp/LCP 02. 分式化简/Solution.cpp | class Solution {
public:
vector<int> fraction(vector<int>& cont) {
function<vector<int>(int)> dfs = [&](int i) {
if (i == cont.size() - 1) {
return vector<int>{cont[i], 1};
}
vector<int> next = dfs(i + 1);
int a = next[0], b = next[1];
... | ALGO | 0.999925 | 4.996248 |
2924084b-444b-467c-b898-e4fbb4ea63ce | Saimouli7424/Data-Structures-Algorithms-Learning-Journey | leetcodequestions/210.cpp | //Course Schedule II(Medium)
//using dfs+topological sort
// Time complexity: O(V+E), where V is the number of vertices and E is the number of edges.
// Space complexity: O(V+E), where V is the number of vertices and E is
#include <functional>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace ... | ALGO | 0.999984 | 6.914383 |
40b953a8-ac11-43bf-8839-113cd9ed0ea0 | MikailBag/perforator | contrib/libs/llvm18/lib/CodeGen/LiveRegMatrix.cpp | #include "llvm/CodeGen/LiveRegMatrix.h"
#include "RegisterCoalescer.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervalUnion.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#includ... | ALGO | 0.920071 | 7.663682 |
a92a7323-b0a2-4da7-95ca-31b56858f721 | MostafaOsmanFathi/Problem-Solving-Training | codeforces/Phase 2.1/Mathematics/447B.cpp | #include <bits/stdc++.h>
#define MOSTAFAOSMAN() ios_base::sync_with_stdio(false);cout.tie(NULL),cin.tie(NULL);
#define ll long long
#define ld long double
#define outCondtion(a) cout<<((a)?"YES":"NO")<<"\n";
#define tloop int t;cin>>t;cin.ignore();while(t--)
#define endl "\n"
#define lcm(x,y) ((x/__gcd(x,y))*y)
#define... | ALGO | 0.999839 | 4.023715 |
4d546f1d-5caf-4d03-aad8-77ba7781fb18 | anan416/c-secundario | C++ ejercicios/LPOO2023_S01_01_Culeddu_Ana_Clara/Ejercicio 3/Ejnro03.cpp | #include <cstdlib>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include "Sistema.h"
using namespace std;
int main(){
Sistema s;
int numeros[9];
string opcion;
s.ingresarNumero(numeros);
s.asc_desc(opcion, numeros);
return 1;
}
| TOOL | 0.984345 | 3.252332 |
5939f7d8-11d7-4c09-9b4d-4002223bc8a5 | vfolunin/archives-solutions | LeetCode/1866.cpp | class Solution {
long long rec(int n, int k) {
static vector<vector<long long>> memo(1001, vector<long long>(1001, -1));
long long &res = memo[n][k];
if (res != -1)
return res;
if (k == 0 || k > n)
return res = 0;
if (n <= 2)
r... | ALGO | 0.999991 | 5.707157 |
2e7f2db3-3176-4de7-a00a-6b957e0b1414 | remondrk-old/bezier-curve | src/render.cpp | #include <SDL2/SDL.h>
#include <vector>
#include "curve.hpp"
void drawFillRect(SDL_Renderer *renderer, SDL_Point point, int radius) {
SDL_Rect rect = {point.x - radius, point.y - radius, 2 * radius + 1, 2 * radius + 1};
SDL_RenderFillRect(renderer, &rect);
}
void drawGuideLines(SDL_Renderer *renderer, std::ve... | TOOL | 0.879105 | 5.663296 |
a3a08515-8088-4512-8ca6-dbf0472630db | VatsBhatt11/CF-Problems | N_Sum_of_a_Matrix.cpp | #include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define uint unsigned long long
#define vi vector<int>
#define no cout << "NO\n"
#define yes cout... | ALGO | 0.999866 | 3.122368 |
5887ec1c-f2c9-44ab-a1e1-5aeb7bc30a68 | sahadat-11/Codeforces | 1915/F.cpp | // #include<bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// using namespace std;
// #define ll long long
// template <typename T> using o_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// int main() {
... | ALGO | 0.999866 | 5.31622 |
e57d7f02-842e-4eb2-a37f-6a40ffa7ecb0 | ishandutta2007/codeforces | noam527/normal/1654/E.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ldb;
const int md = 998244353;
const ll inf = 3e18;
const int OO = 1;
using namespace std;
const int N = 100005;
const int K = 444;
int n;
vector<int> a, b;
int attempt1(int add) {
for (int i = 0; i < n; i++)
b[i] = a[i] + add * i;
sort(b.begin()... | ALGO | 0.999781 | 4.333931 |
e8ec2aa6-0cd1-447f-8ac1-8f7ad8500062 | adetaylor/android-frameworks-base-with-remote-control-service | media/libstagefright/codecs/aacdec/pv_sine.cpp | /*
Filename: pv_sine.c
------------------------------------------------------------------------------
REVISION HISTORY
Who: Date: MM/DD/YYYY
Description:
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Int32 x ... | ALGO | 0.99931 | 6.366296 |
ed1aa161-e6e5-44b4-aee0-e29ab79a4754 | AbhishekDhakad/DSA_CPP | linkedlist/linkedlist_reverse.cpp | #include<iostream>
using namespace std;
class node
{
public:
int data;
node *next;
};
void pushbeg(node **head, int num)
{
node *n;
n=new node();
n->data=num;
n->next=*head;
*head=n;
}
node *reverse(node *head)
{
node *p, *c, *n;
p=NULL;
c=n=head;
while(n!=NULL)
{
... | ALGO | 0.99913 | 3.452843 |
31d1a5b2-2b16-41f0-ad63-9219eec8e670 | Tamim0133/DSA_2024 | DSU/dsu_sohag_vai.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 9;
struct DSU
{
vector<int> par, rnk, sz;
int c;
DSU(int n) : par(n + 1), rnk(n + 1, 0), sz(n + 1, 1), c(n)
{
for (int i = 1; i <= n; ++i)
par[i] = i;
}
int find(int i)
{
return (par[i] == i ? i :... | ALGO | 0.999175 | 3.466612 |
3ab38564-7c15-42f4-ae7c-739723d3117e | Hifzu04/dsa_pratice1 | trappedWater.cpp | #include <iostream>
#include <vector>
using namespace std;
int trappedwater(vector<int> height)
{
int n = height.size();
if (n <= 2)
{
return 0;
}
vector<int> left(n, 0), right(n, 0);
left[0] = height[0];
right[n - 1] = height[n - 1];
for (int i = 1; i < n; i++)
{
lef... | ALGO | 0.99998 | 5.679972 |
d8810388-8706-4257-bb02-e0760eb27759 | gun5046/algorithmStudy | 2631.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <utility>
#include <algorithm>
#include <math.h>
#include <string>
#include <cstring>
#include <time.h>
#include <list>
#include <deque>
#include <sstream>
us... | ALGO | 0.999967 | 4.412099 |
d230af80-3cd1-44e7-a9cc-b9913baa9f3c | JasmineHJM/learn_cpp | primer/第一节/12_2.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
//ģ
namespace std {
// һģ͵ľ̬
template<class T, size_t N = 10>
class array {
public:
T& operator[](size_t index){return _array[index];}
const T& operator[](size_t index)const{return _array[index];}
size_t size()c... | ALGO | 0.981859 | 3.014728 |
bbe9d9b7-b3c3-4244-aa0c-3c31513ec461 | wisecashew/suite | Explicit_Solvation/implementations/HAMILTONIAN_GRAVEYARD/appropriately_biased/src/biased.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <array>
#include <map>
#include <utility>
#include <array>
#include <random>
#include <chrono>
#include <getopt.h>
#include <stdlib.h>
#include "classes.h"
#include "misc.h"
// obtained all necessary libraries.
// TO-DO: Check la... | TOOL | 0.973743 | 4.071045 |
f7e5d7ec-480c-400e-9202-dc235b7ca4ad | ayush3445gupta/Leetcode-Striver | 0416-partition-equal-subset-sum/0416-partition-equal-subset-sum.cpp | class Solution {
public:
// bool f(int ind,int sum,vector<int>& nums,vector<vector<int>>&dp){
// // basecase
// if(sum==0)return true;
// if(ind==0)return sum=nums[0];
// if(dp[ind][sum]!=-1)return dp[ind][sum];
// bool notTake=f(ind-1,sum,nums,dp);
// bool Take=false;
// if(nums[ind]<=... | ALGO | 0.999961 | 5.756093 |
d10b6af9-be13-48b5-a9c6-efe286222de4 | ishandutta2007/codeforces | hbfs-/normal/723/E.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#define N 550
#define M 550*550
using namespace std;
inline int read()
{
int s = 0; char c; while((c=getchar())<'0'||c>'9');
do{s=s*10+c-'0';}while((c=getchar())>='0'&&c<='9');
return s;
}
int head[N],cnt = 1;
int n,m,deg[N],vis[N];
struc... | ALGO | 0.999775 | 4.0164 |
2037d78c-d0f7-40c7-bcbb-dad4cc810f76 | ji-sang-geun/BaekJoon_Algorithm | If/14681_location.cpp | #include <iostream>
using namespace std;
int find_four(int X, int Y) {
// xǥ, yǥ ,
int location = (X > 0 ? (Y > 0 ? 1 : 4) : (Y > 0 ? 2 : 3));
return location;
}
int main(void) {
int x = 0, y = 0; // initialize
cin >> x >> y;
cout << find_four(x, y);
return 0;
}
| ALGO | 0.999921 | 3.573575 |
34424651-62e1-46f8-a6ac-936ee4fd9383 | ClementRiu/AdaptativeRanSaCBenchmark | Scripts/src/third_party/eigen/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp | MatrixXd A = MatrixXd::Random(6,6);
cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
EigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;
complex<double> l... | ALGO | 0.998868 | 3.093769 |
10ce07d4-ede2-4f3b-b52f-2931213d0eea | NestZ/competitive-programming | CodeForces/1418A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int t;cin >> t;
while(t--){
ll x, y, k;cin >> x >> y >> k;
ll gainpertrade = x - 1;
ll wantstick = k + (y * k) - 1;
cout << (gainpertrade + wantstick - 1) / gainpertrade + k;
cout... | ALGO | 0.999852 | 3.669726 |
7efb6b9b-ce6b-499f-bfeb-922d13d2f2f4 | Jocastle98/codetree-TILs | 240821/문자열 나누기/divide-string.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
int n;
cin>>n;
string arr[10];
string a ="";
for(int i=0; i<n; i++){
cin>>arr[i];
a+=arr[i];
}
for(int i=0; i<a.length(); i++){
if(i%5==0 and i !=0){
cout<<endl... | ALGO | 0.999453 | 4.62394 |
ae1c8e7b-17d5-441a-a37c-4765eeeb9ba8 | adasegroup/FDS2020_seminars | Week 1/Day 1/session-2-docker/src/voronoi_1.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/vcm_estimate_edges.h>
#include <CGAL/property_map.h>
#include <CGAL/IO/read_off_points.h>
#include <CGAL/IO/read_xyz_points.h>
#include <utility> // defines std::pair
#include <vector>
#include <string>
#include <fstream>
#include <boost/for... | ALGO | 0.998597 | 6.985967 |
a28457ea-f455-4185-93a4-eb07169a3c35 | raghavas201/CodeForces_Self-Practice | F_Two_Arrays.cpp | // ॐ नमः शिवाय
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define nline "\n"
#define all(x) (x).begin(), (x).end()
void solve(){
int n;cin>>n;
vector<int>a(n),b(n);
for(int i=0;i<n;i++)cin>>a[i];
for(int i=0;i... | ALGO | 0.999922 | 3.913551 |
23976e1a-e4b5-4436-87d0-e510dedd691b | Shubham28/USACO | Contests/escape - DEC'11 III.cpp | #include <algorithm>
#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <numeric>
#include <fstream>
#define FOR(A,B,C) for(int A=B;A<C;A++)
#define EFOR(A,B,C) for(int A=B;A<=C;A++)
#define RFOR(A,B,C) for(int A=B;A>=C;A--)
#define MEM(A,B) mem... | ALGO | 0.999707 | 3.371171 |
92b07845-f30d-400d-be74-913183638d11 | gopaltrivedi5502/learnig | sem19.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n,k=1;
cout<<"Enter the size of array : \n";
cin>>n;
int arr[n];
cout<<"enter the element ";
for(int i=0;i<n;i++)
cin>>arr[i];
cout<<"lower triangular matrix is: \n";
for(int i=0;i<n;i++)
{
if(i==k*sqrt(n))
{
for(int j=0;j<k... | ALGO | 0.99978 | 3.008788 |
ccdddf4e-85cc-4bb7-8cdd-bf219d37e436 | 7oSkaaa/LeetCode_DailyChallenge_2023 | 02- February/14- Add Binary/14- Add Binary (Ahmed Hossam).cpp | // Author: Ahmed Hossam
class Solution {
public:
string addBinary(string& a, string& b) {
string sum;
// iterate over the two strings from the end
int i = a.size() - 1, j = b.size() - 1, carry = 0;
// while we have not reached the beginning of the strings
while(~i || ~j){
... | ALGO | 0.999967 | 6.226694 |
76abbac6-9375-4b7d-b9e6-f651560fc66a | sidharthsharma96/CODING | FCP/BC.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
unsigned long long int t,n,coun;
cin>>t;
while(t--)
{
coun=0;
cin>>n;
while(n)
{
coun += n & 1;
n >>= 1;
}
cout<<coun<<endl;
}
return... | ALGO | 0.999715 | 4.16734 |
a0d8af6b-9676-4ff5-bfce-ad5f6441a531 | NathanW-05/Live-Radar | opencv/sources/modules/core/src/lda.cpp | #include "precomp.hpp"
#include <iostream>
#include <map>
#include <set>
namespace cv
{
// Removes duplicate elements in a given vector.
template<typename _Tp>
inline std::vector<_Tp> remove_dups(const std::vector<_Tp>& src) {
typedef typename std::set<_Tp>::const_iterator constSetIterator;
typedef typename s... | ALGO | 0.9994 | 6.108301 |
5cc7bdc2-e9d4-4e34-919f-7517bd8f7830 | gyurim/codingtest | sds_algorithm/day1/3055_탈출.cpp | #include <iostream>
#include <queue>
using namespace std;
char map[51][51];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int r, c;
bool isVisited[51][51] = {false};
queue<pair<int, int>> startQ;
queue<pair<int, int>> waterQ;
pair<int, int> endIdx;
bool oob(int x, int y) {
return x < 0 || y < 0 || x >= r ... | ALGO | 0.999927 | 4.120265 |
b4d42044-661d-44a2-80ab-d70cc996518e | Nishant-Jain-Codes/GeeksforGeeks-solutions | Basic/Exceptionally odd/exceptionally-odd.cpp | //{ Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int getOddOccurrence(int arr[], int n) {
// code here
int ans = 0;
for(int i=0;i<n;i++){
ans = ans^... | ALGO | 0.999781 | 5.620315 |
d38b87e6-a10e-4b4e-9840-f8053754b444 | victorkc/c-code | ejercicios_navidad/variables/variables_bandera/mayor.cpp | #include <stdio.h>
#include <stdlib.h>
// Programa que pregunta 10 números y dice el mayor.
int main(int argc, char *argv[]){
int contador = 2,
num_alto,
candidato;
system("clear");
printf("\n Introduce el número 1: ");
scanf(" %i", &num_alto);
do{
printf("\n Introduce el número %i: ", contador);
... | ALGO | 0.949641 | 3.552005 |
42fb6ebb-d013-4b97-b27a-bcbec8752e5c | mahirkabir/leetcode-solves | random-solves/Spiral Matrix_567108037.cpp | class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
vector<int> ans;
int r = matrix.size();
int c = matrix[0].size();
int cnt = r * c;
int right = c - 1;
int down = r - 1;
int left = 0;
int up = 1;
... | ALGO | 0.999994 | 6.363575 |
7f82d926-a5fc-4806-88fe-2f700846f093 | Dacia04/code_cplusplus | sohoanhao.cpp | #include<iostream>
#include<cmath>
bool check(long long n)
{
if(n<=1) return false;
for(int i=2;i<=sqrt(n);i++)
{
if(n%i == 0) return false;
}
return true;
}
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(0);
std::cout.tie(0);
int t;
std::cin>>t;
while(t--)
{
... | ALGO | 0.999808 | 4.69569 |
d3f8c5ff-6850-4a95-9c9e-6ec9fb3dcb01 | rilato/Baekjoon | cpp/레벨별/Bronze/Bronze3/2490(윷놀이).cpp | #include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int a, b, c, d;
for (int i = 0; i < 3; i++) {
int count = 0;
cin >> a >> b >> c >> d;
if (a == 1)
++count;
if (b == 1)
++count;
if (c == 1)
++count;
if (d == 1)
++count;
... | ALGO | 0.999587 | 4.219058 |
5ca0cb7e-8a92-4f3c-8145-136d21ebf540 | luonginfosec/DSA | WEEK1-2/CONTEST1_Mang_1_Chieu/[Mảng 1 chiều cơ bản]. Bài 13. Tính tổng và tích các phần tử .cpp | // Thoi gian troi qua khong the quay tro lai, LuongVD <3 , AC AC AC PLEASE
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll mod = 1e9 + 7;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
int a[n];
ll tong = 0, tich = 1;
for (int i = 0; ... | ALGO | 0.999904 | 4.27963 |
9f9f9568-b67d-442a-9a05-4ec6efee90ac | Meet91721/Learning_STL | Let's Solve/SegmentTrees/1Basics.cpp | // https://www.pepcoding.com/resources/data-structures-and-algorithms-in-java-interview-prep/segment-tree/max-in-an-interval-range-query-official/ojquestion
#include <bits/stdc++.h>
using namespace std;
void buildTree(int tree[], int arr[], int l, int r, int node)
{
if (l == r)
{
tree[node] = arr[r];... | ALGO | 0.999992 | 5.925946 |
ace12401-7663-47b5-890e-bdd0d6d9932b | ritwizsinha/PROGRAMMING-SOLUTIONS | CODEFORCES-A/372.cpp | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fu... | ALGO | 0.999255 | 3.808494 |
ad12ad4a-9bf0-4b37-9afd-b477caf770c0 | mitesh-200228/DS-Algo-Whole-Chapter | Binary Trees/BottomView.cpp | #include<unordered_set>
#include<stack>
#include<iostream>
#include<vector>
#include<string>
#include<numeric>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<unordered_map>
#include<set>
#include<climits>
#include<cmath>
#include<math.h>
#include<limits>
#define ll long long int
const ll N... | ALGO | 0.999972 | 4.424215 |
55ccbf53-acc1-4538-a49e-bc79976b6dcb | vinayKing6/algorithmFromCPP | solution/Luogu/simple.cpp | //
// Created by vinay on 23-7-24.
//
/**
* 洛谷 入门题
*/
#include <string>
#include <iostream>
namespace SOLUTION{
class P2084{
/**
* 题目描述
今天小明学会了进制转换,比如(10101)2 ,那么它的十进制表示的式子就是 :
1*2^4+0*2^3+1*2^2+0*2^1+1*2^0,
那么请你编程实现,将一个M进制的数N转换成十进制表示的式子。
注意:当... | ALGO | 0.999797 | 5.130696 |
293754ea-14bc-4376-8698-576c962400cc | Jesse-Z/coding-practise | 每日一题/994 orange rotting/orangesRotting.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
// BFS求解,即腐烂橘子到新鲜橘子的最短路径
int ans = 0, fresh = 0;
queue<pair<int, int>> q;
for (int i=0; i<grid.size();++i){
for (int j=0; j<grid[0].size(); ++j)
... | ALGO | 0.999899 | 5.363201 |
0e1c867b-939a-416e-83e0-bb8d49548d80 | sophgo/libsophon | tpu-cpuop/src/cpu_distribute_fpn_proposals_roi_align_concat.cpp | #include "cpu_distribute_fpn_proposals_roi_align_concat.h"
#include <algorithm>
#include <numeric>
#include <cmath>
#include <thread>
#define FLOAT_PTR(p) (reinterpret_cast<float *>(p))
#define INT_PTR(p) (reinterpret_cast<int *>(p))
#define FLOAT(val) (static_cast<float>(val))
#define INT(val) (static_cast<int>(val))
... | DATA | 0.907967 | 5.974275 |
2892155d-2e44-4887-90b3-27422895ee89 | Sapana-Khemkar/dotnet-runtime | src/coreclr/jit/ssabuilder.cpp | #include "jitpch.h"
#include "ssaconfig.h"
#include "ssarenamestate.h"
#include "ssabuilder.h"
namespace
{
/**
* Method that finds a common IDom parent, much like least common ancestor.
*
* @param finger1 A basic block that might share IDom ancestor with finger2.
* @param finger2 A basic block that might share IDo... | ALGO | 0.996546 | 5.664158 |
abd22649-3999-4025-b01a-56a8d2ed21b1 | stephenkid/LeetCode-Sol | C++/101_Symmetric_Tree.cpp | // 101. Symmetric Tree
/**
* Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
*
* For example, this binary tree is symmetric:
*
* 1
* / \
* 2 2
* / \ / \
* 3 4 4 3
* But the following is not:
* 1
* / \
* 2 2
* \ \
* 3 3
... | ALGO | 0.99997 | 6.645211 |
19be9b4f-fd62-4acd-9b0a-e332de888d07 | fedochet/CPP | 3/task1.cpp | /*
Autor - Golishev Roman, 22.09.2014
В очередь могут быть добавлены элементы, каждому
элементу при добавлении присваивается один
из трех уровней приоритета (low, normal, high)
Элементы из очереди извлекаются в соответствии с их
приоритетами (сначала извлекаются элементы с приоритетом high
, потом normal, потом ... | ALGO | 0.982688 | 4.587769 |
b80e2838-e6e6-4e83-b50e-0b7ee4866b32 | Prathibha28/codeforces | Rating_900/1343A - Candies.cpp | #include "bits/stdc++.h"
using namespace std;
int main(){
long long t;
cin>>t;
long long n;
while(t--){
cin>>n;
int x=3;
while(n%x!=0){
x=2*x+1;
}
cout<<n/x<<endl;
}
}
| ALGO | 0.999939 | 4.302481 |
011887a9-b35c-4c0d-a5ef-2e4091ff0eb5 | Aethereux/Hikari-LLVM19 | libcxx/test/libcxx/fuzzing/unique_copy.pass.cpp | // UNSUPPORTED: c++03, c++11
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <vector>
#include "fuzz.h"
extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) {
std::vector<std::uint8_t> working(data, data + size);
std::sort(working.begin(), ... | TEST | 0.975305 | 5.984567 |
3bdb7dd7-0809-4a2c-8219-19ad16ff1351 | tangziyi001/competitive-programming | Watchman.cpp | /*
* Codeforces 650A
* Created by Ziyi Tang
*
*/
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <stack>
#includ... | ALGO | 0.999841 | 3.491711 |
fb611c51-a48a-428b-8a17-82c46e8e7be5 | SnoopyCodes/code | gold/shortestpath/commuteagain.cpp | #include <bits/stdc++.h>
#define vec vector
#define long int64_t
using namespace std;
int N, S, T;
vec<vec<array<int, 2>>> rails;
vec<long> cost, ucost, vcost;
void dijkstra(int source) {
cost.clear(); cost.resize(N, 1e18);
cost[source] = 0;
auto cmp = [&](int u, int v) {
return cost[u] != cost[v] ? cost[u] <... | ALGO | 0.999891 | 5.218378 |
231dde3e-1d39-4bbb-92ea-b69b2d3afcee | ishandutta2007/codeforces | zhukov_dmitry/normal/128/C.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define bublic public
#define clr(x) memset((... | ALGO | 0.999982 | 4.052949 |
a833da76-4276-468e-b5a7-fc1558e7eba5 | kirtijha014/Data-Structures-Algorithms | Dynamic Programming/LCS_Recursive.cpp | #include<iostream>
#include<string>
using namespace std;
int LongestCommonSubSequence(string x, string y, int n, int m)
{
if(n == 0 || m == 0)
return 0;
if(x[n-1] == y[m-1])
{
return 1 + LongestCommonSubSequence(x,y,n-1,m-1);
}
else
{
return max(LongestCommonSubSequence(x,y,n... | ALGO | 0.999912 | 4.337207 |
367ce7ee-46ab-4618-bf32-bd85d3fb0233 | serenitylc/leetcode | NowCoder/PrintMinNumber.cpp | class Solution {
public:
string PrintMinNumber(vector<int> numbers) {
string res = "";
sort(numbers.begin(), numbers.end(), [&](int& a, int& b) {
string s1 = to_string(a);
string s2 = to_string(b);
return s1+s2 < s2+s1;
});
for (int & num : numbers... | ALGO | 0.999871 | 6.318836 |
32fe34f2-0804-4cbe-a79e-f42ab86e57d8 | udowallasch/comcave | Task_15_2/Task_15_2.cpp | // Task_15_2.cpp : Diese Datei enthält die Funktion "main". Hier beginnt und endet die Ausführung des Programms.
//
#include "pch.h"
#include <iostream>
using namespace std;
int f(int x, int y) {
int temp = x;
int* sum;
sum = &x;
x += y;
cout << "summe = " << sum << endl;
int *prod;
prod = &y;
y = temp * y;
... | ALGO | 0.94839 | 3.714562 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.