uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
263b2322-a28e-42ee-9cfe-2f4b8113d637
mabarrera4/UVa-Online-Judge-Solutions
11095.cpp
/* * 11095. Tabriz City * TOPIC: min vertex cover * status: */ #include <algorithm> #include <iostream> #include <cassert> #include <cstdio> #include <cstdlib> #include <cstring> #include <vector> #include <cctype> #define N 31 #define BIT(k) (1ULL << (k)) #define MASK(k) (BIT(k)-1ULL) #define L(u) ((u)&((~(...
ALGO
0.999664
4.45527
e2728a13-338a-4c13-8bd3-261650fccb48
ishandutta2007/codeforces
comet_honeymoon/normal/1491/C.cpp
#include<bits/stdc++.h> typedef long long ll; int n, T; int a[100005], c[100005]; int main() { scanf("%d", &T); while (T--) { scanf("%d", &n); ll ans = 0; for (int i = 1; i <= n; i++) scanf("%d", &a[i]), c[i] = 0; int H = 0; for (int i = 1; i <= n; i++) { H += c[i]; if (H > a[i] - 1) { c[i + 1] ...
ALGO
0.999849
3.873302
9c2f45aa-9e09-4e07-8217-7d7b4e82e5bc
davida330300/108_1_ParallelProgramming
OpenMPI/HW02/0408/0408.cpp
#include "mpi.h" #include "iostream" #include "stdlib.h" #include "math.h" #define upperbound 1000000 bool isPrime(int n); void process(int rank, int size, int max, int *startNum, int *endNum); using namespace std; int main(int argc, char**argv) { int p, id; int n = upperbound; int startNum, endNum; bool currI...
ALGO
0.99966
3.874171
b1632c51-e1b4-4122-a103-acc4aee342d2
NyahStefanche/Uni-Projects-2nd-Year-2nd-Semester
Design and Analysis of Computer Algorithms/Lab_MasiviBr3/main.cpp
#include <iostream> using namespace std; void fill(int* m) { for (int i = 0; i < 10; i++) { m[i] = 0; } } void read(int*m,int n,int*m1) { for (int i = 0; i < n; i++) { cin >> m[i]; while (m[i]) { m1[m[i] % 10]++; m[i] /= 10; } } } void print_min(int*m) { long long int min = 1; for (int i = 0; ...
ALGO
0.999952
3.713371
ba86c136-d7bc-4bdd-9da0-c380de64d9a7
qeedquan/challenges
codewars/pascals-triangle-number-2.cpp
/* Here you will create the classic [Pascal's triangle](https://en.wikipedia.org/wiki/Pascal%27s_triangle). Your function will be passed the depth of the triangle and you code has to return the corresponding pascal triangle up to that depth. The triangle should be returned as a nested array. for example: PascalsTri...
ALGO
0.999581
6.953428
875a1375-6ffa-4d0f-8065-adc2b87c12b4
shubhamnegi9/MyLeetCodeSolutions
2309-maximize-number-of-subsequences-in-a-string/maximize-number-of-subsequences-in-a-string.cpp
class Solution { public: long long maximumSubsequenceCount(string text, string pattern) { // Inserting first character of pattern at start of text string first = pattern[0] + text; // Inserting last character of pattern at end of text string last = text + pattern[1]; ...
ALGO
0.999996
6.626997
1ca4c393-d1f8-4451-bfd1-2a5c0945fe8d
Spedvaz/AC_2024
dia2/dia2parte2.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <sstream> using namespace std; void get_input(vector<vector<int>> &levels) { string input; while (getline(cin, input)) { int num; vector<int> insertar; stringstream entrada(input); while (entrada >> num) { insertar.push_...
ALGO
0.999369
3.974143
f7a02b39-c355-4fa6-8e13-aa113f371729
ishandutta2007/codeforces
feecie6418/normal/1338/C.cpp
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; typedef long long ll; ll n,f[]={0,1,2,3,4,8,12,5,10,15,6,11,13,7,9,14},ff[]={0,2,3,1}; int main() { int T; scanf("%d",&T); while(T--){ scanf("%lld",&n); ll tmp=n; if(n<=15){ printf("%lld\n",f[n]); continue; }...
ALGO
0.999904
3.657924
444d08a5-bf47-465a-8d4f-f65b79ab916f
sufyansafi/web_socket
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
fff4a50a-76f9-4f32-aece-d470d33e3fa4
Tallahasseeee/2_semestr_OP
Lab5/Source.cpp
#include "Header.h" TMatrix::TMatrix() {} //int TMatrix::Sum() { return 0; } int** TMatrix::get_matrix() { return Matrix; } int TMatrix::get_size() { return size; } DoubleMatrix::DoubleMatrix() { size = 2; Matrix = new int* [size]; for (int i = 0; i < size; i++) { Matrix[i] = new int[size]; for (int j = 0; j...
ALGO
0.988784
3.734549
f34078c5-f175-4a41-8b48-4ba7e5a4736e
lechauanh/IT003
mergesort.cpp
#include<iostream> #include<algorithm> #include<time.h> #include<cstdlib> #include<stdio.h> #include<fstream> using namespace std; const int nTest = 10; const int N = 1e6; int n; double a[N]; void mergee(double a[], int left, int mid, int right) { int *temp; int lf = left; int rf = mid + 1; temp = new int[right -...
ALGO
0.996682
3.439147
352a9474-6495-4fa4-9c30-046538f0d994
ada-zqz/leetcode
gd406_QueueReconstructonbyHeight.cpp
class Solution { public: struct comp { bool operator()(const vector<int> & a, const vector<int> & b) { return a[0] > b[0] || (a[0] == b[0] && a[1] < b[1]); // 高度大的排在前面,高度相等的,k小的排在前面 } }; vector<vector<int>> reconstructQueue(vector<vector<int>>& people) { ...
ALGO
0.999997
5.919579
b87f5aae-a615-4d4c-b573-bfdb3d0ff7bc
Mark-1707/TeachMeDSA
Merge Intervals/Solution1.cpp
// https://leetcode.com/problems/merge-intervals/description/ #include<bits/stdc++.h> using namespace std; class Solution { public: vector<vector<int>> merge(vector<vector<int>>& intervals) { sort(intervals.begin(), intervals.end(), [](const vector<int>& v1, const vector<int>& v2){ return v1[...
ALGO
0.999999
6.237394
a01c3ec4-d246-448f-b099-09633a82a31b
migueltest1234/myvanetza
vanetza/security/v2/verification.cpp
#include <vanetza/security/v2/verification.hpp> namespace vanetza { namespace security { namespace v2 { bool check_generation_time(const SecuredMessage& message, Clock::time_point now) { using namespace std::chrono; bool valid = false; const Time64* generation_time = message.header_field<HeaderFieldType:...
TOOL
0.901035
7.728508
571d8757-73ae-4f04-bec1-f06fca29555d
omgulshan/Dsa-leetcode-gfg-nextleap
0025-reverse-nodes-in-k-group/0025-reverse-nodes-in-k-group.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { ListNode * reverse(ListNode *...
ALGO
0.99999
5.647738
3712e88b-ce72-4182-88dc-db01777b5cfd
timdavidfriedrich/htwk
01-GDP/Weiteres/hanoi.cpp
#include <iostream> enum class Stapel { Eins, Zwei, Drei }; // Deklaration void ziehe( Stapel von, Stapel nach ); void loeseHanoi( Stapel von, Stapel nach, Stapel hilf, unsigned int anzahlScheiben ); // Implementierung für: std::cout << Stapel::Eins; std::ostream& operator<<( std::ostream& out, Stapel s ); // Impl...
ALGO
0.999031
5.221609
1eda7881-cbe9-4019-adf5-c078e32aac09
techsavvyash/TheFundamentals
DSA/DataStructures/Binary-Seach-Trees/BST.cpp
#include <iostream> using namespace std; template <typename T> class BSTNode { public: T data; BSTNode<T> *leftChild; BSTNode<T> *rightChild; BSTNode(T data) { this->data = data; leftChild = rightChild = NULL; } void insert(T key) { if(this->data > key) { ...
ALGO
0.999843
4.641197
22323d56-81f3-42c8-a2b7-b8e79cfa9963
davr/ledsign
tetris.cpp
#include "main.h" #include <avr/pgmspace.h> byte pieces[] = { 0xF0, // 1111 // 0000 // 0xE8,// 1110 // 1000 // 0x8E,// 1000 // 1110 // 0x6C,// 0110 // 1100 // 0xC6,// 1100 // 0110 // 0xCC, // 1100 // 1100 }; // Lookup table for piece rotation, to speed things up (in theory...should p...
ALGO
0.998032
5.482016
d692c4f9-463b-4c36-ba05-b52ce0ef0879
valderyaya/Competitive-Programming
TIOJ/2193.cpp
//#pragma GCC optimize("unroll-loops, no-stack-protector, Ofast") #include<bits/stdc++.h> using namespace std; #define StarBurstStream ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); #define ll long long #define F first #define S second #define ALL(x) x.begin(),x.end() #define pii pair<int,int> #define REP(i,n) for(int...
ALGO
0.999787
3.74666
dc901d27-0ff7-4030-81b4-ca810fe4a9e6
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_1403_12.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; vector<int> d(n); for (int i = 0; i < n; ++i) cin >> d[i]; vector<int> cpy(d); sort(d.begin(), d.end()); int x = 0; int count = 0; for (int i = 0; i < d.size(); ++i) { if (x + d[i] <= k) { x += d[i]; co...
ALGO
0.999981
3.780329
b9564060-c118-4081-b25a-87dc79e39eaa
Moozaheed/All
PROGRAMMING--main/Bit Manipulation/And product2.cpp
#include<bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> #define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0...
ALGO
0.999409
4.843726
b09dce40-9aa1-48de-ad96-4341d4296dd7
pranavsindura/CompetitiveProgramming
MustDo_GeeksForGeeks/Arrays/subarray-with-given-sum.cpp
#include<bits/stdc++.h> #define ll long long int using namespace std; const int MAXN = 1e7 + 5; ll arr[MAXN]; /*SUBARRAY WITH GIVEN SUM*/ /* POSITIVE ARRAY NUMBERS Simple Approach - O(n^3) See all subarrays and check if sum is equal to required sum With prefix array - O(n^2) */ /* Two Pointer Conc...
ALGO
0.999897
4.533391
e8bacc9a-1926-446b-9f28-d05914e2ce20
Akbar-codes/CPP_Akbar
GRADE11B/MTRANSPO.CPP
/* This program accepts a matrix and then transposes the elements. */ #include<iostream.h> #include<conio.h> void main() { clrscr(); int a[20][20],b[20][20],i,j,m,n; cout<<"\n\n\n\t\t\t MATRIX TRANSPOSER "; cout<<"\n\n\t\t Enter row & column of matrix A : "; cin>>m>>n; cou...
ALGO
0.997119
3.661682
630469ea-fb1e-4a4c-b744-449aa0e0f18b
Ldass2000/Leetcode_solution
856-score-of-parentheses/856-score-of-parentheses.cpp
class Solution { public: int scoreOfParentheses(string s) { //Aproach 1 // stack<int>st; // int score=0; // for(int i=0;i<s.size();i++) // { // if(s[i]=='(') // { // st.push(score); // score=0; // } ...
ALGO
0.999734
5.419223
a313df63-e846-4f2e-9a2c-151544f52dcb
tomxuetoy/ticpp_cpp
local-varial-in-stack.cpp
#include <iostream> using namespace std; int main () { int a=5; // initial value = 5 int b(2); // initial value = 2 int result; // initial value undetermined a = a + 3; cout << result << endl; //local variable is in stack, so its content is random each time the program run...
ALGO
0.981116
4.203405
16047364-935e-4b5d-856a-58f7a2e58f94
rafopar/hps_epics
qt/epicsqt-1.1.2-src/ca_framework/qwt-5.2.1/src/qwt_spline.cpp
#include "qwt_spline.h" #include "qwt_math.h" #include "qwt_array.h" class QwtSpline::PrivateData { public: PrivateData(): splineType(QwtSpline::Natural) { } QwtSpline::SplineType splineType; // coefficient vectors QwtArray<double> a; QwtArray<double> b; QwtArray<double> c; ...
ALGO
0.994131
6.135128
a600e375-a80e-46e6-b29f-7169802abbf4
overaction/algorithm_problem_solution
8.16 두니발 박사의 탈옥/8.16 두니발 박사의 탈옥/main.cpp
#include <iostream> #include <stdio.h> #include <algorithm> #include <vector> #include <cstring> #include <cmath> using namespace std; int C,N,D,P,T,Q; int village[51][51], counts[51]; // cache[ ȣ][¥] double cache[51][101]; /* Ž double allSearch(vector < int > &path) { // ¥ ߴٸ if(path.size() == D+1) { ...
ALGO
0.99724
3.576419
98435555-c3c8-419c-8fce-022ced428420
wxxhub/graduationCLient
src/face_detector/add_face.cpp
#include <iostream> #include <dirent.h> #include "face_detector/add_face.h" #include "face_detector/face_mat_process.h" using namespace std; using namespace cv; static int getPDistance(int x1, int x2, int y1, int y2) { return sqrt(powf(x1 - x2, 2) + powf(y1 - y2, 2)); } AddFace::AddFace() : save_index_(0) ...
ALGO
0.981066
4.112749
a4c4a351-02a2-4447-a364-0e2839f30d7b
brownspy1/Phitron
Semister 02/Algorithms/live for Contest class/XPSC Contest - Batch 04/Zeros_and_Ones_01.cpp
// Created by @brownspy1 on 2024-10-14 Time:17-30-18 #include <bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; int ar[n]; int ziro = 0, one = 0; for (int i = 0; i < n; i++) { int a;cin>>a; if (a == 0) { ziro++; } if (a == 1) {...
ALGO
0.999792
4.61742
92c338d0-d704-4330-a8e2-c6f1de6ddf1f
JetBrains/JetBrainsRuntime
src/hotspot/share/gc/z/zHeuristics.cpp
#include "gc/shared/gc_globals.hpp" #include "gc/shared/gcLogPrecious.hpp" #include "gc/z/zCPU.inline.hpp" #include "gc/z/zGlobals.hpp" #include "gc/z/zHeuristics.hpp" #include "runtime/globals.hpp" #include "runtime/os.hpp" #include "utilities/align.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/p...
TOOL
0.863442
6.322004
63f8fbc0-8917-44ed-8d36-c5b1a3d1baf2
Dennitz/chdb
src/Storages/MergeTree/MergeTask.cpp
#include "Storages/MergeTree/IDataPartStorage.h" #include <Storages/MergeTree/MergeTask.h> #include <memory> #include <fmt/format.h> #include <Common/logger_useful.h> #include <Common/ActionBlocker.h> #include <Storages/LightweightDeleteDescription.h> #include <Storages/MergeTree/DataPartStorageOnDiskFull.h> #includ...
TOOL
0.973528
5.830487
1ebe6b41-a5cf-45bf-b78b-b831a8e0ec6c
SOFTK2765/PS
BOJ/11772.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); long long sum = 0; for(int i=0;i<n;i++) { int a, b; scanf(" %d", &a); b = a%10; a /= 10; long long tmp = 1; for(int i=0;i<b;i++) tmp *= a; sum += t...
ALGO
0.999924
4.031712
2bcc5ef4-3927-41ba-98c1-ec03d29cc6d5
ShubhamGoswami-1/My_Journey
Recursion_Permutation_with_Spaces.cpp
#include<bits/stdc++.h> using namespace std; void Permute_with_Spaces(string ip,string op){ if(ip.length()==0){ cout<<op<<"\n"; return; } string op1=op; string op2=op; op1=op1+" "; op1.push_back(ip[0]); op2.push_back(ip[0]); ip.erase(ip.begin()+0); Permute_with_Spaces...
ALGO
0.999902
4.192039
016aa534-e998-48ce-94f5-d672d0402022
UTP-TriforceX/Programming-Contest
UVa/Magic Formula.cpp
#include <bits/stdc++.h> using namespace std; int main(){ long long a,b,c,d,l,cont=0,ecuacion=0; while(cin>>a>>b>>c>>d>>l){ cont=0; ecuacion=0; if(a==0 && b==0 && c==0 && d==0 && l==0)break; for(int i=0; i<=l; i++){ ecuacion = a*(i*i)+(b*i)+c; if(ecuacion%d == 0)cont++; } cout<<cont<<endl; } ret...
ALGO
0.998011
3.068649
16dcf360-19c6-4fe8-8daf-ac42387ded23
tomoakiii/atcoder2
Archive/abc289/b.cpp
#include <atcoder/all> #include <bits/stdc++.h> using namespace std; using namespace atcoder; #define rep(i,n) for (ll i = 0; i < (n); ++i) template<typename T> inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); } template<typename T> inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true...
ALGO
0.999996
4.012165
9a3edc0c-6d14-4f11-b685-14deda2eb8c3
ulas206/KolibriOS_v5938
contrib/sdk/sources/Mesa/mesa-10.6.0/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
#include "brw_fs.h" #include "brw_fs_live_variables.h" #include "brw_cfg.h" /** @file brw_fs_dead_code_eliminate.cpp * * Dataflow-aware dead code elimination. * * Walks the instruction list from the bottom, removing instructions that * have results that both aren't used in later blocks and haven't been read * ye...
ALGO
0.896329
7.685552
307bd10e-5ef2-4fc7-800b-38487c2d6c21
IMWYY/algorithmING
leetCode/array/Problem1567.cpp
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <numeric> #include <string> #include <unordered_map> #include <vector> /** * Given an array of integers nums, find the maximum length of a subarray where * the product of all its elements is positive. * * A subarray of an array i...
ALGO
0.999961
6.098838
709969de-9b35-4d42-8b40-44a40faf3f98
ousttrue/swigbullet
bullet-2.79/LinearMath/btGeometryUtil.cpp
#include "btGeometryUtil.h" /* Make sure this dummy function never changes so that it can be used by probes that are checking whether the library is actually installed. */ extern "C" { void btBulletMathProbe (); void btBulletMathProbe () {} } bool btGeometryUtil::isPointInsidePlanes(const btAlignedObjectArr...
ALGO
0.988529
6.570542
0ef8d63a-6791-44cc-949a-8f9dd4b4117b
ishandutta2007/codeforces
bohun/normal/438/A.cpp
#pragma GCC optimize("O3") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define mp make_pair #define pb push_back #define ld long double #define ss(x) (int) x.size() #define FOR(i, j, n) for(int i = j; i <= n; ++i) #define fi first #define s...
ALGO
0.999888
3.91033
d23e1e1c-bf36-4a53-a5c9-d85b71131032
MeherajUlMahmmud/ProblemSolving
LeetCode/0392. Is Subsequence.cpp
class Solution { public: bool isSubsequence(string s, string t) { if(s.size() == 0) return true; int s_pointer = 0; int t_pointer = 0; while(t_pointer < t.size()) { if(s[s_pointer] == t[t_pointer]) { s_pointer++; if(s_p...
ALGO
0.999923
6.309914
a3b1361e-219c-4663-a017-7c34f0556193
ishandutta2007/codeforces
hollwoq_pelw/normal/1443/E.cpp
/* // is short or still long ??? hollwo_pelw's template(short) // Note : -Dhollwo_pelw_local */ #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/trie_policy.hpp> // #include <ext/rope> using namespace std; // using namespace __gnu_pbds; // using namespace __gnu_cxx; void FA...
ALGO
0.998955
4.315717
250f4f62-ba0f-4cb4-81b7-87dc1aeff6e0
Apurba94/10-Years-of_Competitive-Programming-Resources-Collection
TJU/2859 - S Number.cpp
#include<iostream> using namespace std; int main(){ freopen("in.txt","r",stdin); freopen("out.txt","w",stdout); int n,a,x,y; while(1){ scanf("%d",&n); if(n==0) break; x=-1; y=-1; for(int i=0;i<n;i++){ scanf("%d",&a); ...
ALGO
0.999729
3.484326
7e768dce-0a5c-4198-aed6-2b51d61b5de7
adrish-biswas-au9/Core-DSA-problems
AfterLearning Functions/ArrayFindDuplicateinN.cpp
#include <iostream> using namespace std; void arrayFindDuplicateinN(int arr[], int n) { int count[n]; // int count[4] = {0}; alternative way of declaring an array with all values as 0, but when the size is not a parameter // int count[] = {0, 0, 0, 0}; alternative way of declaring an array with all values as 0, ...
ALGO
0.992426
3.929633
d64296a8-d159-46b4-a652-b9d1039a3a68
mdfaisal001/100DaysOfDSA
100DaysOfDSA/Day45/rootToLeaf.cpp
class Solution { private: void findPathSum(TreeNode *root, int &total, int temp) { if (!root) return; temp = temp * 10 + root->val; if (!root->left && !root->right) { total += temp; return; } findPathSum(root->left, total, temp)...
ALGO
0.999951
5.602686
71bad4d4-8156-49b8-a934-86a413d76c7d
prathmesh0/MISSION_POP
Revision/Linked List/Medium Problems of LL/segreegateOddandEvenNodes.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* oddEvenList...
ALGO
0.999982
5.737317
dd1bd146-853b-4a28-ac5e-0c524d53ac96
Gj0705/RELOCALIZATION
第三章 3D激光里程计2/lidar_localization/src/evaluation/evaluation_flow.cpp
/* * @Description: evo evaluation facade * @Author: Ge Yao * @Date: 2021-01-30 22:38:22 */ #include "lidar_localization/evaluation/evaluation_flow.hpp" #include "glog/logging.h" #include "lidar_localization/tools/file_manager.hpp" #include "lidar_localization/global_defination/global_defination.h" namespace lida...
DATA
0.926807
3.424098
38c406ad-ae82-4677-8143-f8bc63f2df4d
ishandutta2007/codeforces
lawrenceli/normal/87/A.cpp
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define px real() #define py imag() #define rep(i, n) for (int i=0, _##i=(n); i<_##i; ++i) #define repi(i, n) for (__typeof((n).begin()) i=(n).begin(), _##i=n.end(); i != _##i; ++i) #define sz(x) int((x).size()) #define print(x) cerr << ...
ALGO
0.99999
4.325446
ad140c54-3823-4d46-97f5-22945efe5236
Fayorin/2309SinitenkovaCW
2309SinitenkovaCW.cpp
#include <iostream> #include <stack> #include <algorithm> #include <math.h> using namespace std; class TNode { public: char inf; double var; TNode* left; TNode* right; }; typedef TNode* ExpTree; struct Node { char val; float var; Node* next; Node(char _val, float _var) { val = _val; var = _var; next...
ALGO
0.999329
4.01558
9de2b9ce-0e12-4829-854f-e4f1424f7ee6
emsec/PatchingFPGAs
3_trojan_insertion/3_bitstream_merging/7-series-bitstream/src/utils/utils.cpp
#include "utils/utils.h" #include "defines.h" #include <algorithm> #include <iostream> #include <iterator> #include <map> #include <sstream> #include <string> #include <vector> namespace bitstream { namespace utils { bool begins_with(const std::string &str, const std::string &begin) { ...
TOOL
0.943401
6.095291
3ca548da-c4ae-4bfb-8c8f-587aa96efaad
cuong-tay/C-
thaphanoi.cpp
#include<bits/stdc++.h> using namespace std; void thn(int n, char a, char b, char c, int &count) { int i = 1; if (n > 1) { thn(n - 1, a, c, b, count); } cout << "Buoc" << count++ << " Chuyen dia " << n << " tu " << a << " sang " << b << endl; if (n > 1) { thn(n - 1, c, b, a, count...
ALGO
0.99979
3.891883
efd29e15-031f-4fed-8f8a-fd6f1c1d4e4e
SaiVamshiK/Data-Structure-in-C-
Revised DS/Segment Tree/L Horrible Queries.cpp
World is getting more evil and it's getting tougher to get into the Evil League of Evil. Since the legendary Bad Horse has retired, now you have to correctly answer the evil questions of Dr. Horrible, who has a PhD in horribleness (but not in Computer Science). You are given an array of N elements, which are initially...
ALGO
0.998007
4.089054
cdecc6ca-8915-4d9c-bc65-4a566cee7f70
rigved/programming_practice
c++/c++_primer/01/1_12_sum_numbers_to_zero.cpp
#include "iostream" int main() { int sum = 0; for (int i = -100; i <= 100; ++i) { sum += i; } std::cout << "The sum of numbers from -100 to 100 inclusive is " << sum << std::endl; return 0; }
ALGO
0.997428
5.138059
af1b185c-3935-4a88-a391-a7ac0071be7f
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_12253_5.cpp
#include <bits/stdc++.h> using namespace std; int N; int P[1000006]; int IP[1000006]; int main() { cin >> N; for (int i = 1; i <= N; i++) { cin >> P[i]; IP[P[i]] = i; } int min_sw = 0; for (int i = 1; i <= N; i++) { if (i != P[i]) { min_sw++; swap(P[i], P[IP[i]]); int a = IP[i]; ...
ALGO
0.999985
4.060189
46b7cd5e-0c4b-4aed-ad1d-8dcd719ece96
Lebokomape/guessing-game
quadratic/quadratic.cpp
#include <iostream> #include <complex> #include <cmath> using namespace std; int main() { using Complex = complex<float>; int a = 0, b = 0, c = 0; char choice; do { cout << "Enter integers coefficient of a: "; cin >> a; cout << "Enter integers coefficient of b: "; cin >...
ALGO
0.911091
3.343894
ae15e358-4b33-4d51-af29-5d1d9694c4f6
Venom9182/Codes
Median in a stream.cpp
#include<queue> int signum(int a, int b) { if(a==b) return 0; if(a>b) return 1; else return -1; } void callMedian(int element,priority_queue<int,vector<int>,greater<int>> &mini,priority_queue<int> &maxi, int &median) { switch(signum(maxi.size(),mini.size()) ){ ...
ALGO
0.999999
5.20711
c785ed9e-fac5-4f58-9c2f-39462a6110ba
lucdon/LCRIndexing
src/algorithms/createLabeledGraph.cpp
#include "graphs/LabeledGraph.hpp" #include "utility/MemoryWatch.hpp" std::unique_ptr<LabeledGraph> createLabeledGraph(std::vector<std::tuple<Vertex, Vertex, Label>> &edges, uint32_t vertexCount, uint32_t labelCount) { auto graph = std::make_unique<LabeledGraph>(); graph->setSizes(vertexCount, labelCount); ...
TOOL
0.991443
7.181036
6aa9985b-29a8-478b-a1c4-c32a108815b4
evialbert/LeetCode
3812-smallest-palindromic-rearrangement-i/smallest-palindromic-rearrangement-i.cpp
class Solution { public: string smallestPalindrome(string s) { int freqArr[26] = {0}; int n = s.length(); bool hasOddChar = (n%2 == 1); char oddChar; for (char c: s) { freqArr[c - 'a']++; } if (hasOddChar) { oddChar = s[ceil(n/2)]; ...
ALGO
0.999915
6.497542
3bf54aa6-0e54-463a-8514-56d17716f76f
nkassa/DigitalOceanInterview
sortTheMatrixDiagonally.cpp
class Solution { public: vector<vector<int>> diagonalSort(vector<vector<int>>& mat) { int m = mat.size(); int n = mat[0].size(); unordered_map<int, priority_queue<int, vector<int>, greater<int>>> grid; for(int row = 0; row < m; row++) { for(int col = 0; col <...
ALGO
0.999969
6.104784
426d01c0-8a8d-4db0-a7fc-be7f202df87c
Sergei2415/VR
My project/Library/PackageCache/com.unity.ide.visualstudio@2.0.22/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp
#include <iostream> #include <sstream> #include <string> #include <filesystem> #include <windows.h> #include <shlwapi.h> #include <fcntl.h> #include <io.h> #include "BStrHolder.h" #include "ComPtr.h" #include "dte80a.tlh" constexpr int RETRY_INTERVAL_MS = 150; constexpr int TIMEOUT_MS = 10000; // Often a DTE call m...
TOOL
0.940144
6.933585
d5ed9b63-e9f5-454f-a117-7829afaca897
NTMyDung/Demo
223/main.cpp
#include <iostream> using namespace std; bool mangtang( float a[], int n){ //kiem tra mang nhap vao co theo thu tu tang dan khong for( int i=1; i<n; i++){ if(a[i]>a[i+1]) return false; } return true; } void thembaotoan ( float a[], int n, float x){ if...
ALGO
0.999846
3.484705
5e385ee0-cef6-485b-b525-72089b24e638
RigoLigoRLC/Fritzing-build
boost_1_82_0/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.938635
6.471772
5998fa42-60ac-4a08-a182-446eaf85cd37
ButterflyDew/CBA
qhbll.cpp
#include "qhbll.h" #include "Hub-Labeling/global.h" #include <utility> void qHBLL::clear() { L.clear();// group merge label pos.clear();// different l fid.clear();// umap -> D * merge label cntud = cntwd = 0; sumud = sumwd = 0; for(auto resl: lasl) { idx[resl] = -1; potl[res...
ALGO
0.99806
3.978486
15b7cc44-e036-48e4-b428-41abb493f0df
marinastefane/Beecrowd
2- Ad-Hoc/2378.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, c, s, e, t = 0; bool excedeu = false; cin >> n >> c; for (int i = 0; i < n; i++) { cin >> s >> e; t += e - s; if (t > c) { excedeu = true; } } if (excedeu) { ...
ALGO
0.999971
4.116037
9c9c8df5-3194-42ce-a379-491053e1e7cd
Natthawe/simulation_ws
src/navigation2/nav2_smac_planner/src/smac_planner_hybrid.cpp
#include <string> #include <memory> #include <vector> #include <algorithm> #include <limits> #include "Eigen/Core" #include "nav2_smac_planner/smac_planner_hybrid.hpp" // #define BENCHMARK_TESTING namespace nav2_smac_planner { using namespace std::chrono; // NOLINT using rcl_interfaces::msg::ParameterType; using s...
TOOL
0.881582
7.595127
c96a6024-25a6-41fa-984b-73b21337c7d2
Shuhrat556/FlutterHome_12.06
my_project/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.998896
6.76073
b7979cff-dc1e-4292-9995-e4e5d1b3dd5c
PLSysSec/hfi_firefox
gfx/skia/skia/src/gpu/effects/GrBicubicEffect.cpp
#include "src/core/SkMatrixPriv.h" #include "src/gpu/effects/GrBicubicEffect.h" #include "include/gpu/GrTexture.h" #include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h" #include "src/gpu/glsl/GrGLSLProgramDataManager.h" #include "src/gpu/glsl/GrGLSLUniformHandler.h" class GrGLBicubicEffect : public GrGLSLFragmentProc...
ALGO
0.961122
7.273115
5331f325-f5e9-4d15-b7fb-1762b4bbdbe9
kazi-nayeem/Programming-Problems-Solutions
lightoj/1078 - Integer Divisibility.cpp
#include<stdio.h> int main() { int te, ti, n, mod, res, digi; scanf("%d", &ti); for(te = 1; te <= ti; te++) { scanf("%d %d", &mod, &digi); res = digi % mod; for(n = 1; res != 0; n++) res = (res*10+digi)%mod; printf("Case %d: %d\n", te, n); } return 0;...
ALGO
0.999658
3.323407
383683e0-05f0-4cdf-bc4c-eba722d9ffa9
insaneodyssey26/Daily-DSA
RunningSum.cpp
class Solution { public: vector<int> runningSum(vector<int>& nums) { for (int i = 1; i < nums.size(); i++) { nums[i] += nums[i - 1]; } return nums; } };
ALGO
0.999886
6.086196
caff6eb2-2f3d-4b76-a431-0db5eaa583ab
ravikjha7/Competitive-Programming
Data Structures/Prime Numbers/PrimeSum.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define mod 1000000007 void file() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif } vector<ll> primesum(ll A) { ll arr[A + 1] = {0}; for(ll i = 2; i <= A; i++) { ll p = i; if(...
ALGO
0.99906
4.260138
56126061-4575-4ec8-9d96-83c49058bca2
Aman0106/DSA-Learning
Love Babbar DSA/Recursion/Arrays/BinarySearch.cpp
#include<iostream> using namespace std; int bSearch(int *arr, int start, int end, int target){ if(start > end) return -1; int mid = ((end-start)/2) + start; if(arr[mid] == target) return mid; if(arr[mid] < target) start = mid + 1; if(arr[mid] > target) end = mid - 1; return bS...
ALGO
0.99918
5.379023
fde488db-8445-4a53-8052-d866719a9b67
onmyoji-xiao/3dvg_SeCG
external_tools/pointops/src/subtraction/subtraction_cuda.cpp
#include <vector> #include <torch/serialize/tensor.h> #include <ATen/cuda/CUDAContext.h> #include "subtraction_cuda_kernel.h" void subtraction_forward_cuda(int n, int nsample, int c, at::Tensor input1_tensor, at::Tensor input2_tensor, at::Tensor idx_tensor, at::Tensor output_tensor) { const float *input1 = input1_...
DATA
0.895189
6.603104
e4f0fdae-85ea-4bd4-bf21-022d02157307
Avariusnet/VanillaCore
src/shared/Utilities/Util.cpp
#include "Util.h" #include "Timer.h" #include "utf8cpp/utf8.h" #include <mersennetwister/MersenneTwister.h> #include <ace/TSS_T.h> #include <ace/INET_Addr.h> #include "Log/Log.h" typedef ACE_TSS<MTRand> MTRandTSS; static MTRandTSS *mtRand; static ACE_Time_Value g_SystemTickTime = ACE_OS::gettimeofday(); uint32 Worl...
TOOL
0.933528
5.89236
20bd8424-7b3e-4d88-9f38-16904ecb38d1
Yycode76/oss25
250430/n부터 1까지 정수 출력/print-n-to-1.cpp
#include <iostream> using namespace std; int main() { // Please write your code here. int n; cin >> n; int i=n; while ( i > 0){ cout << i << " "; i--; } return 0; }
ALGO
0.999262
4.445368
dd7b5a50-247b-4d52-941d-e591b847a219
ishandutta2007/codeforces
hydro-bot1/normal/367/E.cpp
// Hydro submission #624db793fcdfb741b9e4762b@1649260435904 #include<bits/stdc++.h> using namespace std; #define maxn 200009 #define minn 325 const long long mod=1000000007; int dp[maxn][minn]; int n,m,x; int id(int i,int j){ return i*(n+1)+j; } inline int read(){ int sum=0,fh=1; char c=getchar(); while(c>'9'||c<'...
ALGO
0.999986
4.424695
379c0c0d-b00d-4146-b97c-9113126ccb6f
Mushu1X/LeetCodeQuestions
C++/single_number.cpp
class Solution { public: int singleNumber(vector<int>& nums) { int n = nums.size(); for(int i = 0; i<n ; i++){ int num = nums[i]; int count = 0; for (int j =0 ; j<n; j++){ if (nums[j] == num){ count++; } ...
ALGO
0.999969
5.532863
747164ed-d522-4820-b104-43f08850660a
AKD-01/DSA-LeetCode
200-number-of-islands/200-number-of-islands.cpp
class Solution { public: int numIslands(vector<vector<char>>& grid) { int m = grid.size(), n = m ? grid[0].size() : 0, islands = 0; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (grid[i][j] == '1') { islands++; erase...
ALGO
0.999988
6.692396
644d9dae-6d00-47e4-a83d-a2d55961bdf9
JamshidbekAkhlidinov/masalalar_C
tatu2/container/diyorbek 2 is_sorted_until.cpp
#include <iostream> #include <list> #include <algorithm> #include <time.h> using namespace std; int main(){ srand(time(0)); list<int> list; int n; cout<<"N="; cin>>n; for(int i=1; i<=n; i++){ int r = rand()%30; list.push_back(r); } for(int k: list) cout<<k<<" "; int d = *is_sorted_until(list.begin()...
ALGO
0.991464
3.556132
4a6f99ec-7ec3-40db-b066-e5d1d17e8163
syg/gecko
media/webrtc/trunk/webrtc/modules/video_capture/windows/BasePin.cpp
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim:set ts=2 sw=2 sts=2 et cindent: */ #include <assert.h> #include "nsAutoPtr.h" #include "BasePin.h" namespace mozilla { namespace media { // Implements IEnumMediaTypes for nsBasePin::EnumMediaTypes(). // Does not support dynamic me...
TOOL
0.870605
7.485846
7040a89f-46c3-4b5c-a479-aa9b4abd0046
Shivam2501/MSI-GEM5
src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_unsigned/truncation/datawidth.cpp
/***************************************************************************** datawidth.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /**************************************************************************...
ALGO
0.964648
5.742909
6cbe370c-2bbd-4c6d-ab51-7386bffc286a
algorithmstudy4/sw_test
s_coding/프로그래머스/문자열을 정수로 바꾸기.cpp
//https://programmers.co.kr/learn/courses/30/lessons/12925 #include <string> #include <vector> using namespace std; int solution(string s) { int answer =0; bool flag = false; for(int i=0;i<s.size();i++){ if(s[i] == '-'){ flag =true; } else if (s[i] == '+'){ ...
ALGO
0.999929
4.557161
0f5d18cc-bde6-42c1-819e-3b730442bade
SkyFire/ascent_classic
extras/collision/assembler/g3dlite/AABox.cpp
/** @file AABox.cpp @maintainer Morgan McGuire, <EMAIL> @created 2004-01-10 @edited 2006-01-11 */ #include "G3D/platform.h" # if defined(_MSC_VER) && (_MSC_VER <= 1200) // VC6 std:: has signed/unsigned problems # pragma warning (disable : 4018) # endif #include <assert.h> #include "G3D/AA...
TOOL
0.91332
7.725801
044003de-cc57-487f-816c-29dd74a7607a
hit-computer/Algorithm
Sort/main.cpp
#include <iostream> #include <stdlib.h> #include <stdio.h> #include <time.h> #include <Queue> #include <windows.h> #include <WinBase.h> #include <fstream> using namespace std; void BubbleSort(int D[],int n); void InsertSort(int D[],int n); void ShellSort(int D[],int n); void SelectSort(int D[],int n); void QuickSort(in...
ALGO
0.999849
3.802862
a6f2d459-a11d-4d33-a44d-7feb74a01de8
OpenSourceRisk/Engine
OREData/ored/scripting/engines/amccgcurrencyswapengine.cpp
#include <ored/scripting/engines/amccgcurrencyswapengine.hpp> #include <qle/instruments/currencyswap.hpp> namespace ore { namespace data { void AmcCgCurrencySwapEngine::buildComputationGraph(const bool stickyCloseOutDateRun, const bool reevaluateExerciseInStickyClo...
ALGO
0.989369
5.816467
f7a1d731-75d0-4b01-a074-ad1bdd2d2719
akshaybaviskar/mlir
llvm/lib/CodeGen/DFAPacketizer.cpp
#include "llvm/CodeGen/DFAPacketizer.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstrBundle.h" #include "llvm/CodeGen/ScheduleDAG.h" #include "llvm/CodeGen/ScheduleDAGInstrs...
TOOL
0.9858
7.527
44056239-bee1-4041-8533-5ffdbd520206
costadev00/neps_academy
Distribuindo_Camisetas.cpp
//TODO: SOLVE #include <bits/stdc++.h> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) using namespace std; typedef long long ll; typedef long double ld; #define endl "\n" #define debug(args...) cout << (#args) << " = " << (args) << endl #define MOD 1000000007 #defin...
ALGO
0.999787
3.504454
767d6cba-3c93-4e54-be3f-885e39f2bc06
Moein-Karami/OlympiadCodes
Codeforces/A. Soldier and Bananas/main.cpp
#include <iostream> using namespace std; int main() { int n,w,k; cin>>k>>n>>w; int ans=(k*((w*w+w)/2))-n; if(ans<0) ans=0; cout<<ans; return 0; }
ALGO
0.999707
3.384805
23e66c2b-0e5d-4b2f-bd3c-ba8d45d8c438
unstablebear/rars_mod
rars/robots/mat1.cpp
// OVAL VERSION // This car is now fairly good for anything that an oval can throw at it (I think) // however much work now needs to be done on overtaking as this leaves a lot to // be desired and is essential. #include <string.h> #include <stdlib.h> #include <math.h> #include "car.h" #include "track.h" const double...
ALGO
0.998406
3.265506
dc7cd782-ed59-4aea-b8ab-0ba200b79afa
cattabiani/googleJam
ominousOmino/main.cpp
#include <iostream> using namespace std; int main() { int T; cin >> T; for (int iT = 1; iT <= T; ++iT) { int X, R, C; cin >> X >> R >> C; cout << "Case #" << iT << ": "; if (X >= 7 || (X-1)/2 + 1 > min(R, C) || (R * C)%X !...
ALGO
0.999762
4.570372
1808152e-1dd5-4526-9cea-e34c3248e371
E-O-H/OpenGL-interactive-physics-simulation-old-version
ext/eigen/bench/bench_norm.cpp
#include <typeinfo> #include <iostream> #include <Eigen/Core> #include "BenchTimer.h" using namespace Eigen; using namespace std; template<typename T> EIGEN_DONT_INLINE typename T::Scalar sqsumNorm(const T& v) { return v.norm(); } template<typename T> EIGEN_DONT_INLINE typename T::Scalar hypotNorm(const T& v) { r...
TOOL
0.970773
6.560239
0fc211dc-ea01-47ff-a226-71daa85a84b8
mohitreddy1996/Competitive-Coding
CodeChef/EMRGENCY.cpp
#include <algorithm> #include <stdio.h> #include <map> #include <math.h> #include <stack> #include <string.h> #include <queue> #include <iostream> #include <vector> using namespace std; #define mod 1000000007 #define MAX 10001 /* int solve() { .... Base Cases .... if ( DP[i][j] is calculated) ...
ALGO
0.999947
3.666035
6d520efa-91e1-4d7b-a42c-4bff5464ad4a
vrinda22/DS-ALGO
TREES/preorder_traversal.cpp
/*Given a binary tree, print preorder traversal of it. The task is to complete the function preorder(), which accept root of the tree as argument. For example: preorder traversal of below tree is "1 10 5 39" 1 / \ 10 39 / 5 Input: The first line of input contains the number of test cases T. ...
ALGO
0.999711
6.17967
800c1b8d-8a11-4bbd-ab9f-9a41e0b83e6a
bombpersons/STRIPS_AI_Shooter
include/Box2D/Dynamics/Contacts/b2Contact.cpp
#include <Box2D/Dynamics/Contacts/b2Contact.h> #include <Box2D/Dynamics/Contacts/b2CircleContact.h> #include <Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h> #include <Box2D/Dynamics/Contacts/b2PolygonContact.h> #include <Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h> #include <Box2D/Dynamics/Contacts/b2EdgeAnd...
ALGO
0.994219
7.743597
cb53e88b-0456-46b1-942f-54ce0d6e2285
svanegas/programming_solutions
UVa/11786 - Global Raining at Bididibus/11786.cpp
//Santiago Vanegas Gil. #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 <dequ...
ALGO
0.982309
3.077121
de6c73c8-ea7f-4c4a-9d67-620ce8310595
bryanECE/C-Language
Sum od odd and even integers.cpp
#include<iostream> using namespace std; int main() { int sumofeven=0,sumofodd=0; int count;//total inputs int number;//temporary variable entered by user cout << "Please input how many numbers you want : ";// displays how many numbers entered cin >> count; for(int A=0;A<count;A++) { cout << "\nPl...
ALGO
0.996614
3.570588
8b3b4d24-f069-4c42-94a2-7032c10eabd4
JobHaver/leetCode
smallest-number-in-infinite-set.cpp
class SmallestInfiniteSet { public: int max; // std::priority_queue<int, std::vector<int>, std::greater<int>> out; std::priority_queue<int, std::vector<int>, std::greater<int>> in; SmallestInfiniteSet() : max{1} {} int popSmallest() { if(in.empty()) return max++; ...
ALGO
0.997455
5.377892
2f12661c-2567-45cd-86a4-a834bbb2ea73
platypusperry23/Imp_Codes
codes/ppdiv.cpp
# include <bits/stdc++.h> using namespace std; #define boost ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) #define ll long long #define ld long double #define pi 3.14 #define mkp make_pair #define pb push_back #define pf push_front #define pob pop...
ALGO
0.999959
3.488376
328b8e43-4f34-4076-b2aa-a61f36a73de0
llucifer97/Algorithms-Datastructure
advanced datastructure/Rabin_carp_pattern_match.cpp
#include <bits/stdc++.h> #define ll int long long #define prime 119 using namespace std; ll createHashValue(string str,int n) { ll result = 0; for(int i = 0;i<=n;i++) { result += (ll)(str[i]*(ll)pow(prime,i)); } return result; } ll recalculateHash(string str,int oldIndex,int newIndex,ll oldHas...
ALGO
0.999882
5.094475
4c4a9d82-0f67-467f-877f-6f46d576cc6b
alecksandr26/python-compiler
example/parser.cpp
#include <iostream> #include <vector> #include <string> #include <memory> // Enum for different token types enum class TokenType { Number, Identifier, Operator, ParenOpen, ParenClose, End }; // Token structure struct Token { TokenType type; std::string value; }; enum class NodeType { Number, Variable, Ope...
ALGO
0.997789
7.81363
5d79db65-b0cd-487a-a6c2-5847ab70d1b0
GabrielXIX/Ejercicios-CPP
cap5prog15.cpp
#include <iostream> #include <stdio.h> #include <conio.h> /* Capitulo 5, problema 15 El conjunto de nmeros que aparece con frecuencia en importancia en probabilidad y anlisis es N factorial(N!): N! = 1 x 2 x 3 x 4 x 5 x ... x (N - 1) x N */ //@Author GabrielXIX (Dueas Nuez Alan Gabriel 19211630) //@Date 23 marzo 2...
ALGO
0.99967
4.627913
413ba3fe-68cb-4a87-9cf0-7be12b0da646
gauriiiiiiiiiiii/practise_DSA
13. BINARY TREES/2. MEDIUM PROBLEMS/6. Binary Tree Zigzag Level Order Traversal.cpp
/* Given the root of a binary tree, return the zigzag level order traversal of its nodes' values (i.e., from left to right, then right to left for the next level and alternate between) */ class Solution { public: vector<vector<int>> zigzagLevelOrder(TreeNode* root) { vector<vector<int>> result; if ...
ALGO
0.999997
6.69808