uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
f9230870-30c0-4aa7-ba5e-49a8fcd98355
jtomar24/100-days-of-code
Day 36/MinNumToFormEvenSum.cpp
// } Driver Code Ends class Solution { public: int minNum(long long int arr[], int n) { // Your code goes here int sum = 0; for (int i = 0; i < n; i++) { sum = sum + arr[i]; } if (sum % 2 == 0) { return 2; } else ...
ALGO
0.999658
5.724238
ca50c5a8-6533-4f93-ba67-a8e1f35a36f8
prasadp34/leetcode
0701-insert-into-a-binary-search-tree/0701-insert-into-a-binary-search-tree.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.999976
6.119666
c4ad8717-95c8-4217-8a32-6e20b59b3a36
PKUZHOU/PetS-ATC-2022
pets_deps/eigen/test/sparse_permutations.cpp
static long int nb_transposed_copies; #define EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN {nb_transposed_copies++;} #define VERIFY_TRANSPOSITION_COUNT(XPR,N) {\ nb_transposed_copies = 0; \ XPR; \ if(nb_transposed_copies!=N) std::cerr << "nb_transposed_copies == " << nb_transposed_copies << "\n"; \ VERIFY( (#XPR...
TEST
0.854396
6.328657
58bc6c20-d98a-4bf5-a8b7-3986b28b7612
taidangit/C-tranduythanh
HocTimKiemMang/main.cpp
#include <iostream> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { int n; cout<<"Nhap so phan tu mang:"; cin>>n; int M[n]; cout<<"Nhap gia tri cho phan tu:\n"; for(int i=0;i<n;i++) { cout<<"M"<<i<<"]=";...
ALGO
0.997268
3.411397
400df857-ef76-48d8-8bc9-d661aeb5a8b0
akhatkulov/algorithms
DS_A/C++/Dynamic_Programming/edit_distance.cpp
#include <iostream> #include <vector> #include <algorithm> // min funksiyasi uchun using namespace std; int main(){ string a, b; cin >> a >> b; int n = a.size(); int m = b.size(); // 2D baza jadvali yaratamiz vector<vector<int>> baza(n + 1, vector<int>(m + 1)); // Birinchi qator ...
ALGO
0.999982
4.953098
ac3e0b51-caf1-480d-950c-bc49ec978d06
MicroNanoFlows/ThirdParty-2.4.0-MNF
CGAL-4.6/demo/Interpolation/interpolation_2_demo.cpp
// Geomview doesn't work on M$ at the moment, so we don't compile this // file. //********************** //demo 2D Interpolation over the plane - using 2D natural neighbors //********************** #include <CGAL/basic.h> #ifndef CGAL_USE_GEOMVIEW #include <iostream> int main() { std::cerr << "Geomview doesn't work...
ALGO
0.970926
6.621585
d102b007-dc9b-4e68-8aba-a3a1fe69db1f
Hannsel101/ECE141L-Computational-Algorithms-Lab
HW2/HCamacho_HW2/HCamacho_HW2.cpp
// HCamacho_HW2.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include "testFunctions.h" void problem1(); void problem2(); void extraCredit(); void rotateLeft(int (&arr)[4][4], int row, int size); int main() { //testDoubly(); //testBTree(); ...
ALGO
0.999397
3.571009
eb9f76d2-c8a6-4263-a5bd-1af564f701fc
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_8060_1.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, k, i; cin >> n >> k; int a[n]; for (i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); cout << a[n - k]; }
ALGO
0.999967
3.406046
465be8d5-952c-4dcb-a17d-9f6c414bc6f4
JasirVoriya/algorithm-data-structure
笔试/深信服秋招D卷/D.cpp
#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; using ll = long long; const int max_n = 3e5 + 5; const int inf = 0x3f3f3f3f; pii arr[max_n]; ll pre[max_n]; int n, k; int main() { int t; scanf("%d", &t); while (t--) { scanf("%d%d", &n, &k); for (int i = 0; i < n; i++) { scan...
ALGO
0.999947
4.099875
1d8a057a-1560-440c-bf43-64ac6e78a4c5
kirillnamestnikov/leetcode-problems
392_is_subsequence/main.cpp
class Solution { public: bool isSubsequence(string s, string t) { size_t count = 0; if (s.size() > t.size()) { return false; } for (size_t i = 0; i < t.size(); ++i) { if (t[i] == s[count]) { ++count; } ...
ALGO
0.999814
6.414889
af802535-20c0-4576-af1f-5dfcbb9a8e92
gagandeepahuja09/Competitive-Programming-Contests
Codeforces/Round 652(Div. 2)/1369C.cpp
#include<bits/stdc++.h> using namespace std; #define int long long int #define vi vector<int> #define vvi vector<vi> #define pb push_back const int MOD = 1e9 + 7; int power(int x, int y) { if(y == 0) return 1ll; if(y % 2) return (x * power(x, y - 1)) % MOD; int f = power(x, y / 2); return (f * f) ...
ALGO
0.999956
3.702183
321d37fb-418d-4991-ae31-74c501756215
Siddharthm10/Competitive-Coding-Repo
LeetCode/easy/secondMininBT.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.999995
6.760181
290e6e9d-c313-42b3-9e47-69cb62e4abc2
zjxeditor/FFTracker
ThirdParty/Eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp
MatrixXd X = MatrixXd::Random(5,5); MatrixXd A = X + X.transpose(); cout << "Here is a random symmetric 5x5 matrix, A:" << endl << A << endl << endl; SelfAdjointEigenSolver<MatrixXd> es(A); cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl; cout << "The matrix of eigenvectors, V, is:" << endl << ...
ALGO
0.999753
3.056724
86828bcb-6efc-462e-8e65-d02516d84d89
skrewbar/PS
Baekjoon/platinum/11014.cpp
#include <bits/stdc++.h> #ifndef ONLINE_JUDGE #define ASSERT(x) assert(x) #else #define ASSERT(ignore) ((void)0) #endif using namespace std; int di[] = {-1, 0, 1, -1, 0, 1}, dj[] = {1, 1, 1, -1, -1, -1}; int n, m; vector<string> classRoom; struct Grid { int i, j, num; Grid(int i, int j) : i(i), j(j), num(i...
ALGO
0.999855
5.906417
eff5bcd6-7447-4e2b-b632-edd29492b9d9
msjtw/Algorithmics
cses/Tree-Algorithms/distinct_colors.cpp
#include <iostream> #include <vector> #include <set> using namespace std; const int MX =2e5+7; vector<int> adj[MX]; int vals[MX]; int res[MX]; set<int> dfs(int a, int p){ set<int> ret; ret.insert(vals[a]); for(int b : adj[a]){ if(b == p) continue; set<int> r = dfs(b, a); ...
ALGO
0.999837
4.514444
75c6d31d-4c38-40cb-98bd-a90ae2a3ac43
bfbbdecomp/tssm
dwarf/SB04_Multi_Sku/Engine/Core/x/xutil.cpp
void isort_float(void* base, uint32 num, uint32 width, uint32 key_offset); void quicksort_istr(void* base, uint32 num, uint32 width, uint32 key_offset); void quicksort_float(void* base, uint32 num, uint32 width, uint32 key_offset); void quicksort_int(void* base, uint32 num, uint32 width, uint32 key_offset); int32 xUt...
TOOL
0.99431
4.573426
1641fe3e-52a3-48d4-9889-234d6fc686c0
AizirekBakirova/FlutterProjects
sabak_10_xylophone/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.998861
6.761023
88ac07b4-2d03-4ddc-bf4d-5b746186fcda
calipos/colmapThird
libigl-2.5.0/include/igl/copyleft/cgal/delaunay_triangulation.cpp
#include "delaunay_triangulation.h" #include "../../delaunay_triangulation.h" #include "orient2D.h" #include "incircle.h" template< typename DerivedV, typename DerivedF> IGL_INLINE void igl::copyleft::cgal::delaunay_triangulation( const Eigen::MatrixBase<DerivedV>& V, Eigen::PlainObjectBase<DerivedF>& F) {...
ALGO
0.996709
7.034749
81ff20d2-d4b5-41f0-a622-5b9093eae772
liaochengle/Competitive-Programming
USACO solutions/Bronze/2019-2020/social_distancing_2.cpp
#include <iostream> #include <stdio.h> #include <vector> using namespace std; int cows[1000001] = { 0 }; int social_distancing() { freopen("socdist2.in", "r", stdin); freopen("socdist2.out", "w", stdout); int n; cin >> n; for (int i = 0; i < n; i++) { int p, s; cin >> p >> s; if (s == 1) cows[p] = 1; ...
ALGO
0.999707
3.444061
45cc29bf-6415-42b3-b7a9-598321bf46da
iluzn/iluzn-competetive-programming
codeforces/AGAGA XOOORRR.cpp
// author: iluzn // created: 2021-04-29 14:10:10 #include <iostream> #include <string> #include <vector> #include <algorithm> #include <sstream> #include <queue> #include <deque> #include <bitset> #include <iterator> #include <list> #include <iomanip> #include <stack> #include <map> #include <set> ...
ALGO
0.999851
4.423654
6ffe011a-b4bd-472a-8607-3f81b1caa330
Marawan-Mohamed/Problem-Solving-training
level-1/codeforces/phase-1-2/A_Adjacent_Replacements.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' #define frni(i, _n_) for(int i = 0, _n = _n_; i < _n; ++i) #define SHORT_MAX ((short)0x7FFF) #define SHORt_MIN ((short)0x8000) #define USHORT_MAX ((unsigned short)0xFFFF) #define LL_MAX ((long long)0x7FFFF...
ALGO
0.999873
4.195588
a1c8aa61-f25d-47bf-a5e8-79af11699a12
OpenCFD/OpenFOAM-1.7.x
applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/strutil.cpp
#include "stdafx.h" #include "MASTER.h" #define TECPLOTENGINEMODULE /* ****************************************************************** ****************************************************************** ******* ******** ****** (C) 1988-2008 Tecplot, Inc. ...
TOOL
0.883779
6.233267
c6563cea-ff83-470a-938d-d42f18210dbd
htrcoin/htrcoin
src/rpcmining.cpp
#include "rpcserver.h" #include "chainparams.h" #include "main.h" #include "db.h" #include "txdb.h" #include "init.h" #include "miner.h" #include "kernel.h" #include <boost/assign/list_of.hpp> using namespace json_spirit; using namespace std; using namespace boost::assign; // Key used by getwork/getblocktemplate min...
WEB
0.951448
5.706311
96b717ba-438a-480f-bd1f-a103711730e9
LLstream/atcoder
abc362/a.cpp
#include <bits/stdc++.h> #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; using mint = modint998244353; #endif using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep1(i, s, n) for (ll i = s; i < n; i++) int main() { ll r,g,b; cin >...
ALGO
0.994001
5.448457
6839333f-5903-4032-8152-1e944232225c
soplima/ED2
BCC4001/ordenacao/practice/quick2.cpp
#include <iostream> #include <cstdlib> //funcao swap //funcao partition //o j e incrementado a cada loop //o ultimo elemento e escolhido como elemento // o i comeca no -1 // o i e incrementado quando j < pivot //chamar recursivamente void swap(int* v, int a, int b){ int temp = v[a]; v[a] = v[b...
ALGO
0.999975
5.468476
6311f28d-0575-4864-a56b-93431d4316f3
AnUbHaVafs/Dream_building_everyday
MAXSUMSQ.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; ll n; int a[100000]; int dp[100000]; int Another_dp[100000]; int finalAns1; unsigned long long int finalAns2; void maxSubArray() { dp[0] = a[0]; Another_dp[0] = 1; for(int i=1;i<n;i++){ if(dp[i-1] + a[i] > a[i]){ dp[i]...
ALGO
0.999271
3.787833
b9279d41-0206-4985-b3d3-8bcd615cb7e8
shreyakapoor08/CPP_Programs
29th august/divisible_subarrays.cpp
//divisible subarray /* you are given n elements . find the number of good sub arrays. good subarray is a sub array such that it is divisible by N*/ //concept of pigeon hole principle //1. build array of cumulative sum that will contain sum upto a particular index //sum till index 2 is b and sum till index 1 is a then...
ALGO
0.999569
4.404355
4f55afdd-4f5c-4d30-a6dd-0aa5f469a435
GabrielCortizo/Competitive-Programming-3
Problem Solving Paradigms/ Complete Search/Recursive Backtracking(Medium)/UVa524 Prime Ring Problem.cpp
#include<bits/stdc++.h> #define rep(i,b,c) for(int i = (int)b;i<(int)c;i++) #define clr(v,i) memset(v,i,sizeof(v)) using namespace std; typedef vector<int> vi; int n; bool memo[20]; bool isPrime(int v){ rep(i,2,(int)(sqrt(v)+1)){ if(v%i == 0) return false; } return true; } void dfs(int pos,vi &vet){ //cout <<...
ALGO
0.99994
3.913929
fe05413a-d27f-4c46-abcc-bdd2f54b63cd
jaredks/pyprimesieve
primesieve/src/ParallelPrimeSieve.cpp
/// /// @file ParallelPrimeSieve.cpp /// @brief ParallelPrimeSieve sieves primes in parallel using /// OpenMP 2.0 (2002) or later. /// /// Copyright (C) 2013 Kim Walisch, <<EMAIL>> /// /// This file is distributed under the BSD License. See the COPYING /// file in the top level directory. /// #include "conf...
ALGO
0.99824
7.221124
01d0740e-d4b8-40ba-a5db-361dd64c728b
intel/quantum-intrinsics
llvm/lib/Transforms/Scalar/LoopDeletion.cpp
#include "llvm/Transforms/Scalar/LoopDeletion.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/CFG.h" #include "llvm/Analysis/InstructionSimplify.h" #include "llvm/Analysis/LoopIterator.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/MemorySSA.h" #include "llvm...
ALGO
0.905632
7.759592
c966a45f-86fe-4005-a723-4cc8a24ed827
AVVKavvk/CP
3/EulerFunction/formula.cpp
#include<bits/stdc++.h> using namespace std ; #define pi 3.14 #define fli(a,b) for(int i=a;i<b;i++) #define flj(a,b) for(int j=a;j<b;j++) #define flk(a,b) for(int k=a;k<b;k++) #define ma(a,b) ( (a) > (b) ? (a) : (b)); #define mi(a,b) ( (a) < (b) ? (a) : (b)) ; #define pb push_back #define pob pop_back #de...
ALGO
0.999887
3.878749
75050d72-9a44-47be-b9a0-a3fc8612dd3c
mnhtng/C-plus-Algorithm
C++/Sort - Search - LowerBound - UpperBound/capSoCoTongNhoHonK.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n, k; cin >> n >> k; // int arr[n]; // map<int, int> mp; // for( int &x : arr ){ // cin >> x; // mp[x]++; // } // int temp = k - ...
ALGO
0.999912
3.73479
f6a9e818-9dc4-466f-825c-13f656c8de26
Priyanshi662/DSA
02-Strings/09-LPS.cpp
#include <iostream> using namespace std; string lps(string s) { int n=s.size(); int temp[n+1]; temp[0]=0; int i=0; int len=(n+1)/2; while(len<n) { if(s[i]==s[len]) { len++; temp[len]=i; i++; } else { if(...
ALGO
0.999955
4.029109
cc40307f-5c26-424d-9a6c-bf8f03ae5bec
CodeByTarek/Data-Structures
Mid Problem/Problem3.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: char c; Node* next; Node* prev; }; class List{ public: Node *head, *tail; List(){ head=NULL; tail=NULL; } void push(char ch); void print(); void removeVowels(Node* head); }; int main(){ st...
ALGO
0.999755
4.717289
5f95123d-180b-41b2-805a-c07bfb7c461c
Aman3325k/DSA-
Lec32/WaveForm.cpp
#include<iostream> using namespace std; void wave (int arr[][4], int row, int col) { for (int j=0; j<col; j++) { if(j%2 == 0) // Use '==' for comparison, not '=' { for(int i=0; i<row; i++) cout<<arr[i][j]<<" "; } else { for(int i=r...
ALGO
0.999715
5.04261
5fd719e5-f34a-4a09-af3c-c62e04860b1e
conjectureguy/CP_Templates
code_lib/code-library-main/Data Structures/Treap.cpp
#include<bits/stdc++.h> using namespace std; const int N = 2e5 + 9; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); struct node { node *l, *r; int key, prior; node(int id) { l = r = nullptr; key = id; prior = rnd(); } }; struct treap { node *root; treap() { root = null...
ALGO
0.999984
4.343179
de08c941-ea69-4e1f-aeec-5b6819debd9e
MarkKim1/random_study
Samgsung/9466.cpp
#include <iostream> #include <vector> #include <cstring> using namespace std; const int MAX = 100001; int graph[MAX], done[MAX], visited[MAX]; int cnt = 0; void solve(int curr_node) { visited[curr_node] = true; int next = graph[curr_node]; if (!visited[next]) { solve(next); } else if (!...
ALGO
0.999913
4.946046
b99fde94-f2de-4515-9066-69f446f8f290
RainPPR/oi-archive
20221017 NOIP2013/计数问题.cpp
#include<iostream> #include<cstdio> using namespace std; int main() { cout << time(0) << endl; int n, x, cnt = 0; scanf("%d %d", &n, &x); for (int i = 1 ; i <= n ; ++i) { int t = i; while (t) { if (t % 10 == x) ++cnt; t /= 10; } } printf("%d\n", cnt); return 0; }
ALGO
0.99928
3.721138
0054b453-baa1-41e1-8f88-4ee6a49cc6c4
kauKoala/if-you-are-rich-then-do-not-solve-algorithm
suheoon/code_tree_destory_turret.cpp
#include <bits/stdc++.h> using namespace std; const int MX = 10; int n, m, k; int turn; int board[MX + 1][MX + 1]; int t[MX + 1][MX + 1]; // 언제 공격했는지 pair<int, int> c[MX + 1][MX + 1]; bool a[MX + 1][MX + 1]; // 이번 턴에 관여한 포탑 여부 bool vis[MX + 1][MX + 1]; pair<int, int> attacker; pair<int, int> attacked; int dx[] = ...
ALGO
0.999928
4.593396
78316cce-83fe-41a9-a7ee-dc0ed534c3bb
ishandutta2007/codeforces
nishant403/normal/222/E.cpp
//AUTHOR : TIRTH JARSANIA //COLLEGE : DAIICT #pragma optimize("", off) #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma comment(linker, "/STACK:36777216") #include<bits/stdc++.h> using namespace std; #define INF LONG_LO...
ALGO
0.999986
3.825851
479a1a1f-177c-4a71-b2de-df50a41181a4
Jisan129/Algorithms
String Matching/Z Algo Wrong.cpp
#include <bits/stdc++.h> using namespace std; int Z[1000000]; void Zalgo(string basicString) { int length=basicString.length(); for (int i = 1; i < length; i++) { int count=0; int temp=i; for(int j = 0; j <length;j++){ if(basicString[temp++]==basicString[j]){ ...
ALGO
0.999751
3.988582
b65c4001-8fed-4e64-9eb6-b73bc44b3105
Aadarsh-ops/DS-practise
dataStructure/array/containsDuplicate.cpp
class Solution { public: bool containsDuplicate(vector<int>& nums) { sort(nums.begin(), nums.end()); for(int i=0;i<nums.size()-1;i++){ if(nums[i] == nums[i+1]){ return true; } } return false; } };
ALGO
0.999938
5.630117
41fc1a32-817e-4935-8761-2a1ad26ddcbe
aSyahriza/RedBlackTree-Deletion
.ccls-cache/@home@runner@Red-Black-Tree-P1-Rewriting-rotate-to-b-better/tree.cpp
#include "tree.h" #include <fstream> Tree::Tree(){ root = NULL; numOfNodes = 0; } Tree::~Tree(){ delete root; } void Tree::addFile(char* fileName){ // Checks if file exists ifstream tempFile; tempFile.open(fileName); if(tempFile){ // Reads through every value in file, adds to heap cout << "Fi...
ALGO
0.90845
3.892133
1a7b99e1-656e-4fac-90b2-e024b305276d
afernander/ST0245-033
talleres/taller08/Punto 1/ejemploPila.cpp
// g++ -g -o punto2 ejemploPila.cpp pila.o pilaStr.o #include <iostream> #include <string> #include "Pila.h" #include "pilaStr.h" #include <sstream> using namespace std; //variable gobal Pila *pila = new Pila(); PilaStr *operadores = new PilaStr(); Pila *operandos = new Pila(); PilaStr *operadoresImp = new PilaStr()...
ALGO
0.999304
3.639867
e984f7dd-51d9-4d14-8dde-19c9aaffe7ed
Kartik-Bhutra/DSA
binaryTree/traversals/inorder.cpp
#include <bits/stdc++.h> #include "tree.hpp" using namespace std; void inOrder(Tree *root, vector<int> &path) { if (root == nullptr) return; inOrder(root->left, path); path.push_back(root->val); inOrder(root->right, path); } vector<int> inorder(Tree *root) { if (root == nullptr) return {}; vector<in...
ALGO
0.999939
5.210277
47e23e7a-63c2-4f18-a629-8c0eb2b344d8
SuvratZZZ/solved
solved/cf962c.cpp
#include <bits/stdc++.h> using namespace std; # define ll long long #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> # define pb push_back # define fl(i,n) for(ll...
ALGO
0.999371
4.79019
95869b40-7123-4835-a236-9b76b17acc82
PythonSmall-Q/OI-Codes
5160.cpp
#include<bits/stdc++.h> #define ll long long #define mod 1000007 using namespace std; ll pri[7777]; stack <ll> num,ope; string mp[77],str; ll n,ans[777],len,i,j,k; char c; inline void read() { c=getchar(); while(c=='\n' || c=='\r') c=getchar(); while(c!='\n' && c!='\r'){if(c!=' ') mp[0]+=c;c=ge...
ALGO
0.999868
3.338367
05c08d41-6a08-4505-b15b-81573d684ed7
ishandutta2007/codeforces
kotamanegi/normal/667/C.cpp
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <cstring> #include <queue> #include <stack> #include <math.h> #include <iterator> #include <vector> #include <string> #include <set> #include <math.h> #include <iostream> ...
ALGO
0.999546
3.013564
34e778ee-4182-4d30-b5ea-8840a36bbf9f
s-Hames/Algorithms
insertion_sort.cpp
#include<iostream> using namespace std; void insertion_sort(int a[] ,int x) { for(int i=0;i<x;i++) { int temp = a[i]; int j=i-1; while(j>=0 && a[j] > temp) { a[j+1] = a[j]; j--; } a[j+1] = temp; } } int main() { cout<<"enter the nu...
ALGO
0.999853
3.945712
07ebe0cf-ac50-4378-b7b6-5278a264e380
Dev-RubinJo/AlgorithmCpp
AlgorithmC++/Algorithm/ProblemSolving/week6/21.04.30/17144-1.cpp
#include <bits/stdc++.h> using namespace std; int r, c, t, ans; int m1[51][51], m2[51][51]; int dx[] = {0, 0, 1, -1}; int dy[] = {-1, 1, 0, 0}; int ccw[] = {2, 0, 3, 1}; int cw[] = {2, 1, 3, 0}; vector<pair<int, int>> puri; void input() { cin >> r >> c >> t; for(int i = 0; i < r; i++) { for(int j = 0; j...
ALGO
0.999913
3.753004
343359f5-9346-4225-ad5e-c6c3798bb16a
ishandutta2007/codeforces
joyfun/normal/150/B.cpp
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int MOD = 1000000007; int n, m, k; int pow_mod(int x, int k) { int ans = 1; while (k) { if (k&1) ans = 1LL * ans * x % MOD; x = 1LL * x * x % MOD; k >>= 1; } return ans; } int solve() { if...
ALGO
0.999994
4.327182
891ac3ec-8a78-46a4-8565-80eb928b51a0
Meghak1/Leetcode-
931 Minimum falling path sum.cpp
class Solution { public: int minFallingPathSum(vector<vector<int>>& matrix) { int row=matrix.size(); int col=matrix[0].size(); for (int r=1; r<row; ++r) { for (int c=0; c<col; ++c) { int prev_row=matrix[r-1][c]; int prev_col=(c>0) ? matrix[r-1][c-1]:INT_MAX; int next_col...
ALGO
0.999995
6.337955
89d2dd8a-3231-47ad-b972-dc0c63b5e468
ArcEarth/OpenAvataring
dlib/dlib/test/find_max_factor_graph_viterbi.cpp
#include "tester.h" namespace { using namespace test; using namespace dlib; using namespace std; logger dlog("test.find_max_factor_graph_viterbi"); // ---------------------------------------------------------------------------------------- dlib::rand rnd; // ----------------------------------...
TEST
0.91893
6.397779
f6ab8e06-de10-4c37-8520-d4228676ac22
Ajaykr2109/June-PEP
Self_practice/interview.cpp
#include <bits/stdc++.h> using namespace std; int main() { int arr[] = {0, 5, 7, 8, 9, 0, 0}; int n = sizeof(arr) / sizeof(arr[0]); int ans[n] = {0}, j = 0; for (int i = 0; i < n; i++) { if (arr[i] == 0) { j++; continue; } } for (int i = 0; i <...
ALGO
0.999939
3.208969
92010d68-ef79-46eb-9b59-6b61bba611ef
panyong198801/omr_C_plus_plus
ImgProcess/ImgProcess/opencv_src/opencv-1.0.0/apps/haartraining/src/performance.cpp
/* * performance.cpp * * Measure performance of classifier */ #include "cv.h" #include <stdio.h> #include <math.h> #include <highgui.h> #include <time.h> #ifdef _WIN32 /* use clock() function insted of time() */ #define time( arg ) (((double) clock()) / CLOCKS_PER_SEC) #endif /* _WIN32 */ #ifndef PATH_MAX #define...
ALGO
0.863173
5.613831
dcedde7a-46c7-461d-b697-ea8b3a55f1b0
sczeigenfuse/btc1
src/merkleblock.cpp
#include <merkleblock.h> #include <hash.h> #include <consensus/consensus.h> #include <utilstrencodings.h> CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter* filter, const std::set<uint256>* txids) { header = block.GetBlockHeader(); std::vector<bool> vMatch; std::vector<uint256> vHashes; v...
ALGO
0.998525
6.177397
30d7b963-fc98-40f5-8d5c-7e51084539b4
wicknix/AF-OSX-PPC
gfx/thebes/gfxVR.cpp
#include <math.h> #include "prlink.h" #include "prmem.h" #include "prenv.h" #include "gfxPrefs.h" #include "gfxVR.h" #include "nsString.h" #include "mozilla/Preferences.h" #include "ovr_capi_dynamic.h" #include "nsServiceManagerUtils.h" #include "nsIScreenManager.h" #ifdef XP_WIN #include "gfxWindowsPlatform.h" // ...
TOOL
0.909916
6.547165
ceb71e62-6e6c-4a5d-925a-0e59d3c47470
cyscgzx33/Leetcode-Practice
Algorithm_in_topics/binary_tree/verify_preorder_serialization_of_a_binary_tree.cpp
class Solution { private: bool traverse(std::string& preorder, int& idx) { if ( idx >= preorder.size() ) return false; if ( preorder[idx] == '#' ) { idx += 2; return true; } while (idx < preorder.size() && preorder[idx] <= '9' && preorder[idx] >= '0') idx++; if (idx < preorder.size() && preo...
ALGO
0.999916
5.229102
f55c9662-f3e8-44d1-ac13-fedbd4b11298
Nikitiwe/Leetcode
1994-minimum-number-of-swaps-to-make-the-binary-string-alternating/1994-minimum-number-of-swaps-to-make-the-binary-string-alternating.cpp
class Solution { public: int minSwaps(string s) { int one=0, zero=0; for (int i=0; i!=s.size(); i++) { if (s[i]=='1') one++; else zero++; } if (abs(one-zero)>1) return -1; int ans=0, ans1=0;; if (one>zero) { for (int...
ALGO
0.999997
5.640429
31b5d7d9-e3ce-4ff4-8899-e0663c082839
gtraines/fuz-cy-logic
CPPCODE/MTFZMLG.CPP
/*------------------------------------------------------------* *--------------------Procedure Description--------------------* | mtfzmlg.cpp Earl Cox 04/01/93 Monotonic Reasoning | | In monotonic or proportional fuzzy reasoning the value of | | the model state is implicitly determined by the truth values|...
ALGO
0.997147
5.766176
d4ce17ec-8167-4aec-b60f-d256fa28e683
AkshaySB2000/ADA_1BM18CS011
msortdivideby3.cpp
#include<algorithm> #include<iostream> #include<bits/stdc++.h> void merge(int t[], int low, int mid1, int mid2, int high, int a[]); void mergesort(int t[], int low, int high, int a[]); void mergesortdup(int n, int a[]); using namespace std; int main() { int n,a[1000],i; cout<<"Enter the number of elements\n"; cin>>n...
ALGO
0.999906
4.090945
5e215b72-ca36-4344-842f-b9577033767f
CodeTrans-Research/RefuTra
result/translate/chatgpt/java2cpp/c++_eval/LEXICOGRAPHICAL_CONCATENATION_SUBSTRINGS_STRING.cpp
#include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include <bits/stdc++.h> using namespace std; string f_gold ( string s ) { int n = s . length ( ); int sub_count = n * ( n + 1 ) / 2; string arr [ sub_count ]; int index = 0; for ( int i = 0; i <...
ALGO
0.999933
5.655745
eb827381-1c26-497b-993c-d26229f32b19
abdullaabdullazade/rio-semifinal-submissions-2025
RIO2025_Semifinal_S3 (9).cpp
#include <bits/stdc++.h> #define int long long #define endl '\n' using namespace std; const int N = 1e5 + 5; const int INF = 1e18; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); /// bismillah int t = 1; cin >> t; while(t--) { int n; cin >> n; int a[n] , b...
ALGO
0.999743
3.94839
d2a22f08-2df6-41a4-b4df-a7b0c39706d2
AbhishekXmishra/Leetcode
802-k-th-smallest-prime-fraction/k-th-smallest-prime-fraction.cpp
class Solution { public: vector<int> kthSmallestPrimeFraction(vector<int>& arr, int k) { int n = arr.size(); priority_queue<vector<double>> pq ; for(int i = 0 ; i < n-1 ; i++){ for(int j = i+1 ; j <n ; j++){ double div = (double) arr[i]/arr[j]; pq.push(vector<...
ALGO
0.99993
4.973314
31322c80-c4d6-49a2-adc7-ef91dfd639b4
tacohed393/VR_1
Library/PackageCache/com.unity.ide.visualstudio@2.0.21/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp
#include <iostream> #include <sstream> #include <string> #include <filesystem> #include <windows.h> #include <shlwapi.h> #include <fcntl.h> #include <io.h> #include "BStrHolder.h" #include "ComPtr.h" #include "dte80a.tlh" constexpr int RETRY_INTERVAL_MS = 150; constexpr int TIMEOUT_MS = 10000; // Often a DTE call m...
TOOL
0.952856
6.926379
66766096-31a8-4ffb-8414-5d62fc8b6e28
ParadigmHyperloop/Dynamic_Controls
drake/drake/systems/controllers/QPCommon.cpp
#include "QPCommon.h" #include "controlUtil.h" #include <map> #include <memory> #include <lcm/lcm-cpp.hpp> #include "lcmUtil.h" #include "testUtil.h" #include "lcmtypes/drake/lcmt_zmp_com_observer_state.hpp" const bool CHECK_CENTROIDAL_MOMENTUM_RATE_MATCHES_TOTAL_WRENCH = false; const bool PUBLISH_ZMP_COM_OBSERVER_STA...
ALGO
0.996376
6.147614
5dab8081-17f4-472c-9312-dada5412781b
101magikarp101/USACO
cses/additional-problems/counting-lcm-arrays.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define MOD 998244353 #define MOD2 1000000007 #define vt vector template <class T> using vvt = vt<vt<T>>; template <class T> using vvvt = vt<vvt<T>>; template <class T> using vvvvt = vt<vvvt<T>>; typedef vt<int> vi; typedef vvt<int> vvi; typedef vvvt<i...
ALGO
0.999972
5.3043
f750e6ec-1ea5-46e3-b3a2-ea3e9520e001
Ibn-Omar-Romel/Competitive_Programming_Codeforces
Solved/A_New_Year_and_Hurry.cpp
#include<iostream> using namespace std; int main() { int n , k; cin>>n>>k; int value = 240 - k ; int i = 1, count = 0; while(1) { value = value - (i * 5); if(value >= 0){ count++; i++; if(count == n) break; } ...
ALGO
0.999863
3.333154
2deaf30d-e888-4a73-b525-8f0fb666ae7a
HPDell/Tin2Dem
Eigen/bench/benchmark.cpp
// g++ -O3 -DNDEBUG -DMATSIZE=<x> benchmark.cpp -o benchmark && time ./benchmark #include <iostream> #include <Eigen/Core> #ifndef MATSIZE #define MATSIZE 3 #endif using namespace std; using namespace Eigen; #ifndef REPEAT #define REPEAT 40000000 #endif #ifndef SCALAR #define SCALAR double #endif int main(int ar...
ALGO
0.991052
3.675187
97c9bbef-b360-490c-8882-ab363aeef11e
dqx1130/CppWork
wlacm/week11指针/03【函数的指针参数】求解鸡兔问题.cpp
#include <stdio.h> int calc(int , int , int* , int*); int main(){ int h , f; while(scanf("%d %d",&h,&f) != EOF){ int c,r; if(calc(h,f,&c,&r)){ printf("%d %d\n",c,r); }else{ printf("no solution\n"); } } return 0; } int calc(int h,int f, int *chi , int *rab){ if(f % 2 != 0){ return 0; } *chi = (4...
ALGO
0.999956
3.173768
24d79cf6-bffc-430c-9fbd-28d161e14d62
fpiesik/NoiseBot
software/Bass/BassCtl-frmwr/libs/AudioTuner/AudioTuner.cpp
#include "utility/dspinst.h" #include "arm_math.h" #include "Arduino.h" #include "AudioTuner.h" #define NUM_SAMPLES ( AUDIO_GUITARTUNER_BLOCKS << 7 ) void AudioTuner::update( void ) { audio_block_t *block; block = receiveReadOnly(); if (!block) return; if ( !enabled ) { release(...
ALGO
0.990271
6.029579
4eb3527f-bc4d-4fe3-a949-63afee234a04
heduenas/codeforces
codeforces_194/a.cpp
#include<stdio.h> #include<iostream> #include<math.h> #include<string.h> #include<algorithm> #include<vector> #include<stack> #include<queue> using namespace std; long long n, ans; int main () { cin >> n; long long i; for ( i = 1; i <= n; i *= 3) { if ((n / i) % 3 > 0) break ; } i *= 3; ans = (n + i ...
ALGO
0.999931
3.52557
75fe3e09-9ffd-4490-a7cd-3eb466cb56c7
Lucynano/FoncRecursive
Produit_NxM.cpp
#include <bits/stdc++.h> using namespace std; int produit(int n, int m) { if(m == 0) return 0; //produit(n, 0)=0; return n+produit(n, m-1); //produit(n, 1)=n+0; produit(n, 2)=n+n; produit(n, 3)=n+n+n; ... } int main() { int n, m; cin >> n >> m; cin.ignore(); cout << produit(n, m) << "\n";...
ALGO
0.999905
4.026004
6f962b31-1444-4762-bc36-b439e8bff4f0
chiwwwra/CodeStack-CPP
C++/dsa12-1.cpp
#include<iostream> using namespace std; int main() { int i=1,count=1,n; cin>>n; while(i<=n) { int j=1; while(j<=n) { cout<<count<<" "; count++; j++; } cout<<endl; i++; } return 0; }
ALGO
0.999973
3.380157
9f1b80c2-54fd-4121-87ba-877038d24ac9
Ranj8521Kumar/Leetcode_chalanges
2599-take-k-of-each-character-from-left-and-right/take-k-of-each-character-from-left-and-right.cpp
class Solution { public: int takeCharacters(string s, int k) { // Total counts int n = s.size(); int count_a = 0; int count_b = 0; int count_c = 0; for(const auto &it: s){ if(it == 'a'){ count_a++; }else if(it == 'b'){ ...
ALGO
0.999961
5.759192
71a0fee4-7b13-40c2-affd-23b6ead00b5f
kacrat99/MySpojTasks
[1] MWP8_1F - XV2.cpp
#include <iostream> #include <vector> using namespace std; int main() { ios_base::sync_with_stdio(0); vector <int> num; int sum, t; char c; cin >> t; c = cin.get(); while(t--) { sum = 0; while(c = cin.get()) { if(c == '\n') break; num.push_back(c-'0'); sum += num.back(); } while(sum % 3 != ...
ALGO
0.999762
4.081349
44be449e-f290-4903-8d74-d30dac7d5e0c
apsoei/Engineering_Computation
ps1-2.cpp
#include <iostream> #include <stdlib.h> #include <time.h> using namespace std; int main() { int randomNumber, guess; int answer = 1; srand(time(nullptr)); time_t start, end; for (int i = 0; i < 3; i++){ randomNumber = (rand()%9) + 1; answer = randomNumber * answer; cout << randomNu...
ALGO
0.994623
3.457506
86105a8b-97f7-4af7-9e14-e96863d03bf5
cymans/CPP-Programming
CPP-1/CPP_Practice/add_two_3x3_matrices.cpp
#include <iostream> using namespace std; //Global variable to store number of rows and columns const int rows = 3; const int columns = 3; //Function to input elements in the matrices void getMatrixElements(int matrix[][columns]) { for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { cout << "E...
ALGO
0.999387
3.946151
20cfc033-7498-483c-b30c-b21f0ee935d9
David0tt/DeepGTAV
DeepGTAV-PreSIL/Rewarders/SpeedRewarder.cpp
#include "SpeedRewarder.h" SpeedRewarder::SpeedRewarder(float _setSpeed) { setSpeed = _setSpeed; } float SpeedRewarder::computeReward(Vehicle vehicle) { float reward = ENTITY::GET_ENTITY_SPEED(vehicle) / setSpeed; if (reward > 1.0f) reward = (1.0f - reward); if (reward < -1.0f) reward = -1.0f; return reward; }
ALGO
0.914845
5.383695
4df67724-0e3d-4cfe-ac4e-d27ff634325c
crazyofapple/icpcacm
再谈线段树之picture.cpp
#include<iostream> #include<stdio.h> #include<algorithm> #include<math.h> using namespace std; int ym[10200];//עҪ ȻRE struct Tree { int li,ri,lb,rb;//li,riҶ˵ֵ int lenth,ans,cover;//lenthʾһεij //ans¼,lb,rb¼Ҷ˵㱻Ǵ //cover¼䱻ǵĴ } s[50000]; struct node { int x,y1,y2; int flag; } t[50000]; //ʾұߵĽڵ i...
ALGO
0.99948
3.173222
f005ac6b-1b5f-4f50-9261-8deed0ba9c97
tiredmoth/estudos-c
7.8.2 multas.cpp
#include<stdio.h> float carro, limite, dif; int main(){ printf("Digite a velocidade do carro\n"); scanf("%f", &carro); printf("Digite o limite do dia\n"); scanf("%f", &limite); dif=carro/limite; if (dif<1){ printf("Carro dentro do limite");} else if (dif<=1.2){ printf("Multa de 85 reais e 4 pontos...
TOOL
0.997525
3.969802
6684696e-1fc9-456f-b241-a62a6e59ae30
KuyucuOguz/cs202
cs 202/hw3/BinarySearchTree.cpp
/* * Title: Trees * Author: Ouz Kuyucu * ID: 21902683 * Section: 1 * Assignment: 2 * Description: implementation of binary search tree */ #include "BinarySearchTree.h" BinarySearchTree::BinarySearchTree() { head = NULL; indexx = -1; } BinarySearchTree::~BinarySearchTree() { //dtor } /*struct Node(int val...
ALGO
0.999383
4.539949
e92c6d2f-71bc-4f71-8ec5-085f1add14f8
emacser0/acmicpc_problem_solving
Smilegate/Smilegate/3.cpp
#include <iostream> #include <string> #include <sstream> #include <vector> #include <regex> #include <cassert> // Է // ٿ ڿ ־. // ڿ Ʒ . // // [NumberString]([Base]) + [NumberString]([Notation]) = ([ResultBase]) // NumberString = string // Base = 2 | 8 | 16 // // Է¿ Result Base Բ . // [NumberString]([ResultBase]...
ALGO
0.984451
5.503588
a53ae383-b53f-4724-89a9-b84e6c34e077
ishandutta2007/codeforces
_guoyh_/normal/1183/H.cpp
# include <cstdio> # include <cstring> # include <algorithm> # define ll long long using namespace std; const int MAXN = 105; int n; ll k, ans; char s[MAXN]; int last[31]; int pre[MAXN]; ll f[MAXN][MAXN]; int main(){ scanf("%d%lld", &n, &k); scanf("%s", s + 1); for (int i = 1; i <= n; i++){ pre[i] = last[s[i] - 'a...
ALGO
0.999991
3.522397
5cef0bcf-8535-4ba4-b89d-901ce5c643f7
SamBobBarnes/AdventOfCode2024
Day8/Part2.cpp
#include <set> #include <map> #include "Day8.h" #include "../Point.h" int Day8::Part2() { const auto lines = Helpers::readFile(8, false); const int width = lines[0].length(); const int height = lines.size(); map<char, vector<Point> > antennaGroups{}; set<Point> antiNodes{}; for (int y = 0; ...
ALGO
0.99901
5.222358
625dd8f3-bd08-45b9-a83c-c1fe2e5de05e
takaoki-cpp/atcoder
Contests/Educational DP Contest/Programs/Grid 1.cpp
#include <cstdio> #include <cstring> using namespace std; const int MAX_WIDTH = 1005, MAX_HEIGHT = 1005, MOD = 1e9 + 7; const char WALL = '#'; char grid[MAX_WIDTH][MAX_HEIGHT]; long long no_of_paths[MAX_WIDTH][MAX_HEIGHT]; int main() { int height, width; scanf("%d %d", &height, &width); for(int i = 1; i...
ALGO
0.999973
4.494624
05093b4b-8849-4a1e-be33-3c4cb5eb24a4
shogun-toolbox/shogun
src/shogun/converter/ica/SOBI.cpp
#include <shogun/converter/ica/SOBI.h> #include <shogun/features/DenseFeatures.h> #include <shogun/mathematics/Math.h> #include <shogun/mathematics/eigen3.h> #include <shogun/mathematics/ajd/JADiagOrth.h> using namespace shogun; using namespace Eigen; namespace { MatrixXd cor(MatrixXd x, int tau = 0, bool mean_flag...
ALGO
0.98914
6.818759
b089c54d-961b-4c35-95ce-7f1759d68a84
XiangqianMa/Aim-At-Offer
16_power/power.cpp
// // Created by mxq on 2020/2/4. // #include "power.h" bool invalid_input = false; double Power(double base, int exponent){ invalid_input = false; if (base == 0 && exponent < 0){ invalid_input = true; return 0; } auto abs_exponent = (unsigned int)(exponent); if (exponent < 0) ...
ALGO
0.992216
5.473906
b1a6f18f-d53c-4773-86ea-ee3b86e69306
Divya063/programming
codeforces/round_538/A.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define N 100005 #define MOD 1000000007 #define dd double #define DEBUG(x) cout << '>' << #x << ':' << x << endl; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); //ios_base& scientific (ios_base& str); ll n; cin >> n; ll arr[n]; for(int ...
ALGO
0.99984
4.110418
2c4de678-330f-4313-be2b-9ce3751f284e
algorithm001/algorithm
Week_01/id_16/LeetCode_21_16.cpp
/**[链表][简单] 将两个有序链表合并为一个新的有序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例: 输入:1->2->4, 1->3->4 输出:1->1->2->3->4->4 */ /* 个人感悟: 指针的使用要好好琢磨 疑惑:指针当初创建出来时为了解决什么问题, 没有指针的语言是如何实现链表。 */ /* 思路1:将一个链表逐个插入另一个链表中 */ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x...
ALGO
0.999917
5.568348
c8c41c95-e581-4c3d-b48c-ca12efa21fbb
kingjedidiah01/flutter_Builds
demo_app/flutter_applearn/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.998159
6.761023
110ec50c-0db4-41c1-a389-d15290128cb4
raincross7/code-similarity
codes/train_code/problem164/problem164_400.cpp
#include <iostream> int main() { int k, a, b; std::cin >> k >> a >> b; std::string res = "NG"; for(std::size_t i = a; i <= b; ++i) { if((i % k) == 0) { res = "OK"; break; } } std::cout << res; return 0; }
ALGO
0.998564
4.117242
5d790596-2232-47ab-b7a9-2268dd783794
austinmw/Cpp-code
FILEIO_hash.cpp
#include <iostream> #include <fstream> #include <sstream> #include <vector> #include <string> #include <queue> #include "trie.h" using namespace std; void getFileData(vector<string> &data1, vector<string> &data2, vector<string> &queries1, vector<string> &queries2, vector<int> &counts1, vector<int> &counts2) { ...
ALGO
0.969465
4.276532
abdc91a8-05de-496c-baf9-ef0bb1109184
ithemal/DiffTune
llvm-mca-parametric/llvm/lib/Support/IntervalMap.cpp
#include "llvm/ADT/IntervalMap.h" namespace llvm { namespace IntervalMapImpl { void Path::replaceRoot(void *Root, unsigned Size, IdxPair Offsets) { assert(!path.empty() && "Can't replace missing root"); path.front() = Entry(Root, Size, Offsets.first); path.insert(path.begin() + 1, Entry(subtree(0), Offsets.seco...
ALGO
0.985794
6.213988
596d8bbc-18bd-4e70-bd2b-661766a8e9dc
ImportMengjie/Leetcode
16.3-sum-closest.cpp
/* * @lc app=leetcode id=16 lang=cpp * * [16] 3Sum Closest */ #include <algorithm> #include <vector> using namespace std; class Solution { public: int threeSumClosest(vector<int> &nums, int target) { sort(begin(nums), end(nums)); int closest = nums[0] + nums[1] + nums[2]; for (int ...
ALGO
0.999985
6.348814
7e7c5ab0-fd62-4d25-9c4c-eca3b6495246
DerTeufel/lineage20_frameworks_av
media/codecs/amrnb/common/src/weight_a.cpp
/* Pathname: ./audio/gsm-amr/c/src/weight_a.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Put file into template and first pass at optimization. Description: Made changes based on comments from the review meeting. Used pointers instead of inde...
ALGO
0.999609
6.035372
04dfcf74-cbea-448f-abf1-24105efd40ef
blockspacer/bootstrap-redux
ext/boost-1.70.0/libs/flyweight/example/composite.cpp
#include <boost/flyweight.hpp> #include <boost/functional/hash.hpp> #include <boost/tokenizer.hpp> #include <boost/variant.hpp> #include <boost/variant/apply_visitor.hpp> #include <boost/variant/recursive_wrapper.hpp> #include <iostream> #include <stdexcept> #include <string> #include <vector> using namespace boost::f...
TOOL
0.956258
7.398005
055f4987-9a0e-4e42-9c89-5e000f7751c6
SonaliFlorenceG/Leetcode
2144-maximum-difference-between-increasing-elements/maximum-difference-between-increasing-elements.cpp
class Solution { public: int maximumDifference(vector<int>& nums) { int minVal = nums[0]; int maxDiff = -1; for (int i = 1; i < nums.size(); i++) { if (nums[i] > minVal) { maxDiff = max(maxDiff, nums[i] - minVal); } else { minVal = nums...
ALGO
0.999986
6.029187
ff41efc1-1914-46a4-ab93-3a9bbc96dde8
anshgupta6031/Cpp
02_practice/practice_13.cpp
// find the second maximum number in an array. #include <bits/stdc++.h> using namespace std; int main(){ int n; cout<<"enter the size of array"<<endl; cin>>n; int arr[n]; cout<<"enter the elements of the array."<<endl; for (int i=0; i<n; i++){ ...
ALGO
0.999508
4.710427
059b4e27-37e5-42d6-a330-9eeddb5a06e8
vishal1202verma/PW-C-and-DSA-full-cource
Week16_Stack/Stack-1/LinkedListimplementionofStack.cpp
#include<iostream> #include<vector> using namespace std; class Node{ // user defined datatype public: int val; Node* next; // constructor Node( int val){ this->val = val; this->next = NULL; } }; class stack{ // user defined data struvture public: Node* head; int size; ...
ALGO
0.992879
3.959715