uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
359d192e-42d6-4f4c-9d2e-9c0fc19da548
SCPJaehyeon/tcp_data_change
cpp/check_checksum.cpp
//Need Modify #include "header/header.h" using namespace std; u_int16_t ip_checksum(u_char *data){ //check ip checksum u_int16_t calc; int sum = 0; int i; data[IPCHECKSUM] = 0; data[IPCHECKSUM+1] = 0; for(i=0;i<20;i=i+2) { calc = ((data[i]<<8) & 0xFF00)+(data[i+1] & 0xFF); s...
TOOL
0.989356
3.916087
297b1f19-6450-40ce-acb9-560132e02eac
fkesh10/Lab2_RBPO
Task1/4funcF4.cpp
module student_1bib21801_Lab2_Variant11_Task4:funcF4; import <cmath>; import :funcA; double RBPO::Lab2::Variant11::Task4::funcF4(double e) { double temp0, temp1; double f4 = 0; int i = 0; do { temp0 = funcA(i); temp1 = funcA(i + 1); f4 += funcA(i); i++; } while (abs(temp0 - temp1) > e); return f4; }
ALGO
0.999741
3.668717
153675d0-40dc-4431-a511-caec0f494b71
assassinlengjing/kd
kd/备份fun/fun/sub_482D44.cpp
#include "sub.h" int sub_482D44(_DWORD* thisx, LPSTR lpString1) { CHAR v4[20]; // [esp+4h] [ebp-24h] BYREF char v5; // [esp+18h] [ebp-10h] int v6; // [esp+1Ch] [ebp-Ch] int v7; // [esp+20h] [ebp-8h] int v8; // [esp+24h] [ebp-4h] if (!*thisx) return 0; v7 = 0; v8 = thisx[2]; ...
TOOL
0.933645
3.004434
2ecc2fbf-2af2-4dfb-8e62-aa197edcca29
shlok-2003/DSA-Notes
17_BinaryTree/Traversal/PreOrderTraversal.cpp
#include <iostream> using namespace std; struct Node{ int data; Node* left; Node* right; Node(int data) { this -> data = data; left = right = NULL; } }; void preOrder(Node* root) { if(root == NULL) return; cout << root -> data << endl; preOrder(root -> left); ...
ALGO
0.999824
4.593223
c76a9c55-5a9e-4434-b1a7-dbb5a8edbd8e
Nikita-mnd/lesson50main
task01/main.cpp
#include <iostream> using namespace std; bool localMin(int matrix[][100], int N, int M, int i, int j); int main() { int n, m; cout << "input size of matrix (n and m): "; cin >> n >> m; int matrix[100][100]; cout << "input elements of matrix:\n"; for (int i = 0; i < n; i++) for (int j = ...
ALGO
0.999942
4.747982
e8818cf9-2797-4c97-a3b3-c6c43faa360b
ishandutta2007/codeforces
nutella3000/normal/1610/D.cpp
#include<bits/stdc++.h> using namespace std; #define pb emplace_back #define pii pair<int, int> #define fi first #define se second #define int long long #define chkmin(a, b) a = min(a, b) #define chkmax(a, b) a = max(a, b) #define size(a) (int)a.size() #define all(a) begin(a), end(a) #define mp make_pair #define ld lo...
ALGO
0.999952
4.420216
69c7dbb5-9c87-4682-b1c9-57bf7965f0b1
DeividKirchev/Olympiad
Horce/Хорце.cpp
#include <iostream> #include <string> using namespace std; int check(const string& s, const int& start) { //cout << start << endl; int length = s.size(); int count = 0; int open = 0; for (int i = start;i < start + length;i++) { if (s[i % length] == ')') { if (open == 0)return 0; open--; } else open+...
ALGO
0.986787
4.062792
149aca9d-d75b-4d67-8838-f2f40b56db8f
kazunetakahashi/atcoder
201510_201609/1225/ARC023_B.cpp
#include <iostream> using namespace std; int T[1010][1010]; int main() { int R, C, D; cin >> R >> C >> D; for (auto i = 0; i < R; i++) { for (auto j = 0; j < C; j++) { cin >> T[i][j]; } } int maxi = -1; int mod = D%2; for (auto i = 0; i < R; i++) { for (auto j = 0; j < C; j++) { ...
ALGO
0.999668
4.416883
74163f85-0e94-484c-83bf-d9554c88b18a
yisea123/3d_printer_old
Marlin/least_squares_fit.cpp
/** * Least Squares Best Fit by Roxy and Ed Williams * * This algorithm is high speed and has a very small code footprint. * Its results are identical to both the Iterative Least-Squares published * earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE * it saves roughly 10K of program memory. I...
ALGO
0.998752
5.259576
d7ea80ac-bfa4-42da-93b4-d3232c6cd5cf
arpu-nagar/Coding
codeforces/1419/A.cpp
// author: arpunagar #include <bits/stdc++.h> using namespace std; using ll = long long int; typedef pair<int, int> pi; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<string> vs; #define inv(v) \ for (auto &it : v) \ cin >> it; #define MOD 1000000007 #define pb push_back #define pop...
ALGO
0.999951
4.201362
e097b4c9-a62b-4595-91d3-a9bc43292742
asepdwisaputra/MPL-Flutter-SWU
Jobsheet-6/refresh_name/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.998514
6.76073
1540ebe8-9994-451c-8fcf-171c31f20f02
alps-jbnu/24ALPStudy
2024-2/Basic/zmfltmvl/Array/10808.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string a; cin >> a; int arr[26] = {0, }; for (int i = 0; i < a.length(); i++) { int b = a[i] - 97; arr[b]++; } for (int i = 0; i < 26; i++) { cout << arr[i] << " "; } retu...
ALGO
0.999749
4.074491
3853e232-3407-4edd-bdb8-9bc48e6d0f8c
Alimurrazi/Programming
beginner_level_and_uva/uva-longest paths-10000.cpp
#include<stdio.h> #include<string.h> #include<vector> #include<queue> using namespace std; vector<int>edge[101],cost[101]; const int infinity=1000000; int bfs(int m,int n) { int d[100],i,j,ucost,vcost,u,v,maxx; for(i=1;i<=m;i++) d[i]=0; queue<int>q; q.push(n); //d[n]=infinity; maxx=0; while(!q.empty(...
ALGO
0.999808
3.562609
8b3e4765-60eb-445d-86bc-2d0c4e228096
Bhawna751/LeetCode-Solutions
2160-minimum-operations-to-make-a-uni-value-grid/minimum-operations-to-make-a-uni-value-grid.cpp
class Solution { public: int minOperations(vector<vector<int>>& grid, int x) { vector<int>nums; int ans=0; for(int i=0;i<grid.size();i++){ for(int j=0;j<grid[0].size();j++){ if(grid[i][j] % x != grid[0][0] % x) return -1; nums.push_back(grid[i][j])...
ALGO
0.999976
5.566258
b7ddc334-eb3f-438d-b522-56f49d260cf2
xushengyuan/xushengyuan-OI-codes
OI/luogu/P1176.cpp
#include <bits/stdc++.h> #define MAXN 1010 #define MOD 100003 using namespace std; bool ma[MAXN][MAXN]={false}; int n,m; int read_int() { int result=0; char t; t=getchar(); while(!isdigit(t)) t=getchar(); while(isdigit(t)) { result=result*10+t-'0'; t=getchar(); } ...
ALGO
0.999986
4.149224
32e80b22-bca9-4c8c-b2dd-e6637f2a0806
IceServal/games101-homework-framework
eigen3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { MatrixXf mat(2,4); mat << 1, 2, 6, 9, 3, 1, 7, 2; MatrixXf::Index maxIndex; float maxNorm = mat.colwise().sum().maxCoeff(&maxIndex); std::cout << "Maximum sum at position " << maxIndex << std:...
ALGO
0.99992
4.220459
53028ab0-80d4-430e-9d9c-f8b3a409b645
zapsleep/hanoi
model/main.cpp
#include <iostream> #include "axis.h" #include <stdlib.h> #include <malloc.h> #include <math.h> #define MINDISK 2 using namespace std; int inputCheck(int, char**); void hanoySolve(int); int canMoveOdd(Axis **, int); int main(int argc, char** argv) { int N = inputCheck(argc, argv); if (N>1) hanoySolve(N); retur...
ALGO
0.99897
4.571473
12a4dd73-bdd2-4c15-a000-7c9c5f61b640
New-bottle/training
2016summer/160806/I.cpp
#include<cstdio> #include<cstring> #include<cstdlib> #include<iostream> #include<algorithm> using namespace std; const int INF = 1e9; const int N = 210; int to[N << 1], nxt[N << 1], head[N], cnt; void add(int x, int y){ to[++ cnt] = y; nxt[cnt] = head[x]; head[x] = cnt; to[++ cnt] = x; nxt[cnt] = head[y]; head[y] = ...
ALGO
0.999917
3.853302
1757bcbe-8820-48e4-8022-782ce32b9842
pingjuiliao/mlir-playground
llvm-project/llvm/lib/IR/ReplaceConstant.cpp
#include "llvm/IR/ReplaceConstant.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/ValueMap.h" namespace llvm { void convertConstantExprsToInstructions(Instruction *I, ConstantExpr *CE, SmallPtrSetImpl<Instr...
TOOL
0.983349
7.875496
5d892299-e2c2-4e70-9e8c-14dc7014466a
ishandutta2007/codeforces
sonechko/normal/342/E.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define ff first #define ss second #define pb push_back #define mp make_pair const int N = 2e5 + 11; vector<int> v[N]; int use[N],sz[N],mx[N],deep[N]; int dist[20][N],pr[20][N]; int min_dist[N]; vector<int> prr[N],distt[N]; vector<int> vv; void dfs1(...
ALGO
0.999988
4.441276
717c680f-9bb2-47de-a825-3e1cd638e587
technoayan7/CodeNotes
Eventual Safe States - GFG/eventual-safe-states.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: bool detectCycle(int vertex,vector<int> adj[],vector<bool>&vis,vector<bool>&order,vector<int>&ans){ order[vertex]=true; ...
ALGO
0.999969
6.458912
31553394-24c1-44e7-8a19-8c4569775b52
mejibyte/brazil_problems
during_the_camp/03-02/remoteland/remote.cpp
using namespace std; #include <algorithm> #include <iostream> #include <iterator> #include <numeric> #include <sstream> #include <fstream> #include <cassert> #include <climits> #include <cstdlib> #include <cstring> #include <string> #include <cstdio> #include <vector> #include <cmath> #include <queue> #include <deque> ...
ALGO
0.998788
3.489223
a4b5be0e-5314-4b7f-926b-102a92d7e42b
nhat117/Software-Engineering-Design
absolute/pizza.cpp
// Determine which is the best size to order a pizza #include <iostream> using namespace std; //Function declaration void getdata(int *small_d, double *price_s, int *large_d, double *price_l); void giveres(int small_d, double price_s, int large_d, double price_l); double unit_price(int diameter, double price); /* Retu...
ALGO
0.974106
5.307672
895558c7-bca7-471e-a42c-99106d4fb654
minblock/picscoin
src/common/init.cpp
#include <chainparams.h> #include <common/args.h> #include <common/init.h> #include <logging.h> #include <tinyformat.h> #include <util/fs.h> #include <util/translation.h> #include <algorithm> #include <exception> #include <optional> namespace common { std::optional<ConfigError> InitConfig(ArgsManager& args, SettingsA...
CONFIG
0.971777
7.419991
11a6f16e-1e3f-400c-bbad-3d101aaa5362
prathmesh-gavande/leetcode
0268-missing-number/0268-missing-number.cpp
class Solution { public: int missingNumber(vector<int>& nums) { int sum=0; int n=nums.size(); for (int i=0;i<n;i++){ sum=sum+nums[i]; } int totalsum=(n*(n+1))/2; return totalsum-sum; } };
ALGO
0.99986
5.798887
1ced3d5e-d666-4428-bd5b-bed9ddae9389
YevhenHordiichuk-itstep/ITStep_Lesson_2
homework_2_01_1.cpp
//альтернативная версия без switch #include <iostream> char registr(int literal) { if (literal >= 65 && literal <= 90) { literal += 32; return literal; } else if (literal >= 97 && literal <= 122) { literal -= 32; return literal; } else { std::cout << "waiting letter! exit \"0\""; return ...
ALGO
0.924968
3.774328
2c35e398-ed7a-47ba-9ee9-2eb7aff22ab4
YousefMansy/Problem_Solving
ACM-ICPC_Live_Archive/Regionals_2013/ACPC_2013/6754_The_Alphabet_Sticker/main.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int t; cin >> t; while (t--) { string s; cin >> s; long long res = 1; while (s[0] == '?') { s = s.substr(1, s.length()); ...
ALGO
0.99994
4.518735
84f0d949-16f5-4e9a-9b52-af3c3f4beba5
ThunderCrestt/IA2
IA2/IA2/Main.cpp
#include <iostream> #include <algorithm> #include <map> #include <vector> #include <deque> #include "Constraint.h" #include "Variable.h" #include "Sudoku.h" #include <time.h> #include <cstdlib> #include <locale> bool AC3(); void AddConstraint(Constraint* newConstraint); void AssignValue(Variable* variable, int value, ...
ALGO
0.998505
3.320254
ae64c3d4-e06b-4da1-b7b6-54b97fedf981
jlanga/smsk_selection
src/phyx-1.01/src/seq_utils.cpp
#include <string> #include <vector> #include <map> #include <assert.h> #include <iostream> #include <algorithm> using namespace std; #include "seq_utils.h" #include "sequence.h" #include "utils.h" // IUPAC codes string dnachars = "ACGTURYSWKMBDHVN"; string protchars = "ABCDEFGHIKLMNPQRSTVWXYZ"; /** * IUPAC ambig...
ALGO
0.971234
5.216397
e3dc4e0d-720b-4e72-9864-ae90f5dab479
ShivaniPathak10/-6companies30days
Phone-directory.cpp
class Solution{ public: vector<vector<string>> displayContacts(int n, string contact[], string s) { // code here sort(contact.begin(), contact.end()); contact.erase(unique(contact.begin(), contact.end()), contact.end()); vector<vector<string>> result; string prefix =""; ...
ALGO
0.999734
4.995148
bd014520-b86b-49c0-b946-d76fa0010b90
lansen31/learngit
C-Plus-Plus/greedy_algorithms/huffman.cpp
// C++ program for Huffman Coding #include <iostream> #include <queue> using namespace std; // A Huffman tree node struct MinHeapNode { // One of the input characters char data; // Frequency of the character unsigned freq; // Left and right child MinHeapNode *left, *right; MinHeapNode(ch...
ALGO
0.999995
5.823737
0b4bb881-a912-445a-8afd-568dbc05c1b2
jokteur/QuickTex
src/latex/editor.cpp
#include "editor.h" #include "microtex/lib/core/formula.h" #include "microtex/lib/core/parser.h" #include <algorithm> #define IMGUI_DEFINE_MATH_OPERATORS #include "imgui_internal.h" #define MAX(X,Y) ((X > Y) ? X : Y) #define MIN(X,Y) ((X < Y) ? X : Y) bool is_alpha(char c) { return (c >= 'a' && c <= 'z') || (c ...
TOOL
0.884213
6.744108
996042fc-6143-4020-864f-01e1f6bec4b5
ChiyoYuki/xcpc
cf/2070/F_Friends_and_Pizza.cpp
/** * author: ChiyoYuki **/ #define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define st first #define nd second #define elif else if using i1 = signed char; using i2 = signed short int; using i4 = signed int; using i8 = signed long long int; using u1 = uns...
ALGO
0.999404
3.807345
b72dd20c-923d-42c5-85c1-b063bc21aa1a
szymmirr/PSiO
2012/choinka.cpp
#include <iostream> using namespace std; int main() { float i, j; for( i=0 ; i<5 ; i++ ) { cout << endl; for( j=0 ; j<=i ; j++ ) cout << "*" ; } return 0; }
ALGO
0.99964
3.015214
28704184-4ec0-4ef0-bdc6-f407dc87b8f4
RMohit927/Competitive_Coding
Hiring/Relevel test 4.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; int ar[200001]; vector<int> dp; int tfs(int i, int n, int m, int s,vector<int> takens){ if(i>=n) return 0; if(dp[i] != -1) return dp[i]; vector<int> x(takens.begin(),takens.end()); int k = s; if(x.size()>m) k-=x[0]; x.erase(x.be...
ALGO
0.99992
4.409513
f9da3de2-af74-43b3-b552-b8a4f2b96282
jma02/cpp-compprog
codeforces/7-28-2022-to-9-05-2022/upsolving/100easy/p08.cpp
#include <bits/stdc++.h> using namespace std; void solve(){ long long n, L, a; cin >> n >> L >> a; long long ans = 0; vector<long long> cus(n); vector<long long> serve(n); for(int i = 0; i < n; i++){ long long t, l; cin >> t >> l; cus[i] = t; serve[i] = l; } long long prev = ...
ALGO
0.999789
3.438165
34612828-4cfc-4e6f-ace7-f3cc30798867
krllrn/cpp-search-server
search-server/string_processing.cpp
#include "string_processing.h" std::vector<std::string> SplitIntoWords(const std::string& text) { std::vector<std::string> words; std::string word; for (const char c : text) { if (c == ' ') { if (!word.empty()) { words.push_back(word); word.clear(); ...
ALGO
0.955042
4.229372
72762a0c-6eaa-4108-8fd7-fe0a5d9105e9
woobba94/algorithm
Project_codingTest/baekjoon_step_8_04.cpp
//#include <iostream> //#include <vector> //using namespace std; // //void func(int n, int m, vector <int> vec, int cnt, int newNum); //int main() //{ // ios_base::sync_with_stdio(0); // cin.tie(0); // // int n, m; // vector <int> vec(9, 0); // // cin >> n >> m; // // func(n, m, vec, 0, 1); // //} //...
ALGO
0.999964
4.086208
70ecd259-2a47-4c52-b607-1dd88c6b170a
kunyavskiy/competitive-programming-archive
SnarkNewsSeries/SNWS/2011/round3/quest.cpp
#include <iostream> #include <fstream> #include <vector> #include <set> #include <map> #include <string> #include <queue> #include <deque> #include <stack> #include <algorithm> #include <memory.h> #include <cstdio> #include <cstdlib> #include <cmath> #include <iterator> #define mp make_pair #define pb push_back #ifde...
ALGO
0.999083
3.845932
0e00b8bc-608e-4282-93d7-ce7148d5ab51
ishandutta2007/codeforces
froggyzhang/normal/1252/B.cpp
#include<bits/stdc++.h> using namespace std; #define N 1000100 typedef long long ll; const int mod=1e9+7; inline ll read(){ ll x=0,f=1; char c=getchar(); while(c<'0'||c>'9'){ if(c=='-')f=-1; c=getchar(); } while(c>='0'&&c<='9'){ x=(x<<1)+(x<<3)+c-'0'; c=getchar(); } return x*f; } int n,tot,c[N],dp[N],sum...
ALGO
0.999995
4.182673
9034a443-ef71-42e8-bb0e-1e9ee86f527e
mdzaif/CPP_Practice
compiler/lab_final_4.cpp
#include<iostream> #include <fstream> #include <string> #include <regex> #include <unordered_set> #include <stdio.h> #include<cstring> using namespace std; int main() { FILE *inputFile = fopen("inp.txt", "r"); FILE *outputFile = fopen("out.txt", "w"); if (inputFile == NULL || outputFile == NULL) { ...
TOOL
0.979108
3.832811
d4b0075c-1a04-4149-ba34-ba2a100746d4
alpet83/Xray-NLC7
3rd party/boost/libs/graph/example/vertex-name-property.cpp
using namespace boost; template < typename Graph, typename VertexNamePropertyMap > void read_graph_file(std::istream & graph_in, std::istream & name_in, Graph & g, VertexNamePropertyMap name_map) { typedef typename graph_traits < Graph >::vertices_size_type size_type; size_type n_vertices; typena...
ALGO
0.941824
5.654165
30010751-b786-4f56-aa96-1645d0d19d8b
gavin971/CPP_Learning
Cpp-Primer/ch11/ex11_11.cpp
// // ex11_11.cpp // Exercise 11.11 // // Created by pezy on 12/15/14. // Refactored by Yue Wang Oct,2015 // // Redefine bookstore without using decltype. // #include "../ch07/ex7_26.h" #include <set> auto less(Sales_data const& lhs, Sales_data const& rhs) { return lhs.isbn() < rhs.isbn(); } int main() { ...
TOOL
0.888175
4.384675
1a6ca668-bdc5-4a2d-ac47-4a6cd3506dc8
DarkKat-Rom/android_frameworks_av
media/libstagefright/codecs/m4v_h263/dec/src/post_proc_semaphore.cpp
/* ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS Inputs: q_block = pointer to buffer of inverse quantized DCT coefficients of type int for intra-VOP mode or buffer of residual data of type int for inter-VOP mode Local Sto...
ALGO
0.993392
7.19238
ee7e951f-aaed-487b-98ce-feec0da18535
Ayush-Kumar07/cpp-DSA
004_maximumArray.cpp
#include <iostream> using namespace std; int main() { int a[5] = {1, 3, 5, 7, 9}; int mx = a[0]; for (int i = 0; i < 5; i++) { if (a[i] > mx) { mx = a[i]; } } cout << "The maximum number is " << mx; }
ALGO
0.998801
3.751967
83c9d36a-5235-4ca6-9ef8-569177bfd579
PRANAVJARANDE/CodeForces
K - King's Tas .cpp
#include <bits/stdc++.h> using namespace std; #define MOD (int)(1e9 + 7) #define ll long long bool check(vector<ll>&a) { ll n=a.size(); for(int i=0;i<n-1;i++) { if(a[i]>a[i+1]) { return 0; } } return 1; } void swap1(vector<ll>&a) { ll n=a.size(); ll hf=...
ALGO
0.999987
3.802929
5545c66b-73aa-4b22-9935-42658ddbdd23
jorgebandeo/Algoritmos-e-Programacao-2
Jogos/BingoGame/main.cpp
// // @file bingoGame.cpp // @brief Trabalho da diciplina Algoritimos e Programao II ministrada pelo Professor Rafael Ballottin Martins. // // @author Jorge Bandeo // @author Luiz Gustavo Kleis Platt // @date September 2020 // #include <iostream> // Biblioteca de stream para input e output. #include ...
ALGO
0.989434
3.796375
be03ae33-fcc7-43d2-a67c-c8732a6125d8
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_6360_17.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 5; int n; long long a, b, c, d; char u[MAXN], v[MAXN]; int main() { scanf("%d", &n); scanf("%s", &u); scanf("%s", &v); for (int i = 0; i < n; i++) { if (u[i] == '0') { if (v[i] == '0') a++; else b++; } else ...
ALGO
0.999908
4.139005
4502ea75-0382-4dca-a98b-7bc50cf1bc36
scanno/android_frameworks_av_shuttle
media/libstagefright/codecs/mp3dec/src/pvmp3_imdct_synth.cpp
/* ------------------------------------------------------------------------------ PacketVideo Corp. MP3 Decoder Library Filename: pvmp3_imdct_synth.cpp Date: 09/21/2007 ------------------------------------------------------------------------------ REVISION HISTORY Description: --------------------...
ALGO
0.999746
4.159706
901be78f-5846-46b0-9147-8c50141e4ed2
MariaAkterKhadiza/codeForce
c++ for DSA/Mid_Exam/Sort_It_2.cpp
#include<bits/stdc++.h> using namespace std; int* sort_it( int n){ int* arr = new int[n]; for( int i=0;i<n;i++){ cin>>arr[i]; } sort(arr,arr+n); return arr; } int main(){ int n; cin>>n; int *arr = sort_it(n); for(int i=n-1;i>=0;i--){ cout<<arr[i]<<" "; } ...
ALGO
0.999864
4.312476
e25662df-633c-44f2-8aad-b96637668d8b
dush1729/cp
submission/cses/sorting_and_searching/stick_lengths.cpp
#include "bits/stdc++.h" using namespace std; const int N=2e5+20; int n,a[N]; long long ans; int main() { scanf("%d",&n); for(int i=0;i<n;i++) scanf("%d",&a[i]); sort(a,a+n); for(int i=0;i<n;i++) ans+=abs(a[i]-a[n/2]); printf("%lld",ans); }
ALGO
0.999483
4.041913
f732e25c-7fc6-417a-b141-a16631cb0879
risal-shefin/Competitive-Programming
CodeForces/Solutions/1277B.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define dd double #define ld long double #define sl(n) scanf("%lld", &n) #define si(n) scanf("%d", &n) #define sd(n) scanf("%lf", &n) #define pll pair <ll, ll> #define pii pair <int, int> #define mp make_pair #define pb ...
ALGO
0.999661
4.510191
321b0a65-c11a-47f9-9b34-fa8560e20e9d
oskarc35zut/GrafikaKomputerowa
lab3/GKiW_Lab3/examples/InverseKinematics/InverseKinematicsExample.cpp
#include "InverseKinematicsExample.h" #include "../CommonInterfaces/CommonGraphicsAppInterface.h" #include "Bullet3Common/b3Quaternion.h" #include "Bullet3Common/b3Transform.h" #include "Bullet3Common/b3AlignedObjectArray.h" #include "../CommonInterfaces/CommonRenderInterface.h" #include "../CommonInterfaces/CommonExa...
ALGO
0.884431
5.088428
76db0f04-355c-4912-8106-e2307b1b5567
mandalsudipti/competitive_programming
codeforces/Petya and inequiation.cpp
#include<bits/stdc++.h> using namespace std; int main() { long long int n , x , y ; cin>>n>>x>>y; if(y<n) { cout<<"-1"; return 0; } long long int sum=n-1ll+(y-n+1ll)*(y-n+1ll); if(sum<x) cout<<"-1"; else { cout<<(y-n+1ll)<<endl; for(int i=0;i<...
ALGO
0.999965
3.376575
749357dd-6734-4ead-a238-87e1bbf23a41
OmarFaruq947/C-Plus-Plus
DSA-With-C++/doubly linkedlist/Doubly_linked_list_libarary/reverce_singly.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: int value; Node *next; Node(int value) { this->value = value; this->next = NULL; } }; void print_recursion(Node *head) { // base if (head == NULL) { return; } cout << head->value << " "; ...
ALGO
0.999752
4.90367
5ee6df6b-89e1-44ba-8e04-2dd47f2f04e6
VijayNandakumarkumar/CodingPractise
devc_v2/Google/universal_value_tree.cpp
/* 965. Univalued Binary Tree A binary tree is univalued if every node in the tree has the same value. Return true if and only if the given tree is univalued. Example 1: Input: [1,1,1,1,1,null,1] Output: true */ #include<bits/stdc++.h> using namespace std; struct node{ int key; struct node* left, *right; }; ...
ALGO
0.999971
5.93245
c0b539e3-43a1-45c2-86d9-e9660942794b
tristan/project-euler-code
0002.cpp
#include <vector> #include <functional> #include <iostream> void fn0() { int sum = 0; for (int a = 1, b = 2; b <= 4000000;) { if (b % 2 == 0) { sum += b; } int t = a; a = b; b = t+b; } std::cout << sum << std::endl; } std::vector<std::function<void()>> progs = { fn0 };
ALGO
0.999813
4.764657
e1911fb6-6f1f-413a-97a9-81ca6eeafc0d
UtileBread32046/Personal-Practice-Projects
VSCode/Luogu/B2071.cpp
#include <iostream> using namespace std; int main() { int a, b, c = 0; int x = 2; cin >> a >> b >> c; for (;;) { if (a%x != b%x) x++; else { if (b%x != c%x) x++; else break; } } cout << x; return 0; }
ALGO
0.999905
3.827429
eeb79083-6ca5-4a38-9c17-066914c95eaf
Shreyanigam129/cpp_new
C++/lab_5_6.cpp
#include<iostream> using namespace std; class Sortable{ public: virtual void Sort_Area()=0; }; class Compare:public Sortable{ public: void Sort_Area(float rec,float cir,float tr){ int arr[3],i=0; if(rec>cir){ if(rec>tr){ arr[i]=rec; cout<<"Rectangle area is greatest \n"; i++; } else{ ...
ALGO
0.999062
3.619297
9d4e3d1a-5902-4cb0-86a9-387372f08253
svn2github/3d-editor-toolkit
bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp
#include "btMinkowskiPenetrationDepthSolver.h" #include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h" #include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h" #include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h" #include "BulletCollision/CollisionShapes/btConvexShape.h" ...
ALGO
0.999645
5.929208
b723b66e-a0bf-4713-9bf0-b6ae1c6cc6d5
makio93/competitive-othersites
LeetCode/Contest/WC/250/Q1/main.cpp
#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)) #define all(x) ...
ALGO
0.998021
4.650098
5deeb609-87ec-431f-9ba0-76e4cc96d687
ank809/Cpp-Codebase
OOPS/Concat_2_Strings.cpp
#include<iostream> using namespace std; class S{ public: string s; S(){} S(string str){ s=str; } S operator +( S str){ S name; name= s+str.s; return name; } }; int main(){ S s1("Ankita "); S s2("Thakur"); S s3; s3=s1+s2; cout<<s3.s; }
TOOL
0.987835
3.690747
48d5998d-89fe-4456-b247-a6ef6069edc9
JhonAQ/competitive-programming
codeforces/learn-language/loops/P_Shape_1.cpp
#include <bits/stdc++.h> using namespace std; string makeRow(int x) { string rpta = ""; for (int i = 0; i < x; ++i) { rpta += "*"; } return rpta; } int main() { int x; cin >> x; for (int i = x; i > 0; --i) { cout << makeRow(i) << endl; } return 0; }
ALGO
0.999872
4.301784
49012a16-5d71-446c-8a61-b6cfc2b41dd7
yelaman1206/lab4
lab4(8).app.cpp
#include<iostream> using namespace std; int main(){ double a,b; cin>>a>>b; if (a==0 && b!=0) cout<<"no"; else if (a==0 && b==0) cout<<"INF"; else cout<<" "<<-b/a; return 0; }
ALGO
0.999705
3.570687
29134305-aac8-43c9-8595-76dc1de9d8d6
mainul3195/All
2/A_-_A.cpp
#include <bits/stdc++.h> using namespace std; #define int long long int n, m; vector<vector<int>> price; vector<int> cash; vector<int> items; void solve() { cin >> n >> m; items = vector<int>(m); price = vector<vector<int>>(n); cash = vector<int>(n); for (int i = 0; i < n; i++) { int k; ...
ALGO
0.999852
3.82534
3ad8984d-6061-4db4-82a3-8d7ebe31955f
eBay-USC/MMFDB
foundationdb-7.1.41/fdbserver/ResolutionBalancer.actor.cpp
#include "fdbserver/ResolutionBalancer.actor.h" #include "fdbclient/KeyRangeMap.h" #include "fdbserver/MasterInterface.h" #include "fdbserver/Knobs.h" #include "flow/flow.h" #include "flow/actorcompiler.h" // This must be the last #include. void ResolutionBalancer::setResolvers(const std::vector<ResolverInterface>& ...
ALGO
0.979714
5.91875
91ef9098-d575-4da4-be99-0ccb1d60c7af
lwcM/leetcode_solution
0150-evaluate-reverse-polish-notation.cpp
class Solution { public: int evalRPN(vector<string>& tokens) { vector <int> stk; for(auto s:tokens) { if(s == "+") stk[stk.size()-2] += stk[stk.size()-1]; else if(s == "-") stk[stk.size()-2] -= stk[stk.size()-1]; else if(s == "*") stk[stk.size()-2] *= stk[stk.size...
ALGO
0.999873
6.100195
a155d16c-26bd-4b7c-bc7b-04789aa6a5a1
tobik05/Szkola
Informatyka/07.04/main.cpp
#include <iostream> #include <fstream> using namespace std; int main(){ int liczba; cin>>liczba; string bin; while (liczba>0){ if(liczba%2==0){ bin="0"+bin; }else{ bin="1"+bin; } liczba=liczba/2; } cout<<bin; }
ALGO
0.999972
4.358315
fecee66a-b645-4316-8500-3b395e946243
zty111/OI
zty-Contest/zty-Exercise/luogu/P1081/drive.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<set> #include<cmath> #include<cstdlib> using namespace std; const int u=100010; long long a[u][18][2],b[u][18][2],ansA,ansB,A,B; int f[u][18][2],ans,n,m,t,i,j,k,h[u],g[u],go[u][2],x0,l,x,y; struct rec{int x,y;}; set<rec> s; set<rec>::ite...
ALGO
0.999919
3.658501
507868f7-a252-4c43-ad4f-4d4fcb461048
jamesfang87/Silver
Two Pointers/Quiz Master/main.cpp
#include <iostream> #include <algorithm> #include <vector> #include <unordered_map> using namespace std; int solve() { int n, m; cin >> n >> m; vector<int> smartness(n), team; for (int i = 0; i < n; i++) { cin >> smartness[i]; } sort(smartness.begin(), smartness.end()); // minimize the...
ALGO
0.999969
5.30999
97247240-58ce-41f8-a010-7a826c2a667d
drmeister/legacy-externals-clasp
boost/libs/graph/example/neighbor_bfs.cpp
#include <boost/config.hpp> #include <algorithm> #include <vector> #include <utility> #include <iostream> #include <boost/graph/visitors.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/graph_utility.hpp> #include <boost/graph/neighbor_bfs.hpp> #include <boost/property_map/property_map.hpp> /* ...
ALGO
0.999908
6.000605
f15d367e-912d-43ea-bcf1-070f2ed24c4a
maria2021831011/codefilecpp
is there is a second way left.cpp
#include<bits/stdc++.h> using namespace std; struct Edge { int x, y, v, enable; }; vector<Edge> E; vector<int> P, R; bool cmp(const Edge &a, const Edge &b) { return a.v < b.v; } void init(int n) { P.resize(n+1); R.resize(n+1); for(int i = 0; i <= n; i++) { P[i] = i; R[i] = 1; ...
ALGO
0.999893
4.780728
be32e566-c2db-41ec-8598-1543e83d18ad
GlacialLake/algorithms_of_competitive_programming
lowest-common-ancestor.cpp
#include <vector> #include <cmath> struct lca { /* the index starts from 0 */ /* USAGE: lca tree(n) tree.add(a, b) tree.preproc() tree.query(a, b) */ std::vector<std::vector<int> > tree, st; std::vector<int> depth, dfo, dfo_ly, fapr_pos; lca(int n) { tree.resize(n); depth.resize(n); fapr_pos.res...
ALGO
0.999895
4.295326
f7c885d2-fc32-4128-a648-b413d3d4e60e
neharvard/CodeForces
Codes/1914 D. Three Activities.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; #define ll long long #define fastt ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define sp " " #define pb push_back #define all(x) x.begin(),x.end() #define ff first #define ss second #define nl "\n" void solve() { ll n; cin>>n; vector<...
ALGO
0.999942
4.526662
601a97e2-4555-4174-ac71-6eee9490a30d
ishandutta2007/codeforces
zlobober/normal/67/A.cpp
#include <iostream> #include <vector> #include <cstdio> using namespace std; //#define TASK "" int main(int argc, char **argv) { #ifdef TASK freopen(TASK".in", "r", stdin); freopen(TASK".out", "w", stdout); #endif int n; cin >> n; vector<int> v; v.resize(n, 1); string S; cin >> S; bool f = 0; while(1) { ...
ALGO
0.999978
3.021528
79c302c9-3992-444b-859a-2b16a632d4c6
nabaraj-malla/DSA-in-Cpp
trees/next-larger.cpp
// Problem statement // Given a generic tree and an integer n. Find and return the node with next larger element in the tree i.e. find a node with value just greater than n. // Note: Return NULL if no node is present with the value greater than n. #include <iostream> #include <queue> #include <vector> using namespace ...
ALGO
0.999991
4.822671
1d8be1c5-af79-435b-a445-3c6d06259b37
compilerai/counter
llvm-project/llvm/lib/Support/SpecialCaseList.cpp
#include "llvm/Support/SpecialCaseList.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Regex.h" #include "llvm/Support/VirtualFileSystem.h" #include <string> #include <system_error> #include <utility> #include <stdio.h> namespace llv...
TOOL
0.950422
7.330246
34035e44-5d1b-4c49-9864-31b624c44d90
cecyours/Lectures
C_language_9099/TC/EXAMPLES/LIST2.CPP
// list.cpp: Implementation of the List Class #include <iostream.h> #include "list2.h" int List::put_elem(int elem, int pos) { if (0 <= pos && pos < nmax) { list[pos] = elem; return 0; } else return -1; // non-zero means error } int List::get_elem(int& elem, int pos) { if (0...
TOOL
0.867184
4.196568
7f31c6a0-4b84-4d5b-8979-09ea25b9180b
ZEELRAJPUT2006/module-3
practical/factorial.cpp
#include<iostream> using namespace std; int fact(int n) { int fac; if(n==1) { return 1; } else { fac = n*fact(n-1); return fac; } } main() { cout<<"factorial is"<<fact(6); }
ALGO
0.999359
3.539024
b8d3438d-aa8e-47b2-9afd-27d840328924
zois-tasoulas/LearnCpp
chapterF/question71603/main.cpp
#include <algorithm> #include <ctime> #include <iostream> #include <random> #include <tuple> #include <vector> #include <utility> constexpr int answerThreshold {4}; int square (int num) { return num * num; } std::pair<int,int> readInput (void) { std::cout << "Enter a positive integer to start from? "; in...
ALGO
0.99157
4.393026
63d53015-1def-44cc-9b54-5adc41d4c354
ComKinBio/biomassChemistryMBMFoam
biomassCombustion/eigen-3.4.0/bench/geometry.cpp
#include <iostream> #include <Eigen/Geometry> #include <bench/BenchTimer.h> using namespace std; using namespace Eigen; #ifndef SCALAR #define SCALAR float #endif #ifndef SIZE #define SIZE 8 #endif typedef SCALAR Scalar; typedef NumTraits<Scalar>::Real RealScalar; typedef Matrix<RealScalar,Dynamic,Dynamic> A; type...
ALGO
0.921876
5.941502
f83ca2eb-9093-43cd-ad25-017b93e9f98f
GulSauce/codetree-TILs
240307/X 달리기/x-run.cpp
#include <iostream> using namespace std; int main() { int X; cin >> X; if(X <= 2){ cout << X; return 0; } for(int t = 1; t <= X; t++){ int area = 1*t + t*t/4; if(t % 2 == 1){ continue; } if(area == X){ cout << t; ...
ALGO
0.99982
3.59252
3a54b4e7-c2c8-4389-9102-a0e933dc0f43
27-aditya/LeetSols
0329-longest-increasing-path-in-a-matrix/0329-longest-increasing-path-in-a-matrix.cpp
class Solution { public: int longestIncreasingPath(vector<vector<int>>& matrix) { int row = matrix.size(); int col = matrix[0].size(); int result = 0; vector<vector<int>>dp(row, vector<int>(col, -1)); for(int i = 0; i < row; i++){ for(int j =0 ; j < col; j++){ ...
ALGO
0.99999
6.174068
e3d0846e-1114-49d6-bd4f-d87d85dedc23
khaledman6122/codeforces-A-B
A. Dubstep 2.cpp
// http://codeforces.com/problemset/problem/208/A // #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std ; int main () { string word ; cin>>word ; for(int i=0;i<word.length();i++) { if(word[i]=='W'&&word[i+1]=='U'&&word[i+2]=='B') { word[i]='*'; word[i+1]='*'...
ALGO
0.99995
3.396003
f45d45f3-a3b6-4b10-b66a-61e634515230
Abhinav-Chdhary/strivers-sde-sheet-challenge-2023
BinaryTree2/LCAbinaryTree.cpp
#include <iostream> // TreeNode class definition (assuming it's already defined) template <typename T> class TreeNode { public: T data; TreeNode<T> *left; TreeNode<T> *right; TreeNode(T val) : data(val), left(nullptr), right(nullptr) {} }; // Function to find the common ancestor of two nodes in a bin...
ALGO
0.999983
7.66968
cbdd3c11-ef12-4008-ac0b-69c26e37d91b
RyzOS-Project/frameworks_av
media/module/codecs/amrnb/common/src/gmed_n.cpp
/* Pathname: ./audio/gsm-amr/c/src/gmed_n.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Put file into template and first pass at optimization. Description: Made changes based on comments from the review meeting. Used pointers instead of index a...
ALGO
0.999989
6.599185
849c8d68-87ec-4c00-9578-d3cbc1eb675d
gab-borges/codeforces
problems/2114A.cpp
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> ii; typedef long long ll; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while (t--) { string s; cin >> s; int sum = (s[3]-'0') + 10*(s[2]-'0') + 100*(s[...
ALGO
0.998942
4.237563
c7ae88a0-7be2-4ff5-8c6d-17dbdedb0018
Akshi-Devi/Strivers-A2Z-DSA-Course-Sheet
find_missing_num.cpp
#include<bits/stdc++.h> int missingNum(vector<int>&a,int N){ int ans1=0, ans2=0; int n=N-1; for(int i=0;i<n;i++){ ans1=ans1^(i+1); ans2=ans2^a[i]; } ans1=ans1^N; return ans1^ans2; }
ALGO
0.99987
4.027371
97fc554f-1dfb-4d73-a871-2c39c513269e
MiroTheMighty/ObjectOrientedProgramming
Vježba 10/Zadatak 1.cpp
#include<iostream> #include<fstream> #include<vector> #include<algorithm> #include<iterator> #include<string> bool containsSubstring(const std::string& str, const std::string& substring) { return str.find(substring) != std::string::npos; } void toUpperCase(std::string& str) { std::transform(str.begin(), str.e...
TOOL
0.998321
6.012452
bfc407bf-85ef-448f-92a6-bd926dcd4b8e
JiangWZW/Gitea_Blender_NPR
extern/quadriflow/src/main.cpp
#include "config.hpp" #include "field-math.hpp" #include "optimizer.hpp" #include "parametrizer.hpp" #include <stdlib.h> #ifdef WITH_CUDA #include <cuda_runtime.h> #endif using namespace qflow; Parametrizer field; int main(int argc, char** argv) { setbuf(stdout, NULL); #ifdef WITH_CUDA cudaFree(0); #endif ...
ALGO
0.967588
5.430873
7280d7c4-d6e6-48cb-91b0-a349d0ba3758
JorgeIba/Competitive-Programming-Problems
CodeForces/Grupo - Cuarentena de Entrenamiento/Team Training 08/H.cpp
#include <bits/stdc++.h> #define endl '\n' #define lli long long int #define ld long double #define forn(i,n) for (int i = 0; i < n; i++) #define all(v) v.begin(), v.end() #define fastIO(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define SZ(s) int(s.size()) using namespace std; typedef vector<lli> ...
ALGO
0.999893
4.880909
8705c50a-82c8-427b-81d8-247db13bfc7c
Doublehard/comp322
assignments/my_assignment_solutions/assignment3-comp322-wendy.cpp
// // Created by Wendy Wu on 2022-02-23. // #include <iostream> #include <vector> #include <algorithm> #include <random> using namespace std; enum class Rank{ ACE = 1, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING }; enum class Type{ CLUBS='C', DIAMONDS='D', HEARTS='H', SPADES=...
ALGO
0.977077
7.171667
c6102cac-8316-44e6-8af9-5495514c553e
rn7s2/AutoBus
AutoBus/SCAN.cpp
#include "AutoBus.h" #include <cstdio> // judge if the distance longer than halfway bool AutoBus::less_than_halfway(int from, int to, int direction) { int t = config.total_station; if (direction < 0) { // go counterclockwisely from 'from' to 'to' int h = (config.total_station - 1) / 2; int end_point = ((from - 1...
ALGO
0.99198
4.265097
9a46ad0b-9080-404a-8b67-35bfd65c7583
MadoScientist97/leetcode_solutions
med/82.remove-duplicates-from-sorted-list-ii.cpp
/* * @lc app=leetcode id=82 lang=cpp * * [82] Remove Duplicates from Sorted List II * * https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/description/ * * algorithms * Medium (44.46%) * Total Accepted: 549.3K * Total Submissions: 1.2M * Testcase Example: '[1,2,3,3,4,4,5]' * * Given th...
ALGO
0.999983
6.374703
41a40196-2d10-47ce-ab8b-354e9031cfdc
TheRohitRahul/Algorithms
sorting/bubble_sort.cpp
#include <iostream> #include <vector> using namespace std; int randint(int low, int high){ double rand_num = (double) rand() / (RAND_MAX); int r = int(((rand_num)*(high - low)) + low); return r; } // Procedure for swapping 2 elements void swap(vector<int> &arr, int pos_1, int pos_2){ int temp = ...
ALGO
0.999574
4.831888
6103eb97-6abc-4f89-9ccc-22159a62af54
zrpllvv/ADS-Codeforces
cd_266_B.cpp
//@author: zrpllvv //link: https://codeforces.com/contest/266/problem/B #include <iostream> #include <cmath> #include <string> #include <vector> using namespace std; int main(){ int n, t; cin >> n >> t; vector<char> a(n); for(int i = 0; i < n; i++){ cin >> a[i]; } int count = 0; for(int j = 0; j <...
ALGO
0.999997
3.310605
f108f2b5-ed55-4826-b7ec-0d9db2616735
RensiKaliath1/Hybrid-Visual-Servoing
m3t/examples/constraint_convergence.cpp
#include <m3t/constraint.h> #include <m3t/link.h> #include <m3t/optimizer.h> #include <Eigen/Geometry> Eigen::Vector3f RandomVector(std::uniform_real_distribution<float>* dis, std::mt19937* gen) { float theta_x = acosf((*dis)(*gen)); float theta_z = (*dis)(*gen) * m3t::kPi; return E...
ALGO
0.999519
6.687023
bcfa4cca-87ae-4062-86fb-518a0922a2e7
22a91a05i9/6Companies30days
100-Same-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.999957
6.532715
1717a226-59db-4eb8-8afa-2c5ecdf7bd39
JScoder-git/DSA
Tree/Trim_BinarySearchTree.cpp
/** * Title : Trim a Binary Search Tree * Author : Tridib Samanta **/ #include<bits/stdc++.h> using namespace std; struct Node { int data; Node *left, *right; Node (int value) { data = value; left = right = NULL; } }; Node* insertNode(Node *root, int data) { if (root == ...
ALGO
0.999993
5.884892
24ec6e7f-efd3-4715-b77e-b55651bfe019
turingcompl33t/advent-of-code
2020/day4/harrison_part2.cpp
#include <iostream> #include <fstream> #include <string> #include <regex> #include <vector> #include <cmath> using namespace std; int main(int argc, char* argv[]) { string input(argv[1]); int count = 0; int i; string line; //list of valid values, as expressed in regex - regex101.com helps a lot ...
ALGO
0.964311
5.752634