uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
0bd33266-6241-4213-a1cc-0bee86bda118
Arham811813/Arham811813
week 06/Day 01/A_Segment_Tree_for_the_Sum.cpp
#include <bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #define nl '\n' #define nel cout<<nl #define ll long long using namespace std; using namespace __gnu_pbds; template <typename T> using pbds = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>...
ALGO
0.999586
4.771947
b133f907-6f9e-4117-b6bb-5239f499da62
raincross7/code-similarity
codes/train_code/problem115/problem115_35.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int S,W; cin >> S >> W; if(S<=W){ cout << "unsafe" << endl; } else{ cout << "safe" << endl; } }
ALGO
0.999201
3.765071
c05fa3f1-e0b5-42c0-9133-29c5874c5318
yebinhi/LeetcodePractice
valid-palindrome/Wrong Answer/7-5-2016, 1:39:43 PM/Solution.cpp
// https://leetcode.com/problems/valid-palindrome class Solution { public: bool isPalindrome(string s) { if(s.size()<=0) return true; int E=s.size()-1, S=0; while(S<E){ while(S<s.size()-1 && !isalnum(s[S])) S++; while(E>0 && isalnum(s[E])) E--; i...
ALGO
0.999904
6.738188
2268256d-5b95-4a42-b626-73bfd8ff4610
anwz1126/GAMES202
Assignment2/prt/ext/eigen/doc/examples/Tutorial_BlockOperations_print_block.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; int main() { Eigen::MatrixXf m(4,4); m << 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12, 13,14,15,16; cout << "Block in the middle" << endl; cout << m.block<2,2>(1,1) << endl << endl; for (int i = 1; i <= 3; ++i) { cout << "B...
ALGO
0.98879
3.6853
ba97bfd8-713c-403d-a306-143aca8942c9
VikasKumarRoy/Leetcode
Problem-152.cpp
// Problem - 152 // https://leetcode.com/problems/maximum-product-subarray/ // O(n) time complexity and O(1) space complexity solution class Solution { public: int maxProduct(vector<int>& nums) { int g_max = INT_MIN; int mx = 1, mn = 1; int n = nums.size(); for(int i = 0; i < n; i...
ALGO
0.999994
6.337928
8e794d5c-02bd-4920-9ffe-96eb13a1788f
Jaswantchaudharygla/assignment
4. C program to convert days in to years, weeks and days.cpp
#include <stdio.h> int main() { int days, years, weeks; printf("Enter the number of days: "); scanf("%d", &days); years = days / 365; weeks = (days % 365) / 7; days = (days % 365) % 7; printf("Years: %d\n", years); printf("Weeks: %d\n", weeks); printf("Days: %d\n", days); re...
ALGO
0.996711
3.355947
4ffbe230-3518-45f7-9297-597b92506c1a
IamDikshaR/coding-exercises
Running_sumArray.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cout<<"Enter size of array-"; cin>>n; int nums[n]; for(int i=0; i<n; i++){ cin>>nums[i]; } int ans[n]; int sum=0; for(int i=0; i<n; i++){ ans[i]=sum+nums[i]; sum=ans[i]; } cout<<"Running Sum array- "; for(int i=0; i<n; ...
ALGO
0.999495
3.862982
722125b9-f5d6-4223-8b47-af0b8025bfbb
sandeep62/leetcode-problems
138-copy-list-with-random-pointer/copy-list-with-random-pointer.cpp
/* // Definition for a Node. class Node { public: int val; Node* next; Node* random; Node(int _val) { val = _val; next = NULL; random = NULL; } }; */ class Solution { public: Node* copyRandomList(Node* head) { if (head == NULL) return NULL; // creat...
ALGO
0.998809
5.262799
b11dc366-5a0f-4bf4-b7af-2b051d17bd62
Nikitiwe/Leetcode
2412-minimum-amount-of-time-to-fill-cups/2412-minimum-amount-of-time-to-fill-cups.cpp
class Solution { public: int fillCups(vector<int>& nums) { sort(nums.rbegin(), nums.rend()); int ans=nums[0], t=nums[1]+nums[2]-nums[0]; if (t>0) { ans+=t/2; if (t%2==1) ans++; } return ans; } };
ALGO
0.999977
5.857208
27a9e0cb-dd0d-4c72-8dfd-45d84e4bc68d
wilinz/aimigo
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.99887
6.783439
0bd2987e-299b-495c-af49-f7f285d793b0
nkp1729/CarND-Path-Planning
src/Eigen-3.3/doc/examples/TutorialLinAlgRankRevealing.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix3f A; A << 1, 2, 5, 2, 1, 4, 3, 0, 3; cout << "Here is the matrix A:\n" << A << endl; FullPivLU<Matrix3f> lu_decomp(A); cout << "The rank of A is " << lu_decomp.rank() << endl; c...
ALGO
0.999647
3.725084
5623952d-433f-4024-8733-23f22e86730f
sky-bro/AC
leetcode.com/0805 Split Array With Same Average/main.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; // TLE // ref: // https://leetcode.com/problems/split-array-with-same-average/discuss/120667/C%2B%2B-Solution-with-explanation-early-termination-(Updated-for-new-test-case) class Solution { private: int n; bool ch...
ALGO
0.999514
5.822187
75454749-7368-45b1-8497-e5e4223b418e
AshwiniTokekar/Codes
SPOJ/programs/PERMUT2.cpp
# include <iostream> using namespace std; long int A[100001],B[100001]; int main () { long int size; int flag=0; do { flag=0; cin>>size; if(size==0) break; for(int i=1;i<=size;i++) { cin>>A[i]; B[A[i]]=i; if(B[i]!=A[i]) flag...
ALGO
0.997702
3.365135
7442b4dc-c054-49c5-92f2-980a9b834c8a
ratulhasan001/XPSC
Week 6/S_Odd_GCD_Permutation.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; const char nl= '\n'; int GcdOfArray(vector<int>& arr, int idx) { if (idx == arr.size() - 1) { return arr[idx]; } int a = arr[idx]; int b = GcdOfArray(arr, idx + 1); return __gcd(a, b); } int32_t main() { ios_base::sync_w...
ALGO
0.999815
5.570502
aac74516-e740-4674-b42e-a94a7a0cf4d6
sjtu-imperishable-night/code-library
Template/Template of Other Teams/Spear-of-Longinus/template/SCL_zky/number-theory/miller-rabin.cpp
const int BASE[12] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37}; bool check(long long n,int base) { long long n2=n-1,res; int s=0; while(n2%2==0) n2>>=1,s++; res=pw(base,n2,n); if((res==1)||(res==n-1)) return 1; while(s--) { res=mul(res,res,n); if(res==n-1) return 1; } ...
ALGO
0.999666
3.384179
6fa53c3e-351f-405b-a92e-8f75f597e75c
Chinmay8897/A2Z_CPP
Arrays/Hard/pascals_triangle.cpp
class Solution { public: vector<int> generateRow(int row){ long long ans=1; vector<int> ansRow; ansRow.push_back(1); for(int col=1;col<row;col++){ ans*=(row-col); ans/=col; ansRow.push_back(ans); } ...
ALGO
0.999974
5.061402
91638eed-0ffc-4cd6-9859-035b0af7bbfc
jewelzqiu/opencv-android-library
opencv_contrib/modules/reg/src/mappergradsimilar.cpp
#include "precomp.hpp" #include "opencv2/reg/mappergradsimilar.hpp" #include "opencv2/reg/mapaffine.hpp" namespace cv { namespace reg { //////////////////////////////////////////////////////////////////////////////////////////////////// MapperGradSimilar::MapperGradSimilar() { } /////////////////////////////////////...
ALGO
0.997638
6.381015
e2e9025a-daf8-4fdb-975a-5b28363c47ca
jki14/competitive-programming
2010/ascw10/proH/src/proH.cpp
#include <iostream> #include <sstream> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <climits> #include <algorithm> using namespace std; const int maxn=55,maxm=110; int n,sh,ss,sp,sm; int f[maxn][maxn][maxm]; int ms[maxn],mp[maxn],mm[maxn]; bool d[maxn][maxn][maxm]; void output(cons...
ALGO
0.998745
3.528509
ab46ac38-47f9-46d1-b194-edd7f25e86f5
ValentinMalassigne/Learning_Flutter_Bloc
Bloc_Overview/3_communication_between_cubits_and_blocs/cubit_to_cubit_stream_subscription/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.997999
6.785645
29338ea3-c2f9-4bd8-806e-45738fc68653
Sobeit-Tim/PS
c/15651.cpp
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> #include <map> using namespace std; int N, M; int arr[9] = {0, }; int visit[9] = {0, }; void solve(int len){ if(len == M){ for(int i = 0; i<M; i++){ printf("%d ", arr[i]); ...
ALGO
0.999906
3.372732
d59623e9-061a-4627-b633-acd102eba8ed
MakwanaBhavin1953/desktop-tutorial
modul3/Q6/flutter_application_1/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.997005
6.76775
b3a97ca9-242e-4a2c-9f7e-61f8ddabc6bb
AlaouiMohamedDev/p-m
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.9988
6.76073
c9984fb8-e3dc-4920-8e34-e5b95dc88769
Rishi838/code-freak
cpp/Vishal Dubey/coin.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } int number = 0; for (int i = 0; i < n; i++) { int count = 0; for (int j = 0; j < n; j++) { if (arr[i] == arr[j...
ALGO
0.999905
3.788872
ce14ce7c-927e-4ca0-9cb9-78bacedc34f8
hieupm123/again
code/C++/CSES-Solutions/Mathematics/Binomial Coefficients (1079)/catkl_2.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define trav(a, x) for(auto& a : x) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; const ll mod = 1000000007; // faster if const ll ...
ALGO
0.999951
4.848954
e9bad186-277d-4078-a0c7-f40d6d1549c0
kamrulcse404/Online_Judge_problem
Timus/1068_Sum.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n,sum=0; cin>>n; if(n>0) { for(int i=1; i<=n; i++) { sum+=i; } cout<<sum<<endl; } else { for(int i=n; i<=1; i++) { sum+=i; } cout<<sum<<end...
ALGO
0.999946
3.406719
4699f8ec-a9b0-4754-88fb-75108309a46c
HEltim7/cpcode
CF/Round/807/D_Mark_and_Lightbulbs.cpp
#include <vector> #include <iostream> #include <algorithm> using namespace std; #define endl '\n' using LL=long long; const int N=2e5+10; int arr[2][N]; // #define ONLINE_JUDGE #ifndef ONLINE_JUDGE #include<heltim7/debug> #else #define debug(...) #endif void solve() { int n; cin>>n; vector<pair<int,int>>...
ALGO
0.998789
3.990183
908ff0a4-16f8-4678-a54e-fb389d9a3da8
anilpiparaiya/DSA-IN-C-plusplus
CSES-Solutions/String Algorithms/String Matching (1753)/catkl.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define trav(a, x) for(auto& a : x) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; vi pi(const string& s) { vi p(sz(s)); rep(...
ALGO
0.999847
4.620606
6c5c4742-f9f7-477f-8f0a-76c91e3c994d
nkassa/leetcodepractice
shuffleAnArray.cpp
class Solution { public: vector<int> nums; Solution(vector<int>& nums) { this->nums = nums; } vector<int> reset() { return nums; } vector<int> shuffle() { vector<int> res = nums; for(int i = res.size()-1; i > 0; i--) { ...
ALGO
0.999426
6.283824
719af791-2d5d-4c53-9482-0b5cd3456d34
avBuffer/caffe_ssd-android-lib
eigen_3.2.7/failtest/colpivqr_int.cpp
#include "../Eigen/QR" #ifdef EIGEN_SHOULD_FAIL_TO_BUILD #define SCALAR int #else #define SCALAR float #endif using namespace Eigen; int main() { ColPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10)); }
TEST
0.94231
3.162483
b77cbcc6-d963-4587-a059-1aae9e331dee
wazidu/solved-problems
uva colourful flowers.cpp
#include<bits/stdc++.h> #define pi acos(-1) using namespace std; int main() { double a,b,c; while(cin>>a>>b>>c) { double s = (a+b+c)/2; double p= abs( sqrt((s-a)*(s-b)*(s-c)/s) ); double r= pi*p*p; double q= sqrt(s*(s-a)*(s-b)*(s-c)); double t= abs(q-r); doub...
ALGO
0.999667
3.596075
17d49ff9-b75e-4ecb-8524-d09ba9ed57a2
LovelyFlash/HUST-CS-homework
VS_Code/C/luogu/794284/P1185.cpp
#include <bits/stdc++.h> using namespace std; int m, n, width, height, node_num = 0, x, y; int main() { cin >> m >> n; width = pow(2, m - 2) * 6 - 1, height = width / 2 + 1; char graph[height][width]; memset(graph, ' ', width * height); for (int i = 0; i < width;) { node_num++; ...
ALGO
0.999969
3.434983
4966a36f-d15f-4ae8-8c61-1d421d626f53
KathyLin2009/cpp
factorial.cpp
#include <iostream> using namespace std; int factorial_iterative(int n) { int result = 1; for(int i = 1; i <= n; i++) { result = result * i; } return result; } int factorial_recursive(int n) { if(n < 2) { return 1; } return n * factorial_recursive(n-1); } int main()...
ALGO
0.999904
6.13091
af64ecac-c89e-49ea-86e5-a32fe57c4204
Prince9g/Leetcode-Submissions
3219-make-lexicographically-smallest-array-by-swapping-elements/3219-make-lexicographically-smallest-array-by-swapping-elements.cpp
class Solution { public: vector<int> lexicographicallySmallestArray(vector<int>& arr, int threshold) { vector<pair<int, int>> valueIndexPairs; int size = arr.size(); for (int i = 0; i < size; ++i) { valueIndexPairs.push_back({arr[i], i}); } sort(valueIndexPairs....
ALGO
0.999997
6.447486
851f8731-2507-4404-8701-701d6ec67403
MohammedAnjar/c-codes
pattern2/numberBrige.cpp
#include<iostream> using namespace std; int main (){ int n; cout<<"No. of line : "; cin>>n; for(int i=1; i<=2*n-1; i++){ cout<<i; } cout<<endl; int m = n-1; int nsp=1; for(int i=1; i<=m; i++){ int a = 1; for(int j=1; j<=m+1-i; j++){ cout<<...
ALGO
0.999939
3.353588
b2e1a58a-e93e-431e-9596-4ae5664fa383
Abhishek-Saini/educational
cses/graph/Mail_Delivery.cpp
#include <bits/stdc++.h> #include <stdlib.h> #include <time.h> using namespace std; long long mod = 1e9 + 7; double EPS = 1e-12; typedef long long int lld; typedef pair<lld,lld> PA; long double tick(){static clock_t oldt; clock_t newt=clock(); long double diff=1.0L*(newt-oldt)/CLOCKS_PER_SEC; oldt = newt; return...
ALGO
0.999994
4.043141
c7c8fc65-efb3-4e72-bdc1-dee699ad03d8
AndrewPolyakov1/DiscreteAnalysis
lab6/benchmark.cpp
#include "biggest_int.hpp" #include <gmpxx.h> #include <iostream> #include <vector> #include <map> #include <chrono> using timeDuration = std::chrono::microseconds; void GetTime(std::chrono::time_point<std::chrono::system_clock> & timeVar) { timeVar = std::chrono::system_clock::now(); } int64_t CountTime(const ...
ALGO
0.936691
5.009747
233e3153-a5ed-4d33-bda6-52dd41836286
richardvdo/marlin
src/lcd/menu/menu_delta_calibrate.cpp
// // Delta Calibrate Menu // #include "../../inc/MarlinConfigPre.h" #if HAS_MARLINUI_MENU && EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) #include "menu_item.h" #include "../../module/delta.h" #include "../../module/motion.h" #include "../../module/planner.h" #if HAS_LEVELING #include "../../feature/be...
TOOL
0.873059
7.275981
6d608ec3-ca93-4259-bb22-a727e2e06d33
DanceManiac/Gamma-Ray-Engine
xray/editors/LevelEditor/Edit/ESceneAIMapTools_Generate.cpp
#include "stdafx.h" #pragma hdrstop #include "ESceneAIMapTools.h" #include "scene.h" #include "../ECore/Editor/ui_main.h" #include "ui_leveltools.h" #include "cl_intersect.h" #include "MgcAppr3DPlaneFit.h" #include "sceneobject.h" #include "../ECore/Editor/EditObject.h" #include "../ECore/Editor/EditMesh.h" #include ...
ALGO
0.991847
3.200849
fb1efc79-df27-4d13-a730-6319a1f379bd
Mulab11/cntt2016-hw1
TC-SRM-584-div1-250/ywq.cpp
#include <map> #include <cmath> #include <cstdio> #include <string> #include <vector> #include <cstring> #include <algorithm> using namespace std; #define pb push_back #define mp make_pair #define x first #define y second typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<pii> vp...
ALGO
0.998372
3.630391
23201ea6-ca58-4545-8f4a-24c00091bf9c
hjiang13/LLMs-in-IR
POJ-104/41/161.cpp
#include <iostream> using namespace std; int main() { int i,j,n[5],guess[5],sum,mark; for(n[0]=1; n[0]<6; n[0]++) for(n[1]=1; n[1]<6; n[1]++) for(n[2]=1; n[2]<6; n[2]++) for(n[3]=1; n[3]<6; n[3]++) for(n[4]=1; n[4]<6; n[4]++) { if(n[4]!=2&&n[4]!=3&&n[0]+n[1]+n[2]+n[3]+n[4]==15&&n[0]*n[1]*n[2]*n[3]*n[4]==120) { guess[0]...
ALGO
0.999826
3.048697
9ee69e09-f445-4d84-ae8d-651d0074f170
shay-ff/cpp-files
grand/C_Sowing_Stones.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #ifndef ONLINE_JUDGE #include "../debug.cpp" #else #define debug(...) #define debugArr(...) #endif #define int int64_t #define all(v) (v).begin(),(v).end() #define all...
ALGO
0.999963
3.911863
08cb5485-de3b-415b-bc25-de149884244d
ishandutta2007/codeforces
ddytxdy/normal/1257/E.cpp
#include<cmath> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; namespace ZBK{ const int N=2e5+50; int k1,k2,k3,p[N],n,d1,d2,mn,ans=1e9; void main(){ scanf("%d%d%d",&k1,&k2,&k3);n=k1+k2+k3; for(int i=1,x;i<=k1;i++)scanf("%d",&x),p[x]=1; for(int i=1,x;i<=k2;i++)scanf("%d...
ALGO
0.99977
3.454624
743f8b78-4284-4d5e-83e1-274dc5410199
Ragtime-LAB/Ragtime_Panthera
3_ROS_workspace/ROS1-Noetic+Ubuntu20.04/panther_ws/src/dm_drive/include/eigen/doc/examples/Tutorial_simple_example_dynamic_size.cpp
#include <Eigen/Core> #include <iostream> int main() { for (int size = 1; size <= 4; ++size) { Eigen::MatrixXi m(size, size + 1); // a (size)x(size+1)-matrix of int's for (int j = 0; j < m.cols(); ++j) // loop over columns for (int i = 0; i < m.rows(); ++i) // loop over rows m(i, j) = i ...
ALGO
0.926298
3.085938
ef8d309a-c248-491b-8c12-7f02881c8c65
fatima-ghub/flutter
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
5f8e1b6e-e5e4-47ab-8aa4-54cfc665372d
alvaro9rqc/programacion-competitiva
codeforces/educational/r1/74/a.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; typedef pair<int, int> ii; typedef tuple<int, int, int> iii; typedef vector<int> vi; typedef vector<ii> vii; typedef vector<iii> viii; typedef pair<ll, ll> ll_p; typedef tuple<ll, ll, ll> ll_t; typedef vector<ll> vll; typedef vector<ll_p> vll_p; ...
ALGO
0.999511
4.530363
6862e4bd-9a45-460c-a7ca-27f3b2d190e1
2745518585/code
CF1696C.cpp
#include<cstdio> #include<algorithm> using namespace std; typedef long long ll; const int N=10000001; int n,m,k; struct str { int x; ll w; }a[N],b[N]; int main() { int T; scanf("%d",&T); while(T--) { int t; n=m=0; scanf("%d%d",&t,&k); for(int i=1;i<=t;++i) ...
ALGO
0.999567
3.574975
bac8177c-da8b-4af5-a166-237e6a24d518
assadullaalgalib/Introduction_to_programing
Pattern.cpp
/* **** **** **** **** */ /* * ** *** **** */ #include <iostream> using namespace std; int main() { int n,row,col; cout<<"Enter number of lines:"; cin>>n; for(row=1;row<=n;row++) { for(col=1;col<=n;col++) { cout<< " *"; } cout<<endl; } return...
ALGO
0.998969
3.615973
a15a9646-35fe-47bb-a3d3-91669cdcf7d8
amedhi/NickelateVMC
src/wavefunction/bcs_state.cpp
#include <iomanip> #include "strmatrix.h" #include <boost/algorithm/string.hpp> #include "./bcs_state.h" namespace var { BCS_State::BCS_State(const MF_Order::order_t& order, const MF_Order::pairing_t& pair_symm, const input::Parameters& inputs, const lattice::Lattice& lattice, const model::Hamiltonian& model)...
ALGO
0.977751
4.981264
1c078367-8c1e-41b3-ac04-457ea86e2927
esm712/alcuk
dp/퇴사.cpp
#include<iostream> #include<algorithm> using namespace std; int dp[20]; int main(void){ int N; scanf("%d",&N); for(int i=0; i<N; i++){ int T, P; scanf("%d %d",&T,&P); if(dp[i]>dp[i+1]){ dp[i+1]=dp[i]; } if(dp[i+T]<dp[i]+P){ dp[i+T]=dp[i]+P; ...
ALGO
0.999868
3.409858
d4480f20-7581-4fae-9499-694d394e40d2
davisnguyen111195/Algorithm
9_DeQuy/dequy12.cpp
// [Đệ Quy]. Bài 12. Chuyển hệ thập phân sang hệ 16. // Cho một số nguyên không âm N, hãy in ra dạng biểu diễn của N dưới hệ 16. // Input Format // Số nguyên không âm N // Constraints // 0≤n≤10^18 // Output Format // Biểu diễn hệ 16 của số nguyên N. // Sample Input 0 // 995 // Sample Output 0 // 3E3 #include ...
ALGO
0.998771
5.879494
4e73a75c-a366-4d36-b6f3-713d3b9ef909
SujayVivek/Ok-lets-CP
1400-1600/C_Recover_an_RBS.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" void solve() { string s; cin >> s; int n = s.length() / 2; int open = n - count(s.begin(),...
ALGO
0.999932
4.123196
b9895ae9-48dd-42ec-aecb-a13932381ef7
Anais-Barray/m1_bcd
Algorithmique_en_bioinformatique/TP_CPP/testbits.cpp
#include <iostream> #include <cstring> //calcul de la longueur de la sqc, pas bon pour les longues sqc #include <bitset> //pour afficher sous forme de bits 01. //Mettre dans FastXSeq //créer un tableau d'octet, pb : il faut connaitre la taille du génome (compter long de la seq, créer tableau de cette long) //pb : si a...
ALGO
0.995105
4.024663
e5b028a8-c7e3-471f-88c7-efa55dd0cd76
Sookmyung-Algos/2021algos
algos_assignment/2nd_grade/박서연_syeonnn/week4/1427.cpp
#include <iostream> #include<algorithm> using namespace std; int main() { int N, arr[10], cnt=0; cin >> N; // 정렬하고자하는 수 N 입력 while (N != 0) { arr[cnt] = N % 10; N /= 10; cnt++; } // N의 각 자리수를 배열 arr의 인덱스0부터 넣음 sort(arr, arr + cnt, greater<int>()); // 내림차순 정렬 for (int i = 0; i < cnt; i++) { cout << arr[i...
ALGO
0.999875
5.672789
792c82e4-018c-43e6-ab00-fbe366dfb171
King5678/Socket
Socket/Server.cpp
#include <filesystem> #include <fstream> #include <iostream> #include <sstream> #include <string> #include <winsock2.h> using namespace std; //#pragma comment(lib, "ws2_32.lib") int main() { // ʼ Winsock WSADATA wsaData; int nRc = WSAStartup(WINSOCK_VERSION, &wsaData); if (nRc != 0) { std::c...
WEB
0.954852
3.857117
eb341b83-2478-49b8-bacc-fd55d0fedc10
Jaikirao/Beginner-s-DSA-Sheet-by-FRAZ-
1572. Matrix Diagonal Sum.cpp
class Solution { public: int diagonalSum(vector<vector<int>>& mat) { int sum=0; int j=0; int n=mat.size()/2; for(int i = 0 ; i<mat.size();i++){ sum += mat[i][j++]; } cout<<j<<endl; for(int i = 0 ; i<mat.size();i++){ sum += mat[i][--j]; ...
ALGO
0.999964
5.341647
529c3e36-bd35-4adb-b675-200beb740b8e
Dipankar-Kumar-Singh/Codeforces
A_Chat_room.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long const ll MOD = 1e9 + 7; const ll INF = numeric_limits<long long>::max(); #define F first #define S second #define t_case int ttt {} ; cin >> ttt ; while(ttt--) #define FAST ios_base::sync_with_stdio(0); cin.tie(NULL...
ALGO
0.999923
4.485914
1e4bf9b8-8209-40b3-9b77-0c0d58765572
molloy-lab/Dollo-CDP
src/boost_1_80_0/libs/compute/example/fizz_buzz.cpp
#include <iostream> #include <boost/compute/system.hpp> #include <boost/compute/algorithm/copy.hpp> #include <boost/compute/algorithm/accumulate.hpp> #include <boost/compute/algorithm/exclusive_scan.hpp> #include <boost/compute/container/vector.hpp> #include <boost/compute/utility/dim.hpp> #include <boost/compute/util...
ALGO
0.998096
7.154435
18a1c9c2-b4e2-410f-93fe-44eec6483053
CoderSwarup/DSA_Mastery
22_OOPS/5_polymorphism/1_basic_of_polymorphism.cpp
/* polymorphisum means :- -one name multiple forms -------- polymorphisum -------- | | compiletime Runtime | | --------------- | | | virtual function operator ...
ALGO
0.97452
5.970028
4362e44c-1432-4cb7-90de-caa16aca5892
ishandutta2007/codeforces
ytkn/normal/1304/F2.cpp
#include <iostream> #include <algorithm> #include <iomanip> #include <vector> #include <queue> #include <deque> #include <set> #include <map> #include <tuple> #include <cmath> #include <numeric> #include <functional> #include <cassert> #include <algorithm> #include <cassert> #include <iostream> #include <vector> #ifd...
ALGO
0.999959
4.061103
b7347635-713f-4d5d-a1cc-1fec4c7c4994
czhu1217/competitive-programming
Others/DMOPC15C7P6.cpp
#include <stdio.h> #include <cstring> #include <algorithm> #include <vector> #include <math.h> #include <map> #include <queue> #include <fstream> #include <iostream> #include <unordered_map> typedef long long ll; using namespace std; const int MM = 1e5+5; string s, t; int n, r[2*MM], dif[2*MM];ll dp1[MM], dp2[MM], ans...
ALGO
0.999686
3.716397
7cd92946-f845-473a-addc-8939729ee4aa
albexl/codeforces-gym-submissions
gym/102035/H.cpp
#include <bits/stdc++.h> using namespace std; #define REP(I,A,B) for(int I = A;I < B;++I) #define sz(x) (int)((x).size()) #define MAX 10000005 #define endl '\n' typedef long long ll; typedef pair<int, int> pii; int main() { ios_base :: sync_with_stdio(0); cin.tie(0); int n, m, a, b; cin >> n >> m; ...
ALGO
0.999981
3.592823
b4b93a26-fa90-4de8-86d0-d7fc93daa46a
vintitres/practice
leetcode/1884-minimum-changes-to-make-alternating-binary-string/solution.cpp
class Solution { public: int minOperations(string s) { short c1 = 0, c2 = 0, ssize = s.size(); for (short i = 0; i < ssize; ++i) { if (i % 2 != s[i] - '0') { ++c1; } else { ++c2; } } return c1 < c2 ? c1 : c2; } }...
ALGO
0.999952
5.938069
8cbd7a63-34c3-4654-ad33-db6c4e05fc3c
aniketwasnik1610/Data-Structures-and-Algorithms
Binary & Decimals/BinaryToDecimal.cpp
#include<iostream> #include<math.h> using namespace std; int main() { int n; cin >> n; string ans = ""; // Initialize ans as an empty string while (n != 0) { int bit = n & 1; // Get the last bit ans = to_string(bit) + ans; // Prepend the bit to the result n = n >> 1; // Right ...
ALGO
0.99999
5.234181
81b02be8-bec3-449d-b16a-9a6c3f199acd
Abhishek2533/DSA
LeetCode-Problem's-Solution/Hard/Problem_3337.cpp
/* 3337. Total Characters in String After Transformations II You are given a string s consisting of lowercase English letters, an integer t representing the number of transformations to perform, and an array nums of size 26. In one transformation, every character in s is replaced according to the following rules: Rep...
ALGO
0.999991
6.941358
26d688cf-4150-4bf8-9f5c-cf38335101a3
ArmaanTechDeveloper/DSA
intermediate/Binary Tree/diameterBinaryTreeBruteforce.cpp
#include <iostream> using namespace std; struct Node { int data; struct Node* left; struct Node* right; Node(int x){ data = x; left = right = NULL; } }; class Solution { private: int height(Node * root){ if(root == nullptr){ return 0; } ...
ALGO
0.99998
6.175329
935b5d40-aca4-462b-945d-4201f414c798
nohhyeonjin/BOJ
투포인터/1806.cpp
#include <bits/stdc++.h> using namespace std; int n,s; int arr[100000]; int ans=1e9; int main(){ scanf("%d %d",&n,&s); for(int i=0;i<n;i++) scanf("%d",&arr[i]); int sum=0; int left=0, right=0; int len=0; while(1){ if(sum>=s){ ans=min(ans,len); sum-=arr[left++]; ...
ALGO
0.999932
3.289544
73a2de1c-dcc6-4e70-872f-187136800365
Abhik-Chakraborty/DSA
2448-count-number-of-bad-pairs/2448-count-number-of-bad-pairs.cpp
class Solution { public: long long countBadPairs(vector<int>& nums) { int n = nums.size(); unordered_map<int, int> freqMap; long long goodPairs = 0; for (int i = 0; i < n; i++) { int key = i - nums[i]; goodPairs += freqMap[key]; freqMap[key]++; ...
ALGO
0.999978
5.748741
dfd14b38-3ed0-4590-a4e2-02925392f290
singh-saubhagya/Cpp-programs
PHASE_3/snakeandladders.cpp
#include<bits/stdc++.h> using namespace std; #define inf 1e9 void game(){ vector<vector<pair<int,int>>> g; g.resize(101); for(int i=1;i<=100;i++){ for(int j=1;j<=6;j++){ int idx=i+j; if(idx<=100) { g[i].push_back({idx,1}); } ...
ALGO
0.998656
4.210562
80e4bb08-1db7-47c6-9a98-2a9fef79e46c
TengFeiyang01/Algorithm
casual/LingCha_shilian/1821E.cpp
#include <bits/stdc++.h> const int inf = 0x3f3f3f3f; using i64 = long long; void solve() { int k; std::string s; std::cin >> k >> s; i64 ans = 0, n = s.size(); std::vector<int> a, st; for (int i = 0; i < n; ++i) { if (s[i] == '(') { st.push_back(i); } else { a.push_back((...
ALGO
0.999228
4.471019
b3ad4a48-6540-4de5-8983-0afcfb46f791
raincross7/code-similarity
codes/train_code/problem136/problem136_469.cpp
#define _USE_MATH_DEFINES #include <iostream> #include <sstream> #include <string> #include <list> #include <vector> #include <queue> #include <algorithm> #include <climits> #include <cstring> #include <cmath> #include <stack> #include <iomanip> #include <tuple> #include <functional> #include <cfloat> #include <map> #i...
ALGO
0.999975
3.538123
fd07c05c-88c1-420a-9869-69c6d7f437e5
SteffiKeranJ/Data-Structures-and-Algorithms-Cpp-and-Scala
Dynamic-Programming/maxSubArray2.cpp
class Solution { public: int maxSubArray(vector<int>& nums) { int n = nums.size(); int currentSum = nums[0]; int maxSum = nums[0]; for(int i = 1; i < n; ++i) { currentSum = max(currentSum + nums[i], nums[i]); maxSum = max(maxSum, currentSum); ...
ALGO
0.999721
6.562953
681cec59-d07b-4b0b-a93f-14a78793c3b6
Chang-LeHung/llvm-ir-api-demos
ir/struct_demo.cpp
#include <iostream> #include <llvm/IR/IRBuilder.h> #include <llvm/IR/LLVMContext.h> #include <llvm/IR/Module.h> #include <llvm/Support/TargetSelect.h> #include <llvm/ExecutionEngine/Orc/LLJIT.h> #include <llvm/ExecutionEngine/Orc/ThreadSafeModule.h> #include <llvm/Support/raw_ostream.h> using namespace llvm; int main...
TOOL
0.862541
4.904758
0b1124f6-95a3-4df0-b833-66c2b7203aaf
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Gemma/top0-100/minimum-height-trees-Solution.findMinHeightTrees/177788_DoS_Exec_Code_Overflow.cpp
void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, Stream *maskStr, int maskWidth, int maskHeight, GfxImageColorMap *maskColorMap) { double *ctm; SplashCoord mat[6]; SplashOutImageData imgData; ...
TOOL
0.977423
5.070117
56bbee52-c679-41b8-86cc-1d2d7e4ee62b
zahidaliayub/Japan
src/scrypt.cpp
#include <stdlib.h> #include <stdint.h> #include "scrypt.h" #include "pbkdf2.h" #include "util.h" #include "net.h" #define SCRYPT_BUFFER_SIZE (131072 + 63) #if defined (OPTIMIZED_SALSA) && ( defined (__x86_64__) || defined (__i386__) || defined(__arm__) ) extern "C" void scrypt_core(unsigned int *X, unsigned int *V...
ALGO
0.989365
5.510696
a7fa239c-98e9-4d13-994c-e58f2e34a471
Astha369/CPP_Problems
Merge_Sort.cpp
/* MERGE SORT ALGORITHM Problem Description: Given an array arr[], its starting position l and its ending position r. Sort the array using merge sort algorithm. Example 1: Input: N = 5 arr[] = {4 1 3 9 7} Output: 1 3 4 7 9 Example 2: Input: N = 10 arr[] = {10 9 8 7 6 5 4 3 2 1} Output: 1 2 3 4 5 6...
ALGO
0.999981
5.906762
97845c03-fd0b-4121-a74f-adfc0f3a7398
qwertier24/AC
Codeforces/probs/CF_338B.cpp
#include <stdio.h> #include <algorithm> #include <vector> #include <map> #include <queue> #include <string.h> #include <string> #include <math.h> #define INF 1<<30 using namespace std; int n,m,d,aff[100001]={0},upDist[100001],downDist[100001],m1[100001],m2[100001]; vector<int> adj[100001],son[100001]; void Init(int u,i...
ALGO
0.999889
4.042143
1a038617-abf9-4571-a999-5128c775352f
saurabh1505717/Leet_code_by-SK
53-maximum-subarray/53-maximum-subarray.cpp
class Solution { public: int maxSubArray(vector<int>& nums) { int i=0, n=nums.size(), sum=0, res=nums[i]; for(i=0; i<n; i++){ sum=sum+nums[i]; if(sum>res){ res=sum; } if(sum<0){ sum=0; } }return res; ...
ALGO
0.999954
6.00512
9ea618b2-61ff-49ba-a141-94e5e649cba1
wery0/CP-library
Data structures/VP-tree.cpp
//Vantage point tree //T - type of coordinates //D - number of dimensions template<typename T, const int D, typename R = long double> class VP_tree { static_assert(is_signed_v<T>); static_assert(is_floating_point_v<R>); using point = array<T, D>; //Use this instead when you want to store some info with...
ALGO
0.998464
5.489048
d479cb78-3428-44a5-9cb7-864b0a34b695
thealrashid/A2Z_Code
Array/appear_once.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; int appear_once(vector<int> arr, int n) { if(n == 1) return arr[0]; int result = 0xffffffff; for(int i = 0; i < n; i++) result ^= arr[i]; result = -(result+1); return result; } int main() { int n; cout << "Enter the number...
ALGO
0.999509
5.220116
4596297a-4101-451e-b232-2e07a1da8b7b
andrewsamerhanna/Exam-3-Collatz-Sequence
Exam 3 Collatz Sequence/Collatz Sequence Functions.cpp
#include <iostream> #include "Collatz Sequence Functions.hpp" struct collatzNodePar { int item; collatzNodePar* link; }; int calculateNextCollatzNumber(int inputPar) { switch (inputPar%2) { case 0: // even numbers return inputPar/ 2; break; case 1: // odd numbers return 3 * inputPar + 1; break; default...
ALGO
0.999952
5.413435
e1cbe6bc-7677-4f54-a246-eccf57442848
yongminp42/solved_ac_cpp
class2/2609.cpp
#include <iostream> using namespace std; int main() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); int a, b, x, y; x = 1; y = 1; cin >> a >> b; if (a == b) { cout << a << "\n" << b; return 0; } for (int i = 2; i <= a && i <= b; i++) // i<a && i<b로 해...
ALGO
0.999981
4.529984
66844eb0-bee7-4e87-bbee-39fe73410ff6
chengsun/BIO12-Round-1
2010/2.cpp
#include <iostream> using namespace std; typedef unsigned short *die_t; typedef unsigned short dir_t; #define U 0 #define R 1 #define D 2 #define L 3 typedef int coord_t; #define SIZE 11 #define X(c) ((c)%SIZE) #define Y(c) ((c)/SIZE) #define AT(x,y) ((x)+(y)*SIZE) #define OFF(n) ((n) < 0 || (n) >= SIZE) short move...
ALGO
0.999557
3.841369
52a586fd-e730-4b6d-8f4b-b1a21c556f0e
AnTheFool/NOTES
GRAPH/tplt.cpp
#include <bits/stdc++.h> using namespace std; void bfs(vector<int> adj[], int s, bool visited[]){ queue<int> q; visited[s] = true; q.push(s); while (!q.empty()){ int u = q.front(); q.pop(); for (int v : adj[u]){ if (visited[v] == false){ visited[v] = true; ...
ALGO
0.999911
4.827559
e2a8fd26-96a5-488f-8105-994a58296f08
j-jiwon/algorithms
ALGO/Algo_1.1/_6_P_모의고사.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; const int n1[5] = { 1,2,3,4,5 }; const int n2[8] = { 2,1,2,3,2,4,2,5 }; const int n3[10] = { 3,3,1,1,2,2,4,4,5,5 }; vector<int> solution(vector<int> answers) { vector<int> answer; vector<int> cnt(3, 0); int maxValue = 0; for (int i = 0;...
ALGO
0.999949
5.189358
20e5ced4-b0b1-424e-94b8-6ea436a205b4
Nuria1982/calc_nutrientes
renv/library/windows/R-4.5/x86_64-w64-mingw32/Rcpp/examples/Misc/piSugar.cpp
#include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] double piSugar(const int N) { NumericVector x = runif(N); NumericVector y = runif(N); NumericVector d = sqrt(x*x + y*y); return 4.0 * sum(d < 1.0) / N; }
ALGO
0.99657
5.799429
0659651d-44be-45ff-b04a-c151e007a4aa
SophieLabs/Information-Theory-Vicsek-Model
src/sim_generate_threaded.cpp
#include "../include/model.hpp" #include "../include/stats.hpp" #include "../include/logFileHelper.hpp" #include "../include/version.hpp" #include "../include/defs.hpp" #include "../include/vpTree.hpp" #include "../include/utils.hpp" #include <fmt/format.h> #include <clara.hpp> #include <iostream> #include <omp.h> #in...
ALGO
0.995915
4.549777
0ab4fe20-300a-4cba-96b6-c0d7c0a5690b
Prudhivi-Deepak/DSA
GFG_streak/root_to_leaf_paths.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node* left; struct Node* right; }; Node* newNode(int val) { Node* temp = new Node; temp->data = val; temp->left = NULL; temp->right = NULL; return temp; } Node* buildTree(string str) {...
ALGO
0.997571
7.327456
09083054-4772-4b5b-acd7-91e42e3821f8
outlander23/lab-practice
c++ code/bidirectional.cpp
#include <bits/stdc++.h> using namespace std; /* Bidirectional Search on an unweighted graph: - Runs two simultaneous BFS's from start and goal. - Stops when the frontiers meet. - Reconstructs the shortest path. Input format: n m u0 v0 u1 v1 # m undirected edges (0-based) ... u(m...
ALGO
0.999971
5.461371
49e12670-756e-4a66-bf35-f248c4eae813
ishandutta2007/codeforces
gyh20/normal/1372/E.cpp
#include<bits/stdc++.h> #define re register using namespace std; inline int read(){ re int t=0;re char v=getchar(); while(v<'0')v=getchar(); while(v>='0')t=(t<<3)+(t<<1)+v-48,v=getchar(); return t; } int n,m,f[102][102],L[102][102],R[102][102],len[102],s[102]; int main(){ n=read(),m=read(); for(re int i=1;i<=n;++...
ALGO
0.999781
3.304732
21160551-1cb8-428c-bb1d-5bdf517a9cd3
shuguang101/leetcode_cpp
problems/p151_reverseWords.cpp
#include <bits/stdc++.h> #include <range/v3/all.hpp> // #include <boost/algorithm/string.hpp> // can't found qt5 usage info after installed by vcpkg // #include <QString> // #include <QStringList> // #include <iostream> using namespace std; class Solution { public: string reverseWords_v1(string s) { int start...
ALGO
0.994614
5.161111
fd8845f7-4a85-4106-b842-a3e150186eb1
call-me-bammer/montmartre-hill
baekjoon/21633/main.cpp
#include <iostream> #include <iomanip> using namespace std; int main() { int k; cin >> k; double answer = (k + 2500) * 0.01; if (answer < 100) { answer = 100; } else if (answer > 2000) { answer = 2000; } cout << fixed << setprecision(2) << answer << endl; return 0; }
ALGO
0.996499
3.595223
285ceda6-3c57-4a2e-beb5-98a4c3bbeb97
cwduncan281/personalProjects
qtGUI/SAFETY_NET/letstryagain/polygonal.cpp
#include "polygonal.h" vertex::vertex(double _x, double _y) { x = _x; y = _y; ishead = false; } polygon::polygon() { } polygon::polygon(int sides) { double newx, newy; for(int i=0; i<sides; i++) { newx = cos(2.0 * M_PIl * i / sides); newy = sin(2.0 * M_PIl * i / sides); ...
ALGO
0.9993
3.536027
e2186acf-604b-4b8c-a45d-09b6b823fe7a
hervature/ORFE
531/homework7/xlorflib/xlfunctions3.cpp
/** @file xlfunctions3.cpp @brief Implementation of Excel callable functions */ #include <orflib/market/market.hpp> #include <orflib/products/europeancallput.hpp> #include <orflib/products/asianbasketcallput.hpp> #include <orflib/products/worstofdigitalcallput.hpp> #include <orflib/pricers/bsmcpricer.hpp> #include <o...
ALGO
0.876695
7.124658
36476be3-fdd8-442c-99a7-648e7f64d5af
nicorag/MB_SYSTEM
src/mbtrnav/newmat/newmatnl.cpp
//$$ newmatnl.cpp Non-linear optimisation #define WANT_MATH #define WANT_STREAM #include "newmatap.h" #include "newmatnl.h" #ifdef use_namespace namespace NEWMAT { #endif void FindMaximum2::Fit(ColumnVector& Theta, int n_it) { Tracer tr("FindMaximum2::Fit"); enum State {Start, Restart, Continue, Inter...
ALGO
0.999956
6.224564
3a2cdd91-c436-4109-8444-bb7e72f3c844
VenkataRamana13/cses
introductory/apple_division.cpp
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); long long n; cin >> n; int a[n]; long long sum = 0; for(long long i = 0; i < n; i++){ cin >> a[i]; sum += a[i]; } sort(a, a + n, greater<long long>()); long long sum_local = 0...
ALGO
0.99998
3.940396
35b66c21-50b8-4939-ad05-a7914b3bbd9c
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_4638_49.cpp
#include <bits/stdc++.h> using namespace std; int n; struct Point { double x, y, z; } p[10005], h, ans; double vs, vp; double have; double anst; double dis(Point a, Point b) { return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y) + (a.z - b.z) * (a.z - b.z)); } Point getmid(Point a, Point ...
ALGO
0.999977
3.83585
eeeda6c3-350d-49ae-8b36-cff5d4489867
vedantchawla07/DSARepo
graphs/ShortestPathinWeightedUndirectedGraph.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: #if 0 This method stores the entire path in the queue ds. Path of paths. You could use a pq as well. Same implementation. vector<int> shortestPath(int n, int m, vector<vector<int>>& edges) { ...
ALGO
0.999912
5.509886
9109c3d7-a50f-4395-a6b2-e1f6ab75f702
mpfeifer1/Kattis
sumsquareddigits.cpp
#include <bits/stdc++.h> using namespace std; void solve() { int k, b, n; cin >> k >> b >> n; int ans = 0; while(n > 0) { ans += (n % b) * (n % b); n /= b; } cout << k << " " << ans << endl; } int main() { int cases; cin >> cases; while(cases--) { solve()...
ALGO
0.999714
4.358027
3183bfbb-de35-407a-9366-d46c83045c0c
gokulcodes/leetcode
458-poor-pigs/458-poor-pigs.cpp
class Solution { public: int poorPigs(int buckets, int minutesToDie, int minutesToTest) { return ceil(log(buckets) / log(minutesToTest / minutesToDie + 1)); } };
ALGO
0.988254
6.101873
e97e1df2-47db-442d-a589-a275ade7753b
virgolinosoares/Crowd-SLAM
Thirdparty/g2o/g2o/core/sparse_optimizer.cpp
#include "sparse_optimizer.h" #include <iostream> #include <iomanip> #include <algorithm> #include <iterator> #include <cassert> #include <algorithm> #include "estimate_propagator.h" #include "optimization_algorithm.h" #include "batch_stats.h" #include "hyper_graph_action.h" #include "robust_kernel.h" #include "../st...
ALGO
0.99966
6.976369