uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
403348e9-9a19-4db7-be47-9f0a2a85cca3
sarvex/leetcode-chef
solution/1500-1599/1534.Count Good Triplets/Solution.cpp
class Solution { public: int countGoodTriplets(vector<int>& arr, int a, int b, int c) { int n = arr.size(); int ans = 0; for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n; ++j) { for (int k = j + 1; k < n; ++k) { ans += abs(arr[i] - arr[j...
ALGO
0.9999
5.902443
481044d8-7a99-4d76-830f-6482a738d8eb
Seungchan0325/baekjoon
solutions/2156_0.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; int a[10001], d[10001]; scanf("%d", &n); for(int i=1; i<=n; i++) scanf("%d", a+i); d[1] = a[1]; d[2] = d[1] + a[2]; for(int i=3; i<=n; i++) { d[i] = max({d[i-3] + a[i-1] + a[i], d[i-1], d[i-2] + a[i...
ALGO
0.999947
3.786227
cd3e82ba-8323-435a-8989-ea34aa61ae1c
2k0ri/atcoder-workspace
abc149/E/main.cpp
// clang-format off #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define rep1(i,n) for(ll i=1, i##_len=(n); i<=i##_len; ++i) #defin...
ALGO
0.999817
3.690485
f2e1ddb3-f082-4afa-ae42-cae10f78aa50
cran/birp
src/libs/coretools/core/coretools/Math/TSubsamplePicker.cpp
/* * TDownsamplePicker.cpp * * Created on: Aug 10, 2020 * Author: phaentu */ #include "coretools/Math/TSubsamplePicker.h" #include "coretools/Main/TRandomGenerator.h" #include "coretools/Math/mathFunctions.h" namespace coretools { //--------------------------------------- // TSubsampleSolutions //-------...
ALGO
0.997043
5.69067
f7ede16c-1752-4f12-a54d-d98384ecb3f3
mustafaahussaam3/Data-Structure
406InsertLL.cpp
#include <iostream> using namespace std; struct Node { int data ; struct Node* next ; }*first = NULL; void Create (int A[], int n) { struct Node *temp, *last; first = (struct Node *)malloc (sizeof(struct Node)); first->data = A[0]; first->next = NULL; last = first ; for (int i = 1...
ALGO
0.999924
3.758352
36f37306-8c4a-4148-b468-df62917bd68f
RushitaKolekar/HackerRank_Solutions
Designer_PDF_Viewer/code.cpp
int designerPdfViewer(vector<int> h, string word) { int max_height = 0; for(char c:word){ int char_height = h[c-'a']; if(char_height > max_height) max_height = char_height; } return max_height * word.length(); } //Time Complexity: O(n), where n is the length of the word....
ALGO
0.99668
5.738324
6f75c789-d70b-47e2-b2fa-e9a510ab6c51
SOFTK2765/PS
BOJ/13240.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, m; scanf("%d %d", &n, &m); for(int i=0;i<n;i++) { for(int j=0;j<m;j++) printf("%c", (i+j)%2==0?'*':'.'); printf("\n"); } return 0; }
ALGO
0.9997
3.081016
3d9f310b-3aae-4712-a69e-d24301b8a2cc
Rishabh-Agarwal9/CompetitiveProgramming
Codeforces practice/1697C.cpp
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 typedef set<string> ss; typedef vector<int> vi; typedef map<int, char> msi; typedef pair<int, int> pa; typedef long long int ll; ll gcd (ll a, ll b) { return b ? gcd (b, a % b) : a; } //mmi ll inv(ll a) { return a <= 1 ? a : mod - (ll)(mod/a) ...
ALGO
0.999967
4.859722
b362c29f-8103-4701-907d-0bde493dd49e
golu242/Programming
My Code/permutation-string.cpp
#include<iostream> #include<string.h> using namespace std; void swap(char *x, char *y) { char temp; temp = *x; *x = *y; *y = temp; } void permutation(char *a, int l, int r) { int i; if (l == r) cout<<a<<"\n"; else { for(i = l; i <= r; i++) { swap((a...
ALGO
0.999994
4.075772
00a0e350-94c0-41e4-a5ad-e1952ec0a5ae
kalo-ai/ShapePFCN
Thea/Code/Source/Algorithms/Zernike2.cpp
#include "Zernike2.hpp" #ifndef THEA_NO_ZERNIKE #include "../Math.hpp" namespace Thea { namespace Algorithms { Zernike2::Zernike2(Options const & opts_) : opts(opts_), lut_generated(false) { alwaysAssertM(opts.angular_steps > 0 && opts.radial_steps > 0 && opts.lut_radius > 0, "Zernike2: Lookup dim...
TOOL
0.972243
6.214931
042aad9b-b0a1-48d0-a665-cfa8d281ab0f
ishandutta2007/codeforces
reyna/normal/1270/F.cpp
#include <iostream> #include <algorithm> #include <fstream> #include <vector> #include <deque> #include <assert.h> #include <queue> #include <stack> #include <set> #include <map> #include <stdio.h> #include <string.h> #include <utility> #include <math.h> #include <bitset> #include <iomanip> #include <complex> using n...
ALGO
0.999969
3.654797
180a8f67-d0e0-45d2-a441-7f8fac0f3452
apache/cloudberry
src/backend/gporca/libnaucrates/src/statistics/CExtendedStatsProcessor.cpp
#include "naucrates/statistics/CExtendedStatsProcessor.h" #include "gpos/common/CBitSet.h" #include "naucrates/md/CMDExtStatsInfo.h" #include "naucrates/statistics/CFilterStatsProcessor.h" #define STATS_MAX_DIMENSIONS 8 /* max number of attributes */ #define InvalidOid 0 using namespace gpopt; static BOOL IsDepen...
ALGO
0.998594
7.684579
57f8a9e8-97ea-4ffd-a13e-099878e931b7
Fenharel1/Competitive-Programming
UVA solutions/11952.cpp
#include <bits/stdc++.h> #define REP(i,a,b) for(i = a; i < b; i++) using namespace std; int main(){ int tc, Price; cin >> tc; for(int q = 1; q <= tc; q++){ Price=0; int n,m,i,j,budget,ans=0; cin >> n >> m >> budget; int M[n][m]; REP(i, 0,n) REP(j,0,m) cin >> M[i][j]; i=j=0; RE...
ALGO
0.99986
3.434314
89c8d4fd-c824-4f05-a034-62dff67228f2
jimmy947788/zygisk-florida-gadget
src/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/ranges.search.pass.cpp
// <algorithm> // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: libcpp-has-no-incomplete-ranges // template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2, // sentinel_for<I2> S2, class Pred = ranges::equal_to, // class Proj1 = identity, class Proj2 = identity> // requires...
TEST
0.935353
3.822641
52c64478-bc9b-4baf-bd96-b5428d92754d
yuyahy/Atcoder
tessoku-book/B33/main.cpp
// デバッグ用関数の設定 #ifdef DEFINED_ONLY_IN_LOCAL #include </workspaces/atcoder/cpp-dump/dump.hpp> #define dump(...) CPP_DUMP(__VA_ARGS__) #else #define dump(...) #define CPP_DUMP_DEFINE_EXPORT_OBJECT(...) #endif #include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using namespace std; typedef long long...
ALGO
0.99996
4.403376
fc29f3f5-1c19-4157-81e5-d9edd8e04079
literallyalice/PPPUCPP2nd
ch4/c04e03.cpp
//c04e03 // Read a sequence of double values into a vector. Think of each value as the // distance between two cities along a given route. Compute and print the total // distance (the sum of all distances). Find and print the smallest and // greatest distance between two neighboring cities. Find and print the mean // d...
ALGO
0.993459
4.463461
a9755a77-6eec-4077-bc63-0d62e8b3d7fc
eriktai/gem5-Orca
src/systemc/tests/systemc/misc/unit/data/datawidth_signed/lost_carry/datawidth.cpp
/***************************************************************************** datawidth.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /**************************************************************************...
ALGO
0.980908
5.296924
b545b50f-f2f9-420b-b29e-c7d042a96144
22MH1A05L4/leetcode
169-majority-element/majority-element.cpp
class Solution { public: int majorityElement(vector<int>& nums) { int candidate = nums[0]; int count =1; for(int i=0;i<nums.size();++i){ if(nums[i] == candidate){ ++count; } else{ --count; if(count == 0){ ...
ALGO
0.999957
5.619299
8587fd37-0f64-42eb-9c7e-e71ae7847248
ishandutta2007/codeforces
eddy1021/normal/596/A.cpp
// eddy1021 #include <bits/stdc++.h> using namespace std; typedef double D; typedef long long ll; typedef pair<int,int> PII; #define mod9 1000000009ll #define mod7 1000000007ll #define INF 1023456789ll #define INF16 10000000000000000ll #define FI first #define SE second #define PB push_back #define MP make_pair #defin...
ALGO
0.999483
4.623514
979396dc-6492-4b51-b993-b5b6ba4b9d50
mghro/astroid-core
src/astroid/math/interpolate.cpp
#include <algorithm> #include <astroid/math/interpolate.hpp> #include <cassert> #include <cmath> namespace astroid { regular_grid<1, double> compute_interpolation_grid( std::vector<double> const& sample_positions, double growth_tolerance) { size_t n_samples = sample_positions.size(); if (n_samples <= 1) ...
ALGO
0.999778
7.189478
d5814815-3533-46b9-8f43-3a07c211715c
Georgi-0d/FINKI
SP/Zadaci Vtor Kolokvium/10.cpp
#include <iostream> #include <cctype> #include <cstring> using namespace std; void substring(char *x, char z1, char z2) { char *c1, *c2, newS[80]; c1 = strchr(x, z1); c2 = strchr(x, z2); if (c1 && c2 && c1 < c2) { strncpy(newS, c1 + 1, c2 - c1 - 1); newS[c2 - c1 - 1] = '\0'; cou...
ALGO
0.969432
3.491451
04989588-b93a-440b-9c43-9ccec33f08d0
gauravtrivedi967/CODES-DSA
Day-12/SingleNumber.cpp
/*class Solution { public: int singleNumber(vector<int>& nums) { int ans=0; for(int i=0;i<nums.size();i++) ans=ans^nums[i]; return ans; } };*/ class Solution { public: int singleNumber(vector<int>& nums) { sort(nums.begin(),nums.end()); for(int i=0;i<nums....
ALGO
0.999964
5.272236
90cab513-4d27-438d-a825-0636388926c3
iharh/fp-by-example
tex/src/quicksort.cpp
void quickSort(int arr[], int left, int right) { int i = left, j = right; int pivot = arr[(left + right) / 2]; while (i <= j) { while (arr[i] < pivot) ++i; while (arr[j] > pivot) ++j; if (i <= j) std::swap(arr[i++], arr[j--]); } if (left < j) quickSort(arr, left, j); if (i < right) quickSort(arr, i, rig...
ALGO
0.999927
5.228805
570403dd-c203-49dd-bc46-42a47474d10a
sachithgmg/os
os lab/OS lab by sonu/lab/producer_consumer_pthread.cpp
#include <cstdio> #include<unistd.h> #include <pthread.h> #include<cstdlib> #define MAX 10000000000 /* Numbers to produce */ pthread_mutex_t the_mutex; pthread_cond_t condc, condp; int buffer = 0; void* producer(void *ptr) { int i; for (i = 1; i <= MAX; i++) { pthread_mutex_lock(&the_mutex); /* protect buf...
ALGO
0.997611
4.251972
d867401e-f3c8-4a89-bb29-e3ed235c8ab5
saadmansakib47/Algorithms-CSE-4404-
Lab_Contest_Solutions/Lab05 (MST+TopSort)/SPOJ Toposort.cpp
#include <bits/stdc++.h> using namespace std; const int INF = 1e9; void in(int &x) { register int c = getchar_unlocked(); x = 0; for (; (c < 48 || c > 57); c = getchar_unlocked()); for (; c > 47 && c < 58; c = getchar_unlocked()) { x = (x << 1) + (x << 3) + c - 48; } } vector<int> adj[100...
ALGO
0.99998
4.723131
28dd3232-171c-4955-9ae6-a87dbf183bad
mrunaltarwatkar018/Placement_Data_Structures_N_Algorithms
Linked List/GFG/Delete_node_in_a_Doubly_Linked_List.cpp
/* GFG Problem: Delete node in a Doubly Linked List */ /* Company Tags : Amazon GFG Link : https://www.geeksforgeeks.org/problems/delete-node-in-doubly-linked-list/1 */ class Solution { public: Node* deleteNode(Node* head, int x) { struct...
ALGO
0.999903
5.471278
9ceca0e3-a856-47dd-8cac-8038b9e08413
Cindragon/Leetcode-Practice-Grind-75
0516-longest-palindromic-subsequence/0516-longest-palindromic-subsequence.cpp
class Solution { public: int longestPalindromeSubseq(string s) { vector<vector<int>> dp(s.size(), vector<int>(s.size(), 0)); for(int i=0;i<s.size();i++){ dp[i][i]=1; } for(int i=s.size()-1;i>=0;i--){ for(int j=i+1;j<s.size();j++){ if(s[i]==s[j]...
ALGO
0.99965
5.885493
3788f3b2-98e8-429d-b757-56da70728790
Abdul-Rahimm/LeetCode_2024
6. June/15. 502. IPO.cpp
// بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ #include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() typedef vector<int> vi; typedef vector<vi> vii; typedef pair<int, int> P; void print(priority_queue<P, vector<P>, greater<P>> capital) { while (capital.empty() == false) { P pr = capit...
ALGO
0.999961
4.265501
2e9f97d9-b9d8-43c5-937e-a8c7663e8221
mayanangel/AtCoder.com
TOYOTA MOTOR CORPORATION Programming Contest 2023#1 (AtCoder Beginner Contest 298)/A.cpp
#include <bits/stdc++.h> using namespace std; #define LL long long #define PII pair<int , int> #define PLI pair<LL , int> #define PLL pair<LL , LL> #define bit(x) (1<<x) #define bitl(x) (1LL<<x) #define cnti(x) (__builtin_ctz(x)) #define cntl(x) (__builtin_ctzll(x)) #define clzi(x) (__builtin_clz(x)) #define clzll(x...
ALGO
0.999878
4.010513
de50f05c-5fd6-43c5-b7ab-99e5e977403c
ishandutta2007/codeforces
function348/normal/605/B.cpp
#include<cstdio> #include<iostream> #include<algorithm> #define FR first #define SC second using namespace std; struct PII { int k,i,id;}; const int N=100010; int n,m; PII a[N]; int ans1[N],ans2[N]; int cmp(PII a,PII b) { return a.k<b.k||(a.k==b.k&&a.i>b.i);} int main() { scanf("%d%d",&n,&m); for (int i=1;i<=m;i++) s...
ALGO
0.999979
3.195232
c8dae70f-d831-4b77-ab97-b1e58b5b7a31
WillisDoering/Snake
biconnected.cpp
/********************************************************************//** * @file ***********************************************************************/ #include "biconnected.h" #include <iostream> Biconnected::Biconnected(SnakeGraph *G) : Time(0) { // Set all the parents to be NO_PARENT for (int v : G->Vert...
ALGO
0.995844
5.707919
f2f98692-8a39-45bc-8667-aef8cec7f9da
JangIn-40/Programmers
LV0/Lv0 Basic/FindLongestSubstringEndedWithSpecificString/FindLongestSubstringEndedWithSpecificString.cpp
#include <string> #include <vector> #include <iostream> using namespace std; string solution(string myString, string pat) { string answer = ""; int f = myString.find(pat), s{}; while (f != myString.npos) { s = f; f = myString.find(pat, f + pat.size()); } answer.assign(myString.begin(), myString.begin() + s...
ALGO
0.999701
4.956961
31139b5c-7338-41e5-8912-5ef6c299658b
Orcuslc/Learning
LeetCode/521. Longest Uncommon Subsequence I.cpp
class Solution { public: int findLUSlength(string a, string b) { if(a.size() == b.size()) return a == b?-1:a.size(); return max(a.size(), b.size()); } };
ALGO
0.999755
5.217021
87418bff-401a-4d50-bbda-312e3600d06b
moti9/iCode
dsa/DP/Minimum-Coins-SpaceOptimized.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 // TC- O(N*E) // SC- O(E + E) class Solution { public: int minimumElements(vector<int> &nums, int x) { int n = nums.size(); vector<int> dp(x + 1, 0); for (int tar = 0; tar <= x; tar++) { ...
ALGO
0.999964
4.993433
86d30ea9-048d-45ba-97bb-5a19fe2dc14e
yhondri/tais
PracticaLunes/PracticaLunes/MainLunes/main_46.cpp
// Grupo 15 // Comentario general sobre la solucin, // explicando cmo se resuelve el problema #include <iostream> #include <fstream> #include <vector> #include <algorithm> #include "Matriz.h" // propios o los de las estructuras de datos de clase using namespace std; struct monedas { int valor; int cantida...
ALGO
0.999932
3.931573
653f891e-0c4d-4cc5-a3b1-ca5f84231b23
ishandutta2007/codeforces
fextivity/normal/1684/D.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define endl '\n' #define fi first #define se second #define For(i, l, r) for (auto i = (l); i < (r); i++) #define ForE(i, l, r) for (auto i = (l); i <= (r); i++) #def...
ALGO
0.999939
4.585687
39cbd76a-81d8-4189-ba82-ebfe2b527cca
robinyqc/yosupo-sol
solutions/ds/point_set_range_composite/sol0.cpp
#include <iostream> #include <cstdio> #include <vector> #include <cstring> #include <algorithm> #include <atcoder/modint> #include <atcoder/segtree> using namespace std; using i32 = int; using i64 = long long; using u32 = unsigned int; using u64 = unsigned long long; template<typename T> using vec = vector<T>; templ...
ALGO
0.999718
4.988841
dd02325c-ac89-4f15-8e7a-2c3fb4cc61f6
LiviaJacklinne/INATEL-C202
P3_24.cpp
#include <iostream> #include <cmath> #include <iomanip> #include <locale> #include <cstring> using namespace std; int main () { setlocale(LC_ALL, "Portuguese"); float a,b,c,x; cout<< "digite os valores de a, b e c "<<endl; cin>>a>>b>>c; x = pow(b,2) -4*a*c; if (x > 0 && a != 0) { cout<<"x1 "<< ...
ALGO
0.995797
3.763322
62c678a3-d4a9-4746-95ea-e067527e7565
kbaafi/autonomous-cars-highway-path-planning
src/Eigen-3.3/doc/examples/QuickStart_example.cpp
#include <iostream> #include <Eigen/Dense> using Eigen::MatrixXd; int main() { MatrixXd m(2,2); m(0,0) = 3; m(1,0) = 2.5; m(0,1) = -1; m(1,1) = m(1,0) + m(0,1); std::cout << m << std::endl; }
ALGO
0.98603
3.474624
ea79be03-1918-4c50-97f6-a05d5ecd12f9
il999/CompetitiveProgramming
codeforces/1703/D.cpp
//coding template #include <bits/stdc++.h> using ll =long long; using namespace std; void solve() { int n; cin>>n; string s[n]; map<string, int> m; for(int i=0;i<n;i++) { cin>>s[i]; m[s[i]]=1; } for(int i=0;i<n;i++) { string p=""; string p2=""; ...
ALGO
0.999885
4.114576
af605a34-acd5-4b38-a367-998cf8bde30b
moinhameed27/Ultimate-DSA
Linked List/Middle of Linked List.cpp
// LeetCode : https://leetcode.com/problems/middle-of-the-linked-list/ // GFG : https://www.geeksforgeeks.org/problems/finding-middle-element-in-a-linked-list/1 // [C++]----------------------------------------------------------------------------------------------------------------------- /** * Definition for singly-...
ALGO
0.999868
6.080325
8befe9e1-acfc-4ec8-a45a-cbf236202718
ishandutta2007/codeforces
flukehn/normal/1743/A.cpp
#include<bits/stdc++.h> using namespace std; #define For(i,a,b) for(int i=(a),i##_end=(b);i<i##_end;++i) using ll=long long; #ifndef flukehn #define dbg(...) 0 #define debug(...) 0 #endif ll solve(){ int n; cin>>n; vector<int> a(n); For(i,0,n)cin>>a[i]; int p=10-n; return 1LL*p*(p-1)/2 * 6; } int main(){ #ifdef f...
ALGO
0.999056
4.655092
fc5aaa66-3ddf-47f4-a224-3b0825646d38
ishandutta2007/codeforces
radewoosh/normal/NA/274.cpp
//~ while (clock()<=69*CLOCKS_PER_SEC) //~ #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("O3") //~ #pragma GCC target ("avx2") //~ #pragma GCC optimize("Ofast") //~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") //~ #pragma GCC optimize("unroll-loops") #include <bits/st...
ALGO
0.999776
4.215534
5a72083b-9ea0-4fed-bb96-7a77edab48ca
raincross7/code-similarity
codes/train_code/problem336/problem336_151.cpp
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define all(x) (x).begin(),(x).end() #define YES() printf("YES\n") #define NO() printf("NO\n") #define Yes() printf("Yes\n") #define No() printf("No\n") #define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w #define i...
ALGO
0.999933
3.425833
9447232c-b5bd-42a2-9d60-e3c7442cdf47
rexosorous/school
CMPS-385_Data_Structures/project3/q2/project3_q2.cpp
/* ----------------------------------------------- Name: J-Zach Loke Course: CMPS-385 Semester: Spring 2020 Project: No. 3 Part 2 Purpose: Given some arrays and class declarations, display each original array followed by their sorted form ---------------------------------...
ALGO
0.99486
4.879073
ce4f7f81-f057-445d-8f3e-48d9d19feca5
zyfgisrs/CppLeetNinjas
1-50/0003无重复字符的最长子串/0003无重复字符的最长子串.cpp
#include <algorithm> #include <string> #include <vector> class Solution { public: int lengthOfLongestSubstring(std::string s) { std::vector<int> charIndex(256, -1); int maxLen = 0; int left = 0; for (int right = 0; right < s.size(); right++) { if (charIndex[s[right]] >= left) { left = ...
ALGO
0.999545
6.56628
a569c95d-5b38-4a1b-a23b-2769fe3abfd8
theodorekwok/codepractices
zeroremainderarray.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; ll a[200000]; int main() { int t; cin >> t; while (t--) { ll n, k; cin >> n >> k; for (int i = 0; i < n; i++) { ll v; cin >> v; if (v % k == 0) a[i] = 0; else a[i] =...
ALGO
0.999941
3.293503
abddc208-3dd2-471c-9b73-d16e76feea02
ImNaman/Competitve-Coding
DP/DNC_DP.cpp
#include <bits/stdc++.h> using namespace std; #define INF 1000000000 typedef long long int ll; #define N 1005 #define K 1000 ll A[N],DP[K][N],cost[N][N]; int k; void solve(int l,int r,int L,int R) { if(l>r)return; int mid = (l+r)/2,best = L; DP[k][mid]=INF; for(int i = min(R,mid-1);i>=L;i--) if(DP[k-1][i]...
ALGO
0.99989
3.678575
045b8ea7-b5c9-47d9-aee7-c821fedd5c52
sonitmehr/sde_sheet_grind
4_Sum.cpp
class Solution { public: // Use 2 for loops for first 2 and then 2 Sum + Sort. vector<pair<int,int>> twoSum(vector<int>& v, long long target,int l) { int n = v.size(); vector<pair<int,int>> p; int i =l, r = n-1; while(l < r){ if(v[l] + v[r] == target){ ...
ALGO
0.99996
5.709995
8bf1c3a6-4105-4496-a786-7904269a1e08
smv1999/CompetitiveProgrammingQuestionBank
Data Structures/Trees/level_order_traversal.cpp
/* Given a binary tree, find its level order traversal. Level order traversal of a tree is breadth-first traversal for the tree. */ #include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node *left; struct Node *right; }; Node *newNode(int val) { Node *temp = new Node; temp->d...
ALGO
0.999129
5.822751
75d2d344-5c1c-48b2-9041-5cabf03a7031
CHIR4G7/cpp-codes-old
BIT MASKING/8.cpp
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <unordered_map> using namespace std; int solve(int index,string s,vector<int>& dp) { if(index<s.length() && s[index]=='0') { return 0; } if(index>=s.length()) { return 1; } if(dp[index]!=-1)...
ALGO
0.99977
4.974737
a98e9c27-431c-4b39-954b-17c084fe4b52
kms223344/teamnote
2025spring/source/Math/PrimitiveRoot.cpp
ll primary_root(ll p) { std::random_device rd; std::mt19937 gen(rd()); std::uniform_int_distribution<ll> distrib(1, p-1); //distrib(gen); vl g = po_rho(p-1); while(true) { ll c = distrib(gen); bool ok = true; ll u = p-1; ll b = 1; for(auto i:g) ...
ALGO
0.999907
3.931038
575434df-04c1-4dc0-85e7-81442b74af90
Artamta/Ayush_Raj_Assignments
.history/Assignments/Assignment5/binary_search_tree_20250320221206.cpp
#include <iostream> using namespace std; struct BstNode { int data; BstNode *left; BstNode *right; }; BstNode *GetNewNode(int data); // Function declaration BstNode *Insert(BstNode *root, int data) { if (root == NULL) { root = GetNewNode(data); } else if (data <= root->data) {...
ALGO
0.999383
5.300726
df8f66b8-89bb-4adf-9490-d291589b1249
redoy1102/Phitron-CP-Course
3 - Basic Data Structure/Week-3/Module-9/insert_head.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int value; Node *next; Node *pre; Node(int value){ this->value = value; this->next = NULL; this->pre = NULL; } }; void insert_head(Node *&head, Node *&tail, int v){ Node *nd = new Node(v); if(head==...
ALGO
0.995507
3.774242
94608483-f3eb-4e91-b3cc-575c9933adaf
MNJTdhr/DSA_grind
V26/NextPermutationProblem.cpp
//leetcode q31 #include <iostream> #include <vector> #include <algorithm> using namespace std; void nextPermutation(vector<int>& nums) { int i = nums.size() - 2; while (i >= 0 && nums[i] >= nums[i + 1]) { i--; } if (i >= 0) { int j = nums.size() - 1; while (j >= 0 && nums[j] <=...
ALGO
0.999919
5.590633
e3e7d48c-4c3e-4ea7-96b4-eb8efe3d0597
MOHIT-IITP/Leetcode
3362.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: int maxRemoval(vector<int>& nums, vector<vector<int>>& queries) { } }; int main(){ return 0; }
ALGO
0.986354
4.936838
90db8807-6ca3-4a2b-85d8-15534c0a558e
ChuanqiXu9/clangd-for-modules
libc/src/math/generic/lroundf.cpp
#include "src/math/lroundf.h" #include "src/__support/FPUtil/NearestIntegerOperations.h" #include "src/__support/common.h" #include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(long, lroundf, (float x)) { return fputil::round_to_signed_integer<float, long>(x); } } // namespace...
ALGO
0.997375
6.391389
d9fd6aee-b9c4-4482-a421-0ec2375257c2
shailendji/nefertiti
engines/saga/puzzle.cpp
#include "saga/saga.h" #include "saga/actor.h" #include "saga/interface.h" #include "saga/scene.h" #include "saga/sprite.h" #include "saga/puzzle.h" #include "saga/render.h" #include "common/system.h" #include "common/timer.h" namespace Saga { #define ITE_ACTOR_PUZZLE 176 #define PUZZLE_X_OFFSET 72 #define PUZZLE...
TOOL
0.899474
5.19392
d445c89c-bfdc-4d36-835b-07c79257d3ea
tr1ten/DNA
codeforces/contests/A_TubeTube_Feed.cpp
#include <cstdio> #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 ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update> ; template<typename T> using order...
ALGO
0.999976
3.97657
613ab831-10bf-4d86-aa40-a2a8d885137b
manthan0x23/codeforces-problems
contests/codechef/starters-187B/C.cpp
#include <bits/stdc++.h> using namespace std; const int MOD = 998244353; const int MAXN = 200005; int dp[MAXN]; // Precompute dp[] void precompute_dp() { dp[0] = 1; dp[1] = 2; dp[2] = 3; for (int i = 3; i < MAXN; ++i) { dp[i] = (dp[i - 1] + dp[i - 3]) % MOD; } } int main() { ios::sync_with_stdio(fal...
ALGO
0.999998
5.806234
952e985e-c66a-4c4c-a132-d93a411b3738
fgall002/cs12
MergeSort.cpp
#include <iostream> #include <cstdlib> #include <vector> #include "Deck.h" using namespace std; void merge(vector<Card> &x, unsigned begin, unsigned mid, unsigned end) { unsigned int mergedSize = end - begin + 1; // Size of merged partition vector<Card> mergerdCards(mergedSize); // Temporary array ...
ALGO
0.999284
4.801746
d7cbc9a4-b8f3-4e0d-b1b6-2b69ffb7f719
aospfhem/platform_frameworks_native
libs/input/InputDevice.cpp
#define LOG_TAG "InputDevice" #include <stdlib.h> #include <unistd.h> #include <ctype.h> #include <input/InputDevice.h> namespace android { static const char* CONFIGURATION_FILE_DIR[] = { "idc/", "keylayout/", "keychars/", }; static const char* CONFIGURATION_FILE_EXTENSION[] = { ".i...
TOOL
0.878946
6.857131
4b6d2917-264c-42f2-a1ec-f5303c2ff43f
ishandutta2007/codeforces
louhao088088/normal/372/B.cpp
// Problem: CF372B Counting Rectangles is Fun // Contest: Luogu // URL: https://www.luogu.com.cn/problem/CF372B // Memory Limit: 250 MB // Time Limit: 4000 ms // 2021-12-03 21:05:20 // Author : louhao088 // // Powered by CP Editor (https://cpeditor.org) #include<bits/stdc++.h> using namespace std; //static char buf[1...
ALGO
0.999575
3.999402
02857f42-72ea-4f29-9422-549ef3a68633
Alraaafi/OOP-All-concept-By-Cpp
37 Virtual Inheritance.cpp
#include<bits/stdc++.h> using namespace std; class base { public: int a; }; class d1:virtual public base { public: int b; }; class d2:virtual public base { public: int c; }; class derive:public d1, public d2 { public: void set() { cout<<"Enter A, B, C : "; cin>>a>>b>>c; } ...
TOOL
0.86184
3.624525
eac77503-b986-4cb3-a3a3-403c7cfb00c7
Rayhan-Ahmed108/Dynamic_Programming
subquence_sum.cpp
#include<bits/stdc++.h> using namespace std; int dp[1005][1005]; bool rec(int i, int sum, vector<int> &a, int m) { if (i == a.size()) { return sum == m; } if (dp[i][sum] != -1) return dp[i][sum]; return dp[i][sum] = rec(i + 1, sum + a[i], a, m) || rec(i + 1, sum, a, m); } int main() {...
ALGO
0.999996
4.149463
a11cf0c7-1378-4711-bd00-da7a3db032f5
kaushik-path/GIT_Cpp
CAP445_OOPs/polymorphismQ1.cpp
#include <iostream> using namespace std; class Area { protected: virtual void getArea()=0; // declaration of function }; class Rectangle:public Area { public: void getArea() { int w,h,res; cout<<"Enter height"<<endl; cin>>h; cout<<"Enter width"<<end...
TOOL
0.960281
4.968597
d7c37c45-b9f1-421c-bf3a-6284fb5af06b
nextpyp/ettk
src/Loop.cpp
#include <blitz/array.h> #include <blitz/tinyvec-et.h> #include <blitz/array/stencil-et.h> using namespace blitz; #include <string.h> #include <vtkMath.h> #include <vtkImageData.h> #include <vtkPointData.h> #include <vtkImageReader.h> #include <vtkStructuredPoints.h> #include <vtkStructuredPointsReader.h> #include <...
ALGO
0.996699
4.325021
92a541ac-a9b8-41fc-bb5f-6dd6fb44efcd
weihaoysgs/ssvio
thirdparty/g2o/g2o/types/sba/types_six_dof_expmap.cpp
#include "types_six_dof_expmap.h" #include "g2o/core/factory.h" #include "g2o/stuff/macros.h" namespace g2o { using namespace std; using namespace Eigen; G2O_REGISTER_TYPE_GROUP(expmap); G2O_REGISTER_TYPE(VERTEX_SE3:EXPMAP, VertexSE3Expmap); G2O_REGISTER_TYPE(EDGE_SE3:EXPMAP, EdgeSE3Expmap); G2O_REGISTER_TYPE(EDGE_...
ALGO
0.971581
5.274487
2799b110-6f27-404d-b385-e862a59a57c4
mlbismls/PSI_PRO
thirdparty/linux/boost/libs/graph/example/connected-components.cpp
int main() { using namespace boost; typedef adjacency_list < vecS, vecS, undirectedS > Graph; const int N = 6; Graph G(N); add_edge(0, 1, G); add_edge(1, 4, G); add_edge(4, 0, G); add_edge(2, 5, G); std::vector<int> c(num_vertices(G)); int num = connected_components (G, make_iterator_property_...
ALGO
0.97688
5.646402
5bc42abb-2105-4085-a576-8eee0d331a17
anurag-sketch/Practice-Questions
2114-maximum-number-of-words-found-in-sentences/2114-maximum-number-of-words-found-in-sentences.cpp
class Solution { public: int mostWordsFound(vector<string>& sentences) { int count=0; int mx=INT_MIN; for(int i=0;i<sentences.size();i++) { for(int j=0;j<sentences[i].size();j++) { if(sentences[i][j] == ' ') { ...
ALGO
0.999952
5.596841
11cc4410-f280-4b76-b055-46797f4eeccf
Agniv25/CSES-Problem_set
Introductory Problems/coin_piles.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; const int mod = 1e9 + 7; void solve(int a, int b) { if (b == a) { if (b % 3 == 0) { cout << "YES" << endl; return; } else { cout << "NO"...
ALGO
0.999891
4.785132
80a44423-da58-4452-8148-98f2a9381c2b
banimania/CompetitiveProgramming
Codeforces/1842B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef vector<ll> vll; #define REP(i, a, b) for (int i = a; i < b; ++i) #define REPV(i, a, b) for (int i = a; i >= b; --i) #define SCAN(a, n) for (int i = 0; i < n; ++i) cin >> a[i] #define PRINT(a) for (int i = 0; i < a.size(); ++i) { cout <<...
ALGO
0.999882
3.943699
64a1fc0a-8af2-4c22-9ddc-edc6232a635e
WeileiZeng/weilei_lib
dist.cpp
//Weilei Zeng, April 28 //return min weight of rows in C, which is the distance of the code //random window method is applied with default number of permutation 10. //#include "weilei_lib/my_lib.h" #include "dist.h" #include "lib.h" #include "mm_read.h" #include "mm_write.h" int common::min_wt_decoding(itpp::GF2mat C...
ALGO
0.999907
3.276232
81d986c8-b786-47f1-b880-51081203194a
Yosuamuliawan19/algorithm-bank
Uhunt/101.cpp
#include<iostream> // #include<stdio.h> #include<string> #include<cstring> #include<algorithm> #include<cmath> #include<cctype> #include<iomanip> #include<vector> #include<map> #include<queue> // #include <bits/stdc++.h> #define LL long long #define FOR(i,a,b) for(int i=a;i<=b;i++) using namespace std; vector<vecto...
ALGO
0.99851
3.776807
13c9267d-94a4-4957-85fd-bcefd345b9f1
shihan04/CP-codes
codeforces/912B.cpp
#include<bits/stdc++.h> using namespace std; int main() { long long int n,k,ans; cin>>n>>k; if(k==1){ cout<<n; return 0; } ans=1; while(ans<n) ans=2*ans+1; cout<<ans; }
ALGO
0.999858
3.48204
742ba6f5-c7e4-4608-94a4-87928e33717c
ruoyaow/cse428labs
lab3/HoldEmGame.cpp
/** * File: HoldEmGame.cpp * Author: Ruoyao Wen <EMAIL>, Wanzhou Liu <EMAIL>, Zherui Zhou <EMAIL> * Purpose: Implementation of HoldEmGame class and functions. */ #include "HoldEmGame.h" #include <tuple> const int SUCCESS = 0; // Number of cards each player should have const int playerCards = 2; // Number of cards...
ALGO
0.965885
6.144927
31ea6bd7-7903-455b-9fcd-303f8934459f
sinkyoungdeok/Algorithm
boj_code/2500/2566.cpp
#include <iostream> using namespace std; int main() { int num[10][10]; int max = 0; int maxi; int maxj; for ( int i =1 ;i <=9; i++) for (int j = 1; j <= 9; j++) { cin >> num[i][j]; if (max < num[i][j]) { max = num[i][j]; maxi = i; maxj = j; } } cout << max << endl << maxi << " " << m...
ALGO
0.999788
3.632302
30303899-64e6-4a67-9090-b4e683e63e21
Skrobson/PolishNumberPlateRecognitionSystem
3rdParty/opencv/sources/modules/cudaoptflow/src/tvl1flow.cpp
#include "precomp.hpp" #if !defined HAVE_CUDA || defined(CUDA_DISABLER) cv::Ptr<cv::cuda::OpticalFlowDual_TVL1> cv::cuda::OpticalFlowDual_TVL1::create(double, double, double, int, int, double, int, double, double, bool) { throw_no_cuda(); return Ptr<cv::cuda::OpticalFlowDual_TVL1>(); } #else using namespace...
ALGO
0.996937
6.259012
867b1b66-27d7-4973-8144-9e0607c67b98
OmPr366/Codeforces-Solution
gcd.cpp
#include <iostream> using namespace std; long long gcd(long long int a, long long int b) { if (b == 0) return a; return gcd(b, a % b); } long long lcm(int a, int b) { return (a / gcd(a, b)) * b; } int main() { int t, a, b; cin >> t; for (int i = 0; i < t; i++) { cin >> a >...
ALGO
0.999769
5.353599
56e3ecdd-4eef-4ca3-97d8-f37a30443fda
leen-neel/CPPWork
Practice/Bubble.cpp
#include <iostream> using namespace std; void bubble(int arr[], int n) { for (int i = 0; i < n - 1; i++) { for (int j = 0; j < n - i - 1; j++) { if (arr[j] > arr[j + 1]) { swap(arr[j], arr[j + 1]); } } } } int main() { in...
ALGO
0.999972
5.021833
730ce4c3-7e23-4e5a-b1ec-43e513bf4aa5
Abhishek120797/cpp-bootcamp
assignment 23-basics of c++/Q9.cpp
// Write a C++ program to find the maximum of two numbers #include <iostream> using namespace std; int main() { int num1, num2, max; cout << "Enter two numbers: "; cin >> num1 >> num2; max = num1 >= num2 ? num1 : num2; cout << "max number is " << max; return 0; }
ALGO
0.999749
4.46091
970d1cbe-256f-4700-94d2-3a96cf1b650e
M1v1savva/cp-algorithms
Algo/Sparse Table.cpp
#include <bits/stdc++.h> #define int long long #define pii pair<int, int> #define pb push_back #define ff first #define ss second #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define forn(i, x) for (int i = 0; i < x; i++) #define rforn(i, n) for (int i = x - 1; i >= 0; i--) #define pr...
ALGO
0.999977
3.871552
5d3a79ad-ff41-4dbc-87ca-68e6a8089896
t3rence/Image-segmentation
Program4/main.cpp
// main.cpp // Author: Terence Ho // // This is the driver of a linkedList that is used to find the image's // similar pixels and groups them together in linked lists. //--------------------------------------------------------------------------- #include "linkedList.h" #include "ImageClass.h" #include <iostream> using...
ALGO
0.996836
4.295692
637fcc92-b8e2-44ce-9174-6c78b2acde7e
anoobzg/qi
src/opencv/src/apps/traincascade/lbpfeatures.cpp
#include "opencv2/core.hpp" #include "opencv2/imgproc.hpp" #include "lbpfeatures.h" #include "cascadeclassifier.h" using namespace cv; CvLBPFeatureParams::CvLBPFeatureParams() { maxCatCount = 256; name = LBPF_NAME; } void CvLBPEvaluator::init(const CvFeatureParams *_featureParams, int _maxSampleCount, Size ...
ALGO
0.947521
6.213724
06b0edff-2d35-4eaa-831c-51ef1a3c7dbf
chanil4129/Algorithm_renewal
Baekjoon/1654/1654.cpp
#include <bits/stdc++.h> using namespace std; vector<int> v; int main(){ int K,N,t; cin>>K>>N; while(K--){ cin>>t; v.push_back(t); } sort(v.begin(),v.end()); // 이분탐색 long long left=1,right=v.back(); long long mid; long long num; long long ans=0; while(l...
ALGO
0.999977
4.2903
b91e08dd-b94f-45ca-97ca-74f158b3e6fd
alexandraback/datacollection
solutions_5686275109552128_1/C++/tastelikecoke/B.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ long long cases = 0; cin >> cases; for(long long c=0;c<cases;c++){ long long plates = 0; cin >> plates; vector<long long> vs; for(long long i=0;i<plates;i++){ long long tem...
ALGO
0.999964
3.806429
27255cc7-7c57-4790-a304-e61e63f20aee
YuWeihung/LeetCode
tree/104_二叉树的最大深度_easy.cpp
/* * @lc app=leetcode.cn id=104 lang=cpp * * [104] 二叉树的最大深度 */ #include "tree_node.h" #include <algorithm> using namespace std; // @lc code=start /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), ...
ALGO
0.999156
6.706106
c5475d28-7f0a-42f3-805d-5c68c2a98ef8
osugiw/customized_micropython
micropython/lib/pico-sdk/lib/tinyusb/hw/mcu/nxp/mcux-sdk/devices/MKV31F12810/mcuxpresso/startup_mkv31f12810.cpp
#if defined (DEBUG) #pragma GCC push_options #pragma GCC optimize ("Og") #endif // (DEBUG) #if defined (__cplusplus) #ifdef __REDLIB__ #error Redlib does not support C++ #else //***************************************************************************** // // The entry point for the C++ library startup // //********...
CONFIG
0.850028
7.513844
302dfc61-a4c6-46d8-a1ac-d51486694788
farshad-heravi/rflm_AKF_pkg
src/KalmanFilter.cpp
#include "KalmanFilter.hpp" KalmanFilter::KalmanFilter(int state_count, std::vector<double> x_init, std::vector<double> Q, std::vector<double> R, int camera_role, std::time_t current_time) : state_count_(state_count), prev_time_(current_time), camera_role_(camera_role) { // initiate x_k_ x_k_.resize(st...
ALGO
0.995823
5.995701
3827879d-326a-404a-9bfd-20e63a8afcfe
Olyadtemesgen/Flutter_Practice_Projects
stateful_authorization/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.998412
6.785645
6a7f4654-4e71-43ef-b843-e778b4179512
tjwjdgks/algorithm
프로그래머스/시저암호/lock.cpp
#include <string> #include <vector> using namespace std; string solution(string s, int n) { string answer = ""; for (int i = 0; i < s.size(); i++) { if (s[i] == ' ') { answer += ' '; continue; } int c = 0; int f = 0; if (s[i] >= 'a' && s[i] <= 'z...
ALGO
0.999943
5.458597
20adbd40-2c67-4efe-9402-0016e3b5e783
costadev00/neps_academy
Quadrado_Mágico_3_x_3.cpp
#include <bits/stdc++.h> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) using namespace std; typedef long long ll; typedef long double ld; #define endl "\n" #define debug(args...) cout << (#args) << " = " << (args) << endl #define MOD 1000000007 #define vi vector<in...
ALGO
0.99958
5.272322
eb1c3501-9e0d-4e9b-ad5a-60684445461c
DuNai0524/algorithm_solving
leetcode/editor/cn/LeetCode167.cpp
#include <bits/stdc++.h> using namespace std; //leetcode submit region begin(Prohibit modification and deletion) class Solution { public: vector<int> twoSum(vector<int>& numbers, int target) { int left = 0,right = numbers.size() - 1; while(left < right) { if(numbers[left] + numbers[rig...
ALGO
0.99981
6.167338
d97751f7-57b5-4209-867c-c968e6ab79f4
AERAFALASTRALIS/tk2
Object-Oriented Programming/nanotekspice/src/gate/GateOr.cpp
/* ** EPITECH PROJECT, 2021 ** gate ** File description: ** gate */ #include "GateOr.hpp" #include "AComponent.hpp" nts::GateOr::GateOr(Pin *output, Pin *input1, Pin *input2) : AGate(output), input1(input1), input2(input2) { if (this->input1) this->input1->setGate(this); if (this->input2) this...
ALGO
0.999533
5.571424
a36fb12f-18f0-4758-9604-9509f0e3515c
salilab/imp
modules/multifit/src/fft_based_rigid_fitting.cpp
#include <IMP/multifit/fft_based_rigid_fitting.h> #include <IMP/multifit/internal/fft_fitting_utils.h> #include <IMP/constants.h> #include <IMP/atom/pdb.h> #include <IMP/log.h> #include <IMP/algebra/geometric_alignment.h> #include <algorithm> #include <boost/lexical_cast.hpp> #include <boost/format.hpp> #include <boost...
ALGO
0.999524
6.52125
a0f388e8-fe6f-4e68-90ff-9effc460a425
MortyVI/clang
lib/Sema/SemaConcept.cpp
#include "clang/Sema/SemaConcept.h" #include "clang/Sema/Sema.h" #include "clang/Sema/SemaInternal.h" #include "clang/Sema/SemaDiagnostic.h" #include "clang/Sema/TemplateDeduction.h" #include "clang/Sema/Template.h" #include "clang/Sema/Overload.h" #include "clang/Sema/Initialization.h" #include "clang/Sema/SemaInterna...
ALGO
0.976937
7.871264
0cac85e6-586b-4622-8b32-ba7dbddde1fe
anuragkashyap302/DSA-C-
OOPS/menorymanamentopretaor.cpp
#include <iostream> using namespace std; int main() { int size; // variable declaration cout << "Enter the size of the array: "; cin >> size; // Input the size of the array int *arr = new int[size]; // creating an array with the specified size cout << "\nEnter the elements...
TOOL
0.936511
3.048379
37c48675-23df-4522-b5a3-6ad20182f908
hwhs/hackerrack
Practice/Tutorials/30_Days_of_Code_Challenges/Day20.cpp
//#include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } // Write Your Code Here int numSwaps = 0; for (int i = 0; i < n; i++) { // Track number of...
ALGO
0.999948
4.395669
15d4216c-f2c2-4af1-8c7e-4d4fc7d82fa9
Anurag-Singhal1/DSA_lovebabbar
ncr.cpp
#include<bits/stdc++.h> using namespace std; long long ncr(int n, int r){ long long res=1; for(int i=0;i<r;i++){ res = res*(n-i); res/=(i+1); } return res; } int main(){ int n = 6; int r = 2; cout<<ncr(n,r)<<endl; return 0; }
ALGO
0.999883
5.576052
4f32a823-78b7-4ac5-94a6-1b9579377755
bleetoteelb/algorithm_study
09_journey_to_the_money/main.cpp
#include <iostream> #include <stdio.h> #include <time.h> #include <math.h> #include <vector> #include <queue> using namespace std; #define mm(a,b) a<b?b:a #define co(a) a==0?1:0 // change order struct node{ int val; int group; vector<int> rel_up; vector<int> rel_down; // related node():group(-1){}; }; vector<...
ALGO
0.997532
3.376931