uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
2b819b36-b57d-4898-97fc-deb2301a8e8b
ishandutta2007/codeforces
aaaaajack/normal/409/A.cpp
#include<cstdio> #include<string> #include<iostream> using namespace std; int main(){ string s1,s2; cin>>s1; cin>>s2; int i,x,y,a=0,b=0; for(i=0;i<s1.size();i+=2){ if(s1[i]=='(') x=0; else if(s1[i]=='[') x=1; else x=2; if(s2[i]=='(') y=0; else if(s2[i]=='[') y=1; else y=2; if((x+1)%3==y) b++; else ...
ALGO
0.999961
3.703408
f3b062b8-4979-4ca9-b42f-55254778134f
AlgoAbrar/Data-Structures-Journey
Linked List/Doubly Linked List/insert_at_any_pos (1).cpp
#include<bits/stdc++.h> using namespace std; class Node { public: int val; Node* next; Node* prev; Node(int val) { this->val = val; this->next = NULL; this->prev = NULL; } }; void print_forward(Node* head) { Node* tmp = head; while(tmp != NULL) ...
ALGO
0.999963
5.956268
1e498e6c-8dce-4879-9e96-e8f3ecf73aa1
Ramansingh9948/DSA
13.Sorting/BubbleSort.cpp
#include<iostream> #include<vector> using namespace std; int bubbleSort(vector<int>& arr) { int n = arr.size(); int count = 0; for(int i = 0;i < n-1; i++) { for(int j = 0; j<n-i-1; j++){ if(arr[j]>arr[j+1]) { swap(arr[j], arr[j+1]); count++; ...
ALGO
0.999654
4.118407
c173322f-cf9b-4436-9e58-d75dfc13b0ab
P4L4K/SummerTraining2024
concepts/manualLinkedList/reverse.cpp
#include<iostream> #include "D:\Summar Training 2024\concepts\manualLinkedList\node.cpp" using namespace std; int deleteDup(Node * temp) { if(temp->next==NULL) { return temp->value; } else { cout<<deleteDup(temp->next)<<" "; } return temp->value; } void reversePrint(Node * head) { if(head==nullptr) { ...
ALGO
0.999592
4.556499
a14c33af-9799-4747-94a5-4283ac4c54b6
marinvhs/coding
spoj/classical/ELDORADO.cpp
#include <algorithm> #include <cstdio> typedef long long LL; const int K = 128, MAXVAL = 20048, N = 128; long long f[K][N], LIM = 0; int map[MAXVAL], seq[N], v[N]; LL read(LL *b, int x){ LL sum = 0; for(; x; x -= (x & -x)) sum += b[x]; return sum; } void update(LL *b, int x, LL v){ for(; x < N; x += (x & -x)) b[x] ...
ALGO
0.999577
3.427437
26835066-d4e2-4ecf-9872-7dbcbb0e59bd
ishandutta2007/codeforces
latte0119/normal/455/B.cpp
#include<bits/stdc++.h> using namespace std; #define int long long typedef vector<int>vint; typedef pair<int,int>pint; typedef vector<pint>vpint; #define rep(i,n) for(int i=0;i<(n);i++) #define reps(i,f,n) for(int i=(f);i<(n);i++) #define all(v) (v).begin(),(v).end() #define each(it,v) for(__typeof((v).begin()) it=(v)...
ALGO
0.999994
4.599912
796bbc21-08cd-4ae5-ae21-49892a085cbf
dirkenstein/MicroDexed
dx7note.cpp
#include <math.h> #include <stdlib.h> #include "synth.h" #include "freqlut.h" #include "exp2.h" #include "controllers.h" #include "dx7note.h" const int FEEDBACK_BITDEPTH = 8; int32_t midinote_to_logfreq(int midinote) { //const int32_t base = 50857777; // (1 << 24) * (log(440) / log(2) - 69/12) const int32_t base...
TOOL
0.949231
4.971601
d6ab32ef-2348-452f-9729-c1a7dfc7660e
0x1Shub/Data-Structures-And-Algorithms
Striver DSA Sheet/3-Arrays/3.1-Easy/8_Linear_Search.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int linearSerch(vector<int> &arr, int target) { int n = arr.size(); for (int i = 0; i < n; i++) { if (arr[i] == target) { return i; } } return -1; ...
ALGO
0.99961
5.81518
a688b012-eaaf-4f91-81ce-f2ecc86c34ea
shibayanchatterjee/Algorithms
sorting_and_searching/main.cpp
#include <iostream> #include <cstdlib> using namespace std; void merge(int arr[], int l, int m, int r); void printArray(int arr[], int size){ cout<<"Array: "; for (int i = 0; i < size; ++i){ cout<<arr[i]<<" "; } cout<<endl; } void mergeSort(int arr[], int l, int r){ int mid = 0; if (l <...
ALGO
0.999929
5.090581
1ecff25d-1a4c-4d15-bcda-6720e8c09669
lorenzo-ferrari/olinfo
src/zigzag.cpp
#include <bits/stdc++.h> using namespace std; int main() { ifstream cin("input.txt"); ofstream cout("output.txt"); int n; cin >> n; vector<int> a(n), s(n), g(n); for (int& i : a) cin >> i; stack<pair<int,int>> st1; st1.push({ 2e9, n}); stack<pair<int,int>> st2; st2.push({-2e9, n}); for...
ALGO
0.999826
4.319501
fe556189-e045-4e30-a555-b60aac368d7a
tsksnhr/programming_contest
atcoder/abc205c.cpp
// POW #include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ll A, B, C; cin >> A >> B >> C; bool is_even = (C%2 == 0); if (A == B || C == 0){ cout << "=" << endl; return 0; } else if(A >= 0 && B >= 0){ if (A > B) cout << ">" << endl; ...
ALGO
0.999987
4.647754
ccb49cc4-70d2-40c5-8668-c69e9017f626
sungeunchoi-kr/smoothsearch
playground/main.cpp
#include <iostream> #include <sstream> #include <NTL/ZZ_pX.h> #include <NTL/ZZ_pXFactoring.h> #include <sys/time.h> typedef unsigned long long ts_t; static ts_t get_timestamp() { struct timeval now; gettimeofday (&now, NULL); return now.tv_usec + (ts_t)now.tv_sec * 1000000; } /* usage */ //ts_t t0 = get...
ALGO
0.999255
4.96198
e7b3b5bd-e496-48e2-8987-42838d941d26
ssolaric/leetcode-patterns
Heap/Medium/lc347-top-k-frequent-elements.cpp
class Solution { public: vector<int> topKFrequent(vector<int>& nums, int k) { map<int, int> counter; for (auto x : nums) { counter[x]++; } auto cmp = [&counter](int x, int y) { return counter[x] > counter[y]; // min-heap }; priority_queue<int, ...
ALGO
0.999994
6.29973
f6dbe0ab-a7ac-4924-9028-e15e5bb88d7c
abdelrahman-ops/ProblemSolving
Assuit-Sheet/First-Sheet/PX.cpp
#include <iostream> #include <algorithm> using namespace std; int main() { long long L1 , R1 , L2 ,R2 ; cin >> L1 >> R1 >> L2 >> R2 ; if(R1 < L2 || R2 < L1) { cout << "-1" ; } else { int left = max(L1, L2); int right = min(R1, R2); cout << left << " " << ri...
ALGO
0.999786
3.567343
f449a982-ad1f-4c22-9390-5f08b6b8484c
0xessam/MY-Codeforces-problems-solutions
codeforces/1023/C.cpp
#include <bits/stdc++.h> using namespace std ; #define lp(i,n) for(int i = 0; i < (n); ++i) template<typename T>istream& operator>>(istream&i,vector<T>&v){lp(j,v.size())i>>v[j];return i;} #define tenll(x) ((ll)1e##x) #define ll long long #define el '\n' #define int ll #define ull unsigned long long #define cm return vo...
ALGO
0.999888
4.082574
1ce44e87-dc51-4e66-88a8-351e66c6a03a
CodeToLearnScience/2D_NS_Solver
src/flux_boundary.cpp
#include "../inc/global_declarations.h" #include "../inc/basic_functions.h" void Flux_Boundary(int bind, int bnode, int sbind, int ebind, double ***&cv, double ***&dv, double ***&si, double ***&sj, double ***&rhs) { //computes convective fluxes at for boundaries double sx, sy, rhol, ul, vl, rh...
ALGO
0.997872
4.465134
badd35ff-8233-4d0c-8dcb-0fbff7987611
Wahib294/Projects
Red Black Tree/Source.cpp
#include "myRedBlackTree.h" #include<iostream> using namespace std; int main() { myRedBlackTree<int> * obj = new myRedBlackTree<int>(); obj->insert(10); obj->insert(18); obj->insert(7); obj->insert(15); obj->insert(16); obj->insert(30); obj->insert(35); obj->insert(20); obj->insert(19); cout << endl << obj-...
ALGO
0.953181
3.094981
452f6935-513d-4f48-9bb4-1a1d0115800f
jmlopezfabian/Competitive-Programming
CodeForces/Contest/Div2-157/1895A-TreasurChest.cpp
#include <bits/stdc++.h> using namespace std; void solution(){ int x,y,k; cin>>x>>y>>k; if(x > y){ cout<<x<<endl; }else if((x < y) && (x + k < y)){ int a = x + k; cout<<a + 2*(y - a)<<endl; }else{ cout<<y<<endl; } } int main(){ int t; cin>>t; while(t--){ ...
ALGO
0.999795
3.604803
12748cae-2c76-4fa1-bd13-eb0227fef30b
yoon-yk/LeetcodeSubmission
0539-minimum-time-difference/0539-minimum-time-difference.cpp
class Solution { public: int getDiff(string& time1, string& time2) { int t1 = ((time1[0]-'0')*10 + (time1[1]-'0'))*60 + (time1[3]-'0')*10 + (time1[4]-'0'); int t2 = ((time2[0]-'0')*10 + (time2[1]-'0'))*60 + (time2[3]-'0')*10 + (time2[4]-'0'); return min(abs(t1-t2), 24*60-abs((t1-t2)));...
ALGO
0.999946
6.031563
7e532667-6436-424c-8648-15ccd0eaeae1
May-Terrence/SF09
eigen3/doc/examples/DenseBase_middleCols_int.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; int main(void) { int const N = 5; MatrixXi A(N,N); A.setRandom(); cout << "A =\n" << A << '\n' << endl; cout << "A(1..3,:) =\n" << A.middleCols(1,3) << endl; return 0; }
ALGO
0.970688
3.133398
327b90d8-764d-47be-bccf-7ed0a0109a06
MyckollWinchester/cp-problems
codeforces/sakurakos-exam.cpp
#include <bits/stdc++.h> using namespace std; #define ignore_line() { string ignore; getline(cin, ignore); } #define debug_vec(vec) cout << #vec << ": { "; for (auto v : vec) cout << v << " "; cout << "} size: " << vec.size() << "\n"; #define sort_f(vec) sort(vec.begin(), vec.end()); #define sort_b(vec) sort(vec.rbeg...
ALGO
0.999669
4.607743
22ab75f0-99cf-40e2-b9e2-5f53e3c615aa
nureesong/samsung_swtest
c_lang/2022상반기_예술성.cpp
/************************************************************/ // [2022상반기_오전2번] 예술성 (난이도 중) // FloodFill(BFS) - 4ms, 2MB (2시간 소요) // FF를 두 번 돌리면서 그룹 정보, 그룹간 맞닿은 변의 개수 계산 // 한 그룹당 인접할 수 있는 그룹은 최대 4개 // adj[900][900]은 매우 sparse -> map으로 하면 메모리 절감 // ** 솔루션 ** FF 한 번만 돌리기 // n번 그룹 FloodFill 돌릴 때 이전에 확정된 1 ~ n-1번 그룹들과의 ...
ALGO
0.999784
4.816607
a6fc9cc4-3cb2-43b0-9a51-bfb997e6c0f7
Harsh-D-2004/LB
Practice/program52.cpp
#include<iostream> using namespace std; class Display { private: int iNo; public: Display(int X) { iNo = X; } void Disp() { if(iNo < 0) { printf("Enter the positive number \n"); } for(...
TOOL
0.997973
3.660903
4e460cfa-c749-4ce7-bdf0-58c82c268b31
ldorelli/verao_icmc_maratona
Shiran1/Códigos/d_diego.cpp
#include <cstdio> int expo(int a, int b, int d) { if (b == 1) return a%d; if (b%2) return (a%d*(expo(a, b-1, d))%d)%d; else { int aux = expo(a,b/2,d) % d; return (aux*aux)%d; } } int main() { int a,b,c,d; while(scanf("%d %d %d ", &a, &b, &d)!=EOF) { c = expo(a,b,d)%d; printf("%d\n", c); } ...
ALGO
0.999943
3.932258
52fd9ade-1069-4220-bae1-518eb97ea2b6
xiaojiang-li/xd_leecode
src/01.array_string/020.cpp
/* * @Descripttion: 找到所有单词的共同前缀 * @version: 1.0 * @Author: Li Xiaodong * @Date: 2023-05-20 18:31:53 * @LastEditTime: 2023-05-20 23:15:54 */ #include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; class Solution { public: string longestCommonPrefix(vector<string>& str...
ALGO
0.999741
4.973969
37948c23-1fd4-415a-83b2-92522dc44f4f
quicklers/opencv
modules/dnn/src/nms.cpp
#include "precomp.hpp" #include "nms.inl.hpp" #include <opencv2/imgproc.hpp> namespace cv { namespace dnn { CV__DNN_INLINE_NS_BEGIN template <typename T> static inline float rectOverlap(const T& a, const T& b) { return 1.f - static_cast<float>(jaccardDistance(a, b)); } void NMSBoxes(const std::vector<Rect>& bbo...
ALGO
0.998705
7.541097
d5bf1f32-6150-462d-8f88-57a65a1e804c
oceanbase/oceanbase
src/sql/rewrite/ob_transform_expr_pullup.cpp
#define USING_LOG_PREFIX SQL_REWRITE #include "ob_transform_expr_pullup.h" #include "sql/optimizer/ob_optimizer_util.h" #include "sql/rewrite/ob_transform_utils.h" namespace oceanbase { namespace sql { using namespace common; /** * @brief Pullup select exprs from the inline view to current stmt */ int ObTransformEx...
ALGO
0.857664
7.301063
364f6c3f-10a9-4929-b8b5-4495c3b57f9e
alexandraback/datacollection
solutions_5708284669460480_0/C++/kaszubki/b.cpp
//Karol Kaszuba #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef vector<int> VI; typedef pair<int, int> PII; typedef double D; typedef long double LD; typedef vector<PII> VII; typedef unordered_set<int> USI; typedef unordered_set<LL> USLL; #define FOR(i,x,y) for(auto i=(x);i<=(y);++i) #de...
ALGO
0.999657
3.654156
6f6e45f0-4407-4c24-b3d4-7458f0efd448
raincross7/code-similarity
codes/train_code/problem335/problem335_155.cpp
#include <bits/stdc++.h> using namespace std; /** BBBB 12 34 BWWB 14 23 **/ const int mod = 1'000'000'007; int mul(long long a, long long b){ return a * b % mod; } int main(){ int n; cin >> n; string s; cin >> s; int open = 1; int res = 1; if(s[0] != 'B'){ cout << 0 << endl; return 0; } for(in...
ALGO
0.999969
4.22883
f4090570-68c9-443d-8463-952a88f698c3
anupam-pandey01/DSA
443-string-compression/string-compression.cpp
class Solution { public: int compress(vector<char>& chars) { int index = 0, count = 1; char prev = chars[0]; for (int i = 1; i < chars.size(); i++) { if (chars[i] == prev) { count++; } else { chars[index++] = prev; if (...
ALGO
0.999974
6.603206
05044b3f-511d-41e6-b0d9-f43d2f890a65
Hafiz-Sakib/CPP-for-CP
CSES Problem Solving/All/solutions/1686 - Coin Collector.cpp
/* Problem Name: Coin Collector Problem Link: https://cses.fi/problemset/task/1686 Author: Sachin Srivastava (mrsac7) */ #include<bits/stdc++.h> using namespace std; template<typename... T> void see(T&... args) { ((cin >> args), ...);} template<typename... T> void put(T&&... args) { ((cout << args << " "), ...);} templ...
ALGO
0.999832
4.580032
5c713e34-4b7d-44ab-95c1-d248fa8b555d
JasurbekErgashev/CS201
sorting/lab8/divide_and_conquer/lab9/task2.cpp
class Solution { public: vector<int> sortArrayByParityII(vector<int>& nums) { vector<int> even, odd; for(int i = 0; i < nums.size(); i++){ if(nums[i] % 2 == 0) even.push_back(nums[i]); else odd.push_back(nums[i]); } vector<int> ...
ALGO
0.999992
5.653683
e574eaff-911a-4806-bd05-2af6b27109e4
SarthakArora13/C-
sumofdigits.cpp
#include<iostream> using namespace std; int main(){ int a,n,sum=0; cout<<"Enter the Number"; cin>>n; while(n>0) { a=n%10; sum=sum+a; n=n/10; } cout<<"Sum is:"; cout<<sum; return 0; }
ALGO
0.999401
3.54234
5f3dba14-958f-4953-b92e-555d6879f652
Khushboo-Baheti/coding-problems
upperbound.cpp
#include<stdio.h> using namespace std; int lb(int arr[],int n,int x) { int l = 0; int h = n-1; int mid; while(l < h) { mid = (l+h)/2; if(arr[mid] < x) l = mid; else if( arr[mid] >= x) h = mid-1; } return l; } int ub(int arr[],int n,int x) { int l = 0; int h = n-1; int mid; while(l < h) { mid ...
ALGO
0.999925
3.990471
efffea97-bf98-4b72-a009-5e13b7f133ae
TanYF123/flutter_animtion
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
9ea162a1-53d4-4d39-98d2-50ce28a7c442
hjiang13/LLMs-in-IR
processed_data/DecompiledResuts_Human_x_164_O1/GPT4o_Human_x_164_O1_decompiled/CPP_67.cpp
```cpp #include <string> #include <cstdlib> int fruit_distribution(std::string input, int size) { long long_value1 = 0; long long_value2 = 0; std::string str1, str2; int result = size; if (input.size() == 0) { return result; } char* endptr1; long_value1 = strtol(input.c_str(),...
ALGO
0.999317
5.212778
cf7e8bef-3ec1-433c-9294-05c6a98948ba
ishandutta2007/codeforces
alpha_q/normal/788/B.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1000010; bitset <N> vis, looped; vector <int> g[N]; int n, m, tot, loop, size; void dfs (int u) { vis[u] = 1, ++size; for (int v : g[u]) { if (!vis[v]) dfs(v); } } int main (int argc, char const *argv[]) { scanf("%d %d", &n, &m); for (int i...
ALGO
0.999909
4.449254
a217a193-2a21-48c5-b609-f111fc852586
aboeuf/AdventOfCode
2021/puzzle_2021_19.cpp
#include <2021/puzzle_2021_19.h> #include <QDebug> #include <common.h> #include <deque> #include <optional> #include <set> using Int = unsigned long long int; struct Vec3 { Vec3() = default; Vec3(int x, int y, int z) : m_x{x}, m_y{y}, m_z{z} {} Vec3(const Vec3 &v) : m_x{v.m_x}, m_y{v.m_y}, m_z{v.m_z} {} int ...
ALGO
0.959514
5.593733
c169b88d-8385-42d0-99d9-e6bb1a5a4e6c
chai-04/Codeforces
A_Boring_Apartments.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ int n; cin>>n; int p=0; while(n>10){ n/=10; p++; } int q=p+1; int ans=(n-1)*10+((q*(q+1))/2); cout<<ans<<endl; } return 0; }
ALGO
0.999744
4.499194
51e618c0-09b1-4d6c-9904-2cb470b6dbdb
COdereator/C-plus
7)Strings/Q19 Program to find All occurrence of word.cpp
//Q19 Program to find All occurrence of word from string #include<iostream> #include<string.h> using namespace std; int main() { char str[255] , word[20]; int i , j , k=0 , lenstr , lenword , count; cout<<"\nEnter your String :"; cin.get(str , 255 , '\n'); lenstr=strlen(str); cout<<"\nLength of String : ...
ALGO
0.998955
4.011919
8f5633b1-a9c6-4bce-9c01-595d4e53d0cc
ishandutta2007/codeforces
ssrs_/normal/1538/E.cpp
#include <bits/stdc++.h> using namespace std; struct var{ long long haha; string s1, s2; var(){ } var(string s){ int N = s.size(); haha = 0; for (int i = 0; i <= N - 4; i++){ if (s.substr(i, 4) == "haha"){ haha++; } } if (s.size() < 3){ s1 = s; s2 = s; }...
ALGO
0.997877
4.160761
162b9c4f-365f-4bfc-93ed-666b7435623c
raincross7/code-similarity
codes/train_code/problem357/problem357_419.cpp
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < int(n); i++) #define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--) #define reps(i, n) for (int i = 1; i <= int(n); i++) #define rreps(i, n) for (int i = int(n); i >= 1; i--) #define repc(i, n) for (int i = 0; i <= int(n); i++) #define rrepc(i, n) for (i...
ALGO
0.999888
3.7436
e2380873-cc64-4976-a398-ab16fc202294
ThettOo/greenhouse_forecast
fastapiserver/Lib/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/libs/compute/perf/perf_stl_unique_copy.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <vector> #include "perf.hpp" int rand_int() { return static_cast<int>((rand() / double(RAND_MAX)) * 25.0); } int main(int argc, char *argv[]) { perf_parse_args(argc, argv); std::cout << "size: " << PERF_N << std::endl; // create ve...
ALGO
0.981462
5.622078
a97813bd-a610-46e0-960e-4b16353d3517
avplayer/proxy
third_party/boost/libs/parameter/test/literate/default-expression-evaluation0.cpp
#include <boost/parameter.hpp> #include <iostream> BOOST_PARAMETER_NAME(graph) BOOST_PARAMETER_NAME(visitor) BOOST_PARAMETER_NAME(root_vertex) BOOST_PARAMETER_NAME(index_map) BOOST_PARAMETER_NAME(color_map) #include <boost/graph/depth_first_search.hpp> // for dfs_visitor BOOST_PARAMETER_FUNCTION((bool), depth_first...
ALGO
0.97597
3.99652
4671e30f-54c5-4db0-a4ec-eefd89968dcb
cimeguy/ExperimentsCodes_ProfessionalCourses
数据结构实验/实验四/main.cpp
#include "Sqstack.h" //˳ջ #include "SqQueue.h" //˳ #include"Huffman.h" // #include "bintree.h" // #include <iostream> #include <string> #include <fstream> #include <vector> using namespace std; int main() { //*----------------------------*// cout << "Զ:" << endl; int n = 0; TElemType ch[] = "ABC##D#E...
ALGO
0.998845
3.426186
27815f65-3040-4325-a58b-05f997ddfa5e
somliy/Code
各种模板/次短路模板+邻接表建图+堆优化.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<queue> #include<vector> using namespace std; const int MAXN = 55; const int inf = 1<<30; struct Edge { int v, w; }; vector<Edge> vet[MAXN]; struct Node{ int v, dist; int mark;//ǣ1Ϊ·2Ϊζ· bool operator < (const Node &p) const { i...
ALGO
0.999875
3.706052
1f531593-6b46-4d10-a394-ef4e3fc70255
iShagor/Phitron
Semester 1/Introduction to C Programming/week 2/module 6/R.cpp
#include <bits/stdc++.h> using namespace std; int main() { int a, b; while(scanf("%d %d", &a, &b) != EOF) { if(a <= 0 || b <= 0) { break; } if(a > b) { int temp = b; b = a; a = temp; } int sum = 0; ...
ALGO
0.99965
4.110468
34cb9832-9f41-4e34-a150-14c3cd56c3a4
ryanl/rlcrackzip
src/zip_read.cpp
#include <iostream> #include <stdio.h> #include <errno.h> #include <string.h> #include <stdint.h> #include "file_access.h" #include "assert.h" #include "zip_read.h" #define verbosity 0 /* * decode_zip_file_header * * @f file * @file_info any info needed for decrypting (out) */ bool decode_zip_file_hea...
TOOL
0.893514
4.026706
b41d2b66-ceb4-49e7-bad7-c9921ff615c8
Mr-Bangladesh/Problem-Solving
UVa/10168 Summation of Four Primes.cpp
/**In the name of Allah, the Most Merciful, the Most Merciful.**/ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define INF 9223372036854775806 #define pb push_back #define mp make_pair #define MOD 1000000007 #define PI 2*acos(0.0) #define EPS 1e-9 #include <ext/pb_...
ALGO
0.999636
3.475818
ab72e07a-4217-4281-b65d-2218d948f788
xtremebrat/Cryptography
hw7-primes/mrabin.cpp
# include <netinet/in.h> # include <cstdlib> # include <iostream> # include <iomanip> # include <fstream> # include <sstream> # include <string> # include <math.h> using namespace std; // hw7 millerrabin -n=number -t=maxitr -p=primesfile extern unsigned long int getLongValue(unsigned long int tp); // obtain the modu...
ALGO
0.996894
3.019555
68a5ddab-fdbf-42d3-b623-dbd139352a6c
hirakuuuu/kyopro
ABC/364/c.cpp
#include <bits/stdc++.h> // #include <atcoder/all> using namespace std; // using namespace atcoder; #define rep(i, a, n) for(int i = a; i < n; i++) #define rrep(i, a, n) for(int i = a; i >= n; i--) #define inr(l, x, r) (l <= x && x < r) #define ll long long #define ld long double // using mint = modint1000000007; // u...
ALGO
0.999978
3.621414
d931a7b6-911e-43ee-b052-0b86a409f0f9
RoyalBosS-Ayush/DSA-450-CHEAT-SHEET
027.cpp
// https://practice.geeksforgeeks.org/problems/array-subset-of-another-array2317/1 string isSubset(int a1[], int a2[], int n, int m) { unordered_map<int, int> freq1; for (int i=0; i<n; i++){ freq1[a1[i]]++; } for (int i=0; i<m; i++){ if (!freq1[a2[i]]) return "No"; ...
ALGO
0.999883
5.018836
7c57e7cb-d057-4ec2-a210-d2167e893e0e
DanceManiac/Advanced-X-Ray-Public
SDK/sources/MagicSoftware/FreeMagic/Source/Tessellation3D/MgcDelaunay3D.cpp
#include "MgcDelaunay3D.h" using namespace Mgc; Real Delaunay3D::ms_fEpsilon = 0.00001f; Real Delaunay3D::ms_fRange = 10.0f; int Delaunay3D::ms_iTSize = 75; int Delaunay3D::ms_iQuantityFactor = 16; //---------------------------------------------------------------------------- Delaunay3D::Delaunay3D (int iVertexQuanti...
ALGO
0.993769
6.386796
7217faaf-440a-4e53-b4f7-bcb8cf6826e0
ishandutta2007/codeforces
monogon/normal/1143/F.cpp
#include <bits/stdc++.h> #define FOR(i, n) for(int i = 0; i < n; i++) #define FORK(i, k, n) for(int i = k; i < n; i++) #define FORr(i, n) for(int i = n - 1; i >= 0; i--) #define FORKr(i, k, n) for(int i = n - 1; i >= k; i--) #define PRINT(a, b) copy((a), (b), ostream_iterator<int>(cout, " ")) #define all(a) a.begin()...
ALGO
0.999944
4.190749
d5d4e515-a57d-4e5a-9128-7816e34d8d1c
Modding-Zaibatsu/ue5-polaris
Engine/Source/ThirdParty/Intel/TBB/IntelTBB-2019u8/examples/parallel_reduce/primes/primes.cpp
// Example program that computes number of prime numbers up to n, // where n is a command line argument. The algorithm here is a // fairly efficient version of the sieve of Eratosthenes. // The parallel version demonstrates how to use parallel_reduce, // and in particular how to exploit lazy splitting. #include "p...
ALGO
0.999884
5.999383
bec840fa-e403-49a1-8d34-458588aa4328
SURYAPRAKASHKALYANAM/LEETCODE-GFG-SOLVED-SOLUTIONS
LeetCode/Easy/2200-find-all-k-distant-indices-in-an-array/2200-find-all-k-distant-indices-in-an-array-06-24-2025-21-44-19.cpp
class Solution { public: vector<int> findKDistantIndices(vector<int>& nums, int key, int k) { int len = nums.size(); vector<int> keyspos(len, 0); for (int i = 0; i < len; i++) { if (nums[i] == key) { keyspos[max(0, i - k)] += 1; if ((i + k + 1) <= ...
ALGO
0.999995
5.79242
fcd90a63-f46d-456f-bb6c-6d7cb4fefa18
karapuzio/Lab_Murashko
rough copy/15_1/15_1/Transport.cpp
#include "Transport.h" void Transport :: addRoute(int number, int kind, list<string> :: const_iterator itBegin, list<string> :: const_iterator itEnd) { list <string> curList; for (auto it = itBegin; it != itEnd; ++it) { curList.push_back(*it); } for (auto it = curList.begin(); it != curList.end(); ++it) { st...
ALGO
0.99035
4.081481
f9b5e401-73a3-4640-9caf-d32f8db77c91
Sanjeevvarmabetter/DATASTRUCTURES_AND_ALGORITHMS
linkedlist/singlelinkedlist.cpp
// //the basic representation of linked list in c++ // //we are using struct // struct linkedlist { // int data; // linkedlist * nxt; // }; //the below code is for traversing #include<bits/stdc++.h> using namespace std; //this is the representation of the linked list struct node { int data; node * ...
ALGO
0.990926
3.528571
070d4eac-296b-44e5-94ff-82efaefa1536
Taha-Adeel/CP
STARTERS 114 DIVISION 1/Chef_and_Tag.cpp
#include <bits/stdc++.h> using namespace std; #define FAST ios::sync_with_stdio(0); cin.tie(0) template<class T> struct V: vector<T>{using vector<T>::vector; void sort() { std::sort(this->begin(), this->end()); } void sort_dsc() { std::sort(this->begin(), this->end(), greater<T>()); } auto sum()...
ALGO
0.999897
5.276936
9080022f-853e-4d16-bfe7-5b3e0e980c8e
menstoo121/leet_code_PS
0020-valid-parentheses/0020-valid-parentheses.cpp
class Solution { public: bool isValid(string s) { stack<char> st; for(int i = 0; i < s.size(); i++){ if(s[i] == ')'){ if(st.empty() || st.top() != '(') return false; else{ st.pop(); conti...
ALGO
0.997393
6.381404
7bacee94-8747-41a1-aa39-8f2d4eef6c21
yshrdbrn/Risk
Model/Player/BenevolentComputerStrategy.cpp
// // Created by Yashar Dabiran on 2018-11-14. // #include <vector> #include <algorithm> #include "Player.h" #include "../Map/country.h" #include "../../Controller/State.h" #include "BenevolentComputerStrategy.h" void BenevolentComputerStrategy::performAttack(Player *player, State *state) { state->setPhaseState("...
ALGO
0.999229
4.240505
25fa7a00-9507-4112-b3bf-377550edc085
dg8fv2010/LeetCode
109.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), le...
ALGO
0.999998
6.216056
f30cc380-dd87-4a2c-8a21-480bf297f7e0
jkhansell/mhdequilibrium
SCR_1/PIC/PICcodes/ch6/World.cpp
/*defines the simulation domain*/ #include <random> #include <math.h> #include <string> #include <fstream> #include <iostream> #include <sstream> #include "World.h" #include "Field.h" #include "Species.h" #include "FESolver.h" //make an instance of the Rnd class Rnd rnd; using namespace std; /*constructor*/ World::...
ALGO
0.997723
3.549783
de9cf1af-f42a-43d6-99dd-b83a15eb5ab5
sanskardagade/Cpp-with-DSA
L9 FUNCTIONS/swapwithouttemp.cpp
#include<iostream> using namespace std; int main(){ int a,b; cin>>a>>b; a = a + b; b = a - b; a = a - b; cout<<a<<" "<<b; }
ALGO
0.999949
3.307719
248d5dd6-0228-42a9-a1d8-f946aaf1a185
ThomasKidane/Competitive_Programming
Codeforce_Problems/2034D.cpp
#include<bits/stdc++.h> using ll = long long; using ld = long double; using namespace std; #define endl "\n"; #define ff first #define ss second #define forn(i,n) for(int i=0;i<n;i++) #define dbgv(v) cout<<#v<<" "<<v<<endl #define dbga(a,n) forn(i,n-1) {cout<<a[i]<<' ';} cout<<a[n-1]<<'\n'; void solve(){ int n; ...
ALGO
0.999879
3.737674
e44e1de4-32ae-4a77-9f7f-5a5095b6ac71
PoisWu/coding
lc/2385. Amount of Time for Binary Tree to Be Infected/solution.cpp
#include <algorithm> #include <array> #include <bitset> #include <iostream> #include <map> #include <queue> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr...
ALGO
0.999994
5.537659
f76ba57b-b4b0-41f8-8c7f-b248c709acb3
rajneesh-rana/learning
rod.cpp
#include<stdio.h> #include<limits.h> // A utility function to get the maximum of two integers int max(int a, int b) { return (a > b)? a : b;} /* Returns the best obtainable price for a rod of length n and price[] as prices of different pieces */ int cutRod(int price[], int n) { if (n <= 0) return 0; i...
ALGO
0.999514
3.895491
c8efa42e-2337-4cfc-913c-ed278b6b51de
Shuiliusheng/MBAPIS
checkpoint_riscv/createCkpt_gem5/src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_signed/promote_extension/datawidth.cpp
/***************************************************************************** datawidth.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /**************************************************************************...
ALGO
0.945987
5.67011
2cd24f39-ef2b-4e23-a76d-3986a8cddaca
Nijz/Leetcode-questions
0053-maximum-subarray/0053-maximum-subarray.cpp
class Solution { public: int maxSubArray(vector<int>& nums) { if(nums.size() == 1){ return nums[0]; } int sum = 0; int max_sum = INT_MIN; for(int i = 0; i < nums.size(); i++){ sum = sum + nums[i]; max_sum = max(max_sum, sum); ...
ALGO
0.999966
6.499616
b5d9a5f3-e371-498f-98bd-c248b842c80d
Erick-Andrade/Marathon_exercises
neps/000148_par_ou_impar.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' #define f first #define s second #define pb push_back #define _ ios_base::sync_with_stdio(0); cin.tie(0); const int MAX = 110; const int IINF = INT_MAX; const int INF = 0x3f3f3f3f; const ll lINF = 0x3f3f3f3f3f3f3f3fll; int main(...
ALGO
0.999811
4.211422
ae277d0d-da09-45cc-bd48-611b569065f3
lammps/lammps
src/DPD-REACT/compute_dpd.cpp
/* ---------------------------------------------------------------------- Contributing author: James Larentzos (U.S. Army Research Laboratory) ------------------------------------------------------------------------- */ #include "compute_dpd.h" #include "atom.h" #include "error.h" #include "update.h" using namesp...
ALGO
0.99777
6.279729
e7d74f24-21e2-4fd9-977a-70c2322b4c55
ansh1194/data_structure-algo
EPI/Primitive_Types/reverse_digit.cpp
/* Reverse Digits */ #include "../Lib/common.h" int reverseDigits(int& num) { int result; bool negFlag = (num < 0) ? true:false; if (negFlag) { num = -num; } while (num) { result = result * 10 + num%10; num /= 10; } return negFlag ? -result:result; }...
ALGO
0.999591
5.564965
d08e12e1-8f72-47a4-8b96-d64cfa980123
hikjik/leetcode
solutions/stone-game-iii/test.cpp
#include <catch.hpp> #include <solution.hpp> TEST_CASE("Simple") { struct TestCase { std::vector<int> stoneValue; std::string expected; }; std::vector<TestCase> test_cases{ { .stoneValue{1, 2, 3, 7}, .expected = "Bob", }, { .stoneValue{1, 2, 3, -9}, ...
TEST
0.963946
6.163573
6eef84ab-1389-48ad-bad1-84855d80833f
Talustus/node-forknote-util
src/cryptonote_core/tx_pool.cpp
#include <algorithm> #include <boost/filesystem.hpp> #include <unordered_set> #include <vector> #include "tx_pool.h" #include "cryptonote_format_utils.h" #include "cryptonote_boost_serialization.h" #include "cryptonote_config.h" #include "blockchain_storage.h" #include "common/boost_serialization_helper.h" #include "c...
TOOL
0.945945
6.543945
5eaf38ec-b1d4-4c73-a97b-fa728274aaf5
arturobp3/DataStructures_And_Algorithms
12 Uvas Concurso/18-19/turismo/turismo/turismo.cpp
#include <iostream> #include <vector> #include <cmath> using namespace std; bool casoDePrueba() { int iluminadas; cin >> iluminadas; if (!cin) return false; else { int visitar, leido, satis1 = 0, satis2 = 0, asombro = 0, resta, cmp; vector<int> espect; cin >> visitar; for (int i = 0; i < iluminadas...
ALGO
0.999887
3.705493
af60b54c-4301-424e-a42f-ac2fb9559c06
SimonNitzsche/OpCrux-Server
libs/reactphysics3d/src/collision/shapes/TriangleShape.cpp
// Libraries #include <reactphysics3d/collision/shapes/TriangleShape.h> #include <reactphysics3d/collision/Collider.h> #include <reactphysics3d/mathematics/mathematics_functions.h> #include <reactphysics3d/collision/RaycastInfo.h> #include <reactphysics3d/utils/Profiler.h> #include <reactphysics3d/configuration.h> #inc...
ALGO
0.991003
7.33632
fb4ffc97-a4ce-4261-847d-b138b262381a
Matskva/avana
src/hash.cpp
#include "hash.h" inline uint32_t ROTL32 ( uint32_t x, int8_t r ) { return (x << r) | (x >> (32 - r)); } unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char>& vDataToHash) { // The following is MurmurHash3 (x86_32), see http://code.google.com/p/smhasher/source/browse/trunk/MurmurH...
ALGO
0.987379
6.215198
0d711d46-21dd-4e4c-a8d8-ad0ab35b2111
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/ChefAndAnts_20210112143043.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #define vv vector #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define printM...
ALGO
0.999951
3.673596
1425b6ab-1474-4280-b016-b0c437d9db9c
IIHasanII/bitcoin_ticker
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
82e31349-eb5a-44b3-8a16-b54373d3fb27
MinhNK251/PRF192
CQ16.5.cpp
#include <stdio.h> #include <stdlib.h> int search (int x, int *a, int n) { int i, result=0; for (i=0; i<n; i++) if (a[i]==x) result++; return result;} int removeOne (int pos, int*a, int*pn) { if (pos<0||pos>=*pn) return 0; for(int i=pos; i<*pn-1; i++) a[i]=a[i+1]; (*pn)--; return 1;} int ...
ALGO
0.999029
3.350284
323c2d1d-6304-459b-af5e-ceb320486e14
interactivevislab/FusionCrowd
FusionCrowd/OperationComponent/bicycleComponent.cpp
#include "BicycleComponent.h" #include "Math/consts.h" #include "Math/geomQuery.h" #include "Math/Util.h" #include "Navigation/AgentSpatialInfo.h" #include "Navigation/Obstacle.h" #include <algorithm> #include <list> #include <iostream> #include <cmath> using namespace DirectX::SimpleMath; namespace FusionCrowd { ...
ALGO
0.997719
5.992746
0da6ea54-e70a-4b56-a38c-a385ae42ff45
Benjixx99/BXGameEngine
Sourcefiles/AAD/Algorithm.cpp
#include "../../Headerfiles/AAD/Algorithm.hpp" #include <queue> #include <stack> bx::NodePointer bx::Algorithm::AStar(const Vector2& start, const Vector2& target, GridField& field) { std::vector<Vector2> closed; PriorityQueue open; open.push(std::make_shared<Node>(start, target, MoveAction::NoAction)); while (!o...
ALGO
0.999913
5.00441
cefacd66-4fc2-48ce-ae99-683ebb903069
khushangsingla/Bubble-Trouble
source/bubble.cpp
#include "bubble.h" Bubble::Bubble(double cx, double cy, double r, double acceleration, double vx_, double vy_, Color color_) { // Bubble constructor color = color_; circle = Circle(cx, cy, r); circle.setColor(color); circle.setFill(true); g=acceleration; vx = vx_; vy = vy_; } void Bubb...
ALGO
0.851731
4.747455
58b422ac-8249-4f51-8f75-73462799f33f
raincross7/code-similarity
codes/train_code/problem432/problem432_324.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> P; #define rep(i,m,n) for(int i=m;i<n;i++) ll mod=1e9+7; int main(){ int x,t; cin>>x>>t; cout<<max(x-t,0)<<endl; }
ALGO
0.999841
4.117702
238da197-e4ca-4fa7-b3e9-a955c59c846b
deepak-ky/cpp-codes
cpp-codes/removing_digits.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; #define int long long #define varname(name) #name #define mod 1000000007 #define wer(x) cout<<"\n"<<varname(x)<<" here : "<<x<<"\n" #define asdf(a,n) ...
ALGO
0.999826
4.123765
058daa7a-15a7-4fd2-80e7-56ed0a62168f
goodstudyqaq/ACM
codeforces/1000-1099/1099/F.cpp
#include <bits/stdc++.h> using namespace std; template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <typename A, typename B, typename C, typename D> string to_string(tuple<A, B, C, D> p); string to_string(const s...
ALGO
0.999931
4.012434
86a7a250-072e-445c-8458-a82bbd3a93b8
Bob8percent/Programming-Abstractions-in-C-
08/Ex11.cpp
#include <iostream> #include <cctype> #include <iomanip> #include <sstream> #include <fstream> #include "Card.h" #include "TokenScanner.h" #include "Library/queue.h" #include "Library/map.h" #include "Library/set.h" void listMnemonics(const std::string& num); void generateMnemonics(std::size_t idx, const std::string& ...
TOOL
0.957378
4.493485
e4fb7ecd-5007-4196-b620-c4f08abdbd05
shohan2032/Competitive-Programming-Practice-Codes
A_United_We_Stand.cpp
#include <bits/stdc++.h> using namespace std; //Debug Function-->works for vector,map,set(dbg(stl_name)),,arrar(dbg(array_name,range)) template < typename F, typename S >ostream& operator << ( ostream& os, const pair< F, S > & p ) {return os << "(" << p.first << ", " << p.second << ")";} template < typename T >ostrea...
ALGO
0.999903
3.795677
3c229370-d483-4d10-837f-b492c51ee2d5
mohamedwahbahassan/Projet_Trophic_Networks
HASSAN-TRAN-GUICHARNAUD/K-connexite.cpp
#include "graph.h" #include <fstream> #include <iostream> void Graph::remplir_tab_adj_sym() { int i=0,j=0, n=0, g=0; /// on initialise le tableau de taille ordre*ordre 0 m_tab_adj_sym.resize(m_ordre); for(i=0; i<m_ordre; i++) { m_tab_adj_sym[i].resize(m_ordre); for(j=0; j<m_ordre; ...
ALGO
0.967704
3.247874
bc68c5da-b5b1-4bd8-a216-901854be9c47
nafiz512/Codeforces
D_Balanced_Round.cpp
#include<bits/stdc++.h> using namespace std; #define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define int long long #define ff first #define sc second #define endl '\n' #define pb push_back #define all(v) (v).begin(),(v).end() #define Pi 2.0 * acos(0.0) #define getbit(n, i) (((n) & (1LL << (i))) != 0) #de...
ALGO
0.999835
4.061143
e88d7255-017b-4ef0-8527-5e4708189a5a
alvi-khan/IUT-Notes-Archive
Semester 04/CSE 4404 (Algorithms Lab)/Contests/01. Graph Traversal/Problem E.cpp
#include <iostream> using namespace std; int G[50001]; // neighbour of each node int reach[50001]; // how many people each node can reach (including self) bool vis[50001]; // if a node has been visited or not int dfs(int src) // dfs traversal (kind of) { vis[src] = true; // mark as visited if (!v...
ALGO
0.999873
5.095521
f2300772-00f2-4602-9882-627a01e512ce
anagorko/kinf
zajecia/jkacprzak/grzyby.cpp
#include<iostream> using namespace std; int main(){ int n[5], wynik = 0; for (int i = 0; i < 5;i++){ cin >> n[i]; wynik += n[i]; } cout << wynik/3 << endl; }
ALGO
0.999678
3.659755
03285d49-56a1-4987-b124-8e195917a2ef
rakshal123/codeforcesQuestions
Implementation and Constructive/A__Boring_Apartments.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ int n; cin>>n; int c=0; int u=n%10; while(n!=0){ c++; n=n/10; } int sum = (c*(c+1))/2; cout<<((u-1)*10)+sum<<"\n"; } }
ALGO
0.999459
4.711569
824fb319-6245-49c2-a9b5-6c09e24b291d
djolertrk/llvm-metadataburn
llvm/lib/CodeGen/MachinePostDominators.cpp
#include "llvm/CodeGen/MachinePostDominators.h" #include "llvm/InitializePasses.h" using namespace llvm; namespace llvm { template class DominatorTreeBase<MachineBasicBlock, true>; // PostDomTreeBase extern bool VerifyMachineDomInfo; } // namespace llvm char MachinePostDominatorTree::ID = 0; //declare initializeMa...
ALGO
0.998047
7.620006
a236048f-430d-4224-a4a1-87f53a2f35f7
krishauser/KrisLibrary
geometry/solid3/src/convex/DT_PenDepth.cpp
#include "DT_PenDepth.h" #include "DT_TriEdge.h" #include "DT_GJK.h" #include "DT_Convex.h" #include "MT_Quaternion.h" //#define DEBUG const int MaxSupportPoints = 100; const int MaxFacets = 200; static MT_Point3 pBuf[MaxSupportPoints]; static MT_Point3 qBuf[MaxSupportPoints]; static MT_Vector3...
ALGO
0.999887
5.919027
b57abcd0-c269-4e9e-b5b6-b36462a21042
christianfds-university/tcc-nqueens-mpi-cluster
main.cpp
#include <gmpxx.h> #include <mpi.h> #include <ctime> #include <iostream> #include "NQueensTable.hpp" #include "PossibilitiesGenerator.hpp" #include "Utils.h" using namespace std; /* Requirements: libgmp3-dev libopenmpi-dev Install requirements on AWS: wget http://us-east-1.ec2.archive.ubuntu.com/ubuntu/p...
ALGO
0.999542
4.717919
bf399889-08aa-4a46-a24f-6ffab82a2320
abhijeet141/GFG-DSA-PROBLEM
ARRAY/majority.cpp
#include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution{ public: // Function to find element with more appearances between two elements in an // array. int majorityWins(int arr[], int n, int x, int y) { int c1=0,c2=0; for(int...
ALGO
0.999989
5.356916
5f8ffd2f-70f3-4fe5-8036-c0ac17321319
Zackary-Lykos/ECED3401
FFT/Commented FFT.cpp
void fft_help(complex<int> *v, int n, complex<int> *tmp) { if (n > 1) { // verifies that there are elements in the array int k, m; // counters complex<int> z, w, *vo, *ve; // declaration of complex variables for indexing ve = tmp; // even part of the signal. Var tmp is temporary space needed to define ve...
ALGO
0.999973
4.06012
3d2e7e9c-68c3-451c-8135-4476582496f0
karimali03/Competitive-programming
solutions/archive/General/D_Arrays_Sum.cpp
#include <bits/stdc++.h> using namespace std; #define ln "\n" #define ll long long #define ld long double #define ull unsigned long long #define vec vector #define vi vector<int> #define vii vector<vector<int>> #define viii vector<vector<vector<int>>> #define f(i, a, b) for(int i = a; i < b; i++) #define all(x) (x).be...
ALGO
0.999928
4.247318
9afbe57c-75df-483a-8e8c-feb41cff7c5b
bellbpng/Baekjoon_hub
프로그래머스/lv2/68936. 쿼드압축 후 개수 세기/쿼드압축 후 개수 세기.cpp
#include <string> #include <vector> #include <iostream> using namespace std; int N; string ans; void compress(vector<vector<int>>& arr, int sx, int sy, int step){ bool flag = true; int ref = arr[sx][sy]; for(int dx=0; dx<step; dx++){ for(int dy=0; dy<step; dy++){ int nextX = sx + dx; ...
ALGO
0.999954
4.29591