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
8962ef84-718f-4b42-a08c-fd0e0e9496b4
backsani/Coding-Test
프로그래머스/1/12932. 자연수 뒤집어 배열로 만들기/자연수 뒤집어 배열로 만들기.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; vector<int> solution(long long n) { vector<int> answer; while(n > 0) { answer.push_back((int)(n % 10)); n = n / 10; } return answer; }
ALGO
0.99963
5.574088
27e49dbe-d0bd-454c-8651-f8fb4cabe378
esl-epfl/xheep_matrix_spec
llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cpp
#include "sanitizer_flag_parser.h" #include "sanitizer_common.h" #include "sanitizer_flag_parser.h" #include "sanitizer_flags.h" #include "sanitizer_libc.h" namespace __sanitizer { class UnknownFlags { static const int kMaxUnknownFlags = 20; const char *unknown_flags_[kMaxUnknownFlags]; int n_unknown_flags_; ...
TOOL
0.892529
7.401461
0bc4b6da-e6d9-4c37-972c-3c98b520aab7
kolodani/AUS_Diseno_orientado_a_objetos
000-teoria/008-Templates/003.cpp
#include <iostream> #include <string> using namespace std; template <class T> const T &maximo(const T &a, const T &b) { return (a > b) ? a : b; }; int main() { string a("hola"); string b("zorro"); cout << "int mayor: " << maximo(4, 6) << endl; cout << "float mayor: " << maximo(4.5, 6.5) << endl; ...
ALGO
0.99437
3.910558
38e624d6-df46-44f5-aef3-626b43104150
QuyDatDamMaiKhongXanh/String
B13_TanSuatXuatHienCacTuTrongXau.cpp
#include <bits/stdc++.h> using namespace std; bool check(string s) { string t = s; reverse(t.begin() , t.end()); return t == s; } int main() { string s ; getline(cin , s); map<string,int>mp; string x; stringstream ss(s); vector<string>v; while(ss >> x) { v.push_back(x); ...
ALGO
0.999395
3.802227
b6e783ef-09cf-4bb0-b115-933e87995841
Tecax/Tecax
src/univalue/lib/univalue.cpp
#include <stdint.h> #include <errno.h> #include <iomanip> #include <limits> #include <sstream> #include <stdexcept> #include <stdlib.h> #include <string.h> #include "univalue.h" namespace { static bool ParsePrechecks(const std::string& str) { if (str.empty()) // No empty string allowed return false; ...
TOOL
0.874481
6.62095
bd4432f9-f269-4bbd-98a9-3f8a9508d32f
fThAbhishek-Pandey/Data-Structure-And-Algorithm
greedyAlgorithm/MaxMeetingInOneRoomAftAtem.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; struct meeting { int start; int end; int idx; }; bool cmpr (meeting m1,meeting m2){ return m1.end<m2.end; } void print_max_meet (vector<meeting> &arr){ sort (arr.begin(),arr.end(),cmpr); cout<<arr[0].idx<<" "; int ...
ALGO
0.999953
4.263455
d4dd45e4-ab35-475f-911e-55b69e865793
bharathv005/Cpp
rec_factorial.cpp
#include<bits/stdc++.h> using namespace std; int recursion_factorial(int n) { if(n==0 || n==1) return 1; return recursion_factorial(n-1)*n; } int main() { int n; cin>>n; cout<<recursion_factorial(n)<<endl; return 0; }
ALGO
0.999992
5.398281
eb87bf4e-6615-4723-b3af-50f730e79bbf
KastB/tas_car
odom_vel_calculator/src/odom_vel_calculator.cpp
#include "odom_vel_calculator/odom_vel_calculator.h" //FILE* outfile; //2nd order Butterworth low pass filter Butter2Order::Butter2Order(uint inputcount, double A1, double A2, double A3, double B1, double B2, double B3) :_inputcount(inputcount), _valid(false), _x_1(Eigen::VectorXd::Zero(inputcount)), ...
ALGO
0.970187
4.399999
f98a89ca-9e0b-4d12-8397-69af951f70c6
ishandutta2007/codeforces
karuna/normal/1696/C.cpp
#include <bits/stdc++.h> using namespace std; int n, m, k; void func(vector<int> &A, vector<pair<int, long long>> &Res) { for (int i = 0; i < A.size(); i++) { int x = A[i], c = 1; while (x % m == 0) { c *= m; x /= m; } if (!Res.empty() && Res.back().first == x) { ...
ALGO
0.999971
4.3922
c68358b6-d28b-4d56-bcbb-f6c00080e710
ishandutta2007/codeforces
geothermal/normal/1680/D.cpp
#include "bits/stdc++.h" #pragma GCC optimize ("O3") #pragma GCC target ("sse4") using namespace std; typedef long long ll; typedef long double ld; typedef complex<ld> cd; typedef pair<int, int> pi; typedef pair<ll,ll> pl; typedef pair<ld,ld> pd; typedef vector<int> vi; typedef vector<ld> vd; typedef vector<ll>...
ALGO
0.999819
4.037965
7b61fbe0-cf64-4863-a9da-72165abb4fb0
procojd/leetcode
0292-nim-game/0292-nim-game.cpp
class Solution { public: bool canWinNim(int n) { if(n%4==0) return false; return true; } };
ALGO
0.99971
5.802904
d80946be-39a6-4cc1-8797-47d4c1b86a7b
ishandutta2007/codeforces
itst/normal/148/A.cpp
#include<bits/stdc++.h> using namespace std; int main() { std::ios::sync_with_stdio(false); int a , b , c , d , e , cou = 0; cin >> a >> b >> c >> d >> e; for(int i = 1 ; i <= e ; i++) if(i % a && i % b && i % c && i % d) cou++; cout << e - cou; return 0; }
ALGO
0.999865
3.536566
808a1837-ead8-4f44-beee-7ed4c9159f4f
DanielWynter/Recommendation-System
Step3/BinarySearch/Da/main.cpp
#include <iostream> #include <fstream> #include <sstream> #include <string> #include "../../../ADT/DynamicArray.hpp" #include "../../../ADT/LinkedList.hpp" #include "../../../ADT/DoublyLinkedList.hpp" #include "../../../Movie/Movie.hpp" #include "../../../Movie/MovieLoader.hpp" #include "../../../SearchMethods/BinarySe...
ALGO
0.997267
4.562512
0f008997-c686-4f0d-8eb1-50ba7db6feeb
SHACHI57/Leetcode
Distance from the Source (Bellman-Ford Algorithm) - GFG/distance-from-the-source-bellman-ford-algorithm.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: /* Function to implement Bellman Ford * edges: vector of vectors which represents the graph * S: source vertex to start traversing graph with * ...
ALGO
0.999902
5.490887
404f230f-807a-4e25-9e3e-45c67e6fe9b5
green-fox-academy/sanyi0411
week-01/day-4/24. Sort that list/main.cpp
#include <iostream> #include <string> // Create a function that takes a list of numbers as parameter // Don't forget you have to pass the size of the list as a parameter as well // Returns a list where the elements are sorted in ascending numerical order by using bubble sort // Make a second boolean parameter, if ...
ALGO
0.999727
5.346187
caa92aeb-bbe4-46bc-bdbd-f57df180d8bc
yusei-wy/atcoder
abc/cpp/105_c.cpp
#include <iostream> #include <string> using namespace std; typedef long long ll; int main() { ll n; cin >> n; string ans = ""; while (n != 0) { if (n % 2 == 0) { ans = "0" + ans; } else { n--; ans = "1" + ans; } n /= -2; } if (ans == "") ans = "0"; cout << ans << endl...
ALGO
0.999986
4.709415
f828350a-10e3-4678-9b68-f017c29480ed
DebashishSarkarDurjoy/HashMaps
GPTriplets.cpp
#include <iostream> #include <unordered_map> #include <vector> using namespace std; int count_triplets(vector<int> arr, int r) { int n = arr.size(); unordered_map<long, long> left, right; // Init the right with freq and left with 0 for (auto x: arr) { right[x]++; left[x] = 0; } ...
ALGO
0.999726
4.809585
e24bb17a-6e43-4ad1-b252-7188748d7945
muhammadhasan01/cp
Online Judge/Codeforces/Contests/EDU-DIV2/EDU-DIV2-101/B.cpp
#include <bits/stdc++.h> using namespace std; #define sim template < class c #define ris return * this #define dor > debug & operator << #define eni(x) sim > typename \ enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) { sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } s...
ALGO
0.999966
4.091226
df77ec07-df4c-4ff3-a6e3-78d09564aa89
PhamHung2020/Applied_Algorithms_Exercise
Training 7 - Greedy/H. Job Schedule/H. Job Schedule.cpp
#include <iostream> #include <vector> #include <algorithm> #include <queue> using namespace std; priority_queue<int> pq; int n; vector<int> profit[100100]; long long res; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; for (int i = 1; i <= n; ++i) { int d, p; cin >> d >> ...
ALGO
0.99981
4.038918
58fd441e-c754-420e-8c15-168909da4b5a
sammiiT/leetcode
DFS/Leetcode 1087 Brace Expansion.cpp
//===思路=== void dfs(string& s, int i, string in, vector<string>& res){ if(i==s.size()){ res.push_back(in); return; } //不用 for(int i=start;i<s.size();++i)的方式, 達到遍歷所有節點的方式 if(s[i]=='{'){ string tmp=""; vector<string> str; while(s[i]!='}'){ if(s...
ALGO
0.994566
4.668096
e537d58b-df7d-4bc2-a10b-4c4277952083
priyansh-iitd26/Problem-Solving_2025
Feb 9/2065C2.cpp
/* Link : https://codeforces.com/contest/2065/problem/C2 For C2, you now have m values in the array b[]. Clearly, we now need to consider (m + 1) different possible options for a particular index of a[]. Solving this problem in O(n*m) is clearly too slow. Therefore, we need to employ a different technique. Note that...
ALGO
0.999928
5.416339
7744c580-6982-401e-9a78-2b8b857214d7
Cerberus-Future/frameworks_av
media/libstagefright/codecs/amrnb/common/src/q_plsf.cpp
/* ******************************************************************************** * * GSM AMR-NB speech codec R98 Version 7.5.0 March 2, 2001 * R99 Version 3.2.0 * REL-4 Version 4.0.0 * *********************************************************...
ALGO
0.927666
5.540532
f7ae18f9-e295-44ed-98e8-6d4f41d3119b
sarvex/leetcode-pharo
solution/2100-2199/2134.Minimum Swaps to Group All 1's Together II/Solution.cpp
class Solution { public: int minSwaps(vector<int>& nums) { int cnt = 0; for (int& v : nums) cnt += v; int n = nums.size(); vector<int> s((n << 1) + 1); for (int i = 0; i < (n << 1); ++i) s[i + 1] = s[i] + nums[i % n]; int mx = 0; for (int i = 0; i < (n << 1); ...
ALGO
0.999998
5.63213
0ce7ab8a-4a6c-4609-9624-c4d87e4791ed
jacklambert122/MovieBST
src/MovieTree.cpp
#include <iostream> #include "MovieTree.hpp" using namespace std; /* ====================================================================== * MovieTree Class Methods ========================================================================= */ void MovieTree:: destroyNode(MovieNode *currNode) { if(currNode!=NULL)...
TOOL
0.989269
4.70408
aa1bebf2-05ed-4e7b-9e35-f8aa4f9fa2e2
ishandutta2007/codeforces
rgb_icpc1/normal/1362/B.cpp
#include<bits/stdc++.h> using namespace std; int flg[1050], a[1050]; int main() { ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); int t, n; for (cin >> t; t --;) { cin >> n; memset(flg, 0, sizeof(flg)); for (int i = 0; i < n ; i ++) cin >> a[i], flg[a[i]] = 1; int res = -1; for (int i = 1; i < 1024; i +...
ALGO
0.999957
4.556251
4419989b-1b43-4957-bd91-0645552bd0c8
Raibows/BigInteger
BigInt.cpp
// // Created by Raibows on 2019/12/30. // #include "BigInt.h" bool BigInt::get_positive_sign() { return this->sign == 0 ? true : false; } int BigInt::get_real_length() { /* * not include the sign bit */ int i = this->value.size() - 1; int j = 0; this->real_length = 0; while (this->v...
ALGO
0.998206
4.261054
2a6c2467-ba3d-4ee1-830e-ce350c8aa0b7
shakil-ahmmed-se/algo-graph
dfs_tree_practice.cpp
#include<bits/stdc++.h> using namespace std; const int N = 1e5+5; vector<int> adj[N]; bool visited[N]; void dfs(int u){ //section 1 visited[u] = true; cout<<"Visiting node : "<<u<<endl; for(int v : adj[u]){ if(visited[v] == true) continue; dfs(v); } } int main(){ int n,m; ci...
ALGO
0.999883
4.783727
a843da97-d21b-4a28-b740-88328705a8d9
Divyansh-Kumawat/leetcode
0966-binary-subarrays-with-sum/0966-binary-subarrays-with-sum.cpp
class Solution { public: int func(vector<int>& nums, int goal ){ int n=nums.size(),l=0,r=0,sum=0,cnt=0; if(goal<0) return 0; while(r<n){ sum+=nums[r]; while(sum>goal){ sum=sum-nums[l]; l++; } cnt+=r-l+1; ...
ALGO
0.999992
5.978502
27bf4ac9-b8d0-41cb-aac7-aea9000816b7
badumbatish/Leetcode
0023-merge-k-sorted-lists/0023-merge-k-sorted-lists.cpp
/** * Definition for singly-linked list. * 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) {} * }; */ class Solution { public: ListNode* mergeKLists...
ALGO
0.999879
6.051523
bf25986b-a19a-4aa0-9fd3-472f51381e8e
ritwikdixit/Kalman-Filter
cpp/thirdparty/eigen/doc/snippets/compile_MatrixBase_applyOnTheRight.cpp
static bool eigen_did_assert = false; #define eigen_assert(X) if(!eigen_did_assert && !(X)){ std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X << "\n### The following would happen without assertions:\n"; eigen_did_assert = true;} #include <iostream> #include <Eigen/Eigen> #ifndef M_PI...
ALGO
0.863329
3.291859
94e8808c-ef1e-45f7-b1e2-68a7adce25af
manishsinghkuswaha/code_library-100-Questions-
lb_cyc_rot_by1.cpp
#include<iostream> using namespace std; int main() { int n,i; cout<<"enter the size of array\n"; cin>>n; int a[n]; cout<<"enter array\n"; for(i=0;i<n;i++){ cin>>a[i]; } int temp = a[n-1]; for(i=n-1;i>0;i--){ a[i] = a[i-1]; } a[0] = temp; for(i=0;i<n;i+...
ALGO
0.999867
3.105563
385253dd-840c-4abf-b7ac-37549031b955
ishandutta2007/codeforces
gary2005/normal/1082/F.cpp
/* AuThOr Gwj */ #include<bits/stdc++.h> #define rb(a,b,c) for(int a=b;a<=c;++a) #define rl(a,b,c) for(int a=b;a>=c;--a) #define LL long long #define IT iterator #define PB push_back #define II(a,b) make_pair(a,b) #define FIR first #define SEC second #define FREO freopen("check.out","w",stdout) #define rep(a,b) for(int...
ALGO
0.999914
3.347643
0bc49c94-dee4-42e1-87fd-153e8e021fb9
snewptl/stationaryTraveller
old-memory/Codeforces Round #812 (Div. 2)/A.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int>pii; typedef double db; const int maxn=2e5+5; const ll mod=998244353; const double eps=1e-10; int n; int ans[4]; int main(){ int T=1;scanf("%d",&T); while(T--){ scanf("%d",&n); for(int i=0;i<4;i++)ans[i]=0; for(int i=1;i<=n;...
ALGO
0.999485
3.980211
8b8cf2c4-933a-4fb5-9de7-1342157739b6
yousseftaher2008/Awfarly
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
fc20ca3f-f4d0-4661-b807-726599dc3ff1
sarvex/leetcode-algol
solution/1000-1099/1008.Construct Binary Search Tree from Preorder Traversal/Solution.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.999994
6.370674
33719268-6f79-445c-bd3f-cc67649072db
zhengry22/basics_of_programming
repos/铺地毯/铺地毯/铺地毯.cpp
#include<iostream> using namespace std; int n; int* a, * b, *g, * k; int x, y; int m = 0; int main() { // cin >> n; a = new(int[n]); b = new(int[n]); g = new(int[n]); k = new(int[n]); for (int i = 0; i < n; i++) { cin >> a[i] >> b[i] >> g[i] >> k[i]; } cin >> x >> y; //ٴӵnŵ̺һ for (int i = n - 1; i >= 0...
ALGO
0.99975
3.51649
83a4c9e5-6d42-40a8-a8ff-8cbd0677a606
di3g0r/GraphosActivities
4.3.cpp
//Act 4.3 Actividad Integradora Grafos //Carlos Tellez //Diego Rodríguez Romero //Sergio Ramirez Anaya //18 de noviembre de 2023 #include <vector> #include <iostream> #include <fstream> #include <sstream> using namespace std; class Graph { private: int numVertices; int adjMatrix[1000][1000]; int topValue; ...
DATA
0.979142
4.596704
3f2a2977-1ec9-4c75-9c21-394634c3476e
behradesg/LIGGGHTS_BE
src/KSPACE/ewald_disp.cpp
/* ---------------------------------------------------------------------- Contributing authors: Pieter in 't Veld (SNL), Stan Moore (SNL) ------------------------------------------------------------------------- */ #include <mpi.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #includ...
ALGO
0.99091
3.157679
52f624cc-20d2-46b7-9659-fece0fdadacb
Suikaba/procon-solved
Codeforces/Round300-349/Round304/C-Soldier_and_Cards.cpp
// http://codeforces.com/contest/546/problem/C #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<deque<int>> st(2); for(int i = 0; i < 2; ++i) { int k; cin >> k; st[i].resize(k); for(int j = 0; j < k; ++j) { cin >> st[i][j]; ...
ALGO
0.999785
3.674619
965b5c6f-7107-44a8-be99-b63bed28ff67
Mahmoud3ali/CompetitiveProgramming
Timus/TIMUS 1349.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll ; int dp[502][(int) 1e4]; vector<int> a, b; int main() { bool good = 0; pair<int,pair<int,int> > ans; ans = {1e9,{1e9,1e9}}; int n; cin >> n; if(n > 2 || n == 0) cout << "-1\n"; else if(n == 1) cout << "1 2 3\...
ALGO
0.999776
3.61401
a30b746b-03ec-443a-8946-83589017cda7
MinhHieuPT/me
DSA01003 - HOÁN VỊ KẾ TIẾP.cpp
#include<bits/stdc++.h> #define mod 1000000007 #define ll long long #define p(x) pair<x,x> #define v(x) vector<x> #define tree node* #define pb(a) push_back(a) #define pf(a) push_front(a) #define FOR(i,l,r) for(int i=l;i<r;i++) #define FORX(i,l,r,x) for(int i=l;i<r;i+=x) #define FORD(i,l,r) ...
ALGO
0.999854
3.035975
59dd781a-8686-4db4-8485-512561a9674c
koritafei/leetcode
dp/70.climbing-stairs.cpp
/* * @lc app=leetcode id=70 lang=cpp * * [70] Climbing Stairs * * https://leetcode.com/problems/climbing-stairs/description/ * * algorithms * Easy (50.21%) * Likes: 9347 * Dislikes: 286 * Total Accepted: 1.3M * Total Submissions: 2.5M * Testcase Example: '2' * * You are climbing a staircase. It ta...
ALGO
0.999974
6.735954
185bfb84-d064-4fa7-9fde-6d746978279f
hyeonseong0917/Codeforces
876_div2/a.cpp
#include <iostream> #include <cmath> using namespace std; int main() { // your code goes here int t=0; cin>>t; while(t--){ int n,k=0; int res=0; cin>>n>>k; double c=(double)(n-1)/k; double d=ceil(c); res+=d; res+=1; cout<<res<<"\n"; } return 0; }
ALGO
0.999815
3.910013
2e74b85c-7908-4213-bc1e-3612e42a2cec
JorenSix/Pidato
libraries/Yin/Yin.cpp
#include "Yin.h" #include "WProgram.h" void Yin::initialize(float yinSampleRate,int yinBufferSize){ bufferSize = yinBufferSize; sampleRate = yinSampleRate; halfBufferSize = bufferSize / 2; threshold = 0.15; probability = 0.0; //initialize array and set it to zero yinBuffer = (float *) malloc(sizeof(float)* halfB...
ALGO
0.991884
4.584992
0e32ac4e-43bb-44e7-8216-d757382eca4b
mcmkmp/tiscript
tool/ucdata/ucdata_lt.cpp
/* Lite version (with local translation tables) of original code of M. Leisher Andrew Fedoniouk @ terrainformatica.com */ #include <stdio.h> #include <stdlib.h> #include <string.h> //#ifndef WIN32 // #include <unistd.h> //#endif #include "ucdata_lt.h" #include "ucdata_data.inl" #include "../tl_sync.h" #include "../...
TOOL
0.91715
5.884528
a530a1e2-c000-4cf6-856e-f95522047a3f
hishamcse/Data-Structures-and-Algorithms-Specialization
COURSE 1 (Algorithmic Toolbox)/week5_dynamic_programming1/Week 5 Assignment/submitted files C++/lcs2.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; using std::vector; int lcs2(vector<int> &a, vector<int> &b) { int d[a.size() + 1][b.size() + 1]; for (int j = 0; j <= b.size(); j++) { for (int i = 0; i <= a.size(); i++) { if (i == 0) { ...
ALGO
0.99997
4.953642
e963672d-79dd-4517-a013-7d309e548c41
pepsiduck/SNAIKE
local_ver/src/train.cpp
#include "../headers/train.h" std::string directions[PLAYERS] = {"","","","","",""}; int8_t snake_step(std::vector<std::pair<int32_t,int32_t>> *snakes, std::pair<int32_t,int32_t> *apples, std::pair<int32_t,int32_t> *walls, bool* alive, float *rewards, Gradient **gradients, AI *ai, uint32_t game_step) { for(uint32...
ALGO
0.999139
4.675991
7d69cfa0-b690-45ff-8f45-12a398d065b1
nksharma132/Competitive-Programming
Codeforces/Division_3/TwoVessels.cpp
#include<bits/stdc++.h> using namespace std; void testCase() { int a, b, c; cin>>a>>b>>c; if(a == b) { cout<<"0\n"; return; } int diff = abs(a - b); if (ceil(diff/float(2)) <= c) { cout<<"1\n"; } else { cout<<ceil(diff / float(2 * c))<<"\n"; } } int main() { int t; cin>>t; while(t--) { testC...
ALGO
0.999662
3.847125
5b4db0a8-cdd5-40cf-b22f-934cd5dd6430
ahmedbougacha/dagger
lib/Analysis/MemorySSAUpdater.cpp
#define DEBUG_TYPE "memoryssa" using namespace llvm; // This is the marker algorithm from "Simple and Efficient Construction of // Static Single Assignment Form" // The simple, non-marker algorithm places phi nodes at any join // Here, we place markers, and only place phi nodes if they end up necessary. // They are on...
ALGO
0.998459
7.401504
b6b56015-4f3d-494a-b70a-b7f9b05d1743
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/CodeLlama/top0-100/find-the-occurrence-of-first-almost-equal-substring-Solution.minStartingIndex/177767_DoS.cpp
static bool decode_openldap_dereference(void *mem_ctx, DATA_BLOB in, void *_out) { void **out = (void **)_out; struct asn1_data *data = asn1_init(mem_ctx); struct dsdb_openldap_dereference_result_control *control; struct dsdb_openldap_dereference_result **r = NULL; int i = 0; if (!data) return false; control = ...
TOOL
0.979143
4.864362
5753c0f7-dff3-4ceb-bc15-25a912854d68
pinchyCZN/notepad
PowerEditor/src/WinControls/Preference/preferenceDlg.cpp
#include "precompiledHeaders.h" #include "preferenceDlg.h" #include "lesDlgs.h" #include "EncodingMapper.h" const int BLINKRATE_FASTEST = 50; const int BLINKRATE_SLOWEST = 2500; const int BLINKRATE_INTERVAL = 50; const int BORDERWIDTH_SMALLEST = 0; const int BORDERWIDTH_LARGEST = 30; const int BORDERWIDTH_INTERVAL = ...
TOOL
0.87817
5.267811
a44377d9-7199-44e3-98a8-0a938626bc0e
exmy/PAT-Solution
PAT (Advanced Level) Practise/1112. Stucked Keyboard (20).cpp
#include <iostream> #include <string> #include <map> #include <algorithm> using namespace std; /* 3 aaajkhjfffjjj af ajkhjfjjj 3 abc_fff__a_sss_t_ttt_fff 5 _____anc _ _anc 3 bbbavvvb v bbbavb 3 caseee1__thiiis_iiisss_a_teeeeeest ei case1__this_isss_a_teest */ int main() { string str; int k; cin >> k ...
ALGO
0.999989
3.569329
cf130bfd-7618-43f0-9ac5-9a087e341be3
firiexp/contest_log
atcoder/030B.cpp
#include <iostream> #include <algorithm> #include <vector> #include <iomanip> #include <map> #include <queue> static const int MOD = 1000000007; using ll = long long; using u32 = unsigned; using namespace std; template<class T> constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208; template <class T, class U>...
ALGO
0.999948
3.635348
69e7478a-f517-4a06-80ae-978aa00f7cb0
alexandraback/datacollection
solutions_5630113748090880_0/C++/TrueBamboo/PB.cpp
#include<iostream> #include<cmath> #include<cstring> #include<cstdio> #include<algorithm> #include<cstdlib> #include<iomanip> #include<vector> #include<list> #include<iterator> #include<stack> #include<queue> using namespace std; #include<fstream> FILE *fin=freopen("a.in","r",stdin); FILE *fout=freopen("a.out","w",std...
ALGO
0.999308
3.293033
9e86ccb6-2dab-4a74-9694-c22e908fb621
wjoh0315/BOJSolutions1
BOJ15652_NandM4/NandM4.cpp
//https://www.acmicpc.net/problem/15652 #include <iostream> using namespace std; void printsequencef(int n, int m, int cur, int current[8]) { if (m <= 0) { for (int i=0; i < 8; i++) { if (current[i] == 0) break; cout << current[i] << ' '; } ...
ALGO
0.999917
3.623394
67031c72-0ba8-4efe-af6f-62dcf03a8def
srkimdev/Cpp_practice
search_template.cpp
#include <iostream> template <typename T> bool search(T a, T b[], int size) { for(int i = 0; i < size; i++) { if (b[i] == a) return true; } return false; } int main() { char x[] = {'c', 'd', 'e', 'f', 'g'}; if (search('e', x, 5)) std::cout << "100이 배열 x에 포함되어 있습니다." <<...
ALGO
0.997043
5.09789
c420b327-5b9e-4335-9fa0-9df49e4f200d
Toysoft/NNvision
darknet_nvenc/opencv-3.4.4/apps/interactive-calibration/frameProcessor.cpp
#include "frameProcessor.hpp" #include "rotationConverters.hpp" #include <opencv2/calib3d.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> #include <vector> #include <string> #include <algorithm> #include <limits> using namespace calib; #define VIDEO_TEXT_SIZE 4 #define POINT_SIZE 5 static cv::Si...
TOOL
0.908205
6.210593
4cd3b782-3feb-4b64-9cf7-acc7d149e735
vanbeonhv/ptit-source
PTIT - DSA/4.do_thi_dsc_to_dsk.cpp
#include<bits/stdc++.h> using namespace std; int n, m; vector<int> ke[1005]; int main(){ freopen("dsc.in","r",stdin); freopen("dsk.out", "w",stdout); cin >> n >> m; for(int i = 0; i < m; i++){ int x, y; cin >> x >> y; ke[x].push_back(y); // ke[y].push_back(x); } for(int i = 1; i <= n; i++){ sort(ke...
ALGO
0.999403
3.992261
fcf12e4b-6615-44ff-98df-4fe513d8a047
ChrisXu1006/Leecode
199.cpp
#include <iostream> #include <cstring> #include <string> #include <vector> #include <cmath> using namespace std; void traverse(vector<vector<int>> &buf, TreeNode* root, int level){ if ( root == NULL ) return; if ( level >= buf.size() ){ vector<int> levl; bu...
ALGO
0.999965
5.222551
7373245e-63f5-4898-a612-00bc38bf4def
amanSin1/DS-algo-s
recurrsion/quickSort.cpp
#include<bits/stdc++.h> using namespace std; int partition(vector<int>&arr, int low, int high){ int pivot = arr[low]; int i = low; int j = high; while(i<j){ while(arr[i] <= pivot && i<= high-1){ i++; } while(arr[j] > pivot && j >= low+1 ){ j--; ...
ALGO
0.999951
5.14311
bc26c683-ddc2-42ff-b56c-fb6a7db96521
vultkayn/cp_training
kattis/fullTank_ok/code.cpp
#include <iostream> #include <vector> #include <queue> #include <algorithm> #include <tuple> #include <limits> #include <utility> using namespace std; using vvi = vector<vector<long>>; struct road_t { int to; int w; road_t (int to, int w) : to {to}, w{w} {} }; struct city_cost_fuel { int city; in...
ALGO
0.999943
5.134184
45b51d16-581e-4cb1-8102-ca35c72e989d
zhibekkazbek/pp1-22B030546
lab5/G.cpp
/* G-74816.Equality !!! Given two strings s and t, check this two strings for equality.*/ #include <iostream> using namespace std; int main(){ string s, t; cin >> s >> t; if(s.find(t) != -1) cout << "YES"; else cout << "NO"; }
ALGO
0.999991
4.674299
dc731695-e532-48c7-af2c-8a21c145d1b9
shivcodecf/leetcode-start-9-2-24
2727-number-of-senior-citizens/number-of-senior-citizens.cpp
class Solution { public: int countSeniors(vector<string>& details) { int ans=0; for(int i=0;i<details.size();i++) { string s = details[i].substr(11,2); int check = stoi(s); if(check>60) { ans++; } } ...
ALGO
0.998759
5.886596
dfdbd7f4-3506-43c9-94f8-d909b8b82f59
keshavchandel13/DAA-lab
15_BinaryKnapsack.cpp
#include<iostream> #include<vector> #include <limits.h> using namespace std; int knapsack(vector<int> wt, vector<int> val, int n, int w){ vector<int> prev(w+1,0); for(int i = wt[0];i<=w;i++){ prev[i] = val[0]; } for(int ind = 1;ind<n;ind++){ for (int cap = w; cap >= 0; cap--) { i...
ALGO
0.999975
5.10333
953ca734-6c10-4b88-a499-d1fc8f9e4baa
muyangrendequzhang/langqiao.cpp
马的遍历.cpp
#include<iostream> #include<queue> #include<cstring> using namespace std; typedef pair<int,int> pii; struct node { int x; int y; };//记录我们点所在的位置 int n,m,x,y; int dis[500][500];//记录距离 int vis[500][500];//记录是否走过了 bool check(int mx,int my) { if(mx<=n&&my<=m&&mx>0&&my>0&&vis[mx][my]==0) { return tru...
ALGO
0.999227
3.13909
5d19759a-ca5e-4532-8ac7-638b4c2c71e8
QtWorks/VirtualClientDialogEditor
core/phasenode.cpp
#include "phasenode.h" #include "expectedwordsnode.h" #include "hashcombine.h" #include "logger.h" namespace Core { namespace { QList<AbstractDialogNode*> filterLeafs(const QList<AbstractDialogNode*>& nodes) { QList<AbstractDialogNode*> leafs; std::copy_if(nodes.begin(), nodes.end(), std::back_inserter(leafs), ...
TOOL
0.956209
6.171551
c9e83bb6-0ce0-4c1b-ac28-2f07927c7c53
alexandraback/datacollection
solutions_2463486_0/C++/simp1eton/C.cpp
#include <iostream> #include <cstdio> #include <string> #define MAXN 1000 using namespace std; int checkPalin(int x){ string s = ""; while(x > 0){ s += x%10 + '0'; x /= 10; } string y = s; reverse(y.begin(),y.end()); return s == y; } int main(){ freopen("C-small-attempt0.in","r",stdin); freope...
ALGO
0.998434
4.380464
89814e6f-523c-4cde-8263-5420a33682fb
mathpaul3/Algorithm-Problem-Solving
baekjoon/cpp/1033.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; vector<int> adj[10]; int N, ingredient[10]={0,}; void multiply(int ingred, int mul) { bool visit[10]={0,}; queue<int> q; q.push(ingred); ingredient[ingred] *= mul; visit[ingred] = true; while (!q.empty()) { int...
ALGO
0.999973
3.500513
b99b7f4b-a219-46f4-8b25-6cdbf6821cc2
priyanshscpp/Data_Structures
02_Recursion/5_NestedRec.cpp
#include<iostream> using namespace std; int fun(int n) { if(n>100) return n-10; return fun(fun(n+11)); } int main() { int r; r=fun(30); cout<<r<<endl; return 0; }
ALGO
0.999392
3.157853
3dd6bf2e-8973-4155-8fe5-302ea18b42b1
mochi-hpc/mofka
src/PrioPool.cpp
#include "PrioPool.hpp" #include <mutex> #include <condition_variable> #include <queue> #include <chrono> #include <iostream> struct ArgsWrapper { uint64_t priority; void (*func)(void*); void* args; }; struct ULT { ABT_thread m_thread; ULT(ABT_thread t) : m_thread(t) {} bool operator<(c...
TOOL
0.951575
6.086675
5ea66fb1-fdd7-442e-a282-495d69d7c1d4
sharc-lab/LightningSim
llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp
// <algorithm> // template<ForwardIterator InIter, OutputIterator<auto, InIter::reference> OutIter> // constexpr OutIter // constexpr after C++17 // rotate_copy(InIter first, InIter middle, InIter last, OutIter result); #include <algorithm> #include <cassert> #include "test_macros.h" #include "test_iter...
TEST
0.980102
7.417317
b2372dff-3ba2-4898-9dfc-8cd813394206
imFAHADcom/course_4_cpp
generate_keys.cpp
/* Write a program to read how many keys to generate and print them on the screen. Input: 5 Output: Key [1]: ETAI-HJUV-PEIP-CFRX Key [2]: UMCO-YSPQ-PHYK-STIL Key [3]: QBSR-MZEC-BYNA-DSYK Key [4]: MISQ-ULYB-ZRAZ-LMAG Key [5]: NQCR-PPFJ-KZLF-ZHMT */ #include <iostream> #include <ctime> #include <cstdlib> #include <s...
TOOL
0.921035
4.703411
6682ef8c-5c60-46aa-8a8c-5a17e7a37b50
Flare-k/Algorithm
최단경로/친구_최단경로_1058.cpp
#include <iostream> #include <algorithm> #include <string> #define MAX 51 #define INF 987654321 using namespace std; int board[MAX][MAX]; int N, answer; void run() { for (int k = 1; k <= N; k++) { for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) { if (i == j || j == ...
ALGO
0.999896
4.614982
55b6fbe5-a960-4d6a-8123-954809dd4127
raincross7/code-similarity
codes/train_code/problem472/problem472_222.cpp
#include<bits/stdc++.h> #include<stdio.h> using namespace std; const long long INF = 1e7+1; const long long MOD = 1000000007; const long double PI = 3.1415926; #define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++) #define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) RFOR(i,0...
ALGO
0.999229
4.061018
e0ec620c-ffc5-4405-a2c6-31a922016768
xiaoshen320924/c-learning
test_10-26/MultipPlus.cpp
#define _CRT_SECURE_NO_WARNINGS 1 //#include<stdio.h> //int main() //{ // int k = 0; // int i = 1, j = 1; // scanf("%d", &k); // for (i = 1; i <= k; i++) // { // for (j = 1; j <= i; j++) // { // printf("%d*%d=%d ",j,i, (i * j)); // } // printf("\n"); // } // return 0; //}
ALGO
0.999275
3.530267
18e07414-b5cf-42d2-8dfe-9dbb53c02a25
zak-soussi/Competitive_Programming_Codeforces
CodeForces/GNU C++20 (64)/1822E | Making Anti-Palindromes/203368278.cpp
#include <bits/stdc++.h> #pragma GCC target("bmi,bmi2,lzcnt,popcnt") #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3") typedef long long ll; typedef long double ld; const char nl='\n'; const int infiniint=INT_MAX; const ll infinill=LONG_LONG_MAX; using namespace std; ll power_no_mod(ll a, ll b)...
ALGO
0.999589
4.392434
93d9ade5-02dc-4f57-b5ad-e3f2754aa7d2
HEltim7/cpcode
Archive/CCPC/2022威海/J_Eat_Sleep_Repeat.cpp
#include <set> #include <vector> #include <iostream> #include <algorithm> using namespace std; #define endl '\n' using LL=long long; using PII=pair<int,int>; constexpr int N=1e5+10; int arr[N]; PII con[N]; LL solve(vector<PII> con,vector<int> arr) { if(arr.empty()) return 0; LL res=0; int pre=con.front()....
ALGO
0.999622
4.161396
d83959ec-6796-44bc-9c63-e4eba9cacb89
md143rbh7f/competitions
codeforces/16/log.cpp
#include <iostream> using namespace std; int n, last = -1, t, h, m, count, i, ans = 1; char buf[50]; int main() { cin >> n; cin.getline( buf, 50 ); for( i = 0; i < n; i++ ) { cin.getline( buf, 50 ); m = 10*(buf[4]-'0')+buf[5]-'0'; h = (10*(buf[1]-'0')+buf[2]-'0')%12; if( buf[7]=='p' ) h += 12; t = 60*h...
ALGO
0.995325
3.474803
6f48fcb5-01d8-415f-b4ed-19be3d575f78
arcogelderblom/AdventOfCode
2015/Day03/day3.cpp
#include <iostream> #include <vector> #include <cassert> #include <chrono> #include <set> #include "StringParser.hpp" #include "FileHandler.hpp" typedef std::pair<int, int> Coordinate; // x,y std::set<Coordinate> deliverPresents(std::string instructions) { Coordinate currentHouse = std::make_pair(0,0); std::...
ALGO
0.999849
5.850962
fb598d7b-dc3c-41b5-b26c-796f2676e338
nopower0/ACM
HDU_ACM/2045/main.cpp
/* * File: main.cpp * Author: nopower0 * * Created on 2012年3月20日, 下午7:03 */ #include <iostream> #include <iomanip> using namespace std; double f(int n) { double* a=new double[n]; a[0]=3; a[1]=6; a[2]=6; for (int i=3; i<n; i++) a[i]=a[i-1]+a[i-2]*2; double result=a[n-1]; delete[] a; return result; } ...
ALGO
0.999703
3.861143
22c1c25e-43b6-41ae-bacd-9efd257b4838
Nag28endra/Competitive-Programming-using-C--
count_subarrays_with_xor_as_k.cpp
#include<bits/stdc++.h> using namespace std; int optimal(vector<int> &arr, int n, int k){ /* We'll be using the formula x = xr^k; {check for the derivation in notes} We make sure that x is in our hashmap. The hashmap stores values in (front xor->count) format. */ int xr = 0; int ...
ALGO
0.999527
4.234128
09e7378a-0d23-438b-8026-8400b6ca62cb
RanishPanthee/CPP-Practice-works
test001.cpp
class shape { public: double side1,side2; public: shape(){ side1=1; side2=1; } shape(double a ,double b){ side1=a; side2=b; } void setData(){ cout<<"enter data"<<endl; cin>>side1>>side2; } virtual void displayArea(){ } ...
TOOL
0.873198
3.822261
1dba5a0f-d4a0-4e79-8bb8-bf17c831aa9b
DysonHoang/Tin-Hoc
IT at school NEW/10-22/cau2.cpp
#include <bits/stdc++.h> #define Mx 10000000 #define ll long long using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); if (fopen("CAU2.INP", "r")) { freopen("CAU2.INP", "r", stdin); freopen("CAU2.OUT", "w", stdout); } string s; cin...
ALGO
0.999479
4.328367
27644943-6076-43e8-8c22-1a3e4c1d2c94
LinkouCommander/sdp_test
sdp_serial.cpp
#include <iostream> #include <cmath> #include <limits> #include <time.h> using namespace std; void transpose(float**** matrix, float**** matrix_transposed, int batch_size, int num_heads, int rows, int cols) { // cout << "Transposing matrices with rows: " << rows << ", cols: " << cols << endl; for (int b = 0; ...
ALGO
0.995014
4.103932
ad13e145-796d-4c4c-aa47-44c7191da497
dochi486/ProgrammersCPP
FindNumber/FindNumber.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; int solution(int num, int k) { int answer = 0; auto num_str = to_string(num); auto find_str = to_string(k); for (int i = 0; i < num_str.size(); ++i) { char a = num_str[i]; int b = stoi(&a); if (b...
ALGO
0.999573
5.000147
02e3ea63-26c6-42cb-84d8-38456146553f
K111DK/opengauss-Multi-Tenancy-Buffer
src/common/backend/utils/adt/orderedsetaggs.cpp
#include "postgres.h" #include "knl/knl_variable.h" #include "catalog/pg_aggregate.h" #include "catalog/pg_type.h" #include "miscadmin.h" #include "nodes/nodeFuncs.h" #include "executor/node/nodeAgg.h" #include "utils/array.h" #include "utils/lsyscache.h" #include "utils/timestamp.h" #include "utils/tuplesort.h" const...
ALGO
0.988967
7.413564
5b1236c1-6de3-4a80-beda-db1766b22ed8
cms-externals/boost
libs/geometry/doc/doxy/doxygen_input/sourcecode/doxygen_1.cpp
OBSOLETE #include <boost/tuple/tuple.hpp> #if defined(_MSC_VER) // We deliberately mix float/double's here so turn off warning #pragma warning( disable : 4244 ) #endif // defined(_MSC_VER) #include <boost/geometry/geometry.hpp> #include <boost/geometry/geometries/register/point.hpp> #include <boost/geometry/geometri...
TOOL
0.945993
7.397203
e741a346-6daa-42c6-bcd6-1d934744a504
sbylash/PEMR_MOBILE
flutter_plugin_pubdev/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.998214
6.76775
53b84331-9110-42ad-b43a-3aac82cfb540
ishandutta2007/codeforces
arayi/normal/1505/E.cpp
//Arayi #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <string> #include <queue> #include <stack> #include <algorithm> #include <math.h> #include <vector> #include <cstring> #include <ctime> #include <set> #include <bitset> #include <map> #include <unordered_map> #include <unordered_set> #include <iomanip...
ALGO
0.999928
3.762182
6bbb2eea-07e4-4973-a479-5bc733d0f336
Higherorbit/Leetcode-and-gfg-solutions
129-sum-root-to-leaf-numbers/129-sum-root-to-leaf-numbers.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.99999
6.245656
8b8981ed-c671-4d7f-be7b-abe61ab3c6d1
jarus9350/leetmycodes
2533-bitwise-xor-of-all-pairings/bitwise-xor-of-all-pairings.cpp
class Solution { public: int xorAllNums(vector<int>& nums1, vector<int>& nums2) { int s1 = nums1.size() % 2; int s2 = nums2.size() % 2; int xorNums1 = nums1[0]; for (int i = 1 ; i < nums1.size() ; i++){ xorNums1 = xorNums1 ^ nums1[i]; } int xorNums2 = nu...
ALGO
0.999962
5.527659
02467614-314f-47c7-8e15-ea77f8634e67
obito456/c-
string a to A 5.cpp
#include <iostream> #include <algorithm> using namespace std; int main() { string s1="vijay kumar"; for(int i=0; i<s1.size(); i++){ if (s1[i]>='a' && s1[i]<='z') s1[i]-=32; // } cout<<s1<<endl; return 0; } // In ASCII, the uppercase lette...
ALGO
0.995194
3.974391
524c0a0b-bf9b-4adb-8099-b80623b90534
lihzxs/LouGuOJCode
cpp/P1238.cpp
///////////////////////////////////////////// // // FileName : First.cpp // Creator : Fm // Date : 2019-10-16 22:45 // Comment : OJ(P1238) // /////////////////////////////////////////// //#include "pch.h" #include <iostream> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <math.h> #include <st...
ALGO
0.999894
3.696846
95584227-da60-42da-9baa-f59b339b0699
GalitMiller/sandbox
cplus/BinarySearchTree/Tree.cpp
#include <iostream> #include "Tree.h" Tree* Tree::insert(int data){ if ( data == _data ) return this; if ( data > _data ) { if ( _right ) return _right->insert(data); _right = new Tree(data); _right->_parent = this; return _right; } ...
ALGO
0.9947
3.778418
3520b681-7a01-4e11-9c23-a74a89996afe
HekpoMaH/Olimpiads
grupa C/olimpiada/ob6tinski/2012/NOI_1_2012_C/number/make-tests.cpp
#include <iostream> using namespace std; int main() { int k=0; for(int x=10000; x<=99999; x++) { int a = x/10000; int b = x/1000%10; int c = x/100%10; int d = x/10%10; int e = x%10; if(b==a+c && d==c+e) { k++; cout << x << " " << k << endl; } } return 0; }
ALGO
0.998561
3.616095
e943c6ac-6aa0-4099-ba7a-bc8af105d947
parasguglani1/competitive_coding
Codechef/long challenge/Aug2022_1/Two_Trains.cpp
#include <bits/stdc++.h> using namespace std; using namespace chrono; #define ff first #define ss second #define int long long using ll = long long; #define setbits(x) __builtin_popcountll(x) #define zrobits(x) __builtin_ctzll(x) #define mod 1000000007 #define inf 1e18 #define PI 3.1415926535897932384626 #define ps(x,...
ALGO
0.999881
4.180541
eed13e4f-2cb0-45ea-ab19-090b4b67b776
WilliamX1/leetcode
Offer/38.cpp
class Solution { private: set<string> ans; bool get(int flag, int idx) { return (flag >> idx) & 1; }; void dfs(const string str, string cur, int flag) { if (str.size() == cur.size()) { ans.insert(cur); return; }; for (int i = 0; i...
ALGO
0.999979
5.707376
38d1aa1c-ecc1-4f68-8632-1bc93f5f9577
matt-seb-ho/toto
polygon.cpp
#include "polygon.h" #include <cassert> using namespace std; //definition of an implicit line //f(x; y) = (y0 - y1) * x + (x1 - x0)*y + x0 * y1 - x1 *y0 = 0 double implicitLine(vec2 v0, vec2 v1, vec2 p) { return( (v0.y()-v1.y())*p.x() + (v1.x()-v0.x())*p.y() + v0.x()*v1.y() - v1.x()*v0.y() ); } /* polygon evaluati...
ALGO
0.998657
5.878999
8e8ce58b-0711-4da6-bb45-29e62b5a319d
sebhtml/hiv-dskernel
discriminant/Sort.cpp
#include <list> #include <string> #include <iostream> #include <algorithm> #include <fstream> using namespace std; class MyData{ string key; double value; MyData(); public: MyData(string key,double value); bool operator<(const MyData&a); string&getKey(); double getValue(); }; MyData::MyData(string key,double v...
ALGO
0.961417
4.287258
53ff5334-e259-443d-ad0a-370868ad4085
kk77777/LeetCode-Solutions
q701.cpp
class Solution { public: TreeNode* insertIntoBST(TreeNode* root, int val) { if(root==NULL){ TreeNode*t=new TreeNode(val); return t; } TreeNode*iroot=root; while(root!=NULL){ if(val<root->val){ if(root->left){ roo...
ALGO
0.999967
5.921092