uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
ce2373be-39d8-408f-a97e-77f17eca3971
gajgeospatial/geos-3.5.0
src/index/strtree/AbstractSTRtree.cpp
#include <geos/index/strtree/AbstractSTRtree.h> #include <geos/index/strtree/AbstractNode.h> #include <geos/index/strtree/ItemBoundable.h> #include <geos/index/ItemVisitor.h> // std #include <algorithm> #include <vector> #include <typeinfo> #include <cstddef> #include <cassert> using namespace std; namespace geos { n...
ALGO
0.975761
5.588271
4d2ea485-d48b-40e8-83e5-b0b8d4200c8c
eric2003/OneFLOW
example/partition/struct/2d/stage1/01e/Partition.cpp
#include "Partition.h" #include "CgnsGrid.h" #include "SplitZone.h" #include "cgnslib.h" #include <string> double CalSumOfProcSpeed( std::vector<double> & procSpeed ); double CalSumOfProcSpeed( std::vector<double> & procSpeed ) { int nProc = procSpeed.size(); double sumOfProcSpeed = 0; for ( int iProc = 0;...
ALGO
0.999452
3.552407
a9d01683-96dd-4eba-8fdd-45dc3f1e28f4
ishandutta2007/codeforces
dreamoon_love_aa/normal/1624/G.cpp
/*{{{*/ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> #include<string> #include<iostream> #include<sstream> #include<set> #include<map> #include<queue> #include<bitset> #include<vector> #include<limits.h> #include<assert.h> #define SZ(X) ((int)(X).size()) #define ALL(X) (X).be...
ALGO
0.999927
3.807719
28d600ec-89c7-4ebb-b564-6186b4c874a6
Jyf624761709/Luogu
AC/P1100.cpp
#include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<queue> using namespace std; #define in(t) freopen("t.in","r",stdin) #define out(t) freopen("t.out","w",stdout) #define m(a) memset(a,0,sizeof(a)) typedef long long ll; const ll N=((ll) 1)<<((ll) 16); int main(){ ll t; scanf("%lld",&t);...
ALGO
0.999352
3.209379
6e102087-b4b7-4814-8657-18bbf4ce2077
goccy/go-zetasql
internal/ccall/icu/common/ubidiwrt.cpp
#include "unicode/utypes.h" #include "unicode/ustring.h" #include "unicode/uchar.h" #include "unicode/ubidi.h" #include "unicode/utf16.h" #include "cmemory.h" #include "ustr_imp.h" #include "ubidiimp.h" /* * The function implementations in this file are designed * for UTF-16 and UTF-32, not for UTF-8. * * Assumpti...
TOOL
0.997683
4.736028
9e98ef32-e1f5-48be-9e58-d1f74ecc1b72
DhruvGahoi/ds-zero
array/73.cpp
class Solution { public: void setZeroes(vector<vector<int>>& matrix) { int m = matrix.size(); int n = matrix[0].size(); vector<int> row(m, 0); vector<int> col(n, 0); for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ if(matrix[i][j] == 0){ ...
ALGO
0.998398
6.417202
5416fb8e-9cf4-4629-94bd-80236f97fadb
gustavouliano/crivo_de_eratostenes_algoritmo
sequencial.cpp
#include <iostream> #include <vector> #include <chrono> #include <cmath> void crivoEratostenes(int limiteSuperior) { std::vector<bool> numeros(limiteSuperior + 1, true); numeros[0] = numeros[1] = false; int limiteRaizQuadrada = sqrt(limiteSuperior); auto inicio = std::chrono::high_resolution_clock::no...
ALGO
0.999826
5.355239
4808bef7-f481-4f94-8bba-15e983588517
YttriumWillow/OI
Problems/T296711.cpp
/* FileName: T_296711_UOI-R_1_询问.cpp + randomhash: a560137d18ec2d10278f166a Author: fengziyi + base64: ZmVuZ3ppeWk= + MD5: 9b0454ce8364ba54b28c8b9b7f9dafc7 Date: 2022/12/10 星期六 Time: 17:02:59 + Unix Timestamp(second): 1670662979 Encoding: UTF-8 + Encodeing Tes...
ALGO
0.999915
3.661328
12ad69fe-365f-46e4-9120-699e205ed198
husain-zaidi/hhz-kata
Computer Lab SemVI/seek.cpp
#include <iostream> using namespace std; struct Process { int cylinder; int toa; int processTime; }; int seekTime = 0; int processingTime = 0; Process user_request[8]; int reqArray[200]; int headPos; bool moveLeft = true; int findByCylinder(int cylinder){ for(int i = 0; i < 8; i++){ if(cylin...
ALGO
0.9998
3.332204
0e56fd85-92a8-4662-8071-8abdb71f4baf
Mail163/7-Zip-JBinding-4Android
sevenzipjbinding/src/main/cpp/7zip/CPP/7zip/Compress/ShrinkDecoder.cpp
// ShrinkDecoder.cpp #include "StdAfx.h" #include <stdio.h> #include "../../../C/Alloc.h" #include "../Common/InBuffer.h" #include "../Common/OutBuffer.h" #include "BitlDecoder.h" #include "ShrinkDecoder.h" namespace NCompress { namespace NShrink { static const UInt32 kBufferSize = (1 << 18); static const unsign...
ALGO
0.978021
5.434281
69a59644-32e6-4852-b68c-dfedc6701042
Erumaru/ACM
codeforces/archive/012/a.cpp
#pragma comment(linker, "/STACK:64000000") #include <iostream> #include <cmath> #include <cstdio> #include <cstring> #include <cstdlib> #include <cassert> #include <ctime> #include <sstream> #include <algorithm> #include <functional> #include <numeric> #include <string> #include <vector> #include <queue> #include <stac...
ALGO
0.999833
3.322959
ba1a8a3a-36de-43f5-97ec-592c7f2ed7ef
Richi78/CF-Algorithms
J_Waiting_for.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define all(v) v.begin(),v.end() #define forn(i,n) for(int i=0;i<n;i++) #define print(x) cout << x << " " #define printl(x) cout << x << endl #define sz(a) (a).size() #define input(x) cin >> x #define printv(v) for(int i=0;i<sz(v...
ALGO
0.999257
3.621473
c6df1525-4359-4f56-b880-826e7fb4194c
amb-lucas/Competitive-Programming
Number-Theory/MillerRho.cpp
typedef unsigned long long ull; typedef long double ld; //miller_rabin ull fmul(ull a, ull b, ull m) { ull q = (ld) a * (ld) b / (ld) m; ull r = a * b - q * m; return (r + m) % m; } ull fexp(ull x, ull e, ull m) { ull ans = 1; x = x % m; for(; e; e >>= 1) { if(e & 1) ans = fmul(ans, x, m); x = fmul(x, x, ...
ALGO
0.999737
3.313103
c2987e52-7276-44c3-a01c-1aed61f69469
ishandutta2007/codeforces
vkgainz/normal/1265/E.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long ll MOD = 998244353; ll power(int base, int to){ if(to==0){ return 1; } ll x = power(base,to/2); ll ret; if(to%2==0){ ret = x*x%MOD; ret%=MOD; if(ret<0) ret+=MOD; return ret; } else{ ...
ALGO
0.999972
4.424035
558080f3-d944-45b3-aa9d-60fc2efaa1a0
AlterFritz88/intro_to_prog_c_plus_plus
task_1_11_8.cpp
#include <iostream> #include <string> #include <set> #include <map> #include <vector> #include <sstream> using namespace std; int main() { int n; string input, delimiter = ", ", token; vector<string> splited; set<string> latin_words; map<string, vector<string>> dict; cin >> n; getline(cin, ...
ALGO
0.998361
4.686703
b9a7f76b-cb70-4954-b54d-04e66c1c8845
arielshao/HackerRankCpp
SherlockandtheValidString.cpp
#include <bits/stdc++.h> using namespace std; /* * Complete the 'isValid' function below. * * The function is expected to return a STRING. * The function accepts STRING s as parameter. */ string isValid(string s) { //create a hashmap namely 'map' to count the frequency of each character in string s; ...
ALGO
0.999994
5.600756
2b3b4b60-6f87-460e-ac07-e8d24adc7489
ishandutta2007/codeforces
serotonin/normal/1349/A.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int sz = 3e5+5; int a[sz], spf[sz]; void sieve() { for(int i=2; i<sz; i++) { if(spf[i]) continue; for(int j=i; j<sz; j+=i) spf[j] = i; } } vector <int> v[sz]; int main() { sieve(); int n; cin >> n; if...
ALGO
0.999992
4.435493
0a35bf51-588b-4401-9855-64fff1a46aa0
AbhijnaKalbhag/LeetCode
simulation/get-maximum-in-generated-array.cpp
class Solution { public: int getMaximumGenerated(int n) { if(n==0){return 0;} int a[102],i;a[0]=0;a[1]=1; int max=0; for(i=0;i<=n;i++) { if(a[i]>max){ max=a[i];} if(2*i<=n){ a[2*i]=a[i]; a[2*i+1]=a[i]+a[i+1];} } return max; ...
ALGO
0.999989
5.873575
90235a05-e4a1-400b-8a4c-249e9b4415f0
pavel-ryzhov/global_vars
runs/000880.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> typedef unsigned short ushort; using namespace std; struct button { string letters; button(char value); }; button::button(char value) { if (value == '2') letters = "abc"; if (value == '3') letters = "def"; if (value == '4') letters = ...
ALGO
0.998802
4.237253
e70f6e6e-36a6-4f89-a0d2-5c73ec57ae5a
YanLi26/leetcode-summer
Array/442. Find All Duplicates in an Array/442. Find All Duplicates in an Array1.cpp
class Solution { public: vector<int> findDuplicates(vector<int>& nums) { vector<int>res; for(int i = 0; i < nums.size(); ++i) { int pos = abs(nums[i]) - 1; if(nums[pos] < 0) res.push_back(abs(nums[i])); else nums[pos] *= -1; } return res; } };
ALGO
0.999938
5.704093
30e000ab-70a6-4501-b733-dc435c1b5469
silasdani/C-Cplusplus
min3/main.cpp
#include <iostream> using namespace std; int main() { int a,b; cin>>a>>b; char c; cin>>c; if(c=='+') cout<<a+b; else if(c=='-') cout<<max(a,b)-min(a,b); else if(c=='*') cout<<a*b; else if(c=='/') cout<<max(a,b)/min(a,b); }
ALGO
0.999911
3.606351
aaedcda0-2c63-4080-80b1-283d0dffd97e
HOWAIKIAT287156/flutter_LoanCalculator
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.998809
6.763549
cf17392a-3c57-41ea-a27a-427cec1cc07b
nitkoposeban/openholdembot
CTransform/hash/lookup3.cpp
#include "stdafx.h" #include "lookup3.h" /* ------------------------------------------------------------------------------- lookup3.c, by Bob Jenkins, May 2006, Public Domain. These are functions for producing 32-bit hashes for hash table lookup. hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final()...
ALGO
0.997663
5.599909
4a06d701-216c-488b-9594-4effd2c729b4
kunfeng327/hmwk
hmwk2.cpp
#include<iostream> using namespace std; class Rectangle { private: double length; //长 double width; //宽 public: Rectangle(double Length=10.,double Width=5.); double Area() const; //获取面积 double Perimeter() const;//获取周长 }; Rectangle::Rectangle(double Length,double Width){ length=Length; width=W...
ALGO
0.998843
3.421038
f043c7e4-8645-4cc0-bb09-71d098022dfd
boyima/Leetcode
lc165.cpp
class Solution { public: int compareVersion(string version1, string version2) { for(int begin1 = 0, begin2 = 0; begin1 < version1.size() || begin2 < version2.size(); begin1++, begin2++){ int len1 = give(version1, begin1); int len2 = give(version2, begin2); if(len1 > len2)...
ALGO
0.999575
5.358211
220d9972-91ae-494b-b72e-7564b4125382
WebProject-STT/Algorithm
prev/baekjoon/22주차/2012/2012_jh.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; /* 1등, 1등, 2등, 2등 을 원할 경우 1등, 2등, 3등, 4등 으로 만들어주는게 불만도가 제일 적은 방법 */ int main() { vector<int> rank; long N, answer = 0; cin >> N; rank.resize(N + 1); for (int i = 1; i <= N; i++) { cin >> rank[i]; } // 입력받은 등수 정렬 sort(...
ALGO
0.999903
4.021448
779b25e3-40c1-4d4f-9e25-d921efb0a3bf
Shriman1527/dsa-by-love-babber
26. Pointer in CPP Part 2/Pointer7.cpp
#include<iostream> using namespace std; int get_sum(int arr[],int n) { // both will be treat as same // int arr[] and int *arr cout <<endl<<"size "<< sizeof(arr)<< endl; int sum=0; for(int i=0;i<n;i++) { sum+=arr[i]; } return sum; } int main(){ int arr[6]={1,2,3,4,5,8}; co...
ALGO
0.980556
4.304942
5ab4292f-b91e-4b2d-a1fd-344ead2a0f3e
Aarnachauhan/DSA-
Stack /imple in linkedlist.cpp
#include <bits/stdc++.h> using namespace std; struct Node{ int data; Node *next; Node(int x){ data=x; next=NULL; } }; struct MyStack{ Node *head; int sz; MyStack(){ head=NULL; sz=0; } void push(int x){ Node *temp=new Node(x); tem...
ALGO
0.99934
3.803131
91f85681-7288-4416-adb4-6d6fac35ed80
duows/Exercicios-Programacao
LeetCode/05_10.cpp
#include <iostream> #include <algorithm> #include <unordered_map> #include <vector> using namespace std; int main() { vector<int> nums = {1, 2}; unordered_map<int, int> frequence; vector<int> res; int n = nums.size() / 3; for (int num : nums) { frequence[num]++; if (frequence[n...
ALGO
0.999902
4.178457
0e976d36-1e5f-4932-b303-21b4a13caac7
SuveenKumar/Competitive-Programming
codeforces/1455/B.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl ("\n") #define pi (3.141592653589) #define mod 1000000007 #define INF 1000000009 #define float double #define pb push_back #define mp make_pair #define ff first #define ss second #define so sizeof #define pii pair<ll,ll> #define all(c) c.b...
ALGO
0.999953
4.341914
1e997bbd-3b60-4dff-8bea-8ad2cdd535bf
avnomad/Array-VS-Real-Matrices-and-Vectors
Array VS Real Matrices and Vectors/main.cpp
#include <iostream> using std::cout; using std::endl; #include <Real Matrices and Vectors.h> #include <Array/Array.h> using namespace ASL; using namespace ASL::DataStructures; double (*sinp)(double) = sin; double (*cosp)(double) = cos; double add1(double x) { return 1+x; } int main() { Array<double> A(25000000);...
ALGO
0.918694
3.76912
00e6b1fe-df6f-44b3-bbef-c7190d1f6e67
sangyeong01/Algorithm
Chapter8/Lis.cpp
#include <iostream> #include <vector> #include <cassert> #include <algorithm> using namespace std; // ޾Ƽ ش Lis ȯ int Lis(vector<int> seq) { //seq ִ if(seq.size() == 0) { return 0; } vector<int> dp(500, 1); dp[0] = 1; //seq ε ؼ LIS Ž for(int i = 1; i < seq.size(); i++) { ...
ALGO
0.999781
4.551838
ad57a9a7-f906-447e-88f7-138d83663f70
Kuldeepagrahari/Programming-DSA-Shell-BashScripting-OOPS
CP/Rock_Paper_Scissors.cpp
#include<bits/stdc++.h> using namespace std; #define int long long template <typename Container> void printer(const Container &container) { for (auto it = std::begin(container); it != std::end(container); ++it) { cout << *it << " "; } cout << endl; } // ---------------------------------...
ALGO
0.999957
4.769256
140e1e51-adcf-44ac-86e0-89871f23408d
ishandutta2007/codeforces
wangziji/normal/1543/D1.cpp
#include <bits/stdc++.h> using namespace std; int main() { int T; cin >> T; while(T--) { int n,k,now=0; cin >> n >> k; for(int i=0;i<n;i++) { int x=now^i; cout << x << endl; now^=x; int t; cin >> t; if(t==1) break; } } return 0; }
ALGO
0.999924
3.393738
818b1721-371f-47e9-bb6d-a5d12f3d04a7
nevermlnd/ue4-test
Engine/Source/ThirdParty/PhysX3/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepCapsuleCapsule.cpp
#include "GuSweepCapsuleCapsule.h" #include "GuCapsule.h" #include "GuDistancePointSegment.h" #include "GuDistanceSegmentSegment.h" #include "GuIntersectionRayCapsule.h" #include "PxQueryReport.h" #include "PxTriangle.h" using namespace physx; using namespace Gu; #define LOCAL_EPSILON 0.00001f // PT: this value makes...
ALGO
0.997066
6.674758
78a04b1d-244d-4597-8e55-dd9add316287
ishandutta2007/codeforces
shayan.p/normal/1246/F.cpp
// Remember... #include<bits/stdc++.h> #define F first #define S second #define PB push_back #define sz(s) int((s).size()) #define bit(n,k) (((n)>>(k))&1) using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; const int maxn=1e5+10,mod=1e9+7; const ll inf=1e18; int n; int a...
ALGO
0.999985
3.697638
f5028219-8b4c-43ab-a880-5f2339201d63
tjscha/CompetitiveProgramming-Cpp
judging/judging.cpp
#include <iostream> #include <unordered_map> #include <string> #include <cstdlib> using namespace std; int main() { long long len; cin>>len; unordered_map<string,long long> dom; unordered_map<string,long long> kat; long long sum = 0; string next; for(int i = 0; i < len; ++i){ ci...
ALGO
0.999973
3.493872
65abc01b-c58d-44b0-a96c-55da266cdcb0
daoffner/Astrometrica
persian.cpp
#include <math.h> #include "watdefs.h" #include "afuncs.h" #define PI 3.1415926535897932384626 /* See this code also in DATE.CPP. It determines the date of the beginning of the Persian year, in JD form. It so happens that this can be expressed, in somewhat "condensed" form, using the following not-too-terribly-co...
ALGO
0.999815
5.041727
32cfc309-3da9-4301-b092-cb9a6b3c2495
zhou-xingxing/algorithm_self
动态规划/背包问题/二维01背包.cpp
#include<stdio.h> #include<iostream> #include<string> #include<cmath> #include<algorithm> #include<stdlib.h> using namespace std; int a[1005][1005]; int w[1005]; int c[1005]; int v[1005]; //01ͬ int self_max(int a,int b){ return a>b? a:b; } int main(){ int n,W,C; cin>>n>>W>>C; for(int i=0;i<n;i++){ cin>>w[i]>...
ALGO
0.999976
3.642087
a219bd42-ccdc-4c77-8c11-21766bfaac3a
DysonHoang/Tin-Hoc
time-skip/season 1/HDA_LQD_12-17/pairpbro.cpp
// Good wine must be aged for a long time... // Hoang Duc Anh #include <bits/stdc++.h> #define Mx 10000000 #define ll long long using namespace std; int max1 = INT_MIN; int min1 = INT_MAX; bool SNT[Mx + 5]; void sangnt() { for (int i = 2; i <= Mx; i++) SNT[i] = 1; for (int i = 2; i <= sqrt(Mx); i++) ...
ALGO
0.999968
4.010957
235f1c37-4e39-4ab4-a7d9-70ba4aa7c088
danhmatem/hackerrank
LTNC-01/B7.cpp
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); /* * Complete the 'plusMinus' function below. * * The function accepts INTEGER_ARRAY arr as parameter. */ void plusMinus(vector<int> arr) { int pos = 0,neg = 0, zer...
ALGO
0.998904
4.674896
f86c7859-7abf-4d69-a0aa-b5fd775df3fb
TranBaLoi/Code_C_plus_plus
TichGiaiThuaCacChuSo.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while(t--) { int n; string s; int a[10]={0}; cin >> n >> s; for(int i=0;i<s.size();i++) { int tmp=s[i]-'0'; if(tmp==1) continue; else if(tmp==9) { a[3]+=2; a[7]++; a[2]++; } else if(tmp==8) { a[7]++;...
ALGO
0.999825
4.555374
6bbb341c-cff3-41e6-bbc2-d92c7a5d1c7a
satvik007/Scanner_OP
A4-paper-sheet-detection-and-cropping/Header_files/eigen/doc/snippets/MatrixBase_all.cpp
Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones()); Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs(); // let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax: cout << "Is (" << p0.transpose() << ") inside the box: " << ((boxMin.array()<p0.array(...
ALGO
0.990346
3.51303
cc10775d-fce9-4fc2-8c06-50ff391aa1e1
YakutsukuriYuu/JuCpp
icloud/ipadcpp/luogu/P1367.cpp
#include <iostream> #include <algorithm> using namespace std; struct Node{ int x; int d; int id; }ants[100005],bnts[100005]; int order[100005]; int n,t; bool cmp(Node x,Node y){ return x.x<y.x; } void input(){ cin>>n>>t; for(int i=1;i<=n;i++){ int x,d; cin>>x>>d; ants[...
ALGO
0.999906
3.294123
f577c40f-092f-4111-95bb-c6b8191ff3d8
rohmatalpur/Data-Structure-Implementations
Ring.cpp
#include<iostream> using namespace std; class node{ public: int data; node *next; node(int data){ this->data=data; next=NULL; } }; class Ring{ private: node *head; int length; public: Ring(){ length=0; head=NULL; //head->next=head; } ~Ring(){ head=NULL; delete head; } vo...
ALGO
0.975259
3.576137
79a80da1-cff2-44de-ae54-2cce7d91facd
yousefbenattar/stories_application
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
f9393214-41a4-48a4-9b84-b5bfcd3a4c96
IshanGarg123/Love-Babbar-Coding-Course
Love Babbar/DP4/Lec-133/C++3.cpp
// Leetcode - 188 // Best Time to Buy and Sell Stock IV // Tabulation // T.C. = O(N*k) S.C = O(N*K); #include <iostream> using namespace std; #include <limits.h> #include <vector> #include <map> int maxProfit(int k, vector<int> &prices) { int n = prices.size(); vector<vector<int>> dp(n + 1, vector<int>(2 * k...
ALGO
0.99957
5.943492
9852eee8-140a-469c-a9fb-2445b785cee6
highlycaustic/OOP_sem4
Task2/vectmethods.cpp
#include "randminmax.h" #include <cmath> #include <iostream> #include <vector> namespace vect { // Процедура заполнения вектора случайными числами в заданном диапазоне. void arrRandom(std::vector<int>& vect, int min, int max) { for (int i = 0; i < vect.size(); ++i) { vect[i] = randMinMax(min, max); } } //...
TOOL
0.985183
4.24188
ba9b55fc-a594-46f8-a862-ee1be77b152a
Rajvansh2003/Leetcode-solutions
2501-longest-square-streak-in-an-array/2501-longest-square-streak-in-an-array.cpp
class Solution { public: void getSequence(vector<int>&nums,long long start,int &temp_long,vector<bool>&vis){ start=start*start; while(1){ auto it = lower_bound(nums.begin(),nums.end(),start); if(it!=nums.end() && start==(*it)){ start*=start;vis[it-nums.begin()...
ALGO
0.999986
5.184905
c486a29e-477c-4d91-845e-5ed306e5d264
UllasDas004/DSA-WITH-CPP-Learning-
22 TREE/BINARY TREE/preorder.cpp
#include<iostream> #include<climits> using namespace std; class Node { public: int val; Node* left; Node* right; Node(int val) { this->val = val; left = NULL; right = NULL; } }; void predisplay(Node* root) { if(root == NULL) return; cout<<root->val<<" "; ...
ALGO
0.999893
5.091777
d8178f87-0ff2-4e75-9f0f-953818ce684a
Saad07Khan/dsa
256makingalargeisland.cpp
class DisjointSet { public: vector<int> rank, parent, size; // rank: array to store rank of each set // parent: array to store parent of each node // size: array to store size of each set DisjointSet(int n) { rank.resize(n + 1, 0); parent.resize(n + 1); size.resize(n + 1)...
ALGO
0.999801
6.033631
96e7314c-668a-4fbc-9b1e-21267bedf873
2020147542/PS
250225/재귀함수를 이용한 최소공배수/least-common-multiple-using-recursive-function.cpp
#include <iostream> #include <algorithm> using namespace std; int n, ans; int x[10]; int r[4] = {2, 3, 5, 7}; int gcd(int a, int b) { if(a == 1 || b == 1) return a * b; for(int i = 0; i < 4; i++){ if ((a % r[i] == 0) && (b % r[i] == 0)) { return r[i] * gcd(a / r[i], b / r[i]); } ...
ALGO
0.999949
4.554292
255be2ec-2037-43c2-918f-a941d78b8e36
manpreetnub23/leetCode
minDistance.cpp
#include <bits/stdc++.h> class Solution { public: int distanceBetweenBusStops(std::vector<int> &distance, int start, int destination) { int totalSumSimple = 0, totalSumReverse = 0; // for (int i = start; i < destination - 1; i++) // { // totalSumSimple += distance[i]; ...
ALGO
0.999974
4.715415
c87178da-a8b0-4ab5-8142-e8d2ba4a459d
ishandutta2007/codeforces
abc864197532/normal/1194/B.cpp
#include <iostream> #include <vector> // vector #include <algorithm> // sort #include <math.h> // math #include <map> // map #include <string> // string using namespace std; int row[50000],col[50000]; int n,m; int main () { int t,a,i,j; char q; cin >> t; for (a=0;a<t;++a) { cin >> n >> m; int nums[n][m]; fo...
ALGO
0.999804
3.898643
aa180ea2-0a68-4056-b26b-0a8ccf9522bc
Raghav1034/CPPDS_Pointers
pointers3.cpp
#include<iostream> using namespace std; void swap (int *x,int *y); int main() { int i,j,c; i = 5; j = 8; cout<<"Before Swap "<<i<<j<<endl; swap(&i,&j); cout<<"After Swap "<<i<<j<<endl; } void swap(int *m , int *n) { int tmp; tmp = *m; *m = *n; *n = tmp; return; } //call by ...
ALGO
0.999205
4.769766
f4b24eed-7242-493b-b893-49c16578f69a
qlyao/leetcode
166 Fraction to Recurring Decimal/fraction_to_recurring_decimal.cpp
/* * LeetCode Submissions by Xinyu Chen * Fraction to Recurring Decimal * https://leetcode.com/problems/fraction-to-recurring-decimal/ * Runtime: 0 ms */ class Solution { public: string fractionToDecimal(int numerator, int denominator) { long long num = numerator; long long den = denominator; ...
ALGO
0.999951
6.317872
23efbecf-c742-4cf7-9017-091817ae9391
gbeliako/fm_random
minimalsplus.cpp
/* This code is based on the program supplied by Elias Combarro and Susana Irene Diaz Rodribuez in October 2019, which is also published in their paper "Minimals plus: An improved algorithm for the random generation of linear extensions of partially ordered sets." Information Sciences, 501:50–67, 2019. The program ...
ALGO
0.999752
3.811027
76d42112-fc9c-45de-9e51-3d167a556d1b
matthewJ1981/dataStructures
dataStructures/dataStructures/ch1ex2.cpp
#include <iostream> #include <vector> //Convert 1d position to 2d position, y is first. std::pair<size_t, size_t> convertToCoords(size_t pos, size_t width) { return { pos / width + 1, pos % width + 1 }; } //check to see if a move from the current position is a valid position on the board. //Starting attempt is posit...
ALGO
0.998526
5.702255
031dffdb-92c1-4a36-8d98-8f492fb2da43
jennkimm/Algorithm
baekjoon/14500.cpp
#include <stdio.h> #include <vector> #include <algorithm> using namespace std; int n, m; vector<vector<int>> v; vector<vector<bool>> visited; int dx[] = {0, 0, 1, -1}; int dy[] = {1, -1, 0, 0}; int ans = 0; void dfs(int x, int y, int depth, int result) { if (depth == 3) { //printf("ans = %d, result = %d\n", ans ,...
ALGO
0.999974
3.996748
441211bc-f382-479f-9b9e-f374515fcfd1
thegamer1907/Code_Analysis
contest/1542581845.cpp
#include <bits/stdc++.h> using namespace std; #if 0 bool exist[100005]; int power(int x , int y) { int f = 1; while(y--) f *= x; return f; } #endif bool vis[62]; int main() { /*int n , k; scanf("%d%d" , &n , &k); bool can = false; for(int i=0 ; i<n ; i++) { ...
ALGO
0.999888
3.046272
8dc505e6-2354-46c0-8a85-69a49ea82330
bhaak/HackedUpReader
thirdparty/agg/examples/interactive_polygon.cpp
#include "agg_basics.h" #include "interactive_polygon.h" namespace agg { interactive_polygon::interactive_polygon(unsigned np, double point_radius) : m_polygon(np * 2), m_num_points(np), m_node(-1), m_edge(-1), m_vs(&m_polygon[0], m_num_points, false), m_stroke(m_vs)...
ALGO
0.998379
6.740976
5e177fed-70d3-48d6-8f17-8cc69633f72a
jungahshin/algorithm
c:c++/2206_review.cpp
//벽 부수고 이동하기 #include <iostream> #include <queue> #include <climits> using namespace std; int map[1001][1001] = {0, }; int visited[1001][1001][2] = {0, }; string s; int dx[4] = {0, 0, -1, 1}; int dy[4] = {-1, 1, 0, 0}; int final = INT_MAX; int n, m; //(0, 0)에서 (n-1, m-1)로 도착하는 데에 최소경로 //BFS로 가면서 num이 0이면 벽 하나를 부수고 이동...
ALGO
0.999987
4.213781
7b084ae2-bd37-41e8-ba44-daf2d66b4a97
Vanhoai/MasterAlgorithms
practice/sort_search/sort_by_abs.cpp
#include <iostream> using namespace std; #include <iostream> using namespace std; #define ms(s, n) memset(s, n, sizeof(s)) #define all(a) a.begin(), a.end() #define sz(a) int((a).size()) #define FOR(i, a, b) for (int i = (a); i <= (b); ++i) #define FORD(i, a, b) for (int i = (a); i >= b; --i) #d...
ALGO
0.99991
3.616243
e60ec9ce-6320-49aa-a95c-497100e5f54c
vquilon/DOM-Physics-Engine
lib/box2d/box2d-emscripten/Box2D_v2.2.1/Box2D/Collision/Shapes/b2EdgeShape.cpp
#include <Box2D/Collision/Shapes/b2EdgeShape.h> #include <new> using namespace std; void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2) { m_vertex1 = v1; m_vertex2 = v2; m_hasVertex0 = false; m_hasVertex3 = false; } b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const { void* mem = allocator->All...
ALGO
0.964541
7.591003
9c2ccf11-5d22-4bbb-af37-42436901678c
calvinle/weightliftingCalc
calc.cpp
#include "calc.h" //Discs double const red = 25.0; double const blue = 20.0; double const yellow = 15.0; double const green = 10.0; double const white = 5.0; double const microBlack = 2.5; double const microWhite0 = 1.25; double const microWhite1 = 0.5; double const microWhite2 = 0.25; //Array to hold count of Discs d...
TOOL
0.931047
3.784391
57c55dab-db93-4201-b108-29205e980ee2
Nehasharma97549/job-ready-bootcamp-all-assignments
bootcamp_assignment_31/31_7th.cpp
//7- #include <iostream> using namespace std; class Employee { protected: int empCode; char name[20]; public: void acceptData() { cout << "\nEnter employee no. : "; cin >> empCode; cout << "\nEnter employee name : "; cin >> name; } int getEmpid() { return empCode...
TOOL
0.974406
3.278605
e6c0ab44-7d3b-4cbe-85f5-bcd3fd553d3e
SI-Abid/ACM
TPC-2/a.cpp
#include<bits/stdc++.h> using namespace std; #define PI acos(-1) int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); double a,b; string c; while(cin>>a>>c>>b) { double rat = a/b; double w = 400/((PI*0.685)+2*rat); double l = w*rat; cout << "Case " << ...
ALGO
0.998179
3.436707
307d1b5c-e0f6-43fb-b5f0-bafe3fe01c80
mafraba/ANPR
src/Band.cpp
/* * Band.cpp * * Created on: 21/01/2011 * Author: SEMDFF */ #include <iostream> #include <sstream> #include <string> #include <cv.h> #include "Band.h" #include "commons.h" namespace anpr { Band::Band(cv::Mat input, int y0, int y1, bool clone) : data(input), top(y0), bottom(y1), cloned(clone), project...
ALGO
0.995809
4.316473
5550218d-90f2-4cda-98f9-9389952ddccf
alexandru-andronache/projecteuler
problems/problem_035/main.cpp
#include "sieve_eratosthenes.h" #include <cmath> #include <iostream> namespace problem_035 { int solve(int n) { math::SieveEratosthenes se(n); int nr = 0; for (int i = 2; i < n; ++i) { int multiply = std::pow(10, std::to_string(i).length() - 1); int k = i; ...
ALGO
0.999464
5.985979
f3120660-4724-4ef5-874f-89f54d4214d0
quynezz/LeetCodeProblems
easy and medium/3417. Zigzag Grid Traversal With Skip/zigzag.cpp
class Solution { public: vector<int> zigzagTraversal(vector<vector<int>>& grid) { int R = grid.size(); int C = grid[0].size(); vector<int> v; // flip the direction (false = right, true = left) bool flip = false; // already take ? false = need take, true = no need tak...
ALGO
0.999998
5.961104
3d520b09-9379-4cd8-95e2-2fe42134b749
vibhmitra/dac-public
00-Curriculum/Assignments/01_CPP/Assignment-1/3-CalSumDecimal.cpp
/* Problem 3 - Cal sum of four decimal. */ #include <iostream> using namespace std; int main() { float a, b, c, d, sum, avg; cout << "Enter First Number: "; cin >> a; cout << "Enter Second Number: "; cin >> b; cout << "Enter Third Number: "; cin >> c; cout << "Enter Forth Number: "; ...
ALGO
0.969417
3.634014
ed38933c-fc7c-43fd-81ae-1a9e867b064a
bashell/leetcode
16_3SumCloset.cpp
class Solution { public: int threeSumClosest(vector<int>& nums, int target) { if(nums.size() == 3) return std::accumulate(nums.cbegin(), nums.cend(), 0); std::sort(nums.begin(), nums.end()); int n = nums.size(); int diff_min = INT_MAX, sum_min = INT_MAX; for(int i = 0; i < n;...
ALGO
0.999991
6.217335
e4a7d748-3124-42a2-8cbb-5c5e9753de1e
shubhansu-kr/DailyChallenge-2025-LeetCode
06_June_2025/16_CountArr.cpp
// https://leetcode.com/problems/count-the-number-of-arrays-with-k-matching-adjacent-elements/?envType=daily-question&envId=2025-06-17 #include <bits/stdc++.h> using namespace std ; auto init = []() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); return 'c'; }(); class Solution { public: stat...
ALGO
0.999969
4.675826
eeac8bb2-9011-4367-b54a-c37924f83139
Harsh-Sisodia857/Love-Babbar-DSA-Sheet
Bit Manipulation/findPosition.cpp
int findPosition(int N) { int n = N; if (n && (n & (n - 1)) == 0) { int count = 0; while (n) { count++; n = (n >> 1); } return count; } else { return -1; } }
ALGO
0.999663
4.931795
899cbc74-f045-4660-ac42-0a7d88e39d80
sm823zw/leetcode
remove-nth-node-from-end-of-list/remove-nth-node-from-end-of-list.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* removeNthFr...
ALGO
0.999971
5.998853
99fed6b3-c467-4245-aa2c-4af119acd876
ankitam777/LeetCode-Solved-Questions
Number of NGEs to the right - GFG/number-of-nges-to-the-right.cpp
//{ Driver Code Starts //Initial Template for C++ #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution{ public: vector<int> count_NGE(int n, vector<int> &arr, int queries, vector<int> &indices){ //write your code here vector<int> v; ...
ALGO
0.999933
5.399592
83059919-7dfb-497e-adc9-449351308f91
priyanshukoshta5/MOB100-Leetcode-GFG
2695-find-score-of-an-array-after-marking-all-elements/2695-find-score-of-an-array-after-marking-all-elements.cpp
class Solution { public: long long findScore(vector<int>& nums) { int n = nums.size(); priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int,int>>> minH; for(int i = 0; i < n; i++) minH.push({nums[i], i}); vector<bool> vis(n, false); lo...
ALGO
0.999986
5.320541
7ac85c04-f874-421a-ac48-9723ce879529
BIAOXYZ/variousCodes
_CodeTopics/LeetCode/201-400/000219/tran/000219.cpp
class Solution { public: bool containsNearbyDuplicate(vector<int>& nums, int k) { unordered_map<int, vector<int>> dic; for (int i = 0; i < nums.size(); ++i) { int num = nums[i]; // C++ 判断map里是否有某个key是用map的count()方法。 // 当然,也可以用 map 自己的 find 方法。 if (dic...
ALGO
0.999857
6.090079
e05b24f8-ee14-4c7a-9e53-0a295719ca15
MRSlothAlan/CodeForcePractice
1476A_k_divisible_sum/Source.cpp
#pragma warning(disable : 4996) #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <math.h> using namespace std; int main() { int t; scanf("%d", &t); while (t--) { long long int n, k; scanf("%lld %lld", &n, &k); long long int res = 0; /* if (n > k) { res = (long long int)c...
ALGO
0.999877
3.808924
ffd4369e-31c3-4587-a07b-72798ca0d10c
qijun-jiang/eecs584
executor.cpp
#include <iostream> #include "executor.h" using namespace std; struct CompareInfo{ CompareInfo(string table_name_, double attr_value_){ table_name = table_name_; attr_value = attr_value_; } string table_name; double attr_value; }; bool NoCompareCallback(ValueType id, void* arg) { C...
TOOL
0.931177
3.82142
22be82c1-1963-4a17-9a15-99d6a99e01e4
tingsu/DroidDefects
reproducible-cases/Mitzuli-com.mitzuli-1.0.7/com.mitzuli_10007_src.tar.gz/libraries/tesseract-android-tools/src/main/native/com_googlecode_tesseract_android/src/cube/char_bigrams.cpp
#include <algorithm> #include <math.h> #include <string> #include <vector> #include "char_bigrams.h" #include "cube_utils.h" #include "ndminx.h" #include "cube_const.h" namespace tesseract { CharBigrams::CharBigrams() { memset(&bigram_table_, 0, sizeof(bigram_table_)); } CharBigrams::~CharBigrams() { if (bigram...
ALGO
0.945169
6.006968
14646a32-8fc9-44ba-9dee-2aa5b36b38f8
mrhidan/Algorithm-2-Homework-2
algorithm_2_task_1.cpp
#include <cmath> #include <cstdlib> #include <ctime> #include <iostream> #include <iterator> #include <limits> #include <unordered_map> #include <unordered_set> #include <set> #include <vector> #include <string> #include <fstream> class Graph { public: using Vertex = size_t; using VertexSet = std::unordered_s...
ALGO
0.99952
5.45839
165d0002-245e-4577-b4db-f13edaaa4e54
LAM-GROUP/LammpsWithPLIP
src/compute_vcm_chunk.cpp
#include <string.h> #include "compute_vcm_chunk.h" #include "atom.h" #include "update.h" #include "modify.h" #include "compute_chunk_atom.h" #include "domain.h" #include "memory.h" #include "error.h" using namespace LAMMPS_NS; enum{ONCE,NFREQ,EVERY}; /* ---------------------------------------------------------------...
TOOL
0.924987
5.622988
5665fa75-452a-4310-a788-7da32afcd2ac
Raghav1209/Leetcode_practice_questions
39-combination-sum/39-combination-sum.cpp
class Solution { public: void solve(vector<int> nums,int n,vector<int> v,set<vector<int>> &s,int index,int sum){ if(sum<0){ return; } if(sum==0){ sort(v.begin(),v.end()); s.insert(v); return; } for(int...
ALGO
0.999994
6.429866
9fadd5b2-60af-4cfd-9379-488a2970ef60
yvlaere/yvl-chess
move_generation.cpp
#include "move_generation.h" // usefull functions U64 combine_white(const std::array<U64, 12>& piece_bitboards) { U64 combined = 0; for (int i = 0; i < 6; i++) { combined |= piece_bitboards[i]; } return combined; } U64 combine_black(const std::array<U64, 12>& piece_bitboards) { U64 combin...
ALGO
0.998199
4.482237
f8ec69f2-4e76-4c62-89ac-de4c22bcf96c
devanshV18/DSA
GreedyAlgorithm/fractionalKnapsack.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; struct Item{ int value; int weight; }; bool compare(Item a, Item b){ double r1 = (double) a.value / (double) a.weight; //calculating val/wt for item a double r2 = (double) b.value / (double) b.weight; //calculating val/wt for ite...
ALGO
0.999916
5.579361
43441d72-3b90-4219-8154-2456634feb9a
kangtae1/Algorithm_Study
Baekjoon/Silver/11052.cpp
#include <iostream> using namespace std; int main() { int N; cin >> N; int P[N + 1]; for (int i = 1; i <= N; i++) { cin >> P[i]; } int dp[N + 1]; for (int i = 1; i <= N; i++){ dp[i] = P[i]; for (int j = 1; j < i; j++) { dp[i] = max(dp[i], dp[i - j] + P[...
ALGO
0.999932
4.157255
2d43d59f-4040-400b-afb8-bc77d4f082a8
acgtun/leetcode
algorithms/cpp/Majority Element II.cpp
class Solution { public: vector<int> majorityElement(vector<int>& nums) { vector<int> ret; if(nums.size() == 0) return ret; int cand1, counter1 = 0; int cand2, counter2 = 0; for(int i = 0;i < nums.size();++i) { if(counter1 == 0 && nums[i] != cand2) { ...
ALGO
0.999987
5.571883
0d2ccc35-2cd0-470d-b2a8-aa7527c01c0a
mianfg-DGIIM/MP
Teoría/Tema 2/Problemas/ejercicio6.cpp
#include <iostream> using namespace std; #define SIZE 10 void buscarCotas ( int * arr, int * &pMax, int * &pMin ) { pMax = arr; pMin = arr; for ( int *p = arr; p < arr+SIZE; p++ ) { if ( *p > *pMax ) pMax = p; if ( *p < *pMin ) pMin = p; } } // Los tres funcionan igualmente int main()...
ALGO
0.999968
4.007631
a3d1d6d8-4bbb-4f98-9c24-22a12ebe05ed
1Rituraj/Program_cpp
recursion_in_cpp/oldRecursion/base_power.cpp
#include<bits/stdc++.h> using namespace std; double pow(double b,long long p) { if(p==0) return 1; else return b*pow(b,p-1); } int main() { double b; long long p; cout<<"ENTER BASE AND POWER:\n"; cin>>b>>p; cout<<pow(b,p); }
ALGO
0.999963
4.636977
eecb0c55-2e0b-42ce-8e55-8fdea0ecf5f3
sangmin970528/BOJ-algorithm
category/dp/14002_가장 긴 증가하는 부분 수열 4.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cmath> #include <stack> #include <queue> #include <deque> #include <climits> using namespace ::std; int g[1001]; int main(){ cin.tie(NULL); ios_base::sync_with_stdio(false); int n; cin >> n; int a[1001]={0}; in...
ALGO
0.999999
3.797806
e1e7bbf6-438e-4c98-a143-40617143c856
ishandutta2007/codeforces
magga/normal/1304/E.cpp
#include<bits/stdc++.h> using namespace std; struct LCA { vector<int> height, euler, first, segtree; vector<bool> visited; int n; LCA(vector<vector<int>> &adj, int root = 0) { n = adj.size(); height.resize(n); first.resize(n); euler.reserve(n * 2); visited.assign...
ALGO
0.999986
4.712412
54ecb072-5ae4-473d-954e-2b367b894cc5
Nithi-Kerdmongkhon/Weather-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.9988
6.76073
c5ef2925-2227-481d-af2c-fae1e166e22f
Alexisflipi/Club-de-Algoritmia
Reference 2017/Arboles/Binary Search Tree.cpp
#include <bits/stdc++.h> #define MAX 1000 using namespace std; //Binary Search Tree //Nodos indexados de 0 ... n - 1 //c indica el tipo de dato a guardar typedef char c; typedef vector<int> vi; struct T{ vector<c> clave; vi izq, der, visited; vector<c> t; int nodos = 0; T(int n) : izq(n), der(n), visited(...
ALGO
0.999907
3.797751
8f7fe621-9e62-434a-bf42-c689f7c3812e
HKUST-Aerial-Robotics/EPSILON
core/vehicle_model/thirdparty/odeint-v2/libs/numeric/odeint/examples/resizing_lattice.cpp
#include <iostream> #include <utility> #include <boost/numeric/odeint.hpp> #include <boost/ref.hpp> #include <boost/random.hpp> using namespace std; using namespace boost::numeric::odeint; //[ resizing_lattice_system_class typedef vector< double > coord_type; typedef pair< coord_type , coord_type > state_type; str...
ALGO
0.999856
5.029648
239d736c-46e1-4ec8-b843-82fc190f23a0
ZhangGroup-MITChemistry/Explicit_Ion_Chromatin
Code/example_lammps_src/USER-MISC/fix_ttm_mod.cpp
/* ---------------------------------------------------------------------- Contributing authors: (in addition to authors of original fix ttm) Sergey Starikov (Joint Institute for High Temperatures of RAS) Vasily Pisarev (Joint Institute for High Temperatures of RAS) ---------------------------------------------...
ALGO
0.940101
5.887865
b4aa9eab-e864-441f-8a96-1d442dbff89d
Phobos25/basics-of-cpp-red-belt
week6/final_part2/search_server.cpp
#include "search_server.h" #include "synchronized.h" #include "iterator_range.h" #include <algorithm> #include <iterator> #include <sstream> #include <vector> #include <iostream> #include <numeric> #include <future> using namespace std; vector<string> SplitIntoWords(const string& line); void UpdateIndex(istream& doc...
WEB
0.984567
5.489364
8a07731c-9183-406a-b2ad-380ea01a48df
clay-arras/cp-practice
codeforces/newsolved/1007A.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "algo/debug.h" #define open(x) freopen(x, "r", stdin); #else #define open(x) #endif void solve() { int N; cin >> N; vector<int> A(N); for (int& t : A) cin >> t; sort(A.begin(), A.end()); int count = 0; multiset<int> ...
ALGO
0.9998
4.135975
6202a1bf-f4d7-4aee-9bf1-5d404452c38d
parul148/dsa
array/reverse_array.cpp
#include<iostream> using namespace std; int reverse(int arr[],int n) { int start =0; int end= n-1; while(start<=end){ swap(arr[start],arr[end]); start++; end --; } } int printArray(int arr[], int size){ for(int i=0;i<size; i++){ cout<<arr[i]<<" "; } cout<<en...
ALGO
0.999419
5.296515
5b42eb4e-5598-4598-9368-5b56c02bb700
sanketa124/Leetcode-all
C++/amount-of-new-area-painted-each-day.cpp
// Time: O(nlogr), r is the max position // Space: O(r) template <typename T> class SegmentTree { public: explicit SegmentTree( int N, const function<T(const T&, const T&)>& query_fn, const function<T(const T&, const T&)>& update_fn) : base_(N), tree_(2 * N), lazy_(2...
ALGO
0.999941
6.316105