uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
951cbaa9-7082-4775-a951-ab06506a4ce0
Chenchunxuan/rattle-iros-2022
rattle_rrt/bullet3/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
#include "btConvex2dConvex2dAlgorithm.h" //#include <stdio.h> #include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h" #include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h" #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletCollision/Collisio...
ALGO
0.999674
6.671592
a58ec0d7-769a-4d98-a834-891bfae1e57b
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_12960_20.cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 105; const int inf = 1e9; struct pt { int x, l; }; inline bool operator<(const pt &a, const pt &b) { return a.x < b.x; } pt p[maxn]; int n; vector<int> xs; int ans[3 * maxn][maxn]; int main() { scanf("%d", &n); for (int i = 0; i < n; i++) { scanf(...
ALGO
0.999844
3.519542
fe915533-88c9-4dd2-9cc1-d911df35df3c
bacalhzu-archive/prof.judson-poo
Labs/Lab07/ExFix01/main.cpp
#include <iostream> #include "Jogo.h" using namespace std; const int MAX = 3; int main() { // vetor de objetos inicializados Jogo colecao[MAX] = { Jogo("Gears", 10.0f, 30), Jogo("Doom", 60.0f, 120), Jogo("Halo", 80.0f, 40) }; cout << "Coleo de Jogos:\n"; for (int i ...
ALGO
0.875454
4.434518
9d9452b4-876b-4859-a384-350377408748
apennisi/multi_target_tracker
src/hypothesis.cpp
#include "hypothesis.h" using namespace ATracker; std::shared_ptr<Hyphothesis> Hyphothesis::m_instance = nullptr; std::shared_ptr< Hyphothesis > Hyphothesis::instance() { if(!m_instance) { m_instance = std::shared_ptr<Hyphothesis>(new Hyphothesis); } return m_instance; } void Hyphothesis::new_hyphoth...
ALGO
0.997434
5.617142
7ea66ec5-67d1-4654-948e-f704e356c3c2
Samsung/lwnode
deps/node/deps/icu-small/source/tools/genrb/filterrb.cpp
#include <iostream> #include <stack> #include "filterrb.h" #include "errmsg.h" const char* PathFilter::kEInclusionNames[] = { "INCLUDE", "PARTIAL", "EXCLUDE" }; ResKeyPath::ResKeyPath() {} ResKeyPath::ResKeyPath(const std::string& path, UErrorCode& status) { if (path.empty() || path[0] != '/') { ...
TOOL
0.955745
6.28081
43524ed9-a6d6-41a8-bfd2-d6f282bd0c75
yuichiro-kurose/kyopro
joi/joi2012/honsen/a/main.cpp
// author: Yuichiro Kurose #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string s; cin >> s; int n = s.size(); int cnt_j = 0, cnt_o = 0, cnt_i = 0; int p = 0; int ans = 0; while (p < n) { while (p < n && s[p] == 'J') { cnt_j++; ...
ALGO
0.998276
4.023555
3d9dff59-2f39-4b7d-b337-9b39e9067ef0
clockzhong/WrapLAMP
Boost/libs/numeric/ublas/doc/samples/vector_binary_scalar.cpp
#include <boost/numeric/ublas/vector.hpp> #include <boost/numeric/ublas/io.hpp> int main () { using namespace boost::numeric::ublas; vector<double> v (3); for (unsigned i = 0; i < v.size (); ++ i) v (i) = i; std::cout << 2.0 * v << std::endl; std::cout << v * 2.0 << std::endl; }
ALGO
0.936994
3.24158
489ccf8a-5f3c-41c0-b66f-75ddf2a596a5
Neel-max-cpu/CodingNinjaDSAsolution
introduction to c++/L10 Character Arrays and 2d arrays/printAllSubstrings.cpp
/* For a given input string(str), write a function to print all the possible substrings. Substring A substring is a contiguous sequence of characters within a string. Example: "cod" is a substring of "coding". Whereas, "cdng" is not as the characters taken are not contiguous Input Format: The first and only line of in...
ALGO
0.999892
5.467525
edea291e-5fbf-44cd-b8e3-8c72347450c8
wdiiahk/procon-archive
atcoder.jp/abc142/abc142_d/Main.cpp
//デバッグ用オプション:-fsanitize=undefined,address //コンパイラ最適化 #pragma GCC optimize("Ofast") //インクルードなど #include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; typedef long long ll; using vint = vector<int>; using vll = vector<ll>; using vbool = vector<bool>; template <class T> using arr...
ALGO
0.999392
4.808301
ab1f9ea0-e708-4bea-91ee-1a8ff589e8f8
Chentao2000/practice_code
C++_LeetBook/力扣_合并区间/main.cpp
class Solution { public: vector<vector<int>> merge(vector<vector<int>>& intervals) { int n = intervals.size(); if(n==1) return intervals; sort(intervals.begin(), intervals.end()); vector<vector<int>> vec; vec.push_back(intervals[0]); int j =0; for(...
ALGO
0.999997
5.932946
1affd71f-5c5c-4236-9807-9ff3b1803704
jkt1999/pic
ch8/ad/ad1-steady.cpp
/* Steady-State Convection-Diffusion Equation solver */ #include <iostream> #include <vector> #include <fstream> #include <math.h> using namespace std; using dvector = vector<double>; // simple tri diagonal matrix struct TriD { TriD(int ni) { a.reserve(ni); b.reserve(ni); c.reserve(ni); } dvector a,b,c; //...
ALGO
0.999994
4.358515
62f05bd0-ebbf-4bb2-9d8f-1ff1eefd47df
w2strive/algorithm
72_数组最多异或和划分.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <unordered_map> #include <algorithm> #include <ctime> using namespace std; void generatorRandomArray(vector<int> &vt, int maxSize, int maxValue); void printVector(vector<int> &vt); /* 给定一个数组arr, 可以任意把arr分成很多不相容的子数组. 求: 分出来的子数组中, 异或和为0的子数组...
ALGO
0.999773
5.163873
5b76697d-2a83-472c-89fa-8966433e0a3c
SeldonHarry/Visual_Group
autoaim/src/autoaim/enemy_predictor_node/predictor/motion/armor_model.cpp
#include "motion/armor_model.hpp" #include "param/param.hpp" #include "coord_convert/coord_converter.hpp" namespace aimer { /** @struct FilterThread */ FilterThread::FilterThread(aimer::CoordConverter* const converter, const aimer::ArmorData& armor, const double& c...
ALGO
0.893665
6.044348
e61eee48-602d-43b9-94f3-607518351e62
alvinnardo/licode
leetcode/2073.cpp
#include "../template/head.h" #include <bits/stdc++.h> int timeRequiredToBuy(vector<int> tickets, int k) { // 思路:模拟 // 前面小于等于的应该先拿完,后面少一轮小于的应该先拿完 // 时间 O(n),空间 O(1) int sum = 0; for (int i = 0; i < tickets.size(); i++) { if (i <= k) { sum += tickets[i] <= tickets[k] ? tickets[i]...
ALGO
0.999816
4.855465
57dde82b-0412-41e2-8c13-9c93e591808d
1425/strategy_2020
opr.cpp
#include "opr.h" #include<cassert> #include<iostream> #include<map> #include<vector> #include<set> #include<cmath> #include "qr_solve.hpp" #include "util.h" #include "input_data.h" #include "../tba/tba.h" #include "../tba/db.h" #include "../tba/data.h" using namespace std; template<typename K,typename V> std::vector<...
ALGO
0.987524
4.413527
acce81f6-c3d8-42dd-8c6a-db392d7b243f
kks227/BOJ
4300/4386.cpp
#include <cstdio> #include <cmath> #include <algorithm> using namespace std; typedef pair<int, int> P; struct Edge{ int u, v; double w; Edge(): Edge(0, 0, 0){} Edge(int u1, int v1, double w1): u(u1), v(v1), w(w1){} bool operator <(const Edge &O){ return w < O.w; } }; struct UnionFind{ int p[100]; UnionFind(){ ...
ALGO
0.999786
3.873091
9b48f90f-a1a9-4f0e-9d17-907a33a8d8e2
coin-or/Couenne.old
Couenne/src/expression/operators/exprSin.cpp
#include <math.h> #include "CouenneExprSin.hpp" #include "CouenneExprClone.hpp" #include "CouenneExprCos.hpp" #include "CouenneExprBSin.hpp" #include "CouenneExprMul.hpp" namespace Couenne { static const CouNumber pi = M_PI, pi2 = M_PI * 2., pih = M_PI / 2.; // differentiation expression *exprSin::differen...
ALGO
0.998776
6.92443
6927c707-7516-437d-a982-ad6c91fb2c3c
nikunj-var/6Companies30DaysChallenge
Goldman Sachs/trailingzeroes.cpp
class Solution { public: int trailingZeroes(int n) { if (n < 0) return -1; if (n < 5) return 0; int ans = 0; for (int i = 5; n / i >= 1; i *= 5) { ans += n / i; } return ans; } };
ALGO
0.999858
6.417876
17ac074c-44eb-4944-8a0e-9a633cfb8e32
KnifeParty12/Back_again
CodeForces/Grakn Forces/A_Circle_Coloring.cpp
#include <bits/stdc++.h> #define endl "\n" #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define loop(i, a, b) for (int i = a; i < b; i++) #define sloop(str, i, a) for (int i = a; str[i] != '\0'; i++) #define mod 1000000007 #d...
ALGO
0.999979
4.048243
df05547b-7068-4757-b277-8800599b114a
jaydeep-savaliya/__Cplus
strongly_connected_componenet.cpp
#include <bits/stdc++.h> using namespace std; class Solution { private: void dfs(int node, vector<int> &vis, vector<int> adj[], stack<int> &st) { vis[node] = 1; for (auto it : adj[node]) { if (!vis[it]) { dfs(it, vis, adj, st); } } ...
ALGO
0.999852
5.810816
abdf8701-5ab6-43a9-a8b2-4fd577ea17cb
aobolensk/ppc-2024-mpi-retake
modules/core/util/src/util.cpp
#include "core/util/include/util.hpp" #include <cstdlib> #ifdef _WIN32 #include <cstdint> #include <iostream> #include <memory> #include <vector> #endif #include <filesystem> #include <string> std::string ppc::util::GetAbsolutePath(const std::string &relative_path) { const std::filesystem::path path = std::string(...
TOOL
0.887913
5.999128
92180d83-2068-4100-a946-b20099c0032a
vik673/Data-Structure-And-Algorithm-using-C-plus-plus
TreeImplementation/BineraySearchTree.cpp
#include<iostream> using namespace std; struct TreeNode { int data; TreeNode *left,*right; TreeNode(int val) : data(val), left(nullptr), right(nullptr){} }; TreeNode* insertBST(TreeNode* root, int val) { if(!root) return new TreeNode(val); if(val < root->data) root->left = insertBST(root->right,...
ALGO
0.999975
5.68065
72ec21df-b009-44d4-81ca-463e8ed264b0
sid-rh/MyLeetcode
28.Index-Of-First-Occurence/IndexOfFirstOccurrence.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; /* Approach: find the first occurrence of the first word, find the substring of the size of the needle, if it is equal return index, else continue. */ int strStr(string haystack, string needle) { for (int i = 0; i < haystack.size(); i++) ...
ALGO
0.999847
5.350079
3ef73530-af06-4dbb-9755-69487f4630fc
naseem12007571/Coder-Army-180-Day-challange
Array/alternative reverse array.cpp
logic samjha love babbar lecture 17 #include <bits/stdc++.h> using namespace std; int main() { int arr[6]={6,5,4,0,-2,1}; for(int i=0;i<5;i=i+2){ if(i+1<6) swap(arr[i],arr[i+1]); } for(int i=0;i<6;i++){ cout<<arr[i]<<" "; } }
ALGO
0.999892
3.132695
3414a561-aa64-415c-9237-a830e9392833
sachinkumar8757/CPP_Programs
cpp cource/hex_decimal.cpp
#include<iostream> #include<math.h> using namespace std; int main() { int n; cout<<"Enter number in Hexadecimal: "; cin>>n; int sum=0; int count=-1; while(n>0) { int r=n%10; count=count+1; sum=sum+r*pow(16,count); n=n/10; } cout<<"in decimal it is: "<<...
ALGO
0.999719
4.356372
9accab73-9c89-451c-82e3-344ffb28137e
1Coold1/labs
11_4/11_4/11_4.cpp
#include <iostream> using namespace std; struct List { char data; List* next; }; List* make_list(int n, List*& first, List*& last) { if (n == 0) return NULL; List* p = new List; char a; cin >> a; p->data = a; p->next = NULL; first = p; last = p; for (int i = 2; i <= n; i++)...
ALGO
0.998188
3.530012
13d66ded-4bb1-4e60-ade0-3d5fbd9604b4
ishandutta2007/codeforces
joyfun/normal/397/A.cpp
#include <stdio.h> #include <string.h> #include <algorithm> using namespace std; const int N = 105; int n, i, vis[N], l, r, ll, rr; int main() { scanf("%d", &n); scanf("%d%d", &ll, &rr); for (i = 2; i <= n; i++) { scanf("%d%d", &l, &r); for (int j = l; j < r; j++) vis[j] = 1; ...
ALGO
0.999893
3.141472
3f3f1885-a0ba-4b9a-8262-3a69cc3f8a7d
GrihsaIvanenko/code228
Tinkoff_2020_2021/Корневые оптимизации 1/Подарок/code.cpp
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; void sum(int &a, int b) { a += b; if (a >= MOD) a -= MOD; } signed main() { cin.tie(nullptr); cout.tie(nullptr); ios_base::sync_with_stdio(false); int n, k; cin >> n >> k; map<int, int> mm; mm[k - 1] =...
ALGO
0.999927
4.134302
81041c54-ddfb-4260-a1bb-6dbb33ebd8c9
Agam3108/Data_Structures-n-Algorithms
0135-candy/0135-candy.cpp
class Solution { public: int candy(vector<int>& ratings) { int n = ratings.size(); vector<int> candies(n,1); for(int i = 1;i<n;i++){ if(ratings[i] > ratings[i-1]) candies[i] = 1 + candies[i-1]; } for(int i = n-2 ;i>=0;i--){ if(ratings...
ALGO
0.999995
6.089042
457564d8-2a01-4a81-97fb-d3ddcb81f92b
vidhi-cmyk/C-C-Data-Structures-and-Pointers
Lesson_4_Stacks.cpp
// Stack implementation using arrays #include <iostream> #include <stdio.h> /* #define max_size 7 int A[max_size]; int top=-1; void push(int x){ if(top==max_size-1){ //array is full printf("Stack overflow"); } A[++top]=x; } int pop(){ if (top==-1){ printf("error: nothing to pop"); ...
ALGO
0.998761
3.921399
c1c8fc17-893a-49e6-b180-4762a5910308
kim1992/CarND_Highway_Driving
src/Eigen-3.3/lapack/svd.cpp
#include "lapack_common.h" #include <Eigen/SVD> // computes the singular values/vectors a general M-by-N matrix A using divide-and-conquer EIGEN_LAPACK_FUNC(gesdd,(char *jobz, int *m, int* n, Scalar* a, int *lda, RealScalar *s, Scalar *u, int *ldu, Scalar *vt, int *ldvt, Scalar* /*work*/, int* lwork, ...
ALGO
0.998704
5.526819
e8f583fb-b7b3-4c71-8d76-d2270518c222
LouisFoschiani/GROUPE_4_IAJV_S1
StateMachine.cpp
#include "StateMachine.h" #include "PuantMan.h" #include <iostream> void StateMachine::Init(PuantMan& pm) { node_IDLE->AddCondition(new Condition(Null, True, -1)); node_Play->AddCondition(new Condition(Mentalhealth, SuperiorOrEqual, MENTALHEALTH_MIN)); node_Play->AddCondition(new Condition(Cleanliness, SuperiorOrE...
ALGO
0.989441
3.211179
61812dde-6e24-4c11-8676-898c40f08d17
qinlonglong123/OgreKit
bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.cpp
#include "btStaticPlaneShape.h" #include "LinearMath/btTransformUtil.h" btStaticPlaneShape::btStaticPlaneShape(const btVector3& planeNormal,btScalar planeConstant) : btConcaveShape (), m_planeNormal(planeNormal.normalized()), m_planeConstant(planeConstant), m_localScaling(btScalar(0.),btScalar(0.),btScalar(0.)) { m_...
ALGO
0.916201
7.231369
3b3175da-38c1-432e-b7a2-a839c35b7a1c
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_4304_22.cpp
#include <bits/stdc++.h> int main() { int a[19000], b, c, n; a[1] = 1; int i = 2; while (i <= 18257) { a[i] = a[i - 1] + 6 * i; i++; } while (scanf("%d", &n) != EOF) { printf("%d\n", a[n]); } return 0; }
ALGO
0.999605
3.502488
be9de92a-8aa8-4e5d-b6d5-0eaef9bea46e
adityakharat25/Rubikscube
Model/RubiksCube.cpp
// // Created by Shubham Patil on 17/12/21. // #include "RubiksCube.h" // //Given a color return it's first letter // char RubiksCube::getColorLetter(COLOR color) { switch (color) { case COLOR::BLUE: return 'B'; case COLOR::GREEN: return 'G'; case COLOR::RED: ...
ALGO
0.927511
6.545438
e4453b26-ad9c-48b0-8e05-9275b29acaac
Mayoahamy/TP6-Programacion
TP6E2.cpp
#include<iostream> using namespace std; class Triangulo{ private: int lado1,lado2,lado3; public: void inicializar(); void ladomayor(); void equilatero(); }; void Triangulo::inicializar(){ cout<<"Ingresar lado 1 en cm: "; cin>>lado1; cout<<"Ingresar lado 2 en cm: "; cin>>lado2; cout<<"Ingresar lado 3 en c...
ALGO
0.997752
3.906453
4e9cb387-37b8-43fe-9a5a-0fb0d48978f3
Mr-Xiao2021/ascend_op_learning
operator/MatmulLeakyReluCustomSample/KernelLaunch/CppExtensions/matmul_leakyrelu_custom.cpp
#include "kernel_operator.h" #include "lib/matmul_intf.h" using namespace matmul; __aicore__ inline uint32_t Ceiling(uint32_t a, uint32_t b) { return (a + b - 1) / b; } template <typename aType, typename bType, typename cType, typename biasType> class MatmulLeakyKernel { public: __aicore__ inline MatmulLeaky...
ALGO
0.927111
6.864893
27ec8976-d010-4426-9de9-4710944b0990
lijinf2/gqr
include/eigen/test/eigen2/eigen2_visitor.cpp
#include "main.h" template<typename MatrixType> void matrixVisitor(const MatrixType& p) { typedef typename MatrixType::Scalar Scalar; int rows = p.rows(); int cols = p.cols(); // construct a random matrix where all coefficients are different MatrixType m; m = MatrixType::Random(rows, cols); for(int i =...
TEST
0.924422
5.877094
53d3370f-a71e-4e2a-89a3-6eb3d4a9ef69
fesabelilla/Data-Structures
binary_tree_level_order_structure.cpp
#include <bits/stdc++.h> using namespace std; struct Node { int data; Node* left, * right; Node* par; }; Node* newNode(int data) { Node* node = (Node*)malloc(sizeof(Node)); node->data = data; node->left = node->right = node -> par = NULL; return (node); } Node* insertLevelOrder(int arr[],...
ALGO
0.999984
4.582706
55441658-842f-4fad-ac3c-d2e719768333
ishandutta2007/codeforces
-23333/normal/1679/F.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,h,t) for (int i=h;i<=t;i++) #define dep(i,t,h) for (int i=t;i>=h;i--) #define ll long long int f[2000],ni[2000]; const int mo=998244353; int dp[60000][1026]; ll fsp(int x,int y) { if (y==0) return 1; if (y==1) return x; ll ans=fsp(x,y/2); ans=a...
ALGO
0.999981
4.553135
6f2355da-f916-4a40-89ba-18f7f4f0919b
mdimaiolo/nimbix_us02_su2_source
subprojects/Mutationpp/thirdparty/eigen/doc/examples/Tutorial_BlockOperations_corner.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; int main() { Eigen::Matrix4f m; m << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12, 13,14,15,16; cout << "m.leftCols(2) =" << endl << m.leftCols(2) << endl << endl; cout << "m.bottomRows<2>() =" << endl << m.bottomRows<2>() << endl << ...
ALGO
0.998547
4.092313
cc76f33d-4ef8-4398-89fc-8a6596b461a2
prajwal6162/DSA-Advance
Binary Search/Logic Building/Search insert position (Optimal).cpp
class Solution { public: int searchInsert(vector<int> &nums, int target) { //lower bound implementation; int n=nums.size(); int low=0; int high=n-1; int ans = n; while(low <= high){ int mid = (low+high) / 2; if(nums[mid] >= target){ ans = mid; ...
ALGO
0.99992
6.240221
d316af6e-12da-4712-9b3e-4812c51c13f6
randbatch-md/lammps-rbe
src/GPU/fix_nve_asphere_gpu.cpp
// clang-format off /* ---------------------------------------------------------------------- Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ #include "fix_nve_asphere_gpu.h" #include "atom.h" #include "atom_vec_ellipsoid.h" #include "comm...
ALGO
0.995987
5.525864
b7b1d204-1f31-4ef8-988f-ddb1d9dfb65c
Sagar-Mondal/GFG-POTD
Medium/Painting the Fence/painting-the-fence.cpp
//{ Driver Code Starts #include <bits/stdc++.h> #include<stdio.h> #include<math.h> using namespace std; // } Driver Code Ends class Solution{ public: long long countWays(int n, int k) { // Base cases if (n == 0) { return 0; } else if (n == 1) { return k; ...
ALGO
0.999961
5.627748
a6822e21-a14f-49ee-b139-33a0a3000981
Ajaybhaskar-Athi/Winter-PEP
59.4 Array Partitioning.cpp
#include<bits/stdc++.h> using namespace std; /* Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), ..., (an, bn) such that the sum of min(ai, bi) for all i is maximized. Return the maximized sum. Example 1: Input: nums = [1,4,3,2] Output: 4 Explanation: All possible pair...
ALGO
0.999985
5.555774
cd02f282-b827-4a53-b04b-a1f508df7294
nybzmr/CP
cp31/1200/C_Dora_and_Search.cpp
// Author: Nayaab Zameer #include <bits/stdc++.h> using namespace std; #define pi (3.141592653589) #define mod 1000000007 #define pb push_back #define is insert #define mp make_pair #define ff first #define ss second #define all(x) x.begin(), x.end() #define min3(a, b, c) min(c, min(a, b)) #define min4(a, b, c, d) min...
ALGO
0.999697
3.856432
0d636ed3-8c05-47e3-bea0-497a959b6e9d
IVANCHEW/ivan_aruco
src/kinect_pose_estimation.cpp
// ROS #include <ros/ros.h> #include <ros/package.h> #include <ros/service.h> #include <ros/callback_queue.h> #include <yaml-cpp/yaml.h> // POSE ESTIMATION #include <tf/transform_broadcaster.h> #include <tf_conversions/tf_eigen.h> #include <eigen_conversions/eigen_msg.h> // POINT CLOUD PROCESSING #include <pcl_conver...
TOOL
0.857132
4.637814
79e9bb23-a2f8-4885-9e0a-9db8239ed061
DeepakChauhan-cloud/Learning-Cpp-Coding-Army
Class Notes Problems/BASICS OF C++/Lec 08 Hard Pattern/04_Pattern.cpp
/* A A B A B C A B C D A B C D E */ #include<iostream> using namespace std; int main() { int row,n; cout<<"Enter the value of row: "; cin>>n; for(row=1;row<=n;row++) { for(int col=1;col<=n-row;col++) { cout<<" "; } for(char...
ALGO
0.99859
3.768531
216e388f-0805-451d-b73b-7bcc892e6c20
MinHK4/Algorithm_Study
BOJ/Divide_Conquer/Binary_Search/BOJ_2352_반도체설계.cpp
// https://www.acmicpc.net/problem/2352 #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair <int, int>; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); freopen("inp.txt", "r", stdin); int N; cin >> N; vector<int> arr(N); for(int i=0; i<N; i++) cin >> ...
ALGO
0.999989
5.002712
d2a84d0c-0173-4f54-87d9-261baa5b12e0
austinsonger/Coding-Challenges
LeetCode/Algorithms/C++/add-digits.cpp
// Time: O(1) // Space: O(1) class Solution { public: int addDigits(int num) { return (num - 1) % 9 + 1; } };
ALGO
0.999901
6.700509
f9ba7a14-7fce-4cb7-88a6-ac6407cdbebb
Samyc2002/CP
Codeforces/Problemset/Minor_Reduction.cpp
#include <bits/stdc++.h> using namespace std; #define gfoi(i, j, k, in) for (int i = j; i < k; i += in) #define gfod(i, j, k, in) for (int i = j; i >= k; i -= in) #define foi(i, j) gfoi(i, 0, j, 1) #define fod(i, j) gfod(i, j, 0, 1) #define all(cont) cont.begin(), cont.end() #define rall(cont) cont.end(), cont.begin(...
ALGO
0.999965
6.124341
74e237e4-6b91-40d1-951c-766f58a42362
ericyuanhui/Eric_Leetcode_Roadmap
two_pointer/left_right/680valid_palindrome/main.cpp
#include <iostream> #include "lib/680valid_palindrome.h" using namespace std; int main(int argc,char **argv) { string s = "cupxpucu"; Solution slo; bool res = slo.validPalindrome(s); cout << res << endl; return 0; }
ALGO
0.999713
4.407419
e4686a3c-a5f9-4426-9cfd-ba85235053a4
liu115/renderpy
thirdparty/eth3d-pipeline/thirdparty/igl/arap_dof.cpp
#include "cotmatrix.h" #include "massmatrix.h" #include "speye.h" #include "repdiag.h" #include "repmat.h" #include "slice.h" #include "colon.h" #include "is_sparse.h" #include "mode.h" #include "is_symmetric.h" #include "group_sum_matrix.h" #include "arap_rhs.h" #include "covariance_scatter_matrix.h" #include "fit_rot...
ALGO
0.99976
5.954325
e98db4bf-6bd2-4546-88b3-40b432d4601f
akifzaman/CP_Topics
Codeforces/DIV2(B)/Levko and Permutation.cpp
#include <bits/stdc++.h> using namespace std; #define nl "\n" #define mod 1000000007 #define sz(c) (int)c.size() #define pb push_back #define ff first #define ss second #def...
ALGO
0.999939
3.922553
6bd326d2-85c2-4484-8fc0-465e380e83f9
gudtldn/BOJ
2953/cpp/boj_2953.cpp
#include <iostream> using namespace std; int main() { int max[2] = {-1, -1}; for (int i = 0; i < 5; i++) { int sum = 0; for (int j = 0; j < 4; j++) { int a; cin >> a; sum += a; } if (sum > max[1]) { max[0] = ...
ALGO
0.999837
3.401211
d40b8997-6ffb-454e-a254-6304868408f7
GooferByte/data-structures-and-algo
DataStructures-and-Algorithm-main/DataStructure/c++/heap/loveBabbarDsSheet/merge-k-sorted-arrays.cpp
class Solution { public: //Function to merge k sorted arrays. vector<int> mergeKArrays(vector<vector<int>> arr, int K) { priority_queue <int, vector<int >, greater<int> > pq; for(int i = 0 ; i < K ; i++){ for(int j = 0 ; j < K ; j++){ pq.push(arr[i][j]); ...
ALGO
0.999943
5.319544
2edaef84-ba38-42a1-9630-766d64d7fba1
anis191/Phitron
Introduction to C++/Module-6.5(Practice Day_1)/A_Lucky.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; for(int test=1; test<=t; test++){ string a; cin>>a; int first_sum=0,second_sum=0; for(int i=0; i<3; i++){ first_sum += int(a.at(i)); } for(int i=3; i<6; i++){ second_sum += int(a.at(i)); } if(firs...
ALGO
0.999638
3.991056
d43322cd-5c4e-41fd-b628-4411ff335d5f
Royal520/leetcode
leetcode/editor/cn/[20]有效的括号.cpp
#include<bits/stdc++.h> using namespace std; //leetcode submit region begin(Prohibit modification and deletion) class Solution { public: bool isValid(string s) { } }; //leetcode submit region end(Prohibit modification and deletion) int main() { Solution solution = *new Solution(); clock_t start, end...
ALGO
0.997053
4.096111
41b2adf4-6baa-49b8-a46f-1f96351950a7
Guo-lab/LeetCode
2023_With_Carl/tree/199.二叉树的右视图.cpp
/* * @lc app=leetcode.cn id=199 lang=cpp * * [199] 二叉树的右视图 * * https://leetcode.cn/problems/binary-tree-right-side-view/description/ * * algorithms * Medium (65.84%) * Likes: 844 * Dislikes: 0 * Total Accepted: 278.4K * Total Submissions: 422.8K * Testcase Example: '[1,2,3,null,5,null,4]' * * 给定一个...
ALGO
0.999879
6.868524
e7235f4f-fe69-4a2f-a907-fb63df737849
tobe2098/CodingExercises
DynamicProgramming/DynamicProgramming/main.cpp
// DynamicProgramming.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include "parenthesis.hpp" int main() { //std::cout << possiblePaths(18,18)<<'\n'; //std::vector<int> arr = { 23,17,3,2 }; //std::unordered_map<int, std::vector<int>> hashmap;...
ALGO
0.998932
3.672788
24a9d54c-318d-42fc-b6d3-16628666cc75
brupadhyay/Striver-SDE-Sheet-Challenge
Day02/findDuplicate.cpp
/* BRUTE FORCE - check if some number is repeated TC - O(n^2) SC - O(1) */ #include <iostream> #include <vector> #include <algorithm> using namespace std; int findDuplicate(vector<int> &arr, int n){ int duplicate = -1; for(int i = 0;i<n-1;i++){ int assumedDuplicateNumber = arr[i]; for(int j = i+1;j<n;j++){ ...
ALGO
0.999946
5.344092
6b6e3aa9-875b-47ea-a504-47af19852688
Ahmdfalah7/Doubleinkedlist_148
Doubleinkedlist_148/Doubleinkedlist_148.cpp
#include <iostream> #include <string> using namespace std; class Node { public: int noMhs; string name; Node* next; Node* prev; }; class DoubleLinkedList { private: Node* START; public: DoubleLinkedList(); void addNode(); bool search(int rollNo, Node** previous, Node** current); bool deleteNode(int rollNo); ...
ALGO
0.999796
4.19893
d6297568-95e7-482e-9716-ebda3a0477b3
raincross7/code-similarity
codes/train_code/problem093/problem093_229.cpp
#include <iostream> #include <cmath> #include <vector> #include <map> #include <iomanip> #include <algorithm> #include <sstream> #include <string> #include <math.h> #include <set> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); int a, b, c = 0; cin >> a ...
ALGO
0.998601
3.833313
76e4e55f-af46-4508-b55f-0b499567cd93
ishandutta2007/codeforces
bench0310/normal/1610/D.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; const int mod=1000000007; auto add=[&](int a,int b)->int{return a+b-(a+b>=mod?mod:0);}; auto sub=[&](int a,int b)->int{return a-b+(a-b<0?mod:0);}; auto...
ALGO
0.999986
4.321178
6b08b85d-34a1-409d-89e3-12daeb7e122c
praneethaBrindavanam/LeetCode
1556-make-two-arrays-equal-by-reversing-subarrays/1556-make-two-arrays-equal-by-reversing-subarrays.cpp
class Solution { public: bool canBeEqual(vector<int>& target, vector<int>& arr) { sort(arr.begin(),arr.end()); sort(target.begin(),target.end()); for(int i=0;i<arr.size();i++){ if(arr[i]!=target[i]) return false; } return true; } };
ALGO
0.999925
5.745537
46c9b386-e45e-47e3-988d-bdb8ee458b89
jingli-jenny/demo
thirdparty/faiss/Clustering.cpp
// -*- c++ -*- #include <faiss/Clustering.h> #include <faiss/impl/AuxIndexStructures.h> #include <cmath> #include <cstdio> #include <cstring> #include <omp.h> #include <faiss/utils/utils.h> #include <faiss/utils/random.h> #include <faiss/utils/distances.h> #include <faiss/impl/FaissAssert.h> #include <faiss/FaissHo...
ALGO
0.999003
6.954825
e83579b1-d08a-4a6d-ab69-9516e82a0fa1
tempdeltavalue/opengl_
CudaLessons/CudaRuntime1/CudaRuntime1/seq_add.cpp
#include "stdio.h"; #include <time.h> void add(int N, float* X, float* Y) { for (int i = 0; i < N; i++) { Y[i] = X[i] + Y[i]; } } //int main() { // printf("start \n "); // // int n = 1 << 27; // printf("n %d", n); // // float *x = new float[n]; // float *y = new float[n]; // // for (int i = 0; i < n; i++) { // ...
ALGO
0.888767
3.105698
cf76221c-6b1e-4566-88bd-eac77e2e207d
PBP-A-05/batikin-mobile
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.998733
6.76775
8e01dd3a-e356-4f09-aa17-d4b1b4908049
lead-afk/Mandelbrot-set-explorer
mandel win/mandel win - Copy.cpp
#include <thread> #include <iostream> #include <vector> #include <SFML/Graphics.hpp> #include <mutex> #include <cmath> #include <boost/multiprecision/cpp_dec_float.hpp> using namespace boost::multiprecision; using namespace std; const int WIDTH = 900; const int HEIGHT = 900; cpp_dec_float_50 minx = -3; cpp_dec_flo...
ALGO
0.998272
3.994569
2b44a5f2-c131-4099-9208-7d78e05b2acd
MWrobel92/SRPP-Kurierzy
src/RandomSolver.cpp
#include "RandomSolver.h" #include "Route.h" #include <vector> #include <cstdlib> using namespace std; RandomSolver::RandomSolver() { } RandomSolver::~RandomSolver() { } Solution* RandomSolver::process(InputData* input) { vector<Route*> routes; int k = input->getK(); vector<City*> cities = input->getCities(); C...
ALGO
0.994753
4.757904
77f72457-b7c0-4683-8735-511f6f0ba981
AafreenUCSD/mygraphlab
demoapps/rpc/rpc_example7.cpp
#include <iostream> #include <cstdio> #include <graphlab/serialization/serialization_includes.hpp> #include <graphlab/parallel/pthread_tools.hpp> #include <graphlab/rpc/dc.hpp> #include <graphlab/rpc/dc_dist_object.hpp> using namespace graphlab; template <typename T> class distributed_vector { private: dc_dist_obje...
TOOL
0.987469
5.131378
3917fbd2-3cf8-434e-b5f3-9c87b74a7036
martin-simeonov/NBU-programming
algorithms/sort_linear/stl_sort.cpp
#include <iostream> #include <algorithm> using namespace std; int a[1000000], n; bool mycmp(int i, int j) { return i < j; } int main() { int i; cin >> n; for(i = 0; i < n; i++) cin >> a[i]; if(n != 1) sort(a, a + n, mycmp); for(i = 0; i < n; i++) cout << a[i] << endl; }
ALGO
0.999639
3.795066
46449393-c235-44f0-9c62-20ee8256c50a
Staticshashwat/assignment_5
print_element_of_linked list.cpp
https://www.hackerrank.com/challenges/print-the-elements-of-a-linked-list/problem?isFullScreen=true #include <bits/stdc++.h> using namespace std; class SinglyLinkedListNode { public: int data; SinglyLinkedListNode *next; SinglyLinkedListNode(int node_data) { this->data = node...
ALGO
0.999448
5.721038
39aa5df9-ccce-4956-8fa5-289288d166d8
MdHamzaHossain/competitive-programming
solves/leetcode/2901_longest-unequal-adjacent-groups-subsequence-ii/CPP 2901_longest-unequal-adjacent-groups-subsequence-ii.cpp
// TODO class Solution { public: vector<string> getWordsInLongestSubsequence(vector<string> &words, vector<int> &groups) { int n = words.size(); auto canFormSequence = [](const string &left, const string &right) { if (left.size() != right.size()) { ...
ALGO
0.999953
5.922968
c9080b59-0227-4e3f-b256-db03ea89041b
raincross7/code-similarity
codes/train_code/problem186/problem186_56.cpp
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define sz(x) int(x.size()) using namespace std; typedef long long ll; typedef pair<int, int> P; const ll INF = 1LL << 60; ll N, K; vector<ll> A; int main() { cin >> N >> K; A.resize(N); rep(i, N) cin >> A[i]; // 最終的には全て1になる...
ALGO
0.999745
4.002206
132ad472-6ba4-48a5-b388-c864511973bf
bzz13/timus
1502/1502.cpp
#include <iostream> using namespace std; int main() { long long n; cin >> n; cout << n*(n+1)*(n+2)/2; }
ALGO
0.999838
3.919734
d31de75f-a0c7-446b-88b0-e9ec340bb8ce
Vaibhav10sept/DSA
LINKED LIST/linked-list-flattening-a-linked-list.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: int data; Node *right, *down; }; // Utility function to insert a node at // beginning of the linked list Node* push(Node* head_ref, int data) { // Allocate the Node & Put in the data Node* new_node = new Node(); new_node->data = data; new_nod...
ALGO
0.999963
4.413511
480717a8-8c17-4166-b784-4aa5f45f222a
Murasho7164/AtCoder2
240/240a.cpp
#include "bits/stdc++.h" using namespace std; #define rep(i,n) for (int i = 0 ; i < (n) ; i++) #define For(i,k,n) for (int i = k ; i < (n) ; i++) #define all(x) (x).begin(),(x).end() using P = pair<int, int>; typedef int long long ll; typedef vector<int> vi; typedef vector<ll> vl; const int mod = 1000000007; const int ...
ALGO
0.999878
4.887127
e36f48a8-fea2-41cb-8e0b-47184ea17f7b
MissGrass/c_language
c++7.19.cpp
//arfupt.cpp--an array of function pointers #include <iostream> const double * f1 (const double ar[], int n); const double * f2 (const double [], int); const double * f3 (const double *, int); using namespace std; int main() { double av[3] = {1112.3, 1542.6, 2227.9}; const double *(*p1)(const double *, int) = f1;...
TOOL
0.961334
5.376747
c61cd1ba-0b90-4958-8776-018ed5eadf63
ishandutta2007/codeforces
shnirelman/normal/1132/F.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string t; cin >> t; string s; s += t[0]; for(int i = 1; i < n; i++) { if(t[i - 1] != t[i]) s += t[i]; } n = s.length(); vector<vector<int>> dp(n, vector<int>(n, 0...
ALGO
0.999975
4.134577
c427651b-ef87-48a4-99aa-2bd57b3fb26a
ww5365/tiny_util
src/leetcode/cpp/leetcode_my/000_max_longest_palindrome.cpp
/* * 402 lintcode / leetcode: */ #include "01_all.h" #include <deque> #include <queue> #include <iostream> #include <limits> #include <vector> #include <unordered_set> #include <unordered_map> using namespace std; /* lintcode: 200 https://www.lintcode.com/problem/200/description leetcode: 5 https://leetcode.c...
ALGO
0.999699
6.030842
6a1c95be-9ae0-4f91-bc74-5d77746972c8
wifituga/TI-LenguajesProg
SobelLP/SobelLP/test.cpp
#include <iostream> #include "fMatrices.h" #include <opencv2/opencv.hpp> using namespace std; using namespace cv; int main() { int kernel; int tam; char pColor; int blur; int sobel; Mat fotito = imread("aa2.png"); Mat mImage; Mat mImage2; cout << "Grupo 3 | Lenguajes de programacio...
TOOL
0.966528
4.897381
bd5b58d7-9691-4cb7-b035-ee76871b3144
Fighohji/Competitive-Programming
Record/PassRecord/2023.11.1/H.cpp
#include <map> #include <set> #include <array> #include <cmath> #include <queue> #include <stack> #include <tuple> #include <bitset> #include <cctype> #include <cstdio> #include <random> #include <string> #include <vector> #include <cassert> #include <cstring> #include <iomanip> #include <limits.h> #include <iostream> ...
ALGO
0.990276
3.70012
92363fde-802a-4f21-b445-f9ba0f095bbf
Zero-Vec/cppACM
lanqiao/lanqiao_problem/test/2.1.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; void solve(){ string s; cin >> s; int a = 0, b = 0; for (int i = 0; i < s.size() - 1;i++){ if(i&1){ if(s[i]=='A') a++; else b++; } else{ if(s[i]=...
ALGO
0.999842
5.083007
8af1d3b1-ee80-46ee-8e8f-315b6b638efc
unclezhou486/ACM-Solutions
Mix/2024/牛客寒营3/智乃与瞩目狸猫_幸运水母_月宫龙虾.cpp
#include <bits/stdc++.h> using namespace std; void solve(){ string a,b; cin>>a>>b; if(a[0]>=97) a[0]-=('a'-'A'); if(b[0]>=97) b[0]-=('a'-'A'); if(a[0]==b[0]) cout<<"Yes\n"; else cout<<"No\n"; } int main(){ ios::sync_with_stdio(0); cin.tie(0),cout.tie(0); int t; cin>>t; whi...
ALGO
0.999988
6.022091
efb6572f-00d8-47ae-91e0-6527a2df9857
FJ98/CLionProjects-2019-1
PARALELA THREADS/hilosClase1/main.cpp
#include <iostream> #include <thread> #include <vector> #include <mutex> #include <future> #include <list> #include "Funciones.h" #include "LinkedListLock.h" #include "TBT.h" using namespace std; mutex mtx; void saludo(int i) { lock_guard<mutex> lock(mtx); cout << "Hilo #:" << i << endl; } void acumular(int& ...
TOOL
0.969883
4.041754
0ebdfcf9-9ebd-4a10-875b-9d01a5ff7032
ishandutta2007/codeforces
couplefire/normal/1562/B.cpp
#include <bits/stdc++.h> using namespace std; bool isP[100]; void solve(){ int n; string s; cin >> n >> s; for(int i = 0; i<n; ++i){ if(s[i]=='1' || s[i]=='4' || s[i]=='6' || s[i]=='8' || s[i]=='9'){ cout << 1 << '\n'; cout << s[i] << '\n'; return; } } ...
ALGO
0.999673
4.589899
21a8663d-a08b-44f5-bcc0-bb33467c59bb
ConanNobita/leetcode-myanswer
algorithm/052.LCR_Increasing_Order_Search_Tree.cpp
#include "common.h" #include "node.h" USESTD class Solution { public: TreeNode* increasingBST(TreeNode* root) { if (root == nullptr) { return nullptr; } int minValue = root->val; TreeNode* current = nullptr; TreeNode* minNode = nullptr; dfs(root, &current, &minNode, minValue); return minNode; } ...
ALGO
0.999991
6.656733
505c2a8a-0d2f-4c49-bb34-bc69b6d67cff
Aditya6112/Leetcode
324-wiggle-sort-ii/wiggle-sort-ii.cpp
class Solution { public: void wiggleSort(vector<int>& nums) { int n=nums.size(); sort(nums.begin(),nums.end()); vector<int>dummy(n); int i=1; int j=n-1; while(j>=0){ while(i<n){ dummy[i]=nums[j]; j--; i+=2; ...
ALGO
0.999997
5.540073
3f1f34ed-ba0b-4e4a-967d-298efae6905d
Coach-Academy/Spring-1-2024
Level 3/CPU - Regular - L3 - C101/Practice/Week 07/C - Learning Languages.cpp
#include <bits/stdc++.h> using namespace std; struct DSU { vector<int> par; int n; DSU(int n) : par(n), n(n) { iota(par.begin(), par.end(), 0); } int find(int u) { if (par[u] == u)return u; return par[u] = find(par[u]); } void join(int u, int v) { if ((u = find(u)) == (v = find(v))) return;...
ALGO
0.999739
3.960313
e7cff5a2-d109-4618-9032-b7ef9480b8d4
bencabrera/wikiMainPath
src/parsers/main_s3_parseAllLinks.cpp
// stdlib #include <iostream> #include <iomanip> #include <map> #include <future> #include <thread> #include <fstream> #include <functional> // xerces #include <xercesc/sax2/SAX2XMLReader.hpp> #include <xercesc/sax2/XMLReaderFactory.hpp> #include <xercesc/sax2/DefaultHandler.hpp> #include <xercesc/util/XMLString.hpp> ...
DATA
0.955368
4.49124
5d082e7a-3021-44ef-82e9-3f25023ebf06
Ayushrak/DSA-ROHIT-NEGI
RECURSION/Day 86/GenerateParathesis.cpp
#include<iostream> #include<vector> using namespace std; void parath(int n,int left,int right,vector<string>&ans,string &temp){ if(left+right==2*n){ ans.push_back(temp); return; } //Left if(left<n){ temp.push_back('('); parath(n,left+1,right,ans,temp); temp.pop_b...
ALGO
0.999554
4.131691
e49cf17b-6fc2-44cc-ba0c-d388f8711ace
ljw523054441/UE5SourceCodeLearning
Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/CCDUtilities.cpp
#include "Chaos/ParticleHandle.h" #include "Chaos/PBDCollisionConstraints.h" #include "Chaos/PBDRigidsEvolutionGBF.h" #include "Chaos/CollisionResolution.h" bool bChaosCollisionCCDEnableResweep = true; FAutoConsoleVariableRef CVarChaosCollisionCCDEnableResweep(TEXT("p.Chaos.Collision.CCD.EnableResweep"), bChaosCollisi...
TOOL
0.986792
6.80905
55a87ff5-1029-4a88-90ac-3732c8aedf3d
MichaelSedrak/Interactive-ARAP
ARAP/libs/libigl-2.2.0/include/igl/face_occurrences.cpp
#include <map> #include "sort.h" #include <cassert> template <typename IntegerF, typename IntegerC> IGL_INLINE void igl::face_occurrences( const std::vector<std::vector<IntegerF> > & F, std::vector<IntegerC> & C) { using namespace std; // Get a list of sorted faces vector<vector<IntegerF> > sortedF = F; f...
ALGO
0.981864
5.81774
d9d1b3f4-b505-4877-b7c7-f5de00bd3e3a
Time1ess/MyCodes
LeetCodeR2/747-Largest Number At Least Twice of Others/solution.cpp
class Solution { public: int dominantIndex(vector<int>& nums) { int n = nums.size(); if(n == 1) return 0; int mmax, second_mmax, idx; mmax = second_mmax = INT_MIN; for(int i = 0; i < n; i++) { if(nums[i] > mmax) { id...
ALGO
0.999989
5.88527
a0df9295-9a62-40a1-a5e3-682f4b27ec0f
nityaupd11099/Questions
A_Gregor_and_Cryptography.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { long long n; cin >> n; cout<<"2" <<" "<< n-1<<endl; } }
ALGO
0.999459
3.874338
7c9ccb08-9632-4682-922c-9a6d7a2410a7
jyqiu1216/Rino
sdk/boost_1_62_0/libs/graph/test/metis_test.cpp
#include <boost/graph/breadth_first_search.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/metis.hpp> #include <fstream> #ifdef BOOST_NO_EXCEPTIONS void boost::throw_exception(std::exception const& ex) { std::cout << ex.what() << std::endl; abort(); } #endif using namespace boost; /* An ...
ALGO
0.998303
5.490001
7b83b2a3-31e7-4ed4-b43f-cfb590b28636
roy7077/POTD-gfg
Sorted insert for circular linked list.cpp
// Time complexity - O(N) // Space complexity- O(1) class Solution { public: Node *sortedInsert(Node* head, int data) { if(!head) { Node *temp = new Node(data); temp->next = temp; return temp; } Node* h=head->next; Node* p...
ALGO
0.999983
5.632555
5df0e986-f42c-4c90-b3a6-fb9d53116023
bishavro1/Algorithm-lab
Quicksort.cpp
#include<bits/stdc++.h> using namespace std; int partition_array(int arr[], int start, int end){ int pivot = arr[end]; int partition_index = start; for(int i=start; i<end; i++){ if(arr[i]<= pivot){ swap(arr[i], arr[partition_index]); partition_index++; } } sw...
ALGO
0.999973
5.391753
7366227f-8772-485d-8804-5bef5976b0be
jih189/fixtureless_fixturing_place_and_pick_re-grasping
perception/include/igl/copyleft/cgal/component_inside_component.cpp
#include "order_facets_around_edge.h" #include "../../LinSpaced.h" #include "points_inside_component.h" #include <CGAL/AABB_tree.h> #include <CGAL/AABB_traits.h> #include <CGAL/AABB_triangle_primitive.h> #include <CGAL/Exact_predicates_exact_constructions_kernel.h> #include <cassert> #include <list> #include <limits>...
ALGO
0.990441
6.878416