uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
8ea42f6f-24e1-41d2-8fd2-94d9889a830d
folgerwang/UnrealEngine
Engine/Source/ThirdParty/hlslcc/hlslcc/src/hlslcc_lib/opt_dead_code.cpp
/** * \file opt_dead_code.cpp * * Eliminates dead assignments and variable declarations from the code. */ #include "ShaderCompilerCommon.h" #include "ir.h" #include "ir_visitor.h" #include "ir_variable_refcount.h" #include "glsl_types.h" static bool debug = false; /** * Do a dead code pass over instructions and ever...
ALGO
0.874926
7.895238
983714e0-b584-4c05-b045-6f0f1f3ca806
ishandutta2007/codeforces
maksim1744/normal/1265/B.cpp
/* author: Maksim1744 created: 05.12.2019 21:09:46 */ #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define mp make_pair #define pb push_back #define eb emplace_back #define sum(a) ( accumulate ((a).begin(), (a).end(), 0ll)) #define mine(a) (*mi...
ALGO
0.999935
4.379521
40d5d1d6-a64f-4e5c-a8ef-47922a957022
newenclave/teranyina
agent/subsystems/subsys-listeners.cpp
#include <iostream> #include <list> #include <memory> #include "subsys-listeners.h" #include "../application.h" #include "vtrc-server/vtrc-listener.h" #include "vtrc-server/vtrc-listener-tcp.h" #include "vtrc-server/vtrc-listener-ssl.h" #include "vtrc-server/vtrc-listener-local.h" #include "vtrc-common/vtrc-mutex-ty...
WEB
0.880795
6.097128
b812b7a7-4029-409c-bc27-c1026b905cfb
NLGRF/Advance-Compro
mid term/week 4.1/ex2.cpp
#include<stdio.h> int toBinary(int); int main(){ int binary=0,decimal; printf("Enter a decimal(0-255) : "); scanf("%d",&decimal); binary = toBinary(decimal); printf("Binary = %d",binary); return 0; } int toBinary(int n){ int bin = 0,base = 1; while(n > 0){ bin = bin +(n % 2)*base; base*=10; n/=2; } ...
ALGO
0.983873
5.076382
3c5d7217-8266-4742-aeed-a7946236ad43
garvmalik11/cppCodes
3. FUNCTIONS/FactorialNum.cpp
#include<iostream> using namespace std; void fact(int num){ int factorial=1; for(int i=1;i<=num;i++){ factorial=factorial*i; } cout<<factorial<<endl; } int main(){ int n; cin>>n; fact(n); return 0; }
ALGO
0.999926
5.010184
9352d743-c680-4964-839a-1d2a439301b9
jonatas57/maratona
uva/00414-MachinedSurfaces.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<bool> vb; typedef map<int, int> mii; typedef pair<int, int> ii; #define INF 0x3f3f3f3f #define INFLL 0x3f3f3f3f3f3f3f3f...
ALGO
0.998547
3.806309
0d003e80-5014-4d7b-b644-594863270e90
dgudim/qt_disk-deduper
src/utils/gutils.cpp
#include "gutils.h" #include "phash.h" #include <QFileDialog> #include <QIcon> #include <QProcess> #pragma region File utils { const QMap<QString, quint64> size_multipliers = {{"b", 1}, {"Kb", 1024}, {"Mb", 1048576}, {"Gb", 1073741824}}; void FileUtils::walkDir(const QString& dir, const QStringList& blacklisted_dir...
TOOL
0.871451
6.028463
ead14175-3084-49b6-b216-a22f2c9c2f5b
shubhansu-kr/DailyChallenge-April2022-Leetcode
03_SwappingNodes.cpp
// https://leetcode.com/problems/swapping-nodes-in-a-linked-list/ // You are given the head of a linked list, and an integer k. // Return the head of the linked list after swapping the values // of the kth node from the beginning and the kth node from the // end (the list is 1-indexed). #include <bits/stdc++.h> usin...
ALGO
0.999975
6.083358
baf638dd-a148-4f1e-b069-61d717d74409
ishandutta2007/codeforces
laycurse/normal/913/A.cpp
#include<bits/stdc++.h> using namespace std; void rd(int &x){ int k, m=0; x=0; for(;;){ k = getchar(); if(k=='-'){ m=1; break; } if('0'<=k&&k<='9'){ x=k-'0'; break; } } for(;;){ k = getchar(); if(k<'0'||k>'9'){ break; } x=x*10+k-'0'; } if(m...
ALGO
0.999902
4.081711
ddc8dfd0-169b-40fd-9463-35c6335fb523
NUC-NCE/algorithm-codes
codes - ac/CodeForces/920A/14838998_AC_15ms_8kB.cpp
#include<bits/stdc++.h> using namespace std; int a[320]; bool vis[320]; int main() { int t; cin>>t; while(t--) { int n,k; cin>>n>>k; for(int i=0;i<=300;i++) vis[i]=false; for(int i=0;i<k;i++) { cin>>a[i]; vis[a[i]]=true; ...
ALGO
0.999862
3.432674
84473946-4321-4647-b553-9641e1e3b21b
rhiturajdesai/LP3Gun
tan/lp3a1.cpp
#include <iostream> using namespace std; void fibonacciNonrecursiveSeries(int n) { if (n >= 1) cout << 0; if (n >= 2) cout << " " << 1; int p1 = 0, p2 = 1, c; for (int i = 2; i < n; ++i) { c = p1 + p2; cout << " " << c; p1 = p2; p2 = c; } cout << endl; } int fi...
ALGO
0.999759
5.260026
94d403a8-d8de-423c-93a0-1247a2f7af68
pjump3226/programmers
깊이,너비 우선 탐색(DFS,BFS)_타겟 넘버.cpp
#include <string> #include <vector> using namespace std; int count = 0; void dfs(vector<int> numbers, int target, int n, int sum) { if (n == numbers.size()) { if (sum == target) count++; return; } dfs(numbers, target, n + 1, sum + numbers[n]); dfs(numbers, target, n + 1, sum - numbers[n]); } int solution(vec...
ALGO
0.999925
5.558688
52f96214-df40-443c-83bc-6381d2567dcd
rapidlua/barebone-c
llvmorg/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/prev_permutation.pass.cpp
// <algorithm> // template<BidirectionalIterator Iter> // requires ShuffleIterator<Iter> // && LessThanComparable<Iter::value_type> // bool // prev_permutation(Iter first, Iter last); #include <algorithm> #include <cassert> #include "test_macros.h" #include "test_iterators.h" #include <cstdio> int fa...
TEST
0.87076
7.103584
e97cd078-3d82-4a9b-83f0-3cc1865acc59
Masked-coder11/gfg-POTD
13.01.2025.cpp
class Solution { public: int maxWater(vector<int> &arr) { // code here int ans=0, l=0, r=arr.size()-1; while(l<r){ ans=max(ans, min(arr[l],arr[r])*(r-l)); if(arr[l]<arr[r]) l++; else r--; } return ans; } };
ALGO
0.9999
6.267761
489cc876-d8aa-4adb-8e14-4d5630dd6ce5
hemantgangolia/leetcode
remove_nth_node.cpp
/* https://oj.leetcode.com/problems/remove-nth-node-from-end-of-list/ Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list becomes 1->2->3->5. Note: Given n will...
ALGO
0.999913
6.30801
cde0608f-ad40-451b-b65b-73f0d3fd009c
ishandutta2007/codeforces
juve45/normal/461/A.cpp
#include <iostream> #include <algorithm> #define DMAX 300005 using namespace std; int n, a[DMAX]; long long sum; int main() { cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; } sort(a+1, a+n+1); for(int i=1;i<=n-1;i++) sum+=1LL*a[i]*(1+i); sum+=1LL*a[n]*n; cout<<sum; return 0; }
ALGO
0.999886
3.609735
12a4b5e5-1de6-4c7b-b794-8d67ed45fb6c
mohitmallick17/LeetCodeSolutions
2192-all-ancestors-of-a-node-in-a-directed-acyclic-graph/2192-all-ancestors-of-a-node-in-a-directed-acyclic-graph.cpp
class Solution { public: vector<vector<int>> getAncestors(int n, vector<vector<int>>& edges) { vector<int> degree(n, 0); vector<int> adj[n]; for(auto &x:edges){ degree[x[1]]++; adj[x[0]].push_back(x[1]); } queue<int> q; vector<bool> visited(n, ...
ALGO
0.999983
6.181696
8e22cea4-c68d-4d53-9b60-86633d176b4f
tongbs/CPE
Funny Encryption Method.cpp
#include <iostream> #include <string> #include <stdio.h> using namespace std; int main(){ int n; cin>>n; char s[100]; while(n--){ cin>>s; int X1,X2,b1=0,b2=0; sscanf(s,"%d",&X1);//decimal sscanf(s,"%x",&X2);//heximal while(X1){ b1+=X1&1; X1/=2; } while(X2){ b2+=X2&1; X2/=2; } cout<<b1...
ALGO
0.9928
3.742943
900a1904-835f-4b29-af72-155afd21d708
tempure/algorithm-advance
OJ/acwing/第1场周赛/a.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define all(x) (x).begin(), (x).end() #define sz(x) ((int)(x).size()) typedef vector<int> vi; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; mt19937 mrand(random_device{}()); const ll mod = 1000000007; int rnd(int x) {...
ALGO
0.999928
5.04455
12bc3e98-54c2-4877-a2e5-04c9ecd5e07d
QuaziSamiha/C-and-CPP
OOP and Basic/C Parts/8. String/string_12.cpp
// reverse of string without using strrev() function #include<stdio.h> int main() { char string_1[30] = "C Programming"; char string_2[30]; int i, length = 0, j; i = 0; while(string_1[i] != '\0') { i++; length++; } for(j = 0,i = length-1; i >= 0; i--,j++) { ...
ALGO
0.999874
3.327385
019c4bcb-f251-4ae6-8dd6-132e2dd0db35
open-vela/nuttx_libs_libxx_libcxx
test/std/algorithms/alg.sorting/alg.merge/ranges_inplace_merge.pass.cpp
// UNSUPPORTED: c++03, c++11, c++14, c++17 // <algorithm> // template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less, // class Proj = identity> // requires sortable<I, Comp, Proj> // I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // ...
TEST
0.998304
7.78
d8651a49-3abe-4581-90f3-c04732f3f5f5
jaibairagi01/Tree
binaryTree.cpp
#include<iostream> #include<queue> using namespace std; class node { public: int data; node* left; node* right; node(int d) { this -> data = d; this -> left = NULL; this -> right = NULL; } }; node* buildTree(node* root) { cout << "Enter the data: " << ...
ALGO
0.999411
4.135942
f2eb1643-888c-4579-9da6-a37a0bb58ea1
jingtao8a/cmu15445-project
src/storage/index/b_plus_tree.cpp
#include <cstddef> #include <optional> #include <sstream> #include <string> #include "common/config.h" #include "common/exception.h" #include "common/logger.h" #include "common/macros.h" #include "common/rid.h" #include "execution/expressions/comparison_expression.h" #include "storage/index/b_plus_tree.h" #include "st...
ALGO
0.997013
7.084731
da5e9118-adb3-426d-8dfc-31c57be18493
luobuyu/Code-test-daily
luogu/线段树2.cpp
#include <bits/stdc++.h> #define ll long long namespace FAST_IO { template <class T> inline void read(T &x) { T flag = 1; x = 0; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') flag = -1; ch = getchar(); ...
ALGO
0.999941
4.438791
663afcd3-c40c-4c80-8058-52dcd1b51065
LikeScience/Code
CompetitiveProgramming/Codeforces/CoFoR925B.cpp
#include <bits/stdc++.h> #define F(i,s,e) for (ll i = s; i<e; i++) #define ll long long #define fi first #define se second using namespace std; int main() { ll t, n; cin >> t; F(z,0,t) { cin >> n; vector<ll> a(n); ll s=0; F(i,0,n) { cin >> a[i]; s+= a[i]; } s/= n; ...
ALGO
0.999839
4.08833
bb798ef4-e996-4f8e-8b45-3b938f6c7921
ishandutta2007/codeforces
hyperhyperhypercubelover/normal/110/A.cpp
#include<cstdio> int chk(long long x) { int t=0; while(x) { if(x%10==4||x%10==7)t++; x/=10; } return t==4||t==7; } int main() { long long a; scanf("%I64d",&a); printf(chk(a)?"YES":"NO"); }
ALGO
0.999484
3.729861
2b7538bf-5ce1-4a11-a241-250613d22a49
kumarshivam03/Cpp-Pr
Leetcode+CodNin/CodNinja/modularExponentiation.cpp
#include <bits/stdc++.h> int modularExponentiation(int x, int n, int m) { int res = 1; x %= m; // Ensure x is within the range of m while (n > 0) { if (n & 1) { res = (1LL * res * x) % m; // Perform modulus operation after each multiplication } x = (1LL * x *...
ALGO
0.999959
5.767778
cbee3d26-6cdd-41c8-9efa-e31c34e56491
nachiketkanore/Advent-of-Code-2023
day-09/sol-part-1.cpp
/** * Author: Nachiket Kanore * Created: Saturday 09 December 2023 12:13:46 PM IST **/ #include "bits/stdc++.h" using namespace std; #ifdef DEBUG #include "debug.h" #else #define see(...) ; #endif #define int int64_t #define sz(x) (int)(x.size()) #define ALL(x) (x).begin(), (x).end() #define F0R(i, R) for (i...
ALGO
0.999937
4.301985
9378939a-276a-4222-b235-9ae3be1c7ceb
NguyenNhatKhai/CO4041_CPP_RS_v6
FFA/binary.cpp
//////////////////////////////////////////////////////////////////////////////////////////////////// // // File: binary.cpp // Author: Nhat Khai Nguyen // //////////////////////////////////////////////////////////////////////////////////////////////////// #include "ffa.h" inline bool Binary::operator==(const Binary& ...
TOOL
0.902689
5.778557
8b30e7e5-7818-4c39-ae2d-e2fdfbec7d6a
camilamenjivar/actividades-clase
Bucle for/Ejercicio19.cpp
//Triángulo de Asteriscos //Imprime un triángulo de altura N usando * #include <iostream> using namespace std; int main() { int N; // Pedimos la altura del triángulo cout << "Ingresa la altura del triángulo: "; cin >> N; for (int i = 1; i <= N; i++) { // Imprimimos i asteriscos en la fila...
ALGO
0.994212
5.217187
e8d753e4-50ae-4379-9198-024a66327d4e
guptavarun619/Data-Structure
Array/maxsum_subarray.cpp
#include<iostream> using namespace std; int main() { int n; cin >> n; int a[100]; int maxSum = 0; int tempSum = 0; int left_pos = -1, right_pos = -1; for (int i = 0; i < n; i++) { cin >> a[i]; } // Generate All sub-array // Simple bruteforce method to check sum for ...
ALGO
0.999936
4.431985
f40da0ce-b5df-498b-9c80-5e4fa94ee246
pihu26112005/Cpp
DSA(love babbar)/problems/LECTURE WISE/L-49(LL)/4-merge_2_sorted_LL-2nd_approach.cpp
#include<iostream> #include<map> using namespace std ; class Node { public: int data ; Node* next_pointing_pointer ; // kyokii ye Node type ki value ko point krega na Node(int x) // constructor { this->data = x; this->next_pointing_pointer = nullptr ; } // Node(int x...
ALGO
0.999955
4.917729
4f9722bb-d5b8-47ad-a0a2-3b5ef601e8ff
tmwilliamlin168/CompetitiveProgramming
COCI/18-Deda.cpp
/* - Create a segment tree with the indicies as the numbers of the children - Maintain minimum stops rode for each segment - Kind of like doing a binary search on a segment tree to find the minimum r with smaller than y number of stops */ #include <bits/stdc++.h> using namespace std; const int mxN=2e5; int n, q, a...
ALGO
0.999966
4.752306
e6e044dd-cb97-429e-810e-6fd6b5cc148d
ducciopiovani/Data-on-Teresina-
codes/test_gravity_functions.cpp
#include <iostream> #include <string> #include <fstream> #include <sstream> #include <math.h> #include <vector> #include <list> #include <stdio.h> #include <stdlib.h> #include <map> #include <algorithm> #include "functions_headers_class_defintion.h" using namespace :: std ; int main(int argc, char* argv[]) { ...
ALGO
0.991505
4.191228
33c27f91-d196-43ac-95d4-1bd47fe166a5
harivishvanath7/DSA
BASICS/SIMPLE PROBLEMS/FibonacciSeries.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n, arr[50]; cout << "Enter the Number of terms : "; cin >> n; // for 0 and 1 arr[0] = 0, arr[1] = 1; for (int i = 2; i <= n; i++) { arr[i] = arr[i-1] + arr[i-2]; } // printing the series for (int i = 0; i...
ALGO
0.999967
4.466137
548453c5-56f8-444f-9b9e-9de587f18c90
waqarasghar-007/Introsuction-to-computing-in-C-
11.OddNumber.cpp
#include <iostream> using namespace std; int main() { bool even = false; int num; cout << "Enter any number : \n"; cin >> num; if (num % 2 == 0) even = true; else even = false; if (even) cout << num << " is " << "even" << endl; else cout << num << " is " << " odd " << endl; system("pause"); return 0; ...
ALGO
0.978736
3.451874
6a71c5f6-670c-4d04-a807-5fb896a027d0
adityanjr/code-DS-ALGO
Olympiad Solutions/URI/1004.cpp
// Ivan Carvalho // Solution to https://www.urionlinejudge.com.br/judge/problems/view/1004 #include <cstdio> int main(){ int a,b; scanf("%d",&a); scanf("%d",&b); printf("PROD = %d\n",a*b); return 0; }
ALGO
0.997642
3.625568
67e3d440-a2b3-42e6-95c7-4b33c622b3a5
ishandutta2007/codeforces
fsouza/normal/436/A.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <numeric> #include <climits> #include <sstream> #include <utility> #include <cstring> #include <cassert> #include <vector> #include <stack> #include <queue> #include <cmath> #include <map> #include <set> #define INF (INT_MAX/2) typedef long long lint...
ALGO
0.999839
4.3184
f6335200-a59d-4abb-8715-3df50a61ee45
Shreyanshupare/AlgorithmExample
Data_structure/ConsoleApplication1/ConsoleApplication5/ConsoleApplication5.cpp
#include <stdio.h> #include <stdlib.h> struct node { struct node *prev; int n; struct node *next; }*h,*temp,*temp1,*temp2,*temp4; void insert1(); void insert2(); void insert3(); void traversebeg(); void traverseend(); void sort(); void search(); void update(); void delete1(); int count = 0; void main() { } voi...
ALGO
0.999904
3.167374
8b49db68-3170-443a-b91c-febbb7426ad1
AdarshMuet/Dev-Connect-Hub
magic_index.cpp
#include <iostream> #include <optional> #include <span> #include <initializer_list> #include <concepts> #include <chrono> template<std::integral T> static std::optional<std::size_t> findMagicIndex1(const std::span<T> array) { for(std::size_t i = 0; i < array.size(); ++i) if(static_cast<T>(i) == array[i]) return ...
ALGO
0.997795
6.470979
4d078e3d-0590-4a13-8d5b-0f8970968fa9
Altu-Bitu-2/Altu_Bitu
stackqueuedequeue/ab24.cpp
#include <iostream> //입출력 사용 #include <stack> //stack 사용 #include <vector>//vector 사용 //문제 2841 using namespace std; //std namespace 사용중 /** * 각 줄마다 외계인이 누르고 있는 프렛을 스택에 저장하기 * 매 입력에 대해 이번에 누를 프렛이 해당 줄에서 가장 높은 프렛이어야 함 * * 1. 이번에 눌러야 할 프렛보다 높은 프렛에서 손가락을 전부 떼기 * 2. 만약 이번에 눌러야 할 프렛을 누르고 있지 않다면 누르기 * * 존재하지 않는 0...
ALGO
0.999178
4.276325
dd694968-8199-4602-900d-40c4e9ff70ac
tangziyi001/competitive-programming
STL/(U) LargestRectangleInAHistogram.cpp
/* * POJ 2559 * Created by Ziyi Tang * 单调栈 */ //#include <bits/stdc++.h> #include <iostream> #include <cstdio> #include <string> #include <cstring> #include <cstdlib> #include <sstream> #include <cmath> #include <algorithm> #include <list> #include <vector> #include <set> #include <map> #include <stack> #include <...
ALGO
0.99978
3.44808
7c210657-c574-4d02-a568-e548cd483f5a
takaakiaoki/my-lammps
src/pair_coul_cut.cpp
#include "math.h" #include "stdio.h" #include "stdlib.h" #include "string.h" #include "pair_coul_cut.h" #include "atom.h" #include "comm.h" #include "force.h" #include "neighbor.h" #include "neigh_list.h" #include "memory.h" #include "error.h" using namespace LAMMPS_NS; /* --------------------------------------------...
ALGO
0.987393
5.813579
ecffc55a-08c3-4ff1-bc6c-6680a5e23b70
tecshogo/contest
ABC/140/B/answer.cpp
#define rep(i, n) for (int i = 0; i < (n); i++) #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const int MOD = 1000000007; // MAX int 2,147,483,647 // MAX O(n) 10^18 int main() { int N; cin >> N; vector<int> A(N), B(N); vector<int> C(N - 1); rep(i, N) ...
ALGO
0.999952
3.847132
18f06b71-7db3-4ba2-bea5-a9d49f9bb37a
adarshmishra1310/Coding
C++_Programming/Codeforces Questions/C_Update_Queries.cpp
#include <bits/stdc++.h> using namespace std; #define int long long //const int inf = (int)1e18; //const int mod = 1e9 + 7; void runCase() { int n,m; cin>>n>>m; string s; cin>>s; vector<int> ind(m); for(int i=0;i<m;i++) cin>>ind[i]; string c; cin>>c; sort(ind.begin(),ind.end()); ...
ALGO
0.99998
4.823712
7b30bcc0-0ef4-4a38-8343-fc02d904b042
3dfernando/CFD_Immersed_Boundary
ConsoleApplication1/Body.cpp
#include "stdafx.h" #include "Body.h" Body::Body(double* xPos, double* yPos, double* xVel, double* yVel, double* xForce, double* yForce, double delta_s, double n_s, double* Tx, double* Ty, double xC, double yC) { x = xPos; y = yPos; vel_x = xVel; vel_y = yVel; Fx = xForce; Fy = yForce; ds = delta_s; ns = n_s; ...
ALGO
0.979933
4.844207
ca52a500-ce61-4fba-b81f-f70e60eb5bd0
wenjiesun1024/Leetcode
Cpp/Week-Contest-Problems/1871. Jump Game VII.cpp
class Solution { public: bool canReach(string s, int minJump, int maxJump) { if (s.back() != '0') return false; vector<int> zero; for (int i = 0; i < s.size(); ++i) { if (s[i] == '0') zero.push_back(i); } vector<bool> can(zero.size(), fal...
ALGO
0.999322
5.904177
78998ba9-87e8-476d-972c-5bdd3a5c0d44
thienphuoc/axmolcreator-cocos2dxcreator
thirdparty/openal/router/router.cpp
#include "config.h" #include "router.h" #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include "AL/alc.h" #include "AL/al.h" #include "almalloc.h" #include "strutils.h" #include "version.h" std::vector<DriverIfacePtr> DriverList; thread_local DriverIface *ThreadCtxDriver; enum Lo...
TOOL
0.859799
6.54912
f1d6b8bb-297a-4792-a5e2-acb995706900
Pandey-SaurabhP/CP
Codeforces/1890/a.cpp
#include <bits/stdc++.h> using namespace std; #define read(a, n) for(int i = 0; i < n; ++i) cin >> a[i]; #define print(a, n) for(int i = 0; i < n; ++i) if(i == n - 1){ cout << a[i] << " "; } else { cout << a[i] << ' '; } typedef long long int ll; typedef long double ld; const int mod = 1e9 + 7; const int mxn = 1e6 ...
ALGO
0.999906
4.507375
058d96a2-ed31-4bc7-85b9-3cfc3cecea7e
ishandutta2007/codeforces
liouzhou_101/normal/1695/B.cpp
#ifndef IO_H_ #define IO_H_ #include <cctype> #include <cmath> #include <cstdint> #include <cstdio> #include <string> #include <algorithm> #include <type_traits> #include <utility> namespace io { namespace internal { //#ifndef ONLINE_JUDGE #define FWRITE //#endif #ifdef FWRITE #include <cstdio> #else #include <un...
ALGO
0.999876
4.422318
776379d2-fe63-4ca9-a051-5fd47f6b43d7
WILDCHAP/PAT-B
1054 求平均值.cpp
/*ºsscanf; sprintf*/ /* ȫͨ */ #include<iostream> #include<cstdio> #include<cstring> using namespace std; int main(){ int n;cin>>n; double sum=0,temp; int num=0; char a[50],b[50]; for(int i=0;i<n;i++){ scanf("%s",a); sscanf(a,"%lf",&temp);//aַתΪʽlf浽temp sprintf(b,"%.2lf",temp);//ʽtempдַb bool flag=0; ...
ALGO
0.975017
3.577144
e782a7f8-5fef-4011-b4f2-62f94e828370
rlaisqls/codeforces
Codeforces Round #781 (Div. 2)/B - Array Cloning Technique.cpp
#include<iostream> #include<algorithm> #include<cmath> using namespace std; int arr[100001]; void solve(){ //25min int i,n,mcnt=1,cnt=1,res=0; cin>>n; for(i=0;i<n;i++)cin>>arr[i]; sort(arr,arr+n); for(i=1;i<n;i++){ if(arr[i]==arr[i-1])cnt++; else cnt=1; mcnt=max(mcnt,cnt); } while(mcnt<n){ res+=1+min(n-...
ALGO
0.999874
4.349576
ea8d053d-c1dc-4a1d-94ea-0a3895de9423
shashankdvn/Data-Structures
Trees/del_node_bt.cpp
#include <iostream> using namespace std; #include <queue> struct Node{ int key; Node * left; Node * right; }; Node* newNode(int key){ struct Node* temp = new Node; temp->key = key; temp->left = NULL; temp->right = NULL; return temp; }; /*Function to delete the deepest node in a give...
ALGO
0.999976
5.483928
ee54be55-b426-46b2-808a-08274ee456f0
StefanGC1/PeerBridge
networking/src/P2PSystem.cpp
#include "Utils.hpp" #include "P2PSystem.hpp" #include "Logger.hpp" #include <iostream> #include <vector> #include <sstream> namespace { // REMOVE LATER inline void dumpMulticastPacket(const std::vector<uint8_t>& buf, const std::string& textPrefix) { if (buf.size() < 34) return; ...
TOOL
0.932822
6.778979
e4114f28-38eb-4e70-ab51-2eeb6ca986bc
Dartpixel/Competitive-Coding
LEETCODE/maximum_product_difference_between_two_pairs.cpp
class Solution { public: int maxProductDifference(vector<int> &nums) { int temp = 0; sort(nums.begin(), nums.end()); int n = nums.size(); return ((nums[n - 2] * nums[n - 1]) - (nums[0] * nums[1])); } };
ALGO
0.999952
5.333278
6f41e485-dad3-4c33-876e-52cd9b4260a6
alexandraback/datacollection
solutions_1673486_0/C++/hhhuang/solution.cpp
#include <stdio.h> #include <string.h> char map[26]; char s1[200] = "ejp mysljylc kd kxveddknmc re jsicpdrysi rbcpc ypc rtcsra dkh wyfrepkym veddknkmkrkcd de kr kd eoya kw aej tysr re ujdr lkgc jv"; char s2[200] = "our language is impossible to understand there are twenty six factorial possibilities so it is okay if ...
ALGO
0.999935
3.211766
73adfa46-9e24-4126-b9b1-435bec5a5dc4
fengbunny/leetcode_c
88.cpp
class Solution { public: void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) { nums1.erase(nums1.begin() + m + n, nums1.end()); for(int i = m - 1, j = n - 1, cnt = m + n - 1; cnt >= 0; cnt--) { if(i < 0) nums1[cnt] = nums2[j--]; else if(j < 0) nums1[cnt] ...
ALGO
0.999958
5.274632
8c98e273-0905-43ec-a819-09e30e98f731
IainWinter/IwEngineOld
IwPhysics/src/Collision/GJK.cpp
#include "GJK.h" #include <vector> #include "IwMath\vector3.h" iwphysics::collision_data* iwphysics::GJK( const collider* collider1, const collider* collider2, const collision_transformation& collisionTrans) { iwmath::vector3* points = new iwmath::vector3[4]; iwmath::vector3 direction = iwmath::vector3::unitX; ...
ALGO
0.998714
5.64957
323179df-7142-40d0-95af-d882d9997169
phUR99/ps
leetcode/2859.sum-of-values-at-indices-with-k-set-bits.cpp
/* * @lc app=leetcode id=2859 lang=cpp * * [2859] Sum of Values at Indices With K Set Bits */ // @lc code=start class Solution { public: int sumIndicesWithKSetBits(vector<int> &nums, int k) { int ret = 0; for (int idx = 0; idx < nums.size(); idx++) { int cnt = 0; ...
ALGO
0.999726
6.538585
e6dd5d9f-518e-4dc6-a974-816fba0849a7
gavinband/bingwa
3rd_party/boost_1_55_0/libs/graph/example/stoer_wagner.cpp
#include <cassert> #include <cstddef> #include <cstdlib> #include <iostream> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/graph_traits.hpp> #include <boost/graph/one_bit_color_map.hpp> #include <boost/graph/stoer_wagner_min_cut.hpp> #include <boost/property_map/property_map.hpp> #include <boost/typeo...
ALGO
0.999961
6.468927
3bdb3938-82c3-4d7b-a71a-926e496d3450
Bossppp/Comprog
mockFinal67/hhk.cpp
#include <iostream> using namespace std; int phi(int n, int p = 2) { if (n == 1) { return 1; } // หา p ที่เป็นตัวประกอบเฉพาะของ n while (n % p != 0) { p++; } // ถ้า p เป็นตัวประกอบเฉพาะของ n ให้ทำการลดขนาด n int reduced_n = n; while (reduced_n % p == 0) { reduced...
ALGO
0.999957
5.001863
667293f7-a4da-4dcf-8328-2fb468712381
gadhiyakeval163/fltr_assesments
Flutter - Deployment/mywhatsapp/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.998345
6.76073
6f7bc009-8816-4c28-9462-83ff21fa6f31
SakshamSahgal/Competitive-Programming
College_Problems/Mergesort.cpp
#include<iostream> using namespace std; void merge_it(int a[],int l,int m,int r) { //l , m //m+1 r int i=l; int j=m+1; int cur = 0; int *temp = new int[r-l+1]; while(i <= m && j <= r) { if(a[i] < a[j]) temp[cur++] = a[i++]; else temp[cur++] = a[j...
ALGO
0.999845
4.697117
ec68977e-e383-470f-af82-bc7c6892cfb6
Liby99/nash
src/intern/adhoc/raytrace/bounding_box.cpp
#include <adhoc/raytrace/bounding_box.h> using namespace nash; BoundingBox::BoundingBox(const Vector3f min, const Vector3f max) { vertices_.push_back(min); vertices_.push_back(max); } BoundingBox::BoundingBox(const std::initializer_list<Vector3f> vertices) { this->vertices_.insert(this->vertices_.end(), vertic...
ALGO
0.960591
7.389944
58dd4dc4-a8f9-4c2c-acaa-dab54e826133
timmyjose-experiments/competitive-programming
cp/cses/assiut/sheet1/r.cpp
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; int ny = n / 365; n -= ny * 365; int nm = n / 30; n -= nm * 30; int nd = n; cout << ny << " years" << "\n"; cout << n...
ALGO
0.997414
3.791932
b9b6073c-88d0-4f84-bab8-84bd976d7a23
ufz/ogs
ProcessLib/TH2M/ConstitutiveRelations/DiffusionVelocity.cpp
#include "DiffusionVelocity.h" namespace ProcessLib::TH2M { namespace ConstitutiveRelations { template <int DisplacementDim> void DiffusionVelocityModel<DisplacementDim>::eval( CapillaryPressureGradientData<DisplacementDim> const& grad_p_cap, GasPressureGradientData<DisplacementDim> const& grad_p_GR, MassM...
ALGO
0.992324
6.775986
7a0cb668-426a-42c6-9430-8262c66eb484
kaioken166/C-CPP
Cautruc_dulieu/quickSort_perform.cpp
#include <iostream> using namespace std; void swap(int *a, int *b) { int t = *a; *a = *b; *b = t; } void quickSort(int arr[], int first, int last) { int lower = first + 1, upper = last - 1; swap(arr[first], arr[(first + last) / 2]); int bound = arr[first]; while (lower <= upper) { ...
ALGO
0.999987
5.132802
c24ad19c-c12d-4f3e-974f-740a45bc93f9
Landvibe-DataStructure-2024/Donghun-Mentee
week 11 practice/22_p02.cpp
#include <iostream> using namespace std; struct node { node* parent; node* left; node* right; int val; node() { parent = left = right = NULL; val = 0; } node(int v) { parent = left = right = new node; val = v; } }; class BST { public: int size; int count; int idx; int arr[10001]; node* root; BS...
ALGO
0.999812
4.724862
872a3874-5af2-4f8d-aded-67c32aea8ee6
mquanit2k4/CTDL-GT
HANOI.cpp
#include <bits/stdc++.h> using namespace std; int a[11]; int k,kt,dem; void tower (int n, int x, int y, int z) { if(kt==1) return; if (n==1) { a[x]--; a[y]++; dem++; if (k==dem) { cout<<a[1]<<' '<<a[2]<<' '<<a[3]; kt=1; } return; } tower(n-1,x,z,y); tower(1,x,y,z); tower(n-1,z,y,x); } int m...
ALGO
0.999928
3.410346
c3a6bf39-5e1f-4360-87cb-e27dc3f769ae
Rainboylvx/pcs
luogu/1049/1.cpp
/* author: Rainboy email: <EMAIL> time: 2020年 07月 31日 星期五 09:11:37 CST */ #include <bits/stdc++.h> using namespace std; const int maxn = 1e5+5; int V; int n,m; int a[100]; int f[100][20005]; void init(){ scanf("%d",&V); scanf("%d",&n); int i,j; for(i=1;i<=n;++i){ scanf("%d",&a[i]); } } ...
ALGO
0.999922
3.196235
e1442956-517a-42a3-9d67-7cfbf2684a29
pranav-bt/GritEngine
MonsterChase/GritEngine/Eigen3/demos/mandelbrot/mandelbrot.cpp
#include "mandelbrot.h" #include <iostream> #include<QtGui/QPainter> #include<QtGui/QImage> #include<QtGui/QMouseEvent> #include<QtCore/QTime> void MandelbrotWidget::resizeEvent(QResizeEvent *) { if(size < width() * height()) { std::cout << "reallocate buffer" << std::endl; size = width() * height(); i...
ALGO
0.909697
5.79494
7679f0ed-a370-4b53-a19e-bc9bc215b3d9
Arafat817/C-program
C3 Module 3.5 Prob E.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n,mn=1; cin>>n; while(mn*2<=n) { mn*=2; } cout<<mn; }
ALGO
0.999906
4.236217
ddfef912-cde1-4c7e-abce-d7265fcee913
changkyu/iros2020_changkyu
software/ros-package/src/control/iiwa_utils/trac_ik_kinematics_plugin/src/trac_ik_kinematics_plugin.cpp
#include <ros/ros.h> #include <urdf/model.h> #include <tf_conversions/tf_kdl.h> #include <algorithm> #include <kdl/tree.hpp> #include <kdl_parser/kdl_parser.hpp> #include <trac_ik/trac_ik.hpp> #include <trac_ik/trac_ik_kinematics_plugin.hpp> #include <limits> namespace trac_ik_kinematics_plugin { bool TRAC_IKKinema...
TOOL
0.957822
6.184735
15acfd07-b21e-4bb1-9048-d5d861808e61
SaiVinay007/Competitive-Programming
codechef/snackdown/round1b/pb2.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef vector<int> vi; typedef pair<int,int> pi; typedef vector<ll> vll; #define F first; #define S second; #define PB push_back; #define MP make_pair; #define rep(i, a, b) for (int i=a; i<b; i++) int main() { ll t; cin>>t; rep(i,...
ALGO
0.999735
3.35017
d049e549-dd64-41c4-b912-dbb68c60ef52
revanthponna/3DGameEngine
3DGameEngine/Tools/MeshBuilder/cMeshBuilder.cpp
#include "cMeshBuilder.h" #include <Engine\Platform\Platform.h> #include <Tools/AssetBuildLibrary/Functions.h> #include <Engine/ScopeGuard/cScopeGuard.h> #include <Engine/Asserts/Asserts.h> #include <iostream> #include <fstream> using namespace eae6320; cResult Assets::cMeshBuilder::Build(const std::vector<std::stri...
TOOL
0.880999
5.869741
f91c4c0d-384e-42a5-9892-358c542ab661
Nivitus/One_Month_Arrays
CPP/1.cpp
// Print an array in reverse order. #include<iostream> #include<bits/stdc++.h> std::vector<int> reverse_array(const std::vector<int>& nums) { std::vector<int> rev; for(int i=nums.size()-1;i>=0;i--){ rev.push_back(nums[i]); } return rev; } int main() { int n; std::cin>>n; std::vect...
ALGO
0.999922
5.239698
22360dcd-57b1-4da0-99c6-05d0fc75e2de
ROCm-Developer-Tools/llvm-project
libcxx/test/std/algorithms/algorithms.results/in_in_out_result.pass.cpp
// UNSUPPORTED: c++03, c++11, c++14, c++17 // template <class I1, class I2, class O> // struct in_in_out_result; #include <algorithm> #include <cassert> #include <type_traits> #include "MoveOnly.h" struct A { explicit A(int); }; // no implicit conversion static_assert(!std::is_constructible_v<std::ranges::in_in_o...
TEST
0.872676
7.489209
4a613fa0-8b89-4262-b720-7357fbe6fbed
MiraclesinWang/ACM_exercise
排位赛/第五次/F.2.cpp
#include<iostream> using namespace std; #define ll long long const ll mod=1e9+7; ll cal(ll a,ll n) { ll tmp=1; while(n){ if(n&1) tmp=(tmp*a)%mod; a=(a*a)%mod,n>>=1; } return tmp; } int main() { ll a,b,n,x,tmp=1,res,cpy; cin>>a>>b>>n>>x; if(a==1){ res=x%mod; n%=mod; res=(res+b*n)%mod; cout<<res<<endl...
ALGO
0.999967
3.917847
b194101c-e0db-4897-80ed-08fdf605aa52
hiteshnatha15/VS-CODE
C++/CIRCULAR_LINKESLIST.CPP
#include<iostream> using namespace std; class Node { public: int data; Node* next; Node(int data) { this->data=data; next=NULL; } }; class Linkedlist { public: Node* head; Linkedlist() { head=NULL; } void insertAtHead(int data) { ...
ALGO
0.996578
3.72481
00b63c74-2864-4424-82fd-6d3de6f7f822
MatLop-git/adventofcode_2024
Day11/day11.cpp
#include "IAoCHelper.cpp" class Helper : public IAoCHelper { const int TARGET_BLINKS = 25; std::vector<unsigned long long> _initialStones; void prepareInput() { // parse initial stones auto beginPos = 0; auto endPos = beginPos; do { endPos = _fileIn...
ALGO
0.99065
6.380702
15f4220d-5b72-4545-ad68-a9e2cf96d889
hv65616/Data-Structures-and-Algorithms
Queue/Queue3.cpp
/* Queue using Stack In this we will implement nature of queue and the functionality of it into a Stack. So that our stack will behave like a queue.We will use the operation of stack. We will need two stack one will be empty and other one will be full. */ #include <iostream> #include <stack> using name...
ALGO
0.998274
5.315495
a1ea1b6d-b1f4-441a-b595-3db06a10f8b3
ambak/CSES-solutions
Tree Algorithms/Fixed-Length Paths I.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; int n, k; vector<int> v[200009]; vector<int> w[200009]; bool odw[200009]; LL depth[200009]; int subtree_size[200009]; void get_size(int st, int parent) { subtree_size[st] = 1; for (auto x : v[st]) { if (x != parent && !odw[x]) { get_size(x, st...
ALGO
0.999886
4.557858
c4301354-bbdd-4d91-b99b-9bc6312e2db6
ishandutta2007/codeforces
al.cash/normal/575/F.cpp
#include <stdexcept> #include <iostream> #include <sstream> #include <fstream> #include <cstring> #include <cstdarg> #include <cstdio> #include <cmath> #include <ctime> #include <functional> #include <algorithm> #include <complex> #include <numeric> #include <bitset> #include <vector> #include <string> #include <queue>...
ALGO
0.99988
4.069499
35541ab1-413c-401d-a17e-2683943bbffb
HandongProblemSolvers/Problem-Solving
problems/Mathematics/BOJ10610/김용주.cpp
#include <cstdio> #include <algorithm> #include <cmath> #include <cstring> using namespace std; #define MAX_N 100001 typedef long long ll; char N[MAX_N]; ll sum; bool chk; int partition(int p, int r){ int x = N[r]; int i = p - 1; for(int j = p; j < r; j++){ if(N[j] > x){ i++; ...
ALGO
0.9999
4.013151
fc687d52-790e-4ccb-a585-54b498e1505e
MarceloFCandido/PIC02
src/pthreads/fc-pthreads-parabolloid/src/solver.cpp
#include <iostream> #include <stdio.h> #include <armadillo> #include <pthread.h> using namespace std; using namespace arma; #define NUM_THREADS 4 #define PI 3.14159265359 typedef struct { mat *A; int num_p_x_sub_mtx, num_p_y_sub_mtx_start, num_p_y_sub_mtx_end; float x_start, y_start; float x_ofst, y_...
ALGO
0.986864
4.214369
b2c01d16-1679-48e0-9142-cf8e2165cc38
hwannow/PS
BOJ/21278.cpp
#include<bits/stdc++.h> #define x first #define y second using namespace std; int n, m; int a, b; int ansa, ansb, ans = 987654321; vector<int> v[101]; void bfs(int i, int j) { int visited[101] = { 0 }, tmp = 0; queue<pair<int, int>> q; //ǥ, ð q.push({ i, 0 }); q.push({ j ,0 }); visited[i] = 0; visited[j] = 0; ...
ALGO
0.999986
3.67897
8396cb76-3fa4-4efc-a006-822df30a0762
itsmanvendra/DSA-Solved-LeetCode-GFG
0090-subsets-ii/0090-subsets-ii.cpp
class Solution { public: void solve(set<vector<int>> &st, int index, vector<int> output, vector<int> nums){ //base condition if(index >= nums.size()){ st.insert(output); return; } //exclude solve(st, index+1, output, nums); //include ...
ALGO
0.999979
5.924869
56ff9f1f-8896-43cd-ab6a-9eb34d2be127
H-Shen/MyCodeCollection
Luogu/P5681.cpp
#include <bits/extc++.h> using namespace std; using namespace __gnu_pbds; using ll = long long; int main() { ll a, b, c; cin >> a >> b >> c; if (a * a > b * c) { cout << "Alice"; } else { cout << "Bob"; } cout << endl; return 0; }
ALGO
0.999956
4.538969
70311b0f-2204-4835-ab48-8a58e3731217
Chandrashekharsk/dsa_cpp
day73/minEffort.cpp
// 1631. Path With Minimum Effort #include <iostream> #include <queue> #include <vector> using namespace std; int findMinEffort(vector<vector<int>>& heights) { int n = heights.size(), m = heights[0].size(); priority_queue<pair<int, pair<int, int>>, vector<pair<int, pair<int, int>>>, greater<pair<int, pair<int, int...
ALGO
0.999991
5.931085
6837f1c9-6b9d-4095-bd56-2cef24ec1df4
shiblesadik/coding-interview
Codeforces/572B.cpp
#include <bits/stdc++.h> using namespace std; struct vpair { }; int n, s, p, q; char d; vector<pair<int, int>> buy, sell; map<int, int> buy_mp, sell_mp; int main (void) { // ios_base::sync_with_stdio(false); // cin.tie(NULL); // cout.tie(NULL); scanf("%d %d", &n, &s); for (int i = 0; i < n; ++i) { scanf("...
ALGO
0.999276
3.03286
c291d640-7b35-435b-b84e-a5c57b1e0a99
Wasrek/POSN15
MWITS 26-31.3.19/Dressing.cpp
/* TASK:Dressing LANG: CPP AUTHOR: KersaWC SCHOOL: REPS */ #include<bits/stdc++.h> using namespace std; priority_queue<int> h; int in[50100],mark[50100]; vector<int> g[50100],ans; int main() { int n,m,r,s,t,ch=0,i; scanf("%d %d",&n,&m); while(m--) { scanf("%d %d",&s,&r); ...
ALGO
0.999996
3.383105
b1143185-e947-4bec-b311-e823d05b20f4
saxena-vinayak36/SUPPLY-CHAIN
C++/Timsort.cpp
/*TimSort is a sorting algorithm based on Insertion Sort and Merge Sort. A stable sorting algorithm works in O(n Log n) time and O(n) in best case. Used in Java’s Arrays.sort() as well as Python’s sorted() and sort(). First sort small pieces using Insertion Sort, then merges the pieces using merge of merge sort. We di...
ALGO
0.999945
6.118928
c682042c-1df0-4aa3-8023-cef50e2b7ae0
wangzi6147/leetcode
src/Path Sum II/Solution.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: vector<vector<int>> pathSum(TreeNode* root, int sum) { vector<vector<int>> result = {{}...
ALGO
0.999963
5.883868
30e9f944-b0e9-4e56-b3b1-e10ecc98e100
ZHOURUIH/GameEditor
LegendDataEditor/LegendDataEditor/SceneMap/UnreachTileGroup.cpp
#include "UnreachTileGroup.h" #include "MapData.h" #include "MapHeader.h" #include "MapTile.h" #include "ImageUtility.h" myVector<int> UnreachTileGroup::mTempAddTriangles; UnreachTileGroup::UnreachTileGroup(int id, MapData* mapData) { mGroupID = id; mMapData = mapData; mMapHeight = mMapData->mHeader->mHeight; mMa...
ALGO
0.931633
4.870627
5edf8eaa-76d7-4df6-9ce6-c76aa055f425
SuyashSingh01/Leetcode-SDE-Sheet
Code/reversingarray33.cpp
#include<iostream> using namespace std; //program to reverse an array /*void printarray(int arr); int takearray(int arr){ for(int i=0;i<100;i++){ cin>>arr[i]; } }*/ //class fun{}; void printarray(int arr[]){ for(int i=0;i<10;i++){ cout<<arr[i]<<" "; } cout<<endl; } class fun{ public: void reverse(i...
ALGO
0.995807
4.05491
2d24a6cc-4766-48c6-aa0a-64eb9409d878
salprince123/Blaster-Master
BlasterMaster/GameObject.cpp
#include <d3dx9.h> #include <algorithm> #include "Utils.h" #include "Textures.h" #include "Game.h" #include "GameObject.h" #include "Sprites.h" #include "Background.h" #include "PlayScence.h" CGameObject::CGameObject() { x = y = 0; vx = vy = 0; nx = 1; } void CGameObject::Update(DWORD dt, vector<LPGAMEOBJECT> *c...
ALGO
0.958392
4.960674
23455704-8a7b-4ec6-ba9f-f6210b3a0252
PraffulPatel27/GFG-Solution
Easy/Trail of ones/trail-of-ones.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int mod = 1e9+7; int fun(int i, int n, int prev, int flag, vector<vector<vector<int>>> &dp) { if(i==n) { if(flag) return 1; return 0; } if(dp[i][...
ALGO
0.999982
6.23197
b9b85ab5-1c55-469f-8858-c0a36eb0b99c
Prashantcoder88/Assignmentrepo
permutation and combination.cpp
#include<iostream> using namespace std; int factorial(int y) { int i, fact = 1; for(i = 2; i <= y; i++) { fact = fact * i; } return fact; } int main() { int n, r; int ncr, npr; cout<< "Enter the value of n: "; cin>> n; cout<<" Enter the value of r: "; cin>> r; npr = factorial(n) / factorial(n-r);...
ALGO
0.979323
3.78822
5714d2eb-ed9f-4390-9eeb-50387887a6ac
LeeNJU/LeetCode
LeetCode/Alien Dictionary.cpp
#include<string> #include<unordered_map> #include<vector> #include<queue> #include<unordered_set> #include<algorithm> //Ŀ:һַ飬ַһ˳УҵЩַ˳["wrt","wrf","er", // "ett","rftt"]ôַ˳"wertf" //ⷨ:ʵͼַ֮˳һߣȹһͼȻùжǷл std::unordered_map<char, std::unordered_set<char>> build_graph(std::vector<std::string>& words) { ...
ALGO
0.999999
5.965785
9c6e9679-5e3b-4c30-a6f7-b69ec7b18e7f
shubhamraut789/POSIX-SHELL-Implementation
cd.cpp
#include <iostream> #include <unistd.h> #include <string> #include <vector> #include "functions.h" using namespace std; // Variables to store current and previous directories string curr_dir = ""; string prev_dir = ""; int cd_dash_cnt = 0; void update_directories() { char temp[128]; if (getcwd(temp, sizeof(t...
TOOL
0.872284
4.69096