uuid
stringlengths
36
36
repo_name
stringlengths
5
123
relative_path
stringlengths
5
4k
content
stringlengths
33
2.85M
category
stringclasses
6 values
algo_rel_score
float64
0.85
1
quality_score
float64
3
8.76
aebd2059-a0a4-44f7-bfb6-2760d3d30c25
Lanze1507/Estructuras
Ejercicio2.cpp
#include <iostream> #include "Ejercicio2.h" using namespace std; //Ejercicio 2 void verificarParidad() { int num; cout << "Ingrese un numero: "; cin >> num; if (num % 2 == 0) cout << "El numero es par." << endl; else cout << "El numero es impar." << endl; } int main() { int opcion; do { ...
ALGO
0.949587
4.126236
2c3f96a5-c4ff-4a89-8815-a93ea52c42bf
amstudnet/itsa
ncpc/2019/first/pc.cpp
#include <iostream> #include <cstring> #define maxn 10000000 long long ans[maxn]; using namespace std; int main() { //cin.tie(0); //ios::sync_with_stdio(0); int t; cin>>t; while(t--){ memset(ans,0,sizeof(ans)); int l,n; cin>>l>>n; ...
ALGO
0.999855
3.607047
9da54c4d-1b13-4243-bd1e-ac9fafb313a2
AkshayRamakrishnann/oneAPI_With_SYCL
Libraries/oneMKL/guided_cuBLAS_examples_SYCL_Migration/01_sycl_dpct_output/Level-3/cublas_syrk_example.dp.cpp
#include <sycl/sycl.hpp> #include <dpct/dpct.hpp> #include <cstdio> #include <cstdlib> #include <vector> #include <oneapi/mkl.hpp> #include <dpct/blas_utils.hpp> #include "cublas_utils.h" using data_type = double; int main(int argc, char *argv[]) try { dpct::device_ext &dev_ct1 = dpct::get_current_device(); ...
ALGO
0.998586
4.528792
54be7e10-d4ee-41d6-911a-574561d0f0ca
AigaGoto/AtCoders
BiginnerContest/232/C.cpp
#include <iostream> #include <string> #include <vector> #include <math.h> #include <set> #include <map> #include <queue> #include <algorithm> // #include <atcoder/all> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int M, N; cin >> N >> M; int T[N][N], A[N][N]; ...
ALGO
0.999995
4.365827
f70f75d4-0370-4063-8e58-34fb803ead1b
big-quantum/all_code
code/coin.cpp
#include<bits/stdc++.h> using namespace std; int n[1005],i; void coin(int a) { int b=0,sum=0; for(int i=1;i>=1;i++){ for(int j=1;j<=i;j++){ b=b+1; sum=sum+i; if(b>=a) break; } if(b>=a) break; } cout<<sum<<endl;; } int main(){ do { i++; cin>>n[i]; } while(n[i]!=0); for(int j=1;j<i;j++){ coin(...
ALGO
0.999362
3.616799
e27324b8-a930-4e0c-83d9-cbbe7dd00658
zarif-ahnaf/CSE-2212
Day 7/Home Work/2.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 1005; struct Point { int x, y; Point() {} Point(int x, int y) : x(x), y(y) {} }; int par[MAXN]; int findrep(int r) { if (par[r] == r) return r; return par[r] = findrep(par[r]); } void Union(int a, int b) { int u = findrep(a); ...
ALGO
0.999943
4.656586
a3bd6648-ae53-4998-858e-5e3e564db265
TigranAbrahamyan/tigran_abrahamyan
cpp/day03/6_factorial.cpp
#include <iostream> using namespace std; int factorial(int n) { if (n == 1) { return n; } return n * factorial(n - 1); } int main() { int number = 0; cout << "Write a number: "; cin >> number; if (number > 0) { int numberFactorial = factorial(number); cout << "Factorial: " << numberFacto...
ALGO
0.999739
5.817121
66d2602e-1bf4-4398-be4c-8d8935f9da52
kks227/BOJ
6100/6131.cpp
#include <cstdio> using namespace std; int main(){ int N, cnt = 0; scanf("%d", &N); for(int i=1; i<=500; i++) for(int j=1; j<=i; j++) if(i*i == j*j+N) cnt++; printf("%d\n", cnt); }
ALGO
0.999478
3.027845
ab0b94b3-f139-4613-a99d-053df31992e6
zetaglest/zetaglest-source
source/shared_lib/sources/streflop/libm/flt-32/e_acoshf.cpp
/* See the import.pl script for potential modifications */ /* e_acoshf.c -- Simple version of e_acosh.c. * Conversion to Simple by Ian Lance Taylor, Cygnus Support, <EMAIL>. */ #if defined(LIBM_SCCS) && !defined(lint) static char rcsid[] = "$NetBSD: e_acoshf.c,v 1.5f 1995/05/12 04:57:20 jtc Exp $"; #endif #include ...
ALGO
0.979063
5.251889
5f69ab7f-123b-4fc7-a7a1-df8e28d816c5
yzzupgo/MFTCG
Data/abc136_b/utakata/ac/6716009.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n,m=0,N;cin>>n; N=n; while(N>0){ N/=10; m+=1; } if(m==1)cout<<n<<endl; if(m==2)cout<<9<<endl; if(m==3)cout<<n-90<<endl; if(m==4)cout<<909<<endl; if(m==5)cout<<n-9090<<endl; if(m==6)cout<<90909<<endl; }
ALGO
0.999846
3.788743
76caadb4-a5d0-4b3a-b4a1-5b4b6866b3a5
Hiyabye/Baekjoon
15xxx/15719.cpp
#include <iostream> using namespace std; void solve(void) { long long n; cin >> n; long long ans = (1 - n) * n / 2; while (n--) { int x; cin >> x; ans += x; } cout << ans; } int main(void) { ios::sync_with_stdio(false); cin.tie(nullptr); solve(); return 0; }
ALGO
0.999788
3.735398
0d1d575b-b598-42a7-b51a-d24152917c75
Modding-Zaibatsu/ue4-tekkengame
Engine/Source/ThirdParty/PhysX/PhysX-3.3/Source/LowLevel/software/src/PxsConstraintPartition.cpp
#include "PxsConstraintPartition.h" #include "PxcSolverConstraintTypes.h" #define INTERLEAVE_SELF_CONSTRAINTS 1 // todo: unify with PxcDynamics.cpp #define SPU_CONSTRAINT_PARTITIONING 1 using namespace physx; PX_FORCE_INLINE PxU32 getArticulationIndex(const uintptr_t eaFsData, const uintptr_t* eas, const PxU32 numEa...
ALGO
0.924292
5.793074
9c69a84c-1eae-4ddb-85a0-7d7ea17c04d5
sachinsngh165/Competitive-Programing
codechef/DIVNINE.cpp
#include<iostream> #include<string.h> #define endl '\n' #define ll unsigned long int using namespace std; int main() { ios::sync_with_stdio(false); int t; cin>>t; for (int i = 0; i < t; ++i) { char num[1000000]; cin>>num; int len=strlen(num),sum=0; for (ll j = 0; j < len; ++j) sum+=(int)(num[j]-48); ...
ALGO
0.999957
4.024075
4f3104df-31f7-4b39-ba55-0a83461f824c
Andreas-Burkhalter-Lab/am_funcs
archive/holy_lab_multielectrode_funcs/holylab/Statistics/critical_neighborhoods/cn_filter_boxcar.cpp
#include "mex.h" #include "PointServerFilter1d.h" #include "AccumulatorMoments.h" #include "CriticalNeighborhoodBase.h" #include "MatlabIO.h" using namespace Eigen; // See cn_filter.m for the syntax // This performs the actual filtering computation. It's templated so that we can call it for the whole zoo of possibil...
ALGO
0.999651
5.845924
cf670eee-bc5b-4179-a8dc-43f9c9563834
AdarshSharadPandey/100DaysOfCodeChallenge
Day 25/MaximumDepthNaryTree(lcEasy).cpp
int maxDepth(Node* root) { if(!root) return 0; int maxi = INT_MIN; for(Node* it: root->children) maxi = max(maxi,maxDepth(it)); if(maxi==INT_MIN) return 1; return maxi+1; }
ALGO
0.998534
5.534798
9de798dd-13cd-4754-8529-cf48dc5fc90f
MarcCruzs/CS3700
lab02/minmax/minmax.cpp
#include "mpi.h" #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> #include <climits> #define ARRAY_SIZE 1000000 int main (int argc, char *argv[]) { int myid, numprocs; int namelen; int* numbers = new int[ARRAY_SIZE]; char processor_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(&argc, ...
ALGO
0.999951
4.529545
1f112108-eb8b-4a4f-912c-5696f9428dbf
JongSinister/LeetCode4Fun
Template/AlgorithmC++/divideconquer/merge_sort.cpp
#include <bits/stdc++.h> using namespace std; void merge(vector<int> &v,vector<int> &tmp,int left,int right,int mid){ int bi = left; //index of B int ci = mid+1; //index of C for (int i = left; i<= right;i++) { if (ci > right) { tmp[i] = v[bi++]; continue; } if (bi > mid) { ...
ALGO
0.999921
4.41441
afafa03b-d553-44c5-b3e9-34622db4caad
nishgpt/competitive_programming
codeforces/653_div3/D.cpp
/* Author : Nishant Gupta 2.0 */ #include<bits/stdc++.h> using namespace std; #define LL long long int #define getcx getchar_unlocked #define X first #define Y second #define PB push_back #define MP make_pair #define MAX 100005 #define LOG_MAX 20 #define MOD 1000000007 #define INF 0x3f3f3f3f #define INFL (LL(1e18)...
ALGO
0.999726
3.44587
c8e3ba66-b981-43ff-86c6-086984462b24
Divyanshu9794/cpp_practice
A. Bear and Big Brother.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; int c=0; while(a<=b){ a=a*3; b=b*2; c++; } cout<<(c)<<endl; }
ALGO
0.999876
3.87737
1619c491-40b5-4412-9b13-0b2c76226293
Arkaenaz/GDPARCM
Shared/OpenCV/sources/modules/dnn/src/layers/reduce_layer.cpp
#include "../precomp.hpp" #include <opencv2/dnn/shape_utils.hpp> namespace cv { namespace dnn { class ReduceLayerImpl CV_FINAL : public ReduceLayer { public: ReduceLayerImpl(const LayerParams& params) { setParamsFrom(params); // set reduce type CV_Assert(params.has("reduce")); Str...
TOOL
0.855781
7.470252
5d90631a-4a73-458c-bed8-60eae3763cbb
lukasstockner/blender
extern/bullet2/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp
#include "btDefaultCollisionConfiguration.h" #include "BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h" #include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h" #include "BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h" #include "BulletCollision/CollisionDispatch/btCom...
TOOL
0.927433
6.727683
f97c2aa3-921c-47bf-97d8-291a7c25de35
nocotan/algorithms
atcoder/Cpp/ARC/098/D.cpp
#include <bits/stdc++.h> using namespace std; int dl[]{0, 1}; int dr[]{-1, 0}; set<pair<int, int>> memo; signed main() { int n; cin >> n; vector<int> A(n); vector<int> SUM(n); vector<int> XORSUM(n); for(int i=0; i<n; ++i) cin >> A[i]; SUM[0] = A[0]; XORSUM[0] = A[0]; for(int i=1; i<n; ++i) { S...
ALGO
0.999978
4.656972
3bb59020-2c02-460f-ac6a-aba4fa44ec7a
PrachurGupta/APLab3
Lab2/Ex2.cpp
#include <bits/stdc++.h> using namespace std; class AvlTree{ public: int data; AvlTree *left; AvlTree *right; int height; AvlTree() { data = 0; left = nullptr; right = nullptr; height = 0; } AvlTree(int val) { dat...
ALGO
0.999983
5.139295
08852367-2499-4863-bccb-e13e27cf7b48
lc19890306/routing
routing_protocol_checking/src/weight.cpp
#include "weight.h" unsigned weight(const Path<int> &path) { unsigned s = path.head(); unsigned t = path.rear(); int w = 0; int i = 0; int size = 0; if (path.empty()) w = Graph::matrix[s][t]; else { size = path.size(); for (i = 0; i < size - 1; ++i) { w += Graph::matrix[path[i]][path[...
ALGO
0.999098
3.867978
70078f47-63f5-4950-acfe-edf1c8a2e08e
Masters-Akt/CS_codes
leetcode_sol/122-Best_Time_To_Buy_And_Sell_Stock_II.cpp
class Solution { public: int maxProfit(vector<int>& prices) { int sum=0; for(int i=1;i<prices.size();i++){ if(prices[i]>prices[i-1]) sum+=(prices[i]-prices[i-1]); } return sum; } };
ALGO
0.99897
5.96882
46bfeb41-1abc-4d1b-9f0d-d40fcbd3260c
stack-queue-coder/CP-DSA
conversion.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define fast ios_base::sync_with_stdio(false); cin.tie(NULL); void solve(){ } int strtoint(string s){ int n = s[0] - '0'; for(int i=1 ; i<s.size(); i++){ if(s[i] == ' '){ return n; } n = n*10 + int(s[i] - '0'); } return n; } int main(){ /...
ALGO
0.998655
3.638784
769bb7d5-c3fd-4065-84d0-2c7580ab8e39
GYPpro/ACM
1_Exercise/Daily_8/t.cpp
#include<bits/stdc++.h> using namespace std; const int N=3e5+100; #define ll long long #define int long long double p=acos(-1.0); void solve(){ int n; // scanf("%lld",&n); cin >> n; double ans = 0; if(n%2==0){ ans=(1.0/tan(p/(2*n))); } else{ ans=2*sin((3*p)/(4*n)); } // printf("%.12lf\n",ans); cout...
ALGO
0.998669
4.413311
1ec68136-c073-41a0-896f-3b7abcdb1451
chandreshkulshrestha/cpp-programs
patten questions/pattern7.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; int i = 1; while (i <= n) { int j = 1; int value = i; while (j <= i) { cout << value; value = value + 1; j = j + 1; } cout << endl; i ...
ALGO
0.999956
4.149249
7df66a87-6a26-4d70-8652-af6b333fd776
LidorPrototype/TicTacToesCollection
C++/TicTacToe/C++TicTacToe_Issue_1/C++TicTacToe_Issue_1.cpp
#include <iostream> using namespace std; char square[10] = {'0','1','2','3','4','5','6','7','8','9'}; int score1 = 0, score2 = 0; int checkwin(); void board(); void showFinalResult(); int main() { int player = 1, i = -1; char mark, choice; while (i == -1) { do { board(); player = (player % 2) ? 1 : 2; ...
ALGO
0.999868
4.846889
cb80a63b-df92-4b92-9d1d-f6b9236707a4
MoRongsi/myhelloAigo
codes/cpp/chapter_tree/avl_tree.cpp
/** * File: avl_tree.cpp * Created Time: 2023-02-03 * Author: what-is-me (<EMAIL>) */ #include "../utils/common.hpp" /* AVL 树 */ class AVLTree { private: /* 更新节点高度 */ void updateHeight(TreeNode *node) { // 节点高度等于最高子树高度 + 1 node->height = max(height(node->left), height(node->right)) + 1; ...
ALGO
0.999198
6.090318
eaace1ef-3290-42fe-8727-a1015301920b
MOHIT-IITP/Leetcode
3217.cpp
#include<bits/stdc++.h> using namespace std; // not able to iterate throughout the linked list ListNode* modifiedList(vector<int> & nums, ListNode* head){ ListNode* dummy = new Listnode(); ListNode* mover = dummy; ListNode* temp = head; set<int> s; for(auto it: nums){ s.insert(it); } while(temp){ ...
ALGO
0.999957
4.829173
f542a6fa-ac42-4997-bf34-5b0b9b308114
Arunm619/InterviewBit
2.Arrays/ValueRanges/MergeIntervals.cpp
#include <iostream> #include <vector> #include <set> #include <stack> using namespace std; /* 3.Merge Intervals 4.Merge Overlapping Intervals 5.N/3 Repeat Numbers. 6.Simple Queries. */ struct Interval { int start; int end; Interval() : start(0), end(0) {} Interval(int s, int e) : start(s), end...
ALGO
0.999657
5.912171
f44cae3f-8b5c-444a-8bb0-8bd33454df24
Bharath7095/OwlCoder
Count the nodes at distance K from leaf.cpp
class Solution { public: void traverse(Node *root,map<Node*,int>&mp,int c,int k,vector<Node*>&vt){ if(root==NULL) return; vt.push_back(root); if(root->left==NULL and root->right==NULL){ if(c-k>=0) mp[vt[c-k]]++; } traverse(root->left,mp,c+1,k,vt); trav...
ALGO
0.999944
5.750993
664c03c5-7be7-4d01-ae0e-c42fa7fdbe25
SwapnanilHalder/CodingFiles
CSES/2165_tower_of_hanoi.cpp
#include <bits/stdc++.h> #define SPEED1 ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL) #define int long long int #define For(i, a, b) for(int i=a; i<b; i++) #define pl(x) cout << x << endl #define endl '\n' using namespace std; void hanoi(int stack, int curr_pos, int final_pos) { if(stack == 1) { ...
ALGO
0.999923
4.276263
65665b41-72b6-4d12-8af2-806cf0dec7c5
bossxu/acm
比赛/队内赛/额外/a.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<string> #include<algorithm> #include<queue> #include<stack> #include<vector> #include<cmath> #include<set> #include<cstdlib> #include<functional> #include<climits> #include<cctype> #include<iomanip> using namespace std; typedef long long ll; #define INF 0x3...
ALGO
0.999961
4.193556
0c4a17d4-c843-4215-bc90-24fac7d264e4
PolarNight-Dawn/LeetCode_Code
代码随想录/栈与队列/232_MyQueue.cpp
#include <iostream> #include <stack> // // Created by polarnight on 23-9-22, 下午9:07. // class MyQueue { public: MyQueue() { } void push(int x) { stack_in.push(x); } int pop() { if (stack_out.empty()) { while (!stack_in.empty()) { int tmp = stack_in.to...
ALGO
0.99749
5.044656
650cf47a-0ff3-475c-9db9-b702b7d5578b
PrathamSherawat/375-Placement-questions
8.cpp
// Best time to Buy and Sell Stock #include <iostream> using namespace std; int maxProfit(int prices[], int n) { int buy = prices[0], max_profit = 0; for (int i = 1; i < n; i++) { if (buy > prices[i]) buy = prices[i]; else if (prices[i] - buy > max_profit) max_profit...
ALGO
0.999405
5.859179
ee7ac3c1-2c9e-4bc5-a288-65af7b142ab4
pengcuo/armnn-android
boost/boost_1_64_0/libs/numeric/ublas/doc/samples/mapped_matrix.cpp
#include <boost/numeric/ublas/matrix_sparse.hpp> #include <boost/numeric/ublas/io.hpp> int main () { using namespace boost::numeric::ublas; mapped_matrix<double> m (3, 3, 3 * 3); for (unsigned i = 0; i < m.size1 (); ++ i) for (unsigned j = 0; j < m.size2 (); ++ j) m (i, j) = 3 * i + j; ...
ALGO
0.896172
3.261972
8cd1b964-b66d-42bf-a3fa-f31a52ce9e69
ishandutta2007/codeforces
aid/normal/1609/D.cpp
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> using namespace std; typedef long double ld; #ifdef DEBUG #define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr) #else #define eprintf(...) ; #endif #define sz(x) ((int) (x).size()) #define TASK "text" const int inf = (int) 1.01e9; con...
ALGO
0.999978
4.026649
50187263-80f5-4c57-ab66-09f9a08f492a
agarwal002/GlobalTrend_Programming_Assessment
Q3.cpp
#include <iostream> #include <climits> struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; class Solution { public: int maxPathSum(TreeNode* root) { int maxSum = INT_MIN; maxPathSumHelper(root, maxSum); r...
ALGO
0.999981
6.40816
28ecd933-0eee-4189-b9cf-0828d424a9f0
neohacker18/striver-sde-sheet
Medium/Child sum property.cpp
// Link to the problem:https://www.codingninjas.com/codestudio/problems/childrensumproperty_790723?topList=striver-sde-sheet-problems&utm_source=striver&utm_medium=website&leftPanelTab=0 void solve(BinaryTreeNode<int>* &root) { if(!root) return; int child=0; int l=root->left!=NULL?child+=root->left...
ALGO
0.999986
5.528777
2d4a0008-25e7-4015-b4ef-daaf1ac6dc4f
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_5488_2.cpp
#include <bits/stdc++.h> using namespace std; struct zfc { char a[101]; int la; } a[101]; bool cmp(zfc a, zfc b) { return a.la < b.la; } bool cha(zfc a, zfc b) { int flag; for (int i = 0; i <= b.la - a.la; i++) { flag = 0; for (int j = 0; j < a.la; j++) if (a.a[j] != b.a[j + i]) { flag = 1...
ALGO
0.999994
3.16387
1231ca29-df44-4b32-bb10-6a8a64b88d1f
MaximusDraganoid/machi_algo_repo
main.cpp
#include <iostream> #include "headers/math_func.h" #include "tests/headers/burnikel_zigler_test.h" #include "headers/util_function.h" //access_token git - //<GITHUB_TOKEN> //числа записаны в обратном порядке. Т.е. числов 123 в массиве будет представлено // как [3, 2, 1]. void test(); void testMultiplyLenByShort(); v...
TEST
0.904918
3.430219
cba48f59-a76e-49af-978f-4c0d3f6b239e
ssbadjate02/Competetive-Programming
C_Where_is_the_Pizza.cpp
#include<bits/stdc++.h> using namespace std; #define ll int #define pb push_back #define FASTIO ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL) #define all(x) (x).begin(),(x).end() #define ss second #define ff first template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;} template<typename ...
ALGO
0.999914
3.904216
2103b5fd-7d80-42ba-890e-e5f84ad208cb
ishandutta2007/codeforces
unstoppablechillmachine/normal/962/D.cpp
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> //#pragma GCC optimize("O3") //#pragma GCC optimize ("Ofast,no-stack-protector") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx") //#pragma GCC target("avx,tune=native") using namespace std; //usi...
ALGO
0.99995
3.511914
d33da32b-a2a9-4d51-80c6-136630140b87
LeeJunjae1/DLIP_22000573
include/Hough_line_22000573_JunjaeLee.cpp
#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" using namespace cv; using namespace std; int main(int argc, char** argv) { // Declare the output variables Mat dst, cdst, cdstP, canny, src; // Loads an image // const char* filename = "Lane_center.JPG"; const char* fil...
ALGO
0.983927
5.596314
203697d3-1901-473d-9669-ba80b5a99365
tasnim-zeba/Problem-Solving
Codeforces/1936A.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; bool cmp(int x, int y) { cout<<"? "<<x<<" "<<x<<" "<<y<<" "<<y<<endl; char ch; cin>>ch; if(ch=='<') { return true; } else{ return false; } } int main() { int t; cin>>t; while(t--) { ...
ALGO
0.999809
3.165915
0312c15a-03ed-4264-8cf2-97e0b29c0265
SharifAIChallenge/AIC20-Client-Cpp
client/src/AI/AI.cpp
#include <stdlib.h> #include <iostream> #include "AI.h" #include <cstdlib> using namespace std; //Some global variable(s) to access in different turns: int pathIDForMyUnits; //CAUTION: NEVER DEFINE POINTERS IN THE GLOBAL VARIABLES (BECAUSE // THE MEMORY OF "World *world" GETS FREED AT THE END OF EVERY TURN // AND AS...
ALGO
0.871121
3.526243
e2f3fe91-209c-4906-aaee-51a440f3b081
igaspard/LeetCode
1178_NumberofValidWordsforEachPuzzle.cpp
class Solution { public: vector<int> findNumOfValidWords(vector<string>& words, vector<string>& puzzles) { unordered_map<int, int> dicts; for (auto w : words) ++dicts[bitmask(w)]; vector<int> ans; for (auto p : puzzles) { int firstChar = 1 << (p[0] - 'a'); ...
ALGO
0.999903
6.358624
593a438d-b100-47f1-8260-9bb9bc33a8bf
metridia/LIGGGHTS_B
LIGGGHTS-PUBLIC-master/src/USER-CUDA/neighbor_cuda.cpp
#include "math.h" #include "neighbor_cuda.h" #include "cuda.h" #include "atom.h" #include "atom_vec.h" #include "domain.h" #include "neigh_list.h" #include "neigh_request.h" #include "force.h" #include "group.h" #include "memory.h" #include "error.h" using namespace LAMMPS_NS; enum{NSQ,BIN,MULTI}; // also in neig...
ALGO
0.997552
6.761625
9973b45f-6a5d-4206-be2d-beff31cd7365
iChauster/competitive_programming
2020/cf86/a.cpp
//#include "../../cpp/config/bits/stdc++.h" #include <bits/stdc++.h> using namespace std; void solve() { long long x; long long y; cin >> x >> y; long long a; long long b; cin >> a >> b; if (b > 2*a) printf("%lld\n", a * (x + y)); else printf("%lld\n", (max(x,y) - min(x,y)) * a ...
ALGO
0.998428
3.662562
eb716101-9263-40d1-9887-14b2591a1f97
ishandutta2007/codeforces
hyperbolic/normal/1520/D.cpp
#include <stdio.h> #include <algorithm> #include <map> int x[200010]; std::map<int,int> M; int main() { int T; scanf("%d",&T); while(T--) { M.clear(); int a; scanf("%d",&a); for(int i=1;i<=a;i++) scanf("%d",&x[i]); for(int i=1;i<=a;i++) x[i] -= i; for(int i=1;i<=a;i++) M[x[i]]++; long long int an...
ALGO
0.999861
3.617458
aa28285d-fdb5-471e-b59b-ad7e0aec79d1
charles-pku-2013/CodeRes_Cpp
Google_OJ/Practice_Round_China_New_Grad_Test_2014/A_Bad_Horse/BadHorse.cpp
// validation of bipartite graph by BFS dyeing 用广度优先搜索解决着色问题 #define _FILE_DEBUG_ //#define _C_LAN_ //#define _DEBUG_OUTPUT_ #ifdef _FILE_DEBUG_ #include <fstream> #endif #include <iostream> #include <stdio.h> using namespace std; #include <string> #include <vector> #include <map> #include <stack> #include <algorithm>...
ALGO
0.999898
5.108086
1fa37d56-92ea-4696-af1f-35bef86532a6
denis-gubar/Leetcode
Depth-first Search/0129. Sum Root to Leaf Numbers.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: int sumNumbers(TreeNode* root, int prefix = 0) { if (!root) return 0; if (!root->left && !r...
ALGO
0.99997
6.460093
c4248d30-8250-4052-845c-d7c32fab3d73
Iwakura9/Estudos-ICPC
Exercicios/Maratona/Simulados/GEPC/socks.cpp
#include <bits/stdc++.h> using namespace std; stack<int> pilha1, pilha2; int main(){ int n, cont = 0; cin >> n; for(int i=0, a; i < 2*n; ++i){ cin >> a; pilha1.push(a); } while(pilha1.size() > 0){ if(pilha2.size() <= 0){ pilha2.push(pilha1.top()); pilha1.pop(); cont++; } if(pilha1.top() == pi...
ALGO
0.999946
3.660364
2ca4f678-68c0-4994-868f-0f17a1405c1b
jeanchilger/competitive-programming
uri-problems/Strings/1237.cpp
#include <iostream> #include <string> #include <vector> using namespace std; vector<vector<int> > cache; string a; string b; int lcs (int pa, int pb) { int currBiggest = -999; // current lcs for (int i = 0; i < pa; i++) { for (int j = 0; j < pb; j++) { if (a[i] == b[j]) { ...
ALGO
0.999783
4.293744
be303b47-8fc5-4b0d-a7e4-ac245cf0dfee
WuzhouDu/LeetCode-Practice-from-Scratch
Binary-Tree/binary-tree-inorder-traversal/binary-tree-inorder-traversal.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.99998
6.745262
d67cd419-5cbe-4727-a946-7537bf6a2254
ishandutta2007/codeforces
heltion/normal/1554/A.cpp
#include <bits/stdc++.h> using namespace std; using LL = long long; int main(){ cin.tie(nullptr)->sync_with_stdio(false); cout << fixed << setprecision(20); int t; for (cin >> t; t; t -= 1) { int n; cin >> n; vector<LL> a(n); for (LL& x : a) cin >> x; LL ans = 0; ...
ALGO
0.999914
4.201054
df48d1fd-66bf-4c41-bab4-7989c93cb313
FALL1N1/My-WoDCore-6.x.x
src/server/collision/BoundingIntervalHierarchy.cpp
#include "BoundingIntervalHierarchy.h" #ifdef _MSC_VER #define isnan _isnan #else #define isnan std::isnan #endif void BIH::buildHierarchy(std::vector<uint32> &tempTree, buildData &dat, BuildStats &stats) { // create space for the first node tempTree.push_back(uint32(3 << 30)); // dummy leaf tempTree....
ALGO
0.984797
5.884527
ce93c9ef-a2c5-4bcb-a922-f833cc77d713
sooobus/wazuhl-gym
lib/Support/TrigramIndex.cpp
#include "llvm/Support/TrigramIndex.h" #include "llvm/ADT/SmallVector.h" #include <unordered_map> #include <set> #include <string> using namespace llvm; static const char RegexAdvancedMetachars[] = "()^$|+?[]\\{}"; static bool isAdvancedMetachar(unsigned Char) { return strchr(RegexAdvancedMetachars, Char) != null...
ALGO
0.908557
7.181519
e3b50735-af60-4ce5-8692-11fe6a466041
sunstick/code-street
leetcode/maximum_subarray.cpp
/* Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the contiguous subarray [4,−1,2,1] has the largest sum = 6. More practice: If you have figured out the O(n) solution, try coding another solution using the ...
ALGO
0.999955
6.232968
db3719fe-ed8b-459d-99db-430e8cad2446
sarvex/leetcode-boo
solution/0900-0999/0927.Three Equal Parts/Solution.cpp
class Solution { public: vector<int> threeEqualParts(vector<int>& arr) { int n = arr.size(); int cnt = accumulate(arr.begin(), arr.end(), 0); if (cnt % 3) return {-1, -1}; if (!cnt) return {0, n - 1}; cnt /= 3; auto find = [&](int x) { int s = 0; ...
ALGO
0.999959
5.587402
8742fb03-db39-4d68-9cce-474835d0126e
Sagarpatil1206/All_cpp_codes
stackUsingLinkedList.cpp
#include<iostream> using namespace std; //stack using linked list template <class T> struct node{//we have created the structure of node T data;//data node *next;//next pointer }; template<class T> class stack_LL{ node<T> *top;//private public: stack_LL();//constructor node<T> *getNode(int);/...
ALGO
0.999224
4.301865
e0747591-ab5b-4458-a1b9-c2073f1faa8c
sarvex/leetcode-ruby
solution/0500-0599/0535.Encode and Decode TinyURL/Solution.cpp
class Solution { public: // Encodes a URL to a shortened URL. string encode(string longUrl) { string v = to_string(++idx); m[v] = longUrl; return domain + v; } // Decodes a shortened URL to its original URL. string decode(string shortUrl) { int i = shortUrl.rfind('/'...
ALGO
0.996955
6.425267
89323739-35c1-48ce-9aa8-e892479ed9ed
sandsoftimes/CL2001-LAB_data-structures-REPEAT-updated-version
labtasks/Lab 9/786.cpp
#include<iostream> using namespace std; class Queue{ private: int *arr; int front; int rear; int size; int noofelements; public: Queue(int s){ arr=new int[s]; size=s; front=0; rear=-1; noofelements=0; } void enqueue(int val){ if(isF...
ALGO
0.999355
3.95446
183f72fe-7467-4e3b-8f57-089699396ae8
giuseppegranatiero/CP-competitive-programming-training
Olinfo/easy1.cpp
#include <iostream> #include <cassert> using namespace std; int main(){ assert(freopen("input.txt", "r", stdin)!=NULL); assert(freopen("output.txt", "w", stdout)!=NULL); int N, max, S; cin >> N; max = -1000; for (int x=0; x<N; x++){ cin >> S; if (S>max) max=S; } cout << max; return 0; }
ALGO
0.998704
3.562344
42ad9956-d10a-4c7d-a6cb-9c2a886d2946
fregu856/cpp
geeksforgeeks/linkedlists_2.cpp
#include <iostream> struct Node { int data; Node *next; }; void listAppend(int value, Node *&head) { Node *new_node = new Node; new_node->data = value; new_node->next = NULL; if (head == NULL) { head = new_node; return; } Node *ptr = new Node; ptr = head; ...
ALGO
0.999865
5.192888
fda035cc-d178-4dd4-ba63-db6501e7985d
psg-19/cp
lvl2/concepts/BIT_MANIPULATION/bit-masking.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define forn(x,n) for(ll i=x;i<n;i++) const int N=1e6+10; int power(int a,int b){ if(b==1){ return a; } int half_pow=power(a,b/2); if(b%2==0) return half_pow*half_pow; else return half_pow*half_pow*a; } int main(){ vector<ll> v...
ALGO
0.999735
3.575341
fe53247a-10e6-4f17-9ca6-3f8afb93dbb9
drkspace/Advent-of-Code-2024
day20.cpp
#include <ranges> #include <vector> #include <string> #include <fstream> #include <iostream> #include "easyTimer.h" #include <unordered_set> #include <unordered_map> #include <cinttypes> #include "utils/utils.h" #include <optional> using dt = intmax_t; constexpr dt INF = std::numeric_limits<dt>::max()/2; std::vector<...
ALGO
0.999947
4.612404
276088fe-c1d6-418e-ad81-c976875a801b
deivanayakis/DATA-STRUCTURE
Graph.cpp
#include<iostream> using namespace std; class CGraph; class CQueue; class CAppliances { private: string name; string color; string brand; float cost; int id; public: friend class CQueue; frien...
ALGO
0.969392
3.807712
55272597-0dfa-42cb-8766-0da93fae775f
handsomem1n/Algorithms_in_cpp
mid/2단조증가.cpp
// 단조증가 #include <iostream> #include <vector> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } int maxlen = 0, nowlen = 1; for (int i = ...
ALGO
0.999925
4.312068
4aa3e641-45cd-4665-927a-8251d8554e25
dbarr0s/Projeto-CG
FASE3/src/utils/figura.cpp
#include "figura.hpp" #include "ponto.hpp" #include "groups.hpp" #include "catmull.hpp" #include <iostream> #include <cstdio> #include <string> #include <list> struct figura { bool curva; // Indica se uma figura é uma curva de Catmull-Rom std::list<Ponto> pontosControl; // Se for uma curva, guarda os pontos de...
TOOL
0.887632
3.925891
f534afc6-038a-44de-976b-80a78a868530
Jesse-Culver/SourceEngineStorybook_Old
mp/src/game/server/physics_fx.cpp
// memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" static int BestAxisMatchingNormal( matrix3x4_t &matrix, const Vector &normal ) { float bestDot = -1; int best = 0; for ( int i = 0; i < 3; i++ ) { Vector tmp; MatrixGetColumn( matrix, i, tmp ); float dot = fabs(DotProduct...
ALGO
0.90667
6.779823
8eea7aa0-bd77-48cf-b871-56c3da3aa615
yifan0/stochastic_competition_git
c_code/benchmark.cpp
#include <cstdio> #include <random> // rand() #include <string.h> // memcpy() #include <queue> // queue #include <chrono> #include <set> #include <map> #include <numeric> #include <algorithm> #include "sfmt.h" using namespace std; #ifndef MULTIFILE_PROJECT // If compiled as a single file then include these cpp files, ...
ALGO
0.999838
3.688246
e08bb202-2e7d-427c-9d2e-d87c7a835223
LongyueChang/android11
frameworks/base/tools/streaming_proto/java/main.cpp
#include "Errors.h" #include "stream_proto_utils.h" #include "string_utils.h" #include <stdio.h> #include <iomanip> #include <iostream> #include <sstream> #include <map> using namespace android::stream_proto; using namespace google::protobuf::io; using namespace std; /** * If the descriptor gives us a class name, u...
TOOL
0.855622
6.917449
faafb575-0a54-44fd-8280-a05a32292a38
perilouswithadollarsign/cstrike15_src
studiorender/r_studiolight.cpp
#include "r_studiolight.h" #include "studiorender.h" #include "studiorendercontext.h" #include "studio.h" #include "materialsystem/imaterialsystemhardwareconfig.h" #include "mathlib/vector.h" #include "mathlib/mathlib.h" #include <float.h> // memdbgon must be the last include file in a .cpp file!!! #include "tier0/mem...
TOOL
0.930328
5.89903
c133c3d9-86f1-4462-871b-b1ca63d99ffd
UmeshEkhande/CPP_Adv_Assignments
Assignment9/Sketcher -Deque/src/BBox.cpp
#include<iostream> #include "../headers/BBox.h" #include "../headers/Triangle.h" #include "../headers/Point3D.h" #define __DBL_MIN__ 2.2250738585072014e-308 #define __DBL_MAX__ 1.7976931348623158e+308 BBox::BBox(std::deque<Triangle> triangles) :mMin(0,0,0), mMax(0,0,0), mCenter(0,0,0) { calculateBBox(triangles); ...
ALGO
0.994236
5.762488
ec55f9e5-a730-48af-a5d3-731243ce6758
ADVRHumanoids/cogimon_controller
src/resampler.cpp
#include "resampler.h" #include "utils.h" #include <chrono> #include <thread> Resampler::Resampler(double horizon_duration, int n_nodes, urdf::ModelInterfaceSharedPtr urdf_model, std::map<std::string, double> fixed_joints, std::vector<...
ALGO
0.989175
6.222157
7af2a328-1287-4550-bc73-9f83e7e9eb5b
RTXI/rtxi
libs/dsp/anlg_rcn.cpp
// // File = anlg_rcn.cpp // #include "anlg_rcn.h" #include "misdefs.h" #include "sinc.h" #include <iostream> #include <math.h> #include <stdlib.h> using namespace std; //========================================= // default constructor //----------------------------------------- AnalogReconst::AnalogReconst(double...
ALGO
0.993889
3.953629
5479cf06-7526-42db-9a70-e1dfed7c5c47
Matthew-Krueger/PostageStampProblem
Source/Backend/ElevenByThirteen.cpp
#include <iostream> #include "ElevenByThirteen.hpp" #include "Utils.hpp" /* This maps how many thirteens are in each item, useful for mapping the cycle on to the result */ static uint8_t thirteenMap[] = {5,0,6,1,7,2,8,3,9,4,10}; namespace PostageStampProblem::Backend{ std::vector<uint8_t> elevenByThirteen(uint32...
TOOL
0.99698
3.128635
98080031-da1b-4c6b-ba8e-f2179ce66bc0
fabstu/c3
source/mmcmsf_merged.cpp
#include <bits/stdc++.h> #include <cmath> #include <limits.h> #include <algorithm> #include <chrono> using namespace std::chrono; using namespace std::placeholders; using ll = long long; using lll = __int128; #define vi vector<int> #define vil vector<ll > #define pb push_back #define fi ...
ALGO
0.999461
3.664702
8dd849c3-bffa-4578-be98-1ff0c5e75277
ishandutta2007/codeforces
enem/normal/1351/A.cpp
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define M1 1000000007 #define M2 998244353 #define ll long long #define pll pair<ll,ll> #define REP(i,a,b) for(ll i=a;i<b;i++) #define REPI(i,a,b) for(ll i=b-1;i>=a;i--...
ALGO
0.999801
4.881274
05072174-4b18-4d52-9235-a5801528d46c
aniisabihi/TNM067-Scientific-Visualization-Labs
tnm067lab2/processors/marchingtetrahedra.cpp
#include <modules/tnm067lab2/processors/marchingtetrahedra.h> #include <inviwo/core/datastructures/geometry/basicmesh.h> #include <inviwo/core/datastructures/volume/volumeram.h> #include <inviwo/core/util/indexmapper.h> #include <inviwo/core/util/assertion.h> #include <inviwo/core/network/networklock.h> namespace invi...
ALGO
0.930083
6.759722
b2873566-aaa1-4db5-a69c-2dd8d77dc7b6
ishan-0803/code-it-out
P102(B).cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb emplace_back #define loop(i,s,n) for(ll i=s;i<n;i++) #define test ll t ; cin>>t; while(t--) void solve() { string s; ll sum=0,n,ans=0; cin>>s; loop(i,0,s.length()) sum+=(s[i]-'0'); if(s.length()==1) cout<<"0"; ...
ALGO
0.99997
4.397567
8d6e280c-8760-4940-a389-5b33e73ada86
RaspberryCoke/code_note
templates/数学/七进制.cpp
string convertToBase7(int num) { if (num == 0) return "0"; bool is_negative = num < 0; if (is_negative) num = -num; string ans; while (num) { int a = num / 7, b = num % 7; ans = to_string(b) + ans; num = a; } return is_negative ? "-" + ans : ans; }
ALGO
0.999544
5.149569
662c44e6-ba21-4ade-824a-1fe6cc8e5825
rishimalhan/cartesian_planner
src/libigl/include/libigl/igl/copyleft/cgal/hausdorff.cpp
#include "hausdorff.h" #include "../../hausdorff.h" #include <functional> template < typename DerivedV, typename Kernel, typename Scalar> IGL_INLINE void igl::copyleft::cgal::hausdorff( const Eigen::MatrixBase<DerivedV>& V, const CGAL::AABB_tree< CGAL::AABB_traits<Kernel, CGAL::AABB_triangle_primi...
ALGO
0.999696
7.387593
e7e553f7-758a-4807-9089-71af0cbe4023
AbdullahShaukat2191/PD-Semester-1
PD/Week 7/GameProjectV2.cpp
#include <iostream> #include <windows.h> #include <random> using namespace std; void gotoxy(int, int); char getCharAtxy(short int, short int); int ran(int x, int y); void printMaze(); void printScore(); void incrementScore(); void eraseEnemy1(); void printEnemy1(); void moveEnemy1(); void eraseEnemy2(); void printE...
ALGO
0.959523
3.224238
7a3d76b6-b0a7-4563-ba12-f42630a5a49b
akshatvermavi/DSA_akshatvermavi
Leetcode_easy_1929_Concatenation_of_Array.cpp
class Solution { public: vector<int> getConcatenation(vector<int>& nums) { //gives tle // vector<int> vrr; // for(int i=0;i<2*nums.size();i++) // { // if(i<nums.size()) // vrr.push_back(nums[i]); // if(i>=nums.size()) // { // i = i - ...
ALGO
0.999252
5.398286
6ee41b92-19f2-41bf-9278-e1ada29b5bba
divyansh-jindal/DSA-Sheet
0350-intersection-of-two-arrays-ii/0350-intersection-of-two-arrays-ii.cpp
class Solution { public: vector<int> intersect(vector<int>& nums1, vector<int>& nums2) { sort(nums1.begin(),nums1.end()); sort(nums2.begin(),nums2.end()); vector <int> res; int i=0; int j=0; while(i<nums1.size() && j<nums2.size()) { if(num...
ALGO
0.999995
5.758199
629ca8f3-9c49-4ef8-98c1-e531916385bf
Xilinx/llvm-aie
libcxx/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
// UNSUPPORTED: c++03, c++11 // <vector> // vector.bool // template <class... Args> reference emplace_back(Args&&... args); // return type is 'reference' in C++17; 'void' before #include <vector> #include <cassert> #include "test_macros.h" #include "min_allocator.h" TEST_CONSTEXPR_CXX20 bool tests() { { ...
TEST
0.894487
5.912372
2542d36d-97ae-4712-b26e-8314e719d51f
Aleoami/SPUC
spuc/ofdm_data_encoder.cpp
namespace SPUC { //-------------------------------------------------------------------------- // Interleave the coded bits //-------------------------------------------------------------------------- void ofdm_data_encoder::interleave(const std::vector<bool>& data_in) { int k; for (int i = 0; i < coded_bits_per_fr...
ALGO
0.989331
5.498872
8e3db199-c062-4811-acb5-64829242417e
funcdfs/Algorithm
2024/486B.cpp
/** * name: B. OR in Matrix * link: https://codeforces.com/contest/486/problem/B * time: 2024/5/29 12:22:47 https://github.com/funcdfs **/ #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "algo/dbg.h" #else #define dbg(...) 42 #endif auto main() -> int32_t { cin.tie(nullptr), cout.tie(nullp...
ALGO
0.999804
3.973003
0362cecd-a5f6-4bbc-b6c2-e542fdc8a20d
ishandutta2007/codeforces
ohweonfire/normal/443/B.cpp
#include <iostream> #include <fstream> #include <sstream> #include <cstring> #include <cmath> #include <cstdlib> #include <string> #include <string.h> #include <set> #include <map> #include <memory> #include <cstdio> #include <stdio.h> #include <queue> #include <deque> #include <algorithm> #include <vector> #include <u...
ALGO
0.999658
3.394211
e6d47fb9-920a-461a-8792-2a7f680437a1
ishandutta2007/codeforces
antoine/normal/1133/A.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; string f(const int x) { if (x < 10) return "0" + to_string(x); return to_string(x); } int main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); char c; int h1, m1, h2, m2; cin >> h1 >> c >> m1 >> h2 >> c >> m2; const int t1 = h1 * 60 +...
ALGO
0.999438
4.888358
cfa35275-c17c-463b-888b-c0eae4d01ba8
misaelmateus/problem-solving
Spoj/Homem_Elefante_Rato.cpp
#include<bits/stdc++.h> #define MAXN 100100 using namespace std; int tree[MAXN*3][3]; int mark[MAXN * 3]; int v[MAXN]; void build(int l, int r, int n){ if(l == r){ tree[n][0] = 1; return ; } int mid = (l + r) >> 1; build(l, mid, n << 1); build(mid+1, r, (n << 1) + 1); for(int k = 0; k < 3; k++) tree[n][k] ...
ALGO
0.999845
3.668575
6782c0d5-5f41-4fdb-9992-f28981b41788
Viraj1975/DSA_C-
PW_Decode/trees/implementation/using_c++.cpp
#include<bits/stdc++.h> using namespace std; class treeNode{ public: int value; treeNode* left; treeNode* right; treeNode(int value){ this->value=value; left=NULL; right=NULL; } }; treeNode* insert(treeNode* root,int ele){ if(root==NU...
ALGO
0.999941
4.356646
160f59b0-a9b6-4512-b768-427b0ebc4efa
cdh-hub/leetcode
271.字符串的编码与解码.cpp
/* * @lc app=leetcode.cn id=271 lang=cpp * * [271] 字符串的编码与解码 */ // @lc code=start class Codec { public: // Encodes a list of strings to a single string. string encode(vector<string>& strs) { string res = ""; for (string s: strs) { for (int i = 0; i < s.size(); i++) { ...
ALGO
0.973355
6.49087
b3c0d6a5-fe6c-42ff-aeb1-fcf6ec1b3ea0
Ishrak-Tawsif/Accepted-Codes
Ishrakk_Tawsif-ac/CodeForces/196A/10477115_AC_92ms_2248kB.cpp
#include<bits/stdc++.h> using namespace std; #define sf(nn) scanf ("%d", &nn) #define sfll(nn) scanf ("%lld", &nn) #define pf printf #define casepf(nn) printf ("Case %d: ",nn) #define out(nn) cout <<nn <<endl #define loop(var,start,till)...
ALGO
0.999995
3.905844
9dc57ee8-6704-48aa-a6d9-6d7ebd0026e3
JackAz/sort
insertion_sort.cpp
#include <iostream> using namespace std; void insertion(int arr[],int n){ int i; int tmp; for(i=n-1;i>=1;i--){ if(arr[i]<arr[i-1]){ tmp = arr[i]; arr[i] = arr[i-1]; arr[i-1] = tmp; } else break; } } void insertion_sor...
ALGO
0.999954
4.752122
b5cfd6b8-fe65-4fd1-a9f8-a63f962ea1f8
ajakhotia/eyeKin
boost/boost/boost_1_57_0/libs/graph/test/random_spanning_tree_test.cpp
// Authors: Jeremiah Willcock // Andrew Lumsdaine #include <boost/graph/random_spanning_tree.hpp> #include <boost/graph/grid_graph.hpp> #include <boost/array.hpp> #include <boost/random.hpp> #include <boost/property_map/shared_array_property_map.hpp> #include <boost/property_map/dynamic_property_map.hpp> #i...
ALGO
0.944432
5.143466