uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
80b4c4b9-58f4-4e14-b9ed-101b424d8e0c
HyeonJuSon/Choppa_Dont_Bite_Me
BaekJoon/Bronze/Bronze_1/bj_9946_B1.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(void){ string before, after; int idx = 1; while(true){ cin >> before >> after; if(before=="END" && after =="END")break; sort(before.begin(), before.end()); sort(after.begin(),after.end()); cout << "Case " << idx++ <<...
ALGO
0.999903
3.489977
0265baee-3498-47e2-9b6e-4844cd71dc96
27Divashree/Leetcode
0140-word-break-ii/0140-word-break-ii.cpp
class Solution { public: void solve(string s,vector<string> &res,unordered_set<string> &st,vector<string> &temp) { if(s.length()==0) { string str = ""; for(auto it:temp) str += it + " "; str.pop_back(); res.push_back(str); ...
ALGO
0.999929
5.982308
2a03a353-6826-40ab-bf00-b7ae81da7526
Dzhevizov/CplusplusAdvanced
MapsAndSetsEx/Ex5/Ex5.cpp
#include <iostream> #include <string> #include <sstream> #include <set> using namespace std; int main() { string strInput; getline(cin, strInput); istringstream iStr(strInput); int nNum = 0; set<int> oNumbers; while (iStr >> nNum) { oNumbers.insert(nNum); } for (auto i ...
ALGO
0.999268
3.995022
be747120-569a-41d7-820b-1967cf635995
Yaro2709/AlgoProblems
7/747A.cpp
#include<iostream> #include<math.h> using namespace std; int main() { int n; cin >> n; for (int i = sqrt(n); i > 0; i--) { if (n % i == 0) { cout << i << " " << n / i << endl; return 0; } } return 0; }
ALGO
0.999937
4.017231
cbda032c-8467-417d-8b68-6c8719aa0f88
MOHDDANISH007/Question1
Implemention_of_Queue_by_using_stack.cpp
#include <stack> class MyQueue { public: std::stack<int> input, output; MyQueue() { } void push(int x) { input.push(x); } int pop() { if(output.empty() == true){ while(!input.empty()){ output.push(input.top()); inpu...
ALGO
0.999649
5.843464
97f719c9-4e2c-490d-b167-63847ec3d5f2
uxth/leetcode
cpp/67.add-binary.cpp
/* * @lc app=leetcode id=67 lang=cpp * * [67] Add Binary * * https://leetcode.com/problems/add-binary/description/ * * algorithms * Easy (46.47%) * Likes: 2522 * Dislikes: 328 * Total Accepted: 566.6K * Total Submissions: 1.2M * Testcase Example: '"11"\n"1"' * * Given two binary strings a and b, r...
ALGO
0.999965
6.769212
4788bb43-6754-4e9e-a5ea-d9403ec79de8
patpro28/maketest
custom/trie4/gen/random.cpp
#include <iostream> #include <vector> #include "random.h" #include "../params.h" using namespace std; const long long MAX = 1e18; int main(int, char* argv[]) { long long seed = atoll(argv[1]); auto gen = Random(seed); int n = 100000; cout << n << '\n'; for (int i = 0; i < n - 1; ++i) cou...
ALGO
0.99839
3.37665
f5ece30f-2ea6-4b19-99f5-8320eeced040
sarthakpy7/Leetcode
2479-meeting-rooms-iii/2479-meeting-rooms-iii.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int mostBooked(int n, vector<vector<int>>& meetings) { sort(meetings.begin(), meetings.end()); priority_queue<int, vector<int>, greater<int>> free; for (int i = 0; i < n; ++i) free.push(i); using T = pair<long ...
ALGO
0.99999
6.063389
69ccd3d3-8f91-4c90-8f3c-45b1cff12d0a
skyteredev/skytere
src/llmq/quorums_commitment.cpp
#include <llmq/quorums_commitment.h> #include <chainparams.h> #include <spork.h> #include <validation.h> #include <evo/specialtx.h> bool IsBlsSigCheckEnabled(int64_t blockTime) { int64_t activeTime = sporkManager.GetSporkValue(SPORK_17_QUORUM_DKG_ENABLED); return blockTime >= activeTime; } namespace llmq { ...
ALGO
0.961656
6.866133
83eb0891-80b7-4a1c-958a-abfc759efa80
ishandutta2007/codeforces
kczno1/normal/1081/C.cpp
#include<bits/stdc++.h> using namespace std; template <typename T> void chmin(T&x,const T &y) { if(x>y)x=y; } template <typename T> void chmax(T &x,const T &y) { if(x<y)x=y; } typedef long long s64; typedef unsigned long long u64; typedef unsigned int u32; typedef pair<int,int> pii; #define rep(i,l,r) for(int i=l;i<...
ALGO
0.999988
4.130065
1ce619ad-0b74-4689-aeb3-4d1a1bf3434d
yms020615/Algospot
BOARDCOVER.cpp
#include <bits/stdc++.h> using namespace std; const int coverType[4][3][2] = { { {0, 0}, {1, 0}, {0, 1} }, { {0, 0}, {0, 1}, {1, 1} }, { {0, 0}, {1, 0}, {1, 1} }, { {0, 0}, {1, 0}, {1, -1} } }; bool setting(vector<vector<int>>& board, int y, int x, int type, int delta) { bool ok = true; for (int i = 0; i < 3; i...
ALGO
0.999712
5.230653
69a806ca-63d8-495b-970a-b809003d0936
VisualGMQ/NickelEngine-backup
nickel/src/physics/manifold_solver.cpp
#include "physics/manifold_solver.hpp" #include "physics/manifold.hpp" #include "physics/shape.hpp" namespace nickel { namespace physics { std::unique_ptr<Contact> ManifoldSolver::GetContact(const CollideShape& shape1, const CollideShape& shape2, bool shouldRecurse) { auto& s1 = *shape1.shape; auto& s2 = *sh...
ALGO
0.987214
6.253961
3d247164-7361-4ee9-8b2e-49040dda079f
Devanshh07/Two-Pointer-Sliding-Window
3SumClosest.cpp
#include<bits/stdc++.h> using namespace std; int closestSum(vector<int> nums,int target){ int n=nums.size(); int close = 10000; sort(begin(nums),end(nums)); for(int i=0;i<=3;i++){ int j=i+1; int k=n-1; while(j<k){ int sum = nums[i]+nums[j]+nums[k]; if(abs...
ALGO
0.999923
5.154374
b2e4051b-e29f-4b75-9432-386493926ebb
enzogl25/Competitive-Programing
Codeforces/A. Restoring Three Numbers.cpp
#include <bits/stdc++.h> using namespace std; #define _ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define f first #define s second #define pb push_back #define ppb pop_back using ll = long long; int main() { _ vector<int> nums(4); for(int i = 0; i < 4; i++){ cin >> nums[i]; ...
ALGO
0.99966
3.501529
d14e3a6d-fb67-42e2-9792-2941c5aab0fa
JoeyYilinWang/shuati
链表/reverseList.cpp
#include "ListNode.hpp" #include <stack> class reverseList { public: // 双指针法 ListNode* Solution1(ListNode* Head) { ListNode* pre = NULL; ListNode* cur = Head; ListNode* temp; while (temp != NULL) { temp = cur->next; cur->next = pre; ...
ALGO
0.999957
5.463267
95932674-7e49-4d06-b1af-b155719d538d
AMReX-Astro/MAESTROeX
Exec/test_problems/reacting_bubble/MaestroInitData.cpp
#include <Maestro.H> #include <actual_network.H> #include <network_properties.H> using namespace amrex; using namespace problem_rp; // prototype for perturbation function to be called on the // device (if USE_CUDA=TRUE) AMREX_GPU_DEVICE void Perturb(const Real p0_init, const Real* s0, Real* perturbations, ...
ALGO
0.957738
5.20451
e1daf47e-8d50-4619-8703-bfd9dc83eaa8
ThierrySHYAKA/notes_app
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
5b83bab3-f455-4229-8e31-9112d4779891
2236803HarshPahwaCECCSEC/rev-sheet
450-delete-node-in-a-bst/delete-node-in-a-bst.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999981
6.041996
906d5716-42fb-4f53-8944-da796c980210
BartoszewskiA/2022-23-Podstawy-programowania-NST-L3
lab03p05.cpp
#include <iostream> using namespace std; int main() { int tab[100]; int n; cout << "n="; cin >> n; for (int i = 0; i < n; i++) { cout << "x="; cin >> tab[i]; } for (int i = n - 1; i >= 0; i--) { cout << "tab[" << i << "]=" << tab[i]<<" "; } return 0...
ALGO
0.979142
3.199393
8d6b250e-0164-4915-819f-0a51bb593bfa
swarna-M08/LeetCode
0231-power-of-two/0231-power-of-two.cpp
class Solution { public: bool isPowerOfTwo(int n) { int result=1; for(int i=0;i<=30;i++){ if(result==n){ return true; } if(result < INT_MAX/2) result = result*2; } return false; } };
ALGO
0.996448
6.030685
05dbdcc6-4f43-4ce9-af20-d72417f3a7d4
abhinavprkash/geeksforgeeks
codechef contest/July Long2020/chfnswps.cpp
/*Chefina and Swaps Problem Code: CHFNSWPS submitted by Abhinav Prakash username abhinav_526 */ #include <bits/stdc++.h> #include <cstdio> #include <cstring> #include <cmath> #include <cstring> #include <chrono> #include <complex> #define endl "\n" #define ll long long int #define um unordered_map<ll, ll> #define vi v...
ALGO
0.999979
3.797098
34fd1cb7-0ac6-4f3b-8e50-9d37a4223aef
ashish2125it/Coding_Blocks_Launchpad
Coding-Blocks-Launchpad-main/Lecture 03/Program4.cpp
#include <iostream> using namespace std; int main() { int number1, number2, number3; cout << "Enter three numbers: "; // Read the three numbers from standard input cin >> number1 >> number2 >> number3; // Compare the three numbers to find the largest if (number1 >= number2 && number1 >= ...
ALGO
0.999738
4.594557
84e3c24a-596c-4f98-baa7-a1a0d496fe1a
Akitsuyoshi/CarND-Path-Planning-Project
src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; int main() { Eigen::MatrixXf mat(2,4); Eigen::VectorXf v(4); mat << 1, 2, 6, 9, 3, 1, 7, 2; v << 0,1,2,3; //add v to each row of m mat.rowwise() += v.transpose(); std::cout << "Broadcasting result: " << std::...
ALGO
0.993095
4.296038
67f7d389-ec04-4a04-830d-50eb63dafee7
kinghuangdd/dataStructure
ch2/2_13.cpp
#include "../Repository/LinkList.hpp" int main() { LinkList L; int n; ElemType x; cout << "input n value:" << endl; cin >> n; cout << "input x value:" << endl; cin >> x; CreateList_L(L,n); Print_L(L); int l = Locate_L(L,x); l?(cout << "the location is " << l << endl):(cout <...
ALGO
0.999875
3.918612
2444e978-e11c-4393-986d-eccfa113b1b2
dingyaguang117/POJ
1004/1004.cpp
#include <stdio.h> int main() { freopen("1.txt","r+",stdin); freopen("2.txt","w+",stdout); float a=0,b; int i; for(i=0;i<12;i++) { scanf("%f",&b); a+=b; } a/=12; a+=0.005; printf("$%.2f",a); }
ALGO
0.99576
3.150375
2dc678f4-71b4-4b52-90fb-5538a9276542
youtube/cobalt_sandbox
third_party/icu/source/common/propsvec.cpp
#include <stdlib.h> #include "unicode/utypes.h" #include "cmemory.h" #include "utrie.h" #include "utrie2.h" #include "uarrsort.h" #include "propsvec.h" #include "uassert.h" struct UPropsVectors { uint32_t *v; int32_t columns; /* number of columns, plus two for start & limit values */ int32_t maxRows; ...
TOOL
0.995497
6.293249
7694b141-49f0-4b21-9050-1c9cf4eb5d31
alexandraback/datacollection
solutions_5756407898963968_0/C++/benson2b/A_Magic_Trick.cpp
#include <iostream> #include <cstring> #include <fstream> #include <sstream> using namespace std; int main(void){ ifstream fin("A-small-attempt1.in"); //ifstream fin("aex.in"); ofstream fout("As.txt"); int T; cin >> T; /* string st; getline(fin,st); stringstream ss(st); ss >> T; */ ...
ALGO
0.991854
3.865835
309e4005-59a1-4c99-8fd8-67fe87eaf12d
ravep/tdkp
tdkp/utilities/SchroedingerPoisson.cpp
#include "tdkp/utilities/SchroedingerPoisson.h" namespace tdkp { template<> void SchroedingerPoisson<KP8x81D2D,KP8x81D2D>::calculate_cb_bandstructure() { // -------------------------------------- // delete old data // -------------------------------------- cb_bands = 0; cb_problem.delete_solutions(); // -----...
ALGO
0.998251
4.372318
4ccab2e3-5e6e-48a6-8636-cb39f5a77580
priyanshu-21singh/competitive-programming
codeforce contest/11 feb/Kar-Salesman.cpp
#include<bits/stdc++.h> using namespace std; void solve(){ int n,x; cin>>n>>x; long long a,ma=0,sum = 0; for(int i=0;i<n;i++){ cin>>a; ma = max(ma,a); sum+=a; } cout<<max(ma,(sum+x-1)/x)<<endl; } int main(){ int t; cin>>t; while(t--){ solve(); } ...
ALGO
0.999829
3.742846
29a572c0-9313-4e16-97f7-567098975349
roshan194/DSA
DSA_babbar/Recursion/Day9/Permutations.cpp
class Solution { private: void solve(vector<int> nums, int index, vector<vector<int>>& ans){ //base case if(index>=nums.size()){ ans.push_back(nums); return ; } for(int j=index;j<nums.size();j++){ swap(nums[index], nums[j]); so...
ALGO
0.999997
6.473232
dcb68756-4478-4bc4-95f8-203ba48162b6
zorrobyte/Taz-6-E3D-Lighthead-Firmware
Marlin/qr_solve.cpp
#include "qr_solve.h" #ifdef AUTO_BED_LEVELING_GRID #include <stdlib.h> #include <math.h> //# include "r8lib.h" int i4_min ( int i1, int i2 ) /******************************************************************************/ { int value; if ( i1 < i2 ) { value = i1; } else { value = i2; } r...
ALGO
0.999926
4.77243
1b8ea619-ce0c-4c92-bf05-da1b4c92288c
Harshu05x/Recursion
quick_sort.cpp
#include <iostream> using namespace std; // Quick Sort = partitioning logic + Recursion logic // T.C. = O(nlogn) for best and avg cases & O(n^2) for worst case // partitioning logic int partition(int arr[], int s, int e){ // 1] Choose pivot ele int pivot = s; int i = s+1; int j = e; // 2] Find a ...
ALGO
0.99997
5.66431
82031f2b-bb2e-4677-be69-51cc0172eacb
forked-llvm/Polaris-Obfuscator
llvm/tools/llvm-mt/llvm-mt.cpp
#include "llvm/Option/Arg.h" #include "llvm/Option/ArgList.h" #include "llvm/Option/Option.h" #include "llvm/Support/Error.h" #include "llvm/Support/FileOutputBuffer.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" #include "llvm/Support/PrettyStackTrace.h" #in...
TOOL
0.919641
7.676764
48d68040-0ea8-4c89-a616-96a13b2e1786
musharafaahel/Data-Structures-And-Algorithms
Pattern Questions/pattern10.cpp
#include<iostream> using namespace std; int main(){ int n; cin>>n; for(int i =1; i<=n;i++){ for(int j = 1; j <= n-i; j++){ cout<<" "; } for(int j = 1; j <= n; j++){ cout<<"* "; } cout<<endl; } return 0; }
ALGO
0.999651
3.662733
7d239a29-163b-4928-bc0a-cc3b8d0018e1
Rayhan-Ahmed108/Dynamic_Programming
C_Sweets_Eating.cpp
// ALLAH IS ALMIGHTY // NEVER GIVE UP JEYAM // TRY TRY & TRY #include <bits/stdc++.h> #include <map> #include <set> using namespace std; #define ll long long int #define yes cout << "Yes\n"; #define no cout << "No\n"; #define pb push_back; #define FAST_IO \ { ...
ALGO
0.999986
3.199779
5add25af-9e19-42a5-8550-9e42aaddba64
Saber7X/DaiMaDaQuan
CF1560A Dislike of Threes.cpp
#include<bits/stdc++.h> using namespace std; int main() { int cnt = 1; int num[20050]={0}; for (int i = 1; i <= 2000; i ++ ) { if (i % 3 == 0 || i % 10 == 3) continue; num[cnt ++ ] = i; } int t; cin >> t; while (t -- ) { int k; cin >> k; cout << num[k] << endl << endl; } return 0; }
ALGO
0.998712
3.452246
aee5a3c3-05f9-4f32-af83-7c60527f2b1b
Seungchan0325/baekjoon
solutions/1032_0.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 55; int n; vector<string> v; int main() { cin >> n; v.resize(n); for(auto& s : v) cin >> s; for(int i = 0; i < v[0].size(); i++) { bool flag = false; for(auto& s : v) if(s[i] != v[0][i]) flag = true; if(flag) cou...
ALGO
0.999934
3.525186
dbe0419b-7c31-46db-b546-5100b57aa23a
mianTanKnight/open_jdk1.8SourceNote
share/native/com/sun/java/util/jar/pack/coding.cpp
// -*- C++ -*- // Small program for unpacking specially compressed Java packages. // John R. Rose #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> #include "jni_util.h" #include "defines.h" #include "bytes.h" #include "utils.h" #include "coding.h" #include "constants.h" #include "unpac...
ALGO
0.99723
5.873769
89180023-e022-4077-b711-16f004640537
partho-majumdar/Striver_DSA_Sheet
Linear_Search/q1.cpp
#include <bits/stdc++.h> using namespace std; int linear_search(int arr[], int n, int value) { for (int i = 0; i < n; i++) { if (arr[i] == value) { return i; } } return 0; } int main() { int n; cout << "Enter number of element: "; cin >> n; int arr[n...
ALGO
0.999445
5.382339
1d3497c8-6feb-4625-afbe-28d9333fcbe2
RonielNunes/SolutionsUriJungle
SolutionsInC++/1047-TempodeJogocomMinutos.cpp
#include <iostream> #include <vector> #include <algorithm> #include <math.h> #include <list> //g++ 1047-TempodeJogocomMinutos.cpp -o exec using namespace std; //hora inicial, minuto inicial, hora final e minuto final void solver(){ int hi, mi, hf, mf; cin >> hi >> mi >> hf >> mf; int hora = hf - hi; ...
ALGO
0.998977
4.202749
04b59dc7-3ad0-4d4b-b27e-59db59188879
krishnateja-nanduri/MyCodePractice
InterviewBit/Arrays/Add One Number to Another.cpp
//https://www.interviewbit.com/problems/add-one-to-number/ void swap(int& a,int &b) { int c=a; a=b; b=c; } vector<int> Solution::plusOne(vector<int> &A) { // Do not write main() function. // Do not read input, instead use the arguments to the function. // Do not print the output, inst...
ALGO
0.999912
5.606024
72b6dc9c-1b28-46cc-8ada-ea4da295d4bf
WAVM/Wavix
llvm/lib/Transforms/Utils/SymbolRewriter.cpp
#include "llvm/Transforms/Utils/SymbolRewriter.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/ilist.h" #include "llvm/ADT/iterator_range.h" #include "llvm/IR/Comdat.h" #include "llvm/IR/Function.h" #include "llvm/IR/GlobalAlias.h" #include "llvm/I...
TOOL
0.92126
7.542576
7420306d-7f69-458c-9da4-c17c6b852823
reiyo/EDA
STA/runSTA.cpp
/************************************************************************ * Console of combinational or sequential STA. * * Author : Kuan-Hsien Ho ************************************************************************/ #include <cassert> #include <vector> #include "Circuit.h" #include "Gate.h" #include ...
ALGO
0.99611
3.329737
23cdb4ba-2e44-44af-891e-f45d89411e29
varshakriplani0210/CPP_Array_Questions
Basic_ArraySort.cpp
//WITHOUT TEMP VARIABLE #include <iostream> #include <climits> using namespace std; #define MAX 100 int main() { int arr[MAX]; int n; int secondEle,firstEle; cout<<"enter the number of elements of an array"; cin>>n; //to accept array elements for(int i=0;i<n;++i){ cin>>arr[i]; }...
ALGO
0.999861
4.406707
c9584a0a-beff-4b31-887c-3473a0612d17
Tiphereth-A/CP-lib
usage/math/exeuclid.cpp
#define PROBLEM "https://www.luogu.com.cn/problem/P5170" #include "../../include/math/exeuclid.hpp" #include "../../include/math/mint.hpp" #include "../../include/math/mint_s30.hpp" using namespace tifa_libs; template <class T> struct exeuclid_node { T u, r; T i, f, sqr_f, i_f; exeuclid_node(T u = 0, T r = 0, ...
ALGO
0.999696
4.80723
306c51fc-130e-4ced-a230-43ea9f983dc2
Decmofofs/GoMonte
src/board/GomokuBoard.cpp
// // Created by Decmo on 25-1-8. // #include <GomokuBoard.h> #include <HelperFunctions.h> #include <QDebug> #include <unordered_set> PlayerOccupy GomokuBoard::at(const int x, const int y) const { return board[x][y]; } int GomokuBoard::set(const int x, const int y, const PlayerOccupy state) { if (board[x][y] ...
ALGO
0.985894
4.982463
2e649e46-b8be-4193-8d9c-fabd3f2ad256
exajobs/coding-interview-collection
leetcode/algorithms/cpp/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.II.cpp
// Source : https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/ // Author : Hao Chen // Date : 2014-10-21 /********************************************************************************** * * Follow up for "Find Minimum in Rotated Sorted Array": * What if duplicates are allowed? * * Would ...
ALGO
0.999951
5.431493
d8765297-1b6d-40e4-a66d-76fe023591e7
SamXop123/CPP-codes
Experiments/Experiment-30.cpp
/* Develop a program to sort a file consisting of books‟ details in the alphabetical order of author names. The details of books include a. book_id, b. author_name, c. price, no_of_pages, d. publisher, e. year_of_publishing. */ #include <iostream> #include <fstream> #include <vector> #include <algorithm> #include <st...
ALGO
0.996926
6.035592
45b0abef-52b6-47c5-8888-d782c59d298d
karslioguzhan/Programming-Principles-and-Practice-Using-Cpp
04_Chapter/14_Exercise/14_Exercise.cpp
// 14_Exercise.cpp : Modify the program described in the previous exercise to take an input value max and then find all prime numbers from 1 to max. #include <iostream> #include <vector> #include <algorithm> int main() { std::cout << "Please enter a maximum number to search for prime numbers: "; int maxNum{};...
ALGO
0.999768
5.624938
191ad76e-c1b1-4d98-8b36-124f00b622ee
danielkrupinski/Osiris
Source/Platform/Windows/CRTWindows.cpp
#include <cstddef> #include <cstring> #include <intrin.h> extern "C" int _fltused{ 0x9875 }; namespace crt { [[nodiscard]] inline int memcmp(const unsigned char* lhs, const unsigned char* rhs, std::size_t count) noexcept { for (std::size_t i = 0; i < count; ++i) { if (lhs[i] != rhs[i]) return...
TOOL
0.982498
6.199914
bc138cb5-d34d-432c-8a2b-89592d34b165
raincross7/code-similarity
codes/train_code/problem479/problem479_146.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int m, n; char tem; cin >> m >> n; ll dp[m][n]; memset(dp, 0, sizeof(dp)); for (int i = 0; i < m; i++) for (int j = 0; j < n; j++) { cin >> tem; if ...
ALGO
0.999986
4.471622
2f10b910-15b8-41e0-b729-0b8fde8c9021
manuelTorrealba/tofu
src/core/parallel/decompose/decompositionMethods/manualDecomp/manualDecomp.cpp
#include "parallel/decompose/decompositionMethods/manualDecomp/manualDecomp.hpp" #include "OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.hpp" #include "OpenFOAM/db/IOstreams/Fstreams/IFstream.hpp" #include "OpenFOAM/primitives/ints/lists/labelIOList.hpp" // * * * * * * * * * * * * * * * * * * * ...
DATA
0.935881
4.523287
64ffada4-ef6f-4d68-8525-291f4454cbc8
manikanta2901/ubuntu
.history/SRM/placementPractice/HackerRank/DataStructure/SparseArray_20210320112558.cpp
#include<bits/stdc++.h> #include<iostream> using namespace std; vector<int> matchingStrings(vector<string> strings, vector<string> queries){ vector<int> results; map<string,int> freq; for(auto i : strings){ freq[i]++; } for(i) } int main(){ return 0; }
ALGO
0.994528
4.870815
f3f52247-02a1-4d90-92a3-32eb6228d0ab
ishandutta2007/codeforces
maximumshot/normal/814/C.cpp
#include <bits/stdc++.h> using namespace std; #define vec vector #define ALL(x) (x).begin(), (x).end() typedef long long ll; typedef long double ld; typedef pair< int, int > pii; typedef pair< ll, ll > pll; int const inf = 1000 * 1000 * 1000; ll const inf64 = 1ll * inf * inf; int const N = 1505; int n; char s[N];...
ALGO
0.999889
4.445894
f0d13247-34eb-45e7-b4c7-3afb877dea50
kamol7/Online-Judge-Problems-solved
A. Optimal Currency Exchange/main.cpp
#include <iostream> #include <algorithm> using namespace std; int main() { int money,dollar,euro; int ans=money; cin>>money>>dollar>>euro; for(int i=0; i*euro <= money;i+=5 ){ int a= (money- (i*euro))%dollar; if(a<ans) ans = a; } cout<<ans<<endl; return 0; }
ALGO
0.998722
3.583969
eff906d6-0c36-41c2-be67-d8b3f1639086
Lujie1996/Leetcode
245. Shortest Word Distance III/245. Shortest Word Distance III/main.cpp
#include <iostream> #include <vector> using namespace std; int shortestWordDistance(vector<string>& words, string word1, string word2) { vector<int> index1, index2; for (int i = 0; i < words.size(); i++) { if (words[i] == word1) { index1.push_back(i); } else if (words[i] == ...
ALGO
0.999905
5.63807
a1da3f89-644f-4a61-9c3f-fe9b1d740620
milorb/EclipseEngine
game_engine/third_party/box2d/b2_edge_polygon_contact.cpp
#include "b2_edge_polygon_contact.h" #include "box2d/b2_block_allocator.h" #include "box2d/b2_fixture.h" #include <new> b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) { void* mem = allocator->Allocate(sizeof(b2EdgeAndPolygonContact)); ...
ALGO
0.982232
6.890633
2f145083-f302-4c39-8de5-6b668c772c7e
ishandutta2007/codeforces
potassium/normal/1471/A.cpp
#pragma GCC optimize ("O3", "unroll-loops") // #pragma GCC target ("avx2") // #pragma comment(linker, "/stack:200000000") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include "bits/stdc++.h" #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define disti...
ALGO
0.999733
3.709764
92493b5d-cf52-4bb2-94ae-0d0b040cd9f6
ScottFitzgerald83/cosc_1337
week_7/program_10_6.cpp
// This program processes an array using pointer notation // Created by Scott Fitzgerald on 7/17/20. // #include <iostream> using namespace std; int main() { const int SIZE = 5; // Size of the array int numbers[SIZE]; // Array of the integers // Get values to store in the array // Use pointer...
TOOL
0.982266
5.137657
af692b27-d95a-4907-ad84-6ff1953c9692
Tusharinvincible/-6Companies30days
Microsoft/13.Given a Graph of V vertices and E edges and another edge(c - d), the task is to find if the given edge is a Bridge. i.e., removing the edge disconnects the graph..cpp
#include <bits/stdc++.h> using namespace std; class Node{ public: int data; Node* left; Node* right; //Node *nextRight; }; bool dfs(int src,vector <int> adj[],vector <bool> &vis,int d){ vis[src]=true; if(src==d){ return true; } for(int x: adj[src...
ALGO
0.999281
4.562404
57b52e72-4bfd-43f3-8259-d3e7862764f5
moves-rwth/dft-bdmp
2022-LambdaMu/StormFigaro/src/storm-dft/generator/DftNextStateGenerator.cpp
#include "DftNextStateGenerator.h" #include "storm/utility/constants.h" #include "storm/utility/macros.h" #include "storm/exceptions/NotImplementedException.h" #include "storm/settings/SettingsManager.h" #include "storm-dft/settings/modules/FaultTreeSettings.h" namespace storm { namespace generator { tem...
ALGO
0.935379
7.518456
07bdb79c-cc27-4289-9770-0b535ab45e4c
zhou-jk/code
Codeforces/CF1195 Codeforces Round #574 (Div. 2)/C/C.cpp
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int N=100005; int n; int a[3][N]; long long f[N][4]; int main() { scanf("%d",&n); for(int i=1;i<=2;i++) for(int j=1;j<=n;j++) scanf("%d",&a[i][j]); for(int i=1;i<=n;i++) { f[i][0]=max({f[i-1][0],f[i-1][1],f[i-1][2]}); f[i][1...
ALGO
0.999855
3.266717
83980305-d041-409d-af38-971433d2628c
alexandraback/datacollection
solutions_5756407898963968_0/C++/itzkow/A.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #...
ALGO
0.999524
3.147108
0b740f20-2a93-4314-aca8-ce2b2f1be011
Saketmishra14/DSA-Supreme-3.0
04 Arrays, Time complexity and Space complexity/Array class-2/All pairs/withdiagonal.cpp
#include<iostream> using namespace std; //print all pairs void printAllPairs(int arr[],int n){ for(int i=0; i<n;i++){ //for every i, we are running looping variable "j" from start to end for(int j=0;j<=i;j++){ cout<<arr[i]<<", "<<arr[j]<<endl; } } } int main(){ int arr[]=...
ALGO
0.977986
4.027323
45b9da96-47f6-4385-a828-e6aebf00b01c
marufremoncse/Dimik-OJ-
[৫২ সমস্যা বই] শব্দ গণনা - ২.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; cin.ignore(); for(int j=0;j<n;j++){ string input; getline(cin,input); string store = ""; int count=0; for(int i=0;i<input.length();i++){ if(input[i]!=' '){ st...
ALGO
0.996405
4.050393
ccb3cdda-66bd-4393-a942-026f5425e530
zhipeng-web/my_algorithm
二叉树/94.cpp
// // Created by china on 2024/4/3. // #include "iostream" #include "vector" #include "stack" using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} TreeNod...
ALGO
0.999966
6.68798
7da88d2f-d9ca-4767-8935-9078b9bab6ac
Muhammad-Yasir-Asad/PD
Lab-04/task-2.cpp
#include <iostream> using namespace std; void inchesToFeet(float inches); main() { float inches; cout << "Enter the value in inches : "; cin >> inches; inchesToFeet(inches); } void inchesToFeet(float inches) { float feet; feet = inches / 12; cout << "The value in feet is : " << feet; }
TOOL
0.908853
3.241299
dc58596d-65dc-4f3f-9ee3-1a683141819f
ImanRezaeipour/G-Collection
GP7/Classes/DAC.cpp
#include "MATH.H" #include "DAC.H" #include "HARDWARE.H" #include "RTOS.H" Shape DAC::wave_form; Direction DAC::wave_status; Answer DAC::wave_generate; WORD DAC::data; double DAC::vtl; double DAC::vth; double DAC::v_instant; unsigned int DAC::high_interval; unsigned int DAC::low_interval; double DAC::M...
TOOL
0.867749
5.99544
3e363977-f308-4afd-9b46-22f85e74e424
alifalhasan/CP-code-vault
CodeChef/Practice/IRSTXOR - Interesting XOR!/43858284.cpp
#include<bits/stdc++.h> using namespace std; const int N=5e6+5; const int mod=1e9+7; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int i,l,t; long long a,b,c; cin >> t; while(t--) { cin >> c; for(i=30;i>=0;i--) { if((c >> i) & 1) ...
ALGO
0.999958
4.056035
52dfa475-322e-4051-8fb1-069e7545255c
vivekgopalshetty/mycoding_profile
Dynamic programming/GeeksforGeeks/medium/dp_medium_geeksforgeeks_page3_recursion.cpp
//https://www.geeksforgeeks.org/medium/dynamic-programming/3/ //recursion #include <bits/stdc++.h> using namespace std; int min_cubes_req(int k) { if (k < 8) return k; int res = k; for (int i = 1; i <= k; i++) { if ((i * i * i) > k) return res; res = min(r...
ALGO
0.999854
3.913127
44105d9f-b990-44c4-8ead-a27bf8cb449e
raincross7/code-similarity
codes/train_code/problem188/problem188_341.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<b;i++) #define iter(it,a) for(auto it=a.begin();it!=a.end();it++) #define mp make_pair #define pb push_back #define F first #define S second #define preturn(X) cout<<X<<endl; return 0 typedef long long ll; typedef long double ld; const ll MO...
ALGO
0.999967
4.031035
62c6104a-9ec8-4ae0-af45-178d32c3785c
man0045/Data_Structure_with_Cpp
Linklist/lluserdefinrd.cpp
#include<iostream> using namespace std; class Node{ public: int val; Node* next; Node(int val){ this->val = val; this->next = NULL; } }; class Linkedlist{ public: Node* head; Node* tail; int size; Linkedlist(){ head = tail = NULL; size = 0; } void ...
ALGO
0.999634
4.448771
d6dd0513-d84b-44bf-af4b-515ae10cb66a
ishandutta2007/codeforces
pb0207/normal/956/C.cpp
#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=1e5+1e3+7; int n,a[N],f[N],g[N]; long long ans; int main() { scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=n;i>=1;i--) f[i]=max(f[i+1]-1,a[i]+1); for(int i=1;i<=n;i++) g[i]=max(g...
ALGO
0.999463
3.291375
7d405985-1f3f-48ba-a5ee-9c63b5ceb65c
ISOLDE-Project/riscv-llvm
lldb/examples/synthetic/bitfield/program.cpp
typedef unsigned int uint32_t; enum MaskingOperator { eMaskingOperatorDefault = 0, eMaskingOperatorAnd = 1, eMaskingOperatorOr = 2, eMaskingOperatorXor = 3, eMaskingOperatorNand = 4, eMaskingOperatorNor = 5 }; class MaskedData { private: uint32_t value; uint32_t mask; MaskingOperator oper; public: ...
TOOL
0.994106
6.231884
88cb4d38-52a8-47d1-a41e-db7dde3ec1e3
3211SHANKAR/Leetcode-Solutions
2448-count-number-of-bad-pairs/2448-count-number-of-bad-pairs.cpp
class Solution { public: long long countBadPairs(vector<int>& nums) { long long int count=0; int n=nums.size(); long long int tp=(1LL*n*(n-1))/2; long long int gp=0; map<int,int>mp; for(int i=0;i<nums.size();i++){ mp[nums[i]-i]++; } for(auto &a:mp...
ALGO
0.999986
5.390054
0ad5ccb2-7548-4903-a2df-2f5c600cd2e9
ZihanYuanCN/C
160801-4/160801-4/main.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <algorithm> using namespace std; const int mod=1e9+7; const int maxn=15005; const int h=1<<5; int t,cas,a[5],n,num[h+1]; long long int fa[maxn],fb[maxn],dp[maxn][h+1],out; long long int C(long long int a,long long int...
ALGO
0.999947
4.336829
4c84f268-67a5-4cf0-b943-8f72c6d19458
YeonjuSeo/DDosAlgorithm_Study
BOJ_13913/yeonju.cpp
// 1초 후에 X-1 / X+1 / 2*X // BFS // 순서대로 // N이 K와 같은 경우 // 0초, 현재 위치만 출력하면 됨 #include <iostream> #include <queue> #include <vector> #define MAX 100005 using namespace std; int N, K; // 수빈이 위치, 동생 위치 vector<int> answer; int visited[MAX]; int pastLocation[MAX]; // idx로 오기 직전의 위치 void findSister(vector<int> path) { q...
ALGO
0.999996
4.794355
7859b50c-b6ba-4a33-9ee3-f9fe3a7d6ced
SpartacusVipul/LeetCode_Python_Practice
215-kth-largest-element-in-an-array/kth-largest-element-in-an-array.cpp
class Solution { public: // default priority queue implementation in c++ is max heap // so, first we insert all elements into the queue, // then we remove first k elements int findKthLargest(vector<int>& nums, int k) { priority_queue<int> pq; for (int i = 0; i < nums.size(); i++) { ...
ALGO
0.999936
5.385632
94c29c8b-ec02-4918-9b45-d8bdee0c3d6f
proteus-core/libra
libra-llvm/llvm/lib/Transforms/Utils/LoopPeel.cpp
#include "llvm/Transforms/Utils/LoopPeel.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/Loads.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/LoopIterator.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/Sca...
ALGO
0.916986
5.523769
04bc6255-416b-4256-97d3-7460773a1212
juniorandrade1/Competitive-Programming
Codeforces/Higher Institute for Applied Sciences and Technology Collegiate Programming Contest 2016/K.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef pair< ll, ll > ii; typedef vector< ll > vi; typedef vector< ii > vii; #define INF 0x3F3F3F3F #define LINF 0x3F3F3F3F3F3F3F3FLL #define pb push_back #define mp make_pair #define pq prior...
ALGO
0.999767
4.296237
3789021f-20b8-441e-8e2f-92b43b85eb67
CS203UCR/2025wi
demo/intro/arraySort.cpp
#include <algorithm> #include <ctime> #include <iostream> #include <climits> #ifdef __cplusplus extern "C" { #endif long long calculate_sum(int *data, unsigned int size, int threshold); #ifdef __cplusplus } #endif int main(int argc, char **argv) { // generate data // const unsigned arraySize = 262144; int ...
ALGO
0.998714
5.392009
4ba85a0f-9459-45c4-b94d-b80e8a36a380
AjinkyaLok-2005/DSA-Practice-Problems
LECTURE63/Height.cpp
#include<iostream> #include<queue> using namespace std; class node { public: int data; node * left; node * right; node(int d) { this -> data = d; this -> left = NULL; this -> right = NULL; } }; node * buildTree(node * root) { cout << "Enter the data: " << endl;...
ALGO
0.99984
4.710701
3f1189bd-7860-4b76-87e8-8814d1b0e1d6
thebesttv/vul-llvm
clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
#include "ClangTidyOptions.h" #include "ClangTidyCheck.h" #include "ClangTidyDiagnosticConsumer.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/ScopedPrinter.h" #include "llvm/Testing/Annotations/Annotations.h" #include "gmock/gmock.h" #include "gtest/gtest.h" #include <optional> namespace clang { namespa...
TEST
0.924076
7.881296
c33c6274-4146-45ff-a9a1-aa18d9cf04cd
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_5889_8.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<vector<int> > s(n, vector<int>(m)); for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) cin >> s[i][j]; int answer = 0; for (int i = 0; i < n; i++) { int cur = 0; if (s[i][0] == 1) cur += 1; for (i...
ALGO
0.999925
3.84507
3b6c6117-3c9a-468b-a75f-9615b0bb5267
champ88044/dsa-solved-question
DSA-LeetCode/Arrays/Gas-station.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int canCompleteCircuit(vector<int> &gas, vector<int> &cost) { int dificit = 0, start = 0, balance = 0; for (int i = 0; i < gas.size(); i++) { balance += gas[i] - cost[i]; if (balance < 0) ...
ALGO
0.999978
5.55537
70c80fc1-eee8-4fac-838b-887a28557a3f
Umbra-Ignis-0-Kaiju/PolyProg
Lab№10/Lab№10/Ex5.cpp
#include<iostream> #include<vector> #include<assert.h> #include<algorithm> #include<string> #include <windows.h> using namespace std; int main() { int n, l, r, m1, m2; SetConsoleOutputCP(CP_UTF8); cout << "Введите число относительно которого проверяется высказывание: "; cin >> n; n = abs(n); l = n / 1000; r = n...
ALGO
0.995674
3.075682
eba6da23-04f7-4826-96c3-e3d58a242db9
roobiul/codeforce
2023.cpp
//بسم الله الرحمن الرحيم //محمد روبيول الإسلام //roobiul~Githab #include<iostream> #include<string> #include<bits/stdc++.h> #define ll long long int #define ctt cout<< #define Robiul ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) using namespace std; int main () { Robiul; ll t; cin>> t; while ...
ALGO
0.999741
3.140475
2ddf7923-0261-4c3d-92c8-320734e1b181
dlwlehd/BOJ_Cpp
Gold_1/13977.cpp
#include <bits/stdc++.h> using namespace std; #define all(v) (v).begin(), (v).end() #define X first #define Y second typedef unsigned long long ll; const int MOD = 1e9 + 7; ll fac[4000001]{ 1 }, inv[4000001]; ll mInv(ll a, ll b) { if (a == 0 && b == 1) return 0; if (a == 1) return 1; return b - mInv(b % a, a) * b...
ALGO
0.999935
4.827005
66d1adf9-26dc-4ca5-aff9-51bad7897d0f
Robin920/ppt_assignement
assignment 4/q7.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int maxCount(int m, int n, vector<vector<int>>& ops) { int minX = m; int minY = n; for (auto& op : ops) { minX = min(minX, op[0]); minY = min(minY, op[1]); } return minX * minY; } int main() ...
ALGO
0.999591
6.308164
ed36af9e-cfd9-44c1-8313-238f5fb415d6
alexandraback/datacollection
solutions_1483485_0/C++/rafalm/sit.cpp
#include <cstdio> int main() { const char map[26] = {'y', 'h', 'e', 's', 'o', 'c', 'v', 'x', 'd', 'u', 'i', 'g', 'l', 'b', 'k', 'r', 'z', 't', 'n', 'w', 'j', 'p', 'f', 'm', 'a', 'q'}; int i, j, T; char ch, G[102]; scanf("%d", &T); for (i = 1; i <= T; i++) { do { scanf("%c", &ch); } while (ch < 'a' ...
ALGO
0.994601
3.711213
1e68a03d-9516-46cd-95de-8cdf3bdcf509
JModelica/JModelica
ThirdParty/CasADi/CasADi/casadi/interfaces/worhp/worhp_interface.cpp
#include "worhp_interface.hpp" #include "casadi/core/std_vector_tools.hpp" #include "casadi/core/matrix/matrix_tools.hpp" #include "casadi/core/mx/mx_tools.hpp" #include "casadi/core/matrix/sparsity_tools.hpp" #include "casadi/core/function/mx_function.hpp" #include <ctime> using namespace std; namespace casadi { ...
TOOL
0.920298
3.011201
3a74c645-e928-4bc3-9213-8ff6d9c3bdf9
aditya-sar/LeetCode
2119-minimum-number-of-operations-to-make-array-continuous/minimum-number-of-operations-to-make-array-continuous.cpp
class Solution { public: int n; int minOperations(vector<int>& a) { sort(a.begin(), a.end()); n = a.size(); int l = 0; int mx = 1; int count = 1; for(int r=1; r<n; ++r) { if (a[r] == a[r-1]) { continue; } whi...
ALGO
0.999984
5.888174
2fdb8152-5972-403b-967a-1cc8c29650ae
keqhe/leetcode
google_list/leetcode318.cpp
class Solution { public: int maxProduct1(vector<string>& words) { if (words.size() < 2) return 0; unordered_map<string, unsigned int> m; for (auto w : words) { int curr = 0; for (auto c : w) { curr |= (1 << (c-'a')); } ...
ALGO
0.999838
5.489231
5c1517a3-dd95-4d65-b979-03986aa7b106
mugdhamalpe/CP
B_Taxi.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int arr[n]; for(int i=0; i<n; i++){ cin>>arr[i]; } int count1=0, count2=0, count3=0, count4=0, result=0, sum=0; for(int i=0; i<n; i++){ if(arr[i]==4){ count4+=1; }else if(arr[i]==1)...
ALGO
0.999932
4.09658
d55fff36-c6d5-485d-b816-b7c33daecdcd
ishandutta2007/codeforces
umqra/normal/120/H.cpp
#include <iostream> #include <string> #include <vector> using namespace std; string word[210]; vector <bool> used;// dfs, vector <int> mt;//mt[i] - , i vector <int> graph[210];//graph[i] - , i vector <string> substring;// string rez[210];// int hash[27][27][27][27]; int n; void sumbol_code ( s...
ALGO
0.999955
4.040175
1d3e4c4e-650b-41b1-954a-066df5b6df5a
morishita8256/AtCoder
ABC/041-060/ABC055/A - Restaurant.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define se second #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define repp(i, a, b) for (int i = a; i <= (b); ++i) #define repr(i, a, b) for (int i = a; i >= (b); --i) typedef long long ll; cons...
ALGO
0.999218
3.137962
bf66dbfb-410b-4e6e-ab0a-b2bbfe24666d
emae18/gema-de-la-mente
Notebook/Problemas Resueltos/EdmJudge/Granja (1).cpp
#include<iostream> using namespace std; long long conejosF(long long n,long long c[]) { if(n==1 || n==2)return 1; else { c[2]=c[1]+c[0]; c[1]=c[0]; c[0]=c[2]; conejosF(n-1,c); return c[0]+c[1]; } } long long vConejos(long long n) { long long conejos...
ALGO
0.999976
3.35566
8de20a30-2060-4ce4-a271-d6bba3cf7121
runlnr/solid-octo-sniffle
Codeforces/405A - Gravity Flip.cpp
#include <bits/stdc++.h> #define endl "\n" #define sp ' ' using namespace std; typedef string str; typedef long long ll; void solve(ll n) { int ar[n+10]; for(int i = 1; i <= n; i++) cin >> ar[i]; sort(ar+1, ar+n+1); for(int i =1; i <= n; i++) cout << ar[i] << sp; } int main() { //f...
ALGO
0.999768
3.204112
0e632819-1a10-4e9e-84cb-7bd1f343720b
yadsasusi/LeetCode-Sol
solutions/1483. Kth Ancestor of a Tree Node/1483.cpp
class TreeAncestor { public: TreeAncestor(int n, vector<int>& parent) : maxLevel(32 - __builtin_clz(n)), dp(n, vector<int>(maxLevel)) { for (int i = 0; i < n; ++i) for (int j = 0; j < maxLevel; ++j) if (j == 0) // node i's 2^0 ancestor is its direct parent dp[i][j] = parent[i]; ...
ALGO
0.999923
6.10134
6ff44d08-41d3-4df9-923e-d82a9f02d1b6
bishakh17/CP
Problems/C_Friends_and_Gifts.cpp
#include <iostream> #include<bits/stdc++.h> using namespace std; #define endl "\n" #define int long long #define cout(x) cout<<(x)<<endl #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) int T = 1; void solve(){ int n; cin>>n; vector<int> a(n); for(int i = 0; i<n; i++) cin>>a[i]...
ALGO
0.999917
4.399123