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
d94e18bd-51f4-4399-ba9f-9062688440f2
kaitokidi/JacobsHack
utils.cpp
#include "utils.hpp" bool isInt(std::string s) { for(int i = 0; i < int(s.size()); ++i) if (!(s[i]>='0' && s[i]<='9')) return false; return true; } int myStoi(std::string s) { int x=0; for (int i = 0; i < int(s.size()); ++i) x = 10*x+(s[i]-'0'); return x; } bool myStob...
TOOL
0.887623
4.349405
8a714308-7155-4c5d-a4ea-31f93b4adf88
hredhayxz/Programming-Problem-Solutions
C++/Arrays/A. String Task.cpp
/// Ques link: https://codeforces.com/problemset/problem/118/A #include<bits/stdc++.h> using namespace std; int main() { string str; cin>>str; for(int i=0;i<str.size();i++) { char c=tolower(str[i]); if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='y') { continue; ...
ALGO
0.997318
3.406431
2a3eabcd-7019-4c88-8701-f1581cf26d39
Ranjeet7250/C-C-Basic-que
c++/S_G_find.cpp
#include<iostream> using namespace std; int main(){ int arr[10],n,min,max,i; cout<<"enter the size"; cin>>n; cout<<"enter the number"<<endl; for(int i=0;i<=n;++i) cin>>arr[i]; max=arr[0]; for(i=0;i<=n;++i){ if(max<arr[i]) max=arr[i]; } min=arr[...
ALGO
0.999884
3.149728
3e08348c-5f71-48fd-9d2c-0bc6fd686cfd
roberttovornik/FRI-RINS_TurtleBot
src/detection/dlib_detector/dlib/md5/md5_kernel_1.cpp
#include <sstream> #include <cstring> namespace dlib { // ---------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------...
ALGO
0.988125
6.390938
263374b5-6410-4d92-bbbf-053d1ccb40fa
abhishekgupta1906/Striver-Sde-sheet-solutions
BinarySearch/Minimumtimetocompletrips.cpp
#include <iostream> #include <bits/stdc++.h> #define int long long using namespace std; // check(mid)-can i make >=k trips in less<=k bool check(vector<int> &time,long long mid, int k) { int trips = 0; for (int i = 0; i < time.size(); i++) { trips += (mid) / time[i]; /* code */ } ret...
ALGO
0.999949
4.961897
41e4a2a1-f7e9-437e-9543-28a4c5697818
khanhtc1202/cp
orange/prime/lpd.cpp
#include <iostream> using namespace std; typedef long long ll; ll solve(ll n) { int cnt = 0; ll result = 1; for (ll i = 2; i * i <= n; i++) { if (n % i == 0) { cnt++; result = i; while (n % i == 0) { n /= i; } ...
ALGO
0.999961
4.449917
46030b87-7082-41c7-9587-899e35e1703b
qingzengsong/pytorch
aten/src/ATen/native/mkl/SpectralOps.cpp
#include <ATen/ATen.h> #include <ATen/NativeFunctions.h> #include <ATen/native/SpectralOpsUtils.h> #include <ATen/Config.h> #if !AT_MKL_ENABLED() namespace at { namespace native { Tensor _fft_mkl(const Tensor& input, int64_t signal_ndim, bool complex_input, bool complex_output, bool i...
ALGO
0.921255
6.903314
0d88d178-26ba-4e11-9f53-05fcbb4a55ef
omjee17/DS_Algo_Questions
Binary Search Tree(BST)/count_bst_nodes_that_lies_in_range.cpp
#include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node *left; struct Node *right; }; Node* newNode(int val) { Node* temp = new Node; temp->data = val; temp->left = NULL; temp->right = NULL; return temp; } Node* buildTree(string str) { // Corner Case if (str.length() == 0 || str[...
ALGO
0.99977
4.973493
c8303fba-9edd-44fa-a52e-f9a88d1ca4b4
huiluohuiluohuiluo/TBIP
src/dp.cpp
#include <iostream> #include <fstream> #include <string> #include <sstream> #include <vector> #include <iterator> #include <map> #include <set> #include <bits/stdc++.h> #include <algorithm> #include "time.h" #include "edge.h" #include "fileProcess.h" #include "partition.h" using namespace std; vector<int> dp(Graph g...
ALGO
0.999815
4.433356
d8764957-aa4e-40aa-a7f9-5b6b1d9d593e
tounaishouta/ProjectEuler
C++/0110.cpp
// 0110.cpp #include <iostream> using namespace std; const int psize = 1e4; bool prime[psize]; int p[psize], primes; void primeformat() { prime[0] = prime[1] = false; for ( int i = 2; i < psize; i++ ) prime[i] = true; for ( int i = 2; i*i < psize; i++ ) if ( prime[i] ) for (...
ALGO
0.999804
4.937932
87d6fa21-a14a-49ea-9a05-254275033372
govinddwivedi-git/CSES-solutions
Counting_Bits.cpp
#include <bits/stdc++.h> using namespace std; // Macros and constants #define pb push_back #define endl ("\n") #define pi (3.141592653589) #define int long long #define float double #define pb push_back #define mp make_pair #define ff first #define ss second #define all(c) c.begin(), c.end() #define mini(a, b, c) min(...
ALGO
0.999957
5.327869
4a9dc649-9149-4d9d-a806-bcc9fdfcab2b
satyam6112/DSA-with-c-
zero/patern.cpp
#include <iostream> using namespace std ;; int main(){ int row ; cout<<"enter the number of rows "; cin>>row; for (int i = 0; i <= row; i++) { for (int j = 0; j <i; j++) { cout<<"*"; } cout<<endl; } return 0; }
ALGO
0.99938
3.730528
85ebba0c-b3c7-429c-a9e0-a980f44d6bef
raincross7/code-similarity
codes/train_code/problem419/problem419_25.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <functional> #include <cmath> #define pi 3.14159265358979323846264338327950 int main() { std::string s; std::cin >> s; std::vector<long long> NUM(s.size() - 2); for (int i = 0; i < s.size() - 2; ++i) NUM[i] = ((s[i] - '0') * 100...
ALGO
0.999463
3.59662
ebf66820-5a78-4510-9ed8-84d75c2f8864
ehnryx/acm
acpc-2021/i.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pt = complex<ld>; constexpr char nl = '\n'; constexpr int MOD = 1e9 + 7; constexpr ld EPS = 1e-9L; random_device _rd; mt19937 rng(_rd()); int main() { cin.tie(0)->sync_with_stdio(0); cout << fixed << setprecision(10...
ALGO
0.999994
5.936418
33f51c89-580e-43f6-85a9-feae8fd05087
ManjuYadav15/Manju
Maximum Draws.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { int n,i,a; cin>>n; for(i=0;i<n;i++) { cin>>a; cout<<(a+1)<<endl; } /* Enter your code here. Read input from STDIN. Print output to STDOUT */ ...
ALGO
0.996485
3.146049
257e3f6d-b5c2-4985-acbf-e1827ccb1d40
NanaNsiah/stevies
thirdparty/icu4c/common/uset.cpp
#include "unicode/utypes.h" #include "unicode/uobject.h" #include "unicode/uset.h" #include "unicode/uniset.h" #include "cmemory.h" #include "unicode/ustring.h" #include "unicode/parsepos.h" U_NAMESPACE_USE U_CAPI USet* U_EXPORT2 uset_openEmpty() { return (USet*) new UnicodeSet(); } U_CAPI USet* U_EXPORT2 uset_o...
TOOL
0.865811
7.51815
fbeeed97-2b5b-4f5b-981a-6f643b284448
acc-cosc-1337-spring-2023/midterm-RamiNahhas
src/question_1/main.cpp
#include "question1.h" using std:: cin; using std::cout; int main() { int n; char choice = 'y'; while (choice == 'y') { cout << "Enter a positive integer between 1 and 15: "; cin >> n; while (n < 1 || n > 15) { cout << "Invalid input. Please enter a positive integer...
ALGO
0.974828
5.21983
1fcb114a-36ff-4e45-b593-123891488fb4
boyplus/competitive-programming
TOI/TOI4/sms.cpp
#include <cstdio> #include <vector> using namespace std; vector<char> vec; char sms[10][10] = {"","","ABC","DEF","GHI","JKL","MNO","PQRS","TUV","WXYZ"}; void gen(int btn,int click){ int mod = 3; if(btn == 7 || btn == 9){ mod = 4; } if(btn!=1){ click = click%mod; if(click == 0){ click = mod; } char temp...
ALGO
0.999536
3.053223
7754d57c-2603-4d7b-a920-e89c996fc2c8
shakibamoshiri/1000_examples_with_cpp
std/quick_review_2/algorithm/083#is_sorted.2.cpp
/* A review of algorithm library Partition: */ #include <iostream> #include <algorithm> #include <iterator> /// is_sorted // checks whether range is sorted //bool binary_function( const int i_1, const int i_2 ){ // return i_1 < i_2; //} int main(){ int array[] = { 1,3,2 }; int* begin_array = array; ...
ALGO
0.999823
5.478952
b9d3c534-8df9-47af-b966-50290f5dd713
sarat-ravi/old-intersect
intersect/util/opencv/samples/c/find_obj.cpp
/* * A Demo to OpenCV Implementation of SURF * Further Information Refer to "SURF: Speed-Up Robust Feature" * Author: Liu Liu * <EMAIL> */ #include "opencv2/objdetect/objdetect.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/calib3d/calib3d.hpp" #include "...
ALGO
0.998531
5.353226
337670d1-f667-4473-8371-85b58dbe952a
juruoO-o/CPP_LC
LC826.cpp
#include <bits/stdc++.h> using namespace std; struct ListNode { int val; ListNode *next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(x), next(nullptr) {} ListNode(int x, ListNode *next) : val(x), next(next) {} }; struct TreeNode { int val; TreeNode *left; TreeNode *...
ALGO
0.999948
5.235272
99edea3a-ca1f-4f7b-a6a4-320bb6cd3f31
littleDizzy/Snake
Snake.cpp
#include"Snake.h" /*ĿǰѾʵֻܣҪ 1ܵǽѽײǽ(ѽ,ǽɫѽ 2: ͷײҲ(ѽ) 3ӻֹ򣬰մʱͳ(ѽ) 4Сbug:ʳпܳǽ(޸) */ /*Sprite method*/ void Sprite::draw() { //ɫ setfillcolor(m_color); //ƾ fillrectangle(m_x, m_y, m_x + 10, m_y + 10);//ĸֱʾεϽǵ½ǵ }; void Sprite::moveBy(int x, int y) { m_x += x; m_y += y; } bool Sprite::collision(const Sprite& other) {...
TOOL
0.952673
4.258854
6b80b2bb-826c-43d9-bb76-788ef95f1b75
Panzer3232/Competitve-Programming
Hackerearth/BeingGreedyForWater.cpp
#include<bits/stdc++.h> using namespace std; #pragma GCC push_options #pragma GCC optimize ("unroll-loops") #define watch(x) cout << (#x) << " is " << (x) << "\n" #define watch2(x,y) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<"\n" #define pow2(x) ((x)*(x)) #define ll long long #define ld long double #d...
ALGO
0.999909
3.873224
5422e95e-ca04-4943-80da-5031de2b5d57
sora-taka/online-contest
atcoder/abc/406/A_Not_Acceptable.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; void solve() { int a, b, c, d; cin >> a >> b >> c >> d; if (a * 60 + b > c * 60 + d) cout << "Yes"; else cout << "No"; } int main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); in...
ALGO
0.999556
3.70037
98dfc19a-92d2-4513-8d06-6e4cb8bd0307
Hazer-BJTU/Algorithm-Contest-Templates
模板-源文件 No.1/Erdos Gallai-线段树优化.cpp
#include <bits/stdc++.h> #define MAXN 40005 #define lc(x) (2*(x)) #define rc(x) (2*(x)+1) using namespace std; int n,arr[MAXN]; long long presum[MAXN],backsum[MAXN]; bool comp(int x,int y) { return x>y; } struct segment_tree { int l; int r; int key; }tree[4*MAXN]; void update(int p) { tree[p].key=min(tree[lc(p)]...
ALGO
0.999944
4.038174
a15e4732-e59c-4a84-862b-84adf163cadf
mmsarode/CarND-Path-Planning-Project
src/Eigen-3.3/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix3f A; Vector3f b; A << 1,2,3, 4,5,6, 7,8,10; b << 3, 3, 4; cout << "Here is the matrix A:\n" << A << endl; cout << "Here is the vector b:\n" << b << endl; Vector3f x = A.colPivHouseholderQr...
ALGO
0.999883
3.334035
b2733545-dd16-4ba6-920a-721fc0e6499f
brubee/prog1
drill20.cpp
#include <iostream> #include <stdexcept> #include <vector> #include <algorithm> #include <list> #include <array> #include <string> template <typename C> void print_contents(const C& c){ for(auto& a : c){ std::cout << a << " "; } std::cout << std::endl; } template <typename C> void inc(C& c, int n){ for(auto& a ...
TOOL
0.871171
4.91105
96945494-828b-49a1-a301-62781c010cd7
fpdjsns/Algorithm
leetcode/medium/77. Combinations.cpp
/** * problem : https://leetcode.com/problems/combinations/ * time complexity : O(N! / (N-K)!) * algorithm : backtracking */ class Solution { vector<vector<int>> answer; int N, K; void combine(int ind, vector<int>& arr) { if(arr.size() == K) { answer.push_back(arr); ret...
ALGO
0.99997
6.298669
975fe470-9350-414e-b33a-fb20b1bf8879
TheHolyJoker/Adaptive-Bloom-filter
AdaptiveBF/Helper.cpp
// // Created by tomer on 9/20/18. // #include "Helper.h" Helper::Helper(size_t n, double eps) { nForReBuild = n, epsForReBuild = eps; Helpersdepth = getDepthByMinNM(n, eps); size_t mList[Helpersdepth], kList[Helpersdepth]; GetMList(n, eps, mList, Helpersdepth); GetKList(n, eps, kList, mList, Help...
ALGO
0.971655
4.982862
be482fee-5a3b-45ca-9aff-b7ca46c4babb
ilksh/LeetCode
Medium/0322. Coin Change.cpp
#include<bits/stdc++.h> using namespace std; class Solution { private: const int INF = 1e9; // Define a large value to represent infinity public: int coinChange(vector<int>& coins, int amount) { int dp[amount + 1]; // Initialize the dp array with the value INF, as initially, we assume ...
ALGO
0.999966
6.157399
a27d1e92-dd24-4aeb-ac12-b9122f43227c
SoumenX-CZ/GCH-Informatika
Lekce19.cpp
//Lekce 19 - Hanojská věž #include <iostream> using namespace std; void vez(int a, char z, char pom, char na) { if (a==1) { cout << "presun disk 1 z " << z << " na " << na << endl; } else { vez(a-1, z, na, pom); cout << "presun disk " << a << " z " << z << " na " << na << end...
ALGO
0.998236
4.642462
3e470171-74b1-40ff-9dee-8d6d22b48d7a
rebeater2/RGIOE
Src/KalmanFilter.cpp
/** * @file: LooselyCouple2020_cpp KalmanFilter.cpp * @author: rebeater * @function: Implement of Kalman Filter * @date: 2020/11/28 * @version: 1.0.0 @note first complement * **/ #include "KalmanFilter.hpp" #if 0 template<int dim, typename fp> void KalmanFilter<dim,fp>::Update(const Mat2Xd &H, const Vec2d &z...
ALGO
0.997858
5.563338
6cf96212-d26c-45d3-a650-302902577389
capranersa/dst
ggml/src/ggml-cann/kernels/get_row_f32.cpp
#include "kernel_operator.h" // optimize me. Use template to avoid copy code. using namespace AscendC; #define BUFFER_NUM 2 class GET_ROW_F32 { public: __aicore__ inline GET_ROW_F32() {} __aicore__ inline void init(GM_ADDR input, GM_ADDR indices, GM_ADDR output, int64_t *in...
ALGO
0.861208
5.376829
c357fe2a-ef8a-463a-8c37-00a95259e630
ishandutta2007/codeforces
aidos/normal/810/C.cpp
#include <bits/stdc++.h> using namespace std; #ifdef WIN32 #define I64 "%I64d" #else #define I64 "%lld" #endif typedef long long ll; #define f first #define s second #define mp make_pair #define pb push_back #define all(s) s.begin(), s.end() #define sz(s) (int(s.size())) #define fname "a" #define MOD 1000000007 #...
ALGO
0.999984
4.069786
829b728e-1eb6-4476-a0cd-8396b77c0135
vfaergestad/sudoku-solver
cpp/main.cpp
#include <iostream> #include "stdio.h" #include <Windows.h> using namespace std; int const MAX = 9; int board[MAX][MAX]; bool solved = false; void fillBoard(){ board[0][4] = 6; board[0][6] = 4; board[0][7] = 2; board[1][0] = 5; board[1][5] = 7; board[1][7] = 8; board[2][2] = 7; board...
ALGO
0.99921
5.495134
101c26ea-02d4-4b39-b811-45819023aa07
hieupm123/again
code/C++/CSES2/1691 - Mail Delivery.cpp
/* Problem Name: Mail Delivery Problem Link: https://cses.fi/problemset/task/1691 Author: Sachin Srivastava (mrsac7) */ #include<bits/stdc++.h> using namespace std; template<typename... T> void see(T&... args) { ((cin >> args), ...);} template<typename... T> void put(T&&... args) { ((cout << args << " "), ...);} templa...
ALGO
0.999942
4.382447
a3909677-9924-42a6-ab54-cc2ba0cf44db
alex-rarzola/Trapezoide
WXY/1062.cpp
#include <iostream> #include <stack> #include <cstring> #include <vector> using namespace std; typedef stack <char> pila; typedef vector <pila> vpila; vpila v; int insert(char a) { for (size_t i = 0; i < v.size(); i++) { if(a <= v[i].top()){ v[i].push(a); return 0; } } pila aux; aux.push(a...
ALGO
0.999821
3.786428
b972429f-462e-4419-89a3-932c4b1b7b7c
aokblast/LeetCode_Problem_Solving
Medium/970_Powerful_Integers.cpp
// //Runtime 0 //Memory 6.9 class Solution { public: vector<int> powerfulIntegers(int x, int y, int bound) { unordered_set<int> s; if(bound == 0 || bound == 1) return {}; if(x == 1 && y == 1) return {2}; if(x == 1){ int lim = bound == 1 ? -1 : log(...
ALGO
0.999603
4.694304
04f86514-8d37-4c18-8382-a70226e9fd9f
ishandutta2007/codeforces
rush_d_cat/normal/1109/B.cpp
#include <iostream> #include <algorithm> #include <cstring> using namespace std; typedef long long LL; const int N = 5000 + 10; char s[N<<1]; int n; int main(){ scanf("%s", s+1); n=strlen(s+1); bool ok=0; for(int i=1;i<=n/2;i++){ if(s[i]!=s[1]) ok=1; } if(!ok) return !printf("Impossible\n"...
ALGO
0.999816
3.107088
5aaacceb-e626-402e-a3fe-c283e7bb0c3a
savagecarol/c-
prcatice5/45.cpp
/* code by savagecarol */ #include <bits/stdc++.h> using namespace std; /* predefined value */ #define yes() cout << "YES" #define no() cout << "NO" #define one() cout << "1" #define zero() cout << "0" #define ll long long int #define mp make_pair #define fi first #define se second #define pb push_back #define mod 1...
ALGO
0.999901
4.552862
912b3c01-14b6-4d3d-8fea-4bf2d3398733
BruceWayneLinxu/programming_practice_projects
geeksforgeeks/linked_list_iterator.cpp
// C++ program to implement Custom Linked List and // iterator pattern. #include <iostream> using namespace std; // Custom class to handle Linked List operations // Operations like push_back, push_front, pop_back, // pop_front, erase, size can be added here template <typename T> class LinkedList { // Forward decl...
ALGO
0.999042
5.951134
752179d0-69b2-41a4-852d-a4816b9d0510
Poarthur/cppstudy
03_break/main.cpp
#include <iostream> int main() { int counter = 0; for(int j = 0; j < 6; ++j) { for(int i = 0; i < 6; ++i) { std::cout << '*'; if(i == counter) { counter+=1; break; } } std::cout << std::endl; ...
ALGO
0.88363
3.078705
384dac54-9864-45c1-b90e-68d97f396a59
ishandutta2007/codeforces
ssrs_/normal/1730/F.cpp
#include <bits/stdc++.h> using namespace std; const int INF = 1000000000; int main(){ int n, k; cin >> n >> k; vector<int> p(n); for (int i = 0; i < n; i++){ cin >> p[i]; p[i]--; } vector<int> q(n); for (int i = 0; i < n; i++){ q[p[i]] = i; } vector<vector<int>> S(n + 1, vector<int>(n + 1,...
ALGO
0.999957
3.637086
3d023c89-1a43-4bc6-b669-5ec5ea385511
pjswarnpath2709/Self-Learning
DYNAMIC PROGRAMMING/MagicGrid copy.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define M 1000000007 int magicgrid(int **input, int m, int n) { int **dp = new int *[m]; for (int i = 0; i < m; i++) { dp[i] = new int[n]; } dp[m - 1][n - 1] = 1; dp[m - 2][n - 1] = 1; if (input[m - 2][n - 1] < 0) ...
ALGO
0.999995
5.044641
809931bc-80a7-4cc9-aa24-1ad3d0cc16ca
ShantanuNimbalkar/opencvDemo
samples/cpp/travelsalesman.cpp
#include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> #include <opencv2/ml.hpp> using namespace cv; class TravelSalesman { private : const std::vector<Point>& posCity; std::vector<int>& next; RNG rng; int d0,d1,d2,d3; public: TravelSalesman(std::vector<Point> &...
ALGO
0.999993
4.586428
bf65c2f7-7d18-45ff-ac53-4a80f6a49b58
alex-udodik/Earthquake-Monitor
frontend/client/windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.997741
6.763549
8bc83833-3f2e-4024-818d-653e6d0adcd8
prabhakaran9397/DataStructureLab
10-bstree-2/h/stub/stub_bstree3.cpp
#include <stdio.h> #include "bstree.h" int main() { BSTree t; int arr[10], count, ref[10] = { 1, 3, 2, 5, 7, 6, 4 }; int i; printf("testing insert..."); t.add(4); t.add(2); t.add(6); t.add(1); t.add(3); t.add(5); t.add(7); printf("[ok]\n"); printf("testing search..."); if (!t.search(1) || !t.search(2) ...
TEST
0.989435
4.326493
2b123430-d5f2-4c7e-a97d-2071e5af6784
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_1393_0.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, x, sum, res, i; cin >> n; sum = 0; for (i = 0; i < n; i++) { cin >> x; sum += x; } res = 1; for (i = 1; i <= 5; i++) { if (((sum + i) % (n + 1)) == 0) { res++; } } cout << res << endl; }
ALGO
0.999803
3.832477
109b38ff-861a-445d-a9fd-c91aea8bf678
MansiMittal7/LeetCode_Questions
Stock span problem - GFG/stock-span-problem.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function to calculate the span of stock’s price for all n days. vector <int> calculateSpan(int price[], int n) { vector <int> ans; stack< pair<int,int>> st; // f...
ALGO
0.999765
6.208557
3a79949a-50cd-4921-aa1a-d370b723843b
ishandutta2007/codeforces
kostia244/normal/231/E.cpp
#pragma GCC optimize ("Ofast") #include<bits/stdc++.h> #define pb push_back #define __V vector #define all(x) x.begin(), x.end() #define oit ostream_iterator #define mod 1000000007ll using namespace std; void doin() { cin.tie(); cout.tie(); ios::sync_with_stdio(0); #ifndef ONLINE_JUDGE // freopen("input.txt", "r", s...
ALGO
0.999977
4.377468
09d3f673-0815-4127-9665-e9954d6db9c5
sergiocampoy/fp
fp_sesion10/IV_Histograma_Vocales.cpp
/* Sergio Campoy Maldonado Fundamentos de Programacin 1C Programa que cuenta el nmero de veces que aparece cada vocal y muestra los resultados en forma de histograma */ #include <iostream> #include <cctype> #include <iomanip> using namespace std; int main (void) { // Declaracin de constantes const char TERMIN...
ALGO
0.997595
4.142109
f8daa6e1-c9f6-4888-b5d7-8da4798e2b93
3LP/Normalize
3rdparty/bullet3/src/BulletSoftBody/btDefaultSoftBodySolver.cpp
#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h" #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletCollision/CollisionShapes/btCollisionShape.h" #include "btDefaultSoftBodySolver.h" #include "BulletCollision/CollisionShapes/btCapsuleShape.h" #include "BulletSoftBod...
ALGO
0.907685
7.045202
b5f33198-90f3-4855-a2f3-fabfa15f979e
masoudbehzadinasab/Trilinos_12_11
packages/aztecoo/example/AztecOO_UserOpUserMat_LL/Poisson2dOperator.cpp
#include "Poisson2dOperator.h" #include <stdlib.h> #include "Epetra_CrsMatrix.h" #include "Epetra_Map.h" #include "Epetra_Import.h" #include "Epetra_Vector.h" #include "Epetra_MultiVector.h" #include "Epetra_Comm.h" #include "Epetra_Distributor.h" //=====================================================================...
ALGO
0.996237
6.190017
a3c129a8-960f-41be-bb00-41517d17ee5b
firoorg/firo
src/wallet/lelantusjoinsplitbuilder.cpp
#include "lelantusjoinsplitbuilder.h" #include "walletexcept.h" #include "../primitives/transaction.h" #include "validation.h" #include "../policy/policy.h" #include "../lelantus.h" #include <boost/format.hpp> #include <random> struct CoinCompare { bool operator()( const std::pair<lelantus::PrivateCoin, uint32...
ALGO
0.998015
5.180517
ab6e5e68-3195-4afb-8da3-84a2f668449a
DIPJOY10/CompetitiveProgramming
Bit Trie.cpp
//reference problem:https://codeforces.com/contest/1625/problem/D struct Node{ int ptr; Node* child[2]; Node(){ ptr=0; child[0]=NULL; child[1]=NULL; } }; struct TRIE{ Node* root; TRIE(){ root=new Node(); } void insert(int num){ Node* temp=root; ...
ALGO
0.999909
4.207259
f89cb7af-f9e0-4053-8271-eb8d6983164d
Green-Chan/msu_cpp_autumn_2019
01/mycalc.cpp
#include <iostream> void skip_spaces(char *&curr_char_ptr) { while (*curr_char_ptr == ' ') { curr_char_ptr++; } } long long atom (char *&curr_char_ptr, char *&error_ptr) { int sgn = 1; if (*curr_char_ptr == '-') { sgn = -1; curr_char_ptr++; } long long atom = 0; if ...
ALGO
0.999594
4.474902
e5ad777d-c4e2-440b-a6e1-8893fa96ae51
Compiler-Dependency-Analysis/llvm-levioso
llvm/tools/llvm-xray/xray-converter.cpp
#include "trie-node.h" #include "xray-registry.h" #include "llvm/DebugInfo/Symbolize/Symbolize.h" #include "llvm/Support/EndianStream.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/FormatVariadic.h" #include "llvm/Support/ScopedPrinter.h" #include "llvm/Support/YAMLTraits.h" #include "llvm/Support/raw_o...
TOOL
0.937611
7.670268
446d704a-093c-4e91-bd39-62ce66e1c938
jkatghub/tud-cpp-lecture
code_samples/d02_elevator-example_with_Boost/src/SimpleElevatorStrategy.cpp
/* * SimpleElevatorStrategy.cpp * * Created on: May 20, 2013 * Author: jgdo */ #include <set> #include <stdexcept> #include <exception> #include "SimpleElevatorStrategy.h" #include "Building.h" SimpleElevatorStrategy::SimpleElevatorStrategy() { } SimpleElevatorStrategy::~SimpleElevatorStrategy() { } voi...
TOOL
0.867471
5.558168
c33a0b43-d6c8-4d31-97bc-d24cac8887c4
tenacityteam/tenacity-legacy
src/menus/ClipMenus.cpp
#include "../CommonCommandFlags.h" #include "../ProjectHistory.h" #include "../ProjectSettings.h" #include "../TrackPanelAx.h" #include "../ProjectWindow.h" #include "../UndoManager.h" #include "../WaveClip.h" #include "../ViewInfo.h" #include "../WaveTrack.h" #include "../commands/CommandContext.h" #include "../comman...
TOOL
0.961951
5.990853
9b40e4a4-3abb-427f-ac6c-b33a7dfaf4d3
ivca8479/advent-of-code-2024
libraries/array_helpers.cpp
#include "array_helpers.hpp" int get_min(int arr[], int size) { int min = INT_MAX; int min_index = 1; for(int i = 0; i < size; i++) { if(arr[i] < min) { min = arr[i]; min_index = i; } } arr[min_index] = INT_MAX; return min; } void print_array...
TOOL
0.990882
5.021113
a0cf65c2-0c41-4ef4-a1d7-4c831edc3776
krishna-raj007/BodhiTree-Annotation
CS101_Spring2020-21 /LAB4_L1/categorized/mod/Code2vec/Data/62_mod.cpp
#include<simplecpp> main_program{ long int n,m,p=1,x; int i=1; cin>>n>>m; repeat(n){ p=p*i; i=i+1; } x=p%m; cout<<x; }
ALGO
0.999987
3.760946
0e13266e-ff91-4a38-936f-79d515317f7b
sabinleee/solve-problems
BOJ/C++/1000~2000/1037.cpp
#include<iostream> #include<algorithm> using namespace std; int main() { int arr[51], n, mul = 1; cin >> n; for (int i = 1; i < n+1; i++) cin >> arr[i]; sort(arr+1, arr + n+1); if (n == 1) cout << arr[1] * arr[1]; else if (n % 2 == 1) cout << arr[n / 2 + 1] * arr[n / 2 + 1]; else cout << arr[n / 2] *...
ALGO
0.999938
4.356039
ad524b77-c7fc-4c49-877b-6ae82ff5284a
scorta/SPOJ
CATM_ad_hoc.cpp
//Solution for The Cats and the Mouse problem on SPOJ: http://www.spoj.com/problems/CATM/ #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; struct Cell { int row, column; }; int n, m, k; Cell mouse, cat1, cat2; int Distant(Cell start, Cell target) { return abs(start....
ALGO
0.999915
3.576807
980d7334-8503-41b0-b520-5de4921b63c3
himanshiiiiii/CrackYourPlacements
Day2/SubarraySumequalK.cpp
class Solution { public: int subarraySum(vector<int>& nums, int k) { map<int,int>m; int sum=0; m[0]=1; int ans=0; for(int i=0;i<nums.size();i++) { sum+=nums[i]; int val=sum-k; if(m.find(val)!=m.end()) { ...
ALGO
0.999918
6.117345
7d28a35f-30e1-4079-ac01-c4534b54e782
yonsei-hpcp/gcom
third-party/boost_1_86_0/libs/graph/example/dag_shortest_paths.cpp
#include <boost/graph/dag_shortest_paths.hpp> #include <boost/graph/adjacency_list.hpp> #include <iostream> // Example from Introduction to Algorithms by Cormen, et all p.537. // Sample output: // r: inifinity // s: 0 // t: 2 // u: 6 // v: 5 // x: 3 int main() { using namespace boost; typedef adjacenc...
ALGO
0.99997
5.793457
e52258f3-3ee7-4216-8a8e-9f2363442bfb
GauravYadavAtWork/cses-solutions
Introductory/cses_Number_Spiral.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; void solve(int y, int x){ // x is the coloumn, y is the row int m = max(x, y); if(m&1){ if(x==m){ cout<<(1LL*m*m) - y + 1; }else{ cout<<(1LL*(m-1)*(m-1))+x; } }else{ if(x==m){ ...
ALGO
0.999647
4.265363
4336c458-3264-4f08-8898-bcb0c50dda99
HKPolyU-UAV/COVIS
src/test/create_voc.cpp
//SYSTEM HEAD FILE #include <dirent.h> #include <stdio.h> #include <string> #include <fstream> #include <iostream> #include <vector> // DBoW3 #include "../3rdPartLib/DBow3/src/DBoW3.h" #include "../3rdPartLib/DBow3/src/DescManip.h" #include "../3rdPartLib/DBow3/src/Vocabulary.h" #include "../3rdPartLib/DBow3/src/BowV...
TOOL
0.919043
3.704092
7a0ba692-bf8a-4ade-964c-d81ce0f18991
Anshuu-Sharma/LeetCode-my-solutions
0861-flipping-an-image/0861-flipping-an-image.cpp
class Solution { public: vector<vector<int>> flipAndInvertImage(vector<vector<int>>& image) { vector<vector<int>> ans; int n = image.size(); for(int i = 0; i<n; i++) { vector<int> temp; for(int j = n-1; j>=0; j--) { temp.push_back(image[i][j] ^ 1); ...
ALGO
0.999959
6.520827
130d114b-f21c-45d0-9f80-fedb6cf565e8
sswamyn/cpp
docs/Code/c20_code/05_PartitionAlgorithms/01_partition_copy.cpp
import <algorithm>; import <vector>; import <iostream>; using namespace std; // Function template to populate a container of ints. // The container must support push_back(). template<typename Container> void populateContainer(Container& cont) { while (true) { cout << "Enter a number (0 to quit): "; int value; ...
ALGO
0.999318
5.661004
db846a75-2bf2-4b29-af15-89bee8c203ed
demi2k-sudo/problem-solving
BinarySearch/orderUnknown.cpp
#include <iostream> #include <vector> using namespace std; int BinarySearch(vector<int> arr, int target) { int start = 0, ans = -1, end = arr.size()-1,mid=0; bool isAsc = arr[start] < arr[end]; while (start <= end) { mid = (end + start) / 2; if (arr[mid] > target) { ...
ALGO
0.999956
5.513682
947d188d-3fee-49b3-b760-97e5ca5bda50
PabloHorno/Concurso-C-
Fibonacci/main.cpp
#include<iostream> using namespace std; void main() { while (true) { unsigned n, fibb = 0,fibbAnt = 1; cin >> n; for (int i = 0; i < n; i++) { unsigned temp = fibb; fibb += fibbAnt; fibbAnt = temp; } cout << fibb << endl; } }
ALGO
0.999923
3.864366
c0a8c550-6a3d-4540-a7a1-5aa37aeb8894
cobra-kai-03/DSA-striver-s
Array/Merge_sorted_arrays.cpp
//Without extra spaces #include<vector> void mergeTwoSortedArraysWithoutExtraSpace(vector<long long> &a, vector<long long> &b){ // Write your code here. long long left=a.size()-1; long long right=0; while(left>=0 && right<=b.size()) { if(a[left]>b[right]) { swap(a[left],b[right]); left--; right++; ...
ALGO
0.999948
4.440993
038161fd-3d03-49a5-ac4b-79855b26ca90
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/july/temp2_20200708015756.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #include<unordered_map> #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define ...
ALGO
0.999964
3.855144
dc941191-5df6-4e4c-b3cd-ef145680ca79
HarryGuo2012/ACMCode
Winter/#6/J.cpp
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<vector> #define MAX_N 15 #define MAX_M 123 using namespace std; int n,m,k; int a[MAX_N][MAX_M]; int b[MAX_N][MAX_M]; int c[MAX_N][MAX_M]; vector<int> v; bool cmp(int x,int y){ return x>y; } int main(){ //freopen("in.txt","r",stdin...
ALGO
0.999951
3.308184
0df23e3a-904a-452e-aa21-e0610945a04e
LukasKrisna/cpp-dasar
kalkulator.cpp
#include <iostream> #include <math.h> using namespace std; int main(int argc, char const *argv[]) { int angka1, angka2, total, pilihanMenu; char pilihan, operasi; do { cout << "Kalkulator Sederhana" << endl; cout << "Masukkan Pilihan" << endl; cout << "1. Penjumlahan" << endl;...
ALGO
0.919678
3.530357
206f7ebf-1f9d-4eab-a7f0-91d668871b29
vivek2005Bot/DSA-with-C-
nthroot.cpp
#include <bits/stdc++.h> using namespace std; int func(int mid,int n,int m){ long long ans=1; for(int i=0;i<n;i++){ ans=ans*mid; if (ans>m) return 2; } if (ans==m) return 1; return 0; } int NthRoot(int n,int m){ int low=1; int high=m; while(low<=high){ int mid=(...
ALGO
0.999987
5.096653
530e4634-c7ac-42ed-86e3-91ee6357a167
Atanusaha143/Competitive-Programming
LightOJ/Guilty Prince.cpp
#include<bits/stdc++.h> using namespace std; #define NL '\n' #define sz(x) x.size() #define PINF INT_MAX #define NINF INT_MIN #define PI (2.0*acos(0.0)) #define sfi(x) scanf("%d",&x) #define sfi2(x,y) scanf("%d %d",&x,&y) #define sfi3(x,y,z) scanf("%d %d %d",&x,&y,&z) #define sfl(x) scanf("%lld",&x) #define sfl2(x,y)...
ALGO
0.999743
4.205533
dff0c28f-81bb-498c-b883-882bd715a4d4
xiaowansheng/leetcode-Cjiajia
leetcode-c++/80-删除有序数组中的重复项 II.cpp
#include<iostream> #include<vector> using namespace std; class Solution { public: int removeDuplicates(vector<int>& nums) { } }; int main() { vector<int> nums = { 0,1,1,2,2,2,3,4,4,5,6,6 }; Solution* s = new Solution(); int count = s->removeDuplicates(nums); for (int i = 0; i < count; ++i) { std::cout << nu...
ALGO
0.999718
5.052666
68cf77b0-5049-4dd1-908b-0330786a4b74
ishandutta2007/codeforces
hydro-bot1/normal/560/A.cpp
// Hydro submission #625506b617cd4d0a417647d0@1649739447107 #include<bits/stdc++.h> using namespace std; int main() { int a,n,i; cin>>n; for(i=0;i<n;i++) { cin>>a; if(a==1) { printf("-1\n"); return 0; } } printf("1\n"); return 0; }
ALGO
0.99972
3.352058
cf837025-f477-4095-8dee-b9e136c0709d
lives-in-virgosupercluster/Codeforces_problem_solving
1201C.cpp
#include <bits/stdc++.h> #define ll long long int #define endl "\n" using namespace std; bool check(vector<ll>&v,ll num,ll k,ll n){ ll moves=0; for(ll i=n/2;i<n;i++){ if(v[i]<num){ moves+=num-v[i]; } } if(moves>k){ return false; } return true; } int main(){...
ALGO
0.999996
4.810033
8b6fa9fb-c0b2-4731-84c2-b39418367b45
ishandutta2007/codeforces
spacevortex/normal/1290/A.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; const ll N=5050; ll n,m,K,ans; ll a[N]; void Solve() { ll i,j,val,now; cin>>n>>m>>K; K=min(K,m-1); ans=0; for(i=1;i<=n;i++) cin>>a[i]; for(i=0;i<=K;i++) { now=1e9+50; for(j=0;j<=m-1-K;j++) { val=max(a[i+j+1],a[n-(m-1-i-j)]); now=min(n...
ALGO
0.999937
4.250855
1f8f45d5-1099-4de0-ace8-6f0eb512b833
Seyamalam/SPOJ
Adacut.cpp
// Ivan Carvalho // Solution to https://www.spoj.com/problems/ADACUT/ #include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 3 * 1e5 + 10; ll vetor[MAXN], total, N, resp; int main() { scanf("%lld", &N); for (ll i = 1; i <= N; i++) { scanf("%lld", &vetor[i]); total +...
ALGO
0.999924
3.677327
7d0e05ec-aa33-4dc9-ac4a-51c1299d8a09
Shrey123ansh/Placement
DSA/BST/Easy/Search in a Binary Search Tree.cpp
TreeNode* searchBST(TreeNode* root, int val) { if (root == nullptr || root->val == val) { return root; } if (root->val > val) { return searchBST(root->left, val); } else { return searchBST(root->right, val); } }
ALGO
0.999934
5.597016
6b1c0840-a75a-49c7-a868-c5e4fb64576c
srsran/srsRAN_Project
lib/scheduler/support/mcs_calculator.cpp
#include "mcs_calculator.h" #include "srsran/adt/span.h" using namespace srsran; const unsigned CQI_TABLE_SIZE = 16; // The table below performs the mapping of the CQI into the closest MCS, based on the corresponding spectral efficiency. // The mapping works as follows: // - With respect to TS 38.214 V15.14.0, // ...
ALGO
0.889579
7.237904
80c8bb3d-0ff7-40f1-952b-4949cf4afde0
ishandutta2007/codeforces
scott_wu/normal/1336/A.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 200100; int N, K; vector <int> edge[MAXN]; int ssize[MAXN]; vector <int> v; void dfs (int cloc, int last, int dep) { ssize[cloc] = 1; for (int neigh : edge[cloc]) { if (neigh == last) continue; dfs (neigh...
ALGO
0.999874
4.48545
6bd6da1f-9d22-4ca2-9642-38a20e485c2c
xalbertho/Programacion
Programacion_Avanzada_2MV7/2024-2/ADS 1TV1/P9/biblioteca.cpp
/** * @file biblioteca.cpp * @author Jose Luis Cruz (<EMAIL>) * @brief Mi biblioteca de funciones chidas * @version 0.1 * @date 2024-03-21 * * @copyright Copyright (c) 2024 * */ #include <iostream> using namespace std; void burbuja(int *arr, int size) { int aux; for (int j = 0; j < size; j++) { ...
ALGO
0.998185
5.067146
4c2d749a-597a-4bf1-8b68-44b372b50982
ishandutta2007/codeforces
bigbag/normal/1178/F1.cpp
#include <bits/stdc++.h> using namespace std; const int max_n = 505, mod = 998244353, inf = 1000111222; int n, m, a[max_n], mn[max_n][max_n], dp[max_n][max_n]; int mul(int x, int y) { return 1LL * x * y % mod; } int get_dp(int l, int r) { return dp[r - l + 1][l]; } int main() { //freopen("input.txt", ...
ALGO
0.999993
4.640246
79daaf77-04e7-48b4-80fa-13c9b80bfb8e
Yehia-Nour/LeetCode
0143-reorder-list/0143-reorder-list.cpp
class Solution { public: void reorderList(ListNode* head) { if (!head || !head->next) return; vector<ListNode*> vec; ListNode* current = head; while (current) { vec.push_back(current); current = current->next; } int i = 0; in...
ALGO
0.99998
6.010965
12529a76-3a69-4f35-86d0-4ad734749fc8
0x7a726f/kaipolycoding
tech/seira5/gas.cpp
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; class Graph { public: Graph(int V){ VertexList.resize(V); DistanceList.resize(V); size = V; } ~Graph(){ for(int i = 0;i < VertexList.size(); i++){ VertexList[i].clea...
ALGO
0.999968
4.418892
f2fe2038-3e7e-4a6b-a4c1-42d364432fbd
pthom/multiplicative-persistence
persistence.cpp
//#define ALGO_USE_VECTORS //#define ALGO_USE_COROUTINES //#define ALGO_USE_RANGES #include <iostream> #include <vector> #include <future> #include <array> #include <gmpxx.h> #include <boost/asio/thread_pool.hpp> #include <boost/asio.hpp> #include "spdlog/spdlog.h" #include "stopwatch.hpp" #ifdef ALGO_USE_COROUTINES ...
TEST
0.997753
6.646058
725bedba-277a-4213-a649-4fd69fdde544
sapscode/Code-Files
C++ test files/Tree/depth_order_traversal.cpp
#include<bits/stdc++.h> using namespace std; struct node { int data; node* left; node* right; }; node* insert(node* root, int data) { if(!root) { root = new node(); root->data = data; root->left = root->right = NULL; } else if(data <= root->data) root->l...
ALGO
0.999921
5.099722
102eb9d6-70aa-4c57-8af1-4dad3a3bf82c
Khushbu1824/LeetCode-Solutions
1281-Subtract-product-and-sum-of-digits-of-an-int.cpp
class Solution { public: int subtractProductAndSum(int n) { int product = 1; int sum = 0; while(n) { int digit = n % 10; product *= digit; sum += digit; n = n / 10; } int result = product - sum; return result;...
ALGO
0.999971
6.551172
5f49bfad-d44b-4b82-a2fd-cf6b1bf385d4
CaioBoa/SupercompCluster
Entrega15/ex1.cpp
#include <mpi.h> #include <iostream> #include <cstring> int main(int argc, char** argv) { MPI_Init(&argc, &argv); int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (rank == 0) { const char* message = "Olá"; MPI_Send(message, strlen(message) + 1, MPI_CHAR, 1, 0, MPI_COMM_WORLD); ...
ALGO
0.890725
5.527982
a6ef54e3-b3da-4aa8-bee6-38e7223c10b8
Aman-droid/CP_Essentials
1700-1900/G_Short_Task.cpp
#include<bits/stdc++.h> #define ll long long #define int long long #define endl '\n' #define rep(i,a,b) for(int i=a;i<=b;i++) #define pll pair<ll,ll> #define pii pair<int,int> #define vpll vector<pll> #define SZ(x) ((int)x.size()) #define FIO ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL) #define watch(x)...
ALGO
0.999803
4.089197
6423670f-a55b-4ae5-bc68-0fade12d5a2f
nguyenkimdao1998/Contest_D19
Contest/Contest D18/Contest 9/Bai20.cpp
#include<bits\stdc++.h> using namespace std; vector<int> ke[1001]; bool check[1001]; void BFS(int u){ queue<int> q; q.push(u); while(q.size()>0){ int top = q.front(); q.pop(); check[top] = true; for(int i=0; i<ke[top].size(); i++){ if(!check[ke[top][i]]){ check[ke[top][i]] = true; q.push(ke[top...
ALGO
0.999837
4.256176
09522dc9-f0bd-454f-92f2-97fb1f2d739c
SSDC-SLIET/practice
Week-05/1.Primitive/Solutions/Mukesh kumar (Gcs-1840095)/Solution-03.cpp
#include<iostream> using namespace std; int main() { //code int t; cin>>t; while(t--) { int n; cin>>n; int a[n],b[n]; for(int j=0;j<n;j++) cin>>a[j]; int max=n-1,min=0,temp,i; for(i=0;i<=n;i++) if(i%2==0) { b[i]=a[max]...
ALGO
0.999839
3.733055
8ee4805b-63c5-4374-b277-5bdec5e5224d
SequoiaDB/SequoiaDB
thirdparty/boost/libs/fusion/example/performance/inner_product2.cpp
#include <boost/array.hpp> #include <boost/timer.hpp> #include <boost/fusion/algorithm/iteration/accumulate.hpp> #include <boost/fusion/algorithm/transformation/transform.hpp> #include <boost/fusion/container/vector.hpp> #include <boost/fusion/algorithm/transformation/zip.hpp> #include <boost/fusion/sequence/intrinsic...
TEST
0.992684
6.187331
509d4ff3-bdc0-4409-81ae-1eb3d8bd27d6
laerciovacca/BitsOfBytes
sources/cpp/ex1049.cpp
#include<stdio.h> #include<stdlib.h> struct node { int key_value; struct node *left; struct node *right; }; void destroy_tree(struct node *leaf) { if( leaf != 0 ) { destroy_tree(leaf->left); destroy_tree(leaf->right); free( leaf ); } } void insert(int key, struct node **leaf) { if...
ALGO
0.999881
3.469877
260d2bd5-ae78-4ade-9e0d-1b471c4dba0c
vi5hnuu/love-babbar-dssa-sheet-sol
coding ninjas ques/Find The Sum Of The Left Leaves.cpp
/* Problem Statement Given a binary tree with ‘root’. Your task is to find the sum of all the left leaf nodes. Properties of leaf:- In a binary tree, a leaf is a node such that it does not have any children. Node ‘1’ is always the root of the binary tree. Left leaves are those nodes that are the left child of their par...
ALGO
0.999983
5.806196
e254adc4-97c2-474f-95f4-2673c71c297f
psj5329/Algorithm_Study
BaekJoon/2884.cpp
#include <iostream> using namespace std; int main() { int H, M; while (1) { cin >> H >> M; if (H >= 0 && H <= 23 && M >= 0 && M <= 59) break; } M -= 45; if (M < 0) { M = 60 + M; H -= 1; if (H < 0) H = 24 + H; } cout << H << " " << M; }
ALGO
0.999086
4.024511