uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
13dafd1e-2756-48e5-8eb3-578eea8177d1
ambika-garg/-6Companies30days
Walmart/06_Kth smallest element.cpp
Problem Link: https://practice.geeksforgeeks.org/problems/kth-smallest-element5635/1/ ------------------------------------------------------------------------------------------------ class Solution{ public: // arr : given array // l : starting index of the array i.e 0 // r : ending index of the array i...
ALGO
0.99999
4.977687
3839171f-0288-4493-a548-ce97bd015525
julianblanco/objeeAirlines
Archive/Arduino/Car/ObjectOreinted/TestCode/testdriveOO/ControlOutputs00.cpp
#include "ControlOutputs.h" //=================================================================== // // Program: ControlOutputs.cpp // // Author: Julian Blanco // Date: Sep 4 2015 // // Description: Description // //=================================================================== void execute_control(float he...
ALGO
0.998369
4.155538
3f565e69-2187-4968-9f33-ce21340518da
kmjp/procon
yuki/0001-1000/001-100/061.cpp
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<to;x++) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINU...
ALGO
0.999328
3.9607
4da3eb17-4c7a-4444-a309-e688efc17ec2
grantgib/five-link_alip_mpc
external_packages/casadi-linux-matlabR2014b-v3.5.5/include/casadi/core/norm.cpp
#include "norm.hpp" using namespace std; namespace casadi { Norm::Norm(const MX& x) { set_dep(x); set_sparsity(Sparsity::scalar()); } std::string NormF::disp(const std::vector<std::string>& arg) const { return "||" + arg.at(0) + "||_F"; } int NormF::eval(const double** arg, double** res, casad...
TOOL
0.989516
6.172164
f92ebdd2-f9f3-4d75-a95d-bf683e5a9c3e
ShailavMalik/DSA
Dynamic Allocation/3-Dynamic_array.cpp
#include <iostream> using namespace std; int main() { int n; cin>>n; int * arr=new int [n]; for(int i=0;i<n;i++) { arr[0]=i*10; } for(int i=0;i<n;i++) { cout<<arr[i]<<" "; } return 0; }
ALGO
0.995202
3.250235
1b6c7eae-1322-4e39-a937-65d19fe4b359
richeytastic/rimg
src/DistanceTransform.cpp
#include "DistanceTransform.h" using rimg::DistanceTransform; #define INF INT_MAX >> 2 #define SQUARE( x)( (x)*(x)) void calcPhase1Distance( int* inArray, int n, int stepSz) { const int maxn = n * stepSz; int d = 0, dsum = INF; // Large enough! int a = -1, k; for ( int i = 0; i < maxn; i += stepSz) ...
ALGO
0.999928
6.658448
ae3aaf7e-3794-4f5d-836c-5a80c83d0dc1
x1314aq/dsa
51nod/1130.cpp
// // 51nod 1130 N的阶乘的长度 V2 // #include <bits/stdc++.h> using namespace std; using ull = unsigned long long; const double pi = 3.14159265358979; const double le = 0.43429448190325; int main() { int t; cin >> t; while (t--) { int n; cin >> n; double res = log10(2.0 * pi * n) / 2.0 ...
ALGO
0.999605
4.689104
458c221b-4a87-4ed5-b998-b13f736cdf49
nardo0905/CS-Uni-Course-Git
230106 Pract/task3.cpp
#include <iostream> bool isPrimeRec(int num, int currCheck) { if (num == 1) return false; if (num % currCheck == 0) return false; isPrimeRec(num, currCheck + 1); return true; } bool isPrime(int num) { return isPrimeRec(num, 2); } int main() { std::cout << isPrime(6); return 0; }
ALGO
0.999679
5.417043
f3d7523c-8d9b-498a-aac2-1a4e1033b0a1
yashsiwach/Leetcode-CPP
95-unique-binary-search-trees-ii/unique-binary-search-trees-ii.cpp
class Solution { public: vector<TreeNode*> generateTrees(int n) { return n ? generate_trees(1, n) : vector<TreeNode*>(); } private: vector<TreeNode*> generate_trees(int start, int end) { if (start > end) return {nullptr}; vector<TreeNode*> all_trees; for (int i = start; i <...
ALGO
0.999865
7.041385
4d16ae2c-7f17-4eed-8eee-7f19e2615056
xdandroid/frameworks_base
opengl/libagl/matrix.cpp
#include <stdlib.h> #include <stdio.h> #include "context.h" #include "fp.h" #include "state.h" #include "matrix.h" #include "vertex.h" #include "light.h" #if defined(__arm__) && defined(__thumb__) #warning "matrix.cpp should not be compiled in thumb on ARM." #endif #define I(_i, _j) ((_j)+ 4*(_i)) namespace android...
TOOL
0.931004
6.465521
d9a293fc-cccb-41d6-bc2e-1fa5f513474f
NoSpamDan/external_pdfium
core/src/fxcodec/codec/fx_codec_fax.cpp
#include "codec_int.h" #include "core/include/fxcodec/fx_codec.h" namespace { const uint8_t OneLeadPos[256] = { 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,...
ALGO
0.980314
4.766433
8e8fc234-369d-4361-bb0f-9332dc1c9844
anidub/CPP
String/FirstUniqueChar.cpp
#include <iostream> #include <climits> #include <algorithm> #include <numeric> #include <vector> #include <stack> #include <utility> #include <string.h> #include <unordered_map> #include <queue> using namespace std; /*https://leetcode.com/problems/first-unique-character-in-a-string/ * Given a string s, find the first...
ALGO
0.999105
5.355281
70430746-8875-4d9e-9e75-80ccbf0393da
kushgupta-official/All_Programs
LeetCode/Majority Element.cpp
class Solution { public: int majorityElement(vector<int>& nums) { int n=nums.size(); int cnt=0,ele=0; for (int i=0;i<n;i++){ if (cnt==0) ele=nums[i]; if (nums[i]!=ele) cnt--; else cnt++; } ret...
ALGO
0.999959
5.540692
067df6b6-8a19-406c-8283-e6d19185d7cb
Mudassir704/SdeSheetChallenge
Day8/Maximum Consecutive Ones.cpp
int longestSubSeg(vector<int> &arr, int n, int k) { int j = 0; int cnt = 0, mx = 0; for (int i = 0; i < n; i++) { if (arr[i] == 0) cnt++; while (cnt > k) { if (arr[j] == 0) cnt--; j++; } mx = max(mx, i - j + 1); ...
ALGO
0.999948
5.008278
28b02006-b506-4270-8041-7a0ef8695d43
bappi2097/ACM-Problem-Solving
Practice/Vector/stl-5.cpp
//Ascending Order #include<iostream> #include<vector> #include<iterator> #include<algorithm> using namespace std; int main() { vector <int> vec; vector<int>::iterator it; vec.push_back(10); vec.push_back(123); vec.push_back(3); vec.push_back(15); vec.push_back(44); vec.push_back(96); ...
ALGO
0.999218
4.687228
acba6a1d-3dde-43c6-be72-cbb5324aee01
ash956901/ImprovingDSA
123-best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii.cpp
class Solution { public: int solve(int idx, int canBuy, int cap, vector<int>& prices, vector<vector<vector<int>>>& dp) { if (idx == prices.size() || cap == 0) return 0; if (dp[idx][canBuy][cap] != -1) return dp[idx][canBuy][cap]; int profit = 0; if (canBuy) { int buy = ...
ALGO
0.999984
6.246053
a258dbf6-3dec-4cf2-806c-41b2d2ad545b
dddql/cpp
Algorithm/Recurrence/P1990.cpp
#include <cstdio> const int MAXN = 10; int n; int a[MAXN], sum[MAXN]; int count(int n) { a[0] = 1; a[1] = 1; a[2] = 2; /* sum[0] = 1; sum[1] = 2; sum[2] = 4; */ if (n == 0 || n == 1 || n == 2) return n; //*a[i]-a[i-1]化简得递推式 for (int i = 3; i <= n; i++) ...
ALGO
0.999964
3.892272
5376cb99-b15d-4eb8-b26c-5c108b9e1c70
FlowSight/coding
blind75/16_course_schedule.cpp
class Solution { public: typedef vector<int> vi; typedef vector<vi> vvi; bool canFinish(int n, vector<vector<int>>& preReq) { vvi g(n,vi()); vi ind(n,0); for(const auto& it : preReq){ g[it[1]].push_back(it[0]); ind[it[0]]++; } queue<int> q; ...
ALGO
0.99979
6.442276
58e037ba-4691-4f80-95bd-5f51ae962d1d
EmamulArefin/Compiler-Design
Lab-2 Mid/OperatorOr_Not.cpp
#include<bits/stdc++.h> using namespace std; bool operator_Check(char a) { char ab[]={'+','-','/','%','=','*'}; for(int i=0;i<6;i++) { if(a==ab[i]) { return true; } } return false; } void final_check(string a) { set<char>c; for(int i=0;i<a.length();i++...
ALGO
0.999707
4.362175
94d74959-9aac-4b88-a62f-3c3802f54969
ishmeetkohli/SketchBasedImplicitBlending
lib/libigl/include/igl/min_quad_with_fixed.cpp
#include "slice.h" #include "is_symmetric.h" #include "find.h" #include "sparse.h" #include "repmat.h" #include "matlab_format.h" #include "EPS.h" #include "cat.h" //#include <Eigen/SparseExtra> // Bug in unsupported/Eigen/SparseExtra needs iostream first #include <iostream> #include <unsupported/Eigen/SparseExtra> #i...
ALGO
0.999761
5.402625
7b1d2884-d742-41f1-8149-e48eb0db0491
Liesegang/Procon
AtCoder/dp/b.cpp
#include <bits/stdc++.h> using namespace std; // Type alias using ll=long long; using ld=double; using pi=pair<int,int>; using pll=pair<ll,ll>; using pld=pair<ld,ld>; using ti3=tuple<int, int, int>; using vi=vector<int>; using vll=vector<ll>; using vld=vector<ld>; using vpi=vector<pi>; using vpll=vector<ll>; using v...
ALGO
0.999974
4.210174
5d8c7c3b-c7d4-440c-b70d-f6ca3ac1a433
nearlyeveryone/tsp-genetic-algorithm
545_4/City.cpp
#include "City.hpp" #include <cmath> using namespace std; double City::DistanceTo(City c) const { return sqrt(pow(c._latitude - this->_latitude,2) + pow(c._longitude - this->_longitude,2)); } double City::DistanceFromEdge(City s, City t) { double a, b, d; //http://mathworld.wolfram.com/Point-LineDistance2-Dime...
ALGO
0.985709
4.026823
52e1f237-079c-47db-8dc8-a3e3dab7a5cd
ishandutta2007/codeforces
farhod_farmon/normal/990/E.cpp
#include <bits/stdc++.h> #define fi first #define se second #define fin(s) freopen( s, "r", stdin ); #define fout(s) freopen( s, "w", stdout ); const long long N = 1000010; const long long Q = 100000001; const long long mod = 1e9 + 7; const long long MAGIC = 30; using namespace std; int n; int m; int k; int last[N]...
ALGO
0.999931
3.816828
36e0aba1-0a87-4cd3-adf8-7ddc23dfa56d
Basil-Ismail/CPP_modules_42
CPP09/ex01/models/RPN.cpp
#include <RPN.hpp> RPN::RPN() { } RPN::RPN(const RPN &obj) : _operationsStack(obj._operationsStack) { } RPN::~RPN() { } RPN::RPN(std::string expression) { validateExpression(expression); } void RPN::validateExpression(std::string &expression) { size_t index = expression.find_first_not_of(" +-/*0123456789")...
ALGO
0.932647
4.88898
21f5da28-a214-48ff-ad0e-b74f0b3927af
namhyun-gu/learn-c
Study/c/2/3_if_and_switch.cpp
#include <stdio.h> int main() { int a, b; scanf_s("%d", &a); scanf_s("%d", &b); if (a > b) { printf("A B ũ\n"); } else { printf("A B ۴\n"); } int c; scanf_s("%d", &c); switch (c) { case 0: printf("%d\n", a + b); break; case 1: printf("%d\n", a - b); break; case 2: printf("%d\n", a * b); ...
ALGO
0.999269
3.895947
208a1e8e-7f80-4d9b-8d61-ee5bb907120c
isym444/Competitive-Programming-Solved-Problems
A_Word.cpp
/* #include <bits/stdc++.h> */ #include <cstdio> #include <algorithm> #include <iostream> #include <vector> #include <string> #include <ctype.h> using namespace std; /* using std::vector; */ #define fo(i, n) for (i = 0; i < n; i++) #define ll long long #define sz(x) (int)(x).size() #define mp make_pair typedef pair<...
ALGO
0.99964
4.874413
831eda37-175f-4d32-8bc5-db1b8ccd4d00
PKUcoldkeyboard/LOG-Means
third-party/eigen-3.4.0/bench/eig33.cpp
#include <iostream> #include <Eigen/Core> #include <Eigen/Eigenvalues> #include <Eigen/Geometry> #include <bench/BenchTimer.h> using namespace Eigen; using namespace std; template<typename Matrix, typename Roots> inline void computeRoots(const Matrix& m, Roots& roots) { typedef typename Matrix::Scalar Scalar; con...
ALGO
0.99924
5.646229
18545215-2bff-4d4c-ba7d-f63151043da6
YaseenMughal/Frivia_App
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.99887
6.783439
4dc6f92d-5919-4a8a-ba26-6616dd9a0b0e
ANI-IN/leetcode
0713-subarray-product-less-than-k/0713-subarray-product-less-than-k.cpp
class Solution { public: int numSubarrayProductLessThanK(vector<int>& nums, int k) { if (k <= 1) return 0; int n=nums.size(); long long prod=1; int i=0,j=0; int ans=0; while(j<n) { prod=prod*nums[j]; whi...
ALGO
0.999911
5.41704
66d46909-c0bb-4b7b-9c33-05bb8cc6f68b
RickyLiu0w0/myLeetCodeCode
cpp/373_查找和最小的-k-对数字.cpp
/* * @lc app=leetcode.cn id=373 lang=cpp * * [373] 查找和最小的 K 对数字 */ #include "AllInclude.h" // @lc code=start class Solution { public: vector<vector<int>> kSmallestPairs(vector<int>& nums1, vector<int>& nums2, int k) { vector<vector<int>> res; struct cmp { bool operator()(const pair...
ALGO
0.999956
6.021414
c7d61a04-25a8-406b-b17f-1643793fbb4f
Luckitas1986/FaceDetection
modules/cudabgsegm/src/mog.cpp
#include "precomp.hpp" using namespace cv; using namespace cv::cuda; #if !defined HAVE_CUDA || defined(CUDA_DISABLER) Ptr<cuda::BackgroundSubtractorMOG> cv::cuda::createBackgroundSubtractorMOG(int, int, double, double) { throw_no_cuda(); return Ptr<cuda::BackgroundSubtractorMOG>(); } #else namespace cv { namespac...
ALGO
0.885337
6.909103
35d00797-451e-40c2-901b-0848c69621f8
ScripterAnmol/Codeforces_Practice
D. Epic Transformation Round 710 Codeforces/main.cpp
#include <bits/stdc++.h> using namespace std; // #define ll long long #define ll int #define dd double #define vl vector<ll> #define vvl vector<vl> #define vd vector<dd> #define vvd vector<vd> #define loop ll t; cin>>t; while(t--) #define all(a) a.begin(), a.end() #define sz 100005 #define MOD 1000000007 #define debug ...
ALGO
0.999927
3.68102
06bceda3-bb00-416a-a674-b4ce554d1d71
akshitagupta03/learningDSA
08_strings/04_leetcode151.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: string reverseWords(string s) { vector<string> v; int j = 0; string temp = ""; for(int i=0; i<s.length(); i++) { if(s[i] == 32 && temp != "") { v.push_back(temp); ...
ALGO
0.999972
4.737125
0ecf525c-a1d3-4d41-9cdc-9ee77cebe4a0
willing827/lyCommon
include/sqthird/soui/third-part/skia/src/gpu/effects/GrConvexPolyEffect.cpp
#include "gl/builders/GrGLProgramBuilder.h" #include "GrConvexPolyEffect.h" #include "gl/GrGLProcessor.h" #include "gl/GrGLSL.h" #include "GrTBackendProcessorFactory.h" #include "SkPath.h" ////////////////////////////////////////////////////////////////////////////// class GLAARectEffect; class AARectEffect : publi...
TOOL
0.921404
7.420825
b85075a5-bc1d-4b56-a5a2-0ae944275a7c
caduud/Algoritimos
Tarefa1/AreaDoCirculo.cpp
#include <iostream> #include <cmath> #include <iomanip> using namespace std; int main( ){ double raio, area, n; cin >> raio; n = 3.14159; area = n * pow(raio, 2); cout << "A=" << fixed << setprecision(4) << area << endl; }
ALGO
0.992248
4.177558
7e1a4489-214f-4f88-a341-59699c44d71e
akansha2002/LeetCode
0958-check-completeness-of-a-binary-tree/0958-check-completeness-of-a-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.996291
6.425598
c5e6df3a-862c-4f69-a76f-983923631594
tylerashcraft/ganbareru
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
50cd326d-8b7f-4b28-8981-f9500df7ab7c
thomas-moulard/visp-deb
src/math/kalman/vpKalmanFilter.cpp
/*! \file vpKalmanFilter.cpp \brief Generic kalman filtering implementation. */ #include <visp/vpKalmanFilter.h> #include <math.h> #include <stdlib.h> /*! Initialize the Kalman filter. \param size_state : Size of the state vector \f${\bf x}_{k}\f$ for one signal. \param size_measure : Size of the measu...
ALGO
0.994356
5.131512
161aa430-0f91-433c-8057-c62ed5040bc1
hamzahasann/CPlates
CHT.cpp
#include<bits/stdc++.h> using namespace std; // Line, x -> Line useful x onwards struct Line{ long long m,c; Line(long long _m,long long _c){ m=_m;c=_c; }long long eval(long long x){ return m*x+c; }long long intersect(Line l2){ return (l2.c-c+m-l2.m-1)/(m-l2.m); } }; deque<...
ALGO
0.993759
3.432132
f0692fb8-5abb-4fed-a61f-9b079f593dc3
TabotCharlesBessong/C-C-Related-Project-
Charles/Project3/fcfs.cpp
#include<iostream> #include <algorithm> #include<iomanip> using namespace std; struct process_struct { int pid; int at; //Arrival Time int bt; //CPU Burst time int ct,wt,tat,rt,start_time; // Completion, waiting, turnaround, response time }ps[100]; //Array of structure to store the inf...
ALGO
0.999722
4.39298
c03fe928-e3c6-40f8-a969-860957f7a631
yoogledev/DataStructure
BinaryTree/BinaryTree/BinaryTree.cpp
#include "BinaryTree.hpp" #include <iostream> #include <stdlib.h> BTreeNode * MakeBTreeNode(void){ BTreeNode * nd = new BTreeNode; nd -> left = NULL; nd -> right = NULL; return nd; } BTData GetData(BTreeNode * bt){ return bt -> data; } void SetData(BTreeNode * bt, BTData data){ bt -> data = d...
ALGO
0.996802
3.882579
5623fdbe-7913-4475-abd4-9140dee47e35
SetsunaChyan/OI_source_code
CF1102C.cpp
#include <cstdio> int n,x,y,k=0; int main() { scanf("%d%d%d",&n,&x,&y); if(x>y) { printf("%d",n); return 0; } for(int i=0;i<n;i++) { int g; scanf("%d",&g); if(g<=x) k++; } printf("%d",(k+1)/2); return 0; }
ALGO
0.999939
3.215003
ca665bb9-ae53-4de2-a8d1-52d70d473e2a
SavioCartaxo/Estudos-de-CPP
Beecrownd/2783.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, c, m; cin >> n >> c >> m; vector<int> lc(c); for (int i = 0; i < c; i++) { cin >> lc[i]; } for (int i = 0; i < m; i++) { int it; cin >> it; auto it_pos = find(lc.begin(), lc.end(), it); ...
ALGO
0.999869
3.737304
877f250c-8db3-4993-9fd0-c012e8470e55
palilo815/ps
baekjoon/1000/1114.cpp
#include <bits/stdc++.h> using namespace std; const int mxK = 1e4; int L, K, C, a[mxK + 1]; bool solve(int m) { for (int i = 0, cnt = 0, sum = 0; i < K; ++i) { if (sum + a[i] > m) { if (++cnt > C) return false; sum = 0; } sum += a[i]; } return true; } int m...
ALGO
0.999985
4.527113
c552e6f3-dac6-4ba4-a308-17f4827cac3e
HelioStrike/AtCoder
dpe.cpp
#include <bits/stdc++.h> #define FOR(i,a,b) for(ll i = (a); i < (b); i++) #define ll long long #define N 101 #define V 100010 using namespace std; ll n,w,v,x; int main() { cin>>n>>w; ll its[n][2]; FOR(i,0,n) cin>>its[i][0]>>its[i][1],v+=its[i][1]; ll inf,dp[n+1][v+1]; inf=1e14; FOR(i,0,n+1) F...
ALGO
0.999995
3.996297
68d52749-0e5f-4722-923d-77cef34d9b99
TanviDeshmukh23/Codes
program210.cpp
/* iRow = 4 iCol = 4 * * * * * * * * * * * * * * * * */ #include<iostream> using namespace std; void Display(int iRow, int iCol) { int i = 0; int j = 0; for(i =1; i<= iRow; i++) { for(j =1; j<= iCol; j++) { cout<...
ALGO
0.94025
3.868152
ba4e9cdd-434a-44f2-b7d3-140c53853144
Ruchanov/Algorithms-and-Data-Structures
lab2/C3.cpp
#include<iostream> using namespace std; struct ListNode{ int val; ListNode* next; ListNode(){ this->val = 0; this->next = nullptr; } ListNode(int val){ this->val = val; this->next = nullptr; }ListNode(int val, ListNode* next){ this->val = val; th...
ALGO
0.999902
3.832927
d6342737-78ed-4da9-8ab4-aba8b33e6456
TochusC/aspera2algorithm
Part1-BasicAlgorithm/MergeSort/787-mergeSort/mergeSort.cpp
#include <cstdio> #define MAX 100010 int arr[MAX]; int* mergeSort(int *arr, int size){ int mid = size/2; int *leftArr, *rightArr; if(mid > 1){ leftArr = mergeSort(arr, mid); rightArr = mergeSort(arr + mid, size - mid); } else{ leftArr = new int(arr[0]); if(size - m...
ALGO
0.999964
4.254561
88db46aa-9b19-4a33-b80a-02d80b8fc746
egekabas/Competitive-Programming-Solutions
codeforces/egekabas/normal/1292/C.cpp
#include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define mp make_pair using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<ull, ull> pull; typedef pair<ll, ll> pii; typedef pair<ld, ld> pld; ...
ALGO
0.999362
4.0518
fd368aea-16e6-43b8-b974-fbf4e42a400e
khushivj711/c-Basics
first.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; int main() { // int age; // cin>> age; // if(age>18){ // cout<<"yes ! you are an adult" <<endl; // } // else{ // cout<<"you are not adult" ; // } // int marks; // cin >> marks; // if (marks < 25) /...
TOOL
0.972563
3.215934
6c4eb163-c5d7-41dc-ad3d-5cf229aa58ad
Soumithra-DNS/Problem_Solving
Codeforces/A. Polycarp and Coins.cpp
#include<iostream> using namespace std; int main() { int t; cin >> t; while(t--){ int n,a,b; cin >> n; if(n%3==0){ a=b=n/3; } else if((n+1)%3==0){ a=n/3 +1; b=n/3; } else if((n+2)%3==0){ a=n/3; ...
ALGO
0.99993
3.685596
d8c02284-ee5f-456d-b967-07116ef6ae69
StanleyJo-37/competitive-programming-chatbots-comprasion
submissions/deepseek/sub217.cpp
#include <iostream> #include <vector> #include <numeric> using namespace std; int main() { int n; cin >> n; vector<long long> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } // Calculate the total sum of the array long long total_sum = accumulate(a.begin(), a.end(), 0LL); ...
ALGO
0.999989
4.677968
fa29856f-269e-4f12-b9fe-7917c26c5430
kevinfrancis/practice
arrays/dutch_flag_partition.cpp
#include <iostream> #include <vector> using namespace std; template <typename T> void print_vector(vector<T> &v) { for (typename vector<T>::iterator it = v.begin(); it != v.end(); it++) { cout << *it << " "; } cout << endl; } /** * Partition an array of elements using a pivot, * such that the r...
ALGO
0.999616
5.323621
b9049ac3-bb85-47e0-94b3-e3d78aeb0cfe
mfooo/wow
src/bindings/Scriptdev2/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
/* ScriptData SDName: Boss_Emperor_Dagran_Thaurissan SD%Complete: 90 SDComment: With script for Moria SDCategory: Blackrock Depths EndScriptData */ #include "precompiled.h" #include "blackrock_depths.h" enum eEmperor { FACTION_NEUTRAL = 734, SAY_AGGRO = -1230001, SAY_SLAY ...
TOOL
0.910567
6.345376
ab2c1987-9d22-470f-bde8-70c12c6f8e66
hajimeIppo-cmd/cp-codes
Baekjoon OJ/16000-16999/16929.cpp
#define _USE_MATH_DEFINES #include <bits/stdc++.h> #include <cassert> using namespace std; #define ll long long #define ull unsigned long long #define ld long double #define pii pair<int, int> #define pll pair<ll, ll> #define fr first #define sc second #define vt vector #define all(c) (c).begin(), (c).end() #define sz...
ALGO
0.999974
4.802666
244c95d4-9339-4b05-b86e-bc7a3e2b3a7d
yzzupgo/MFTCG
Data/abc170_b/nabeko/ac/14316965.cpp
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x, cin >> y; for (int i = 0; i < x + 1; i++) { if ((2 * i) + (4 * (x - i)) == y) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; }
ALGO
0.999959
3.272559
46eaa18a-eab0-4045-9553-4ab2e810fd0e
Rajveer100/CSES-ProblemSet
SortingAndSearching/DistinctNumbers.cpp
#include <algorithm> #include <array> #include <chrono> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <string> #include <time.h> #include <unordered_map> #include <unordered_set> #include <vector> ...
ALGO
0.998922
5.494438
9794e13d-2f6e-499a-8b9c-d9f728966dbe
manikanta2901/CCC
.history/Day 3/Practice/Answers/Caesar Cipher_20210307165719.cpp
// // // #include <cmath> // // // #include <cstdio> // // // #include <vector> // // // #include <iostream> // // // #include <algorithm> // // // using namespace std; // // // int main(){ // // // int size,k; // // // string word; // // // cin >> size >> word >> k; // // // for (int i = 0; i <= siz...
ALGO
0.999875
4.226042
7087b408-3fec-4224-bc25-01168617971c
dvaitam/codeforces
1000-1999/1100-1199/1180-1189/1187/solC.cpp
//...author:MAUNIE...// #include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; vector<int> a(n); vector<bool> s(n); vector<int> t(m), l(m), r(m); for (int i = 0; i < n; i++) { a[i] = 0; } for (int i = 0; i < m; i++) { ...
ALGO
0.999986
3.535852
4468ba5a-5dc6-4f5f-abed-ab110c78e810
abdulrehmannl/Rock-Paper-Scissors-WASM
game.cpp
#include<iostream> #include<cstdlib> #include<ctime> using namespace std; char getComputerChoice() { char choices[3] = {'s', 'p', 'z'}; return choices[rand() % 3]; } string determineWinner(char user, char computer) { if (user == computer) { return "It's a tie!"; } else if ((user == 's' && com...
ALGO
0.997705
4.858765
723ce163-92ae-4016-9ec2-5f9af64ed8a2
ayushjha119/DSA
bfs_short_path_unit_wt.cpp
#include <iostream> #include <bits/stdc++.h> #include <queue> #include <cmath> using namespace std; #define pi (3.141592653589) //#define int long long int #define mod 1e9+7 #define float double #define pb push_back #define mp make_pair #define min3(a,b,c) min(c,min(a,b)) #define min4(a,b,c,d) min(d,min(c,min(a,b))) ...
ALGO
0.99986
4.592051
2cb336ed-a50d-4f61-9345-b91e1d9d14ff
chongrufan123/leedcode
exam_bank/bupt_3.cpp
// 树查找 // https://www.nowcoder.com/practice/9a10d5e7d99c45e2a462644d46c428e4 // Hard #include <iostream> #include <vector> using namespace std; int main(){ int n; vector<pair<int, int> > vp; pair<int, int> p; int deep; while(cin >> n){ for(int i = 0; i < n; ++i){ cin >> p.first...
ALGO
0.999608
4.019865
fb280674-256f-4638-b1d6-71d4eb27065b
trunghai95/MyCPCodes
20171015/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 1e5; int test, n, q; ll a[MAXN+2], h[MAXN+2], x, wf[MAXN+2], sumh[MAXN+2]; int main() { scanf("%d", &test); h[0] = 1e18; a[0] = -1; while (test --> 0) { scanf("%d", &n); for (int i = 1; i <= n; ++...
ALGO
0.999943
3.465691
6f660543-182a-4123-baa2-c47c5c31513d
raghavraj-27/dsa
2611-mice-and-cheese/2611-mice-and-cheese.cpp
class Solution { public: int miceAndCheese(vector<int>& reward1, vector<int>& reward2, int k) { priority_queue<pair<int, int>> maxHeap; int n = reward1.size(); int total = accumulate(reward2.begin(), reward2.end(), 0); for(int i=0; i<n; i++) { maxHeap.pu...
ALGO
0.999962
5.354407
e4e11f45-f843-408c-ae04-8bec1e180883
kaniz-codes/codeforces-contests-solve
b.cpp
#include <iostream> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; int left = 1, right = n; for (int i = 1; i <= n; ++i) { if (i % 2 == 1) { cout << left++ << " "; } else { cout << ri...
ALGO
0.999978
4.795617
52921992-e6d2-4b66-b3ca-fcc4b13db607
ku-dml/SDsystem
OGDF/src/ogdf/cluster/CPlanarEdgeInserter.cpp
#include <ogdf/basic/FaceArray.h> #include <ogdf/basic/Queue.h> #include <ogdf/cluster/CPlanarEdgeInserter.h> #include <ogdf/fileformats/GraphIO.h> namespace ogdf { //Note that edge insertions in cluster (sub)graphs are always performed //on already embedded graphs with modeled cluster boundaries void CPlanarEdgeInse...
ALGO
0.995752
6.082718
cb4b4eef-2731-47b2-a4c9-17517c31a19a
scriptum/Cheetah-Texture-Packer
src/imagecrop.cpp
#include "imagepacker.h" #include <QHash> #define CMPF1(x,y,a) qAlpha(img.pixel(x,y)) > a #define CMP(x,y,a) if(CMPF1(x,y,a)) {t = false; break;} if(!t) break; #define CMPF2(x,y) img.pixel(x,y) != pix #define CMP2(x,y) if(CMPF2(x,y)) {t = false; break;} if(!t) break; //auto-cropping algorithm QRect ImagePacker::crop(c...
TOOL
0.967823
4.328511
51e9955e-59f1-42ba-98c1-48844ee972f4
NavdeepKaurRupaul/IP-DSA
14 BINARY TREE/Find a node.cpp
#include <iostream> #include <queue> template <typename T> class BinaryTreeNode { public : T data; BinaryTreeNode<T> *left; BinaryTreeNode<T> *right; BinaryTreeNode(T data) { this -> data = data; left = NULL; right = NULL; } }; using namespace std; BinaryTreeNode<int...
ALGO
0.999991
4.923818
630d852a-b5ff-49f7-9871-a0071e36137b
fuxiang90/code-fuxiang90
cpp/acm/programming2013-4-13-b.cpp
#include <iostream> #include <map> #include <cstring> #include <vector> #include <cstdio> using namespace std; const int N = 50000 + 10; int n,m; char src[N]; char dest[N]; int main() { freopen("in","r",stdin); int t; scanf("%d",&t); //while(getchar() != '\n'); for(int i =1 ; i <= t ; i ++){ ...
ALGO
0.999852
3.923033
f7a4ceb9-927f-404b-a9fc-f3450fa3ccff
Pritha18/CPPCoding
Imran/7.Pyramid/7.7.1.cpp
/* 7.7. 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 */ #include <iostream> using namespace std; int main(int argc, char const *argv[]) { int num; cout << "Enter the value of num: "; cin >> num; cout << endl << endl; ...
ALGO
0.999922
4.931881
ef3637fb-e3ea-45dc-a124-240f694f8379
keisuke90/AtCoder
beginnersSelection/abc086a.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int a, b; cin >> a >> b; if(a*b % 2 == 0){ cout << "Even" << endl; } else { cout << "Odd" << endl; } }
ALGO
0.999995
4.672076
e9dc7953-224b-4566-80cd-248b634ff62b
lerrorgk/LeetCode
19. 删除链表的倒数第 N 个结点/main.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* removeNthFr...
ALGO
0.999975
5.909514
d0379978-65c9-45a3-aecf-3cacd4da9d07
plantom03/C
001_Interveiw/Test.cpp
include<iostream> #include<thread> #include<mutex> #include<condition_variable> using namespace std; mutex m; condition_variable cond; int flag=10; void fun(int num){ for(int i=0;i<50;i++){ unique_lock<mutex> lk(m);//A unique lock is an object that manages a mutex object with unique ...
TOOL
0.886139
3.598895
3c5f8d1e-3993-4a75-b47e-6548610e6a24
IronMan1612/DeliveryFood
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.99887
6.783439
217628c3-265f-4166-94b9-37ca933eed0e
lotfi10/eyes-free
ocr/ocrservice/jni/opticalflow/feature_detector.cpp
// Author: Andrew Harp // // Various feature detecting functions. #include <float.h> #include "utils.h" #include "time_log.h" #include "image.h" #include "feature_detector.h" // Threshold for pixels to be considered different. #define FAST_DIFF_AMOUNT 10 // How far from edge of frame to stop looking for FAST featu...
ALGO
0.983232
5.417886
fb16489b-53d1-4513-8793-7474f3c82761
cup2of2tea/CompetitiveProgramming
codeforces/Codeforces_Beta_Round_#42_(Div_2)/A_Football.cpp
#include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { int nb; cin>>nb; vector <string> v; v.resize(nb); for(int c=0;c<nb;c++) cin>>v[c]; sort(v.begin(),v.end()); int max=-1; string maxi; int current=0; for(int c=0;c<v.size();c++) ...
ALGO
0.999819
3.830892
3c3120e6-9bc1-469d-b9fc-fd27e38190aa
clarashepherd/20-07_GABE_clara
g2spectra.cpp
/********************************** SPECTRA FILE **********************************/ #include "g2header.h" //contains declerations for program functions. #if spec_output==1 static long double *indft, *dindft; //decleares input field for dft static fftwl_complex *outdft, *doutdft; //decleares output field for dft s...
ALGO
0.987767
3.814133
92f47720-e3e8-4d2a-a57f-90da401b34df
capnmav77/Core-Programming
STL/DSA/Backtracking/Letter Combinations of a Phone Number.cpp
/* MY YOUTUBE VIEDO ON THIS Qn : https://www.youtube.com/watch?v=vgnhZzw-kfU Company Tags : Microsoft, Meta, Epic Systems, Amazon, Flipkart Leetcode Link : https://leetcode.com/problems/letter-combinations-of-a-phone-number/ */ //Backtracking - Khandani template /* Each dig...
ALGO
0.999832
7.131935
44bd8c05-667c-499e-8a47-8e93f96e5260
Nasifuad/Codeforce-Solutions_CPP
236A.cpp
#include <iostream> #include <algorithm> using namespace std; int main() { string s; int len = 0; getline(cin, s); int n = s.length(); sort(s.begin(), s.end()); for (int i = 0; i < n; i++) { if (s[i] == s[i + 1] && i < n - 1) { len++; } } len = n -...
ALGO
0.999849
4.07864
83c3083b-33b4-4704-88f3-26b6e104a14d
thegamer1907/Code_Analysis
contest/1542593378.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define vi vector<int> #define vll vector<ll> #define pb push_back #define mp make_pair #define pii pair<int, int> #define all(a) a.begin(), a.end() #define tr(a, it) \ for(typeof(a.begin()) it = a.begin(); it != a....
ALGO
0.99996
3.55699
59a4418e-8269-4ff7-8187-c78bef263125
xakepbean/core-setup-debug
corehost/common/pal.unix.cpp
#include "pal.h" #include "utils.h" #include "trace.h" #include <cassert> #include <dlfcn.h> #include <dirent.h> #include <sys/stat.h> #include <sys/types.h> #include <pwd.h> #include <unistd.h> #include <fcntl.h> #include <fnmatch.h> #if defined(__APPLE__) #include <mach-o/dyld.h> #include <sys/param.h> #include <sy...
TOOL
0.917984
6.293844
20fef1a8-4ef8-462a-9253-3a927f82c06a
chrisbuczy/reset
cpp/deitel_cpp10_sourcecode/ch22/fig22_02_04/DeckOfCards.cpp
// Fig. 22.3: DeckOfCards.cpp // Member-function definitions for class DeckOfCards that simulates // the shuffling and dealing of a deck of playing cards. #include <iostream> #include <iomanip> #include <cstdlib> // prototypes for rand and srand #include <ctime> // prototype for time #include "DeckOfCards.h" // DeckOfC...
ALGO
0.959193
7.092272
8bf28d13-0c5c-451e-b426-bfff8433dda4
mpogue2/SquareDesk
SquareDesk-DEV/test123/soundtouch/source/SoundTouch/InterpolateLinear.cpp
#include <assert.h> #include <stdlib.h> #include "InterpolateLinear.h" using namespace soundtouch; ////////////////////////////////////////////////////////////////////////////// // // InterpolateLinearInteger - integer arithmetic implementation // /// fixed-point interpolation routine precision #define SCALE 655...
ALGO
0.930056
6.384697
83e125cf-ce74-4f26-9552-6766969d5735
ishandutta2007/codeforces
dreamoon_love_aa/normal/1700/A.cpp
/*{{{*/ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> #include<string> #include<iostream> #include<sstream> #include<set> #include<map> #include<queue> #include<bitset> #include<vector> #include<iomanip> #include<limits.h> #include<assert.h> #define SZ(X) ((int)(X).size()) #de...
ALGO
0.999884
3.131391
05b85c14-106f-4c82-9a61-f35aeb97e2e0
mqjinwon/ComputerVision
Homeworks_CV/eigen-3.3.8/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.999562
3.891046
40b85e32-d541-443a-a4d3-ec2ea0c18a1f
susmita413/Dsa-1_nw
Sorting--/Bubble sort ascending order/Bubble_asc.cpp
//Bubble sort Ascending order with manual-trace every iteration// #include <iostream> using namespace std; void bubbleSort(int a[], int n){ int temp ; for(int i=0; i<n-1 ; i++){ int flag=0 ; for(int j=0; j<n-1-i; j++){ if(a[j]> a[j+1]){ temp= a[j]; a[...
ALGO
0.999139
4.637184
f076f839-4cfa-49c8-ad9b-9d5435cdcac0
gaoxifeng/Feature-Preserving-Octree-Hex-Meshing
extern/vcg/eigenlib/unsupported/doc/examples/MatrixSquareRoot.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; int main() { const double pi = std::acos(-1.0); MatrixXd A(2,2); A << cos(pi/3), -sin(pi/3), sin(pi/3), cos(pi/3); std::cout << "The matrix A is:\n" << A << "\n\n"; std::cout << "The matrix square root of A is:...
ALGO
0.999153
3.930508
c8a9fee1-f2a0-47f2-8bda-49cbb708df32
kuzux/olimpcan
ubo06/alan.cpp
#include <iostream> #include <fstream> using namespace std; struct dd{ int x, y, w, h; }; int N; dd ddler[5000]; int kesisim[5000][5000]; bool kesisik[5000][5000]; int grup[5000]; int alan[5001]; int currGrup=1; void read(){ ifstream in("alan.gir"); in >> N; for(int i=0;i<N;i++) in >> ddler[i].x >> ddle...
ALGO
0.999694
3.333824
cd95b111-c1e3-4625-83cf-8ffc3762e734
ReynardAdimas/CP-Journey
cf/sum_of_round_number.cpp
#include<bits/stdc++.h> using namespace std; void solution() { int x; vector<int> ans; cin >> x; int mod = 10000; while(x > 0) { if(x%mod==x) { mod/=10; } else { int d = x%mod; ans.push_back(x-d); x = d; ...
ALGO
0.999929
4.357301
e920e12c-6dbb-449e-bcb4-5f8a6417bfdb
ishandutta2007/codeforces
tearinfree/normal/875/A.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d",&n); vector<int> ans; for(int i=max(1,n-100);i<n;i++) { int val=i,sum=i; while(val) { sum+=val%10; val/=10; } if(sum==n) ans.push_back(i); } printf("%d\n",ans.size()); for(int i=0;i<ans.size();i++) printf("%d\n",ans[i]); ...
ALGO
0.999846
3.898313
cb550938-f57e-460c-bb88-d464e7793c3b
avi2027/Data-structure
Binary_search_user.cpp
#include<iostream> using namespace std; int size,arr[100],key,i; // global variable int binary_search(); void printline(); int main() { cout << "Enter array Size: "; cin >> size; for(i=0; i<size; i++){ cin >> arr[i]; } cout << "Which value you are see: "; cin >> key; int element_search = binary_search(); p...
ALGO
0.999441
4.170196
bee479e4-017a-48d9-b1c8-247e0709da1c
deepikagoel1/intel-ai
oneAPI_Essentials/07_DPCPP_Library/src/inclusive_scan.cpp
#include <CL/sycl.hpp> #include <iostream> #include <oneapi/dpl/algorithm> #include <oneapi/dpl/execution> #include <oneapi/dpl/iterator> using namespace sycl; using namespace oneapi::dpl::execution; int main() { const int num_elements = 6; auto R = range(num_elements); //Initialize the input vector...
ALGO
0.999366
3.19301
a42a7191-0188-423b-a814-ef5b8a233db9
Mingda-tech/MingDa_OrcaSlicer
src/libigl/igl/copyleft/comiso/miq.cpp
#include "miq.h" #include "../../local_basis.h" #include "../../triangle_triangle_adjacency.h" #include "../../cut_mesh.h" #include "../../LinSpaced.h" // includes for VertexIndexing #include "../../HalfEdgeIterator.h" #include "../../is_border_vertex.h" #include "../../vertex_triangle_adjacency.h" // includes for Po...
ALGO
0.99893
5.037763
9648decf-83d9-4de0-b3e7-78bee7b4fe2e
emsr/cxx_math
3rdparty/TOMS/toms910_e_float/functions/polynomials/polynomials.cpp
#include <functions/complex/e_float_complex.h> #include <functions/constants/constants.h> #include <functions/elementary/elementary.h> #include <functions/polynomials/polynomials.h> #include <functions/hypergeometric/hermite.h> #include <functions/hypergeometric/hypergeometric.h> namespace OrthogonalPoly_Series { t...
ALGO
0.99975
6.835899
e8f36a95-e656-4503-ab6e-c59219a9af97
GaurishIIITNR/CP-Problems-Solutions
C_Letters.cpp
/* ======================================================================================== // ****हर हर महादेव🙏🙏***** // // ***AUTHOR: GAURISH OJHA** // // *****DATE: 25-02-2022**** // // ******TIME:...
ALGO
0.999824
3.736434
c28b564d-70e2-4959-a8ed-9ea1874804a3
gedorinku/llvm-65816
libcxx/test/std/algorithms/alg.nonmodifying/alg.find.first.of/ranges.find_first_of.pass.cpp
// <algorithm> // UNSUPPORTED: c++03, c++11, c++14, c++17 // template<input_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2, // class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> // requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> // conste...
TEST
0.985552
7.300266
455b208b-ae61-4d6c-9062-56c51f9b48f2
fsy-juruo/noip-2021-js-answer
t2021/JS-0398/variance/variance.cpp
#include <bits/stdc++.h> #define INF 1000000007 using namespace std; int n,m,a[110],d[110]; signed main() { freopen("variance.in","r",stdin); freopen("variance.out","w",stdout); ios::sync_with_stdio(false); cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; m=a[n]-a[1]; for(int i=1;i<=n-1;i++) d[i]=a[i+1]-a[i]; sort(d+...
ALGO
0.999823
3.35047
b61249a2-054a-412f-b4f2-6858e8b4244e
rishabg30/DSA_CP_24
Graphs/graph_representation_adjacency_list.cpp
#include <bits/stdc++.h> using namespace std; void printArray_1D(vector<int> &arr) { for (auto it : arr) { cout << it << " "; } cout << endl; } void printArray_2D(vector<vector<int>> &arr) { for (auto it : arr) { for (auto it2 : it) { cout << it2 << " "; } co...
ALGO
0.999964
5.210905
4ca13c01-fd6a-4c94-a0a8-c9d9ea4f6c0d
dhakadrohan98/350_DSA_Problems_Java_CPP
c++/searching & sorting/find fixed point (value equals to index).cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: vector<int> valueEqualToIndex(int arr[], int n) { // code here vector<int> v; for (int i = 0; i < n; i++) { if (arr[i] == i + 1) { v.push_back(arr[i]); } } return v; } }; int main() { int t;...
ALGO
0.999891
4.408118
5a0b555c-56d6-4637-a2dd-3175bce85af7
ShohanNur/Data-Structure-and-Algorithm
Algorithm CSE237/Backtracking/Rat_in_a_maze.cpp
// Taken from geekforgeeks // backtracking #include <bits/stdc++.h> using namespace std; // Maze size #define N 5 bool solveMazeUtil(int maze[N][N], int x, int y,int sol[N][N]); // A utility function to print solution matrix sol[N][N] void printSolution(int sol[N][N]) { for (int i = 0; i < N; i++) { for (...
ALGO
0.999958
5.030316