uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
53c1fb81-d0dd-4906-adee-42f26490bcab
SpectraL519/PWR-S7-SD
presentation2/test.cpp
#include <iostream> #include <vector> #include <memory> template <typename T> class IPropertyElement { public: virtual ~IPropertyElement() = default; virtual T property() const = 0; }; class Vertex { public: Vertex(int id) : _id(id) {} virtual ~Vertex() = default; int id() const { retur...
TOOL
0.909639
6.167426
f8fdb27c-e51a-4e57-8d21-610ff7291fce
guilhermebluhm/c_plus_plus-course
c-Strings/mostFrequency.cpp
#include <iostream> #include <cstring> using namespace std; int main(){ //para todos os possiveis 255 posicoes de ASCII //descartando os estendidos int countFrq[255] = {0}; const int MAX_TAM = 100; char vT1[MAX_TAM] = {}; std::cout << "enter your sentense: "; std::cin.getline(vT1, MAX_T...
ALGO
0.999413
4.592613
a5c6a33a-68f5-446f-b431-f7dd0db593f4
Fanananan/GoodGoodStudy
Algorithm/PAT-A/1097.cpp
#include <cstdio> #include <stdlib.h> #include <algorithm> using namespace std; const int maxn = 100000; struct NODE { int address, key, next, num = 2 * maxn; //num让其数时数据规模的两倍,中间留出充足的空间进行分类放置 } node[maxn]; bool exist[maxn] = {false}; int cmp(NODE a, NODE b) { return a.num < b.num; } int main() { int begin,...
ALGO
0.999075
3.395382
e033181b-832c-49dc-8c8f-ba48b75c398d
SABARISHR4092/OPERATING-SYSTEM
OS C 39.cpp
#include <stdio.h> #include <stdlib.h> #define MAX 100 void csan(int arr[], int n, int head, int direction) { int seek_sequence[MAX], distance, seek_count = 0, cur_track; int i, j; // Sort the request array for (i = 0; i < n - 1; i++) { for (j = 0; j < n - i - 1; j++) { if (arr[j]...
ALGO
1
4.882158
ddd3a600-4a57-47e3-b24a-58ecd0cdf026
BIT-aerial-robotics/active_vision_control
quadrotorload_input_pos.cpp
/** * Author David Ariens, Rien Quirynen * Date 2009-2013 * http://www.acadotoolkit.org/matlab */ #include <acado_optimal_control.hpp> #include <acado_toolkit.hpp> #include <acado/utils/matlab_acado_utils.hpp> USING_NAMESPACE_ACADO #include "quadrotor_load_dynamics_L_pos.cpp" #include <mex.h> void mexFunc...
ALGO
0.999192
5.917847
c936e5db-c93e-4664-b63a-ef1bcdcbd35b
MehediHasan-75/code
B_Fibonaccharsis.cpp
#include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define prnt(x) for(auto &it: x)cout<<it<<" ";cout<<"\n"; #define all(x) (x).begin(), (x).end() #define sz(x) ((ll)(x).size()) typedef long long ll; typedef vector<ll> vll; const ll N = 2e5 + ...
ALGO
0.999866
3.955857
019be836-03f1-4bf4-ad21-20fe11da8e0b
MonakaResearch/pytorch-a64fx
aten/src/ATen/native/Distance.cpp
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/core/grad_mode.h> #include <ATen/ExpandUtils.h> #include <ATen/NamedTensorUtils.h> #include <ATen/TensorOperators.h> #include <ATen/native/Distance.h> #include <c10/util/accumulate.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/...
ALGO
0.998218
7.310769
b60e9d75-3fa2-4f4d-99c0-fddf6894c6b4
zeyuanzhao/usacoguideold
bcount/bcount.cpp
#include <bits/stdc++.h> using namespace std; int main() { freopen("bcount.in", "r", stdin); freopen("bcount.out", "w", stdout); int n, q; cin >> n >> q; vector<int> holsteins(n+1, 0); vector<int> guernseys(n+1, 0); vector<int> jerseys(n+1, 0); for (int i = 1; i <= n; i++) { in...
ALGO
0.999904
3.63597
d7d29fbb-b425-4663-b2d5-f9b5b599566a
leehi0110/Algorithm
ProgrammersAlgorithm/Cpp/Level_2/L2_Find_Prime_Number.cpp
#include <string> #include <vector> #include <iostream> #include <algorithm> #include <cmath> using namespace std; int solution(string numbers) { int answer = 0; string tmp = numbers; sort(tmp.begin(),tmp.end(),greater<char>()); int max_val = stoi(tmp); vector <bool> prime(max_val+1,true); v...
ALGO
0.999581
5.15101
3aad18ee-5741-4ec9-89a2-19304444c426
qweraqq/lineage-20-bionic
libc/bionic/semaphore.cpp
// Memory order requirements for POSIX semaphores appear unclear and are // currently interpreted inconsistently. // We conservatively prefer sequentially consistent operations for now. // CAUTION: This is more conservative than some other major implementations, // and may change if and when the issue is resolved. #in...
TOOL
0.921548
7.806409
19e7342b-fa75-4a54-8483-73abec01e29f
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_5370_4.cpp
#include <bits/stdc++.h> using namespace std; int n, N, a[2005][2005], mn = 2000000000, mnp, dis[2005], vis[2005]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; for (int i = 1; i <= n; i++) for (int j = i + 1; j <= n; j++) { cin >> a[i][j]; if (a[i][j] < mn) { ...
ALGO
0.999923
3.05699
4c1aa4ac-244c-4785-ad05-7e3a5a551040
Revuelt0/LearningCpp
PrvniC2xPlusProjekt/PrvniC2xPlusProjekt/Math.cpp
int Multiply() { return 5 * 2; }
TOOL
0.877841
3.640127
cb1c2a8d-c2d1-4913-af3d-6b3e77288600
smundhra-git/Kattis_Solutions
vauvau.cpp
#include <iostream> #include <vector> #include <string> #include <sstream> #include <unordered_map> #include <unordered_set> #include <cmath> #include <set> #include <climits> #include <queue> #include <stack> #include <numeric> #include <iomanip> using namespace std; typedef vector<int> vi; typedef pair<double, doub...
ALGO
0.99998
4.788608
254bd310-c548-49dd-9b6d-afa161d15778
HumanHyeon/Algorithm_Book
Problem/Yutae/Week1/B16926(배열돌리기1).cpp
// https://www.acmicpc.net/problem/16926 #include <iostream> #include <cstring> using namespace std; int N, M, R; int A[301][301] = { 0, }; int B[301][301] = { 0, }; int dy[4] = { 1,0,-1,0 }; int dx[4] = { 0,1,0,-1 }; void rotation() { for (int i = 0; i < N / 2; i++) { int y = i, x = i; for (int j = 0; j < 4...
ALGO
0.999813
3.865058
0368cf97-64a6-4a3b-92a2-8e7e1f9eb5ad
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_9267_0.cpp
#include<algorithm> #include<iostream> #include<cstring> #include<cstdio> //by NeighThorn using namespace std; const int maxn=10+5; int n,a[maxn],ans; inline int gcd(int x,int y){ return y==0?x:gcd(y,x%y); } signed main(void){ scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); ans=a[1]; for(int i=2;i<=n;i+...
ALGO
0.999987
3.230122
02c14f3c-6d62-4680-9cf5-cca1de8e7316
vidheeagrawal/Cpp-Codes
vowels.cpp
#include<bits/stdc++.h> using namespace std; int countVowels(string s){ int count = 0; for(int i=0;i< s.length();i++){ char ch = s[i]; if( ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') count++; } return count; } int main(){ string s; cout<<"Enter a strin...
ALGO
0.998137
5.102263
2ddf7f59-ce60-4769-bd2c-ab291f10c589
harshturakhia/Data-Structure-Algorithm-in-CPP
prac3.cpp
#include "bits/stdc++.h" #define MAX_ELEMENT 50 using namespace std; void radixSort(int arr[], int n) { } void shellSort(int arr[], int n) { for (int gap = n / 2; gap > 0; gap /= 2) { for (int i = gap; i < n; i += 1) { int temp = arr[i]; int j; for (j = i; j...
ALGO
0.999786
4.39186
07cffd17-b1f3-41e0-86b2-8055db18f518
107-systems/l3xz_gait_ctrl
src/gait/state/Init_Femur.cpp
/************************************************************************************** * INCLUDES **************************************************************************************/ #include <l3xz_gait_ctrl/gait/state/Init_Femur.h> #include <l3xz_gait_ctrl/gait/state/Init_Tibia.h> #include <l3xz/l3xz.h> /***...
TOOL
0.918171
5.890993
d751f6c1-4754-415d-ab38-578c24d3a988
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_10578_2.cpp
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization("unroll-loops") using namespace std; long long int n; long long int dp[30]; bool check(long long int m) { long long int num = ((m) * (m - 1)) / 2; return (num <= n); } long long int binsrc() { long l...
ALGO
0.999892
4.910501
230a5f0c-698e-495b-a553-9bad55b2c70c
khanreaz/resketch
lib/eigen/doc/examples/class_CwiseUnaryOp.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; // define a custom template unary functor template<typename Scalar> struct CwiseClampOp { CwiseClampOp(const Scalar& inf, const Scalar& sup) : m_inf(inf), m_sup(sup) {} const Scalar operator()(const Scalar& x) const { return x<m_...
ALGO
0.90579
6.433227
20586baa-7c99-4dab-b5bf-390cbee06d85
Nithish-9/Competitive-programming
DivA/Wrong Subtraction.cpp
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. ******************************************...
ALGO
0.999909
4.209848
ad8cb220-5324-47ed-8a26-918f848f0a93
mosra/magnum
src/Magnum/Math/Test/IntersectionBenchmark.cpp
#include <random> #include <Corrade/TestSuite/Tester.h> #include "Magnum/Math/Angle.h" #include "Magnum/Math/Intersection.h" namespace Magnum { namespace Math { namespace Test { namespace { template<class T> bool rangeFrustumNaive(const Math::Range3D<T>& box, const Math::Frustum<T>& frustum) { for(const Math::Ve...
TEST
0.955075
7.416462
9ef64e9f-572c-42b2-bb70-bbdedfdd3b03
ishandutta2007/codeforces
demoralizer/normal/743/E.cpp
#include "bits/stdc++.h" using namespace std; #define pb push_back #define ppb pop_back #define pf push_front #define ppf pop_front #define all(x) (x).begin(),(x).end() #define uniq(v) (v).erase(unique(all(v)),(v).end()) #define sz(x) ...
ALGO
0.999667
3.758732
a3be24b5-b0d1-4a41-948e-d3522cf4ca0a
mwashief/step
Codeforces/1251-1500/1485/1485C.cpp
/* Washief Hossain Mugdho 12 February 2021 701Div2 C */ #ifndef DEBUG #pragma GCC optimize("O2") #endif #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fr first #define sc second #define fastio ios_base::sync_with_stdio(0) #define untie cin.tie(0) #define rep(i, n) for (int i = ...
ALGO
0.999901
4.593776
01aa4cc1-e467-4717-9cb5-344822cd56b1
marineve17/FEUP-PROG
ficha1/cap4/4.11c/main.cpp
#include <iostream> #include <cstdlib> using namespace std; int comparator(const void* a, const void* b) { if (*(int*)a > *(int*)b) { return 1; } else if (*(int*)a == *(int*)b) { return 0; } else { return -1; } } int main() { int arr[10] = {6, 1, 3, 5, 10, 8, 2, 9, 4, ...
ALGO
0.999982
4.771562
fa0cd6db-7a40-40a1-9fe9-254d9729ce4e
marble234/LAMMPS
src/USER-SPH/fix_meso_stationary.cpp
#include "stdio.h" #include "string.h" #include "fix_meso_stationary.h" #include "math.h" #include "stdlib.h" #include "string.h" #include "atom.h" #include "comm.h" #include "force.h" #include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" #include "update.h" #include "integrate.h" #include "respa.h" ...
ALGO
0.986845
6.223447
49dd070d-c48c-4daf-a0e2-b713588f6bfc
MoeinGhaniyoun/LLVM-SLH-RISCV
libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
// <vector> // iterator insert(const_iterator position, size_type n, const value_type& x); #include <vector> #include <cassert> #include <cstddef> #include "test_macros.h" #include "test_allocator.h" #include "min_allocator.h" #include "asan_testing.h" TEST_CONSTEXPR_CXX20 bool tests() { { std::vector<i...
TEST
0.887806
5.774403
b6518f85-3ce1-4562-85ac-c0219b1565bc
moon1198/Leetcode
DP/solution63.cpp
#include <vector> #include <string> #include <map> #include <iostream> #include <algorithm> #include <numeric> using namespace std; int solution63_0(vector<vector<int>> &obstacleGrid) { vector<vector<int>> dp(obstacleGrid.size(), vector<int>(obstacleGrid[0].size(), 1)); for (int i = 0; i < obstacleGrid.size()...
ALGO
0.999883
5.621669
c9b92254-7abd-469a-9e6f-69b988384349
proxmox/ceph
ceph/src/boost/libs/compute/example/sort_vector.cpp
#include <algorithm> #include <iostream> #include <vector> #include <boost/compute/system.hpp> #include <boost/compute/algorithm/copy.hpp> #include <boost/compute/algorithm/sort.hpp> #include <boost/compute/container/vector.hpp> namespace compute = boost::compute; int rand_int() { return rand() % 100; } // this...
ALGO
0.999659
5.922979
692a8ae9-9676-4d09-90ba-e3e8e767617b
GorkemOkur/Cpp-How-to-Program-9-e
Chapter06/exercise_6-50.cpp
/* * ===================================================================================== * * Filename: exercise_6-50.cpp * * Description: 6.50 (Pass-by-Value vs. Pass-by-Reference) * * * Version: 1.0 * Created: 22/05/18 00:04:00 * Revision: none * Compiler:...
TOOL
0.976242
5.968279
0a5c88a4-af34-472b-af1d-9d19174ac044
Eduardofig/Competitive-Programming-Solutions
codeforces/codeforces-121/c.cpp
#include <bits/stdc++.h> using namespace std; using ui = unsigned int; using l = long; using ul = unsigned long; using ll = long long; using ull = unsigned long long; const int MXN = 2e5 + 3; const int INF = 0x3f3f3f3f; int n; vector<string> names; int dp[26][26] = { 0 }; void solve() { for(string name: name...
ALGO
0.999876
5.036118
ffba7145-ab39-4899-a2f0-86ab2aa75e98
mitsos-tsali/al-go-rithms
sort/Slow_Sort/C/Slow_Sort.cpp
//Returns the sorted vector after performing SlowSort //It is a sorting algorithm that is of humorous nature and not useful. //It's based on the principle of multiply and surrender, a tongue-in-cheek joke of divide and conquer. //It was published in 1986 by Andrei Broder and Jorge Stolfi in their paper Pessimal Algor...
ALGO
0.999837
5.018224
79d773d3-939d-42aa-92f4-37101d15b928
Fransiscus-Xaverius/PRAKTIKUM
Intro to Programming(C++)/T2/beratbadanideal.cpp
#include <iostream> #include <math.h> using namespace std; int main(){ int jk,tb; double bbskrg,bbt,bbp,bbi; cout<<"Program Berat Ideal"<<endl<<endl; cout<<"Gender"<<endl<<endl; cout<<"1. Pria"<<endl; cout<<"2. Wanita"<<endl<<endl; cout<<"Pilih : ";cin>>jk;; cout<<"Masukkan tinggi badan : ";cin>>tb; cout<<"Masukkan...
ALGO
0.998716
4.011873
0632fea0-df8f-42b1-82f7-b1f20fd21331
ishandutta2007/codeforces
wxhtzdy/normal/200/B.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double sum = 0; for (int i = 0; i < n; i++) { double a; cin >> a; sum += a; } cout << fixed << setprecision(12) << (double) sum / (double) n; }
ALGO
0.984441
4.065096
1a17c61c-2a97-4876-93e0-82f927f4c941
CherYou/-XL
stock111/externalsort.cpp
#include<algorithm> #include<fstream> #include<cstdio> #include<iostream> #include"stock.h" #include"maxheap.h" using namespace std; FILE* fileopen(char *filename,char *mode) { FILE* fp = fopen(filename, mode); if (fp == NULL) { perror("Error while opening the file.\n"); exit(EXIT_FAILURE); ...
DATA
0.945485
3.483432
4a929a22-3ed1-4c9a-8308-18608361e975
StepXo/Ada
Modulo6/UniendoPuntos/UniendoPuntos.cpp
#include <iostream> #include <vector> #include <cmath> #include <queue> #include <limits> using namespace std; double distancia(double x1, double y1, double x2, double y2) { return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); } double prim(int N, const vector<pair<double, double>>& puntos) { vector<b...
ALGO
0.999637
5.029965
6efcadaf-82b8-4945-82d2-f1d410e5f67d
ishandutta2007/codeforces
tute7627/normal/582/C.cpp
//#define _GLIBCXX_DEBUG #include<bits/stdc++.h> using namespace std; #define endl '\n' #define lfs cout<<fixed<<setprecision(10) #define ALL(a) (a).begin(),(a).end() #define ALLR(a) (a).rbegin(),(a).rend() #define spa << " " << #define fi first #define se second #define MP make_pair #define MT make_tuple #define P...
ALGO
0.999972
3.657976
1938f45a-b45b-4b88-96f0-1fc51d1ea67a
psolblanc/UdacityCpp-RoutePlanning
src/route_planner.cpp
#include "route_planner.h" #include <algorithm> RoutePlanner::RoutePlanner(RouteModel &model, float start_x, float start_y, float end_x, float end_y): m_Model(model) { // Convert inputs to percentage: start_x *= 0.01; start_y *= 0.01; end_x *= 0.01; end_y *= 0.01; // TODO 2: Use the m_Model.Fi...
ALGO
0.992784
4.939473
dfbfc9a5-47cf-4de4-993b-44a9c4e18752
sarvex/leetcode-clojure
solution/0500-0599/0559.Maximum Depth of N-ary Tree/Solution.cpp
/* // Definition for a Node. class Node { public: int val; vector<Node*> children; Node() {} Node(int _val) { val = _val; } Node(int _val, vector<Node*> _children) { val = _val; children = _children; } }; */ class Solution { public: int maxDepth(Node* root) { ...
ALGO
0.999955
6.417494
0739e3ff-e8bd-4309-8237-f924f6ca9012
amantaiaitolkyn/ADS1
ADS/LAB4/4.cpp
#include <iostream> using namespace std; struct Node{ int val; Node* left; Node* right; Node(int val){ this-> val = val; left = right =NULL; } }; class BST{ private: Node* root; Node* push(Node * cur,int val){ if(cur == NULL){ return new Node(val); ...
ALGO
0.999904
5.058806
f04fc3a4-c753-4830-95ef-093e4a4c62da
AleksaArsic/Cpp-Algorithms-and-Data-Structures
linked_lists/circular_linked_list/main.cpp
#include <iostream> #include <memory> #include "CircularLinkedList.h" std::shared_ptr<int[]> createDummyArray(const unsigned int sizeOfArray) { std::shared_ptr<int[]> elementsToAdd = std::make_shared<int[]>(sizeOfArray); for (int i = 0; i < sizeOfArray; ++i) { elementsToAdd[i] = i; } ...
ALGO
0.99548
4.791474
db7bd1cc-aee2-4837-8d16-369ac3407169
marinaKadochnikova/labs
lab4/MinimalBST/MinimalBST/BinaryTree.cpp
#include"BinaryTree.h" #include"TreeNode.h" BinaryTree::BinaryTree() { root = nullptr; } BinaryTree::BinaryTree(TreeNode* firstNode) { root = firstNode; } BinaryTree::~BinaryTree() { Destoy(root); } void BinaryTree::Destoy(TreeNode* node) { if (node) { Destoy(node->pLeft); Destoy...
ALGO
0.999951
4.336195
f6412ba7-1b2e-4dfb-aadf-5c9144300a4e
2TAJ/przyklady
charNaInt.cpp
#include <iostream> using namespace std; int main() { char znak, znak1; int liczba, liczba1; cout << "Podaj dwie cyfry: " << endl; cin >> znak >> znak1; liczba = (int)znak; liczba -= 48; liczba1 = (int)znak1; liczba1 -= 48; cout << "Wynik " << liczba << " + " << liczba1 << " = " <<...
ALGO
0.997162
3.775733
40214662-5f4a-420c-ba8c-5834697bc363
erisrivera19/Tarea_Estructura_5
main.cpp
#include "Evaluador.h" #include <iostream> // std::cin, std::cout #include <vector> // std::list using namespace std; int infinito = 9999; //Dado: un grafo con 5 nodos implementado en una tabla (arreglo bidimensional) //Dado: las columnas de la tabla representan el inicio y las filas el destino //Dado...
ALGO
0.997111
4.325723
5d71e958-08b2-4f11-b589-7fa7cde3f947
meeuw007/Path-Planning-Project
src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp
#include <Eigen/Dense> #include <iostream> using namespace Eigen; using namespace std; int main() { MatrixXf m(2,2); m << 1,-2, -3,4; cout << "1-norm(m) = " << m.cwiseAbs().colwise().sum().maxCoeff() << " == " << m.colwise().lpNorm<1>().maxCoeff() << endl; cout << "infty-norm(m...
ALGO
0.999486
4.076589
d6c27bb0-da48-413f-a4bf-ac613012b2d0
animay7860/CodeForces-CodeChef
A_Everybody_Likes_Good_Arrays.cpp
/*Author :- Animay Prakash*/ #include <bits/stdc++.h> #include <bits/extc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; /*------ TypeDef Micro's -------*/ using ll = long long; using li = long int; using ld = long double; using lli = long long int; using vb = st...
ALGO
0.999848
4.917552
c34b7f32-4971-4c03-ada1-055498a85865
denis-chakarov/algorithm-course
permutation swap/permSwap.cpp
#include <iostream> #include <cstdio> using namespace std; int N, a[2000000]; long long inversions; void input() { scanf("%d", &N); for( int i = 0; i < N; i++ ) scanf("%d", &a[i]); } int b[2000000]; void Merge( int left, int right ) { int k = 0; int mid = (left+right)/2; int i = left, j = ...
ALGO
0.999686
4.120538
a7200761-57b0-4fcb-b783-5336922db34e
akash9721/ALL_DSA_TOPIC
PatternProgram/butterfly.cpp
#include<bits/stdc++.h> using namespace std; void butterfly(int n) { for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(i==j ||i+j==n-1 ||j==0 ||j==n-1) { cout<<"*"; } else cout<<" "; } cout<<endl; ...
ALGO
0.999945
3.875375
cb0bff1d-90bf-4498-97ce-2c9e6e93ef6c
raedzayoud/Competitive-Programming
graph/841. Keys and Rooms.cpp
#include <iostream> #include <vector> using namespace std; void dfs(int index, vector<vector<int>> &rooms, vector<bool> &vis) { if (vis[index]) { return; } vis[index] = true; for (int i = 0; i < rooms[index].size(); i++) { int key = rooms[index][i]; dfs(key, ro...
ALGO
0.999886
6.098647
eb33c554-082a-42c4-8904-805c7339d251
Afaf-wasili/ComputationalCourse
Lab/Q1KU.cpp
//Question: Define the variables x and y in separate header file void Statements(){ if (x < y) { std::cout << x << " is less than " << y << std::endl; } else if (x > y) { std::cout << x << " is greater than " << y << std::endl; } else { std::cout << x << " and " << y << " are equal" ...
TOOL
0.96926
3.114678
51122c7d-cffc-485f-9557-f6bb00a91b7a
TheTrustyPwo/CP
CodeBreaker/ghostrule.cpp
#include <bits/stdc++.h> using namespace std; #define int long long int n, x, k, d, depth[2005]; vector<int> g[2005]; bool h[2005], visited[2005]; bool acc[2005][2005]; void bfs(int start) { for (int i = 0; i <= n; i++) visited[i] = 0; queue<pair<int, int>> q; q.emplace(start, 0); visited[start] = 1; while (!q.em...
ALGO
0.999948
5.066633
1c2f54ce-b166-4ec2-a22b-59523ea69595
TwistedCore/frameworks_av
media/libstagefright/codecs/m4v_h263/dec/src/deringing_luma.cpp
#include "mp4dec_lib.h" #include "post_proc.h" #ifdef PV_POSTPROC_ON void Deringing_Luma( uint8 *Rec_Y, int width, int height, int16 *QP_store, int, uint8 *pp_mod) { /*---------------------------------------------------------------------------- ; Define all local variables --...
ALGO
0.999437
3.200507
cd75b573-1b84-4d9f-b10c-4dd34841e6c4
raydzai/informaticsCityOlympiad-2024
260823/C++/CAU12.cpp
#include <iostream> #include <cmath> using namespace std; int oddExpo(int x, int n){ if (n == 0){ return x; } return pow(x, 2*n+1) + oddExpo(x, n-1); } int main(){ int x, n; cin >> x >> n; cout << oddExpo(x, n); return 0; }
ALGO
0.999973
4.676808
ec8f3f8a-6b3c-4ad4-9560-974fbe3007e7
Schrodinger1926/A2OJ
div2A/4.11.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; int min = 100; int max = 0; int max_i,min_i; for (int i = 0; i < n; ++i) { int x; cin >> x; if(x > max){ max = x; max_i = i; } if(x <= min){ min = x; min_i = i; } } max_i < min_i ? cout << max_i + n - 1 - min_i << e...
ALGO
0.999897
3.535869
2c3a52e2-0405-430b-9e72-6df72aeb048c
Shawdox/Pymutate
code_translation/Datasets/TransCoder/transcoder_evaluation_gfg/cpp/CHANGE_BITS_CAN_MADE_ONE_FLIP.cpp
#include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include <bits/stdc++.h> using namespace std; bool f_gold ( string str ) { int zeros = 0, ones = 0; for ( char ch : str ) ( ch == '0' ) ? ++ zeros : ++ ones; return ( zeros == 1 || ones == 1 ); } //TO...
ALGO
0.991744
5.467438
47880efd-c297-46d8-ad46-026afb84d9ed
fciapsa/Competitive-Programming
AceptaElReto/308InsercionDeParentesis.cpp
#include <iostream> #include <vector> #include <string> struct resultados { bool a = false, b = false, c = false; }; int main() { std::string s; std::cin >> s; while (std::cin) { if (s.size() > 1) { std::vector<std::vector<resultados>> tabla(s.size(), std::vector<resultados>(s.size())); //casos base fo...
ALGO
0.999783
4.135783
8a8b252c-b6c0-4ad6-a33d-ee7ef9b1c682
electrohyun/snake_game
snake_game/play.cpp
#include <iostream> #include <thread> #include <chrono> #include <conio.h> #define WIDTH 60 #define HEIGHT 30 using std::cout; using std::endl; int score = 0; char direction = 'd'; char board[HEIGHT][WIDTH]; struct snake { int pos[2]; // ġ snake* node; // }; void snake_add(snake* head, int tailY, int tailX) { s...
TOOL
0.902719
3.965453
2e4f3c82-9ef5-4745-b18d-66a57d1e33a6
RigoLigoRLC/Fritzing-build
boost_1_82_0/libs/program_options/src/config_file.cpp
#define BOOST_PROGRAM_OPTIONS_SOURCE #include <boost/program_options/config.hpp> #include <boost/program_options/detail/config_file.hpp> #include <boost/program_options/errors.hpp> #include <boost/program_options/detail/convert.hpp> #include <boost/throw_exception.hpp> #include <iostream> #include <fstream> #include ...
TOOL
0.938582
7.239641
6223151c-27be-477e-957b-e81ceee3c935
chyhhwen/image-recognition-java
opencv/sources/samples/cpp/minarea.cpp
#include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> using namespace cv; using namespace std; static void help() { cout << "This program demonstrates finding the minimum enclosing box, triangle or circle of a set\n" << "of points using functions: minAreaRect(...
ALGO
0.996906
5.668061
e354b9e9-0382-4aed-bcfa-fc5b2d8b10b9
yash-chintu/LeetCode
Feb2022/day13.cpp
class Solution { public: void findsub(vector<vector<int>> &res, vector<int> nums, int i) { int j = 0; vector<int> v; while (i > 0) { if ((i & 1) == 1) v.push_back(nums[j]); j++; i = i >> 1; } res.push_back(v); ...
ALGO
0.999987
5.83101
7db86af9-92f1-4669-a8d1-cf632e430cf1
iPiyushJaiswal/codingPlatform
codePOD/2023/09September/D23M09Y2023/LeetCodeD23M09Y2023POD.cpp
/*Problem LeetCode (Medium) 1048. Longest String Chain Question link: https://leetcode.com/problems/longest-string-chain/description/?envType=daily-question&envId=2023-09-23 Logic: DP ------------------------- Complexity: Method 1: DP Time Complexity=O(n*n*l) l=length of longest string. Space Complexity=O(n) ...
ALGO
0.999995
6.092428
581b4440-6d73-47da-9f7a-a412f1cf6990
ba2slk/boj-solutions
BOJ/17946.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, k; cin >> n; int max_piece; int to_give; int max_to_eat; for (int i = 0; i < n; i++) { cin >> k; to_give = 0; max_to_eat = 0; max_piece = (2 + ((1 + k) * k)) / 2; to_give = ((1 + k)...
ALGO
0.999871
3.719388
0cc53764-6934-4b56-b0a9-51051c3fc65b
LucasSenandeLopez/C-Cpp
Cpp_Code/IntroductionToCpp/Chapter8/U_8_3/Ex_U_8_3.cpp
/* We are proposed to use pointers to display the fractional part of a double */ #include <iostream> using namespace std; int main() { double num_doub, *ptr_doub = &num_doub; double num_frac, *ptr_frac = &num_frac; int num_base, *ptr_base = &num_base; cout << "Input a number: \n"; cin >> *p...
ALGO
0.89713
3.757555
4e1e6667-4aa9-423f-a7dc-2696b0d106f7
StarfishC/StudyNotes
数据结构/习题/src/3-栈和队列/3-1-5.cpp
// File: 3-1-5.cpp // Author: csh // Date: 2020/08/23 // Update: 2021/02/27 // =================== #include <iostream> using namespace std; template <typename T> class Link { public: T Data; Link<T> *Next; Link(const T &info, Link<T> *nextlink=nullptr): Data(info), Ne...
ALGO
0.990476
4.184292
973fe0cb-0785-4bec-a47e-995c5521538c
adityajamwal02/LeetcodeProblemSet1
LargestRectangleInHistogram.cpp
/* Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram. Example 1: Input: heights = [2,1,5,6,2,3] Output: 10 Explanation: The above is a histogram where width of each bar is 1. The largest rectangle is sh...
ALGO
0.999977
6.961521
be9af5fe-edda-47d1-8703-596586c1b7f4
sarvex/leetcode-matlab
solution/0300-0399/0365.Water and Jug Problem/Solution.cpp
class Solution { public: bool canMeasureWater(int jug1Capacity, int jug2Capacity, int targetCapacity) { if (jug1Capacity + jug2Capacity < targetCapacity) return false; if (jug1Capacity == 0 || jug2Capacity == 0) return targetCapacity == 0 || jug1Capacity + jug2Capacity == targetCapacity;...
ALGO
0.999889
6.077153
fddf44b7-74a0-4c2c-916d-e5238cf386b0
cursed-0men/CPP-Programming
90_substring_condition.cpp
// substring condition // tro print null when substring can't be created #include<iostream> #include<cstring> using namespace std; int main(){ char s1[15] = "programming"; char s2[10] = "k"; if(strstr(s1,s2)!=NULL){ cout<<strstr(s1,s2)<<endl; } else{ ...
ALGO
0.9961
3.277953
d1b33932-3a54-4e15-a4e8-1b207e5b2202
rumdien113/Algorithm
CODEFORCES/Div4_993/B.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define pf push_front #define db long double #define st first #define nd second #define fast ios_base::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL); #define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr) #define all(x...
ALGO
0.999873
4.327896
13409199-049e-4ed5-b8e0-3b12c5cc0bdf
calubtus/gem5_cache_partitioning
src/systemc/tests/systemc/datatypes/fx/shift/operator_shift_right.cpp
/***************************************************************************** operator_shift_right.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /***************************************************************...
ALGO
0.891951
3.479373
6a2be1fd-be09-41c3-8395-6c9043068a32
babu12f/uri_problem_solved
Interval 2_1072.cpp
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <iomanip> #include <stdio.h> #define pf printf #define sf scanf using namespace std; int main() { int test, in=0, out=0, n; cin>>test; while(test--) { cin>>n; if(n>=10 && n<=20) in++; else ...
ALGO
0.995415
3.462242
050981f5-35b9-4884-9a61-0ad8d8c369ec
realcx/leetcode_roger
[other]Array Nesting.cpp
/* g++ origin.cpp -o hello -std=c++11 */ #include <iostream> #include <set> #include <cassert> #include <vector> #include <algorithm> #include "common/vector_util.hpp" using namespace std; /* Descrition: A zero-indexed array A of length N contains all integers from 0 to N-1. Find and return the longest length of s...
ALGO
0.999814
5.752984
3f2b08da-d127-46f8-986c-b0f6b6fb9b52
Next-Gen-UI/Code-Dynamics
LoveBabbar/11_heap/06_merge_k_sorted_array.cpp
/* link: https://practice.geeksforgeeks.org/problems/merge-k-sorted-arrays/1 sol: https://www.geeksforgeeks.org/merge-k-sorted-arrays-set-2-different-sized-arrays/ [above solution will work for both] sol (just to refer): https://www.geeksforgeeks.org/merge-k-sorted-arrays/ */ // ---------------------...
ALGO
0.999969
5.241892
335e63e8-768b-4274-93d7-188923533d27
scottp/xcsoar
Common/Source/Device/Volkslogger/vlutils.cpp
#include <ctype.h> #include <stdio.h> char *utoa(unsigned value, char *digits, int base) { const char *s = "0123456789abcdefghijklmnopqrstuvwxyz"; if (base == 0) base = 10; if (digits == NULL || base < 2 || base > 36) return NULL; if (value < (unsigned) base) { digits[0] = s[va...
TOOL
0.988149
5.979145
95f13c6a-2f46-498c-a787-bd9d000bf4d2
sommerlukas/llvm-offload-jetson
libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp
// <algorithm> // template<ForwardIterator Iter, class T, CopyConstructible Compare> // constexpr bool // constexpr after C++17 // binary_search(Iter first, Iter last, const T& value, Compare comp); #include <algorithm> #include <vector> #include <functional> #include <cassert> #include <cstddef> #include "...
TEST
0.999024
7.314066
fd5265fa-3067-4e96-9e67-f3d4c895d6d4
hs094/CP
LeetCode/Easy/1752.cpp
class Solution { public: bool check(vector<int>& nums) { int i=0, n = nums.size(); int cnt = 0; for(int i=0;i<n-1;i++) { if(nums[i] > nums[i+1]) cnt++; } return cnt == 0 || (cnt == 1 && nums[0] >= nums[n-1]); } };
ALGO
0.999985
5.647998
686ce1c0-acff-4caf-92da-de80ea3b29c2
pratyaksh29/DSA-Leetcode
105-construct-binary-tree-from-preorder-and-inorder-traversal/construct-binary-tree-from-preorder-and-inorder-traversal.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.999982
6.555104
6d71f9dd-8e04-49a1-a9bc-dcc97931de66
Purvesh271/CPP
while table.cpp
#include <iostream> using namespace std; int main (){ int n, i=1; cout<<"Enter the number: "; cin>>n; while(i<=10) { cout<<n<<"*"<<i<<"="<<n*i<<endl; i++; } return 0; }
ALGO
0.998338
3.402091
c2522437-db40-4065-a55c-952efa5277de
ishandutta2007/codeforces
emorgan5289/normal/886/F.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; const int inf = 1e9+10; const ll inf_ll = 1e18+10; #define all(x) (x).begin(), (x).end() #define pb push_back #define cmax(x, y) (x = max(x, y)) #define cmin(x, y) (x = min(x, y)) #ifndef LOCAL #define debug(...) 0 #else #include "../../debug.cpp" #e...
ALGO
0.999888
4.206609
0b3d371d-6503-458e-b114-212cad0b0419
anjalidevi1/DSA-
27.cpp
#include <iostream> using namespace std; // A function to implement bubble sort void bubbleSort(int arr[], int n) { for (int i = 0; i < n - 1; i++) { for (int j = 0; j < n - i - 1; j++) { if (arr[j] > arr[j + 1]) { // Swap elements swap(arr[j], arr[j + 1]); ...
ALGO
0.999913
5.880982
2ddabc59-2080-41fc-b5a0-368261cf7d9b
nensi22/CPP
3_ifelse/2_smallest.cpp
#include <iostream> int main() { int a,b,c; std::cout<<"enetr a="; std::cin>>a; std::cout<<"enter b="; std::cin>>b; std::cout<<"enter c="; std::cin>>c; if(a<b && a<c) { std::cout<<"a is smallest"; } else if(b<c) { std::cout<<"b is smallest"; } else { std::cout<<"c is smallest";...
ALGO
0.985024
3.396014
486a8a36-ed40-48ad-992c-af78951223a6
loremach/Initial_Orbit_Determination
src/gibbs.cpp
/* * @file gibbs.cpp * @brief Performs the Gibbs method of orbit determination. * * @details This file contains the implementation of the function to perform the Gibbs method of orbit determination. * This method determines the velocity at the middle point of the 3 given position vectors. * * @param r1 IJK posit...
ALGO
0.999984
5.725383
f0213162-e794-482d-9285-cce4f6dbfae3
bensapp/Stretchable-Models-for-Motion-Parsing
cps/thirdparty/opencv/share/opencv/samples/c/peopledetect.cpp
#include "cvaux.h" #include "highgui.h" int main(int argc, char** argv) { cv::Mat img; if( argc > 1 ) img = cv::imread(argv[1]); if( !img.data ) { fprintf( stderr, argc == 1 ? "ERROR: no image was specified\n" : "ERROR: the specified image could not be loaded\n"); ...
ALGO
0.995922
6.108178
dc9249f8-8238-461e-98a9-66f4095e0183
jash459/DSA-BUSTED
ongest Continuous Subarray With Absolute Diff Less Than or Equal to Limit.cpp
class Solution { public: int longestSubarray(vector<int>& nums, int limit) { deque<int> increase; deque<int> decrease; int max_len = 0; int left = 0; for (int right = 0; right < nums.size(); ++right) { while (!increase.empty() && nums[right] < increase.back()) { ...
ALGO
0.999993
6.180475
c68ee5fd-e461-487e-981b-8a442c513607
saladibhaskar/gfg
Difficulty: Easy/Product array puzzle/product-array-puzzle.cpp
//{ Driver Code Starts // Initial template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: // nums: given vector // return the Product vector P that hold product except self at each index vector<long long int> productE...
ALGO
0.999872
6.415903
4382d2d8-a205-4e01-89a0-48baaedf0f7e
ishandutta2007/codeforces
jell/normal/650/A.cpp
#line 2 "Library\\gcc_option.hpp" #ifdef LOCAL #define _GLIBCXX_DEBUG #else #pragma GCC optimize("O3") #pragma GCC target("avx,avx2") #pragma GCC optimize("unroll-loops") #endif #line 2 "Library\\gcc_builtin.hpp" #include <cstdint> namespace workspace { constexpr int clz32(const uint32_t &n) noexcept { ...
ALGO
0.999818
4.692092
4dcab9fb-97ec-4b24-ae0a-58310beeda3b
It4innovations/RoutingAlg
main-alt.cpp
#include <iostream> #include "Routing/Tests/IOUtils.h" #include "Routing/Data/Probability/ProfileStorageHDF5.h" #include "Tests/DataPaths.h" #include "Routing/Algorithms/Alternatives/AlternativesPlateauAlgorithm.h" int main(int argc, char **argv) { shared_ptr<Routing::Data::GraphMemory> routingGraph = Routing::Te...
ALGO
0.953141
5.228424
5cee7b07-f7c1-4069-a5a0-e26933b6750a
laksh0709/Hacktoberfest2022-1
Find All Roots of a Quadratic Equation.cpp
#include <iostream> #include <cmath> using namespace std; int main() { float a, b, c, x1, x2, discriminant, realPart, imaginaryPart; cout << "Enter coefficients a, b and c: "; cin >> a >> b >> c; discriminant = b*b - 4*a*c; if (discriminant > 0) { x1 = (-b + sqrt(discriminant)) / (2*a...
ALGO
0.995259
3.993403
52b11767-24cf-42cc-a28c-c2c34694590e
Junaid7200/University-Labs
Data Structures/Stacks/.history/LabEvalPractice_20240418215513.cpp
#include <iostream> using namespace std; class Node { public: int data; Node* next; Node(int data) { this -> data = data; this -> next = NULL; } void setData(int data) { this -> data = data; } void setNext(Node* node) { this -> next = node; } int getData() { return this -> data; } Node...
ALGO
0.994582
4.838723
ad800621-ee93-4174-9d59-c387e3025124
Hitdahit/Opencv_project
Lane_recognition/hsv_ransac_ver-0.cpp
#include <ctime> #include <algorithm> #include <cmath> #include <cstdlib> #include <vector> #include <utility> #include <iostream> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; typedef pair<int, int> pii; vector <pii> white1; vector <pii> white2; Mat roi(Mat srcImg) { Mat mask; Scalar colo...
ALGO
0.999724
4.81299
188a277a-6c67-4fad-82a5-fc2f495d152f
abhiyansh/Text-Compression
HuffmanCode.cpp
//takes in an frequency map, returns code for each char void getCodes(MinHeapNode* root, string st, map<char, string> &codes){ if(!root) return; if(root->c!='\0'){ codes.insert(make_pair(root->c, st)); return; } getCodes(root->left, st+"0", codes); getCodes(root->right, st+"1", codes); } map<char, string> ...
ALGO
0.999933
3.734045
4c42d893-3de3-44cb-b213-579579294643
singular-gpispace/gspc-feynman
template/template/feynman.cpp
#include <Singular/libsingular.h> #include <interface/template_interface.hpp> // This defines NO_NAME_MANGLING #include "feynman.hpp" #include "singular_functions.hpp" #include <string> #include <vector> #include <iostream> #include <sstream> #include <regex> #include "template/config.hpp" #include <kernel/linear_alge...
TOOL
0.852017
4.603429
a936e73d-25e6-42f6-a296-124bb947fc42
Refstop/VSLAM_Example
3rdparty/gtsam/gtsam/3rdparty/Eigen/demos/mix_eigen_and_c/binary_library.cpp
// This C++ file compiles to binary code that can be linked to by your C program, // thanks to the extern "C" syntax used in the declarations in binary_library.h. #include "binary_library.h" #include <Eigen/Core> using namespace Eigen; /************************* pointer conversion methods **************************...
TOOL
0.895734
6.259336
cfd7d69e-3cfe-4c88-8eb0-ecd92337ae68
TapItNinja/FAANG
0118-pascals-triangle/0118-pascals-triangle.cpp
class Solution { public: vector<vector<int>> generate(int numRows) { vector<vector<int>>ans; int num=numRows; for(int i=0; i<num; i++){ vector<int>mid(i+1,1); for(int j=1; j<i; j++){ mid[j]=ans[i-1][j-1]+ans[i-1][j]; } ans.push_...
ALGO
0.999981
5.552344
69609307-e580-4e69-9b08-a2c98d8e0404
ishandutta2007/codeforces
-is-this-fft-/normal/559/B.cpp
#include <iostream> #include <string> #include <random> #include <chrono> using namespace std; typedef long long ll; mt19937 rng; const int MOD = 1e9 + 2017; vector<ll> mults; vector<ll> xorer; ll calc_hsh (const string &s, int l, int r, int d) { if ((r - l) % 2 == 0) { ll ans = (((calc_hsh(s, l, l + ...
ALGO
0.999996
4.55982
6253ec8f-6357-47d9-a3f3-c2ba58d3b4da
cicuvc/LLVM-LA32R
libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
// UNSUPPORTED: c++03 && !stdlib=libc++ // <vector> // vector(vector&& c); #include <vector> #include <cassert> #include "test_macros.h" #include "MoveOnly.h" #include "test_allocator.h" #include "min_allocator.h" #include "asan_testing.h" TEST_CONSTEXPR_CXX20 bool tests() { test_allocator_statistics alloc_sta...
TEST
0.922108
5.416512
63ddc945-cdfb-4ee6-88f2-c7a60db88941
imnotnoa/Marlin-2.0.x-Nightly-Ender-3-SKR-Mini-E3-V1.2-BLTouch
Marlin/src/feature/meatpack.cpp
/** * MeatPack G-code Compression * * Algorithm & Implementation: Scott Mudge - <EMAIL> * Date: Dec. 2020 * * Character Frequencies from ~30 MB of comment-stripped gcode: * '1' -> 4451136 '4' -> 1353273 '\n' -> 1087683 '-' -> 90242 * '0' -> 4253577 '9' -> 1352147 'G' -> 1075806 'Z' -> 341...
TOOL
0.942064
5.863376
9e00e7cd-f75b-46da-bf54-31bcfc783c96
khaledhasanmilu/Complete_CPP_Programming
String/ArrayReverse.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int arr[n]; for (int i = 0; i < n; i++) { cin>>arr[i]; } reverse(arr,arr+n); for (int i = 0; i < n; i++) { cout<<arr[i]<<" "; } return 0; }
ALGO
0.999746
3.772047
e6969eab-b201-40c0-8c04-90f4924dcc63
kaorulego5x/comp
abc/249/C-JustK.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0; i < ll(n); i++) #define reps(i, s, n) for(ll i = s; i < ll(n); i++) #define repd(i, n) for(ll i = n-1; i >= 0; i--) #define ford(i, a, b) for(ll i = a; i >= ll(b); i--) #define fora(i, I) for(const auto& i:I) #define all...
ALGO
0.999951
4.543054
fced298a-e772-44f1-bda9-6b7effeb219b
adherent9870/data-structures-and-algorithm
linked list/deletenode.cpp
#include <iostream> using namespace std; #include "node.cpp" node *takeinput(){ int data; cin >> data; node *head=NULL; node *tail=NULL; while(data != -1){ node *newnode=new node(data); if(head==NULL){ head=newnode; tail=newnode; } else { ...
ALGO
0.999883
3.959986
8f9d6c72-e8a5-461b-afa9-837dc5071b66
brownspy1/Phitron
Semister 02/Algorithms/Week 02/Module 05/Detect_Cycle_in_Undirected_Graph_using_BFS.cpp
// Created by M.Mahadi on 2024-09-15 Time:18-55-44 #include <bits/stdc++.h> using namespace std; const int N= 1e5; vector<int> adjlist[N]; bool vis[N]; int parent[N]; bool flage; void bfs(int src){ queue<int> q; q.push(src); vis[src] = true; while (!q.empty()) { int par = q.front(); ...
ALGO
0.999921
5.106171