uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
9f15815b-47f9-4d4e-b6d2-3b5c48246d31
JainitBITW/CP
1600/C_Divisibility_by_Eight.cpp
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, n) for (int i = a; i < n; i++) #define FOK(i, a, n) for (int i = n; i > a; i--) #define JALDI ios_base::sync_with_stdio(false); #define jaldi cin.tie(NULL); #define F first #define MP make_pair #define PB push_back #define S second #define nl cout << '\n' ...
ALGO
0.999386
3.63212
cc1c86ae-353e-4f06-86f6-c1f1f3a4b800
NoaCohanim/Election-Race
src/Graph.cpp
#include "Graph.h" #include <vector> using namespace std; Graph::Graph(vector<Party> vertices, vector<vector<int>> edges) : mVertices(vertices), mEdges(edges) { // You can change the implementation of the constructor, but not the signature! } int Graph::getMandates(int partyId) const { return mVertices[part...
ALGO
0.968138
5.354659
899b01ac-5b26-4685-bd0d-cc49d18dd3bc
buptwjf/Leetcode
0_offer2/search/03.cpp
// // Created by 86188 on 2023/7/13. // #include "../include/user.h" #include <unordered_set> using namespace std; /* * ่ฟ™้“้ข˜ๅ…ณ้”ฎ๏ผšๅˆ†ๆžๆ—ถ้—ดๅ’Œ็ฉบ้—ดๅคๆ‚ๅบฆ * 1. ไฝฟ็”จ hash ่กจ๏ผŒ็ฉบ้—ด O(n) ๏ผŒๆ—ถ้—ด O(n) * 2. ไฝฟ็”จ ๅŽŸๅœฐๆŽ’ๅบ๏ผŒไบŒๅˆ†ๆˆ–่€…ๅฟซๆŽ’ ็ฉบ้—ด O(1) ๏ผŒๆ—ถ้—ด O(nlog(n)) * 3. ไฝฟ็”จ ้ธฝๅทขๅŽŸ็†๏ผŒ็”ฑไบŽ้ข˜็›ฎๅ‡บ็Žฐ็š„ n ไธชๆ•ฐๅญ—้ƒฝๅœจ 0~n-1 ็š„่Œƒๅ›ดๅ†…ใ€‚ๅฐ†ไฝ ๆฏไธช * */ class Solution1 { public: int findRepeatNumbe...
ALGO
0.999894
5.772952
d734ea48-3083-45ce-af2b-3884358233e5
bischofc/sgs
contrib/LSF/Matrix.cpp
/* * Code by Peter Salz, TU Kaiserslautern, Germany, 2008 */ #include "Matrix.h" #include "Vector.h" Matrix::Matrix() { m_NumberRows = 0; m_NumberColumns = 0; m_Data = NULL; m_RowSwaps = NULL; } Matrix::Matrix(uint numberRows, uint numberColumns) { m_NumberRows = numberRows; m_NumberColumns = numberColumns; ...
ALGO
0.998073
4.263967
c01cc965-b30b-4933-8347-a7f1641c3afb
asdadeeeee/OJ
leetcode/3396/b.cpp
#include <iostream> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; class Solution { public: int minimumOperations(vector<int> &nums) { unordered_map<int, int> count; for (int i = nums.size() - 1; i >= 0; i--) { count[nums[i]]++; if (count[n...
ALGO
0.999602
5.793605
c2338f03-2e58-4bbb-9afa-d3a98f2ad771
TyDunn/hacker-rank-daily-challenge
HackerRank/Algorithms/String/funny-string.cpp
// Funny String // Day #81 // Sunday, July 30, 2017 // https://www.hackerrank.com/challenges/funny-string #include <cmath> #include <string> #include <iostream> using namespace std; int main() { int tests; cin >> tests; for (int i = 0; i < tests; i++) { bool funny = true; ...
ALGO
0.997134
5.712754
bc6652bf-82d7-4adf-841f-48138fc2c7b7
fqez/kobuki_test
src/ecl_core/ecl_core_apps/src/benchmarks/eigen3_inverse.cpp
/** * @file /ecl_core_apps/src/benchmarks/eigen3_inverse.cpp * * @brief Tests eigen3 inverses and decompositions. * * @date Aug 4, 2010 **/ /***************************************************************************** ** Includes *****************************************************************************/ #i...
TEST
0.939625
5.387869
94b93e60-110c-4e02-a660-3c45216f84be
igorjoz/cpp-course
!! math, functions/Zaokraglanie/main.cpp
#include <iostream> #include <cmath> using namespace std; int main() { float liczba; cout<<"Rozne rodzaje zaokraglania:"<<endl<<endl; cout<<"Podaj liczbe: "; cin>>liczba; cout<<endl<<"round(x): "<<round(liczba)<<endl; cout<<"ceil(x): "<<ceil(liczba)<<endl; cout<<"floor(x): "<<floor(licz...
ALGO
0.853557
3.200489
88e4da10-96a2-4bfe-8acf-020daf963808
sanhee16/baekjoon
greedy/13413.cpp
#include <string> #include <vector> #include <iostream> #include <queue> #include <deque> #include <stack> #include <algorithm> #include <set> #include <unordered_map> #include <map> #include <unordered_set> using namespace std; int main() { int k, n; cin >> k; for (int loop = 0; loop < k; loop++) { cin >> n; ...
ALGO
0.999929
4.282745
e0963a02-cecb-48c4-ada6-d94ce1837082
rahul-goel/CompetitiveProgramming
CodeForces/A/168 A.cpp
/* Created by Rahul Goel. */ /*******************************************************************************/ #include <iostream> #include <vector> #include <cstring> #include <string> #include <queue> #include <deque> #include <stack> #include <algorithm> #include <cmath> #include <set> #include <map> #include <un...
ALGO
0.999684
3.493474
cda34825-f6b9-4112-9555-bcc370853ecd
ishandutta2007/codeforces
lycmd/normal/1280/D.cpp
#include<bits/stdc++.h> #define int long long using namespace std; int const N=3010; int t,n,m,a[N],b[N],sz[N]; struct node{ int cnt,val; node(int x=0,int y=0):cnt(x),val(y){} int operator<(const node&rhs)const{ return cnt<rhs.cnt||(cnt==rhs.cnt&&val<rhs.val); } }; node f[N][N],g[N]; vector<int>e[N]; void dfs(int...
ALGO
0.999947
3.993495
24159f7b-8877-4b4e-b23e-3182324d85f7
Priyanshu-Sarkar03/DSA
0027-remove-element/0027-remove-element.cpp
class Solution { public: int removeElement(vector<int>& nums, int val) { int count = 0; for (int i = 0; i < nums.size(); ) { if (nums[i] == val) { nums.erase(nums.begin() + i); count++; } else { i++; } } ...
ALGO
0.998271
6.403005
b15529ee-f3fc-4eaa-ad33-f978755a7398
Kuliyalrashmi/DSA_Questions
0118-pascals-triangle/0118-pascals-triangle.cpp
class Solution { public: vector<vector<int>> generate(int numRows) { vector<vector<int>>pascal(numRows); for(int i=0;i<numRows;i++) { pascal[i]=vector<int>(i+1,1); for(int j=1;j<i;j++) { pascal[i][j]=pascal[i-1][j]+pascal[i-1][j-1]; ...
ALGO
0.999978
5.901454
99b8bc32-28fa-4524-b7c8-24c459ff1d10
Thalisson-Alves/Competitive-Programming
submissions/CodeForces/1527/c.cpp
#include <bits/stdc++.h> using namespace std; #ifdef DEBUG #include "debug.cpp" #else #define dbg(...) #endif using ll = long long; void solve() { int n; cin >> n; map<int, ll> sum; ll res = 0; for (int i = 0; i < n; i++) { int x; cin >> x; res += sum[x] * (n - i); sum[x] += i+1; } cout...
ALGO
0.999581
4.939526
dca8a6cb-08da-47a0-8ab3-bb8f71a17467
ammoramine/StereoMatchingAlgorithm
ROF.cpp
#include "ROF.h" ROF::ROF(const double &tau,const std::vector<double> &l,const std::vector<double> &costij) // this function resolve argmin( Sigma cost(ij)|v(i+1)-v(i)|+tau/2*Sigma|vi-li|^2) with vi on R // costij should be smaller than l on size by one element, and should contains postive elements { m_tau=tau; int ...
ALGO
0.999977
6.100945
72912166-5de4-4125-a4f3-04e5273a5fb0
hrushikesht/CompetitiveProgramming
old/temp/noob-digits.cpp
#include <iostream> #include <stdio.h> #include <algorithm> #include <stdbool.h> #include <string> using namespace std; int main() { int test; cin>>test; while(test--) { string boolean; // boolean = (char *)malloc(51*sizeof(char)); cin>>boolean; // cout<<sizeof(boolean); // scanf(" %[^\n]s",boolean)...
ALGO
0.999705
3.689458
2e8fe2e3-d076-42c7-a021-567b786832b2
WilsNTHU/Leetcode
0518-coin-change-ii/0518-coin-change-ii.cpp
class Solution { public: int helper(vector<int>& coins, vector<vector<int>> &dp, int amount, int idx){ if(idx < 0) return 0; if(amount == 0) return 1; if(dp[idx][amount] != -1) return dp[idx][amount]; int take = 0, notTake = 0; if(amount >= coins[idx]) take ...
ALGO
0.999947
5.990042
9d6aa9d5-ce5e-413a-83bc-ec81806cbeb3
avidLearnerInProgress/leetcode-solutions
long_pressed_name.cpp
class Solution { public: bool isLongPressedName(string name, string typed) { int i = 0, m = name.length(), n = typed.length(); for (int j = 0; j < n; ++j) if (i < m && name[i] == typed[j]) ++i; else if (!j || typed[j] != typed[j - 1]) return fa...
ALGO
0.99977
6.039743
b58bd434-ad85-4b89-a31c-91640027f77c
bjbjkidrock/LeetCode-1
Algorithms/find-eventual-safe-states.cpp
802. Find Eventual Safe States https://leetcode.com/problems/find-eventual-safe-states/ In a directed graph, we start at some node and every turn, walk along a directed edge of the graph. If we reach a node that is terminal (that is, it has no outgoing directed edges), we stop. Now, say our starting node is eventual...
ALGO
0.999993
7.091983
218a172c-f9bd-4f82-9d25-142237ae75b6
Grizzlyess/Programming-Competicion
permutations.cpp
#include <bits/stdc++.h> using namespace std; void permutation(int seq[], int tam) { int resp[tam], c = 0, d; if (tam%2==0) d = tam / 2; else d = (tam / 2)+1; for (int i = 0; i < tam; i++) { if (i % 2 == 0) { resp[c] = seq[i]; c++; ...
ALGO
0.999991
4.531947
6304c1a7-e7d9-4405-a5f7-aec31fc9ad61
hezhaojiang/leetcode-cpp
959.็”ฑๆ–œๆ ๅˆ’ๅˆ†ๅŒบๅŸŸ.cpp
/* * @lc app=leetcode.cn id=959 lang=cpp * * [959] ็”ฑๆ–œๆ ๅˆ’ๅˆ†ๅŒบๅŸŸ */ #include<vector> #include<string> using namespace std; /* * ๅ•ๅ…ƒๆ ผๅ†…๏ผš * +------+ * |\ 0 /| * | \ / | * |3 \/ 1| * | /\ | * | / \ | * |/ 2 \| * +------+ * ๅฆ‚ๆžœๆ˜ฏ็ฉบๆ ผ๏ผšๅˆๅนถ 0ใ€1ใ€2ใ€3๏ผ› * ๅฆ‚ๆžœๆ˜ฏๆ–œๆ ๏ผšๅˆๅนถ 0ใ€3๏ผŒๅˆๅนถ 1ใ€2๏ผ› * ๅฆ‚ๆžœๆ˜ฏๅๆ–œๆ ๏ผšๅˆๅนถ 0ใ€1๏ผŒๅˆๅนถ 2ใ€3ใ€‚ */ // @lc code=sta...
ALGO
0.999511
6.258223
b58d68aa-5915-414e-b508-87839337c270
ahmedL1110/Food-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.998762
6.786404
70ba740e-d054-4a55-b106-45a8470aecb5
KeitoKubo/SolutionCodes
AtCoder/Solutions/ABC251-300/ABC286/d.cpp
#define _USE_MATH_DEFINES #include <iostream> // cout, endl, cin #include <cstdio> // printf, scanf #include <string> // string, to_string, stoi #include <algorithm> // min, max, swap, lower_bound, upper_bound // & stable...
ALGO
0.999963
3.641798
c8e4d24d-addf-4564-8e06-ec8658a3051a
hellocomrade/happycoding
leetcode/SingleNumber3.cpp
#include <vector> #include <numeric> #include <functional> using namespace std; //https://leetcode.com/problems/single-number-iii/ /* 260. Single Number III Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appea...
ALGO
0.999556
5.530244
bf310bcf-33e5-4ed9-bb6c-d32ec8df8794
SuriyaaVijay/code-dump
Algorithms/MooreVotingAlgorithm.cpp
#include <iostream> using namespace std; // Function to find majority element int findMajority(int arr[], int n) { int i, candidate = -1, votes = 0; // Finding majority candidate for (i = 0; i < n; i++) { if (votes == 0) { candidate = arr[i]; votes = 1; } else { if (arr[i] == candidate) votes++; ...
ALGO
0.999991
5.120369
5c23e8a2-3304-4297-a922-b37a48fa06ed
yeze322/Linux-C
OldCode/100้ข˜/5/5/ๆบ.cpp
/*ะดาปvoid fun(int m,int k,int xx[]) รบฤนวฃmาฝmkxxึธ*/ #include<iostream> using namespace std; int ifprime(int n) { int t=0; for(int i=2;i<n;i++) if(n%i==0) t++; return (!t); }//1 void fun(int m,int k,int xx[]) { int t=0; m++; while(t<k)//m*mฮช็กฃวดฤฃ { if(ifprime(m))// { //cout<<m<<"~~~"; xx[t++]=m; //t...
ALGO
0.999606
3.352589
62dcd02e-a71e-41bc-ae1f-902dc084bdba
reofard/Algorithm
2263/code.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; int n; int post[100001]; int in[100001]; struct node { int v = 0; node *right = nullptr; node *left = nullptr; }; void tree(node *a) { cout << a->v << ' '; if (a->left != nullptr) { tree(a->left); } ...
ALGO
0.999993
4.480569
d28df7f8-ea29-48c2-83a2-798a6e276160
its-coder5128/leetcode
my-folder/problems/best_time_to_buy_and_sell_stock_ii/solution.cpp
class Solution { public: int solve(vector<int>& prices,int index,int buy,vector<vector<int>> &dp) { int n = prices.size(); if(index == n) return 0; if(dp[index][buy] != -1) return dp[index][buy]; if(buy) return dp[index][buy] = max( ...
ALGO
0.999966
5.863418
8b69614e-5bc5-4b42-bd8c-e6b102a4828b
SahilRaj1/placement-prep
dsa/dp/23_Minimum_Swaps_To_Make_Sequences_Increasing.cpp
/* TOPIC: Minimum Swaps To Make Sequences Increasing */ // TIME COMPLEXITY: O() // SPACE COMPLEXITY: O() // REFERENCE: https://youtu.be/IeT9Qz_vqHo // QUESTION: https://leetcode.com/problems/minimum-swaps-to-make-sequences-increasing/ #include <bits/stdc++.h> using namespace std; /* Recursion + Memoization */ class...
ALGO
0.999993
5.654092
93dab6a5-2592-4673-929d-78438171e74a
bigshishiga/zaochka
E.cpp
//#pragma GCC optimize("Ofast,unroll-loops") #ifdef LOCAL #include "debug.h" #else #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define debug(x...) #endif using namespace std; //#define int short typedef long long ll; typedef long double ld; typedef pair...
ALGO
0.999955
4.163565
ac0635e4-aa13-4a12-8fd0-5c6ed72795e1
mahnoor-ali/DATA_STRUCTURES
Sorting/BubbleSort/bubleSort.cpp
// LOGIC: repeatedly swap two adjacent elements if they are in wrong order (Left->Right) //"BUBBLE sort": At each iteration, maximum element (of unsorted part) comes out like a bubble and settle down at appropriare position (end) int* bubbleSort(int[] arr, int n) { int temp; //outer loop for n-1 iterations ...
ALGO
0.999739
4.668558
448f9245-7e35-493d-915e-6a0707acf04a
ris04hit/CP
template/sieve template.cpp
// template // template_sieve // template containing sieve related functions #include <bits/stdc++.h> using namespace std; // /*Sieve Template*/ /*The ith element of array contains smallest prime factor of i+1*/ struct Sieve{ vector<int> sieve; Sieve(int n){ sieve = vector<int> (n, 1); for (...
ALGO
0.998762
4.188303
8d0ce485-a856-4da0-9dff-f726532a01d8
Twinklebear/libbat
tools/vtu_converter.cpp
#include <fstream> #include <iostream> #include <string> #include <vector> #include <glm/glm.hpp> #include <vtkCell.h> #include <vtkDataArray.h> #include <vtkPointData.h> #include <vtkSmartPointer.h> #include <vtkUnstructuredGrid.h> #include <vtkXMLUnstructuredGridReader.h> #include "bat_file.h" #include "lba_tree_buil...
DATA
0.904622
4.839723
f5eddf93-4130-41ed-beee-c6bbf9321af9
mdalauddin45/Competitive
Module 10/Rectangle.cpp
#include<bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> p; typedef long long ll; typedef long long int lli; const int N=1e5+7; int nums[N]; #define cn(n) int n;cin>>n; #define w(t) int t;cin>>t;while(t--) #define Alauddin ios_base::sync_with_stdio(fals...
ALGO
0.999425
4.322793
0eb1696b-6647-4627-8ffc-538ba8c6e080
infinitex-tech/default-template
Project/contracts/libc++/upstream/benchmarks/algorithms.bench.cpp
#include <unordered_set> #include <vector> #include <cstdint> #include "benchmark/benchmark_api.h" #include "GenerateInput.hpp" constexpr std::size_t TestNumInputs = 1024; template <class GenInputs> void BM_Sort(benchmark::State& st, GenInputs gen) { using ValueType = typename decltype(gen(0))::value_type; c...
TEST
0.990932
7.186753
eacd9a45-3a9f-46c0-96a1-c94c6cb011ce
FryderJr/Unreal-Engine
Engine/Source/ThirdParty/CryptoPP/5.6.2/include/eprecomp.cpp
// eprecomp.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #ifndef CRYPTOPP_IMPORTS #include "eprecomp.h" #include "asn.h" NAMESPACE_BEGIN(CryptoPP) template <class T> void DL_FixedBasePrecomputationImpl<T>::SetBase(const DL_GroupPrecomputation<Element> &group, const Element &i_base) { ...
ALGO
0.868447
7.05814
39064788-7f71-45c0-b5b3-357040624bbc
MarkKim1/Leetcode
47-permutations-ii/47-permutations-ii.cpp
class Solution { public: vector<vector<int>> permuteUnique(vector<int>& nums) { vector<vector<int>> result; vector<int> sub; sort(nums.begin(),nums.end()); //result.push_back(nums); int count = 0; // while(next_permutation(nums.begin(),nums.end())){ // res...
ALGO
0.999979
6.129646
aaa81680-3b58-4d8c-ba8c-78a923f532ec
kechidi-abdelilah/itec_test
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.9988
6.76073
3f741c85-955b-4f00-b27e-933dc5248236
ericliuu/flux
FLUX/llvm/lib/Transforms/Utils/CtorUtils.cpp
#include "llvm/Transforms/Utils/CtorUtils.h" #include "llvm/ADT/BitVector.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/Module.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include <numeric> #define DEBUG_TYPE "ctor_uti...
TOOL
0.887145
7.789199
8c147bb5-2738-4654-8ebb-3e14c7af4c90
dong-minkim/algorithm
BOJ/์•Œ๊ณ ๋ฆฌ์ฆ˜ ์—ฐ์Šต/14647_์ค€์˜ค๋Š” ์กฐ๋ฅ˜ ํ˜์˜ค์•ผ.cpp
#include<iostream> #include<algorithm> #include<vector> using namespace std; int arr[500][500]; int main() { int n, m; int num; int hap = 0; int max_ = 0; int col = 0; int row = 0; cin >> n >> m; for (int i = 0; i < n; i++) { row = 0; for (int j = 0; j < m; j++) { int cnt = 0; cin >> num; while (nu...
ALGO
0.999961
3.598968
6e83cf3d-4d90-408e-bf91-2ce5f6f301bf
JunMoLee/GpGnCS
Array.cpp
#include "formula.h" #include "Array.h" int counter=0; double Array::ReadCell(int x, int y, char* mode) { // mode is only for the 3T1C cell to select LSB or MSB // it should be "MSB_LTP","MSB_LTD" or "LSB" if (AnalogNVM *temp = dynamic_cast<AnalogNVM*>(**cell)) // Analog eNVM { double readVoltage = st...
ALGO
0.968215
3.406503
c4d6531a-bdef-4830-8b63-ccab0461e2cb
HumbertoJunior/FECG_CNN
Testes/frugallyTest/eigen/bench/sparse_randomsetter.cpp
#define NOGMM #define NOMTL #include <map> #include <ext/hash_map> #include <google/dense_hash_map> #include <google/sparse_hash_map> #ifndef SIZE #define SIZE 10000 #endif #ifndef DENSITY #define DENSITY 0.01 #endif #ifndef REPEAT #define REPEAT 1 #endif #include "BenchSparseUtil.h" #ifndef MINDENSITY #define M...
TOOL
0.922999
4.487392
b860dab7-db22-4140-83b5-2f7a5f459785
ishandutta2007/codeforces
allvik06/normal/1195/C.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double const int INF = 1e18; signed main() { #ifdef _DEBUG freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int n, maxa = 0, maxb = 0; cin >> n; vector <int> a(n), b(n); for (in...
ALGO
0.999931
4.289246
2df85ff5-0a5e-4b02-bce5-bbf42de36cab
Akash-reddy-s/DSA0182-Object-Oriented-Programming-with-C-for-String-Applications
Add binary number.cpp
#include<iostream> using namespace std; int main() { string str1, str2, sum=""; int len1, len2, i, j, ds=0; cout<<"Enter the First Binary Number: "; cin>>str1; cout<<"Enter the Second Binary Number: "; cin>>str2; len1 = str1.size(); len2 = str2.size(); i = len1 - 1; j = len2 - 1; while...
ALGO
0.999953
4.569013
e9e8b628-900a-4a18-a706-a878857ca093
Sefayet-Alam/New-CP-submissions_vol_3
Invert_And_Equalize.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; // VVI #define fast \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define ll long long #define SZ(a)...
ALGO
0.999899
5.100703
00cd1525-fef3-4feb-ab37-e101a441abfa
mfirhas/ProgrammingChallenges
OpenKattis/encodedmessage.cpp
// author: Muhammad Fathir Irhas // date: 2018-11-03 // sample input: // 3 // RSTEEOTCP // eedARBtVrolsiesuAoReerles // EarSvyeqeBsuneMa // sample output: // TOPSECRET // RosesAreRedVioletsAreBlue // SquaresMayBeEven // ---- // previous solution using Go(same case and same algorithm): // package main // import ( //...
ALGO
0.999953
4.902625
c62602d2-f3e0-458f-9a2a-e01cdc52bf3b
ishandutta2007/codeforces
andr0901/normal/1111/C.cpp
#pragma GCC optmize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; #define forn(i, s, f) for (int i = s; i < f; i++) #define pii pair <int, int> #define fs first #define sc second #define pb push_bac...
ALGO
0.99978
3.750525
33408f1e-8199-4763-8eb3-1eb349f7b2a8
yashyvs/6Companies30Days
Atlassian/Construct-the-Longest-New-String.cpp
class Solution { public: int longestString(int x, int y, int z) { int co = 0; while(x > 0 && y > 0) { co += 2; co += 2; x--; y--; } if(x >= 1) co += 2; if(y >= 1) co += 2; co += (z*2); return co; } }; /* ...
ALGO
0.999788
5.389407
dcdff4de-b235-46d0-a38d-87d899a5b4a3
abhishek201202/competitive-programming
Game theory/othello_evaluation.cpp
#include <iostream> #include <vector> using namespace std; int** makeAMove(int** board, int x, int y, int player,int isCheck); vector<pair<int, int>*>* possibleMoves(int** board, int player) { vector<pair<int, int>*>* output = new vector<pair<int, int>*>(); for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++...
ALGO
0.999034
4.592209
061eb63b-62fb-4833-8a29-e0dc21f5813f
petermoomaw/Xenharmonic-Keyboard
cpp/eigen/doc/examples/class_CwiseUnaryOp.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; // define a custom template unary functor template<typename Scalar> struct CwiseClampOp { CwiseClampOp(const Scalar& inf, const Scalar& sup) : m_inf(inf), m_sup(sup) {} const Scalar operator()(const Scalar& x) const { return x<m_...
ALGO
0.941564
6.417363
39e1bed0-6d94-498e-861d-e664633ea061
letsjdosth/BayesianSTERGM
BayesianSTERGM/ERGM_MCML.cpp
#pragma once #include <vector> #include <iostream> #include <armadillo> #include "Network.h" #include "NetMCMCSampler_ERGM.h" #include "ERGM_MCML.h" using namespace std; using namespace arma; //private void ERGM_MCML::updateNetworkInfo() { n_Node = observedNet.get_n_Node(); } vector<Network> ERGM_MCML::genSamp...
ALGO
0.99938
4.83375
a8a23f18-292a-4b95-8379-a7f1f2ab0136
kaushikns/3d-multiscale-thrombosis-solver
palabos/utility/stl/refineByAreaSTL/refineByAreaSTL.cpp
#include "palabos3D.h" #include "palabos3D.hh" using namespace plb; using namespace std; typedef double T; int main(int argc, char* argv[]) { plbInit(&argc, &argv); global::directories().setOutputDir("./"); global::IOpolicy().activateParallelIO(false); string stlFileName, outFileName; try { ...
ALGO
0.9704
5.472381
5b47a400-1739-4371-abda-00e8ca665c43
AishwaryaDoosa/Boost
boost_1_72_0/libs/multi_index/example/rearrange.cpp
#if !defined(NDEBUG) #define BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING #define BOOST_MULTI_INDEX_ENABLE_SAFE_MODE #endif #include <boost/config.hpp> #include <boost/detail/iterator.hpp> #include <boost/multi_index_container.hpp> #include <boost/multi_index/random_access_index.hpp> #include <boost/random/binomial_dis...
TEST
0.976003
6.947739
286cd8b3-40b3-4bfa-9cef-a8c11fc8b74b
mkkellogg/GTE
src/gtemath/gtemath.cpp
#include "gtemath.h" #include <math.h> #include <cmath> #include <stdlib.h> namespace GTE { union IntFloatUnion { Int32 i; Real f; }; Real GTEMath::SquareRoot(Real n) { return sqrt(n); } Real GTEMath::QuickSquareRoot(Real n) { IntFloatUnion ifu; Real thre...
ALGO
0.859872
5.431386
9e1e2c98-aec8-433c-a022-1bd7599e6d44
raincross7/code-similarity
codes/train_code/problem314/problem314_153.cpp
#include "bits/stdc++.h" #define PRECISION(x) cout << fixed << setprecision(x) #define FAST_IO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define SZ(X) ((int)(X).size()) #define ALL(X) (X).begin(), (X).end() #define ALLR(X) (X).rbegin(), (X).rend() #define MP make_pair #define PB push_back #define EB e...
ALGO
0.999891
3.74346
94642a60-f201-4a2a-a86b-a71b1204e56e
ishandutta2007/codeforces
umqra/normal/555/B.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <set> #include <map> #include <algorithm> #include <vector> #include <cstring> using namespace std; typedef long long ll; typedef pair<ll, int> pii; #define X first #define Y second #define mp make_pair const int N = (int)2e5 + 10; const int E = 4 * N;...
ALGO
0.999999
3.652483
d8f3ee49-2914-43bb-a31c-e2aa17ab4cc3
YongBinnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn/hood
proxy/src/tls_message_decoder.cpp
#include <boost/endian/conversion.hpp> #include <string> #include <type_traits> #include <vector> #include "logging.hpp" #include "src/tls_definition.hpp" #include "src/tls_definition_raw.hpp" #include "tls_message_decoder.hpp" namespace endian = boost::endian; using std::string; using std::vector; namespace hood_pr...
TOOL
0.871247
6.308589
fbfa784f-72b2-49a8-bab7-1205c4bf0577
5thwin/baekjoon
6679(์‹ฑ๊ธฐํ•œ ๋„ค์ž๋ฆฌ ์ˆซ์ž).cpp
#include <cstdio> using namespace std; int sum_10(int num) { int sum = 0; while (num) { sum += num % 10; num /= 10; } return sum; } int sum_16(int num) { int sum = 0; while (num) { sum += num % 16; num /= 16; } return sum; } int sum_12(int num) { int sum = 0; while (num) { sum += num % 12; nu...
ALGO
0.998824
3.794025
362e71b0-0ad5-4414-a1fc-7479b757e199
ANYCUBIC-3D/AnycubicSlicer_Prusa
src/slic3r/Utils/Serial.cpp
#include "Serial.hpp" #include "libslic3r/Exception.hpp" #include <algorithm> #include <string> #include <vector> #include <chrono> #include <thread> #include <fstream> #include <exception> #include <stdexcept> #include <boost/algorithm/string/predicate.hpp> #include <boost/filesystem.hpp> #include <boost/format.hpp...
TOOL
0.917462
7.08877
a58f9ca4-c2c7-45d8-aa1a-cfb6312be6c3
Hasibul-Jihad/L-2-T-2
lab-1/ex-2.cpp
#include <iostream> using namespace std; class BOX { public: // public access of the members double length, breadth, height; // data members // defining member functions void input_value() { cout << "Enter three sides of a box: " << endl; cin >> length >> breadth >> height; } ...
TOOL
0.873568
5.063894
875b7e10-078a-4bcf-b4c5-2f20e87682a6
alexandraback/datacollection
solutions_1483488_1/C++/zxfc/QualC.cpp
#include <cmath> #include <ctime> #include <iostream> #include <string> #include <vector> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cstring> #include <sstream> #include <queue> #include <cassert> #include <cctype> #define pb push_back #define mp make_pair using namespace std; typedef long long...
ALGO
0.999587
3.868524
76363194-0450-4097-86ff-c1fd4ce31adc
wzao1515/R2S
ra2sql/ra2sql/include/boost_1_55_0/libs/units/example/radar_beam_height.cpp
/** \file \brief radar_beam_height.cpp \details Demonstrate library usage for user test cases suggested by Michael Fawcett. Output: @verbatim //[radar_beam_height_output radar range : 300 nmi earth radius : 6.37101e+06 m beam height 1 : 18169.7 m beam height 2 : 9.81085 nmi beam height 3...
TOOL
0.990404
6.504805
9dcd9422-0ddd-4c7d-8127-59853290ae01
Manteg-Singh/Data-Structures-and-Algorithms
Practice Problems/Greedy/RearrangeChar.cpp
#include <iostream> using namespace std; int main() { int i; cin>>t; while (t--) { string s; cin>>s; } return 0; }
ALGO
0.996477
3.543463
3dc49aa2-7556-4797-83ba-aee42ab98938
tang415a/algorithms
numbers/oddEvenJumps.cpp
/* You are given an integer array arr. From some starting index, you can make a series of jumps. The (1st, 3rd, 5th, ...) jumps in the series are called odd-numbered jumps, and the (2nd, 4th, 6th, ...) jumps in the series are called even-numbered jumps. Note that the jumps are numbered, not the indices. You may jump f...
ALGO
0.999967
5.597964
ba7eabec-4f4f-467d-9784-d3d2682e5dd6
MaxCar31/Programming-for-Beginners-C-
Pagos y Salarios/Pago_Comision_Vendedores_Compania.cpp
//Max Carriรณn //Objetivo: Resolver el problema de una compaรฑia que paga a sus vendedores por comision. #include <iostream> bool agregarVendedores (); using namespace std; int numeroDeVendedores = 1; int main (){ const int base = 200; const int numeroDeRangos = 9; int nventasDevendedores [numeroDeVendedores]; ...
TOOL
0.9916
4.516649
402aa61b-20f3-43fc-a700-d7f820c17744
hus-king/Luogu_C
36_dream_3.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n; cin>>n; vector<int> a; vector<int> b; vector<int> d(n+1,0); vector<int> min(n+1,0); vector<int> bmin(n+1,0); //min[i] ไธบไปŽ0ๅˆฐiไธญd็š„ๆœ€ๅฐๅ€ผ vector<int> c(n+1,0); for(int i=0;i<=n;i++){ ...
ALGO
0.999997
3.252507
45803e7c-386c-4029-83aa-c7e07e4a916b
Abhi347/s3eTxmpp
src/proxydetect.cpp
#include "proxydetect.h" #ifdef WIN32 #include "win32.h" #include <shlobj.h> #endif // WIN32 #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef OSX #include <SystemConfiguration/SystemConfiguration.h> #include <CoreFoundation/CoreFoundation.h> #include <CoreServices/CoreServices.h> #include <Security/Security.h...
TOOL
0.967202
7.154583
8b75a86a-f3af-41a2-ba95-63b9fb582c3a
Bhasvanth-Dev9380/adhicine
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.998809
6.763549
a12eb5bb-a1b1-44d7-ad35-364b669486e4
vanniee2401/DSA_IT003.P213
OnThiCK/OnThiCK.cpp
#include <bits/stdc++.h> using namespace std; // linked list struct Node { int data; Node *next; Node(int idata) { data = idata; next = nullptr; } }; struct List { Node *head; Node *tail; List() { head = nullptr; tail = nullptr; } }; void Creat...
ALGO
0.99868
4.037895
7084f354-d747-4ae6-87e8-0e666f16eb62
SeismicTools/HorizonTrackingTools
src/FotiadiMath.share/seismic3D.cpp
#include "fotiadi_math.h" #include <vector> #include <unordered_map> #include <string> #include <map> #include <queue> #include <chrono> #include "graph_alg.h" #include "fotiadi_math_private.h" #include <omp.h> #include "wave_alg.h" class CorrelationObjectForTwoPoint { private: std::vector<int16_t> forward; std::vec...
ALGO
0.997116
3.910162
afd9de5b-92be-4a54-a37e-c4cfe84d79c4
nowaxsky/Data_Structure_with_Cplusplus
9_Sorting/Exercise9-Sorting/ex9A.cpp
#include <iostream> #include <algorithm> #include <vector> #include <cstdlib> using namespace std; struct LargerThan { inline bool operator()(int a, int b) const { // TODO return a>b; } }; ostream &operator<<(ostream &lhs, const vector<int> &rhs) { for (size_t i = 0; i < rhs.size(); ++i) { if (i != 0) lh...
ALGO
0.991676
4.084476
3405b9c9-8646-4b6b-8756-974e6651dfe5
WCWFA/code-practice
ๅฟซ้€Ÿๅน‚_ๆจกๆฟ/main.cpp
#define _CRT_SECURE_NO_WARNINGS 1 #include<iostream> #include<math.h> using namespace std; long long a, b, p; long long QuickPow(long long a, long long b,long long p) { long long ret = 1; while (b) { if (b & 1) { ret = ret * a % p; } a = a * a % p; b = b >> 1; } return ret; } int main() { cin >> a >>...
ALGO
0.999962
4.003155
174f48bf-ce17-4876-b4c0-2ccf188d7308
achillescd/C-program
practice/1-6.cpp
#include <stdio.h> int main() { int a,b,c,t; scanf("%d%d%d",&a,&b,&c); if(a<b) { t=b; } else t=a; if(t>c) { printf("max=%d\n",t); } else printf("max=%d\n",c); return 0; }
ALGO
0.999914
3.831823
c2ff18fe-1cc7-4645-a306-98f6ea89c4e6
zll-hust/ProgrammingUpupup
Day1/D1-H-LalaLandandAppleTrees/H - Lala Land and Apple Trees.cpp
#include <iostream> #include <string> #include <cstring> #include <vector> #include <algorithm> #include <cmath> using namespace std; // #define LOCAL bool cmp1(pair<int, int> a, pair<int, int> b) { return a.first < b.first; } bool cmp2(pair<int, int> a, pair<int, int> b) { return a.first > b.first; } int m...
ALGO
0.99987
3.539356
ddd1ea56-255c-48a3-92ac-0a6d91a4b53a
umahesh-7/Data-Structures-Project
coding/module4.cpp
#include<stdio.h> #include<malloc.h> #define infinity 9999 typedef enum { thread, link} boolean; struct node *in_succ(struct node *p); struct node *in_pred(struct node *p); struct node { struct node *left_ptr; boolean left; int info; boolean right; struct node *right_ptr; }*head=NULL; insert_head() { struct node...
ALGO
0.999975
3.638481
1d2f3c74-5f7b-48c7-8c56-d8b98f2a810c
yooniversal/PS
BOJ/greedy/1931.cpp
//1931 #include <cstdio> #include <cstring> #include <iostream> #include <vector> #include <algorithm> #define max(a, b) (((a)>(b)) ? (a) : (b)) using namespace std; pair<int, int> input[100005]; int main() { int n, cnt = 0; scanf("%d", &n); // รฐ sort() ฯฑ first ึพุด // รฐ start ึพ for (int i = 0; i < n; i++) ...
ALGO
0.999955
3.776458
018336cf-80ae-4970-9d50-4d4cfbfff478
HPC-AI-Team/lammps-fugaku-threadpool-sc23
src/ASPHERE/fix_nve_asphere.cpp
// clang-format off /* ---------------------------------------------------------------------- Contributing author: Mike Brown (SNL) ------------------------------------------------------------------------- */ #include "fix_nve_asphere.h" #include "atom.h" #include "atom_vec_ellipsoid.h" #include "error.h" #includ...
ALGO
0.988431
7.053648
f5119184-4dc2-4ede-a0ef-91c4e00dcb3d
davimuri/adventofcode2024
src/day23.cpp
#include <iostream> #include <fstream> #include <sstream> #include <map> #include <vector> #include <set> #include <deque> #include <tuple> #include "utils.cpp" using namespace std; map<string, set<string>> adjacencyList(vector<string> lines) { map<string, set<string>> connections; for (string l : lines) { ...
ALGO
0.998349
5.674386
883f9d05-cc37-4562-ba4a-615b7595376c
rishabhrkr/geeksforgeeks_POTD
Queue Operations.cpp
class Solution{ public: // Function to insert element into the queue void insert(queue<int> &q, int k){ q.push(k); } // Function to find frequency of an element // return the frequency of k int findFrequency(queue<int> &q, int k){ // Your code here queue<int...
ALGO
0.999719
5.124023
ff7b3dc8-f911-470c-89d5-aa01fd1b2d51
CodeTrans-Research/RefuTra
result/translate/starchat/java2cpp/c++_eval/FIND_N_TH_ELEMENT_FROM_STERNS_DIATOMIC_SERIES.cpp
#include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include <bits/stdc++.h> using namespace std; int f_gold ( int n ) { int DP [ n + 1 ]; DP [ 0 ] = 0; DP [ 1 ] = 1; for ( int i = 2; i <= n; i ++ ) { if ( i % 2 == 0 ) DP [ i ] = DP [ i / 2 ];...
ALGO
0.999879
5.729283
e7037708-e785-4f07-ae25-521f7f461574
bahailu-abera/Competitive-programming
stack/132pattern.cpp
class Solution { public: bool find132pattern(vector<int>& nums) { int n = (int)nums.size(); stack<int> S; vector<int> left_min(n); left_min[0] = nums[0]; for (int i = 1; i < n; i++) left_min[i] = min(nums[i], left_min[i - 1]); for (int i = n - 1; i >= ...
ALGO
0.999966
6.393887
448f7138-7fac-4984-b4a8-1368a789b5df
mhl-popoff/algoritm_task
ะ—ะฐะดะฐั‡ะฐ_D/ะ—ะฐะดะฐั‡ะฐ_D/Source.cpp
#include <iostream> #include <math.h> using namespace std; int main() { int l, r, temp = 0; float a, b, hold; cin >> l >> r; for (a = l; a <= r; a++) { for (b = a + 1; b <= r; b++) { if (a != 1) hold = sqrt(a) - int(sqrt(a)); else hold = 1; if (hold != 0) { hold = sqrt(b) - int(sqrt(b)); ...
ALGO
0.999556
3.629463
c615a728-b00b-4bff-8b17-fd91b48ac8c9
Max850709/Leetcode_C
myAtoi/myAtoi/main.cpp
/* Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function). */ #include <iostream> using namespace std; class solution { public: int myAtoi(string s) { if(s[0]=='+' || s[0]=='-' || s[0]>47 && s[0]<58 || s[0]==' '){ ...
ALGO
0.996865
5.672596
b3bb0ce0-917f-4763-87f4-08de77b8f313
CS1342-F22/lecture-materials
Chapter11/memory_diagram_2.cpp
#include <iostream> using namespace std; int main() { int *ptrA; int *ptrB; int data[6] = {12, 10, 8, 6, 4, 2}; ptrA = (data + 1); // int * ptrB = &data[3]; (*ptrA)++; *ptrB = *ptrA + 2; ptrB++; // ptrB = ptrB + 1 *(data + 4) = *ptrA; *ptrA = data[0]; return 0; }
ALGO
0.997493
3.011424
66608cd7-488e-496c-beb9-b99e65fcc7f4
tin10401/CodeForces
CodeForces/F_x-prime_Substrings.cpp
//โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ•—โ–‘โ–‘โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— //โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• //โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–‘โ–‘ //โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•”โ•โ•โ•โ–‘โ–‘ //โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–‘โ•šโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— //โ–‘โ–‘โ–‘โ•šโ•โ•โ–‘โ–‘โ–‘โ•šโ•โ•โ•šโ•โ•โ–‘โ–‘โ•šโ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• // __________________ // | ________________ | // || ____ || // ||...
ALGO
0.999856
4.649039
9a5b0b52-d315-4f33-9a26-398fc733eb43
QianQNanami/JSOI-WC25
TG/judger/source/WC25-482/matrix.cpp
#include<bits/stdc++.h> using namespace std; #define int long long int n; int a[405][405]; int x[405][405],y[405][405],ans=-INT_MAX; signed main() { freopen("matrix.in","r",stdin); freopen("matrix.out","w",stdout); cin>>n; for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) cin>>a[i][j]; for(int i=1;i<=n;i++) { fo...
ALGO
0.999993
3.03528
f1f16693-d4ad-4aba-9501-3f87611267c7
Abhijeet-Bhushari/Leetcode-Daily
Valid Anagram/solution.cpp
class Solution { public: bool isAnagram(string s, string t) { map<char, int> mp1; for(int i=0; i<s.size(); i++){ mp1[s[i]]++; } for(int i=0; i<t.size(); i++){ mp1[t[i]]--; } for(auto i: mp1){ if(i.second != 0) return false; ...
ALGO
0.999989
6.298612
75a84cd0-d888-40d0-b27b-f40daa1aa264
AlaminPu1007/leet-code
Leet-Code/125. Uncrossed Lines/Uncrossed_Lines.cpp
#include <bits/stdc++.h> using namespace std; const int ARRAY_SIZE = 1001; class Solution { public: int maxUncrossedLines(vector<int>& text1, vector<int>& text2) { int m = text1.size(), n = text2.size(); int MEMO[2][ARRAY_SIZE] = {}; for (int i = 0; i < m; ++i) { ...
ALGO
0.999988
5.947725
5ee8d84f-932f-4d29-afb2-86f8e39a7c85
ShreyKhanduja/DSA-Sheet
reverse_groups_k.cpp
class Solution { // temp head and tail ListNode *th = NULL, *tt = NULL; public: // helper function to calculate the size of the linked list int length(ListNode *head) { int size = 0; while(head) { size++; head = head->next; } return size; } ...
ALGO
0.999992
6.06532
b69258b0-e1c0-4ca3-8fe2-3980617e6ba4
amytrkpatel/Code
GfG/rotation-k-array.cpp
// https://practice.geeksforgeeks.org/problems/rotate-array-by-n-elements-1587115621/1/ #include <bits/stdc++.h> using namespace std; main() { int t; cin >> t; while (t--) { int n, min_index = 0; cin >> n; int A[n]; for (int i = 0; i < n; i++) { cin ...
ALGO
0.999699
5.424994
10cb380b-4cf3-4515-951d-e9daf0e46f74
raincross7/code-similarity
codes/train_code/problem376/problem376_35.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, s, e) for (int i = (int)(s); i <= (int)(e); i++) #define printYesNo(is_ok) puts(is_ok ? "Yes" : "No"); #define SORT(v) sort(v.begin(), v.end()); #define RSORT(v) sort(v.rbegin(), v.rend()); #define REVERSE(...
ALGO
0.999561
3.797241
7d3c4ae5-bbcb-41a1-93ce-e2743621a2bd
Eason0729/NCKU-DS2024-HW2-template
tests/sort.cpp
#define BOOST_UT_DISABLE_MODULE 1 #include <boost/ut.hpp> #include <random> extern "C" { #include "../fheap.h" } using namespace boost::ut; using namespace std; void RandomSort(size_t test_size) { long int value[test_size]; for (long int i = 0; i < test_size; i++) value[i] = i; for (const long &i: value)...
TEST
0.992227
6.622181
16ba11e5-187f-42a6-9dfd-4df0ddb7a7a9
hjlee6824/Problem-Solving
Baekjoon/5000~5999/5086/5086.cpp
#include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int a, b; while (true) { cin >> a >> b; if (a == 0 && b == 0) break; if (b % a == 0) cout << "factor"; else if (a % b == 0) cout...
ALGO
0.999777
4.658494
08b25e0e-ad5d-4b8e-a1ed-c703713d9096
shoaibrayeen/Programmers-Community
Basic/Check if A String is Palindrome or Not/solutionbygargprince1702.cpp
#include <iostream> using namespace std; int main() { int i, j, len, flag = 1; char a[20]; cout << "Enter a string:"; cin >> a; for (len = 0; a[len] != '\0'; ++len) ; for (i = 0, j = len - 1; i < len / 2; ++i, --j) { if (a[j] != a[i]) flag = 0; } if (flag ...
ALGO
0.991733
4.160168
645f02f2-af7a-4cd3-a4a8-dcd2d7a2700b
muhammadhasan01/cp
Online Judge/Codeforces/Gym/ACM-ICPC_Latin_American_2019/M.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e3 + 5; int n, x; int a[N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> x; for (int i = 1; i <= n; i++) { cin >> a[i]; } int ans = 1; for (int i = 1; i <= n; i++) { int cu...
ALGO
0.99996
4.23112
86a81bed-f7b9-44c4-9e98-d792e3b85015
kmjp/procon
atcoder/past001-040/past003/g.cpp
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZER...
ALGO
0.999544
3.929249
52bd1b82-05ba-449d-94ce-09e4b5feb85b
anandhu720/Leetcode-Solutions
130-surrounded-regions/130-surrounded-regions.cpp
class Solution { public: void solve(vector<vector<char>>& board) { int m = board.size(),n = board[0].size(); int grad[] = {0,1,0,-1,0}; for(int i=0;i<m;i++) { for(int j=0;j<n;j++) { if(i == 0 or i == m-1 or j == 0 or j == n-1) { ...
ALGO
0.99991
6.220193
d2fd11af-f2a1-4481-8712-2e133708fd25
khanhtran219/DSA
cautrucphansoplus.cpp
#include <bits/stdc++.h> using namespace std; struct PhanSo { long long tu,mau; }; void nhap(struct PhanSo &p){ cin >> p.tu>>p.mau; } long long gcd(long long a, long long b){ if(b==0) return a; return gcd(b,a%b); } void rutgon(struct PhanSo &p){ long long a = gcd(p.tu,p.mau); p.tu = p.tu/a; p.mau = p.mau/a...
ALGO
0.995781
5.282242
3c63a318-5b42-444b-b659-4bbfa23a493c
ishandutta2007/codeforces
dlalswp25/normal/1469/C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int N; ll K; int A[202020]; int main() { int tc; scanf("%d", &tc); while(tc--) { scanf("%d%lld", &N, &K); for(int i = 1; i <= N; i++) scanf("%d", &A[i]); ll L = A[1], R = A[1]; bool ok = true; for(int i = 2; i <= N; i++) { ll l = A[i]...
ALGO
0.999923
4.3246
df2c4630-3ec2-4134-873a-0b1c58597aea
Yashrajdps13/cp_dsa
Recursion_striver/lecture10.cpp
#include <iostream> #include <vector> using namespace std; void subs(int a[],vector<int> &b, int i){ if(i==2){ int s=0; for(auto k:b){ s+=k; } cout<<s<<" "; return; } b.push_back(a[i]); subs(a,b,i+1); b.pop_back(); subs(a,b,i+1); } int main(){ ...
ALGO
0.999679
3.277143