uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
6188ccb8-637e-438f-b784-e78f7cc7780c
anasmak04/Leetcode-1
Tree/Maximum-Depth-Of-Binary-Tree.cpp
class Solution { public: int maxDepth(TreeNode *root) { if (root == NULL) return 0; int l = maxDepth(root->left); int r = maxDepth(root->right); return 1 + max(l, r); } };
ALGO
0.999197
5.957454
87969673-0c2b-4518-9871-cfbfa6e44292
zerovm/llvm-port
lib/CodeGen/LiveIntervalAnalysis.cpp
#define DEBUG_TYPE "regalloc" #include "llvm/CodeGen/LiveIntervalAnalysis.h" #include "LiveRangeCalc.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/CodeGen/LiveVariables.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/Machi...
TOOL
0.97325
7.835721
722bd9df-f1db-4d9e-acd8-5a9247c43045
Manraj-Mann/Enhanced-CPP-Notes
Function Overloading and Function Templates/007_functionTemplateInstantiation.cpp
#include <iostream> /* Notes : 1. Function templates are not actually functions -- their code isn’t compiled or executed directly. Instead, function templates have one job: to generate functions (that are compiled and executed). 2. The process of creating functions (with specific types) from function te...
TOOL
0.950504
6.631185
99b45d90-99d0-428d-af11-92e12b6bd34b
KennyChiu0503/Algorithm-and-Problem-Solving-Practice
week1/src/Part-A/InsertionSort.cpp
#include <bits/stdc++.h> using namespace std; const int maxN = (int)2e7; // array for input numbers int A[maxN], n; int main() { int i,j,k; freopen("random_num.in", "r", stdin); cin >> n; for(i=0; i<n; i++) cin >> A[i]; // perform Insertion Sort for(i=0; i<n; i++) { int...
ALGO
0.999956
4.370111
e796a82f-9852-4cff-90ac-b3f783c7218e
TheAlphaJas/Striver-TuF-A2Z
Arrays/Lec 3/2. Majority Element II.cpp
class Solution { public: vector<int> majorityElement(vector<int>& nums) { vector<int> ans; map<int,int> mp; for(auto x:nums) {mp[x]++;} vector<pair<int,int>> f; for(auto x:mp) {f.push_back({x.second,x.first});} sort(f.begin(),f.end()); reverse(f.begin(),f.end(...
ALGO
0.999976
5.709225
a8ef3d16-f2c7-4aca-ad2f-ad47c6a377f1
Kiritouse/Algorithm
最长的公共前缀/最长的公共前缀 main.cpp
#include <stdio.h> #include <string.h> int judge(int num,char ch[][200]){ int Index01 = strlen(ch[0]);//֪ʶ //άstrlenʲô ҪŪ //Եһнɨ //Ҳ˵index01ʵǵ0ַij for(int i = 0;i<Index01;i++){//һַÿһַ char ch2 = ch[0][i];//һַĵiַ for(int j = 1;j<num;j++){//ַ int templen = strlen(ch[j]);//ǰַij,һմУʱʡ if(i==templen|...
ALGO
0.999732
3.484445
574674d9-874c-47cc-8d11-33e3b47d5010
LewiesCheng/Code
ACM practice/16-矩阵嵌套(NYOJ).cpp
/** Ƕ **/ /* from NYOJ-16 */ #include<iostream> #include<cstdlib> using namespace std; //ѰҸþǶ׾ int findMax(int *a, int *b, int *count, bool *temp, int n, int sigh){ int max = count[sigh]; for(int i=0; i < n; i++){ if((a[sigh] > a[i] && b[sigh] > b[i]) || (a[sigh] > b[i] && b[sigh] > a[i])){ if(temp[i]) ...
ALGO
0.99986
3.962155
64c2f9d2-e41e-444a-b2b0-aced7490c6c6
hs094/CP
CodeChef/Practice/Peer/INDX12.cpp
#include <bits/stdc++.h> using namespace std; template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; } template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::va...
ALGO
0.999927
4.959455
e50ba768-7541-4f30-a170-087cd481e8d1
yuichiro-kurose/kyopro
joi/joi2013/yosen/c/main.cpp
// author: Yuichiro Kurose #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; string name; cin >> name; int ans = 0; while (n--) { string s; cin >> s; for (int i = 0; i < s.size(); i++) { bool f; for (int d...
ALGO
0.999618
4.011161
d549daf5-abf8-4a3c-8728-ccae10ee0646
yangtianjian/Typical_algorithms
algorithms/graph_algorithms/graph.cpp
#include "graph.hpp" // The implementation of sparse graph is in hpp file because sparse graph is a template class DenseGraph::DenseGraph(int total_node, int not_connected_const, bool calculate_edge, bool suppress_warnings): DenseGraph() { _dynamic_mode = true; _suppress_warni...
ALGO
0.995004
5.63154
72811b07-72dc-4e18-8d36-0395c7530315
KhronosGroup/SPIRV-LLVM
lib/CodeGen/IfConversion.cpp
#include "llvm/CodeGen/Passes.h" #include "BranchFolding.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/Statistic.h" #include "llvm/CodeGen/LivePhysRegs.h" #include "llvm/CodeGen/MachineBlockFrequencyInfo.h" #include "llvm/CodeGen/MachineBranchProbabilityInfo.h" #include "llvm/Code...
ALGO
0.952468
6.346034
f73ca83b-6b98-4c44-8166-d08fbe7b24b0
lovelybigduck/note
代码练习/刷题/LeetCode/18-四数之和.cpp
//18-֮ #include <iostream> #include <algorithm> #include <string> #include <cstring> #include <cstdlib> #include <cstdio> #include <vector> #include <map> #include <sstream> #include <set> using namespace std; //Ҫü֦Ϳȥظʹset class Solution { public: vector<vector<int>> fourSum(vector<int>& nums, int target) { ...
ALGO
0.999982
4.92406
e9176f45-a6bd-4266-a3eb-c6b6323736de
kyw04004/ProblemSolving
BOJ/2357_최솟값과 최댓값.cpp
#include<cstring> #include<string> #include<algorithm> #include<iostream> #include<stdio.h> #include<vector> #include<cmath> using namespace std; int h, n, m, k, Min = 1e9, Max; vector<pair<int, int>> tree; int arr[100001]; void query(int left, int right) { left += h; right += h; Min = 1e9, Max = 0; for (; left < r...
ALGO
0.999984
4.013564
04a5583b-6ffa-4b20-a7c5-b2fc2e3238d7
Vip2016-0/-SdeSheetChallenge_by_Striver
SDE_SHEET/Binary Tree/Binary Tree (Miscellaneous)/Kth_largest_element_in_unsorted_array.cpp
// Time Complexity :- O(nlogk) // Space Complexity :- O(k) int kthLargest(vector<int>& arr, int size, int K) { priority_queue<int, vector<int>, greater<int>> pq; for(int i = 0 ; i < size ; i++){ if(i < K) pq.push(arr[i]); else{ if(pq.top() < arr[i]){ ...
ALGO
0.999937
5.325439
d8ab61dc-6804-4a75-8bac-eef41b79a90e
littlewyy/OI
hdu 4699.cpp
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; const int MAXN = 1E6 + 5; int n; int top[2],St[2][MAXN],Sum[MAXN],Max[MAXN]; int read()//˸! { char ch = getchar(); int w = 0 , tmp = 1; while((ch < '0' || ch > '9') && ch != '-') ch = getchar(); if(ch == '-') tmp = -1 , ...
ALGO
0.989867
3.367288
f58146d6-1110-4c1f-8f24-aff4d2abaa95
algorithm006-class02/algorithm006-class02
Week_06/G20200343030614/LeetCode_130_614.cpp
const int maxn=0x7fffff; int father[maxn]; class Solution { public: int find(int x) { int j=x; while (father[x]!=x) { x=father[x]; } while (father[j]!=x) { father[j]=x; } return x; } void uni(int i,int j) { int f1=find(i); ...
ALGO
0.999909
5.623586
10103017-57af-42b1-b976-cf39a66c7310
Samdroid27/DSA
Codeforces/1669/C.cpp
#include <bits/stdc++.h> using namespace std; map<int,int> mp; int main() { int test; cin>>test; while(test--){ int n; cin>>n; int a[n]; for(int i=0;i<n;i++) cin>>(a[i]),a[i]%=2; if(n<=2){ cout<<"YES"<<endl; continue; } int op=a[0],ep=a[1]; bool flag=true; for(int i=2;i<n;i+=2){ if(a[i...
ALGO
0.999824
4.056091
f41c5d69-3b97-4795-8436-7f49471ebb59
ishandutta2007/codeforces
jovanb/normal/912/E.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; const ll MAX = 1000000000000000000LL; vector <ll> vals[2]; ll p[20]; ll lim; int _n; void gen(ll val, int ind){ if(ind > _n){ vals[ind%2].push_back(val); return; } if(lim/val >= p[ind]){ g...
ALGO
0.999981
3.997544
ff3138a7-73f2-46b8-958f-75e63d2630b5
david2du/david_training
sng/2020/summer_training/U3/OJ-1973.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool ok(int a, int b, int c, int systems) { ll n1, n2, n3; while (a > 0) { n1 *= systems; n1 += (a % 10); a /= 10; } while (b > 0) { n2 *= systems; n2 += (b % 10); b /= 10; ...
ALGO
0.9993
4.435587
284f7019-37ec-4df0-bf99-278dd7ff18c2
Wahid-Murad/News-App
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.998859
6.785645
1ebcb55e-7238-4e65-8684-cb4d7390f900
thanh-nguyen03/CPP-Code
CodePTIT-CPP/CodePTIT-CPP-Vn/CPP0429_SUA_DEN.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double db; const long long mod = 1e9 + 7; #define faster() ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define pb push_back #define all(x) x.begin(), x.end() #define vi vector<int> #define vll vector<ll> #define tester() int t;...
ALGO
0.999921
3.933103
8f47f35b-f3b6-40c1-ba11-8d0d8d7da352
Robin329/CPlusPlusThings
learn_algorithms/leetcode/algorithms/cpp/videoStitching/VideoStitching.cpp
// Source : https://leetcode.com/problems/video-stitching/ // Author : Hao Chen // Date : 2019-10-01 /***************************************************************************************************** * * You are given a series of video clips from a sporting event that lasted T *seconds. These video clips can...
ALGO
0.99996
6.436435
41cfd3a8-97a6-40a2-955b-b18be8acf4b4
omnirepo/frameworks_av
media/libstagefright/codecs/mp3dec/src/pvmp3_mdct_18.cpp
/* ------------------------------------------------------------------------------ PacketVideo Corp. MP3 Decoder Library Filename: mdct_18.cpp Date: 09/21/2007 ------------------------------------------------------------------------------ REVISION HISTORY Description: ------------------------------...
ALGO
0.999747
5.616552
dbf4147c-e9e2-4b6f-af97-9064cb53c878
Rizwankhan0001/Leetcode
Inorder Traversal (Iterative) - GFG/inorder-traversal-iterative.cpp
//{ Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; #define MAX_HEIGHT 100000 // Tree Node struct Node { int data; Node* left; Node* right; }; // Utility function to create a new Tree Node Node* newNode(int val) { Node* temp = new Node; temp->data = val...
ALGO
0.999903
7.065743
f3751f4d-2b84-4e7b-a156-18096f712790
maindishes/ft_containers
containers_test/srcs/multiset/comp.cpp
#include "common.hpp" #define T1 char typedef TESTED_NAMESPACE::multiset<T1> _multiset; typedef _multiset::const_iterator const_it; static unsigned int i = 0; void ft_comp(const _multiset &st, const const_it &it1, const const_it &it2) { bool res[2]; std::cout << "\t-- [" << ++i << "] --" << std::endl; res[0] = s...
TEST
0.936505
4.47155
4478f7b0-9b3a-4694-94b5-40db48caa5a8
paranshu-singhal/CompetetiveCoding
Spoj/PARTY.cpp
#include<bits/stdc++.h> void knapSack(int W, int wt[], int val[], int n) { int i, w; int K[n+1][W+1]; for (i = 0; i <= n; i++) { for (w = 0; w <= W; w++) { if (i==0 || w==0) K[i][w] = 0; else if (wt[i-1] <= w) K[i][w] = std::max(val[i-1] + K[i...
ALGO
0.999884
3.723359
033984dd-02b5-4e71-b818-f7a03579314a
skd988/point-location
Tests.cpp
#include "Tests.h" #include "TopologicalNode.h" #include "PointLocationSlabs.h" #include "PointLocationTrapezoids.h" void checkEdgeToVertex(Window win) { while (true) { Vertex p; Edge e; cin >> e; win.clear(); win.drawLine(e); cin >> p; win.drawPoint(p); ...
TEST
0.907854
4.432074
56f0cec8-a363-4aa5-bdf0-7123e5c91ad2
mdshahadothosen2001/cp
B Beecrowd [++/[1041] Coordinates of a point.cpp
#include<iostream> using namespace std; int main() { double x,y; cin>>x>>y; if(x==0 && y==0) cout<<"Origem\n"; else if((y<0 || 0<y) && x==0) cout<<"Y Axis\n"; else if((x<0 || 0<x) && y==0 ) cout<<"X axis\n"; else if(x>0 &&y>0) cout<<"Q1\n"; else if(x<0 && y>...
ALGO
0.999913
3.673117
4db48f14-9699-41f6-b918-4dd92ee9cbe5
KaziRifatAlMuin/Online-Judges
Codeforces/Binary Search - C. Magic Ship.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; void solve() { ll x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; ll n; cin >> n; string s; cin >> s; ll ans = -1, low = 0, high = 1e18; ll xp = 0, yp = 0, x, y; for(auto ch : s){ if(ch == 'U') yp++; else if(ch...
ALGO
0.999808
4.687497
d57320ad-93b5-4b5c-aa2c-4150637c3fd4
ishandutta2007/codeforces
peti1234/normal/1205/B.cpp
#include <bits/stdc++.h> using namespace std; const int c=202; typedef long long ll; int n, p[c], o[c]; ll t[c]; bool v[c][c], qq[c]; int kor(int a) { for (int i=1; i<=n; i++) { qq[i]=p[i]=o[i]=0;; } queue<pair<int, int> > q; q.push({a, 1}); int mini=INT_MAX; while(q.size()>0) { ...
ALGO
0.999946
3.694231
4c080c73-4462-4a5e-aa5d-7a88f6916cd0
clarasdfgh/SCD
Practicas/Seminario1/scd-s1-fuentes/ejemplo07.cpp
// ----------------------------------------------------------------------------- // Sistemas concurrentes y Distribuidos. // Seminario 1. Programación Multihebra y Semáforos. // // Ejemplo 7 (ejemplo7.cpp) // Creación de hebras idénticas con distintos parámetros. // (usando async y un vector de futuros) // // Historial...
ALGO
0.961678
5.307598
c13e087e-ccd3-4f73-96ab-5779cbe59253
ddv2311/help
Lecture046 Linked List Day3/reverseInKGroup.cpp
/**************************************************************** Following is the Linked List node structure class Node { public: int data; Node *next; Node(int data) { this->data = data; this->next = NULL; } }; *********************...
ALGO
0.999892
5.394238
07996af6-6274-4615-93eb-e8d5bce7d0db
wishescsnow/Competitive-Programming
Chapter 3 Problem Solving Paradigms/Dynamic Programming/Max 2D Range Sum/10667.cpp
#include <iostream> #include <string.h> #include <algorithm> using namespace std; bool board[110][110]; int height[110][110]; int left1[110][110]; int right1[110][110]; int left2[110][110]; int right2[110][110]; int main() { int p, s, n, r1, c1, r2, c2, ans; cin >> p; while(p--) { ans = 0; cin >> s >>...
ALGO
0.998201
3.66296
684a1c9c-0f2f-43f9-8b36-7b82e13bc436
flucloxin500/CSE
CSE-2321-22/Recursion/TowersOfHanoi.cpp
#include <iostream> using namespace std; int towerOfHanoi(int n, char from_rod, char to_rod, char aux_rod) { if (n == 0) { return 0; } int moves = towerOfHanoi(n - 1, from_rod, aux_rod, to_rod); cout << "Move disk " << n << " from rod " << from_rod << " to rod " << to_rod << endl; moves++; ...
ALGO
0.999782
6.434465
a14abe53-19c0-4615-831c-761019847058
Ayush-Pandey0/CPP-Daily
ss/1.cpp
#include <bits/stdc++.h> using namespace std; int main(){ vector<int> vec={1,2,5,1,4,6}; } //----->>>> {-1 ,-1,-1,5,-1,-1}
ALGO
0.999709
3.662145
ed6aad92-e188-4177-8323-343e9fbc0d32
nianny/sample
GeneralCoding/CP/lis/main.cpp
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { ios_base::sync_with_stdio(); cin.tie(0); cout.tie(0); int n; cin>>n; int arr[n]; int lis[n]; memset(lis, 0, sizeof lis); for (int i=0; i<n; i++){ cin>>arr[i]; } for (int i=0; i<n; i++){ ...
ALGO
0.999847
4.211826
874792f1-d3b4-470d-9047-95edb273ecce
sunscorch/Learncpp
algorithm/kmp.cpp
#include <iostream> #include <vector> #include <string> using namespace std; vector<int> buildPreArray(const string& pattern) { vector<int> res(pattern.size(), 0); int index = 0; for (int i = 1; i < pattern.size(); ) { if (res[i] == pattern[index]) { res[i] = index + 1; i++; index++; }else { //ex : ...
ALGO
0.999936
5.198073
0cee3dcc-c9ed-441b-8415-3bc9c272fd2d
kunyavskiy/competitive-programming-archive
TopCoder/unsorted/TPS.cpp
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <cstdlib> #include <cstdio> #include <stack> #include <algorithm> #include <iostream> #include <string> #include <cstring> #include <cstdio> #include <cmath> #include <cstdlib> #include <iterator> #include <functi...
ALGO
0.999884
5.448669
2369d72c-16ba-4664-b8ac-5322a28c3a0d
Aoishy/Artificial-Intelligence
Adversial/AdversialSearch.cpp
#include <bits/stdc++.h> #include "Mancala.cpp" using namespace std; #define ll int #define sng string void AI_vs_AI(Mancala *Game) { while (!Game->isGameFinished()) { cout << endl; cout << "Player " << Game->get_player_turn() << "'s turn" << endl; ll best_move = Game->getBestmove(DEPTH...
ALGO
0.997926
4.444913
ccb95a55-58cf-47d1-a431-517c80855512
youngsam-byun/my-notes.github.io
leetcode/src/test/java/Others/2132.Stamping-the-Grid/2132.Stamping-the-Grid_v1.cpp
class RegionSum { vector<vector<int>>presum; public: RegionSum(vector<vector<int>>& A) { int m = A.size(); int n = A[0].size(); presum.resize(m); for (int i=0; i<m; i++) presum[i].resize(n); for (int i=0; i<m; i++) for (int j=0; j<n; j++) ...
ALGO
0.998733
5.503158
8efa8305-4199-499c-8bbe-d692cafffe97
BGI-Qingdao/TGS-GapCloser
orientation_correct/ONT_contigmapper.cpp
#include <iostream> #include <sstream> #include <map> #include <string> #include <vector> #include <cassert> #include <stdlib.h> struct MapInfo { std::string contig_name ; int contig_len ; int contig_start ; int contig_end ; char contig_orientation ; std::string read_name ; int read_len ; ...
DATA
0.968348
3.656178
acb44007-fc2b-4716-bf56-7723fbe55ae4
nickatkins04/CSC-1310-Program-2
LinkedList.cpp
#include "LinkedList.h" #include <iostream> using namespace std; // edit function implementation after adding template to header //Function that returns true or false for if the funcion is empty template<typename T> bool UserStorage<T>::isEmpty() { if(!head) return true; else return false; } //Function that r...
ALGO
0.997526
5.009043
d6f2dea7-87c6-46b1-991d-933433f3f7c5
alexandraback/datacollection
solutions_2749486_1/C++/farzadab/Code.cpp
#include<iostream> #include<algorithm> #include<iomanip> #include<fstream> #include<cstdlib> #include<cstring> #include<vector> #include<queue> #include<deque> #include<stack> #include<ctime> #include<set> #include<map> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> PII; typede...
ALGO
0.999971
3.745605
0ecbf0b3-764e-49dc-8d9a-d5174de50aed
tuhinbc/online_judge_solutions
294.cpp
#include<stdio.h> #include<iostream> #include<stdlib.h> #include<math.h> using namespace std; #define maxv 32000 int list[maxv+1]; int maxp=0; inline bool isp(int t) { return !list[t]; } void sieve() { int walk,lmt=sqrt(maxv)+1; list[1]=true; for(walk=2;walk<=lmt;walk++) { if(!isp(walk)) con...
ALGO
0.999732
4.083886
30651062-55f6-4757-989d-26e657da87fb
hacker1649/custom-layout
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.9988
6.76073
a731eba2-8e19-4e58-b1f7-7d569727d5e0
kwakjames5/USC_CSCI_104_FALL2020
Repositories/prestudy-2020/080_Negative_count_matrix_1351/negative_count_matrix.cpp
#include "negative_count_matrix.h" #include <iostream> // link: https://leetcode.com/problems/count-negative-numbers-in-a-sorted-matrix/ // date: 6/19/2020 // description: given a grid (each vector is a row, there are multiple rows), iterate every element and return the total number of negatives int Solution::count...
ALGO
0.999789
5.901407
42c0bc18-5ab3-476b-957a-8c07f0289e19
omkarsharma2821/Daily-DSA
Array/secLarMin.cpp
#include<bits/stdc++.h> using namespace std; int Second_Largest(vector<int>arr, int n){ if(n<2) return -1; int largest = arr[0]; int seclargest = -1; for(int i = 0; i<n; i++){ if(arr[i]>largest){ seclargest = largest; largest = arr[i]; } else if(arr[i]>se...
ALGO
0.999893
4.428597
8ed7624e-d7a0-4ad2-9d42-b46e0db89550
AnuraagDev/Practice-codes-for-DSA-and-Competitive-Programming
validatebracket.cpp
class Solution { public: bool isValid(string s) { int open=0,close=0; for(int i=0;i<s.size();i++) { if(s.at(i)=='(')open++; if(s.at(i)==')')close++; if(i!=s.size()-1) { if(close>open)return false; } if(i=...
ALGO
0.998282
6.165261
e305d955-0ca7-4ca1-9715-6803109e6b53
thomasxm/Akira-obfuscator
libcxx/test/std/containers/sequences/vector.bool/insert_range.pass.cpp
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=2000000 // template<container-compatible-range<bool> R> // constexpr iterator insert_range(const_iterator position, R&& rg); // C++23 #include <vector> #include "../insert_range_sequence_container...
TEST
0.974924
6.682305
71a854c4-595e-4cab-bdc5-67787d1dd2ce
astitvaaryan/node-based-image-processor
opencv/modules/dnn/src/layers/normalize_bbox_layer.cpp
#include "../precomp.hpp" #include "layers_common.hpp" #include "../op_cuda.hpp" #include "../op_inf_engine.hpp" #include "../ie_ngraph.hpp" #ifdef HAVE_CUDA #include "../cuda4dnn/primitives/normalize_bbox.hpp" using namespace cv::dnn::cuda4dnn; #endif namespace cv { namespace dnn { class NormalizeBBoxLayerImpl CV_F...
ALGO
0.852377
7.101177
e33d3487-c258-4836-91b2-fb612e6009c8
BHayesO/LeetCode
CPP/5. Longest Palindromic Substring.cpp
#include <iostream> #include <string> using namespace std; class Solution { public: string longestPalindrome(string s) { if (s.empty()) return ""; if (s == string(s.rbegin(), s.rend())) return s; int start = 0, size = 1; for (int i = 1; i < s.size(); ++i) { int l = i ...
ALGO
0.999836
5.902178
977a6f11-99dd-4ea7-ba5c-0c3cdfec21ca
akramhany/ProblemSolving
ComptetiveProgramming/Azhar_Problems/LevelOne/Week2/L_Divisibility_by_Eight.cpp
#include <iostream> #include <math.h> #include <vector> #include <algorithm> #include <map> #include <string> #define ll long long #define llu unsigned long long using namespace std; bool isPrime(ll n) { if (n == 2) return true; else if (n < 2 || n % 2 == 0) return false; for (ll i = 3; i * i <= n; i ...
ALGO
0.999213
4.152162
ffc16c62-8c44-41fc-8ead-80dae5a63a78
suiguan/CS_286_Machine_Learning
hw2/hmm.cpp
#include <stdio.h> #include <ctime> #include <cstdlib> #include <cmath> #include <string> #include <fstream> #include "hmm.h" #define USE_FIXED_DIGRAPH //enable this define to use a fixed A matrix from a pre-defined digraph #ifdef USE_FIXED_DIGRAPH #include "AMat.h" #endif #define MAX_INT 9223372036854775807 static ...
ALGO
0.999638
5.313706
29bbf38b-7cad-4f84-8d06-053ea6def51c
Flavi086/Project-Euler
E9.cpp
#include <iostream> int main() { int tot = 1000; for (int a = 1; a < tot; a++) { for (int b = a + 1; b < tot; b++) { int c = tot - a - b; if (a * a + b * b == c * c) { long long product = static_cast<long long>(a) * b * c; std::cout << "La terna ...
ALGO
0.999663
4.399526
9e4aff7b-8eb1-4b9f-bde0-10115a84ebc1
Keshav7891/Leetcode-Solutions
0733-flood-fill/0733-flood-fill.cpp
class Solution { public: void dfs(int i, int j , vector<vector<int>>& grid , vector<vector<bool>>&visited , int source , int target){ if(i<0 || j<0 || i>= grid.size() || j>=grid[0].size() || visited[i][j]==true || grid[i][j]!=source){ return; } visited[i][j] = true; grid...
ALGO
0.999339
6.519556
ceb1b8cd-0783-4ab8-90bd-5363e785a631
Aamodit/GFG-Daily
Difficulty: Medium/2D Difference Array/2d-difference-array.cpp
class Solution { public: vector<vector<int>> applyDiff2D(vector<vector<int>>& mat, vector<vector<int>>& opr) { int n =mat.size(); int m =mat[0].size(); vector<vector<int>> temp(n,vector<int> (m+1,0)); for(auto a: opr){ int va...
ALGO
0.999891
6.01326
504aee33-e009-44d1-b401-4b9031c33641
langningchen/Etiger
0655.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll N = 200005; int main() { freopen("car2.in", "r", stdin); freopen("car2.out", "w", stdout); int n, m, a[N], b[N]; cin >> n >> m; for (ll i = 1; i <= n; i++) cin >> a[i]; for (ll i = 1; i <= m; i++) cin >>...
ALGO
0.999936
3.421121
ca984329-d734-4cbc-ac4b-0666ea497488
yingjerkao/FAME-GPU
FAME_Tools/vec_inner_prod.cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <complex.h> #include "FAME_Internal_Common.h" // 2020-02-19 realCPU vec_inner_prod(realCPU* vec1, realCPU* vec2, int len) { realCPU sum = 0; for( int i = 0; i < len; i++ ) sum += vec1[i]*vec2[i]; return sum; } cmpxCPU vec_inner_prod(cmpxCPU* vec_1...
ALGO
0.998462
3.958695
7d1535d1-38d2-477d-852d-7cf2da4a8856
AshwinkumarPillai/LeetCode
Problems/1557_Minimum_Number_of_Vertices_to_Reach_All_Nodes.cpp
// Using vector class Solution { public: vector<int> findSmallestSetOfVertices(int n, vector<vector<int>>& edges) { vector<int>indegree(n); for(auto x: edges){ indegree[x[1]]++; } vector<int>ans; for(int i=0;i<n;i++){ if(indegree[i] == 0) ans.push_back...
ALGO
0.999907
6.14702
e3d23bed-f99b-410a-b6dd-91f075966169
CEJiang/Social-Force-Algorithm
include/glm/test/core/core_func_integer_find_lsb.cpp
// This has the programs for computing the number of trailing zeros // in a word. // Max line length is 57, to fit in hacker.book. #include <cstdio> #include <cstdlib> //To define "exit", req'd by XLC. #include <ctime> int nlz(unsigned x) { int pop(unsigned x); x = x | (x >> 1); x = x | (x >> 2); x = ...
ALGO
0.998943
5.181918
2552ff91-5fd2-4750-b129-29ff6ba372eb
sandeshkhadase/Leetcode-Solutions
Leetcode Solutions/solution/0200-0299/0242.Valid Anagram/Solution.cpp
class Solution { public: bool isAnagram(string s, string t) { if (s.size() != t.size()) { return false; } vector<int> cnt(26); for (int i = 0; i < s.size(); ++i) { ++cnt[s[i] - 'a']; --cnt[t[i] - 'a']; } return all_of(cnt.begin(), c...
ALGO
0.999945
6.611021
865a6a87-9d9a-469f-936c-8b40f5084650
AliceTB21/SmallAssignment
PalindromeCheck/main.cpp
#include <iostream> using namespace std; bool CheckPalindrome(string word) { bool isPalindrome = false; string reverseWord = word; reverse(word.begin(), word.end()); if (word == reverseWord) { isPalindrome = true; } return isPalindrome; } int main() { string input; cout << "Enter a word to check if it is a ...
ALGO
0.996678
4.638062
ff75ec55-26b3-4e97-9ba3-9c041c673b6a
Niran-Chan/leetcode-practice
c++/LongestCommonPrefix.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; /* string longestCommonPrefix(vector<string>& strs) { //Maximum can only be as long as the smallest word //Sort out words first, select first one and loop through string res = ""; cout << strs[0...
ALGO
0.999349
4.789526
76a501b9-bcd2-40d5-a99f-a16716080f3d
ljw7630/PKU_ACM
code/1700_dp_greedy.cpp
#include <iostream> #include <algorithm> using namespace std; int main() { freopen("in.txt","r",stdin); freopen("out.txt","w",stdout); int t,n; int i; int a[1005]; int dp[1005]; scanf("%d",&t); while(t--) { memset(dp,0,sizeof(dp)); scanf("%d",&n); for(int i=0;i<n;++i) scanf("%d",&a[i]); sort(a,a+n)...
ALGO
0.999932
4.118335
c07963fc-72ba-47b7-8101-cbaa1f372dc6
ishandutta2007/codeforces
wygzgyw/normal/1733/C.cpp
// wygzgyw #include <bits/stdc++.h> using namespace std; template <typename T> void read(T &t) { t=0; char ch=getchar(); int f=1; while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); } do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f; } template <typename T> void write(T t) { if (t<0) { put...
ALGO
0.99949
3.423618
a7a883ba-10b7-430b-87f6-a6db6127aa56
anakniss/univali
algorithms and programming II/alocação dinâmica de memória e lista encadeada/lista/exercício 4/main.cpp
#include <iostream> using namespace std; //Escreva um procedimento que elimine a primeira ocorrncia de um determinado valor de uma lista de //valores inteiros. typedef struct Nodo{ int elemento; struct Nodo *proximo; }Lista; Lista* montaLista(); void exibaLista(Lista *); void excluiElemento(Lista **, int); ...
ALGO
0.997179
4.408019
193dd6f7-c2a8-43b1-b7ed-c086f6efb3a5
linouk23/leetcode
44.cpp
// 44. Wildcard Matching - https://leetcode.com/problems/wildcard-matching #include "bits/stdc++.h" #include "gtest/gtest.h" using namespace std; class Solution { public: bool isMatch(string f, string s) { int n = (int)f.length(); int m = (int)s.length(); vector<deque<bool>> dp(n + 1, deq...
ALGO
0.997826
6.481467
474e1b77-79f2-4ab0-bad0-5b92ff7e4303
VipulChauhan89/Leetcode-solutions
Bit Manipulation/0201-Bitwise_AND_of_Numbers_Range.cpp
class Solution { public: int rangeBitwiseAnd(int left,int right) { while(left<right) { right&=right-1; } return right; } };
ALGO
0.999892
5.772805
4858adc0-3eca-4294-ab15-0c390ba5508b
gsorial/Medication-Backorder-Prioritization
code/xor.cpp
#include "xor.h" Xor::Xor(){ } Xor::~Xor(){ if(top_ptr_){ curr=top_ptr_; prev=nullptr; while(curr){ next=XOR(prev,curr->link); prev=curr; delete curr; curr=next; } } } node* Xor::InitNode(int MRN, int dose){ node* ret = new node; ret->MRN=MRN; ret->dose=dose; ret-...
TOOL
0.92681
3.284764
b2f92c5a-a0e1-4f5a-b2ea-eb1b0bd5bec4
DhruvSharma4435/Coding
0225-implement-stack-using-queues/0225-implement-stack-using-queues.cpp
class MyStack { public: void push(int x) { q.push(x); for (int i = 0; i < q.size() - 1; ++i) { q.push(q.front()); q.pop(); } } int pop() { const int val = q.front(); q.pop(); return val; } int top() { return q.front(); } bool empty() { return q.empty(); }...
ALGO
0.997923
5.825942
fb808e26-3d3d-445a-984b-412932cbb31c
seb-torres3600/OpenMP
main.cpp
/* Sebastian Torres 11/7/22 Lab 3 */ #include <iostream> #include <unistd.h> #include <getopt.h> #include "read_write.hpp" #include "merge.hpp" using namespace std; int main(int argc, char** argv){ // Variable declarations int our_option; // Num of threads defaults to 4 if nothing passed int NUM_TH...
ALGO
0.989987
4.92498
8aaf966b-0576-4f3b-916e-98a84c5b00a7
eiselekd/vhdl2js
antlr4-runtime-cpp/atn/ParseInfo.cpp
#include "atn/ProfilingATNSimulator.h" #include "dfa/DFA.h" #include "atn/ParseInfo.h" using namespace antlr4::atn; ParseInfo::ParseInfo(ProfilingATNSimulator *atnSimulator) : _atnSimulator(atnSimulator) { } std::vector<DecisionInfo> ParseInfo::getDecisionInfo() { return _atnSimulator->getDecisionInfo(); } std::...
ALGO
0.904846
5.854838
0a441a2e-6f22-4123-9bd5-b4f93ee23f62
r-a-braun/SVAR-DPMM
mex functions/dcovustatC.cpp
/* * dcov.cpp - example in MATLAB External Interfaces * */ #include "mex.hpp" #include "mexAdapter.hpp" using namespace matlab::data; using matlab::mex::ArgumentList; class MexFunction : public matlab::mex::Function { public: ArrayFactory factory; //std::shared_ptr<matlab::engine::MATLABEngine> matlabPtr = g...
ALGO
0.971016
5.979199
64184c4b-0a5a-4805-8299-942b814a6fe5
xlnt415/programing
python-for-coding-test-master/9/3.cpp
#include <bits/stdc++.h> #define INF 1e9 // 무한을 의미하는 값으로 10억을 설정 using namespace std; // 노드의 개수(N), 간선의 개수(M) // 노드의 개수는 최대 500개라고 가정 int n, m; // 2차원 배열(그래프 표현)를 만들기 int graph[501][501]; int main(void) { cin >> n >> m; // 최단 거리 테이블을 모두 무한으로 초기화 for (int i = 0; i < 501; i++) { fill(graph[i], gra...
ALGO
0.999897
4.689343
35969b44-4c12-4871-a587-3f0e00d9e115
asarra/University-n-school-projects-experiences
UOS-C++/Boids/src/main.cpp
/** ** Algorithmen und Datenstrukturen ** OpenFrameworks App ** ** <Beschreibung> ** ** <Autoren> **/ #include "ofAuDApp.h" #include "speedboid.h" int anzahl = 50; SpeedBoid boids[50]; int align(SpeedBoid boids[50],SpeedBoid b[b_id],int b_id){ int b_x=b.getX(),b_y=b.getY(); int total_x,total_y,tx,ty,x...
ALGO
0.991129
4.991422
811677ad-f71e-43f9-97b1-bc166d021a5a
ank809/Cpp-Codebase
OOPS/NeonNumber.cpp
#include <iostream> #include <cmath> class NeonNumber { protected: int number; public: NeonNumber(int n) : number(n) {} virtual ~NeonNumber() { // Virtual destructor for proper memory management } virtual bool isNeonNumber() { int square = number * number; int sum...
ALGO
0.999563
5.615477
a06e66ef-4260-4e71-b942-1794d6281547
avcopan/MPACK
mlapack/library/Rtzrqf.cpp
#include <mblas.h> #include <mlapack.h> void Rtzrqf(INTEGER m, INTEGER n, REAL * A, INTEGER lda, REAL * tau, INTEGER * info) { INTEGER i, k, m1; REAL Zero = 0.0, One = 1.0; //Test the input parameters. *info = 0; if (m < 0) { *info = -1; } else if (n < m) { *info = -2; } else if (lda < max((...
ALGO
0.999981
4.406519
46cdbde3-c7d3-4f02-a0c6-af9cf6edbbce
Tejas-Santosh-Nalawade/GFG-SUBMISSIONS
Difficulty: Easy/Left View of Binary Tree/left-view-of-binary-tree.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // Tree Node struct Node { int data; Node* left; Node* right; }; // } Driver Code Ends /* A binary tree node struct Node { int data; struct Node* left; struct Node* right; Node(int x){ data = x; left = ...
ALGO
0.998581
7.187792
22a2e120-96b5-4a1a-8a88-15098ac08130
raincross7/code-similarity
codes/train_code/problem157/problem157_63.cpp
#include <bits/stdc++.h> using namespace std; /*{{{*/ //template #define REP(i,n) for(int i=0;i<n;i++) #define rep(i,n) for(int i=0;i<n;i++) #define INF 1<<29 #define LINF LLONG_MAX/3 #define MP make_pair #define PB push_back #define pb push_back #define EB emplace_back #define ALL(v) (v).begin(),(v).end() #define all...
ALGO
0.999726
3.802682
03ea24df-331f-434d-96c1-d5a47664ea1c
rakibunateed/Problem-Solving
A_Beautiful_Sequence.cpp
#include <bits/stdc++.h> using namespace std; #define mod 1e9 + 7 typedef long long int ll; const ll mx = 2e5 + 123; void solution() { ll m; cin >> m; vector<ll> v(mx); bool find = false; for (int i = 0; i < m; i++) { cin >> v[i]; if (v[i] == i + 1) find = true; } cout << (find ? "YES" : "NO") << ...
ALGO
0.99982
4.46428
152cbb0b-c3a3-4cf6-9474-bd82fbf604a5
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Gemma/top0-100/minimum-adjacent-swaps-for-k-consecutive-ones-Solution.minMoves/177842_+Info.cpp
_PUBLIC_ codepoint_t next_codepoint_handle_ext( struct smb_iconv_handle *ic, const char *str, charset_t src_charset, size_t *bytes_consumed) { /* it cannot occupy more than 4 bytes in UTF16 format */ smb_iconv_t descriptor; size_t ilen_o...
ALGO
0.997976
4.644909
84053565-65a3-4faa-a8dd-caf778858b99
ishandutta2007/codeforces
hyperbolic/normal/711/C.cpp
#include <stdio.h> int a,b,c; int x[110],y[110][110]; long long int MAX = 1; long long int DP[110][110][110]; long long int func(int s, int t, int k) { //s t , k long long int ans = MAX; if(s==a) { if(t==c) return 0; else return MAX; } if(DP[s][t][k]!=-1) return DP[s][t][k]; if(x[s+1]==0) { for(int i=1;i...
ALGO
0.999932
3.116592
e5ebd0c4-34de-4b59-aaa8-88fec4b79eae
agyaglikci/mcsima-plus
pin/source/tools/MemTrace/membuffer_simple.cpp
/* * * A memory trace (Ip of memory accessing instruction and address of memory access - see * struct MEMREF) is collected by inserting Pin buffering API code into the application code, * via calls to INS_InsertFillBuffer. This analysis code writes a MEMREF into the * buffer being filled, and calls the register...
TOOL
0.935808
6.49491
22ac5243-0f1a-4688-b4b7-1ed6cac1e8b9
yudit12/cpp-projects
code for interview practice/codility practice/Lesson 1-Iterations/BinaryGap.cpp
/****************************************************************************** Find longest sequence of zeros in binary representation of an integer. between two 1's *******************************************************************************/ #include <iostream> using namespace std; int solution(int N); int main(...
ALGO
0.999925
5.749012
be02f704-bf28-4ece-8263-ad0f02f0e4d4
guhorlando/AEDS-I
Treinamentos/divisores.cpp
#include <stdio.h> int main () { int numero, i, contadorDivisores; i = 1; printf("Digite um número: "); scanf("%d", &numero); while (i <= numero){ if (numero % i == 0){ contadorDivisores = contadorDivisores + 1; } i = i + 1; } if (contadorDiviso...
ALGO
0.99787
3.929351
629ec392-ec2c-41af-a51b-e43e3f8aee72
AIxiaodi4Ever/leetcode_in_cpp
01x数组/0377.cpp
class Solution { public: int combinationSum4(vector<int>& nums, int target) { vector<int> combs(target + 1, 0); combs[0] = 1; for (int i = 1; i <= target; ++i) { for (int val : nums) { if (val <= i && combs[i - val] <= INT_MAX - combs[i]) { com...
ALGO
0.999907
6.526623
8776b778-e1f2-4739-81c2-e077d00ca2c5
zhh2005757/slambook2_in_Docker
slambook2/3rdparty/opencv-3.3.0/3rdparty/carotene/src/accumulate.cpp
#include "common.hpp" #include "vtransform.hpp" #include <cstring> namespace CAROTENE_NS { void accumulate(const Size2D &size, const u8 *srcBase, ptrdiff_t srcStride, s16 *dstBase, ptrdiff_t dstStride) { internal::assertSupportedConfiguration(); #ifdef CAROTENE_NEON size_t roi...
ALGO
0.998075
5.641029
f0750fe4-5073-4c16-b6c2-b072edf1d718
PinkArmor/BTL_TRR1_PTIT
sinh xau nhi phan k bit 1.cpp
#include <bits/stdc++.h> using namespace std; int n,k; int a[100001]; bool check(){ int sum=0; for(int i=1; i<=n; i++){ sum+=a[i]; } return sum==k; } int main(){ cin>>n>>k; for(int i=1; i<=n; i++){ a[i]=0; } int ok=1; while(ok){ if(check()){ for(in...
ALGO
0.999987
3.12077
31abd2de-54c4-4832-a247-a7fe1ab84711
Huawei-Robot/C-_week2
E.cpp
//#include <iostream> //#include <vector> //#include <set> // Ͽ //#include<cstdio> //using namespace std; //int dx[] = { 1,-1,0,0 }; //int dy[] = { 0,0,1,-1 }; //int dfs(int x, int y, int R, int C, vector<string>& board, vector<vector <bool> >& visited,set<char>& path); ////x y ʾǰӵľλá ////R C ̵ĴС ////board ʾ̵I...
ALGO
0.999653
4.682508
72afa66d-1316-4294-a644-d05280657b17
LuizHenriqueSena/ESBMC-GPU
regression/esbmc-cpp/cpp/cstring10_strpbrk/main.cpp
/* strpbrk example */ #include <iostream> #include <cstring> int main () { char str[] = "This is a sample string"; char key[] = "aeiou"; char * pch; std::cout << "Vowels in ' "<< str << " ': " << std::endl; pch = strpbrk (str, key); while (pch != NULL) { std::cout << *pch << std::endl; pch = strp...
ALGO
0.990761
4.60903
44ba93b6-b191-4370-b8ff-90cbf9d144a2
BenAmundson/vue-spa
mysql-community-5.7.23/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
#include <ndb_global.h> #include <ndb_version.h> #include "InitConfigFileParser.hpp" #include "Config.hpp" #include <NdbOut.hpp> #include "ConfigInfo.hpp" #include "EventLogger.hpp" #include <m_string.h> #include <util/SparseBitmask.hpp> #include "../common/util/parse_mask.hpp" extern EventLogger *g_eventLogger; con...
CONFIG
0.936837
5.937855
074fbb4a-914a-49ee-a728-8b1d073ddc3d
VictorZhangAI/Algorithms
mergesort/mergesort.cpp
#include<bits/stdc++.h> using namespace std; vector<int> aux; bool lt(int i, int j) { if(i < j) return true; else return false; } bool testbench(vector<int> a, int lo, int hi) { for(int i = lo + 1; i <= hi; i++) if(a[i] < a[i - 1]) return false; return true; } void merge(vector<int> &a, vector<int> &au...
ALGO
0.999643
4.388058
22f63acd-73f9-4486-a5e9-9deffa5c88e0
JimmieKJ/unrealCode
UnrealEngineGitHub/Engine/Source/ThirdParty/CryptoPP/5.6.2/include/gf2_32.cpp
// gf2_32.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #include "misc.h" #include "gf2_32.h" NAMESPACE_BEGIN(CryptoPP) GF2_32::Element GF2_32::Multiply(Element a, Element b) const { word32 table[4]; table[0] = 0; table[1] = m_modulus; if (a & 0x80000000) { table[2] = m_modulus ^ (...
ALGO
0.999768
5.535272
ad8ad240-2544-4f52-b67e-99c4c298e483
Muthulakshmisubi/java.numb
Muthulakshmi_Traininng/powofnum.cpp
#include <iostream> #include <cmath> using namespace std; int main() { double base, exponent; cout << "Enter the base: "; cin >> base; cout << "Enter the exponent: "; cin >> exponent; double result = pow(base, exponent); cout << base << " to the power of " << exponent << " is: " << res...
ALGO
0.929277
5.203492
40d55312-7a21-4dbd-b259-32b4b7795a12
Rudra1402/Codeforces-Solutions
1132B - Discounts.cpp
// 1132B - Discounts // This is a solution to codeforces problem 1132B - Discounts #include<bits/stdc++.h> using namespace std; long long arr[300005]; int main() { int nBars,qBars,qVal,i,j; long long sum=0; cin>>nBars; for(i=0;i<nBars;i++) { cin>>arr[i]; } sort(arr,arr+nBars); f...
ALGO
0.999754
3.768153
d768003d-d590-4c93-9978-6884aebba0bc
Saifu0/Competitive-Programming
CP/1500/chef_strings.cpp
// ----- In the name of ALLAH, the Most Gracious, the Most Merciful ----- #include<bits/stdc++.h> using namespace std; #define NINJA ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define fo(i,n) for(int i=0;i<n;i++) #define Fo(i,k,n) for(int i=k;i<n;i++) #define for1(i,n) for(int i=1;i<=n;i++) #define dloop(i...
ALGO
0.999591
4.540561
c1d05fe3-0017-4838-9203-3e85c677a060
mudar-hussain/DSA_Leetcode_Practice
414-third-maximum-number/414-third-maximum-number.cpp
class Solution { public: int thirdMax(vector<int>& nums) { if(nums.size() == 1) return nums[0]; if(nums.size() == 2) return max(nums[0], nums[1]); long m1 = LONG_MIN; long m2 = LONG_MIN; long m3 = LONG_MIN; for(auto i: nums){ if(i ...
ALGO
0.999974
5.390085
2536d42e-5883-42d7-8027-727909df0d4a
raincross7/code-similarity
codes/train_code/problem164/problem164_454.cpp
#include <iostream> #include <vector> #include <algorithm> #include <bitset> #include <math.h> #include <iomanip> #include <map> #include <queue> #include <tuple> #include <math.h> #include <iomanip> using namespace std; typedef long long ll; typedef tuple<int,int,int> P; int main(){ int A,B,K; cin >> K >> A...
ALGO
0.999241
3.950724
d7284e16-a562-4f96-8bd7-75813584f495
Jengdeuk/Algorithm
Baekjoon/99.Class/Class0/10817.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); vector<int> Seq(3, 0); for (int i = 0; i < 3; ++i) { cin >> Seq[i]; } sort(Seq.begin(), Seq.end()); cout << Seq[1]; }
ALGO
0.999835
3.82054
1a89f424-a068-42d3-8069-b1347452fc08
SCIBERCODE/volumeter
Libs/spuce/filters/raised_cosine_imp.cpp
namespace spuce { float_type raised_cosine_imp(float_type alpha, float_type xin, float_type r, size_t num_taps) //------------------------------------------------------------------------------------------------ // Calculates the raised cosine pulse shape given the excess bandwidth value alpha and the index. //---------...
ALGO
0.999271
6.780749