uuid
stringlengths
36
36
repo_name
stringlengths
5
123
relative_path
stringlengths
5
4k
content
stringlengths
33
2.85M
category
stringclasses
6 values
algo_rel_score
float64
0.85
1
quality_score
float64
3
8.76
4aba0fd1-1952-4f81-8a1b-1dac6319dbfc
doocs/leetcode
solution/2100-2199/2106.Maximum Fruits Harvested After at Most K Steps/Solution.cpp
class Solution { public: int maxTotalFruits(vector<vector<int>>& fruits, int startPos, int k) { int ans = 0, s = 0; for (int i = 0, j = 0; j < fruits.size(); ++j) { int pj = fruits[j][0], fj = fruits[j][1]; s += fj; while (i <= j && pj - fruits[i][0] + min(abs(sta...
ALGO
0.999985
5.840891
0c46df3d-4fd2-449c-b80c-c42ba74ceca6
Codinator29/InterviewBit
Sorting/LargestNumber.cpp
/* Largest Number Problem Description Given a array A of non negative integers, arrange them such that they form the largest number. Note: The result may be very large, so you need to return a string instead of an integer. */ static bool compareNum(string a, string b) { return a + b > b + a; ...
ALGO
0.999859
5.959664
38796eb5-6907-435c-b01d-3da309b08389
kimByoungGoun/codetest
1.문제 해결 패러다임/동적 계획/200924_baekjoon_2193/byounggoun/main.cpp
#include "stdafx.h" #include <iostream> using namespace std; int main() { long long before = 1; long long after = 1; long long result = 0; int count = 0; cin >> count; if (count == 1) { result = 1; } if (count == 2) { result = 1; } for (int i = 2; i < count; i++) { long long tmp = after; after =...
ALGO
0.999981
3.686422
775c5a5c-bdd4-4b1c-9112-81b7c42cfa29
hasonau/Two_Sum_II_M
main.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: vector<int> twoSum(const vector<int>& numbers, int target) { int start = 0; int end = numbers.size() - 1; while (start < end) { int sum = numbers[start] + numbers[end]; if (sum == t...
ALGO
0.99985
7.036066
559a8ff3-0d90-4edb-8b77-f19d569e8ee9
rahulpinto19/ds
2794-maximum-number-of-moves-in-a-grid/2794-maximum-number-of-moves-in-a-grid.cpp
class Solution { public: int dp[1001][1001]; int help(int i,int j,vector<vector<int>>&nums) { if(i>=nums.size() || i<0 || j>= nums[0].size()) return 0; if(dp[i][j] != -1) return dp[i][j]; int a,b,c; a=b=c=0; if(j+1 < nums[0].size()) { ...
ALGO
0.999999
5.842226
be773607-b450-4277-91f6-6c10a84c1855
Aomsub101/CodeForces-Problem
1200/514-A. Chewbaсca and Number/Solution.cpp
//headerfile #include<iostream> #include<string> //namespace using namespace std; //typedef typedef long long int ll; //functions int main(){ //write your code here //1-->8 2-->7 3-->6 4-->5 5-->4 string s; cin >> s; /* unfortunately this does not work on codeforece's compiler char a; if...
ALGO
0.999957
4.813807
5116fd56-c3af-499b-8ddd-cf23b0526aa8
EHREkramul/Competitive-Programming
STL/Priority_Queue.cpp
// Ekramul-Haque // In The Name of Almighty ALLAH #include <bits/stdc++.h> using namespace std; // priority_queue: A heap-based priority queue (max-heap by default). int main() { // 1. Initialization of a Max-Heap (Default) priority_queue<int> maxHeap; // Max-Heap: Largest element is on top // Adding ele...
ALGO
0.998502
5.482797
3b8250ee-6431-439b-8902-e572870f7b8e
leehn5/The_Final-Station
Box2D/Collision/Shapes/b2EdgeShape.cpp
#include "Box2D/Collision/Shapes/b2EdgeShape.h" #include <new> void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2) { m_vertex1 = v1; m_vertex2 = v2; m_hasVertex0 = false; m_hasVertex3 = false; } b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const { void* mem = allocator->Allocate(sizeof(b2EdgeSh...
ALGO
0.932485
7.657962
0bdf2f14-2d9f-4397-be9c-c828408216f9
seal-git/atcoder
2020-10-31-A/main.cpp
#include <iostream> #include <string> #include <stdio.h> #include <math.h> #include <queue> #include <algorithm> #include <utility> #include <vector> #include <tuple> #include <numeric> using namespace std; long long sum(long long i){ return(i*(i+1)/2); } int main(int argc, char* argv[]){ long long A,B,C; cin >> A>>B...
ALGO
0.999932
5.023042
340c52fd-f194-4add-91f5-2efaac7b6187
shadab375/all-dsa-questions-list
Stack/Sum of Subarray Minimums.cpp
/* MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=HRQB7-D2bi0 Company Tags : Facebook, Amazon, Google Leetcode Link : https://leetcode.com/problems/sum-of-subarray-minimums/ */ typedef unsigned long long ll; class Solution { public: //This is just we are...
ALGO
0.999984
6.287634
77eef038-1e30-4143-80e3-ad2ea4a9d173
ayanahmad11/DSA
DTurtleTenacityContinual Mods.cpp
//https://codeforces.com/contest/1933/problem/D // Look for Smallest element if it occurs once ans is always possible // else if look for mod of any element with small el not equal to 0 // else not possible #include<bits/stdc++.h> #define endl "\n" using namespace std; #define int long long int #define vi vector<int> ...
ALGO
0.999455
4.309
9b3eae2d-83e8-49f2-998e-cd4f8cf2532c
cthuurne-private/Introduction-C-plus
Section 7 - Arrays/Vectors/Vectors.cpp
// Vectors.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include <vector> int main() { std::vector<char> vowelsEmpty; //empty std::vector<char> vowels1(5); //5 elements, each initialized to zero std::vector<char> vowels{'a', 'e', 'i', 'o', 'u'}; //5 ...
ALGO
0.959894
5.154379
54d2b122-3e1e-4473-b9ef-77778a3aa76b
abhishekshaarma/riskoptimizer-LSTM-Network
include/eigen-3.4.0/doc/examples/DenseBase_middleRows_int.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; int main(void) { int const N = 5; MatrixXi A(N,N); A.setRandom(); cout << "A =\n" << A << '\n' << endl; cout << "A(2..3,:) =\n" << A.middleRows(2,2) << endl; return 0; }
ALGO
0.96517
3.307581
e168cefe-b458-469e-ae52-248c45e93a0e
leenaaq/Practice
프로그래머스/1/131128. 숫자 짝꿍/숫자 짝꿍.cpp
#include <string> #include <vector> #include <algorithm> #include <iostream> using namespace std; vector<int> Change(string s) { vector<int> num(10, 0); for(int i = 0; i < s.length(); i++){ for(int j = 0; j < 10; j++){ if(s[i] - '0' == j) { num[j]++; ...
ALGO
0.999924
4.966684
2524b146-b191-4518-adb6-5d78d4f48236
shivangi0110/24SS-AllTrans-main
benchmarks/benchmarks_source/8_level/p02400/s891426506.cpp
#include <iostream> #include <iomanip> #define PAI 3.141592 using namespace std; int main(void) { int r; cin >> r; cout << fixed << setprecision(6)<< r * r * PAI << " " << 2 * r * PAI << endl; return 0; }
ALGO
0.988921
3.737292
9e6d9b14-676c-4e68-a7bb-63005536013a
antim0n/neighborhood-search
fluidSolver.cpp
#include "fluidSolver.h" #include <iostream> #include <fstream> FluidSolver::FluidSolver(int size) { numFluidParticles = size; numBoundaryParticles = sqrt(numFluidParticles) * 16; numParticles = numBoundaryParticles + numFluidParticles; particles = new Particle[numParticles]; } FluidSolver::~FluidSolv...
ALGO
0.999526
4.238287
f50663ac-af9b-4002-8944-fc449b257c38
Poonji/Leet_Code
9. Palindrome Number.cpp
class Solution { public: bool isPalindrome(int x) { string s=to_string(x); int n=s.length(); int i=0; int j=n-1; while(i<=j){ if(s[i]!=s[j]) { return false; } else{ i++; j--; } } return true; ...
ALGO
0.999693
5.912814
9cc9eba6-7925-4e0d-9ec3-8a7db06ce494
raihanuldev/Problem-Solving
codeChef/startrs 197 div-4/lost_in_the_fast.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int tcase;cin>>tcase; while(tcase--) { int n;cin>>n; vector<int>a(n); for(int i =0; i<n;i++) { cin>>a[i]; } int bhomi = a[n-1]; ...
ALGO
0.999713
3.913064
77045d0b-04a4-43b4-a030-93aab7c94df1
Gediminas19/AdventOfCode2019
day24/day24-2.cpp
#include <bits/stdc++.h> using namespace std; struct BugHasher { size_t operator()(const tuple<int, int, int>& bug) const { int layer, row, col; tie(layer, row, col) = bug; return layer*25 + row*5 + col; } }; int main() { ifstream fp; fp.open("input.txt"); int iters = 200; unordered_set<tuple...
ALGO
0.999018
5.297177
86c6ad83-cb08-4bb4-bd22-5598c9f47fbc
lhy-loveworld/LeetCode
5_Array/#153_FindMinRotateSortArr.cpp
//#153. Find Minimum in Rotated Sorted Array //Medium //Method: recursion and iteration //Complexity: Time O(logN) O(log(M+N)); Space O(1) class Solution { public: //Method 1: iteration int findMin(vector<int>& nums) { int l = 0, r = nums.size() - 1; while (nums[l] > nums[r]) { int mid...
ALGO
0.999997
6.345649
03b1cc8b-af05-4d2c-9806-6aed9662f93c
akash-dewangan03/CP-Problem
Ferris_Wheel.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define dob double #define cout(x) cout<<x<<endl #define vec(type1, name) vector<type1> name #define vecp(type1, type2, name) vector<pair<type1, type2>> name #define set(type, name) set<type> name #define map(type1, type2, name) map<type1, type2> na...
ALGO
0.99993
4.272622
c8f646cb-ab07-4cc2-9f57-b3e8c69be6d4
AST-TheCoder/Solved-Problems
Codeforces/Codeforces Round 914 (Div. 2) /C_Array_Game.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long int #define pb push_back #define all(x) x.begin(),x.end() #define Max 10000000000000000 template <typename T> using ordered_set = tree<T, null_ty...
ALGO
0.9999
4.047763
c1768141-97a2-4ffd-9f7f-40360c38a9c1
YAJATapps/android_system_core
libcutils/config_utils.cpp
#include <cutils/config_utils.h> #include <string.h> #include <ctype.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <cutils/misc.h> cnode* config_node(const char *name, const char *value) { cnode* node = static_cast<cnode*>(calloc(sizeof(cnode), 1)); if(node) { node->name = na...
CONFIG
0.898159
4.75982
4116fbe0-787c-4c76-be9d-b929a0a604f9
imabhinav-am/Competetive-Programming
hr_waiter.cpp
/* Author : Abhinav Modified : 17-12-2017 02:46:50 AM */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; const ll mod = 1e9+7; vi pr; void SieveOfEratosthenes(int n){ bool prime[n+1]; memset(prime, true, sizeof(prime)); for (int p=2; p*p<=n; p++)...
ALGO
0.999959
3.430503
d3053fcc-f3be-49f8-861d-e4893c129639
ShashwatDev-IIITBBSR/CrackYourPlacementChallenge
Dynamic Programming/0 - 1 Knapsack Problem.cpp
class Solution { public: int knapSack(int W, int wt[], int val[], int n) { int mat[1001][1001],i,j; for(i=0;i<n+1;i++)//val { mat[i][0]=0; } for(i=0;i<W+1;i++)//val { mat[0][i]=0; } for(i=1;i<n+1;i++)//val { ...
ALGO
0.999998
5.370455
411f41a1-aa9a-4811-880e-4b392d8cf178
takano536/atcoder
abc/abc325/e.cpp
#include <algorithm> #include <iostream> #include <queue> #include <vector> int main() { const long INF = 1e18; int n, a, b, c; std::cin >> n >> a >> b >> c; std::vector<std::vector<int>> d(n, std::vector<int>(n)); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { st...
ALGO
0.99982
4.51631
e71ec40a-3d75-4f0c-a3dc-a8cf49398d64
karim-aboelazm/All_CodeForces_CPPTasks_Solutions
991A/if-at-first-you-dont-succeed.cpp
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, n; cin >> a >> b >> c >> n; if (c > a or c > b or a + b - c + 1 > n) { cout << -1 << endl; } else { cout << n - (a + b - c) << endl; } return 0; }
ALGO
0.999789
3.906767
dad8b6e6-34bb-4754-ac20-a829eebd638b
sukirth-singh-gaur/Leetcode
leetcode/monotonicStack/previousGreater.cpp
#include <bits/stdc++.h> using namespace std; vector<int> findPreviousGreaterIndexes(vector<int> & arr){ // initialize an empty stack stack<int> s; // initialize nextGreater array, this array hold the output // initialize all the elements are -1 (invalid value) vector<int> previousGreater(arr.size(...
ALGO
0.999977
4.791389
cbeb96ab-c47c-4164-a63e-33a460bb6177
Pro-Haseeb/C-Plus-Plus
function/loop fun product.cpp
#include<iostream> using namespace std; void product(int num); int main() { int n,i,pro=1 ; cout<<"ENTER A NUMBERS FOR PRODUCT:"; for(i=0;i<=4;i++) { cin>>n; pro=pro*n; } product(n); } void product(int num) { int pro=1; cout<<"PRODUCT OF THE NUMBERS IS "<<pro*num; }
ALGO
0.999217
3.824736
5d30f37f-40d7-467f-a143-7d8abe194913
Noti404/PS
acmicpc/108__/10845.cpp
#include <vector> #include <algorithm> #include <queue> #include <iostream> #include <map> #include <set> #include <math.h> #include <numeric> #include <cassert> #include <stack> #include <cstring> #include <climits> typedef long long ll; typedef unsigned long ull; #define interface struct #define zx3f 1061109567 ty...
ALGO
0.997347
4.433995
190a2e5e-e651-40e9-96b6-bb69da2da761
virtualsecureplatform/llvm-rv16k
libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp
// <algorithm> // template<InputIterator Iter, Predicate<auto, Iter::value_type> Pred> // requires CopyConstructible<Pred> // constexpr Iter // constexpr after C++17 // find_if_not(Iter first, Iter last, Pred pred); #include <algorithm> #include <functional> #include <cassert> #include "test_macros.h" #inclu...
TEST
0.956235
6.494315
0565a123-d538-4d39-9bc6-0a5611fe51fa
u-wyh/luogu-code
P2500.cpp
#include<bits/stdc++.h> using namespace std; const int INF = 1e9+7; const int MAXN = 1e5+5; const int MAXM = 5e5+5; const int MAXB = 405; int n,m; int blen; int col[MAXN]; int head[MAXN]; int nxt[MAXM<<1]; int to[MAXM<<1]; int weight[MAXM<<1]; int cnt=1; struct point{ int t,sub; }arr[MAXN]; int vis[MAXN]; int id...
ALGO
0.999814
5.231667
6a68ed72-2401-44c8-83db-fde6df6ccc3d
Li1229575912/hello-algo
codes/cpp/chapter_sorting/radix_sort.cpp
/** * File: radix_sort.cpp * Created Time: 2023-03-26 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 获取元素 num 的第 k 位,其中 exp = 10^(k-1) */ int digit(int num, int exp) { // 传入 exp 而非 k 可以避免在此重复执行昂贵的次方计算 return (num / exp) % 10; } /* 计数排序(根据 nums 第 k 位排序) */ void countingSortDigit(vector<i...
ALGO
0.999916
5.787879
a993108b-ec35-4082-8aaa-6e01ee184dcf
sarvex/leetcode-io
solution/1000-1099/1030.Matrix Cells in Distance Order/Solution.cpp
class Solution { public: vector<vector<int>> allCellsDistOrder(int rows, int cols, int rCenter, int cCenter) { queue<pair<int, int>> q; q.emplace(rCenter, cCenter); vector<vector<int>> ans; bool vis[rows][cols]; memset(vis, false, sizeof(vis)); vis[rCenter][cCenter] =...
ALGO
0.999954
4.71996
0b2a07fa-f0c8-4d3b-b35f-388860f7b6bd
rijan188/C-Files
fgbtg.cpp
#include <stdio.h> #define MAX_SIZE 100 // Function prototypes int linearSearch(int arr[], int n, int key); int binarySearch(int arr[], int low, int high, int key); // Hashing functions int hashFunction(int key) { return key % MAX_SIZE; // Simple modulo hashing } void insertHash(int hashTable[], int data) { ...
ALGO
0.99988
6.183255
7e55ca2c-d55b-4bcc-8512-56dd5874ac65
Xan-ca/CF-Submissions
Practice-B/P39.cpp
#include<iostream> #include<bits/stdc++.h> #define ll long long using namespace std; void solve(){ int n; cin>>n; ll int arr[n]; for(int i=0;i<n;i++){ cin>>arr[i]; } int min=INT_MAX; for(int i=0;i<n;i++){ int k=i; for(int j=i;j<n;j++){ if(arr[i]<arr[j]){ k+=1; } } if(k<min){ ...
ALGO
0.999905
4.426933
3e51e5c8-5ec6-41cf-b2f8-c7d15c3f1c86
ishandutta2007/codeforces
rns3/normal/618/B.cpp
#include <bits/stdc++.h> using namespace std; #define M 60 int a[M][M], ans[M], cnt, n, vis[M]; int main() { // freopen("B.in", "r", stdin); scanf("%d", &n); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) scanf("%d", &a[i][j]); } while (cnt < n) { for (int i = 0; i < n; i++) { if (vis[i]) continu...
ALGO
0.999926
3.288211
9cdfb90a-459d-43ce-80a8-731232eccb55
raincross7/code-similarity
codes/train_code/problem297/problem297_478.cpp
#include <iostream> using namespace std; void ABC60(void); void ABC61(void); void ABC62(void); void ABC63(void); void ABC64(void); void ABC65(void); void ABC66(void); void ABC67(void); void ABC68(void); void ABC69(void); int main(void){ ABC60(); } void ABC60(void){ string a,b,c; int i,j; cin >> a >> b...
ALGO
0.999966
3.234695
c38e6a4c-a2ae-4629-9d65-406e0ffb1b51
saitejvejju/demo-glsl
Terrain/QuadtreeNode.cpp
#include "QuadtreeNode.h" #include "../Frustum.h" #include "../Mesh.h" #include "TerrainChunk.h" #include "TerrainObject.h" #include <math.h> #include <iostream> #include <assert.h> using namespace std; void QuadtreeNode::Build(unsigned int depth, // profondeur de la rcursion ivec2 pos, // position du chu...
ALGO
0.998488
4.579967
dea4e2fb-af2d-4425-a586-be7c76c96109
eduhwwh/Maratona
QuestoesTreino2024/Funcao/RaizQuadadrade2.cpp
#include <bits/stdc++.h> using namespace std; double naoSei(int N){ double raiz = 1.0; for(int i=0; i < N; i++){ raiz = 1.0 + 1.0 / (1.0 + raiz); } return raiz; } int main() { int N; cin >> N; double resu = naoSei(N); cout << fixed << setprecision(10) ...
ALGO
0.999767
3.712755
67a21154-787b-48d1-9b5e-958f75a4a554
polarr/competitive-programming
OI/APIO/2009/1.cpp
/** * Solution by 1egend (polarity.sh) * Date: 2025-01-15 * Contest: APIO 2009 * Problem: 1 - Digging for Oil **/ #include <bits/stdc++.h> using namespace std; #define pb push_back #define ull unsigned long long #define ll long long const int MAX_N = 1e5 + 1; const ll MOD = 1e9 + 7; void solve(){ int m, n, ...
ALGO
0.999966
3.592752
0912dba9-3c4c-4958-a939-35f2e40aea0e
Yasiraalam/Practice-Problems
DSA(youtube + 450)/bit manupulation/digitSumProduct.cpp
#include<bits/stdc++.h> using namespace std; int main() { int num; cout<<"Enter number: "; cin>>num; int prod=1,sum=0; while (num!=0) { int rem=num%10; prod *= rem; sum += rem; num = num/10; } int ans =prod - sum; cout<<ans<<endl; return 0; }
ALGO
0.999913
4.151694
2217709a-cfaa-4088-8173-3ddbf18bcd10
Manojit-Das-10/Coding
Basic/Function_call_by_value.cpp
#include<bits/stdc++.h> using namespace std; int incrementby1(int n) { n++; return n; } int main() { int n; cout<<"Input:"; cin>>n; n=incrementby1(n); cout<<"n:"<<n<<endl; return 0; }
ALGO
0.968791
3.04054
0188a4c9-29b7-4497-87ff-f1354e0f2dba
JasbirCodeSpace/AlgorithmsHive
Tim_Sort/Tim_Sort.cpp
#include <iostream> #include <algorithm> using namespace std; const int RUN = 32; void insertionSort(int arr[],int left,int right); void mergeHalves(int arr[],int temp[],int leftStart,int mid,int rightEnd); void copyArray(int a[],int aBegin,int b[],int bBegin,int size); void timSort(int arr[],int n); void printArray(...
ALGO
0.999871
4.105762
a72c23ef-e59b-4a95-bed5-f1f8ff5aa4df
itsme3030/codeForces
codeforces/1793/A.cpp
// #include<bits/stdc++.h> // using namespace std; // int main() // { // #ifndef ONLINE_JUDGE // freopen("input.txt","r",stdin); // freopen("output.txt","w",stdout); // #endif // //write your code from here // int t; // cin >> t; // while(t--){ // // cout<<t<<endl; // int n; // ...
ALGO
0.999747
4.078623
42dd29af-d4b9-4b5a-8067-05f001a82cc4
huaijin-chen/OpenCVMirror
opencv/modules/objdetect/src/matching.cpp
#include "precomp.hpp" #include "_lsvm_matching.h" #include <stdio.h> #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif /* // Function for convolution computation // // INPUT // Fi - filter object // map ...
ALGO
0.999504
5.092179
849417bf-84dd-402a-af81-f72281ead712
korpatiy/pplab4msv
pplab4msv.cpp
#include <iostream> #include "opencv2/opencv.hpp" #include "omp.h" #include <iostream> #include <fstream> using namespace std; using namespace cv; Mat kernel = (Mat_<double>(3, 3) << -1.0, -1.0, -1.0, -1.0, 9.0, -1.0, -1.0, -1.0, -1.0); int clip(int value) { if (value >= 255) return 255; ...
ALGO
0.981269
4.644171
c45ae3a5-8223-400c-b473-38dbe48b3bad
DDongYeop/Algorithm
C++/BAEKJOON/10870 - 피보나치 수 5.cpp
#include <iostream> using namespace std; int Fibonacci(int n); int main() { int n; cin >> n; cout << Fibonacci(n); } int Fibonacci(int n) { if (n < 1) return 0; else if (n < 2) return 1; return Fibonacci(n-1) + Fibonacci(n-2); }
ALGO
0.99998
5.425846
d8e15df6-3e40-42ce-8d4d-7b49a24b37ff
LRL52/ACM-ICPC
2022年电子科技大学ACM-ICPC暑假集训(含数学与几何专题)/7.16/A_-_Digit_Sum_of_2_x.cpp
//ID: LRL52 Date: 2022.7.15 #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #define rep(i, a, b) for(int i = (a); i <= (b); ++i) #define ee(i, a) for(int i = head[a]; i; i = e[i].nxt) using namespace std; const int N = 1055, M = 2055, inf = 0x3f3f3f3f; char Buf[1 << 21], *_A = Buf, *_B = B...
ALGO
0.999926
3.632999
80859d35-68a5-4c8f-8e7c-110bfb4001cd
LaisaRuiz/TPA
ex18.cpp
/*Programa: Exerccio 23 Funo: Leia o nome de um aluno e sua media final Autora: Laisa Cristiana Gonalves Ruiz Data: 29/09/2019 */ #include <stdio.h> #include <locale.h> #include <windows.h> int main(){ setlocale(LC_ALL,""); float media=0; char nome[30]; printf("Informe a mdia do aluno: "); scanf("%f", &...
TOOL
0.961068
3.501659
a4c30ce2-d969-48f2-8627-2c7f0b73661f
RajibTheKing/Interview_Preparation
Practice_Problems/CopyLinkList.cpp
/* // 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) { map<Node*, Node*> mp; Node* ptr = head; ...
ALGO
0.99569
5.396266
38f80d9d-48bc-4819-adf5-4570ba39c26a
alienarena/alienarena
source/unix/odesrc/OPCODE/Ice/IceRevisitedRadix.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Contains source code from the article "Radix Sort Revisited". * \file IceRevisitedRadix.cpp * \author Pierre ...
ALGO
0.999994
6.939073
b20933c7-3551-4ebd-96ef-1d58f67182e7
JoaoHMiranda/Problemas-resolvidos
UVA/11709/11709.cpp
#include <bits/stdc++.h> using namespace std; int n,m; int r=0; map<string,vector<string>>adj; map<string,vector<string>>rev; map<string,bool> vis1; map<string,bool> vis2; stack<string>st; void DFS(string node){ vis1[node]=true; for(auto u:adj[node]){ if(vis1[u]!=true){ DFS(u); } }...
ALGO
0.99965
4.267836
8227cda3-cd77-408c-8d0b-fce5ce2ddf3b
alexandraback/datacollection
solutions_2449486_1/C++/nofto/run.cpp
#include <iostream> #include <string> #include <algorithm> #include <cmath> #include <cstdio> using namespace std; int main() { int T; scanf("%d\n",&T); for(int t=1; t<=T; t++) { int N; int M; int a[100][100]; int rowmax[100]; int colmax[100]; scanf("%d %d\n",&N,&M); for(int i=0;i<N;i++) rowmax[i]...
ALGO
0.999716
3.330957
cd426a93-fa55-42fa-b062-8f0f91c34d97
MehdiNoroozi/JigsawPuzzleSolver
caffe-master-jps++/examples/cpp_classification/classification.cpp
#include <caffe/caffe.hpp> #ifdef USE_OPENCV #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #endif // USE_OPENCV #include <algorithm> #include <iosfwd> #include <memory> #include <string> #include <utility> #include <vector> #ifdef USE_OPENCV using names...
DATA
0.941413
7.697945
77ed9c53-1709-49fb-beb8-68199faa325e
stephenmcgruer/clang-arcompact
lib/AST/DeclObjC.cpp
#include "clang/AST/DeclObjC.h" #include "clang/AST/ASTContext.h" #include "clang/AST/ASTMutationListener.h" #include "clang/AST/Attr.h" #include "clang/AST/Stmt.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallString.h" using namespace clang; //===------------------------------------------------------------...
TOOL
0.978905
6.086887
78589663-c4e2-48a0-aa9e-0015baf191f9
SparklyYS/ProjectEuler
8-Largest_product_in_a_series.cpp
#include <cstdio> #include <cstdlib> #include <iostream> #include <algorithm> #define INF (1<<31) using namespace std; const int maxn = 1024; int d[maxn]; int main() { freopen("in.dat", "r", stdin); for (int i = 0; i < 1000; i++) scanf("%1d", &d[i]); long long Max = -INF; for (int i = 0; i < 988; i++) { l...
ALGO
0.999662
3.787385
65a5d4bc-4800-438d-aae6-4c3c45ae8e1c
juarezpaulino/coderemite
problemsets/UVA/UVA458.cpp
/** * * Author: Juarez Paulino(coderemite) * Email: <EMAIL> * */ #include <cstdio> #include <cstdlib> using namespace std; int main() { char S[1000]; while (gets(S)) { for (int i = 0; S[i]; i++) S[i]-=7; puts(S); } return 0; }
ALGO
0.952329
3.039295
337f1fe4-1c31-4787-abad-045a64ab90d4
shakilahamedriaz/Number-Theory-for-cp
Nod & Sod/sumofDiv2.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int sumofDiv(int n) { ll sum=0; for(int i=1; i*i<=n; i++) { if(i*i==n) { sum+=i; } else if(n%i==0) { sum+=i; sum+=n/i; } } return sum-n; } int main() { int t; cin ...
ALGO
0.999009
5.249291
1e355c9c-72cb-4627-8e09-69f9fd5c61bb
osyoyu/CompetitiveProgramming
aoj/0007.cpp
#include <iostream> #include <cstdio> using namespace std; double cutup(double x) { if (x - (double)((int)x / 1000) * 1000 > 0) { x = (double)((((int)x / 1000) + 1) * 1000); } return x; } double money(double x, int target, int depth = 0) { if (target == depth) { return x; } return money(cutup(x * 1.05),...
ALGO
0.999393
3.416985
b3eed288-90f8-4ebc-a983-c0e9e547d80f
Yeamin235/1-1
factorial in c++.cpp
#include<iostream> using namespace std; int main(){ int num,fact=1,i; cout<<"Enter any number "; cin>>num; for(i=1;i<=num;i++) { fact=fact*i; } cout<<"\n"<<" The factorial is:"<<fact; return 0; }
ALGO
0.998936
3.212639
4e18fda3-a055-4ffc-8f27-56daf924f471
Yush1nk1m/Problem-Solving
BOJ/Random/16956_AdHoc.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; #define EMPTY '.' #define LAMB 'S' #define WOLF 'W' #define WALL 'D' int R, C; int dr[4] = { -1, 0, 1, 0 }; int dc[4] = { 0, -1, 0, 1 }; vector<pii> lambs; vector<vector<char>> m; inline bool isValidPoint(int r, int c); inline bool ...
ALGO
0.999602
3.715293
95efcab4-a104-43a4-86cb-beb3454bf017
rahularity/DSA
Graphs/0-1Matrix.cpp
#include<iostream> #include<queue> using namespace std; class Node{ public: int row; int col; int distance; Node(int row, int col, int distance){ this->row = row; this->col = col; this->distance = distance; } }; vector<vector<int>> find...
ALGO
0.999948
4.94433
5b61ff00-1392-4614-9b7c-bbebc17a8158
Cando02/Algorithmic
模拟/狗哥玩木棒.cpp
// 题目链接:https://www.luogu.com.cn/problem/P2383 // 能否组成4个相同的数字,所以的木棍都要用到 #include<bits/stdc++.h> using namespace std; int t,n; int nums[21],w[5]; int flag; bool vis[1010]; void dfs(int step){ if (flag) return; if (step==5){ flag = 1; return; } for (int i=1;i<=n;i++){ if (!vis[i]&&w[step]-nums[i]>0){ vis[i] ...
ALGO
0.999968
3.924136
83b57c2f-85d0-4e34-82d5-fbe92ef8ff4d
qhadron/contest-solutions
dijkstra_n^2.cpp
#include <iostream> #include <algorithm> #include <string> using namespace std; #define MAX 100 int main() { int adj[MAX][MAX]; int N, M; cin >> N >> M; for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) adj[i][j] = 0xffff; for (int x,y,w; M--;) { cin >> x >> y >> w; adj[x][y...
ALGO
0.99998
4.111624
47ca499a-8bd5-4305-a57f-19c89421a3c0
rituraj0/Topcoder
Old Topcoder SRM codes/ColorfulDecoration.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define bg begin() #define en end() #define Y second #define X first typedef long long ll; #define fi freopen("input.txt","r",stdin) #define fo freopen("output.txt","w",stdout) const double pi = acos(-1.0); const double eps ...
ALGO
0.999932
4.061124
807b86ae-33d6-4edc-bafc-7de48474bd52
efeslab/Pathfinder
pathfinder/graph/posix_graph.cpp
#include "posix_graph.hpp" using namespace std; using namespace llvm; namespace icl = boost::icl; namespace fs = boost::filesystem; namespace pathfinder { /* posix node */ bool posix_node::is_equivalent(string function, const posix_node& other) const { // we search for stack frame, and if there is a match with ...
TOOL
0.921175
5.118287
f526cf9b-24b6-496f-83b1-4c4f99a2f424
udowallasch/comcave
Taschenrechner/Taschenrechner.cpp
// Taschenrechner.cpp //liest zeilenweise eine Operation und ihre Operanden ein und gibt das Ergebnis //Kettenrechnungen sind möglich - das jeweils letzte Ergebnis wird als erster //Operand der nächsten Rechnung genommen. //Udo Wallasch #include "pch.h" #include <iostream> #include <string> #include <regex> using nam...
TOOL
0.965027
3.668419
587aed44-b58b-4437-bec2-6f70965d4a41
jbiccler/learncpp
chapter18/selectionsort/src/main.cpp
#include <cstddef> #include <iostream> #include <type_traits> #include <utility> #include <vector> template <typename T> void selectionSort(T &v) { for (std::size_t i = 0; i < std::size(v) - 1; ++i) { std::size_t smallest_idx{i}; auto smallest_val{v[i]}; for (std::size_t j = i + 1; j < std::size(v); ++j...
ALGO
0.996776
5.930933
845bcdbc-0c3d-4f97-84c7-d038dce72283
LYRA-Block-Lattice/LyraWalletManager
crypto/aes.cpp
#include "aes.h" #include <QCryptographicHash> #include <QApplication> #define F(x) (((x)<<1) ^ ((((x)>>7) & 1) * 0x1b)) #define FD(x) (((x) >> 1) ^ (((x) & 1) ? 0x8d : 0)) // #define BACK_TO_TABLES #ifdef BACK_TO_TABLES const uint8_t sbox[256] = { 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x...
ALGO
0.99964
5.642897
5ba1109a-a166-40dd-85aa-020783375b03
Gabriel-Baril/boost
boost_1_81_0/libs/graph/example/dag_shortest_paths.cpp
#include <boost/graph/dag_shortest_paths.hpp> #include <boost/graph/adjacency_list.hpp> #include <iostream> // Example from Introduction to Algorithms by Cormen, et all p.537. // Sample output: // r: inifinity // s: 0 // t: 2 // u: 6 // v: 5 // x: 3 int main() { using namespace boost; typedef adjacenc...
ALGO
0.999968
5.761645
d6d081ee-1e8b-4ba4-82b8-03e44dd65879
Oscarbralo/TopBlogCoder
UVAOnline/11942/Problem.cpp
// TCTemplate.cpp: define el punto de entrada de la aplicacin de consola. // #include "stdafx.h" #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...
ALGO
0.999653
5.024642
ca5503e2-b4f3-4811-b674-64dc6ca9d16f
ishandutta2007/codeforces
nuip/normal/1153/F.cpp
#include <string> #include <vector> #include<iostream> #include<cstdio> #include<cstdlib> #include<stack> #include<queue> #include<cmath> #include<algorithm> #include<functional> #include<list> #include<deque> #include<bitset> #include<set> #include<map> #include<unordered_map> #include<unordered_set> #include<cstring>...
ALGO
0.999972
3.802842
847cc496-512d-456e-95af-b16ca6a82ffb
csienslab/icLibFuzzer
llvm/lib/MC/MCCodeView.cpp
#include "llvm/MC/MCCodeView.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/DebugInfo/CodeView/Line.h" #include "llvm/DebugInfo/CodeView/SymbolRecord.h" #include "llvm/MC/MCAsmLayout.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/M...
TOOL
0.858924
7.429839
a99ebf99-3fd9-408c-a2ba-410fd266b0f0
paulora2405/udesc
cal/t1/src/key_generator.cpp
#include "../include/key_generator.hpp" Key_pair initialize_128(unsigned max_bits, bool print) { if(max_bits > 256) { throw std::runtime_error("Tamanho de chave não suportada\n"); } big_int p, q, n, totn, e, d, tmp; Prime_generator gen(std::time(NULL)); // Passo 1: Selecionar dois numeros primos aleator...
ALGO
0.933143
5.111266
8a9f6776-59cf-4b06-8b84-5720711c03ab
BIBHAB22/DAA
fractional_knapsack.cpp
// Write a program in C or C++ to implement Fractional Knapsack algorithm. // Find an optimal solution to the knapsack instance n = 7, W = 15. // (p1, p2, ..., p7) = (10, 5, 15, 7, 6, 18, 3) // and (w1, w2, ..., w7) = (2, 3, 5, 7, 1, 4, 1). #include <iostream> using namespace std; // class for fractional knapsack class...
ALGO
0.999993
5.309185
c5c7a7de-7329-4658-810e-95cd411f18da
minyoad/StrokesPlus
boost_1_50_0/libs/graph/example/simple_planarity_test.cpp
int main(int argc, char** argv) { // This program illustrates a simple use of boyer_myrvold_planar_embedding // as a simple yes/no test for planarity. using namespace boost; typedef adjacency_list<vecS, vecS, undirectedS, property<ver...
ALGO
0.98025
6.267366
5825bb0d-0198-4be8-b46c-e2bedc71f645
yeohj0710/old-solutions
05000s/5666.cpp
#include <bits/stdc++.h> using namespace std; int main() { int a, b; while(scanf("%d", &a) != EOF) { scanf("%d", &b); printf("%.2lf\n", (double)a/b); } }
ALGO
0.985915
3.395445
0e8f6378-9bee-41ef-bbc5-783d435c5e62
poorab21/Data-Structures-and-Algorithms
Binary_Tree(Inorder,PostOrder,PreOrder).cpp
#include<iostream> #include<queue> struct Tree{ int data; Tree *left; Tree *right; }*root=NULL; void InsertNode(int data) { Tree *temp=new Tree; temp->data=data; temp->left=NULL; temp->right=NULL; if(root==NULL) { root=temp; } else { std::queue<Tree*> q; q.push(root); while(1) { Tree *sub=q.fro...
ALGO
0.999289
4.486054
2de10b2e-5408-4506-8007-78fc71485a21
Vinayaka2k/Coding-Practice
Desktop/Coding-Practice-main/DAC_2DArraySearch.cpp
class Solution { public: bool search(vector<vector<int>>& arr, int fromRow, int toRow, int fromCol, int toCol, int key){ if(fromRow > toRow || fromCol > toCol) return false; int x = fromRow + (toRow-fromRow)/2; int y = fromCol + (toCol - fromCol)/2; int mid_ele =...
ALGO
0.999893
5.659058
d72f797d-3672-4607-b3b9-b344d17b8202
mvancompernolle/ai_project
data/indonesia.cpp
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include <ql/time/calendars/indonesia.hpp> #include <ql/errors.hpp> namespace QuantLib { Indonesia::Indonesia(Market market) { // all calendar instances share the same implementation instance static boost::shared_ptr<...
TOOL
0.966788
7.123602
1f566069-d262-4851-8167-752d87e5a6ea
hieu7110/code
boiso2.cpp
#include<bits/stdc++.h> using namespace std; long long n,d=0;; long long coso(long long i) { long long so=1; while(i>0) { so=so*10; i--; } return so; } int main() { cin>>n; d=0; for(int i=1;i<=18;i++) { if(coso(i)%n==0){cout<<coso(i);d++;break;} } if(d==0)...
ALGO
0.999787
3.406147
8206f593-b146-4a09-91b6-de8f18cf2209
liusonglei796/code
2089洛谷烤鸡.cpp
#include<bits/stdc++.h> using namespace std; vector<int>v1(10); vector<vector<int>>v2; int n; void dfs(int pos, int sum) { if (pos == 9) { // 修正:先判断终止条件 if (sum == n) { v2.emplace_back(v1); } return; // 移到这里,确保pos==9时一定返回 } for(int i = 1; i <= 3; ++i) { if...
ALGO
0.999919
4.182085
f7d8880b-3c3a-4b3b-aa33-2ddbb5ab6ef6
LouisNguyen25/NGCP_Software_2021_2022
opencv-master/samples/cpp/points_classifier.cpp
#include "opencv2/core.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/ml.hpp" #include "opencv2/highgui.hpp" #include <stdio.h> using namespace std; using namespace cv; using namespace cv::ml; const Scalar WHITE_COLOR = Scalar(255,255,255); const string winName = "points"; const int testStep = 5; Mat img, im...
ALGO
0.961681
4.174309
3e667632-0a2d-4207-a67c-b82c0d8cbc57
niravnb/InterviewBit
13. Dynamic Programming/BestTimeToBuyAndSellStocksIII.cpp
/* Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most two transactions. Note: You may not engage in multiple transactions at the same time (ie, you must sell the stock before you buy again). Example : Input...
ALGO
0.999676
5.909976
6f2b14a9-140b-484b-96ba-d9125aa1a7e9
PunnyOz2/POSN-Programming
Monday/Treebeauty.cpp
/* TASK: LANG: CPP AUTHOR: Pun~ SCHOOL: CRU */ #include<bits/stdc++.h> using namespace std; struct A{ int u,p,q; double d; bool operator<(const A&o)const{ return d>o.d; } }; priority_queue<A> q; vector<A> g[1000002]; double cost[1000003]; int main() { int n,i,u,v; scanf("...
ALGO
0.999827
3.749923
8fe857a2-a960-446f-ad41-f4b0c2989d23
elnormous/ouzel
engine/assets/ObjLoader.cpp
// Ouzel by Elviss Strazdins #include <cstdlib> #include <map> #include <tuple> #include "ObjLoader.hpp" #include "AssetError.hpp" #include "../graphics/Material.hpp" namespace ouzel::assets { namespace { [[nodiscard]] constexpr auto isWhiteSpace(const std::byte c) noexcept { retur...
TOOL
0.929921
3.374363
73cd90c9-d3d4-4ddd-8b02-d3862ea43ff5
sky-bro/AC
leetcode.com/5318 Minimum Number of Taps to Open to Water a Garden/main.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; class Solution { public: int minTaps(int n, vector<int>& ranges) { vector<pair<int, int>> range_pairs; for (int i = 0; i <= n; ++i) { if (ranges[i] == 0) continue; range_pairs.push_back(pair<int...
ALGO
0.999855
5.230819
4e007389-3839-4c17-84d9-4a9c0244c35c
MrSameerKhan/DSA
Recursion/tree_recursion.cpp
#include<iostream> using namespace std; int treeRec(int n ) { if(n>0) { cout<<n<<endl; treeRec(n-1); treeRec(n-1); } } int main() { treeRec(3); }
ALGO
0.999984
4.063854
67100b20-1e29-45d4-9a16-26de202b4635
bell-2/TIL
Algorithm/베스트앨범.cpp
#include <string> #include <vector> #include <map> #include <algorithm> #include <iostream> using namespace std; struct Music { int idx=0; string genre; int play = 0; Music(int _idx, string _g, int _p):idx(_idx), genre(_g), play(_p){} }; map<string, int> maxGenre; bool desc(pair<string, int> &aa, pai...
ALGO
0.999961
4.989511
2a647cd5-b2f5-4501-b18c-e07cf574d2bf
giantleap2012/bundlefusion
FriedLiver/Source/SBALie.cpp
#include "stdafx.h" #include "SBALie.h" #ifdef USE_LIE_SPACE //WARNING broken: needs residual unpacking #include "TimingLog.h" LieEnergyTermHelper* SBA::s_energyTermHelperGlobal = NULL; #define POSESIZE 6 void LieEnergyTermHelper::computeEnergy(const std::vector<mat4f>& transforms) { // set to zero m_lastEnergy ...
ALGO
0.994894
5.260908
cc880efa-8c87-4e6d-8e1c-289aac69e3fb
aceyan/UE4.18.3_release
Engine/Source/Developer/MaterialBaking/Private/MaterialBakingHelpers.cpp
#include "MaterialBakingHelpers.h" #include "Math/Color.h" #include "Async/ParallelFor.h" FColor FMaterialBakingHelpers::BoxBlurSample(TArray<FColor>& InBMP, int32 X, int32 Y, int32 InImageWidth, int32 InImageHeight, bool bIsNormalMap) { const int32 SampleCount = 8; const int32 PixelIndices[SampleCount] = { -(InImag...
ALGO
0.981831
5.8701
51b66567-1554-42e9-9cc8-697fd3d3c093
suryakaushik46/CompetativeProgramming
.ccls-cache/@home@runner@A-Soft-Drinking/Maths: (10*5=50)@Competitive Programmer.cpp
#include <bits/stdc++.h> #define int long long using namespace std; void solve() { string n; cin >> n; if (n.size() == 1 && n[0] == 0) { cout << "red" << endl; return; } int sum = 0; bool even = false; int c = 0; for (int i = 0; i < n.size(); i++) { if ((n[i] - '0') != 0 || c >= 1) { ...
ALGO
0.998638
4.502023
53345e83-ab33-438a-9656-5713a6308630
sarafarajnasardi/cp
Coin_Combinations_II.cpp
// Author : Sarafaraj Nasardi #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #include <complex> #include <queue> #include <set> #include <unordered_set> #include <list> #include <chrono> #include <r...
ALGO
0.999965
4.598212
a063222f-5094-49a6-9393-284049685eec
Hassan-Irtaza/Freshman-year-Assignments
Prep final/Faiq1.cpp
#include <iostream> using namespace std; int main() { int n; do { cout << "enter: "; cin >> n; if (n == 2 || n == 3) { cout << "prime!" << endl; } else if (n == 1 || n % 2 == 0 || n % 3 == 0) { cout << "not prime!" << endl; ...
ALGO
0.999651
3.648655
fbfdbd3c-18ae-489b-b25a-1d3de33189eb
gcant/spectrum-message-passing
include/eigen3/bench/bench_norm.cpp
#include <typeinfo> #include <iostream> #include <Eigen/Core> #include "BenchTimer.h" using namespace Eigen; using namespace std; template<typename T> EIGEN_DONT_INLINE typename T::Scalar sqsumNorm(T& v) { return v.norm(); } template<typename T> EIGEN_DONT_INLINE typename T::Scalar stableNorm(T& v) { return v.sta...
TEST
0.99107
6.666052
697d0899-9f71-4e65-b0a6-d85e45df0b38
junseok16/Baekjoon-Online-Judge
Baekjoon-Online-Judge/03. 정렬(Sort)/2910번 빈도 정렬.cpp
/* * @title : 2910번 빈도 정렬(실버 2) * @content : 정렬 * @author : 탁준석 * @date : 230212 * @time : 0ms * @memory : 2160KB * @state : 완료 */ #include <iostream> #include <vector> #include <unordered_map> #include <algorithm> using namespace std; bool compare(int a, int b); unordered_map<int, pair<int, int>>...
ALGO
0.999991
4.423136
c119df64-5bc0-4bbc-90f3-62951055ff0a
HONGJICAI/LeetCode
cpp/705.cpp
class MyHashSet { vector<set<int>> m_buf = vector<set<int>>(2); int m_totalSize = 0; const int expandRatio = 2; int hashCode(int val, bool rebuild = false) { return val % (rebuild ? m_buf.size() * expandRatio : m_buf.size()); } void tryRebuild() { if (m_totalSize < m_buf.size() * expandRatio * expan...
ALGO
0.998312
5.850339
9f49c851-848e-4e5c-9a1a-ad77de308dfe
ishandutta2007/codeforces
saketh/normal/1363/F.cpp
#include <bits/stdc++.h> using namespace std; // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define mt make_tuple #define lb lower_bound #define ub upper_bound #define f first #define s second #define resz resize #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() ...
ALGO
0.999985
4.830597
d6d52a00-2b2d-4e43-b37f-f1072162a49b
gzhh/leetcode
algorithms/cpp/reverseNodesInKGroup/reverseNodesInKGroup.cpp
// Source : https://leetcode.com/problems/reverse-nodes-in-k-group/ // Author : Zhonghuan Gao // Date : 2019-07-29 /********************************************************************************** * Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive i...
ALGO
0.999995
5.58841