uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
c47e6a43-b73b-4492-b1d9-b333bc06e6ef
rajat1712/someusefulcodes
DynamicProgramming/SubsetSum/subsetSum.cpp
#include<iostream> using namespace std; int helper(int *arr,int n,int **output,int sum){ for(int i=0;i<n+1;i++){ output[i][0]=1; } for(int i=1;i<sum+1;i++){ output[0][i]=0; } for(int i=1;i<n+1;i++){ for(int j=1;j<sum+1;j++){ if(arr[n-1] > sum){ output[i][j]=output[i-1][j]; } else{ int x=o...
ALGO
0.99997
4.15834
97e190df-a409-45bb-b3fd-d31fa1d90195
alexandraback/datacollection
solutions_2755486_0/C++/tony412/pc-small.cpp
#include <stdio.h> #include <string.h> #include <algorithm> #define M 500 struct ATK { int d, s, l, r; } atk[200], atk2[200]; bool cmp(ATK arg1, ATK arg2) { return arg1.d < arg2.d; } bool cmp2(ATK arg1, ATK arg2) { return arg1.r < arg2.r; } int wall[1005]; int main() { int t, c = 1; int n, d, dd, s, ds, l, r, dp, ...
ALGO
0.998803
3.594324
93ad178f-9138-4d78-ae55-ac540138adbb
tarvarus/tarvarus-core
src/policy/rbf.cpp
#include <policy/rbf.h> #include <util/rbf.h> RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool) { AssertLockHeld(pool.cs); CTxMemPool::setEntries setAncestors; // First check the transaction itself. if (SignalsOptInRBF(tx)) { return RBFTransactionState::REPLACEABL...
ALGO
0.858655
7.295966
f06665f8-623e-49af-a2a5-b695780613f8
KunalNasa/DSA
recursion/reclec2.cpp
#include <iostream> using namespace std; int fibonacci(int num) { if (num == 0) { return 0; } if(num == 1) { return 1; } return fibonacci(num - 2) + fibonacci(num - 1); } int main() { int number; cin >> number; cout << fibonacci(number) << endl; int a = 0; ...
ALGO
0.999992
4.913013
eefc6b03-7454-4f95-8cea-4c9845fcceca
msr8/school
cpp/14-operator-overloading.cpp
#include <iostream> using namespace std; class Vector { public: int a,b,c; Vector(int x, int y, int z) {a=x, b=y, c=z;} Vector operator+(const Vector &other) { Vector result(0,0,0); result.a = this->a + other.a; result.b = this->b + other.b; result.c = this->c + other.c; ...
TOOL
0.90081
4.455888
a97f9400-ca78-4625-8a59-2e9a3153d9fc
igor-pavkov/honours-2024
Code Examples/DiverseVul Filtered/Vulnerable/ab4c767099f263a7cd4109bcdca80ee74210a769.cpp
int process_peer_commit (pwd_session_t *session, uint8_t *in, size_t in_len, BN_CTX *bnctx) { uint8_t *ptr; size_t data_len; BIGNUM *x = NULL, *y = NULL, *cofactor = NULL; EC_POINT *K = NULL, *point = NULL; int res = 1; if (((session->peer_scalar = BN_new()) == NULL) || ((session->k = BN_new()) == NULL) || ...
ALGO
0.996009
5.248554
44c09da0-45fa-4ebe-87da-0f1233b264c4
Ginakira/Code-Archive
Leetcode/LeetCode1189.cpp
// LeetCode 1189 气球的最大数量 #include <algorithm> #include <numeric> #include <string> #include <unordered_map> #include <vector> using namespace std; class Solution { public: int maxNumberOfBalloons(string text) { unordered_map<char, int> ch_cnt; for (char c : text) { ++ch_cnt[c]; ...
ALGO
0.999549
6.381884
de950b97-5370-4cd0-acfb-13ddfe921ae7
jatinbharadwaj/Bootcamp
Assignment/find_k_largest.cpp
class Solution { public: int findKthLargest(vector<int>& nums, int k) { sort(nums.begin(),nums.end(),greater<int>()); return nums[k-1]; } }; void trimLeftTrailingSpaces(string &input) { input.erase(input.begin(), find_if(input.begin(), input.end(), [](int ch) { return !issp...
ALGO
0.999665
4.812011
a0f70a8a-672d-46cd-9d6c-65d31df47eb5
Udittyagi07/100DaysOfCoding
Day 23 (Baseball Game).cpp
class Solution { public: int calPoints(vector<string>& operations) { int n = operations.size(); vector<int> score(n); int j=0; for(int i=0;i<n;i++) { if(operations[i]=="+") { score[j]=score[j-1]+score[j-2]; j...
ALGO
0.999781
6.384399
151c4324-f608-4395-9fbc-d62bb708c351
tnsgud/AlgorithmsWithCpp
src/baekjoon/implementation/10797.cpp
// // Created by qkrtn on 2022-03-16. // Link : https://www.acmicpc.net/problem/10156 #include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, arr[5], cnt=0; cin >> n; for (int & i : arr) { cin >> i; } for (auto i:arr) { ...
ALGO
0.999786
4.421175
ce381507-1d8b-49fb-9e06-246ecb3b2aae
dongheuw/ICPC-related
2015-summer/0715/i.cpp
#include <cstdio> #include <cstring> #include <algorithm> #define fo(i,a,b) for (int i = a;i <= b;i ++) using namespace std; int T,n; struct node { int a,b; bool operator <(const node &s)const{return a > s.a;} }A[100005]; int main() { scanf("%d",&T); fo(cs,1,T) { scanf("%d",&n); ...
ALGO
0.999693
4.146223
91bb3b33-ed1b-4f95-9680-3c8eb13d7652
omkarugale7/codeforces
contests/Codeforces Round #820 (Div. 3)/01.cpp
/* Editor: Omkar Ugale DATE - 12-Sep-2022 TIME - 20:02:06*/ #include <bits/stdc++.h> using namespace std; // typedef long long int ll; #define int long long int #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); void PrintArr(vect...
ALGO
0.999965
4.678214
ab08de8d-1a48-4aa2-a4aa-1acb0741bd51
shishirRsiam/CSE-Fundamentals-With-Phitron
3. Data Stracture/2. Mid Exam/Mid Try/3.stl.cpp
#include <bits/stdc++.h> using namespace std; int main() { list<string> myList; string val; while (true) { cin >> val; if (val != "end") { myList.push_back(val); } else { break; } } int n; cin >> n; auto it...
ALGO
0.999171
4.644006
c2131665-24fa-46b1-8546-6bb7373efd2e
careercup/CtCI-6th-Edition-cpp
Ch 4. Trees and Graphs/C++14/4.11-RandomNode.cpp
// Random Node: You are implementing a binary search tree class from scratch, which, in addition // to insert, find, and delete, has a method getRandomNode() which returns a random node // from the tree. All nodes should be equally likely to be chosen. Design and implement an algorithm // for getRandomNode, and explain...
ALGO
0.999295
5.15652
c09b15f0-5802-4d18-96d9-b55384ebf8a6
kuman514/StudyCPP
20160126PriorityQueue.cpp
#include <iostream> #define nullptr (Node<T>*)NULL // I think I misunderstood what Priority Queue means. // What Priority Queue means, I found, is a type of QUEUE, not a Binary Tree. // Later, my Heap will be added as soon as possible. template <typename T> struct Node { Node<T> *prev; T data; Node<T> *next; }; t...
ALGO
0.997724
4.975607
7f077dd7-789f-41c8-9b05-46b2e350b296
SnehilVukkusila/graph-resources
Leetcode Daily Challenge/August-2021/09. Add Strings.cpp
/* Add Strings =========== Given two non-negative integers, num1 and num2 represented as string, return the sum of num1 and num2 as a string. You must solve the problem without using any built-in library for handling large integers (such as BigInteger). You must also not convert the inputs to integers directly. Exam...
ALGO
0.9999
7.299816
bc1a7739-53fa-4903-a776-9432202828d0
Debashish-hub/INTERVIEW-KIT
DSA/SDE SHEET BY Striver_79/DAY 15/Roman_to_integer_and_vice_varsa.cpp
int romanToInt(string str) { map<char, int> m; m.insert({ 'I', 1 }); m.insert({ 'V', 5 }); m.insert({ 'X', 10 }); m.insert({ 'L', 50 }); m.insert({ 'C', 100 }); m.insert({ 'D', 500 }); m.insert({ 'M', 1000 }); int sum = 0; for (int i = 0; i...
ALGO
0.999628
5.825335
097a9c80-b954-41f8-a379-c372804f2086
ridzRUSH/codeForces
matching.cpp
#include<iostream> #include<string> using namespace std; int main(){ int n ; cin>> n; while (n--) { int ans =1; string s; cin>>s; if(s[0]=='0'){ ans=0; } for(int i=0 ;i< s.size();i++){ if(s[i]=='?'){ if( i== 0 ){ ...
ALGO
0.999867
3.503839
9b682031-b8de-4199-9f95-1cd0fda53488
Shrirangop/task
spiral.cpp
#include <bits/stdc++.h> using namespace std; void input_array(int*m,int*n, int arr[][50]){ cout<<"Input the elements of the matrix"<<endl; for(int i = 0;i<*m;i++){ for (int j=0 ;j<*n;++j){ cin>>arr[i][j] ; } } } void print_array(int*m,int*n,int arr[][50]){ //printing ar...
ALGO
0.999395
3.372626
5b183d4d-b3ac-42a1-b9f6-94c9c0bc51c8
glennychen/cp3
leetcode/CLionProjects/untitled78/main.cpp
// https://leetcode.com/problems/count-the-number-of-consistent-strings/ #include <iostream> #include <string> #include <vector> #include <unordered_map> using namespace std; int countConsistentStrings(string allowed, vector<string>& words) { unordered_map<char, bool> m; for(const auto& c:allowed) { m[...
ALGO
0.999154
6.163833
e6830594-4f3b-4ece-ba5c-133313174374
TheSlothThatCodes0/CodeForces-Problems
B_JoJo_s_Incredible_Adventures.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; #define ll long long #define YES cout << "YES" << endl #define NO cout << "NO" << endl #define vll vector<long long> #define endl "\n" #define int ll #define pb push_back int gcd(int a, int b) { if (!a || !b) return a | b; unsigned shif...
ALGO
0.999957
4.426324
87842b9e-cb28-4f0f-aa2c-5be84a1d35d4
N3RLUK/LB-C-PP
lab18/task1.cpp
#include <iostream> using namespace std; void increment(int &var) { // var посилання на змінну var += 1; } void increment(int &var, int value) { // коли збільшуєм var в функції ми змінюємо зміну яку ми передали а не її копію var += value; } int main() { int var = 0; ...
ALGO
0.990759
3.888275
c0cc650b-8380-4104-b22a-41af4a7186d5
schiob/OnlineJudges
CodeForces/cpp/499A.cpp
#include <iostream> #include <string> #include <cstdio> using namespace std; int main(){ int n, x, c = 0, l, r; cin >> n >> x; int ac = 1; while(n--){ cin >> l >> r; if(ac < l){ c += (l-ac)%x; } c += (r-l +1); ac = r+1; } cout << c << endl; return 0; }
ALGO
0.999719
3.259677
5dd0a165-e1ec-4271-acec-670db787ba6a
AndIG0/d
znaki_na_doroge.cpp
#include "pch.h" #include <iostream> #include <opencv2/opencv.hpp> #define NUMBER 2 using namespace std; using namespace cv; Mat frame; Mat mask; Mat hsv; Mat img; Mat FragmentC; vector<vector<Point> > contours; vector<Vec4i> hierarchy; vector <Mat> images(NUMBER); int main() { VideoCapture videoSource; if (!vide...
TOOL
0.97041
3.071149
be746b09-5a61-491d-a201-46e3180168bb
Mu-Ahmad/Uva-Solutions
ch2-problems/Linear-DS/date_bugs-700.cpp
#include <bits/stdc++.h> using namespace std; struct Info { int current, start, end; int difference() const{ return end - start; } }; int main(){ int n, x=1; bool same = true; while(cin >> n and n){ vector <Info> arr(n); int curr = 0; for (int i=0; i<n; i++){ cin >> arr[i].current >> arr[i]....
ALGO
0.998008
3.646922
2b08c166-4fc0-42e6-a1a3-02b49879c188
seo-bo/ProblemSolving
Atcoder/ABC354/A.cpp
#include <bits/stdc++.h> #include <unordered_map> using namespace std; typedef long long ll; typedef long double lb; int main(void) { ios::sync_with_stdio(false); cin.tie(0); int tall = 1; int n = 0; int result = 1; cin >> n; while (tall <= n) { tall += pow(2, result); result++; } cout << result; return...
ALGO
0.999962
4.391713
ecee2e68-3572-40ec-8631-dbd9ffd49628
waffledood/team08
src/ee4308_turtle/src/common.cpp
#include "common.hpp" #include <cmath> Index::Index() : i(0), j(0) {}; Index::Index(int i, int j) : i(i), j(j) {}; Position::Position() : x(0), y(0) {}; Position::Position(double x, double y) : x(x), y(y) {}; double sign(double value) { if (value > 0) return 1; else if (value < 0) return -1; ...
ALGO
0.999653
5.600437
fe2c1dfe-9c30-495f-bb92-ee4f8cb28cff
randlem/Class-Work
cs612/dijkstra.cpp
#include <iostream> using std::cout; using std::endl; #include <vector> using std::vector; struct vertex { int previous; int distance; } int main (int argc, char* argv[]) { return 0; }
ALGO
0.999194
3.119378
67558a98-4b4c-4c00-b17c-d159042494ee
ayush-kumar774/Competitive-Programming
Leetcode/JewelsandStones.cpp
// In the name of Aadi Shakti // You are everything and I am nothing // Jai Mata Di //https://leetcode.com/problems/jewels-and-stones/ #include <bits/stdc++.h> using namespace std; class Solution { public: int numJewelsInStones(string J, string S) { int cnt = 0 ; int len1 = J.size() ; i...
ALGO
0.999811
5.01013
2212ca7d-64ca-487a-992b-b946aa502880
Kashyapdevesh/My_A20J_Submissions
1300_ladder/Parallelepiped.cpp
#include<iostream> #include<cmath> using namespace std; int main(){ int x,y,z; cin>>x>>y>>z; int a,b,c; a=sqrt((x*y)/z); b=sqrt((x*z)/y); c=sqrt((z*y)/x); cout<<(a+b+c)*4; return 0; }
ALGO
0.999395
3.554736
83e09eab-e776-4878-9716-88b12eb6430e
khangmoihocit/DSA
DSA-sublimeText/0_baitap/1_set_map/bai5_kituxuathien.cpp
#include <bits/stdc++.h> using namespace std; int main() { int T; cin >> T; cin.ignore(); while (T--) { string s; getline(cin, s); map<char, int> freq; for (char c : s) { freq[c]++; } char result = '\0'; int maxFreq = 0; // D...
ALGO
0.999944
5.830687
fe232ece-c529-4b67-b721-e811e2e05fd1
baofuhann/FISCO_BCOS_FL
deps/src/boost/libs/fusion/example/performance/accumulate.cpp
#include <boost/array.hpp> #include <boost/timer.hpp> #include <boost/fusion/algorithm/iteration/accumulate.hpp> #include <boost/fusion/algorithm/transformation/transform.hpp> #include <boost/fusion/container/vector.hpp> #include <boost/fusion/algorithm/transformation/zip.hpp> #include <boost/fusion/sequence/intrinsic...
TEST
0.992451
6.407534
4e067267-0343-46ce-aec7-18a3cd5feed1
JZ226/DSA-Concept-Practice
DSA CODE/Circularlinklist.cpp
#include<iostream> using namespace std; class Node{ public: int data; int key; Node* next; Node(){ data=0; key=0; next=NULL; } Node(int d,int k){ data=d; key=k; } }; class Circularlinkedlist{ public: Node* head; Circularlinkedlist()...
ALGO
0.999879
4.524908
5daa4658-80a1-4a30-b57a-5b9def92afb4
haru210/atcoder
ABC333/B.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using pint = pair<int,int>; using pll = pair<long long, long long>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i,n) for (int i = 1; i <= (int)(n); i++) #define YesNo(bool) if(bool) cout << "Yes" << endl; else cout << "No" << end...
ALGO
0.999974
3.784732
10751147-85f9-4c65-b9fa-2c458ce6a1db
RinCloud/TrickCatcher
Datasets/TrickyBugs/GenProgs/tc_generated_progs_cpp/p03598/p03598_num1_parsed.cpp
#include <bits/stdc++.h> using namespace std; int main() { int N,K,x,sum=0; // Initialize sum to 0 cin>>N>>K; for(int i= 0;i<N;i++){ cin>>x; if(x>K/2){ // compare x with K/2 instead of K-x sum +=(K-x)*2; }else{ sum +=x*2; } } cout<<sum<<endl; ...
ALGO
0.999685
3.990194
2bb4ad38-0ee6-4202-aa8d-4fb92e99054f
Tasurron/Introduction-to-Programming
C++/odd even.cpp
#include<iostream> using namespace std; int main(){ int odd = 0,even = 0; int demo [10] = {12, 67, 3, 56, 23, 32, 81, 42, 16, 37}; for(int i=0;i<10;i++){ cout<<demo[i]<<" ";} cout<<endl; for(int i=0;i<10;i++){ if(demo[i]%2!=0){ odd++; //ODD NUMBERS }} cout<<"There are "<<odd<<" odd numbers"...
ALGO
0.989589
3.844211
c97be07f-b436-49dc-972a-cdf710af53ae
merego/scrippa
C++/NRinC302/legacy/nr2/CPP_211/examples/xvander.cpp
#include <iostream> #include <iomanip> #include "nr.h" using namespace std; // Driver for routine vander int main(void) { const int N=5; const DP x_d[N]={1.0,1.5,2.0,2.5,3.0}; const DP q_d[N]={1.0,1.5,2.0,2.5,3.0}; int i,j; DP sum=0.0; Vec_DP w(N),term(N),x(x_d,N),q(q_d...
ALGO
0.999697
3.582993
715c1242-022e-4a39-a4a4-2f3ba9526ca1
0point1Zishan/CP
DSA Practice/Number_Theory/Practice/E_Segments_with_Small_Set.cpp
#include<bits/stdc++.h> using namespace std; #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define MOD 1000000007 #define MOD1 998244353 #define INF 1e18 #define nline "\n" #define pb push_back #define ppb pop_back #define mp make_pair #define ff first #define ss second #define int lon...
ALGO
0.999965
4.833487
66850abb-4c6f-4aa0-b658-d31f32199e8a
Remyuu/GAMES202-Homework
HW2/prt/ext/eigen/bench/sparse_lu.cpp
// g++ -I.. sparse_lu.cpp -O3 -g0 -I /usr/include/superlu/ -lsuperlu -lgfortran -DSIZE=1000 -DDENSITY=.05 && ./a.out #define EIGEN_SUPERLU_SUPPORT #define EIGEN_UMFPACK_SUPPORT #include <Eigen/Sparse> #define NOGMM #define NOMTL #ifndef SIZE #define SIZE 10 #endif #ifndef DENSITY #define DENSITY 0.01 #endif #ifnd...
ALGO
0.998355
4.187482
e72c51b0-e3d6-4c31-842a-6baccc70ff53
mayuravaani/Basic2Adv
PracticeExamples/Untitled1.cpp
#include "gift.h" const int MAX_N = 500000; int sef[MAX_N]; int myfind(int x) { if(x == sef[x]) return x; sef[x] = myfind(sef[x]); return sef[x]; } void myunion(int a, int b) { int sa = myfind(a), sb = myfind(b); if(sa != sb) sef[sb] = sa; } int construct(int n, int r, std:...
ALGO
0.998516
3.819866
55c13e93-27f7-476c-bec6-601bd568ba6f
kurbanovxurshidbek/flutterdev-lesson23
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.998784
6.761023
b83a755e-0548-4a5b-a103-0bf65c1cf8a7
yasheshoffgithub/DSA_revision_byA2ZSheet
array/easy/maxconsectivesOnes.cpp
#include "../bits/stdc++.h" using namespace std; class Solution { public: int findMaxConsecutiveOnes(vector<int> &nums) { int i = 0; int j = 0; int ans = 0; while (i <= j && j < nums.size()) { while (j < nums.size() && nums[j] == 1) { ...
ALGO
0.999889
5.767194
2db4ba71-af03-4d74-bb5e-6f83f7e13420
kseokc/algorithm
백준/그래프 탐색/bfs/구슬탈출 2.cpp
// // Created by 김석찬 on 2023/02/01. // #include<iostream> #include<vector> #include<queue> using namespace std; int xn[] = {0, 0, -1, 1}; int yn[] = {-1, 1, 0, 0}; int N, M; char map[11][11]; bool visit[11][11][11][11]; void move(int &RX, int &RY, int &dis, int &i) { while (map[RY + yn[i]][RX + xn[i]] != '#' &...
ALGO
0.999868
4.625703
b7706df7-f122-4075-bcab-eb1b390b1a88
sieg-zeon/algo-method
さまざまなアルゴリズム設計技法/二分探索/6.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep3(i, m, n) for(int i = (m); i < (int)(n); i++) #define ALL(x) x.begin(), x.end() #define debug(var) \ d...
ALGO
0.999984
4.034722
58461ccb-f33a-4b35-972c-9ef64e9d51b7
tushargautam3112/Application-Club-Potd
w4/d23/happyNumber.cpp
class Solution { public: int sumofDigits(int num){ int digit=0; while(num>0){ digit += (num%10)*(num%10); num = num/10; } return digit; } bool isHappy(int n) { int sum=n; while(sum!=1){ sum=sumofDigits(sum); if(s...
ALGO
0.999987
6.383956
5d2ace04-39f9-46e8-8352-1150651507a6
jsoncodez/leet-Program
leet-H-Index/main.cpp
#include <iostream> #include <vector> #include <map> #include <algorithm> using namespace std; class Solution { public: int hIndex(vector<int>& citations) { // order greatest to lowest int n = citations.size(); sort(citations.begin(), citations.end(), greater<int>()); co...
ALGO
0.999807
5.96379
88a097d6-222a-4490-9b25-aed10e89732f
0xm4yo/compro
atcoder/tessoku-book/cpp/A08.cpp
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; using ull = unsigned long long; #define rep(i, a, b) for(ll i=a; i<b; i++) #define rrep(i, a, b) for(ll i=a; i>=b; i--) #define all(a) (a).begin(), (a).end() #define YesNo(bool) if(bool){cout<<"Yes"<<en...
ALGO
0.999532
4.718832
e15de40e-4b04-4057-a750-7111cfa06ae7
raincross7/code-similarity
codes/train_code/problem132/problem132_256.cpp
// 答えを見た #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; #define int ll #define REP(i,n) for (int i = 0; i < (n); ++i) #define FORE(i, s, n) for (int i = (s); i <= (int)(n); i++) #define debug(x) cerr << #x << ": " << x << '\n' #define hyphen() cerr << "--\n" #define ALL(...
ALGO
0.999982
4.214264
80c30831-b371-4e2c-b0eb-cfbf78d6126b
ishandutta2007/codeforces
aidos/normal/769/C.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <set> #include <map> #include <queue> #include <ctime> #define pb push_back #define ll long long #define mp make_pair #define f first #define s second #define pii pair < int, int ...
ALGO
0.999986
3.734707
a2882538-cf0b-4f04-bf45-e366b6b173b0
guilimadev/lp1_202101
filter/src/function.cpp
/*! * Remove negative and zero values from an array, preserving the * relative order of the original values that will remain in the * resulting array. * We do not alter the origimal memory associated withe the input * array. Rather, we just rearrange the values inside the array * and return a pointer to the new ...
ALGO
0.996301
4.942141
62de28b2-200b-487e-8052-465637487cdd
sosamsony/Leetscode-solutions
861-score-after-flipping-matrix/861-score-after-flipping-matrix.cpp
class Solution { public: int matrixScore(vector<vector<int>>& mat) { int res = 0; int n = mat.size(); int m = mat[0].size(); // Find the final matrix whose rows will give us the maximum possible score // Try to make the significant bit 1's ...
ALGO
0.999984
6.616763
36f48fa3-5e00-4c61-93e6-977b4be232ac
ustcyyw/algorithm
luogu/math/number_theory/CF1029D.cpp
/** * @Time : 2024/4/22-8:53 AM * @Author : yyw@ustc * @E-mail : <EMAIL> * @Github : https://github.com/ustcyyw * @desc : */ /* * 两个数拼接后的数 num = num1 * d + num2 d就是num2的数位 * num % k = num1 * d % k + num2 % k * num % k = 0 * 就相当于 num1 * d % k + num2 % k = k 或者 0 * 因此可以统计num1 * d % k的值(d从1到10)出现了几次 * ...
ALGO
0.999938
4.166252
203d8019-92fb-4572-b1bd-09fd7a0c7cbe
modulabs/gdyn-legged-locomotion
legged_robot_dependencies/qpOASES/testing/cpp/test_example5.cpp
/** * \file testing/cpp/test_example5.cpp * \author Andreas Potschka, Christian Kirches * \version 3.1 * \date 2011-2015 * * Very simple example for testing qpOASES (using the possibility to * compute the local linear feedback law) */ #include <stdlib.h> #include <qpOASES.hpp> #include "../../examples/exampl...
ALGO
0.912647
5.853859
d9f1c6a9-e085-4fea-8f7a-aa0445c718ef
polyester-CTRL/procon-archive
atcoder.jp/arc059/arc059_a/Main.cpp
#include<iostream> #include<algorithm> #include<vector> #include<functional> #include<string> #include<cmath> #include<map> #include<set> #include<queue> #include<stack> #include<cstdio> #include<numeric> using namespace std; using ll = long long; int main(){ int n; cin >> n; vector<int> a(n); for(int i = 0; i ...
ALGO
0.999859
4.318971
6ec5ff67-6502-40f6-a3b1-322cb49c9071
MichalMrena/DecisionDiagrams
examples/soft_x.cpp
#include <libteddy/reliability.hpp> #include <array> #include <iostream> #include <vector> int main() { using namespace teddy::dpld; using namespace teddy::ops; using mdd_t = teddy::mss_manager<3>::diagram_t; teddy::mss_manager<3> manager(3, 100); mdd_t x0 = manager.variable(0); mdd_t x1 = manag...
ALGO
0.998536
5.776929
756fac44-8f14-4059-a633-c8119686a93f
raihanuldev/Algorithms
Bellman Ford Algorithm/bellman-ford.cpp
#include <bits/stdc++.h> using namespace std; class Edge { public: int a, b, c; Edge(int a, int b, int c) { this->a = a; this->b = b; this->c = c; } }; int dis[1005]; int main() { int n, e; cin >> n >> e; vector<Edge> edge_list; while (e--) { int a,...
ALGO
0.99997
4.0269
e48643ee-7239-4006-96c0-a51ee2258e09
Imonuil12/CSC240-C-Projects
Module_2/Classwork_code/longest_string.cpp
// Find the longer of two input strings #include <iostream> #include <string> using namespace std; int main() { string str1; string str2; string longest; getline(cin, str1); getline(cin, str2); // Initially assume the first string is longest. longest = str1; // Change "longest" if t...
ALGO
0.951569
4.564165
98ffebe8-c9bc-4ac0-9dfa-59ced2e847a1
ArshiyaArora/DSA
Distance_of_nearest_cell_having_1 .cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function to find distance of nearest 1 in the grid for each cell. vector<vector<int>>nearest(vector<vector<int>>grid) { int n=grid.size(); int m =grid[0].size(); vector<vector<i...
ALGO
0.999947
6.134799
cf802952-c4eb-4eff-bf21-404692f86202
ramkumar142002/Leetcode-Solutions
518-coin-change-ii/coin-change-ii.cpp
class Solution { public: // int ret(vector<int>& coins,int ind,int amount,vector<vector<int>> &dp){ // if(amount==0) return 1; // if(amount<0)return 0; // if(ind<0)return 0; // if(dp[ind][amount]!=-1) return dp[ind][amount]; // int take=ret(coins,ind,amount-coins[ind...
ALGO
0.999943
5.763759
3f34664e-0aa7-4666-8268-9786da9ac173
AiC-Project/platform_system_core
libutils/JenkinsHash.cpp
/* Implementation of Jenkins one-at-a-time hash function. These choices are * optimized for code size and portability, rather than raw speed. But speed * should still be quite good. **/ #include <utils/JenkinsHash.h> namespace android { hash_t JenkinsHashWhiten(uint32_t hash) { hash += (hash << 3); hash ^...
ALGO
0.991958
7.014037
5fce359a-58df-455a-937b-34c611abacae
Abhishek-Gupta-1/Basic-DSA-Problems-using-CPP
28_printing_star_pattern_21.cpp
// 28_printing_star_pattern_21 /*To print :- 1 22 333 4444 55555 */ #include<iostream> using namespace std; int main(){ int i=1,n; cout << "Enter Number of line/row : "; cin >>n; while (i<=n) { int j = n-i, k = i; while (j>0) { cout ...
ALGO
0.999564
4.410711
4f32cf5b-6898-4be3-87a9-755a2c593d67
alexandraback/datacollection
solutions_5652388522229760_1/C++/stetsyk/main.cpp
#include <bits/stdc++.h> #define F first #define S second using namespace std; typedef long long ll; const int N = 2e5 + 5; const int mod = 1e9 + 7; const int inf = 1e9 + 9; int main() { freopen("A-large.in", "r", stdin); freopen("output.txt", "w", stdout); int T; cin >> T; for(int qw = 1; qw <= T;...
ALGO
0.999348
5.299881
7aec3883-f248-45ee-924e-88cd4104ad0f
gafeol/competitive-programming
Contests/BrasilCC/cataratas.cpp
#include <bits/stdc++.h> using namespace std; #define fst first #define snd second typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> pii; #define pb push_back #define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++) #ifndef ONLINE_JUDGE #define debug(args...) fprintf(st...
ALGO
0.999997
3.626592
82175a1c-d5bc-4c9d-9058-c3aa8ecb6653
kanghyejong1001/SW-Academy
[CodingTest] programmers/2023_01/20230111.cpp
// [하] 중요한 건 꺾이지 않는 마음 1 #include <iostream> using namespace std; int main(void) { int T; cin >> T; for(int i = 0; i < T; i++){ int n, sellPrice, buyDate; cin >> n >> sellPrice >> buyDate; // 날짜별 주가 저장 int stock[n + 1]; for(int j = 1; j <= n; j++){ ...
ALGO
0.999956
4.019318
99034601-06f6-4b6a-93fa-de953c507a5b
KaustubhKarnam/Segway-Implementation
func_segway.cpp
/* Introduction to Scientific Programming, Programming project, 2019/2020 */ /* (c) Matthias Braendel, 2019 */ /* func_segway.cpp */ #include <vector> #include "func.h" void f_segway( unsigned int m, const std::vector<double> &yt, const...
ALGO
0.999248
4.445743
4dada839-d683-4561-9e91-db3851fd331a
masterchef2209/coding-solutions
codes/cses/1642.cpp
/*Read the problem carefully before starting to work on it*/ #include <bits/stdc++.h> //#include <boost/multiprecision/cpp_int.hpp> //using namespace boost::multiprecision; //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> using namespace std; //using namespace __gnu_pbds; typedef lo...
ALGO
0.999976
3.874436
d705dd28-4516-4d4b-ae31-cb0dee016623
Jafrin-khan/Practice
Maximum Sum Combination - GFG/maximum-sum-combination.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: vector<int> maxCombinations(int n, int k, vector<int> &a, vector<int> &b) { set<pair<int,int>> st; priority_queue<pair<int , pair<int,int>>> pq; //<sum , <i , j>> ...
ALGO
0.99999
5.589452
57bcdf49-4419-487e-8b97-04c613f42314
Manan21st/Advanced_DSA_and_CSES
SegmentTreeTemp.cpp
#include <iostream> #include <bits/stdc++.h> #define int long long #define mod 1000000007 using namespace std; template<typename T> class SegmentTree{ public: int N; T identity; vector<T> tree; SegmentTree(int n,T identity){ N = n; this->identity = identity; tree.assign(4*N,id...
ALGO
0.997822
3.480267
a3ba7b99-601b-4372-a935-288e91e910b2
devartstar/Algorithms
contest/virtualContest/contest3/b.cpp
/* ------------------------------------- | | | Author - Devjit Choudhury | | Date - ___curd___ | | Time - __curt__ | | | ------------------------------------- */ #include <bits/stdc++.h> using namespace std; #define ar array #define ll long long #define vi vector<int> #define pii pa...
ALGO
0.999475
4.209531
e1612051-408d-4559-882e-78a651204e1d
viiku/competitive-programming-problems
codechef/ADDREV.cpp
#include<bits/stdc++.h> using namespace std; using ll=long long int; int reverse_num(int num){ int rev_num=0; while(num>0){ rev_num=rev_num*10+num%10; num/=10; } return rev_num; } int main(){ int t,x,y;cin>>t;while(t--){ cin>>x>>y; int k=reverse_num(x)+reverse_num(y);...
ALGO
0.999946
5.369637
f64aa074-9fb4-464a-9092-2b2ffee68369
15969687923/JiangWeiyan2024-1
Historical Code/HDU OJ Test/蟠桃记 .cpp
#include<stdio.h> int main(){ int n,m,i; while(scanf("%d",&n)!=EOF){ m=1; for(i=1;i<n;i++){ m=(m+1)*2; } printf("%d\n",m); } return 0; }
ALGO
0.999797
3.344218
4a0923f2-1937-4ad7-9712-1074a420468e
ValentinaCherniaevskaia/2LAB_C-
task_C.cpp
#include<iostream> #include<vector> #include <sstream> using namespace std; template <typename T> void print_vector (vector<T>& v){ auto i = v.begin(); while(i != v.end()){ cout << *i << " "; i++; } cout << "\n"; } int main() { string s; getline(cin, s); vector<char> v(s.begi...
ALGO
0.999823
4.359302
a1488cf1-c767-45b0-b842-8ac7a28362c3
gamesburner/IT-DSA-SEM3
heapSort.cpp
#include <iostream> using namespace std; void heapify(int arr[], int n, int i) { 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 (largest != ...
ALGO
0.99991
5.450368
eacf4b04-f5e4-408c-b97a-5571fbfb44cc
cakuang1/codeforces
codeforces/graphs/shortest.cpp
#include<bits/stdc++.h> using namespace std; //{ #define si(a) scanf("%d",&a) #define sii(a,b) scanf("%d %d",&a,&b); #define siii(a,b,c) scanf("%d %d %d",&a,&b,&c); #define sl(a) scanf("%lld",&a) #define sll(a,b) scanf("%lld %lld",&a,&b); #define slll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c); #define outi(a) printf("...
ALGO
0.999976
3.641818
7086e2b8-936b-4988-8f90-48e2c6cc7913
Oxmose/SATSolver
dev/src/SMTGenerator/randomSMTEGen.cpp
/* ** ** Random SMTE formula generator ** */ // STD INCLUDES #include <iostream> // std::cin std::cout #include <algorithm> // std::transform #include <string> // std::string #include <cstdlib> // std::srand std::rand #include <ctime> // std::time #include <fstream> // std::ofstream #include <...
TOOL
0.947388
4.946183
d02f9102-bf8f-4915-a85e-8e4515212f52
andrewrong/Interview
stringToInt/atoi.cpp
#include <cstring> #include <iostream> #include <fstream> #include <cmath> using namespace std; int atoi(const char* lhs) { char strInt[20] = {0}; int length = strlen(lhs); bool hasSigned = 0; int result = 0; int i = 0; for(i = 0; i < length && isspace(lhs[i]); i++) ; cout << "i:" ...
ALGO
0.93396
3.981011
781af734-8f3f-4403-ba14-1a50f5c6e78c
HC-Chang/LeetCode
complete/3375.minimum-operations-to-make-array-values-equal-to-k.cpp
/* * @lc app=leetcode id=3375 lang=cpp * * [3375] Minimum Operations to Make Array Values Equal to K */ // @lc code=start class Solution { public: int minOperations(vector<int> &nums, int k) { unordered_set<int> s; int min_val = INT_MAX; for (auto x : nums) { if ...
ALGO
0.999755
5.95611
7af06a7f-0b8a-49e4-baa2-96f74f73f24b
KerubinDev/exercicioCondicionaisEmC-
exercicio13.cpp
#include <iostream> //Nota int main(){ int nota1, nota2, nota3, total, presenca, recu, situ, final; printf("Nota 1: "); scanf("%d", &nota1); printf("Nota 2: "); scanf("%d", &nota2); printf("Nota 3: "); scanf("%d", &nota3); printf("Presença: "); scanf("%d", &presenca); total = ...
TOOL
0.93633
3.543203
1310df7b-bbcb-4196-88bf-0d4e5ee61127
whitebookes/UVA-practice
Vito's Family.cpp
#include<iostream> #include<string> #include<algorithm> using namespace std; int main(){ int c = 0; int tmp = 0; cin >> c; int ans[1000]; for (int a = 0; a < 1000; a++)ans[a] = 0; while (c--){ int sn = 0; int md=0; cin >> sn; int s[501]; for (int b = 0; b < 501; b++)s[b] = 0; for (int i = 0; i < ...
ALGO
0.999872
3.337241
2b845706-ad41-4f99-a17f-7236382dd906
seungchan-mok/solvedPS
boj_1920.cpp
#include <iostream> #include <algorithm> #include <cstdio> using namespace std; int arr[100002]; bool bi_search(int st, int end, int key) { int mid = ((end + st) / 2) +1; if (arr[st] == key) return true; if (arr[end] == key) return true; if (arr[mid] == key) return true; if (st>=end) return false;...
ALGO
0.999993
4.555238
b4d1d5c2-4a6d-4f6f-8a6f-797cb1264ec0
TH-takahirohara/atcoder_solve
abc340/c_divide_and_divide.cpp
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; typedef long long ll; typedef unsigned long long ull; #define rep(i,a,b) for(int i=a;i<b;i++) #define fore(i,a) for(auto &i:a) // 桁数指定: cout << fixed << setprecision(10) map<ull,ull> mp; ull rec(ull n) { if (mp.count(n)) {...
ALGO
0.999982
5.006968
6d11d527-d8c6-4867-8cb6-e4b017602a6c
Ongvn/olpiuhTutorial
b.cpp
#include<bits/stdc++.h> using namespace std; int a[100009]; int b[100009]; int main(){ int n, x, y, d; scanf("%d",&n); while(n--){ scanf("%d %d %d",&x,&y,&d); a[x] += d; b[y+1] += d; } int s=0, ma=0; int i=0; while(i<=100000){ while(i<=100000 && !(a[i] || b[i]...
ALGO
0.999878
3.982738
c05e9eb1-840b-484c-b80e-906c5ffef60b
Kimseongju7/2023_Jeonghyegyung_C
HW47.cpp
/*ۼ : 輺 HW */ #include <stdio.h> #pragma warning (disable : 4996) //scnaf void input(double* pary, int size); double serchmax(double* pary, int size); double serchmin(double* pary, int size); void output(double max, double min); int main(void) { //TODO double ary[5]; double max, min; int size = sizeof(ary) / si...
ALGO
0.999626
3.327196
b385d9f7-7ff2-48cd-932d-ccb144fa683a
Mikha1lSorokin/parallel-algorithms
Lab17.cpp
#include <mpi.h> #include <stdio.h> void print_arrays(float a[], char b[]) { int i; for (i = 0; i < 9; i++) { printf("%.0f,", a[i]); } printf("%.0f]. b: [", a[9]); for (i = 0; i < 9; i++) { printf("%c,", b[i]); } printf("%c].\n", b[9]); } int main(int argc, char **a...
ALGO
0.99579
3.371275
e0fa0a93-8e0a-4b3f-9056-37ddccf62086
paul2705/OI
contact/EFZ/18.11.6/2018.11.06成七/source/HSEFZ-姜兆祥/color.cpp
#include<bits/stdc++.h> #define MAXN 100005 using namespace std; int n,m; int p[MAXN]; vector<int> c[MAXN]; vector<int> G[MAXN]; int d[MAXN]; int fa[18][MAXN]; void dfs(int u,int p){ d[u]=d[p]+1; fa[0][u]=p; for(int i=0;i<(int)G[u].size();i++){ int v=G[u][i]; if(v==p) continue; dfs(v,u); } } int lca(in...
ALGO
0.999929
4.056768
c4f7f621-7a2c-4a40-939f-213313eaad4f
braxbeckman/cs101
week8/w8q5.cpp
#include <iostream> #include <limits> #include <vector> using namespace std; vector<char> t1{'A', 'B', 'C'}; vector<char> t2{}; vector<char> t3{}; bool win = false; int source, dest; void display(); void selection(); void move(); int main() { // A really tidy main, simply calls the three functions responsible for ...
ALGO
0.9903
5.329646
7604e1f7-2862-43a2-870e-b79559e242b0
YoLynx/Daily-DSA-Dose
Graphs/medium/Dijsktra algo/Dijsktra_min_heap.cpp
//Problem Link : https://www.geeksforgeeks.org/problems/implementing-dijkstra-set-1-adjacency-matrix/1 // User Function Template class Solution { public: vector<int> dijkstra(int V, vector<vector<int>> &edges, int src) { // Code here priority_queue<pair<int, int>, vector<pair<int, int>>, greater<...
ALGO
0.99983
5.537075
0fd6b822-c202-4092-ab44-99adbc8809ef
Gaolious/algorithm
UVA-Online/Volume_001/162/src/162.cpp
#include <stdio.h> #include <string.h> #include <stdlib.h> /* Simulation player [26] 2 7 12 3 13 14 3 13 4 5 3 2 8 11 9 13 9 10 7 12 7 4 5 13 4 14 table [ 0] dealer [26] 2 10 8 10 12 14 9 9 12 11 7 2 8 6 6 8 10 6 11 4 11 5 6 5 14 3 =>player [25] 7 12 3 13 14 3 13 4 5 3 2 8 11 9 13 9 10 7 12 7 4 5 13 4 14 ...
ALGO
0.970843
3.484743
3ef91b8e-c3c9-40c0-8379-2ded7b96e44a
jybill01/optimization
venv/Lib/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/libs/program_options/src/winmain.cpp
#define BOOST_PROGRAM_OPTIONS_SOURCE #include <boost/program_options/parsers.hpp> #include <cctype> using std::size_t; #ifdef _WIN32 namespace boost { namespace program_options { // Take a command line string and splits in into tokens, according // to the rules windows command line processor uses. // ...
TOOL
0.970537
6.206842
13ed40b9-e95e-4336-ac66-f6f5f1488259
agrawalsajal02/Interviews-Preparation-and-Cp
Old CP repo competetive-coding/4 month -coding challange/3 part - graph theory -18mar-28 mar/practice.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a[n]; for(ll i=0;i<n;i++){ cin>>a[i]; } int count=0; for(ll i=0;i<n;i++){ cin>>a[i]; } map<int,int>s; for(ll i=0;i<n;i++){ for (auto itr = mp.find(3); itr != mp.end(); itr++) cout << itr->first if(a[i]>i+1){ s[a[i]]++; co...
ALGO
0.999858
3.014121
235ad358-bd87-4ea4-811f-05e39c2a0e6d
raincross7/code-similarity
codes/train_code/problem061/problem061_102.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <climits> #include <cstdlib> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define DEBUG 1 using namespace std; constexpr int kMod = 1000000007; typedef long lo...
ALGO
0.999868
4.548147
9e685763-84c9-4d4b-98a4-b1147ad7c324
sccluisx/tests
seecer/repo_ver/SEECER/ext/seqan/demos/tutorial/pairwise_sequence_alignment/alignment_global_overlap.cpp
//![main] #include <iostream> #include <seqan/align.h> using namespace seqan; int main() { typedef String<char> TSequence; // sequence type typedef StringSet<TSequence> TStringSet; // container for strings typedef StringSet<TSequence, Dependent<> > TDepString...
ALGO
0.995149
5.506613
b6650732-db1e-4c7b-b40d-389f85da58b8
prathmesh0/DSA
countno.cpp
#include<iostream> using namespace std; int main(){ int neg=0,pos=0,zero=0,n,i; cout<<"How many no.do you want to entered:"<<endl; cin>>n; int arr[n]; cout<<"enter a number"<<endl; for ( i = 0; i < n; i++){ cin>>arr[i]; } for(i=0;i<n;i++){ if(arr[i]<0){ neg++; ...
ALGO
0.999043
3.813181
4abc87c8-45fb-4289-ac35-4a3e6d34e0ae
Alpha4952/Competitive-Programming-Code
Backtracking 2/12. Ngoac/Ngoac.cpp
#include <bits/stdc++.h> using namespace std; long long n, eh[100001], c; bool check() { if (eh[1] == 1) return false; long long opens = 0; for (int i = 1; i <= n; i++) { if (eh[i]) opens--; else opens++; if (opens < 0) return false; } return opens == 0; } void print() { ...
ALGO
0.999767
4.139079
f6b5d9ba-2902-45af-af90-4a4600367753
yujiaoki/competitive-programming
???/abc096b.cpp
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) #define FOR(i,start,end) for(int i=start;i<=end;i++) const int INF = 1001001001; typedef long long ll; const ll MOD=1000000007; using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class ...
ALGO
0.999979
3.668043
55707e73-bca2-40b6-8b2d-58d4780df202
reikux/hello-world
zadanie 1.3.cpp
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. ******************************************...
ALGO
0.989321
3.540992
a4e2d878-9a95-4876-a9f5-c15b22a8b17a
shivendrasaurav/Data-Structures-CPP
singlyLinkedListDemo.cpp
#include<iostream> #include<conio.h> #include<stdlib.h> using namespace std; struct sll{ int data; struct sll *next; }; typedef struct sll node; node *ptr, *head; void insert(int data, node *ptr){ while(ptr->next) ptr->next = ptr; node *newnode = (node*)malloc(sizeof(node)); newnode->data = data; newnode->ne...
ALGO
0.999283
3.387558
2c1c45fe-5e9c-462b-917e-39737c6fbc7f
kishanrajput23/Wipro-Unix-CPP-Systems
Self Practice/Sum Of Series Questions/09.cpp
#include<iostream> #include<stdio.h> #include<math.h> using namespace std; int main() { int i,j,p=1,n,reverse; cout<<"We have to print the given pattern or series given below"<<endl; cout<<"12345"<<endl; cout<<"5432"<<endl; cout<<"234"<<endl; cout<<"43"<<endl; cout<<"3"<<endl; co...
ALGO
0.999925
4.30174
d4d2d4fc-ea9f-42c6-be69-0c7356281e38
Vaibhav-22-dm/Cpp-Codes
Sliding Window/sub_array_with_max_sum.cpp
#include <bits/stdc++.h> using namespace std; int max_sum(int a[], int ws, int size){ int sum = 0; int sumi = 0; int i = 0; for(int j = 0; j < size; j++){ if(j-i<ws){ sum+=a[j]; sumi = sum; } else{ sumi = sumi + a[j] - a[i]; if(sum...
ALGO
0.999939
4.41494
d773a54a-32fa-4943-b653-d2257c618b05
AKASH-ALAM/Competitive-Programming
Number Theory/GCD and LCM.cpp
#include <bits/stdc++.h> using namespace std; int GCD(int a, int b){ return b == 0 ? a : GCD(b , a % b); } int LCM(int a, int b){ return (a / GCD(a, b)) * b; } int main(){ int a, b; cin >> a >> b; cout << "GCD is : " << GCD(a, b) << endl; cout << "LCM is : " << LCM(a, b) << endl; return 0; ...
ALGO
0.999665
4.589209