uuid
stringlengths
36
36
repo_name
stringlengths
5
123
relative_path
stringlengths
5
4k
content
stringlengths
33
2.85M
category
stringclasses
6 values
algo_rel_score
float64
0.85
1
quality_score
float64
3
8.76
c216f0d3-727e-47ee-9017-32ce70e07a50
Quadroue4/Algorithm
1644.cpp
//1644.cpp #include <iostream> #include <vector> using namespace std; int eratos[4000001]; int main(){ cin.tie(NULL); ios_base::sync_with_stdio(false); int N; cin >> N; vector<int> prime; long long num = N; fill(eratos,eratos+(num+1),1); eratos[0] = 0; for(int i=2;i<=num;i++){ ...
ALGO
0.999949
4.067562
e55adc50-1033-4689-8970-82db0c2ec8c1
dhrjsfud0522/Baekjoon
Baekjoon/9. 약수, 배수와 소수/2501.cpp
//https://www.acmicpc.net/problem/2501 #include <stdio.h> int main(){ int n, k, m; scanf("%d %d", &n, &k); for(int i = 1; i <= n; i++){ if(k == 0){ break; } if(n % i == 0){ k--; m = i; } } if(k == 0){ printf("%d", m); ...
ALGO
0.999996
4.619574
b4e1f192-fea2-4e2a-a0a6-0d1ed5dcb197
cvtrana/LeetcodeSolutions
0207-course-schedule/0207-course-schedule.cpp
class Solution { public: bool iscycle(vector<int> adj[],vector<int> &vis,int id){ if(vis[id]==1) return true; if(vis[id]==0){ vis[id]=1; for(auto edge : adj[id]){ if(iscycle(adj,vis,edge)) return true; } } ...
ALGO
0.999947
6.014703
b9d34287-37dc-4ef1-ab33-966c2459bc2b
hakkobun/K-R-Exercises-Solutions
testfileinput.cpp
#include<iostream> #include<map> #include<set> #include<stack> #include<queue> #include<vector> #include<algorithm> #include<string> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int x, y; cin >> x >> y; cout << x * y << endl; return 0; }
ALGO
0.995837
3.784249
51dbf224-3b6f-47a3-a1ab-7a7ce2090a6e
TanishqBhargava/Hackerearth
Basic Programming/Basics of Implementation/Roy and Coding Contest.cpp
/*========================*\ | ID: tanishqbhargava2509 | | LANG: C++ | \*========================*/ //Tanishq Bhargava #include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while(t--) { int N, M, T = 0, Ph = 0, Ch = 1; cin >> N >> M; int Pdh = M, Cdh = N - 1; while(Pd...
ALGO
0.999966
3.970426
0f7b1476-c475-4e6a-9668-3d607cbf373c
MouryaVishal/A2Z_Questions
15 Graphs [Concepts & Problems]/15.1 Learning/5 BFS.cpp
#include<bits/stdc++.h> using namespace std; 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), left(left), right(...
ALGO
0.999925
4.506581
bbbecf43-4715-4b75-aec7-1030da64e554
Ruchip16/Daily_DSA
509-fibonacci-number/509-fibonacci-number.cpp
class Solution { public: int fib(int n) { if(n==0) return 0; else if(n==1) return 1; else { return (fib(n-1)+fib(n-2)); } } };
ALGO
0.999988
5.773215
c3bd3020-0ff4-44c6-bb90-5631733ef2a9
alexandraback/datacollection
solutions_2464487_0/C++/wanbo/A.cpp
#include<map> #include<set> #include<ctime> #include<cmath> #include<queue> #include<stack> #include<bitset> #include<vector> #include<cstdio> #include<string> #include<cassert> #include<cstring> #include<numeric> #include<sstream> #include<iterator> #include<iostream> #include<algorithm> using namespace std; typedef l...
ALGO
0.999787
4.031629
1c44401c-ebbd-4c2f-aa04-b1dead2a99ce
zihanpeter/problems
P2860USACO06JANRedundantPathsG.cpp
#include <cstdio> #include <vector> using namespace std; const int N = 5e3 + 5; int n, m, timeStaff, dfn[N], low[N], g[N][N], g2[N][N], ans, leaves; bool vis[N]; void dfs(int x, int fa) { dfn[x] = low[x] = ++timeStaff; for (int i = 1; i <= n; ++i) { if (!g[x][i]) continue; int y = i; if (y == fa) contin...
ALGO
0.999906
4.59955
944366b1-1677-48df-8b23-40024c8f791b
alexcerezo/Programmation
Task 4/19.algorithm.cpp
// 19.algorithm.cpp // Alejandro Cerezo Contreras 12-10-2023 // Description #include <iostream> using namespace std; int main() { int n = 5, r; bool win; while (n<10) { cout << "Enter the number of objects (10 min): "; cin >> n; } while (n > 1) { cout << "Enter the numbe...
ALGO
0.998564
3.660689
67d4c1d0-373a-4b52-9a5b-17f3dd2e3a56
QuyDatSadBoy/DSA_Tong_Hop
CP_Challenge/so_hoc/G.cpp
#include <bits/stdc++.h> #define ll long long #pragma GCC optimize("Ofast") const ll mod = (ll)1e9 + 7; #define endl "\n" #define all(v) v.begin(), v.end() #define ms(a) memset(a, 0, sizeof(a)) #define faster() \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); u...
ALGO
0.999601
5.305269
c2c06f8d-d53d-4bfd-9075-5650fe56d5e0
zhiwei-c/Monte-Carlo-Path-Tracing
archive/src/ndfs/ggx.cpp
#include "ndf.hpp" #include "../math/coordinate.hpp" #include "../math/math.hpp" NAMESPACE_BEGIN(raytracer) void GgxNdf::Sample(const dvec3 &n, double alpha_u, double alpha_v, const dvec2 &sample, dvec3 *h, double *pdf) const { double sin_phi = 0.0, cos_phi = 0.0, alpha_2 = 0.0; if (alpha_u == alpha_v) {...
ALGO
0.997789
3.994322
a8c4c08b-2031-4fa3-a442-7d44db0b09c1
ghozt777/cp
practice/cpp/CN/2DArrays/main.cpp
#include<bits/stdc++.h> using namespace std ; #define fr(n , x) for(int x = 0 ; x < n ; x++) void Run() { // 2D arrays are internally stored as 1D array of size row x column // coversion of the 1D index from 2D index is done by the system // 2D index to 1D index conversion : cxi + j for (i,j) index where c denotes...
ALGO
0.999856
3.797814
d2ba74fc-5d9e-402e-80c8-f173a6cc3d1e
DarkKnight054/Lightoj_Solution
String/LIGHTOJ-1255.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <iostream> #include <bits/stdc++.h> using namespace std; #define ll long long #define dbg puts("Viva la vida") #define CHECK(x) cout << (#x) << " is " << (x) << endl; #define endl printf("\n") typedef map<int,int> mii; typedef map<string,int> msi; type...
ALGO
0.999625
3.892033
e5761851-5ffe-4286-a0ea-e6f4212fc159
Lophophora24/Quench_2.0
thirdparty/boost_1_82_0/libs/math/tools/bessel_derivative_append_negative.cpp
#include <fstream> #include <utility> #include <functional> #include <map> #include <vector> #include <iterator> #include <algorithm> #include <boost/multiprecision/mpfr.hpp> #include <boost/program_options.hpp> #include <boost/lexical_cast.hpp> #include <boost/math/special_functions/bessel.hpp> template <class T> T...
TOOL
0.892204
6.198708
9ce11f6f-c206-446a-9feb-31ec4003c2d3
vishalku03/POTD_Questions_2025
day_99/Number of Zero-Filled Subarrays.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: long long zeroFilledSubarray(vector<int> &nums) { long long ans = 0; long long num = 0; for (int x : nums) { if (x == 0) { num++; ...
ALGO
0.999962
6.184997
ca2aeb8e-e62b-4a8c-bed1-87b4caf3bc29
jm0nteiroz/CPPEXs
C04/C04EX04.CPP
//CO4EX04.CPP #include<iostream> using namespace std; int main(void) { int N, I = 1; long int FAT = 1; cout << "\nPrograma Fatorial\n"; cout << "\nFatorial de que valor: "; cin >> N; cin.ignore(80, '\n'); while (I <= N) { FAT *= I; I++; } cout << "\n"; cout << "Fatorial de " << N << "="...
ALGO
0.995605
3.731571
ba37bbdd-f121-46a8-b1ea-f90bda4a3da0
sqmedeiros/sblp2023-time-vs-energy
1084-Apartments/c++/fast/4774912.cpp
#include <bits/stdc++.h> #define loop(i,a,b) for(int i=a;i<b;i++) //#define local_test using namespace std; /* I/O template starts */ #ifdef local_test /* For Windows */ inline int getchar_unlocked() { return getchar(); } inline void putchar_unlocked(char _c) { putchar(_c); } inline void fputs_unlocked(char* ans,FILE...
ALGO
0.999931
3.331972
cae90195-62a6-4702-a593-b4d784b2a18c
prasachin/DSA
graph/primsAlgo.cpp
#include <bits/stdc++.h> using namespace std; /* TYPES */ #define ll long long #define pii pair<int, int> #define pll pair<long long, long long> #define vi vector<int> #define vll vector<long long> #define vs vector<string> #define vvll vector<vector<long long>> #define vpi vector<pair<int, int>> #define vpll vector<...
ALGO
0.999941
4.553798
808f0a59-d2f5-416c-a52c-bbdfaaf72245
ANKAN257/DSA-problems
cp Algo/sorting/quickSort.cpp
#include<bits/stdc++.h> using namespace std; int partionIng_theArray(int arr[],int left,int right){ //make strting pivot int pivot=arr[left]; int cnt=0; for(int i=left+1;i<=right;i++){ if(arr[i]<=pivot)cnt++;//count kr rhe hu ki pivot se kitna bad ahai } //pivot ko uske ...
ALGO
0.999989
5.150939
a077ae0a-f530-47f6-85c8-3a566bd8ab07
qiaozishun4/CSP2024_BJ
BJ-Senior/answers/BJ-S01166/duel/duel.cpp
#include <bits/stdc++.h> using namespace std; int const N=1e5+3; int a[N],n; int main() { freopen("duel.in","r",stdin); freopen("duel.out","w",stdout); scanf("%d",&n); for(int i=1;i<=n;++i) scanf("%d",&a[i]); sort(a+1,a+n+1); int i=1,j=2,cnt=0; while(i<=n && j<=n) { while(j<=n &&...
ALGO
0.9999
3.808407
0f39b935-7094-441c-a5fb-44866226ce3a
mdsoponabdullah/graph_BFS
is the graph bicolorable or Bipertite.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; const double PI = acos(-1); #define PB push_back #define gcd(a,b) __gcd(a,b) #define lcm(a,b) (abs(a*b)/gcd(a,b)) #define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); const int sz=20...
ALGO
0.999709
4.940081
63700db8-2e00-420a-81b5-f7c22697bb95
wx-chevalier/algorithm-examples
剑指 Offer/cpp/14_CuttingRope/CuttingRope.cpp
//================================================================== // ָOfferԹپͱ⡷ // ߣκ //================================================================== // 14 // ĿһΪnӣӼmΣmnn>1m1 // ÿεӵijȼΪk[0]k[1]k[m]k[0]*k[1]**k[m]ܵ // Ƕ٣統ӵij8ʱǰɳȷֱΪ233Σ // ʱõij˻18 #include <iostream> #include <cmath> // ====================̬滮=...
ALGO
0.999568
4.929978
4f1742fd-b8dd-4ec5-a08d-672e787d0d89
TKWebSE/AtCoder_Beginner_Contest
AtCoder Beginner Contest 394/explanations/B - cat_AnswerCopy.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0;i < (n);++i) int main() { int n; cin >> n; vector<string> s(n); rep(i,n) cin >> s[i]; sort(s.begin(),s.end(),[&](string a,string b){ return a.size() < b.size(); }); string ans; for(string ns : s) ans += ns; cout << ans <...
ALGO
0.999921
4.602777
212a2aaf-d5fe-4465-9277-e12627a02aed
OpenSees/OpenSees
SRC/system_of_eqn/linearSOE/diagonal/DistributedDiagonalSolver.cpp
// $Revision: 1.2 $ // $Date: 2005-06-20 21:35:18 $ // $Source: /usr/local/cvs/OpenSees/SRC/system_of_eqn/linearSOE/diagonal/DistributedDiagonalSolver.cpp,v $ // Written: fmk // Created: 05/05 // // What: "@(#) DistributedDiagonalSolver.C, revA" #include <DistributedDiagonalSolver.h> #include <DistributedDiagonalSOE...
ALGO
0.997839
5.349901
665c70ff-5837-4de8-9901-5cc7b3653de5
SujayVivek/Ok-lets-CP
CSES/Graphs/CourseScheduleInDegree.cpp
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define ff first #define ss second typedef vector<vector<long long>> vvi; typedef vector<long long> vi; #define int long long #define endl "\n" vvi g; vi vis; void Solve() { int n, m; cin >> n >> m; vector<vector<int>> g(n + 1); vecto...
ALGO
0.999996
4.633749
654be959-aff1-4dda-8a5e-d451b34e0913
shvmsh20/GFG_POTD
June 2024/Maximum Tip Calculator.cpp
long long maxTip(int n, int x, int y, vector<int> &arr, vector<int> &brr) { // code here vector<pair<int, int>> temp; for (int i = 0; i < n; i++) { int diff = abs(arr[i] - brr[i]); temp.push_back({diff, i}); } sort(temp.begin(), temp.end(), greater<pair<int, int>>()); long lo...
ALGO
0.999979
4.524826
73b3d56d-6288-4920-8310-c3771184d19c
fan-ziqi/rl_sar
src/rl_sar/library/thirdparty/Lite3_MotionSDK/lib/eigen3/bench/quat_slerp.cpp
#include <iostream> #include <Eigen/Geometry> #include <bench/BenchTimer.h> using namespace Eigen; using namespace std; template<typename Q> EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t) { return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized()); } template<typename Q> EIGEN_DONT_INL...
ALGO
0.998282
6.251058
71485317-f18a-4a59-b2b3-b2fc9a5a2253
zlldt/LintCode
未通过 sqrtx.cpp
class Solution { public: /* * @param x: An integer * @return: The sqrt of x */ int sqrt(int x) { // write your code here int sqrt_base=1; sqrt_base=x/2; while(x>4000000) sqrt_base=2000; while( sqrt_base*sqrt_base > x ) { sqrt...
ALGO
0.999959
5.127757
1d07d670-94e5-47e9-9d3b-b06f0cd2ccc2
ShohanNur/Data-Structure-and-Algorithm
Algorithm CSE237/Sorting Algorithms/mergeSort.cpp
#include<bits/stdc++.h> #define pb push_back #define pf push_front #define pi 2*acos(0.0) #define f first #define s second #define inf 1e18 #define mod 1000000007 #define all(x) x.begin(), x.end() #define rev(x) x.rbegin(),x.rend() #define spc(x) cout<<fixed<<setprecisio...
ALGO
0.999959
3.76238
06b4eb42-0d59-4c20-ad33-3d26f356319e
108-19/problem-solving-training
atcoder/phase1.1/2020-2021/154A.cpp
#include <bits/stdc++.h> using namespace std; int main (){ string s,t,u; int a,b; cin>>s>>t>>a>>b>>u; if(s==u) {a--;} else {b--;} cout<<a<<' '<<b<<endl; return 0; }
ALGO
0.993274
3.582141
10cf450a-8ac6-45c0-952f-37c7ae0bd37c
ygzaydn/Kattis
Kattis/Tais_Formula/taisformula.cpp
#include <iostream> using namespace std; int main(int argc, char **argv) { int number_of_samples; cin >> number_of_samples; double time[number_of_samples]; double sample[number_of_samples]; double output=0; for (int i=0;i<number_of_samples;i++){ cin >> time[i] >> sample[i]; } for (int i=0;i<number_of_sa...
ALGO
0.999779
4.567296
6c2aeefc-2073-4202-afc3-8e6a0d0fb38f
moveside/Baekjoon
baekjoon_code/13549.cpp
#include<bits/stdc++.h> using namespace std; int N, K; queue<int> qu; bool vis[100001] = { false, }; bool is_valid(int x) { if (x < 0 || x> 100000) return false; if (vis[x]) return false; return true; } void push_qu(int x) { if (!is_valid(x)) return; qu.push(x); vis[x] = true; if (x == 0) return; if (x < K)...
ALGO
0.999983
4.10536
1fba9521-3702-42e7-bbed-be18a9d1b6b9
Owmicron/CPStuff
Codeforces/YetAnotherYetAnotherTask.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #pragma comment(linker, "/stack:200000000") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=n...
ALGO
0.999898
4.011974
c0ca36c7-80b1-4700-a726-23d2c946530a
bruce1408/Alogrithm_Datastruct
Array/57_InsertInterval.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; /** * 57 区间插入,给定一个区间数组,按照第一个元素排列的有序区间。然后插入一个新的 * 区间,新的区间可能会和原来区间进行合并,所以最后返回这个区间 * */ /** * 方法 1,将整个区间分成3部分,前面没有交集部分,中间交集部分,后面没有交集部分 * 主要集中在中间产生交集的部分; * 设置一个i遍历扫描整个区间范围, * 如果是s[i][1] < t[0]没有交集 * 如果是s[i][0] <= t[1] 产生交集部分,更新t[0] 和t[...
ALGO
0.999931
4.623874
2b93344d-9a78-486d-b029-803802777f4d
tuck3rb/PictoApp
pictoapp/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.997411
6.76775
f0dda5f7-ca59-463d-a94a-88aa0071eb88
joaomarcostomaz/Posfix_infix-calculator
Posfix_infix calculator/src/Expression.cpp
#include "../include/Stack.hpp" #include <string> #include "../include/Expression.hpp" #include "../include/Node.hpp" #define MAX_TAM 10 using namespace std; //Construtor Expression::Expression(){ } //Função que lê e avalia se a expressão é válida e deve ser armazenada void Expression::read_infix_expression(string o...
ALGO
0.99015
4.706231
7b1de60b-b6ec-42e2-bd48-031eade14a17
hossamasaad/Problem-Solving
Hackerearth/Easy Sum Set Problem.cpp
/* * Author : Hossam Asaad */ #include <bits/stdc++.h> #include <iostream> #include <algorithm> #include <string> #include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #define ll long long #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define REP(i,n) for(ll i=0;i<(n);i++) #define FO...
ALGO
0.999967
3.556211
b34096dc-111a-4242-873e-55b2bd2dc4a9
karan-pawar-09/codeforces
C_Unlucky_7.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long string toOctal(int n) { string s; while(n) { s+=to_string(n%8); n/=8; } return s; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin>>n; int no=0; for(int j=1;j<=n;j++) { ...
ALGO
0.999382
3.995019
2c50a3cc-fde4-4a8b-983c-72325e2fa42c
kkpan11/apple-llvm-project
llvm/lib/MCA/Support.cpp
#include "llvm/MCA/Support.h" #include "llvm/MC/MCSchedule.h" #include <numeric> namespace llvm { namespace mca { #define DEBUG_TYPE "llvm-mca" ReleaseAtCycles &ReleaseAtCycles::operator+=(const ReleaseAtCycles &RHS) { if (Denominator == RHS.Denominator) Numerator += RHS.Numerator; else { // Create a com...
TOOL
0.879473
6.917248
647b1c56-cbd6-4075-9c6d-4f7582f887ae
crystax/android-vendor-boost-1-62-0
libs/date_time/example/posix_time/time_periods.cpp
/* Some simple examples of constructing and calculating with times * Returns: * [2002-Feb-01 00:00:00/2002-Feb-01 23:59:59.999999999] contains 2002-Feb-01 03:00:05 * [2002-Feb-01 00:00:00/2002-Feb-01 23:59:59.999999999] intersected with * [2002-Feb-01 00:00:00/2002-Feb-01 03:00:04.999999999] is * [2002-Feb-01 00:...
TOOL
0.947312
5.631301
e202f748-6f79-495a-bc1a-f5b3a5f33063
Rpetey317/taller1-worms
libs/box2d/testbed/tests/distance_test.cpp
#include "box2d/b2_distance.h" #include "test.h" class DistanceTest: public Test { public: DistanceTest() { { m_transformA.SetIdentity(); m_transformA.p.Set(0.0f, -0.2f); m_polygonA.SetAsBox(10.0f, 0.2f); } { m_positionB.Set(12.017401f, 0.13...
TEST
0.850675
7.456832
c645ae61-2d2c-47af-9b3c-bb1c16af8ad0
fakhrbasha/OOP
Template&This/Template.cpp
#include<iostream> using namespace std; template <class T> // T abs(T n){ // return (n<0) ? -n:n; // }; T Getmax(T a , T b){ T result; result=(a>b)?a:b; return result; }; int main(){ int i=5 , j=6 , k; long l=10 , m= 5 , n; k=Getmax<int>(i,j); n=Getmax<long>(l,m); cout << k <<endl; ...
ALGO
0.998216
3.601706
b324fa37-216e-46fd-ab48-cae52b2133b5
Rakib-RS/Algorithm-Data-structure
code/seive 3.cpp
#include<stdio.h> #include<iostream> #include<math.h> #define MAX 10000009 #define MAX_N 700000 using namespace std; bool flag[MAX]; int prime[MAX_N]; void sive() { int i,j,k,r,total=1; flag[0]=flag[1]=1; prime[total]=2; for(i=3;i<MAX;i+=2) { if(!flag[i]) { prime[++total...
ALGO
0.998413
3.542001
c08fab83-325e-4a4b-87a1-2e6fbf027118
Rtk100/DIAS-Summer-Internship
C++/D2-Branes/eigen/bench/perf_monitoring/gemvt.cpp
#include "gemv_common.h" EIGEN_DONT_INLINE void gemv(const Mat &A, Vec &B, const Vec &C) { B.noalias() += A.transpose() * C; } int main(int argc, char **argv) { return main_gemv(argc, argv, gemv); }
ALGO
0.908949
4.434121
6521c633-065c-47c5-bd79-0247abedfe89
raincross7/code-similarity
codes/train_code/problem446/problem446_212.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<vector<int>> G(n+1); for (int i=0; i<n; i++) { int u,k; cin >> u >> k; for (int j=0; j<k; j++) { int v; cin >> v; G[u].push_back(v); } } vector<int> c(n+1,-1...
ALGO
0.999936
3.871862
dad21431-8a12-4b04-bbde-e7e595927ff8
Anjali-225/CPP_A_Beginners
Challenges/Challenges/Letter_Pyramid_Final/main.cpp
#include <iostream> using namespace std; int main() { cout << "Please input a string: "; string user_input.; getline(cin, user_input); string padding (user_input.length(), ' '); for (int center {0}; center < user_input.length(); ++center) { cout << padding; for (int left {0}; l...
ALGO
0.997685
4.564516
ede4b58a-b0ef-4fd6-889e-458de3b8c2e4
ManasArora17/DATA-STRUCTURE-DS-
Graph/adjacency list.cpp
#include<iostream> #include<vector> using namespace std; int main(){ int V,E; cout<<"How many vertices are there in the Graph?"; cin>>V; cout<<"How many edges are there in the the Graph?"; cin>>E; vector<int>adjlist[V]; for(int i=0;i<E;i++){ int a,b; cout<<"Enter the end poin...
ALGO
0.99878
3.949122
59ae3b3c-d89c-4600-bf0e-a77035a77d9c
raincross7/code-similarity
codes/train_code/problem361/problem361_181.cpp
// abc055_c #include <bits/stdc++.h> #ifdef LOCAL #include "../cxx-prettyprint/prettyprint.hpp" #endif using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; #define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i)) #define REPN(i, m, n) for (int (i) = m ; (i) < (int)(...
ALGO
0.999928
3.261723
ee3e395b-54fe-412d-9006-d207ad1c5b01
mangosArchives/MangosTwo_Scripts_old
scripts/northrend/gundrak/boss_moorabi.cpp
/* ScriptData SDName: Boss_Moorabi SD%Complete: 20% SDComment: SDCategory: Gundrak EndScriptData */ #include "precompiled.h" #include "gundrak.h" enum { SAY_AGGRO = -1604011, SAY_QUAKE = -1604012, SAY_TRANSFORM = -1604013, SAY_SLAY_1 =...
TOOL
0.889819
6.857632
3a705c99-827d-4dd6-80d4-9f9a787da4ed
hi-mukul/computerNetwork
CRC/crc.cpp
#include <iostream> #include <string> using namespace std; string divide(string dividend, string divisor) { int n = divisor.size(); string temp = dividend; temp.append(n - 1, '0'); for (int i = 0; i < temp.size() - n + 1; i++) { if (temp[i] == '1') { for (int j = 0; j < ...
ALGO
0.999977
5.5511
75de16ad-3abb-480a-a00b-5d99806313a3
jrob00/box2d-test
box2d-test/libs/Box2D/Dynamics/Joints/b2LineJoint.cpp
#include <Box2D/Dynamics/Joints/b2LineJoint.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2TimeStep.h> // Linear constraint (point-to-line) // d = p2 - p1 = x2 + r2 - x1 - r1 // C = dot(perp, d) // Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1)) // = -dot(perp...
ALGO
0.998682
5.718181
4981cdea-5e7f-4a7d-a4f1-d1eb4a032ee0
tiwari-vinay/Data-Structures-and-Algorithms
Sorting/BubbleSort.cpp
#include<bits/stdc++.h> using namespace std; // In each iteration one element pops to the correct position // thats why its called bubble sort and sometime sinking sort // void BubbleSort(vector<int> &arr) // { // int n=arr.size(); // //we could introduce a variable swapped, which will be respo...
ALGO
0.999947
5.017862
95958646-4b13-43a5-91aa-6a7de1cbf58a
UtkarshTrivedi2934/Dynamic_Programming
DynamicProgramming/EditDistance.cpp
#include<iostream> using namespace std; int EditDist(string s,string t) { //Base case if(s.size() == 0 or t.size() == 0) return max(s.size(),t.size()); int count = 0; //Recursion if(s[0] == t[0]) return EditDist(s.substr(1),t.substr(1)); else { int a = EditDist(s.substr(1),t)...
ALGO
0.999992
4.309555
2ca104da-458b-4a10-bbe0-d3bf7007a0b6
chrishawking7281/sekcja4_restaurants
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
4b4986df-9405-4368-b89d-1ac76879b6ae
seunghyukcho/algorithm-problems-solved
codeforces/div2/583/C.cpp
#include <iostream> #include <string> using namespace std; int main() { int n; string s; cin >> n >> s; int pos = -1, st = 0; for(int i = 0; i < n; i++) { if(s[i] == ')' && !st) { pos = i; break; } else if(s[i] == ')') st--; els...
ALGO
0.999929
4.057511
914a866b-6158-4d79-b539-267c4fef4400
seongho-joo/PS_study
BOJ/1789.cpp
#include <iostream> using namespace std; typedef long long lint; int main() { lint s, n; cin >> s; for(lint i = 1;;i++) { if(s * 2 < i * i + i) { n = i - 1; break; } } cout << n << "\n"; return 0; }
ALGO
0.999184
3.218997
abc71307-63a9-456a-a3a2-a848805a6163
ishandutta2007/codeforces
reyna/normal/848/D.cpp
// In the name of God #include <iostream> #include <algorithm> #include <fstream> #include <vector> #include <deque> #include <assert.h> #include <queue> #include <stack> #include <set> #include <map> #include <stdio.h> #include <string.h> #include <utility> #include <math.h> #include <bitset> #include <iomanip> #incl...
ALGO
0.999989
4.252709
31133c00-1814-4a24-b1cf-1baf497c074a
ishandutta2007/codeforces
sunzh/normal/1178/F2.cpp
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<vector> #include<queue> #include<set> #define PII pair<int,int> #define mp make_pair #define pb push_back #define fi first #define se second using namespace std; inline int read(){ int x=0,f=1;char c=getchar(); while(c<'0'||c>'9') { if...
ALGO
0.999994
4.121627
895b0d60-b0ab-4715-bc8b-d29e85f0b636
ishandutta2007/codeforces
ylwang/normal/1343/E.cpp
#pragma GCC optimize(3, "Ofast", "inline") #include <bits/stdc++.h> #define start ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define ll long long #define int ll #define ls st<<1 #define rs st<<1|1 #define pii pair<int,int> #define rep(z, x, y) for(int z=x;z<=y;++z) #define com bool operator<(const node &b) u...
ALGO
0.999846
4.232835
6470761f-acf5-4bc5-9d37-a9674b329091
SHIVAM2255/AISSMS
LP5/hpc/with_time_min_max.cpp
#include <iostream> #include <omp.h> #include <vector> #include <climits> using namespace std; int main() { int n; cout << "Enter number of elements: "; cin >> n; vector<int> arr(n); cout << "Enter elements:" << endl; for (int i = 0; i < n; i++) { cin >> arr[i]; } int min...
ALGO
0.999753
5.314254
37785bc5-8a4a-48bb-8579-2d0e84a2f440
ikutoo/DataMining
test/main.cpp
#include <iostream> #include <fstream> #include <string> #include <vector> #include <algorithm> #include <stdlib.h> #include <cmath> using namespace std; #define ATTRIBUTE_NUM 3 //#define K 21 typedef struct { float attrs[ATTRIBUTE_NUM]; int label; } SData; typedef struct { float distance; int label; } SDistanc...
ALGO
0.996332
3.824797
150993d2-ccbb-4dbf-8220-51c644ded271
mijinko17/competitive-programming
Atcoder/ABC/155/e2.cpp
#include <bits/stdc++.h> typedef long long lint; using namespace std; int digit_sum(int x) { int res = 0; string s = to_string(x); for (auto e : s) { res += e - '0'; } return res; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } ...
ALGO
0.999892
3.612251
160e6cbb-f336-4b57-83a6-2ba70b9d4495
antoniak/PRI
lib/boost_1_67_0/libs/geometry/doc/src/examples/geometries/adapted/boost_range/sliced.cpp
// Boost.Geometry (aka GGL, Generic Geometry Library) // QuickBook Example //[boost_range_sliced //` Shows how to use a Boost.Geometry linestring, sliced by Boost.Range adaptor #include <iostream> #include <boost/geometry.hpp> #include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/geometries/po...
TOOL
0.853825
4.707787
b57d7a89-a253-4c79-bb5d-ee505f962714
ankushgarg1998/Competitive_Coding
practice-websites/data-structures-and-algos/Mathematics/assignment problem.cpp
// Branch and bound Algorithm - Assignment Problem. #include<iostream> #include<climits> #define loop(i, a, b) for(int i=a; i<b; i++) using namespace std; int n, m; int a[30][30]; struct format { int cost; int index; }; format func(int r, string s) { int minax = INT_MAX, minai = 0; string s_copy = s;...
ALGO
0.999942
4.143859
07bfb617-8ecc-4d2f-a14f-6250ce67842d
yjnnlee/Algorithm
solve/15886 내 선물을 받아줘2.cpp
#include <stdio.h> int n; char a[3000]; int main() { scanf("%d", &n); scanf("%s", a); int res = 0; for (int i = 0; i < n; i++) { if (a[i] == 'E' && a[i+1] == 'W') { res++; } } printf("%d", res); }
ALGO
0.999972
3.509473
bf67ce70-e149-4789-9e86-b58e67025f03
act1lazi0N/cPlusPlusInThePass
Teaser/mang1/05. Nhom 2/ants.cpp
#include<bits/stdc++.h> using namespace std; long long n,k,x,mx,d; /**********************/ int main() { freopen("ants.inp","r",stdin); freopen("ants.out","w",stdout); /**/ cin>>n>>k; for(long i=1;i<=n;i++) { cin>>x; if(x>0) { d=k-x; if(d>mx) mx=d; ...
ALGO
0.999913
3.766016
25b9b5fb-7cd0-426e-9974-841c0fe0040b
ordinary-developer/education
cpp/std-20/i_horton-beginning_cpp20/ch_21-concepts/ex_02.cpp
#include <iostream> #include <concepts> #include <ranges> #include <functional> #include <iterator> #include <vector> #include <cassert> using namespace std::ranges::views; template <std::forward_iterator Iterator, std::indirect_strict_weak_order<Iterator> Comparison> Iterator original_find_optimum(Iterato...
ALGO
0.9997
5.680667
d9f0b5a3-7b12-43b0-a6cb-eb65b1c9e9a4
Jaspreet-10/LeetCode
Nth catalan number - GFG/nth-catalan-number.cpp
// { Driver Code Starts //Initial template for C++ #include <boost/multiprecision/cpp_int.hpp> using boost::multiprecision::cpp_int; // https://www.geeksforgeeks.org/factorial-large-number-using-boost-multiprecision-library/ using namespace std; // } Driver Code Ends //User function template for C++ class Solution...
ALGO
0.999901
6.337526
499b9c93-f6d0-4f48-b4ca-f014bae18bf3
maahive-77/Complete-C-DSA-Course-Data-Structures-Algorithms-by-Maahi
lecture_04/patterns/05_pyramid_patterns/01_pyr_patterns.cpp
#include <iostream> using namespace std; int main() { int n = 4; for (int i = 0; i <= n; i++) { int num = 1; for (int j = 0; j <= n - i - 1; j++) { cout << " "; } for (int j = 0; j < i; j++) { cout << num; num++; } ...
ALGO
0.999923
3.429213
2ec624fd-a07e-45bc-942e-d378869ece37
gprs1022/100daysofcode
Day6-12/pattern2.cpp
#include<bits/stdc++.h> using namespace std; void print1(int n){ for(int i=0;i<n;i++){ for(int j=1;j<n;j++){ cout<<"*"; } cout<<endl; } } void print2(int n){ for(int i=0;i<n;i++) { for(int j=0;j>=i;j++) { cout<<"* "; } cout...
ALGO
0.999982
3.73179
4a36e0e5-3605-4d81-a747-dd021ad0720b
sinian666/codes_82_1
cpp_副本23/chapter_hashing/array_hash_map.cpp
/** * File: array_hash_map.cpp * Created Time: 2022-12-14 * Author: msk397 (<EMAIL>) */ #include "../utils/common.hpp" /* 键值对 int->String */ struct Entry { public: int key; string val; Entry(int key, string val) { this->key = key; this->val = val; } }; /* 基于数组简易实现的哈希表 */ class A...
TOOL
0.900931
5.642146
2f8f766e-4323-42c0-a166-a8b033829ad0
liam-lemonade/doubletap_checker
main.cpp
#include <iostream> #include <Windows.h> #include <vector> class c_key { public: char name; bool can_press; int vk_code; uint64_t last_pressed; c_key(char name) { this->name = name; this->vk_code = VkKeyScanExA(name, GetKeyboardLayout(NULL)); this->last_pressed = GetTickCount64(); this->can_press = true;...
TOOL
0.950224
6.61228
e8574aa1-da9b-4b53-ae18-32f6fa2bc8a7
klasdfiz/leetcode
palindrome_number_9.cpp
#include <iostream> using namespace std; class Solution { public: bool isPalindrome(int x) { if (x < 0) return false; if (x <= 9) return true; int top_digit = 1; while (top_digit <= (x / 10)) top_digit *= 10; while (x) { if ((x / top_digit) != (x % 10)) return false; x = (x % top_digit...
ALGO
0.999294
4.809438
f5e51af0-7497-4df8-b9ac-c18b46601471
ilksh/LeetCode
Medium/0287. Find the Duplicate Number.cpp
#include<bits/stdc++.h> using namespace std; class Solution { private: const int MAX_N = 1e5 + 1; public: int findDuplicate(vector<int>& nums) { bool used[MAX_N]; memset(used, false, sizeof(used)); int ans = -1; for (auto num: nums) { if (used[num]) { ...
ALGO
0.999942
5.146273
0c3b0d00-77b3-4727-8297-bf644a1a4e78
akshita1204/gfg160
LinkedList/Day69.cpp
//{ Driver Code Starts #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; /* Linked list Node */ struct Node { int data; struct Node* next; Node(int x) { data = x; next = NULL; } }; Node* buildList() { vector<int> arr; string input;...
ALGO
0.998146
6.970125
7f3ae5a0-34c2-4c51-be17-cc96babde729
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_589_5.cpp
#include <bits/stdc++.h> using namespace std; const int N = 300000 + 100; const int oo = 1e9; int n, q; int gcd(int a, int b) { return !b ? a : gcd(b, a % b); } struct line { int a, b, c; line() {} line(int x1, int y1, int x2, int y2) { a = y1 - y2; b = x2 - x1; c = x1 * y2 - x2 * y1; int g = gcd(...
ALGO
0.999943
4.475367
4aa7e6a2-968d-41bd-bcdf-5be7db3b0f3b
gersteinlab/MolLM
downstream/graph-transformer/fairseq/clib/libbase/balanced_assignment.cpp
/* C++ code for solving the linear assignment problem. Based on the Auction Algorithm from https://dspace.mit.edu/bitstream/handle/1721.1/3265/P-2108-26912652.pdf and the implementation from: https://github.com/bkj/auction-lap Adapted to be more efficient when each worker is looking for k jobs instead of 1. */ #include...
ALGO
0.999268
7.176435
d19e9340-eb45-43fb-9f80-d816b7ef7117
VAK314/calc_distr
cl_cl.cpp
#include "cl_cl.h" #include <fstream> #include <string.h> #include <math.h> #include <stdio.h> #include <openssl/ecdsa.h> #include <openssl/ec.h> // for EC_KEY definition #include <openssl/obj_mac.h> #include <openssl/bn.h> #include <openssl/sha.h> #include <openssl/ripemd.h> using namespace std; long long TimeVal...
TOOL
0.876954
3.167465
58c119f0-5171-4d31-a630-c969e5dcb7bd
mick909/topcoder
srm/SRM579/PrimalUnlicensedCreatures.cpp
#include <cstdio> #include <cstdlib> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> #include <climits> #include <cfloat> #include <ctime> #include <map> #include <utility> #include <set> #include <memory> #include <functional> #include <sstream> #include <complex> #include...
ALGO
0.999677
4.267524
ffe0d08d-abee-4134-8bea-981ce776b39e
Rishika-05/DSA-GFG
LinkedList/CDLL.cpp
#include <bits/stdc++.h> using namespace std; struct Node { int data; Node *next; Node *prev; Node(int x) { data = x; next = NULL; prev = NULL; } }; void PrintCDLL(Node *head) { if (head == NULL) cout << head; Node *ptr = head; do { cout ...
ALGO
0.999296
4.920406
08b1c090-d963-44f7-9038-509b4d075bb4
piyushsir/DSA-
DSA/insertionsort.cpp
#include<bits/stdc++.h> using namespace std; void is(int arr[],int n) { for(int i=1;i<n;i++) { int current=arr[i]; int j=i-1; while(arr[j]>arr[j+1]) { arr[j+1]=arr[j]; j--; } arr[j+1]=current; } } int main() { int arr[]={2,1,3,4,3,8...
ALGO
0.999985
4.273365
2ee9d184-5d58-49e6-a283-872444e58542
Verlihub/verlihub
src/cdcclients.cpp
#include "cdcclients.h" #include "cconfigitembase.h" #include "cserverdc.h" #include "cpcre.h" #include "i18n.h" namespace nVerliHub { using nUtils::cPCRE; using namespace nEnums; cDCTagParser cDCClients::mParser; cDCTagParser::cDCTagParser() { /* 0 - whole chunk 1 - whole prefix 2 - id in prefix 3...
TOOL
0.925595
4.958564
0107e337-4cf3-4629-9ec8-282ad9687401
charumittal12/75dayscodechallenge
day1/remove_spaces.cpp
#include<iostream> #include<string.h> using namespace std; int main(){ string str; string k; getline(cin,str); for(int i=0;i<str.length();i++){ if(str[i]==' '){ continue; } else{ k=k+str[i]; } } cout<<k; return 0; }
ALGO
0.99915
3.41402
1619986e-0de7-4ba9-b165-2263becebb04
OTOY-NZ/OctaneBlender
blender/extern/bullet2/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp
#if defined(_WIN32) || defined(__i386__) #define BT_USE_SSE_IN_API #endif #include "btMultiSphereShape.h" #include "BulletCollision/CollisionShapes/btCollisionMargin.h" #include "LinearMath/btQuaternion.h" #include "LinearMath/btSerializer.h" btMultiSphereShape::btMultiSphereShape(const btVector3* positions, const bt...
TOOL
0.939185
7.286428
6ab1e95a-d0db-4e8d-9c8b-3ac467100841
ishandutta2007/codeforces
ffao/normal/425/E.cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <stack> #include <bitset> #include <algorithm> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> ...
ALGO
0.999954
3.616139
08aa37ed-4831-41c7-b370-3ac55c5f5726
rohit-sa/image_processing
otsu/otsu.cpp
#include <iostream> #include <opencv2/highgui/highgui.hpp> #include <opencv2/core/core.hpp> #include <opencv2/imgproc/imgproc.hpp> using namespace std; using namespace cv; int main(){ //init double t = (double)getTickCount(); Mat im, colorMat; string path = "/home/r/Documents/C++ Projects/corner/output.png"; f...
ALGO
0.994631
4.829312
0db67f97-b56d-42d6-8a72-978e066f0d78
TheDev05/CARDIO
Domains/UnCategorized/LC904.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; std::cin >> n; std::vector<int> num(n); for (auto &i : num) std::cin >> i; std::map<int, int> data; int res = 0, index = 0; for (int i = 0; i < num.size(); i++) { data[num[i]]++; while (data.si...
ALGO
0.999872
4.15868
4f34e9af-9977-45a8-8ec4-295c01f8a1f7
gh4abhi/A2Z-DSA-Sheet
Step 6 Learn LinkedList [Single LL, Double LL, Medium, Hard Problems]/Lec 1 Learn 1D LinkedList/Find the length of the linkedlist [learn traversal].cpp
// Problem Link - https://www.geeksforgeeks.org/problems/count-nodes-of-linked-list/0 #define ll int class Solution { public: // Function to count nodes of a linked list. int getCount(struct Node* head) { ll ans = 0; while(head->next) ans++, head = head->next; return ans+...
ALGO
0.999853
5.4041
371efff6-ac24-45bc-8daa-df3a578ad915
tonyli00000/Competition-Code
USACO/nuggets/nuggets/nuggets.cpp
/* ID: tonyli21 PROG: nuggets LANG: C++ */ #include<iostream> #include<cstdio> #include<cstring> #include<string> #include<algorithm> #include<cmath> using namespace std; int n; bool dp[1000000]; int rec[20]; int gcd(int a, int b){ return b ? gcd(b, a%b) : a; } int main(){ freopen("nuggets.in","r",stdin); freopen("n...
ALGO
0.999943
3.730787
616d864c-12a4-49fd-b525-ae33a98ffa0c
randcd-APY/QuectelShare
OTA/system/extras/simpleperf/utils.cpp
#include "utils.h" #include <dirent.h> #include <errno.h> #include <fcntl.h> #include <stdarg.h> #include <stdio.h> #include <sys/stat.h> #include <unistd.h> #include <algorithm> #include <map> #include <string> #include <android-base/file.h> #include <android-base/logging.h> void OneTimeFreeAllocator::Clear() { ...
TOOL
0.870437
6.347557
9aa09630-20d1-4a2b-a5fa-fe4432963a16
TRDizer/CSC417_rigid-body-collision
extern/libigl/include/igl/mosek/bbw.cpp
template < typename DerivedV, typename DerivedEle, typename Derivedb, typename Derivedbc, typename DerivedW> IGL_INLINE bool igl::mosek::bbw( const Eigen::PlainObjectBase<DerivedV> & V, const Eigen::PlainObjectBase<DerivedEle> & Ele, const Eigen::PlainObjectBase<Derivedb> & b, const Eigen::PlainObject...
ALGO
0.999073
6.080972
75474f90-802b-4910-b0d0-c72193c77d09
darkshuige/codecode
c code/1127.cpp
#include<bits/stdc++.h> using namespace std; int main() { string s; while(cin>>s) { stringstream ss; ss<<s; double a[200]={0}; double sum=0,num; int pos=1; ss>>num; a[0]=num; char op; int flag=1; while(ss>>op>>num) { if(op=='+') { a[pos++]=num; } else if(op=='-') { a[pos+...
ALGO
0.999651
3.564489
e5fed61e-c604-4b5a-a438-a4b486a84486
PeisenWong/tensorrtx
dbnet/dbnet.cpp
#include <iostream> #include <chrono> #include "cuda_runtime_api.h" #include "logging.h" #include "common.hpp" #include <math.h> #include "clipper.hpp" #define USE_FP16 // comment out this if want to use FP32 #define DEVICE 0 // GPU id #define EXPANDRATIO 1.5 #define BOX_MINI_SIZE 5 #define SCORE_THRESHOLD 0.3 #defi...
DATA
0.9316
3.171835
fc35f7c4-f60c-4094-9d93-778718fd988c
tlim8772/Kattis
solved/FindMyFamily.cpp
#include <set> #include <vector> #include <iostream> using namespace std; // all heights are distinct // iterate through every idx 0 to n - 1 // for each nums[i], check to the left, the smallest heigh greater than nums[i] // and to the right, the greatest value bool solve(vector<int> & nums) { set<int> left; ...
ALGO
0.99978
3.863498
9ac3d4d9-36ce-4b06-a8dc-631d47581ec4
doubley318/LeetCode
Cpp/153.寻找旋转排序数组中的最小值.cpp
/* * @lc app=leetcode.cn id=153 lang=cpp * * [153] 寻找旋转排序数组中的最小值 */ // @lc code=start class Solution { public: int findMin(vector<int> &nums) { int l = 0, r = nums.size() - 1, m; while (l < r) { m = (l + r) / 2; if (nums[m] > nums[r]) l = m + ...
ALGO
0.999983
6.823551
881983c8-16ce-46d7-92d6-3bdd638961e6
RiccardoBravin/Collection-of-exercises
C++ exercises/palindromo/palyndrome2.cpp
#include <iostream> #include <cstring> using namespace std; bool is_palindrome(const char s[], int length); int main(){ char s1[] {'b', 'e', 'l', 'l', 'a', ' ', 'a', ' ', 't', 'u', 't', 't', 'i', '\0'}; char s2[] {'c', 'i', 'a', 'o', ' ', 'a', 's', ' ', 'o', 'a', 'i', 'c', '\0'}; char s3[] {'a', 's', 'd'...
TEST
0.897974
3.935871
3d5e7a65-93e3-484b-afe6-6e9f27468159
snichols/boost_1_61_0
libs/graph/example/bellman-ford-internet.cpp
int main() { using namespace boost; // ID numbers for the routers (vertices). enum { A, B, C, D, E, F, G, H, n_vertices }; const int n_edges = 11; typedef std::pair < int, int >Edge; // The list of connections between routers stored in an array. Edge edges[] = { Edge(A, B), Edge(A, C), Edge(B...
ALGO
0.999722
4.852907
e654b73d-7be1-48df-9e25-0545042c0caa
codicm/gem
src/systemc/tests/systemc/misc/unit/data/datawidth_unsigned/extension/datawidth.cpp
/***************************************************************************** datawidth.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /**************************************************************************...
ALGO
0.965087
5.331775
16d46332-bb48-48c3-9a5a-aa1bfd3c58ba
Illusion0-0/LCBase
2938-separate-black-and-white-balls/2938-separate-black-and-white-balls.cpp
class Solution { public: long long minimumSteps(string s) { int o=0; for(char c:s){ if(c=='0')o++; } long sum=0; for(int i=0;i<s.length();i++){ if(s[i]=='1'){ sum+=(o-i); o++; } } return s...
ALGO
0.999959
5.930235