uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
f39f58ad-e8f9-4314-a2df-d088437a14de
PaukIsUha/optimizing_formating_code
predictions/submissions-aizu-cot-gpt4/Codenet/p02528/125342033/response_3.cpp
#include <algorithm> #include <iostream> #include <sstream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, i, f; int A[1000001]; cin >> n; for (i = 0; i < n; i++) cin >> A[i]; sort(A, A + n); stringstream output; for (i = f = 0; i < n; i++) ou...
ALGO
0.999805
4.755695
1c56cc98-fd87-4a2a-aaaa-27eb2d152d6d
bieddes-blade/useful-code
adding_one_tree_to_another_plus_sum_query.cpp
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> using namespace std; typedef long long ll; int n, q; vector<ll> tree_a, tree_b; vector<ll> a, b, flag; void build_a(int v, int tl, int tr) { if (tl == tr) tree_a[v] = (tl < a.size() ? a[tl] : 0); else { int tm =...
ALGO
0.999958
4.203959
8e2156e7-f55a-485c-93d3-26c1d1b6582a
geoffrey-anto/leetcode-solutions
2054-the-number-of-the-smallest-unoccupied-chair/solution.cpp
class Solution { public: int smallestChair(vector<vector<int>>& times, int targetFriend) { set<int> availSeats; int seatNumber = 0; priority_queue<pair<int, int>, vector<pair<int, int>>, greater<>> occupSeats; int trgtFrndArrTime = times[targetFriend][0]; sort(times....
ALGO
0.999985
5.864847
687de84a-3cfe-4f6b-a626-a8563e051767
muskan-meena/ocd
day 28.cpp
ques 1 (has a cycle) TC=O(n) SC=O(1) class Solution { public: bool hasCycle(ListNode *head) { if (!head || !head->next) return false; ListNode *slow = head; ListNode *fast = head; while (fast && fast->next) { slow = slow->next; fast = fast->next...
ALGO
0.999814
5.54676
32217045-54f7-4a88-8394-e7e733c8e54c
axelzucho/facial_recognition
FaceAligner/main.cpp
#include "facial_extractor_tools.h" #include "Aligner.h" #include "FaceLandmarkDetector.h" #include "FaceAligner.h" using cv::Mat; using std::string; using dlib::full_object_detection; using cv::Size; using dlib::rectangle; void example(int argc, char **argv, const string &path_to_image, const string &path_to_model, ...
TOOL
0.866377
5.324872
bb90e0a9-05ad-4cf7-a64e-8e3807198889
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_9205_990.cpp
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; cout << a + b << endl; }
ALGO
0.996868
3.646245
4b71217f-6cb0-4518-aec3-1297c96a3bfd
theo022002/Scientific-Computing
Direct Methods for Linear Systems/LU_method/error.cpp
// sdi2000014 - Theodora Archontaki // #include "Functions.h" vector<long double> matrixVectorProduct(vector<vector<long double>> A, vector<long double> x) //Kanei ton pollaplasiasmo enos nxn pinaka me enan nx1 pinaka { size_t m = A.size(); size_t n = A[0].size(); vector<long doub...
ALGO
0.998293
4.058306
d457ea56-bde0-4494-946b-1bb42c2454ba
konstatoivanen/PKRenderer
PKRenderer/Source/App/Engines/EngineEntityCull.cpp
#include "PrecompiledHeader.h" #include "Core/Math/FunctionsIntersect.h" #include "Core/Math/FunctionsMisc.h" #include "Core/Math/FunctionsMatrix.h" #include "Core/ECS/EntityDatabase.h" #include "Core/RHI/Structs.h" #include "App/ECS/EntityViewScenePrimitive.h" #include "EngineEntityCull.h" namespace PK::App { Eng...
ALGO
0.926637
7.695214
748b57fc-28a3-4bf8-bcfb-9ed974e00203
adrian-budau/work
Codeforces/Spala training camp, Wroclaw contest/I/main.cpp
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <queue> #include <cstring> using namespace std; int S, D; const int kMaxN = 1000; int cap[kMaxN][kMaxN], from[kMaxN]; vector<int> E[kMaxN]; bool bfs() { queue<int> Q; Q.push(S); memset(from, -1, sizeof(from)); from...
ALGO
0.99989
4.581714
f2737225-8207-45e8-97b9-3b0d0d5a16e5
ovidiuparvu/Mule-dev
Multiscale/modules/util/sample/LineCircleIntersectionSample.cpp
#include "multiscale/util/Geometry2D.hpp" #include <iostream> using namespace multiscale; // Print the points from the std::vector void printPoints(const std::vector<cv::Point2f> &points) { std::cout << "=========== cv::Points ===========" << std::endl; for (const cv::Point2f &point : points) { std...
ALGO
0.96527
5.765242
da954e80-8a7b-485f-82bd-75336415abe8
hawkwood/cocos2dx-helloWorld-tvOS
tvapp/cocos2d/cocos/platform/winrt/CCWinRTUtils.cpp
#include "CCWinRTUtils.h" #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 #endif #include <Windows.h> #include <wrl/client.h> #include <wrl/wrappers/corewrappers.h> #include <ppl.h> #include <ppltasks.h> #include <sstream> using namespace Windows::UI::Xaml; using namespace Windows::UI::Xaml::Controls; NS_CC...
TOOL
0.98588
6.062138
fcbbc19d-797d-4ac8-bd46-c4b7049f1ab7
Borked3DS/dynarmic
src/dynarmic/common/fp/op/FPRoundInt.cpp
#include "dynarmic/common/fp/op/FPRoundInt.h" #include <mcl/assert.hpp> #include <mcl/bit/bit_field.hpp> #include <mcl/stdint.hpp> #include "dynarmic/common/fp/fpcr.h" #include "dynarmic/common/fp/fpsr.h" #include "dynarmic/common/fp/info.h" #include "dynarmic/common/fp/mantissa_util.h" #include "dynarmic/common/fp/p...
ALGO
0.973569
7.295459
d40d1110-6f49-4f06-be9f-3743a81ded34
vsricharan16/cp
practise/lcmchallenge.cpp
/*I shall rise*/ #include<bits/stdc++.h> using namespace std; #define rep(i,n) f(i,0,n) #define charan int main() #define vi vector< int > #define vl vector< ll > #define vii vector<pii> #define vll vector<pll> #define viii vector<tri> #define tri pair<int,pii> #define ll long long #define pb push_back #define mp make_...
ALGO
0.999991
4.6113
cd2f9151-87d7-4887-84bc-24732c83b2a8
Ehsan-aghapour/LW-GA
DVFS-Delay/Perf2/DVFS_Delay_perf.cpp
// + #define CL_TARGET_OPENCL_VERSION 200 #define CL_HPP_TARGET_OPENCL_VERSION 110 #define CL_HPP_MINIMUM_OPENCL_VERSION 110 #include <CL/cl2.hpp> #include <dlfcn.h> #include "../OpenCL.h" #include <chrono> #include <thread> #include <ctime> #include <iostream> #include <chrono> #include <cmath> #include <vector> #inc...
ALGO
0.988827
5.526055
f065d58b-8254-4575-bdca-6d800a06db4d
shhebing/walberla
tests/lbm/evaluations/PermeabilityTest.cpp
#include "blockforest/all.h" #include "core/all.h" #include "domain_decomposition/all.h" #include "field/all.h" #include "geometry/all.h" #include "lbm/all.h" #include "timeloop/all.h" namespace walberla { using flag_t = walberla::uint8_t; using FlagField_T = FlagField<flag_t>; enum Scenario { BCC }; // constants f...
ALGO
0.998833
6.751914
20842234-47ee-479c-908e-21ad3567740d
daddasd/MyProject
src/FaceID.cpp
#include "myconfig.h" uint8_t FACE_REGISTRATION[] = {0XEF, 0XAA, 0X13, 0X00, 0X00, 0X00, 0X00, 0X13}; // ע uint8_t ON_BACKLIGHT[] = {0XEF, 0XAA, 0XC1, 0X00, 0x00, 0x00, 0x01, 0X01, 0XC3}; // ʾ uint8_t OFF_BACKLIGHT[] = {0XEF, 0XAA, 0XC1, 0X00, 0x00, 0x00, 0x01, 0X00, 0XC2}; // رʾ uint8_t RECOGNITION[] = {0xEF, 0xAA...
TOOL
0.893249
3.052702
ee875ffa-801e-4d53-b3b3-14a332ef2131
videogamesrockp/Codeforces-Solutions
Codeforces Round 995 (Div. 3)/E - Best Price/main.cpp
#include <bits/stdc++.h> using namespace std; void solve() { int n, k; cin >> n >> k; vector<int> a (n); vector<int> b (n); for (int i = 0; i < n; i ++) { cin >> a[i]; } for (int i = 0; i < n; i ++) { cin >> b[i]; } sort(a.begin(), a.end()); sort(b.begin(), b.end()); long long ans = 0; for (int i = ...
ALGO
0.999907
3.707357
55b1f5b4-fd28-4285-bb20-4ab038ad1635
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_3898_2.cpp
#include <bits/stdc++.h> using namespace std; template <typename T> inline int popcount(T t) { if (std::numeric_limits<T>::digits <= std::numeric_limits<unsigned int>::digits) { return __builtin_popcount(t); } else { return __builtin_popcountll(t); } } const long double EPS = 1e-8; const long double...
ALGO
0.999821
3.7746
3adb45f2-2b3c-40b9-aa63-67eea3335c27
ManasviGaur/Competitive-Programming-Solutions
CodeChef/C++17/CLPNT/35662509.cpp
#include <bits/stdc++.h> #define ll long long int #define ld long double #define pb push_back #define vi vector<int> #define vl vector<ll> #define fo(i,a) for(ll i=0;i<a;i++) #define Fo(i,a,n) for(ll i=a; i<n; i++) using namespace std; ll n,m,k,x; void solve(){ cin>>n; vi a(n); fo(i,n){ cin>>a[i];...
ALGO
0.99987
4.354306
45608f18-4e1f-4024-b389-bd8f3974da59
PunnyOz2/POSN-Programming
Sunday/Cycleonomnipeat.cpp
/* TASK: LANG: CPP AUTHOR: Pun~ SCHOOL: CRU */ #include<bits/stdc++.h> using namespace std; unordered_map<int,int> mp; int a[100100]; int main() { int q,n,i,num,ch,now,nownum; scanf("%d",&q); while(q--){ scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); ...
ALGO
0.999835
4.104276
3ff7507a-f2d0-4b7f-8440-f43b420feb3a
osu-crypto/BaRK-OPRF
thirdparty/win/miracl/miracl_osmt/source/ake8cpt.cpp
/* Scott's AKE Client/Server testbed See http://www.compapp.dcu.ie/research/CA_Working_Papers/wp02.html#0202 Compile as cl /O2 /GX /DZZNS=16 ake8cpt.cpp zzn8.cpp zzn4.cpp zzn2.cpp ecn4.cpp big.cpp zzn.cpp ecn.cpp miracl.lib Fastest using COMBA build for 512-bit mod-mul Cocks-Pinch Curve - Tate pai...
ALGO
0.998338
3.597589
3b54f61f-22bb-4c59-8658-461bd9c71f5a
Souma-cpp/Cpp-Journey
L46_to_L50/Linked_List/sort_0s_1s_2s.cpp
#include<iostream> using namespace std; class Node { public: int data; Node* next; Node(int data) { this->data = data; this->next = nullptr; } }; void insert_at_tail(Node* &tail, int data) { Node* newNode = new Node(data); tail->next = newNode; tail = newNode; } void sort_...
ALGO
0.999998
5.588451
8b3a0723-7ceb-4034-8840-722c94afef9c
Mesoma/hope_for_humanity
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.998799
6.776823
2a9e73a6-9d08-432b-9532-f1f685fad7a8
jatin69/coding-practice
codechef/codechef-2017/SPIT1503/main.cpp
#include<iostream> #include<cmath> using namespace std; int main() { int n,len; cin>>n; while(n--) { cin>>len; char* str = new char[len]; cin>>str; int noOfStrs=pow(2,(len-2)); if(len%2==0) noOfStrs+=1; if(len==1){ noOfS...
ALGO
0.999986
3.131005
3e9a88f5-1616-4572-b238-4ebcfa4980d2
xgh127/Leetcode
.history/63.不同路径-ii_20230529140111.cpp
/* * @lc app=leetcode.cn id=63 lang=cpp * * [63] 不同路径 II */ // @lc code=start class Solution { public: int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) { //dp[i][j] = dp[i-1][j]+dp[i][j-1] int m = obstacleGrid.size(); int n = obstacleGrid[0].size(); vector<vect ...
ALGO
0.998889
5.222242
7b61a5f5-50de-47b7-95c1-e4f4e1e29a6b
ishandutta2007/codeforces
vercingetorix/normal/1146/B.cpp
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <ctype.h> #include <queue> #include <cstring> #include <set> #include <bitset> #include <map> #include <chrono> #include <random> #include <unordered_map> #include <stdio.h> using namespace std; typedef long long ll; typedef long do...
ALGO
0.997533
3.158969
897dfdd5-5e26-4858-9276-41fad2db9ef1
qpanx/Programming-advices-course
Course3/problem#39/problem#39/problem#39.cpp
#include <iostream> using namespace std; int main() { float a; float b; cout << "Totalbill substric cashpaid\n"; cin >> a >> b; float total = b - a; cout << "The result is: " << total << endl; }
ALGO
0.930223
3.2231
95d06d28-2bec-4836-bb69-5da485f4d470
ishandutta2007/codeforces
purplecrayon/normal/1247/C.cpp
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; void fsc(int &x){ register int c; x = 0; c=getchar()...
ALGO
0.999943
3.327961
aa3da470-85d2-4e54-a6ff-8a7f8056f06a
ishandutta2007/codeforces
moe.tsuki/normal/1523/D.cpp
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back #define mp make_pair #define all(x) begin(x),end(x) #define F(i,n) for (int i = 0; i < n; ++i) #define F1(i,n) for (int i = 1; i <= n; ++i) #define dbg(x) cerr << #x << " = " << x << endl #define dbgg(x) cerr << #x << " = " << x << ' ' #de...
ALGO
0.999933
3.607926
c6b41fcb-e1f3-4ee6-a569-badbedb943bf
vineelabhinav/oneDNN_m
src/cpu/x64/gemm/amx/jit_avx512_core_amx_gemm_kern.cpp
#include "cpu/x64/gemm/amx/jit_avx512_core_amx_gemm_kern.hpp" namespace dnnl { namespace impl { namespace cpu { namespace x64 { #define Bm rdi #define Bn rsi #define K rdx #define AO rax #define BO rbp #define LDC r13 #define I rcx #define FLAG r8 #define bm r9 #define bm0 r10 #define bm0w r10w #define bm1 r11 #defin...
ALGO
0.997196
5.240918
4c990c05-9d12-48a9-b854-1dd3e1c1b263
Abhishek-Sharma-1999/LeetCode-Solutions
125-valid-palindrome/125-valid-palindrome.cpp
class Solution { public: bool isPalindrome(string s) { if(s.size()==0) return true; string str=""; int i=0; while(i<s.size()) { if( (s[i]>='A' && s[i]<='Z') || (s[i]>='a' && s[i]<='z') || (s[i]>='0' && s[i]<='9') ) { str+=to...
ALGO
0.99978
6.221941
16aaaf3b-e861-40e0-99d1-57222596836c
AbhishekTiwari14/Neetcode_DSA
c++/basics/2e_design_ll.cpp
class Node{ public: int val; Node* next; Node* prev; //constructor Node(int val){ this->val = val; this->prev = NULL; this->next = NULL; } }; class MyLinkedList { public: Node* left; Node* right; MyLinkedList() { ...
ALGO
0.999971
5.423678
f8de31ee-5d35-4b9d-aa67-7b28810896f0
kavaneinfochips/Assignment
matrix.cpp
#include<iostream> using namespace std; class Matrix{ public: int rows; int columns; int a[3][3]={1,1,1,2,2,2,3,3,3}; int b[3][3]={1,1,1,2,2,2,3,3,3}; Matrix(){ rows=3; columns=3;} void no_of_row(int c){ rows=c; } void no_of_column(int d){ columns=d; } void entry(int r,int c,int d,int e){ if(e==1){ ...
ALGO
0.999122
3.388412
50e79edb-0930-42db-9cf6-f36bbdf439ad
Franklyn-S/Metodos2
eigenLib/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Eigen::MatrixXf m(2,4); Eigen::VectorXf v(2); m << 1, 23, 6, 9, 3, 11, 7, 2; v << 2, 3; MatrixXf::Index index; // find nearest neighbour (m.colwise() - v).colwise().squaredNorm()...
ALGO
0.999958
4.138078
c36474ef-593d-47a7-bcde-e705bd77f399
Ricardo234LOL/ADA-RicardoArque
ALGORITMOS/C++/Insertion_Sort.cpp
#include <iostream> #include <fstream> #include <vector> #include <sstream> #include <chrono> using namespace std; using namespace std::chrono; void insertionSort(vector<int>& arr) { int n = arr.size(); for (int i = 1; i < n; i++) { int key = arr[i]; int j = i - 1; while (j >= 0 && ar...
ALGO
0.999165
5.57911
796834f3-ace7-4731-beee-1b9fb726fe03
Venkat-rgb/DSA-practice
Sorting Algorithms/Selection Sort.cpp
// Time complexity: O(N^2) // Space complexity: O(1) void selectionSort(int arr[], int n) { for(int i = 0; i < n; ++i) { int mini = INT_MAX, minIdx = -1; for(int j = i; j < n; ++j) { if(arr[j] < mini) { mini = arr[j]; minIdx = j; } } ...
ALGO
0.999889
5.955394
bd378d82-3201-4173-9f77-68817997961b
tholian-network/retrokit
Source/JavaScriptCore/dfg/DFGCFAPhase.cpp
#include "config.h" #include "DFGCFAPhase.h" #if ENABLE(DFG_JIT) #include "DFGAbstractInterpreterInlines.h" #include "DFGBlockSet.h" #include "DFGClobberSet.h" #include "DFGClobberize.h" #include "DFGGraph.h" #include "DFGInPlaceAbstractState.h" #include "DFGPhase.h" #include "DFGSafeToExecute.h" #include "OperandsIn...
ALGO
0.982009
7.512084
525b1a19-fc24-46db-be58-2b9d0fc280ab
satwikgm/LeetCode
Geek Jump - GFG/geek-jump.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int fun1(vector<int> &h , int n) { int dp[n]; dp[0]=0; for(int i=1;i<n;i++) { dp[i] = dp[i-1] + abs(h[i]-h[i-1]); if(i>1) { ...
ALGO
0.999791
6.370601
f0733502-79e5-4f5e-8e0f-95dcbf7e5d36
ShimuGuyue/AlgorithmPractice-Codes
NowCoder/题库/NC293086.cpp
#pragma region /* /$$$$$$\ $$\ $$\ $$\ $$$$$$\ $$$$$$\ $$$$$$\ $$ __$$\ $$ | \$$\ $$ |$$ __$$\ \_$$ _|$$ __$$\ $$ / $$ |$$ | \$$\ $$ / $$ / \__| $$ | $$ / $$ | $$$$$$$$ |$$ | \$$$$ / \$$$$$$\ $$ | $$$$$$$$ | $$ __$$ |$$ | \$$ / \____$$\ $$ | $$ __$$ | $$ | $$ |$$ | ...
ALGO
0.999732
4.779979
460d76d9-a156-49ac-94db-1edd36850ae5
KL-Lru/Competitive-Programming
AtCoder/abc022/c.cpp
#include<bits/stdc++.h> using namespace std; #define nmax 300 #define inf 10000000000 #define ll long long int main(){ int n,m; ll ln[nmax+1][nmax+1]; int u,v,l; ll ans=inf; cin>>n>>m; for(int i=0;i<=n;i++) for(int j=0;j<=n;j++) { if(i==j)ln[i][j]=0; else ln[i][j...
ALGO
0.999795
3.907788
3a2bc734-6460-472f-a2a8-633ae12c4d43
yo4hi6o/annak_website
my_website/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.998827
6.76073
2847def4-4b9f-45d8-9825-1afbf2ad4fc4
kolak33/AlgoAnalysis
przyblizoneZliczanieAA2/przyblizoneZliczanieAA2/ExperimentHandler.cpp
#include "stdafx.h" #include "ExperimentHandler.h" #include <vector> #include <algorithm> #include <string> #include <iostream> #include <fstream> #include <ctime> #include "Hash.h" ExperimentHandler::ExperimentHandler() { } void ExperimentHandler::RunExp1CalcRatio() { std::clock_t start = std::clock(); std::vect...
ALGO
0.950782
4.651122
6f79983b-e13d-47fd-92c8-ba4df36215be
dadi1/Black-Scholes-Pricing
src/normals/Normals.cpp
#include <cmath> #include "Normals.h" // One Over Root of Pi constant. const double OverRootOfPi = 0.398942280401433; // Probability Density Function for a standard gaussian Distriburion. double NormalDensity(double x) { return OverRootOfPi * std::exp(-x * x/2); } // The Inverse Cumulative Density Function via ...
ALGO
0.999891
7.462461
5eec4c8a-513c-4d2d-bcbf-28d0151c96ba
hexu1985/design-patterns-examples
Design.Patterns.Modern.Cpp20/DesignPatternsWebinar/adapter/adapter.cpp
#include <iostream> #include <string> #include <cstdio> #include <vector> using namespace std; #include <boost/algorithm/string.hpp> class String { std::string s; public: String(const string &s) : s(s) { } String to_lower_copy() const { return {boost::to_lower_copy(s)}; } vector<String> split(const s...
TOOL
0.977793
4.688705
935fb808-5462-44eb-8b14-7f3ad6c7922b
raincross7/code-similarity
codes/train_code/problem187/problem187_103.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; if(n%2){ int l = 1, r = n; for(int i=0; i<m; ++i){ printf("%d %d\n",l,r); ++l; --r; } }else{ int l=1, r = n-1; bool frag = true; for(int i=0; i<m; ++i){ if(frag && r-l <= n/2){ ...
ALGO
0.999971
3.32155
80602f68-5248-4b76-b0eb-fd175c0810ad
bira37/problem-solving
Codeforces/Official Rounds/Educational Round 58/B.cpp
#include <bits/stdc++.h> #define int long long #define double long double #define ff first #define ss second #define endl '\n' #define ii pair<int, int> #define mp make_pair #define mt make_tuple #define DESYNC ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) #define pb push_back #define vi vector<int> #defin...
ALGO
0.999187
4.220778
6101902b-0949-4105-bfa4-04f0ca06f1a2
HONGJICAI/LeetCode
cpp/275.cpp
// binarySearch.cpp class Solution { public: int hIndex(vector<int> &citations) { int l = 0, r = citations.size() - 1, n = citations.size(), res = 0; while (l <= r) { int mid = (l + r) / 2; int num = n - mid, h = citations[mid]; if (num > h) { res = max(h, res); l = mid + 1; ...
ALGO
0.999953
6.471647
26d0025f-c1cc-4a7d-a763-f43b6c59078b
KeyboPH/Data-Structures-and-Algorithims
towerofhanoi.cpp
#include <iostream> #include <string> #include <stack> using namespace std; class Stack { private: int top; int maxSize; int* stackArray; public: Stack(int size) { maxSize = size; stackArray = new int[maxSize]; top = -1; } ~Stack() { ...
ALGO
0.986922
4.163636
3526e5be-f840-4580-b8cc-828d0899bb54
aquawicket/etrigger
lib/cryptopp/vmac.cpp
// vmac.cpp - written and placed in the public domain by Wei Dai // based on Ted Krovetz's public domain vmac.c and draft-krovetz-vmac-01.txt #include "pch.h" #include "vmac.h" #include "argnames.h" #include "cpu.h" NAMESPACE_BEGIN(CryptoPP) #if defined(_MSC_VER) && !CRYPTOPP_BOOL_SLOW_WORD64 #include <intrin.h> #en...
ALGO
0.922583
6.08424
dd42e86b-79ea-4b59-ad8c-208339bb8495
fernunex/CompetitiveProgramming
CodeForces/Apr14-20/tungtung.cpp
// https://codeforces.com/contest/2094/problem/D #include <bits/stdc++.h> using namespace std; //LRLR //LLLRLR void solve() { string str1, str2; cin >> str1 >> str2; int ptr1 = 0, ptr2 = 0, last1, last2; while(ptr1 < str1.length() || ptr2 < str2.length()){ if (str1[0] != str2[0] || ptr1 == str1.length() ||...
ALGO
0.999963
5.197862
2f0f2566-dc95-4006-9faa-c612456ccdf2
Ryansmg/CodingPractice
Baekjoon/4_platinum/p5_2568_dp.cpp
#include <iostream> #include <vector> #include <algorithm> #include <set> #define int_max 2100000000 using namespace std; //전깃줄 - 2 bool cmp(pair<int,int> a, pair<int, int> b) { return a.first < b.first; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; //전깃줄의 개수 c...
ALGO
0.999933
4.031697
b1ed2ac3-544b-4ce3-a346-9404de6401b5
touyou/CompetitiveProgramming
aoj/0211.cpp
#include <cstdio> #include <map> #include <set> using namespace std; typedef long long ll; typedef pair<int, int> P; int n; ll d[10], v[10]; ll gcd(ll a, ll b) { return a%b==0?b:gcd(b,a%b); } ll lcm(ll a, ll b) { return a*b/gcd(a,b); } int main() { while (scanf("%d",&n)) { if (n==0) break; set<P> s; for (int i...
ALGO
0.999633
3.423726
4ff87258-7ab6-4666-a67c-2d0540d28ec8
sinha-sahil/ProblemSolving
01_Algorithms/Other/SpiralForm.cpp
#include<iostream> #include<vector> using namespace std; int main(){ vector<int> output; int m, n; cout<<"Rows and Col.: "; cin>>m>>n; int matrix[m][n]; cout<<"Matrix: "<<endl; for(int i=0; i<m; i++){ for(int j=0; j<n; j++){ cin>>matrix[i][j]; } } int fr=0, fc=0; while(fr<m and fc<n){ for(int i=fc; ...
ALGO
0.999982
3.417319
20830e02-8ad3-4c90-b20f-49b0734a073e
TheSeems/vtree
RBTree.cpp
#include "RBTree.h" RBTree::RBTree() { root = nullptr; } int RBTree::getColor(Node* node) { if (node == nullptr) return BLACK; return node->color; } void RBTree::setColor(Node*& node, int color) { if (node == nullptr) return; node->color = color; } Node<int>* RBTree::insertBST(Node*& root, Node*...
ALGO
0.996874
5.138776
c9d18edc-af77-4bc7-8526-3198ddd792a4
qurbonpulotrustamqulov/plant_shop
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
c6d69e33-11b3-44cd-8fbc-01ef21418259
JohnFarbotnik3/cpp_machine-learning
src/models/autoencoder_subimages/main.cpp
#include <cstdio> #include <filesystem> #include <string> #include "src/utils/commandline.cpp" #include "src/utils/random.cpp" #include "src/image/file_image.cpp" #include "src/image/value_image.cpp" #include "src/stats.cpp" #include "src/models/autoencoder_subimages/ae_model.cpp" /* debug build: g++ -std=c++23 -O2 -...
DATA
0.851381
6.391194
716b8cc1-d2b2-4040-bfe8-403e59893594
tushar-amrit-6/Interview-Questions
Knight Tour.cpp
/* Time complexity: O(N^2) Space complexity: O(N^2) Where ‘N’ is the number of rows/columns. */ struct Cell { int xCoordinate, yCoordinate; int stepCount; Cell() {} Cell(int x, int y, int step) { xCoordinate = x; yCoordinate = y; stepCount = step; } }; // Utili...
ALGO
0.999919
6.086271
9efee96d-948a-4fbd-9d86-d453c7eed9d1
edwardzeng/Face
example/FaceDetection/facedetection.cpp
#include <opencv2/objdetect/objdetect.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/core/core.hpp> #include<iostream> #include<vector> using namespace std; using namespace cv; string path="F:/SourceCode/GitWorking/Face/Face/data"; const double DESIRED_LEFT_EYE_X =...
ALGO
0.980307
4.281928
f51f1a04-92b6-4378-b033-79f6b9cb65d0
avramdj/MATF
AISP/cpp/test.cpp
#include <iostream> using namespace std; int main(int argc, char** argv){ char a1, a2; int b1, b2; cin >> a1 >> b1 >> a2 >> b2; if(a1 == a2 || b1 == b2 || abs(a1 - a2) == abs(b1 - b2)) cout << "da" << endl; else cout << "ne" << endl; return 0; }
ALGO
0.999869
3.580461
36de6d65-eeaa-4a23-b5f5-aba251955496
Harris-giki/Semester1_GIKI
CS101/Sample Codes/Code Samples/1 to 10 while loop.cpp
# include <iostream> using namespace std; int main() { int n = 1; while(n<=10) { cout<<n<<endl; n++; } }
TOOL
0.934002
3.37222
480c91cb-ff6c-4c4b-9aac-e84a81aac209
ishandutta2007/codeforces
box/normal/1081/E.cpp
#include <bits/stdc++.h> #define iter(i, a, b) for(int i=(a); i<(b); i++) #define rep(i, a) iter(i, 0, a) #define log(a) cerr<<"\033[32m[DEBUG] "<<#a<<'='<<(a)<<" @ line "<<__LINE__<<"\033[0m"<<endl #define all(a) a.begin(), a.end() #define fi first #define se second #define pb push_back...
ALGO
0.999821
3.643088
1df20984-9cc9-4572-900f-dccfe7c646d4
Zeta0080-cell/c--
2012蓝桥杯国赛-国庆星期几(zeller公式).cpp
//2012ű-ڼ(zellerʽ) //zellerʽڼڼ #include <bits/stdc++.h>//ͷļ using namespace std; int zeller(int year,int month,int day)// { if (month < 3) { month += 12; year -= 1; } int h = (day + (13 * (month + 1)) / 5 + year + year / 4 - year / 100 + year / 400) % 7; return (h + 5) % 7 + 1; // ת...
ALGO
0.99928
3.690917
8a4b97e0-0c2b-4a13-aec5-d1afa9750ff1
Syzain/CSCI136REAL
Balloon.cpp
/* Author: Syed Hussain Course: CSCI-136 Instructor: Gwenael Gatto Assignment: Lab This program takes an inputted diameter and returns a difference in growth where you add 1 to the given diameter */ #include <iostream> #include <iomanip> using namespace std; int main(){ float diameter; float growth; const double...
ALGO
0.999539
4.812
d72f9572-bf96-4082-9e5b-d841fe0f700c
RenanTashiro/URI
code/Paradigmas/p-level-3/2080.cpp
/* Nome: Seqüências de Röntgen ID: 2080 Resposta: Accepted Linguagem: C++ (g++ 4.8.5, -std=c++11 -O2 -lm) [+0s] Tempo: 0.120s Tamanho: 1,31 KB Submissao: 12/08/17 17:53:21 */ #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); int T; cin >> T; f...
ALGO
0.999891
4.411915
5fa037cd-a8b1-4c2c-a600-5370dff57209
pokaa3a/LeetCode
cv_questions/convex_hull.cpp
// Return a list of points forming a convex polygon #include <iostream> #include <vector> using namespace std; struct Point { int x; int y; Point() {} Point(int a, int b) : x(a), y(b) {} }; class ConvexHull { public: // > 0 : p-q-r turns counter-clockwisely // < 0 : p-q-r turns clockwisely ...
ALGO
0.999994
5.652332
5fff47fd-891f-4b43-8b2e-cd3f89824656
skennetho/algorithm-using-cpp
Baekjoon/Class2-all/boj_11866.cpp
#include<iostream> #include<queue> using namespace std; int main(){ int n, k; cin >> n >> k; queue<int> que; queue<int> answer; for(int i =0 ;i< n ; i++){ que.push(i+1); } while(!que.empty()){ for(int i =1; i< k ; i++){ que.push(que.front()); que...
ALGO
0.99999
3.310654
eaa1f97f-07cd-4f94-8f2d-4dd724764b29
PLBilodeau/godot
platform/linuxbsd/wayland/detect_prime_egl.cpp
/**************************************************************************/ /* detect_prime_egl.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
TOOL
0.867903
6.698298
83978e56-a47b-4577-ae11-2172b916146a
chaixiang2002/code-works
ex_agorithm/mindis.cpp
#include <iostream> #include <vector> using namespace std; class point{ private: int x,y; int dis; /////////////////////////////////////// static int min_dis; static int p1; static int p2; static vector<vector<int>> pan; static int bound_x; static int bound_y; static int offset_x; ...
ALGO
0.996739
3.95956
42497276-4714-4d21-8dd3-49351d49ac48
SparrowSurya/leetcode-blind-75
valid-palindrome.cpp
#include <cctype> #include <string> using namespace std; class Solution { public: bool isPalindrome(string s) { string str; for (char ch: s) { if (isalnum(ch)) str.push_back(tolower(ch)); } int left = 0; int right = str.size() - 1; while (left <= right) { if (str[left] != str[right]) return fal...
ALGO
0.999563
6.089554
ab2b27e0-56c9-48d9-9878-d31e2b828d8e
leonlau373/codeforces
1011 Div 2/A/main.cpp
/* Name: Leon Lau username: nya10 Problem link: */ #include <bits/stdc++.h> using namespace std; void printvector(vector<int>& v, int size) { for (int i = 0; i < size; i = i + 1) { cout << v[i] << ' '; } } void inputvec(vector<int>& v, int size) { for (int i = 0; i < size; i = i + 1) { ...
ALGO
0.999896
3.910484
e77c1515-6971-4a37-8977-949e9068fb69
sarvex/leetcode-intercal
solution/0200-0299/0279.Perfect Squares/Solution.cpp
class Solution { public: int numSquares(int n) { vector<int> dp(n + 1); for (int i = 1; i <= n; ++i) { int mi = 100000; for (int j = 1; j * j <= i; ++j) { mi = min(mi, dp[i - j * j]); } dp[i] = mi + 1; } return dp[n]; ...
ALGO
0.999979
6.105291
10085994-819f-4063-995b-5b9c19b30fa0
tofuuuuuuu/competitive-programming
misc/greedily_gamboling.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> const ll MAXN = 20005; const ll MAX = (ll)9e10; struct Edge { int v; ll w; Edge(int vertex, ll weight) { this->v = vertex; this->w = weight; } }; struct DijkstraE { int v, msk; ll w; Di...
ALGO
0.999953
4.313145
1ac4bcae-6d2e-47bd-ba7a-dac32863341a
Randowlh/Project_ACM_2021
code/competition/pta_2.2/12.cpp
#include <bits/stdc++.h> using namespace std; const int inf = 0x7FFFFFFF; typedef long long ll; struct node { string s; string m; string f; char j; }; map<string, int> M; vector<node> date; bool check(int a, int b, int step) { // cout<<"TES"<<endl; if (a == b) return false; if (step ...
ALGO
0.999967
3.911445
401b8e29-976e-4b5b-9b1a-85828979349b
Mannan-Ali/C-Learnings
Recursion/divide_conqure/count_inversion.cpp
#include <bits/stdc++.h> using namespace std; template <class T> long long merge(vector<int> &v, T s, T e, int mid) { long long inv=0; int len1 = mid - s + 1; int len2 = e - mid; vector<int> arr1(len1); vector<int> arr2(len2); int k = s; // cout<<k<<endl; for (int i = 0; i < len1; i++) ...
ALGO
0.999995
3.899375
36531d62-65d4-4055-8ef9-bfa22843e8dc
03-Aman/cpp-DSA--programs
Arrays and strings/RemoveConsecutiveDuplicates.cpp
#include <iostream> #include <cstring> using namespace std; int main() { char s1[100], s2[100]; cout << "Enter the string: "; cin >> s1; int j = 0; for (int i = 0; s1[i] != '\0'; i++) { if (s1[i] == s1[i + 1]) { continue; } else { s...
ALGO
0.999243
4.138578
423eb282-9131-49bc-80d8-9f854587e046
nrngooooo/myapp
phchulabfe/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.997929
6.76775
53248dcd-c868-4729-8e31-17a5653b1a74
EFTY1309/operaytingSystem
producer_consumer.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <pthread.h> #include <unistd.h> #include <time.h> #include <semaphore.h> #define THREAD_NUM 8 sem_t semEmpty; sem_t semFull; pthread_mutex_t mutexBuffer; int buffer[10]; int count = 0; void* producer(void* args) { while (1) { // Produc...
ALGO
0.947974
5.000865
040e6000-8964-49a0-8e5c-26b83277ae16
batora9/atc-practice
sort-algorithm/b.cpp
#include <bits/stdc++.h> #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; #endif using namespace std; using ll = long long; using ull = unsigned long long; using P = pair<int,int>; using vi = vector<int>; #define rep(i, n) for (int i = 0; i < (n); ++i) void selectionSort(vi &a, int n){ ...
ALGO
0.999994
4.779639
930a7479-9422-4378-89a6-0eac4aab3789
guinao/poj
poj3126.cpp
#include <cstdio> #include <cstring> #include <cstdlib> #include <ctime> #include <vector> #include <queue> #include <algorithm> using namespace std; int mod_exp(int a, int b, int n) { int ret = 1; a %= n; while(b){ if(b & 1) ret = (ret*a) % n; a = (a*a) % n; b >>= 1; } return ret; } bool witness(int a,...
ALGO
0.999885
3.876532
c7f697ed-081c-4584-a95e-c9ab96588121
niaokedaoren/LeetCode_Solution
Solutions/question_71.cpp
class Solution { public: string simplifyPath(string path) { // Start typing your C/C++ solution below // DO NOT write int main() function if (path.size() == 0 || path[0] != '/') return ""; vector<string> track; int begin = 0; path.push_back('/'); for (int i=1; i<path.size(...
ALGO
0.999918
5.724658
c179cf2f-05e9-4276-b92f-4e6876124c16
vallarasuk/LeetCode
solutions/3185. Count Pairs That Form a Complete Day II/3185.cpp
class Solution { public: // Same as 3184. Count Pairs That Form a Complete Day I long long countCompleteDayPairs(vector<int>& hours) { long ans = 0; vector<int> count(24); for (const int hour : hours) { ans += count[(24 - hour % 24) % 24]; ++count[hour % 24]; } return ans; } };
ALGO
0.998129
5.897166
2f7cbbb2-5d5f-4503-b070-a5bb0ec815d0
quantum2409/Eavesdropping101
Assignment 1/210155/Anshu.cpp
#include <iostream> using namespace std; int main() { string s = "tbzvoclymifqef, kdr jriq ioklzbwbf, vzqgdgu iurqqivajp, fvsqpqket fwb wesmieqdnnab hfeotp qw rzroaggudk. afhd hhkcye, nlwi eqabpkyqhp rleejfv fs wclycrpvb, ceq kdrt laipsgivzv agkrdbfprgudk jriq abf pbg il vyve blovaf, iekj txdokfhe blovaf dc vivgbmj...
ALGO
0.999977
3.58277
039a09b0-c114-480f-80be-a3177229d5d5
seeitsmanish/Cpp_Competitive_Repo
Practise/13_Jul_2021/Frog_Sort.cpp
//Link : https://www.codechef.com/FEB21C/problems/FROGS #include<bits/stdc++.h> using namespace std; #define sort(v) sort(v.begin(),v.end()) #define print(v) for(auto n:v) cout<<n<<" " #define rev(v) reverse(v.begin(), v.end()) #define int long long #define l long #define ll long long #define vi vector<int> #define pb ...
ALGO
0.998473
4.640887
18a57249-d751-469c-92b6-078325699307
KSHITIJSAHU28/C-PROJECT-WORK
SUM OF N NATURAL NUMBERS.cpp
#include <stdio.h> int main() { int num, i, sum = 0; printf(" Enter a positive number: "); scanf("%d", &num); for (i = 0; i <= num; i++) { sum = sum + i; } printf("\n Sum of the first %d number is: %d", num, sum); return 0; }
ALGO
0.968381
3.18246
50529e8b-07db-479c-96ae-cca30e20300d
corretto/corretto-23
src/hotspot/share/opto/bytecodeInfo.cpp
#include "precompiled.hpp" #include "ci/ciReplay.hpp" #include "classfile/vmSymbols.hpp" #include "compiler/compilationPolicy.hpp" #include "compiler/compileBroker.hpp" #include "compiler/compilerEvent.hpp" #include "compiler/compileLog.hpp" #include "interpreter/linkResolver.hpp" #include "jfr/jfrEvents.hpp" #include ...
ALGO
0.866468
5.15785
46dd4035-c7a0-475e-91e1-b4725bc23f85
SeacenLiu/LeetCode
231. 2的幂/main.cpp
#include <iostream> using namespace std; // 方法二: 位运算规律法 /** 若 n = 2^x 且 x 为自然数(即 n 为 2 的幂),则一定满足以下条件: 1. 恒有 n & (n - 1) == 0,这是因为: n 二进制最高位为 1,其余所有位为 0; n−1 二进制最高位为 0,其余所有位为 1; 2. 一定满足 n > 0。 (&: 都是1才是1) 2^x n n - 1 n & (n - 1) 2^0 0001 0000 (0001) & (0000) == 0 2^1 0010 00...
ALGO
0.999398
6.402001
b2f0063b-4679-46a2-ac61-afa752597b26
KaranGulve4342/DSA
beginning/A+B again.cpp
// EVERY PROBLEM IS SOLVABLE #include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int T; cin >> T; while(T--){ int n; cin >> n; cout<<n/10 + n%10<<endl; } return 0; }
ALGO
0.999313
4.489552
5d89e47e-0a19-4b7b-af3a-3cdb5fc23135
Aadarsh-Negi/LeetCode
329-longest-increasing-path-in-a-matrix/329-longest-increasing-path-in-a-matrix.cpp
class Solution { public: int solve(int i,int j,vector<vector<int>> &m,vector<vector<int>> &dp){ // if(i<0 || j<0 || i>=m.size() || j>=m[0].size()) return INT_MAX/2; if(dp[i][j]!=-1) return dp[i][j]; int x=1; if(i+1<m.size() && m[i+1][j]>m[i][j]) x=1+solve(i+1,j,m,dp); if(j+1<...
ALGO
0.999986
5.801638
f3953401-2015-48da-87c3-4cb1413d64c5
ruhulaminjr/Phitron-Cse-Fundamental-Course
algorithms/graph/check_connected_bfs.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5; vector<int> adj_list[N]; int visited[N] = {}; vector<int> bfs(int Node) { queue<int> q; q.push(Node); visited[Node] = 1; vector<int> chk; chk.push_back(Node); while (!q.empty()) { int head = q.front(); q.pop(); ...
ALGO
0.999944
4.936186
a30630db-3f56-4d95-a51c-0e6a352aada4
bentoper/Competitive
Contests/CFG7/d.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define fst first #define snd second #define fr(i,n) for(int i=0;i<n;i++) #define frr(i,n) for(int i=1;i<=n;i++) #define pv(x, n) fr(iii, n) printf("%d%c", x[iii], " \n"[iii==n-1]) #define pvv(x, n) frr(iii, n) printf("%d%c...
ALGO
0.999979
3.794226
5a3b4ec2-7e4a-47c5-a64d-ab61581c14b1
Jikky1618/AtCoder
ABC/ABC150-199/ABC168/b.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int k; string s; cin >> k >> s; if(s.size() <= k) cout << s << endl; else cout << s.substr(0,k) << "..." << endl; return 0; }
ALGO
0.999653
4.185097
ff0251dc-80ba-4641-92e1-8d5a41f66a74
eber10/P.A
ejer2.cpp
#include<iostream> using namespace std; int main() { int arr[]={20, 12, 14, 25, 04, 3, 7}; int n=7; for(int i=n-1; i>0; i--) { for(int j=i-1; j>=0; j--) { if(arr[i]<arr[j]) { int aux=arr[i]; arr[i]=arr[j]; arr[j]=aux...
ALGO
0.999946
4.051849
17c661b2-77a0-4d2c-bf71-ac621e518eec
codewithnick/dsaandcp
1100 rating/teleporters easy version.cpp
#include<bits/stdc++.h> using namespace std; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t,n,c,i,x,cnt; cin>>t; while(t--){ cin>>n>>c; cnt=0; vector <long long >arr(n); for(i=0;i<n;i++){ cin>>x; arr[i]=...
ALGO
0.999905
3.511699
3f547ef5-1527-46b8-8d22-d0382e5ac9b8
virujthakur/Codeforces-Contests
Round 903 Div 3/D_Divide_and_Equalize.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define mod 998244353 #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define INF (1LL << 60) #define NINF -INF #define endl "\n" // vector<int> seive; // int N= 1e6+1; // void...
ALGO
0.999819
5.33392
d4b21c5e-475a-4e9a-a9e0-a9d4aff7edfd
ishandutta2007/codeforces
marckess/normal/1535/A.cpp
#include <bits/stdc++.h> #define endl '\n' #define fi first #define se second #define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k)) #define forn(i,n) for (int i = 0; i < int(n); i++) #define forr(i,a,b) for (int i = a; i <= b; i++) #define all(v) v.begin(), v.end() #define pb push_back using namespace std; typedef long lo...
ALGO
0.999888
4.31765
45363500-3f6d-457a-a329-e067c882885c
roushan-raj/Codes
VS Code Cpp/Stack_Aditya_Verma/1_NGR_Nearest_Greater_To_Right.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; void NGR(int arr[], int n){ vector<int> vec; stack<int> st; if(n==1){ vec.push_back(-1); return; } for(int i=n-1; i>=0; i--){ if(st.size()==0){ vec.push_back(-1); } else if(st.size(...
ALGO
0.999957
5.226201
f23c2491-8cdb-48df-9e04-d0a0028f6886
hannanxo/data-structures-algorithms
Linked list/singly_circular_linked_list.cpp
#include<iostream> using namespace std; struct node{ char data; node *next; }; class SinglyCircularLinkList{ private: node* head; public: SinglyCircularLinkList(){ head = NULL; } node* create_node(char data){ node* link_node = new node(); ...
ALGO
0.999636
3.654653
1f91f8d4-841f-4fe6-8875-5b93312a6662
LazieKat/YAPR
src/modules/control_allocator/ControlAllocation/ControlAllocationSequentialDesaturation.cpp
/** * @file ControlAllocationSequentialDesaturation.cpp * * @author Roman Bapst <<EMAIL>> * @author Beat Küng <<EMAIL>> */ #include "ControlAllocationSequentialDesaturation.hpp" void ControlAllocationSequentialDesaturation::allocate() { //Compute new gains if needed updatePseudoInverse(); _prev_actuator_sp =...
ALGO
0.980223
6.773466
b14d009a-65fa-4610-92c7-931bd8551fbc
Rajshah1103/DSALGO
DynamicProgramming/FrogJump.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; // int f(int ind,vector<int>&heights,vector<int>&dp){ // if(ind==0) return 0; // if(dp[ind]!=-1) return dp[ind]; // int left = f(ind-1,heights,dp) + abs(heights[ind] - heights[ind-1]); // int right = INT_MAX; // if(ind>1){ // r...
ALGO
0.999988
4.891771
47f5ec02-b448-47ae-bc78-768291b928df
vinayakbhat24/Codility-Solutions
MinJumps.cpp
// Online C++ compiler to run C++ program online #include <iostream> using namespace std; int minJumps(int * arr, int n) { if (arr[0] == 0) return 0; int minJumps = 1; int maxValueDecay = 0; int nextIndex = arr[0]; for (int i = 1; i<n; i++) { if(nextIndex == i) ...
ALGO
0.999972
4.781013