uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
50210c73-5b2d-4314-918f-df896fb80990
Foereaper/Antrix
dep/poco/Foundation/src/SHA1Engine.cpp
#include "Poco/SHA1Engine.h" #include <cstring> #ifdef POCO_ARCH_LITTLE_ENDIAN #define SHA1_BYTE_REVERSE(x, y) byteReverse(x, y) #else #define SHA1_BYTE_REVERSE(x, y) #endif namespace Poco { SHA1Engine::SHA1Engine() { _digest.reserve(16); reset(); } SHA1Engine::~SHA1Engine() { reset(); } inline void SHA1Engin...
ALGO
0.950748
7.566369
20f3a088-a2a6-4500-919e-8f0a1ab360b6
Prakharsahu10/DataStructure_Algorithms
BINARY TREES/Diameter_of_tree.cpp
/* Diameter of a tree */ #include <iostream> #include <algorithm> using namespace std; // Node structure for the binary tree struct Node { int data; Node *left; Node *right; // Constructor to initialize // the node with a value Node(int val) : data(val), left(nullptr), right(nullptr) {} }; c...
ALGO
0.999999
7.341331
7b0e610d-4212-49ab-abad-d8a49045231f
akineko4396/3DGame
Lib/BulletPhysicsEngine/src/BulletSoftBody/btDefaultSoftBodySolver.cpp
#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h" #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletCollision/CollisionShapes/btCollisionShape.h" #include "btDefaultSoftBodySolver.h" #include "BulletCollision/CollisionShapes/btCapsuleShape.h" #include "BulletSoftBod...
ALGO
0.870651
7.064888
5619bbab-a6c2-42f8-9ba9-ca99ece6ab3e
knirvey/PR1
split.cpp
/* CSCI 104: Homework 1 Problem 1 Write a recursive function to split a sorted singly-linked list into two sorted linked lists, where one has the even numbers and the other contains the odd numbers. Students will receive no credit for non-recursive solutions. To test your program write a separate .cpp file and #inc...
ALGO
0.999914
5.586808
3257cfdb-cc41-4714-9f32-21894e1dcee0
FranksMathematics/CBC_ReleaseParallel_Win86
cbc/src/CbcHeuristicDiveGuided.cpp
#if defined(_MSC_VER) // Turn off compiler warning about long names #pragma warning(disable : 4786) #endif #include "CbcHeuristicDiveGuided.hpp" #include "CbcStrategy.hpp" // Default Constructor CbcHeuristicDiveGuided::CbcHeuristicDiveGuided() : CbcHeuristicDive() { } // Constructor from model CbcHeuristicDiveGuid...
ALGO
0.999301
6.010597
de4d686d-e294-4ae6-a7eb-4a5794bcd151
NQBH/advanced_STEM_beyond
OLP_ICPC/C++/bookshop.cpp
#include <iostream> #include <vector> using namespace std; int main() { int n, x; cin >> n >> x; vector<int> price(n), pages(n); for (int& v : price) cin >> v; for (int& v : pages) cin >> v; vector<vector<int>> dp(n + 1, vector<int>(x + 1, 0)); for (int i = 1; i <= n; ++i) for (int j = 0; j <= x; ++j) { dp...
ALGO
0.999898
3.968198
99221469-b85a-4395-b45b-e6d45e2c4fec
MohakGogia/Success-Gateway
Week 1 Contest/max min.cpp
// Time Complexity - O(nlog n) // Sapce Complexity - O(n) #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n,i,k; vector<int> v; cin>>n; cin>>k; for(i = 0; i < n ; i++) { int num; cin>>num; v.push_back(num); } ...
ALGO
0.999869
3.674768
5fb398a1-9406-4cfc-adf0-53c95c99687f
koba-e964/contest
yukicoder/117-short.cpp
#include <cstdio> typedef long long ll; ll m=1e9+7,f[1<<21],n,k,t,s,u,e;char c; ll r(ll v){for(e=m-2,s=1,u=v%m;e;u=u*u%m,e/=2)if(e%2)s=s*u%m;return s;} ll b(ll n,ll k){return n<k?0:f[n]*r(f[k])%m*r(f[n-k])%m;} int main(){for(f[t=0]=1;++t<1<<21;f[t]=f[t-1]*t%m);for(scanf("%lld",&t);t--;printf("%lld\n",c%2?b(n,k):c%5?(n?...
ALGO
0.999739
3.540159
2ff05299-08d0-4d82-a670-935c4ce9cc26
hpumengzhao/AtCProbems
ABC271/D.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <vector> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <queue> #include <ctime> #include <cassert> #include <complex> #include <string> #include <cstring> #include <chrono> ...
ALGO
0.999987
3.332628
d3f7c1b2-251f-4dd1-82b4-c367bc6684f1
PavlosMak/LLVM-Fence-Insertion
utils/benchmark/cmake/std_regex.cpp
#include <regex> #include <string> int main() { const std::string str = "test0159"; std::regex re; re = std::regex("^[a-z]+[0-9]+$", std::regex_constants::extended | std::regex_constants::nosubs); return std::regex_search(str, re) ? 0 : -1; }
ALGO
0.878278
5.855292
f7a67d5c-56e2-43c0-8af1-7fd80e2bc4ca
Software-Engineer-EPU/C-Extend
GNU-Compiler/WindowsOS/POP/Basic/Data-Struct-and-Algorithm/Excercises/BT10.cpp
/* Code by KingNNT */ #include <bits/stdc++.h> using namespace std; #define pathio "E:/Code/C-Extend/GNU-Compiler/Test/" #define fi pathio"input.txt","r",stdin #define fo pathio"output.txt","w",stdout class phanso { private: int tuso, mauso; public: phanso() { tuso = mauso = 0; } ~phanso() { tuso = mauso = ...
ALGO
0.996239
3.500593
f7d4387d-4ded-4591-958e-af4eb5e21c18
jeraldamo/BlenderVR
extern/bullet2/src/BulletCollision/Gimpact/btContactProcessing.cpp
#include "btContactProcessing.h" #define MAX_COINCIDENT 8 struct CONTACT_KEY_TOKEN { unsigned int m_key; int m_value; CONTACT_KEY_TOKEN() { } CONTACT_KEY_TOKEN(unsigned int key,int token) { m_key = key; m_value = token; } CONTACT_KEY_TOKEN(const CONTACT_KEY_TOKEN& rtoken) {...
ALGO
0.99748
4.895953
a9ce7a25-e60c-4a49-9e6a-fb5329c7eaf1
dhruvsaini25/GFG-solutions
Difficulty: Basic/Decision Making in Java/decision-making-in-java.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution { public: string compareNM(int n, int m){ if (n<m) return "lesser"; else if (n==m) return "equal"; else return "greater"; } int main(){ ...
ALGO
0.999803
5.301537
6485b62a-1324-4f57-8da4-3d2d281bf29c
RoshiniUdayaKumar/cpp_programming
Loops/Ex3.cpp
//"Program to input a number and then calculate sum of its digits. #include <iostream> using namespace std; int main() { int num,last_digit; int sum=0; //get the number from the user cout<<"Enter the number:"<<endl; cin>>num; //calculation while(num>0) { last_digit=num%10; //las...
ALGO
0.998643
5.438227
8b01b180-d7d9-4138-862a-80f4955931bb
Amylo-jh/baekjoon
14000s/14651.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; if(n == 1) { cout << 0; } else if(n == 2) { cout << 2; } else { long long answer = 2; for(int i = 3; i <= n; i++) { answer *= 3; answer %= 100...
ALGO
0.999969
4.28809
6535e4d7-9612-40d4-a751-d17bbdf8cc0f
nvdmike/CPP-Primer-Plus-Stephen-Prata
class_work/chapter_03/3.12/modulus.cpp
// modulus.cpp -- использует операцию % для преобразования фунтов в стоуны #include <iostream> int main() { using namespace std; const int Lbs_per_stn = 14; int lbs; cout << "Enter your weight in pounds: "; cin >> lbs; int stone = lbs / Lbs_per_stn; // количество целых стоунов int pounds = lbs % Lbs_per_stn; //...
ALGO
0.962599
3.875207
c637c45d-6fed-41ac-8d55-c6ae797dddb6
arnavarora1710/Competitive_Programming
Codeforces/1975D.cpp
// https://codeforces.com/contest/1975/problem/D #pragma GCC optimize("Ofast") #pragma GCC optimization("unroll-loops") #include <bits/stdc++.h> using namespace std; #define int long long typedef pair<int, int> pi; #define f first #define s second #define mp make_pair #define MULTI_TEST (1) const int maxn = 2e5 + 5, ...
ALGO
0.99966
4.744127
d48ecaf0-b87a-43df-a9df-a4b4280d23ce
AbhinavGangwar12/leetQues-
268-missing-number/missing-number.cpp
class Solution { public: int missingNumber(vector<int>& nums) { int n = nums.size(); int total = n * (n+1)/2; int sum =0 ; for(int i = 0;i<nums.size();i++){ sum += nums[i]; } return total-sum; } };
ALGO
0.99993
5.641387
6ae7681d-aac3-4571-a5bf-9a477b2b9f0e
darkshuige/codecode
c code/以撒和隐藏房间.cpp
#include<bits/stdc++.h> #define jiasu ios::sync_with_stdio(false),cin.tie(0),cout.tie(0) #define INF 0x3f3f3f3f #define int long long using namespace std; const int maxn=1005; char a[maxn][maxn]; int n,m; int check(int i,int j) { if(a[i][j]=='0') { int sum=0; if(i-1>=0) { if(a[i-1][j]=='2') return 0; ...
ALGO
0.999621
4.042795
17115402-d5a4-4072-a514-8762a738605d
nandeeshbhatrai/codeforces-chef-problems
A_Two_Frogs.cpp
// Author: Nandeesh // created: 12.01.2025 20:07:56 #include <bits/stdc++.h> // #include <chrono> using namespace std; using namespace std::chrono; #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #pragma optimization_level 3 #pragma GCC optimize("Ofast,no-stack-p...
ALGO
0.999919
4.888503
52c78521-50d1-46c5-8ab8-30a2717ebc9f
sarvex/leetcode-c3
lcof2/剑指 Offer II 097. 子序列的数目/Solution.cpp
class Solution { public: int numDistinct(string s, string t) { int m = s.size(), n = t.size(); vector<vector<unsigned long long>> dp(m + 1, vector<unsigned long long>(n + 1)); for (int i = 0; i <= m; ++i) { dp[i][0] = 1; } for (int i = 1; i <= m; ++i) { ...
ALGO
0.99996
6.521086
8c4a0121-329e-4073-b668-26d9fb1248e8
matiWaisman/TDA-1C-2024
Guia 1/Ejercicio 7/astroTradeBottomUp.cpp
#include <vector> using namespace std; vector<int> catalogo; vector<vector<int>> mem; int at(){ for(int i = 0; i < mem.size(); i++){ mem[i][0] = 0; mem[0][i] = 0; } for(int f = 1; f < mem.size(); f++){ for(int c = 1; c <= f; c++){ int noHagoNada = mem[f - 1][c]; ...
ALGO
0.999836
4.72153
46686c0b-0109-4d70-8203-460bbacf3fd5
hjiang13/LLMs-in-IR
processed_data/DecompiledResuts_Human_x_164_O2/MetaLLama_Human_x_164_O2_decompiled/test/CPP_127.cpp
#include <string.h> void intersection(std::string* result, std::vector<int>* v1, std::vector<int>* v2) { int* data1 = v1->_M_impl._M_start; int* data2 = v2->_M_impl._M_start; int size1 = *data1; int size2 = *data2; int min_size = (size1 < size2) ? size1 : size2; int* data1_next = data1 + 1; ...
ALGO
0.998739
4.954837
a7b67462-677c-46b7-b494-0e7489f45760
shashi918/CP_stuff
C++/Find_the_odd_int.cpp
// Find the odd int /* Given an array of integers, find the one that appears an odd number of times. There will always be only one integer that appears an odd number of times. Examples [7] should return 7, because it occurs 1 time (which is odd). [0] should return 0, because it occurs 1 time (which is odd). [1,1,2] s...
ALGO
0.997692
6.025762
fb04281e-7ebd-4f6e-bec6-b5fe374810cd
vaibhavgoyal0/codeforsomethinggood
PatternBasic1.cpp
#include<iostream> using namespace std; int main() { int r,c; cin >> r >> c; for (int i = 0; i < r; i++){ for (int j = 0; j < c; j++){ cout << "* "; } cout << endl; } }
ALGO
0.998897
3.857947
b8b0898b-2eee-416e-9a74-42bd1682056a
anmolchauhanji/DSA
array/missing_elem_by_xor.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: int missing(vector<int> &arr,int n) { int res =0; for (int i = 1; i < n; i++) { res+=(arr[i]^i); if (res!=0) { return i; } } } }; int main() { Solution s...
ALGO
0.999309
5.146891
9aa1f284-5c59-4b05-9088-f21fbdaf4f5c
pranjalcotra/ACC45DAYSOFCODE-2024
day 3.cpp
#include <iostream> #include <unordered_map> #include <string> using namespace std; int romanToInt(string s) { unordered_map<char, int> roman_values = { {'I', 1}, {'V', 5}, {'X', 10}, {'L', 50}, {'C', 100}, {'D', 500}, {'M', 1000} }; int total = 0; int prev_value = 0; for (int i =...
ALGO
0.998597
6.414548
286953b1-f893-416d-b776-6968a1e960a0
samkimuel/problem-solving
BaekjoonOJ/10866.cpp
/** * @file 10866.cpp * @brief 덱 - 라이브러리 * @author Sam Kim (<EMAIL>) */ #include <iostream> #include <deque> #include <string> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; deque<int> d; while (n--) { string str; ...
ALGO
0.99575
4.837431
c36fda00-9e76-4882-9cec-d8af1f6868ed
MeganVeitz/CSC_160_CPP
Lab_5/Equation_ex44.cpp
// Section CSC160 - Computer Science I: C++ // File Name: ex43.cpp // Student: Meg Veitz // Homework Number: Lab 5 // Description: The following function will use a, b, and c as the coefficients of a quadratic equation to compute b2 - 4ac. // This function calls on another function called get_a_b_c to get the values f...
ALGO
0.999654
3.687572
0f5e24f5-d720-420f-84b3-1add4d3793a4
abhidtu2014/competitive-programming
interviewbit/dynamic-programming/min-jumps.cpp
int Solution::jump(vector<int> &A) { int n = A.size(); if (n<=1) return 0; int ladder_end = 0; int jumps = 0; int max_position = 0; int stairs = 0; while(stairs<=ladder_end) { jumps++; while (stairs<=ladder_end) { ...
ALGO
0.999969
5.379219
96cc2509-7bf8-49f0-8987-87b27a1290f6
MingRuey/leetcode-practice
questions-tree/medium/144.binary-tree-preorder-traversal_byStack.cpp
/* * @lc app=leetcode id=144 lang=cpp * * [144] Binary Tree Preorder Traversal * * https://leetcode.com/problems/binary-tree-preorder-traversal/description/ * * algorithms * Medium (56.90%) * Likes: 2020 * Dislikes: 84 * Total Accepted: 588.9K * Total Submissions: 1M * Testcase Example: '[1,null,2,3...
ALGO
0.999974
7.099304
8c3a4c9a-00a8-41ab-983b-79411df016fb
albee/rattle-iros-2022
rattle_rrt/bullet3/src/Bullet3OpenCL/ParallelPrimitives/b3PrefixScanCL.cpp
#include "b3PrefixScanCL.h" #include "b3FillCL.h" #define B3_PREFIXSCAN_PROG_PATH "src/Bullet3OpenCL/ParallelPrimitives/kernels/PrefixScanKernels.cl" #include "b3LauncherCL.h" #include "Bullet3OpenCL/Initialize/b3OpenCLUtils.h" #include "kernels/PrefixScanKernelsCL.h" b3PrefixScanCL::b3PrefixScanCL(cl_context ctx, cl...
ALGO
0.888593
3.363814
97158735-32e8-458e-888e-380a46c9fbdb
Harsha1298/ds-algo
code&algo/GCD/delete-one-max-gcd.cpp
// Problem Statement: // Given an integer array A of size N. //You have to delete one element such that the GCD(Greatest common divisor) of the remaining array is maximum. // Approach: // Idea is to find the GCD value of all the sub-sequences of length (N – 1) // and removing the element which is not present in t...
ALGO
0.999919
5.723971
5788db29-b0da-48b3-8939-9a4914fe8965
0Loner/CompParalelayDistribuida
claseExample.cpp
#include <iostream> #include <chrono> #include <vector> using namespace std; void testByRows(int max, vector<vector<double>>& A, vector<double>& x, vector<double>& y) { for (int i = 0; i < max; i++) for (int j = 0; j < max; j++) y[i] += A[i][j] * x[j]; } void testByColumns(int max, vector<vect...
ALGO
0.990393
4.705359
9ce90692-8b40-4616-9964-1101cb07dff9
manojborugadda/Leetcode-questions
3170. Lexicographically Minimum String After Removing Stars/main.cpp
class Solution {//MIN HEAP with CUSTOM COMPARATOR public: //TC: O(nlogn) SC:O(N) typedef pair<char, int> pi; struct CustomComp { bool operator()(const pi a, const pi b) { if( a.first == b.first) { return a.second < b.second; } return a.first > b.firs...
ALGO
0.999969
4.67858
c54916d6-e1ae-4a6a-b210-d477c0cce93c
Shivk123/Leetcode-problems
387-FirstUniqueCharacterInAString/387-FirstUniqueCharacterInAString.cpp
// Last updated: 5/28/2025, 9:55:01 PM class Solution { public: int firstUniqChar(string s) { vector<int> count(26); for (const char c : s) ++count[c - 'a']; for (int i = 0; i < s.length(); ++i) if (count[s[i] - 'a'] == 1) return i; return -...
ALGO
0.999507
6.512016
cbaf1084-581d-4265-8214-841de24ab31c
Md-Merazul-Islam/XPSC-Batch-3
Weekly Task/8th week Supper XPSC/day-1/A_Divisible_Array.cpp
/**************بسم الله الرحمن الرحيم************* ***********************❀‿❀************************/ #include <bits/stdc++.h> using namespace std; #define PI 3.14159265359 #define dmin 1e-9 #define dd double #define ll long long #define pq priority_queue #define yes cout<<"YES\n" #define no cout<<"NO\n" #define pb p...
ALGO
0.99911
3.955788
ea479f57-3817-423c-92ad-e152c1dd2133
yaolili/algorithmHomework
communicateSystem/communicateSystem.cpp
#include <iostream> #include <cstdlib> #include <cstdio> #include <vector> #include <queue> #include <limits.h> #include <string.h> #include <algorithm> #define LOCAL using namespace std; //f[i][j]ʾǰi豸СΪjʱС۸ int f[103][2000]; int mi[103]; struct node { int b; int p; }; int main() { #ifdef LOCAL freop...
ALGO
0.997835
3.37428
57615aba-16cb-46b5-af3d-549b87ac008c
tjdlfgns1234/baekjoon
14938번 서강그라운드.cpp
#include<iostream> #include<list> #include<queue> using namespace std; #define MAX_VERTEX 20000 #define INF 987654321 struct Edge { int dir; int weight; }; list <Edge>* graph; int result = 0; int Max = 0; int value[MAX_VERTEX + 1] = { 0 }; int cost[MAX_VERTEX + 1] = { 0 }; bool visit[MAX_VERTEX + 1] = { fals...
ALGO
0.999977
3.717278
27d1c8f3-2417-4b00-b831-ac23e73b73a4
udit-panchal/DSA-CPP
Stack/13_celebrity_problem.cpp
#include <bits/stdc++.h> using namespace std; int celebrity(vector<vector<int>> &arr, int n) { stack<int> s; // push all candidate in stack for (int i = 0; i < n; i++) s.push(i); // find potential candidate while (s.size() > 1) { int a = s.top(); s.pop(); int b...
ALGO
0.99982
5.209992
ae799718-2a68-4627-b2f1-d7d1db9fc4eb
Wang-Ji20/pigskinjelly
src/problems/1343.大小为-k-且平均值大于等于阈值的子数组数目.cpp
#include "lc_common.hh" /* * @lc app=leetcode.cn id=1343 lang=cpp * * [1343] 大小为 K 且平均值大于等于阈值的子数组数目 * * https://leetcode.cn/problems/number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/description/ * * algorithms * Medium (68.98%) * Likes: 92 * Dislikes: 0 * Total Accepted: 4...
ALGO
0.999021
6.326493
e0e42e7f-9513-4f94-91bf-e28a55d9dc43
zhenqiufu/vrx_ws
src/multi_dp/third_party/eigen/failtest/jacobisvd_int.cpp
#include "../Eigen/SVD" #ifdef EIGEN_SHOULD_FAIL_TO_BUILD #define SCALAR int #else #define SCALAR float #endif using namespace Eigen; int main() { JacobiSVD<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10)); }
ALGO
0.910308
3.327923
c7c52883-11e5-449d-9220-7800a1630bca
morshed-seu/LeetCode
9.Palindrome-Number.cpp
class Solution { public: bool isPalindrome(int x) { if(x < 0)return false; string str, rts; x = abs(x); while(x){ str += (x % 10) + '0'; x /= 10; } rts = str; reverse(rts.begin(), rts.end()); return rts == str; } };
ALGO
0.999922
5.939147
54d118da-40a7-4aae-8164-20737dd54368
ishandutta2007/codeforces
gyh20/normal/1295/D.cpp
#include<bits/stdc++.h> #include<map> #define re register #define int long long using namespace std; inline int read(){ re int t=0,f=0; re char v=getchar(); while(v<'0')f|=(v=='-'),v=getchar(); while(v>='0'){ t=(t<<3)+(t<<1)+v-48; v=getchar(); } return f?-t:t; } #define LL long long LL num[110]; LL que[100010...
ALGO
0.999564
4.367961
46f9f0d0-145c-44d4-849f-1e46fd45e55d
wyllowyllo/Coding_Test_Problems
problems/Algorithm_Codes/Algorithm_Codes/Scripts/15595.cpp
#include <bits/stdc++.h> using namespace std; int n; int num, result, mem, exTime, lang, len; string id; map<string, int> m1; // {id, 틀린 횟수} map<string, bool> m2; //문제를 푼 사람들 vector<string> solver; //문제 푼 사람들 int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n; for (int i = 0; i < ...
ALGO
0.971228
4.231409
b51bc4dd-1b1c-44cb-aa98-15894d51df82
GrapheneOS-Archive/platform_frameworks_av
media/module/codecs/amrnb/dec/src/d3_14pf.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/d3_14pf.c Functions: decode_3i40_14bits Date: 01/28/2002 ------------------------------------------------------------------------------ REVISION HISTORY Description: Modified to place file in t...
ALGO
0.999728
6.111506
90809269-a69a-4c62-8958-17a30b727b3d
THA-chain/tha
src/test/util/mining.cpp
#include <test/util/mining.h> #include <chainparams.h> #include <consensus/merkle.h> #include <consensus/validation.h> #include <key_io.h> #include <node/context.h> #include <pow.h> #include <primitives/transaction.h> #include <test/util/script.h> #include <util/check.h> #include <validation.h> #include <validationint...
ALGO
0.982221
7.67519
0d4b07f4-3458-4db1-b8c6-ef372927515b
michaelrk02/toki-training
Ngoding-Seru-2019/Babak-1A/A/main.cpp
#include <iostream> #include <stdint.h> using namespace std; #define DUMP(_X) cout << #_X << ": " << (_X) << endl void getYBoundaries(int64_t px, int64_t py, int64_t x, int64_t& y1, int64_t& y2) { int64_t delta = x - px; y1 = py - delta; y2 = py + delta; } int main() { int64_t R, C, A, B, X, Y; ...
ALGO
0.999204
4.171782
df37a225-fff9-4478-be68-ef62c384122f
flutomax/nanobrot
nmblib/nmblib.cpp
// compile: // g++ -std=c++11 -Ofast -mfpmath=387 -march=native nmblib.cpp -lmpfr -lgmp -Wall -Wextra -pedantic -fopenmp #include <windows.h> #include "nmblib.h" #include "nmbimpl.h" HNmb nmb_create() { return new TNmb(); } void nmb_delete(HNmb _nmb) { _nmb->destroy(); } void nmb_calc(HNmb _nmb, void* owner, call...
TOOL
0.979357
4.387375
f2051318-1613-432b-80f9-4d81f709abfc
liuxuanhai/book-code
www.cplusplus.com-20180131/reference/bitset/bitset/reset/reset.cpp
// bitset::reset #include <iostream> // std::cout #include <string> // std::string #include <bitset> // std::bitset int main () { std::bitset<4> foo (std::string("1011")); std::cout << foo.reset(1) << '\n'; // 1001 std::cout << foo.reset() << '\n'; // 0000 return 0; }
TOOL
0.973091
6.551698
66c1a66b-8d9f-4959-a1bd-d0ba99d81c2b
VijayPandey08/LeetCode
322-coin-change/coin-change.cpp
class Solution { public: int solve(vector<int>& coins, int amount, int ans, vector<int>& dp) { if (amount == 0) { return 0; } if (dp[amount] != -1) { return dp[amount]; } int mini = INT_MAX; for (int i = 0; i < coins.size(); i++) { ...
ALGO
0.999968
5.790069
a9daea5f-faf4-4d0e-99ac-1c22bcbf1c33
elvircrn/ccppcodes
main (22).cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <vector> #include <string> #include <cstring> #include <cmath> #include <set> #include <functional> #include <climits> using namespace std; struct point { int x, y; point() { } point(int _x, int _y) { x = _x; y = _y; } point(b...
ALGO
0.999741
3.694688
99723888-47e3-40ca-8293-3d88efb9de7f
Sobachynska/Programming_C_labs
Lab02/Lab02-0401/Lab02-0401.cpp
#include <iostream> #include<cmath> using namespace std; int main() { setlocale(LC_CTYPE, "ukr"); float F; float a; cout << "Введiть a "; cin >> a; float b; cout << "Введiть b "; cin >> b; float c; cout << "Введiть c "; cin >> c; float x; cout << "Введiть x "; cin >> x; if ((x < 0 and b != 0)) { F = (...
ALGO
0.998867
3.754597
c377e60e-aa42-47ba-ae57-395ec90ca59c
Reddy-Sree217/Cpp-Practice
DynPro/HouseRobber_2.cpp
#include <bits/stdc++.h> using namespace std; int plan(vector<int> &nums, int index, int base, vector<int> &dp) { if (index == base) return nums[base]; if (index < base) return 0; if (dp[index] != -1) return dp[index]; int rob = nums[index]; if (index - 2 >= base) ro...
ALGO
0.999219
5.610594
d0048216-d7b6-4dca-83a0-c7002d7c3cc2
ishandutta2007/codeforces
qazswedx2/normal/1183/B.cpp
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; int n,m,a[100005],t; int main() { scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) scanf("%d",&a[i]); sort(a+1,a+n+1); if(a[n]-a[1]>2*m) { printf("-1\n"); continue; } printf("%d\n",a[1]+m); } r...
ALGO
0.999948
3.422802
9f7cc4a0-c164-4187-9c25-ae7307b39688
0nah1d/Code-Force
StringTask.cpp
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; for(int i=0; i<s.size(); i++) { s[i] = tolower(s[i]); if(s[i]=='a' || s[i]=='o' || s[i]=='y' || s[i]=='e' || s[i]=='u' || s[i]=='i') { continue; } else { ...
ALGO
0.998152
3.188597
81650c83-09c9-43bc-b575-cf7d83f3695c
healerXvivek/DSA
HASHING/array_subset_of_another_array.cpp
string isSubset(int a1[], int a2[], int n, int m) { unordered_map<int,int>mp; for(int i=0;i<n;++i) { mp[a1[i]]++; } for(int i=0;i<m;++i) { if(mp[a2[i]]==0) { return "No"; } mp[a2[i]]--; } return "Yes"; }
ALGO
0.999984
3.964955
c89fdcaa-4ba6-4064-b54d-013b613ed43d
Clarrynet/OpenGLShare
HelloWorld/cugl/src/math/CUMathBase.cpp
#include <cugl/math/CUMathBase.h> /** * Returns the power of two greater than or equal to x * * @param x The original integer * * @return the power of two greater than or equal to x */ int nextPOT(int x) { x = x - 1; x = x | (x >> 1); x = x | (x >> 2); x = x | (x >> 4); x = x | (x >> 8); ...
ALGO
0.980631
4.777709
e59636ad-1f27-4306-b034-0962b75dc3e1
abhinash1051/cpp
temp9.cpp
#include<iostream> using namespace std; template<class T> T addition(T num1,T num2) { return(num1 + num2); }; int main() { cout<<"sum of multiple addition parametr :: \n"; cout<<"\n ---------------------"; cout<<"\n addition of integar parameters :"<<addition<int>(10,20); cout<<"\n addition of flo...
TOOL
0.955773
4.467417
8a45d4a4-6946-4ea6-af26-dd26a29fedbf
Anon0/dalvik
vm/compiler/codegen/arm/GlobalOptimizations.cpp
#include "Dalvik.h" #include "vm/compiler/CompilerInternals.h" #include "ArmLIR.h" /* * Identify unconditional branches that jump to the immediate successor of the * branch itself. */ static void applyRedundantBranchElimination(CompilationUnit *cUnit) { ArmLIR *thisLIR; for (thisLIR = (ArmLIR *) cUnit->fir...
ALGO
0.987034
4.676143
aaf634d2-1e24-4f25-a7af-fd366f810670
Neonlab-kr/KGA_Homework
Homework/0726test3.cpp
#include <iostream> using std::cin; using std::cout; using std::endl; void main() { int myArray[10]; for (int i = 0; i < 10; i++) { myArray[i] = i + 1; } cout << "迭 "; for (int i = 0; i < 10; i++) { cout << myArray[i] << ' '; } cout << endl; cout << "¦ : "; for (int i = 1; i < 10; i += 2) { co...
ALGO
0.8567
3.19111
58f03693-8120-4aab-8c8b-93585735cdf4
abhandary/ProgrammingInterviewProblemSolutions
CPlusPlus/EPI/main.cpp
#include <iostream> #include <random> #include <iostream> #include <algorithm> #include <vector> #include <queue> using namespace std; struct IteratorCurrentAndEnd { public: vector<int>::const_iterator _current; vector<int>::const_iterator _end; bool operator<(const IteratorCurrentAndEnd& that) const...
ALGO
0.999838
4.190561
fc99a874-671c-45f2-843f-fbb986554e9b
antienclone/baitapchuong1ktlt
bai4.cpp
//#include<iostream> // //using namespace std; // //int sum (int a[5][6],int row,int culumn,int roworculumn,int number) { // int tong = 0; // if (roworculumn == 1) { // for (int i = 0; i < culumn;i++) { // tong+=a[number][i]; // } // } // if (roworculumn == 2) { // for (int i = 0; i < row; i++) { // tong += a[i]...
ALGO
0.97494
3.406332
b02ab46e-606d-4471-9320-a543db6cc169
djngalja/aoc-solutions
day14/day14_part1_2024.cpp
#include <iostream> #include <fstream> #include <cmath> // std::abs #include <cctype> // std::isdigit #include <string> #include <vector> int calc_safety_f(const std::vector<std::vector<int>>&, int, int, int); int predict_coord(int, int, int, int); std::vector<int> split_str(const std::string&); bool read_input(const ...
ALGO
0.996976
5.333381
694ec59b-6f4d-47f2-be38-cfef4e5a24e4
rauluranga/Cocos2dx-UIKit
cocos2d/extensions/Particle3D/PU/CCPUForceField.cpp
#include "CCPUForceField.h" NS_CC_BEGIN const Vec3 PUForceFieldCalculationFactory::DEFAULT_WORLDSIZE(500.0f, 500.0f, 500.0f); //----------------------------------------------------------------------- unsigned short PUForceFieldCalculationFactory::getOctaves(void) const { return _octaves; } //--------------------...
TOOL
0.94227
6.642299
2ddeac8c-1164-40c4-ab2e-5f8f00d91c70
Cheglockvvv/leetcode
1920. BuildArrayfromPermutation/main.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: static vector<int> buildArray(vector<int>& nums) { vector<int> ans(nums.size()); for (int i = 0; i < nums.size(); i++) { ans[i] = nums[nums[i]]; } return ans; } }; int main() { ...
ALGO
0.999979
5.622548
b5137b1f-b591-4997-b4ad-a604f14156f8
Joey-Yannuzzi/Q4GameMod
idlib/geometry/JointTransform.cpp
#include "../precompiled.h" #pragma hdrstop /* ============= idJointMat::ToJointQuat ============= */ idJointQuat idJointMat::ToJointQuat( void ) const { idJointQuat jq; float trace; float s; float t; int i; int j; int k; static int next[3] = { 1, 2, 0 }; trace = mat[0 * 4 + 0] + mat[1 * 4 + 1...
ALGO
0.985534
5.18517
cf594dc5-d161-4453-b9f6-e22db2b01e6a
SyedMa3/CP
A_Reverse.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define PI 3.1415926535897932384626 #define rep(n) for (int i = 0; i < n; ++i) #define repc(i, n) for (ll i = 0; i < n; i++) #define fore(i,x1,x2) for(ll i=x1; i<x2; ++i) #define pb push_back #define mp make_pair #define F first #define S second #define...
ALGO
0.999949
3.41824
2b558990-61be-493f-aa45-2a149c6c96f7
mwashief/step
Codeforces/1501-1750/1517/1517B.cpp
/* Washief Hossain Mugdho 23 April 2021 Codeforces 1517 1517B */ #ifndef DEBUG #pragma GCC optimize("Ofast") #pragma GCC optimization("unroll-loops, no-stack-protector") #pragma GCC target("avx,avx2,fma") #endif #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fr first #define sc...
ALGO
0.999737
4.162083
ef480d3e-b954-4796-890a-166e79aa3230
pwxcoo/accept
2018-12/2018-12-07/leetcode218.cpp
class Solution { public: vector<pair<int, int>> getSkyline(vector<vector<int>>& buildings) { vector<pair<int, int>> bs; for (auto building: buildings) { bs.push_back({building[0], -building[2]}); bs.push_back({building[1], building[2]}); } sort(bs.begin(), bs....
ALGO
0.999989
6.116383
77263ecc-5dba-4c4e-80c1-e69ea2ccafdf
Suraj-000/Code-Library
dlist.cpp
#include<iostream> using namespace std; class Node{ public: int data; Node* next; Node* prev; Node* getnewnode(){ Node* newnode=new Node(); int x; cout<<"enter the data"<<endl; cin>>x; newnode->data=x; newnode->next=NULL; newnode->prev=NULL;...
ALGO
0.999599
4.069349
395380db-4dc0-4918-a1f8-c3272c0998cf
vasukalariya/Must-Do-Coding-Questions-for-Companies-like-Amazon-Microsoft-Adobe-GFG
Linked List/rotate_a_linked_list.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node *next; Node(int x) { data = x; next = NULL; } }; Node *rotate(struct Node *head, int k); void printList(Node *n) { while (n != NULL) { cout<< n->data << " "; ...
ALGO
0.999924
5.620549
370a8824-d591-4301-84af-04831d106c6f
cechallenge/2025
llvm/compiler-rt/lib/tsan/rtl/tsan_md5.cpp
namespace __tsan { #define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) #define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y)))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | ~(z))) #define STEP(f, a, b, c, d, x, t, s) \ (a) += f((b), (c), (d)) + (x) + (t); \ (a) = (((a) << (s)) | (((a...
ALGO
0.998679
6.864769
2f092bdd-f4c5-4d9c-9b74-681f35ef38db
StanPlatinum/proofGen
clang/lib/Tooling/Refactoring/ASTSelection.cpp
#include "clang/Tooling/Refactoring/ASTSelection.h" #include "clang/AST/LexicallyOrderedRecursiveASTVisitor.h" #include "clang/Lex/Lexer.h" #include "llvm/Support/SaveAndRestore.h" using namespace clang; using namespace tooling; using ast_type_traits::DynTypedNode; namespace { CharSourceRange getLexicalDeclRange(Dec...
TOOL
0.920294
7.904453
1c80ae2f-8008-46c3-a451-1ca7ca801318
ishandutta2007/codeforces
andr0901/normal/1140/C.cpp
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; #define forn(i, s, f) for (int i = s; i < f; i++) #define ll long long #define pii pair <int, int> #define fs first #define sc seco...
ALGO
0.999955
3.671417
e0802c03-575e-409c-bb68-c35a117084d2
zarif98sjs/Competitive-Programming
CodeForces/GYM/AlgorithmsThread Tree Basics Contest/E (Filthy Rich Trees).cpp
/** Which of the favors of your Lord will you deny ? **/ #include<bits/stdc++.h> using namespace std; #define LL long long #define PII pair<int,int> #define PLL pair<LL,LL> #define F first #define S second #define ALL(x) (x).begin(), (x).end() #define READ freopen("alu.txt", "r", stdin) #define WRITE ...
ALGO
0.99983
4.275535
7e226a55-649b-4a9b-bda3-9c33eb162ac0
K14KHaNaSa/bojPractice
29732.cpp
#include <iostream> using namespace std; int main(void) { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, m, k; char r; int infested[10000]; bool origin[10000]; cin >> n >> m >> k; r = cin.get(); // \n for (int i = 0; i < n; i++) { r = cin.get(); r == 'R' ? origin[i] = true : origin[i]...
ALGO
0.999988
4.196947
71414b00-e03b-44c3-b51c-fc97e7a9b29c
MBMariana/face
modules/features2d/src/matchers.cpp
#include "precomp.hpp" #include <limits> #include "opencl_kernels_features2d.hpp" #if defined(HAVE_EIGEN) && EIGEN_WORLD_VERSION == 2 #include <Eigen/Array> #endif namespace cv { /////////////////////// ocl functions for BFMatcher /////////////////////////// #ifdef HAVE_OPENCL static void ensureSizeIsEnough(int row...
ALGO
0.943518
6.796435
0b8b4cbe-52bd-4ccc-8601-73304de88550
ishandutta2007/codeforces
shino16/normal/1360/F.cpp
#line 2 "C:/Users/W/c/lib/template.cpp" #ifndef LOCAL #pragma GCC diagnostic warning "-w" #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx") #endif #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <functional> #include <iostream> #include <map> ...
ALGO
0.999957
4.371731
a71e86de-4f02-471f-8a79-17b05483a597
Sriver27/DSA
0283-move-zeroes/0283-move-zeroes.cpp
class Solution { public: void moveZeroes(vector<int>& nums) { int i= 0; for(int j=0;j<nums.size();j++) { if(nums[j] != 0) // shift all non-zero elements to left and ignore all 0's { swap(nums[j],nums[i]); i++; } } ...
ALGO
0.999942
6.43676
080c5574-c439-4c8a-b437-a714014d2071
GDV-Proyectos3/Motor-Ola
MotorOla_Solution/Dependencies/PhysX-4.1/Src/physx/source/geomutils/src/intersection/GuIntersectionTriangleBox.cpp
#include "GuIntersectionTriangleBox.h" #include "GuIntersectionTriangleBoxRef.h" #include "CmMatrix34.h" #include "PsVecMath.h" #include "GuBox.h" #include "GuSIMDHelpers.h" using namespace physx; Ps::IntBool Gu::intersectTriangleBox_ReferenceCode(const PxVec3& boxcenter, const PxVec3& extents, const PxVec3& tp0, con...
ALGO
0.925882
7.775709
a40d9a66-5b72-47d8-9cd1-86c9ba030975
u-noob-i/contest
Codeforces/719 div3/A.cpp
#include<iostream> #include<string> #include<vector> #include<set> #include<map> #include<utility> #include<math.h> #include<cmath> #include<algorithm> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin>>t; while(t--) { int n; string s...
ALGO
0.999897
4.300416
f52f0a24-bf7d-4459-bdd3-9abc6e0106da
Abhinavpatel00/bgfx-sys
bgfx/3rdparty/meshoptimizer/src/indexcodec.cpp
#include <assert.h> #include <string.h> // This work is based on: // Fabian Giesen. Simple lossless index buffer compression & follow-up. 2013 // Conor Stokes. Vertex Cache Optimised Index Buffer Compression. 2014 namespace meshopt { const unsigned char kIndexHeader = 0xe0; const unsigned char kSequenceHeader = 0xd0;...
ALGO
0.971362
6.669989
dac9ccac-cc8b-43b7-9945-d0bfc0d2028d
geogao07/Comp371_ComputerGraphics
Assignment3/ThirdParty/FreeImage-3170/Source/FreeImageToolkit/MultigridPoissonSolver.cpp
#include "FreeImage.h" #include "Utilities.h" #include "ToneMapping.h" static const int NPRE = 1; // Number of relaxation sweeps before ... static const int NPOST = 1; // ... and after the coarse-grid correction is computed static const int NGMAX = 15; // Maximum number of grids /** Copy src into dst */ static inl...
ALGO
0.999894
5.573731
37482394-c53c-44a5-8d64-edc55dd71c43
Robin329/CPlusPlusThings
learn_algorithms/leetcode/algorithms/cpp/longestConsecutiveSequence/longestConsecutiveSequence.cpp
// Source : https://oj.leetcode.com/problems/longest-consecutive-sequence/ // Author : Hao Chen // Date : 2014-06-22 /********************************************************************************** * * Given an unsorted array of integers, find the length of the longest *consecutive elements sequence. * * For...
ALGO
0.999971
5.402537
e5dd84a3-c3f6-4064-badd-8927de1588ef
quanguo2088/Approaching-single-molecule-data-readout-for-DNA-Storage
PNC-LDPC_Encoding/src/R093_encode.cpp
#include <cstdlib> #include <cstdio> #include <cstring> #include "ldpc_codec.h" #define LDPC_K 29760 #define LDPC_N 32000 const char *enc_config_file = "./configure/R093.gen"; const char *ldpc_pchk_file = "./configure/R093.pchk"; const char *watermark_file = "./configure/PNseq_32000"; int main(int argc, char *arg...
DATA
0.918123
4.860211
6add35a3-7011-4f78-b8d2-ca60d76b1144
Justinshao33/competitive_programming
done/AtCoder/027_Sign_Up_Requests_2.cpp
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx,popcnt,sse4,abm") #include<bits/stdc++.h> using namespace std; #define ZTMYACANESOCUTE ios_base::sync_with_stdio(0), cin.tie(0) #define ll long long #define ull unsigned long long #define pb push_back #define all(a) (a).begin(), (a).end() #define debug(x) ...
ALGO
0.999828
4.531878
450f4402-7ec8-466b-bb72-3f711f4cf693
urielSilva/legendOfOguh
AndEngine/AndEnginePhysicsBox2DExtension-GLES2/AndEnginePhysicsBox2DExtension-GLES2/jni/Box2D/Collision/b2DynamicTree.cpp
#include "Box2D/Collision/b2DynamicTree.h" #include <cstring> #include <cfloat> using namespace std; b2DynamicTree::b2DynamicTree() { m_root = b2_nullNode; m_nodeCapacity = 16; m_nodeCount = 0; m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeN...
ALGO
0.998082
7.751198
adc88a03-5e0f-4497-b35d-5af26384d982
NAIMKHAN3/Mock-Contest-PSC
Mina_Moni.cpp
#include <bits/stdc++.h> using namespace std; int minDeferent(vector<int> &c, int n) { int sum = 0; for (int i = 0; i < n; i++) { sum += c[i]; } bool dp[n+1][sum / 2+1]; memset(dp, false, sizeof(dp)); dp[0][0] = true; for (int i = 0; i < n; i++) { for (int j = sum / 2; ...
ALGO
0.999882
4.570971
365143cd-3c00-40a5-ad82-a04179ec27ba
vaishnavikorde/CppPrograms
program479.cpp
#include<iostream> using namespace std; template <class T> class ArrayX { public: T *Arr; int iSize; ArrayX(int); ~ArrayX(); void Accept(); void Display(); bool LinearSearch(T); bool BidirectinalSearch(T); }; template <class T> ArrayX<T>:: ArrayX(in...
ALGO
0.999703
3.735721
f06bf834-fec1-4802-8d76-2655592c5dbc
Azhar2786/Leetcode_DailyChallange_Sol
December-daiy_question/Day21.cpp
//! 1637. Widest Vertical Area Between Two Points Containing No Points class Solution { public: int maxWidthOfVerticalArea(vector<vector<int>>& points) { vector<int> xPoints; for(auto point: points){ xPoints.push_back(point[0]); } sort(xPoints.begin(), xPoints.end()); int m...
ALGO
0.999923
5.687346
08e3716c-52ca-46da-9366-6e51843801d0
guswns8431/algorithm
boj/boj_2440v2.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < n - i; j++) { cout << "*"; } cout << "\n"; } return 0; }
ALGO
0.999839
4.109093
20d69231-6657-4fcb-b48d-e0b0004e35e0
mbrzecki/julian
src/mathematics/stochasticProcesses/hestonProcess.cpp
#include <mathematics/stochasticProcesses/hestonProcess.hpp> #include <mathematics/stochasticProcesses/cirProcess.hpp> #include <mathematics/distributions/gaussianRandomVariable.hpp> #include <cmath> #include <vector> namespace julian { /** * \brief Generates path * \param x0 initial_value Value of the proc...
ALGO
0.998136
5.283215
eeb32777-0ff6-4d34-819b-13b316d36cf0
javagovindsharma/leetscode
solution/2600-2699/2656.Maximum Sum With Exactly K Elements/Solution.cpp
class Solution { public: int maximizeSum(vector<int>& nums, int k) { int x = *max_element(nums.begin(), nums.end()); return k * x + k * (k - 1) / 2; } };
ALGO
0.999951
5.518792
725f9796-df61-4d04-a739-ac4aad685afd
jasmine217k/Leetcode-Tree-BST-Problems
235. Lowest Common Ancestor of a Binary Search Tree.cpp
class Solution { public: TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) { if(root==NULL) return NULL; if(root==p||root==q) return root; TreeNode *left=lowestCommonAncestor(root->left,p,q); TreeNode *right=lowestCommonAncestor(root...
ALGO
0.999977
5.928304
c3214d2b-6164-459d-b364-acd1746ed529
HONG-LOU/training
Daily_Training/23-4/6/b.cpp
#include <bits/stdc++.h> int main () { int n; std::cin >> n; std::vector<int> a(n); for (int i = 0; i < n; i++) { std::cin >> a[i]; } std::sort(a.begin(), a.end()); int mn = (int) 1e9; for (int i = 1; i < n; i++) { mn = std::min(mn, a[i] - a[i - 1]); } if (mn == 0) { std::cout << n << "\n"; } std...
ALGO
0.999805
3.731875
537326ca-1845-4965-8962-2c5ca1ccd265
master-hkshenoycse/CP
DailyPractice/20241015/LC_2938.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long class Solution { public: long long minimumSteps(string s) { ll n=s.size(),ans=0,pos=0; for(ll i=0;i<n;i++){ if(s[i]=='0'){ ans=ans+abs(i-pos); pos++; } } return a...
ALGO
0.999963
4.997683
aac6ca5c-3831-424c-93e5-63a6d2eb51c2
ThanhPhammmm/DSA_PTIT
2.CON2_/CON2_26.cpp
/*Done*/ #include <bits/stdc++.h> using namespace std; string result; void Backtracking(string S, int K){ if(K == 0){ return; } for(int i = 0;i < S.length() - 1;i++){ for(int j = i + 1;j < S.length();j++){ if(S[i] < S[j]){ swap(S[i], S[j]); if(S...
ALGO
0.999989
4.464791
194c9c45-aaba-4f84-b5d4-6ad5cc2a620b
raincross7/code-similarity
codes/train_code/problem102/problem102_109.cpp
#include<bits/stdc++.h> using namespace std; #define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++) #define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(),(a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int,int> #define priq...
ALGO
0.999655
3.699697
23ec7691-01ea-4b20-8fc1-098b0adaedf1
manishkandpal1/TLElvl1
02-09-22/1343A_Candies.cpp
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define int long long const int MOD = 1e9 + 7; const int INF = LLONG_MAX >> 1; signed main() { ios::sync_with_stdio(false); cin.tie(NULL); int t; cin>>t; while(t--){ int n; cin>>n; for(int k=2;k<1e8;k++){ int p=pow(2,...
ALGO
0.999959
4.663311