uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
8d7ef683-d92b-4b0c-ab44-62d1af355653
iliyian/LuoguOJ
Problems/CF776B/main.cpp
#include <bits/stdc++.h> using namespace std; bitset<100001> vis; int pri[100001], cnt = 0, f[100001]; void gen(int n) { for (int i = 2; i <= n; i++) { if (!vis[i]) { pri[cnt++] = i; } for (int j = 0; j < cnt; j++) { int p = 1ll * pri[j] * i; if (p > n) break; vis[p] = true; ...
ALGO
0.999803
3.931614
159142b1-ab86-49cb-bc5c-fb0bd7a5e045
Sabbir1039/Data-Structures-and-Algortihms-with-CPP
DSA_lab_1/reverse.cpp
#include<iostream> using namespace std; int main() { int arr[] = {1,2,3,4,5}; int n=5; int temp = 0; for(int i=0; i<n/2; i++) { temp = arr[i]; arr[i] = arr[n-i-1]; arr[n-i-1] = temp; } cout<<"Reversed array: "; for(int i=0; i<n; i++) { cout<<arr[i]<<"...
ALGO
0.999446
4.330552
641b4cf4-52ea-40d9-b50a-c26430ec5d94
brianzhan/trac_ik1
src/trac_ik_examples/src/ik_tests_upload.cpp
// for testing, moved ~/trac_ik/src/ada_description/robots/mico-modified_nolimits back by 1 directory #include <boost/date_time.hpp> #include <trac_ik/trac_ik.hpp> #include <ros/ros.h> #include <kdl/chainiksolverpos_nr_jl.hpp> #include <trac_ik/nlopt_ik.hpp> #include <boost/bind.hpp> #include <boost/function.hpp> #incl...
TOOL
0.928765
6.047601
f7ed0216-0ef3-4891-b41e-b0a9c3516387
K1XE/LeetCode
9.贪心算法/3.摆动序列/376.摆动序列.cpp
/* * @lc app=leetcode.cn id=376 lang=cpp * * [376] 摆动序列 */ #include "tools.h" // @lc code=start class Solution { public: int dp[1005][2]; int wiggleMaxLength(vector<int>& nums) { memset(dp, 0, sizeof(dp)); dp[0][0] = dp[0][1] = 1; for (int i = 1; i < nums.size(); i ++ ) { ...
ALGO
0.999988
5.973557
a66a64a4-a40d-4c59-80a7-307fd85a3713
murali2601/TE_CPP_Code
STL/vector_in_vector.cpp
#include <iostream> #include <vector> using namespace std; int main() { vector <int> v1 = {1,2,3,4,5}; vector <int> v2 = {11,22,33,44,55}; vector <int> v3 = {12,23,34,45,56}; vector <int> v4 = {9,8,7,6,5}; // for(int it : v1) // { // cout << "it : " << it << "\n"; // } ve...
ALGO
0.98487
3.99107
37a63077-2c77-460a-a3e7-3ca74d1176a2
herozxb/work_in_slam
GICP_regulation/A-LeGO-LOAM/A-LeGO-LOAM/src/laserOdometry.cpp
#include "alego/laserOdometry.h" namespace loam { void LaserOdometry::onInit() { cout << "--------- LaserOdometry init --------------" << endl; TicToc t_init; if (use_imu && use_odom != false) { ROS_ERROR("set use_imu=false when use_odom=true"); return; } imu_ptr_front_ = odom_ptr_front_ = 0; ...
TOOL
0.965963
3.697838
68ed5eff-2e07-4e9c-9613-833b14f6df62
deecodess/Data-Structures-and-Algorithms
DSADiscussions/Aarav_Mahajan/10-09-2023/odd-even-list.cpp
#include <iostream> #include <stack> using namespace std; 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(ListNo...
ALGO
0.99987
5.529672
d44b9e37-dc0e-4e79-93f4-152a46133020
jindalshivam09/cppcodes
ACM/CodeChef/MLCHEF2.cpp
// wrong solution #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef list<int> li; typedef vector<int> vi; typedef vector<double> vd; typedef vector<long long> vll; typedef vector<bool> vb; typedef pair<int,int> pii; typedef vector<pair<int,int> > vpii; typedef pair<double,double> p...
ALGO
0.999851
4.026847
ffdc8bcf-92fd-47fc-a6bd-46085d703bff
GYPpro/ACM
Z_DATA/HDU6/std/1006.cpp
#include<bits/stdc++.h> using namespace std; using i64=long long; using i128=__int128; i64 ksm(i128 x,i64 tp,const i64 p,i64 s=1){ for(;tp;x=x*x%p,tp>>=1) if(tp&1) s=x*s%p; return s; } bool check(i64 x,i64 p){ return ksm(x,(p-1)/2,p)==1; } struct F{ i64 d,p; F(i64 d=0,i64 p=0):d(d),p(p){} struct...
ALGO
0.999784
4.26432
7e0dd420-efc1-45b7-a497-41393e18be2d
Wataru-Oshima-Tokyo/C--vol.1
QuickSortHW/QuickSortHW/main.cpp
#include <iostream> #include <ctime> #include <time.h> #include <stdlib.h> #include <stdio.h> template <class insertType> void insertionSort(insertType list[], int length) { for (int firstOutOfOrder = 1; firstOutOfOrder<length; firstOutOfOrder++) { if (list[firstOutOfOrder] < list[firstOutOfOrder-...
ALGO
0.999778
4.906355
6aa58171-4160-4772-989d-e1b0ad732223
wu-qing-157/Aerial-Ace
Training/0729/E.cpp
#include <cstdio> #define maxn 500010 struct Node { int val[4], num; Node *ch[4], *fa; bool leaf; } mem[maxn], *root = mem, *tot = mem, *null; Node *new_node(bool leaf) { *++tot = (Node) {{0, 0, 0, 0}, 0, {null, null, null, null}, null, leaf}; return tot; } void push_back(Node *x, int v, Node *ns) { if (x == ...
ALGO
0.999906
4.335256
e380bd6b-b37c-4733-9998-e1593a733c65
gigawa/Image-Processing-Class-Projects
P2/Correlation.cpp
#include <iostream> #include <fstream> #include <stdlib.h> #include "image.h" using namespace std; int readImageHeader(char[], int&, int&, int&, bool&); int readImage(char[], ImageType&); int writeImage(char[], ImageType&); ImageType & ImagePadding(ImageType & image, int N, int M, int Q, int P); void ApplyMask(Image...
ALGO
0.931785
3.887523
d6106306-9fa5-4b2a-9539-3fc0b129b2f5
mostainRifat/CPxCSE-1200
watermelon.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; if(n%2==0 && n>2) cout<<"YES"; else cout<< "NO"; return 0; }
ALGO
0.999881
3.402847
b12c4bf0-bb94-4bff-bb5e-841e3dcbfbf8
wei-han/LeetCode
216_Combination Sum III.cpp
class Solution { public: void combination(vector<vector<int>> &result, vector<int> item, int k, int n){ if(item.size() == k && n==0) { result.push_back(item); return; } if( item.size()<k ){ for(int i = item.empty()? 1: item.back()+1 ; i<=9; i++){ ...
ALGO
0.999956
6.648728
1393b3a0-b454-4070-b840-e6f1abe6e374
View-MG/2110328-Data-Structures-and-Algorithms
Algorithms/Dynamic_Programming/a60b_q1_diagsum/a60b_q1_diagsum.cpp
#include<bits/stdc++.h> using namespace std; int findmaximum(vector<int> &v){ int current{0},maxs{-99999}; for(int i{0} ; i<v.size() ; i++){ current = max(current+v[i],v[i]); maxs = max(current,maxs); } return maxs; } int main(){ int n; cin >> n; vector<vector<int>> diag(n,vect...
ALGO
0.999983
4.01318
5480f8c9-d68b-464c-8d59-79290122fb9a
wxy1245/Numerical-Algebra-
Iteration/Iteration/MyTest.cpp
#include<iostream> #include <vector> #include"Function.h" #include"auxiliary.h" using namespace std; /* int main() { int N = 3; unsigned count; vector<vector<double>> A(N, vector<double>(N, 0)); vector<double> b(N, 0); vector<double> x(N, 0); //ĵֵΪ A[0][0] = 1; A[0][1] = 2; A[0][2] = -2; b[0] = 1; A[1][0] = 1;...
ALGO
0.99993
3.817254
cd9735e8-5938-46ee-881a-21d31f9d9cbb
polarr/competitive-programming
Codeforces/2125/E.cpp
/** * Solution by Charles Ran (polarity.sh) * Date: 2025-07-22 * Contest: * Problem: E **/ #include <bits/stdc++.h> using namespace std; using ull = unsigned long long; using ll = long long; using vi = vector<int>; using vl = vector<ll>; using pii = pair<int, int>; #define pb push_back #define rep(i, a, b) for(i...
ALGO
0.999921
5.440867
377f7a1e-6d18-49a8-8f83-37990020513f
SMiles02/CompetitiveProgramming
Codeforces/CF 1300 - 1399/CF1385/CF1385B.cpp
#include <bits/stdc++.h> #define ll long long #define sz(x) (int)(x).size() using namespace std; //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); //uniform_int_distribution<int>(1000,10000)(rng) ll binpow(ll a, ll b) { if (b == 0) return 1; ll res = binpow(a, b / 2); res*=res;...
ALGO
0.999667
3.619665
e3024f92-e942-46ad-82fa-fbfbd32f96ec
ducphanduyagentp/vbox-svn
src/VBox/Additions/3D/mesa/mesa-24.0.2/src/intel/compiler/brw_vec4_cmod_propagation.cpp
/** @file brw_vec4_cmod_propagation.cpp * * Really similar to brw_fs_cmod_propagation but adapted to vec4 needs. Check * brw_fs_cmod_propagation for further details on the rationale behind this * optimization. */ #include "brw_vec4.h" #include "brw_cfg.h" #include "brw_eu.h" namespace brw { static bool writemas...
ALGO
0.990468
7.35627
f81cec8b-6572-477e-bfbe-25ef8ee43f20
Rostlab/ConSurf
vagrant_ConSurf/rate4site.3.2.source_slow/sourceMar09/likeDistProp.cpp
// $Id: likeDistProp.cpp 391 2005-06-12 12:44:57Z ninio $ #include "likeDistProp.h" #include "numRec.h" const MDOUBLE likeDistProp::giveDistance( const vector<countTableComponentGam>& ctc, MDOUBLE& resL) const { const MDOUBLE MAXDISTANCE=2.0; // const MDOUBLE PRECISION_TOLL=0.001; const MDOUBLE ax=0,bx...
ALGO
0.999533
4.930998
e2503766-9269-4ab1-8cb3-b504b92ccc04
jtushya/DSA-Lab-Test-OBM
Labsheet codes/Labsheet 5/Program3.cpp
#include <bits/stdc++.h> using namespace std; // This function returns the total number of ways to reach stair n from stair i int totalWays(int i, int n) { // Base Case if (i == n) return 1; if (i > n) return 0; // You can take 1 step, 2 steps or 3 steps // Find number of ways if you take 1 step ...
ALGO
0.99998
4.184281
1a10e00e-d4a2-42c4-997b-03767919c7ff
pavlysamir/post_bet_app
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.9988
6.76073
eef642c9-489f-4117-8320-cb0b245cfe72
faiyazansari0010/Cpp-and-DSA-Preparation-CodingNinjas
Data Structures and Algorithms in C++/Binary Search Tree/Find Path in BST.cpp
#include<iostream> #include<bits/stdc++.h> #include<vector> #include<string> using namespace std; template <typename T> class BinaryTreeNode { public: T data; BinaryTreeNode<T> *left; BinaryTreeNode<T> *right; BinaryTreeNode(T data) { this->data = data; left = NULL; ...
ALGO
0.999933
4.118383
f4056d1f-4ac8-424e-b1a2-aa81b258ded6
fabberr/beecrowd-solutions
cpp/1277/main.cpp
// C++ stdlib #include <vector> #include <array> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <string> #include <string_view> #include <span> #include <iostream> #include <sstream> #include <algorithm> #include <utility> #include <limits> #include <memory> #include <new> // ...
ALGO
0.993892
6.568041
3a3f6149-c532-419f-ad03-67017f692d6a
Shikhar21121999/ds-algo-busted
number-of-triangles-graph.cpp
// program to print number of triangles in graph #include <bits/stdc++.h> using namespace std; #define pii pair<int,int> #define vpii vector<pii> #define vvpii vector <vpii> #define vi vector<int> #define vvi vector<vi> #define vb vector<bool> #define si stack<int> #define ll long long #define vll vector<ll> #define m...
ALGO
0.999988
5.465858
70bab0e5-2a8f-469b-a9a2-f928cc9b09b9
RiisDev/Roblox-Executor-Sources
2018 Sources/Cyber - V3rmillion/Cyber/LuaSourceFiles/lcode.cpp
#include <stdlib.h> #define lcode_c #define LUA_CORE #include "lua.hpp" #include "lcode.hpp" #include "ldebug.hpp" #include "ldo.hpp" #include "lgc.hpp" #include "llex.hpp" #include "lmem.hpp" #include "lobject.hpp" #include "lopcodes.hpp" #include "lparser.hpp" #include "ltable.hpp" #define hasjumps(e) ((e)->t != ...
TOOL
0.900441
5.532753
be2a27cd-332f-4811-9b2a-102b66de1735
kerasis/labASD1sem
5/lab5.cpp
#include <iostream> #include <vector> template <typename T> void insertionSort(std::vector<T>& mas) { for (int j = 1; j < mas.size(); j++) { T temp = mas[j]; int i = j - 1; while (i >= 0 && mas[i] > temp) { mas[i + 1] = mas[i]; i = i - 1; } ...
ALGO
0.999798
5.008721
2eccbc23-bedf-4229-be73-759c08f56c99
raincross7/code-similarity
codes/train_code/problem126/problem126_184.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int w, h; cin >> w >> h; priority_queue<ll, vector<ll>, greater<ll>> p, q; for (int i = 0; i < w; ++i) { ll pi; cin >> pi; p.push(pi); } for (int i = 0; i < h; ++i) { ll qi; cin >> qi; ...
ALGO
0.999962
3.674515
26431b5b-d1a9-484f-87e3-4cac6c89b8cd
Dakata99/CPP
OOP/Book of problems/Part 2/Additional tasks/3.Pointers to objects/task35/Polynom.cpp
#include "Polynom.h" #include <cmath> Polynom::Polynom(const size_t num, const double X) { x = X; max = num + 1; coeff = new double[max]; } Polynom::~Polynom() { delete[]coeff; } double Polynom::operator[](const size_t index)const { if (index < 0 || index > max - 1) { return 0; } ...
ALGO
0.999135
3.766135
331e8757-cb16-4bc3-8748-a9a8c6e77a69
mrapp-ke/MLRL-Boomer
cpp/subprojects/boosting/src/mlrl/boosting/prediction/predictor_binary_output_wise.cpp
#include "mlrl/boosting/prediction/predictor_binary_output_wise.hpp" #include "mlrl/boosting/prediction/discretization_function_probability.hpp" #include "mlrl/boosting/prediction/discretization_function_score.hpp" #include "mlrl/boosting/prediction/predictor_binary_common.hpp" #include "mlrl/boosting/prediction/trans...
ALGO
0.985931
7.977177
d13b83a8-df4c-47cb-85cc-9fb8485795b8
navytuner/basic-algorithm
0x0F-sorting-2 /1431.cpp
#include <bits/stdc++.h> using namespace std; string arr[50]; int sum(const string& str){ int len = str.length(); int cnt = 0; for (int i = 0; i < len; i++){ if (str[i] >= '0' && str[i] <= '9') { cnt += str[i] - '0'; } } return cnt; } bool compare(const string& a, cons...
ALGO
0.999882
5.558368
72e4a733-c4aa-43b4-9f24-6b37cf4e1179
Harshal-Sanas/Acad_Codes
CS 201 (Algorithm)/Lecture Qns/c++/Max_2nd_max_DNC.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: pair<int, int> find_max_2nd_max(const vector<int> &arr, int p, int r) { if (p == r) // Only one element { return {arr[p], INT_MIN}; // INT_MIN represents no second maximum } else if (r - p == 1) /...
ALGO
0.999985
5.193895
9f88a40f-e383-40b3-bdd5-ad2d30811c10
shiv127001/DSA
Lec_89 Maximum Path Sum in Binary Tree.cpp
#include <iostream> #include <vector> #include <stack> #include <map> #include <set> using namespace std; typedef struct node { int data; struct node *left; struct node *right; } node; int pathsum(node *root, int &maxi) { if (root == NULL) { return 0; } int lsum = max(0, pathsum(r...
ALGO
0.999992
5.196061
839460eb-b368-4914-8665-057e967d3a2f
PengDeiDei/INFO-6350-SEA-Spring24
Final Project/final_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.99859
6.76073
e2e3b84a-d1d4-46f4-8b3e-b960c54c1828
ZhenyingZhu/ClassicAlgorithms
src/CPP/src/leetcode/PathSum.cpp
/* * [Source] https://leetcode.com/problems/path-sum/ * [Difficulty]: Easy * [Tag]: Tree * [Tag]: Depth-first Search */ #include <iostream> using namespace std; // [Solution]: DFS. backtracking. // [Corner Case]: class Solution { }; /* Java solution https://github.com/ZhenyingZhu/ClassicAlgorithms/blob/master/...
ALGO
0.999921
6.471478
4c2792a4-8c78-494b-bbf2-73f9364b0504
Aman-droid/CP_Essentials
CODES/D_Binary_String_To_Subsequences.cpp
#include<bits/stdc++.h> #define ll long long #define int long long #define endl '\n' #define rep(i,a,b) for(int i=a;i<=b;i++) #define pll pair<ll,ll> #define pii pair<int,int> #define vpll vector<pll> #define SZ(x) ((int)x.size()) #define FIO ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL) #define watch(x)...
ALGO
0.999955
4.65316
f2321ff4-ab9b-424e-883a-e8de9575aa95
MioZh/asbdbsdbas
Lab8/H.cpp
#include <iostream> #include <unordered_set> using namespace std; long long p = 31; long long get_hash(string s) { long long h = 0; for (int i = 0; i < s.size(); i++) { h = (h * p + (s[i] - 'a' + 1)); } return h; } bool rk(string s, string t) { int n = s.length(), m = t.length(); int...
ALGO
0.999992
5.114003
b058365f-8e56-47ef-81cf-792057a668b4
Anggerdhismakusuma/Algorithm-and-Programming
Repetition part 2/AS.cpp
// Hard Problem #include <stdio.h> int main() { int T, N, nilai, temp = 0; char jawaban[100], kunci[100]; scanf("%d", &T); for (int tc = 1; tc <= T; tc++) { scanf("%d", &N); getchar(); scanf("%[^\n]", jawaban); getchar(); scanf("%[^\n]", kunci); getchar(); for (int i = ...
ALGO
0.994812
3.36532
dad455dd-4155-4ca4-906e-028ea073ce14
gauravkatara53/DSA
Week 15 Heaps/class 2/kthSmallestElement.cpp
// find kth smallest element #include<iostream> #include<queue> using namespace std; int getKthSmallestElement(int arr[], int n, int k){ priority_queue<int> pq; // process first k element for(int i=0; i<k; i++){ int element = arr[i]; pq.push(element); } // remaining element ko tab...
ALGO
0.999988
4.869891
b6261f91-1665-4d8e-be9d-5b98c801675f
Fazziekey/leetcode
DFS-BFS/386字典序排数.cpp
class Solution { public: vector<int> lexicalOrder(int n) { vector<int> ret(n); int number = 1; for (int i = 0; i < n; i++) { ret[i] = number; if (number * 10 <= n) { number *= 10; } else { while (number % 10 == 9 || number +...
ALGO
0.999833
6.854959
fe76c838-14e5-4910-93f4-978b6aa7b6e9
anmolsahu2k/DSA
Binary Trees/10. right_view.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // Tree Node struct Node { int data; Node* left; Node* right; }; // Utility function to create a new Tree Node Node* newNode(int val) { Node* temp = new Node; temp->data = val; temp->left = NULL; temp->right = NULL; ...
ALGO
0.999792
6.219295
64522386-4550-4c6b-bfd6-36a0550a76ed
domfarolino/algorithms
src/algorithm_practice/Datastructure_Algorithms/Tree/populateNextRightPointers/populate.cpp
#include <iostream> // Source: https://leetcode.com/problems/populating-next-right-pointers-in-each-node/description/ /** * Populating next right pointers in each node * This problem is really cool! We are given the wonderful guarantee that the input * tree is perfect. Given a NULL tree (NULL root) however, we sho...
ALGO
0.998315
6.18909
ab2cd12e-0a35-408b-9b56-532ca7869659
ishandutta2007/codeforces
wlzhouzhuan/normal/1458/A.cpp
// Author: wlzhouzhuan #pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define pii pair<int, int> #define pb push_back #define fir first #define sec second #define rep(i, l, r) for (int i = l;...
ALGO
0.999981
3.232243
030e9776-d5c8-44d2-a43f-90ad94e126c7
guidoasbun/CppSTLAlgorithmLab
Functions.cpp
// // Created by Guido Asbun on 10/23/21. // CLion 2021.2.2 // #include "Functions.h" #include <vector> #include <iostream> #include <numeric> #include <list> using namespace std; void displayScores(vector<int>& scores) { // Part 1 /************************************* Do NOT use endl or \n *******...
TOOL
0.993901
5.085896
1e2bc8f3-b57c-4890-ad77-4a55bb336332
metehkaya/Algo-Archive
Problems/LeetCode/Solutions/1989.Maximum_Number_of_People_That_Can_Be_Caught_in_Tag.cpp
class Solution { public: int catchMaximumAmountofPeople(vector<int>& v, int d) { int n = v.size() , ans = 0; queue<int> q[2]; for( int i = 0 ; i < n ; i++ ) { for( int k = 0 ; k < 2 ; k++ ) while(!q[k].empty() and i-q[k].front() > d) q[k].pop()...
ALGO
0.999936
5.616879
b8a66ea8-6f2c-4163-86f9-907d3ba9ee45
wolfvoid/HNU-resourses
学类核心-程序设计(84)/程序设计-作业/3/3.2.cpp
#include<bits/stdc++.h> using namespace std; int main() { //90ּ ΪA8089ΪB7079ΪC6069 ΪD60ΪE int n; cin>>n; if (n>=90) cout<<"A"; else if (n>=80) cout<<"B"; else if (n>=70) cout<<"C"; else if (n>=60) cout<<"D"; else cout<<"E"; return 0; }
ALGO
0.998496
3.634547
f393f4c8-6276-4a0b-8811-806930adc42b
2dongheee/Udacity-CarND-Path-Planning-Project
src/Eigen-3.3/unsupported/doc/examples/MatrixExponential.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; int main() { const double pi = std::acos(-1.0); MatrixXd A(3,3); A << 0, -pi/4, 0, pi/4, 0, 0, 0, 0, 0; std::cout << "The matrix A is:\n" << A << "\n\n"; std::cout << "The matrix exponential ...
ALGO
0.999651
3.706936
48945e4f-8a92-4218-878f-dc356492b47f
soonduck-dreams/algorithm-problem-solving
baekjoon/11758.cpp
// cross product의 성질을 이용해서 회전 방향을 구하는 ccw 알고리즘을 이용 #define FASTIO ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr) #include <iostream> #include <vector> using namespace std; int main(void) { FASTIO; short p[3][2]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) { cin >> p[i]...
ALGO
0.999996
4.615817
a3c6553c-e30d-41ef-a551-3d71b6b0abc6
peter1456/UVA-codes
11286.cpp
#include<cstdio> #include<map> #include<vector> #include<algorithm> using namespace std; int main(){ int n, max, tmp, count; vector<int> tmpvec; map<vector<int>, int> mp; while(scanf("%d", &n), n){ mp.clear(); while(n--){ tmpvec.clear(); for(int i = 0; i < 5; i++...
ALGO
0.999777
3.711801
4bce50ef-057f-433a-8606-f262408c2b8f
VisheshSaluja/DSA
210-course-schedule-ii/course-schedule-ii.cpp
class Solution { public: vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites) { vector<vector<int>> adj(numCourses); queue<int> q; vector<int> indegree(numCourses, 0); for(auto it: prerequisites){ adj[it[1]].push_back(it[0]); } for(i...
ALGO
0.999969
6.360338
d07c9bff-fece-4de8-b4c0-fb2af0238ef7
huudat31/CSES_solve
Permutations.cpp
#include<bits/stdc++.h> using namespace std; int main (){ int n; cin >> n; if(n == 1){ cout<< 1; } else if(n == 2 ||n == 3){ cout<< "NO SOLUTION"; } else { for(int i = 1;i<=n;i++){ if(i %2 == 0){ cout<< i<< " "; } } ...
ALGO
0.999997
3.868848
af1293f3-c382-4fc7-8744-d3f305b42937
yellowHatpro/Codes-Practice
Trees/BST/LargestBSTInBT.cpp
#include <bits/stdc++.h> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right...
ALGO
0.999822
6.567648
d6f0e03c-218f-42d9-af8d-f3eb120ed2b6
islamifelipe/Transgene-tico-PCV2
Implementacao/Grafo.cpp
#include "Grafo.h" #include <iostream> using namespace std; Grafo::Grafo(){}; Grafo::~Grafo(){} Grafo::Grafo(const Grafo& t){ n = t.n; lista_vertices = t.lista_vertices; adjacencia = t.adjacencia; for (int i=0; i<t.lista_allArestas.size(); i++){ particao[i] = t.particao.at(i); } lista_allArestas = t.lista_a...
ALGO
0.932026
3.961995
2abd096c-4dc1-4da4-a7f2-f8251b6df178
wonju-cho/Algorithm_Problems
Baekjoon/22860_organize_files.cpp
#include <iostream> #include <unordered_set> #include <vector> #include <unordered_map> #include <string> using namespace std; struct Folder { vector<string> files; vector<Folder*> childs; }; int N; int M; int Q; pair<int,int> FileCnt(Folder f, pair<int,int>& res, unordered_set<string>& s) { for(auto f : f.files)...
ALGO
0.998733
3.920771
02ca31f4-27bd-421d-9d83-4fadfbe28573
MariaKonsmo/compulsory3
Compulsory3/Compulsory3/Graph_class.cpp
#include "Graph_class.h" //empty constructure of the "graph" class. Constructors are special member functions used to initialize objects of the class. In this case, // the constructor initializes the graph. Since it's an empty constructor, it doesn't perform any specific initialization operations. // The Graph class ...
ALGO
0.858126
6.133528
8e3b4478-90fd-44e4-9af9-0d957aa7ed28
leeeyupeng/leeeyupeng.github.io
project/algorithm/leetcode/src/1004.longestOnes_1.cpp
#include"leetcode.h" class Solution { public: int longestOnes(vector<int>& A, int K) { int n = A.size(); if(n==0){return 0;} int ret = 0; int i = 0,j=0; int counter = 0; while(j<n){ if(A[j] == 1){j++;} else{ if(counter == K){ ...
ALGO
0.999849
6.044847
da3bffc9-d335-43d0-a94e-60625fa76522
DahamChoi/Algorithm
물통/물통.cpp
#include <iostream> #include <vector> #include <queue> #include <map> #include <climits> using namespace std; int a, b, c, d; int answer = INT_MAX; struct queue_info { int x, y, depth; }; queue_info fill_a(queue_info& q) { return { a, q.y, q.depth + 1 }; } queue_info fill_b(queue_info& q) { return { q.x, b, q.d...
ALGO
0.999941
3.768969
4d38632d-8b6d-4f9f-b734-d2ca98bfbb6b
AnishDhomase/Code2.O
1039-find-the-town-judge/find-the-town-judge.cpp
class Solution { public: int findJudge(int n, vector<vector<int>>& trust) { int judgeCt = 0, judge = -1; vector<pair<int,int>> degree(n+1,{0,0}); //{in,out} for(auto tr : trust){ degree[tr[0]].second++; degree[tr[1]].first++; } for(int i=1; i<=n; i++){...
ALGO
0.999931
5.523159
30b8014b-9195-4446-9fe0-02e1a50c51eb
Rubgish/AoC_2022
day4a.cpp
#include "utils.hpp" int main(int argc, char *argv[]) { auto input = read_input("day4_input"); std::regex reg_exp("([0-9]+)-([0-9]+),([0-9]+)-([0-9]+)"); std::smatch reg_out; int contained_count = 0; for (auto &&x : input) { if (std::regex_search(x, reg_out, reg_exp)) { ...
ALGO
0.99603
5.501569
7c7ae62d-7fd6-408d-959a-b685c5c9895d
Foysal-Munsy/Rush-Roadmap
Week-04/Day 01/Possible or not.cpp
/******************** * ------------- * * Author:Foysal * * ------------- * ********************/ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef complex<ld> cd; typedef pair<int, int> pi; typedef pair<ll,ll> pl; typedef pair<ld,ld> pd; typedef vector<in...
ALGO
0.999933
4.646418
3e7bf481-0849-458c-afe6-1ff520cd3c9f
bitwisegaurav/DSA
Cpp/Trie.cpp
#include "header.h" string toLowerCase(string word){ for (int i = 0; i < word.length(); i++) word[i] = tolower(word[i]); return word; } class Node { private: char data; bool isTerminal; int numCharacters; public: Node** characters; Node(int n = 26) { data = '\0'; n...
ALGO
0.999085
4.870162
7d9dd45d-f716-4953-888c-a5996eb438b4
Gabesty44/Tema-13-03-2025
MinimizeSum/main.cpp
#include <bits/stdc++.h> using namespace std; ifstream fin("minimizesum.in"); ofstream fout("minimizesum.out"); long long cerinta,n,i,j,k,v[500005],suma,minim; bool change; void schimb() { if(v[i-1]+v[i+1]-v[i]<v[i]) { v[i]=v[i-1]+v[i+1]-v[i]; change=true; k++; } } int main() { ...
ALGO
0.999971
3.778221
3fe9955f-16b3-449e-8c2f-adc92639538c
allem40306/Competitive-Programming
zerojudge/A750~999/zja810.cpp
#include <iostream> using namespace std; #define MAX 0x7FFFFFFFFFFFFFFF #define LL long long #define abs(a) ((a)<0ll?-(a):(a)) LL lcm(LL x, LL y){ LL z, xx = x, yy = y; if (x < y)z = x, x = y, y = z; if (y == 0ll)return 0ll; while (x % y){z = x%y, x = y, y = z;} xx /= y; if (xx > MAX / yy) return MAX; else retu...
ALGO
0.999645
3.641516
4179754a-0dca-40f7-bf21-6bcfad63d49e
Nahin-CDR/CodeForces
Rating : 800/A. Vasya and Coins.cpp
//Solver : Nahin the Coder //Date : 04-04-2022 #include<bits/stdc++.h> using namespace std; int main() { int test; cin>>test; while(test--) { long long a,b; cin>>a>>b; if(a == 0 and b == 0) { cout<<1<<endl; } else if(a == 0) { ...
ALGO
0.999376
4.407437
6bf34628-b0b5-410b-8567-3dc86ccf8c24
changmu/StructureAndAlgorithm
HDOJ/1106.cpp
////////////////////System Comment//////////////////// ////Welcome to Hangzhou Dianzi University Online Judge ////http://acm.hdu.edu.cn ////////////////////////////////////////////////////// ////Username: changmu ////Nickname: ľ ////Run ID: ////Submit time: 2014-01-23 22:31:07 ////Compiler: GUN C++ ///////////////////...
ALGO
0.999781
3.440947
e16dcbf0-36b8-4d17-91dc-735d938bbd16
sapjv/SAPJV_Codes
Tree/Binary Tree InOrder Traversal Iterative using stack.cpp
// Binary Tree InOrder Traversal Iterative using stack.cpp vector<int> inorderTraversal(TreeNode* root) { vector<int> result; if(root == NULL){ return result; } stack<TreeNode *> st; TreeNode *currentNode = root; while(currentNode != NULL || (!st.empty())){ while(currentNode != NULL){ st.push(currentNode)...
ALGO
0.999983
6.091613
600c96f6-a9f9-41dc-86eb-52281923a6d4
Kalebfantu321/Projects
Assign8/inpost.cpp
// // inpost.cpp // Assign8 // // Created by Kaleb Fantu on 10/26/22. // #include "inpost.hpp" #include "mystack.h" #include <string> using namespace std; string convert(const string& infix) { mystack opstack; string postfix = ""; for(size_t i = 0; i < infix.length(); i++) { char token = ...
ALGO
0.966515
4.478885
1b2c39b7-e925-433d-981d-39e535d42163
all1m-algorithm-study/2021-1-Algorithm-Study
week2/Group4/boj1026_gganada.cpp
#include <iostream> #include <string> #include <algorithm> #include <utility> #include <string.h> #include <math.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; int a[50], b[50], c,d[50],e; for (int i = 0; i < n; i++) { cin >> a[i]; } ...
ALGO
0.99997
3.005768
b97e82ed-8763-42e4-be57-f727bc892763
eddyson1006/ue4.25-pro-max
Engine/Source/ThirdParty/CryptoPP/5.6.2/include/safer.cpp
// safer.cpp - modified by by Wei Dai from Richard De Moliner's safer.c #include "pch.h" #include "safer.h" #include "misc.h" #include "argnames.h" NAMESPACE_BEGIN(CryptoPP) const byte SAFER::Base::exp_tab[256] = {1, 45, 226, 147, 190, 69, 21, 174, 120, 3, 135, 164, 184, 56, 207, 63, 8, 103, 9, 148, 235, 38, 168,...
ALGO
0.996071
6.981608
4c19f3c7-57ed-48e9-ab2a-a94a0b351337
satyamtiwari736182/CP
pepcoding/Level 1/5_Recursion_Backtracking/2_Target Sum Subsets.cpp
// 1. You are given a number n, representing the count of elements. // 2. You are given n numbers. // 3. You are given a number "tar". // 4. Complete the body of printTargetSumSubsets function - without changing signature - to calculate and print all subsets of given elements, the contents of which sum to "tar". Use sa...
ALGO
0.999017
4.88809
d150e04e-7939-4138-afa7-535efe3ffae8
ishandutta2007/codeforces
packer_jp/normal/1559/B.cpp
#include <bits/stdc++.h> using namespace std; #define all(a) (a).begin(), (a).end() using ll = long long; using ull = unsigned long long; using vll = vector<ll>; constexpr ll dy[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0}; constexpr ll dx[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0}; constexpr ull bit(int n) { return 1ull << n; } cons...
ALGO
0.999975
4.584009
672a49f6-d686-4f86-a092-d4d5d2422dc3
ITmaze/snapmaker-firmware
Marlin/src/gcode/bedlevel/abl/G29.cpp
/** * G29.cpp - Auto Bed Leveling */ #include "../../../inc/MarlinConfig.h" #if HAS_ABL_NOT_UBL #include "../../gcode.h" #include "../../../feature/bedlevel/bedlevel.h" #include "../../../module/motion.h" #include "../../../module/planner.h" #include "../../../module/stepper.h" #include "../../../module/probe.h" #...
ALGO
0.980261
7.279965
1fd3dbc5-3aa8-4660-833d-1fa0a3e47017
jercytryn/inception
thirdParty/vpdetection/JLinkage/Src/matlab/JLinkageLibRandomSamplerMex.cpp
// JLinkageLibRandomSamplerMex.cpp : mex-function interface implentation file #include "RandomSampler.h" #include "JLinkage.h" #include "PrimitiveFunctions.h" #include "../../VPPrimitive.h" //FC #include "mex.h" // Create the waitbar mxArray *hw,*title,*percent; double *percentDoublePtr; mxArray *input_array[3]; mxAr...
ALGO
0.977488
5.299669
7fc15e3d-8f3e-4b45-b91e-07eb660a763d
Phenom-AOSP/frameworks_av
media/libstagefright/codecs/amrnb/dec/src/a_refl.cpp
/* ------------------------------------------------------------------------------ Filename: /audio/gsm-amr/c/src/a_refl.c Functions: a_refl Date: 02/05/2002 ------------------------------------------------------------------------------ REVISION HISTORY Description: Removing unneeded include files and the ...
ALGO
0.999858
5.786362
efca5918-d303-4af5-968e-596f457ab024
Abhinav30072003/A2Z-Solutions
majorityelement.cpp
class Solution { public: int majorityElement(vector<int>& nums) { int candidate = nums[0], count = 1; for (int i = 1; i < nums.size(); i++) { if (nums[i] == candidate) count++; else if (--count == 0) candidate = nums[i], count = 1; } return candidate; } };...
ALGO
0.999868
6.010206
8196dd08-1bc9-4526-813f-0db03eb5886d
TONYBRYANT1/ZUO---algorithm-and-data-strcuture
CODE/13.Implementing queues and stacks with linked lists and arrays/To Implement CircularQueue/code.cpp
// CircularQueue 关键在与边界处理 // 同时在队列中的数不超过 N #include<bits/stdc++.h> using namespace std; const int N = 5; int Queue[N] , l=0 , r=0 , size=0 , Limit=N; bool IsFull() { return size == Limit; } bool IsEmpty() { return size == 0; } // 满了不能加 // 边界处理 bool Offer(int x) { if(IsFull()) { return false...
ALGO
0.999534
4.322897
490b4e5e-5c68-43e5-94c2-843633ae8a91
IamRash-7/LeetCode
300-longest-increasing-subsequence/300-longest-increasing-subsequence.cpp
class Solution { public: int lengthOfLIS(vector<int>& nums) { vector<int> dp(nums.size(), 1); for(int i=nums.size()-1;i>=0;i--) { for(int j=i-1;j>=0;j--) { if(nums[j]<nums[i]) { dp[j] = max(dp[j], dp[i]+1); ...
ALGO
0.999973
5.95667
43bee6c2-7b04-4509-8630-e6f49d427feb
ishandutta2007/codeforces
boook/normal/1240/D.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; #define REP(i,j,k) for(int i = j ; i < k ; ++i) #define RREP(i,j,k) for(int i = j ; i >=k ; --i) #define F first #define S second #define mp make_pair #define pb emplace_back #define PII pair<int , int> #...
ALGO
0.999918
4.250756
5a2c3105-661a-41e6-89e6-c2f6119c75a6
linux4life798/llvm-project-ci-test
libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_constexpr.pass.cpp
// <algorithm> // template<RandomAccessIterator Iter> // requires ShuffleIterator<Iter> // && LessThanComparable<Iter::value_type> // void // sort(Iter first, Iter last); #include <algorithm> #include <cassert> #include "test_macros.h" #include "test_iterators.h" #include "MoveOnly.h" const int LargeN...
TEST
0.982375
7.441508
5e64019d-42c8-48bf-853c-64e0090a2abe
landaire/llvm-project
llvm/lib/Transforms/Scalar/GuardWidening.cpp
#include "llvm/Transforms/Scalar/GuardWidening.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/BranchProbabilityInfo.h" #include "llvm/Analysis/GuardUtils.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/LoopPass.h" #includ...
TOOL
0.995569
7.964836
40b75563-9314-449a-970c-092cd3722819
bad-coco/LeetCode
array/house-robber-ii.cpp
class Solution { public: int f(vector<int>& nums, int n, int start) { int prev = 0; int prev2 = 0; int curr = 0; for (int i = start+1; i <= n; i++) { int left = nums[i - 1] + prev2; int right = prev; curr = max(left, right); prev2 = pre...
ALGO
0.999908
5.865445
5fe97a58-17c6-4930-bd8c-ace18aef9d75
ishandutta2007/codeforces
bluediamond/normal/379/C.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,first_free=1; cin>>n; vector<pair<int, int>> a(n); vector<int> sol(n); for (int i=0;i<n;i++) { cin>>a[i].first; a[i].second=i; } sort(a.begin(), a.end()); for (auto &x:a){ so...
ALGO
0.999971
3.608198
c5501dd7-8814-456c-b22a-18329ee1ea23
lakshayEXE/Leetcode_question
232-implement-queue-using-stacks/implement-queue-using-stacks.cpp
class MyQueue { public: stack<int>s1; stack<int>s2; MyQueue() { } void push(int x) { while(s1.size()){ s2.push(s1.top()); s1.pop(); } s2.push(x); while(s2.size()){ s1.push(s2.top()); s2.pop(); } ...
ALGO
0.997495
5.55645
7fec408d-40ca-4e79-b009-8ec3c2da80a0
VenkataAnilKumar/LeetCode
Solutions/searchForRange/searchInsertPosition.cpp
// Source : https://oj.leetcode.com/problems/search-insert-position/ // Author : Venkata Anil Kumar /********************************************************************************** * * Given a sorted array and a target value, return the index if the target is found. * If not, return the index where it would be i...
ALGO
0.999989
6.090519
5450496f-c197-48ee-8975-7af87f88a2bf
theiyobosa/probabilistic-robotics
ProbabilisticRobotics/door_open_or_close.cpp
#include "door_open_or_close.h" SensorRobot::SensorRobot(float z_open_X_open, float z_closed_X_open, float z_open_X_closed, float z_closed_X_closed) { this->sensor_p_z_open_when_X_open = z_open_X_open; this->sensor_p_z_closed_when_X_open = z_closed_X_open; this->sensor_p_z_open_when_X_closed = z_open_X_clos...
TOOL
0.925317
5.515393
0e9080ac-fdc0-4467-9ece-20421a3861da
aokblast/LeetCode_Problem_Solving
Medium/2187_Minimum_Time_to_Complete_Trips.cpp
//Binary Search //Runtime 243 //Memory Usage 94.5 class Solution { public: long long minimumTime(vector<int>& time, int totalTrips) { long long l = 1, r = 100000000000000; while(l < r) { long long mid = l + (r - l) / 2; long long cur = 0; for(const auto t : tim...
ALGO
0.99998
6.189192
457cc7a9-6c94-4955-8acc-a6e22874fe32
aeshwin10/LeetcodeDSA
1986-largest-color-value-in-a-directed-graph/1986-largest-color-value-in-a-directed-graph.cpp
class Solution { public: int largestPathValue(string colors, vector<vector<int>>& edges) { int n = colors.size(); vector<vector<int>> adj(n); vector<int> indegree(n, 0); for (auto& edge : edges) { adj[edge[0]].push_back(edge[1]); indegree[edge[1]]++; ...
ALGO
0.999775
6.011733
5c26e6bf-2464-46f1-b193-af9f859ea2f0
syk22/kpro
problems/abc315/b/main1.cpp
#include <bits/stdc++.h> using namespace std; #define REP(i, a, n) for (int i = (a); i < (n); ++i) int M, d, m = 0; int main() { cin >> M; vector<int> D = {}; REP (i, 0, M) { cin >> d; REP (j, 0, d) D.push_back(j + 1); } REP (i, 0, D.size() / 2 + 1) { if (D[i] == 1) ++m; } cout << m << '...
ALGO
0.999941
5.058437
3088d7cd-31ca-48b5-8b4c-ff70cc37de35
n-a-hashjin/CarND-Path-Planning
src/Eigen-3.3/bench/bench_gemm.cpp
// g++-4.4 bench_gemm.cpp -I .. -O2 -DNDEBUG -lrt -fopenmp && OMP_NUM_THREADS=2 ./a.out // icpc bench_gemm.cpp -I .. -O3 -DNDEBUG -lrt -openmp && OMP_NUM_THREADS=2 ./a.out // Compilation options: // // -DSCALAR=std::complex<double> // -DSCALARA=double or -DSCALARB=double // -DHAVE_BLAS // -DDECOUPLED // #include...
TOOL
0.938023
5.829477
5837eeff-0775-4ee6-9e5d-35bf2c01fe87
joncampbell123/openwatcom-hackipedia
bld/plustest/regress/datainit/idata24.cpp
#include <stdio.h> int main( void ) { int i = 0; int &r = i; printf( "%d %d\n", i, r ); r = 1; int *p = &r; int &rr = r; printf( "%d %d %d %d\n", i, r, *p, rr ); return 0; }
TOOL
0.856399
3.131833
b64f3dd3-a08e-4a54-98ea-ae13dfe3c1e4
akshit-jain01/dsa_cpp
p12.cpp
#include<bits/stdc++.h> using namespace std; int main(){ for(int i=1;i<=4;i++) { for(int j=0;j<i;j++) cout<<j+1; for(int k=0;k<4-i;k++) cout<<" "; for(int k=0;k<4-i;k++) cout<<" "; for(int j=i;j>0;j--) cout<<j; cout<<endl; } return 0; }
ALGO
0.999713
3.156191
02083740-f1c4-47d4-8ca3-a30b90f3d218
Xelerezex/languages-playground
C++/Art-Of-Development-C++/3-red-belt/week-4/01-effective-rsrv-vect.cpp
#include <iostream> #include <vector> #include "profile.h" using namespace std; int main() { int vec_size = 100'000'000; { LOG_DURATION("push_back"); vector<int> v; for (int i = 0; i < vec_size; ++i) { v.push_back(i); } } { LOG_DURATION("push_back & ...
TOOL
0.924957
5.121034
7949eb16-76e4-48ce-82f4-4a226824b415
ByteFries/DX_2023
2303_WINAPI/ConsoleApplication1/DP.cpp
#include <iostream> #include <vector> #include <windows.h> using namespace std; vector<int> cache = vector<int>(100, -1); int Fibonacci(int n, int& count) { // if (n == 0 || n == 1) return 1; if (n == 2) count++; // ޸̼ // κб ã , cacheٰ س if (cache[n] != -1) return cache[n]; // ϱ cache[n] = Fibona...
ALGO
0.999375
5.265437
d8145149-a905-41f7-873f-70ae677264cd
viftode4/PBINFOOOO
Info/asmax/main.cpp
#include <bits/stdc++.h> using namespace std; ifstream fin( "asmax.in" ); ofstream fout( "asmax.out" ); int n, x, y; int sol = -1 * INT_MAX; vector<int>g[16005]; int cost[16005]; int use[16005]; int dp[16005]; void dfs( int x ) { use[x] = 1; for( auto it : g[x] ) if( !use[it] ) { ...
ALGO
0.99981
3.88266
fbd585d1-4c1a-4ce0-a309-d56cd1da24d6
algorithm001/algorithm
Week_01/id_131/LeetCode_687_131.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; 㷨 getMaxLen Ϊӽڵ node ͷijȡ node.Left ڵ node ֵͬ ֵͻ 1 + getMaxLen node.right ڵҲһ Ǽ󳤶ʱѡ𰸽Ǹýڵϵļͷ֮͡ǽЩѡ𰸼¼Ѵ𰸡 */ class Solution {...
ALGO
0.999723
6.263453
3e41dff1-d4ee-4ff8-89a5-bde7489d49be
MatSciTools/HFCalc
boost_1_79_0/libs/numeric/ublas/doc/samples/assignment_examples.cpp
#include <boost/numeric/ublas/assignment.hpp> #include <boost/numeric/ublas/vector.hpp> #include <boost/numeric/ublas/vector_proxy.hpp> #include <boost/numeric/ublas/matrix_proxy.hpp> #include <boost/numeric/ublas/vector_sparse.hpp> #include <boost/numeric/ublas/matrix_sparse.hpp> #include <boost/numeric/ublas/io.hpp> ...
TOOL
0.900905
3.670881
4aaafe02-4cd6-4f63-b41e-8f31b662648f
bglick13/nexa_gym
src/consensus/tx_verify.cpp
#include "tx_verify.h" #include "consensus.h" #include "grouptokens.h" #include "main.h" #include "primitives/transaction.h" #include "script/interpreter.h" #include "tweak.h" #include "unlimited.h" #include "validation.h" // TODO remove the following dependencies #include "chain.h" #include "coins.h" #include "utilm...
ALGO
0.972699
6.481456
9a33eb9b-39e9-4843-a30c-1f23f739763f
yk1002/CarND-Path-Planning-Project
src/Eigen-3.3/doc/examples/Tutorial_ArrayClass_cwise_other.cpp
#include <Eigen/Dense> #include <iostream> using namespace Eigen; using namespace std; int main() { ArrayXf a = ArrayXf::Random(5); a *= 2; cout << "a =" << endl << a << endl; cout << "a.abs() =" << endl << a.abs() << endl; cout << "a.abs().sqrt() =" << endl << a.abs().sqrt() << endl...
ALGO
0.953006
3.130341
66997c93-83e4-4664-b25c-7a259b20702d
chopingu/competitive_programming
neetcode/math_and_geometry/set_matrix_zeros.cpp
class Solution { public: void setZeroes(vector<vector<int>>& matrix) { int flag = 0, n = matrix.size(), m = matrix[0].size(); for(int i = 0; i < n; i++) for(int j = 0; j < m; j++) if(!matrix[i][j]) { matrix[0][j] = 0; if(i) ...
ALGO
0.998423
6.275259
e4e450ff-9255-4546-a96d-9e5bf5231a2f
LCC-CIT/CS161CPP-CourseMaterials
Examples/DiceRollMatchingGame.cpp
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; void displayInstructions(); bool getYesNo(string); int rollDie(int compRoll); int highScore(int score); int lowScore(int score); int high = 0; int low = 10000000; int main() { srand(time(NULL)); displayInstructions(); do {...
TOOL
0.999114
5.367746