uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
6b3e9c63-531e-492e-bc81-bbd56a81b573
MostafaMohamed2001/C-Data-Structure
.history/test_20240624092432.cpp
#include <iostream> #include <string> using namespace std; int main() { int N, M; string C, D; int P[M], sum = 0; cin >> N >> M; for (int i = 0; i < N; i++){ cin >> C; } for (int i = 0; i < M; i++){ cin >> D; } for (int i = 0; i < M; i++){ sum += P[i]; } cout<<s }
ALGO
0.999795
3.609373
a2c4d2a9-3557-4e55-809b-b79f6c39a672
abubakaristiak/CSE-Fundamentals
Introduction to C++ for DSA/Week 01- (Introduction to C++)/Module - 3.5/_03_G_Palindrome_Array.cpp
//https://codeforces.com/group/MWSDmqGsZm/contest/219774/problem/G #include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int ar[n]; for(int i = 0; i<n; i++){ cin >> ar[i]; } int flag = 0; int i = 0; int j = n-1; while(i<j){ if(ar[i] != ar[j]){ ...
ALGO
0.999991
3.869474
41613b64-4357-48d5-ab3d-a4258b579fa3
hosiyamakaze/bitope
bitope.cpp
static char sccsid[]= "@(#)$Workfile: bitope.cpp $$Revision: 12 $$Date: 25/02/04 19:13 $$NoKeywords: $"; /* ***************************************************************************** * * bitope.c: ahs|l`oIy[V * * * LF * EbitPʂ̓]T|[g܂B * EmNp^[(DEPTH=1)̂ݑΉ܂B * Eł͍ɑΉrbgon('1')Ƃ܂ * E̊TOT|[g...
TOOL
0.993129
4.032689
835b1f1d-6bbd-445c-954c-6eb272529fb8
mansi35/CPlusPlus-Daily-Questions-Interview-Prep
count-good-nodes-in-binary-tree/count-good-nodes-in-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999721
6.774728
73e4a004-a156-4f83-97dc-0966fd9249a1
sthsuyash/CSIT_Labs
5th_Semester/Simulation_and_Modeling/5_Distributed_log.cpp
/* * Write a C/C++ program to find the growth in national consumption for five years using Distributed Lag Model given below: I = 2 + 0.1Y0 Y = 45.45 + 2.27(I+G) T = 0.2Y C = 20 + 0.7(Y-T) * Assume the initial value of Y0 is 80 and take the governmental expenditure in the 5 years to be as follows: Year ...
ALGO
0.997975
3.816617
00cb4641-79e0-4dad-8631-bc0e4ea000e0
luobuyu/Code-test-daily
luogu/部分例题代码/河流.cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 105; const int inf = 1 << 30; vector<int> adj[maxn]; int w[maxn], dis[maxn], n, K, dp[maxn][maxn][maxn]; bool onpath[maxn]; //记录所有点在不在0-当前DFS到的节点的路径上 void dfs(int u) { onpath[u] = true; for (int i = 0; i <= n; i++) for (int j = 0; j <= K; j+...
ALGO
0.999894
3.864776
1859af96-f51a-4910-a21f-760ec20d9962
nandayvk/EECE5554_Final_Project
openvslam/libraries/eigen/eigen-eigen-5a0156e40feb/doc/examples/tut_arithmetic_matrix_mul.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; int main() { Matrix2d mat; mat << 1, 2, 3, 4; Vector2d u(-1,1), v(2,0); std::cout << "Here is mat*mat:\n" << mat*mat << std::endl; std::cout << "Here is mat*u:\n" << mat*u << std::endl; std::cout << "Here is u^T*mat:\n" << u.transpo...
ALGO
0.99932
3.818773
060b3d05-f7e4-446a-b08b-327ed0ae16d2
0xGeN02/University
1/EstructuraDatos/Clase11/E07_GND_Path.cpp
/******************************************** * Asignatura: Estructura de Datos * * Sesión 11 TDA Grafo NO DIRIGIDO PONDERADO * * Ejemplo 07. CAMINOS ENTRE DOS VÉRTICES * * Definición Clase GrafoNDP * * Representación: Matriz de Adyacencia * * Métodos Caminos BFS* ...
ALGO
0.999474
5.085158
b434eea5-51a5-44c5-9619-9b6d655fa7ac
jrenzhile/3d_cascaded_seg
features/mex/intersect_vectors.cpp
#include <math.h> #include "mex.h" void IntSort(double A[],int n) { int i,j; double x; for(i=1;i<n;i++) { x = A[i]; for(j= i-1;j>=0;j--) { if(x<A[j]) A[j+1] = A[j]; else break; } A[j+1] = x; } } void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { #define ...
ALGO
0.999978
3.809703
05dfe7ea-a92c-4e34-8311-e62f53b6bb3c
zxyDEDIRE/ACM_CODE
多校/The 2023 Guangdong Provincial Collegiate Programming Contest/D.cpp
#include<bits/stdc++.h> using namespace std; #define endl "\n" #define pp(x) array<int,x> using ull=unsigned long long; using ll=long long; using pii=pair<int,int>; using pdd=pair<double,double>; const int dx[]={0,0,1,-1,1,-1,1,-1}; const int dy[]={1,-1,0,0,1,-1,-1,1}; const int mod=998244353; const int inf=0x3f3f3f3f;...
ALGO
0.999963
4.658298
0adc100e-0358-44e8-b234-0476ce05a8ab
avBuffer/miniCaffe_ssd
src/caffe/layers/softmax_layer.cpp
#include <algorithm> #include <vector> #include "caffe/layers/softmax_layer.hpp" #include "caffe/util/math_functions.hpp" namespace caffe { template <typename Dtype> void SoftmaxLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { softmax_axis_ = bottom[0]->CanonicalAxisIndex...
DATA
0.949839
7.522981
0ae3b83c-baab-46fa-b5e5-9d9621ebc01e
wandering-sage/dsa-practice
50- Subsets II/sol1.cpp
#include <bits/stdc++.h> using namespace std; // Using Recursion // time-->O(2^N) space-->O(2^N) void getSubSet(int ind, vector<int> &set, vector<int> &arr, vector<vector<int>> &ans) { ans.push_back(set); for (int i = ind; i < arr.size(); i++) { if (i != ind && arr[i] == arr[i - 1]) continue...
ALGO
0.999934
5.432222
7cffa979-7336-4a28-ad9b-205e159bd709
linus-young/LeetCode
94-Binary-Tree-Inorder-Traversal.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: vector<int> inorderTraversal(TreeNode* root) { // Version 1: recursive if(root...
ALGO
0.999981
6.738641
93f01a15-eeb4-41f0-af0a-61685a9a40c4
junah201/leetcode
Medium/3.cpp
// 3. Longest Substring Without Repeating Characters // 02/24/2022 22:24 Accepted 7 ms 6.8 MB cpp #include <string> using namespace std; class Solution { public: int lengthOfLongestSubstring(string s) { int len = s.length(); int is_used[200] = {0,}; int cnt = 0; int ans = 0; ...
ALGO
0.999864
5.72375
adc1532a-2256-4a39-a1f0-247b7b190e2d
mdelorme/gravity_solver_stream
session5/src/tree.cpp
#include "tree.h" namespace gravity { Cell::Cell(Vec3 x0, double size) : x0(x0), size(size), hsize(size*0.5) {}; void Cell::DistributeParticles(const std::vector<TreePart> &particles, int level) { // 3 cas : // 1- particles.size() = 0 -> sort rien à faire // 2- particles.size() = 1 -> on définit le centre d...
ALGO
0.998468
4.125122
dcc91173-5916-47b0-ac62-65cf3af3df77
anindiangeek/450DSA
Graphs/BFS.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: // Function to return Breadth First Traversal of given graph. vector<int> bfsOfGraph(int V, vector<int> adj[]) { vector<int> BFS; queue<int> q; vector<int> visited(V + 1, 0); q.push(0); visited[0...
ALGO
0.999984
6.248087
c7323cfc-ade6-4efc-af88-670b77f70f22
ishandutta2007/codeforces
kdvinit/normal/1487/B.cpp
/* K.D. Vinit |,,| */ #include<bits/stdc++.h> using namespace std; #define int long long void solve() { int n,k; cin>>n>>k; if(n%2==0) { int ans=k%n; if(ans==0) ans+=n; cout<<ans<<endl; return; } int m=n/2; int l=(k-1)/m; k+=l; int ans=k%n; ...
ALGO
0.999884
4.060023
09ee50f1-cc78-492b-b100-dc9a8b82c7c6
stwc/OJ
LeetCode/cpp/1038 - Binary Search Tree to Greater Sum Tree.cpp
class Solution { public: TreeNode *bstToGst(TreeNode *root) { int greater = 0; dfs(root, greater); return root; } void dfs(TreeNode *root, int &greater) { if (!root) return; dfs(root->right, greater); root->val += greater; greater...
ALGO
0.999982
5.66493
77ba15d1-21f8-45bd-bb80-b248bd8c8a01
ajinkyavn1/Codes
codeforces_Old/The_Great_Run.cpp
#include<bits/stdc++.h> taxisypedef long long int ll; #define do_it_fast ios_base::saxisync_with_stdio(0),cin.tie(0),cout.tie(0) #define vll vector<long long int> #define pll pair<long long int, long long int> using namespace std; void solve(){ int n,k; cin>>n>>k; vll v(n); for (int i = 0; i < n; i++)...
ALGO
0.999901
3.969476
773458bd-61e3-4a90-9f69-9c41a9e7d35f
imvskalhans/DSA-Codes
0347-top-k-frequent-elements/0347-top-k-frequent-elements.cpp
class Solution { public: vector<int> topKFrequent(vector<int>& nums, int k) { // Step 1: Create a hash map to store the frequency of each element unordered_map<int, int> freq_map; for (int num : nums) { freq_map[num]++; } // Step 3: Create a max heap (priority queue) priority_queu...
ALGO
0.999992
6.574308
2f82351c-ba87-4de8-82f9-40e375ee73ac
MaxKuklaVod/Polinomial
Rational.cpp
#include <iostream> #include "Rational.h" using namespace std; Rational::Rational() { this->numer = 0; this->denom = 1; } Rational::Rational(const int numer) { this->numer = numer; this->denom = 1; } Rational::Rational(const int numer, const int denom) { this->numer = numer; this->denom = denom; } void Rationa...
ALGO
0.995983
4.857559
e76c756f-7330-4796-913f-369000921ec7
JorgeIba/Competitive-Programming-Problems
CodeForces/Double Profiles.cpp
#include <bits/stdc++.h> #define lli long long int #define ld long double #define endl "\n" #define forn(i, in, fin) for(int i = in; i<fin; i++) #define all(v) v.begin(), v.end() #define fastIO(); ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); using namespace std; vector< vector< lli > > adj; map<pair<ll...
ALGO
0.999901
4.495005
78f8065b-416a-444d-8c5d-230dc57ff4a0
esix/competitive-programming
sgu.old/volume-2/222/main.cpp
#include <iostream> #include <utility> #include <vector> #include <string> #include <sstream> #include <algorithm> #include <map> using namespace std; int solve(int w, int h, int k) { // solve for board w*h, k rooks if (k > w || k > h) return 0; if (k == 0) return 1; if (k == 1) return w * h; int resu...
ALGO
0.999743
3.740609
073bb7a3-17de-444b-9a49-5a2665ddef5d
Maaz-7858/cpp_practise
recursion_3.cpp
Ques.1--------------------------------------------------- #include<bits/stdc++.h> using namespace std; int minimum_ele_of_nums(int *nums,int m){ if(m==-1)return INT_MAX; return min(nums[m],minimum_ele_of_nums(nums,m-1)); } int main(){ int n; cin>>n; int nums[n]; for(int i=0;i<n;i++){ cin...
ALGO
0.99965
3.736969
ad3ed024-c512-4359-9dc8-fefffdccc0ad
sidikone/vision_project
initial_release/src/edging.cpp
#include "edging.h" using namespace std; using namespace cv; EdGing::EdGing(Mat& image_in){ this->_imag = image_in; } void EdGing::compute_canny_edge_detector(Mat& imag_out, int s_ker, double three_min, double three_max){ Canny(_imag, imag_out, three_min, three_max, s_ker); } void EdGing::compute_sobel_edge...
ALGO
0.991569
4.778819
3d7cd265-a91e-4347-b4ae-ce976c7fb698
awa-Orz-Ljy/LJYCODE-VSCODE
算法模板分类总结/并查集/1135 并查集.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; const int N = 2e5 + 9; int n, m, op, x, y; ll pre[N]; int root(int x){//路径压缩,递推寻找根节点 return pre[x] = (pre[x] == x ? x : root(pre[x])); } void merge(int x,int y){//连接两个点 pre[root(x)] = root(y); } bool iscon(int x,int y){//判断是否连接 return roo...
ALGO
0.999975
4.293376
5653ee23-ec78-475b-ba56-14199ba075b5
HEltim7/cpcode
NowCoder/寒假/2023/5/小沙の抱团_easy.cpp
#include <vector> #include <iostream> #include <algorithm> using namespace std; #define endl '\n' using LL=long long; void solve() { LL n,ans=0; cin>>n; while(n>2) { ans++; if(n%2==0) n-=n/2-1; else n-=n/2; } cout<<ans; } int main() { ios::sync_with_stdio(0); cin....
ALGO
0.999937
4.926815
afeeea40-6fe5-46cf-9d4e-b9606194d251
cvc5/cvc5
src/theory/uf/symmetry_breaker.cpp
#include "theory/uf/symmetry_breaker.h" #include <iterator> #include <queue> #include "theory/rewriter.h" #include "util/hash.h" #include "util/statistics_registry.h" using namespace std; namespace cvc5::internal { namespace theory { namespace uf { using namespace cvc5::context; SymmetryBreaker::Template::Templat...
ALGO
0.996518
5.97618
f306c541-cc28-4c10-8e60-17b0daf1f969
gabrielanh1/MiniProject3
src/policy/myalgorithm.cpp
#include <cstdlib> #include<iostream> #include "../state/state.hpp" #include "./myalgorithm.hpp" int int_min = -1000000; int int_max = 1000000; /** * @brief Randomly get a legal action * * @param state Now state * @param depth You may need this for other policy * @return Move */ Move myalgorithm::get_move(St...
ALGO
0.999098
4.272417
98845ecd-47f7-45d4-8915-20d4825241e3
mateor/pdroid
android-2.3.4_r1/tags/1.32/frameworks/base/media/libstagefright/codecs/amrnb/enc/src/levinson.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/levinson.c Funtions: Levinson_init Levinson_reset Levinson_exit Levinson ------------------------------------------------------------------------------ MODULE DESCRIPTI...
ALGO
0.998595
6.290952
964b9307-6484-424d-a69c-6c5a9ae88594
Parihar07/DSA
isAlphaNum/ian.cpp
#include<iostream> #include<vector> using namespace std; int solve(vector<char>& A) { int ans = 0; for (int i = 0; i < A.size(); i++) { if (!(A[i] >= 'A' && A[i] <= 'Z' || A[i] >= 'a' && A[i] <= 'z' || A[i] >= '0' && A[i] <= '9')) { return 0; } } return 1; } int main() { cout << "Hello AlphaNu...
ALGO
0.977015
3.562001
ac82b9ad-87af-41e4-96c4-c143158d8fb4
kirollosatef/problem-solving
others/azhar-university/sheet#2/H_One_Prime.cpp
#include <iostream> using namespace std; bool is(int x) { for (int i = 2; i <= x / 2; i++) if (x % i == 0) return 0; return 1; } int main() { int x; cin >> x; is(x) ? cout << "YES\n" : cout << "NO\n"; }
ALGO
0.999696
4.870309
ea0c56cb-2564-479d-9552-9cd8bed5c24d
Ph0en1xGSeek/ACM
LeetCode/225.cpp
class MyStack { public: vector<int> v; /** Initialize your data structure here. */ MyStack() { } /** Push element x onto stack. */ void push(int x) { v.push_back(x); } /** Removes the element on top of the stack and returns that element. */ int pop() { ...
ALGO
0.99767
5.926636
8692a713-1d8a-42cb-aaab-b60cd84e2440
NafiHasan/HabiJabi
C++/CSEDU/DU TEAM/h.cpp
#include <bits/stdc++.h> using namespace std; #define w(t) int t; cin >> t; while (t--) #define ll long long int #define en "\n" int main () { ios::sync_with_stdio(false); cin.tie(NULL); w(t){ int n,m; string s; cin>>n>>m>>s; int mx=0,cnt=0; for (int i=0; i<s.size(...
ALGO
0.999837
4.006649
63172d55-151f-4b75-b385-581aa5184a24
msurovic/msc-thesis
llvm-3.7.0/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
#include "InstCombineInternal.h" #include "llvm/Analysis/InstructionSimplify.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/PatternMatch.h" using namespace llvm; using namespace PatternMatch; #define DEBUG_TYPE "instcombine" /// simplifyValueKnownNonZero - The specific integer value is used in a context /// ...
ALGO
0.995736
7.356249
6fc181d9-d9a5-47bd-b499-af980acea553
akshya03/LoveBabbar-DSA-playlist
backtracking 2.cpp
//n-queens problem //prints all solutions #include<bits/stdc++.h> using namespace std; void displayMatrix(const vector<vector<int>> &matrix){ int rows,cols,i,j; rows=matrix.size(); cols=matrix[0].size(); for(i=0;i<rows;++i){ for(j=0;j<cols;++j) cout<<matrix[i][j]<<" "; cout<...
ALGO
0.999949
4.818918
94c08c8d-c80c-4fd8-a4c6-2ba5604b8b66
lovi-bhatia/Coding-Ninja-DSA
Sort/Bubble_sort.cpp
#include <bits/stdc++.h> using namespace std; void BubbleSort(int arr[],int n){ for(int i=0;i<n-1;i++){ bool swapped = false; for(int j=0;j<n-i-1;j++){ if(arr[j] > arr[j+1]){ swap(arr[j],arr[j+1]); swapped = true; } } if(!swapped) break; } } int main(){ int arr[] = {-1,2,-12,43,5,-10...
ALGO
0.999966
5.096795
1b71cf12-877d-40ca-869b-ab830d753615
Mahmoud-Abd-Elrazek/ICPC-Assiut-Juniors-Phase-1-Sheets
BS & 2Ponters/E_Game.cpp
// لَنْ تَنَالُوا الْبِرَّ حَتَّى تُنْفِقُوا مِمَّا تُحِبُّونَ وَمَا تُنْفِقُوا مِنْ شَيْءٍ فَإِنَّ اللَّهَ بِهِ عَلِيمٌ [آل عمران:92]. // © M_Abrazeg #include <bits/stdc++.h> using namespace std; using i64 = long long ; #define all(x) (x).begin(), (x).end() #define rall(a) a.rbegin(), a.rend() #define ff first #d...
ALGO
0.999971
4.657889
bbe2de24-be9e-42bd-b56a-ac7b6bfc20c2
DEVANSH-DVJ/CS213-Autumn-2020
Quizzes/Quiz 15/CS213_Quiz_15.cpp
#include <iostream> using namespace std; int f_1(int T[], int n); int f_2(int T[], int n); int g_1(int T[], int n); int g_2(int T[], int n); int f_1(int T[], int n) { if (n == 0) { return 0; } int min = T[0]; int index = 0; for (int i = 1; i < n; i++) { if (T[i] < min) { index = i; min...
ALGO
0.999983
4.635259
f686fb26-58f3-496c-8b5d-185a2dddff2c
poneciak57/OI-prep-2023-2024
archive1-11.11.2k23/WO2_worek2/main.cpp
#include <bits/stdc++.h> typedef long long ll; typedef std::string str; template <typename T> using vec = std::vector<T>; int main() { std::ios_base::sync_with_stdio(false); std::cout.tie(nullptr); std::cin.tie(nullptr); ll n, q, t; std::cin>>n; vec<ll> liczby; while (n--) { ...
ALGO
0.999956
4.738787
f893cee7-6410-478d-89f5-41be3dda0adf
nguyenquyen1910/DSALearn
Kiem Tra 2/bai_1.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; int n,m; vector<int> res; bool vst[100]; void Try(int i){ for(int j=n;j<=m;j++){ if(!vst[j]){ vst[j]=1; res.push_back(j); if(res.size()==(m-n+1)){ for(int i=0;i<res.size();i++){ ...
ALGO
0.999759
3.641536
274e4187-27c2-4cc4-935d-1bdf830b301c
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_1597_28.cpp
#include <bits/stdc++.h> using namespace std; int a[205], p[205], n, m, l; double f[205][205][205 + 205]; void work() { int i, j, k; cin >> n >> l >> m; for (i = 1; i <= n; ++i) cin >> p[i]; for (i = 1; i <= n; ++i) cin >> a[i]; f[0][0][min(m, n) + n] = 1; for (i = 0; i < n; ++i) for (j = 0; j <= n; ++j...
ALGO
0.999749
3.600911
c482bb5d-92a8-4e75-86ab-2296b2942718
asirff399/Phitron_s3
Introduction to Algorithms/Module 14/Messege_Rpute_2.cpp
#include<bits/stdc++.h> using namespace std; const int N=1e5+5; vector<vector<int>> graph(N); bool vis[N]; int parent[N]; void bfs(int node) { queue<int> q; q.push(node); vis[node]=true; while (!q.empty()) { int par=q.front(); q.pop(); for(int x: graph[par]) { ...
ALGO
0.999994
4.223974
b08d1805-16d0-4d76-a026-223923a50bda
mangosArchives/MangosZero-Server_18.1
dep/src/g3dlite/MeshAlgWeld.cpp
#include "G3D/MeshAlg.h" #include "G3D/Table.h" #include "G3D/Set.h" namespace G3D { namespace _internal { class Welder { private: // Intentionally illegal Welder& operator=(const Welder& w); public: /** Indices of newVertexArray elements in <B>or near</B> a grid cell. */ typedef Array<int> List; ...
ALGO
0.996077
6.904353
0dc0d781-227f-4453-a5f7-db65d80898b5
IcePool23/Energycoin
src/consensus/merkle.cpp
#include "merkle.h" #include "hash.h" #include "utilstrencodings.h" /* WARNING! If you're reading this because you're learning about crypto and/or designing a new system that will use merkle trees, keep in mind that the following merkle tree algorithm has a serious flaw related to duplicate tx...
ALGO
0.9999
7.667043
9a6151de-6553-4a42-9280-20f5cb81525c
PlatonovDmitry/CPP_Learning
Sprint 5/5.1 Iterators/5.1.7.1_LibraryFunctions.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <sstream> #include <vector> using namespace std; // функция, записывающая элементы диапазона в строку template <typename It> string PrintRangeToString(It range_begin, It range_end) { // удобный тип ostringstream -> https://ru.cppreference.com/w/...
ALGO
0.999903
5.333001
d7f6a54c-b56c-458b-9dfc-13bde3017bff
npnkhoi/Competitive-programming
LQDTraining/180323/minsum.cpp
#include <bits/stdc++.h> using namespace std; int n; string s; int a[15], b[15]; long long res = (long long) 1e18; set<int> head; int main() { freopen("minsum.inp", "r", stdin); freopen("minsum.out", "w", stdout); scanf("%d ", &n); for (int i = 1; i <= n; i++) { getline(cin, s); for (i...
ALGO
0.999889
4.427076
88aa2598-9e32-42d4-9f8c-5be68126ac20
itzpankajpanwar/Leetcode
univalued-binary-tree/univalued-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.999335
6.47858
de5f4207-524b-418a-b142-6d6aac252d6e
navya0887/Cryptography
24.cpp
#include <stdio.h> // Function to calculate the greatest common divisor (GCD) of two numbers int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } // Function to calculate the modular multiplicative inverse using the extended Euclidean algorithm int modInverse(int e, int phi) { int...
ALGO
0.999979
5.816532
a7b115e2-0348-4aae-8952-4cb77152ec99
NPSfah/friday-same-act
08_​Map_​★_​Telephone_​Directory.cpp
#include<bits/stdc++.h> using namespace std; int main () { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin>>n; string data; map<string,string> mp; cin.ignore(); for(int i=0;i<n;i++) { getline(cin,data); string a = "",b = ""; for(int j=data.siz...
ALGO
0.999803
4.319869
5a51b122-972d-4de2-b6df-76114d727ffe
ishandutta2007/codeforces
qingyu/normal/1477/C.cpp
#include <bits/stdc++.h> const int N = 1e5 + 50; int n, lst, x[N], y[N]; bool v[N]; int64_t dist(int64_t x, int64_t y) { return x * x + y * y; } inline int find(int p) { int z = 0; long long max = -1; for (int i = 1; i <= n; ++i) { int64_t dis = dist(x[i] - x[p], y[i] - y[p]); if (!v[i] && dis > max) { ...
ALGO
0.999943
4.141694
9613c986-d7fa-4b18-a55b-9d01bb3a2ab5
creditbit/creditbit
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
e0464eb2-f061-4dc3-909a-b719a7073b01
ishandutta2007/codeforces
yzc2005/normal/1718/A2.cpp
#include <bits/stdc++.h> using namespace std; const int N = 100005; int n, a[N], dp[N]; void solve() { map<int, int> last; last[0] = 0; cin >> n; for (int i = 1; i <= n; ++i) { cin >> a[i]; a[i] ^= a[i - 1]; dp[i] = dp[i - 1]; if (last.count(a[i])) { dp[i] = m...
ALGO
0.999983
4.954745
5ac8fb6b-823f-4445-a9b1-062b547639fb
ChenXia93/C-
C++_D_S/Array/2dArray.cpp
#include <iostream> using namespace std; int main() { //2D array int A[3][4] = {{1,2,3,9}, {2,3,5,7}, {6,4,8,1}}; for(int row = 0; row < 3; row++){ for(int column = 0; column < 4; column++){ cout<<A[row][column]<<" "; } cout<<endl; ...
ALGO
0.951883
3.157868
dd2e4319-aaa7-4c1a-85b9-6b06d2d86e73
Ismail-Upal/CP-Trash
Solved Problem/C_Sofia_and_the_Lost_Operations.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e6; ll a[N]; ll b[N]; ll d[N]; map<int, int>mp, res; set<int>s; // void solve() { mp.clear(); res.clear(); s.clear(); int n, m; cin >> n; for (int i = 1;i <= n;i++) cin >> a[i]; for (int i = 1;i <= n;i+...
ALGO
0.999957
3.867863
6d4e989b-d9bc-4360-8136-2bd8d40d99f4
adamspeedy/vtr3
src/main/src/deps/steam/src/trajectory/const_vel/evaluable/jinv_velocity_evaluator.cpp
#include "steam/trajectory/const_vel/evaluable/jinv_velocity_evaluator.hpp" namespace steam { namespace traj { namespace const_vel { auto JinvVelocityEvaluator::MakeShared( const Evaluable<XiInType>::ConstPtr& xi, const Evaluable<VelInType>::ConstPtr& velocity) -> Ptr { return std::make_shared<JinvVelocityE...
ALGO
0.972708
7.288278
0e169912-408c-47cc-b947-d69bac8cb498
akbtech17/dsa
Other/Nagarro Bootcamp/38-Lecture-QPS-Arrays,Bitmasking,Lists/5-HammingDistance.cpp
// 5-HammingDistance.cpp // number of different bits among two given integers #include<bits/stdc++.h> using namespace std; // tc = 32bit int hammingDistance(int x, int y) { int cnt = 0; for(int i=0;i<32;i++) { int mask = 1<<i; int x_bit = x&mask?1:0; int y_bit = y&mask?1:0; if(x_bit!=y_bit) cnt++; } r...
ALGO
0.999823
4.887931
b623924c-9142-4e7e-bc0b-2a68ec51772f
sriramsanthosh/LeetCode
Valid Expression - GFG/valid-expression.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; bool valid(string str); int main() { int t; cin>>t; cin.ignore(); while(t--) { string str; getline(cin,str); cout<<valid(str)<<endl; } return 0; } // } Driver Code Ends bool valid(string s) { // ...
ALGO
0.998937
6.32238
93e4be3a-41c2-422b-b5a9-3fe53c0b4189
pixeldust-project-caf/android_frameworks_base
cmds/incident_helper/src/ih_util.cpp
#define LOG_TAG "incident_helper" #include "ih_util.h" #include <algorithm> #include <sstream> #include <unistd.h> bool isValidChar(char c) { uint8_t v = (uint8_t)c; return (v >= (uint8_t)'a' && v <= (uint8_t)'z') || (v >= (uint8_t)'A' && v <= (uint8_t)'Z') || (v >= (uint8_t)'0' && v <= (uint...
TOOL
0.911991
6.599935
ab092b12-9767-4102-89b4-f621b48b26dc
ELiTE0005/DSA-180
day5o1.cpp
<<<<<<< HEAD #include<iostream> using namespace std; int main(){ int i,n,sum; sum = 0; cout<<"enter upto which natural number: "; cin>>n; for(i=1 ; i<=n ; i = i+1){ sum = sum + i ; } cout<<sum<<endl; } ======= #include<iostream> using namespace std; int main(){ int i,n,...
ALGO
0.939717
3.666197
3d4b829c-74df-4001-8cc2-b200e0a37284
54k/leetcode-rs
cpp/code_forces/edu/itmo/seg_tree1/part1/1.cpp
#include <bits/stdc++.h> using namespace std; struct segtree { vector<long long> tree; int size; void init(int n) { size = 1; while (size < n) size *= 2; tree.assign(2 * size - 1, 0); } void build(vector<int> &a) { init(a.size()); build(...
ALGO
0.999882
4.871627
1e71033d-4b9d-4de5-a3ea-911174df64d1
khalilrefai/mesh-viewer
include/igl/pso.cpp
#include "pso.h" #include <cassert> #include <Eigen/StdVector> #include <vector> #include <iostream> template < typename Scalar, typename DerivedX, typename DerivedLB, typename DerivedUB> IGL_INLINE Scalar igl::pso( const std::function< Scalar (DerivedX &) > f, const Eigen::MatrixBase<DerivedLB> & LB, ...
ALGO
0.999897
6.353269
3492a054-31d1-4604-a529-acc8758e0989
openjdkgit/jfx-sandbox
modules/javafx.web/src/main/native/Source/WebCore/page/ViewportConfiguration.cpp
#include "config.h" #include "ViewportConfiguration.h" #include "Logging.h" #include <wtf/Assertions.h> #include <wtf/MathExtras.h> #include <wtf/text/CString.h> #include <wtf/text/TextStream.h> #if PLATFORM(IOS_FAMILY) #include "PlatformScreen.h" #endif namespace WebCore { static inline bool viewportArgumentValueI...
TOOL
0.859131
7.563784
6f3c8f13-00cf-4385-8c95-8befa793ae04
Remote0/bmnlts
024-m.cpp
/************************************************************************* > File Name: 024-m.cpp > Author: lbh > Mail: <EMAIL> > Created Time: 2019年12月28日 星期六 18时56分05秒 ************************************************************************/ #include<iostream> #include<cstdio> using namespace std; #define max_...
ALGO
0.999133
3.251235
0cc56524-bd32-4601-8a5f-44a6183ba7b6
Farhana100/Artificial_Intelligence_CSE318
offline2/1705100.cpp
#include <bits/stdc++.h> #include <stdlib.h> #define BOARD_H 24 #define SCALE_X 2 #define CELL_B 5 #define CELL_H 10 #define DELAY for(long long i = 0; i < 1000000000ll; i++);\ #define WAIT getchar(); #define EMPTY_SLOT ' ' #define STONE 'o' #define LAST_MOVED_STONE 178 #define DEPTH 2 #define DEPTH1 3 #define DEPTH2 ...
ALGO
0.990851
3.720281
556a5585-6a4f-4d27-bc43-8a137bd93c46
mattttttttttyyyy/cpp_lab
kula.cpp
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { float promien, objetosc, pi = 3.14; cout << "Podaj promień: " << endl; cin >> promien; objetosc = (4.0 / 3.0) * pi * pow(promien, 3); cout << fixed << setprecision(2); cout << "Objętość kuli wynosi " <...
ALGO
0.963697
4.218695
51541ce4-d267-4685-b4a3-e6863964fe89
MihirSinghYadav/programming-basics
C++/Extras/q3.cpp
#include <bits/stdc++.h> using namespace std; char maxRepeating(string str, int *count) { int n = str.length(); int count; count = *count; char res = str[0]; int cur_count = 1; for (int i = 0; i < n; i++) { if (i < n - 1 && str[i] == str[i + 1] && str[i] == '*') cur_co...
ALGO
0.999827
3.910955
f054f813-ac02-49a5-8bf8-9976395d732c
Nilabha5000/data-structures-in-c-
graph matrix.cpp
#include <iostream> using namespace std; struct Pair{ int vertex1; int vertex2; }; class Graph{ int v_count; int e_count; int **adj; public: Graph(); ~Graph(); void createGraph(Pair *,int , int); void printAdjacents(int); bool isIsolated(int); void printMatrix(); }; Gr...
ALGO
0.999602
4.644676
243ad315-3dab-47cb-9c9c-eb6c9b282bdc
asquare14/Contest-repository
Codeforces/Contests/div2-682/A.cpp
#include <bits/stdc++.h> #define ll long long const unsigned int mod = 1000000007; using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; while(n--) cout<<1<<" "; cout<<endl; } }
ALGO
0.999837
3.741185
c1324eac-b793-448a-9862-bc0b71ad044d
davidliljefors/editor-renderer
mh64.cpp
#include "mh64.h" #include <string.h> inline static uint64_t rotate_right(uint64_t v, unsigned k) { return (v >> k) | (v << (64 - k)); } // unaligned reads, fast and safe on Nehalem and later microarchitectures inline static uint64_t read_u64(const void * const ptr) { return static_cast<uint64_t>(*reinterpre...
ALGO
0.967005
6.738725
7c8a404b-f79c-4cb6-9fdd-8ba40f9aa275
bossbobster/CSES-Problems
Tree Algorithms/CompanyQueriesI.cpp
#include <iostream> #include <string.h> #include <fstream> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <iomanip> #include <algorithm> #include <math.h> #include <cmath> #include <vector> #include <stack> #include <queue> #include <bitset> #include <map> #include <set> #include <unordered_map> #inc...
ALGO
0.999816
3.728944
d64178cb-0bac-4c67-b0fb-0f0bf012e889
radum2275/mmap2u
src/bn2cn.cpp
#include "bn2cn.h" namespace merlin { // Initialize Loopy2U void bn2cn::init() { // Prologue std::cout << "[BN2CN] Begin initialization ..." << std::endl; std::cout << "[BN2CN] Random generator seed: " << m_seed << std::endl; // Calculate total initialization time double elapsed = (timeSystem() - m_start_time)...
ALGO
0.9868
6.144785
8d977ef7-1014-490d-84a0-d8848491add8
mohdahsanrazakhan/codebase
LeetCode/LC121.cpp
class Solution { public: int maxProfit(vector<int> &prices) { int buy_low = INT_MAX, sell_high = 0; for (int i = 0; i < prices.size(); i++) { buy_low = min(buy_low, prices[i]); sell_high = max(sell_high, prices[i] - buy_low); } return sell_high; ...
ALGO
0.999104
6.110883
6474527c-2bb8-4ee5-abf9-d96963017be3
MadhurYadav/dsa-daily-grind
04_recursion/05_printSubsets.cpp
#include <iostream> using namespace std; // TC - O(2^N), SC - O(N) void printAllSubsets(int arr[], int index, int size, int tmp[], int tmpIndex){ // termination condition // when index reaches size of array if(index == size){ // print subset for(int i=0; i<tmpIndex; i++){ cout<...
ALGO
0.999648
5.828557
6bc45283-9bb0-4c32-965d-e452e59aeb95
MBU-Team/OpenMBU
engine/lib/assimp/code/Common/SGSpatialSort.cpp
/** @file Implementation of the helper class to quickly find vertices close to a given position. Special implementation for the 3ds loader handling smooth groups correctly */ #include <assimp/SGSpatialSort.h> using namespace Assimp; // --------------------------------------------------------------------------------...
ALGO
0.99871
7.007978
0438b973-1f38-41da-9bf8-c827666e2b47
vfolunin/archives-solutions
LeetCode/576.cpp
class Solution { public: int findPaths(int h, int w, int n, int y, int x) { if (!n) return 0; vector<vector<vector<long long>>> ways(n, vector<vector<long long>>(h, vector<long long>(w))); ways[0][y][x] = 1; long long res = 0, MOD = 1e9 + 7; ...
ALGO
0.999949
5.068165
71e09807-9f5e-4a10-9ab0-a5ac45c4fdba
BlackOutDevelops/OpticalFlow
OpenCV/opencv/sources/samples/cpp/tutorial_code/features2D/SURF_Homography.cpp
/** * @file SURF_Homography * @brief SURF detector + descriptor + FLANN Matcher + FindHomography * @author A. Huaman */ #include <stdio.h> #include <iostream> #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/calib3d/calib3d.hpp" ...
ALGO
0.995247
5.785466
b4d8381a-d08c-4852-a9d6-ff47be184c3f
ncu-psl/TOCTOU-Detection
lib/Transforms/Utils/LowerSwitch.cpp
#include "llvm/Transforms/Scalar.h" #include "llvm/ADT/STLExtras.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/LLVMContext.h" #include "llvm/Pass.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream...
TOOL
0.98371
7.74193
6a5147de-cd08-401f-8d18-cb633fd48e28
YogenderTanwar/Sublime-codes-
travellingsalesmanbitmasking.cpp
#include<bits/stdc++.h> using namespace std; #define int long long //delete if causing problems #define F first #define dbg(x) cout<<#x<<" "<<x<<endl; #define S second #define setbit(n) __builtin_popcount(n) #define all(x) x.begin() , x.end() #define clr(x) memset(x,0,sizeof(x)) #define fast ios_base::sync_with_stdio...
ALGO
0.999576
4.166633
0d220f1b-97fc-46cc-9d36-df94d72e2d73
Mero0GF/Analise-de-dados-netflix
NodeBST.cpp
//------------------------------------------------------------ //Nome: Eric Akio Uchiyamada TIA: 42107865 //Nome: Lucas Goulart de Farias Meres TIA: 42127459 //Nome: Oliver Kieran Galvão McCormack TIA: 42122058 //Nome: Pedro Loureiro Morone Branco Volpe TIA: 42131936 //Nome: Renan Tagliaferro...
ALGO
0.913361
4.068254
f4979608-63be-4129-8f36-eca67f0f5d29
qiufengla/AK
贪心/排队打水问题.cpp
/* 题目描述 有n个人排队到r个水龙头去打水,他们装满水桶的时间t1,t2,...,tn为整数且各不相等,应如何安排他们的打水顺序才能使他们花费的总时间最少? 每个人打水的时间 = 排队的时间 + 实际打水的时间,本题假设一个人打好水,排在他后面的人接着打水的这个切换过程不消耗时间。 比如,有2个人A和B,他们打水的时间分别是3和2,只有1个水龙头,这时,如果A先打水,B后打水,那么A和B打水的时间分别为3、3+2(B排队3分钟)。 因此,所有人打水的总时间就是每个人的打水时间及每个人的排队时间的总和。 输入 第1行,两个整数n(1<=n<=500)和r(1<=r<=100)。 第2行,n个正整数t1,t2,...,tn,(1<=...
ALGO
0.999998
4.0124
4145db6d-6fca-46d8-af99-921d8bf5c4b3
shubham25kr07/Attendance_via_face_Recognition
opencv-master/samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp
/** * @function cornerDetector_Demo.cpp * @brief Demo code for detecting corners using OpenCV built-in functions * @author OpenCV team */ #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include <iostream> using namespace cv; using namespace std; /// Global variables Mat src, src_gray; Mat myHarris...
ALGO
0.999149
7.062222
e1d2f1cd-7511-44df-91b8-32617c825e52
chaudhariyash10/LEETCODE
144BibaryTreePreorderTraversal.cpp
#include<stdc++.h> using namespace std; class TreeNode { public: TreeNode *left; TreeNode *right; int val; TreeNode(int val) { this->val = val; this->left = nullptr; this->right = nullptr; } }; class BST { public: TreeNode *root; BST() { this->root...
ALGO
0.999979
5.328593
a55b5af7-8083-44ce-88c8-1ebbf8958fb1
franswaharold/TurtleGold
src/Common/StringTools.cpp
#include "StringTools.h" #include <fstream> #include <iomanip> namespace Common { namespace { const uint8_t characterValues[256] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, ...
TOOL
0.937482
5.923031
9017bfe3-88a4-4c47-8702-281e13531f59
shoryaagrawal553/DSA
Matrix/2D_rotate_90_anticlock.cpp
#include<iostream> #include<vector> using namespace std; // one method can be rotating 90 degree three times i.e. 270 degree rotation void antiClockwise_90 (vector<vector<int>> &mat) { int m= mat.size(); // row int n= mat[0].size(); // col for(int i=0; i<m; i++) // step-1) transpose matrix { ...
ALGO
0.999985
6.085063
9ccf886d-01f9-480c-a1d7-48cf7f9918ef
veliyev100/lessons
zadaca.cpp
#include <iostream> #include <vector> std::vector<std::vector<int>> tr(const std::vector<std::vector<int>>& matrix) { int n = matrix.size(); int m = matrix[0].size(); std::vector<std::vector<int>> transposed(m, std::vector<int>(n)); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { ...
ALGO
0.999972
5.886245
38ec6486-dd32-46b0-9a94-92398e0d8194
Synoep/DSA-
0039-combination-sum/0039-combination-sum.cpp
class Solution { public: void findCombination(int ind,int target,vector<int>& arr,vector<vector<int>>& ans,vector<int>& ds){ if(ind==arr.size()){ if(target==0){ ans.push_back(ds); } return ; } if(arr[ind]<=target){ ds.push_back(...
ALGO
0.999978
6.577284
ad771eb0-c720-4c8e-9bd9-beaa3a4d4411
satoshi-numata/cpp_numeric-value-by-string
FPValueExp/FPValue.cpp
#include "FPValue.hpp" #include "IntStringHelper.hpp" #include "FPMath.hpp" #include <cassert> #include <cctype> #include <cstdio> #include <strstream> #include <stdexcept> /*! 小数点の位置を合わせて、数値を表す文字列の長さを揃えます。 @param vstr1 数値1の文字列 @param dp1 数値1の小数点以下の数字の個数 @param vstr2 数値2の文字列 @param dp2 ...
TOOL
0.955812
5.135117
c35538c5-b2b1-4a23-b249-498afdb84fb7
pkuxxy/LeetCode
C++/MinimumWindowSubstring.cpp
#include<iostream> #include<vector> #include<string> #include<string.h> #include<math.h> #include<algorithm> using namespace std; class Solution { public: //const static int INT_MX = (1<<31)-1; string minWindow(string S, string T) { // Start typing your C/C++ solution below // DO NOT write int main...
ALGO
0.999977
5.399389
386f8e72-ec64-4921-b76c-4cf0ad27b70c
sakibul-shovon/cpp-practice
Codeforces/A_Jellyfish_and_Undertale.cpp
// File Name: A_Jellyfish_and_Undertale.cpp // Date: 2024-04-02 // Time: 01:28:08 #include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define ll long long int #define vint vector<int> #define vll vector<long long int> #def...
ALGO
0.999063
3.808307
44e0044c-51a2-48b2-9a4b-6730d977a695
SAgarwal-24/algorithms
binary-search/search-in-rotated-sorted-array.cpp
#include "binary-search.h" /* * Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). You are given a target value to search. If found in the array return its index, otherwise return -1. You may assume no duplicate exist...
ALGO
0.999995
7.206221
14344929-6a18-46d0-833b-6f9d35d7acc5
fafa1899/BuildCppDependency
Source/boost-1.86.0/libs/url/src/grammar/ci_string.cpp
#include <boost/url/detail/config.hpp> #include <boost/url/grammar/ci_string.hpp> namespace boost { namespace urls { namespace grammar { namespace detail { //------------------------------------------------ // https://lemire.me/blog/2020/04/30/for-case-insensitive-string-comparisons-avoid-char-by-char-functions/ //...
TOOL
0.858966
7.462791
9c092312-28ec-47af-896c-cac21058c41c
ishandutta2007/codeforces
waynetuinfor/normal/855/A.cpp
#include <bits/stdc++.h> using namespace std; set<string> s; int main() { int n; cin >> n; while (n--) { string t; cin >> t; if (s.size() && s.count(t)) cout << "YES" << endl; else cout << "NO" << endl; s.insert(t); } }
ALGO
0.999869
5.314605
8a0a3092-2216-4b7e-bcf0-99d7d2522b6b
gimmizz/Data-Structure-Algorithm
BOJ/C++/Silver4_10845.cpp
#include <bits/stdc++.h> using namespace std; int n; int main(){ cin >> n; int q[n+1], s=0, e=0; for (int i = 0 ; i < n ; i++){ string command; cin >> command; if (command == "push"){ int command_num; cin >> command_num; q[e] = command_num; e++; } else if( command == "pop"){ if (s == e){ ...
ALGO
0.99883
4.132033
334c5d1d-4bf8-46ce-8262-82cac3f6cb58
p-Singh-Parmar/first-rep
arr_Queue.cpp
#include<iostream> using namespace std; class queue { public: int n; int arr[5]; int front=-1; int rear=-1; void enQ() { cout<<"enetr data:\n"; cin>>n; arr[rear]=n; rear++; if(front==-1) front++; } void deQ() { cout<<arr[front]<<endl; arr[front]=0; front++; } int main() { queue...
ALGO
0.992444
3.243092
3a81abaa-fec3-409e-bc3a-2ead4b259fc8
Pratikraut5530/DSA2024
OOPS/17may.cpp
#include<iostream> #include<string.h> using namespace std; //inheritance - single,multiple,multilevel,hybrid //polymorphism - 1.compile time polymorphism - function overloading,operator overloading //2.runtime polymorphism - function overloading class Animal{ public: void speaking(){ cout<<"Animal Spea...
TOOL
0.870073
4.245446
dd6ee899-ee26-48bc-8609-8b521babca1c
Gooner1886/DSA-101
greedy/twoCityScheduling.cpp
// Leetcode - 1029 - Two City Scheduling int twoCitySchedCost(vector<vector<int>> &costs) { vector<int> diff; int mincost = 0; for (int i = 0; i < costs.size(); ++i) { // cost to send every person to city A mincost += costs[i][0]; // computing difference if person sent to city B...
ALGO
0.999946
6.223368
3e1a94b8-8df9-4d77-a259-40643d9010fd
ishandutta2007/codeforces
isonan/normal/343/D.cpp
#include <cstdio> int head[500001],nxt[1000001],b[1000001],k,lazy[2100001]; int son[1000001],dfn[1000001],size[1000001],mx[1000001],now,top[1000001],fa[1000001],n; void push(int s,int t){ nxt[++k]=head[s]; head[s]=k; b[k]=t; } void dfs1(int x,int f){ size[x]=1; fa[x]=f; for(int i=head[x];i;i=nxt[i]) if(b[i]!=f...
ALGO
0.999974
4.260816
ce40e237-6472-4e13-aba4-069ced925e87
tuanha1508/Cpp_Journey
leetcode/Medium/3443.CPP
//3443. Maximum Manhattan Distance After K Changes /* Time Complexity: O(n) Space Complexity: O(1) Problem Overview: Find the maximum Manhattan distance after making at most k changes to the string s, where each change can replace a character with any of 'N', 'S', 'E', or 'W'. Approach: Greedy, Ar...
ALGO
0.999956
6.167558
df967ee5-a2a7-40a5-bcc3-2b693cc5872a
delahee/hae_gp2_2019
mt_case_switch/Box2D/Contributions/Platforms/Box2D.Net/Matrix.cpp
#pragma once #include "Stdafx.h" #include "Vector.cpp" namespace Box2D { namespace Net { public ref class Matrix { internal: Matrix(const b2Mat22 &matrix) : col1(gcnew Vector(matrix.col1)), col2(gcnew Vector(matrix.col2)) { } b2Mat22 getMat22() { return b2Mat22(col1->getVec2(), col2->getVec2()); ...
TOOL
0.993287
6.8182