uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
b33a938e-c0b3-4bf1-9271-07bf017de20b
Shweta2024/Daily-DSA-Revision
0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-hidden-flex-wrap-wrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divmicrosoft-divdiv-classcompanytagscontainer-tagoccurence2-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-...
class Solution { public: void getPascalTriangleRow(int n, int targetRow, vector<int>&currentAns, vector<int>&ans) { if(n > targetRow) { for(auto i : currentAns) ans.push_back(i); return ; } vector<int>temp(n); temp[0] ...
ALGO
0.999945
6.383251
b6a24533-a0b8-4f05-8a43-024fb107e347
alpha079/LeetCode-Problems
654-maximum-binary-tree/654-maximum-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.99999
6.599032
4c556627-97c2-439e-99db-33c9d1bc016e
Farhana-Najnin/Datastructure
module23/count_words_in_a_string_using_map_module23.cpp
#include<bits/stdc++.h> using namespace std; int main(){ string sentence; getline(cin,sentence); string word; stringstream ss(sentence); map<string,int>mp; while(ss>>word){ mp[word]++; } //sobgulo wod koibar asce dekhar jnno for(auto it=mp.begin();it!=mp.end();it++){ cout<<it->first<<" "<<it->second<<endl; } //spec...
ALGO
0.998487
4.136827
8362d5d0-3ed0-4b40-b6fe-15181a3b2832
HowardDreemurr/pl-slam-compat
depends/opencv/modules/features2d/src/kaze/nldiffusion_functions.cpp
/** * @file nldiffusion_functions.cpp * @brief Functions for non-linear diffusion applications: * 2D Gaussian Derivatives * Perona and Malik conductivity equations * Perona and Malik evolution * @date Dec 27, 2011 * @author Pablo F. Alcantarilla */ #include "../precomp.hpp" #include "nldiffusion_functions.h" #...
ALGO
0.999965
7.159442
a966eb68-1b01-4bcf-a1a0-55521050702b
k-tokitoh/atcoder
contests/typical90/046/main.cpp
#include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector< long long > A(46, 0); for (int i = 0; i < N; i++) { int n; cin >> n; A[n % 46]++; } vector< long long > B(46, 0); for (int i = 0; i < N; i++) { int n; cin >> n; B[n % 46]++; } ...
ALGO
0.999951
3.568511
6ea03ef5-3ce1-4940-a0c8-dbdc7b0ef523
Noodle3D/ZCookie
algorithm/POJ/POJ2075 Tangled in Cables.cpp
#include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <iostream> using namespace std; static const int MAXN = 250; double totalLength; int houseNumber, pathNumber; string houseName[MAXN]; struct Path { int s, t; double length; bool operator < (const Path &p) const { ...
ALGO
0.999985
3.691544
b4cd4d3d-372a-497c-9777-cfac4b4e4a0b
TFS-here/problemSolving
Planets.cpp
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int t; cin>>t; while(t--) { int n,c; cin>>n>>c; int a[n]; for(int i=0;i<n;i++) { cin>>a[i]; } sort(a,a+n); vector<int...
ALGO
0.999934
3.513567
ff43fce2-2f0b-4075-98d4-178e00433571
kmjp/procon
atcoder/abc201-250/abc234/d.cpp
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define ...
ALGO
0.999832
4.006714
aa35303b-d9a3-473a-9777-077f5f7eafaa
KeshavTandon/LeetCode
0560-subarray-sum-equals-k/0560-subarray-sum-equals-k.cpp
class Solution { public: int subarraySum(vector<int>& nums, int k) { unordered_map<int,int>mp; mp[0]=1; int ans=0,sum=0; for(int i=0;i<nums.size();i++) { sum+=nums[i]; if(mp.find(sum-k)!=mp.end()) { ans+=mp[sum-k]; ...
ALGO
0.999904
6.073926
8d5d7503-a4fd-4bdc-98ae-a851d8ad8051
hefen1/kalpa
third_party/skia/src/effects/SkCornerPathEffect.cpp
#include "SkCornerPathEffect.h" #include "SkPath.h" #include "SkPoint.h" #include "SkFlattenableBuffers.h" SkCornerPathEffect::SkCornerPathEffect(SkScalar radius) : fRadius(radius) {} SkCornerPathEffect::~SkCornerPathEffect() {} static bool ComputeStep(const SkPoint& a, const SkPoint& b, SkScalar radius, ...
TOOL
0.955034
6.633647
08041f1c-54ca-4ab6-be6f-c7d7fd75a7db
hocvn/Online-judge
LuyenCode/MAGPERM.cpp
#include <iostream> using namespace std; const int N = 1e5 + 3; int a[N],luu[N],n,k; bool d[N]; int main(){ scanf("%d%d",&n,&k); bool check = true; for (int i = 1; i <= n; i++){ if (i-k < 1 && i+k > n) check = false; if (!check) break; if (i-k > 0){ if (d[i-k]){ ...
ALGO
0.999878
3.534001
17ea863f-cf53-4fc9-97f8-8b8c8de0648c
jigyansunanda/Leetcode-Practice
113-path-sum-ii/113-path-sum-ii.cpp
class Solution { public: using str = string; using ll = long long; using ld = long double; using vi = vector<int>; using pii = pair<int, int>; using vvi = vector<vector<int>>; template <class T> using maxheap = priority_queue<T>; template <class T> using minheap = priority_queue<T, vecto...
ALGO
0.999963
6.153232
a3f407bd-0afc-4cb0-8efb-ee97f93b220d
SiddiqueSahb/DSASeries
.ccls-cache/@home@runner@DSASeries/DSA Series@DS@Recursion@printKeypadCombination.cpp
/* Print Keypad Combinations Code Send Feedback Given an integer n, using phone keypad find out and print all the possible strings that can be made using digits of input n. Note : The order of strings are not important. Just print different strings in new lines. Input Format : Integer n Output Format : All possible str...
ALGO
0.999841
5.762921
d96a6945-b37f-4045-a6eb-d10b53933f0b
raincross7/code-similarity
codes/train_code/problem035/problem035_52.cpp
#include<bits/stdc++.h> using namespace std; int main(void){ int n; int i,j,k,l; int cnt; while(1){ cin>>n; if(cin.eof()) break; cnt=0; for(i=0;i<=9;i++){ for(j=0;j<=9;j++){ for(k=0;k<=9;k++){ for(l=0;l<=9;l++){ if(n==i+j+k+l) cnt++; } } } } cout<<cnt<<endl; } return 0; }...
ALGO
0.999505
3.895
99e07f26-8179-4bb0-937e-43fc462c4f2f
horizon-research/Fov-3DGS
fov3dgs/submodules/diff-gaussian-rasterization_fov_pcheck_obb/third_party/glm/test/perf/perf_matrix_transpose.cpp
#define GLM_FORCE_INLINE #include <glm/matrix.hpp> #include <glm/ext/matrix_float4x4.hpp> #include <glm/ext/matrix_double4x4.hpp> #include <glm/ext/matrix_relational.hpp> #include <glm/ext/vector_float4.hpp> #if GLM_CONFIG_SIMD == GLM_ENABLE #include <glm/gtc/type_aligned.hpp> #include <vector> #include <chrono> #inclu...
TEST
0.906527
6.841862
3d6ad916-7c1d-449c-9d15-b98b14a0e4eb
securesystemslab/llvm-project
lld/ELF/CallGraphSort.cpp
#include "CallGraphSort.h" #include "OutputSections.h" #include "SymbolTable.h" #include "Symbols.h" #include <numeric> using namespace llvm; using namespace lld; using namespace lld::elf; namespace { struct Edge { int from; uint64_t weight; }; struct Cluster { Cluster(int sec, size_t s) : next(sec), prev(sec...
ALGO
0.999241
6.316964
e9004dab-5aa6-44e1-8655-ba4880dd7559
heweimin77/shoran_cpp
session3000/problem2400/p2338.idealArrays.cpp
#include <gtest/gtest.h> #include <unordered_map> #include <cmath> #include <numeric> using namespace std; namespace { class Solution { static constexpr int MOD = 1e9 + 7; public: int idealArrays(int n, int maxValue) { vector<int> primes; vector<unordered_map<int, int>> counts(maxValue + ...
ALGO
0.999838
6.594224
d39f0187-5310-4207-90dc-95228fe57c06
shrutigoel11/Data-Structures-and-Algorithms
DSA Course 2/Array Questions Lecture-18/Intersection of Arrays/optimal.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; vector<int> findArrayIntersection(vector<int> &a, int n, vector<int> &b, int m) { int i=0,j=0; vector<int> ans; while(i<n && j<m){ if(a[i]>b[j])j++; else if(a[i]<b[j])i++; else{ ans.push_back(a[i]); i++; j++; } } return ans; } int...
ALGO
0.99993
3.264799
96c6bdbd-11f6-4a59-8802-23ba251ec5c6
Farrius/cp
harbour/summercamp/segment_tree/e.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; const int MX = 2e5 + 5; vector<int> seg(MX * 4), ar(MX); int n, q; void build (int x, int lx, int rx) { if (lx == rx) { seg[x] = ar[lx]; return; } int m = (lx + rx)/2; build(2 * x, lx, m); ...
ALGO
0.99999
5.161715
b2acef14-a4cc-4bb8-846e-1d490904c43b
ishandutta2007/codeforces
golikovnik/normal/321/E.cpp
#include <bits/stdc++.h> using namespace std; // http://acm.math.spbu.ru/~sk1/algo/input-output/fread_write_export.cpp.html /** Interface */ inline int readChar(); template <class T = int> inline T readInt(); template <class T> inline void writeInt( T x, char end = 0 ); inline void writeChar( int x ); inline void ...
ALGO
0.999851
3.360089
63e56ce9-44a3-46dd-92a2-512009f4a91f
ayushsharma4457/Data-Structure-And-Algorithms
Code/21 Multiplication Table/multiplicationTable.cpp
#include <iostream> using namespace std; int main() { int table_start, start_num, end_num, table_end; cout << "Table Start From: "; cin >> table_start; cout << "Table End In: "; cin >> table_end; cout << "Table Numbers Start From: "; cin >> start_num; cout << "Table Number End In: ";...
ALGO
0.99192
3.795436
af782d40-f69f-492c-9e78-dcfbbaf53d6a
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_9858_14.cpp
#include <bits/stdc++.h> using namespace std; pair<int, int> p[100005]; long long acum[100005], ans[100005]; int id[100005]; bool comp(int x, int y) { return p[x].first < p[y].first; } int main() { int n, k; scanf("%d%d", &n, &k); for (int i = 0; i < n; i++) scanf("%d", &p[i].first); for (int i = 0; i < n; i++)...
ALGO
0.999972
3.042305
2b6c4fd9-d33c-4239-93e9-ee78523aeedf
sawarn24/LEETCODE-questions
0123-best-time-to-buy-and-sell-stock-iii/0123-best-time-to-buy-and-sell-stock-iii.cpp
class Solution { public: int maxProfit(vector<int>& prices) { if (prices.empty()) return 0; int firstBuy = INT_MIN, firstSell = 0; int secondBuy = INT_MIN, secondSell = 0; for (int price : prices) { firstBuy = max(firstBuy, -price); // Best price to buy first stock fir...
ALGO
0.999776
6.280559
ef59506b-2e2a-4f98-a358-668736a1f89d
brstu/OTIS-2024
trunk/ii02506/task_02/src/task_02.cpp
#include <iostream> struct PIDParameters { double kp; double ki; double kd; double K; double T; double TD; double T0; }; double calculate(double setpoint, double measured_value, double dt, PIDParameters& params, double& previous_error, double& integral) { double error = setpoint - meas...
ALGO
0.999813
6.357194
45ec94f2-2ec5-4228-b4d7-3a40bfee86a4
Rezuanul-Islam-Fahim/Competitive-Programming-Codes
HackerRank/Climbing_the_Leaderboard.cpp
/* ****** ****** https://www.hackerrank.com/challenges/climbing-the-leaderboard/problem ****** */ #include <bits/stdc++.h> using namespace std; #define mx 200000 int r[mx + 1]; int s[mx + 1]; void build_rank(int n) { for (int i = 0; i < n; i++) { if (i == 0) r[i] = 1; else { if (s[i]...
ALGO
0.999989
4.766007
a502af72-709c-4a96-b325-b7b4aae922d1
SourceBoxGame/OldSourceBox
game/client/portal/Portal_DynamicMeshRenderingUtils.cpp
#include "cbase.h" #include "Portal_DynamicMeshRenderingUtils.h" #include "iviewrender.h" extern ConVar mat_wireframe; int ClipPolyToPlane_LerpTexCoords( PortalMeshPoint_t *inVerts, int vertCount, PortalMeshPoint_t *outVerts, const Vector& normal, float dist, float fOnPlaneEpsilon ) { vec_t *dists = (vec_t *)stackal...
ALGO
0.990591
6.218737
a1f5b476-9324-42ae-a7ee-a9a05c23f374
serban-cercelescu/Darboux-Normal-Form
test.cpp
#include <fstream> #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int matrix[128][128]; void gen_matrix(int n, int mod) { for (int i = 1; i <= n; ++i) { for (int j = i + 1; j <= n; ++j) { matrix[i][j] = rand() % mod; matrix[j][i] = (mod - matrix[i][j])...
TEST
0.931355
3.145836
bc838387-a992-4db9-af0b-703ddd4a72ac
vaibhavnirmal2001/DSA-problems
power-of-two/power-of-two.cpp
class Solution { public: bool isPowerOfTwo(int n) { // n = abs(n); if(n <= 0) return false; if(n%2 == 0) return isPowerOfTwo(n/2); if(n == 1) return true; return false; } };
ALGO
0.996797
5.896459
25fd7677-6198-4776-871e-988af4bcd167
mclarafreitas/Linguagem-de-Programacao
Lista 5/Datas.cpp
#include <iostream> using namespace std; int main(){ int dia1, mes1, ano1, dia2, mes2, ano2; cin >> dia1 >> mes1 >> ano1 >> dia2 >> mes2 >> ano2; if(dia1>=1 && dia1<=31 && dia2>=1 && dia2<=31 && mes1>=1 && mes1<=12 && mes2>=1 && mes2<=12){ if(ano1<ano2){ cout << "A primeira data e mais...
ALGO
0.999971
3.562965
88566e03-8c77-43b5-9459-23e927d4eacb
NicolasMartalog/GAN-Construction
gan_architecture.cpp
#include "gan_architecture.h" #include "matrix_mult.h" #include <iostream> #include <random> #include "adam_optimizer.h" #include <opencv2/opencv.hpp> #include <cmath> float binaryCrossEntropy(float predicted, float target) { // Prevent log(0) issues predicted = std::max(std::min(predicted, 0.999999f), 0.0000...
DATA
0.971859
7.43309
62b101da-345f-48e8-bf8a-de446e033bc8
stinb/plugins
CodeCheck/Published Standards/SEI Cert Standards/C++/OOP51-CPP/Noncompliant2.cpp
#include <iostream> #include <string> #include <vector> #include "Employee.h" #include "Manager.h" void f(const std::vector<Employee> &v) { for (const auto &e : v) { std::cout << e; } } int main() { Employee typist("Joe Smith"); std::vector<Employee> v{typist, Employee("Bill Jones"), Mana...
TOOL
0.923252
3.240001
281ca719-b921-4bbe-ae01-50c1513ba63a
roshnimishraa/Leetcoding
778-reorganize-string/reorganize-string.cpp
class Solution { // {freq,char} typedef pair<int,char> p; public: string reorganizeString(string s) { int n = s.length(); vector<int> freq(26,0); for(char &ch: s) { freq[ch-'a']++; if(freq[ch-'a'] > (n+1)/2) return ""; } // max-hea...
ALGO
0.999989
5.249499
ed8ade25-e40c-4383-bf03-37ba212b40da
aroraadivya/LeetCode-Questions
2764-maximum-number-of-fish-in-a-grid/2764-maximum-number-of-fish-in-a-grid.cpp
class Solution { public: int findMaxFish(vector<vector<int>>& grid) { int m = grid.size(); int n = grid[0].size(); int maxFish = 0; function<int(int, int)> dfs = [&](int r, int c) -> int { if (r < 0 || c < 0 || r >= m || c >= n || grid[r][c] == 0) return ...
ALGO
0.999954
6.280473
f9e236c2-62ec-4101-bcde-bdf3355f1c3e
ZeeJoww/CSUST-2023-ICPC-Training-Selection-Contest
data-gen/05.扮装节/jury.cpp
#include <iostream> const int N = 618; int dis[N][N]; int main() { std::cin.tie(nullptr) -> sync_with_stdio(false); int n, m, q; std::cin >> n >> m >> q; constexpr int inf = 0x3f3f3f3f; for (int i = 1; i <= n; i++) { std::fill(dis[i] + 1, dis[i] + n+1, inf); dis[i][i] = 0; ...
ALGO
0.999987
5.268109
c0a88617-aa33-47b7-9074-c97f9b5c799c
hamza-vuiyan/Problem-Solving
codes/A_Cheap_Travel.cpp
// In The Name of Almighty Allah #include <bits/stdc++.h> using namespace std; #define ll long long #define errv for(auto it: v){cerr << it << ' ';} #define star cerr << "*\n"; #define cerrV(x) for(auto it: x) cerr << it << ' '; cerr << '\n'; #define cerr(i, x) cerr << 'i' << " ...
ALGO
0.999708
3.680474
72d49d76-3041-426d-b8dd-7e8f1162eb5a
elli0t-yash/Colab-DSA-Practice
mihir/competitive_programming_basics_luv/EP61-70/EP66_Three_Musketeers.cpp
#include <iostream> #include <string> #include <unordered_map> #include <set> #include <vector> using namespace std; // https://www.hackerearth.com/problem/algorithm/the-three-musketeers-6efd5f2d/ // The Three Musketeers bool isVowel(char ch) { return (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u'...
ALGO
0.999861
5.765503
ead128ca-5169-4bea-857f-f3301314ccb8
etiset/kattis-solutions
pizza2.cpp
#include <bits/stdc++.h> using namespace std; int main() { double r, c; cin >> r >> c; double pi = acos(-1); double pizza = pi * r * r; double cheese = pi * (r - c) * (r - c); double ans = 100.0 * cheese / pizza; printf("%.6lf\n", ans); return 0; }
ALGO
0.998381
3.594861
89420437-2bd3-424c-85b4-2c15ed339a7c
Riverside-City-College-Computer-Science/Summer14_CSC5_46023
pg2321263/Hmwk/Assignment 2/Gaddis_6thEd_Chap3_Prob4_Average_Rainfall/main.cpp
/* * File: main.cpp * Author: Patrick Glenning * Created on June 26, 2014, 12:53 PM * Purpose: Calculate the average rainfall over 3 months */ //System Libraries #include <iostream> #include<iomanip> //User-defined Libraries //Global Constants //Function Prototypes using namespace std; //Begin execution i...
TOOL
0.967598
4.254384
af078c24-d04b-4262-b5d2-6566c3176fd3
Hassan-Sadiq/Quiz-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
c97f03d9-0066-48a9-8fa8-7941dc8e39a2
kabuto64425/Atcoder
other/AlgoAndMath/014_2.cpp
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; typedef long long ll; #define REP(i,n) for(ll i=0;i<ll(n);i++) #define REPD(i,n) for(ll i=n-1;i>=0;i--) #define FOR(i,a,b) for(ll i=a;i<=ll(b);i++) #define FORD(i,a,b) for(ll i=a;i>=ll(b);i--) #define ALL(x) x.begin(),x.end()...
ALGO
0.999923
4.968151
de465994-d874-4c42-8d80-d1dfedbbf5fd
meat124/BAEKJOON_My_Solution
Silver_4/백준_1021_회전하는큐.cpp
#include <iostream> #include <deque> #include <algorithm> void FindItr(int n, std::deque<int>::iterator &Iter) { for (size_t i = 0; i < n; i++) Iter++; } int main() { int N, M; std::cin >> N >> M; std::deque<int> deq; // ť for (size_t i = 0; i < N; i++) deq.push_back(0); fo...
ALGO
0.999985
4.054846
c17a930b-e9b2-46c4-b5b3-9c4673095640
paul-fornage/CS10A-2
class materials/wks7_8/triangle1.cpp
#include<iostream> //triangle1.cpp using namespace std; int main() { int limit=5; char symbol='x'; int colcount=1, rowcount=1; cout<<"Please enter a positive number to be used to generate a triangle."<<endl; cin>>limit; while(!cin || limit<0) { cin.clear(); cin.ignore(100,'...
ALGO
0.983429
3.801351
e8bfb1c2-e301-400d-a188-55c70a1d70dd
softarts/myoj
ojcpp/leetcode/200/299_cowbull.cpp
#include <codech/codech_def.h> using namespace CODECH; using namespace std; /* You are playing the Bulls and Cows game with your friend. You write down a secret number and ask your friend to guess what the number is. When your friend makes a guess, you provide a hint with the following info: The number of "bulls", wh...
ALGO
0.999554
6.70765
15a1cbad-0860-4895-b9ce-92460d0d3c44
jiacongfang/Frontiers_of_Geometric_Computation_25Spring_PKU
Final_Project/preprocess/isosurface/tbb/tbb-2018_U6/src/test/test_parallel_sort.cpp
#include "tbb/parallel_sort.h" #include "tbb/task_scheduler_init.h" #include "tbb/concurrent_vector.h" #include "harness.h" #include <math.h> #include <vector> #include <exception> #include <algorithm> #include <iterator> #include <functional> #include <string> #include <cstring> /** Has tightly controlled interface s...
TEST
0.953732
7.384946
52cad42a-55ee-46dc-baaa-d85aee303675
NehaChaudhary311/Competitive-Programming-Problems-2020
Linked List/Intersection point in Y shaped linked list.cpp
/* https://practice.geeksforgeeks.org/problems/intersection-point-in-y-shapped-linked-lists/1# */ int intersectPoint(Node* head1, Node* head2) { // Your Code Here if(head1 == NULL || head2 == NULL) return -1; Node* p1 = head1; Node* p2 = head2; while(p1 != p2){ p1 = p1->next; p2 = p2...
ALGO
0.999992
4.785958
d887b9b6-e52d-4712-a3dc-6bab664858ec
EASINTUHA/Coding-Journey-reset
April 2025 past/B_Permutation_Chain.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define ff first #define ss second #define pb push_back #define all(x) x.begin(), x.end() #define sz(x) (int)(x)...
ALGO
0.999956
3.816175
45d70b22-2eb8-4a6a-93db-694853843af3
Sup3rFire/CP
Codeforces/Codeforces_Codeforces_Round_479_Div_3/C_Less_or_Equal.cpp
#include <bits/stdc++.h> using namespace std; // loal is the cutest girl #define ll long long #define ld long double #define pow2(x) (x)*(x) #define le left #define ri right #define fi first #define se second #define pb push_back #define all(v) v.begin(), v.end() #define pii pair<int, int> #define pll pair<long long,...
ALGO
0.999924
4.438923
0b780835-9713-4a3d-a12e-8a99336207ed
ishandutta2007/codeforces
martin53/normal/392/D.cpp
#include<bits/stdc++.h> using namespace std; const int nmax=1e5+42; struct info { int u,v,w; }; info interesting[nmax*3]; int id; void add(info current) { id++; interesting[id]=current; //cout<<"added: "<<current.u<<" "<<current.v<<" "<<current.w<<endl; } int n; int a[nmax],b[nmax],c[nmax]; map<int,...
ALGO
0.999979
3.713641
9ba04fd6-19cf-465e-aa0e-c9ca84afe2b1
Jashimjnn/CppProject
A_Simple_Design.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; int sum(int x); void display(int t) { int x,k; cin>>x>>k; while(sum(x)%k!=0) { x++; } cout<<x<<endl; } int sum(int x) { //int y=x; int sum=0; while(x!=0) { int tmp=x%10; sum+=tmp; x/=10; } ret...
ALGO
0.999685
3.556019
5bcacf05-9093-40ea-89f9-af28231ba5f0
tht2005/OI
uva/11029.cpp
/** * Author: tht2005 * Gene: 2021.11.08 13:52:37 **/ #include <bits/stdc++.h> using namespace std; #ifdef __GNU_PBDS #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #endif #define fs first #define sc second #define SZ(x) ((int)x.size()) #define ALL(x) x.b...
ALGO
0.999202
4.103547
e0706e71-9724-43d4-901c-3173db6f9d0b
IshanRakte/LeetCode-Solutions
0881-boats-to-save-people/0881-boats-to-save-people.cpp
class Solution { public: int numRescueBoats(vector<int>& people, int limit) { int count = 0; int left = 0; int right = people.size()-1; sort(people.begin(), people.end()); while(left <= right){ int weight = people[left] + people[right]; count+...
ALGO
0.999997
5.973081
3ade2112-9354-4989-82eb-428b2864fc98
rajat2004/programming
a2oj/ladder12/66.cpp
#pragma GCC optimize ("-O3") #include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef long long unsigned lluu; typedef long double ld; typedef pair<int,int> p32; typedef pair<ll,ll> p64; typedef pair<double,double> pdd; typedef vector<ll> v64; typedef vector<int> v32; typedef vector<vector<int> >...
ALGO
0.999946
4.620582
d240bb24-5acb-4ea3-95e8-9930d7702e14
jawaidm/geodjango
data/proj-7.0.1/src/apps/proj.cpp
/* <<<< Cartographic projection filter program >>>> */ #include "proj.h" #include "proj_internal.h" #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #include <math.h> #include "emess.h" #include "utils.h" #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__WIN32__) # include...
TOOL
0.947443
6.352478
1c631bf5-7f47-4f38-b0ea-c2f947c6ba12
Ceclap/university
APA/apaLab3/main.cpp
#include <iostream> #include <vector> #include <ctime> #include <chrono> #include <climits> #include <algorithm> #include <cstring> using namespace std; // Definim o structura pentru a reprezenta muchi struct Edge { int src, dest, weight; }; // Clasa pentru reprezentarea unui graf neorientat ponderat class Graph...
ALGO
0.99967
6.259339
c70ce409-040f-431d-94c7-353910bb075b
ssatwik975/leetcode-solutions
solutions/1895-minimum-number-of-operations-to-move-all-balls-to-each-box/solution.cpp
class Solution { public: vector<int> minOperations(string boxes) { vector<int>position; for(int i =0;i<boxes.size();i++){ if(boxes[i]=='1'){ position.push_back(i); } } vector<int>minoperations; for(int i =0;i<boxes.size();i++){ ...
ALGO
0.999993
5.848701
5b10265a-4718-4f51-a9b9-0b75be0e8f3c
joshuanunn/algorithms-unlocked
strings/lcs.cpp
#include <chrono> #include <cstdlib> #include <iostream> #include <iomanip> #include <string> #include <vector> #include "include/randstring.hpp" /* * @brief Parse argument to extract user string length * * @param[in] param argv element corresponding to string length * @return (int)string_length parsed size of...
TOOL
0.997211
6.402694
d7d1007b-9d72-44e3-86ee-0769c501f953
Aadityajain75/CompetitiveProgramming
practice/techgig/2.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define vi vector<ll> int main() { for(ll i=0;i<1000;++i); ll t; cin>>t; while(t--) { ll n; cin>>n; vi a(n); for(ll i=0;i<n;++i) { cin>>a[i]; } vi max_sum(n); max_sum[0]=max((ll)0,a[0]); max_sum[1]=max(max...
ALGO
0.999968
4.007557
a4be6e7e-cb4f-4995-89d2-1dc9e10e4bd2
Farhana-Faruque/Code-Force
DivideIt.cpp
#include<bits/stdc++.h> using namespace std; long long intoOne(long long n) { int ans = 0; while (n%2 == 0){ n /= 2; ans++; } while (n%3 == 0){ n = (n/3) * 2; ans++; while (n%2 == 0){ n /= 2; ans++; } } while (n%5 == 0){ ...
ALGO
0.999616
4.369487
e142c367-fec9-4740-b257-f9be5465601b
KrailH/FeatureVerificatio
LockFreeQueueVerificatio/main.cpp
#include <atomic> #include <thread> #include <iostream> template<typename T> class LockFreeQueue { public: LockFreeQueue(int capacity) : capacity_(capacity), buffer_(new T[capacity]), head_(0), tail_(0) {} ~LockFreeQueue() { delete[] buffer_; } bool Enqueue(const T& value) { int curre...
ALGO
0.990776
5.239837
35e103fc-514d-4aa8-bc52-1222ac3b0af9
Elubrazione/pat_ab_levels
Advanced/code/A1138.cpp
#include <bits/stdc++.h> using namespace std; vector<int> pre, in; bool flag = false; struct TreeNode { int val; TreeNode *left, *right; }; TreeNode* create(int preL, int preR, int inL, int inR) { if (preL > preR) return NULL; TreeNode *root = new TreeNode; root -> val = pre[preL]; root -> left = root -> ...
ALGO
0.999997
4.212832
2409c38a-1403-4021-a75d-111e17c2e1bd
Ashutoshyadav01/Programs
c++ programs by abdul bari/factor of number.cpp
#include<iostream> using namespace std; int main() { int n,count=0; cout<<"enter the number to know it's factor\n"; cin>>n; for(int i=1;i<=n;i++) { if(n%i==0) { cout<<i<<" is factor of "<<n<<endl; count++; } else { //cout<<i<<" is not a factor of "<<n<<endl; } } if(count==2) { cout<<n...
ALGO
0.996186
3.250772
296288cb-90f9-4da1-a592-65436b21f481
Danial-Kord/Solar-System-OpenGL
thirdparty/glm-0.9.9.7/test/core/core_func_matrix.cpp
#include <glm/matrix.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/ulp.hpp> #include <glm/gtc/epsilon.hpp> #include <glm/gtc/constants.hpp> #include <vector> #include <ctime> #include <cstdio> using namespace glm; int test_matrixCompMult() { int Error(0); { mat2 m(0, 1, 2, 3); mat2 n = matrixC...
TEST
0.903127
6.696014
a2d67c86-403d-445a-bda2-73a22f27eeb7
LuizZak/swift-z3
Sources/CZ3/nlsat/nlsat_interval_set.cpp
#include "nlsat/nlsat_interval_set.h" #include "math/polynomial/algebraic_numbers.h" #include "util/buffer.h" namespace nlsat { struct interval { unsigned m_lower_open:1; unsigned m_upper_open:1; unsigned m_lower_inf:1; unsigned m_upper_inf:1; literal m_justification;...
ALGO
0.890586
5.964172
725cfa99-76a6-4df0-8c71-76ed7f342dff
adi2710/LeetCode
Copy Set Bits in Range - GFG/copy-set-bits-in-range.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution{ public: int setSetBit(int x, int y, int l, int r){ // code here return x | y & (((1ll << r) - 1) & ~((1 << (l - 1)) - 1)); ...
ALGO
0.998793
4.732178
e4c6cd9d-bf76-4141-a0fb-31b9335a8bd5
chakshukhanna99/DSA
DAY 9/RECURSION 1/ispresent.cpp
#include<iostream> using namespace std; bool ispresent(int arr[],int n,int m){ n--; if(n<0){ return false; } if(arr[n]==m){ return true; } return ispresent(arr,n,m); } int main(){ int arr[]={1,6,7,9,8}; int n=5; if (ispresent(arr , 5,8)){ cout<<"true"; } ...
ALGO
0.999645
3.98039
5c2dedcc-3d02-4f93-92e5-6722aecb735a
ad-freiburg/loom
src/octi/Octilinearizer.cpp
#include <algorithm> #include <fstream> #include <thread> #include "ilp/ILPGridOptimizer.h" #include "octi/Octilinearizer.h" #include "octi/basegraph/BaseGraph.h" #include "octi/basegraph/ConvexHullOctiGridGraph.h" #include "octi/basegraph/GridGraph.h" #include "octi/basegraph/HexGridGraph.h" #include "octi/basegraph/N...
ALGO
0.999877
6.740753
aee3c029-0f9c-4c79-b7e6-68ff38a924be
Rudrakshyadav1/c-DSA
loopdetection.cpp
#include <iostream> #include <map> using namespace std; class node{ public: int data; node* next; node(int data){ this->data=data; this->next=NULL; } ~node(){ cout<<"this element is deleted:"<<this->data; } }; void insertathead(int data,node*&head){ node * temp= new n...
ALGO
0.9999
3.948765
aa9503be-4749-4ff5-b032-89e23c6c0937
hexin-pku/Data_Structures_Algorithms_Collection
BinSearchTree/BinSearchT.cpp
#include <cstdio> #include <cstdlib> #include <cstring> #include "BinSearchT.h" int SearchBT(PBT pbt,int key,PTN* pploc)//زڵĸڵ { PTN p=pbt->ptree;PTN pre=NULL; while(p!=NULL) { if(p->key==key) { *pploc=p;return true;//Ҫָ룡μдǴģ } pre=p; if(p->key>key) p=p->...
ALGO
0.999515
3.558559
fc9b9ef5-0215-4d6d-b540-a19b297557d3
DivyamVJ0901/Love-Babbar-DSA-Youtube-Course-all-Codes
L140_Fractional_Knapsack.cpp
#include <bits/stdc++.h> using namespace std; class Item { public: int value; int weight; Item(int v, int w) { this->value = v; this->weight = w; } }; static bool cmp(pair<double, Item> a, pair<double, Item> b) { return a.first > b.first; } double fracKnapsack(int W, Item arr[...
ALGO
0.999977
4.572854
5036e22c-0e68-4368-9b44-a7c718516ff7
Zentertain/ZenMediaLib
ffmpeg/jni/fdk-aac/libDRCdec/src/drcGainDec_preprocess.cpp
/* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android © Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION The Fraunhofer FDK AAC Codec Lib...
TOOL
0.968074
5.013272
cd148c07-5187-4941-b49d-91542fbf1e49
pwelke/hops
smallgraphs/util/gaston-1.1-re/legoccurrence.cpp
// legoccurrence.cpp // Siegfried Nijssen, <EMAIL>, jan 2004. #include "legoccurrence.h" #include "closeleg.h" #include "database.h" #include "graphstate.h" vector<LegOccurrences> candidatelegsoccurrences; // for each frequent possible edge, the occurrences found, used by extend LegOccurrences legoccurrences; bool cl...
ALGO
0.995616
4.338531
0b78b52c-c284-491b-b8f3-880f6c0e91c3
ChristopherMarreroL/Tarea8AppMovil
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.998733
6.76775
f5d9979d-0400-4fec-b44c-a749fd128623
HapyProgrammer/SFMLPrototype
FunGame/Collider.cpp
#include "Collider.h" #include <SFML/Graphics.hpp> Collider::Collider(sf::RectangleShape& body) : body(body) { } Collider::~Collider() { } // AABB Collision detection bool Collider::CheckCollision(Collider& other, float priority) { sf::Vector2f otherPosition = other.GetPosition(); sf::Vector2f otherHal...
ALGO
0.90579
5.444447
08003bc9-75fa-4f04-af16-33dbd16e36f3
Kawser-nerd/CLCDSA
Source Codes/AtCoder/arc071/A/4198911.cpp
#include <iostream> #include <cstdlib> #include <string> #include <vector> #include <queue> #include <set> #include <algorithm> #include <utility> #include <tuple> using namespace std; int main() { int n, length; cin >> n; string str; vector<int> count(26, 0); vector<int> num_min(26, 300); for...
ALGO
0.999992
4.323927
5e565776-85da-4c08-812b-d483bc2bb4e7
cc20mtech11006/Data-Structures-and-Algorithms
09_2DArrays/9.1_searchinInArray.cpp
//Searching element in 2D Array O(n) = O(n*m) #include<bits/stdc++.h> using namespace std; int main(){ int n, m; cout<<"Enter no of rows and cols of array: "; cin >> n>>m; int a[n][m]; cout<<"Enter Elements: "; for(int i=0;i<n; i++){ for(int j=0;j<m; j++){ cin>>a[i][j]; } } int target; cout<<"Enter t...
ALGO
0.99489
5.067915
3f6f4e07-669e-45f6-af24-4a458d7f9833
Aashish079/OOP-in-Cpp-Practise
Lab/Lab-6/classWork.cpp
#include <iostream> using namespace std; class Number { public: int notes[7] = {1000, 500, 100, 50, 20, 10, 5}; int money; int numofNotes = 0; int getNumberofNotes() { cin >> money; for (int i = 0; i < 6; i++) { if (money / notes[i] >= 1) { ...
ALGO
0.998399
4.14692
7fb73c4a-ad1c-4a6b-b343-aac856df63ec
Akash-Ingle/DSA_in_CPP
Arrays/SubarraysMNCsQs/PairSum.cpp
// O(n^2) time complexity approach // #include <iostream> // using namespace std; // bool pairSum(int a[], int n, int k){ // for(int i=0;i<n-1;i++){ // for(int j=i+1;j<n;j++){ // if(a[i]+a[j]==k){ // cout<<i<<" "<<j<<endl; // return true; // } // ...
ALGO
0.999561
5.408267
689b9ada-85f1-48a3-8381-5a417f169776
riyaz28/some-CP-problems
C. Maximum Median.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long bool f(ll med,vector<ll>a,int n,ll k) { ll res=0; for(int i=(n-1)/2;i<n;i++) { res+=max((ll)0,med-a[i]); } if(res<=k) return true; return false; } int main() { ll n,k; cin>>n>>k; vector<ll>a(n); for(int i=0;i<n;i++)cin>>a[i]; sort(a...
ALGO
0.999984
4.852446
405a83d4-2edd-4851-8677-05d441babca7
nikesh33/DSA
Week 7 Recursion/Recurssion Class 3/03_subSequnceOfString.cpp
#include <iostream> using namespace std; void findSubsequences(string str, string output, int index) { // base case if (index >= str.length()) { // ans vo output string me build ho chuka hai // print kardo cout << "->" << output << endl; return; } char ch = str[inde...
ALGO
0.999904
4.915546
00d393a5-611d-469f-9079-4d14e376f29d
josuerom/Competitive-Programming
Contests/CodeChef/2017/SnackDown 2017/Pre-elimination round A/A temple of Snakes.cpp
#include <bits/stdc++.h> #define endl '\n' #define debug(X) cout << #X << " = " << X << endl; #define fori(i,b,e) for (int i = (b); i < (e); ++i) using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<ii> vii; const int INF = 1e9, MAXN = 100010; ll temples[MAXN];...
ALGO
0.999972
4.126451
cfdb8522-cfcc-4c67-8d37-6918b9e96673
sarvex/leetcode-algol
solution/1200-1299/1213.Intersection of Three Sorted Arrays/Solution.cpp
class Solution { public: vector<int> arraysIntersection(vector<int>& arr1, vector<int>& arr2, vector<int>& arr3) { vector<int> ans; int cnt[2001]{}; for (int x : arr1) { ++cnt[x]; } for (int x : arr2) { ++cnt[x]; } for (int x : arr3) { ...
ALGO
0.999975
5.725906
de00bcea-256b-48ca-a277-30fe3cb799c0
PavanRaj26/LeetCode
August/duplicates_in_array.cpp
class Solution { public: vector<int> findDuplicates(vector<int>& nums) { vector<int> a; int n= nums.size(); a.push_back(0); vector<int> ans; for (int i = 0; i <n ; i++) a.push_back(nums[i]); for (int i =1 ; i <= n; i++) { if (a[abs(a[i])] >= 0) { ...
ALGO
0.999935
5.507491
4045c5e3-c586-4638-9f16-e7a3daa7ace6
soomrack/MR2020
Ilya Bondarenko/Sortirovka/Bubble_Sort.cpp
#include <iostream> using namespace std; void bubbleSort(int* array, int length) { for (int sorted_index = length - 1; sorted_index > 0; sorted_index--) { for (int pointer = 0; pointer < sorted_index; pointer++) { if (array[pointer] > array[pointer+1]) swap(array[pointer], arra...
ALGO
0.999735
5.084532
5c184158-63eb-44f6-8718-2a469d9d62a4
pingjuiliao/softbound
llvm-project-13.0.0.src/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
// <algorithm> // template<RandomAccessIterator Iter> // requires ShuffleIterator<Iter> && LessThanComparable<Iter::value_type> // constexpr void // constexpr in C++20 // sort_heap(Iter first, Iter last, Compare comp); #include <algorithm> #include <cassert> #include "test_macros.h" #include "test_iterators.h...
TEST
0.942253
6.927226
9ba2f175-0313-484d-b06c-7bbf5a559ba2
Ark-Aak/code_repo
2024-01-10/pi.cpp
#include <bits/stdc++.h> #define int ll #define rep(i, a, b) for(int i = (a), i##end = (b); i <= i##end; i++) #define _rep(i, a, b) for(int i = (a), i##end = (b); i >= i##end; i--) using namespace std; typedef long long ll; typedef pair <int, int> pii; int read() { int x = 0, f = 1; char c = getchar(); while (!i...
ALGO
0.999669
4.009927
0f7b51b8-80c7-4dd1-a46d-2620b7217e59
hookflash/obsolete.opbb10
hookflash-libs/boost/libs/spirit/phoenix/example/users_manual/all_odds.cpp
#include <vector> #include <algorithm> #include <iostream> #include <boost/spirit/include/phoenix_core.hpp> #include <boost/spirit/include/phoenix_operator.hpp> #include <boost/spirit/include/phoenix_statement.hpp> using namespace boost::phoenix; using namespace boost::phoenix::arg_names; using namespace boost::phoeni...
TOOL
0.886081
4.893861
6617e37c-cb4f-4b7c-b346-9beee8aaeb14
Johan-Palacios/cpp-tasks
ej37/main.cpp
#include <iostream> int factorial(int n) { if (n > 1) // Recursividad, se llama la función a sí misma durante su ejecución return n * factorial(n - 1); else return 1; } int main(int argc, char *argv[]) { int number = 4; // Se usa la fución factorial(number); return 0; }
ALGO
0.999484
5.591334
28b3d83a-33f1-4051-91c3-3cc4890a69bb
shivangi0110/24SS-AllTrans-main
benchmarks/benchmarks_source/8_level/p0002/s516586727.cpp
#include<stdio.h> int main(void) { int i,a,x,b,c; while((scanf("%d%d",&a,&b))!=EOF){ c=0; x=a+b; while(x!=0){ x=x/10; c++; } printf("%d\n",c); } }
ALGO
0.999125
3.255774
3ce01c6d-f641-4605-98b3-4331cdff39ab
busarobi/MDDAG
srcRL/multiboost/WeakLearners/BanditSingleStumpLearner.cpp
#include "BanditSingleStumpLearner.h" #include "IO/Serialization.h" #include "IO/SortedData.h" #include "Algorithms/StumpAlgorithm.h" #include "Algorithms/ConstantAlgorithm.h" #include "WeakLearners/SingleStumpLearner.h" #include <limits> // for numeric_limits<> #include <sstream> // for _id #include <math.h> //for l...
ALGO
0.997617
6.051084
3c6645aa-11e4-4388-b3e9-130213369e51
codeAbinash/leetcode-solutions
leetcode/problems/cpp/search-insert-position.cpp
// by @codeAntu // time complexity: O(log n) // space complexity: O(1) class Solution { public: int searchInsert(vector<int>& nums, int target) { int min = 0, max = nums.size() -1 ; int mid; while (min <= max) { mid = (min + max) / 2; if (nums[mid] == target) return mid;...
ALGO
0.999965
6.234312
fd71d7cd-c33a-4b55-a653-9bb1486938b1
kokosabu/atcoder
cpp/ddcc2020_qual_a/main.cpp
#include <iostream> using namespace std; int main() { int X, Y; int score; cin >> X >> Y; score = 0; if(X == 3) { score += 100000; } else if(X == 2) { score += 200000; } else if(X == 1) { score += 300000; } if(Y == 3) { score += 100000; } else if(...
ALGO
0.984387
3.508423
1ce07001-2b3c-4de9-81ec-1c0d168f7392
manikanta2901/ubuntu
.history/practice/cpp/codeforces/puzzleFronFuture_20210124111405.cpp
#include <bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #include<queue> using namespace std; #define trav(dataType,DataStruct,name) for(dataType<DataStruct>::itt ip = name.bb(); ip != name.ee(); ip++) //Pre processors & typedefs ...
ALGO
0.999981
4.185314
dde9a3d8-7a0b-4a26-ad3e-53435308b1a2
CGCL-codes/MHSim
zsim/src/prefetcher.cpp
#include "prefetcher.h" #include "bithacks.h" //#define DBG(args...) info(args) #define DBG(args...) void StreamPrefetcher::setParents(uint32_t _childId, const g_vector<MemObject*>& parents, Network* network) { childId = _childId; if (parents.size() != 1) panic("Must have one parent"); if (network) panic(...
TOOL
0.851535
5.012428
1bee5702-074e-4102-9eed-6198d6d36732
ayush-kumar774/Competitive-Programming
Codeforces/B. Ternary Sequence.cpp
// https://codeforces.com/contest/1401/problem/B #include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0) ; #define int long long #define endl '\n' void solve() { int a[3], b[3] ; for (int i = 0 ; i < 3 ; i++) cin >> a[i] ; for (int i = 0 ; i < ...
ALGO
0.999967
4.67684
9d5296bf-35dd-4fed-bc1e-67e3e1db0e00
sara-mohamd/ICPC-Assiut-Sheets
Newcomers-Training/Sheet5/03-wonderfulNumber.cpp
#include <iostream> using namespace std; bool isOdd(int n) { return !(n % 2 == 0); } bool isPalindrome(int n) { string binary = ""; while (n) { if (n % 2 == 0) binary += '0'; else binary += '1'; n /= 2; } for (int i = 0; i < binary.length(); i++) if (binary[i] != binary[binary.le...
ALGO
0.999805
5.111684
fc31a35c-e6b9-4587-9644-3ffad4daec49
stg05/sortings
sortings/merge.cpp
// // Created by stg05 on 17.03.2024. // #include <iostream> #include <ctime> #include <random> #include <algorithm> using namespace std; const size_t arr_size = 30; void merge(int *arr, size_t left, size_t mid, size_t right) { auto res = new int[right - left]; size_t ptr_l = left, ptr_r = mid, ptr = 0; ...
ALGO
0.999293
5.371646
97787d64-08f5-4dac-8bd4-787b017eca88
AlperenCavus/Rick-and-Morty-Flutter-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.998733
6.76775
93de837c-7f45-41d0-8f19-7de49f437b93
kdh01517/Coding_example
dfs/16932.cpp
#include <iostream> #include <queue> #include <cstring> #include <map> #include <set> using namespace std; int map2[1001][1001]; int dfs[1001][1001]; int vis[1001][1001]; int N, M; int ans; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; vector <pair<int, int> > v; map <int, int> m; int main(void) { ios::sync_wi...
ALGO
0.99968
4.086842
e3ed408a-576a-4518-8eb1-6a8f5acd634b
tyabus/xray-1.0
3rd_party/boost/libs/utility/binary_search_test.cpp
#include <vector> #include <string> #include <memory> #include <climits> #include <iostream> #include <cassert> #include <stdlib.h> // for rand(). Would use cstdlib but VC6.4 doesn't put it in std:: #include <list> #include <algorithm> #include <boost/detail/binary_search.hpp> #if defined(__SGI_STL_PORT) ? defined(__S...
TEST
0.955989
6.181669
2030ec84-446e-4906-b5b1-2918f84e914f
retrocoder123/codeforces
watermelon.cpp
#include <bits/stdc++.h> using namespace std; int main() { int w; cin >> w; if (w % 2 == 0 && w > 2) { cout << "YES"; } else{ cout << "NO"; } }
ALGO
0.999746
3.797598