uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
c31b21d2-b77f-4a67-a006-69c3ddccf141
muhammadhasan01/cp
Online Judge/Codeforces/Gym/2017-2018 ACM-ICPC, NEERC, Southern Subregional Contest, qualification stage (Online Mirror, ACM-ICPC Rules, Teams Preferred)/I.cpp
#include <bits/stdc++.h> using namespace std; const int N = 255; const int K = 30; const int dx[] = {1, -1, 0, 0}; const int dy[] = {0, 0, 1, -1}; struct Sound { int x, y, sound; Sound(int x, int y, int s) : x(x), y(y), sound(s) { } }; int n, m, q, p; int res[N][N]; bool vis[N][N]; char a[N][N]; void bfs(i...
ALGO
0.999671
4.013317
49be5cec-b60b-4e35-b09a-2af8a6e4b852
kid-kb/HacktoberCodes
Kruskals_Minimum_Spanning_Tree_using_STL_in_C++.cpp
// C++ program for Kruskal's algorithm to find Minimum // Spanning Tree of a given connected, undirected and // weighted graph #include<iostream> #include<vector> #include<algorithm> using namespace std; // Creating shortcut for an integer pair typedef pair<int, int> iPair; // Structure to represent a graph struct Gr...
ALGO
0.999961
5.822231
c9785541-5d89-4eb8-abcd-907c2f07b76f
ujjwalagrawal-1/CP_Problems
B_Following_the_String.cpp
//"2024-02-06 20:26:32", // Author Ujjwal_Agrawal // Linkedin: https://www.linkedin.com/in/uj7b1253/ // Codeforces: https://codeforces.com/profile/n_________er // Codechef: https://www.codechef.com/users/kgr #include <bits/stdc++.h> using namespace std; //Speed #define bullet() ios_base::sync_with_stdio(false), cin....
ALGO
0.999964
5.593712
d2b43b7b-1e29-4c47-afd3-58ff05b404bb
christiealappatt/TrilRACE
packages/tpetra/core/example/advanced/Benchmarks/blockCrsMatrixMatVec.cpp
// This benchmark exercises Tpetra::BlockCrsMatrix's // sparse matrix-vector multiply (the apply() method). Tpetra // implements sparse matrix and dense vector data structures and // computational kernels for users and other Trilinos data structures. // Tpetra uses MPI (Message Passing Interface) for distributed-memor...
TEST
0.957634
6.344477
ba61c54b-9225-47e0-ade7-4f76bf607663
Hazrat-Ali9/XPSC-Problem-Solving
Week 2/day 4/4.cpp
#include<bits/stdc++.h> using namespace std; //......... macros......... #define ull unsigned long long #define ll long long #define ld double #define pii pair<int,int> #define F first #define S second #define vi vector<int> #define vii vector<pii> #define vc vector #define nl cout<<"\n" #define Faster ios_base::sync...
ALGO
0.999773
4.420998
92738eab-440e-493d-b9a7-15b3adca4948
Anshul-Sohal/M.C.A---CipherSchools
12_2-D Array/2-D array ques.cpp
#include <iostream> using namespace std; int sumOfAllElements(int arr[][4],int row,int col){ int sum = 0; for (int i = 0; i < row; i++){ for (int j = 0; j < col; j++){ sum+=arr[i][j]; } } return sum; } void rowWithMaximunSum(int arr[][4],int row,int col){ int maxRowSum =...
ALGO
0.999294
4.152724
f5bfd866-c16e-4844-b5e0-56803ebd8de9
joaoDossena/MIEIC-AEDA
TP 9 - Priority Queues/Tests/maquinaEmpacotar.cpp
#include "maquinaEmpacotar.h" #include <sstream> #include <algorithm> MaquinaEmpacotar::MaquinaEmpacotar(int capCaixas): capacidadeCaixas(capCaixas) {} unsigned MaquinaEmpacotar::numCaixasUsadas() { return caixas.size(); } unsigned MaquinaEmpacotar::addCaixa(Caixa& cx) { caixas.push(cx); return caixas.size(); } ...
ALGO
0.972989
5.025677
c1934b07-d792-47e5-b1f5-299c7fe3cc74
OneBitPython/Codeforces
B_Inflation.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define all(c) c.begin(), c.end() #define endl "\n" int sum() { return 0; } template<typename... Args> int sum(int a, Args... args) { return a + sum(args...); } string bin(long n){ long i; string val = "0"; for (i = ...
ALGO
0.999816
4.131763
73042105-e8fb-4af2-b969-46a7ff247a19
porkallen/leetcode
C++/Source/DP/472.cpp
#include "common.h" class Solution { public: void helper(vector<string>& words, int chosenIdx, int startIdx, string& conStr, vector<string>& ret){ if(words[chosenIdx] == conStr){ ret.push_back(words[chosenIdx]); return; } if(conStr.length() > words[chosenId...
ALGO
0.999467
5.823189
98a1c4b0-18b9-4920-9d65-6bbf8f6f3878
Rubusch/cpp
020__cpp__language-techniques/functor__member-functions-functionpointer/functor.cpp
// functionpointer.cpp /* Geronimo the parrot Demo on function pointers to member functions. //*/ #include <iostream> /* Parrot //*/ class Parrot { public: void eat() { std::cout << "\tTsk, knick, tsk...\n"; } void speak() { std::cout << "\tOh Captain, my Captain!\n"; } }; /* main() //*/ int main() { ...
TOOL
0.987821
7.237984
212c2c2a-a27c-46d3-a4e9-b7d6b5387b27
AshvinBa/CPP_Programs-2
STACK/sort_element_by_Stack.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; void rev(stack<int> &s, int num) { if (s.empty()) { s.push(num); return; } int ele = s.top(); s.pop(); rev(s, num); s.push(ele); } void reverse_st(stack<int> &s) { if (s.empty()) { return; ...
ALGO
0.999926
5.128811
b5588b83-ec59-4fd7-a53d-511da166f3bb
alexandraback/datacollection
solutions_5640146288377856_0/C++/divanshu/div2.cpp
/* Divanshu Garg */ #include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include ...
ALGO
0.999264
4.166471
a8fa8f29-c96e-4cbe-a869-67a27f0b24d0
oo1463/Problemsolving
BOJ/21-01/2563.cpp
// https://www.acmicpc.net/problem/2563 #include <iostream> #include <vector> #include <algorithm> #include <cstring> #include <string> #define el '\n' #define FAIO ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr) using namespace std; int main() { FAIO; int N; cin >> N; bool...
ALGO
0.99199
4.73897
a3f161f6-ed36-47c4-a7c6-e7a11b926640
ishandutta2007/codeforces
lawrenceli/normal/425/A.cpp
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define px real() #define py imag() #define rep(i, n) for (int i=0, _##i=(n); i<_##i; ++i) #define repi(i, n) for (__typeof((n).begin()) i=(n).begin(), _##i=n.end(); i != _##i; ++i) #define sz(x) int((x).size()) #define print(x) cerr << ...
ALGO
0.999982
3.932317
0a54490b-e68a-407a-986f-ca8fda6e9b7e
harroshan/C-plus-plus-Assignments
Arrays/bubbleSort.cpp
#include<iostream> using namespace std; void bubbleSort(int arr[], int n){ for(int i=0; i<n;i++){ for(int j=0;j<n-i-1;j++){ if(arr[j] > arr[j+1]){ swap(arr[j], arr[j+1]); } } } } int main(){ int n; cin>>n; int arr[n] = {0}; for(int i=0;i<...
ALGO
0.999915
4.245436
d7f3ded0-eaea-47c5-b6a4-daadae3c823f
Mukeshkumar1611/Leetcode
Medium/Sort_Characters_By_Frequency.cpp
class Solution { public: string frequencySort(string s) { vector<pair<int, char>> v1; unordered_map<char, int> freq; for (int i = 0; i < s.size(); i++) { freq[s[i]]++; } for (auto it : freq) { v1.push_back({it.second, it.first}); ...
ALGO
0.999988
6.052458
10423a57-77da-4322-9585-b3b5132559db
cjlworld/OJ
Ybt/1938.cpp
#include<bits/stdc++.h> using namespace std; struct student { int c; int m; int e; int mark; int o; }a[100000]; bool rule(const student &a,const student &b) { if(a.mark>b.mark) return true; else if(a.mark<b.mark) return false; else { if(a.c>b.c) return true; else if(a.c<b.c) return false; else { if(a....
ALGO
0.999781
3.461309
7f2b1d93-1712-42de-9266-cac4b9c064f7
fum-is-chum/UVA_Practice
CombinationLock.cpp
#include <iostream> using namespace std; int init, n1, n2, n3; int res = 720 + 360; int spin(int a, int b, bool cw = true) { int res = 0; if(cw) res = a - b; else res = b - a; if(res < 0) res += 40; return res; } void solve() { res += spin(init,n1,true) * 9; res += spin(n1,n2,false) * 9; res += spin(...
ALGO
0.999941
3.983365
c7073647-9eaa-43db-a59f-697d4d61a4c4
kanishka-p1/DSA_Codes
InterviewBit/Arrays/addOneToNumber.cpp
// QUESTION /* Given a non-negative number represented as an array of digits, add 1 to the number ( increment the number represented by the digits ). The digits are stored such that the most significant digit is at the head of the list. NOTE: Certain...
ALGO
0.999832
6.943748
cc931f33-89ca-422c-b656-c960f8418dd0
fluffysyntax-26/DSA-in-Cpp
Arrays/problems/numbersWithEvenDigit.cpp
#include<iostream> #include<vector> using namespace std; int findNumbers(vector<int>& nums) { int evenDigits = 0; for(int i=0; i<nums.size(); i++){ int number = nums[i]; short digits = 0; while(number > 0){ number /= 10; digits++; } if ...
ALGO
0.998494
5.981453
f76bfa87-414f-4ae8-b544-778307d7504b
touyou/CompetitiveProgramming
topcoder/Snowflakes.cpp
#include <string> #include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include ...
ALGO
0.999747
4.350952
bc8cf16b-d0cc-4f51-bc4a-e44a0fba5af6
ishandutta2007/codeforces
feecie6418/normal/1464/C.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll m; int n,pl[10],a[100005]; char str[100005]; set<ll> dfs(int l,int r){ set<ll> ret; if(l==r){ ret.insert(1<<str[l]-'a'); return ret; } for(int i=l;i<r;i++){ set<ll> a=dfs(l,i),b=dfs(i+1,r); for(ll j:a)for(ll k:b)ret.insert(-j+k); } retu...
ALGO
0.999998
3.838561
ac0c0473-29b4-4071-a1b0-714118da1d31
paolo-torres/interview-prep
leetcode/all/all/jump_game_ii.cpp
/* Given int array, determine min jumps to reach last index Ex. nums = [2,3,1,1,4] -> 2, index 0 to 1 to last Greedy: At each point, determine furthest reachable, jump to it Time: O(n) Space: O(1) */ class Solution { public: int jump(vector<int>& nums) { int n = nums.size(); i...
ALGO
0.999986
6.592454
e95b0955-6f7a-4f6f-b502-252a623eb500
arash16/prayers
UVA/vol-105/10563.cpp
/* >>~~ UVa Online Judge ACM Problem Solution ~~<< ID: 10563 Name: Least Squares Problem: https://onlinejudge.org/external/105/10563.pdf Language: C++ Author: Arash Shakery Email: <EMAIL> */ #include <stdio.h> #include <iostream> using namespace std; int n, m; char sq[200][200]; bool isEmpty(int r, in...
ALGO
0.999945
4.283792
7dd69910-295d-4a18-b955-8c51decd2aa6
JNArrazola/Leetcode_Files
386_lexicographicalNumbers/main.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <unordered_set> #include <algorithm> #include <string> #include <cmath> #include <queue> #include <stack> #include <list> #include <array> #include <set> #include <math.h> #include <iomanip> #include <bitset> #include <deque> #include <bits/stdc++....
ALGO
0.994938
5.86974
7bff9a70-6a63-473d-8213-a69cd8d55082
Shivin01/DataStructure
Greedy/GreedyC/Meeting.cpp
#include<iostream> #include <vector> using namespace std; struct meeting { int start; int end; int pos; }; bool comp(meeting a, meeting b) { return a.end < b.end; } int maximumMeetings(vector<int> &start, vector<int> &end) { int n = start.size(); struct meeting meet[n]; for (int i ...
ALGO
0.999934
5.489356
9478f7f0-5946-4e30-bd0f-3150326d6aa0
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/Year2021/May/ModularEquation_20210509152544.cpp
#include<bits/stdc++.h> #include<iostream> using namespace std; int main(){ int t; cin >> t; while(t--){ int n,m; cin >> n >> m; set<int,int> } return 0; }
ALGO
0.999581
3.584835
b8e8f2c6-d2ff-4be7-95a7-6a1a883c4e7d
yehui2001/C_code
Linear List/Linklist_circular.cpp
//该程序实现带头结点的循环单链表的定义及基础操作 #include<iostream> using namespace std; typedef int ElemType; // 定义单链表中的结点类型 typedef struct LNode{ ElemType data; //数据域 struct LNode *next; //指针域 }LNode,*LinkList; //重命名后的Linklist常用来定义单链表的头指针 //初始化单链表 bool Init_List(LinkList &L){ L = (LNode *)malloc(sizeof(...
ALGO
0.999908
4.259372
fbba8b44-e84b-4de8-898c-10c23f8cdb2f
GlaucoMasi/CompetitiveProgramming
Cses/Graph Algorithms/1711-DistinctRoutes.cpp
#include <bits/stdc++.h> using namespace std; int n, m; vector<vector<int>> g, clean; vector<vector<int>> cap; int flow(vector<int> &fat){ fill(fat.begin(), fat.end(), -1); fat[0] = -2; queue<int> q; q.push(0); while(!q.empty()){ int i = q.front(); q.pop(); if(i == n-1) return 1; for(auto j : g[i]...
ALGO
0.999824
4.551002
48a1f630-172d-4863-8eef-e288ac31f552
lyhyl/AAPlusSharp
AAPlusSharp/AAIlluminatedFraction.cpp
//////////////////// Includes ///////////////////////////////////////////////// #include "stdafx.h" #include "AAIlluminatedFraction.h" #include "AACoordinateTransformation.h" #include <cmath> using namespace AAPlusSharp; //////////////////// Implementation /////////////////////////////////////////// double CAAIllumi...
ALGO
0.93613
6.290364
9791de6a-45e9-4325-aaa8-dda0b877a160
Mifandika/Contoh-Dasar-dasar-Cpp-1
Dasar-dasar-Cpp/034 String/sFind.cpp
#include <iostream> #include <string> using namespace std; int main(){ // method ( .find() ) // method mencari kata dari belakang // ( .rfind() ) string nama = "Kudasi"; int posisi = nama.find('d'); cout << "posisi kata pada nomer: " << posisi << endl; cout << endl; // contoh input string...
ALGO
0.993032
4.429996
5a79a055-52c8-40f3-a66f-2a66e65da7f3
NickLennonLiu/cpp
bpd/Homework/HW2/bigsum.cpp
#include <iostream> using namespace std; char as[101] = {0}, bs[101] = {0}; int c[102],a[102],b[102]; int main() { scanf("%s %s",as,bs); int alen = 100, blen = 100; while(!as[alen]) --alen; while(!bs[blen]) --blen; for(int i = 0; i <= alen; i++) { a[i] = as[alen-i] - '0'; } for...
ALGO
0.999917
3.474425
09632320-b0da-4cbb-a738-20f485176819
raincross7/code-similarity
codes/train_code/problem059/problem059_22.cpp
#include <bits/stdc++.h> #define rep(i,n) for (int i=0; i< int (n); i++) using namespace std; typedef long long ll; int main(){ int n,x,t; cin >> n >> x >>t; cout << t*((n+x-1)/x) << endl; }
ALGO
0.999676
3.479044
7fd1e487-41cb-43db-b89c-65d5287871f2
wjwarner24/s24-project-4-wjwarner24
src/algorithms/rr/rr_algorithm.cpp
#include "algorithms/rr/rr_algorithm.hpp" #include <cassert> #include <stdexcept> #define FMT_HEADER_ONLY #include "utilities/fmt/format.h" /* Here is where you should define the logic for the round robin algorithm. */ RRScheduler::RRScheduler(int slice) { if (slice == -1) { time_slice = 3; ...
TOOL
0.996934
6.117552
6991f95c-8e54-48db-bab8-818818a13098
Lunaris-AOSP/external_cronet
tot/third_party/llvm-libc/src/src/math/generic/fmaximum_magf16.cpp
#include "src/math/fmaximum_magf16.h" #include "src/__support/FPUtil/BasicOperations.h" #include "src/__support/common.h" #include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(float16, fmaximum_magf16, (float16 x, float16 y)) { return fputil::fmaximum_mag(x, y); } } // namespa...
ALGO
0.986729
6.715075
5dd4ced9-88f3-4529-b323-b17af8121966
2e2guk/ToolBox
query처리/LazySeg_nonrecur.cpp
// lazyseg 비재귀 구현 // https://www.acmicpc.net/blog/view/117 참고 /* 1. NodeType : node의 자료형. 2. LazyType : lazy값의 자료형. 3. F_Merge : (NodeType, NodeType)을 매개변수로 받아서 NodeType을 반환하는 Functor. 두 노드를 합치는 연산을 수행. 4. F_Update : (LazyType, NodeType)을 매개변수로 받아서 NodeType을 반환하는 Functor. 노드에 lazy값을 적용하는 연산을 수행. 5. F_Composition : (Laz...
ALGO
0.999941
5.531975
dbbab598-dc45-432b-b9b7-86934f91cae7
nindyaalifaaa/Tugas-Alogoritma
latihan37.cpp
//dibuat oleh nindya alifa //nim 240121053 // parametrik 2 variable #include <iostream> #include <iomanip> using namespace std; float luas( float panjang, float lebar ); //ini dia dua variabelnya int main() { float panjang_se, lebar_se, luas_se; cout << "program menghitung luas segiempat \n"; //input panjang dan l...
TOOL
0.98988
3.379299
0c8529fc-99c6-4526-b2be-a1dd4f074d48
opomerenk/cs2
debugging1.cpp
/** * @file debugging1.cpp * @author The CS2 TA Team <<EMAIL>> * @date 2014-2015 * @copyright This code is in the public domain. * * @brief An example of the utility of print statements in debugging. */ /** * The final computation is the product of a and b. */ #include <iostream> using namespace std; /**...
ALGO
0.97893
3.565638
699f0190-3d26-4dad-a16e-63b84f020b20
wenxiaoming/rabbitrender
third_party/llvm-10.0/llvm/lib/CodeGen/LoopTraversal.cpp
#include "llvm/CodeGen/LoopTraversal.h" #include "llvm/ADT/PostOrderIterator.h" #include "llvm/CodeGen/MachineFunction.h" using namespace llvm; bool LoopTraversal::isBlockDone(MachineBasicBlock *MBB) { unsigned MBBNumber = MBB->getNumber(); assert(MBBNumber < MBBInfos.size() && "Unexpected basic block number."); ...
ALGO
0.999203
7.633179
ce413245-963f-43ce-8f3c-7854e6cfb96f
yoonjaehee/STL-algorithm
src/graph/bak1753_dijkstra.cpp
#include <iostream> #include <vector> #include <queue> #include <climits> using namespace std; priority_queue<pair<int,int>> pq; vector<pair<int,int>> graph[20001]; int dist[20001]; void dijkstra(int st){ dist[st]=0; pq.push({0,st}); while(!pq.empty()){ // 내가 파악하기에 -를 붙이는 이유가 //사실 다음까지의 거리만 두고 봤을때 계산하기...
ALGO
0.999956
4.060931
3a77bcd3-73d2-424c-9cba-f925b71b5d97
ishandutta2007/codeforces
egor.lifar/normal/1575/L.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using db = long double; // or double, if TL is tight using str = string; // yay python! using pi = pair<int,int>; using pl = pair<ll,ll>; using pd = pair<db,db>; using vi = vector<int>; using vb = vector<bool>; using vl = vector<ll>; using vd = ve...
ALGO
0.999913
4.776001
956db4f9-42ac-4091-8072-d2a5987f5d6d
black-shadows/LeetCode-Topicwise-Solutions
C++/count-nodes-with-the-highest-score.cpp
// Time: O(n) // Space: O(n) class Solution { public: int countHighestScoreNodes(vector<int>& parents) { vector<vector<int>> adj(size(parents)); // Space: O(n) for (int i = 1; i < size(parents); ++i) { adj[parents[i]].emplace_back(i); } return iter_dfs(adj); } priv...
ALGO
0.999898
6.174809
7ebef60a-892f-4f78-b88a-ebf779dbb33f
sylcrq/leetcode
combinations.cpp
#include <vector> using namespace std; void combine_(int n, int k, int i, vector<int>& v, vector<vector<int> >& result); vector<vector<int> > combine(int n, int k) { vector<vector<int> > result; vector<int> v; combine_(n, k, 1, v, result); return result; } void combine_(int n, int k, int i, vecto...
ALGO
0.999969
5.088906
69b3c717-6d5c-496a-bffd-4fd5ee6ee28c
kyohei8937/ProgramingContest
Typical DP Contest/F_準急.cpp
#include <bits/stdc++.h> using namespace std; #define int long long const int INF = 1LL << 60; const int MOD = 1000000007; // マクロ #define rep(i,n) for(int i=0;i<n;++i) #define rep2(i,n,m) for(int i=n;i<m;++i) #define ALL(x) (x).begin(),(x).end() // 便利関数 // ...最小値・最大値交換 template<class T> inline bool chmin(T& a, T b) ...
ALGO
0.9999
3.974823
5e9a8618-e13a-4d54-8a0d-aaa8b7b03370
Aman-Manwani/MY-LEETCODE-DAILY-SUBMISSIONS
0020-valid-parentheses/0020-valid-parentheses.cpp
class Solution { public: bool isValid(string s) { stack<int>stk; for(int i=0;s[i]!='\0';i++) { char ch=s[i]; if(ch=='(' || ch=='{' || ch=='[') { stk.push(ch); }else if(ch==')') { if(st...
ALGO
0.999343
6.011315
eb80c1cb-4675-485c-8922-7005074f7d74
iagorrr/Competitive-Programming-Solutions
submissions/Codeforces/1328D.cpp
/*8<{==========~ BEGIN TEMPLATE ~============>8*/ #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "debug.cpp" #else #define dbg(...) #endif #define fastio \ ios_base::sync_with_stdio(0); \ cin.tie(0); #define all(j) j.begin(), j.end() #define rall(j) j.rbegin()...
ALGO
0.999991
3.992767
6d16fa47-5533-4a45-9228-4b6df5ac2558
jenkinnk/Mutation_Testing_Application
output/mutations/64/lucas.cpp
/* Joshua Breeden Section #1003 Assignment #8 * The following program is designed to read pairs of integers from a file using * Linux redirection. All of the integers in the file will be >= 1. The first number * in each pair (n1) will be >= the second number (n2). * For each pair of numbers the program will: * c...
ALGO
0.987277
6.082594
486ab209-6158-495c-babc-b3de6744be95
lucianmot/codechef-problems
746 - C++ - Black cells in a chessboard.cpp
// C++ - Black cells in a chessboard // Rating - 746 // https://www.codechef.com/problems/BLACKCEL #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << (n * n) / 2 << "\n"; return 0; }
ALGO
0.998474
4.825676
b528b893-5a73-46a4-b046-24dd3817da6a
kks227/BOJ
15900/15953.cpp
#include <cstdio> using namespace std; int main(){ int cnt[2][6] = {1, 2, 3, 4, 5, 6, 1, 2, 4, 8, 16, 0}; int prize[2][6] = {500, 300, 200, 50, 30, 10, 512, 256, 128, 64, 32, 0}; int T; scanf("%d", &T); for(int t=0; t<T; t++){ int result = 0; for(int i=0; i<2; i++){ int N, sum = 0; scanf("%d", &N); i...
ALGO
0.995213
3.186982
0e2faa0e-e9b4-4277-8673-de6ccdc863cf
Time1ess/MyCodes
LeetCode/657-Judge Route Circle/solution.cpp
// Author: David // Email: <EMAIL> // Created: 2017-08-15 08:33 // Last modified: 2017-08-15 08:33 // Filename: solution.cpp // Description: class Solution { public: bool judgeCircle(string moves) { int offset[2] = {0}; for(char move: moves) if(move == 'U' || move == 'D') ...
ALGO
0.999903
6.095694
8450e1e7-2257-43f1-9414-d431c22a18c4
right-x2/Algorithm_study
2812.cpp
#include <vector> #include <iostream> #include <stack> #include <algorithm> using namespace std; int n,m; int len; vector<int> v; stack<int> stk; stack<int> ans; int main(int argc, char** argv) { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; string str; cin>>n>>m; ...
ALGO
0.999993
3.633367
665e36e8-b64c-46b2-9832-a2426c3e8bd6
Anup050/DSA
2274-keep-multiplying-found-values-by-two/2274-keep-multiplying-found-values-by-two.cpp
class Solution { public: int findFinalValue(vector<int>& nums, int original) { unordered_set<int> s; for(int i : nums){ s.insert(i); } while(1){ if(s.find(original) != s.end()){ original *= 2; }else{ break; ...
ALGO
0.999978
5.821251
e5ab5abd-7684-4e20-b74f-a89d4584ba11
Deveshbhatla/Competitive-Questions
Bit Magic/Missing_Element.cpp
#include<bits/stdc++.h> using namespace std; int missing(int arr[],int n) { sort(arr,arr+n); for(int i=0;i<n-1;i++) { if(arr[i]+1!=arr[i+1]) return arr[i]+1; } return 0; } //XOR Method int Missing_XOR(int arr[], int n) { int x1 = arr[0]; int x2 = 1; for (int i = 1; i < n;...
ALGO
0.999912
4.366221
12f96b9d-14e1-42c1-b832-2cfad09a3104
championballer/PlacementPrep
ibit/Day31DP1/Min Jumps Array.cpp
int solve(vector<int> & A, int i, int * dp) { if(i>=A.size())return 0; if(dp[i]!=-1)return dp[i]; int mn = INT_MAX; for(int j=A[i];j>0;j--) { int sans = solve(A,i+j,dp); if(sans==INT_MAX)continue; else sans++; if(sans<mn)mn = sans; } dp[i] = mn; retur...
ALGO
0.999997
4.737542
372fbc8e-d084-4526-91f1-2642198ae0b3
Shah-Shishir/Codeforces-Solutions
205A. Little Elephant and Rozdil.cpp
/*** Bismillahir Rahmanir Rahim Read in the name of Allah, who created you!!! Author : Shah Newaj Rabbi Shishir, Department of CSE, City University, Bangladesh. ***/ #include <bits/stdc++.h> using namespace std; #define ebar_khela_hoppe int main (void) #define bair...
ALGO
0.999825
3.416066
a0a256c6-f6d7-4bfc-b0fd-a7524638497b
ALGOREX-PH/TIGERTIDES-FORMS-IN-C-KYU-8
Jenny's_secret_message.cpp
#include <iostream> #include <string> using namespace std; std::string greet(std::string name) { if(name == "Johnny") { return "Hello, my love!"; } else{ return "Hello, " + name + "!"; } } int main (){ std::string input = "Jim"; std::string result = greet(input); cout << result << endl; }
TOOL
0.888704
5.10292
580ae679-a325-451d-878b-516e10ec8d92
dhyeybm/dsa
postfix.cpp
#include <bits/stdc++.h> using namespace std; int n = 100; void push(char s[],int &top,char ch) { if(top == n-1) { cout<<"Overflow"<<endl; return; } s[++top] = ch; } char pop(char s[],int &top) { if(top == -1){ cout<<"Underflow"<<endl; return 0; } return s[top--]; } int f(char ch) { if(ch == '+'|| ch =...
ALGO
0.999946
4.297715
fd53e484-4230-4dd6-a74d-5276df4b6d84
in-silico/Maratones-src
ICPC/2009/Latinoamerica/Regional/dinner.cpp
#include <iostream> #include <algorithm> using namespace std; struct Entrada { int h, m, s; char e; int act; bool iniciada; bool operator<(const Entrada &o) const { if(h == o.h) { if(m == o.m) { return s < o.s; } return m < o.m; } return h < o.h; } }; Entrada entradas[65000]; int n; i...
ALGO
0.999711
3.697757
a4ceb8e7-dc5b-4d1a-a3ec-e9b7af1cc971
BitStashBlockchain/BitStash-Core
src/crypto/hmac_sha512.cpp
#include <crypto/hmac_sha512.h> #include <string.h> CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen) { unsigned char rkey[128]; if (keylen <= 128) { memcpy(rkey, key, keylen); memset(rkey + keylen, 0, 128 - keylen); } else { CSHA512().Write(key, keylen).Finalize(...
ALGO
0.93776
5.726457
9858cb9a-9440-4afa-adb4-a63d0f37e558
GuideWsp/ncnn-lite
src/layer/deconvolution.cpp
#include "deconvolution.h" #include <algorithm> #include "layer_type.h" #include "cstl/utils.h" DEFINE_LAYER_CREATOR(Deconvolution) Deconvolution::Deconvolution() { one_blob_only = true; support_inplace = false; } int Deconvolution::load_param(const ParamDict& pd) { num_output = pd.get(0, 0); kernel...
DATA
0.934704
4.560322
d5dbbb7f-5ca8-4932-8d96-fdd704f5047d
soikot-shahriaar/Algorithms
ProblemSolving/Easy Problems/3_Helpful_Maths.cpp
// Problem Link: // https://vjudge.net/contest/575161#problem/C #include <iostream> #include <algorithm> using namespace std; int main() { int arr[1001]; string s; cin >> s; int count = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == '+') { continue; } ...
ALGO
0.999983
4.45277
d5bc334e-74f5-4346-9c7d-28e5b6f852ca
DomenicaMinervini/LSN_Domenica_Minervini
Esercitazione_08/Esercizio_08.2/funzioni.cpp
/************************************************************* ************************************************************** _/ _/ _/_/_/ _/ Numerical Simulation Laboratory _/_/ _/ _/ _/ Physics Department _/ _/_/ _/ _/ Universita' degli Studi di Milano _/ _/ _/ ...
ALGO
0.99993
5.892385
e53dc9b1-e3ce-42ab-a7d9-6655047670c4
Ankush-Pathak/FaaSOnIoT
core/data_xchange/Thirdparty/boost_1_80_0/libs/graph/example/print-in-edges.cpp
using namespace boost; template < typename Graph, typename VertexNamePropertyMap > void read_graph_file(std::istream& graph_in, std::istream& name_in, Graph& g, VertexNamePropertyMap name_map) { typedef typename graph_traits< Graph >::vertices_size_type size_type; size_type n_vertices; typename graph_t...
ALGO
0.924508
5.865355
6b458fde-e893-48d3-aeb6-b301012e0bc8
ishandutta2007/codeforces
thebes/normal/1416/A.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int,int> pii; #define F first #define S second #define pb push_back const int MN = 3e5+5; vi elem[MN], go[MN]; int T, N, i, j, arr[MN], ans[MN], vs[MN]; int main(){ scanf("%d",&T); while(T--){ scanf("%d",&N);...
ALGO
0.999777
3.90319
eff7d4a7-5f43-4e1c-a638-263e57924c74
malaksayour/hslam-dev
src/FSLAM/Thirdparty/opencv-3.4.6/modules/features2d/src/fast.avx2.cpp
/* The references are: * Machine learning for high-speed corner detection, E. Rosten and T. Drummond, ECCV 2006 * Faster and better: A machine learning approach to corner detection E. Rosten, R. Porter and T. Drummond, PAMI, 2009 */ #include "precomp.hpp" #include "fast.hpp" #include "opencv2/core/hal/intrin.h...
ALGO
0.997341
6.415898
af60e9fc-ed11-4539-a628-147cca86dffb
Fidayeenseen/-for-oops-lab
71-01-recursive-function.cpp
#include <iostream> using namespace std; void fun(int n) { if (n > 0) { cout << n << endl; fun(n - 1); } } int main() { int x = 5; fun(x); }
ALGO
0.999867
4.61828
af1426e4-e6c5-4dd8-b8f0-64f3bee228ad
KirillAlekseeenko/Xonix
Classes/ArcList.cpp
// // ArcList.cpp // TuturialProject // // Created by Кирилл Алексеенко on 15.09.15. // // #include "ArcList.h" CircularList::~CircularList() { Unit *p = this->_end; Unit *p_; this->_begin->prev = nullptr; while(p != nullptr) { p_ = p; p = p->prev; delete p_; } } vo...
TOOL
0.965785
4.273123
5db83d74-4b7e-44d9-a1b6-642861b53320
cwang588/algorithms
cf zealots/CF Zealots Problem Set #44 (Div. 2)/C.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ int k,n; cin>>k>>n; int now=1; cout<<now<<" "; for(int i=1;i<k;++i){ now+=i; if(i+1+n-now>=k)cout<<now<<" "; else{ now-=i; for(int j=1;j<=k-i;++j)cout<<now+j<<" "; break; } } cout<<"\n"; } re...
ALGO
0.99987
3.666403
16cd0d61-ad66-4b1e-9769-ce7fbb160981
Refstop/VSLAM_Example
3rdparty/gtsam/gtsam_unstable/discrete/AllDiff.cpp
/* * AllDiff.cpp * @brief General "all-different" constraint * @date Feb 6, 2012 * @author Frank Dellaert */ #include <gtsam/base/Testable.h> #include <gtsam_unstable/discrete/AllDiff.h> #include <gtsam_unstable/discrete/Domain.h> #include <boost/make_shared.hpp> namespace gtsam { /* **************************...
ALGO
0.998087
7.677444
3a2dc467-eaf1-4801-88a4-0fac3c12e2b5
Manraj-Mann/Hacktoberfest-DSA-Codes
C++/Stacks/Questions/ques8.cpp
// How do we implement two stacks using only one array? Our stack routines // should not indicate an exception unless every slot in the array is used? #include <iostream> #include <climits> using namespace std; class Stack { private: int m_top1= -1; int m_top2; int capacity; int *arr; public: Sta...
ALGO
0.999052
4.48677
85cd239a-4527-4449-9060-ba8ecc564fd9
oud3noida/BOJ
16954/main.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; struct Position { int x, y; Position(int x, int y) : x(x), y(y) {} }; constexpr int MAX = 8; constexpr int DX[9] = {-1, -1, -1, 0, 1, 1, 1, 0, 0}, DY[9] = {-1, 0, 1, 1, 1, 0, -1, -1, 0}; constexpr char BLANK = '.',...
ALGO
0.999823
4.906253
aaf62aba-0331-4e06-a907-b4ac9e5b2b8e
zulqar1nain/week9
task17.cpp
#include <iostream> using namespace std; main() { string name; getline(cin, name); int x, j; int idx = 0; while (name[idx] != '\0') { j = 0; if (name[idx] == 'a' || name[idx] == 'e' || name[idx] == 'i' || name[idx] == 'o' || name[idx] == 'u' || name[idx] == 'A' || name[idx] == 'E...
ALGO
0.999064
4.343634
50a49da6-7c6e-4728-9347-08f5b083f284
Abhilash-0322/cpp_ds
trie.cpp
#include <iostream> #include <unordered_map> using namespace std; struct TrieNode { bool isEndOfWord; unordered_map<char, TrieNode*> children; TrieNode() { isEndOfWord = false; } }; class Trie { private: TrieNode* root; public: Trie() { root = new TrieNode(); } // Fu...
ALGO
0.999862
7.121485
3d0164de-c689-4ca2-9a89-874fed8e7f5d
garrylachman/mac-gpu-miner
xmr-stak/xmrstak/misc/utility.cpp
#include <algorithm> #include <string> namespace xmrstak { bool strcmp_i(const std::string& str1, const std::string& str2) { if(str1.size() != str2.size()) return false; else return (str1.empty() | str2.empty()) ? false : std::equal(str1.begin(), str1.end(), str2.begin(), [](char c1, char c2) { return ::tolow...
TOOL
0.925189
5.05984
1a330e18-2f0e-4a53-8225-1a5dba5e1f81
trantrongnb/Lap_Trinh_DSA_PTIT
dsa03027.cpp
#include<iostream> #include<cstring> #include<vector> #include<algorithm> #include<utility> #include<stack> #include<math.h> #include<queue> #include<set> #include<unordered_map> #include<cstdio> using namespace std; typedef long long ll; int main(){ int n;cin>>n; ll a[n+1]; ll ans=0; for(int i=1;i<=n;i...
ALGO
0.999917
3.333949
cffa8e2d-171b-4846-bfcf-fdaffb281372
raincross7/code-similarity
codes/train_code/problem380/problem380_461.cpp
#include <bits/stdc++.h> #define int long long #define fast_io(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define loop(i,a,b) for(int i=a;i<b;i++) #define all(x) x.begin(),x.end() #define us unordered_set #define um unordered_map #define ms multiset #define mm multimap #define pb push_back #define pf pu...
ALGO
0.999948
3.529577
502cf4b3-f0d3-4690-9225-fe15cfdcee45
jeete121/Coding
Programs/Practice/Prac/GraphAlgorithms/binary_number_with_alternate_bits.cpp
#include <bits/stdc++.h> using namespace std; string toBinary(int n) { string res = ""; while (n > 0) { if (n % 2 == 0) res = '0' + res; else res = '1' + res; n = n / 2; } return res; } bool hasAlternatingBits(int n) { string str = toBinary(n); ...
ALGO
0.999943
5.369406
39c88d15-eea0-4798-b124-f3c309fbb87d
Hdhingra1/Strivers-SDE-Sheet-Challenge
117.cpp
#include <bits/stdc++.h> /************************************************************ Following is the Binary Tree node structure: class BinaryTreeNode { public : T data; BinaryTreeNode<T> *left; BinaryTreeNode<T> *right; BinaryTreeNode(T data) { this -> d...
ALGO
0.999995
5.455534
a7efa7db-9b05-4800-a2e7-ec1cd227189b
SunilChauhan2/CODE-MARATHON
DAY11.cpp
// Question 1: Write a program that accepts an integer n (where n >=2) and print all the prime factors of n using recursion. // Sample Input // 24 // Sample Output // 2 // 2 // 2 // 3 // Constraints : Do not declare any global variables. Do not use any loops; you must use recursion. You can declare as many primitive va...
ALGO
0.999642
5.91359
af052859-0ee7-4a20-bdfe-bc4f8314af2d
yash-93/Coding-Practice
Leetcode/June Challenge 2020/Week 1/528. Random Pick with Weight.cpp
class Solution { public: vector<int> v; Solution(vector<int>& w) { v.push_back(w[0]); for(int i=1;i<w.size();i++){ v.push_back(v[i-1]+w[i]); } } int pickIndex() { auto it = upper_bound(v.begin(),v.end(),rand()%v.back()); return it-v.begin(); } };
ALGO
0.999915
5.349316
1a31f06a-3d5d-4473-bbf7-7446f26446df
ryanzhang15/RJ_HKOI
M1731.cpp
#include <bits/stdc++.h> #define ef else if using namespace std; typedef long long _; typedef const long long constant; constant mod = 1E9+7; constant big = 1E5; constant maxn = big+8; constant srt = 320; _ n, o[maxn]; _ fc[maxn], iv[maxn]; struct qr { _ a, b, id; bool operator < (const qr &y) const { return a ...
ALGO
0.999707
3.957088
86814cfe-12d6-44e3-9afe-bc8ebfb7f478
sohanur-rahman0/OnlineJudge-Solution
CodeForces/CF 1304B. Longest Palindrome.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n,m; cin>>n>>m; string arr[n]; for(int i=0; i<n; i++) { cin>>arr[i]; } string first="",last="",middle="",t,f; for(int i=0; i<n; i++) { t = arr[i]; reverse(t.begin(),t.end()); if(arr[i]==t) ...
ALGO
0.999991
3.284449
07f3e340-9107-46a0-bb40-a39ec0ecf452
jxhe/efficient-knnlm
fairseq/clib/libnat/edit_dist.cpp
#include <torch/torch.h> // @manual=//caffe2:torch_extension #include <pybind11/detail/common.h> #include <pybind11/pybind11.h> #include <vector> #include <algorithm> #include <cstdint> #include <iosfwd> #include <memory> #include <new> #include <string> #include <utility> using namespace ::std; vector<vector<uint32_...
ALGO
0.996817
7.077991
97329553-1842-4299-80fa-7d15c0ab6baf
evasabeeh/DSA
MATH/divisors.cpp
#include<bits/stdc++.h> using namespace std; void divisors(int n){ for(int j=1;j<=sqrt(n);j++){ if(n%j==0){ cout<<j<<" "; if(j!=n/j) cout<<n/j<<" "; } } } int main(){ int n=36; divisors(n); return 0; }
ALGO
0.999438
4.757787
43afb9b8-932a-4b3b-959b-ae1226b71814
raincross7/code-similarity
codes/train_code/problem208/problem208_234.cpp
#include<iostream> #include<vector> #include<algorithm> #include<functional> #include<queue> #include<stack> #include<set> #include<map> #include<unordered_map> #include<climits> #include<cstdlib> #include<cmath> #include<string> #include<iomanip> using namespace std; #define INF 1 << 29 #define LL long long int LL ...
ALGO
0.999915
3.123895
17261ea0-dc4b-4430-89aa-2b1c27042a6e
tic40/atcoder
abc/abc356/e/main.cpp
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0;i<n;i++) #define endl '\n' using ll = long long; const int M = 1e6; int main() { ll n; cin >> n; vector<int> c(M+1); REP(i,n) { int a; cin >> a; c[a]++; } // 累積和 vector<int> s(M+2); REP(i,M+1) s[i+1] = s[i]+c[i]; auto...
ALGO
0.999846
3.959701
e1dc8ccb-5e0a-402e-b823-fbcf12b6725f
dl8sd11/BiTCoin
contest_archive/hp_2019/pD.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<int, ll> pil; typedef pair<ll, int> pli; typedef pair<double,double> pdd; #define SQ(i) ((i)*(i)) #define MEM(a, b) memset(a, (b), sizeof(a)) #define SZ(i) int(i.size()) #define FOR(i, ...
ALGO
0.999994
3.752524
8a84afe2-864b-4b07-9c12-673d66a00ec2
alokpandeygzp/GFG-Leetcode
1598-crawler-log-folder/1598-crawler-log-folder.cpp
class Solution { public: int minOperations(vector<string>& logs) { int rootDist=0; for(string log: logs) { if(log[0]=='.' && log[1]=='.') { if(rootDist==0) rootDist=0; else rootDist--; } else if(log[0]=='.' && log[1]=='/') { ...
ALGO
0.99601
5.093505
212c1b03-0e05-47cc-b133-937fd07c963c
Lzww0608/NewCoder
Month 84/D.cpp
//https://ac.nowcoder.com/acm/contest/72389/D #include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <string> #include <unordered_map> using namespace std; int main() { int n, q; cin >> n >> q; string s; cin >> s; vector<int> prefix01(n, 0); for (int i = 1; i < n; ++i) { prefix01[...
ALGO
0.999918
4.530306
feb07e82-3b2d-475d-bc8a-1d837fb659a5
BENDENG1/FourCppAlgorithmStudy
2023_08/WEEK3/노균욱_스킬트리.cpp
/* 맵써서 인덱스 안맞으면 퇴출 */ #include <string> #include <vector> #include <map> using namespace std; int solution(string skill, vector<string> skill_trees) { int answer = 0; map<char,int> m; for(int i = 0; i < skill.length();i++){ m[skill[i]] = i + 1; } for(int i = 0; i < skill_trees.si...
ALGO
0.999775
4.791826
d411dd4d-6afb-4a4b-b066-668c348e2e1d
GrinilaMonkey/Csc_CIS_17A_
Class/MarkSort_DynamicMemory/main.cpp
/* * File: main.cpp * Author: Dr. Mark E. Lehr * Created on Sept 20th, 2021 1pm * Purpose: Dynamic Memory */ //System Libraries #include <iostream> //Input/Output Library #include <cstdlib> //Random function location #include <ctime> //Time Library using namespace std; //STD Name-space where Librar...
ALGO
0.998656
4.355853
3782a3aa-fe21-44de-add6-01fbef5bd252
sergiobuj/campari_royal
computacion Grafica/practica 2/sarcilav-ray-tracer-6e21ae1d405c2184b33e9b67f7d0dcabd92f5995 copy/src/tracescene.cpp
#include "lib/primitives.h" Vector* GenerateRayDirectionTable() { Vector *direction = new Vector[640*480]; for(int y=0; y<480; y++) for(int x=0; x<640; x++) { Vector &currDirection = direction[x+y*640]; currDirection.x = x - 320; currDirection.y = y - 240; currDirection.z = 58+.4*sqrt( (x-320)*(x-32...
TOOL
0.870993
3.516656
4a7089f8-282d-4f68-9f4d-d9deb8e17aac
ifranco07/SIMP
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
07a01163-8b7c-4c9e-8143-d1f5bc65accc
Ahmed8881/PD
week5/pf5/task10.cpp
#include <iostream> using namespace std; string NumberToText(int number); main() { int number; cout << "Enter a number (1-99): "; cin >> number; string text = NumberToText(number); cout << text; } string NumberToText(int number) { string result; if (number >= 20) { int tens = nu...
TOOL
0.963753
5.885318
6b10e069-a17a-4193-844e-e1ccbd6e39c3
YousufAzadSami/Codes-From-Bachelor
CodesC/cse 1.1/2.1 contest, team_dark/d1.cpp
#include<stdio.h> int main() { int nB,nG,mB,mG,T, facOfnB, facOfmB, facOfnG, facOfmG,facOfDiff1, facOfDiff2, factResult1, factResult2, i; while(scanf(" %d %d %d %d %d", &nB, &mB, &nG, &mG, &T)!= EOF) //scanf(" %d %d %d %d %d", &nB, &mB, &nG, &mG, &T); { facOfnB=facOfmB=facOfnG=facOfmG=facOfDiff1= facOfDiff...
ALGO
0.999661
3.761359
f1dc292a-778b-4715-9e14-7354b06f4c76
Husainbw786/LeetCode
Insert an Element at the Bottom of a Stack - GFG/insert-an-element-at-the-bottom-of-a-stack.cpp
//{ Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution{ public: stack<int> insertAtBottom(stack<int> &st,int X){ if(st.empty()) { st.push(X); return st; ...
ALGO
0.999946
5.198879
a4d4a8ac-f6a5-42e5-a5df-eccadf99d95d
Xander621/SKR-Mini-E3-V1.2
firmware/V1.2/Marlin-2.0.x-SKR-Mini-E3-V1.2/Marlin/src/gcode/probe/G38.cpp
#include "../../inc/MarlinConfig.h" #if ENABLED(G38_PROBE_TARGET) #include "../gcode.h" #include "../../module/endstops.h" #include "../../module/motion.h" #include "../../module/stepper.h" #include "../../module/probe.h" inline void G38_single_probe(const uint8_t move_value) { endstops.enable(true); G38_move =...
ALGO
0.912251
7.700907
b255254c-02fd-41b8-89b6-3b88ee0248b3
naman-ptdr/A2Z_DSA
13_BinaryTree/3_HardProblems/06_MinimmumTimeTOBURN.cpp
// Mapping Parents: bfsTomapParent function to map each node to its parent and find the target node. // Finding Maximum Time: findMaxTime function to compute the time it takes to burn the entire tree starting from the target node. // We need to ensure that the Node structure and all functions are properly defined and t...
ALGO
0.999934
7.518676
12f6b311-d32e-4c26-92bf-24471addeb11
hiepcanhcut/CTDL-GT-PTIT
DSA02001.cpp
#include<bits/stdc++.h> using namespace std; int a[11],n; void print(int m) { cout<<"["; for(int i=1;i<=m;i++) { if(i==m) cout<<a[i]; else cout<<a[i]<<" "; } cout<<"]"; cout<<"\n"; } void tryAt(int n) { print(n); for(int i=1;i<n;i++) a[i]+=a[i+1]; if(n-1) tryAt(n-...
ALGO
0.999089
3.890755
f9b6d9f4-82dc-4169-8d1c-f51ff449a5f8
online5880/Programmers
Level_00/31_콜라츠 수열 만들기/31_콜라츠 수열 만들기.cpp
#include <vector> using namespace std; vector<int> solution(int n) { vector<int> answer; answer.emplace_back(n); while (n != 1) { if (n & 1) { n = (n * 3) + 1; answer.emplace_back(n); } else { n = (n /= 2); answer.e...
ALGO
0.999989
5.810264