uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
833f333c-14bc-4585-931c-a7adb0e21dd4
keyclehhh/MyFirstProject
15/main.cpp
#include <stdio.h> #include <stdlib.h> typedef int Element; typedef struct Btree { Element data; struct Btree *Lchild, *Rchild; }Btree,*BNode; int Building_a_binary_tree(BNode &L,Element i) { if(L==NULL) { L=(BNode)malloc(sizeof(Btree)); L->data=i; L->Lchild=L->Rchild=NULL; ...
ALGO
0.999872
3.53382
5b71961a-34ca-4280-b3b6-b0d496ce9991
Manvitha2011/Compiler-design-
2.Check comments.cpp
#include <stdio.h> #include <ctype.h> #include <string.h> #define MAX_LENGTH 100 // Maximum length for input line // Function to check for single-line comments (//) int is_single_line_comment(char *line) { return strstr(line, "//") != NULL; } // Function to check for multi-line comments (/* */) int is_multi_lin...
ALGO
0.99713
7.253997
04ecdfa9-3f01-4021-877a-02489802b4fa
li924579/ACM
2015暑假集训/DAY-12/test.cpp
#include<iostream> #include<cstdio> #include<cstring> #include <cmath> #include<stack> #include<vector> #include<map> #include<set> #include<queue> #include<algorithm> using namespace std; #define foreach(i,c) for (__typeof(c.begin()) i = c.begin(); i != c.end(); ++i) typedef long long LL; const int INF = (...
ALGO
0.999301
3.493289
84f03069-15d4-4450-acbd-f03f8cb1feac
Kawser-nerd/CLCDSA
Source Codes/AtCoder/arc085/D/2583092.cpp
#include<iostream> #include<cstring> #include<cstdio> #include<vector> using namespace std; inline int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();} return x*f; } #define MN 200005 #define N 262144 int n,m,nu...
ALGO
0.999892
3.202678
71dd68be-a5c4-4bf7-bef2-6e0e735aaf04
itxarsalan006/C-Fundemental
LoopWhileLoop(7.12).cpp
#include<iostream> using namespace std; int main() { int n; cin>>n; int sum=0; while(true){ //The while loop will continue untill when the condition is true int num; cin>>num; if(n>num){ cout<<"Okay"<<endl; break; }else{ cout<<"Bye"<<endl; } } return 0; }
ALGO
0.999774
3.787079
253a409e-6836-4487-8d54-104607750cfa
PaukIsUha/optimizing_formating_code
predictions/submissions-aizu-gpt4/Codenet/p02270/594592961/response_3.cpp
#include <iostream> #include <numeric> #include <vector> #include <algorithm> using namespace std; vector<int> Input(const int n) { vector<int> W(n); for (int i = 0; i < n; ++i) { cin >> W[i]; } return W; } bool IsAllLoaded(int P, const vector<int>& W, int k) { int TrackIndex = 0; int CurrentSum = 0; ...
ALGO
0.99997
4.495126
ad42ceff-bf43-4fc6-a40b-7c078b80c635
priya2001/AC_potd_leetcode
0201-bitwise-and-of-numbers-range/0201-bitwise-and-of-numbers-range.cpp
class Solution { public: int rangeBitwiseAnd(int left, int right) { int count = 0; while(left != right){ left = left>>1; right = right>>1; count++; } return left<<count; } };
ALGO
0.999935
6.027342
490569b9-1368-4e57-b299-ab9a9af4e18e
Liamsi2001/INFO-F413-Assignement-1
main.cpp
#include <iostream> #include <fstream> #include <ctime> #include <cstdlib> #include <vector> #include <chrono> // For timing #include <algorithm> // For std::shuffle #include <random> // For std::mt19937 and std::uniform_int_distribution #include "quickselection.hpp" // Include QuickSelect header #include "lazyselecti...
ALGO
0.993635
6.420149
4cf6d97a-5182-4e96-a694-5946958416f0
shavidze/Codeforces
687C.cpp
#include <iostream> #include <algorithm> #include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <cstring> #include <bitset> #include <algorithm> #include <string> #include <functional> #include <numeric> #include <utility> #include <sstream> #include ...
ALGO
0.999991
3.041638
6d0b6c3a-ce6f-4f9c-a387-e4517628b388
Akshatgupta000/DSA
babbar/BASICS/conditionals/ternary.cpp
#include<iostream> using namespace std; int main(){ int n; cout<<"enter n:"; cin>>n; // (condition) ? if true : if false; (n%2==0) ? cout<<"even" : cout<<"odd"; return 0; }
ALGO
0.999383
3.203911
1e4ded2d-df49-460c-9c75-d52bfc071597
LEECHHE/acmicpc
solved/8891.cpp
#include <cstdio> #include <utility> #include <algorithm> using namespace std; typedef pair<int, int> intPair; int first(int k){ return (k-1)*k/2+1; } int find(int k){ if( k == 1) return 1; for( int i = 1 ; ; ++i ){ if( first(i) > k ){ return i-1; } } } intPair pos(int t...
ALGO
0.99992
3.959295
842fb720-029e-43be-8f98-7011eb933648
raincross7/code-similarity
codes/train_code/problem358/problem358_150.cpp
#include <iostream> #include <string> #include <vector> using ll=long long; using namespace std; int main(){ string S; cin>>S; if(S[2]==S[3] && S[4]==S[5]){ cout<<"Yes"<<endl; }else{ cout<<"No"<<endl; } return 0; }
ALGO
0.999801
3.067458
87058f63-73c3-418e-bdb8-09a25ae9d00b
ameknite/codewars_legacy
cpp/8kyu/monkey_count.cpp
#include <vector> std::vector<int> MonkeyCount(int n) { std::vector<int> monkeys; monkeys.reserve(n); for (size_t i = 1; i <= n; i++) { monkeys.push_back(i); } return monkeys; }
ALGO
0.957785
5.418525
c389ed74-407f-4906-bc50-3cfe956f818a
Zerefez/DOA-general-codes
BRRR/sum_project/sum_project.cpp
#include <iostream> #include <assert.h> using namespace std; int sum(int* ar, int size) { if (size == 0) return 0; int toSum = ar[0]; int partialTotal = sum(ar + 1, size - 1); return toSum + partialTotal; } int main() { int arr[10] = { 1,2,3,4,5,6,7,8,9,10 }; assert(sum(arr, 10) == 55); return 0; }
ALGO
0.993394
5.517121
ff4cc361-ca61-4047-a595-3f979c145543
siddhantadhav/dsa
array/maxDifference.cpp
#include <bits/stdc++.h> using namespace std; // brute force int bruteForce(vector<int> &nums){ int n = nums.size(); int ans = -1; for(int i=0; i<n; i++){ int maxDiff = -1; for(int j=i+1; j<n; j++){ if(nums[j] > nums[i]){ int diff = nums[j] - nums[i]; if(maxDiff < diff) maxDiff =...
ALGO
0.999538
4.572901
2f1903b6-20a5-44ea-b599-21220fe7b6f8
Purvak-L/Application-suite-for-swarm-intelligent-drones
apriltags/example/apriltags_demo.cpp
/** * @file april_tags.cpp * @brief Example application for April tags library * @author: Michael Kaess * * Opens the first available camera (typically a built in camera in a * laptop) and continuously detects April tags in the incoming * images. Detections are both visualized in the live image and shown * in t...
TOOL
0.914033
6.889575
f47e74bb-42f8-4fc6-8255-0b26c76bb471
iamassaduzzaman/cpp-for-data-structure
m3 class and object/sortting.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } // for ascending order // sort(a, a+n); // for descending order sort(a, a + n, greater<int>()); for (int i = 0; i < n; i++) { ...
ALGO
0.999757
4.38535
e41aa1ac-a7de-4796-8be0-cb0249e9356a
haleyalee/ECE3140-Final-Project
snakeGame.cpp
#include "snakeGame.h" #define NULL 0 snakeGame::snakeGame(int startingDir) { head = (SEG*)malloc(sizeof*head); food = (SEG*)malloc(sizeof*food); inPlay = 1; length = 1; currentDir = startingDir; head->x = START_X; head->y = START_Y; head->next = NULL; head->prev = NULL; foo...
TOOL
0.985408
5.051772
aa57c3d2-aac6-42ef-90d1-6ddcaf9b007d
ishandutta2007/codeforces
-23333/normal/1634/A.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,h,t) for (int i=h;i<=t;i++) #define dep(i,t,h) for (int i=t;i>=h;i--) int n,m; const int N=1000; char s[N]; int main() { ios::sync_with_stdio(false); int T; cin>>T; while (T--) { cin>>n>>m; cin>>s; bool tt=0; rep(i,0,n-1) if (s[i]!=s[n-1-i]) ...
ALGO
0.999975
3.447799
93afacd7-80d2-44f3-9d5e-615d82da1eb5
nikhilsinha822/CP
CP problems/C_Ntarsis_Set.cpp
#include<bits/stdc++.h> #define int int64_t #define pb push_back #define pB pop_back() #define mp make_pair #define sc second #define fr first using namespace std; void solve(){ int n,k; vector <int>v; cin >> n >> k; int a[n]; for(int i=0;i<n;i++) cin >> a[i]; for(int i=1,temp=0;i<=a[n-1];i++){ ...
ALGO
0.999938
3.423858
ce3d9895-c534-486f-9355-eaea29066bc3
TakumaSato777/Atcoder
230729/a.cpp
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n+1); i++) string S; int main() { cin >> S; bool hantei = false; string X[7] = {"ACE","BDF","C...
ALGO
0.999966
3.746922
d309b74d-afba-4800-8f83-f3dd5ad36069
balayogigmcs/connectivecare
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
6ad53e8a-3dc1-43f6-ac55-b9e55519f445
Zeta611/baekjoon-solutions
2261-가장-가까운-두-점.cpp
#include <algorithm> #include <iostream> #include <iterator> #include <limits> #include <utility> #include <vector> using point = std::pair<int, int>; inline int square(int n) { return n * n; } inline int dist_sq(point p1, point p2) { return square(p2.first - p1.first) + square(p2.second - p1.second); } int...
ALGO
0.99995
5.134833
edd405de-5e05-4eac-a91c-323082ab57e3
saulgame2010/Estructuras-de-datos
aprenderPilas.cpp
#include <stdio.h> #include <iostream> #include <stdlib.h> use namespace std; struct jajaPila { char dato; jajaPila *sig; }; void agregarPila(jajaPila *&pila, char dato) { jajaPila *nuevaPila = new jajaPila(); nuevaPila->dato = 'a'; nuevaPila->sig = pila; pila = nuevaPila; }
ALGO
0.956485
3.408577
a022ad58-53bd-4f35-a862-ebb28e539054
theadeshkhanna/DSA-Practice
71-simplify-path/71-simplify-path.cpp
class Solution { public: string simplifyPath(string path) { stack<string> st; string res = ""; int n = path.size(); for (int i = 0; i < n; i++) { if (path[i] == '/') continue; string temp = ""; while(i < n && path[i] != '/') {...
ALGO
0.999912
6.142245
382a60b4-1cff-45e8-91c6-e5e1e6818781
nikhil-shirsath/cpp
nCr_calculate_program.cpp
#include<iostream> using namespace std; int factorial(int val){ int fact =1; for(int i=1; i<=val ; i++){ fact*=i; } return fact; } int main(){ int n,r; cout<<"Enter value of n = "; cin>>n; cout<<"Enter value of r = "; cin>>r; int ans = factorial(n)/(factorial(n-r)...
ALGO
0.999117
4.889338
54dba5f7-ef2d-4038-b231-d8fbc7a27bc7
qhb1001/For-that-dream
Codeforces/Round #486/hcx/F_1.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> using namespace std; const int maxn=2e3+10; const int INF=0x3f3f3f3f; int rain[maxn],f[maxn],um[maxn]; int dp[maxn][maxn]; int a,n,m; int main(){ ios::sync_with_stdio(false); cin.tie(0); cin>>a>>n>>m; for(int i=1;i<=n;i++){ ...
ALGO
0.999843
3.642293
91aa1a20-a9d6-43bc-883c-640cb36baaac
Uzer447/Code
Codeforces/HQ9+.cpp
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int flag = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == 'H' || s[i] == 'Q' || s[i] == '9') { cout << "YES" << endl; flag = 1; break; } } if (f...
ALGO
0.996323
3.824048
766e8c2e-7aee-4443-bf31-768a7fd4ef3f
cuong2905say/codeforces
codeforces/1223B.cpp
/* author : cuong2905say created : 26-09-2022 20:41:35 UTC: +7 */ #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; int m[26]; void solve() { for (int i = 0; i < 26; i++) { m[i] = 0; } string s; string t; cin >> s >> t; for (in...
ALGO
0.999974
5.50378
33d13c4c-ddc1-4dd9-b9a0-b70e4433dcdf
Charles-T-T/Algorithm-Practice
Graph-theory/2065-maximalPathQuality/2065.cpp
#include <iostream> #include <vector> using namespace std; /* 给你一张 无向 图,图中有 n 个节点,节点编号从 0 到 n - 1 (都包括)。同时给你一个下标从 0 开始的整数数组 values ,其中 values[i] 是第 i 个节点的 价值 。同时给你一个下标从 0 开始的二维整数数组 edges ,其中 edges[j] = [uj, vj, timej] 表示节点 uj 和 vj 之间有一条需要 timej 秒才能通过的无向边。最后,给你一个整数 maxTime 。 合法路径 指的是图中任意一条从节点 0 开始,最终回到节点 0 ,且花费的总时间 不...
ALGO
0.999946
6.063859
61f60fef-2478-4a35-a6cf-a7f43681a9fc
BytesClub/ICPC-Preparation
ACM2017/NEERC/LostTransliteration.cpp
/** * Lost in Transliteration: http://codeforces.com/contest/883/problem/F * * There are some ambiguities when one writes Berland names with the letters of * the Latin alphabet. * * For example, the Berland sound u can be written in the Latin alphabet as "u", * and can be written as "oo". For this reason, two wo...
ALGO
0.999837
5.424709
457b8135-fa99-4171-877b-bde3eeed89ba
sssvip/LeetCode_lxw
LeetCode_CPP/num065/num065.cpp
// File: num065.cpp // Author: lxw // Date: 2015-07-07 /* Num num065: Valid Number Source: https://leetcode.com/problems/valid-number/ Validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true "abc" => false "1 a" => false "2e10" => true Note: It is intended for the problem statement to be a...
ALGO
0.972761
5.47623
f89409e8-4a84-4344-b409-6941121bb153
eugeous/-Mang1Chieu-UIT_NMLT_ThayKhang
Bai070/Bai070.cpp
#include <iostream> #include <iomanip> using namespace std; void Nhap(int[], int&); int TanSuat(int[], int, int); void LietKe(int[], int, int[], int); int main() { int a[100], b[100]; int n, m; Nhap(a, n); Nhap(b, m); LietKe(a, n, b, m); return 1; } void Nhap(int a[], int& n) { do { cout << "Nhap so phan t...
ALGO
0.999759
3.02892
8ab24eeb-212c-445c-afe4-5e4ec4e623b2
utkarshmaken/cp
iitk interview/night-fury/goldman-sachs/B.cpp
//PROCESS SCHEDULER #include <bits/stdc++.h> typedef long long ll; typedef long double ld; #define f(i,a,b) for(int i = a;i<b;i++) #define rep(i,a,b) for(int i = a;i<=b;i++) #define fd(i,a,b) for(int i = a;i>b;i--) #define repd(i,a,b) for(int i = a;i>=b;i--) #define pii pair<int,int> #define pll pair<ll,ll> #defi...
ALGO
0.999975
4.040585
3f4f8ffa-119b-4989-ac4c-8a4c6ee32a01
tiykuma/compe-program
DT truong/buoi 6/293.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) { for (int j = i; j < n; j++) { for (int k = i; k <= j; k++) cout << a[k] << " "; cout << endl; } } }
ALGO
0.999856
3.927507
4ddb0831-a020-4992-b1a5-f3b8bc958a10
AR13202/DS
Stacks/operations on stack.cpp
#include<iostream> using namespace std; class Node { public: int data; Node *next = NULL; Node(int x){ data = x; next = NULL; } }; class Stackusingll{ Node *head; int s; public: Stackusingll(){ Node *head = NULL; s = 0; } No...
ALGO
0.997643
4.035996
2ac3771d-6c51-413f-8664-8ca76814e9fa
LucasM127/CaveSystem
Tangent2Circles.cpp
//https://gieseanw.wordpress.com/2012/10/21/a-comprehensive-step-by-step-tutorial-to-computing-dubins-paths/ //plus figuring it out for my self the link helped a lot as my brain was mushed so simple in retrospect... just thinking that way #include <SFML/Graphics.hpp> #include "SFVectorFuncs.hpp" //REDO MY OUTLINE GENE...
ALGO
0.99837
3.717764
dc9c9eea-a8ed-4e67-94ad-dd34d51fa47b
PaulH1980/raytrace
Enigma/PathIntegrator.cpp
#include "RNG.h" #include "Renderer.h" #include "Ray.h" #include "Camera.h" #include "Scene.h" #include "Sample.h" #include "Sampler.h" #include "MonteCarlo.h" #include "Primitive.h" #include "BxDF.h" #include "Volume.h" #include "Interaction.h" #include "Medium.h" #include "MediumInterface.h" #include "Film.h" #includ...
ALGO
0.968009
5.832844
994e069b-7a07-48e6-ba1f-71689522d376
tchaikov/scim-googlepinyin
src/share/spellingtrie.cpp
#include <stdio.h> #include <string.h> #include <assert.h> #include "../include/dictdef.h" #ifdef ___BUILD_MODEL___ #include "../include/spellingtable.h" #endif #include "../include/spellingtrie.h" namespace ime_pinyin { SpellingTrie* SpellingTrie::instance_ = NULL; // z/c/s is for Zh/Ch/Sh const char SpellingTrie...
TOOL
0.865274
4.159512
ecfc41b5-e732-4b2a-ac0b-d7bf1db76450
zhengxiang94/ocs2_ros2
ocs2_oc/src/oc_problem/LoopshapingOptimalControlProblem.cpp
#include "ocs2_oc/oc_problem/LoopshapingOptimalControlProblem.h" #include <ocs2_core/loopshaping/Loopshaping.h> namespace ocs2 { namespace LoopshapingOptimalControlProblem { OptimalControlProblem create(const OptimalControlProblem& problem, std::shared_ptr<LoopshapingDefinition> loopshapingDefinition) { OptimalCon...
ALGO
0.8871
7.139289
38005b36-cdad-46c2-ba61-f7f41b7b3a94
mathisre/FYS4411---Project-1-VMC
src/main.cpp
#include <iostream> #include <random> #include <cmath> #include "system.h" #include "particle.h" #include "WaveFunctions/wavefunction.h" #include "WaveFunctions/simplegaussian.h" #include "Hamiltonians/hamiltonian.h" #include "Hamiltonians/harmonicoscillator.h" #include "InitialStates/initialstate.h" #include "InitialS...
ALGO
0.998955
4.225559
523b375d-815c-4a76-ac2a-85a4bbe40c7a
zlccccc/ACM-Templates-by-zlc1114
数论-数学相关/积性函数 线性筛 杜教筛 洲阁筛/杜教筛 前缀和/BZOJ 3512 - DZY Loves Math IV phi(ij)和.cpp
#include <sstream> #include <fstream> #include <cstdio> #include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> #include <cstring> #include <stack> #include <queue> #include <cmath> #include <ctime> #include <utility> #include <cassert> #include <bitset> using namespac...
ALGO
0.999971
4.159805
619428d2-3ecd-49a8-8583-4a6988691419
AlilouGh/gesture_recognition
src/tests/test_parser.cpp
#include <opencv2/opencv.hpp> #include <algorithm> #include <vector> #include <complex> #include <utility> #include <iostream> #include <functional> #include "feature_extraction.hpp" #include "kmeans.hpp" #include "kmeans_input.hpp" #include <random> #include "descripteur_fourier.hpp" #include "traitement.hpp" #include...
DATA
0.988133
3.159334
c8f6ba02-2c13-476f-a1af-22f2c8b64d2e
srgrusso/platform_frameworks_av
media/libheadtracking/PoseDriftCompensator.cpp
#include "PoseDriftCompensator.h" #include <cmath> #include "media/QuaternionUtil.h" namespace android { namespace media { using Eigen::Quaternionf; using Eigen::Vector3f; PoseDriftCompensator::PoseDriftCompensator(const Options& options) : mOptions(options) {} void PoseDriftCompensator::setInput(int64_t timestam...
ALGO
0.96886
7.007365
ea80665f-6982-4081-9a15-f52bd7e7d6d7
aaron777collins/learningcpp
functions/prototypes.cpp
// declaring functions prototypes #include <iostream> using namespace std; // prototypes aren't required but are useful // but in this case where they call each other they are required void odd (int x); // required in order to use odd() in even() void even (int x); // required in order to use even() in odd() int main...
ALGO
0.999524
7.046751
7384234e-24a7-4c36-be1a-daf9f1b3236c
Jtyc99/magic-8-ball
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.998762
6.786404
1111e74c-94b7-4727-8380-ae380bded959
josefmicak/school-projects
ALG_I/lab3.cpp
#include <iostream> using namespace std; int main(void) { const int N = 5; //int p[N]; /* p[3] = 4; p[0] = 15; p[1] = 15; cout << p << endl;//Ukaze adresu prvniho prvku cout << *p << endl;//Ukaze prvni prvek cout << &p << endl; cout << &p[0] << " = " << p << endl; cout << &p[1] << endl;//Podobna adresa co...
ALGO
0.901411
3.075613
8d481e89-95a3-4135-a830-81a34a0a9d0e
SourVoice/c-leetcode-Experiment
leetcode/221. Maximal Square.cpp
// 221. #include <algorithm> #include <cmath> #include <string> #include <iostream> #include <vector> using namespace std; //, ʱ class Solution { public: int maximalSquare(vector<vector<char>> &matrix) { int maxSide = 0; int m = matrix.size(); int n = matrix[0].size(); for (int ...
ALGO
0.999701
5.645712
df97dfb5-959b-4e12-b5c6-b1c9ea62f23a
ishandutta2007/codeforces
flashmt/normal/286/C.cpp
#include <iostream> #include <algorithm> #include <cstdio> #include <stack> using namespace std; int n, p[1000100], isClose[1000100]; stack <int> unknown, close; int findOpen(int x) { close.push(x); while (!close.empty()) { int x = close.top(); isClose[x] = 1; if (unknown.empty()) return 0; int y = unknown...
ALGO
0.999992
3.520762
9d3a1c81-cc36-4366-b95d-7ab981ad6c2f
MintChocoPizza/dodo
baekjoon/c++/18870/temp1.cpp
#include <iostream> #include <algorithm> using namespace std; int bS(int *arr, int element, int start, int end) { int mid = (start+end)/2; if(arr[mid] == element) return mid; else if (arr[mid] < element) return bS(arr, element, mid+1, end); else return bS(arr, element, start, ...
ALGO
0.999997
4.083549
50a9eeee-ab06-4869-9ff4-a6e2825df0c8
ishandutta2007/codeforces
mnbvmar/normal/634/A.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; template<typename TH> void debug_vars(const char* data, TH head){ cerr << data << "=" << head << "\n"; } template<typename TH, typename... TA> void debug_vars(const char* data, TH head, TA... tail){ while(*data != ',') cerr << *data++; ...
ALGO
0.999963
3.257097
43a6e93f-000a-4177-9b4c-ab93b117f0fb
ishandutta2007/codeforces
baluteshih/normal/894/A.cpp
#include <iostream> #define __ ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); using namespace std; int main() { string s; int i,j,k,ans=0; cin >> s; for(i=0;i<s.size();i++) for(j=i+1;j<s.size();j++) for(k=j+1;k<s.size();k++) if(s[i]=='Q' && s[j]=='A' && s[k]=='Q') ans++; cout << ans << "\n"; }
ALGO
0.998116
3.009861
0c083b0a-07dc-4bdc-a492-f0c2f31d47c9
bazelment/boost
regex/performance/table_helper.cpp
#ifdef _MSC_VER # pragma warning (disable : 4224) #endif #include <boost/regex.hpp> #include <boost/lexical_cast.hpp> #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> #include <boost/container_hash/hash.hpp> #include <vector> #include <set> #include <iostream> #include <sstream> #include <ioman...
TOOL
0.8893
4.804463
8137df4c-de67-400e-acf1-a71febb7fa7e
rohitium/llama.cpp
pocs/vdot/q8dot.cpp
#include <cstdio> #include <type_traits> #include <vector> #include <random> #include <chrono> #include <cstdlib> #include <cmath> #include <cassert> #include <cstring> #include <array> #include <type_traits> #include <ggml.h> constexpr int kVecSize = 1 << 16; // Copy-pasted from ggml.c #define QK4_0 32 typedef stru...
TEST
0.941421
6.104757
07ba267a-3ed6-49b1-95b2-c748fc8b2a8d
lajiwangpan2/project1
ch05/ex5_20.cpp
#include <iostream> #include <string> using std::cout; using std::cin; using std::endl; using std::string; int main() { string read, tmp; while (cin >> read) if (read == tmp) break; else tmp = read; if (cin.eof()) cout << "no word was repeated." << endl; else cout << read << " occu...
ALGO
0.999581
3.889792
762bbd5c-028c-46ed-98c4-7160d27312d5
Vaibhav-22-dm/Cpp-Codes
Bitmask DP/bitsets.cpp
#include <bits/stdc++.h> using namespace std; void add(int& subset, int num){ subset |= 1<<(num-1); } void remove(int& subset, int num){ subset ^= 1<<(num-1); } void display(int subset){ for(int bit_no=0; bit_no<=9; bit_no++){ // if(1&subset>>bit_no) cout << bit_no+1 << " "; if(subset & 1...
ALGO
0.991926
4.846092
b285e9d7-88e8-4300-b081-b9f057cc34b8
Docode072/Leetcode_coding_block
STACK/503. Next Greater Element II.cpp
vector<int> nextGreaterElements(vector<int>& nums) { vector<int>res; stack<int>st; int n= nums.size(); for(int i = n-1; i >= 0 ; i--){ st.push(nums[i]); } for(int i = n-1; i >= 0 ;i--){ while(!st.empty() and nums[i] >= st.top(...
ALGO
0.999873
5.124588
332c471c-ed62-4a49-a153-57ca0b32856e
yadavankit671/LEETCODE
C++/1089.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: void duplicateZeros(vector<int>& arr) { int n=arr.size(); for(int i = 0; i < arr.size();i++){ if(arr[i]==0){ arr.insert(arr.begin()+i+1,0); i++; } } n=arr.siz...
ALGO
0.999374
4.985463
8a83fe5c-199d-4c03-bfd7-d15c1e7f0385
ritishBhatoye/dsa
DAY 58/Recursion/Factorial.cpp
#include<iostream> using namespace std; int fac(int n){ if(n==0 || n==1){ return 1; } else { return n*fac(n-1); } } int main() { int n; cout<<endl<<endl; cin>>n; cout<<"RESULT :- "<<fac(n)<<endl; cout<<endl<<endl; return 0; }
ALGO
0.99999
5.259653
731ece83-a5bf-4d91-8f13-af2abd12ae5f
dangduongcoder/PTIT-Code
code.ptit/contest-17-11-24/a.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<ll> vll; #define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define pb push_back #define all(x) (x).begin(), (x).end() #define fi first #define se second #define sz(x) (...
ALGO
0.999928
3.718714
0e0fce6b-7b1e-44c1-ab53-861951339f07
RahulScripted/DSA
Loop/For Loop/CubeOfnNaturalNumber.cpp
// Question: Write a program to display the cube of the number up to an integer. #include<bits/stdc++.h> using namespace std; int main(){ int end; cout<<"Enter ending point : "; cin>>end; int cube = 0; for(int i = 1;i <= end;i++){ cube = (i * i * i); cout<<"Cube of "<<i<<" will be :...
ALGO
0.984101
3.97057
0a3b1dc6-30d0-4b5f-808f-ecae83206d87
TamannaAkter/uva-
uva_11185.cpp
#include<bits/stdc++.h> using namespace std; int main() { long int dnum,num; int rem,l,i; int s[1000]; while(cin>>dnum) { if(dnum<0) break; num=dnum; l=0; while(dnum>0) { rem = dnum%3; l=l+1; dnum = dnum / 3 ; ...
ALGO
0.999954
3.766621
e65029de-61be-4819-b36d-e6696ece8ec9
thangitus/LeetCode-Solution
C++/Greedy/Partition Labels.cpp
#include <bits/stdc++.h> using namespace std; /** * https://leetcode.com/problems/partition-labels/ * */ class Solution { public: vector<int> partitionLabels(string s) { vector<int> pos(26), result; int start = 0, end = 0; for (int i = 0; i < s.length(); i++) pos[s[i] - 'a']...
ALGO
0.999758
6.080369
af9ec02a-bd52-40f5-8513-7acf0d564875
yash2411-cmd/placement_prep
stacks/questions/redundantbrackets.cpp
#include <bits/stdc++.h> bool findRedundantBrackets(string &s) { stack<char>st; for(int i=0;i<s.length();i++){ char ch = s[i]; if(ch == '(' || ch == '+' || ch == '-' || ch == '*' || ch == '/'){ st.push(ch); } else{ if(ch== ')'){ bool redu...
ALGO
0.999661
4.447359
0cc91858-9690-4f43-b88a-f8e7d4b0fe83
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/Year2021/May/TickTockToe_20210509155400.cpp
#include<bits/stdc++.h> using namespace std; bool isCon1(vector<vector<char> > mat,char a){ // first row if(mat[0][0] == mat[0][1]&& mat[0][1] == mat[0][2] && mat[0][1] == a){ return true; } // second row if(mat[1][0] == mat[1][1] && mat[1][1] == mat[1][2] && mat[1][1] == a){ ret...
ALGO
0.999986
4.003549
6e54a02b-e488-4172-bff4-530c797a9034
call-me-bammer/montmartre-hill
baekjoon/13023/pass_by_ref.cpp
#include <iostream> #include <vector> #define N_MAX 2000 using namespace std; bool reachFive = false; bool check[N_MAX] = { false }; void dfs(vector<vector<int>>& g, int root, int depth) { if (depth == 5) { reachFive = true; return; } check[root] = true; for (int i: g[root]) { ...
ALGO
0.999947
5.418102
8477438b-bf67-4366-8640-28e1c7074d8a
ferrarielectronic/icu
icu/icu4c/source/tools/genrb/filterrb.cpp
#include <iostream> #include <stack> #include "filterrb.h" #include "errmsg.h" const char* PathFilter::kEInclusionNames[] = { "INCLUDE", "PARTIAL", "EXCLUDE" }; ResKeyPath::ResKeyPath() {} ResKeyPath::ResKeyPath(const std::string& path, UErrorCode& status) { if (path.empty() || path[0] != '/') { ...
TOOL
0.982312
6.28081
be916dab-7d7e-4607-99a9-a588c2dc9ade
aa4cc/AcouMan
simulink/system_object/bfgs/C/pressurePoints.cpp
#include <cstdlib> #include <string.h> #include <Eigen/Core> #include "transducers.h" #include "pressurePoints.h" #include <LBFGS/LBFGS.h> using namespace LBFGSpp; using Eigen::MatrixXd; using Eigen::VectorXd; int wrapperCustomArray(double *x, double *y, double *z, double *reqPress, unsigned int numPP, double *initia...
ALGO
0.999272
3.884186
34581c1b-6a1c-4204-93b3-4fe4253aadfc
ashwani361/Leetcode-Solutions
0051-n-queens/0051-n-queens.cpp
class Solution { public: bool check(vector<string>& ds, int row, int col){ int n = ds.size(); for(int i=0; i<n; i++){ if(ds[i][col]=='Q'){ return false; } if(row-i>=0 and col-i>=0 and ds[row-i][col-i]=='Q'){ return false; ...
ALGO
0.999766
5.873093
153bcd91-e811-4e56-8219-d9c47abb78b7
qiaozishun4/CSP2024_BJ
BJ-Senior/answers/BJ-S00211/color/color.cpp
#include <bits/stdc++.h> using namespace std; int n,t,a[200005],now,ans; void dfs(int k,int r,int b,int h){ if(k==n+1){ ans=max(ans,h); return; } dfs(k+1,a[k],b,h+((a[k]==r)?r:0)); dfs(k+1,r,a[k],h+((a[k]==b)?b:0)); } int main(){ freopen("color.in","r",stdin); freopen("color.out"...
ALGO
0.999793
4.329906
f6e68df7-8183-4d11-8149-11daf1aa533a
Tasmia-Hossain/Data-Structures-Lab
BFS_Bicoloring.cpp
#include <bits/stdc++.h> using namespace std; vector<int> Node_Vec[11]; int level[11]; int color[11]; bool BFS(int source) { for (int i = 0; i < 11; i++) { level[i] = INT_MAX; color[i] = -1; // -1 indicates uncolored } queue<int> Q; Q.push(source); level[source] = 0; color...
ALGO
0.999716
5.538709
8060fa26-da67-483d-8b92-9b4f67593781
Sachinaswal29/Leetcode
1905-count-sub-islands/1905-count-sub-islands.cpp
class Solution { public: vector<vector<int>>directions={{0,1},{1,0},{0,-1},{-1,0}}; bool bfs(vector<vector<int>>& grid1, vector<vector<int>>& grid2, int i, int j){ queue<pair<int,int>>q; q.push({i,j}); grid2[i][j]=0; bool ans=true; while(!q.empty()){ int ...
ALGO
0.999925
6.127924
f0ebafd5-253b-42f8-a803-2347156de471
atharv1707/CodeCraft-100DaysOfCode-Completed-
Dominant Element.cpp
#include <iostream> #include <unordered_map> using namespace std; int main() { int t; cin >> t; cin.ignore(); while (t--) { int N; cin >> N; cin.ignore(); int arr[N]; for (int i = 0; i < N; i++) { cin >> arr[i]; } unordered_map<int,...
ALGO
0.999959
5.813172
24fdb62b-d934-42e2-ae46-2d30a156bef6
ishandutta2007/codeforces
chinese_zjc_/normal/1558/B.cpp
// This Code was made by Chinese_zjc_. #include <bits/stdc++.h> // #define debug int n, MOD, dp[4000005], cha[4000005]; void add(int &A, int B) { A = (A + B) % MOD; } signed main() { std::ios::sync_with_stdio(false); std::cin >> n >> MOD; cha[1] = 1; cha[2] = MOD - 1; for (int i = 1; i <= n; ++i) ...
ALGO
0.999992
5.083349
51b2b186-a16d-451d-8e7f-6dbc9d29ea6d
UPG1308/Leetcode-Daily-Challenge
2024 November Leetcoding Challenge/1861. Rotating the Box.cpp
class Solution { public: vector<vector<char>> rotateTheBox(vector<vector<char>>& box) { int m = box.size(); int n = box[0].size(); vector<vector<char>> result(n, vector<char>(m, '.')); // Apply gravity to let stones fall to the lowest possible empty cell in // each column ...
ALGO
0.999977
6.838581
55cb005c-0bef-4c88-9732-7a7e64948b66
ishandutta2007/codeforces
ssamt/normal/1651/A.cpp
#include <bits/stdc++.h> using namespace std; int main() { int cl, ql; int i, j, k, l; int t, n, m, q; int u, v; int in; scanf("%d", &t); for(cl=0; cl<t; cl++) { scanf("%d", &n); printf("%d\n", (1<<n)-1); } }
ALGO
0.99755
3.745734
f3bbc705-d0c8-4aa8-858a-ce9347ab6f6b
Subodhk305/cpp_practiced_codes
cppcodesgit/20231001-151457.cpp
#include<iostream> using namespace std; int main() { int n = 5; int arr[] = {3, 72, 9, 6, 8}; cout << "Array elements are:" << endl; for (int i = 0; i < n; i++) { cout << arr[i] << endl; } for (int i = 0; i < n / 2; i++) { int temp = arr[i]; arr[i] = arr[n - i - 1]; ...
ALGO
0.999563
4.446847
d0550396-2ce5-43d7-a5ba-fe21d5c346fc
Saarthakkj/DSA
Leetcode_problems/stacks_queues/146-lru-cache/lru-cache.cpp
class LRUCache { public: //make a doubly linkedlist class node{ public: int key ; int val ; node* next ; node* prev ; node(int k , int v){ key = k ; val = v; next = nullptr; prev = nullptr; }...
ALGO
0.998806
5.994648
7e786d28-4cf4-4ee7-be7b-193e654317e5
wenliangsun/LeetCode
动态规划/博弈类dp/石子游戏.cpp
#include <bits/stdc++.h> using namespace std; /** * 石子游戏 */ class Solution { public: /** * Min-Max * 博弈类问题 * 时间复杂度:O(2^n) */ bool stoneGame(vector<int>& piles) { return score(piles, 0, piles.size() - 1) > 0; } // 相对分数 会超时! int score(vector<int>& piles, int l, int ...
ALGO
0.999966
4.616947
f7dc162b-50cd-415d-9400-55548d164ed3
NeuCoin/neucoin
src/GetProofOfWorkReward.cpp
#include "constants.h" #include "types.h" #include "GetProofOfWorkReward.h" money_t GetProofOfWorkReward(blockheight_t prevHeight) { if (prevHeight == 0 && COIN_PREMINE > 0) return COIN_PREMINE; if (prevHeight < POW_DUMMY_BLOCK_COUNT) return 1 * CENT; if (prevHeight >= POW_MAX_BLOCK) ...
CONFIG
0.994939
3.100253
b031190c-8cfb-4766-98ce-613e419302f0
ishandutta2007/codeforces
.tx/normal/161/D.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <vector> #include <algorithm> #include <map> #include <set> #include <queue> #include <memory.h> #define scid(a) int a; scanf("%d", &a) #define sciid(a, b) int a, b; scanf("%d%d", &a, &b) #define sciiid(a, b, c) int a, b, c; scanf("%d%d...
ALGO
0.999945
4.082301
e8397803-9311-493e-baa5-c08a83c5d091
matheusota/Witness
name_paths/Solver.cpp
#include <iostream> #include "Environment.h" #include "Timer.h" bool DFS_visit(Environment *e){ vector<char> actions; e -> GetActions(&actions); //reached goal if(e -> CheckGoal()){ if(e -> FullCheck()) e -> PrintPath(); return false; } for(int...
ALGO
0.999376
5.052866
c138ba27-b932-4ae0-8c4e-ce6fb5e244c2
ishika-gupta21/Leetcode-Problems-Solutions
79-word-search/79-word-search.cpp
class Solution { public: bool dfs(vector<vector<char>>& board, string word, int x, int y, int index) { if(x < 0 || x >= board.size() || y < 0 || y >= board[0].size() || board[x][y] != word[index]) return false; if(index == word.size()-1) return true; board[x][y] =...
ALGO
0.999654
6.197646
923b6944-7245-4a69-a93a-7437b5d82e00
trinhminhtriet/leetcode
solutions/2900-2999/2999.count-the-number-of-powerful-integers/Solution.cpp
class Solution { public: long long numberOfPowerfulInt(long long start, long long finish, int limit, string s) { string t = to_string(start - 1); long long f[20]; memset(f, -1, sizeof(f)); function<long long(int, bool)> dfs = [&](int pos, bool lim) -> long long { if (t.s...
ALGO
0.999808
5.923625
a1dbc1e0-8b15-4830-a711-c3c036b26721
amoudgl/leetcode-solutions
src/minimum-number-of-arrows-to-burst-balloons.cpp
// Author: Abhinav Moudgil [ https://leetcode.com/amoudgl/ ] class Solution { public: int findMinArrowShots(vector<pair<int, int>>& points) { if (points.size() == 0) return 0; sort(points.begin(), points.end()); int minE = INT_MIN, count = 0, maxS = INT_MIN; for (int i = 0; i < point...
ALGO
0.999974
6.398354
d62083b6-e753-42b0-a4b3-ddc6f351feb7
ishandutta2007/codeforces
sys/normal/1696/C.cpp
#include <bits/stdc++.h> using namespace std; const int Maxn = 50005; int T, n, m, k, a[Maxn], b[Maxn], c[Maxn], e[Maxn]; long long d[Maxn], f[Maxn]; int main() { scanf("%d", &T); c[0] = -1; while (T--) { int ct1 = 0, ct2 = 0; scanf("%d%d", &n, &k); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); scanf...
ALGO
0.999934
4.017065
6f597c4c-1010-4e14-a048-939ee5cf3b9a
iagozag/competitive_programming
contests/cf/gym/242072/f.cpp
#include <bits/stdc++.h> using namespace std; #define _ ios_base::sync_with_stdio(0);cin.tie(0); #define endl '\n' #define int ll typedef long long ll; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fll; const int MAX = 2e5+10, MOD = 1e9+7; void solve(){ int n; cin >> n; vector<tuple<int, int, int>...
ALGO
0.999994
4.519271
e9f4a335-4f1f-4b5a-8e76-d1af40a8d607
khalwsh/Competitive-Programming
data structure/divide and conquer/SRQ online.cpp
template<typename T = ll> struct SRQ { static const int LG = 20; int n; vector<vector<T>> prec; vector<int> msk; vector<T> a; SRQ(const vector<T>& arr) : a(arr) { n = a.size(); prec.assign(LG, vector<T>(n)); msk.assign(n, 0); build(0, n-1, 0); } // our a...
ALGO
0.999855
4.587747
ac21b556-2e1f-4192-9a93-3873ca237417
PradyumnGup/web
DSA/Binary Trees/Construct Binary Tree from Preorder and Inorder Traversal.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999995
6.564415
1b6dd67d-430b-4b94-bfcb-7f4542838061
avinash0408/DSA
2965-find-missing-and-repeated-values/2965-find-missing-and-repeated-values.cpp
class Solution { public: vector<int> findMissingAndRepeatedValues(vector<vector<int>>& grid) { int n = grid.size(); vector<int> count(n*n+1,0); for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ count[grid[i][j]]++; } } int rep; int mi...
ALGO
0.999695
5.909613
db89de13-3421-4f56-b878-46758aead171
root8950/Templates
matrixExponentIterative.cpp
//MATRIX EXPONENTIATION #define TYPE int #define MAT vector< vector<TYPE> > MAT exponent(MAT &a, int d, ll b, ll mod) { MAT x(d, vector<TYPE> (d, 0) ); MAT y(d, vector<TYPE> (d) ); for (int i = 0; i < d; i++) { x[i][i] = 1; } for (int i = 0; i < d; i++) { for (int j = 0; j < d; j++) { y[i][j] = a[i][j]; ...
ALGO
0.99981
4.068924
c690056a-bf52-4142-9fbf-a4f8031c12c0
raincross7/code-similarity
codes/train_code/problem334/problem334_321.cpp
#include<bits/stdc++.h> #define INF 2000000000 #define MOD 1000000007 #define EPS (1e-10) using namespace std; int main(int argc, char *argv[]) { int N; cin >> N; string s,t; cin >> s >> t; string ans = ""; for (int i = 0; i < N; i++) { ans += s[i]; ans += t[i]; } cout << ans << endl; return 0; }
ALGO
0.999955
3.276655
a8834e1c-f6ce-41bf-ad03-b9114b1173fd
SwapnilSaha59/Important-Programs-on-CP
M-Coloring Problem.cpp
/* M-Coloring Problem ================== Given an undirected graph and an integer M. The task is to determine if the graph can be colored with at most M colors such that no two adjacent vertices of the graph are colored with the same color. Here coloring of a graph means the assignment of colors to all vertices. Print...
ALGO
0.999936
6.385127
b5b4e2da-1b7a-48ab-b9d0-28653664b153
ahmadh84/occlusiontracking
misc/TurboPixels/local_min.cpp
#include <math.h> #include "mex.h" #define min( x, y ) ((x) > (y) ? (x) : (y)) #define max( x, y ) ((x) < (y) ? (x) : (y)) void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { double *img, *x, *y, *N; int iWidth, iHeight; /* The input must be a noncomplex scalar double.*/ ...
ALGO
0.999943
5.591015
2a0a8603-acb0-4a68-a6e8-d82e307fbd97
ACyming/OI
c++/水题/较大数的平方.cpp
#include <cstdio> int a,b,ans; int main() { scanf("%d%d",&a,&b); if(a>b) { ans=a*a; } else { ans=b*b; } printf("%d",ans); return 0; }
ALGO
0.999621
3.847244
22f57541-84b0-45d0-b945-6c74c72eec7f
ishandutta2007/codeforces
vercingetorix/normal/1539/B.cpp
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <ctype.h> #include <deque> #include <cstring> #include <set> #include <bitset> #include <map> #include <chrono> #include <random> #include <unordered_map> #include <stdio.h> using namespace std; typedef long long ll; typedef long do...
ALGO
0.999894
3.738976
33e72043-b9cc-456b-a485-eb45ce010ac8
loal123/CP
codeforces/ntarsis.cpp
#include <bits/stdc++.h> using namespace std; int a[100005]; int main() { int t; cin >> t; while (t--) { int n,k; cin >> n >> k; for (int i = 0; i < n; i++) { cin >> a[i]; } } }
ALGO
0.999606
3.351123
f4e2763e-2b7c-45d7-8ef2-c1948bded274
nadimnesar/Online-Judges-Accepted-Solutions
UVA/10071/27660521_AC_20ms_0kB.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define llu long long unsigned int #define pb push_back #define inst insert #define mp make_pair #define pop pop_back #define dot(x) fixed << setprecision(...
ALGO
0.999141
4.034552
a7dd2974-4dbf-470d-a6eb-7cce39271c62
timmyjose-experiments/competitive-programming
lc/coreprep/implementation/practice_iterations/patterns_iterations_3/start_of_linked_list_cycle.cpp
#include <algorithm> #include <cmath> #include <iostream> #include <limits> #include <list> #include <queue> #include <random> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; int next_random(int low, int high) { random_device rd; mt19937 engine(rd()); u...
ALGO
0.999948
4.156849
3432f15d-3641-4424-8fb0-bcf34bbbecbe
dhingrahimanshu/CompetitiveProgramming
LeetCode/802. Find Eventual Safe StatesR.cpp
class Solution { public: vector<int> ans; void dfs(int node ,int par, vector<vector<int>> & graph , vector<int> & vis , vector<int>&path){ vis[node]=1; path.push_back(node); for(auto & it : graph[node]){ if(vis[it]==1 || (vis[it]==2 && ans[it]==0)){ for(a...
ALGO
0.999964
5.944258