uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
a73c471e-90e1-4380-aee6-cfc6787cc4f8
arin2002/Hacktoberfest-2022
C++/serialiseDeserialiseBinaryTree.cpp
/* Vertical Order Traversal of a Binary Tree - Leetcode Hard Question Given the root of a binary tree, calculate the vertical order traversal of the binary tree. For each node at position (row, col), its left and right children will be at positions (row + 1, col - 1) and (row + 1, col + 1) respectively. The root of t...
ALGO
0.999997
6.830917
9345024f-6689-4b2b-9bcf-8f7a781451ba
bakir004/ETF
tp/instrukcije/4a4b/transform-matricu.cpp
#include <iostream> #include <stdexcept> #include <utility> typedef std::vector<std::vector<int>> Matrica; void ObrniElemente(std::vector<int>& v) { for(int i = 0; i < v.size()/2; i++) { std::swap(v[i], v[v.size()-1-i]); } } std::deque<int> TransformisiMatricuIDajSumuKolona(Matrica& m) { for(int i...
ALGO
0.998381
5.432522
285ab546-4ffe-4089-aed1-a1478320868e
prachurjyo-ghub/Codes
CODES/C++/Practice/bit wise/tempCodeRunnerFile.cpp
// int a,b; // cout<<"ENter A :"<<endl; // cin>>a; // cout<<"ENter B :"<<endl; // cin>>b; // /*Eikhene A k 32 bit binary te convert // and B keo same kore TT onujayee oparation hobe // */ // cout<<"A&b : "<<(a&b)<<endl; // cout<<"A|b : "<<(a|b)<<endl; // cout<<"~A : "<<(~a...
ALGO
0.977842
3.404622
57c1935e-2f99-403f-9807-f34b917200b2
JihanHayaMufialdo/hackerrank
luas kolam.cpp
#include <iostream> using namespace std; int main() { float r; cin >> r; printf("%.2f",3.14*r*r); return 0; }
ALGO
0.997108
3.793427
913cf60b-d1d5-4a9a-b410-2d54697e2cc3
beberiche/Algorithms
SWEA/src/Q15949_현석이의_생일/main.cpp
#include <bits/stdc++.h> using namespace std; int N; string x, y; int main() { int T; cin >> T; for (int t = 1; t <= T; t++) { cin >> N >> x >> y; string ans = ""; cout << x + y << "\n"; if (N < stoi(x + y)) { ans = "-1"; } cout << "#" << t << " " ...
ALGO
0.984342
3.961797
7c55768d-b8bd-4070-8878-fe9826334486
manikanta2901/ubuntu
.history/practice/cpp/Leetcode/Cpp/AddTwoNumbers_20210308204453.cpp
#include<bits/stdc++.h> using namespace std; struct ListNode{ int val; ListNode *next; }; class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { int num1 = 0,num2 = 0; while(l1->next != NULL){ l1 = l1->next } return l1; } }; int mai...
ALGO
0.999635
5.011243
1845bd6c-620a-4957-8755-d7412768cad9
Quadroue4/Algorithm
1865/1865/1865.cpp
// 1865.cpp : ܼ α׷ մϴ. // #include "stdafx.h" #include <iostream> #include <vector> #include <algorithm> #include <climits> int arr[501][501]; using namespace std; #define INFINITE INT_MAX; void Reset() { for (int i = 0; i < 501; i++) { for (int j = 0; j < 501; j++) { if (i != j) arr[i][j] = INFINITE; ...
ALGO
0.999678
4.475391
c3749690-a9c1-43d0-b626-7f94099c0f70
lazyfruit/BV122_BasicsCpp
ProjectArrays/mainArrays.cpp
#include<iostream> using namespace std; #define TAB "\t" #define REVERSE_ARRAY #define SUM_AND_AVG #define MAX_AND_MIN_VALUE_ARRAY #define SHIFT_ARRAY #define PAUSE system("pause"); void main() { //Array initialization: const int SIZE_ARRAY = 10; int array[SIZE_ARRAY] = { 1,2,3,4,5,6,7,8,9,10 }; //Entering value...
TOOL
0.951755
3.739293
30606ad0-7e2d-461b-a95b-0d6aad590ee4
qingbot/UEngine
Engine/Source/ThirdParty/MaterialX/MaterialX-1.38.5/source/MaterialXFormat/Util.cpp
#include <MaterialXFormat/Util.h> #include <fstream> #include <iostream> #include <sstream> MATERIALX_NAMESPACE_BEGIN string readFile(const FilePath& filePath) { std::ifstream file(filePath.asString(), std::ios::in); if (file) { std::stringstream stream; stream << file.rdbuf(); fi...
TOOL
0.946382
7.064904
efcc5a55-4d04-4154-af2a-5f09f129d3cd
Fraunhofer-AISEC/softboundcets-llvm-project
llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallSet.h" #include "llvm/Analysis/InstructionSimplify.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/Dominators.h" #inc...
ALGO
0.885307
4.303577
d7ae56e1-ecf2-4e82-89ca-ee7f137d5687
MUMINUR-RASHID/WEEKLY-PRACTICE
WEEK-5/C_Minimize_the_Thickness.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { int t; cin>>t; while(t--) { int n; cin>>n; vector<int>v(n); ll total=0; for(int i=0;i<n;i++) { cin>>v[i]; total+=v[i]; } ll sum=0; ll len_cn...
ALGO
0.999771
3.603958
4f6eea20-173a-4a4f-b9df-0eacff43627d
deeppatel618/LeetCode
0110-balanced-binary-tree/0110-balanced-binary-tree.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.99991
6.51654
35524590-e7bf-41ad-a517-8644f0d4861a
jamperezmondragon/Competitive-Programming
cses/Graph_Algorithms/Mail_Delivery.cpp
#include <bits/stdc++.h> using namespace std; #define sz(a) (int)a.size() const int Mxn = 1e5 + 1; set<int> g[Mxn]; vector<int> path; void dfs(int node, int parent = -1) { if (parent != -1) g[node].erase(parent); while (sz(g[node])) { auto it = g[node].begin(); int child = *it; g[node].erase(it); d...
ALGO
0.999979
4.210873
f1bf48bd-2de6-440d-8212-690d193959ec
raincross7/code-similarity
codes/train_code/problem264/problem264_398.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a[n+1]; for(int i=0;i<=n;i++)cin>>a[i]; long long b[n+1],wa[n+1]; b[0]=1-a[0]; if(b[0]<0){ cout<<"-1"<<endl; return 0; } wa[0]=a[0]; for(int i=1;i<=n;i++)wa[i]=wa[i-1]+a[i]; for(int i=...
ALGO
0.999964
3.396235
02bb8192-d397-4665-9d0e-3e17359671e1
umairazfar/oop
2018 Summer/Lectures/Week01/Week01_Lecture01.cpp
/** * OOP lecture 01. Programming Basics in C++ * Understanding Data Types and Functions **/ #include<iostream> //Similar to import command in Python #include<stdio.h> #include<stdlib.h>//For random numbers #include<time.h>//For generating a new random seed using namespace std; //required for using cin and cout co...
TOOL
0.884819
3.030061
00b8687e-f93c-4f75-8c63-f9b6af6de428
Sarveshsingh2007/coding
pattern20.cpp
#include<iostream> using namespace std; int main() { int n; cin>>n; int i=1; while(i<=n) { int j=1; while(j<=n-i){ cout<<"*"; j=j+1; } cout<<endl; i=i+1; } }
ALGO
0.999907
3.835597
f631739e-09fc-49cb-b9f7-3922ec219734
hemantsingh443/NNinCpp
lib/eigen-3.4.0/bench/sparse_transpose.cpp
//g++ -O3 -g0 -DNDEBUG sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out // -DNOGMM -DNOMTL // -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a #ifndef SIZE #define SIZE 10000 #endif #ifndef...
ALGO
0.977412
5.110691
3214a20c-52b6-4315-afdf-b043d21eccb6
j-mathes/PPP
Chapter 11/Exercise 16/Exercise 16.cpp
//---------------------------------------------------------------------------- // File: Exercise 16.cpp // Date: 2018-09-12 // Author: Jared Mathes //---------------------------------------------------------------------------- // Solution:Chapter 11 // Project: Exercise 16 //--------------------------------------------...
ALGO
0.998521
5.459664
f0899201-5274-4625-a2ec-18748e43e5f8
umangja/CompetitiveProgrammingSolution
codeforces/77/A.cpp
/*input */ //assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space #include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define pii pair<ll int,ll int> #define vpii vector< pii > #define vi vector<ll ...
ALGO
0.999863
3.892852
23a3e284-3cf2-4e0d-b86e-2244f44880d9
sumit2011/DSA-in-cpp
heap/heapify.cpp
#include<iostream> using namespace std; heapify(int arr[], int n; int i){ } int main(){ return 0; }
ALGO
0.998287
3.764822
cd6dd959-164a-4e42-9ec2-97a0d17d5b37
muhammeduraz/leetcode
Problems/Length_of_Last_Word.cpp
#include "Length_of_Last_Word.h" int lengthOfLastWord(string s) { bool space = false; int length = 0; for (int i = 0; i < s.length(); i++) { if (s[i] == ' ') { space = true; } else { if (space) { length = 0; ...
TOOL
0.88906
4.862348
f5178281-8a7a-4443-a50b-bef1bec3036f
kshitijmishra27/DSA-practice
62-unique-paths/62-unique-paths.cpp
class Solution { public: int find(int i, int j, int m , int n, vector<vector<int>> &dp){ if(i==m-1 && j==n-1){ return 1; } else if(i >= m || j >= n){ return 0; } else if(dp[i][j] != -1){ return dp[i][j]; } else...
ALGO
0.999976
6.347159
43b5bd17-a286-4755-b5b9-3a571ae5a42b
sameerpande12/Traffic-Simulator
common.cpp
#include <any> #include <cstring> #include <string> #include <iostream> #include <map> #include <vector> #include <random> #include <queue> #include <fstream> #include <sstream> #include <chrono> #include "common.h" #include <thread> using namespace std; std::random_device random_gen; std::mt19937 gen(random_gen()); st...
TOOL
0.854732
3.291642
42f96f6a-0703-42be-9ebe-67aeb27d4aa3
LaljiSankhat/DSA
Sliding Window/06_substrContainingAllCharacter.cpp
#include <bits/stdc++.h> using namespace std; /* 1358. Number of Substrings Containing All Three Characters Given a string s consisting only of characters a, b and c. Return the number of substrings containing at least one occurrence of all these characters a, b and c. Example 1: Input: s = "abcabc" Output: 10 ...
ALGO
0.999899
6.097592
4e911391-4272-48ee-8215-86a2edb9d962
vrandachag/Competitive-Programming
CodeChef/BOLT.cpp
#include<bits/stdc++.h> using namespace std; float round_1(float var) { float value = (int)(var * 100 + .5); return (float)value / 100; } int main() { int T; float k1,k2,k3,v; cin>>T; while(T--) { cin>>k1>>k2>>k3>>v; float mult = k1*k2*k3*v; // mult = 100/mult; ...
ALGO
0.999624
3.385839
f5a52235-4ad8-4ad6-8cdf-da1a79dd1c12
SABCEMM/SABCEMM
src/PriceCalculator/PriceCalculatorLLS1.cpp
#include "PriceCalculatorLLS1.h" #include <iostream> using namespace std; PriceCalculatorLLS1::PriceCalculatorLLS1(Price *price, DeltaT* deltaT, double marketDepth, ExcessDemand *ED, ExcessDemandCalculator* EDCalculator, RandomGenerator* rng, double mean, double sigma, vector<Agent *> *agents): price(price), ...
ALGO
0.99813
5.249159
1b49dab0-5dfe-421d-930f-f2040eeaec8e
yoonjaecho/Algorithm_BOJ
problem/15786/15786.cpp
#include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; string pass; cin >> pass; int pl = pass.length(); while(M--) { string in; cin >> in; int i = 0; for(char ch: in) if(ch == pass[i]) i++; puts(i == pl? "true":"false")...
ALGO
0.999561
4.087781
80b32bd5-26d3-4840-9b07-0fd280f57f50
ExistoT01/Discrete-Mathematics-II-Experience3
实验三.cpp
#include <iostream> #include <vector> #include "booster.h" #include "Matrix.h" using namespace std; class solution { public: //变量 int n;//矩阵阶数 int m;//边数 int r;//面数 //对偶图 int dn; int dm; int dr; vector<vector<int>> adjMatrix;//邻接矩阵 vector<vector<int>> faceMatrix;//面矩阵 vector<vector<int>> incMatrix;//关联矩阵 v...
ALGO
0.999123
3.789498
6db59f84-d46e-40c4-86c2-f685ff4001fe
niumeng07/code-dev
test/cpp/openmp.cpp
#include <omp.h> #include <time.h> #include <iostream> using namespace std; int main() { clock_t start = clock(); #pragma omp parallel for for (int i = 0; i < 100; ++i) { std::cout << i; } cout << endl; clock_t end = clock(); cout << end - start << endl; start = clock(); for (int i = 0; i < 100; ...
ALGO
0.955051
3.999421
bb45a29d-de30-405e-ac82-772c27a61cfe
ishandutta2007/codeforces
krk/normal/1497/C1.cpp
#include <bits/stdc++.h> using namespace std; int T; int n, k; int main() { scanf("%d", &T); while (T--) { scanf("%d %d", &n, &k); if (n % 2) printf("%d %d %d\n", n / 2, n / 2, 1); else if (n / 2 % 2) printf("%d %d %d\n", n / 2 - 1, n / 2 - 1, 2); else printf("%d %d %d\n", n / 2, n / 4, n / 4); } retur...
ALGO
0.999542
3.828405
cb5755eb-0f78-42f2-b0da-8baee9067614
shafayetejaman/CLI-projects
extractText/files/week 08/day 4/A_Jagged_Swaps.cpp
// https://codeforces.com/contest/1896/problem/A #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace std; usi...
ALGO
0.999965
4.829506
0b8dfb8e-6ea7-4c33-8624-157d2f765dd6
AyushTripathi1010/Mathematics
Sum_Of_All_Divisors_From_1_To_N.cpp
// Problem Link: https://practice.geeksforgeeks.org/problems/sum-of-all-divisors-from-1-to-n4738/1 // INTUITION: For a given value of N we have to find sum of all divisors from 1 to n // Eg: Input: // N = 5 // Output: // 21 // Explanation: // F(1) = 1 // F(2) = 1 + 2 = 3 // F(3) = 1 + 3 = 4 // F(4) = 1 + 2 + 4 = 7 //...
ALGO
0.999969
5.924053
17f6ff55-fd24-49bf-9a57-1cf58f6643aa
mubasshirahin/Competitive-Programming
Codeforces/762A(D3).cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ string str; cin>>str; int size = str.length(); bool flag = false; if(size%2==1){ cout<<"NO"<<endl; continue; } else{ int mid ...
ALGO
0.999883
4.964363
2baea59a-cbeb-48be-9ad6-9ecf72ed66c8
Nikhil-251/Code
485-max-consecutive-ones/485-max-consecutive-ones.cpp
class Solution { public: int findMaxConsecutiveOnes(vector<int>& nums) { int count=0,curr=0; for(int i=0;i<nums.size();i++){ if(nums[i]==1){ curr+=1; } else{ curr=0; } if(curr>count){ count=cu...
ALGO
0.99997
6.170642
0d9738fd-7666-4341-b8d8-bb0dc29e1589
Mountagha/cpu0-llvm-backend
chapters/Chapter3_5/Cpu0AnalyzeImmediate.cpp
#include "llvm/Support/MathExtras.h" using namespace llvm; Cpu0AnalyzeImmediate::Inst::Inst(unsigned O, unsigned I) : Opc(O), ImmOpnd(I) {} // Add I to the instruction sequences. void Cpu0AnalyzeImmediate::AddInstr(InstSeqLs &SeqLs, const Inst &I) { // Add an instruction seqeunce consisting of just I. if (SeqLs....
ALGO
0.979988
7.478617
e175e312-f8da-4fdd-b646-ccb44fdbc66c
Yash-Jaiswal28/DSA_CPP
Josephus_Problem_II.cpp
//Yash_Jaiswal #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef long long ll; #define Endl '\n' #define pb push_back #define ff first #define ss second #define yes cout<<"YES"<<endl #define no cout<<"NO"<<e...
ALGO
0.999984
3.313788
6f7a56cf-85c8-4cec-b1b0-fa5a2888552c
geethikageethika/CSA0245
DIAGONAL MATRIX OCT 4.cpp
#include <stdio.h> const int M = 4; const int N = 4; void printDiagonalSums(int mat[M][N]) { int principal = 0, secondary = 0; for (int i = 0; i < M; i++) { for (int j = 0; j < N; j++) { if (i == j) principal += mat[i][j]; if ((i + j) ...
ALGO
0.999597
4.074746
bdfaf382-528e-4f0f-9aa5-bcc677e99514
sahilmadaan048/Aditya-Verma-Recursion
17. Generate all valid parenthesis/main.cpp
/* for a given number n generate all valid parentheses with n open and n close brackets generate all of these how is this even recursion some problems can be directly seen some cannot be => if you can understand choices and decisions then we can try to use recursion n=3 means 3 open brackets and 3 closed brackest ...
ALGO
0.999611
4.926747
77b18172-2cc7-41cf-9028-324e64b0f62f
Nandnee/Combinatorial-Computing
ferrer_part_b.cpp
#include <iostream> #include <string> using namespace std; int rpartition(int n, int k) { if (n<k) return 0; if (n==k || k==1) return 1; return rpartition(n-1,k) + rpartition(n-k,k); } int qpartition(int n, int k) { int a = 0; for(int i = 1; i<=k; i++) { a = a+rpartition(n-k,i); } ...
ALGO
0.999921
4.255348
b4b0d3f2-b2d0-42c1-aeea-67ed173736b4
mini-apple/algorithm-level2
04_linked_list/boj_5397_1.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; while (n--) { string L; cin >> L; list<char> lst; auto cursor = lst.end(); for (char c: L) { if (c == '<') { if (cursor != lst.begin()) cursor--; } else if (c == '>') { if ...
ALGO
0.999951
4.269936
4a1010e9-f852-40e5-9835-65dae71a44f9
m-a-d-n-e-s-s/tbb
src/perf/time_fibonacci_cutoff.cpp
#include <cstdio> #include <cstdlib> #include "tbb/task_scheduler_init.h" #include "tbb/task.h" #include "tbb/tick_count.h" #include "fibonacci_impl_tbb.cpp" long CutOff = 1; long SerialFib( const long n ); long ParallelFib( const long n ); inline void dump_title() { printf(" Mode, P, repeat, N, =fib va...
ALGO
0.999918
5.421986
4e2dd697-cac1-4252-8aa1-da543ec6e246
sarvex/leetcode-julia
solution/0000-0099/0096.Unique Binary Search Trees/Solution.cpp
class Solution { public: int numTrees(int n) { vector<int> dp(n + 1); dp[0] = 1; for (int i = 1; i <= n; ++i) { for (int j = 0; j < i; ++j) { dp[i] += dp[j] * dp[i - j - 1]; } } return dp[n]; } };
ALGO
0.999996
6.566315
43dce20f-5a89-4578-be29-1fe86e257a54
ishandutta2007/codeforces
hongzy/normal/1195/D1.cpp
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back typedef pair<int, int> pii; typedef unsigned long long ull; typedef long long ll; typedef double db; const int mo = 998244353; const int N = 1e5 + 10; int n, a[N], pw[20]; int main() { scanf("%d", &n); pw[0] = 1; for(int i =...
ALGO
0.999927
4.615954
dd978d60-3416-4c3f-a1cf-986ddfbf8d16
iRobot42/Geeks-for-Geeks
Easy/Drive the car.cpp
long long required( long long a[], long long n, long long k ) { const auto d{ *max_element( a, a + n ) - k }; return d > 0 ? d : -1; }
ALGO
0.999858
4.587015
c4ff9925-7fc7-4801-bb79-72287d4c6953
iuiuiom/hhvm
third-party/folly/src/folly/detail/SplitStringSimd.cpp
#include <folly/detail/SplitStringSimd.h> #include <folly/detail/SplitStringSimdImpl.h> #include <folly/FBString.h> #include <folly/FBVector.h> #include <folly/small_vector.h> namespace folly { namespace detail { template <typename Container> void SimdSplitByCharImpl<Container>::keepEmpty( char sep, folly::Strin...
TOOL
0.884819
7.613748
1f52e3c4-e184-4273-93e1-093cd3e10624
Thasin-Sheikh/CSES-Solutions
Movie Festival .cpp
///*Bismillahir Rahmanir Rahim***/// ///**Author thasin_sheikh**/// #include<bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template<class T> using myset=tree<T,null_type,less_equal<T>,rb_tree_tag,tree_order_statistics_node_u...
ALGO
0.99979
4.29035
ba9a6e9f-1de9-4ae7-aaab-21ef7d118349
Ryb7532/AtCoder
submissions/arc108/c.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define vec vector #define rep(i,n) for (int i=0; i<(n); i++) #define print(a) cout << a << endl #define fix(n) fixed << setprecision(n) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define Yes "Yes" #d...
ALGO
0.999994
4.263838
e0f1678e-e75b-40c1-bd95-d8a34e8461cf
alzmqp00/leet
198. 打家劫舍 copy.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int rob(vector<int> &nums) { if (nums.size() == 0) return 0; if (nums.size() == 1) return nums[0]; if (nums.size() == 2) return max(nums[0], nums[1]); vector<int> dp(nums.si...
ALGO
0.999794
5.050889
42a48c06-e449-47a8-98f3-269aac3244f3
hnakamur/boost-deb
debian/tests/srcs/mpi/demo5.cpp
// https://www.boost.org/doc/libs/1_67_0/doc/html/mpi/tutorial.html #include <boost/mpi.hpp> #include <boost/mpi/collectives.hpp> #include <iostream> #include <cstdlib> #include <vector> namespace mpi = boost::mpi; int main(int argc, char *argv[]) { mpi::environment env(argc, argv); mpi::communicator world; ...
ALGO
0.9996
4.257902
eef0db52-c044-40c7-ae21-e09a93545db6
raincross7/code-similarity
codes/train_code/problem345/problem345_218.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n,quot,sum=0; cin>>n; quot = n/15; sum = (n*800)-(quot*200); cout<<sum<<endl; return 0; }
ALGO
0.998586
3.475291
11070d5a-6446-4ca2-bd2b-a32f338081dc
Elvito-hub/DSA-competitive-programming-
1.Number Theory/Practice/Hackerearth/tictactoe2.cpp
#include<bits/stdc++.h> using namespace std; int power(long long x,unsigned int y,int p){ int res=1; x=x%p; if(x==0) return 0; while(y>0) { if(y & 1) res=(res*x)%p; y=y>>1;//y=y/2; x=(x*x)%p; } return res; } void solve() { const int MOD = 1e9 + 7; long long maximum, minimum; int no_o...
ALGO
0.999671
4.394434
e5fb9e46-22eb-4f54-9d3d-e52d2bf7de18
tobsa/Xiaolin-Wus-Line-Algorithm
Xiaolin Wu's Line Algorithm/Source/XiaolinWusLineAlgorithm.cpp
//////////////////////////////////////////////////////////////////////////////// // XiaolinWusLineAlgorithm.cpp //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // Headers //////////////////////////////////...
ALGO
0.943055
5.318745
2a95c562-e917-4621-9df0-576278768937
Purnima47/Leetcode-Solutions
🟡 Medium/2657 - Find the Prefix Common Array of Two Arrays/_2657FindthePrefixCommonArrayofTwoArrays.cpp
class Solution { public: vector<int> findThePrefixCommonArray(vector<int>& A, vector<int>& B) { int n = A.size(); vector<int> freq(n + 1, 0); vector<int> res(n); int count = 0; for (int i = 0; i < n; i++) { freq[A[i]]++; if (freq[A[i]] == 2) { ...
ALGO
0.999895
6.377533
e823f418-2eab-48a8-a512-4dcf293bb4c8
TharakaUJ/cpp_time_calculation
src/heapSort/heapSort.cpp
#include <iostream> #include <sstream> #include <vector> #include "heapSort.h" using namespace std; // function to heapify the tree void heapify(int arr[], int n, int root) { // build heapify int left_index = 2 * root + 1; int right_index = 2 * root + 2; int largest_index = root; if (left_index < n...
ALGO
0.999861
4.971744
45f8d8e3-a739-4cbb-ab19-71ba9084c116
pogery-foggy/BOJ_study
code/2023/code/1932_dp.cpp
#include <iostream> #include <vector> using namespace std; vector<vector<int>> arr; int N, ago; void init() { cin >> N; arr.resize(N); for (int i = 0; i < N; i++) { arr[i].resize(i + 1); for (auto &a : arr[i]) { cin >> a; } } } void solve() { // arr[i-1][j]+=ma...
ALGO
0.999961
4.059559
83de673b-6ebc-4538-a6dc-625062789bb1
Ahmedsabib/Phitron_Problem_Solving_Club
Week - 5/Day - 4/B. Candies Division.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace std; typedef long long ll; typedef long double ld; // pairs typedef pair<int, int> pi; typedef pair<long long, long long> pl; typedef pair<long double, long double> pd; // vectors typedef vecto...
ALGO
0.999515
4.470266
0ba056b7-c500-4f1e-8917-f96d726166ca
Surenderdubeyofficial/Cpp
bubblesort.cpp
#include<iostream> using namespace std; int main() { int arr[1000]; int n; cout << "Enter the size: "; cin >> n; cout << "Enter the elements: "; for(int i = 0; i < n; i++) { cin >> arr[i]; } for(int i=n-2;i>=0;i--){ bool swapped =0; for(int j=0;j<=i;j++){ ...
ALGO
0.999956
4.22296
16539d26-b853-482e-95c1-db7aeba09c3c
fafa1899/BuildCppDependency
Source/boost-1.86.0/libs/yap/example/autodiff_library/UaryOPNode.cpp
/* * UaryOPNode.cpp * * Created on: 6 Nov 2013 * Author: s0965328 */ #include "UaryOPNode.h" #include "BinaryOPNode.h" #include "PNode.h" #include "Stack.h" #include "Tape.h" #include "Edge.h" #include "EdgeSet.h" #include "auto_diff_types.h" #include <list> using namespace std; namespace AutoDiff { Uar...
ALGO
0.947768
4.839767
de609a85-e9af-4035-b6ca-6238ec84d666
devparthgarg/Data-Structures-and-Algorithms
20. Backtracking/01 Print Permutations of Strings with Given Condition/01a Print Permutations of Strings with Given Condition.cpp
#include<bits/stdc++.h> using namespace std; /* print all permutations of strings which do not contain the substring "AB" */ void permutations(string &s,int l,int r) { if(l==r) { if(s.find("AB")==string::npos) { cout<<s<<endl; return ; } } for(int i=l;i<=r;i++) { swap(s[i],s[l]); permutations(s...
ALGO
0.999933
4.564759
c7c9be1a-e88e-4fde-be2f-ef0947aa345b
Mussabat/_CP_
Searching_And_Sorting/CSES_Movie Festival.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin >> n; vector<pair<ll, ll>>v; for(ll i = 0; i < n; i++) { ll x, y; cin >> x >> y; v.push_back({y, x}); } sort(v.begin(), v.end()); ll now = 0; ll ans = 0; for(ll i = 0; i < n; i++) ...
ALGO
0.999964
4.849175
7b6d5c1d-b6b4-4825-a28c-cbe4b3f32fa7
kobe24o/LeetCode
algorithm/LCP06.cpp
class Solution { public: int minCount(vector<int>& coins) { int i, sum = 0; for(i = 0; i < coins.size(); ++i) sum += ceil(coins[i]/2.0); return sum; } };
ALGO
0.999899
5.47467
76ddd169-c700-469f-afba-fb38e88bdc4f
JanP2002/My_projects
Binary_Trees/bst_test.cpp
//Jan Poreba #include<iostream> #include<iomanip> #include<assert.h> #include<bits/stdc++.h> #include<ostream> #include<time.h> #include<sys/time.h> #include<limits.h> #include<stdio.h> #include <stdlib.h> #include<queue> using namespace std; typedef struct node{ struct node *parent; struct node *left; struct n...
ALGO
0.995621
3.629066
29dda434-026e-458b-bae4-c2d5a312b198
FahidShadmanKarim/LeetCode
BinarySearch/BinarySearch.cpp
class Solution { public: int search(vector<int>& nums, int target) { int l = 0 , r = nums.size() - 1; int index = -1; if( nums.size() == 1 ){ if(nums[0] == target) return 0; else return -1; } while( l <= r ){ int mid = l +...
ALGO
0.999932
6.04728
efdb1474-8c2f-439e-9c64-6209c4cabdf3
imsuck/solutions
cses/1700.cpp
#include <bits/stdc++.h> using namespace std; template<class F> struct y_comb_t { F f; template<class T> y_comb_t(T &&_f) : f(forward<T>(_f)) {} template<class... Args> decltype(auto) operator()(Args &&...args) { return f(/* ref */ (*this), forward<Args>(args)...); } }; template<class F> y_comb...
ALGO
0.999861
5.566707
de945fe4-748c-47f3-9693-68f793f74f0f
OvidiuGrec/Darwin-Project
tools/openSMILE/opensmile/src/dspcore/transformFftr.cpp
/* openSMILE component: fast fourier transform using fft4g library output: complex values of fft or real signal values (for iFFT) */ #include <dspcore/transformFftr.hpp> #define MODULE "cTransformFFTr" SMILECOMPONENT_STATICS(cTransformFFTr) SMILECOMPONENT_REGCOMP(cTransformFFTr) { SMILECOMPONENT_REGCOMP_INIT ...
ALGO
0.960503
6.190229
ce04d09d-5c10-476e-a6eb-674e26c4601b
eastgerm/eastgerm-algo
BOJ/Basic/3052. 나머지.cpp
// // Created by kimdong on 2019-05-20. // #include <iostream> #include <vector> using namespace std; vector<bool> mod(42,false); int ans = 0; void input(); void output(); int main() { input(); output(); return 0; } void input() { int n; for(int i=0; i<10; i++) { cin >> n; n %= ...
ALGO
0.99836
3.904489
12544643-aa7b-4fba-8235-abcd5e8a5f0c
calgagi/leetcode
1287/answer.cpp
class Solution { public: int findSpecialInteger(vector<int>& arr) { int goal = (int)arr.size()/4, streak = 0; for (int i = 1; i < (int) arr.size(); i++) { if (arr[i-1] == arr[i]) streak++; else { if (streak >= goal) return a...
ALGO
0.999964
5.654499
3f285ef8-4585-4dcc-a6d3-89958bfc4de4
realthunder/hm_sun7i_android
frameworks/av/media/libstagefright/codecs/amrnb/common/src/q_plsf.cpp
/* ******************************************************************************** * * GSM AMR-NB speech codec R98 Version 7.5.0 March 2, 2001 * R99 Version 3.2.0 * REL-4 Version 4.0.0 * *********************************************************...
ALGO
0.942661
5.540532
cc9fa438-6ac5-4edc-83d6-c786883518dd
ishandutta2007/codeforces
leapfrog/normal/850/A.cpp
//{{{ #include<bits/stdc++.h> using namespace std;typedef long long ll; template<typename T>inline void read(T &x) { x=0;char c=getchar(),f=0; for(;c<48||c>57;c=getchar()) if(!(c^45)) f=1; for(;c>=48&&c<=57;c=getchar()) x=(x<<1)+(x<<3)+(c^48); f?x=-x:x; } template<typename T,typename...L>inline void read(T &x,L&......
ALGO
0.999959
3.337482
32f1aaf9-0c8e-41ac-9d8a-d1bbcb8f1ebf
Tahsin007/Competitive-Programming
Arrays/Left Rotate an Array by One.cpp
#include <bits/stdc++.h> vector<int> rotateArray(vector<int>& arr, int n) { // Write your code here. int tmp = arr[0]; for(int i=1;i<n;i++){ arr[i-1]=arr[i]; } arr[n-1]=tmp; return arr; }
ALGO
0.999887
5.524332
affa8ef7-3f64-47d0-af59-6744cd66743f
rsmnnit/Codes
chefark.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define sf(i) scanf("%lld",&i) #define sfd(a,b) scanf("%lld%lld",&a,&b) #define pf(a) printf("%lld\n",a) #define f(i,a,b) for(i=a;i<b;i++) ll po[100002]; long long degree(long long a, long long k, long long p) { long long res = 1; long long cur = a; wh...
ALGO
0.999947
3.537448
4e4cc33d-5b4f-4b73-8cfc-2eeb4da558cf
Xnuvers007/Kuliah
Algoritma Dan Pemrograman 2/Tugas/pencarian beruntun/PencarianBeruntunFor.cpp
#include <iostream> using namespace std; int main () { int a, b, c, d, z[50]; cout<<"Pencarian Berulang\n"; cout<<"masukan banyak data : "; cin>>d; cout<<"Masukan banyaknya "<<d<<" data : \n\n"; for(a=1; a<=d; a++) { cout<<"Masukan data ke - "<<a<<" = "; cin>>z[a]; } ...
ALGO
0.99805
3.808695
01400ee5-5d37-40e0-a2f5-405b0c0eb7d6
Subrat29/100DaysCodingChallenge
Graph revisit/Shortest Path in Directed Acyclic Graphs/bfs2.cpp
#include <iostream> #include <vector> #include <stack> #include <algorithm> #include <limits.h> using namespace std; vector<int> shortestPathInDAG(int n, int m, vector<vector<int>> &edges) { // create adj list vector<vector<pair<int, int>>> adj(n); for (auto &&edge : edges) { int u = edge[0]; ...
ALGO
0.999885
5.358124
67a21fea-0086-41a6-a86b-c4b5fcb65903
reverg/PS
boj/1431.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int sum(string s) { int n = 0; for (int i = 0; i < s.length(); i++) { if (isdigit(s[i])) { n += s[i] - '0'; } } return n; } bool compare(string a, string b) { if (a.length() != ...
ALGO
0.999849
5.92285
80b0035c-1864-4e3d-85fa-d29d36b6fdde
huangshengh/datastructure
dfsbfs.cpp
#include <iostream> #include <list> using namespace std; class Graph { int V; list<int>* adj;//使用一个list array来实现邻接表 void DFEUtil(int v, bool visited[]); int pathto[]; public: Graph(int V); void addEdge(int V,int w); void DFS(); void BFS(int v); } void Graph::addEdge(int V,int w) { this->adj[V].push_back(w);...
ALGO
0.999941
4.549901
292d44bc-aaaf-4c77-9787-6e68e83a5173
Kristoff-starling/Problem-Solving-Solutions
2020/Problem Solving III - 01/最短路2.cpp
#include <bits/stdc++.h> #define rep(i,a,b) for (int i=a;i<=b;i++) #define LL long long using namespace std; const int MAXN=5000; const LL LINF=2e16; int n,m; int X[MAXN+48],Y[MAXN+48],w[MAXN+48]; LL dist[MAXN+48]; int main () { scanf("%d%d",&n,&m);rep(i,1,m) scanf("%d%d%d",X+i,Y+i,w+i); rep(i,1,n) dist[i]=L...
ALGO
0.999789
3.476553
690e4004-3e4f-4c8d-a0b0-d8a000b7de7c
actium/cses
sorting and searching/1630.cpp
#include <algorithm> #include <iostream> #include <vector> int main() { unsigned n; std::cin >> n; std::vector<std::pair<unsigned, unsigned>> tasks(n); for (unsigned i = 0; i < n; ++i) std::cin >> tasks[i].first >> tasks[i].second; std::sort(tasks.begin(), tasks.end()); long long v =...
ALGO
0.999806
4.314609
1061b021-58a9-4c7a-ab85-850a057222b2
Rajsoni03/CPlusPlus-Training
19_function_templates/I.cpp
#include <iostream> using namespace std; // template <typename T1, typename T2> // decltype(a + b) sum(T1 a, T2 b){ // return a + b; // } // template <typename T1, typename T2> // decltype(T1 + T2) sum(T1 a, T2 b){ // return a + b; // } template <typename T1, typename T2> auto sum(T1 a, T2 b) -> decltype(a + b)...
ALGO
0.92193
3.572861
9e3f353f-fad8-49c9-94b9-d00efd669fdf
Math-O5/competitive-programming
CODEFORCES/920/c.cpp
#include<iostream> #include<vector> #define MAX 200003 using namespace std; int sorted[MAX], n, pai[MAX]; //vector<char> canSwap; char aux; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; for(int i = 1; i <= n; ++i) { cin >> sorted[i]; pai[i]=i; } f...
ALGO
0.999999
3.734558
83067261-7e6b-4e4b-a35f-e109f23b00d9
alifalhasan/CP-code-vault
CodeChef/BRBG2020/THTOG - Game of 3 and 2/40900186.cpp
#include<bits/stdc++.h> using namespace std; const int N=2e5+5; const int mod=1e9+7; int indegree[102]; long long a[102]; vector<int>adj[N]; void DFS(int x,int par) { cout << a[x] << ' '; for(int y : adj[x]) { if(y ^ par)DFS(y,x); } } int main() { ios_base::sync_with_stdio(false); cin.ti...
ALGO
0.999993
3.823597
853783f9-93de-40fa-947c-c0f17d504069
delwar03/CF
C_1_Shohag_Loves_XOR_Easy_Version.cpp
#include <bits/stdc++.h> // #pragma GCC optimize("Ofast") // #pragma GCC optimize ("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using o_set ...
ALGO
0.999895
5.477366
394b8f44-bd61-484a-973b-e38503b32178
nihar021/leetcode
0198-house-robber/0198-house-robber.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int rob(vector<int>& nums) { int n=nums.size(); vector<int> dp(n,0); dp[0] = nums[0]; // Iterate through the elements of the numsay for (int i = 1; i < n; i++) { // Calculate the maximum...
ALGO
0.999751
5.809932
0ccb7825-dc53-4fc0-b940-32c0222bebf9
abbash77/DSA
0912-sort-an-array/0912-sort-an-array.cpp
class Solution { public: void heapify(vector<int> &arr,int i,int n){ int largest=i; int left=2*i+1; int right=2*i+2; if(left<n&&arr[left]>arr[largest]){ largest=left; } if(right<n&&arr[right]>arr[largest]){ largest=right; } if(l...
ALGO
0.999992
5.808461
13509f88-cbf4-425c-9d8f-abd0959471a9
soham6125/CSES-Solutions
Graph Algorithms/Round Trip.cpp
#include<bits/stdc++.h> #define ll long long int #define loop(a,b,i) for(long long int i=a;i<b;i++) #define loopr(a,b,i) for(long long int i=a;i>=b;i--) #define cn continue; #define pb push_back #define db double #define mp make_pair #defin...
ALGO
0.999958
4.279456
1d077986-92cf-4d1e-bb89-944e8151d51c
MarwanElkady/GAMES
Pyramid+Ai/Main.cpp
#include <iostream> #include "BoardGame_Classes.h" #include "MinMaxPyramid.h" #include "PyramidTicTacToe.h" using namespace std; int main() { int choice; Player<char>* players[2]; PyramidBoard<char>* B = new PyramidBoard<char>(); string player1Name, player2Name; cout << "Welcome to Pyramid Tic Ta...
ALGO
0.876895
6.405848
99317df7-1909-4786-8fab-091ced2c2bea
alexandraback/datacollection
solutions_6404600001200128_1/C++/jingling/a.cpp
#include <algorithm> #include <numeric> #include <functional> #include <iostream> #include <iomanip> #include <sstream> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <stack> #include <unordered_set> #include <unordered_map> #include <cstdio> #include <cstdlib> #include <...
ALGO
0.999609
3.471061
4b6e2782-c0b9-415d-938c-806605b487f7
as6325400/ITSA_OOP
m6.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); double num; while(cin >> num){ cout << fixed << setprecision(1) << num * 1.6 << '\n'; } }
ALGO
0.981642
3.363599
54ad6945-33e0-4501-899b-01cc139cb286
Ved-Bhonsle/Cpp_Codes
21mar_1_template_func_overloading.cpp
#include <iostream> using namespace std; template <typename T1> void sum(T1 a, T1 b, T1 c) { cout << "Sum: " << a+b+c << endl; } template <typename T1, typename T2> void sum(T1 a, T2 b, T1 c) { cout << "Sum: " << a+b+c << endl; } void sum(int a, int b) { cout << "Sum: " << a+b << endl; } int main() {...
ALGO
0.877983
4.576041
39d11f5d-c64f-46ca-8787-76d5d34761f8
qhadron/contest-solutions
mccc15s3.cpp
#include <iostream> #include <set> #include <algorithm> #include <utility> #include <vector> #include <cstring> using namespace std; #ifdef _DEBUG #define dvar(x) cout << (#x) << ":" << (x) << endl #define dprintf(...) printf(__VA_ARGS__) #define dprintfn(...) printf(__VA_ARGS__),putchar('\n') #else #define dvar(...) #...
ALGO
0.999756
4.103889
05ad68df-5393-4aa2-993d-44dc1843422f
Akshat-Ajmera/LeetCode_Solutions
78-subsets/subsets.cpp
class Solution { private: void adder(vector<int> &v, vector<int> &u, int i, vector<vector<int>> &ans) { if(i>=v.size()) { ans.push_back(u); return; } u.push_back(v[i]); adder(v,u,i+1,ans); u.pop_back(); adder(v,u,i+1,ans); } public: vec...
ALGO
0.999966
6.153468
e74dfad4-029b-44e7-b354-bebd49d04110
msameerfarooq/Hacktoberfest2022
06. Searching/InterpolationSearch.cpp
#include <bits/stdc++.h> using namespace std; int InterpolationSearch(int arr[], int lo, int hi, int x) { int pos; if (lo <= hi && x >= arr[lo] && x <= arr[hi]) { pos = lo + (((double)(hi - lo) / (arr[hi] - arr[lo])) * (x - arr[lo])); if (arr[pos] == x) return pos; if (arr[pos] < x) return Int...
ALGO
0.999775
6.174828
19aa8688-598e-4e2f-93b7-f3b098c558bb
steward-fu/sdl2
swiftshader/third_party/llvm-7.0/llvm/lib/CodeGen/StackColoring.cpp
#include "llvm/ADT/BitVector.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/CodeGen/LiveInterval.h" #include "llvm/CodeGen/MachineBasicB...
TOOL
0.906022
7.717555
78d6cb71-94af-45c2-adaa-3b8db15f58a8
Anuja9699/cpp_code
decimal_to_binary.cpp
#include<iostream> using namespace std; int dectobin(int n) { int pow=1; int binary=0; while(n>0) { int rem=n%2; binary+=rem*pow; pow*=10; n=n/2; } return binary; } int main() { int n=15; cout<<dectobin(n); }
ALGO
0.999803
5.405522
14998e95-8105-42fb-9f08-b4d46da338f7
bmh7190/codetree
250803/treemap 기본/treemap-basic.cpp
#include<iostream> #include<map> using namespace std; int main() { int n; map<int, int> m; cin >> n; for (int i = 0; i < n; i++) { string command; cin >> command; if (command == "add") { int num1, num2; cin >> num1 >> num2; m[num1] = num2; } else if (command == "find") { int num; ...
ALGO
0.999277
5.283605
afee31e1-cebf-439c-a8d1-3ce5b83d060b
about-anuj/Leetcode-Solutions
2186-minimum-number-of-steps-to-make-two-strings-anagram-ii/2186-minimum-number-of-steps-to-make-two-strings-anagram-ii.cpp
class Solution { public: int minSteps(string s, string t) { int a[26]={0},b[26]={0}; int ans=0; for(auto i:s) a[i-'a']++; for(auto i:t) b[i-'a']++; for(int i=0;i<26;i++) ans+=abs(a[i]-b[i]); return ans; } };
ALGO
0.999997
5.72884
b66033fa-5101-4a9c-a528-de977e8cd436
tonymontaro/leetcode-submissions
01-July-2021/find-all-the-lonely-nodes/Accepted/5-30-2021, 6:20:18 AM/Solution.cpp
// https://leetcode.com/problems/find-all-the-lonely-nodes class Solution { public: vector<int> ans; vector<int> getLonelyNodes(TreeNode* root) { if (!root || !root->left && !root->right) return ans; if (root->left) { if (!root->right) ans.push_back(root->left->val); get...
ALGO
0.999975
6.142804
dd55030c-4cc4-4bb0-872d-526dadace54f
ishandutta2007/codeforces
rniya/normal/1437/D.cpp
#include <bits/stdc++.h> using namespace std; #define LOCAL #pragma region Macros typedef long long ll; #define ALL(x) (x).begin(),(x).end() const long long MOD=1000000007; // const long long MOD=998244353; const int INF=1e9; const long long IINF=1e18; const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1}; const char dir[4]={'D'...
ALGO
0.999906
4.785913
2ab0d888-94a0-4e99-9ab3-c6cd2df5f167
AbdullahRFA/Algorithm-1
SCC.cpp
//#include<bits/stdc++.h> //using namespace std; //vector<int> adj[100]; //vector<int> rev_adj[100]; //bool visited[100]; //stack<int> order; // //void dfs1(int node) { // visited[node] = true; // for (int neighbor : adj[node]) { // if (!visited[neighbor]) { // dfs1(neighbor); // } // ...
ALGO
0.999981
5.077363
f1cdb86b-3711-43f4-be83-e56a0a46c1ff
me-ars/notes
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
04772e78-20e2-4ccd-a024-0136e0d27138
tienanhnguyen191999/FinalContest_CTDL_GT
35/main.cpp
#include <iostream> using namespace std; int gt(int n){ int s = 1; for (int i = 2; i <= n ; i++) s*=i; return s; } int tohop(int n,int k){ return gt(n) / (gt(k) * gt(n-k)); } int main(){ int turn, n , k; cin >> turn; while (turn--){ cin >> n >> k; cout << tohop(n,k) << end...
ALGO
0.999842
4.718472