uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
4eb476c8-a88a-4494-bbd1-724a4ac7d219
xxminjixx/algorithm
study/17.cpp
#include <stdio.h> int main() { int i, j, n, num, ans, sum = 0; scanf_s("%d\n", &n); for (i = 0; i < n; i++) { sum = 0; scanf_s("%d %d", &num, &ans); for (j = 0; j <= num; j++) { sum += j; } if (ans == sum) printf("YES\n"); else printf("NO\n"); } return 0; }
ALGO
0.999887
3.407917
950ea6fb-b601-42ac-a73a-296b4ff2ee40
belikeakash/Leetcode
637-average-of-levels-in-binary-tree/637-average-of-levels-in-binary-tree.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.999949
6.897951
210a57cf-1fe4-4e54-a08b-4f4e24ace7c2
heavenMOJANG/ICPC
.history/2024牛客多校/牛客多校8/A_20240808130824.cpp
#pragma GCC optimize(1) #pragma GCC optimize(2) #pragma GCC optimize(3,"Ofast","inline") #include<bits/stdc++.h> #define int long long using namespace std; constexpr int INF = 0x7fffffff; constexpr int N = 1e5 + 10; int isPrime[N], primes[N], idx; void getPrimes() { fill(isPrime, isPrime + N, 1); isPrime[1] = 0...
ALGO
0.99984
4.166693
206404fa-3b11-44e2-8355-ec7ad25b1a63
zivyou/labofziv
leetcode-cn-cpp/leetcode-cn-375/main.cpp
#include <cstdio> #include <vector> #include <climits> using namespace std; class Solution { int **re; private: int minPath(int left, int right) { if (left >= right) return 0; if (re[left][right] > 0) return re[left][right]; int min = INT_MAX; for (int i=left; i<right; i++) { ...
ALGO
0.999789
4.287475
b813207e-9253-40f1-a172-410e99dd1bb0
NurtileuRakhat/C
acmp/Цикл/While/1.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int a,b; cin >> a >> b; cout << lcm(a,b); }
ALGO
0.999837
4.457706
dc4222cb-11af-4a61-b2fd-a52924ea1d4f
juarezpaulino/coderemite
problemsets/Kickstart/2019/C/a.cpp
/** * * Author: Juarez Paulino(coderemite) * Email: <EMAIL> * */ #define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int,int> pi; typedef pair<ll,ll> pl; typedef vector<string> vs; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typed...
ALGO
0.999843
4.11086
411aa4cc-394d-43d6-a517-cad3fbcd6c8a
melody97/geminifs
src/freestanding/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp
// <algorithm> // template<class ForwardIterator, class Size, class T> // constexpr ForwardIterator // constexpr after C++17 // search_n(ForwardIterator first, ForwardIterator last, Size count, // const T& value); #include <algorithm> #include <cassert> #include "test_macros.h" #include "test_iter...
TEST
0.978895
7.379649
0b45b2c1-b4d8-4d03-b994-39298262fcfe
amanBhawsar/Coding-Tree
GFG-GeeksForGeeks/Largest prime factor.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--){ long n,i=1,gf=1; cin>>n; while(n%2==0){ gf=2; n=n/2; } for(i=3;i*i<=n;i=i+2){ while(n%i==0){ gf=i; n=n/i; } } if(n>2){ ...
ALGO
0.999956
4.623636
413715f4-b8d7-4c79-afb1-aa8f6de0a28b
mianhk/learn_cpp
sword-to-offer/c32.cpp
#include <iostream> #include <cmath> using namespace std; int findNumberOf1(int n){ if(n<0) return 0; int high,low,curr,tmp,i=1; high=n; int total=0; while(!high){ high=n/(int)pow(10,i); //ȡiλ tmp = n%(int)pow(10, i); curr = tmp/(int)pow(10, i-1);// ???i? low = tmp%(int)pow(10, i-1);/...
ALGO
0.999556
3.951394
f66349b3-f696-4038-aa5e-9d7a02b21817
spidycse16/My_Codeblocks_Codes
1337B.cpp
#include<bits/stdc++.h> using namespace std; int main() { int tc,n,i,j,x,m; cin>>tc; for(int k=0 ; k<tc; k++) { cin>>x>>m>>n; for(j=0 ; j<m ; j++) { if(x>20) { x=(x/2)+10; } else break; if(x<...
ALGO
0.999095
3.304231
279490dd-69ec-4399-85a6-ad0574702a99
andrewraim/fntl
vignettes/examples/r_trunc.cpp
// [[Rcpp::depends(fntl)]] #include "fntl.h" // [[Rcpp::export]] Rcpp::NumericVector r_trunc_ex(unsigned int n, double shape1, double shape2, double lo, double hi) { fntl::cdf F = [&](double x, bool lower, bool log) { return R::pbeta(x, shape1, shape2, lower, log); }; fntl::quantile Finv = [&](do...
ALGO
0.998828
4.731184
bd88d012-277b-4710-ad75-168163248bec
skjha1/Aditya-verma-youtube-playlist-code
Binary Search/10 Find ceil of an element in a sorted array.cpp
class Solution{ public: int findFloor(vector<long long> v, long long n, long long x){ int start=0; int end=n-1; int res=-1; while (start<=end){ int mid= start+(end-start)/2; if (x==v[mid]) return v[mid]; else if(x<v[mid]) { res=v[mid]; // store candidate in re...
ALGO
0.999992
5.391134
8790f96a-dd65-4332-a5a4-f2de78361981
MandyXie/c_primer_exercise_code
extra_files/src/Exercise_9.20.cpp
#include<deque> #include<list> #include<iostream> using namespace std; int main() { list<int> li{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; deque<int> dq1,dq2; for(auto l:li) { l%2 == 0? dq1.push_back(l) : dq2.push_back(l); } cout << "element in dq1 should be even:" << endl; for(auto dq:dq1) c...
TOOL
0.940349
4.8198
0e842e8c-3dfa-4588-a499-d261aa96496e
WillenPeng/Path_Planning_Algorithm
HybridAstar_MPC/MPC/Eigen-3.3/bench/spbench/sp_solver.cpp
// Small bench routine for Eigen available in Eigen // (C) Desire NUENTSA WAKAM, INRIA #include <iostream> #include <fstream> #include <iomanip> #include <Eigen/Jacobi> #include <Eigen/Householder> #include <Eigen/IterativeLinearSolvers> #include <Eigen/LU> #include <unsupported/Eigen/SparseExtra> //#include <Eigen/Sp...
ALGO
0.983908
4.31638
b43a6e81-206d-42f0-9577-35e8ce10bc36
anthonytk31415/cpp-data-structures-and-algorithms
heaps/priority_queue_example.cpp
// Priority Queue: The C++ STL also provides the priority_queue container adapter, which encapsulates a heap. // By default, it is a max-heap, but you can make it a min-heap by providing a custom comparator. // Here's an example of using priority_queue: #include <queue> #include <vector> #include <iostream> using n...
ALGO
0.998809
5.821121
127bb3af-e38e-459c-9123-a73c759fcfdb
EdwinOrtegaGutierrez/proParalela
project9/mpi_vector_ops.cpp
#include <mpi.h> #include <iostream> #include <vector> #include <algorithm> #include <numeric> #include <random> #include <stdexcept> class OperacionesVector { private: std::vector<int> vector; public: void CrearArreglo() { try { vector.resize(1000); std::iota(vector.begin(), ve...
ALGO
0.99836
5.831228
5ec0cf12-9f3d-485c-9484-8055674225cc
seclab-ucr/SCENT
Tools/LLVM-6.0/llvm-6.0.0.src/lib/Transforms/IPO/MergeFunctions.cpp
#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/CallSite.h" #include "llvm/IR/Constant.h" #include "llvm/IR/Constants.h" #includ...
TOOL
0.974249
6.754358
af9a81ae-da89-45f4-9053-8cae68244bef
Kubia-Beta/Sandboxing
1668 Maximum Repeating Substring.cpp
class Solution { public: int maxRepeating(string sequence, string word) { int solution = 0; string repeatedWord = word; while (sequence.find(repeatedWord) != string::npos) { //while we still have characters in the string left solution++; // increment the solution count ...
ALGO
0.999927
5.956194
a08fd49e-844b-4b91-8f44-d3cb121f8be0
Lchuxian/SLAM-Environment
OpenCV3_and_OpenCV4_coexist/opencv-4.5.5-build/opencv_contrib-4.5.5/modules/saliency/src/staticSaliency.cpp
#include "precomp.hpp" namespace cv { namespace saliency { /** * StaticSaliency */ bool StaticSaliency::computeBinaryMap( InputArray _saliencyMap, OutputArray _binaryMap ) { Mat saliencyMap = _saliencyMap.getMat(); CV_CheckTypeEQ(saliencyMap.type(), CV_32FC1, ""); Mat labels = Mat::zeros( saliencyMap.rows * ...
ALGO
0.998494
7.356016
f1965f47-bcd6-418d-9fc2-ea01ea28101b
myousuf65/cpp_webserver
dependencies/boost/libs/multiprecision/doc/numeric_limits_qbk.cpp
// Program to list all numeric_limits items for any type to a file in Quickbook format. // C standard http://www.open-std.org/jtc1/sc22/wg11/docs/n507.pdf // SC22/WG11 N507 DRAFT INTERNATIONAL ISO/IEC STANDARD WD 10967-1 // Information technology Language independent arithmetic Part 1: Integer and Floating point arith...
TOOL
0.912198
6.40928
77ad392e-e7cd-44b1-aa59-8f6a434af5c7
TheOwl1612-ai/LeetCode
LeetCode-PermutationInString.cpp
#include "Debug.cpp" class Solution { public: bool checkInclusion(string s1, string s2) { if (s2.size() < s1.size()) return false; vector<int>map (27,0); for (char c : s1) map[c-97]++; //fill map vector<int>currCharMap (27,0); size_t l1 = s1.size(); ...
ALGO
0.999632
5.920265
7bc95982-6601-4d85-a4bc-7601265227d4
raincross7/code-similarity
codes/train_code/problem111/problem111_267.cpp
#include <stdio.h> #include <stdlib.h> #include <iostream> #include <stack> #include <vector>//子のセットを記録 #include <string>//ノードのタイプ(root、internal node、leafのいずれか)を記録 #include <algorithm> #include <iterator>//back_inserter #define N_MAX 100000 #define MAX_DEPTH #define NIL -1//親や子などが存在しない場合に用いる using namespace std; //常に心し...
ALGO
0.999465
4.314192
2029187b-fe03-46b1-8f7b-0ce3f21b6532
Alaxe/noi2-ranking
2018/solutions/D/PDI-Sofia/sdnf.cpp
#include<iostream> using namespace std; int long long fac( int n){ int long long fact=1; int a=1; if(n>1){ for(n;n!=1;n--) if(n%5!=0) fact=fact*n; else if(n%2!=0) a=2*a; } return fact/a; } int sum(int long long n){ int sudi=0; for(n;n>0;n=n/10){ sudi=sudi+n%10; } return sudi; } int main(){ int a; cin>>a; cout<<s...
ALGO
0.99988
4.114561
5fbb2677-587e-4c2a-911b-34cc28886f2e
mit-acl/dynus
src/dynus/utils.cpp
#include "dynus/utils.hpp" namespace dynus_utils { dynus_interfaces::msg::PWPTraj convertPwp2PwpMsg(const PieceWisePol &pwp) { dynus_interfaces::msg::PWPTraj pwp_msg; for (int i = 0; i < pwp.times.size(); i++) { pwp_msg.times.push_back(pwp.times[i]); } // push x for (auto coeff_x_i...
TOOL
0.92822
4.140055
e52ec91a-a8dd-4973-9823-c5ac3af4ba80
ishandutta2007/codeforces
square1001/normal/705/B.cpp
#include <bits/stdc++.h> using namespace std; int n, x, sum; int main() { scanf("%d", &n); for(int i = 0; i < n; i++) { scanf("%d", &x); sum ^= x - 1; printf("%d\n", 2 - (sum & 1)); } return 0; }
ALGO
0.999987
3.968927
668a125d-aba9-45f4-b38d-0348bc4ee31a
0-jij-0/CompetitiveProgramming
Problems Archive/2000 - 2999/2081 - Passable Paths.cpp
#include <iostream> #include <vector> #include <algorithm> #include <numeric> using namespace std; struct graph { vector<vector<int>> nodes; int n; graph(int _n) : n(_n), nodes(_n) {} void add_edge(int u, int v) { nodes[u].emplace_back(v); nodes[v].emplace_back(u); } }; struct RMQ { vector<vector<int>> rmq;...
ALGO
0.999992
5.026114
8488ec1d-9db5-4ac6-bd34-be712d3f4437
eric-haibin-lin/pelotondb
src/postgres/backend/rewrite/rewriteDefine.cpp
#include "postgres.h" #include "access/heapam.h" #include "access/htup_details.h" #include "access/multixact.h" #include "access/transam.h" #include "access/xact.h" #include "catalog/catalog.h" #include "catalog/dependency.h" #include "catalog/heap.h" #include "catalog/indexing.h" #include "catalog/namespace.h" #inclu...
TOOL
0.854695
4.474034
44a5b17d-fc7b-45fd-8d96-c53aa2078d45
amit-23-hub/LeetCode---POTD
2793-count-the-number-of-complete-components/count-the-number-of-complete-components.cpp
class Solution { public: bool bfs(int node, vector<vector<int>>& adj, vector<int>& vis) { int nodecnt = 0; int edcnt = 0; vis[node] = 1; // Marking node as visited queue<int> q; q.push(node); while (!q.empty()) { int nd = q.front(); q.p...
ALGO
0.99997
6.398749
439a7c2a-b76b-450f-9f4d-c5837f3f96ee
AkshayAnil1080/DSA
Bleak Numbers - GFG/bleak-numbers.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int is_bleak(int n) { for(int i=n-30; i<=n; i++) { if(i+count_set_bits(i)==n) return 0; } return 1; } int count_set_bits(int n) { int ...
ALGO
0.998099
5.243242
14e5b5dc-72f0-4b0c-a43b-b47fb640b0bf
kino-3/private_atcoder
atcoder/other/typical90/056.cpp
#include <bits/stdc++.h> #define REP(var, n) for (decltype(n) var = 0; var < (n); var++) #define REP_R(var, n) \ for (auto var = (n)-1; var != static_cast<decltype(var)>(-1); var--) #define FOR(var, a, b) for (auto var = (a); var < (b); var++) #define FOR_R(var, a, b) for (auto var = (b - 1); var > (a - 1); var--) ...
ALGO
0.999942
3.795337
f07d183f-698b-4ee1-b7a9-f26ede32da2b
Bharat2044/365-days-coding-challanges
Day_256/02_bagOfTokens.cpp
// Question Link: https://leetcode.com/problems/bag-of-tokens/ /* 948. Bag of Tokens You have an initial power of power, an initial score of 0, and a bag of tokens where tokens[i] is the value of the ith token (0-indexed). Your goal is to maximize your total score by potentially playing each token in one of two ways...
ALGO
0.999963
6.562562
7c13107b-aa2d-4872-8a9f-25f4f4394be3
ishandutta2007/codeforces
tlewpdus/normal/1039/A.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; int n; ll t; ll a[200100], x[200100]; ll bmin[200100], bmax[200100]; void pung() { printf("No\n"); exit(0); } int main() { int i, flag = 1; scanf("%d%lld",&n,&t); for (i=0;i<...
ALGO
0.999998
3.395657
07c1c30c-5236-4cea-ba93-97531706b3f2
Qianheorgan/siyuetian
shuixianhua.cpp
#include <stdio.h> #include<stdlib.h> #include<math.h> int main() { int i = 0; int tmp; for (i = 0; i < 99999; i++) { int count = 0; int sum = 0; tmp = i; while (tmp != 0) { count++; tmp /= 10;//tmp=tmp/10 } tmp = i; while (tmp != 0) { sum += pow((double)(tmp % 10), count); tmp = tmp ...
ALGO
0.998304
3.5013
b15005ed-c78d-460e-b2d5-c3ebaf8fac33
awdevmyid/nodejs
deps/icu-small/source/i18n/number_rounding.cpp
#include "unicode/utypes.h" #if !UCONFIG_NO_FORMATTING #include "uassert.h" #include "unicode/numberformatter.h" #include "number_types.h" #include "number_decimalquantity.h" #include "double-conversion.h" #include "number_roundingutils.h" #include "putilimp.h" using namespace icu; using namespace icu::number; using...
TOOL
0.914951
7.845339
1bd175d3-bf6e-460c-9c04-23533263d545
MohammadFakhreddin/CrazyTankGame
engine/physics_2d/AABB2D.cpp
#include "AABB2D.hpp" #include <algorithm> //----------------------------------------------------------------------- bool AABB2D::Overlap(AABB2D const& other) const { //https://stackoverflow.com/questions/20925818/algorithm-to-check-if-two-boxes-overlap return IsOverlapping1D(min.x, max.x, other.min.x, other...
ALGO
0.996356
6.860317
90a820fa-6194-4ef8-bad1-241609b06133
KOLLINIKHILKUMAR/LEETCODE-GFG-SOLVED-SOLUTIONS
0445-add-two-numbers-ii/0445-add-two-numbers-ii.cpp
class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { stack<int> s1,s2; int carry=0,first,second; ListNode * pt1=l1, *pt2=l2, *head=NULL; while(pt1!=NULL) { s1.push(pt1->val); pt1=pt1->next; } while(pt2!=NU...
ALGO
0.999933
6.211581
42aa8cbd-ad71-40fc-a630-2a16ea0cbecb
ehmprah/coregrounds
server/ThirdParty/boost/boost_1_67_0/libs/compute/perf/perf_bolt_sort.cpp
#include <algorithm> #include <cstdlib> #include <vector> #include <bolt/cl/sort.h> #include <bolt/cl/copy.h> #include <bolt/cl/device_vector.h> #include "perf.hpp" int main(int argc, char *argv[]) { perf_parse_args(argc, argv); std::cout << "size: " << PERF_N << std::endl; ::cl::Device device = bolt::...
ALGO
0.991522
5.063756
ec5e7240-61d1-4483-98ad-5dcf6ab5470f
KagE-Akumaa/DSA-Cpp
Recurssion/SortedArray.cpp
#include <iostream> using namespace std; bool isSorted(int arr[], int n) { if (n == 0 or n == 1) { return true; } if (arr[0] < arr[1] && isSorted(arr + 1, n - 1)) return true; else return false; } int main() { int arr[] = {1, 2, 3, 41, 5}; int n = sizeof(arr) / sizeof(int); bool sor = isSorted(arr, n); ...
ALGO
0.99983
4.862196
affc8ee4-9055-4964-83f0-dd8432748b97
Daahae/algo
rkddlsgur983/backjoon/dfs/11403.cpp
// BOJ DFS 11403 경로 찾기 #include <iostream> #include <algorithm> #include <string.h> using namespace std; int graph[100][100]; bool isVisited[100]; int n; void DFS(int start) { for (int j = 0; j < n; j++) { if (graph[start][j] && !isVisited[j]) { isVisited[j] = true; DFS(j); ...
ALGO
0.999943
4.965197
f510363b-eadd-4030-85ef-50e35d31e1dd
Apress/learn-cocos2d-game-dev-w-ios-5
CH04_code/DoodleDrop02/libs/Box2d/Dynamics/Joints/b2PulleyJoint.cpp
#include <Box2D/Dynamics/Joints/b2PulleyJoint.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2TimeStep.h> // Pulley: // length1 = norm(p1 - s1) // length2 = norm(p2 - s2) // C0 = (length1 + ratio * length2)_initial // C = C0 - (length1 + ratio * length2) >= 0 // u1 = (p1 - s1) / norm(p1 - s1) // u2 = ...
ALGO
0.99091
6.988971
02173c1f-6481-4410-88d9-51285f0cc7a9
jo3-l/cp-practice
src/main/cpp/ccc/2012/sounds_fishy.cpp
#include <bits/stdc++.h> using namespace std; int xs[4]; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); for (int i = 0; i < 4; i++) cin >> xs[i]; if (is_sorted(begin(xs), end(xs), [](int a, int b) { return a <= b; })) cout << "Fish Rising" << '\n'; else if (is_sorted(begin...
ALGO
0.999807
3.939492
aeda96ed-8d53-40b5-b6d0-8cafd860ac48
yusuf-aksoy/cpp-challenges
projectEulerProblem1.cpp
//project euler problem 1 solution #include <iostream> using namespace std; int main() { int toplam = 0; for (int i = 0; i < 1000; i++) { if (i % 5 == 0 || i % 3 == 0) { toplam += i; } } cout << "toplam:" << toplam << endl; return 0; } /* output: toplam:233168 */
ALGO
0.999842
4.133369
0231b781-75d2-488b-b12f-a5e2ee0d2599
roushanku/LEETCODE_POTD_FEB_24
farthest_building_you_can_reach.cpp
// J.S.R -- *roush* #include<iostream> #include<bits/stdc++.h> using namespace std; const int mod = 1000000007; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; typedef tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> pbds; //find_by_...
ALGO
0.999668
4.586369
a60f84db-c68c-4e38-abb7-5f324013dc99
amantibrewal310/Data-Structure-and-Algorithms
Recursion and Backtracking/2048-Problem.cpp
#include<bits/stdc++.h> using namespace std; #define int long long // Problem : Number to Spellings string numInWord(int n) { string ans = ""; switch (n) { case 1: ans = "One"; break; case 2: ans = "Two"; break; case 3: ans = "Three"; break; ...
ALGO
0.999756
5.969166
e7e83c04-8f4f-4590-b059-6239699d1aed
anoobzg/qi
src/CloudCompare/src/libs/qCC_db/ccGriddedTools.cpp
#include "ccGriddedTools.h" //Local #include "ccGBLSensor.h" #include "ccLog.h" //! Association of an angle and the corresponding number of rows/columns typedef std::pair<PointCoordinateType,unsigned> AngleAndSpan; bool ccGriddedTools::DetectParameters( const ccPointCloud* cloud, const ccPointCloud::Grid::...
ALGO
0.987771
7.252888
8d54586a-51bc-4698-b06f-c1f806e7cd43
RISHI2303/Leetcode-and-GFG-Questions
1342-number-of-steps-to-reduce-a-number-to-zero/1342-number-of-steps-to-reduce-a-number-to-zero.cpp
class Solution { public: int numberOfSteps(int num) { if(num == 0) return 0; int steps = 0; while(num > 0) { if(num%2 == 0) num /= 2; else num -= 1; steps++; } return steps; } };
ALGO
0.999952
6.055742
237ae380-2a37-421b-b06e-72f59700f8a7
ADHLilly/graphviz
graphviz-7.1.0/lib/vpsc/generate-constraints.cpp
#include <algorithm> #include <set> #include <cassert> #include <cstdlib> #include <memory> #include <vector> #include <vpsc/generate-constraints.h> #include <vpsc/constraint.h> using std::set; using std::vector; std::ostream& operator <<(std::ostream &os, const Rectangle &r) { os << "{"<<r.minX<<","<<r.maxX<<","<<r...
ALGO
0.999466
6.320946
63931ad1-4663-42f5-ad44-3ca8601d2d2a
aryanraj0611/DSA-
array/MovesZeroToLast.cpp
#include<bits/stdc++.h> using namespace std; int movezero(vector<int>& arr, int n){ // for(int i=0;i<n;i++){ // for(int j=0;j<n-1;j++){ // if(arr[j]==0){ // swap(arr[j],arr[j+1]); // } // } // } int i=0; int j =n-1; while(i<j){ if(arr[...
ALGO
0.999971
5.048948
e8d645e1-fca6-4598-932b-be6464efb24d
artsking/frameworks_av_10.0.0_r33
media/libstagefright/codecs/mp3dec/src/pvmp3_huffman_parsing.cpp
/* ------------------------------------------------------------------------------ PacketVideo Corp. MP3 Decoder Library Filename: pvmp3_huffman_decoding.cpp Funtions: pvmp3_huffman_quad_decoding pvmp3_huffman_pair_decoding pvmp3_huffman_pair_decoding_linbits Date: 09/21/2007 ------------...
ALGO
0.999604
5.388761
37a0f854-6ca9-4eba-8762-c6721313aba6
AmeyaVS/SystemC_DEPRECATED
systemc-regressions/tests/systemc/misc/sim_tests/cycle_dw8051_demo/cycle_model.cpp
/***************************************************************************** cycle_model.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /************************************************************************...
TOOL
0.861615
5.313611
ba402208-7591-4faa-bd0e-592a623ef577
NestZ/competitive-programming
CodeForces/426A.cpp
#include<bits/stdc++.h> using namespace std; typedef long long int ll; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, s;cin >> n >> s; vector<int> arr(n); for(int i = 0;i < n;i++)cin >> arr[i]; sort(arr.begin(), arr.end()); int sum = 0; for(int i = 0;i < n - 1;i++)sum += arr[i]; if(sum <= s)cou...
ALGO
0.999945
3.497914
2a2e4d46-2e5c-48c6-a2ea-84684b8ebb00
GunawanAhmad/Data-Structure
Reversed-Double-Linked-List/main.cpp
#include <iostream> #include "header.h" using namespace std; int main() { List L; createList(L); insertLast(L, 1); insertLast(L, 2); insertLast(L, 3); printList(L); cout<<"Reversed List"<<endl; reverse_List(L); printList(L); return 0; }
ALGO
0.947496
3.919337
725c78e0-746c-47e6-893e-a00ef50d2227
Scalpelapex/Interactive_Geometric_Deformation_Engine
deps/eigen/doc/examples/nullary_indexing.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; // [functor] template<class ArgType, class RowIndexType, class ColIndexType> class indexing_functor { const ArgType &m_arg; const RowIndexType &m_rowIndices; const ColIndexType &m_colIndices; public: typedef Matrix<typename ArgType::Scalar, ...
ALGO
0.991176
6.750382
5a1b7a32-f9bc-4e69-b7f0-74c2e6fce979
ishandutta2007/codeforces
abc864197532/normal/699/B.cpp
#include <bits/stdc++.h> using namespace std; #define lli long long int #define fop(i,m,n) for (int i=(m);i<(n);i++) #define FOP(i,m,n) for (int i=(m)-1;i>=(n);--i) #define test(x) cout << #x << ' ' << x << endl; #define eb emplace_back #define pb push_back #define mp make_pair #define pii pair<int,int> #define X fir...
ALGO
0.99994
3.210107
c771bfc0-2485-4e3c-8942-0359c92de965
codewithaman07/My-questions
130. Surrounded Regions.cpp
class Solution { public: void dfs(vector<vector<char>> &board, vector<vector<int>> &vis, int row, int col, int drow[], int dcol[]){ int n = board.size(); int m = board[0].size(); vis[row][col] = 1; for(int i = 0; i<4; i++){ int nrow = row + drow[i]; int n...
ALGO
0.999912
6.2591
261783d6-3665-46b1-bcc5-195acd7f12f7
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_9011_0.cpp
#include <bits/stdc++.h> using namespace std; int n, l, r; int a[100005]; int b[100005]; int c[100005]; int p[100005]; bool flag = true; int main() { int i, j; int minb = 1000000007; int maxb = 0; int d = 0; cin >> n >> l >> r; for (i = 1; i <= n; i++) { cin >> a[i]; } for (i = 1; i <= n; i++) { ...
ALGO
0.99998
3.203499
506b5bf4-5ab0-481a-86f0-7003353a749c
yzzupgo/MFTCG
Data/abc170_b/weirdo_max/wa/14313029.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int x,y; cin>>x>>y; int c=0, t=0; if(x*2==y || x*4==y){ cout<<"YES"; return 0; } else if(x*2>y){ cout<<"NO"; return 0; } else{ while(c<=x){ c++; t=x-c; if(c*2 + t*4 ==y){ cout<<"YES"; return 0; } } } cout<<"NO"; return 0; }
ALGO
0.999943
3.413859
3011526a-a4a5-45ea-b741-7fa66c38f773
mihai145/CP-Cheatbook
longestIncreasingSubsequence.cpp
// // Created by Mihai145 on 4/26/2021. // /* * Test problem: https://infoarena.ro/problema/scmax * This algorithm returns the longest *strictly* increasing subsequence * Input: 24 12 15 15 19 * Output: 12 15 19 */ #include <fstream> #include <vector> #include <algorithm> using namespace std; const int NMAX = ...
ALGO
0.999998
4.440789
b47bfc07-90ed-4c43-98d9-17d23eaa13c2
SanketDK7/AI-Project
Sorting_algo_recommendation_using_PSO/main.cpp
#include <iostream> #include <vector> #include <fstream> // Include for file operations #include "../include/data_analysis.h" #include "../include/algorithms.h" #include "../include/recommendation_system.h" #include "../include/utility.h" #include "../include/complexity_analysis.h" #include <chrono> #include <string> ...
ALGO
0.989485
5.69972
844b37cf-b181-4e3f-a835-a32a9461fccf
ahshokry/fluoride
bt/third_party/core/storaged/storaged_utils.cpp
#define LOG_TAG "storaged" #include <dirent.h> #include <fcntl.h> #include <inttypes.h> #include <linux/time.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <time.h> #include <unistd.h> #include <iomanip> #include <sstream> #include <string> #include <u...
TOOL
0.884007
6.281515
e0026fe8-7636-471e-97db-23f8356ca6b9
Aman-Pal07/DSA-Basic-and-Advanced-Problem-
DP/maximalSquare.cpp
#include <bits/stdc++.h> using namespace std; int solveMemo(vector<vector<char>> &matrix, int i, int j, int &maxi, vector<vector<int>> &dp) { if (i >= matrix.size() || j >= matrix[0].size()) return 0; if (dp[i][j] != -1) return dp[i][j]; int right = solveMemo(matrix, i, j + 1, maxi, dp); ...
ALGO
0.999938
5.521601
cb59869f-c585-4c94-9684-a84deae30aa1
sharc-lab/LightningSim
llvm-project/lldb/test/API/functionalities/recursion/main.cpp
#include <stdio.h> #include <stdlib.h> #include <stdint.h> struct node; struct node { int value; node* next; node () : value(1),next(NULL) {} node (int v) : value(v), next(NULL) {} }; void make_tree(node* root, int count) { int countdown=1; if (!root) return; root->value = countdown; while (count > 0) { ...
ALGO
0.999308
3.444803
0e9e56d4-c880-4be7-a066-e70b01ed7f98
Truclam104/custom-llvm-project
libcxx/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of_pred.pass.cpp
// <algorithm> // template<InputIterator Iter1, ForwardIterator Iter2, // Predicate<auto, Iter1::value_type, Iter2::value_type> Pred> // requires CopyConstructible<Pred> // constexpr Iter1 // constexpr after C++17 // find_first_of(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Pred pred); #incl...
TEST
0.991802
6.517296
d4bcea86-8a76-447e-9524-1b85110f4ae8
idiotman-2212/BTCodePTITHCM
So_nguyen_to_va_ap_dung/CPP0130_uocSoNguyenToLonNhat.cpp
#include<bits/stdc++.h> using namespace std; bool check(int n){ if(n <= 1){ return false; }for(int i = 2; i <= sqrt(n); i++){ if(n % i == 0){ return false; } } return true; } long long gcd(long long a, long long b){ if(b == 0){ return a; } return gcd(b, a% b); } long long lcm(long long a, long long b)...
ALGO
0.99993
4.855031
deb27412-00d3-4fdb-a598-5640026fa69a
hydrus3109/USACOSolutions
practice/hopscotch/main.cpp
#include<cstdio> #include<cstring> #include<iostream> #define ll long long using namespace std; const int p=1e9+7; const int N=755; int a[N][N],r,c,K,root[N*N],sz=0; int f[N][N],sum[N][N],sum_line[N]; struct node{ int sum; int l,r; }; node t[6001000]; void change(int &rt,int l,int r,int w,int z) { if (!r...
ALGO
0.999808
3.804264
bcadb7f2-bf5d-4e3c-b87b-358903bbba4d
Tahsin005/Problem-Solving
Week 21+/C_Make_Palindrome.cpp
#include<bits/stdc++.h> #define ll long long using namespace std; void print_palindrome1(vector<ll> &freq,ll n) { string ans(n, '&'); ll i = 0, j = n - 1; char ch; for (ll k = 0; k < 26; k++) { while (freq[k]) { ans[i] = k + 'a'; ans[j] = k + 'a'; freq[k] -= 2...
ALGO
0.999999
4.560943
e2c960ab-fb98-43a5-a87f-f1165bea26a1
ishandutta2007/codeforces
winniechen/normal/1097/B.cpp
#include <cstdio> #include <algorithm> #include <cmath> #include <cstring> #include <cstdlib> #include <queue> #include <iostream> #include <bitset> using namespace std; #define N 16 int a[N],now,ans,n; void dfs(int dep,int now) { if(dep==n+1){if(!now)ans=1;return ;} dfs(dep+1,(now+a[dep])%360),dfs(dep+1,(now-a[dep]+...
ALGO
0.999963
3.54651
5380f067-0a24-44b2-b3a6-30c6406ce262
fulatin/MyAlgorithmProblemCode
luogu/p3383.cpp
#include <bits/stdc++.h> #include <cstring> using namespace std; const int N = (int)10e8; bitset<N + 2> isprime; int prime[6000010]; int cnt; int n, q; int main() { scanf("%d%d", &n, &q); isprime.set(); for (int i = 2; i <= n; ++i) { if (isprime[i]) prime[++cnt] = i; for (int j = 1; j <= cnt && i...
ALGO
0.999914
3.364449
8835a835-955e-4c50-ba00-fc24e75db324
Shouree/storm-http-framework
Core/Search.cpp
#include "stdafx.h" #include "Search.h" namespace storm { template <class T> T bSearch(T from, T to, Fn<Bool, T> *predicate) { while (from < to) { T mid = (to - from) / 2 + from; if (predicate->call(mid)) { from = mid + 1; } else { to = mid; } } return from; } Int binarySearch(Int fro...
ALGO
0.999934
6.046922
e28871ce-7fa5-47ea-9cd0-7f4145a31e8a
codewithdivu/silver_touch_tasks
January/301 to 600/Oops_Programs/20.cpp
#include <iostream> using namespace std; template <int N> struct Factorial { static const int value = N * Factorial<N - 1>::value; }; template <> struct Factorial<0> { static const int value = 1; }; int main() { const int result = Factorial<5>::value; cout << "Factorial of 5: " << result << endl; ...
ALGO
0.999745
6.10574
48085e49-f56e-4e98-8993-b3209933db87
TaeseongMoon/kalman_test
kalman_filter.cpp
#include "kalman_filter.h" KalmanFilter::KalmanFilter(int state_dim, int measurement_dim) : state_dim_(state_dim), measurement_dim_(measurement_dim) {} void KalmanFilter::initialize(const Eigen::VectorXd& x0, const Eigen::MatrixXd& P0, const Eigen::MatrixXd& F, const Eigen::MatrixXd&...
ALGO
0.944133
6.858474
d69bba69-0f5b-4d51-a44c-9b86e0c54b9d
GsnMithra/leetcodes
0098-validate-binary-search-tree/0098-validate-binary-search-tree.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.999793
6.782329
60656ae1-8115-48ce-89e6-5de8b244949d
Asthavarshneyy/DSA
Implementation/MergeSort.cpp
#include <iostream> using namespace std; void merge(int *a, int *b, int *c, int s, int e) { int m = (s + e) / 2; int k = s, i = s, j = m + 1; while (i <= m and j <= e) { if (b[i] < c[j]) { a[k++] = b[i++]; } else { a[k++] = c[j++]; } } while (i <= m) { a[k++] = b[i++]; } while (j <= e) { a[k++] = c[j++]; } } void Merg...
ALGO
0.999962
4.696864
f1342d39-4265-48d7-a22f-e354bf9582be
akshay1027/Competative_programming
projecteuler.cpp/sumofdigits.cpp
#include<bits/stdc++.h> #define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) #define test int T; cin>>T; while(T--) #define ll long long #define G(x) ll x; cin >> x; #define vi vector<int> #define pb push_back #define mp make_pair #define mod 1000000007 #define MAX 1e9 #define MIN -1e9 using n...
ALGO
0.999354
3.396681
2ab6a687-6938-4dda-97eb-cde9c67c77b4
2105022580/DSA-WITH-C-
validpolindrom.cpp
#include<iostream> #include<cstring> using namespace std; bool ispolindrom(char str[],int n){ int st=0,end=n-1; while(st<end){ if(str[st++]!=str[end--]){ cout<<"not a polindrom\n"; return false; } else{ cout<<"it is a polindrom\n"; return ...
ALGO
0.998964
3.612804
1b08398d-30fa-4221-925f-745889b9c6a0
UV-Lab/autoRCcar_indoor
ros2/src/LIO-SAM_MID360_ROS2/src/featureExtraction.cpp
#include "utility.hpp" #include "lio_sam/msg/cloud_info.hpp" struct smoothness_t{ float value; size_t ind; }; struct by_value{ bool operator()(smoothness_t const &left, smoothness_t const &right) { return left.value < right.value; } }; class FeatureExtraction : public ParamServer { public...
DATA
0.963419
5.50713
ab14fff9-d0bb-445c-8c64-71c4bb206278
sikuner/book-code
Using the C++ Standard Template Libraries/Chapter 7/Ex7_01.cpp
// Ex7_01.cpp // Using the equal() algorithm #include <iostream> // For standard streams #include <vector> // For vector container #include <algorithm> // For equal() algorithm #include <iterator> ...
ALGO
0.992541
5.263674
ebfab2fd-c608-4e4e-a14e-7520de01e4e2
shantanu2002git/LEET-QS
179-largest-number/largest-number.cpp
class Solution { public: string largestNumber(vector<int>& arr) { int n = arr.size(); vector<string> si; for (int i = 0; i < n; i++) { si.push_back(to_string(arr[i])); } sort(si.begin(), si.end(), [](string a, string b) { return (a + b) > (b + a); })...
ALGO
0.999994
6.511341
f98ff718-a3ae-4b54-86ac-75068f227f2c
hushwa3/Data-Structures-HydrogenBomb
Array/1st Day/RAVELO_BinarySearch.cpp
#include <stdio.h> #define max 10 int BinarySearch(int find, int A[]); int main() { int A[max] = {1, 3, 5, 7, 11, 13, 19, 23, 29, 31}; int find, choice, j; printf("10 Initialized Integers: "); for (int i = 0; i < max; i++) { printf("%d ", A[i]); } do { printf("\nInput the Num...
ALGO
0.999838
5.141809
ef6fa65a-7315-4492-9227-afb7a335e2c1
csl-iisc/SUV-MICRO24
llvm/llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp
#include "lib/FileAnalysis.h" #include "lib/GraphBuilder.h" #include "llvm/BinaryFormat/ELF.h" #include "llvm/DebugInfo/Symbolize/SymbolizableModule.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Error.h" #include "llvm/Support/FormatVariadic.h" #include "llvm/Support/SpecialCaseList.h" #include "llvm...
TOOL
0.910592
7.057355
66d94a76-a9f3-4e24-947e-2c5df1b9d6ef
y123456yz/reading-and-annotate-mongodb-3.6
mongo/src/third_party/mozjs-45/extract/js/src/gc/Marking.cpp
#include "gc/Marking.h" #include "mozilla/DebugOnly.h" #include "mozilla/IntegerRange.h" #include "mozilla/ReentrancyGuard.h" #include "mozilla/ScopeExit.h" #include "mozilla/TypeTraits.h" #include "jsgc.h" #include "jsprf.h" #include "builtin/ModuleObject.h" #include "gc/GCInternals.h" #include "jit/IonCode.h" #inc...
TOOL
0.903328
7.256695
76fe1bd9-39dd-4940-8fc9-7874d5a2530d
gromacs/gromacs
api/nblib/gmxcalculatorcpu.cpp
/*! \internal \file * \brief Implements a force calculator based on GROMACS data structures. * * \author Victor Holanda <<EMAIL>> * \author Joe Jordan <<EMAIL>> * \author Prashanth Kanduri <<EMAIL>> * \author Sebastian Keller <<EMAIL>> */ #include "nblib/gmxcalculatorcpu.h" #include <algorithm> #include <iterat...
ALGO
0.999835
7.578092
7ec95508-3fff-4c71-bfcc-2f055d3cb941
priyanshu-21singh/competitive-programming
codeforce contest/11 feb/vanyaandfence.cpp
#include<iostream> using namespace std; int main(){ int n,h,a, count = 0; cin>>n>>h; for(int i = 0;i < n; i++) { cin>>a; if(a>h){ count+=2; }else{ count++; } } cout<<count<<endl; return 0; }
ALGO
0.999731
3.107862
c4e5f22c-8604-46af-bf0f-278f070862ce
hfinkel/llvm-project-cxxjit
llvm/utils/TableGen/InstrDocsEmitter.cpp
#include "CodeGenDAGPatterns.h" #include "CodeGenInstruction.h" #include "CodeGenTarget.h" #include "TableGenBackends.h" #include "llvm/TableGen/Record.h" #include <string> #include <vector> using namespace llvm; namespace llvm { void writeTitle(StringRef Str, raw_ostream &OS, char Kind = '-') { OS << std::string(...
TOOL
0.863785
7.477917
595dff4b-d703-47d0-9275-de84e06c95aa
DrewPartin/FlutterProjects
coffee_card/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.998593
6.76775
222f82b4-ef48-40a5-a8ec-e31f9abc788b
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_2864_11.cpp
#include <bits/stdc++.h> using namespace std; int n, q, i, a[100100], d[100100], l, r, s1[100100], s2[100100], k, j; long long ans; int main() { scanf("%d%d", &n, &q); for (i = 0; i < n; i++) scanf("%d", &a[i]); for (i = 1; i < n; i++) { d[i] = abs(a[i] - a[i - 1]); } d[n] = 2147483647; d[0] = 214748364...
ALGO
0.999909
3.654119
e7bb14ab-8dfd-4481-924d-7b8c5ea74ef3
MoyiHP/LeetCode
String/T459 重复的子字符串.cpp
#include <iostream> #include <string> #include <vector> using namespace std; class Solution { private: vector<int> getNext(string s) { vector<int> next(s.size()); next[0] = 0; for (int i = 1, j = 0; i < s.size(); i++) { while (j > 0 && s[j] != s[i]) { ...
ALGO
0.99978
5.460062
8182d004-e4f7-451d-abe5-6a9e1a0847b7
Aethereux/Hikari-LLVM19
mlir/lib/Tools/lsp-server-support/CompilationDatabase.cpp
#include "mlir/Tools/lsp-server-support/CompilationDatabase.h" #include "mlir/Support/FileUtilities.h" #include "mlir/Tools/lsp-server-support/Logging.h" #include "mlir/Tools/lsp-server-support/Protocol.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/YAMLTraits.h" using namesp...
TOOL
0.865988
7.966362
21dcf985-afcc-45e0-aab6-d9df6bc0a487
fabiomigueldp/CS_Algoritms
Lista09/FMDP-Alg-09-Ex-10.cpp
// Exercício 10: Um livro sem “e”. O romance “Gadsby”, de Ernest Vincent Wright, tem mais de 50.000 // palavras. Embora 50.000 palavras não sejam normalmente notáveis para um romance, neste caso é porque // nenhuma das palavras do livro usa a letra “e”. Isso é particularmente notável quando se considera que // "e" é...
ALGO
0.998607
6.373156
d8a2ccff-a356-47a8-a235-d6228791cb6b
AlinaGeorge/Algorithms-Lab
kruskals.cpp
#include <iostream> #include <climits> using namespace std; #define MAX_V 100 #define INF INT_MAX int parent[MAX_V], treeRank[MAX_V]; int find(int u) { if (parent[u] != u) { parent[u] = find(parent[u]); } return parent[u]; } void unionSet(int u, int v) { int root_u = find(u); int root_v ...
ALGO
0.999994
5.847401
f792f7e2-1f92-407d-867d-e3a6766962d2
KhushiRana2003/CRACK_INTERNSHIP
K Sum Paths.cpp
class Solution{ public: void solve(Node* root, int k, int &count, vector<int> path){ if(root==NULL) return; path.push_back(root->data); //adding value of current node value to vector // left call solve(root->left,k,count,path); // right call ...
ALGO
0.999977
6.113503
7872ba60-d597-497e-9acc-31607fccd767
Mystic-a/data_structures
frqdecsstr.cpp
#include <bits/stdc++.h> using namespace std; // Returns count of character in the string int countFrequency(string str, char ch) { int count = 0; for (int i = 0; i < str.length(); i++) if (str[i] == ch) ++count; return count; } // Function to sort the string according to the frequen...
ALGO
0.999938
6.206883
80f7e885-abb4-4e44-8b0d-a5e5d714fe37
xin3liang/platform_development
perftests/panorama/feature_mos/src/mosaic/Pyramid.cpp
// pyramid.cpp #include <stdio.h> #include <string.h> #include "Pyramid.h" // We allocate the entire pyramid into one contiguous storage. This makes // cleanup easier than fragmented stuff. In addition, we added a "pitch" // field, so pointer manipulation is much simpler when it would be faster. PyramidShort *Pyrami...
TOOL
0.983047
5.42671
7c9d85db-5487-4e4f-93bf-3bdb24646e5d
annaAlmeida09/C02
funções/oprofessorassustador.cpp
#include <iostream> #include <iomanip> using namespace std; float media(int notas[], int nAlunos){ float med = 0; for(int i=0; i < nAlunos; i++) { cin >> notas[i]; } for(int i = 0; i < nAlunos; i++) { med += notas[i]; } med = med/nAlunos; re...
ALGO
0.981295
4.199815
6da11e42-a17f-47f4-8d81-2bbf391e4ccc
AadeshPochhi/Leetcode-Problems
0983-minimum-cost-for-tickets/0983-minimum-cost-for-tickets.cpp
class Solution { public: int solve_using_recursion(vector<int>& days, vector<int>& costs,int i){ if(i>=days.size()) return 0; int c1=costs[0]+solve_using_recursion(days,costs,i+1); int lastDay=days[i]+6; int j=i; while(j<days.size() && days[j]<=lastDay) j++; int c7=co...
ALGO
0.999738
5.40527
94af547d-0dd2-40e9-aadc-579bb1ef314c
Ningluosi/15-445
src/primer/hyperloglog_presto.cpp
#include "primer/hyperloglog_presto.h" namespace bustub { template <typename KeyType> HyperLogLogPresto<KeyType>::HyperLogLogPresto(int16_t n_leading_bits) : cardinality_(0), leadingbits_(n_leading_bits) { try { if (n_leading_bits <= 0 || n_leading_bits >= 64) { throw std::invalid_argument("n_leading_bits...
ALGO
0.955613
6.011825
91c1f604-b9bc-41e7-85de-b1d6a9bd0f97
subarnasaikia/Problem-Solving
contests/codeforces/cf_958/tcOfC.cpp
#include <bits/stdc++.h> using namespace std; // #include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; void fastio(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } #define ll long long typedef vector<int> vi; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typ...
ALGO
0.999855
4.600907
195c4b6f-d977-4358-86ab-e44e8771cf1a
iharshwadhwa/cpp-programs
Programs/SumUntilX.cpp
#include <iostream> #include <string> using namespace std; // TODO: Add float input support // FIXME: Handle negative numbers // NOTE: This is Question 5 from the assignment // Function to check if the string is a valid positive number bool isNumber(const string& str) { for (char c : str) { if (!isdigit(c...
ALGO
0.943886
5.153725
b8079a7c-4604-442f-b4af-f60cd4b4e009
sarthakgadekar/marvellous
C language/RECURSION/Assignment 37/program3.cpp
#include<iostream> using namespace std; void Display(int iValue) { if(iValue!=0) { cout<<iValue<<" "; iValue--; Display(iValue); } } int main() { int iValue=0; cout<<"\nEnter value : "; cin>>iValue; Display(iValue); return 0; }
ALGO
0.999899
3.778435
16f2d1cb-adfd-4908-97dc-52768137df2e
NFAsylum/Cpp
Essencials/Part1/MathFunctions.cpp
#include <iostream> #include <cmath> using namespace std; int main(){ cout << pow(3, 3) << endl; cout << sqrt(9) << endl; cout << round(12.0234) << endl; cout << ceil(6.1) << endl; cout << floor(6.9) << endl; cout << fmax(10, 100) << endl; cout << fmin(10, 100) << endl; return 0; }
ALGO
0.971364
3.238247