uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
15a3f270-ce41-41fe-ad31-a22c1326edd7
wso2-incubator/big-data-analytics-smartenergy
game-trunk/gldcore/solvers/newton_method.cpp
#include <stdlib.h> #include "gridlabd.h" static unsigned int solver_version = 1; // change this each time to data structure changes typedef struct { unsigned int n; // dimensions (default 1) double *x; // current values of x double (**f)(double); // functions double (**df)(double); // derivatives double *p; // p...
ALGO
0.999736
5.42369
8497ee21-d086-4afe-b85e-952554f8cf34
DeepInMind12345/UEToonShading
Engine/Source/ThirdParty/nvTextureTools/nvTextureTools-2.0.6/src/src/nvmath/Random.cpp
// This code is in the public domain -- <EMAIL> #include <nvmath/Random.h> #include <time.h> using namespace nv; // Statics const uint16 Rand48::a0 = 0xE66D; const uint16 Rand48::a1 = 0xDEEC; const uint16 Rand48::a2 = 0x0005; const uint16 Rand48::c0 = 0x000B; /// Get a random seed based on the current time. uint ...
TOOL
0.905772
5.564165
d12c1d92-9dea-41a3-a4c1-375af6a7bd38
Mahoganyrc/XCamp
23Summer100ProbsBronze/22_MessageRelay.cpp
//#include <iostream> // //int size; //int data[2000]; //bool visited[2000]; //int x = 0; // //bool findPossible(int cow) { // if (data[cow] == 0) { // return true; // } // // if (visited[cow]) { // return false; // } // // visited[cow] = true; // bool result = findPossible(data[cow]); /...
ALGO
0.999961
3.742924
0764951c-b0cc-4fa0-9472-a27efddf3608
tusikalanse/acm-icpc
2019/hdu/0731/1003.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int T, n, k, a, sum; vector<int> ans[N]; int main() { scanf("%d", &T); while(T--) { scanf("%d%d", &n, &k); if(n == k && k == 1) { puts("yes\n1"); continue; } if(n == k) { puts("no"); continue; } a = n / k; if(a % 2 == ...
ALGO
0.999898
3.685588
3a5d0703-4c70-403d-8747-26d80b7203ef
ris-h-av/codeSnippets
strings/remove_Vowels.cpp
#include<bits/stdc++.h> using namespace std; // remove all the vowels in a given string int main(){ string s = "riihav"; for(int i=0;i<s.length();i++){ char temp = tolower(s[i]); if(temp=='a' || temp=='i' || temp=='e' || temp=='o' || temp=='u'){ s = s.substr(0,i) + s.substr(i+1); ...
ALGO
0.999599
3.097441
f6743bca-e5e0-44f5-aa0e-847edbae37ea
TonmoyZohani/probelmSolving-C-Plus-Plus
prb.cpp
#include <iostream> using namespace std /*int fun(int A[],int n); ; int main () { int i,p=0, n,test=3; int A[100]; int number[100]; cin >> n; do{ for (i = 0; i < n; i++) { cin >> A[i]; } number[p]=fun(A,n); p++; test--; }while (test!=0); cout<<"Now print:"<<endl; for(i=0...
ALGO
0.999501
3.364887
442807f9-0229-4e96-8a7b-cddec5a79465
ishandutta2007/codeforces
rush_d_cat/normal/1409/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; int t; int main() { scanf("%d", &t); while (t--){ LL a,b,x,y,n; scanf("%lld%lld%lld%lld%lld",&a,&b,&x,&y,&n); LL ans = 2e18; if (n >= (a - x) + (b - y)) { ans = x * y; printf("%lld\n", ans); continue; } // printf("ok\n"); if (a ...
ALGO
0.999122
3.463381
b27c27be-6fa9-4f34-92cb-d5918fb7fb7b
gdairo/CompetitiveProgramming
Cpp/Contest2/F.cpp
#include <algorithm> #include <bits/stdc++.h> #include <ios> using namespace std; #define endl '\n'; int main() { ios_base::sync_with_stdio(0); cin.tie(0); // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); int n, t, i, j; cin >> n >> t; vector<int> a(n); for (i = ...
ALGO
0.99998
5.481009
7dc673ec-7e87-42d2-aa57-71f0b93ddf82
papastam/HY425
prog_assignment1/gem5/src/systemc/tests/systemc/misc/user_guide/chpt3.2/fsmr.cpp
/***************************************************************************** fsmr.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /***************************************************************************** ...
ALGO
0.99837
4.796028
fbd08770-ac15-48b4-bcd3-cb34d2b025bc
mahirlabibdihan/Data-Structure
Tree/LazyPropagation.cpp
// Program to show segment tree to demonstrate lazy // propagation #include <stdio.h> #include <math.h> #define MAX 1000 void updateRangeUtil(int si, int ss, int se, int us, int ue, int diff, int *tree, int *lazy) { //cout<<si<<" "<<ss<<" "<<se<<endl; if (lazy[si] != 0) { tree[si] += (se - ss + 1) * lazy[si]; i...
ALGO
0.999849
5.719624
390d17e7-5486-43ce-b9a8-ba84642d03af
basecode-lang/basecode
share/prototypes/bootstrap-redux/ext/boost-1.70.0/libs/icl/example/party_/party.cpp
#include <iostream> #include <boost/icl/interval_map.hpp> #include "../toytime.hpp" using namespace std; using namespace boost::icl; /** Party.cpp demonstrates the possibilities of an interval map (interval_map or split_interval_map). An interval_map maps intervals to a given content. In this case the co...
ALGO
0.994145
6.799102
de2792b4-b7f1-4c0f-8661-ca46886c4e4e
bjohansebas/learning
programadorATS/06-10-expression/exercise6.cpp
#include<iostream> using namespace std; int main(){ float st1,st2,st3,st4, result = 0; cout<<"Final note of studient 1: "; cin>>st1; cout<<"Final note of studient 2: "; cin>>st2; cout<<"Final note of studient 3: "; cin>>st3; cout<<"Final note of studient 4: "; cin>>st4; result = (st1+st2+st3...
ALGO
0.995056
3.532925
0e22e9c6-d862-4815-8da3-0f7ab2836b6d
SHREY247/super-duper-palm-tree
BinarySearchTree/IsBST.cpp
//Check whether binary tree is BST #include<bits/stdc++.h> using namespace std; class Node { public: int key; Node *left; Node *right; Node(int key){ this->key = key; left = right = NULL; } }; bool isBSTUtil(Node* node, int min, int max) { /* an empty tree is BST */ if (node==...
ALGO
0.999975
5.762518
f89e43e8-144a-4a99-aedc-f7e24b94c24d
meganfriedenberg/Jell0
Jello!Sim/physics.cpp
#include "jello.h" #include "physics.h" /* Computes acceleration to every control point of the jello cube, which is in state given by 'jello'. Returns result in array 'a'. */ // FOR EACH struct of springs // // <vector>* of springs void handleCollision(struct world* jello, struct point totalForce[8][8][8], p...
ALGO
0.999269
3.954423
be34d60e-79e6-43b6-937d-7445dd93de57
shyu61/program-competition
code/rasen/042.cpp
#include <iostream> #include <vector> using namespace std; const int MAX = 100; int A[MAX][MAX], F[MAX], B[MAX], visited[MAX], n = 0, ts = 1; void dfs(int id) { if (visited[id]) return; F[id] = ts++; visited[id] = 1; for (int i = 0; i < n; i++) { if (A[id][i] == 0) continue; dfs(i); ...
ALGO
0.999958
4.206415
303bc641-7f1c-4197-b94d-1a2e9d7fec81
JMH201810/Labs
C++/Lab5-4-8/src/Lab5-4-8.cpp
using namespace std; // An empty list: // // Node* // +------+ // | head |-->nullptr // +------+ // // // Node* // +------+ // | tail |-->nullptr // +------+ // // // // A list with two elements: // // Node* Node Node // // +-----+ +-----+ // nullptr<-|prev | +--|prev | // +------+ +...
TOOL
0.927619
4.852527
597d408d-58ac-403e-b8a4-03bfc3842d1f
webaverse-studios/moemate-avatar-wasm
physx/source/physxvehicle2/src/steering/VhSteeringFunctions.cpp
#include "vehicle2/PxVehicleParams.h" #include "vehicle2/commands/PxVehicleCommandHelpers.h" #include "vehicle2/rigidBody/PxVehicleRigidBodyStates.h" #include "vehicle2/steering/PxVehicleSteeringParams.h" namespace physx { namespace vehicle2 { void PxVehicleSteerCommandResponseUpdate (const PxReal steer, const PxR...
ALGO
0.974998
6.69755
43e695ef-3162-4bef-8d1f-b022ab024790
nathanlo99/dmoj_archive
done/stnbd2.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; using ll = long long; ll n, m, s, e, ans; vector<vector<ll>> g; vector<ll> indeg, outdeg; vector<pair<ll, ll>> nodes; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> m; g.resize(n + 1); nodes.resize(n + 1); indeg.resize(n + 1); ou...
ALGO
0.999952
4.388171
2d779f4f-68ea-426e-8769-e3945397808f
Terpodia/Competitive-Programming
Problems Solved/UVa/Math/10392 - Factoring Large Numbers.cpp
#include <algorithm> #include <iostream> #include <map> using namespace std; typedef __uint128_t u128; typedef long long ll; const int MAXN = 1e7 + 10; ll gcd(ll a, ll b) { return (b == 0) ? a : gcd(b, a % b); } ll mult(ll a, ll b, ll m) { a %= m, b %= m; return ((u128)a * b) % m; } ll binpow(ll a, ll e, ll m)...
ALGO
0.999561
4.171683
d18aad5f-f7ce-4580-ad5a-ba33f748d05d
archwine/snpe_demo
android-ndk-r19c/sources/cxx-stl/llvm-libc++/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp
// UNSUPPORTED: c++98, c++03, c++11, c++14 // XFAIL: c++17, c++2a // <functional> // boyer_moore searcher // template<class RandomAccessIterator1, // class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>, // class BinaryPredicate = equal_to<>> // class boyer_moore_searcher {...
TEST
0.911295
7.035668
52abc58e-2360-4736-8c44-6bc775c6a4e6
rickyqin005/DMOJ-Solutions
main/ccc16s5 20.cpp
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define f first #define s second #define MAX_LONG 9223372036854775807 #define MOD 1000000007 typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<pii, int> piipi; typedef pair<int, pii> pipii; boo...
ALGO
0.999998
3.870891
da5f2a79-f9ce-4c60-bd90-ab978df50712
aanda-stcloudstate-edu/WebSpace
cs301/WM7/SourceCodeForStudents_7.0/Chapter11/Listing11-4.cpp
// Listing 11-4. const int MAX_SIZE = 50; /** Merges two sorted array segments theArray[first..mid] and theArray[mid+1..last] into one sorted array. @pre first <= mid <= last. The subarrays theArray[first..mid] and theArray[mid+1..last] are each sorted in increasing order. @post theArray[first..last] is so...
ALGO
0.999966
6.210248
02c9afeb-e39b-4e56-8211-2239ef76e187
basavarajakj/DataStructure_Algo_CPP
12-BinarySearchTree/01-BasicsQuestions/05-ConstructBSTFromPreorderTraversal.cpp
#include <iostream> #include <vector> #include <climits> using namespace std; // 🌳 Definition of the TreeNode structure struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; class Solution { public: /** * Algorithm for build...
ALGO
0.999998
7.167109
c01b1ca8-2878-463b-9ed1-69e71fe514be
ishandutta2007/codeforces
joeywheeler/normal/464/E.cpp
#include <bits/stdc++.h> #define FO(i,a,b) for (int i = (a); i < (b); i++) #define sz(v) int(v.size()) #define NMOD 3 using namespace std; typedef long long ll; ll mod[NMOD] = {1000000009,1000000007,1000000003}; ll pw[200005][NMOD]; bool overflow = false; typedef struct _rt { _rt *l, *r; int hash[NMOD]; ...
ALGO
0.999971
3.970234
25218bdb-cc2b-4200-bb37-d4ddcf272873
magical/cs478
lab3/compress_test.cpp
#include <string> #include <iostream> #include <cctype> #include "crypto.hpp" #include "compress.hpp" bool printable(std::string s) { for (char c : s) { if (!isprint(c)) { return false; } } return true; } int main() { std::cout << hex(compress("")) << "\n"; std::cout << hex(compress("abc")) << "\n"; std:...
TOOL
0.982998
4.91091
bf5a1186-5cb5-40a5-a53c-492181d7841f
mahamudur786/My-pc-c-program
MapsHR.cpp
#include<bits/stdc++.h> using namespace std; int main() { map<string,int>m; int testcase; string x; int queries,marks; cin>>testcase; while(testcase--) { cin>>queries; if(queries==1) { cin>>x>>marks; m.insert(make_pair(x , marks)); } else if(que...
ALGO
0.999213
3.899191
9286402f-128b-4d93-a6ed-f0b0c026dad3
Veljko28/cpp-data-algrtms
codeforces/AvoidTrygub.cpp
#include <iostream> #include <cmath> #include <vector> #include <algorithm> #include <iterator> #include <numeric> #include <string> #include <cstring> #include <ctime> #include <set> #include <list> #include <sstream> #include <iomanip> #include <map> #include <stack> #include <unordered_map> #include <queue> #include...
ALGO
0.999707
4.958395
9609c675-ab5c-4e63-97be-f8065537f448
Marcux777/Programacao_Competitiva
Beecrowd/Organizar/BEE1032.CPP
#include <iostream> #include <vector> #include <cmath> using namespace std; bool is_prime(int n) { if (n < 2) { return false; } for (int i = 2; i <= sqrt(n); i++) { if (n % i == 0) { return false; } } return true; } int main() { int n; w...
ALGO
0.999938
4.588388
023f293c-8071-440a-baf2-ff900a1b5c20
vipinmishra0852/DecodeAssignment
Arrays/Assignment/Assignment1/1.cpp
#include <iostream> using namespace std; // Function to calculate the product of all elements in an array long long calculateProduct(int arr[], int size) { long long product = 1; // Initialize product to 1, since multiplying by 0 would always result in 0 // Iterate through the array and multiply each element with...
ALGO
0.999866
5.66077
c4cc29e8-a9f6-4bd2-877a-5ae1b34e2ea3
Sunny5130/leetCode_practice
764-n-ary-tree-level-order-traversal/n-ary-tree-level-order-traversal.cpp
/* // Definition for a Node. class Node { public: int val; vector<Node*> children; Node() {} Node(int _val) { val = _val; } Node(int _val, vector<Node*> _children) { val = _val; children = _children; } }; */ #include<bits/stdc++.h> class Solution { public: vect...
ALGO
0.999974
5.948769
1530eab8-708e-40d4-a2b8-36d0f4b86f17
Ziklon/algorithms
tc/testprograms/SortMachine.cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
ALGO
0.999844
4.900673
b88dba55-b008-41ea-b21f-e6132a48f7fb
surpise/Problem-Solving
프로그래머스/lv0/120869. 외계어 사전/외계어 사전.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; int solution(vector<string> spell, vector<string> dic) { int answer = 2; vector<string> v; string tmp; sort(spell.begin(), spell.end()); for(int i = 0; i < dic.size(); i++){ if(dic[i].size() == spell.size()){ ...
ALGO
0.999401
4.72628
b49bb680-6d46-446d-98c6-b1866c24e183
AndroidOpenSourceXperia/android_frameworks_av
media/libstagefright/codecs/amrnb/common/src/q_plsf_3.cpp
/*---------------------------------------------------------------------------- ; INCLUDES ----------------------------------------------------------------------------*/ #include <string.h> #include "q_plsf.h" #include "typedef.h" #include "lsp_lsf.h" #include "reorder.h" #include "lsfwt.h" /*------------------------...
ALGO
0.999504
5.85136
ab625181-bcfb-458e-a8a4-32005003cd9d
yangfengzzz/Arche-webgpu
test.geometry/bvh3_tests.cpp
#include "unit_tests_utils.h" #include "vox.geometry/bvh3.h" using namespace vox; TEST(Bvh3, Constructors) { Bvh3<Vector3D> bvh; EXPECT_EQ(bvh.begin(), bvh.end()); } TEST(Bvh3, BasicGetters) { Bvh3<Point3D> bvh; std::vector<Point3D> points{Point3D(0, 0, 0), Point3D(1, 1, 1)}; std::vector<Boundin...
TEST
0.870608
7.760182
50a849f9-f685-437a-b869-63625e3f6a02
Munkhbayr14/flutter_Login
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
8c757299-ba2d-401c-bbd7-3ce12c57b396
M0D4/Competitive-Programming-Problems-Solutions
CodeForces/GNU C++17/219A | k-String/71507540.cpp
#include <bits/stdc++.h> using namespace std; #define all(v) v.begin(), v.end() #define endl "\n"; #define pb push_back #define F first #define S second #define JULEE_DO_THE_THING fast() #define to_str to_string #define isOdd(n) (n&1) #define LLMAX LLONG_MAX #define LLMIN LLONG_MIN #define IMIN INT_MIN #define I...
ALGO
0.999956
4.000094
67dde3b4-905e-483c-a027-f56f92d7927c
tsteenbe/boost
libs/math/src/tr1/cyl_bessel_jf.cpp
extern "C" float BOOST_MATH_TR1_DECL boost_cyl_bessel_jf BOOST_PREVENT_MACRO_SUBSTITUTION(float nu, float x) BOOST_MATH_C99_THROW_SPEC { return c_policies::cyl_bessel_j BOOST_PREVENT_MACRO_SUBSTITUTION(nu, x); }
TOOL
0.952405
3.438202
057f6997-26d8-4335-8121-6c4b7669aae8
Hira-kiran/QR_Code_App
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
dc0006fc-12d2-4ec2-8143-926b633d6cfb
IfBilal/Object-Oriented-Programming
NO_OF_MONTHS_DREAMHOUSE.cpp
#include <iostream> using namespace std; class HomeSavings { private: float annual_salary; float portion_saved; float total_cost; float current_savings; int months; public: HomeSavings(float annual_salary, float portion_saved, float total_cost) { this->annual_salary = annual_salary...
TOOL
0.870084
3.591082
27b99f2b-a557-4225-afff-8db8e8f259ae
Daniel-Barrera-D/Python-Curso
Curso/Entrenamientos OpenCV Ruidos/opencv-master/modules/stitching/perf/perf_matchers.cpp
#include "perf_precomp.hpp" #include "opencv2/imgcodecs.hpp" #include "opencv2/opencv_modules.hpp" #include "opencv2/flann.hpp" namespace opencv_test { using namespace perf; typedef TestBaseWithParam<size_t> FeaturesFinderVec; typedef TestBaseWithParam<string> match; typedef tuple<string, int> matchVector_t; typedef ...
TEST
0.924818
6.842914
b6b1cbf2-610e-47ef-a301-d876e6145547
sabberrahman/CSE
C++/cp-exam/vector-03.cpp
#include<iostream> #include<vector> using namespace std; void printV(vector<int> v){ for(int i=0;i<v.size();i++) { cout<<v[i]<<" "; } cout<<endl; } int main() { int N; cin>>N; vector<int> v[N]; for(int i=0;i<N;i++) { int n; cin>>n; for(int j=0;j<n;j++) { ...
ALGO
0.998008
4.233496
4defad57-d2a3-4c5c-8ea5-b423f6b22ef6
Adityag0243/CP-DSA
codeforce/1700 Rating/1879_d.cpp
#include <bits/stdc++.h> using namespace std; #define all(arr) arr.begin(), arr.end() #define vi vector<int> #define vvi vector<vi> #define int long long #define yes cout << "YES" << endl; #define no cout << "NO" << endl; #define p(x) cout ...
ALGO
0.999994
5.022591
a348cffa-2297-4c2c-9a04-782f5d2cf428
banhtieu/Metal-Tutorial
MetalFramework/Transform.cpp
#include "Transform.h" #pragma mark - #pragma mark Private - Headers #import <cmath> #import <iostream> #import "Transform.h" #pragma mark - #pragma mark Private - Constants static const float kPi_f = float(M_PI); static const float k1Div180_f = 1.0f / 180.0f; static const float kRadians = k1Div180_f * kPi_...
ALGO
0.883095
6.261773
60744b40-4af5-434e-bd2e-a10fb3dc73cd
rubinp22/CS-351
misc/hash-01.cpp
#include <fstream> #include <iostream> #include <string> const char* path = DATA_PATH "/Data.bin"; int main(int argc, char* argv[]) { std::ifstream input{path, std::ios::binary}; std::string outpath{argv[0]}; outpath += ".txt"; std::ofstream hashes{outpath}; size_t numHashes; input.read(rein...
TOOL
0.873518
5.586518
fc32794b-21f4-4114-a7de-ae9e22fe124d
pingchungchang/CP
ABC273F.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll,ll> #define pii pair<int,int> #define fs first #define sc second #define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define ld long double #define _all(T) T.begin(),T.end() #define int ll const ll inf = 1e18; main(){ io in...
ALGO
0.999989
3.688934
966ab2c2-b618-4828-b7a0-4eacc1e87cfb
arijitsaha2002/CSES-SOLUTION
Sorting_and_Searching/Nested_Ranges_Count.cpp
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long #define M 1000000007 #define newline '\n' #define blankchar ' ' #define Point pair<int, int> cla...
ALGO
0.999983
3.973165
f457cf75-af3a-4881-9198-f4fc7b477192
TheoCrd/openglproject
Quadtree.cpp
/***************************************************************************** Quadtree (à revoir --', ne pas mettre le cpp dans le makefile --') mais contient: - initialisation d'une case à la taille du background - fabrication du quadtree, jusqu'à obtenir des cases ne contenant que 4 blocs - fonction qui récupère les...
ALGO
0.995627
3.354378
2f1d3e8c-e045-4f28-9d9b-dab4427ba1fd
aslezar/CompetitiveProgramming
Competiton/ICPC/Practice2/D.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL_RUN #include "debug.cpp" #else #define debug(...) #define debugArr(...) #endif #define int long long #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define sorta(a) sort(all(a)) #define sortd(a) sort(rall(a)) #define input(vec,...
ALGO
0.999685
4.32795
500e7a45-ea1b-44d6-ac26-befe24417b3b
xqian/cpp_projects
elements-of-programming-interviews-read-only/Finding_min_max.cpp
#include <algorithm> #include <cassert> #include <iostream> #include <limits> #include <random> #include <utility> #include <vector> using std::cout; using std::default_random_engine; using std::endl; using std::max; using std::min; using std::minmax; using std::pair; using std::random_device; using std::uniform_int_d...
ALGO
0.981511
5.948477
819a0f7b-e54e-4444-84e3-c16b042e31bb
kmaninis/OSVOS-caffe
src/misc/mex_intersect_hierarchies.cpp
/* Arguments */ #define PARTS prhs[0] #define MERSEQS prhs[1] #define INT_PART plhs[0] #define LUT plhs[1] void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray*prhs[] ) { int num_dims = mxGetNumberOfDimensions(PARTS); const mwSize* in_dims = mxGetDimensions(PARTS); ...
ALGO
0.999084
5.791015
03585a13-2862-4348-a099-c05924812df6
Johniel/contests
codeforces/643div2/A/main.cpp
// codeforces/643div2/A/main.cpp // author: @___Johniel // github: https://github.com/johniel/ #include <bits/stdc++.h> #define each(i, c) for (auto& i : c) #define unless(cond) if (!(cond)) using namespace std; template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first...
ALGO
0.9998
4.222085
ac01281f-3401-4b77-b7bd-e23df9b8435a
BhavyamSanghavi/DSA-QUESTIONS
Difficulty: Medium/Merge two BST 's/merge-two-bst-s.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; #define MAX_HEIGHT 100000 // Tree Node struct Node { int data; Node* left; Node* right; Node(int val) { data = val; left = right = NULL; } }; // Function to Build Tree Node* buildTree(string str) { // Corner ...
ALGO
0.999889
6.195082
e58961fb-21d5-4ed2-b0e2-53685ccfd8cc
wangyonglin/ChatPlayer
src/components/sherpa-ncnn/include/ncnn-src/src/layer/riscv/tanh_riscv.cpp
#include "tanh_riscv.h" #if __riscv_vector #include <riscv_vector.h> #include "rvv_mathfun.h" #include "rvv_mathfun_fp16s.h" #endif // __riscv_vector namespace ncnn { TanH_riscv::TanH_riscv() { #if __riscv_vector support_packing = true; #if __riscv_zfh support_fp16_storage = true; #endif #endif // __riscv_ve...
ALGO
0.904718
7.112504
54cb1354-6a1e-4fca-bb93-fb9421e894a9
Yjiao917/2022-SWE-INTERVIEW-PREPARATION
📖书/Coding-master/Tree and BST/InOrderSucc.cpp
/* Given a Binary Tree, write a function to populate next pointer for all nodes. The next pointer for every node should be set to point to inorder successor. */ /* Set next of p and all descendents of p by traversing them in reverse Inorder */ /* Node Structure struct node { int data; struct node *left; struct nod...
ALGO
0.999978
5.754743
9cd61b03-3dd2-4a23-93a1-06559fe68b7d
Classroom-802/day-1-Hiimanshuhh
Day 1/question_6.cpp
// Count Digits in a Number #include <iostream> using namespace std; int main() { int n; cout << "Enter a positive integer: "; cin >> n; if (n == 0) { cout << "The number of digits in 0 is: 1" << endl; return 0; } int count = 0; // Variable to store the digit count while (...
ALGO
0.999595
6.899029
ddf302d4-b2f0-4d2b-b77a-187730fcea62
algo-geek/Codes
DP/min coins to make value.cpp
#include <iostream> #include <string.h> #include <limits.h> using namespace std; int minCoins(int arr[], int m, int value) { int dp[value + 1]; dp[0] = 0; for (int i = 1; i <= value; i++) dp[i] = INT_MAX; for (int i = 1; i <= value; i++) { ...
ALGO
0.999932
4.983559
241043a4-6070-44f8-b390-87810593b641
tinawebdev/cpp-primer-plus
chapter05/ex06.cpp
#include <iostream> #include <array> #include <string> int main() { using namespace std; const int Years = 3; const int Months = 12; array <string, Months> months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; ...
ALGO
0.963931
4.247027
21321b6d-45f4-4d0d-9510-a1cf93f43e43
MohamedMahmoudH/problemSolvingCodeForces
div2_A_Upload More RAM.cpp
#include <iostream> using namespace std; void solve() { short n , k; cin >> n >> k; cout << (n-1)*k + 1 << '\n'; } short t; int main() { ///ByMohamedMahmoud/// cin >> t; while(t--)solve(); return 0; }
ALGO
0.99975
3.647983
3a58d8a9-c2d6-4a82-ba6e-e8b19ae5400b
pnookala/X-OpenMP
libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
// <algorithm> // template<RandomAccessIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare> // requires ShuffleIterator<Iter> // && CopyConstructible<Compare> // void // sort(Iter first, Iter last, Compare comp); #include <algorithm> #include <functional> #include <vector> #include <cassert> ...
TEST
0.983853
5.644898
443f1920-3ad3-4c6d-8482-eb8368ddf743
shikha7124v/Data-Structures
Array/Easy/One_iteration.cpp
#include<bits/stdc++.h> using namespace std; int oneIteration(int arr[], int n) { sort(arr, arr + n); return (arr[n-1]+arr[n-2]); } int main() { int arr[] = {1,-5,3,6,2,5}; int n = sizeof(arr)/sizeof(arr[0]); int sum = oneIteration(arr, n); cout<<sum; return 0; }
ALGO
0.999931
4.105405
0d841627-6bc0-4b01-bafb-9d89c2956159
kyw04004/ProblemSolving
BOJ/2916_자와 각도기.cpp
#include<stdio.h> #include<cmath> #include<cstring> #include<string> #include<iostream> #include<vector> #include<queue> #include<functional> using namespace std; typedef pair<int, int> P; int n, m,arr[11],dp[361],ans; int go(int angle) { if (angle > 360) return 0; int &ret = dp[angle]; if (ret != -1) return ret; r...
ALGO
0.999993
3.536961
7e80b96d-ad3f-42b7-be36-caa959e086e4
nguyenquitai/nguyenquitai-monc
Chapter6/Program/program13.cpp
// This program demonstrates two value-returning functions. // The square function is called in a mathematical statement. #include <iostream> #include <iomanip> using namespace std; //Function prototypes double getRadius(); double square(double); int main() { const double PI = 3.14159; // Constant for pi doub...
ALGO
0.998944
6.385539
8e391836-60db-4291-ab8f-c43ee260a4a5
lakshaydhiman70/Competitive-Programming
BinarySearch/MedianInRowWiseSortedMatrix.cpp
#include<bits/stdc++.h> using namespace std; int median(vector<vector<int>> &matrix, int m, int n) { // Write your code here. } int main(){ int n = 3, m = 3; vector<vector<int>>matrix = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; auto ans = median(matrix, m, n); }
ALGO
0.999974
4.098189
8cda797b-973b-4e33-97c2-b9f663c55127
sjm150/ps
codeforces/rounds/915/d.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { cin.tie(0); ios_base::sync_with_stdio(0); int t; cin >> t; while (t--) { int n; cin >> n; vector<int> p(n); int z = 0; for (int i = 0; i < n; i++) { cin >> p[i]; if (p[i]...
ALGO
0.999734
4.038716
f2a29b42-8015-4c86-915d-c5abab504477
tail95/CPP_FromScratch
Chapter5/Chap5_ex04.cpp
#include <iostream> using namespace std; bool bigger(int a, int b, int& big) { if (a == b)return true; else { big = a > b ? a : b; return false; } } int main() { int a, b, big; cout << "두 정수를 입력하세요."; cin >> a >> b; b = bigger(a, b, big); if (b) cout << "같습니다" << endl; else cout << "큰수는 " << big << "입니다."...
ALGO
0.999798
4.387529
3ef0996a-8a58-4577-9fac-2967fd4cfd10
axxonite/algorithms
EPI/Problems/10_BinaryTrees/10.4_lowest_common_ancestor.cpp
#include "stdafx.h" #include "binary_tree_with_parent_prototype.h" // #define TEST BinaryTreeNodeP<int>* LCAParent( const unique_ptr<BinaryTreeNodeP<int>>& n0, const unique_ptr<BinaryTreeNodeP<int>>& n1 ) { return nullptr; } #pragma region Test void LCAParentTest() { #ifdef TEST auto root = make_unique<BinaryTre...
ALGO
0.98762
6.403989
95e237fb-9617-4ed0-b2cf-cde954a87262
crazy-kid/learning-boost
boost_1_88_0/libs/mpi/example/random_min.cpp
// An example using Boost.MPI's reduce() to compute a minimum value. #include <boost/mpi.hpp> #include <iostream> #include <cstdlib> namespace mpi = boost::mpi; int main(int argc, char* argv[]) { mpi::environment env(argc, argv); mpi::communicator world; std::srand(time(0) + world.rank()); int my_number = std...
ALGO
0.999877
5.755951
737a00a9-702d-430e-b307-7ca3f6ba8bcf
yashnayan8795/DSA-practice
206-reverse-linked-list/reverse-linked-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* reverseList...
ALGO
0.999719
5.892405
1719b632-eb16-4325-910c-b4a73163e407
prydsn121/Dsa-practise
1SquaresOfSortedArray.cpp
class Solution { public: vector<int> sortedSquares(vector<int>& nums) { for(int i=0;i<nums.size();i++) { nums[i]=nums[i]*nums[i]; } sort(nums.begin(),nums.end()); return nums; } };
ALGO
0.999984
5.804466
9e2def60-0188-439a-bf94-693b3c8f177d
GauravKr57/Complete-DSA
05_Searching/13_Minimum_no_of_pages_allocated.cpp
//NAIVE : Recursive solution int sum(int a[], int b, int e){ int s=0; for(int i=b;i<=e;i++){ s+=a[i]; } return s; } int minPages(int arr[], int books, int students){ if(students==1){ return sum(arr,0,books-1); } if(books==1){ return arr[0]; } int res= INT_...
ALGO
0.999967
4.73043
4edf9353-e885-4925-942f-1075764d1abe
MozhiDeng/solver
ipddp/include/eigen/demos/opengl/quaternion_demo.cpp
#include "quaternion_demo.h" #include "icosphere.h" #include <Eigen/Geometry> #include <Eigen/QR> #include <Eigen/LU> #include <iostream> #include <QEvent> #include <QMouseEvent> #include <QInputDialog> #include <QGridLayout> #include <QButtonGroup> #include <QRadioButton> #include <QDockWidget> #include <QPushButton...
ALGO
0.85694
5.849781
877a4057-8284-432b-b598-2782eef0b0ca
KarthikNedunchezhiyan/competitive-programming-solutions
solutions/leetcode/hard/00076-Minimum-Window-Substring/solution.cpp
class Solution { public: string minWindow(string s, string t) { if (s.length() < t.length()) return ""; unordered_map<char, int> t_freq; unordered_map<char, int> s_freq; int level = 0, ri = 0, rc = INT_MAX, start = 0; for (char &tc: t) ++t_freq[tc]; for (int i = 0...
ALGO
0.999998
6.597735
7c6ca7d1-d605-4d8e-9974-0760c5c89bd7
LakoMoor/SE2013
thirdparty/openal-soft/core/filters/nfc.cpp
#include "config.h" #include "nfc.h" #include <algorithm> #include "opthelpers.h" /* Near-field control filters are the basis for handling the near-field effect. * The near-field effect is a bass-boost present in the directional components * of a recorded signal, created as a result of the wavefront curvature (i...
ALGO
0.99467
5.892649
87c05a34-4430-4962-a420-88dba3aa8184
ishubhranshu/code_soln
2486-append-characters-to-string-to-make-subsequence/2486-append-characters-to-string-to-make-subsequence.cpp
class Solution { public: int appendCharacters(string s, string t) { int n=s.length(), m=t.length(); int i=0, j=0; while(i<n && j<m) { if(s[i]==t[j]) j++; i++; } return m-j; } };
ALGO
0.99995
6.017056
5ad898c4-2c65-48b7-9377-9c99da07282f
TheAlphaJas/A2OJ-Ladders
11/A_Lights_Out.cpp
#include <bits/stdc++.h> using namespace std; //author: von_Braun #define ll long long #define lli long long int #define pb push_back #define rep(var, start, num) for(lli var = start; var <start + num; var++) #define all(x) x.begin(), x.end() #define ulli unsigned long long int #define ull unsigned long long bool sortb...
ALGO
0.999891
3.520867
cbe84e2a-23ba-4354-b6f6-ef5e2d78f8da
StonyBrookDB/hadoopgis
src/resque/resque_2d.cpp
#include <resque/resque_2d.hpp> /* * RESQUE processing engine v3.0 * It supports spatial join and nearest neighbor query with different predicates * 1) parseParameters * 2) readCacheFile - metadata such as partition schemata * 3) for every input line in the current tile * an input line represen...
DATA
0.979541
5.591053
ca1ab5e4-c3be-49d4-9eb0-fcc7aa461c33
Vivek-patial/cpp-learning
day8/evenOdd.cpp
#include<iostream> using namespace std; int main(){ //Check if a Number is Even or Odd int num =10; if(num==0){ cout<< "Even"; } else if(num%2==0){ cout<< "Even"; } else{ cout<< "Odd"; } return 0; }
ALGO
0.997554
3.711105
b8870ae8-59c7-41f8-8cca-2f268e6e4b41
kanadkapil/CPP_Combined_Repo
Sum of two.cpp
#include<iostream> #include<algorithm> using namespace std; int main() { int a, b; cin>>a>>b; int sum=a+b; cout<<"The sum of A and B"<<sum<<endl; return 0; }
ALGO
0.987537
3.532633
9899a046-44db-4eb3-8a66-82f843e8f5de
lt974982407/leetcode
135/main.cpp
#include <iostream> #include <vector> using namespace std; int candy(vector<int>& ratings) { vector<int> left(ratings.size(),1); left[0] = 1; for(int i = 1; i < ratings.size(); i++){ if(ratings[i] > ratings[i - 1]){ left[i] = left[i - 1] + 1; } } int right = 1, res = le...
ALGO
0.999979
6.043762
6970e42e-bc80-46bf-997f-42db2e6a1276
EZury/uni-works
Mokyklos/2_ND/1/1.cpp
//vieta programos vardui #include <iostream> #include <cstdlib> #include <cmath> #include <fstream> #include <iomanip> using namespace std; int main () { system ("chcp 1257"); int n, v; double p; cout << "veskite kiek Lietuvoje yra automobili n = "; cin >> n; cout << "veskite kiek pardav vliav ...
ALGO
0.996287
4.004791
31dd01a2-cc08-4c9f-ae92-c8e7fd1acff2
George-Samir88/bookly_app
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
cfbcdef2-47fb-4332-9421-a71440cd8c63
dvkcool/competitive
codeforces/practice/1256-e.cpp
#include <iostream> #include <algorithm> using namespace std; class student{ public: int skill; int pos; student(){ skill =0; pos = 0; } }; bool studentCompare(student const & a, student const & b){ return a.skill < b.skill; } int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n; cin>...
ALGO
0.999979
3.563812
5257bd9e-7f67-4201-9df3-b137ca6bddb5
musa-45/CODEFORCES_CODES
Arena.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while(t--) { int n; cin >> n; vector<int> v(n); for(int i = 0; i < n; i++) { cin >> v[i]; } sort(v.begin(), v.end()); int b = *min_element(v.begin(), v.end()); ...
ALGO
0.999612
4.781606
1f97e6ad-14c5-4368-86a3-7f50b934bf8d
lutcoding/cmu-database
src/execution/sort_executor.cpp
#include "execution/executors/sort_executor.h" namespace bustub { SortExecutor::SortExecutor(ExecutorContext *exec_ctx, const SortPlanNode *plan, std::unique_ptr<AbstractExecutor> &&child_executor) : AbstractExecutor(exec_ctx), plan_(plan), child_executor_(std::move(child_executor)) {} ...
ALGO
0.997835
6.497196
601f3d9b-0e7a-4834-b765-63692c29112c
Jeelgor/DSA
WEEK__5/Char_String_Array/Length_Of_String.cpp
#include <iostream> using namespace std; int findLength(char ch[], int size) { int length = 0; for (int i = 0; i < size; i++) { if(ch[i]=='\0') { break; } else{ length++; } } return length; } int main() { char ch[100]; cin >> ch...
TOOL
0.901547
3.553912
690e94de-7094-43d8-a621-5834a6d6aa84
AerideS/algorithm_practice
레벨 2/전력망을 둘로 나누기/20231227.cpp
#include <string> #include <vector> #include <cmath> #include <queue> #define MAX 101 using namespace std; int cnt; vector<int> info[MAX]; void bfs(int v1, int v2) { queue<int> q; vector<bool> visited(MAX); q.push(v1); /* ¸ v1 v2 ϴ */ visited[v1] = true; visited[v2] = true; /* v1, v2 ¸ */ while (!q...
ALGO
0.999935
4.861897
62766e4c-4f25-429b-846a-ac7d93277b01
ayush-1105/GfG
Difficulty: Easy/Find Only Repetitive Element from 1 to n-1/find-only-repetitive-element-from-1-to-n1.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: int findDuplicate(vector<int>& arr) { // code here int n=arr.size(); unordered_set<int>st; for(int i=0; i<n; i++){ ...
ALGO
0.996142
6.04285
923822ca-b996-4bf8-a413-34377dd09fbc
initc3/VENEER
main.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cassert> #include <cstring> #include <fstream> #include <sstream> #include <algorithm> #include <vector> #include <map> #include <ctime> #include "sha256.h" #include "NDArray.h" #include "Layers.h" #include "Model.h" using namespace ...
DATA
0.967756
4.557179
817910e1-9bac-4cd0-a5ee-11f8aa40c63e
linkeLi0421/no-remove-no-reorder
bolt/lib/Passes/FrameAnalysis.cpp
#include "bolt/Passes/FrameAnalysis.h" #include "bolt/Core/ParallelUtilities.h" #include "bolt/Passes/CallGraphWalker.h" #include "llvm/Support/Timer.h" #include <fstream> #include <stack> #define DEBUG_TYPE "fa" using namespace llvm; namespace opts { extern cl::OptionCategory BoltOptCategory; extern cl::opt<unsigne...
TOOL
0.872583
7.555149
2b481f6e-b01e-41b7-9512-53fef95a131c
chenhongqiao/USACO
hshoe/hshoe.cpp
#include <iostream> using namespace std; int n; char m[10][10]; bool u[10][10]; short int xdir[4] = {0, 1, 0, -1}; short int ydir[4] = {1, 0, -1, 0}; int ans = 0; void dfs(int ln, int rn, int x, int y) { if ((rn != 0 && rn >= ln) || x < 0 || y < 0 || x >= n || y >= n) { if (ln == rn) { ...
ALGO
0.999794
3.854501
ede912aa-9526-4e3e-9782-3c9dbb5cb7b9
MaximePremont/R-Type_Epitech
libs/boost/libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp
#include <iostream> #include <map> #include <string> #include <fstream> #ifndef M_PI //not there on windows #define M_PI 3.1415927 //... #endif #include <boost/numeric/odeint.hpp> using namespace std; using namespace boost::numeric::odeint; //[ two_dimensional_phase_lattice_definition typedef boost::numeric::ublas:...
ALGO
0.99742
5.251648
4f1bcb24-c9cb-4939-91f2-cb2cc80d765e
priojeetpriyom/competitive-programming
CONTESTS/iut practise contest/Little Masters adhoc geometry .cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); // std::ios_base::sync_with_stdio(false); // cin.tie(0); int t; scanf("%d", &t); double x, y, r; while(t--) { scanf("%lf %lf ...
ALGO
0.99959
3.713757
0008c256-85a7-42f5-9423-206ead451d37
dipeshpandit12/C-plus-plus
Practise/switch.cpp
#include <iostream> using namespace std; int main() { int day; cout << " Enter the day of the week in number as Sunday = 1, Monday = 2 etc. to know the origin of the Word" << endl; cin >> day; switch (day) { case 1: cout << "Sunday is named after a star (the sun), and means day of th...
TOOL
0.988118
3.777926
220117eb-7493-4caf-a589-cc52c5cba6c3
ishandutta2007/codeforces
takio/normal/448/C.cpp
#include <cstdio> #include <iostream> using namespace std; int n, a[5010]; int solve (int l, int r){ if (l > r) return 0; if (l == r) return 1; int mn = 1e9 + 10; for (int i = l; i <= r; i++) mn = min(mn, a[i]); int res = mn; int f = l - 1; for (int i = l; i <= r; i++) { ...
ALGO
0.999967
3.834039
3fbfb973-7400-4fdb-84b1-fa596a8af9fb
RunAtTekky/DSAandCP
practice/cf/C_Schedule_Management.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; map<int,int> freq; ll n, m; vector<ll> vec; bool ok(int mid) { ll extra = 0; for (int i=1; i<=n; i++) { int fr = freq[i]; if (fr >= mid) extra += fr - mid; else extra -= (mid - fr) / 2; } // if (extra <= 0) ...
ALGO
0.999988
4.954323
b789373b-06b8-43ee-9f56-955dcd9e6925
Sena-Han/Baekjoon
24000 - 24999/24356.cpp
#include <iostream> using namespace std; int main() { int t1, m1, t2, m2, res; cin >> t1 >> m1 >> t2 >> m2; m1 += t1 * 60; m2 += t2 * 60; if (m1 > m2) m2 += 24 * 60; res = m2 - m1; cout << res << " " << res / 30 << '\n'; return 0; }
ALGO
0.999621
4.090748
074355ea-1f00-446a-9d4e-16fda5d971bd
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_8337_5.cpp
#include <bits/stdc++.h> using namespace std; int main() { long long int n, k, i = 0, j = 0; string s; cin >> n >> k >> s; for (i = 1; i < n; i++) { while (s[i + j] == s[j] && i + j < n) { j++; } if (i + j == n) { break; } else j = 0; } cout << s; while (k--) { for (i...
ALGO
0.999977
3.054138
eade3e5f-b1cf-4bf8-bc27-d58bd8c40177
AryanSharma47/leetcode-solutions
1614.MaxNestingDepthOfParentheses.cpp
//Brute Force //Using Stack class Solution { public: int maxDepth(string s) { stack<char> st; int ans = 0; for(auto i : s) { if(i == '(') st.push(i); else if(i == ')') st.pop(); ans = max(ans,(int)st.size()); } ...
ALGO
0.999431
5.63129
f0c2d1f3-ef89-4126-ae16-c15562f35a98
Kawser-nerd/CLCDSA
Source Codes/CodeJamData/14/61/2.cpp
#define _CRT_SECURE_NO_DEPRECATE #define _USE_MATH_DEFINES #include <iostream> #include <fstream> #include <cstdio> #include <cstdlib> #include <cassert> #include <climits> #include <ctime> #include <numeric> #include <vector> #include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <iomanip>...
ALGO
0.999817
4.420454
9295fd05-643f-45cc-8b74-2cf5a5fec2a7
itsme-aparna/DSA-Resources
210-course-schedule-ii/210-course-schedule-ii.cpp
class Solution { public: vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites) { vector<int> indegree(numCourses, 0); vector<int> adj[numCourses]; vector<int> ans; for(auto it: prerequisites){ adj[it[1]].push_back(it[0]); indegree[it[0]]++;...
ALGO
0.999986
6.092337