uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
05c48345-0399-4c58-b1d6-9cd24f3d1b76
r930709/frameworks_av
media/libstagefright/codecs/amrnb/dec/src/agc.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/agc.c Funtions: energy_old energy_new agc_init agc_reset agc_exit agc agc2 -------------------------------------------------------------...
ALGO
0.999305
5.192862
f9cec0a9-5b63-4641-a169-89d56eb20fbe
ishandutta2007/codeforces
mohammedehab2002/normal/520/B.cpp
#include <iostream> #include <queue> using namespace std; bool vis[20005]; int main() { int n,m,ans=(1<<20); cin >> n >> m; queue<pair<int,int> > q; q.push({n,0}); while (!q.empty()) { int i=q.front().first,l=q.front().second; q.pop(); if (i<0 || vis[i]) continue; vis[i]=1; if (i>m) { ans=min(ans...
ALGO
0.999987
3.314426
750a287f-f4a2-42a8-9c3e-c8966f856ce9
nayeem-bd/Online-Judge-Solutions
Light OJ/1010 - Knights in Chessboard.cpp
#include<stdio.h> int main() { int i,t,m,n,cnt,k; scanf("%d",&t); for(i=1;i<=t;i++){ scanf("%d %d",&n,&m); if(n==1 || m==1) cnt = m*n; else if(n==2 || m==2) { if(n==2) k = m; else k = n; if(k%4 == 0) cnt = k; else if(k%4 ...
ALGO
0.999729
4.145207
f5cfa594-76bb-4f7f-b1e1-6c4c5621c38f
sunilbhara/competitive_coding
remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.cpp
class Solution { public: int removeDuplicates(vector<int>& nums) { for(int i=0;i<nums.size()-1;i++) { if(nums[i]==nums[i+1]) { nums.erase(nums.begin()+i); i--; } } int res = nums.size(); return res; } };
ALGO
0.99982
6.264026
8c2239e8-3cff-4e06-bd3d-3492463f066f
tanmoy4171/LeetCode
299-bulls-and-cows/299-bulls-and-cows.cpp
class Solution { public: string getHint(string secret, string guess) { int mp1[10] = {0}; int mp2[10] = {0}; int bull=0,cow=0; for(int i=0;i<secret.length();i++) { if(secret[i]==guess[i]) { bull++; } else { mp1[secret[i]-'0']++; ...
ALGO
0.999954
6.430594
bea5c51e-cd5d-4eb6-81df-b85602f1e572
GEORGE21784/Competitive-Programming
CodeForces/763A - Timofey and a tree.cpp
// gerogeVT #include <bits/stdc++.h> #define int long long #define sz(x) (int)x.size() #define fi first #define se second using namespace std; typedef pair<int, int> ii; const int inf = (int)1e18; const int MAX = (int)1e5+7; int n; vector<int> t[MAX]; int c[MAX], sz_sub[MAX]; int parent[MAX]; int c_sub[MAX]; // respe...
ALGO
0.999979
3.773876
78851e06-22ea-4ade-8f4a-3fb2aa784345
mswat5/DSAclass
div3916/905div3/b.cpp
#include <algorithm> #include <string> #include <cstring> #include <map> #include <set> #include <vector> #include <iostream> #include <queue> #include <cmath> #include <ctime> //#include <bit/stdc++.h> using namespace std; typedef long long ll; #define fl(i, n) for (int i = 0; i < n; i++) #define fl1(i, n) for (int ...
ALGO
0.999954
3.916343
a6e80652-43ac-42c8-b1a6-ba8f74e49516
alexvelea/competitive
infoarena/lumanari/lumanari4.cpp
#include <cstdio> #include <algorithm> #include <iostream> using namespace std; const int INF=0x3f3f3f3f, max_n=200005; int El[max_n], Last[max_n]; long long Sum[max_n]; int n,a,i; int main(){ freopen("lumanari.in","r",stdin); freopen("lumanari.out","w",stdout); scanf("%d", &n ); for( i=1; i<=n; ++i ){ scanf("...
ALGO
0.999969
3.631987
5be71068-068f-4fe3-aca8-0d53b652c22e
c834606877/llvm-project
polly/lib/Transform/MaximalStaticExpansion.cpp
#include "polly/DependenceInfo.h" #include "polly/LinkAllPasses.h" #include "polly/ScopInfo.h" #include "polly/ScopPass.h" #include "polly/Support/ISLTools.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/StringRef.h" #include "llvm/Analysis/OptimizationRemarkEmitter.h" #include "llvm/InitializePasses.h" #includ...
ALGO
0.95192
7.83728
7d97eb4f-f2dd-4698-9320-faa6c6abb4d9
Yaro2709/AlgoProblems
6/1104A.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; cout << n << endl; while (--n) cout << "1 "; cout << "1" << endl; return 0; }
ALGO
0.999884
3.495178
f8c9af33-2d9f-4531-b6f3-e23d0874eb46
Ankitverma3507/DSA-CN
12Backtracking/4sudokusolver.cpp
#include <bits/stdc++.h> #include<vector> using namespace std; bool isSafe(int row, int col,vector<vector<int>>& board, int val, int n) { for(int i=0; i<n ;i++) { // checking for row if(board[row][i]==val) return false; //cehcking for column if(board[i][col]==val) ...
ALGO
0.999649
5.783216
d1c5f7bf-6276-4121-b0fd-4d3063eb7338
hma40/Cpp-Competitive-Programming
Codeforces/1983/D.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define add push_back #define FOR(i,a,b) for (int i = (a); i < (b); ++i) #define F0R(i,a) FOR(i,0,a) #define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i) #define R0F(i,a) ROF(i,0,a) #define f first #define s second #define trav(a,x) for (auto& a: x) ...
ALGO
0.999982
4.061649
a37d241c-dc07-4033-a916-fc4959047ebd
yeohj0710/old-solutions
11000s/11410.cpp
#include <cstdio> #include <vector> #include <queue> #include <algorithm> #define MAX 55 #define INF 100000000000 using namespace std; struct Edge { int Next, Capacity, Cost, Flow; Edge* Rev; Edge(int Next_, int Capacity_, int Cost_) : Next(Next_), Capacity(Capacity_), Cost(Cost_), Flow(0) {} int Remai...
ALGO
0.999646
3.48296
16a1744d-7078-4b47-b305-6fcace8d7266
thakur24/hello-world
C++/Pattern_Print_Codes/pattern5.cpp
#include <iostream> using namespace std; /* Following code prints the following binary pattern as per giver n INPUT: n = 3 OUTPUT: ABCCBA ABBA AA INPUT: n = 4 OUTPUT: ABCDDCBA ABCCBA ABBA AA */ //function to print the pattern void printPatt(int n) { int i,k,x; char ph; k = n +...
ALGO
0.999913
4.644478
eabbae6d-dcbe-4de6-b81d-b2d0bd69a73c
NikomSol/Ya-Belts
Yellow/4 week/Tasks/3.Split into words.cpp
#include <vector> #include <string> #include <iostream> #include <algorithm> using namespace std; vector<string> SplitIntoWords(const string& s) { vector<string> result; auto start = s.begin(); while (start != s.end()) { auto stop = find(next(start), s.end(), ' '); result.push_back({next...
ALGO
0.991106
4.092715
d7c4aaf3-f52e-4449-85f2-5fc79af753a2
mvitz933/HPC_frameworks
eigen/src/solve.cpp
#include <Eigen/Dense> #include <stdexcept> #include <vector> // Solve Ax = b using LU decomposition with Eigen void solve_linear_system_with_lu(const Eigen::MatrixXd& A, const Eigen::VectorXd& b, Eigen::VectorXd& x) { // Ensure matrix A is square and compatible with vector b if (A.rows() != A.cols() || A.rows...
ALGO
0.998032
5.983002
eb51d6a3-2483-4d48-9d98-7462ea872d84
nikita-go/arm-raytracer
src/core/camera.cpp
#include "core/camera.h" // Camera constructor: sets up viewport and lens Camera::Camera(Vec3 lookfrom, Vec3 lookat, Vec3 vup, float vfov, float aspect, float aperture, float focus_dist) { lens_radius = aperture / 2; float theta = vfov * M_PI / 180; // Convert vfov to radians float half_height = tan(theta ...
TOOL
0.941545
6.111991
b062019b-80ea-4af3-8777-ca6d2f196569
DavidPH/DH-acc
src/SourceExpression/BinaryIOr.cpp
#include "Binary.hpp" #include "../ObjectExpression.hpp" #include "../ObjectVector.hpp" #include "../SourceException.hpp" #include "../VariableData.hpp" #include "../VariableType.hpp" //----------------------------------------------------------------------------| // Types ...
TOOL
0.935085
7.535286
9c94c5f7-dd99-420b-be57-2aaa6d7559f9
chirag23177/DSA-Qurestions
0133-clone-graph/0133-clone-graph.cpp
/* // Definition for a Node. class Node { public: int val; vector<Node*> neighbors; Node() { val = 0; neighbors = vector<Node*>(); } Node(int _val) { val = _val; neighbors = vector<Node*>(); } Node(int _val, vector<Node*> _neighbors) { val = _val; ...
ALGO
0.999909
6.268147
18f5e842-e680-4d84-81d3-b780ba408420
hosenarafat/Codeforces-Problems-Solution
1382C2.cpp
#include<bits/stdc++.h> #include<stdio.h> #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") using namespace std; #define ll long long #define scl(n) scanf("%lld",&n) #define scll(n, m) scanf("%lld%lld",&n, &m) #define scc(c) scanf("%c",&c) #define fr(i,...
ALGO
0.999923
3.192171
57306ddf-ba80-46e6-b254-fbcdff9c0960
Chenpi-Sakura/algorithm_practice
cpp/DSATraining/Semester1B-Vacation/Daily/1stWeek/P1347.cpp
#include <bits/stdc++.h> using namespace std; #define int long long typedef pair<int, int> PII; const int N = 30; const int M = 1e9 + 7; const int inf = 0x3f3f3f3f; vector<int> g[N]; set<int> ns; int din[N], d[N], a[N]; int n; bool topo(int step) { memcpy(d, din, sizeof(din)); queue<int> q; string ans; ...
ALGO
0.999965
5.410052
7445ebb4-54b9-4f5c-a4df-69179f8c01ae
ashokabairwaideology/Leet-code-problem
solution/2800-2899/2813.Maximum Elegance of a K-Length Subsequence/Solution.cpp
class Solution { public: long long findMaximumElegance(vector<vector<int>>& items, int k) { sort(items.begin(), items.end(), [](const vector<int>& a, const vector<int>& b) { return a[0] > b[0]; }); long long tot = 0; unordered_set<int> vis; stack<int> dup; ...
ALGO
0.999932
5.569098
1bbe4b6d-ac4f-4045-b80f-6f6608a10298
tanmayysain/Cpp
DynamicProgramming/GetMaxOfArray.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; vector<int>dp(n+1,-1); int maxi=0; if(n==0||n==1) cout<<n<<endl; dp[0]=0; dp[1]=1; for(int i=2;i<=n;i++){ if(i%2){ dp[i]=dp[i/2]+dp[i/2+1]; } else dp[i]=dp...
ALGO
0.999997
4.708957
bcf93f3c-81bc-4e8f-bbf0-00a27723d8f5
robot-Yang/Ewenwan_vision
opencv_app/Basic/image_Processing/laplacian.cpp
/* Laplacian 算子 的离散模拟。 图像二阶倒数 梯度的梯度 0值的话 边缘概率较大 Sobel 算子 ,其基础来自于一个事实,即在边缘部分,像素值出现”跳跃“或者较大的变化。 如果在此边缘部分求取一阶导数,你会看到极值的出现。 你会发现在一阶导数的极值位置,二阶导数为0。 所以我们也可以用这个特点来作为检测图像边缘的方法。 但是, 二阶导数的0值不仅仅出现在边缘(它们也可能出现在无意义的位置), 但是我们可以过滤掉这些点。 Laplacian 算子 从以上分析中,我们推论二阶导数可以用来 检测边缘 。 因为图像是 “2维”, 我们需要在两个方向求导。使用Laplacian算子将会使求导过程变...
ALGO
0.981334
5.345376
4d0d43c1-6036-4209-8dce-62fff1002f7d
BAFBFT/DSA-with-Cpp
Functions.cpp
#include <iostream> using namespace std; int add(int a, int b) { int c; c = a + b; return c; } int main() { int num1 = 10, num2 = 15, sum; sum=add(num1, num2); cout<<"Sum is "<<sum<<endl; return 0; }
TOOL
0.997459
4.578351
099cb483-f110-41ff-b0bc-31a4d84185de
DanilishinArtem/neetcode
binarySearch/cppRealizations/searcha2DMatrix.cpp
#include <iostream> #include <vector> #include <stack> using namespace std; class Solution { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { int ROWS = matrix.size(); int COLS = matrix[0].size(); int top = 0; int bot = ROWS - 1; while(top <= bot){ ...
ALGO
0.999957
6.083249
4cf4206a-cd91-4703-bd5e-74b10eafb977
yish0000/leetcode_exercise
LeetCode/MergeKSortedLists.cpp
#include "TestCase.h" #include "LinkedListCommon.h" using namespace std; class SolutionMergeKSortedLists : public LinkedListCommon { public: ListNode* mergeKLists(vector<ListNode*>& lists) { if (lists.empty()) return NULL; while(lists.size() > 1) { int count = (int)lists.size()...
TEST
0.991558
5.761818
cd093852-a3fe-4815-aaca-f5b53963662b
sachinkumarS-K/Cpp
Easy/27.numberPattern.cpp
#include<iostream> using namespace std; int main(){ int row , sum = 1; cout << "Enter the no of rows "; cin >> row; for (int i = 1; i <= row; i++){ for (int j = 1; j <= i; j++) cout << sum++ << " "; cout << endl; } return 0; }
ALGO
0.998887
3.937583
9af6e5da-d695-4ae5-adef-b304f8775b53
gkichaev/PAINTOR_V2.1
eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; int main() { Eigen::MatrixXf mat(2,4); mat << 1, 2, 6, 9, 3, 1, 7, 2; std::cout << "Row's maximum: " << std::endl << mat.rowwise().maxCoeff() << std::endl; }
ALGO
0.99969
3.881483
e9dedd4d-9d0a-4f23-8063-23d66bad30a6
physicalist/ncbs-moose
moose/branches/async_multiscale_cmake/device/RC.cpp
// RC.cpp --- // // Filename: RC.cpp // Description: // Author: subhasis ray // Maintainer: // Created: Wed Dec 31 15:47:45 2008 (+0530) // Version: // Last-Updated: Tue Jun 11 17:01:03 2013 (+0530) // By: subha // Update #: 247 // URL: // Keywords: // Compatibility: // // // Commentary: // /...
ALGO
0.950445
5.631346
0a624739-ff96-409c-8425-fe28ad0a01b4
harleyham/H1
doc/tutorials/content/sources/conditional_euclidean_clustering/conditional_euclidean_clustering.cpp
#include <pcl/point_types.h> #include <pcl/io/pcd_io.h> #include <pcl/console/time.h> #include <pcl/filters/voxel_grid.h> #include <pcl/features/normal_3d.h> #include <pcl/segmentation/conditional_euclidean_clustering.h> typedef pcl::PointXYZI PointTypeIO; typedef pcl::PointXYZINormal PointTypeFull; bool enforceInte...
ALGO
0.950409
6.774424
ffbb023f-aaa9-44e1-97c8-8cd99d346060
hank891008/LeetCode
0215-kth-largest-element-in-an-array/0215-kth-largest-element-in-an-array.cpp
class Solution { public: int solve(vector<int>& nums, int k){ int p = nums[rand() % nums.size()]; vector<int>l, m, r; for(int i = 0; i < nums.size(); i++){ if(nums[i] > p){ l.emplace_back(nums[i]); } else if(nums[i] == p){ m...
ALGO
0.999975
5.093278
c53bce33-a4a5-4b4c-ba39-9c92c959251d
Mosina916/April23_CPP
Rec2/sumofele.cpp
#include<iostream> using namespace std; int sum1(int arr[],int n){ // base case if(n==0){ return 0; } // rec case // return isarraysorted1(arr+1,n-1) and arr[0]<=arr[1]; return arr[0]+sum1(arr+1,n-1); } int sum2(int arr[],int n){ //4 // base case if(n==0){ return 0; } // return n==1; // rec case // r...
ALGO
0.999933
4.617513
761c1ec5-a1bc-4028-9af9-c2a038c0a6a5
rapidswap/algorithm-study
기타/영어끝말잇기.cpp
#include <string> #include <vector> #include <iostream> #include <queue> #include<algorithm> using namespace std; vector<int> solution(int n, vector<string> words) { vector<int> answer; queue<string> q; int cnt=0; int allcnt=1; for(auto str : words){ if(q.empty()){ q.push(str);...
ALGO
0.999854
4.706892
9fe5aa8f-a576-4031-8aea-e1790f95b111
YehoanatnEzra/System_Level_Projects
User-Level Thread Management Library/Tests/jona4.cpp
/********************************************** * Test 429: Compute the N'th catalan number using * multiple threads. * (+random calls to uthreads functions) * **********************************************/ /* * recall that the n'th catalan number is * * n * _______...
ALGO
0.995578
5.753697
5c34d695-2b0e-4fe4-ab94-7c3a1279b1a9
bienhuynh/Big-Numbers
Spil/Chess/BackMoveGenerator.cpp
#include "stdafx.h" #ifdef TABLEBASE_BUILDER class BackMoveGenerator : public MoveGenerator { private: static FieldSet m_knightAttacks[64], m_pawnAttacks[2][64]; static const FieldSet rank1, rank8, fileA, fileH; static bool fieldSetsInitialized; static void initFieldSets(); static const FieldSet *promoteFi...
ALGO
0.990878
5.442705
c0797193-e3b5-4e5a-bb02-fb174dcfcd69
pragya644/Leetcode-Questions
Minimum Spanning Tree - GFG/minimum-spanning-tree.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function to find sum of weights of edges of the Minimum Spanning Tree. int spanningTree(int V, vector<vector<int>> adj[]) { vector<int> weight(V,INT_MAX); vector<bool> curre...
ALGO
0.999984
5.80036
e5a065be-7d56-4777-babd-918f38e81e4f
bhaveshgarg2000/LeetCode-GFG-DailyChallenge
January 2024/232.cpp
#include <bits/stdc++.h> class MyQueue { public: stack<int> S1; stack<int> S2; MyQueue() { } void push(int x) { while (!S1.empty()) { S2.push(S1.top()); S1.pop(); } S2.push(x); while (!S2.empty()) { S1.push(...
ALGO
0.997912
4.736412
45acd748-237b-475a-9031-f1e680762ccc
azecoder/Problem-Solving
E-olimp/130. Rectangle .cpp
#include <stdio.h> #include <stdlib.h> double X1,Y1,X2,Y2,X3,Y3,Y4,X4,a,b,d1,m,n,t,q,g,s; int main(int argc, char *argv[]) { scanf("%lf%lf%lf%lf%lf%lf",&X1,&Y1,&X2,&Y2,&X3,&Y3); a=((X2-X1)*(X2-X1)+(Y2-Y1)*(Y2-Y1)); b=((X2-X3)*(X2-X3)+(Y2-Y3)*(Y2-Y3)); d1=((X3-X1)*(X3-X1)+(Y3-Y1)*(Y3-Y1)); m=X1+X3-X...
ALGO
0.999841
3.250665
821b0ecf-74df-49aa-8a37-b62bc5e6d926
tatusamel/HUPROG22Junior
Numan Kafadar/week4/q2.cpp
#include <iostream> using namespace std; /* Time complexity is O(1).There is no any loop operation or recursion.It is constant time . */ int main(){ int numberOFCases;cin>>numberOFCases; for(int i=0;i<numberOFCases;i++){ int a,b;cin>>a>>b; int remainder=a%b; int v1=a-remainder; ...
ALGO
0.999936
4.319313
d1823b85-6ac9-4a71-b01e-f423b94d05c8
alexaoh/procAndOOP
Oving1/main.cpp
#include "Simple_window.h" int maxOfTwo(int a, int b){ if (a>b){ cout << "A is greater than B" << '\n'; return a; } else { cout << "B is greater than or equal to A" << '\n'; return b; } } int fibonacci(int n){ int a = 0; int b = 1; cout << "Fibonacci numbers:" << '\n'; for (int x = 1; x < n + 1; x++){...
ALGO
0.974552
3.906836
315f0fd7-9523-4c22-9ecc-3febf37f5b7f
m4oughi/100DaysofCode
pureCPP/0033. Day 33/Multithreading Basics/006. Concurrency and Parallelism/002. Parallel Task Execution with stdasync/main.cpp
#include <iostream> #include <future> int task1() { std::this_thread::sleep_for(std::chrono::seconds(1)); std::cout << "Task 1 completed!" << std::endl; return 1; } int task2() { std::this_thread::sleep_for(std::chrono::seconds(1)); std::cout << "Task 2 completed!" << std::endl; return 2; } i...
TOOL
0.867629
5.916457
7c49659a-1b21-40f5-aee6-773ccd3982da
Rishabh-Chandrode/SDE-Sheet
01. Arrays/6.Best Time to Buy and Sell Stock.cpp
class Solution { public: int maxProfit(vector<int>& prices) { int min=INT_MAX,profit=0,maxprofit=0; for(int i=0;i<prices.size();i++){ if(min>prices[i]) min=prices[i]; profit=prices[i]-min; if(profit>maxprofit) maxprofit = profit; } return maxprofi...
ALGO
0.998557
6.086055
3acaa01a-e0cc-4c92-bca1-16e4ab6b6662
cielavenir/procon
tyama_PG110402-UVa120.cpp
//tyama070515flapjacks.cpp //^Yz1hD()STLgĂ܂UI͂̒xłw //ςgтŏ\[X͉w #include <vector> #include <stdio.h> #include <stdlib.h> #include <string.h> #define digit(n) ('0'<=(n)&&(n)<='9') using namespace std; void flip(char **array,char **sort,int siz,int n){ int i(0);char *p; for(;i<n;i++) (*sort)[i]=(*array)[i]; for(;i<siz;...
ALGO
0.999935
3.522774
f9fb2627-9455-431a-b144-3845986c0a2b
alexandraback/datacollection
solutions_2645486_0/C++/Kawazoe/2013-1-B.cpp
#include <stdio.h> #include <cstdlib> #include <string.h> #include <math.h> #include <string> #include <vector> #include <list> #include <set> #include <iostream> #include <fstream> #include <map> #include <algorithm> #include "windows.h" //#include "../../gmp_int.h" //#include "../../common.h" #define MAX(a, b) ((a)>...
ALGO
0.999951
3.17435
8281b95c-2d91-4e67-a8c4-08f65db4b27b
ZhouZiyuIan/OI-Code
OI Documents/Public Code/2025.5sx/七年级34班胡子涵/goof.cpp
#include<bits/stdc++.h> using namespace std; int q; int cnt,de; string t; vector<char>del; struct td{ int cnt; char id; }sum[26]; bool cmp(td x,td y) { return x.cnt<y.cnt; } int main() { freopen("goof.in","r",stdin); freopen("goof.out","w",stdout); cin>>t; cin>>q; int siz=t.size(); for(int i=0;i<siz;i++) { ...
ALGO
0.999994
3.517182
6df20f0f-b0de-4391-96aa-5fe7d2be1f54
JyuKSIR/CP_stuffs
Graph,Tree/Traversal/bellman_ford.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; vector<array<int,3>> g; int dis[n]; const int inf = 1e9+10; for(int i=0; i<n; i++){ dis[i] = inf; } for(int i=0; i<m; i++){ int u,v,w; cin >> u >> v >> w; u--,v--; g.push_bac...
ALGO
0.999962
4.740971
77f20eea-e2de-4653-9969-18ae6ca10062
hal-uw/gpu_variability_sc22_artifact
sec5c_lammps/lib/kokkos/example/fixture/Main.cpp
#include <utility> #include <iostream> #include <Kokkos_Core.hpp> #include <BoxElemPart.hpp> namespace Kokkos { namespace Example { template< class > void test_fixture(); } } int test_box( const size_t global_size , const size_t global_box[][2] , const bool print_verbose ) { size_t global_...
TEST
0.87262
5.995766
c8571aa7-7cd6-4cf1-bbfa-53e70ac3f24d
meganthkumaark/Leetcode_Solutions
0056-merge-intervals/0056-merge-intervals.cpp
class Solution { public: vector<vector<int>> merge(vector<vector<int>>& intervals) { if (intervals.empty()) { return {}; } sort(intervals.begin(), intervals.end(), [](const vector<int>& a, const vector<int>& b) { return a[0] < b[0]; }); vector<vector<i...
ALGO
0.999998
6.417926
78cf5baa-68de-4bbe-bfb8-302bed6400be
seongjinkime/problem-solving
math/달팽이는올라가고싶다/solution.cpp
#include <iostream> using namespace std; int main(int argc, const char * argv[]) { int a,b,v; cin>>a>>b>>v; int day; day = (v-a)/(a-b); if((v-a)%(a-b) != 0) day++; day+=1; cout<<day<<endl; return 0; }
ALGO
0.999918
3.168704
1af8d304-5684-42ea-b5ac-86521bf35596
C-2024-4-6/8209240405sunyuqi
208.cpp
#include<iostream> #include<cmath> using namespace std; double jdz(double x) { double h; if (x >= 0) { h = x; } else { h = -x; } return h; } int quzf(double x) { if (x >= 0) { return 1; } else { return -1; } } int main() { double a = 0; cout << "aֵ" << endl; cin >> a; double x = 1; x = (1.0 ...
ALGO
0.999986
3.316796
a0972241-9505-4377-8a59-7c1735a50dcc
atletisimo/C
obraten.cpp
#include<stdio.h> int main(){ int n,reverse=0; scanf("%d",&n); while(n){ int lastDigit=n%10; reverse=10*reverse+lastDigit; n/=10; } }
ALGO
0.999868
3.993614
423a1c80-5560-491e-a6b3-456501f76d28
abhikdas7421/Leet-Code
1991-find-the-middle-index-in-array/1991-find-the-middle-index-in-array.cpp
class Solution { public: int findMiddleIndex(vector<int>& nums) { int n = nums.size(); vector<int> pre(n, 0); vector<int> post(n, 0); for(int i = 1; i < n; i++) { pre[i] = pre[i-1] + nums[i-1]; } for(int i = n-2; i >= 0; i--) { ...
ALGO
0.999983
6.163101
71a6ce4d-82cf-4ac2-9168-6682cc6cfdc1
Ashish-0211/Leetcode
744-find-smallest-letter-greater-than-target/744-find-smallest-letter-greater-than-target.cpp
class Solution { public: char nextGreatestLetter(vector<char>& letters, char target) { int size = letters.size(); int low = 0,high = size; while(low<high) { int mid = (low+high)/2; if(letters[mid]<=target)low = mid+1; else high = mid; } ...
ALGO
0.999699
5.863302
ef79ec2d-3767-4522-9496-edc9637a5635
sarvex/leetcode-pharo
solution/0600-0699/0662.Maximum Width of Binary Tree/Solution.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.999916
6.215791
4afcab78-6d26-4331-a756-fff1b1b337a3
opensource-hisense/SmartTV-SeriesVidaaU7_NT
oss/part1/cobalt/third_party/llvm-project/lldb/packages/Python/lldbsuite/test/lang/cpp/chained-calls/main.cpp
class Bool { public: Bool operator&(const Bool other) { Bool result; result.value = value && other.value; return result; } bool value; }; bool get(Bool object) { return object.value; } Bool set(bool value) { Bool result; result.value = value; return result; } ...
TOOL
0.916263
5.240546
17417e43-2682-4403-b14a-eec88087b837
farmpiggie/competitive-programming
codeforces/1934/d1.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long void run() { ll n, m; cin >> n >> m; ll a = 0, b = 0; for (ll i = (1ll << 62); i > 0; i >>= 1) { if (i & n) { if (!a) a = i; else if (!b) b = i; } } bool works = (b && ((m & a) || (m < b * 2))); if (!works) { cout << "-1\n"; retu...
ALGO
0.999318
3.621908
57635ba6-d1ec-4c7e-8a14-498690face7c
suankun/cpp_snippets
Codewars/7kyu/01.Basic, conditional, loops/Highest power of 2 that evenly divides a number.cpp
// https://www.codewars.com/kata/58dabca7ce77a12dbd00000f/train/cpp #include <iostream> using namespace std; unsigned long long solution ( unsigned long long n ) { unsigned long long num=1; while (n%num==0) { num*=2; } return num/2; } int main() { cout << solution(123) << endl; ...
ALGO
0.999833
5.874245
865739f1-8a48-426e-b4f7-d183db206f74
seifeldinshadyy/algorthim-Assignment-2
task3.cpp
#include <bits/stdc++.h> using namespace std; // ********************************************************************************************************************* // Problem 3 A ********************************************************************************************************* // ****************************...
ALGO
0.999907
4.478825
597bc723-015b-4e6b-b3a1-b13c8490792b
aadarshraj4321/DSA-CP-Practice-2022
ds-algo-question/array-questions/find_peak_element.cpp
#include<bits/stdc++.h> int findPeakElementBrute(std::vector<int>arr) { for(int i = 0; i < arr.size(); i++) { if((i == 0 || arr[i] > arr[i - 1]) && i == arr.size() - 1 || arr[i] > arr[i + 1]) return i; } return -1; } int findPeakElementOptimal(std::vector<int>arr) { if(arr.size() == 1) return 0; if(arr[0] > a...
ALGO
0.999871
4.930035
d240118c-b5e9-497d-9101-7f0b763954f5
millaker/MiGPU-llvm-project
mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
#include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/Dialect/Arith/Utils/Utils.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/...
ALGO
0.963047
7.439622
c8913188-9fc5-40e1-8803-1795c386ed16
fatimasayyed123/SD_ASSIGNMENT1
SD2.cpp
#include<iostream> using namespace std; #define MAX 100 class TBTnode { public : int data,lflag,rflag; TBTnode *lchild,*rchild; }; class TBT { private : TBTnode *root,*header; public : TBT() { root = NULL; header = NULL; } void menu(); TBTnode * getnode(); TBTnode * getnode1(); ...
ALGO
0.999861
3.807554
d8dba7a8-22ce-46eb-b836-1257461dd7c4
exponentialcherub/VisualSSS
eigen-eigen-b3f3d4950030/unsupported/doc/examples/MatrixSinh.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; int main() { MatrixXf A = MatrixXf::Random(3,3); std::cout << "A = \n" << A << "\n\n"; MatrixXf sinhA = A.sinh(); std::cout << "sinh(A) = \n" << sinhA << "\n\n"; MatrixXf coshA = A.cosh(); std::cout << "cosh(A) = \n"...
ALGO
0.994359
5.890235
9d91da70-bf54-4cf2-b917-dc14749585fe
ahnayef/Code-Practice
Codes/CF/1807B.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n, totalEven = 0, totalOdd = 0; cin >> n; int *arr = new int[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } for (int i = 0; i < n; ...
ALGO
0.999835
5.597207
4529e3a1-01aa-48ba-aa58-8516e7c82420
AUVSL/rgator
ros_drivers/jsk_rviz/jsk_recoginition/jsk_recognition_utils/src/pcl/ear_clipping_patched.cpp
// -*- mode: c++ -*- #include "jsk_recognition_utils/pcl/ear_clipping_patched.h" #include <pcl/surface/ear_clipping.h> #include <pcl/conversions.h> #include <pcl/pcl_config.h> ///////////////////////////////////////////////////////////////////////////////////////////// bool pcl::EarClippingPatched::initCompute () { ...
ALGO
0.990333
7.434207
0448f446-46b1-42bd-9f8e-baf3069ce6a3
Sumu154/Data_Structure
G_Stack/1.stack_static.cpp
#include<bits/stdc++.h> using namespace std; const int MAX_SIZE = 500; class Stack{ public: int a[MAX_SIZE]; int size; Stack() { size = 0; } void top() { if(size == 0) { cout << "Stack is empty\n"; return; } cout << a[size-1...
ALGO
0.97504
4.29307
7793a10a-4a34-4afe-803f-2080ab5b9336
FujiwaraNaoto/atcoder1
library/scc.cpp
/* strongly connected component */ #include<iostream> #include<vector> #include<algorithm> /* 後の頂点であればあるほど,強連結成分の番号が小さい */ class SCC{ //後の頂点であればあるほど,強連結成分の番号が小さい private: //SCC int V,M;//頂点と辺数 std::vector<std::vector<int>> G,rG; std::vector<bool> used; std::vector<int...
ALGO
0.999943
5.366049
9d04a725-d3a6-4463-b9dc-bed7b865f640
buraksaribas/c-plus-plus_primer
ch13/e13-28.cpp
#include <iostream> #include <string> using namespace std; #include <string> using std::string; class TreeNode { public: TreeNode() : value(string()), count(new int(1)), left(nullptr), right(nullptr) { } TreeNode(const TreeNode &rhs) : value(rhs.value), count(rhs.count), left(rhs.left), right(rhs.ri...
ALGO
0.99298
3.767791
a2aa2ffc-e93f-474e-b8e7-c08a4ff65511
bayashi-cl/procon-submission
atcoder/abc035/abc035_a/24258249.cpp
#include <atcoder/math> #include <atcoder/modint> #include <boost/range/irange.hpp> #include <cmath> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <valarray> #include <vector> na...
ALGO
0.999305
5.330545
b6123b6b-8e6b-454e-9554-a1ac1005debd
bXi/olc-codejam-2023
libs/json/tests/thirdparty/Fuzzer/FuzzerMerge.cpp
#include "FuzzerInternal.h" #include "FuzzerIO.h" #include "FuzzerMerge.h" #include "FuzzerTracePC.h" #include "FuzzerUtil.h" #include <fstream> #include <iterator> #include <sstream> namespace fuzzer { bool Merger::Parse(const std::string &Str, bool ParseCoverage) { std::istringstream SS(Str); return Parse(SS, ...
TOOL
0.886621
5.848883
68c045c6-274f-4679-b167-5dcb5cc3f086
vmos-dev/open-vmos-aosp_5.1
ndk/sources/cxx-stl/llvm-libc++/libcxx/test/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
// <algorithm> // template<RandomAccessIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare> // requires ShuffleIterator<Iter> && CopyConstructible<Compare> // void // sort_heap(Iter first, Iter last, Compare comp); #include <algorithm> #include <functional> #include <cassert> #ifndef _LIBCPP_HAS_NO_R...
TEST
0.994853
5.64639
742a919c-a7ee-4d45-90fa-2e0bab14b35c
abhishekiiitbh2903/COMPLETE_DSA
CPP STL/unorderedset.cpp
#include<bits/stdc++.h> using namespace std ; int main(){ unordered_set<int>ut; ut.insert(1); ut.insert(2); ut.insert(3); ut.insert(4); ut.insert(5); ut.insert(6); ut.emplace(7); ut.emplace(8); ut.emplace(9); for (auto it:ut){ cout<<it<<" "; } cout<<endl; ut.erase(...
ALGO
0.99481
4.224767
2088e476-f515-4cfe-aa7b-93065ea9ab60
MirkoDeVita98/ETH_AlgoLab_2020
Problem of the Week/The Iron Islands/theironislands.cpp
#include <bits/stdc++.h> std::istream & fp = std::cin; int sliding_window(const std::vector< int > & path, int k, const std::vector<int> & c){ int n = path.size(); int i = 0; int j = 0; int sum = 0; int max = 0; while(true){ int count = j - i; if(sum == k){ max = std::max(max, count); ...
ALGO
0.999626
3.939039
4faf8b15-a05a-421d-9df8-a2d0946df7df
mamunur1296/C-learning
Algorithom/module-13/edge-to-matrix.cpp
#include <bits/stdc++.h> #include <iostream> #include <vector> #include <list> using namespace std; int main() { int n,e; cin>>n>>e; int mat[n][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { mat[i][j] =-1; if(i==j) mat[i][j]=0 ; } } while...
ALGO
0.999864
3.864294
7d6e248b-82f1-4cdf-9393-3b2388d244d5
CJuncheng/CSCode
LeeCode/string/08.StringToInteger.cpp
#include <iostream> #include <string> using namespace std; //INT_MAX (2147483647) or INT_MIN (-2147483648) int myAtoi(string s) { int i = 0, sign = 1; long num = 0; // 保证最后的 num 不溢出 const int len = s.size(); while(i<len&&s[i]==' ') ++i; if(s[i]=='+') ++i; else if (s[i]=='-') {++i; sign=-1;} ...
ALGO
0.998864
4.180431
9baa84bc-f86f-487b-b4e3-0cd3af4b11f9
Seizzzz/DailyCodes
Course 201809/moni/1/E.cpp
#include <stdio.h> int f(int n) { if(n>0) return f(n-1)+n*n*n+n*n; else if(n==0) return 0; } int main() { int n; scanf("%d",&n); printf("%d\n",f(n)); return 0; }
ALGO
0.999912
3.766394
e056f8eb-6858-412f-9e75-4570e72b64cb
Gauravbisht231/MadCPian
capitalizeString.cpp
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; if(s[0]>90) s[0]= s[0]- 32; cout<< s<<endl; return 0; }
TOOL
0.954554
3.47335
0b37cc84-6d29-4de2-a382-3cf611e9f462
Rizwansheik666/owl
1482-how-many-numbers-are-smaller-than-the-current-number/how-many-numbers-are-smaller-than-the-current-number.cpp
class Solution { public: vector<int> smallerNumbersThanCurrent(vector<int>& nums) { map<int,int>mp; for(int i=0;i<nums.size();i++){ mp[nums[i]]++; } vector<int>v; for(int i=0;i<nums.size();i++){ int cnt=0; for(auto t:mp){ if...
ALGO
0.999981
5.979623
6acba600-2a4f-414a-bc2e-f4fb112e873d
openjdk/jfx22u
modules/javafx.web/src/main/native/Source/WebCore/xml/XPathNodeSet.cpp
#include "config.h" #include "XPathNodeSet.h" #include "Attr.h" #include "Attribute.h" #include "Document.h" #include "ElementInlines.h" #include "NodeTraversal.h" namespace WebCore { namespace XPath { // When a node set is large, sorting it by traversing the whole document is better (we can // assume that we aren't...
ALGO
0.913649
7.227956
6fb66b89-3b06-4d7f-a602-4d1cfa56e49d
kenshi-studygit0011/study_cpp
basic/53_enzanshi.cpp
#include <stdio.h> #include <iostream> using namespace std; class Point{ public: int x; int y; Point(int a, int b); bool operator>(Point obj); // 演算子関数の定義 }; Point::Point(int a, int b){ x = a; y = b; } bool Point::operator>(Point obj){ if(x > obj.x && y > obj.y) ...
ALGO
0.976181
3.696728
8c452521-946e-4dad-ac52-00d7547b0064
sehajs5/Data-Structures-and-Algorithms
convert1Dto2D.cpp
#include <iostream> #include <vector> using namespace std; vector<vector<int> > construct2DArray(vector<int>& original, int m, int n) { if (original.size() != m * n) { // Handle error or return an empty vector, depending on your requirements. return {}; } vector<vector<int> > arr(m, vecto...
ALGO
0.997985
6.661193
2c192174-dbca-4c57-8ec4-842cc8fbed94
CrazyAllegator/MAI-IR
ОЕЯТ1/ОЕЯТ1/lr на 1 файл/Tokenizing.cpp
#include "Tokenizing.h" /* * Так как тексты статей на русском берем только русские слова * остальные символы (цифры,латиницу,греческий,специфические юникод символы) игнорируем * и считаем их разделителями. * * Та как как исходная кодировка файлов UTF-8 - многобайтовая * мы ее переводим UCS-2 (два байта) для удоб...
TOOL
0.855806
4.019769
36b20d0f-8035-4243-beb6-b6efe77924f7
zouchong/humble-video
humble-video-captive/src/main/gnu/libopencore-amr/csrc/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/ol_ltp.cpp
/* ------------------------------------------------------------------------------ Filename: ol_ltp.cpp Functions: ol_ltp */ /*---------------------------------------------------------------------------- ; INCLUDES ----------------------------------------------------------------------------*/ #include "ol_ltp.h" #i...
ALGO
0.920551
7.262773
b4aa7a07-a6de-4045-baf0-9a1db183fe1b
mohdazaan18/Binary-Trees
remove leaf nodes/main.cpp
#include <iostream> #include<queue> #include"Binary.cpp" using namespace std; BinaryTreeNode<int> *takeinputlevel(){ cout<<"Enter rootdata : "; int rootdata; cin>>rootdata; if(rootdata==-1){ return NULL; } BinaryTreeNode<int> *root = new BinaryTreeNode<int>(rootdata); queue<BinaryTr...
ALGO
0.999675
4.92719
623e557b-2669-42a9-b252-4ea3cf6e38b5
gaoxingda/kglab-knowhere
thirdparty/faiss/faiss/IndexFlatElkan.cpp
#include <faiss/IndexFlatElkan.h> #include <memory> #include <faiss/impl/FaissAssert.h> #include <faiss/utils/distances.h> namespace faiss { IndexFlatElkan::IndexFlatElkan(idx_t d, MetricType metric, bool is_cosine, bool use_elkan) : IndexFlat(d, metric, is_cosine) { this->use_elkan = use_elkan; if ...
ALGO
0.999335
6.752487
a8f0a3f3-6830-4c52-a666-cd373588d20b
trailofbits/llvm-wedlock
clang/lib/ASTMatchers/ASTMatchFinder.cpp
#include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/AST/ASTConsumer.h" #include "clang/AST/ASTContext.h" #include "clang/AST/RecursiveASTVisitor.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/StringMap.h" #include "llvm/Support/Timer.h" #include <deque> #include <memory> #include <set> namespace clang ...
TOOL
0.993431
7.793146
de680ce6-737c-4b8e-97a9-900817db7d11
wohenniubi/codebattle
src/1473_Paint_House_III/main.cpp
#include <iostream> #include <vector> #include <tuple> // 是pair的升级,可以多于两个参数 using namespace std; class Solution { public: //Runtime: 172 ms, faster than 29.18% //Memory Usage: 20.1 MB, less than 9.01% int minCost(vector<int>& houses, vector<vector<int>>& cost, int m, int n, int target) { const ...
ALGO
0.999903
5.175873
5e5b101d-2169-4042-b627-53d4380e032c
shadib22/CodeForce
27.cpp
#include <iostream> #include <vector> using namespace std; int main() { int n,a,b=-1, count=0; cin>>n; if(n>=1 && n<=100000) { for(int i=0; i<n; i++) { cin>>a; if(a!=b) { count++; } b=a; } cout<<count; ...
ALGO
0.999847
3.570256
c7f24281-6c7d-4b88-9c73-86fa039e8550
tamdoduc/mario1
cocos2d/cocos/base/CCConsole.cpp
#include "base/CCConsole.h" #include <thread> #include <algorithm> #include <functional> #include <cctype> #include <locale> #include <sstream> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <fcntl.h> #if defined(_MSC_VER) || defined(__MINGW32__) #include <io.h> #include <WS2tcpip.h> #include <Wins...
TOOL
0.961738
5.51721
42aab73c-1b3e-45cb-a4ac-6c5efe2c9438
SakshamSahgal/Competitive-Programming
Codeforces + Codechef/A. Prof. Slim.cpp
#include<iostream> #include<cstring> #include<vector> #include<set> #include<map> #include<algorithm> #include<cmath> #include<climits> #define lli long long int #define GO_FAST ios_base::sync_with_stdio(0);ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); // basic debugging macros lli __i__,__j__; lli inf = 9e18; #defin...
ALGO
0.99996
3.971022
9c088d45-0c9d-4b7d-8a95-2edc588cabb6
polezhaev-ds/made_2019_tsp
MetricGraph.cpp
// // Created by Петр Полежаев ( <EMAIL> ) on 19.12.2019. // #include <cmath> #include <random> #include <cassert> #include "MetricGraph.h" std::default_random_engine MetricGraph::generator; std::uniform_real_distribution<double> MetricGraph::uniform_distribution(-1.0, 1.0 ); void MetricGraph::AddEdge(std::size_t f...
ALGO
0.965644
5.67405
b1b02437-5cb9-418f-b0f9-d4606ed9ea33
vtandon1204/Daily-DSA
10.binary tree/04NumberOfGoodLeafNodesPairs.cpp
#include <bits/stdc++.h> // You are given the root of a binary tree and an integer distance. // A pair of two different leaf nodes of a binary tree is said to be good if the length of the shortest path // between them is less than or equal to distance. // Return the number of good leaf node pairs in the tree. // Inp...
ALGO
0.999946
6.539274
b6e2f19c-ed01-4752-8478-53b8ea69c7d8
darkglimmer/CS-Lab
wordladder.cpp
// This is the CPP file you will edit and turn in. // Also remove these comments here and add your own. // TODO: remove this comment header #include <cctype> #include <cmath> #include <fstream> #include <iostream> #include <string> #include <stack> #include <set> #include "console.h" #include "stack.h" #include "simpi...
ALGO
0.946888
4.582954
26dd1a44-493d-4e1b-bb73-a1c44b12226b
LeeHuiSung/code
boj/17209.cpp
#include<bits/stdc++.h> using namespace std; int n,tmp,anw,cnt,ocnt; bool adj[2010][2010],used[2010],chk[2010]; queue<int> a; int main(){ cin>>n; for(int i=1;i<=n;i++) for(int j=1;j<=n;j++){ scanf("%1d",&tmp); adj[i][j]|=tmp; adj[j][i]|=tmp; } for(int i=1;i<=n;i++) if(!used[i]){ ...
ALGO
0.999941
4.029721
a314ff8e-bbd1-4c52-a1dd-bbe9b9bad73a
brightcoindeveloper/brtcoin
src/zerocoin/Params.cpp
/** * @file Params.cpp * * @brief Parameter class for Zerocoin. * * @author Ian Miers, Christina Garman and Matthew Green * @date June 2013 * * @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green * @license This project is released under the MIT license. **/ #include "Zeroco...
TOOL
0.884522
6.621742
1e3ec5b9-0202-4257-96ad-4a3eb3568dd4
ReadnThink/algorithm
cpp/펜윅트리_최단경로/최단경로.cpp
#include <bits/stdc++.h> using namespace std; const int INF = 987654321; void print(); int v,e,start, sum, cnt, dist[30001]; vector<pair<int,int>> adj[30001]; priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq; void input(){ cin >> v >> e >> start; int u,v,w; for(int i = 0; i < e;...
ALGO
0.999962
3.943193
2da97089-aff5-41a5-a949-40cb8369b2ae
2001adarsh/Contests
Practice/Maths/Prime Numbers/no of prime in range.cpp
#include<bits/stdc++.h> using namespace std; #define int long long int #define endl "\n" #define mod 1000000007 #define inf 1e18 //Number of Primes in a Range. a<=10e6 and b<=10e6 and N<10000 const int N = 1e6; int pr[N] = {0}; void seive() { for (int i = 3; i <= N; i += 2) pr[i] = 1; for (int i ...
ALGO
0.99985
4.888734
ecdce3c9-7db5-4203-abfa-8ba8d342bb31
vivekbiragoni/Leetcode
Recursion/17-letter-combinations-of-a-phone-number/letter-combinations-of-a-phone-number.cpp
class Solution { private: void backTrack(vector<string> & result, string& combination, const vector<string>&digitToLetters, const string &digits, int index){ if(index == digits.size()){ result.push_back(combination); return; } string letters = digitToLetters[digits[in...
ALGO
0.999952
6.96831
bc1bcb0c-b7b0-4edd-9d50-eab57a059c29
openjdk/jfx17u
modules/javafx.web/src/main/native/Source/JavaScriptCore/b3/air/AirFixSpillsAfterTerminals.cpp
#include "config.h" #include "AirFixSpillsAfterTerminals.h" #if ENABLE(B3_JIT) #include "AirBlockInsertionSet.h" #include "AirCode.h" #include "AirInsertionSet.h" namespace JSC { namespace B3 { namespace Air { void fixSpillsAfterTerminals(Code& code) { // Because there may be terminals that produce values, IRC ...
ALGO
0.937472
7.314893
e0415b7a-6c46-41ea-b6b4-6fb301ca2b2c
pnnv/hyprland-dotfiles
VSCodium/User/History/5ee8fe5/tWhO.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int32_t main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector <int> v(n + 1), p; for (int i = 0; i < n; i++) cin >> v[i + 1]; p = v; for (int i = 0; i < n; i++) p[i + 1] += p[i]; vector <ll> dp(n + 1, 1e10); dp[0] = 0; ...
ALGO
0.999981
3.782762