uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
1ad8b854-b4e7-4d68-af3f-06b8cf4f4c3a
vallarasuk/LeetCode
solutions/1893. Check if All the Integers in a Range Are Covered/1893.cpp
class Solution { public: bool isCovered(vector<vector<int>>& ranges, int left, int right) { for (int i = left; i <= right; ++i) { bool seen = false; for (const vector<int>& range : ranges) if (i >= range[0] && i <= range[1]) { seen = true; break; } if (!seen)...
ALGO
0.999637
6.53547
6ced271c-c49f-43ce-83e2-57ba234b2156
Forrest-Z/LIRS-WCT
lirs_wct_gui/src/utils.cpp
#include "utils.h" #include <cmath> void wct_image::separableGaussianBlurImage(QImage& image, double sigma) { // Add your code here. Done right, you should be able to copy most of the code from GaussianBlurImage. int start_s = clock(); double rc, rr, s = 2.0 * sigma * sigma; // sum is ...
TOOL
0.966608
5.562404
deb9b76f-4669-490b-b76a-9c33ee7c91ad
DaurenCS/Programming
lab9/ac.cpp
#include<iostream> using namespace std; int main(){ int x;cin>>x; int a[x]; for(int i=0; i<x; ++i){ cin>>a[i];} int max=a[0]; int max2=a[0]; for(int i=0; i<x; ++i){ if(a[i]>max) max=a[i]; } for(int i=0; i<x; ++i){ if(a[i]<max && a[i]>max2) max2=a[i]; } cout<<max2; }
ALGO
0.999949
3.493823
8116fb70-fb4d-499d-b4d3-b8983b8969d5
SkoogyTV/Leetcode
BinarySearch/2dMatrix.cpp
//Author: Sean Skaugen //LeetCode 74: Search a 2D Matrix #include <vector> using namespace std; class Solution { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { //so this is really doing 2 binary searches! if(matrix.size() == 0) return false; int top = 0, bot =...
ALGO
0.999888
6.43063
a5fa59fd-2f03-40dc-abb2-1154f3cc16ca
ColinChen1843/Competitive-Programming
Uncategorized/Good Inflation.cpp
#include <bits/stdc++.h> using namespace std; #define int long long int n; vector<int> a(1000001), d(1000001), m, b; bool invalid(int l3, int l2, int l1){ if((b[l3]-b[l1])/(m[l1]-m[l3]) < (b[l2]-b[l1])/(m[l1]-m[l2])) return true; return false; } void add_line(int M, int B){ m.push_back(M); b.push_back(B);...
ALGO
0.999965
4.304155
5fa986d2-0762-4e88-8c99-21c4f9c021dd
nchulucifer/leomaster-oi-code
ybt/ybt1114.cpp
#include <bits/stdc++.h> using namespace std; double a[305], ave, t1, t2; int n; int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; sort(a + 1, a + n + 1); ave = 0; for (int i = 2; i <= n - 1; i++) ave = ave + a[i]; ave = ave / (n - 2); t1 = abs(ave - a[2]); ...
ALGO
0.99969
3.830215
b61f0b08-5e2d-476b-a265-d8a02c72af9c
lonnewolf120/DS_Algo
code-library-master/Miscellaneous/Bitset Custom.cpp
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") #include<bits/stdc++.h> using namespace std; const int N = 2e5 + 9; const unsigned long long all = (1ull << 64) - 1; const int sz = N / 64 + 2; unsigned long long o[64][64], z...
ALGO
0.999995
4.213316
1531171c-5f51-44f7-a6c2-d3a66b8eef05
The1one1/code
Best_Permutation.cpp
#include<bits/stdc++.h> using namespace std; #define int long long const int N = 1e9 + 7; signed main() { int t; cin >> t; while (t--) { int n; cin >> n; vector<int> p(n); p[n - 2] = n - 1; p[n - 1] = n; for (int i = 1; i <= n - 2; i++) { p[i - 1] = i; } for (int i = n - 3; i > 0; i -= 2) { swa...
ALGO
0.999826
5.091085
2ceb15d0-fdf0-435e-9135-db5898e5a444
LifWirser/VSE_Test
engine/src/cmd/collide2/OPC_TreeCollider.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////...
ALGO
0.998499
4.85359
1d245e91-81e7-461b-8c55-3217c8345c69
hoarffrost/loving-DSA
Recursion 2/Programs/pi.cpp
#include <iostream> using namespace std; int len(char a[]){ int i=0; while (a[i]!='\0') { i++; } return i; } void replacePi(char input[]) { // Write your code here if (input[0] == '\0') { return; } if (input[0] == 'p' && input[1]=='i') { int i; for (i=(len(input)+1);i>1;...
ALGO
0.999772
3.858248
4fb64d71-7721-4b11-a4a3-22d3cb45f24b
suman319dega/Leetcode
2163-kth-distinct-string-in-an-array/2163-kth-distinct-string-in-an-array.cpp
class Solution { public: string kthDistinct(vector<string>& arr, int k) { map<string,int> m; for(string s : arr) { m[s] += 1; } int count = 0; for(string s : arr) { if(m[s] == 1) count++; if(count == k) return s; } return ""...
ALGO
0.999931
5.908998
eab09b0b-1c61-447d-baca-cec0d8b5641d
m4oughi/100DaysofCode
pureCPP/0039. Day 39/STL Algorithms/002. Non-modifying Algorithms - for_each/002. Modify a Copy of Elements/main.cpp
#include <iostream> #include <vector> #include <algorithm> int main() { std::vector<int> nums{1, 2, 3, 4, 5}; std::for_each(nums.begin(), nums.end(), [](int n) { std::cout << n * n << " "; }); // Output: 1 4 9 16 25 }
ALGO
0.999866
5.080793
c0dededa-35f2-4884-82ae-db5fda400020
anubane/llvm-project-try
llvm/lib/DebugInfo/LogicalView/Core/LVSort.cpp
#include "llvm/DebugInfo/LogicalView/Core/LVSort.h" #include "llvm/DebugInfo/LogicalView/Core/LVElement.h" #include "llvm/DebugInfo/LogicalView/Core/LVReader.h" #include <string> using namespace llvm; using namespace llvm::logicalview; #define DEBUG_TYPE "Sort" //===--------------------------------------------------...
TOOL
0.961809
6.58279
f455bd45-a773-4a19-9c1c-083b1819d26b
TommyXR/TetrisGL
src/engine/falling_phase.cpp
#include "engine/falling_phase.hpp" #include <cmath> #include "engine/game.hpp" #include "engine/pattern_phase.hpp" namespace tetris { namespace engine { falling_phase::falling_phase(game& g): phase(g), fall_speed(1000 * std::pow(0.8 - (game_state.level - 1) * 0.007, game_state.level - 1)) {} void falling_...
TOOL
0.948314
6.437468
3bf43166-b9a4-47e5-aa45-b1b698b00889
IcEy-999/MyUESource
Engine/Plugins/Runtime/AudioSynesthesia/Source/AudioSynesthesiaCore/Private/FFTPeakPitchDetector.cpp
#include "FFTPeakPitchDetector.h" #include "AudioSynesthesiaCoreLog.h" #include "CoreMinimal.h" #include "PeakPicker.h" #include "DSP/Dsp.h" #include "DSP/FFTAlgorithm.h" #include "DSP/SlidingWindow.h" #include "DSP/FloatArrayMath.h" namespace Audio { namespace FFTPeakPitchDetectorIntrinsics { constexpr int32 Pea...
ALGO
0.918877
6.372567
7f7de80a-b262-45cd-a5d6-8abe56d8f943
soyamaguchi/AtCoder-past-problems
2020/tokiomarine2020/B.cpp
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <complex> #include <unordered_map> #include <unordered_set> #include <random> #...
ALGO
0.999752
3.892647
7a9c339e-112c-41ed-895e-55c8bb52d0af
sasha-lobov/AIP-1-semestr
ДЗ_Мудлл_новый_ЛобовА(20й вариант)/Операторы ветвления(20й вариант)/Задание 1F/main.cpp
#include <iostream> #include <cmath> // задачка 1F на ветвления неделя 5 int main() { float x,y; std :: cout << "x = "; std :: cin >> x; if(x>5) { y = 2*x*x + 10; std :: cout << "y = " << y << std :: endl; } else if (x == 0) { y = 0; std :: cout << "y = ...
ALGO
0.993982
3.501385
1aabacad-e8b2-4f4f-a666-c8c80519800f
XDEv11/Codeforces
Round#636_div3/4.cpp
#include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int T; cin >> T; while(T--) { int n, k; cin >> n >> k; for (int i = 0; i < n; ++i) } return 0; }
ALGO
0.999567
3.405886
352d5226-d124-4c84-89f5-c39db0538126
harp-lab/rosetta-slog
souffle/aggregation-comple.cpp
#include "souffle/CompiledSouffle.h" #include "souffle/SignalHandler.h" #include "souffle/SouffleInterface.h" #include "souffle/datastructure/BTree.h" #include "souffle/io/IOSystem.h" #include <any> namespace functors { extern "C" {} } // namespace functors namespace souffle::t_btree_i__0__1 { struct Type { static co...
ALGO
0.951494
4.553646
f8aa1b8f-2b6b-49aa-b229-64104d488a0d
zhouxs1023/WildMagic
LibMathematics/Miscellaneous/Wm5QuadToQuadTransforms.cpp
#include "Wm5MathematicsPCH.h" #include "Wm5QuadToQuadTransforms.h" namespace Wm5 { //---------------------------------------------------------------------------- template <typename Real> HmQuadToSqr<Real>::HmQuadToSqr (const Vector2<Real>& P00, const Vector2<Real>& P10, const Vector2<Real>& P11, const Vector2...
ALGO
0.99626
6.429752
fc87d38d-2e32-468e-acd0-dd96e35343e7
TonyLiu2015/Traffic_Simulation_Class_Codes
10_Queuing_simulation_M_D_1_C++/Problem_4/Source.cpp
#include<iostream> #include<fstream> #include<random> using namespace std; int main() { float GetRandomNumber(int x, int y); float lamda = 2.0 / 60;// arrival rate float lamda2 = 1.0 / 25;// service rate float arriveTime = 0; float timeInterval = 0.0; float serviceTime1 = 0.0; float serviceTime2 = 0.0; f...
ALGO
0.979667
3.594787
7c503e71-8921-43f3-8cf2-f9649029ac69
BrynMawr-CS317-F21/animation-toolkit
assignments/a6-transform/test_slerp.cpp
#include <iostream> #include "atkmath/quaternion.h" #include "atkmath/vector3.h" using atkmath::Quaternion; using atkmath::Vector3; int main(int argc, char** argv) { Quaternion q0(Vector3(0,0,1), 0 * atkmath::Deg2Rad); Quaternion q1(Vector3(0,0,1), 120 * atkmath::Deg2Rad); std::cout << "q0 " << q0 << std::e...
ALGO
0.932374
4.631344
15a8970f-c884-43a3-b6ce-a1683da12d4e
ChristinaDiam/TravelMonitor
TravelMonitor/Monitor/helphelpmain.cpp
#include<iostream> #include<cstring> #include"helphelpmain.h" using namespace std; int compareblooms(void* item1, void* item2){ bloomvirus *bv1=(bloomvirus*) item1; bloomvirus *bv2=(bloomvirus*) item2; return (bv1->getvname()).compare(bv2->getvname()); } int comparebloom(void* item1, void* item2){ ...
ALGO
0.955915
4.468063
277d1b13-7a93-4734-bd78-d4ee2e251deb
aryashahi/Leetcode
94-binary-tree-inorder-traversal/94-binary-tree-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.999955
6.487746
9cc5f204-e660-4e05-a4d1-f4b44e87fc1d
winlibs/openldap
servers/slapd/back-ndb/modrdn.cpp
/* modrdn.cpp - ndb backend modrdn routine */ /* $OpenLDAP$ */ /* ACKNOWLEDGEMENTS: * This work was initially developed by Howard Chu for inclusion * in OpenLDAP Software. This work was sponsored by MySQL. */ #include "portable.h" #include <stdio.h> #include <ac/string.h> #include "back-ndb.h" int ndb_back_modr...
TOOL
0.901375
6.109656
5f33709d-abae-4f1c-9922-72014fa3a1dc
u8y7541/algorithms_clrs
radix_sort/radix_sort.cpp
#include <bits/stdc++.h> using namespace std; void counting_sort(vector<vector<int> >& A, int k, int digit) { int n = A.size(), d = A[0].size(); int B[n] = { 0 }; int C[k] = { 0 }; for (int i = 0; i<n; i++) C[A[i][digit]]++; for (int i = 1; i<k; i++) C[i] += C[i-1]; for (int i = n-1; i>=0; i--) B[C[A[i][digit]]-...
ALGO
0.999761
4.800771
abdf3790-cb3d-48e6-aaba-057ae84d0d10
sedtia-prakoso-budi-tirto-arto/Data-Structure-2022
Persiapan-FP/DFS-TraversalAdjacencyList.cpp
// C++ program to print DFS traversal from // a given vertex in a given graph #include <bits/stdc++.h> using namespace std; // Graph class represents a directed graph // using adjacency list representation class Graph { public: map<int, bool> visited; map<int, list<int>> adj; // function to add an edge to...
ALGO
0.99997
6.252528
e10b5b3f-b508-49af-9096-b8b9e82fad51
ftanvir/Problem-Solving
Codeforces/202A.cpp
#include <bits/stdc++.h> using namespace std; int main() { string s, res; cin>>s; char mx = s[0]; for(int i=1; i<s.size(); i++) { mx = max(mx, s[i]); } for(int i=0; i<s.size(); i++) { if(s[i]==mx) { res+=s[i]; } } cout<<res<<endl; return 0; }
ALGO
0.999955
4.59475
c368a72b-e3ea-4375-8761-e0dc9dd0e353
binarycraft007/libcronet
src/third_party/llvm-libc/src/src/math/generic/cos.cpp
#include "src/math/cos.h" #include "hdr/errno_macros.h" #include "src/__support/FPUtil/FEnvImpl.h" #include "src/__support/FPUtil/FPBits.h" #include "src/__support/FPUtil/double_double.h" #include "src/__support/FPUtil/dyadic_float.h" #include "src/__support/FPUtil/except_value_utils.h" #include "src/__support/common.h...
ALGO
0.986048
7.099959
8456f4c7-394d-4edc-821f-e201798394c4
changtintin/cpp_learning
data_structure/graph.cpp
#include<iostream> #include<stack> #include<queue> using namespace std; class Vertex{ public: int v; Vertex *next; public: Vertex(); }; Vertex::Vertex(){ next = nullptr; } class Graph{ public: Vertex *AdjList; bool *rd; stack<int> stk; ...
ALGO
0.999869
4.774035
11ce740a-2d29-40a1-80f3-b1df031c8e83
Syhire/CompetitivePrograming
Kompetitive 4/Lain-lain/Draughts.cpp
#include <stdio.h> #include <vector> #include <algorithm> using namespace std; int t; char map[15][15]; // vector<int> black; vector<pair<int, int> > white; int maxN = 0; int dir[][2] = {{1, 1}, {1, -1}, {-1, 1}, {-1, -1}}; void printMap() { for (int i = 0; i < 10; i++) printf("%s\n", map[i]); } void s...
ALGO
0.998693
4.135866
1561b89b-35d9-4def-8792-132c54fb388c
ZA139/ACM-Team-Training
ACM Team Training/POJ 3070 Fabonacci(矩阵快速幂).cpp
//#include<stdio.h> //struct Matrix { // long long data[2][2]; //}ans1, ans; //Matrix mul(Matrix a, Matrix b) { // Matrix temp; // for (int i = 0; i < 2; i++) // { // for (int k = 0; k < 2; k++) // temp.data[i][k] = 0; // } // for (int i = 0; i < 2; i++) // { // for (int j = 0; j < 2; j++) // { // for (int k = 0...
ALGO
0.999939
4.049687
eb1862aa-5f0f-44ec-a589-520696ac942b
Cnd96/comp
google/codejam/19/qualification/forgone.cpp
#include "bits/stdc++.h" #include <iostream> #include <vector> using namespace std; int main() { int t; cin>>t; for (int i = 1; i <=t; i++) { string n; cin >> n; string s(n.size(), '0'); for (int i=0; i<n.size();i++) { if(n[i]=='4'){ n[i]='2';...
ALGO
0.999375
4.054773
119c0eab-495c-477f-9253-aa0ecc18ce4a
ari1337an/Algorithm-Vault
General Library/BigInteger.cpp
const int bignumlen = 2200; const int Blen = 8; const ll base = 100000000; struct BigInteger { int len; ll data[bignumlen]; ll &operator[](int x) { return (data[x]); } const ll &operator[](int x) const { return (data[x]); } BigInteger() { memset(data, 0, sizeof(data)); len = 0; ...
ALGO
0.999902
3.453426
77d6a753-8a0a-4a7c-98b6-7bf08cb183b7
ishandutta2007/codeforces
flying2021/normal/1483/B.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<set> #define N 100010 using namespace std; int gcd(int x,int y){return y==0?x:gcd(y,x%y);} int a[N]; int L[N],R[N]; set<int>s; inline bool check(int x){return gcd(a[x],a[R[x]])==1;} void del(int x) { s.erase(x); if(R[x]==x) return; if(check(x)) ...
ALGO
0.999963
4.039021
937302bb-3756-4a17-bcbd-6e32d610fbd6
mjsaikot/Data_Structure
EXAM/Mid Term/WebHistory.cpp
#include <iostream> #include <list> #include <iterator> #include <string> /*You are given a doubly linked list of unique string values. These strings refer to web addresses without any spaces. You will be given Q queries. In each query you will be given some commands. Type of commands are - visit address - You need to ...
ALGO
0.999442
5.910698
db4d39df-825e-412f-b877-54b12cfea621
evoldoers/historian
src/knhx.cpp
// Lightweight Newick tree format parser // Adapted from https://github.com/attractivechaos/klib #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "knhx.h" #define BUFSIZE 128 static inline char *add_node(const char *s, ktree_t *aux, int x) { char *p, *nbeg, *nend = 0; knode_...
ALGO
0.967317
5.241119
e54c92fa-91f6-4f12-a00d-d02cda56e87d
djmagnusa/dsa-dump
detect_cycle_directed_graph.cpp
#include <bits/stdc++.h> using namespace std; class Solution{ public: bool solve(int src, vector<int> &vis, vector<int> &order, vector<int> adj[]) { vis[src] = 1; order[src] = 1; for(auto x : adj[src]) { if(!vis[x]) { ...
ALGO
0.999885
5.348682
8de80639-9fe2-4795-9b37-ecfd2116f31c
pvthuyet/CppInAction
lib/boost_1_70_0/libs/intrusive/example/doc_derivation_value_traits.cpp
struct simple_node { simple_node *prev_; simple_node *next_; }; //Define the node traits. A single node_traits will be enough. struct simple_node_traits { typedef simple_node node; typedef node * node_ptr; typedef const node * ...
TOOL
0.905875
7.666497
f391fe9c-085b-4b9d-b7be-faa66b13a114
prasaddhikale/C-DAC-ACTS
Daywise Lab Work/CPP/Assignment 02/Using for loop/Que 1.cpp
#include <iostream> // find factor using namespace std; int main() { int num; cout << "Enter a positive integer: "; cin >> num; for (int i=1; i<=num; ++i) { if (num%i == 0) { cout << i <<" "; } } return 0; }
ALGO
0.997855
3.210573
31f6e611-a3b7-402f-b84a-3d7d378140b7
Bazik29/Natural-science
1-mpi/main.cpp
#include <mpi.h> #include <iostream> #include <iomanip> #include <cmath> #include <algorithm> #include <unistd.h> #include <fstream> double function(const double x, const double y) { return 0; } double conditions(const double x, const double y) { double e = 0.0000000001; if (1-e <= y && 1+e >= y) ...
ALGO
0.999905
4.766239
bf0c305f-e510-4196-ac5d-1b14b66418d8
weihaoysgs/ssvio
thirdparty/eigen/doc/examples/Tutorial_PartialLU_solve.cpp
#include <Eigen/Core> #include <Eigen/LU> #include <iostream> using namespace std; using namespace Eigen; int main() { Matrix3f A; Vector3f b; A << 1,2,3, 4,5,6, 7,8,10; b << 3, 3, 4; cout << "Here is the matrix A:" << endl << A << endl; cout << "Here is the vector b:" << endl << b << endl; Vec...
ALGO
0.999884
3.142099
458afc6e-d0b1-4d28-ae80-2cbccde9f97e
Pantherval/CPP-Dump
Sum with while.cpp
#include <iostream> using namespace std; int main() { int sum = 0; int number = 0; while (number >= 0) { // add all positive numbers sum += number; // take input from the user cout << "Enter a number: "; cin >> number; // continue condition if (num...
ALGO
0.99914
3.720964
6d220603-bf3f-4822-ae6f-91921a437fcf
ishandutta2007/codeforces
ssrs_/normal/1720/B.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; for (int i = 0; i < t; i++){ int n; cin >> n; vector<int> a(n); for (int j = 0; j < n; j++){ cin >> a[j]; } sort(a.begin(), a.end()); cout << a[n - 1] + a[n - 2] - a[0] - a[1] << endl; } }
ALGO
0.99995
3.540407
437ce28f-5a7a-47c5-8089-ddd6e0e2f7d8
GoksuAbanoz/depo
C_Programlama-12.cpp
#include <stdio.h> #include <conio.h> #include <locale.h> #include <math.h> main() { setlocale(LC_ALL,"Turkish"); int sayi1,sayi2,sayi3,sayi4,sayi5,enB; printf("1.sayy girin :"); scanf("%d",&sayi1); printf("2.sayy girin :"); scanf("%d",&sayi2); printf("3.sayy girin :"); scanf("%d",&sayi3); ...
ALGO
0.999331
3.333771
3d5134eb-e864-4e25-8cd1-bd8c16c5618e
koralkulacoglu/CompetitiveProgramming
DMOJ/CCC/2014/S2.cpp
/* ID: Koral Kulacoglu TASK: test LANG: C++ */ #pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef long double lld; typedef complex<ld> cd; typedef pair<int, ...
ALGO
0.99968
4.625771
0587e4b2-318d-4d4e-bda5-2c38383baaa1
cyh-star/cyh1
第十章/8 Hypothesis_Verification_for_3D_Object_Recognition/source/global_hypothesis_verification.cpp
#include <pcl/io/pcd_io.h> #include <pcl/point_cloud.h> #include <pcl/correspondence.h> #include <pcl/features/normal_3d_omp.h> #include <pcl/features/shot_omp.h> #include <pcl/features/board.h> #include <pcl/keypoints/uniform_sampling.h> #include <pcl/recognition/cg/hough_3d.h> #include <pcl/recognition/cg/geometric_c...
ALGO
0.980942
5.581007
c899a059-202b-4502-9223-bdc27999a683
ritikasingh6/hw5
wordle.cpp
#ifndef RECCHECK // For debugging #include <iostream> // For std::remove #include <algorithm> #include <map> #include <set> #include <vector> #endif #include "wordle.h" #include "dict-eng.h" using namespace std; // data structure like a map that keeps track of used floating letters // multi set? // for all floating...
ALGO
0.955596
5.669076
7e89904f-27cc-4551-ba24-5a90173fcaa3
akmal1216/Summer2025CS101
src/week3/lab9/problem2.cpp
// // Created by Akmaljon Toshbotirov on 20/06/25. // // #include <iostream> // using namespace std; // // double average(int arr[], int n) { // int sum = 0; // for (int i = 0; i < n; i++) sum += arr[i]; // return (double)sum / n; // } // // int main() { // int n; // cin >> n; // int a[n]; // ...
ALGO
0.975543
6.082664
63315f68-66f0-499a-a586-6790d8811fb9
Abhishek-Kamble/Coding-Ninjas-CPP
Linked List 1/findNodeRec.cpp
/* Find a Node in Linked List You have been given a singly linked list of integers. Write a function that returns the index/position of integer data denoted by 'N' (if it exists). Return -1 otherwise. Note : Assume that the Indexing for the singly linked list always starts from 0. Input format : The first line contain...
ALGO
0.999964
6.170045
d9720d5e-a0ff-408a-996a-ae38460d76fa
alexjball/project-euler
problem31.cpp
#include <iostream> #include <string> #include <vector> using namespace std; enum Coin { p200 = 0, p100 = 1, p50 = 2, p20 = 3, p10 = 4, p5 = 5, p2 = 6, p1 = 7, }; const int number_of_coin_types = 8; int coin_values[number_of_coin_types] = {200, 100, 50, 20, 10, 5, 2, 1}; int number_of_ways(int amoun...
ALGO
0.986934
5.72164
d79484ea-1ba6-4543-a877-3feb045f6396
mumba-org/mumba
third_party/boost/src/libs/math/src/tr1/comp_ellint_3f.cpp
extern "C" float BOOST_MATH_TR1_DECL boost_comp_ellint_3f BOOST_PREVENT_MACRO_SUBSTITUTION(float k, float nu) BOOST_MATH_C99_THROW_SPEC { return c_policies::ellint_3 BOOST_PREVENT_MACRO_SUBSTITUTION(k, nu); }
TOOL
0.920718
3.181791
f4044534-5f90-48e0-b7e2-d0b5cec656bf
aniket2013/SPOJ
GIRLSNBS.cpp
#include<stdio.h> #include<math.h> int main() { long long int g,b,intans;double ans,mini,maxi; scanf("%lld",&g); scanf("%lld",&b); while(g!=-1&&b!=-1) { if(g>=b) { mini=b;maxi=g;} else {mini=g;maxi=b;} ans=maxi/(mini+1); ...
ALGO
0.999979
3.116231
143289e6-6574-47ce-8cf2-59eac3d8649b
akhilred36/coScheduling
apps/lammps/src/OPENMP/npair_half_size_multi_newtoff_omp.cpp
// clang-format off #include "npair_half_size_multi_newtoff_omp.h" #include "atom.h" #include "atom_vec.h" #include "domain.h" #include "error.h" #include "molecule.h" #include "my_page.h" #include "neighbor.h" #include "neigh_list.h" #include "npair_omp.h" #include "omp_compat.h" using namespace LAMMPS_NS; /* ---...
ALGO
0.998722
6.261035
4d6d865d-d935-4453-8dbf-903c5a00f803
vikhyat187/DSA
trim-a-binary-search-tree/trim-a-binary-search-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.999995
6.388049
4a9ff671-45fb-4267-830c-9272d1ba0e3a
Vandyshge/2sem
lab11/5.cpp
#include <iostream> #include <string> #include <vector> using namespace std; void print(vector <vector <int>> v) { for (int i = 0; i < v.size(); i++) { for (int j = 0; j < v[0].size(); j++) { cout << v[i][j] << " "; } cout << endl; } cout << endl; } int pos(string s) {...
ALGO
0.999701
4.302343
db9c7e7e-dc16-482c-92d4-3d4eb0120d51
csienslab/icLibFuzzer
compiler-rt/lib/scudo/standalone/linux.cpp
#include "platform.h" #if SCUDO_LINUX #include "common.h" #include "linux.h" #include "mutex.h" #include "string_utils.h" #include <errno.h> #include <fcntl.h> #include <linux/futex.h> #include <sched.h> #include <stdlib.h> #include <string.h> #include <sys/mman.h> #include <sys/stat.h> #include <sys/syscall.h> #inc...
TOOL
0.885653
7.621345
36a338f2-6bc8-4fc2-9cf3-bdefa276f0b4
edoll1843/sophomoreProject
DS/Project_02/Graph.cpp
#include "Graph.h" #include <map> #include <cstdlib> #include <iostream> #include <algorithm> Graph::Graph(ofstream * flog) { this->flog=flog; //get flog } Graph::~Graph() { } bool Graph::Build(AVLTree * root) { int a = 0; //value declare int weight = 0;//value declare while (gp_arry[size] != NULL) { //while gp...
ALGO
0.973882
3.132967
6c01c15b-486b-49eb-9930-cf31f61e78a4
giiulia/BachelorThesis
Single_detectors/Detector3/Shaping_time/fwhm_sh_time.cpp
#include <iostream> #include <fstream> #include <cstdlib> #include <vector> #include <string> #include <cmath> #include <ctime> #include "TGraphErrors.h" #include "TCanvas.h" #include "TF1.h" #include "TFitResultPtr.h" #include "TApplication.h" #include "TAxis.h" #include "TAttFill.h" #include "TMultiGraph.h" #includ...
DATA
0.990458
3.971622
781a4e20-4576-42cb-b0a8-f7b3df06524c
porterlin/LeetCode
binary-tree/617v2.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.999971
6.339249
a5bb5f3a-45e3-49d1-b2fd-96f63b99c735
gracygulati7/100DaysOfCode
Day 9/ImplementAtoi.cpp
//! PROBLEM OF THE DAY OF GEEKSFORGEEKS #include <iostream> #include <string> using namespace std; class Solution { public: int atoi(string s) { int n = s.size(); int sign = +1; int result = 0; for (int i = 0; i < n; ++i) { if (s[i] == '-' && i == 0) { // to check if - i...
ALGO
0.997101
5.573547
9c78dd0a-fbec-4ce6-b992-2d4eeac9e6bf
shreyans-sureja/Spoj_problems
BEENUMS - Beehive Numbers.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pii; typedef pair<double, ll> pdl; typedef vector<ll> vll; #define ff first #define ss second #define pb(x) push_back() #define sl(x) scanf("%lld",&x) #define sll(x,y) scanf("%lld%lld",&x,&y) #define slll(x,y,z) scanf("%lld%lld%lld"...
ALGO
0.996843
3.492328
6962f13f-5816-49bc-8bcc-9beb164f7d22
minjaec023/algorithm-study
study2/day4/14235.cpp
#include <iostream> #include <queue> using namespace std; int n; priority_queue<int> q; int main() { scanf("%d", &n); for(int i=0;i<n;i++) { int num; scanf("%d", &num); if(num==0) { if(q.empty()) { printf("-1\n"); } else { printf("%d\n", q.top()); q.pop(); ...
ALGO
0.999739
3.488974
34123cb6-26ca-43a4-9f5b-df59afc6d527
cmu-db/ext-analyzer
redis/extn_src_code/Redis-ImageScout-master/imgscoutclient.cpp
#include <cstdlib> #include <iostream> #include <iomanip> #include <string> #include <boost/filesystem.hpp> #include <boost/program_options.hpp> #include "hiredis.h" #include "pHash.h" using namespace std; namespace fs = boost::filesystem; namespace po = boost::program_options; struct Args { string cmd, host, key; ...
TOOL
0.968795
5.071582
e4dfe2d9-ac55-4576-9b6d-825dbe2307a9
ketkat-maker/Some-Problems
word.cpp
#include <iostream> #include <String> using namespace std; string uppercase(string s) { string result; for (char c : s) { if (c >= 'a' && c <= 'z') { c -= 32; } result += c; } return result; } string lowercase(string s) { string result; for (char c...
ALGO
0.999346
5.47446
acc961c3-c644-4fbb-82f1-d7c987f926c4
zachmorris/diff-driver
catkin_ws/src/diff_drive_control/src/follow_wall.cpp
// user #include "driver.h" // for robot states #include "follow_wall.h" // c++ #include <cmath> // for fabs #include <array> // ros includes #include "ros/ros.h" #include "geometry_msgs/Twist.h" #include "angles/angles.h" // precision const double g_yaw_precision = 3.14159/90; const double g_follow_wall_distanc...
ALGO
0.997088
4.667763
d240500c-22ec-47e1-9bfb-2730664a4287
rakhi424/programmes_in_c
armstrong_number.cpp
#include<stdio.h> int main() { int num, sum = 0, rev, save; printf("enter the number which you want to search : "); scanf("%d", &num); save = num; while(num>0) { rev = num%10; sum = sum+rev*rev*rev; num = num/10; } printf("\n the number = %d", sum); if(save == sum) printf("\n the number is a ...
ALGO
0.999977
3.635921
e8410e08-e55c-48ec-8b6a-96684d00edfb
Ersocaut/UvaOj
Contest Volumes (10000...)/Volume 122 (12200-12299)/12250.cpp
#include <iostream> using namespace std; int main(){ string s,l; int d = 1; while (cin >> s && s != "#"){ if (s == "HELLO") l = "ENGLISH"; else if (s == "HOLA") l = "SPANISH"; else if (s == "HALLO") l = "GERMAN"; else if (s == "BONJOUR") l = "FRENCH"; ...
ALGO
0.949863
3.941764
0564e52f-e00a-460f-bbfe-10609646ab46
purna135/Web-Scarping-Python
Snippet Upload Automation/snippet_code/code.cpp
#include <iostream> #include <string.h> #include <vector> #include <queue> using namespace std; class Node { public: int data; Node *left = nullptr; Node *right = nullptr; Node(int data) { this->data = data; } }; class Pair { public: Node *node = nullptr; int state = 0; Pair(Node *node, int stat...
ALGO
0.999897
5.240445
d5729caf-2548-4c2f-8d6a-f2b6b18e1e88
vbassn/volume-mesh-benchmarks
amgcl/examples/mpi/runtime_sdd_3d.cpp
#include <iostream> #include <iomanip> #include <fstream> #include <vector> #include <array> #include <numeric> #include <cmath> #ifdef _OPENMP #include <omp.h> #endif #include <boost/scope_exit.hpp> #include <boost/program_options.hpp> #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/json_parser...
ALGO
0.998392
5.045345
89987997-086d-439b-91b7-a01727a1f7bf
CSPWinterPrinz/Prepare-for-Contest-2018
ALL ALGO/LIS.cpp
#include <bits/stdc++.h> #define up(i , a , b) for(int i = a ; i <= b; ++i) #define up2(i , a , b , c) for(int i = a ; i <= b; i += c) #define down(i , a , b) for (int i = a; i >= b; --i) #define down2(i , a , b , c) for (int i = a; i >= b; i -= c) #define II pair <int, int> #define III pair<int, pair<int, int> > #d...
ALGO
0.999997
3.765584
1a61e438-fc2e-4e36-9b54-4b3ef696e2a9
amitrajitbose/Competitive_Programming
Dynamic Programming/Finding_Nth_Fibonacci_2.cpp
//Memoization Based Dynamic Programming //Top Down //nth Fibonacci Number //Author: Amitrajit Bose /* NOTE: Zeroth value(n=0) is fibonacciseries[0]=0 First value(n=1) is fibonacciseries[1]=1 Second value(n=2) is fibonacciseries[2]=1 Third value(n=3) is fibonacciseries[3]=2 .. so on */ #include <bits/stdc++.h> using na...
ALGO
0.999984
5.419049
10ea90d5-38b4-4aa2-9f1d-c1f41a538849
JAFFER1272HUSSAIN/PD-DAY-04
task8.cpp
#include<iostream> using namespace std; void Isequal(int,int); main() { int x,y; cout << "Enter First Number: "; cin >> x; cout << "Enter Second Number: "; cin >> y; Isequal(x,y); } void Isequal(int x,int y) { if (x == y) { cout << "True"; } if (x!=y) { cout << "False"; } }
ALGO
0.996348
3.326715
f6037d2d-7be1-41a4-ad4c-433ac4e62bcc
TomSawyer7/cpp-calculator
midterm-project-oop.cpp
#include <iostream> #include <vector> #include <algorithm> #include <iomanip> using namespace std; class Item { public: int id; string name; int quantity; float price; }; vector<Item> inventory; void addItem() { Item item; cout << "Enter Item ID: "; cin >> item.id; cin.ignore(); c...
TOOL
0.998689
6.497798
386c1467-8ad4-44fd-8ffb-ee1fbf97d49c
Taeyoung96/2021-Spring-Computer-Vision
Homeworks_CV/eigen-3.3.8/unsupported/doc/examples/MatrixPower_optimal.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; int main() { Matrix4cd A = Matrix4cd::Random(); MatrixPower<Matrix4cd> Apow(A); std::cout << "The matrix A is:\n" << A << "\n\n" "A^3.1 is:\n" << Apow(3.1) << "\n\n" "A^3.3 is:\n" << Apow(3.3) << "\n\n" ...
ALGO
0.998014
3.396939
25f28e67-5264-46a7-9c63-f2a457b74f1b
Prabhat2002/Data_Structure_and_Algorithm
Find Lucky Integer in an Array.cpp
class Solution { public: int findLucky(vector<int>& nums) { map<int,int>mp; for(int a=0;a<nums.size();a++) mp[nums[a]]++; int res=-1; for(auto i=mp.begin();i!=mp.end();i++) { if(i->first==i->second) res=i->first; } return res...
ALGO
0.999925
5.283109
1e396d56-91bf-4b7a-b21c-e41fa44b2d7a
sumitdhoble/OSProject
LoopOverhead.cpp
#include<iostream> #include"rdtsc.h" #define CLOCK_RATE 3.4 using namespace std; int main(){ int i, j, k, l, m, n, o, p; bool comparison; int iterations = 1000000; int measurements = 100; // struct timeval startTime, endTime, testTime, testTime2, testTime3; int runtime; float measurementResult = 0.0, finalResu...
TOOL
0.94802
3.404717
25b43afa-0340-4ce9-8aac-9c5689444275
YevhenHordiichuk-itstep/ITStep_Lesson_4
homework_4_10.cpp
#include <cstdio> #include <cstring> int main(int argc, char** argv) { int i; char* str; scanf("%s", str); for (i = (strlen(str) - 1); i >= 0 ; --i) { printf("%c", str[i]); } return 0; }
ALGO
0.997435
4.026099
ff671758-8c23-4a19-bdea-acf30ce5250f
UnrealKaraulov/war3_my_platforms
REBIRTH_CLIENT/MapUploaderProject/StormLib-master/src/sparse/sparse.cpp
/*****************************************************************************/ /*---------------------------------------------------------------------------*/ /* This module contains Huffmann (de)compression methods */ /* */...
ALGO
0.953793
4.993226
49590c13-2387-4d58-aa5b-2e7345d1c697
Subrat29/CrackYourPlacement
Day31/530. Minimum Absolute Difference in BST/sol1.cpp
#include <bits/stdc++.h> using namespace std; // sc: // tc: /** * 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) {} * ...
ALGO
0.999886
6.627443
b6e3dd97-5667-459a-bfc5-b521b361efee
Sameer-2061/DSA_Series
day_19/sumOfBeauty_all-substrings.cpp
#include<bits/stdc++.h> using namespace std; // Problem Name:Sum of Beauty all substrings // Link:https://leetcode.com/problems/sum-of-beauty-of-all-substrings/description/ // Code class Solution { public: int beautySum(string s) { int n=s.size(); int ans=0; for(int i=0;...
ALGO
0.99994
6.020189
cf33c912-1879-40d6-bd44-2120e444b583
fgdgfdgfda/Leetcodes
0412-fizz-buzz/0412-fizz-buzz.cpp
class Solution { public: vector<string> fizzBuzz(int n) { vector<string> op; for(int i=1; i<=n; i++) { if(i% 3==0 && i %5==0) op.push_back("FizzBuzz"); else if(i% 3==0) op.push_back("Fizz"); else if(i %5==0) op.push_back("Buzz"); else op.push_back(to_s...
ALGO
0.99987
6.722525
09c0c5d0-20db-417e-83d6-1c69015359df
shivamb14021999/Theory-Of-Computation-TOC-
Incremented by one.cpp
#include<bits/stdc++.h> using namespace std; int main() { char str[100]; cout<<"Enter a Binary Number :"; cin>>str; for(int i=strlen(str)-1;i>=0;i--) { if(str[i]=='0') { str[i]='1'; break; } else { str[i]='0'; } } cout<<"incremented by 1 :"<<str; }
ALGO
0.99983
4.11339
16638bb5-af5a-4ee0-ab66-6c49a1c1bc18
ishandutta2007/codeforces
memphis/normal/343/B.cpp
#include<cstdio> int l; char ch,s[1000001]; int main(){ while((scanf("%c",&ch)^-1)&&(ch!='\n')) if(l==0||ch!=s[l])s[++l]=ch; else --l; if(l==0)puts("Yes");else puts("No"); }
ALGO
0.999813
3.001579
c110b620-bf30-4eff-92a8-76cc46daba9a
abhishek-217/DSA_Questions
2551-apply-operations-to-an-array/2551-apply-operations-to-an-array.cpp
class Solution { public: vector<int> applyOperations(vector<int>& nums) { int n = nums.size(); for(int i=0; i<n-1; i++){ if(nums[i] == nums[i+1]){ nums[i] = nums[i]*2; nums[i+1] = 0; } } vector<int>ans; for(int i=0; i...
ALGO
0.999972
5.572007
d0ea6eac-63a4-44bc-b7c9-cd70d17c6de2
mochavin/codeforces
2128/a.cpp
#include <bits/stdc++.h> #include <iostream> #define ll long long #define endl '\n' #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define loop(i, h) for (int i = 0; i < h; i++) #define loop1(i, h) for (int i = 1; i <= h; i++) using namespace std; ll M = 998244353; ll N = 2e5 + 10; void solve()...
ALGO
0.999904
4.639078
f9e3d545-a803-4abf-8746-67b84aedb620
TreeSkyx/CE-BOOSTUP-9
bigRec.cpp
#include <stdio.h> int main() { int n,l,area; scanf("%d %d",&n,&l); if(n>0 && l>0) { area = (l*l)*n; printf("%d",area); } else printf("Error"); }
ALGO
0.998967
3.515899
d0f42176-80f4-4ea5-bdcf-51979cc30050
arpan8615/Threads
threadmulti.cpp
// C Program to multiply two matrix using pthreads without // use of global variables #include<stdio.h> #include<pthread.h> #include<unistd.h> #include<stdlib.h> #define MAX 4 //Each thread computes single element in the resultant matrix void *mult(void* arg) { int *data = (int *)arg; int k = 0, i = 0; ...
ALGO
0.999355
3.928696
27780181-2c7f-4479-a341-08bf193d36bd
Vikaskumar0112/cppdsa
p1 2212.cpp
#include<iostream> using namespace std; #define N 5 int arr[N]; int top=-1; int pop(){ int r=-1; //step1: Check under flow condition if(top==-1){ cout<<"under flow condition"; return r; } else{ //step2: store top index value into another value r=arr[top]; //step3: Decrease top by 1 top--; } //step4: ...
ALGO
0.999458
3.727518
70088ecc-36cc-4c79-b296-c7f68f8a1601
shenjianan97/leetcode_answer
40.cpp
class Solution { public: vector<vector<int> > results; vector<int> temp; set<vector<int> > results_set; void generator(int idx, vector<int>& candidates, int target){ if(target < 0) return; if(target == 0){ results_set.insert(temp); return; ...
ALGO
0.999995
6.195529
c8517e9d-caa5-457a-9e9f-1b402f11e97c
makio93/competitive-othersites
Codeforces/Educational/R132/D/1/main0.cpp
// 学習1回目,解説AC #include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i=0; i<(int)(n); ++(i)) #define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i)) #define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i)) #define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); --(i)) ...
ALGO
0.999929
3.895604
d85a659c-f94b-461b-954d-6ffccdb1733d
thermotools/lammps_mie_fh
lib/colvars/lepton/src/CompiledExpression.cpp
#include "lepton/CompiledExpression.h" #include "lepton/Operation.h" #include "lepton/ParsedExpression.h" #include <utility> using namespace Lepton; using namespace std; #ifdef LEPTON_USE_JIT using namespace asmjit; #endif CompiledExpression::CompiledExpression() : jitCode(NULL) { } CompiledExpression::CompiledE...
TOOL
0.982791
7.299992
e48b3330-af2b-4fcf-bbbf-5d1764c2e175
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_8896_11.cpp
#include <bits/stdc++.h> using namespace std; const int maxN = 1010; string a; int n; int dp[maxN][2]; int main() { cin >> n; cin >> a; if (a[0] == '1') { dp[0][1] = 0; dp[0][0] = 1; } else { dp[0][0] = 1; dp[0][1] = 0; } for (int i = 1; i <= n - 1; i++) { dp[i][0] = dp[i - 1][1] + (a[i]...
ALGO
0.999992
4.70341
356063f3-9680-46e1-bc8e-8d02645f77c0
ngoquanghuy99/C-CPP-problems-and-solutions
tim_so_ng_to_trong_khoang_cho_truoc.cpp
#include<stdio.h> #include<math.h> int nguyento(int m){ for(int i=2; i<=sqrt(m); i++){ if(m%i==0){ return 0; } } return 1; } int main(){ int a, b, i; scanf("%d%d", &a, &b); i = 2; while(i<=b){ if(nguyento(i) && i>=a){ printf("%d ", i); } i++; } return 0; }
ALGO
0.99987
3.071124
fa7b8498-db02-45a5-9cb2-30ac889d78b3
ArtemAzimov/Course-CPP
lesson12/HW/linear_list.cpp
#include <iostream> class t_list_node { protected: int data; t_list_node* next; public: t_list_node(int data = 0, t_list_node* next = nullptr) : data(data), next(next) { data = data; next = next; } ~t_list_node() {} t_list_node* createNode(int data) { t_list_node* head_node = new...
ALGO
0.99929
3.770084
9979c37d-47b9-4f37-abf6-5835b55d0747
HarryNguyen2023/AVL-Tree
AVLTree.cpp
#include <iostream> #include <vector> #include <string> #include <queue> #include <stack> #include "AVLTree.h" // Function to create the new node in the tree template <typename T> Node<T>* AVL<T>::newNode(T data) { Node<T>* newnode = new Node<T>(); newnode->data = data; newnode->heigth = 1; newnode->le...
ALGO
0.99977
4.584058
2a6ca9cc-b72b-481f-874d-8a26a825d50a
amansingh-gh/CPP-DSA
Recursion/isSorted.cpp
#include <iostream> #include <vector> using namespace std; bool checkSorted(vector<int>&arr, int i, int &n){ if(i==n-1){ return true; } if(arr[i+1]<arr[i]){ return false; } return checkSorted(arr,i+1, n); } int main(){ vector<int>arr{2,6,7,9,12,11}; int i = 0; int n =...
ALGO
0.999828
5.302031
e0996e8e-36ec-4066-9ee9-81cd1842abf2
Huzefahingora/leetcode-GFG
2347-count-nodes-equal-to-average-of-subtree/2347-count-nodes-equal-to-average-of-subtree.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.999846
6.544847
70bd7292-846c-4160-8971-d18af016cbe6
meetmakwana19/my-dsa
L7_Problems/2.cpp
// leetcode 1009 class Solution { public: int bitwiseComplement(int n) { // saving n int m = n; int mask = 0; // edge case if (m == 0) { return 1; } while (m != 0) { // creating mask by left shifting and OR 1 ...
ALGO
0.999972
6.101636
ca53ae84-1236-41df-b93b-159700d9f28a
yakuri354/cp
cf/round871/b.cpp
// #pragma GCC optimize("Ofast") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include "bits/stdc++.h" using namespace std; using ll = long long; using fl = long double; const ll inf = INT32_MAX; ll a[10100]; ll b[10100]; void solve() { ll n, m; cin >> n >> m; ll z = n*m; for (ll i = 0; i < z;...
ALGO
0.999951
4.173783