uuid
stringlengths
36
36
repo_name
stringlengths
5
123
relative_path
stringlengths
5
4k
content
stringlengths
33
2.85M
category
stringclasses
6 values
algo_rel_score
float64
0.85
1
quality_score
float64
3
8.76
f00ad7b1-1607-4c41-affb-868137d049be
AYUSH-ISHAN/MAPF_future_prediction_using_Transformers
od_mstar3/od_mstar.cpp
#include <chrono> #include <cassert> #include "od_mstar.hpp" using namespace mstar; OdMstar::OdMstar(std::vector<std::shared_ptr<Policy>> policies, OdCoord goals, double inflation, time_point end_time, std::shared_ptr<ColChecker> col_checker){ subplanners_ = new std::unordered_map<ColSetElement, std::sh...
ALGO
0.999068
3.872551
4e963d7e-b461-4fd8-abfd-4b9821a020ae
KhuzaimaHassan/SPRING23
code 3.cpp
#include<iostream> using namespace std; int main() { int number1 = 74, number2 = 82, number3 = 88; double average; const int numGrades = 3; average = (number1 + number2 + number3) / float(numGrades); cout<<average; return 0; }
TOOL
0.93303
3.121818
38d81241-b849-4c1d-a646-70d52dde6836
Suvansh16/Leetcode
0300-longest-increasing-subsequence/0300-longest-increasing-subsequence.cpp
class Solution { public: int dp[2502][2502]; int solve(int start,int prev,vector<int>&nums) { if(start>=nums.size()) return 0; if(dp[start][prev+1]!=-1) return dp[start][prev+1]; int max1=0,max2=0; if(prev<0 || nums[start]>nums[prev]) max1=1+solve(start+1,start,nums); max2=solve(start+1...
ALGO
0.999996
5.782423
06c6c039-4839-4b09-9140-bbab23162f8e
pandeyankit123/CP-Solutions-by-Laidback
C_Minimizing_the_Sum.cpp
/* __ ___ ______ ______ _____ ___ _____ _ __ / / / \ \ |__ __| | | \ \ | | \ \ / \ \ | ___| | | / / / / / /_\ \ || | | | | | |__/ / / /_\ \ | | | | / / / /___ / /---\ \ __||__ | | | | | | \ \ / /---\ \ | |___ | | \ ...
ALGO
0.99993
3.893832
01597ba6-98a9-431d-b9ff-a8c33abc2fa6
ramumaha/Striver_SDE_Challenge
Kth_Smallest_Element_in_a_BST.cpp
#include<bits/stdc++.h> using namespace std; 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), left(left), r...
ALGO
0.999988
5.481761
88d19b9f-21cd-4986-90c3-3a577be94f6e
himanshujainsanghai/DSA
1694-make-sum-divisible-by-p/1694-make-sum-divisible-by-p.cpp
// class Solution { // private: // int n; // int func(int ind , int p ,vector<int>& nums , int sum , int length){ // if(ind==0){ // if(sum%p == 0) return length; // return 0; // } // // take // int take = func(ind-1 , p , nums , sum + nums[ind] , leng...
ALGO
0.999935
5.806658
9944e342-40e2-4d33-af38-303681e7cddc
ssearobber/boost_realize
libs/coroutine2/example/fibonacci.cpp
#include <cstdlib> #include <iostream> #include <boost/coroutine2/all.hpp> int main() { boost::coroutines2::coroutine< int >::pull_type source( []( boost::coroutines2::coroutine< int >::push_type & sink) { int first = 1, second = 1; sink( first); sink( second); ...
ALGO
0.961191
4.227357
b6b039de-32f4-4509-b929-ba7f12c87631
GeneralSandman/zhenhuli-blog
leetcode/205-isomorphic-strings/cpp_solution.cpp
#include <iostream> #include <vector> #include <map> using namespace std; class Solution { public: bool isIsomorphic(string s, string t) { map<char, char> hashTable; for(int index = 0; index < s.size(); index++) { char a = s[index]; char b = t[index]; if(hashT...
ALGO
0.99997
5.988846
de0e97c8-6e9b-41f2-89e8-4cda39dc187c
przewooz/EmpiricalLinkageLearning
sourcecodes/DSMGA2/fastcounting.cpp
#include <cstring> #include "global.h" #include "fastcounting.h" FastCounting::FastCounting () { length = 0; lengthLong = 0; gene = NULL; } FastCounting::FastCounting (int n_length) { gene = NULL; init (n_length); } FastCounting::~FastCounting () { if (gene != NULL) delete []gene; } void Fa...
ALGO
0.964744
4.22851
93c3a713-da1d-4028-a3b8-64e506ca7404
layqafatima/Lab-2-tasks
lab 2 task 2.cpp
#include <iostream> using namespace std; void *add(void*arr,int n){ int *Arr=(int*)arr; for(int i=0;i<5;i++){ Arr[i]+=n; } return (void*)Arr; } int main(){ int n=3; //number to be added int arr[5]={1,2,3,4,5}; cout<<"Original array"<<endl; for(int i=0;i<5;i++){ cout<<arr[i]<<" "; } cout<<endl; void *res...
ALGO
0.996153
4.07287
5489568d-2698-4bc1-b98a-e191547bc4b8
zethuman/PP1
Lab/lab8/K.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> v; int n, x; cin >> n; for (int i = 1; i <= n; i++) { cin >> x; v.push_back(x); } int a,sum = 0; cin >> a ; sort(v.begin() , v.end()); reverse(v.begin()...
ALGO
0.999879
3.195763
9f5e7380-1fb4-4224-a72b-36a47f697fa6
transfer-learning/llvm-tl45
libcxx/test/std/containers/associative/set/contains.pass.cpp
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 #include <cassert> #include <set> // <set> // bool contains(const key_type& x) const; template <typename T, typename V, typename B, typename... Vals> void test(B bad, Vals... args) { T set; V vals[] = {args...}; for (auto& v : vals) set.insert(v); f...
TEST
0.89232
6.587484
b3e1d771-c4ba-44cb-a891-52c8130d0509
clarkok/cdb
lib/index/skip-table.cpp
#include <cstdlib> #include <cassert> #include "lib/utils/buffer.hpp" #include "skip-table.hpp" using namespace cdb; /** * Base class for NonLeaf & Leaf */ struct SkipTable::Node { NonLeaf *parent; /** parent of this Node must be NonLeaf */ bool is_leaf; /** if this Node is a Leaf */ Key key; ...
TOOL
0.921473
5.745012
c3f2848a-e914-4887-b016-f0c3ba3784bc
rko0211/codeforces-question-solve
int_prob.cpp
#include <bits/stdc++.h> using namespace std; void solve() { int a, b; cin >> a >> b; int cnt = 0; int dif = abs(a - b); // if (a < b) // { int d = min(10, dif); if (dif != 0) cnt += dif / d; if (dif != 0 && dif % d != 0) { cnt++; } // } cout << cnt << endl; } int main() { int t; ...
ALGO
0.999239
4.891536
12f2f2fb-1564-465f-a8cd-6b68674dfd0a
jhonatanmacazana/parallel-computing-project
src/sequential/main.cpp
#include <math.h> #include <iostream> #include "omp.h" #include "utils.hpp" // #define EXPORT // shows results on CSV // #define DEBUG // shows results on screen #define NUMBER_SPRINGS 999 #define SPRING_CONSTANT 1. #define INITIAL_MASS 1. #define TIME_LIMIT 10. #define TIME_STEPS 0.1 double** initializeMa...
ALGO
0.999651
4.626215
aa2a58e5-5762-4845-9751-e5f2f6ddcff7
oneskovic/CP-Problems
CodeForces/Round 773/A.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <vector> #include <string> #include <map> #include <set> using namespace std; typedef long long ll; struct point { ll x, y; }; int main() { ios::sync_with_stdio(false); cin.tie(0); int test_cnt; cin >> test_cnt; while (test_cnt--) { vector<...
ALGO
0.999935
4.476388
6f155e38-a73c-4b7f-bdd8-b0130e27f52e
NileshTelang/DSA-KICKSTART
Code Samples/Queue - Abhijeet Chattar/CPP/Queue.cpp
#include <iostream> #define size 5 using namespace std; class queue{ public: int arr[size], front, rear; queue(){ front = -1; rear = -1; } bool isEmpty(){ if(front == -1){ return true; } return false; } bool isFull(){ if...
ALGO
0.972236
4.673106
c37e4cd7-bd08-466f-b76f-d7aa253910df
l0uvre/short-travel-oj
Basic Problem/Oj1017E.cpp
/*** Description: Lucy asked Huang Bo a question, “You have two 2-D point A and B, please calculate how many integer points in segment A, B. For example, A(1, 3), B(3, 1) only has 1 integer point (2, 2)”. Input: There are multiple test cases (less than 1000), for each test, there will be one line contain four integers...
ALGO
0.999285
4.321076
828defc3-3903-467e-9ab3-75bf17db7339
MartinKroe/AliRoot
TEvtGen/EvtGen/EvtGenModels/EvtBtoXsEtap.cpp
#include <stdlib.h> #include "EvtGenBase/EvtRandom.hh" #include "EvtGenBase/EvtParticle.hh" #include "EvtGenBase/EvtGenKine.hh" #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtReport.hh" #include "EvtGenModels/EvtBtoXsEtap.hh" #include <string> #include "EvtGenBase/EvtConst.hh" using std::endl; EvtBtoXsEtap::~...
ALGO
0.908343
5.573553
21b1cac3-a31c-4e9a-93f3-262a4f3a5991
AryanTejani/DSA
subArray.cpp
#include<iostream> using namespace std; int main(){ int arr[5] = {1,2,3,4,5}; for(int i=0;i<5;i++){ for(int j=i;j<5;j++){ for(int k=i;k<j;k++){ std::cout<<arr[k]; } cout<<endl; } } }
ALGO
0.998918
3.100209
30cf2e5a-7686-4519-875c-057d1564d752
SR-Akash/Problem-Solving
Codeforces/Bear and Reverse Radewoosh.cpp
#include<bits/stdc++.h> typedef long long ll; using namespace std; int main() { int n,c; cin>>n>>c; int arr[n+5]; int time[n+5]; for(int i=0;i<n;i++) cin>>arr[i]; for(int i=0;i<n;i++) cin>>time[i]; int cnt=0; int sum=0,sum2=0; for(ll i=0;i<n;i++) { cnt+=ti...
ALGO
0.99999
3.434482
c12d9538-f4c7-4bd4-9944-2fc7a4632fc5
ishandutta2007/codeforces
emthrm/normal/1215/A.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <chrono> #define _USE_MATH_DEFINES #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue>...
ALGO
0.999582
3.442961
b0895658-0bb0-40cf-a556-923157e92cbf
leecoders/ALGORITHMS_CODE
Algorithms/9093.cpp
//#include "bits/stdc++.h" //using namespace std; // //int main() { // ios::sync_with_stdio(0); // cin.tie(0); // cout.tie(0); // //freopen("Input.txt", "r", stdin); // // int n; // cin >> n; // cin.get(); // while(n--) { // string s; // getline(cin, s); // stringstream a(s)...
ALGO
0.999553
5.258747
b4744ad8-3b3a-4f4d-90ad-01b80be53ed3
MH-Sajjat/Atcoder
ABC247/E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef pair <int, int> pii; typedef pair <ll, ll> pll; typedef vector <int> vi; typedef vector <ll> vll; const int N = (int) 2e5 + 5; const int...
ALGO
0.999788
4.026237
c4dded83-ce53-46e0-a1ff-0071cdb6fff4
priya-thv/dsa-practice
graphs/graph implementation1.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n, m; cout<<"enter the no. of nodes ;"; cin >> n ; cout<<"enter the no. of edges ;"; cin>>m; vector<vector<int>> v(n, vector<int>(m, 0)); for(int i = 0; i < m; i++){ int x, y; cin >> x >> y; v[x][y]=1; ...
ALGO
0.999878
3.711198
989d4f2a-33dd-4a8b-9c09-1cb44fad7f64
mansi104-ai/Leetcode_interview_ques
codeforces/contest_871_div_4/A.cpp
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <cmath> #include <cstring> #include <set> #include <hash_map> using namespace std; int main(){ int n; cin >> n; string s; int cnt = 0; string inp = "codeforces"; for(int i = 0;i<n;i++){ cin >> s; ...
ALGO
0.999491
3.692603
eadcb4bb-01be-4829-878e-8ad0681bac80
Haoxiang310/CSCI550_mongo
src/mongo/base/initializer.cpp
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kDefault #include "mongo/platform/basic.h" #include "mongo/base/initializer.h" #include <fmt/format.h> #include <iostream> #include <string> #include <utility> #include <vector> #include "mongo/base/dependency_graph.h" #include "mongo/base/status.h...
TOOL
0.87013
7.910534
54a4216e-8553-4bf2-ac1a-eb8f39e7986d
ishandutta2007/codeforces
krk/normal/1364/E.cpp
#include <bits/stdc++.h> using namespace std; const int Maxn = 3005; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int n; vector <int> seq; int res[Maxn][Maxn]; set <int> inds; int nils = 0; int ans[Maxn]; int getRes(int a, int b) { if (a > b) swap(a, b); if (res[a][b]) return res[a][b...
ALGO
0.999995
3.246812
eaee03bc-0bc9-4bb9-a9c2-69400a87c994
LulwaAnif/c-
c++ course/operator_overloading.cpp
#include<iostream> using namespace std; class marks { int mark; public: marks() //2 { mark=0; } marks(int m) //3 { mark=m; } void yourMarkPlease() //5 //9 //14 { cout<<" your mark is : "<<mark<<endl ; } void operator+=(int bonusmarks) /...
ALGO
0.892482
3.352509
f436cd83-dd56-4f51-9ec7-2a1664580798
yyechan/Algorithm
PROGRAMMERS/조이스틱.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; int Alpha(char alpha) { return alpha - 'A' < 'A' - alpha + ('Z' - 'A') ? alpha - 'A' : 'A' - alpha + ('Z' - 'A') + 1; } int solution(string name) { int answer = 0; vector<int> needToChange; vector<pair<int, int>> temp; vector<int> ppoi...
ALGO
0.999776
4.642887
9f868718-1947-464d-ad72-cff54afc448b
rahulranjan96/Programming
GFG/Stack_Queue/maximum-of-all-subarrays-of-size-k.cpp
#include <iostream> #include <vector> #include <climits> #include <deque> using namespace std; //Naive Approach:O(nk) /*int main() { int t; cin>>t; while(t--) { int n,k; cin>>n>>k; vector<int> a; int key; for(int i=0;i<n;i++) { cin>>key; a.push_back(key); } int max=INT_MIN; for(int i...
ALGO
0.999962
4.224891
3ebae818-10be-4a6a-b70d-1512bca917b5
zeynepsturan/GTU-CSE-241-COMPLETE
PS 1/q2.cpp
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int humanTurn(int humanTotalScore); int computerTurn(int computerTotalScore); int main(){ srand(time(NULL)); int player,computer; player=computer=0; cout<<"----------------------------------"<<endl; cout<<" D...
ALGO
0.990094
4.154881
3d283210-be27-45db-994e-e170e831756b
Manish12-verma/Cpp-DSA
Array/relative sor.cpp
#include <bits/stdc++.h> using namespace std; vector<int> relativeSortArray(vector<int>& arr1, int n, vector<int>& arr2) { vector<int> ans; map<int, int> mpp; // Count occurrences of elements in arr1 for (int i = 0; i < n; i++) { mpp[arr1[i]]++; } // Add elements of arr1 in the order ...
ALGO
0.999979
6.125954
4ba083a7-1b67-43ba-8ff4-6b10d06a75a4
tearsofphoenix/Box2DiOS
Box2D/Box2D/Dynamics/Contacts/b2CircleContact.cpp
#include <Box2D/Dynamics/Contacts/b2CircleContact.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2Fixture.h> #include <Box2D/Dynamics/b2WorldCallbacks.h> #include <Box2D/Common/b2BlockAllocator.h> #include <Box2D/Collision/b2TimeOfImpact.h> #include <new> using namespace std; b2Contact* b2CircleConta...
ALGO
0.963922
6.887669
d33b489c-23db-431f-aca4-49c7920e4cc4
barkhayadav12/Striver-SDE-Sheet-Challenge
Day 18 Binary Tree Part 2/q2_level_order_traversal.cpp
class Solution { public: void level_order(TreeNode *root, vector<vector<int>> &res) { if (root == NULL) { return; } queue<TreeNode *> q; q.push(root); while (!q.empty()) { int n = q.size(); vector<int> v; for...
ALGO
0.999975
6.124996
73bec65c-87c0-444e-beea-a42010f958a8
access-softek/llvm-project
libc/src/math/nvptx/atanh.cpp
#include "src/math/atanh.h" #include "src/__support/common.h" #include "declarations.h" #include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(double, atanh, (double x)) { return __nv_atanh(x); } } // namespace LIBC_NAMESPACE_DECL
TOOL
0.923923
5.656661
9b68168e-e6f6-4658-9f8e-d525ba54f3a4
HansStory/CodingTest
프로그래머스/2/12939. 최댓값과 최솟값/최댓값과 최솟값.cpp
#include <string> #include <vector> #include <sstream> #include <limits> using namespace std; string solution(string s) { stringstream ss(s); int num, minVal = numeric_limits<int>::max(), maxVal = numeric_limits<int>::min(); while (ss >> num) { minVal = min(minVal, num); maxVal = max(maxV...
ALGO
0.999469
5.191548
14799903-6218-4ee5-b4c5-070bcbbb42b2
mzqmarks/c-study
资料-素材-源代码/源代码/58/巩固练习1.cpp
#include <iostream> using namespace std; int main(){ for(int i=1;i<=10;i++){ for(int j=2; j<i;j++){ if(i%j==0){ break; } //cout << j << " "; } cout << i << ""; } return 0; }
ALGO
0.999798
3.689201
31226728-354e-4dfb-8a94-031fd36331fc
hieu-ln/IT82-11
CodeC2/kimyen_c2_bai3.cpp
//#include <iostream> //using namespace std; //struct node //{ // int info; // node *link; //}; //node *first; //void tao() //{ // first=NULL; //} //void duyetds() //{ // node *p; // p=first; // while(p!=NULL) // { // cout<<p->info<<"; "; // p=p->link; // } //} //node *search(int x) //{ // node *p; // p=first; // whi...
ALGO
0.999317
3.583541
cb4ce54d-1976-45ad-8025-5c2c1a52a60b
DrNjitram/AoC2020
AoC2020/days/2020_17.cpp
#include <iostream> #include <fstream> #include <string> #include <regex> #include <chrono> #include <sstream> #include <algorithm> #include <iterator> #include <map> #include <set> #include <bitset> #include <numeric> #include <unordered_map> using namespace std; using Tuple = tuple<int, int, int, int>; using Pair =...
ALGO
0.999417
5.317089
3dc15bed-b9cf-4593-bf0b-81976db1bcef
aryancoder280/SDE-Prepartion
Prime numbers and Factorization/C.cpp
#include<bits/stdc++.h> using namespace std; typedef long long int ll; int main() { int t; cin>>t; while(t--) { int n; cin>>n; string s; cin>>s; int l = 0, r= s.size()-1; int len = 0; if(n&1) { len = 1; } while(l<r) { if(s[l] == '0' ...
ALGO
0.999912
4.474017
6366e134-0111-40e5-80cd-d908b5bfa40b
ishandutta2007/codeforces
pikel_rik/normal/494/A.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define all(x) (x).begin(), (x).end() using namespace __gnu_pbds; using namespace std; using ull = unsigned long long; using ll = long long; template <typename T> using ordered_set = tree<T, null_type, less<>, rb_tree_tag, tree_order_statistics_node_up...
ALGO
0.999534
4.067791
3429f22f-dbb9-4f7d-b3f2-fce558b64a91
sstuqtd/vocal
thridparty/boost/libs/graph/test/dfs_cc.cpp
#include <boost/concept_archetype.hpp> #include <boost/graph/depth_first_search.hpp> #include <boost/graph/graph_archetypes.hpp> int main() { using namespace boost; typedef default_constructible_archetype< sgi_assignable_archetype< equality_comparable_archetype<> > > vertex_t; { typedef incidence_gr...
ALGO
0.977256
5.270398
beb7832b-8a13-4520-afd2-fd3d9ba92b6c
KaiKostack/blender-demolition
intern/elbeem/intern/mvmcoords.cpp
/** \file elbeem/intern/mvmcoords.cpp * \ingroup elbeem */ #include "mvmcoords.h" #include <algorithm> #if defined(_MSC_VER) && _MSC_VER > 1600 // std::greater #include <functional> #endif using std::vector; void MeanValueMeshCoords::clear() { mVertices.resize(0); mNumVerts = 0; } void MeanValueMeshCoords::c...
ALGO
0.986075
5.563768
42ea0ba7-b3a4-406d-9f00-4094604a630f
Parthib13/Uva
UVA - 10018.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll cnt = 0; bool isP(string input) { if (input == string(input.rbegin(), input.rend())) { return true; } else return false; } string int_to_str(ll a) { stringstream ss; ss << a; string str = ss.str(); return...
ALGO
0.999781
4.03547
61286d39-aa84-4f25-9c42-faf459b11be2
Shyeok/Algorithm-Programming
BOJ/5913.cpp
#include<stdio.h> int field[5][5]; int dap = 0; int n; void findway(int x, int y, int len) { if(x == 4 && y == 4) { if(len == (5 * 5) - n && len % 2 == 1) { dap = dap + 1; } } else { if(x - 1 >= 0 && field[x - 1][y] != 1) { field[x - 1][y] = 1; findway(x - 1,y,len + 1); field[x - 1][y] = 0; ...
ALGO
0.999935
3.780418
073ddd39-7404-4de1-b038-404e6e21d96a
vfolunin/archives-solutions
MCCME/3756.cpp
#include <iostream> #include <sstream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> #include <bitset> using namespace std; using Set = bitset<100001>; Set readSet() { string line; getline(cin, line); if (line == "HELP") return {}; Set res; string...
ALGO
0.999866
3.336012
1062385d-fea1-47f0-9af0-67554dafd5c8
Lewuathe/mlir-hello
thirdparty/llvm-project/llvm/tools/dsymutil/MachOUtils.cpp
#include "MachOUtils.h" #include "BinaryHolder.h" #include "DebugMap.h" #include "LinkUtils.h" #include "llvm/ADT/SmallString.h" #include "llvm/CodeGen/NonRelocatableStringpool.h" #include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCMachObjectWriter.h" #include "llvm/MC/MCObjectStreamer.h" #include "llvm/MC/MCSectionMa...
TOOL
0.942129
7.437747
d49a529a-3b2c-4511-9259-c213f1586153
ceezyyy/leetcode
others/cpp/257.Binary Tree Paths.cpp
/** * Source: LeetCode 257. Binary Tree Paths * Author: ceezyyy * Date: 10-12-2019 */ /* Easy Given a binary tree, return all root-to-leaf paths. Note: A leaf is a node with no children. Example: Input: 1 / \ 2 3 \ 5 Output: ["1->2->5", "1->3"] Explanation: All root-to-leaf paths ...
ALGO
0.999784
6.308589
865c62bb-10c5-47f1-b0c3-d48bdd0ddc08
lowhung/cloth_simulation
include/eigen/bench/sparse_lu.cpp
// g++ -I.. sparse_lu.cpp -O3 -g0 -I /usr/include/superlu/ -lsuperlu -lgfortran -DSIZE=1000 -DDENSITY=.05 && ./a.out #define EIGEN_SUPERLU_SUPPORT #define EIGEN_UMFPACK_SUPPORT #include <Eigen/Sparse> #define NOGMM #define NOMTL #ifndef SIZE #define SIZE 10 #endif #ifndef DENSITY #define DENSITY 0.01 #endif #ifnd...
ALGO
0.99858
4.187482
1dc5ca82-441b-4114-a967-34b1e680682c
anle42160/2-5---Product-Calculator
2.5/2.5 - Product Calculator.cpp
/* 2.4.) Write a statement (or comment) to accomplish each of the following (assume that using declarations have been used for cin, cout, and endl): a. Document that a program calculates the product of three integers. b. Declare the variables x, y, z, and result to be of type int (in separate statements...
TOOL
0.94225
3.510707
54ae3f2c-f66f-4d58-8a2c-2b193957957f
AimotoRyosuke/atcoder
work/abc/A/271_A_2.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int N; cin >> N; printf("%02X\n", N); }
ALGO
0.997919
3.920675
762da6af-63bd-455e-8b6b-c6b214ae1594
BMGongsg1/algorithms-code
2024-05-06----2024-05-12/2024-05-12-3.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int stx,sty,edx,edy; vector<vector<int>> mapp(n,vector<int>(n)); for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ char temp; cin>>temp; if(temp == '+') mapp[i][j] = 1; else if(t...
ALGO
0.999829
4.317299
45811117-5518-44ce-82fd-8c43f272b947
MdAjharulIslam/LeetCode
2410-maximum-matching-of-players-with-trainers/2410-maximum-matching-of-players-with-trainers.cpp
class Solution { public: int matchPlayersAndTrainers(std::vector<int>& players, vector<int>& trainers) { sort(players.begin(), players.end()); sort(trainers.begin(), trainers.end()); int count = 0; int i = 0, j = 0; // pointers for players and trainers while (i < players.si...
ALGO
0.999904
5.894533
19734a64-01eb-429a-a765-56231b42a0f2
Zero-Vec/cppACM
scnu/xiji_encourage/80.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; bool judge(char a, char b){ return tolower(a) == tolower(b); } bool ch_is_in_set(char ch, const vector<char> &set){ for (char s : set) if (judge(ch, s)) return true; return false; } void solve(const string &s, vector<c...
ALGO
0.999914
3.806342
9708d1b2-4af3-46aa-95f7-7ed3575694b9
Manahil-Aamir/PokeDex
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.998859
6.785645
41b9525c-f9fa-44ab-b44c-9c3c78898e72
eigen-mirror/eigen
bench/perf_monitoring/gemv.cpp
#include "gemv_common.h" EIGEN_DONT_INLINE void gemv(const Mat &A, const Vec &B, Vec &C) { C.noalias() += A * B; } int main(int argc, char **argv) { return main_gemv(argc, argv, gemv); }
ALGO
0.964202
4.385633
adbe8f97-d42f-404a-8379-983d530448cf
mzwang25/dcgem5
src/systemc/tests/systemc/datatypes/int/arith/arith10/arith10.cpp
/***************************************************************************** arith10.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /****************************************************************************...
TEST
0.966412
4.808961
458adc6b-e43d-4801-827d-266627481912
raincross7/code-similarity
codes/train_code/problem447/problem447_430.cpp
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int,int>; const int MOD=1000000007; int main() { int a, b, c; cin >> a >> b >> c; cout << max(c-a+b,0) << endl; }
ALGO
0.99985
3.800797
8eec2c6f-acc0-4b5f-92e4-cf7b4b5211f7
bastien-roucaries/qucsrework
qucs-core/src/components/digital/and.cpp
#if HAVE_CONFIG_H # include <config.h> #endif #include "component.h" #include "digital.h" #include "and.h" logicand::logicand () : digital () { type = CIR_AND; setVariableSized (true); } void logicand::calcOutput (void) { nr_double_t v = getPropertyDouble ("V"); nr_double_t n = getSize () - 1; nr_double_t ...
TOOL
0.978084
6.395548
e61c24a1-c8bc-46a9-b136-2b5c445ed97a
madomigo/programacion-competitiva
AceptaElReto/p320.cpp
#include <iostream> using namespace std; int main () { int n; cin >> n; for (int t = 0; t < n; t++) { int cae, num; cin >> cae >> num; int contador = 0; int palmeras[num]; int i = 0; int k = 0; int longitud = 0; for (int j = 0; j < num; j+...
ALGO
0.999791
4.230697
55cc9a17-4e99-41ca-9d8e-91550f54c39e
sourabhjoshi62/DSA_Decode_C-
IfElse/5or3not15.cpp
#include<iostream> using namespace std; int main() { int x; cout << "Enter a number: "; cin >> x; if (x % 3 == 0 || x % 5 == 0) { if (x % 15 == 0) { cout << "Condition not valid (Divisible by 15)"; } else { cout << "Given number is divisible by 3 or 5"; ...
ALGO
0.987842
5.361982
58112db8-13f0-4623-ab76-7fd0de4e7997
Prateek307/Leetcode-Solutions
102_Binary_Tree_Level_Order_Traversal.cpp
// link to the problem ---> https://leetcode.com/problems/binary-tree-level-order-traversal/ class Solution { public: vector<vector<int>> levelOrder(TreeNode *root) { vector<vector<int>> ans; if (root == NULL) return ans; queue<TreeNode *> q; q.push(root); wh...
ALGO
0.999986
6.147699
f7ab8632-3de7-42c6-ba45-59774b7ae031
taranjeet/practice
cnt1s.cpp
/* 2015-02-25 12:48 practice FEB 15 */ #include <bits/stdc++.h> #define _ ios_base::sync_with_stdio(0);cin.tie(0); using namespace std; typedef long long int ll; #define FOR(i,n) for(int i = 0; i < n; i++) #define FORS(i,a,n) for(int i = a; i < n; i++) #define RDARR(a,n) FOR(i,n) cin>>a[i]; #define SOLVE() int t;cin...
ALGO
0.998284
3.958687
7c7707e1-5da7-4a30-b9f7-867ef807ba08
AhmedElgizawy95/C-Workspace
C++ Workspace/Session 10/LinkedList.cpp
#include<iostream> #include<vector> struct Record { std::string name; int num; }; struct Node { Record record; Node *next; }; void Print(Node *Head) { std::cout << Head->record.name << " " << Head->record.num << std::endl; } void Traverse (Node *Head , void (*callBack) (Node*)) { while(Head) { ...
TOOL
0.952482
3.978619
a87919b0-9776-460a-85a0-18fb79d0f642
tangyanmin/PressTest
deps/eigen/bench/sparse_randomsetter.cpp
#define NOGMM #define NOMTL #include <map> #include <ext/hash_map> #include <google/dense_hash_map> #include <google/sparse_hash_map> #ifndef SIZE #define SIZE 10000 #endif #ifndef DENSITY #define DENSITY 0.01 #endif #ifndef REPEAT #define REPEAT 1 #endif #include "BenchSparseUtil.h" #ifndef MINDENSITY #define M...
TOOL
0.916471
4.487392
b85edcac-34c7-450a-a3df-41070b370175
thebesttv/00.ACM
50.c/aoapc-book-master/BeginningAlgorithmContests/exercises/ch6/UVa10562.cpp
// UVa10562 Undraw the Trees // Rujia Liu // ⣺ѻͦÿĶתΪűʾ // 㷨ֱڶάַݹ顣עҽſɴӡַ #include<cstdio> #include<cctype> #include<cstring> using namespace std; const int maxn = 200 + 10; int n; char buf[maxn][maxn]; // ݹַbuf[r][c]Ϊ void dfs(int r, int c) { printf("%c(", buf[r][c]); if(r+1 < n && buf[r+1][c] == '|') { // i...
ALGO
0.999172
3.678245
0a740ce7-595a-43b4-a3a8-f106908c493e
ishandutta2007/codeforces
benq/normal/1483/F.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using db = long double; // or double, if TL is tight using str = string; // yay python! using pi = pair<int,int>; using pl = pair<ll,ll>; using pd = pair<db,db>; using vi = vector<int>; using vb = vector<bool>; using vl = vector<ll>; using vd = v...
ALGO
0.999937
3.924391
5eb4b41d-349d-4b3e-8c1e-2037ff16b4a7
ishandutta2007/codeforces
jtnydv25/normal/449/C.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define vi vector<int> #define pb push_back #define F first #define S second #define sd(x) scanf("%d", &(x)) const int N = 1e5 + 10; int prime[N]; vector<pair<int, int> > pairings; bool done[N]; vector<int> vec; void pre(int n){ for(int i = 3; 2 * i...
ALGO
0.999719
3.676502
ae5a7825-9794-4102-be80-fa6023c7b540
Coach-Academy/Summer-2-2024
Level 2/CPU - Standard - L2 - C103/Lecture/Week 11/LCM_Problem.cpp
#include <bits/stdc++.h> using namespace std; void fileIO(void) { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif } void fastIO(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } typedef long long ll; ll gcd(ll a, ll b) { ...
ALGO
0.999908
4.898529
1570c90a-9f16-4f2e-b56e-80b4feb4758a
harsh852003/Competitve-Programming
kidsWithGreatestNumberCandies.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; class Solution{ public: vector<bool> kidsWithGreatestNumberOfCandies(vector<int>&candies,int extraCandies){ vector<bool> result; int MaxCandies = *max_element(candies.begin(),candies.end()); for(int i = 0;i<ca...
ALGO
0.999964
5.297451
f82a6527-92fa-4925-a217-4e7b0fa3e14e
gomind-ritesh/labsheets
labsheets_y1/Lab5/qu1.cpp
#include <iostream> #include <cmath> using namespace std; /* int main() { int num; num = 0; while (num<100) { num+=5; cout<<num<<endl; } return 0; } */ int main() { int num; num = 0; while (num<100) { num++; if(num %5 ==0) {cout<<num<<endl;} } return 0; }
ALGO
0.997878
3.017845
6d3ce2bb-176b-4293-95bf-bf0b8c350f4d
ishandutta2007/codeforces
golovanov399/normal/1718/B.cpp
#include <bits/stdc++.h> #define itn int #define all(x) (x).begin(), (x).end() #define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin()) using namespace std; inline int nxt() { int x; scanf("%d", &x); return x; } vector<int> fib; void solve() { int n = nxt(); vector<int> c(n); generat...
ALGO
0.999969
4.271345
aea571f9-8c6e-47f0-a138-455a6f9c2bcb
RUSHDCAT/Contest-Solutions
Educational Codeforces Round 101 /FF.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 200000 + 10; int n, k, l[N]; int a[600000 + 10]; int main() { scanf("%d%d",&n,&k); for(int i=1;i<=n;i++) scanf("%d",&l[i]); LL sum=1; for(int i=1;i<=n;i++){ sum+=l[i]-2; } if(sum<k)return !printf("-1\n"); sort(l+1,l+1+n); revers...
ALGO
0.999985
3.419074
589cdb1a-7311-4348-bb0a-f1f2adfb654e
vinaytheprogrammer/Data_Structure
linear_search.cpp
#include<bits/stdc++.h> using namespace std; //Linear search on 1 D simple Array int linear_search1(int a[],int n) { for(int i=0;i<6;i++) { if(a[i]==n) return i; } return -1; } int main() { cout<<"Linear Search by VINAY GUPTA\n"; int n,a[7]={1,2,3,7,4,5,6}; for(int i=0;i<...
ALGO
0.999319
4.007892
427a98c4-7a17-4b19-b7a5-06b093e121b4
paoxiaode/CPP-prime-exercise
ch6/6.32.cpp
#include <iostream> using namespace std; int &get(int *array, int index) { return array[index]; } int main() { int ia[10]; for (int i = 0; i != 10; ++i) get(ia, i) = i; for (int i: ia) cout << i << " "; }
ALGO
0.906535
3.271913
f53a7514-f7ee-452d-ae2c-53ae3ddca03f
bqmnhat/CompetitiveProgramming
VnoiAndSpoj/PALIN/main.cpp
#include <iostream> #include <bits/stdc++.h> #define MaxN 100000 using namespace std; typedef long long ll; const ll Mod = 1e9 + 7; ll Fact[MaxN+5], InvFact[MaxN+5], cnt[MaxN+5][31]; int q, l, r, n; string s; ll FastPow(ll base, ll e, const ll Mod) { ll ans = 1; while (e) { if (e&1LL) ans =...
ALGO
0.999891
4.970621
f41f8849-49e0-4051-82a2-7def1336f7b7
melisadindar/cpp-modules
cpp-module-08/main.cpp
/* #include <iostream> #include <vector> int main(){ // Bir int vector oluşturma std::vector<int> myVector; // Vector'e eleman ekleme myVector.push_back(10); myVector.push_back(20); myVector.push_back(30); // Vector'deki elemanları yazdırma for (size_t i = 0; i < myVector.size(); ++i)...
TOOL
0.870387
4.491309
2c289682-cca8-470f-95fc-0fdc7a34bc6e
intel/external-mesa
src/intel/compiler/brw_vec4_cmod_propagation.cpp
/** @file brw_vec4_cmod_propagation.cpp * * Really similar to brw_fs_cmod_propagation but adapted to vec4 needs. Check * brw_fs_cmod_propagation for further details on the rationale behind this * optimization. */ #include "brw_vec4.h" #include "brw_cfg.h" #include "brw_eu.h" namespace brw { static bool writemas...
ALGO
0.993434
7.302599
25faa594-09f7-40b8-b56d-ee205fcccd8c
Abhinav7076/My-Codes
Graph/Paths to travel each nodes using each edge(Seven Bridges).cpp
// An Euler path is a path that uses every edge of a graph exactly once. // An Euler circuit is a circuit that uses every edge of a graph exactly once. // An Euler path starts and ends at different vertices. // An Euler circuit starts and ends at the same vertex. // If there is an Eulerian path then there is a soluti...
ALGO
0.999886
5.081319
c7ce07f0-0ddc-48b7-bb04-5e60e841b263
SunghunKim98/Algorithm_Study
sprint05/JMS/SW/BOJ_1138.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int N; int arr[10]; vector<int> v; void Input() { cin >> N; for (int i = 0; i < N; i++) { cin >> arr[i]; v.push_back(i); } } void Solution() { do { vector<int> permutationV(v); int f = 0; for (int i = 0; i < permutationV...
ALGO
0.999982
4.097644
ae11c8f3-be2d-4355-bf7c-844eb00bba38
diaojibo/PAT-Code
advanced level/1115/1115.cpp
#include<vector> #include<stdio.h> using namespace std; #define N 1001 int m,n; int a[N]; int ln[N],rn[N]; void build(int p,int x){ if(a[x]<=a[p]){ if(ln[p]==-1){ ln[p] = x; }else build(ln[p],x); }else{ if(rn[p]==-1){ rn[p] = x; }else build(rn[p],x); } } int maxlevel = -1; int c1=0,c2=0; void dfs(int ...
ALGO
0.999751
3.296067
7eb2c067-b941-471d-b165-745c1ebba568
cglwn/ppp3e
04/11_ctok_error_check_in_ctok.cpp
#include <iostream> #include <stdexcept> using namespace std; double ctok(double c) { if (c < -273.15) { throw runtime_error("temperature must be above -273.15C"); } double k = c + 273.15; return k; } int main() { double c = 0; cin >> c; double k = ctok(c); cout << k << '\n'; }
TOOL
0.991992
4.317073
7868f88b-1c7e-4e5d-b220-ffcbf2aae0fe
kevin-on/Teamnote
src/String/Z algorithm.cpp
void calcZ(const string &s, int *z) { int n = (int)s.size(); int L = 0, R = 0; for(int i = 1; i < n; i++) { if(i > R) { L = R = i; while(R+1 < n && s[R-L+1] == s[R+1]) R++; z[i] = R-L+1; } else { int k = i-L; if(z[k] < R-i+1) z[i] = z[k]; else { L = i; while(R+1 < n && s[R-L+1] == s[R+1...
ALGO
0.99747
4.474288
ed449bc8-954a-469e-a9ce-8a7d76b342b3
sarvex/leetcode-rockstar
solution/2400-2499/2471.Minimum Number of Operations to Sort a Binary Tree by Level/Solution.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999979
6.2384
e172bcbd-0f48-4106-b929-f01fd01ffbd2
repelli/Exercicios_Livro_C
prog8.8.cpp
#include<stdio.h> #include<stdlib.h> #define TAMANHO 50 void ordena(int[],int); int main() { int tab[TAMANHO],i,j; for(i = 0; i < TAMANHO; i++) { printf("Digite um numero ou zero para terminar: \n"); scanf("%d",&tab[i]); if(!tab[i]) break; } ordena (tab,i); for(j = 0 ; j < i; j++) printf("%d\...
ALGO
0.999832
3.853682
9ac090e5-a354-4794-8197-f9ccf91de01a
Eduw/CORB-SLAM
Thirdparty/g2o/g2o/core/marginal_covariance_cholesky.cpp
#include "marginal_covariance_cholesky.h" #include <algorithm> #include <cassert> using namespace std; namespace g2o { struct MatrixElem { int r, c; MatrixElem(int r_, int c_) : r(r_), c(c_) {} bool operator<(const MatrixElem& other) const { return c > other.c || (c == other.c && r > other.r); } }; Ma...
ALGO
0.9999
7.461662
e45e51d5-555c-4428-aeda-d76e5df453f0
Ivancaminal72/MTH
rtabmap/rtabmap-release/corelib/src/Stereo.cpp
#include <rtabmap/core/Stereo.h> #include <rtabmap/core/util2d.h> #include <rtabmap/utilite/ULogger.h> #include <opencv2/video/tracking.hpp> namespace rtabmap { Stereo * Stereo::create(const ParametersMap & parameters) { bool opticalFlow = Parameters::defaultStereoOpticalFlow(); Parameters::parse(parameters, Parame...
ALGO
0.986031
6.866549
b357d175-474c-466b-b536-078ed5109c84
ertugrl/LeetCodeWorks
3379-score-of-a-string/score-of-a-string.cpp
class Solution { public: int scoreOfString(string s) { int result = 0; for (int i = 1; i < s.size(); ++i){ result += abs(s[i] - s[i - 1]); } return result; } };
ALGO
0.999919
5.577755
c75ccaf8-e761-4026-a760-f00af1426f0d
SamIam9640/codetree-TILs
240414/총합 구하기/find-the-total.cpp
#include <bits/stdc++.h> using namespace std; int main() { int a,b,sum=0; cin>>a>>b; for(int i=a;i<=b;i++){ if(i%6==0&&i%8!=0){ sum+=i;} } cout<<sum; return 0; }
ALGO
0.998751
3.483294
62a74069-d7fb-4768-8668-d82eb70b6683
acidentally/cplusplus
CodeForces Problems/CF_1844D.cpp
/*Good luck for those who are trying your best May the most glorious victory come*/ #include <bits/stdc++.h> using namespace std; #define int long long #define fi first #define se second #define vi vector<int> #define vvi vector< vector<int> > #define endl '\n' int const maxn = 1e6 + 10; int n; bool cnt[maxn] = {}; c...
ALGO
0.999638
4.973142
9d9aae87-c283-4bda-baae-eb9ab1c8160e
rahultumpala/cses
Movie_Festival.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pi; #define forn(i, k, e) for (int i = k; i < e; i++) #define fat(x) for (auto &it : x) #define all(x) (x).begin(), (x).end() int32_t main() { int n; cin >> n; vector<pi> times(n); fat(times) cin >> it.first >> it.second; sort(a...
ALGO
0.999957
4.897953
bb7847d5-6945-420a-8799-0f34df58199c
abhishek-8081/Data-Structure-Algorithms
2915-count-of-interesting-subarrays/count-of-interesting-subarrays.cpp
class Solution { public: long long countInterestingSubarrays(vector<int>& nums, int m, int k) { int n = nums.size(); unordered_map<int, int> remainderFrequency; int count = 0; remainderFrequency[0]++; long long totalSubarrays = 0; for (int i = 0; i < n; i++) { ...
ALGO
0.999955
6.146653
96e94e7c-c342-41f8-aae2-57262e96b3c0
AbdullaKhan01/Competitive-Programming
1400/PowersOfTwo.cpp
#include<bits/stdc++.h> #define mod 1000000007 #define mod2 998244353 #define ceil(a,b) ((a+b-1)/b) #define ll long long #define int long long #define vi vector<int> #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define input(x) for(auto &a:x) cin >> a; #define output(x) for(auto a:x) cou...
ALGO
0.999962
4.028453
25abb088-73d7-4763-9666-91520eb18870
yjbong/problem-solving
boj/2268/2268.cpp
#include <cstdio> #define SWAP(a,b,t){t=a;a=b;b=t;} long long near_pw; long long d[1<<21]; long long sum(long long i, long long j){ long long left=near_pw+i-1; long long right=near_pw+j-1; long long sol=0; while(left<right){ if(left%2==0) left=left/2; else{ sol+=d[left]; ...
ALGO
0.999742
3.38785
7ec8ce67-f748-48af-8a49-99a9a6e48d7a
FFMG/myoddweb.piger
myodd/boost/libs/compute/perf/perf_prev_permutation.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <vector> #include <boost/compute/system.hpp> #include <boost/compute/algorithm/next_permutation.hpp> #include <boost/compute/algorithm/prev_permutation.hpp> #include <boost/compute/container/vector.hpp> #include "perf.hpp" int rand_int() { retu...
ALGO
0.997921
5.289071
f12748d0-523e-406e-b89b-02e8eebb340c
InsightforGeeks/flutter-widgets
pdf_generator_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.998579
6.76073
a60bc928-0450-4e43-98a1-a2f1ea128c69
Monal-Patel/amrsolver
lib/boost/libs/math/example/ooura_fourier_integrals_multiprecision_example.cpp
#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606L) # error "This example requires a C++17 compiler that supports 'structured bindings'. Try /std:c++17 or -std=c++17 or later." #endif //#define BOOST_MATH_INSTRUMENT_OOURA // or -DBOOST_MATH_INSTRUMENT_OOURA etc for diagnostic output. #in...
ALGO
0.862241
6.462285
76cbb005-99d8-4acc-a421-cecc3e8c2c6f
Deepan20/Interview-prep
Cpp/DataStructures/Linked List/findMiddleElement.cpp
#include<iostream> using namespace std; class Node{ public: int data; Node *next; }; //create the new node Node *newNode(int ele){ Node *nn=new Node(); nn->data=ele; nn->next=NULL; return nn; } //insert the node at the end of the linked list Node *insert(Node **root,int ele){ Node *nn=ne...
ALGO
0.999891
4.769607
3c3b2cf5-cf6a-4a09-aac5-e0374c7c98f8
MaitriGu/LeetCodeProblemSolving
3824-number-of-unique-xor-triplets-i/number-of-unique-xor-triplets-i.cpp
class Solution { public: int uniqueXorTriplets(vector<int>& nums) { int n = nums.size(); if(n < 3) return n; int cnt = 0; int temp = n; while(temp > 0){ temp >>= 1; cnt++; } return pow(2, cnt); } };
ALGO
0.999909
5.913948