uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
4319e99e-430f-488a-b9fa-c59d5b4954df
fujicoin/fujicoin
src/rpc/server.cpp
#include <fujicoin-build-config.h> // IWYU pragma: keep #include <rpc/server.h> #include <common/args.h> #include <common/system.h> #include <logging.h> #include <node/context.h> #include <node/kernel_notifications.h> #include <rpc/server_util.h> #include <rpc/util.h> #include <sync.h> #include <util/signalinterrupt....
WEB
0.950528
7.639107
aae0a4da-df56-4b0a-bfd8-c4d914a179de
neuroagents-lab/2025-tactile-whisking
whisker-sim/whiskitphysics/bulletlib/examples/SoftDemo/SoftDemo.cpp
///btSoftBody implementation by Nathanael Presson #include "btBulletDynamicsCommon.h" #include "BulletSoftBody/btSoftRigidDynamicsWorld.h" #include "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h" #include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h" #include "LinearMath/btQuickprof.h" #in...
ALGO
0.983347
4.316331
cf273b5c-fab3-4cc6-9d63-9bc7c6153348
sjsfwch/LeetCode
264.丑数-ii.cpp
/* * @lc app=leetcode.cn id=264 lang=cpp * * [264] 丑数 II */ #include "headers.h" // @lc code=start class Solution { public: int nthUglyNumber(int n) { vector<int> ugly(n + 1, 1); int p2 = 1, p3 = 1, p5 = 1; for (int i = 2; i < ugly.size(); ++i) { ugly[i] = min(min(ugly[p2]...
ALGO
0.999748
6.117502
66bdecd2-e233-4002-827c-8c13c8310541
BonexGoo/Boss2D
Boss2D/addon/opencv-4.1.1_for_boss/3rdparty/carotene/src/warp_perspective.cpp
#include "remap.hpp" namespace CAROTENE_NS { bool isWarpPerspectiveNearestNeighborSupported(const Size2D &ssize) { #if SIZE_MAX > UINT32_MAX return !(ssize.width > 0xffffFFFF || ssize.height > 0xffffFFFF) && // Restrict image size since internal index evaluation ...
ALGO
0.997075
6.9464
2869ce79-f7db-4e30-92cc-2d34dd355203
ShubhranshuSanjeev/oj-submissions
Codechef/CHEFWARS.cpp
#include <iostream> #include <cstdio> #include <cmath> using namespace std; int main() { int t, h, p; scanf("%d", &t); while(t--){ scanf("%d %d", &h, &p); double x = log2(h); while(p > 0){ h -= p; p /= 2; } printf("%d\n", (h < 1)); } return 0; }
ALGO
0.999534
3.659247
d878f7c7-1086-495b-b45a-d003b759c043
Agnes331/2311102126_Agnes-Refilina-Fiska
pertemuan06/unguided1.cpp
#include <iostream> #include <stack> #include <string> #include <cctype> using namespace std; // Fungsi untuk membersihkan kalimat dari karakter non-alfabet dan mengonversi huruf ke huruf kecil string cleanString(const string& str) { string cleaned; for(char c : str) { if(isalpha(c)) { cle...
ALGO
0.998533
6.420255
67b4ecd7-56f2-4f81-bff8-cb7229eb5ce3
rocky55737/AlgoAfoc
BaekJoon/10816/main.cpp
#include <iostream> #include <vector> #include <algorithm> int main() { int n; std::cin >> n; std::vector<int> cards(n); for (int i = 0; i < n; i++) { std::cin >> cards[i]; } std::sort(cards.begin(), cards.end()); int m; std::cin >> m; std::vector<int> targets(m); for (int i = 0; i < m; i++) {...
ALGO
0.999987
5.154564
f911f59b-f2ad-4b06-a28b-5b162f671b3d
PAnand007/Learn-C_plus_plus
DSA/Recursion/Recursion2/subarray.cpp
// #include <iostream> // using namespace std; // int main() { // int arr[] = {1, 2, 3, 4}; // int n = sizeof(arr) / sizeof(arr[0]); // for (int i = 0; i < n; i++) { // Start index // for (int j = i; j < n; j++) { // End index // for (int k = i; k <= j; k++) { // Print elements from...
ALGO
0.99673
4.908115
ea2f9619-869d-4a2a-83f8-860967a512e9
nmf-wasi/Data-Structures
Module#22 [Representing BST in array & Heap]/Insert_in_max_Heap.cpp
#include <bits/stdc++.h> using namespace std; int main() { vector<int> Lia; int input; //number of inputs cin >> input; for (int i = 0; i < input;i++) { int x;//taking input cin >> x; Lia.push_back(x); // pushback done in vector like a complete binary tree in...
ALGO
0.999964
4.660908
5ce035b2-ef40-4ec6-952c-d703bac27248
ishandutta2007/codeforces
bench0310/normal/1468/G.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct point { ll x,y; point(){x=0;y=0;} point(ll a,ll b):x(a),y(b){} }; struct line { ll a,b,c; line(point p,point q) { a=p.y-q.y; b=q.x-p.x; c=-a*p.x-b*p.y; } }; bool operator==(const point &a,c...
ALGO
0.999977
3.774742
3bd0abd2-3e48-4b16-b3d7-ef9838f964ab
Jay7221/competitve-programming
codeforces/normal_rounds/Round960/c.cpp
#include <bits/stdc++.h> using namespace std; //#pragma GCC optimize("Ofast,unroll-loops") //#pragma GCC target("avx,avx2,avx512,fma") template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; } template<typename T_container,...
ALGO
0.999805
5.251842
8850c172-919b-4c6e-b7cb-0adf1181df8a
atcsecure/blocknet
src/bitcoinrpc.cpp
#include "init.h" #include "util.h" #include "sync.h" #include "ui_interface.h" #include "base58.h" #include "bitcoinrpc.h" #include "db.h" #undef printf #include <boost/asio.hpp> #include <boost/asio/ip/v6_only.hpp> #include <boost/bind.hpp> #include <boost/filesystem.hpp> #include <boost/iostreams/concepts.hpp> #inc...
WEB
0.935864
4.539328
a8d5c816-913b-4ad2-bdeb-99a0385bdc70
csuyangpeng/ros_src
src/opencv3/3rdparty/carotene/src/phase.cpp
#include <cfloat> #include <cmath> #include "common.hpp" namespace CAROTENE_NS { #ifdef CAROTENE_NEON namespace { #define FASTATAN2CONST(scale) \ f32 P1((f32)( 0.9997878412794807 * (180.0 / M_PI) * scale)), \ P3((f32)(-0.3258083974640975 * (180.0 / M_PI) * scale)), \ P5((f32)( 0.155578651...
ALGO
0.998294
5.868984
3050f5a4-864f-4a5c-822d-76d0f74d8847
m-eraf/DSApractice
Assignment 10/guess_no._high_low.cpp
class Solution { public: int guessNumber(int n) { long long l= 1, h = n, m; while(l<=h){ m = l+(h-l)/2; if(guess(m) == 0){ return m; } else if(guess(m) == -1){ h = m - 1; } else { l = m + 1; }...
ALGO
0.999997
5.8922
cd860f5b-593a-4033-a55f-f65896f6b674
ishandutta2007/codeforces
memset0c/normal/1065/A.cpp
#include <bits/stdc++.h> namespace ringo { typedef long long ll; template < class T > inline void read(T &x) { x = 0; register char c = getchar(); register bool f = 0; while (!isdigit(c)) f ^= c == '-', c = getchar(); while (isdigit(c)) x = x * 10 + c - '0', c = getchar(); if (f) x = -x; } template < class T > in...
ALGO
0.99929
3.319105
ff89f011-ab7e-458f-822c-a18b4045667d
Harshini-Maddali/Array.cpp
sorted_order-or-not_1.cpp
#include<iostream> using namespace std; int main() { int n; cin>>n; int a[n]; for(int i=0;i<n;i++) { cin>>a[i]; } int fl=1; for(int i=0;i<n-1;i++) { for(int j=i+1;j<n;j++) { if(a[i]>a[j]) { fl=0; break; } } if(fl==1) { cout<<"sorted order"; } else { cout<...
ALGO
0.999893
4.392288
f5c835c5-24b1-41d7-bb86-3b0a66421ff6
clarinet758/atcoder
abc/b076_100/b084/b1.cpp
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;++i) #define per(i,n) for(int i=n-1;i>=0;--i) #define sc1(a) scanf("%d",&a) #define sc2(a,b) scanf("%d %d",&a,&b) #define sc3(a,b,c) scanf("%d %d %d",&a,&b,&c) #define sl1(a) scanf("%lld",&a) #define sl2(a,b) scanf("%lld %lld",&a,&b) ...
ALGO
0.999957
3.492406
fac2b88f-6f71-4406-8171-cbe20b56530d
SeveralBandicoot/exam3
graphs/ex10_Chat_Graph_Adj_List.cpp
#include <iostream> #include <vector> using namespace std; void addEdge(vector<vector<int>>& adjList, int u, int v) { adjList[u].push_back(v); // For undirected graph, add both directions adjList[v].push_back(u); } int main() { int nodes = 5; vector<vector<int>> adjList(nodes); addEdge(adjList, 0, 1); addEdge(adjList,...
ALGO
0.997722
5.532731
e1a9470f-4ef3-4414-820f-5576cbde2964
vedalken/How_to_program_Cpp
How_to_programC++/06.Functions_and_an_Introduction_to_recursion/Exercises/6.58_Computer_Assisted_Instruction_Monitor_student_performance/main.cpp
// main.cpp // Computer-Assisted Instruction (CAI). // Program help elementary school student learn multiplication. #include <iostream> #include <cstdlib> #include <ctime> #include "fun.h" using std::cout; // iostream using std::endl; using std::cin; using std::rand; //cstdlib using std::srand; using std::time; //ct...
TOOL
0.952934
4.398292
8341379a-258a-4415-889c-fb11a8a6d6e4
shfnr/2023aaib3
week16/week16-3.cpp
class Solution { public: void helper(TreeNode* root, vector<int>& ans){ if(root==nullptr) return; helper(root->left, ans); ans.push_back(root->val); helper(root->right,ans); } vector<int> inorderTraversal(TreeNode* root) { vector<int> ans; helper(root, ans); ...
ALGO
0.999993
6.607382
a31ece56-b289-4805-bccd-19a430e6e13b
tanersnmz/CS204-Assignments
HW3-Bus Lines/taners_Sonmez_Taner_HW3.cpp
/******************************************************************************************************************* Purpose: This program is a simplified version of a bus line/stop management system that is used in the everyday life. Author: Taner Giray Sonmez Date: 17/11/2021 *****************************************...
TOOL
0.969504
3.614873
9666b4c9-f1bd-440f-833f-e4005ad2f253
dappelha/BoxLib-omp4-Hackathon2016
Src/C_BaseLib/MultiFab.cpp
#include <winstd.H> #include <algorithm> #include <cfloat> #include <iostream> #include <iomanip> #include <map> #include <limits> #include <BLassert.H> #include <MultiFab.H> #include <ParallelDescriptor.H> #include <BLProfiler.H> #include <ParmParse.H> #include <PArray.H> #ifdef BL_MEM_PROFILING #include <MemProfil...
ALGO
0.935635
6.193933
ce87220e-78c5-4bc9-8c1a-890724397786
Hg-lab/PreparationFromBOJ
백준_마리오.cpp
#include <iostream> #include <algorithm> #include <vector> //밪 Լ int absolNum(int a) { if(a < 0) { return (-1) * (a); } else return a; } using namespace std; int main() { int input = 0; int sum = 0; vector<int> vSum; // ´ for(int i = 0; i < 10; i++) { cin >> input; sum += input; vSum.push_back(su...
ALGO
0.999685
3.48842
521f2607-a40a-4de2-832e-a92d4994ad32
tejas1995/SPOJ-solutions
a2oj/2B/CF276.cpp
//http://codeforces.com/problemset/problem/276/B #include <iostream> #include <string> #include <set> using namespace std; int main() { string s; cin >> s; set<char> odd; for(int i = 0; i < s.length(); i++) if(odd.find(s[i]) == odd.end()) odd.insert(s[i]); else odd.erase(odd.find(s[i])); if(odd.size(...
ALGO
0.999996
4.431299
03506797-1822-4ae8-812f-4c65865b1b39
grantathon/nquantlib64
QuantLib/ql/models/marketmodels/evolvers/lognormalfwdratepc.cpp
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include <ql/models/marketmodels/evolvers/lognormalfwdratepc.hpp> #include <ql/models/marketmodels/marketmodel.hpp> #include <ql/models/marketmodels/evolutiondescription.hpp> #include <ql/models/marketmodels/browniangenerator.hpp> #include...
ALGO
0.998754
7.704927
f1799cb3-2c33-4915-8504-f7bafa9a7bf8
ishandutta2007/codeforces
demoralizer/normal/1528/D.cpp
#include "bits/stdc++.h" using namespace std; #define int long long #define pb push_back #define ppb pop_back #define pf push_front #define ppf pop_front #define all(x) (x).begin(),(x).end() #define uniq(v) (v).erase(unique(all...
ALGO
0.999973
3.854282
69e3605f-7de3-4d47-87b2-3a11164b62e2
chinet-project/chinet-node-util
src/currency_core/difficulty.cpp
#include <algorithm> #include <cassert> #include <cstddef> #include <cstdint> #include <vector> #include "misc_log_ex.h" #include "common/int-util.h" #include "crypto/hash.h" #include "currency_core/currency_config.h" #include "difficulty.h" #include "profile_tools.h" namespace currency { using std::size_t; usi...
ALGO
0.99372
6.212162
b935798f-0518-4e3f-9255-8cdd8c23e441
mks004t/DSA
DSA Codes/DP_Minimum_jumps_to_reach_end.cpp
#include<bits/stdc++.h> using namespace std; // O(N) time complexity & O(1) space int minJumps(int arr[], int n) { if(n<=1) return 0; else if(arr[0]==0) return -1; else { int maxReach = arr[0]; int step = arr[0]; int jump = 1; for(int i=1; i<n; i...
ALGO
0.99999
4.379005
d34e53f4-4ce9-4af1-a435-af56a4f5300f
ishandutta2007/codeforces
mofk/normal/466/A.cpp
#include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #define MAX (int)1e5+5 #define f(i,n) for(i=1;i<=n;++i) #define F(i,n) for(i=n;i>=1;--i) #define FF(i,a,b) for(i=a;i>=b;--i) #define ff(i,a,b) for(i=a;i<=b;++i) typedef long long ll; using namespace std; int main(void) { long int n,m,a,b; scanf("%...
ALGO
0.999844
3.341242
1cc6d8f5-d253-490f-a7d3-9359eed60e5b
sanu11/Codes
HackerRank/codesprint2.cpp
#include<bits/stdc++.h> using namespace std; #define mx 1000000007 int m,n; long long sum=0; int a[2500][2500]; void recur(int i,int j,int temp) { //cout<<i<<" "<<j<<endl; int te=(temp%mx*a[i][j]%mx)%mx; //left if(j<m) { int z=j+1; recur(i,z,te); } //cout<<i<<" "<<j<<"after left"<<endl; //down if(i<n) { int y=i+1; recu...
ALGO
0.99996
3.851586
ae71fb0d-1e86-4f33-bd48-e745b6e851c8
tzupengwang/PECaveros
contest/opencup/XVII/2Capitals/c.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n , l , r; cin >> n >> l >> r; string ans = ""; for( int i = l ; i <= r ; i += 2 ) ans += "[]"; int lft = l - 1 , rgt = n - r; while( lft and rgt ){ ans = "(" + ans + ")"; lft --; rgt --; } while( lft > 0 ){ ans = "()" + ans; ...
ALGO
0.999557
4.095438
91e45f1e-4988-4b59-b819-54fe063ee9fa
ThakurSarveshGit/Open3D
Open3D/3rdparty/tinygltf/tinygltf/examples/common/glm/test/core/core_func_integer_find_lsb.cpp
// This has the programs for computing the number of trailing zeros // in a word. // Max line length is 57, to fit in hacker.book. #include <cstdio> #include <cstdlib> //To define "exit", req'd by XLC. #include <ctime> int nlz(unsigned x) { int pop(unsigned x); x = x | (x >> 1); x = x | (x >> 2); x = ...
ALGO
0.999149
5.25303
dd98aa4b-69eb-43f7-b872-1a3130d2a42a
GaisaiYuno/OI-Record-exe-deleted
Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day2程序包/answers/GD-0304/defense/defense.cpp
#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; void read(int &x){ char c;int f=1;x=0;c=getchar(); while(c>57||c<48){if(c==45)f=-1;c=getchar();} while(c>=48&&c<=57){x=x*10+c-48;c=getchar();} x*=f; } int n,m; char typ[2]; int p[3001],dp[3001][3001]; void DP(int a,int x,...
ALGO
0.999847
3.611362
da513697-dcb3-4e9f-8d27-d835baca8521
ActuallyHappening/SchoolBoxStyling
schoolbox_styling/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.998417
6.785645
d37bbdc6-1aa2-47c3-be37-620d023b4dfe
yashparmar15/Cpp-Codes
Pseudo_Palindromic_Paths_in_a_Binary_Tree.cpp
/*Given a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be pseudo-palindromic if at least one permutation of the node values in the path is a palindrome. Return the number of pseudo-palindromic paths going from the root node to leaf nodes. Example 1: Input: root = [2,3,1,...
ALGO
0.999977
6.375381
e02d80bb-2acf-4159-ad32-9afff70e0e49
Pulkit1822/GeeksforGeeks
Medium/Minimize the Difference/minimize-the-difference.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; class Array { public: template <class T> static void input(vector<T> &A,int n) { for (int i = 0; i < n; i++) { scanf("%d ",&A[i]); } } template <class T> static void print(vector<T> &A) ...
ALGO
0.999924
5.322076
98cdd0e4-ebd6-488d-9675-323285b1b7ca
JmKanmo/ProblemSolving
AlgorithmSytudy/AlgorithmSytudy/Programmers/Kakao_무지먹방라이브.cpp
#include <iostream> #include <vector> #include <queue> #include <map> #include <algorithm> using namespace std; typedef pair<int, int> Pair; vector<Pair>sorted_arr; map<int, int>m; queue<int>q; bool comp(const Pair& p1, const Pair& p2) { return p1.second < p2.second; } void init(vector<int>food_times) { int cnt =...
ALGO
0.999938
4.643334
9f8182c7-48cc-476e-931f-71bcbdab0acc
ayukumi-cmd/Leetcode_solutions
3296-minimum-time-to-revert-word-to-initial-state-ii/3296-minimum-time-to-revert-word-to-initial-state-ii.cpp
class Solution { public: vector<int>kmp(string s){ vector<int>lps(s.size(), 0); for(int i=1; i<lps.size(); i++){ int prev_idx=lps[i-1]; while(prev_idx>0 and s[i]!=s[prev_idx]){ prev_idx= lps[prev_idx-1]; } lps[i]=prev_idx+(s[i]==s[prev_...
ALGO
0.999987
5.615907
503a066b-ebab-437e-bc00-d7485eb46ee4
Acka1357/ProblemSolving
BeakjoonOJ/12000/12961_체스판2.cpp
// // Created by Acka on 10/24/16. // #include <stdio.h> #include <vector> #include <queue> using namespace std; #define MAXF 987654321 struct Edge { int to, cap, flow, rev; Edge(int t, int c, int r):to(t), cap(c), flow(0), rev(r){} int residual() const {return cap - flow;} }; struct NetworkFlow { ...
ALGO
0.998739
3.864002
c79e0551-2612-4b19-b0b4-aaf0ae0f0887
igor-pavkov/honours-2024
Code Examples/DiverseVul Filtered/Secure/f6b97b29513950bfbf621a83d85b6f86b39ec8db-15.cpp
static struct sock *nr_find_peer(unsigned char index, unsigned char id, ax25_address *dest) { struct sock *s; struct hlist_node *node; spin_lock_bh(&nr_list_lock); sk_for_each(s, node, &nr_list) { struct nr_sock *nr = nr_sk(s); if (nr->your_index == index && nr->your_id == id && !ax25cmp(&nr->dest_addr...
TOOL
0.881729
5.019043
01ff546e-8d4a-4f77-9f0d-af868567de29
mamun4122/My-Online-Judge-Submission
lightoj/1237 - Cyber Cafe.cpp
#pragma comment(linker, "/stack:640000000") #include <bits/stdc++.h> using namespace std; const double EPS = 1e-9; const int INF = 0x7f7f7f7f; const double PI=acos(-1.0); #define READ(f) freopen(f, "r", stdin) #define WRITE(f) freopen(f, "w", stdout) #define MP(x, y) make_pair(x, y) #...
ALGO
0.999905
3.541208
93e4e678-1bee-4fc4-8bac-763ac9d69855
Ckend/myLeetcode
100.Same_Tree/100.Same_Tree/main.cpp
#include <iostream> struct TreeNode{ int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x),left(NULL),right(NULL){} }; class Solution{ public: bool isSameTree(TreeNode* p,TreeNode* q){ if(p==NULL && q==NULL) return true; else if(p==NULL || q==NULL) ...
ALGO
0.99989
5.652801
3a6b8a47-dc56-47b5-a8ba-9bf5231ecfc4
RunAtTekky/DSAandCP
contests/CF/987Div2/A_Penchick_and_Modern_Monument.cpp
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; vector<int> a(n); for (auto &e : a) cin >> e; int maxi = 0; map<int,int> freq; for (auto e : a) { freq[e]++; maxi = max(maxi, freq[e]); } cout << n - maxi << "\n"; } int main() { int ...
ALGO
0.999908
4.48562
38a13901-5c77-4822-9422-3a9087c312a9
YunzeWu/YunzeWu
我的刷题记录/shell game.cpp
#include<bits/stdc++.h> using namespace std; bool shell[5]; int s1,s2,s3; int main(){ int n,a,b,g; scanf("%d",&n); shell[1]=1; shell[2]=0; shell[3]=0; for(int i=0;i<n;i++){ scanf("%d%d%d",&a,&b,&g); bool t=shell[a]; shell[a]=shell[b]; shell[b]=t; if(shell[g]==1){ s1++; } } printf("%d ",s1); shel...
ALGO
0.999961
3.354701
289bf344-f0c7-4aa8-a7c2-89954e60585f
ddanielcruz/Competitive-Programming
URI/Strings/1253.cpp
#include <iostream> using namespace std; int main() { int N; cin >> N; cin.ignore(); string cipher; int L, tam, i; while(N--) { getline(cin, cipher); cin >> L; cin.ignore(); tam = cipher.size(); for(i = 0; i < tam; ++i) { ciphe...
ALGO
0.999271
3.264216
57a00967-4eb5-4522-b996-6883abb10665
WeichenXu/shuati
416_partition_equal_subset_sum.cpp
#include <iostream> #include <vector> #include <numeric> using namespace std; class Solution { public: bool canPartition(vector<int>& nums) { int sum = accumulate(nums.begin(), nums.end(), 0); if (sum%2) return false; sum = sum/2; sort(nums.begin(), nums.end()); int size =...
ALGO
0.999948
5.301943
e431e754-cf4c-415c-88f2-8feb029bd974
DaniloLMD/UFG
AED1/lista1/ex9.cpp
//questao 9 #include <iostream> void hanoi(int qtd, char O, char D, char A){ if(qtd == 1){ printf("(%c,%c)\n", O, D); return; } hanoi(qtd-1, O, A, D); printf("(%c,%c)\n", O, D); hanoi(qtd-1, A, D, O); } int main(){ int qtd; std::cin >> qtd; hanoi(qtd, 'O', 'D', 'A');...
ALGO
0.999659
4.948956
21db36a9-470f-4902-aa03-7967f5c6694e
BelidePruthvi/summer2019_vce_pruthvibelide
Systems/summer2/summer2/DLLMergesort.cpp
#include<stdio.h> #include<stdlib.h> struct node{ int data; struct node *lptr; struct node *rptr; }; struct node * insert(int x, struct node* head) { struct node *temp = (struct node *)malloc(sizeof(struct node)); temp->data = x; temp->lptr = NULL; temp->rptr = NULL; if (!head) { head = temp; } else { t...
ALGO
0.999977
5.156197
a6f4c252-252d-4d5f-8c8b-e541f98cccb4
raptoravis/forwardplusrendering
thirdparty/boost_1_70_0/libs/graph/test/dijkstra_cc.cpp
#include <boost/config.hpp> #include <boost/concept_archetype.hpp> #include <boost/graph/dijkstra_shortest_paths.hpp> #include <boost/graph/dijkstra_shortest_paths_no_color_map.hpp> #include <boost/graph/graph_archetypes.hpp> typedef boost::default_constructible_archetype< boost::sgi_assignable_archetype<> > dist_va...
TEST
0.97086
4.685881
419fc4f9-ab44-4813-b787-60e8818cdedb
Anjalisharma011/Leetcode-solutions
0153-find-minimum-in-rotated-sorted-array/0153-find-minimum-in-rotated-sorted-array.cpp
class Solution { public: int findMin(vector<int>& nums) { int left=0; int right=nums.size()-1; while(left<right){ int mid=(left+right)/2; if(nums[mid]<nums[right]){ right=mid; } else{ left=mid+1; } ...
ALGO
0.999986
5.805129
8cd92290-79ad-4946-9d5b-3c78cce117cf
amitasj7/DSA_CODES
leetcode/top_interview_questions/copyListWithRandomPointer.cpp
#include <bits/stdc++.h> using namespace std; // Definition for a Node. class Node { public: int val; Node *next; Node *random; Node(int _val) { val = _val; next = NULL; random = NULL; } }; class Solution { public: Node *copyRandomList(Node *head) { // ...
ALGO
0.998935
4.748249
40e7bd6c-f985-4058-ae5d-0fe2ad80fbf0
srushti-pmr/SeminarSynergy
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); } ...
TOOL
0.998735
6.678298
27249cdd-8192-4b8f-a639-b0ca90431601
MalikCoderGreen/LeetCode_Problems
easy_problems/spitBalancedString.cpp
/* 1221. Split a String in Balanced Strings Balanced strings are those that have an equal quantity of 'L' and 'R' characters. Given a balanced string s, split it in the maximum amount of balanced strings. Return the maximum amount of split balanced strings. Input: s = "RLRRLLRLRL" Output: 4 Explanation: s can be spl...
ALGO
0.999528
6.769339
b153aba3-83ef-43eb-8bae-600586ab6e3d
Kiranchawla09/GFG
Minimum_four_sum_subsequence.cpp
int minSum(int arr[], int n) { int dp[n]; if (n==1) return arr[0]; if (n==2) return min (arr[0],arr[1]); if (n==3) return min (arr[0], min (arr[1],arr[2])); if (n==4) return min (min(arr[0],arr[1]),min (arr[2],arr[3])); dp[0]=arr[0]; dp[1]=arr[1]; dp[2...
ALGO
0.999954
5.22196
9645bcb1-e105-4a6a-8667-f61e436c7dab
raincross7/code-similarity
codes/train_code/problem262/problem262_223.cpp
//--------------------------------------------------------------- #include <bits/stdc++.h> using namespace std; #include <iostream> #include <vector> #include <cstdlib> #include <cmath> #include <math.h> #include <sstream> #include <numeric> #include <cctype> #include <bitset> #include <cassert> #include<algorithm> //-...
ALGO
0.999997
3.380738
9571185e-8c64-4a99-a9bd-ac8fc6f5bf9e
adubredu/rascapp_robot
bill_ws/src/ar_track_alvar/src/medianFilter.cpp
/** * \file * * N-dimensional median filter for marker poses * * \author Scott Niekum */ #include <ar_track_alvar/filter/medianFilter.h> namespace ar_track_alvar { using namespace alvar; MedianFilter::MedianFilter(int n){ median_n = n; median_ind = 0; median_init = false; median_poses...
ALGO
0.999146
6.102664
9ea4cd94-fb6a-4e05-8f4f-2eecb6b3085c
Aman-Dubey/InterviewBitSolutions
Tree Data Structure/Construct_Binary_Tree_From_Inorder_And_Preorder.cpp
int find(vector<int> &A,int start,int end,int x) { for(int i=start;i<=end;i++) { if(A[i]==x) return i; } } TreeNode * findans(vector<int> &A,vector<int> &B,int start,int end,int &p) { if(start>end) return NULL; int k=find(A,start,end,B[p]); TreeNode *temp=new TreeNode(B[p++]); temp->...
ALGO
0.999996
5.083847
2f9dba5f-7979-4bee-9079-00334bac8c56
yungchii/llvm-project
mlir/lib/Dialect/Tensor/Transforms/ExtractSliceFromReshapeUtils.cpp
using namespace mlir; using namespace mlir::tensor; /// Get the dimension size of a value of RankedTensor type at the static OpFoldResult getShapeDimSize(OpBuilder &b, Location loc, Value rankedTensor, int64_t dimIdx) { RankedTensorType tensorType = rankedTensor.getType().cast<Ran...
TOOL
0.932028
7.523076
48f1c8cd-a7ce-41bb-a43b-93f15de5e10b
sitodav/before-november-2014
Cplusplus/Cplusplus_oldsnippets/priorityqueue/main.cpp
#include "priority_queue.h" #include <cstring> #include <cstdlib> #include <iostream> using namespace std; int main(){ priority_queue queue1; queue1.insertNew(10,string("weweee")); queue1.insertNew(18,string("CIAOOO")); queue1.insertNew(22,string("C")); queue1.insertNew(4,string("CIAOOO")); queue1.stampa(); ob...
ALGO
0.990762
4.175265
b08adc13-9ef8-4274-af90-e93fd1bb56bb
Aadarshg087/competitive-programming
Striver 190 Sheet/Linked List II/141_LinkedListCycle.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; /* - Check for overflow - Add brackets while using bitwise - Check corner cases (out of bounds for loops) - Revise the code - Try to prove yourself wrong */ class ListNode { public: int val; ListNode *next; ListNode(int ...
ALGO
0.999599
5.308066
cad9069f-dccd-4f1a-906d-dddaf23ddf53
ml13571/opencv_lite
modules/imgproc/src/samplers.cpp
#include "precomp.hpp" namespace cv { static const uchar* adjustRect( const uchar* src, size_t src_step, int pix_size, Size src_size, Size win_size, Point ip, Rect* pRect ) { Rect rect; if( ip.x >= 0 ) { src += ip.x*pix_size; rect.x = 0; } else { ...
ALGO
0.990051
5.696206
1baf5fdf-0097-4859-af28-dc479592f705
loki-engr/CtrlHair
wrap_codes/wrap_triangle/useful_code/libigl/include/igl/tet_tet_adjacency.cpp
#include "tet_tet_adjacency.h" #include "parallel_for.h" #include <array> #include <vector> template <typename DerivedT, typename DerivedTT, typename DerivedTTi> IGL_INLINE void igl::tet_tet_adjacency( const Eigen::MatrixBase<DerivedT>& T, Eigen::PlainObjectBase<DerivedT...
ALGO
0.999267
6.527616
ce84a2f3-39ca-47f5-908f-99671a1c2c7c
Renataberga/LAB1
Ex4/main.cpp
#include <iostream> #include "Circulo.h" #include <windows.h> using namespace std; int main() { SetConsoleOutputCP(65001); Circulo c1, c2; c1.definirRaio(7.0); c1.definirCentro(2.0, 3.0); c2.definirRaio(4.0); c2.definirCentro(7.0, 8.0); cout << "Círculo 1:" << endl; c1.imprimirRaio...
ALGO
0.94375
4.634629
54bea52b-e687-4c87-a776-d8f14af0a24f
techboy-s/Code
0976-largest-perimeter-triangle/0976-largest-perimeter-triangle.cpp
class Solution { public: int largestPerimeter(vector<int>& nums) { sort(nums.begin(), nums.end()); for(int i = nums.size()-1;i > 1; --i){ if(nums[i] < nums[i-1] + nums[i-2] ) return nums[i] + nums[i-1] + nums[i-2]; } return 0; } };
ALGO
0.999887
4.99501
36fee5ed-35f0-4087-aefd-c4b807257357
RamPrateek24/Leetcode
70-climbing-stairs/climbing-stairs.cpp
class Solution { public: int climbStairs(int n) { if(n == 1) return 1; int c = 0; int p1 = 1, p2 = 1; for(int i=2; i<=n; i++){ c = p1+p2; p1 = p2; p2 = c; } return c; } };
ALGO
0.999988
5.802684
aeaec85c-3f11-4de1-bf7b-e3f6ffe3eecb
yeonheey/algorithms
LeetCode/Medium/739_DailyTemperatures.cpp
//Stack class Solution { public: vector<int> dailyTemperatures(vector<int>& temperatures) { int tempSize = temperatures.size(); vector<int> answer(tempSize, 0); stack<int> stk; //index for(int i = 0; i < tempSize; i++) { while(!stk.empty()) { ...
ALGO
0.999982
6.423528
23c4feca-da1e-4c1c-a599-ac06100e05a9
SChandu7/SportsFroChangeProject
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998733
6.76775
fe529c2a-fcdc-4fdc-9622-829d3b3f84ca
DenisShestakov1/labarotory-4
task1.cpp
#include <iostream> #include <fstream> #include <locale.h> using namespace std; int number(int b) { int count = 1; for (int i = 1; i < b; i++) { if (b % i == 0) { count++; } } return count; } int main() { setlocale(LC_ALL, "...
ALGO
0.982841
3.610544
10024507-eabc-4fe7-9c69-8644768e9a84
Kanakalasriharika/Competitive-Programming
Easy/Find duplicates in an array/find-duplicates-in-an-array.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: vector<int> duplicates(int arr[], int n) { // code here vector<int> v; map<int,int>m; for(int i =0;i<n;i++){ m[arr[i]]++; } for(auto itr=m...
ALGO
0.999373
6.181685
d7432cc8-b4c9-40b2-8711-bcbbc3235cff
OwaisK4/TRD
src/math/modular-exponentiation.cpp
int binmult(int a, int b) { if (b == 0) { return 0; } int answer = binmult(a, b / 2) % MOD; answer = (answer * 2) % MOD; if (b & 1) { answer = (answer + a) % MOD; } return answer; } int binpow(int x, int n) { // Recursive if (n == 0) { return 1; } else if (n =...
ALGO
0.999861
4.122687
3a9f73dc-9b07-4a17-bfe9-dba9a4043266
Daniel-Sameh/DataStructures
AVL&Heap.cpp
#include <bits/stdc++.h> using namespace std; class Item{ private: string name; string category; int price; public: Item(string name, string category, int price){ this->name=name; this->category=category; this->price= price; } Item(){price=0;} void setName(string name...
ALGO
0.999015
4.58348
8f9a8207-eb74-473f-b8a6-275f1430a457
artiam99/GeeksforGeeks
5 Binary Tree/7 Miscellaneous/16 Binary Tree Vertical Width reference.cpp
#include<bits/stdc++.h> using namespace std; #define int long long #define intmax std::numeric_limits<int>::max() #define intmin std::numeric_limits<int>::min() struct Node { int data; Node* left; Node* right; Node(int x) { data=x; left=right=NULL; } }; void traverse(Node* root,int &mn,int &mx,int v) { if...
ALGO
0.999824
5.098511
b0fd8989-f461-4bfa-8f99-d86d5e0131bd
Mostafa2115/Problem-Solving
A. Football.cpp
#include <bits/stdc++.h> #define ll long long #define vi vector<int> #define vl vector<long> #define vll vector<ll> #define pll pair<ll, ll> #define qi queue<int> #define qll queue<ll> #define PI 3.141592653589793238462 #define MOD 1000000007 using namespace std; void Yalla_beena_IO() { // Hey then bye ... ios...
ALGO
0.99995
4.16249
672e201e-3e91-45b8-863c-77fe2c332662
bitcoinanatomy/bitcoinanatomy
src/codebase/bitcoin-0.11.2 Github/src/primitives/block.cpp
#include "primitives/block.h" #include "hash.h" #include "tinyformat.h" #include "utilstrencodings.h" #include "crypto/common.h" uint256 CBlockHeader::GetHash() const { return SerializeHash(*this); } uint256 CBlock::BuildMerkleTree(bool* fMutated) const { /* WARNING! If you're reading this because you're lea...
ALGO
0.977336
7.039129
4a26f0c6-e715-4a75-84a9-12c3272c01c3
Imlierniu/Homework
小游戏集/cmd伪图形界面画图工具集/hdc_1752846_math.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <Windows.h> #include "../include/cmd_hdc_tools.h" #include<cmath> using namespace std; #define PI 3.1415926 static void flower(int point_x,int point_y) { //õ int RGB_value=RGB(190,183,255); int x, y,a=100,n=8; for (double cta = 0; cta <= 360; cta+=0.01)...
ALGO
0.859355
3.313062
fa90fde7-c1f5-4a97-bca3-25f5f53a51be
raincross7/code-similarity
codes/train_code/problem173/problem173_124.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>; int main() { ll n; cin >> n; /* for (ll m=1;m<=n;m++) { ll p = n/m; ll r = n%m; printf("m=%3lld, p=%3lld, r=%3lld", m, p, r); if (p==r) printf(":same"); printf("\n");...
ALGO
0.999933
3.713557
141fcdf3-3631-4815-b4da-9270f90d00fb
uupks/VisualSLAM
PA1/code/ORB_SLAM2/Thirdparty/DBoW2/DBoW2/ScoringObject.cpp
#include <cfloat> #include "TemplatedVocabulary.h" #include "BowVector.h" using namespace DBoW2; // If you change the type of WordValue, make sure you change also the // epsilon value (this is needed by the KL method) const double GeneralScoring::LOG_EPS = log(DBL_EPSILON); // FLT_EPSILON // ------------------------...
ALGO
0.996487
5.906807
09d00e47-0a6c-4b5a-805b-cf2125aed2bc
NazmulHasanMoon/OJ
Random/bellmanford#unknown.cpp
#include <cstdio> #include <climits> #include <vector> #include <list> #include <utility> using namespace std; void PrintNegativeCycle(vector< pair<int, int> > shortestDistances, int vertex, int startVertex) { if (vertex == startVertex) { printf("%d ", vertex); } else if (shortestDistances[vertex].sec...
ALGO
0.99991
4.378498
166e42bc-69ee-4fea-a1c8-b1cd55abe062
Shouryadip/DSA-C-C-
StackUsingArray2.cpp
#include<iostream> #define MAX_SIZE 10 using namespace std; class Stack { private: //static const int MAX_SIZE = 10; int arr[MAX_SIZE]; int top; public: Stack() { top = -1; } bool isEmpty() { return top == -1; } bool isFull() { return top == MAX_SIZE - 1; ...
ALGO
0.904691
5.094269
71d23630-00ff-43e3-8ccd-35c6636ec695
danyalmendigali/programming_scientific_codes
unordered_set_scientific_codes/unordered_set_counting_the_frequency_of_occurrence_of_words_in_a_text.cpp
#include <bits/stdc++.h> #include <windows.h> #include <iterator> using namespace std; #define ar array #define ll long long #define FOR(i, a, b) for(int i = a; i < b; i++) // Подсчет частоты появления слов в тексте с использованием unordered_set: unordered_map <string, int> countWordFrequencies(const string& text) ...
ALGO
0.998567
5.329214
84440ebb-56be-46f5-acf5-8c488e446bbc
luckyman2907/CPP_PTIT
giaimatanggiam.cpp
#include <bits/stdc++.h> using namespace std; void TestCase() { string s; cin >> s; vector<int> v; int minn = 1, posI = 0; // Xet s[0] if (s[0] == 'I') { v.push_back(1); v.push_back(2); posI = 1; } else { v.push_back(2); v.push_back(1); p...
ALGO
0.999192
3.913538
0835e62b-7db3-4af0-b79a-21f0a86bdf91
ishandutta2007/codeforces
shnirelman/normal/1300/B.cpp
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; vector<int> a(n * 2); for(int i = 0; i < n * 2; i++) cin >> a[i]; sort(a.begin(), a.end()); cout << a[n] - a[n - 1] << endl; } int main() { int t; cin >> t; while(t--) solve(); }
ALGO
0.997931
3.703279
67e4e8ff-e5ca-4e3b-b75d-b831f44bbaaa
benedictprajwal/hacktoberfest-2022-algo-projects
C++/missinginteger.cpp
// C++ program to Find the missing element #include <bits/stdc++.h> using namespace std; void findMissing(int arr[], int N) { int i; int temp[N + 1]; for(int i = 0; i <= N; i++){ temp[i] = 0; } for(i = 0; i < N; i++){ temp[arr[i] - 1] = 1; } int ans; for (i = 0; i <= N ; i++) { if (temp[i] == 0) ans ...
ALGO
0.999727
5.024261
67c63584-302f-44c3-9b53-d959f0f8de43
js1972/CarND-Extended-Kalman-Filter-Project
src/FusionEKF.cpp
#include "FusionEKF.h" #include "tools.h" #include "Eigen/Dense" #include <iostream> using namespace std; using Eigen::MatrixXd; using Eigen::VectorXd; using std::vector; /* * Constructor. */ FusionEKF::FusionEKF() { is_initialized_ = false; previous_timestamp_ = 0; // initializing matrices R_laser_ = Matr...
ALGO
0.962645
4.561761
f2f22a38-35fb-43fd-b729-ac7d64237a47
Anandpandey0/PractiseExercises-DSA
Interviewbit/Add-One-To-Number.cpp
#include<bits/stdc++.h> using namespace std; int main(){ vector<int>A {1, 1, 1, 3}; vector<int>B; reverse(A.begin(), A.end()); int decimal = 1; int total = 0; for (auto& it : A) { total += it * decimal; decimal *= 10; } int sum = total +1; while(sum!=0){ B.push_back(s...
ALGO
0.99998
3.793275
1b69831a-e462-4e1d-90b2-d0de0916bce0
ishandutta2007/codeforces
pavelkunyavskiy/normal/142/D.cpp
#include <iostream> #include <fstream> #include <vector> #include <set> #include <map> #include <string> #include <cmath> #include <cassert> #include <ctime> #include <algorithm> #include <queue> #include <memory.h> #include <stack> #define mp make_pair #define pb push_back #define setval(a,v) mems...
ALGO
0.999964
3.356162
1434e812-2ab8-4ce1-acc5-ae010af31356
PolarNight-Dawn/LeetCode_Code
LeetCode120/51-60/52_totalNQueens.cpp
#include <iostream> #include <vector> #include <algorithm> // // Created by polarnight on 23-7-28. // class Solution { public: bool isValid(std::vector<int> &row, std::vector<int> &col, std::vector<int> &bias1, std::vector<int> bias2, int i, int newRow) { if (std::find(row.begin(), row.en...
ALGO
0.999958
5.54235
019d2171-bcd0-408e-af90-244879a620db
alexandraback/datacollection
solutions_5769900270288896_0/C++/lym953/b.cpp
#include<iostream> #include<set> #include<map> #include<stdio.h> #include<stdlib.h> #include<cmath> #include<vector> #include<algorithm> #include<string> #include<cstring> #include<stack> #include<queue> #include<list> #include<valarray> #include<numeric> #include<sstream> using namespace std; #define pb push_back #de...
ALGO
0.999767
3.806547
7ae54110-82a8-4a1e-a64c-8ee8463595c0
LEZEgit/-OS-Project---SerenityOS
Userland/Libraries/LibCrypto/Hash/SHA2.cpp
#include <AK/CPUFeatures.h> #include <AK/Platform.h> #include <AK/SIMD.h> #include <AK/SIMDExtras.h> #include <AK/Types.h> #include <LibCrypto/Hash/SHA2.h> namespace Crypto::Hash { constexpr static auto ROTRIGHT(u32 a, size_t b) { return (a >> b) | (a << (32 - b)); } constexpr static auto CH(u32 x, u32 y, u32 z) { ret...
ALGO
0.997236
7.455474
af6f0819-f19b-46e8-ab56-bee324712992
Viish/kfiltre
kfiltre.cpp
#include "kfiltre.h" KFiltre::KFiltre(int** matrix, int taille, int diviseur) : matrix(matrix), taille(taille), diviseur(diviseur) { } KFiltre::KFiltre(FILTER filtre) : matrix(0), taille(3), diviseur(1) { switch (filtre) { case BLUR : diviseur = 9; matrix = new int*[taille]...
TOOL
0.96871
4.37259
a19de835-6fd6-4dc4-b8dd-e638874f8af9
raincross7/code-similarity
codes/train_code/problem338/problem338_161.cpp
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using ld = long double; #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) #define rep3(i, n) for (int i = 1; i < (int)(n+1); i++) #define rep4(i, s, n) for (int i = (s...
ALGO
0.999923
4.592151
e5ca34af-4ae7-4213-8d17-50619659d7ab
hasegawa1/procon-library
aizu/ntl_1_d.test.cpp
#define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/library/6/NTL/all/NTL_1_D" #include <iostream> #include "../number-theory/Sieve.cpp" using namespace std; int main(void) { cin.tie(nullptr); ios_base::sync_with_stdio(false); Sieve s; int n; cin >> n; cout << s.euler_phi(n) << endl;...
ALGO
0.997042
5.29851
549d10c4-890d-4294-9fc2-2c01a0f32af9
changym5/track
tracker/deepsort/src/tracker.cpp
#include "tracker.h" #include "nn_matching.h" #include "model.h" #include "linear_assignment.h" using namespace std; //#define MY_inner_DEBUG #ifdef MY_inner_DEBUG #include <string> #include <iostream> #endif tracker::tracker(/*NearNeighborDisMetric *metric,*/ float max_cosine_distance, int nn_budget...
ALGO
0.997133
6.064534
ee7f9d59-f198-4841-82d7-5db4f9838c01
bantyK/competitive_programming
techniques/atcoder-dp/sushi.cpp
// Problem : https://atcoder.jp/contests/dp/tasks/dp_j #include <bits/stdc++.h> #define ll long long #define mod 1000000007 #define inf (1LL<<60) #define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL) #define loop(i,s,e) for(int i = s; i < e; ++i) using namespace std; const int N = 301; /* We only need 3-D ...
ALGO
0.999826
3.487604
da28b3d6-8d37-4899-bdc8-d210d1e07d2b
jiadaizhao/LintCode
0501-0600/0515-Paint House/0515-Paint House.cpp
class Solution { public: /** * @param costs n x 3 cost matrix * @return an integer, the minimum cost to paint all houses */ int minCost(vector<vector<int>>& costs) { // Write your code here int m = costs.size(); if (m == 0) { return 0; } ...
ALGO
0.999818
6.09921
b18fe6b3-01d9-45a2-b6a4-56dbef7136f2
ruved/180DaysProblemSolving
1460-number-of-substrings-containing-all-three-characters/number-of-substrings-containing-all-three-characters.cpp
class Solution { public: int numberOfSubstrings(string s) { int count = 0; int left = 0; unordered_map<char, int> char_count = {{'a', 0}, {'b', 0}, {'c', 0}}; for (int right = 0; right < s.length(); ++right) { char_count[s[right]]++; whil...
ALGO
0.999878
6.148839
c1aa3033-53d0-42d5-9400-7dbbaa1e06ea
sneha423/DSA
c++/DAA/No_ofPlatforms2.cpp
//sweep line algorithm #include<iostream> #include<algorithm> using namespace std; int countPlatforms(int arr1[],int arr2[],int n){ int count=0; int plat_needed=0; int m=arr2[0]; for(int i=0;i<n;i++){ if(arr2[i+1]>arr2[i]){ m=arr2[i+1]; } } int final_arr[m+2]={0}; ...
ALGO
0.999338
4.75579
06e9666f-2e7b-4d28-b26c-5e3399bf2ef7
Gornalas/my_best_from_codewars
spinWord.cpp
//Write a function that takes in a string of one or more words, //and returns the same string, but with all five or more letter words reversed //(Just like the name of this Kata). Strings passed in will consist of only letters and spaces. //Spaces will be included only when more than one word is present. std::strin...
ALGO
0.999822
5.426194
118bff43-b345-4345-bcfd-a72d01f08dfa
Ash-KODES/Leetcode-Solutions
64-minimum-path-sum/64-minimum-path-sum.cpp
class Solution { public: int dp[200][200]; int mini(int n,int m,vector<vector<int>>& grid) { if(n==0&&m==0) return grid[n][m]; if(n<0||m<0) return 1e5; if(dp[n][m]!=0) return dp[n][m]; int up=mini(n-1,m,grid)+grid[n][m]; int left=mini(n,m-1,grid)+grid[n][m]; ...
ALGO
0.999942
6.084979
7b04180c-596c-4afe-bb50-788c6ca200fa
avreetkaur84/Competitive_Programming
stack/monotonic/7asteroid_collision.cpp
// Question Link - https://leetcode.com/problems/asteroid-collision/ #include <bits/stdc++.h> #define ll long long using namespace std; /* There was gap in my understanding of question, my focus was on performing operation rather than understanding in detail what exactly I need to solve: BIG RED FLAG!! */ c...
ALGO
0.99997
5.676289