uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
29a7937d-06ec-4871-b4eb-3119b72d656c
sk1805/Advanced-Programming-UVA-
Solutions/176-InternetBandwidth-solved-(UVA 820).cpp
#include <iostream> #include <stdio.h> #include <string.h> #include <queue> #include <algorithm> #include <limits.h> #define MaxNodes 101 using namespace std; int Graph[MaxNodes][MaxNodes],parent[MaxNodes]; bool bfs(int N,int src, int trgt) { bool visited[N]; memset(visited, false, sizeof(visited)); queue<...
ALGO
0.999717
3.616611
740958af-a877-4c38-bb41-f2dc4b3e08ae
lucasnar/competitive-programming
SPOJ/CHAMADA1/CHAMADA1.cpp
#include<cstdio> #include<string.h> int main(){ int n, k; char names[110][25]; char temp[25]; scanf(" %d %d", &n, &k); for (int i = 1; i<=n; ++i) scanf(" %s", names[i]); //for (int i = 1; i<=n; ++i) printf(" %s\n", names[i]); //printf("\n"); for (int i = 1; i<=n; ++i) for...
ALGO
0.999944
3.106944
3b412666-5f61-467a-bae3-aa8eb7937645
jakev/CobraDroidBeta
src/frameworks/base/media/libstagefright/codecs/amrnb/enc/src/hp_max.cpp
/* ------------------------------------------------------------------------------ Filename: /audio/gsm_amr/c/src/hp_max.c Date: 02/01/2002 ------------------------------------------------------------------------------ REVISION HISTORY Description: Replaced "int" and/or "char" with OSCL defined types. Des...
ALGO
0.999542
7.219464
f9482d29-08bb-4666-9a48-bc9bd318153c
TSimmz/MiniSim
Arduino/MiniSim/Simulation.cpp
//================================================================ // Simulation.cpp //================================================================ #include "Simulation.h" //====================================================== // Constructor //====================================================== Simulation::S...
ALGO
0.991913
4.798919
e6924d35-ce6d-4b8c-aecb-5a9fd18d77ad
KIT-IBT/CardioMechanics
electrophysiology/src/MathBasics/MatrixTools.cpp
#include <MatrixTools.h> #include <algorithm> class isort_compare { // Cmp class for isort double *keys; public: inline int operator()(const int &a1, const int &a2) const { return fabs(*(keys+a1)) > fabs(*(keys+a2)); } isort_compare(double *k) { keys = k; } }; CMatrixStructure::CMatrixStructure(...
ALGO
0.992242
4.374684
5036578a-8b6b-40c4-bf17-10b015dec807
Wuffluv/Structure-of-algoritm-and-data-Processing
Лабы/Лабораторная работа №11/Лабораторная работа №11/Лабораторная работа №11.cpp
#include <iostream> #include <fstream> #include <set> // Шаблонный класс Node для хранения значения и указателя на следующий узел template <typename T> class Node { public: T data; // Значение узла Node* next; // Указатель на следующий узел Node(T value) : data(value), next(nullptr) {} // Констру...
ALGO
0.999754
5.890324
631f1cc1-7366-452c-884f-074f33b1057b
epicwu/topcoder
SRM576/ArcadeManao.cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
ALGO
0.999751
4.43292
83ba6865-cadb-485b-897c-d8bfc215282a
raincross7/code-similarity
codes/train_code/problem119/problem119_290.cpp
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; typedef long long int ll; typedef long double ld; #define rep(i,n) for(int i = 0; i < (n); ++i) #define Sort(Array) sort(Array.begin(), Arra...
ALGO
0.999982
4.186476
aa6d3296-7832-4f91-8800-027366cfb876
DeimosMH/DCH_CppPrimerPlus
programs/fun_ptr.cpp
#include <iostream> double betsy(int); double pam(int); // second argument is pointer to a type double function that // takes a type int argument void estimate(int lines, double (*pf)(int)); int main() { using namespace std; int code; cout << "How many lines of code do you need? "; cin >> code; c...
ALGO
0.986089
6.835995
92c0939e-668e-4c65-948b-b44cf99849d1
LinGuohao/Object-Oriented-Programming
20200304/queue/main.cpp
#include <iostream> #include "prsor.h" #include <vector> using namespace std; void PrSorTeszt(); void beolvas(PrSor &ps); void kiir(PrSor &ps); int main() { PrSorTeszt(); PrSor ps; beolvas(ps); kiir(ps); return 0; } void kiir(PrSor &ps) { cout<<"\nEredmenyek: \n\n"; int n=ps.getHossz();...
ALGO
0.944418
3.982795
fc749672-1122-4780-8db4-0d7f146220a4
nickstevensMU/HawkScan
droneProjectFinal/public/assets/py/opencv-python-4.5.4.60/opencv/samples/cpp/tutorial_code/snippets/imgproc_HoughLinesCircles.cpp
#include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> #include <math.h> using namespace cv; using namespace std; int main(int argc, char** argv) { Mat img, gray; if( argc != 2 || !(img=imread(argv[1], 1)).data) return -1; cvtColor(img, gray, COLOR_BGR2GRAY); // smooth it, otherwise a l...
ALGO
0.979218
4.424689
f4656181-09d8-4709-8a1f-4c53ee462676
ishandutta2007/codeforces
ania/normal/380/C.cpp
#include <bits/stdc++.h> using namespace std; #define REP(i,a,b) for (int i = (a); i <= (b); ++i) #define REPD(i,a,b) for (int i = (a); i >= (b); --i) #define FORI(i,n) REP(i,1,n) #define FOR(i,n) REP(i,0,int(n)-1) #define mp make_pair #define pb push_back #define pii pair<int,int> #define vi vector<int> #define ll lon...
ALGO
0.999672
3.895231
e104705d-cc7a-414f-9880-d02802b77917
Noor210111/UVa-Problem-Solution
11172 - Relational Operator.cpp
#include <iostream> using namespace std; int main() { int t, a, b; char x; cin >> t; while(t--) { cin >> a >> b; if(a == b) cout << '=' << endl; else { x = a > b ? '>' : '<'; cout << x << endl; } } return 0; }
ALGO
0.999924
4.1805
db96a51a-40fe-437c-aabf-46f897f8369f
DoctorLai/ACM
leetcode/1020. Partition Array Into Three Parts With Equal Sum/1020.cpp
// https://helloacm.com/how-to-partition-an-array-into-three-parts-with-equal-sum/ // https://leetcode.com/problems/partition-array-into-three-parts-with-equal-sum/ class Solution { public: bool canThreePartsEqualSum(vector<int>& A) { int avg = std::accumulate(begin(A), end(A), 0, [](auto &a, auto &b) {ret...
ALGO
0.99944
6.153028
4a7a7298-97ee-44eb-9672-58b046665af2
yao561/2015.01.27
MCS for reliability/MCS for reliability.cpp
//#include "stdafx.h" #include <iostream> #include <ctime> #include <cstdlib> #include <cstdio> #include <algorithm> #include <cstring> #define bianshu 9 #define point_num 6 #define M 100000//ؿ巽ĵ int r[point_num][point_num]; bool visited[point_num];//¼ijǷͨ double a[bianshu]; using namespace std; void DFS(int a) { ...
ALGO
0.999386
3.312482
1d25b9fa-b3b3-4c65-9c3e-47e723c0effc
evialbert/LeetCode
0179-largest-number/0179-largest-number.cpp
class Solution { public: static bool comp(string& a, string& b) { return a+b>b+a; } string largestNumber(vector<int>& nums) { int n=nums.size(); vector<string> v; for(int i:nums) v.push_back(to_string(i)); sort(v.begin(), v.end(), comp); string s=""; for(a...
ALGO
0.99999
6.169671
7a9b488a-5c0c-4c6d-8329-3fc72038dec6
Laanith/DSA
NumberTheoryandMath/Easy/ArmstrongNumber_GFG.cpp
#include<bits/stdc++.h> #include<algorithm> #define ll long long #define PYES cout<<"YES"<<endl #define PNO cout<<"NO"<<endl #define PMINUS cout<<-1<<endl #define vi vector<int> #define vpi vector<pair<int,int>> #define vs vector<string> #define qi queue<int> #define si stack<int> #define seti set<int> #define pi pair<...
ALGO
0.999767
4.534675
6b68bf5a-eced-416d-8bb0-b07b9517e2e0
Hcm455429728/Trans_PingStitching
Trans_PingStitching/Trans_PingStitching/eigen3/doc/special_examples/Tutorial_sparse_example_details.cpp
#include <Eigen/Sparse> #include <vector> #include <QImage> typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double typedef Eigen::Triplet<double> T; void insertCoefficient(int id, int i, int j, double w, std::vector<T>& coeffs, Eigen::VectorXd& b, con...
ALGO
0.998988
5.388735
9490452a-545a-4210-9267-f14054510ecc
Chenjh-dev/C-exercises
C++练习题/圆和圆柱体计算(继承).cpp
/* ԲԲ㣨̳У Ŀ һCPoint࣬ݳԱx,y㣩 CPointΪ࣬һԲCCircle ݳԱr(뾶һԲijԱ CCircleΪֱӻ࣬һԲCCylinder ݳԱh()һijԱ ԲԲ󣬵óԱ ԲԲλá뾶 ԲԲλá뾶 ԲԲλ 뾶 Բ ԲԲλ 뾶 Բ 0 0 1 1 1 2 3 Circle:(0,0),1 Area:3.14 Cylinder:(1,1),2,3 Volume:37.68 ĿҪPointࡢCCircleCCylinderĶ,඼붨幹캯 ݡCCircleCCylinder󲢵ӦļijԱ */ #include<iostream> using namespace std; class CPoint { pu...
ALGO
0.979384
3.547621
45177575-07b3-4f5b-9057-b874af4f083c
morris821028/UVa
volume100/10043 - Chainsaw Massacre.cpp
#include <stdio.h> #include <algorithm> using namespace std; struct Pt { int x, y; Pt(int a = 0, int b = 0): x(a), y(b){} bool operator<(const Pt &p) const { if(p.x != x) return x < p.x; return y < p.y; } }; bool cmp(Pt a, Pt b) { if(a.y != b.y) return a.y...
ALGO
0.999703
3.569696
b3655fd6-d2b6-433b-8919-6617611a1b1a
sidjha57/Coding-Data-Transfer
Competitive/C_Paprika_and_Permutation.cpp
//Siddharth Jha #include<bits/stdc++.h> //#include<ext/pb_ds/assoc_container.hpp> //#include<ext/pb_ds/tree_policy.hpp> //#include <ext/pb_ds/trie_policy.hpp> //using namespace __gnu_pbds; using namespace std; //typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds; //typedef trie<...
ALGO
0.999421
3.811905
27202b7b-54ce-4345-8f5e-b1e81f4ca917
Sadiya194112/Algorithm-Basic-Code
Vector of Set.cpp
#include<bits/stdc++.h> #define int long long #define pb push_back #define ff first #define ss second #define pi acos(-1.0) #define yes puts("YES") #define no puts("NO") // mini = min_element(a, a+n)-a; // minval = *min_element(a, a+n); const int mod=1e9+7; using namespace std; int i,j,n,k,x; int Case=1; void ac(){ ...
ALGO
0.999543
3.693008
98b642d5-4429-45ca-b1ed-cc695d110b2f
Qianhongbo/LeetCode
problems/543.diameter-of-binary-tree.cpp
/* * @lc app=leetcode id=543 lang=cpp * * [543] Diameter of Binary Tree */ #include <algorithm> // ! need to be commented before submitting struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} explicit TreeNode(int x) : val(x), left(nullptr), ...
ALGO
0.999748
6.972169
e0c4e9b6-f5ba-47b0-9790-904679735ade
egeturan/cpp-samples
AVL Tree/AVLTree.cpp
#include <iostream> #include "AVLTree.h" #include "TreeNode.h" #include <cmath> #include <stdio.h> #include <stddef.h> #include <cstdlib> #include <ctime> using namespace std; /** * Title : Heaps and AVL Trees * Author : Name Surname * ID: 21000000 * Section : 0 * Assignment : 3 * Description : description of your cod...
ALGO
0.999597
4.222476
e619c85a-993b-4117-ad01-42820dc0c8e5
sezRR/ctis
CTIS151/LG12_Sols/LG12_Q1/Q1.cpp
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main(void) { int number = 747; int *ptr; ptr = &number; printf("1.Value of the variable number by using number is : %d\n", number); printf("2.Value of the variable number by using ptr is : %d\n", *ptr); printf("\n1.Address of the variable number by using n...
ALGO
0.946614
3.523277
f33b4dfc-f6d4-4f9d-adef-0692fc437d87
AksanaKuzmitskaya/introductiontocpp
min.cpp
template <typename T> T min(const T num1, const T num2) { return num1 < num2 ? num1 : num2; } #define min(num1, num2) (num1 < num2 ? num1 : num2)
ALGO
0.99595
5.417802
9946b846-0c3b-44da-b101-c9330efe8c21
aqzsha/ads
ADS-2023/lab4/i.cpp
#include<bits/stdc++.h> using namespace std; struct TreeNode{ int val; int counter; TreeNode* left; TreeNode* right; TreeNode(int x = 0){ this->val = x; this->counter = 1; this->left = NULL; this->right = NULL; } }; TreeNode* insertNode(TreeNode* root, int x){ ...
ALGO
0.999913
4.567439
0b8c2359-24a8-477d-973d-85b7021afa1a
morris821028/UVa
volume105/10500 - Robot maps.cpp
#include <stdio.h> #include <string.h> int n, m, x, y; char s[3], g[20][20], used[20][20]; int color(int x, int y) { if(x < 0 || y < 0 || x >= n || y >= m) return 0; if(used[x][y] == 1) return 0; used[x][y] = 1; return 1; } int dir[4][2] = {{-1,0},{0,1},{1,0},{0,-1}}, move; void dfs(int x, int y...
ALGO
0.999958
3.661913
b8e25c24-21b5-4093-8405-89d98ed1b385
milan-jani/DSA
String/longestpallindromesubstr.cpp
#include<iostream> #include<string> using namespace std; class Solution { public: string longestPalindrome(string s) { string longest = ""; for (int i = 0; i < s.length(); i++) { for (int j = i + 1; j <= s.length(); j++) { string substr = s.substr(i, j - i); ...
ALGO
0.999686
6.496185
51146095-7e1d-4440-839e-a76418032a11
ashutoshpatel2210/Path-Planning
src/Eigen-3.3/bench/sparse_cholesky.cpp
// #define EIGEN_TAUCS_SUPPORT // #define EIGEN_CHOLMOD_SUPPORT #include <iostream> #include <Eigen/Sparse> // g++ -DSIZE=10000 -DDENSITY=0.001 sparse_cholesky.cpp -I.. -DDENSEMATRI -O3 -g0 -DNDEBUG -DNBTRIES=1 -I /home/gael/Coding/LinearAlgebra/taucs_full/src/ -I/home/gael/Coding/LinearAlgebra/taucs_full/build/lin...
ALGO
0.992059
4.147974
d2da6735-e5d9-4ba2-972e-06617522f77d
SA-K1B/Problem-Solving
Codeforces Contest/virtual/DIV 3 595/b.cpp
#include<bits/stdc++.h> #define ll long long int #define db double #define pb push_back #define mp make_pair #define Max 10000000000000000 #define Min -10000000000000000 #define gcd(a, b) __gcd(a, b) #define lcm(a, b) (a * (b / gcd(a, b))) using namespace std; void solve() { // string s1; // cin>>s1; ll n,a[205]...
ALGO
0.999971
3.322464
15835085-6c33-4f2e-b235-8ffc19e7c9d0
jvara34/CIS-7
BloomFilter/bloomFilter.cpp
#include <iostream> #include <fstream> #include <string> #include "GeneralHashFunctions.h" #include "GeneralHashFunctions.cpp" using namespace std; string hashPicker(int &, string); int main() { string input; string hashOutput; string oneline; int counter = 0; cout << "Enter a string: "; c...
TOOL
0.961265
5.388996
35af4d06-5401-4e21-96e4-2d3653547f41
aide-qc/qcor
examples/qcor_demos/pnnl_tutorials/3_quasimo/qite_deuteron.cpp
#include "qcor_qsim.hpp" // qcor qite_deuteron.cpp -qpu qsim __qpu__ void state_prep(qreg q) { X(q[0]); } int main(int argc, char **argv) { using namespace QuaSiMo; // Create the Hamiltonian auto observable = -2.1433 * X(0) * X(1) - 2.1433 * Y(0) * Y(1) + .21829 * Z(0) - 6.125 * Z(1) + 5.907...
ALGO
0.999655
3.339873
d3c219d6-6a3c-4d1e-aa04-0b02ad967a5d
plasmatic1/dmoj-solutions
cpp/alexquiz2.cpp
// ./sum-of-primes-2.yml #include "bits/stdc++.h" using namespace std; // Defines #define fs first #define sn second #define pb push_back #define eb emplace_back #define mpr make_pair #define mtp make_tuple #define all(x) (x).begin(), (x).end() // Basic type definitions using ll = long long; using ull = unsigned long ...
ALGO
0.999895
4.311185
ee607093-a592-4f4b-b456-7158cdc0059f
chapuni/llvm-project-legacy
libcxx/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval_param.pass.cpp
// <random> // template<class RealType = double> // class weibull_distribution // template<class _URNG> result_type operator()(_URNG& g, const param_type& parm); #include <random> #include <cassert> #include <vector> #include <numeric> template <class T> inline T sqr(T x) { return x * x; } int main() { { ...
TEST
0.928883
5.405563
b95f56f4-5202-42a7-b41a-8ae6ef045056
prateekroy/SPOJ
CRSCNTRY.cpp
#include <iostream> #include <string> #include <cstring> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <ctime> #include <vector> #include <queue> #include <deque> #include <stack> #include <set> #include <map> #include "limits.h" using namespace std; class Crossco...
ALGO
0.999753
3.79588
35c8eb9e-1087-4f47-82ce-62a19cb69d39
wyw97/leetcode
No19RemoveNthNodeFromEndofList.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* removeNthFromEnd(ListNode* head, int n) { ListNode* First=head; ListNode* Tail=head; ListNode* Bef...
ALGO
0.999987
5.518675
1aa91b5c-8118-43d8-9f20-f438344552f0
anna-katherine/hw3
llrec-test.cpp
#include <iostream> #include <fstream> #include <functional> #include "llrec.h" using namespace std; /** * Reads integers (separated by whitespace) from a file * into a linked list. * * @param[in] filename * The name of the file containing the data to read * @return * Pointer to the linked list (or NULL if em...
TOOL
0.982976
5.091582
de431705-3c65-4c02-8eac-3640069b0859
iprincekumark/Cpp-Codes
Day5Problem5.cpp
/* Day: 5 Problem: 5 Difficulty: Medium Source: Leetcode Statement: You are given a series of video clips from a sporting event that lasted T seconds. These video clips can be overlapping with each other and have varied lengths. Each video clip clips[i] is an interval: it starts at time clips[i][0] and ends at ti...
ALGO
0.999063
6.342987
e2ba2383-f480-4708-909a-cbe049c031e6
RGTechno/CompetitiveProgramming
AtCoder/Beg Contest 233/D_Count_Interval.cpp
// C++ Program to count number // of subsequences in an array // with sum less than or equal to X #include <bits/stdc++.h> using namespace std; // Utility function to return the count // of subsequence in an array with sum // less than or equal to X int countSubsequenceUtil( int ind, int sum, int *A, int N, ...
ALGO
0.999969
4.542267
c7598c58-335c-4052-b9d0-6e97f593dc96
Aniljangir89/linked-list
doublylinkedlist/insertBeforeAnumber.cpp
// insert before a number in doubly linked list //2212090 #include <iostream> using namespace std; class node { public: int data; node *next; node *prev; node(int val) { data = val; next = NULL; prev = NULL; } }; class doubli { public: node *head; node *tail; ...
ALGO
0.99998
4.173306
041052a3-0832-4928-a3dc-fb4e5cafaad5
NSchertler/GeneralizedMotorcycleGraph
ext/libigl/igl/copyleft/swept_volume.cpp
#include "swept_volume.h" #include "../swept_volume_bounding_box.h" #include "../swept_volume_signed_distance.h" #include "../voxel_grid.h" #include "marching_cubes.h" #include <iostream> IGL_INLINE void igl::copyleft::swept_volume( const Eigen::MatrixXd & V, const Eigen::MatrixXi & F, const std::function<Eigen:...
ALGO
0.999215
6.790164
f7ecb430-6451-4360-a38b-f18eed8544b8
jmlopezfabian/Competitive-Programming
CodeForces/Contest/Div3-929/a.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; void solution(){ int n; cin>>n; int acum = 0; int aux; for(int i=0; i<n; i++){ cin>>aux; acum += abs(aux); } cout<<acum<<endl; } int main(){ int t; cin>>t; while(t--){ solution(); } ...
ALGO
0.999199
4.967057
2c33e50c-f3ce-426b-b9b2-7a79b771144c
letelete/algorithms-and-data-structures
competetive_programmer_handbook/problems/TASK_1094.cpp
#include <bits/stdc++.h> #pragma GCC target("popcnt") #define fastIO \ std::cin.tie(0); \ std::cout.tie(0); \ std::ios::sync_with_stdio(0); template <typename T> using v = std::vector<T>; template <typename T> using q = std::queue<T>; template <typename T> using pq = std::priority_queue<T>; template <typ...
ALGO
0.99989
4.940262
8c554374-e812-427e-a9f3-77eabe1b92b5
imabot05/Testttttt
Warehouse.cpp
#include<iostream> #include<vector> #include<algorithm> #include<climits> using namespace std; const int MAXN = 1005; const int INF = 1e9 + 7; int n, tt, d; int a[MAXN], t[MAXN]; int f[MAXN][MAXN]; int res = -INF; int main(){ cin >> n >> tt >> d; for (int i = 1; i <= n; i++){ cin >> a[i]; } for (int i = 1; i ...
ALGO
0.999891
4.232181
d7446281-1dd1-4482-ba22-52e194ed784f
ishitaoverhere/CPP-Practice
matrix-using-function.cpp
#include <iostream> using namespace std; void inputMatrix(int, int); void inputMatrix(int r, int c) { int arr[r][c], arr2[r][c]; cout << "1st Matrix\n"; for(int i=0; i<r; i++) { for(int j=0; j<c; j++) { cout << "Enter element at [" << (i+1) << ", " << (j+1) <<"] : "; ...
ALGO
0.994891
4.334579
d016b87d-17e6-4777-bd09-73e5356b497c
Yomon420/betterPlayerModified
example/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.998787
6.76775
d2488dd1-27d0-441b-9b1e-93cde40d3adf
ksuzu46/atcoder
abc168/c.cpp
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1); int main() { double a, b, h, m; cin >> a >> b >> h >> m; double rad = abs((60 * h + m) / 720 * 2 * PI - m / 60 * 2 * PI); double res = sqrt(a * a + b * b - 2 * a * b * cos(rad)); cout << fixed << setprecision(10) << res << ...
ALGO
0.999896
3.597151
1ca4f382-c540-4910-9c30-57b8a8a82308
Xang0/Estrutura_De_Dados
Pilhas/Dreed/q1_pratica.cpp
/* Implemente uma função que realize a remoção dos jogos com valores inferiores a um valor informado, denominada remoção especial. Você poderá utilizar somente como estrutura auxiliar outra pilha. Os demais valores da pilha devem permanecer na posição original. Os valores removidos devem ser impressos no momento da r...
ALGO
0.99297
4.354644
0cff4e7e-2d0c-44cb-88c9-1b2a337374c9
davidyslu/LeetCode
LC-942/LC-942.cpp
#include <vector> #include <string> using namespace std; class Solution { public: /** * Concepts: Ad Hoc * 1. If S[0] == 'I', we can always put 0 as the first element * If S[0] == 'D', we can always put N as the first element * 2. Keep track of the smallest and largest element we haven't pl...
ALGO
0.999912
5.758422
28795a8f-bc43-45ea-b5f1-98febe39fd53
94seungjin/cpp
250110/250110_19.cpp
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { vector<int> v = { 1,3,5,7,2,4,6 }; auto maxIt = max_element(v.begin(), v.end()); auto minIt = max_element(v.begin(), v.end()); cout << *maxIt << endl; cout << *minIt << endl; }
ALGO
0.999129
4.088748
0d403bda-7b41-4ce7-8dd6-c39dcbfebcea
JodsintZ/roadtotoi
TOI/TOI15_medal.cpp
#include <bits/stdc++.h> #define long long long using namespace std; const int N = 1e6+5; long n, t[N], h[N]; long ans; int main () { scanf("%d", &n); for(int i = 1; i <= n; i++) scanf("%lld", t + i); for(int i = 1; i <= n; i++) scanf("%lld", h + i); sort(t + 1, t + n + 1); sort(h + 1, h + n + 1...
ALGO
0.99995
3.213079
7325f2f2-e8c9-48ea-afed-17ce97500224
abhijeetmallick65/DsAlgo
Queue/main.cpp
#include<stdio.h> #include<stdlib.h> #include<iostream> using namespace std; // queue structure struct Queue{ int size; int front; int rear; int *arr; }; // create void create(struct Queue *q,int size){ q->size = size; q->front = q->rear = -1; // q->arr = new int[q->size]; q->arr = (int...
ALGO
0.998051
4.063797
b56aee16-f7c0-4c96-81cb-a4f63f9e513f
naeunchan/programmers_study
kakao/파일명 정렬.cpp
#include <string> #include <vector> #include <map> #include <algorithm> #include <string> #include <iostream> using namespace std; bool cmp(pair<string, pair<string, int>> a, pair<string, pair<string, int>> b) { if(a.first == b.first) { if(a.second.first == b.second.first) return a.second....
ALGO
0.999318
4.899863
1cb878a9-17bb-40f8-9ac5-ff08da6d78ba
natsalete/desafios-de-codigo-do-beecrowd
beecrowd-1-iniciante/2152 - Pepe, Já Tirei a Vela!.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; while(n--){ int h, m, o; cin >> h >> m >> o; if(o == 1 && h < 10 && m >= 10){ cout << "0" << h << ":" << m << " - A porta abriu!" << endl; }else if(o == 1 && h >= 10 && m < 10){ ...
ALGO
0.989012
4.190161
16572726-8b23-4f97-94e9-95081b31fc2b
dlgkrwns213/algorithm
BFS07 (baekjoon2644 - 촌수계산) .cpp
//가계도를 입력받아 두사람의 촌수를 구하는 문제 (구할 수 없으면 -1을 출력한다) //기본적인 bfs문제 #include <iostream> #include <vector> #include <queue> using namespace std; int bfs(vector<vector<int> > &graph, bool* visited, int n, int start, int finish); int main() { int n, a, b, m; cin >> n >> a >> b >> m; vector<vector<int> > graph(n+1); while...
ALGO
0.999953
4.154325
7d2541d4-37e1-4728-9121-b0d5dbf7f361
M-CreativeLab/embeddable-nodejs-windows
deps/icu-small/source/common/bytestriebuilder.cpp
#include "unicode/utypes.h" #include "unicode/bytestrie.h" #include "unicode/bytestriebuilder.h" #include "unicode/stringpiece.h" #include "charstr.h" #include "cmemory.h" #include "uhash.h" #include "uarrsort.h" #include "uassert.h" #include "ustr_imp.h" U_NAMESPACE_BEGIN /* * Note: This builder implementation stor...
TOOL
0.959313
7.580065
f014aac8-4042-4a71-91ef-e56032c3fab4
PrsCPlusPlus/arrays-in-c-plus-plus
binary_search.cpp
#include<bits/stdc++.h> using namespace std; void add_elements(int A[] , int n); void display_elements(int A[] , int n); void insertion_sort(int A[] , int n); int binary_search(int A[] , int n , int element); int main() { int n; cout<<"HOW MANY ELEMENTS ? "; cin>>n; int A[n]; add_elements(A,n); ...
ALGO
0.999585
4.303225
154d9a34-7b50-4327-a825-d08a87ea175f
gdsc-ipsacademy/Competitive_Programming
problems/0054-spiral-matrix/0054-spiral-matrix.cpp
class Solution { public: vector<int> spiralOrder(vector<vector<int>>& matrix) { vector<int>ans; int m = matrix.size(); int n= matrix[0].size(); int total_element= m*n; int startingRow=0; int endingCol=n-1;; int endingRow=m-1; in...
ALGO
0.999993
6.226802
b4b40f1d-76f2-4eb4-8b98-f402cc6dca45
milli9d/leet_stash
base-7/base-7.cpp
#include <stdlib.h> #define BASE 7 class Solution { public: string convertToBase7(int num) { if(num == 0) {return "0";} std::ostringstream os{}; bool neg = false; /* if number is negative , mark negative and take absolute value */ if(num < ...
ALGO
0.999417
5.700723
83a787c7-7677-44c8-b2f1-01e045682a0e
its-satyam/Leetcode-Solutions
1155-number-of-dice-rolls-with-target-sum/1155-number-of-dice-rolls-with-target-sum.cpp
class Solution { public: long long dp[31][1001]; int mod = 1000000007; int numRollsToTarget(int n, int k, int target) { memset(dp,-1,sizeof(dp)); return solve(n,k,target); } long long solve(int n,int k,int target) { if(n==0) r...
ALGO
0.999994
5.66644
0a74241c-8a53-4355-a89e-65fd8ee448e4
malakemadd/News_displaying-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.998809
6.763549
0fdc068c-dc4a-4fbb-b4bf-4bb21ee509c6
isaacarvestad/pll-smc
lib/src/phylo_forest.cpp
#include "phylo_forest.h" PhyloForest::PhyloForest( const std::vector<std::pair<std::string, std::string>> sequences, const unsigned int sequence_lengths, const pll_partition_t *reference_partition, PLLBufferManager *const pll_buffer_manager) : reference_partition(reference_partition), pll_bu...
ALGO
0.862606
3.543932
de17e4c5-6c74-459e-af67-fce227d5ee0d
fuqinho/POJ
3045/main.cpp
// Used: 1672K 375MS #include <iostream> #include <vector> #include <algorithm> #include <numeric> using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; typedef pair<int, int> PII; typedef long long LL; #define ALL(a) (a).begin(),(a).end() #define REP(i,n) for(int i=0;i<(n);++i) #define REP_R(i,n) for(...
ALGO
0.999928
3.862867
b12578e2-e37d-4d22-8b52-9ebfca39b9dd
ChandankMahato/KU-LabWorks
DSA_3rd_Sem/Assign_1_Q6/Q6_5_Armstrong_queue/queue_i.cpp
#include "queue.h" using namespace std; Queue::Queue(){ front = -1; rear = -1; } void Queue::enQueue(int value){ if(front == -1) front = 0; rear++; items[rear] = value; cout <<"Digit= "<< value << endl; } int Queue::deQueue(){ int value; value = items[front]; i...
TOOL
0.985979
3.780234
21f33a76-9697-4d55-b87f-1c8fad45ab9d
CYRUS-STUDIO/LLVM
mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp
#include "mlir/Dialect/Affine/Passes.h" #include "mlir/Analysis/SliceAnalysis.h" #include "mlir/Dialect/Affine/Analysis/AffineAnalysis.h" #include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h" #include "mlir/Dialect/Affine/Analysis/NestedMatcher.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/A...
TOOL
0.942247
6.626846
bb3ac245-4bf4-4f44-a569-1b5197a13b82
samratalamshanto/LeetCode
114-flatten-binary-tree-to-linked-list/114-flatten-binary-tree-to-linked-list.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.999946
5.947618
62d0ecc5-f5c0-4615-99da-46ae9d360c0a
salaadas/amnesia_linux
HPL2/tools/NewEditors/Common/EdEditModeSelect.cpp
#include "../Common/EdEditModeSelect.h" #include "../Common/Editor.h" #include "../Common/EdWindowViewport.h" #include "../Common/EdWorld.h" #include "../Common/EdGrid.h" #include "../Common/EdSelection.h" #include "../Common/EdWindowSelect.h" #include "../Common/EdScnObjEditPane.h" #include "../Common/EdAction.h" ...
TOOL
0.89119
6.452855
b167b8ff-1df4-41ca-8ab7-c0d1f5c648ea
x1rh/ACAutomaton
leetcode/0104(二叉树的最大深度)/0104(二叉树的最大深度).cpp
class Solution { public: int maxDepth(TreeNode* root) { if(!root) return 0; if(!root->left && !root->right) return 1; return 1+max(maxDepth(root->left), maxDepth(root->right)); } };
ALGO
0.99954
6.581549
286b8b3e-9b38-43d6-b096-0f18c76e9441
charleswang007/c-plus-plus
C++4ed-SourceCode/Windows/MyPrograms/derived.cpp
//============================================= // C++ Programming in easy steps 4ed. [7:126] //============================================= #include <iostream> using namespace std ; class Polygon { protected: int width, height ; public: void setValues( int w, int h ) { width = w ; height = h ; } } ; cl...
TOOL
0.851932
6.380539
e773b44c-d7ac-4ab3-af0c-7e2b20ec39da
2005arun/LeetCode
0004-median-of-two-sorted-arrays/0004-median-of-two-sorted-arrays.cpp
class Solution { public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { // vector<int> merge; // for(auto i:nums1){ // merge.push_back(i); // } // for(auto j:nums2){ // merge.push_back(j); // } // sort(merge.begin(),mer...
ALGO
0.999991
5.955271
bb3a7bdb-0609-4fc9-b8fe-35674549e58f
keemsunguk/IntermediateJava
tictactoe.cpp
#include <iostream> #include "tictactoe.h" using namespace std; void main() { TTT ttt; int my_turn = ttt.DecideTurn(); //1 = computer, 0 = my turn if(my_turn == 1) { //computer first ttt.GetCenter(); ttt.ShowMap(); } int flag = 0; while (flag == 0) { flag = ttt.GetInput(); } if( ttt.IsCenterEmpty(...
ALGO
0.997893
3.702808
f33ebaf7-51f6-418e-99a5-b29d59135ac5
raincross7/code-similarity
codes/train_code/problem269/problem269_35.cpp
//高知能系Vtuberの高井茅乃です。 //Twitter: https://twitter.com/takaichino //YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw #include <bits/stdc++.h> using namespace std; typedef long long ll; #define INTINF 1999999999 #define REP(i,n) for(int i=0;i<n;i++) #define REP1(i,n) for(int i=1;i<=n;i++) #define MODA 10...
ALGO
0.999956
4.033872
b6316829-b2e0-4094-9f15-18ea297d3637
snehapaul2005/c-program
max among 3 nos(ladder if else).cpp
#include<stdio.h> int main() { int a,b,c; printf("Enter three number:"); scanf("%d %d %d",&a,&b,&c); if(a>b&&a>c) { printf("The greatest number is %d",a); } else if(b>a&&b>c) { printf("The greatest number is %d",b); } else { printf("The greatest number is %d",c); } return 0; }
ALGO
0.99996
3.452421
aff878b6-253d-4647-999f-fbddd9b19ef1
Kushala01/DSA
HashMap/GoogleOA23.cpp
class Solution { public: int maxOperations(vector<int>& nums, int k) { unordered_map<int, int> umap; int ans = 0; for(int i = 0; i < nums.size(); i++){ if(umap[k - nums[i]] > 0){ umap[k - nums[i]]--; ans++; } else{ umap[nums[i]]++; } } return ans; } };
ALGO
0.999962
6.092672
d831aff1-c61d-4ce3-8110-92f5dc0d76c2
viragvoros/parallel-programming
Project/kdtree_omp.cpp
#include <algorithm> #include <iostream> #include <functional> #include <chrono> #include <random> #include <math.h> #include <omp.h> #include "Utility.hpp" #define DEBUG 0 /***************************************************************************************/ float Point::distance_squared(Point &a, Point &b){ ...
ALGO
0.999972
5.968933
5595da93-9ad1-4fee-9b34-102b0582bdfc
ziwon-park/GPSMobileSLAM
PathPlanning/src/ompl/util/src/GeometricEquations.cpp
/* Author: Jonathan Gammell*/ // This file's header #include "ompl/util/GeometricEquations.h" // For gamma function #include <cmath> // For pi definition #include <boost/math/constants/constants.hpp> // OMPL exceptions #include "ompl/util/Exception.h" double ompl::nBallMeasure(unsigned int N, double r) { retur...
ALGO
0.998584
7.120821
6a13539e-f5c6-43ca-8f13-ac0edad14f4c
sgwrld-999/ICPC
2. Basic_Number_Theory/3. Euler's Totient Fucntion/1.ETFInSqrtN.cpp
#include<bits/stdc++.h> using namespace std; class solution{ int phiInN(int n){ int ctr = 0 ; for(int i = 1 ; i <= n ; i++){ if(__gcd(i , n) == 1){ ctr++; } } } int phiInSqrtN(int n){ int result = n ; for(int i = 2 ; i * i <= ...
ALGO
0.999951
5.611194
674e1ec6-9412-4ce6-9087-47279092b506
m4oughi/100DaysofCode
pureCPP/0039. Day 39/STL Algorithms/060. Numeric Algorithms - transform_exclusive_scan, transform_inclusive_scan/006. Inclusive Scan for Weighted Sums/main.cpp
#include <iostream> #include <numeric> #include <vector> int main() { std::vector<int> nums{5, 10, 15, 20}; std::vector<int> weights{1, 2, 3, 4}; std::vector<int> result(nums.size()); std::transform_inclusive_scan(nums.begin(), nums.end(), result.begin(), std::plus<>(), [&](int n) { return n *...
ALGO
0.999895
6.058364
e57d6aa7-eaa2-41d1-88fb-a070701be0c6
yokoleia/AmadeusCPP
Chapter_3/3_22.cpp
#include <iostream> using namespace std; int main() { int a, b, c, out; cin >> a >> b >> c; if (a > b) { if (b > c) { out = c; } else { out = b; } } else { if (a > c) { out = c; } ...
ALGO
0.999761
3.966138
2e062fd1-dd58-4014-a7f2-59e6c6f1b4e3
maxgallup/llvm-blade
llvm-project-16.0.1.src/libcxx/test/std/algorithms/alg.sorting/alg.sort/is.sorted/ranges.is_sorted_until.pass.cpp
// UNSUPPORTED: c++03, c++11, c++14, c++17 // <algorithm> // template<forward_iterator I, sentinel_for<I> S, class Proj = identity, // indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> // constexpr I ranges::is_sorted_until(I first, S last, Comp comp = {}, Proj proj = {}); // template<for...
TEST
0.963107
7.838236
461a319b-1f40-40fe-84c7-faf09bffb1dd
IamSaransh/CodeForces-Solution
c++/usacoTraining/bronze/simulation/lostcow/lostcow.cpp
#include<bits/stdc++.h> #include<iostream> using namespace std; int main() { // #ifndef ONLINE_JUDGE freopen("lostcow.in", "r", stdin); freopen("lostcow.out", "w", stdout); // #endif int x, y; cin>>x>>y; int walk =1; int totalDist = 0; int original = x; int oldPos=x; while(true){ ...
ALGO
0.999967
3.646688
a839dcab-a373-4d24-9ea8-b48c9d75fd09
BorjaAdayUCM/Metodos-Algoritmicos-en-Resolucion-de-Problemas
2 - Colas de Prioridad/La reina del súper/Source.cpp
#include <iostream> #include <iomanip> #include <fstream> #include "PriorityQueue.h" using namespace std; struct Cliente { int tiempo; int caja; }; bool operator<(Cliente const& a, Cliente const& b) { return a.tiempo < b.tiempo || (a.tiempo == b.tiempo && a.caja < b.caja); } int resolver(int nCajas, int...
ALGO
0.99964
4.788282
cd539d10-2c9a-4e28-bf7d-caddb67c53f4
wu6shen/Relocal_ORB
Thirdparty/g2o/g2o/core/hyper_graph.cpp
#include "hyper_graph.h" #include <assert.h> #include <queue> namespace g2o { HyperGraph::Vertex::Vertex(int id) : _id(id) { } HyperGraph::Vertex::~Vertex() { } HyperGraph::Edge::Edge(int id) : _id(id) { } HyperGraph::Edge::~Edge() { } void HyperGraph::Edge::resize(size_t size) { ...
ALGO
0.973842
5.601523
fd98f170-ef12-401b-9537-f304ddd89f6f
kieutienanh2k/anhktth1909006
nhap mang va x xem x co thuoc mang ko neu co gan vi tri nao nhat.cpp
#include <stdio.h> int main(){ int n; printf("Nhap n=\n"); scanf("%d",&n); int ary[n],x; for (int i = 0; i < n; ++i) { printf("Nhap ary[%d] = \n",i); scanf("%d",&ary[i]); } printf("Nhap x = \n"); scanf("%d",&x); int i = 0; for ( i = 0; i < n; ++i) { if(x == ary[i]){ printf("%d nam ...
ALGO
0.998692
3.761681
433f3b96-9fbf-4010-8d23-d58c65cd3e9b
raincross7/code-similarity
codes/train_code/problem195/problem195_198.cpp
#include<bits/stdc++.h> using namespace std; #define endl '\n' #define optimize() ios_base::sync_with_stdio(0); int n; int arr[100001]; int cost[100001]; int func(int index) { if(index>=n-1) return 0; if(cost[index]!=-1) return cost[index]; if(index+1<=n-1 && index+2<=n-1) { re...
ALGO
0.999979
4.438831
c2f52103-79b2-4296-917c-10fb39fe5e65
sramirezh/Lammps_mods
src/USER-SPH/pair_sph_heatconduction.cpp
#include "pair_sph_heatconduction.h" #include <cmath> #include "atom.h" #include "force.h" #include "memory.h" #include "error.h" #include "neigh_list.h" #include "domain.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairSPHHeatConduction::PairSPHHeatCondu...
ALGO
0.999318
4.876494
8c095b4a-d691-4964-8b66-a7414e3737f3
alvi00/My-DSA-Learning-Journey
8.Binary_Tree/1.Recursive way/3.post_order_traversal/1.post_order_traversal.cpp
#include<bits/stdc++.h> // Include necessary header file for standard library utilities using namespace std; // Using the standard namespace for convenience class Node { // Definition of the Node class public: int data; // Data stored in the node Node *left; // Pointer to the left child node Node *right; ...
ALGO
0.999666
6.217493
1b0167f0-c03f-4fa9-91bd-1fddb8daec1f
megargayu/USACO-Solutions
contests/silver/2018/usopen/multimoo/multimoo.cpp
#include <bits/stdc++.h> using namespace std; #define MAX_N 250 const array<int, 4> dr{-1, 1, 0, 0}, dc{0, 0, -1, 1}; const array<int, 4> dr2{1, 0}, dc2{0, 1}; int N; int currComp = 0; vector<vector<int>> grid(MAX_N, vector<int>(MAX_N)); vector<vector<bool>> vis(MAX_N, vector<bool>(MAX_N)); vector<vector<i...
ALGO
0.999315
4.20069
c0160040-34b3-455b-bcc8-8296a4c57c15
arc-w/Cinema-Mode
SleepMode/CloseApps.cpp
#include "header.h" std::set<DWORD> pids; BOOL CALLBACK EnumProcs(HWND hwnd, LPARAM lparam) { DWORD pid = 0; // stores current process PID GetWindowThreadProcessId(hwnd, &pid); // gets current process PID // gets info from current process HANDLE hName = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FAL...
TOOL
0.889644
4.159032
d20bb2aa-bf49-408c-9590-ca2038bf4356
SYSU-PlayDroneSquad/sysu_playDrone_ws
src/geographiclib/tools/GeodSolve.cpp
#include <iostream> #include <string> #include <sstream> #include <fstream> #include <GeographicLib/Geodesic.hpp> #include <GeographicLib/GeodesicLine.hpp> #include <GeographicLib/GeodesicExact.hpp> #include <GeographicLib/GeodesicLineExact.hpp> #include <GeographicLib/DMS.hpp> #include <GeographicLib/Utility.hpp> #if...
TOOL
0.954166
5.722699
21fd4185-d47e-4cd7-af77-7ea67f282045
kkpan11/apple-llvm-project
llvm/lib/CAS/HashMappedTrie.cpp
#include "llvm/CAS/HashMappedTrie.h" #include "HashMappedTrieIndexGenerator.h" #include "llvm/ADT/LazyAtomicPointer.h" #include "llvm/CAS/ThreadSafeAllocator.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include <memory> using namespace llvm; using namesp...
TOOL
0.915717
7.860016
73ca95ab-792d-4be6-95a6-5099eeae0247
yiyongc/BvhEditor
Middleware/boost_1_55_0/libs/graph/example/min_max_paths.cpp
#error "This example appears to be incorrect; it uses edge weights that are smaller than 0 using the comparison operator passed to Dijkstra's algorithm, which is not allowed." #include <boost/config.hpp> #include <iostream> #include <boost/graph/graph_traits.hpp> #include <boost/graph/graph_utility.hpp> #include <boo...
ALGO
0.9996
4.604785
15e27c51-97d5-46fb-8ee4-d2ceebc4ff94
JoaoDanielRufino/Online-Judges
GeeksForGeeks/kth_largest_element_in_bst.cpp
class Solution { public: void solve(Node* root, int& k, int& ans) { if(!root) return; solve(root->right, k, ans); k--; if(!k) { ans = root->data; return; } solve(root->left, k, ans); }...
ALGO
0.999989
5.1854
3d30571e-05ce-47c6-8a20-df0a39b5f2d0
RoteKekse/LibIntTests
PostHartreeFock/als_ev.cpp
#include <xerus.h> using namespace xerus; class InternalSolver { const size_t d; double lambda; std::vector<Tensor> leftAStack; std::vector<Tensor> rightAStack; TTTensor& x; const TTOperator& A; public: size_t maxIterations; InternalSolver(const TTOperator& _A, TTTensor& _x) : d(_x.degree()), x(_x), A(_A...
ALGO
0.999969
5.454243
95429fc9-4f12-4e11-bdca-b7daa2bf2f33
tusharshah21/Striver-sheet-solution
Harkirat_cohort_DSA/1732. Find the Highest Altitude.cpp
// Link: https://leetcode.com/problems/find-the-highest-altitude/ // Time complexity: O(n) // Space complexity: O(1) // Optimal Version class Solution { public: int largestAltitude(vector<int>& gain) { int n=gain.size(); vector<int> alt(n+1,0); for(int i=1;i<=n;i++){ alt[i]=al...
ALGO
0.99967
6.592445
49546d34-f82e-453b-8888-d72df390c374
rishabh-i13/10DaysRecursionChallenge-i13
merge.cpp
#include<bits/stdc++.h> void merge(vector<int> &arr,int s,int e){ int mid=(s+e)/2; int len1=mid-s+1; int len2=e-mid; int *first = new int[len1]; int *second = new int[len2]; int mainArrayIndex=s; for(int i=0;i<len1;i++){ first[i]=arr[mainArrayIndex++]; } mainArrayIndex...
ALGO
0.999966
5.689094
e6a7975a-001c-4d20-85b7-8ee2d6ba84b5
Varun-Nirala/BigNumber
src/main.cpp
#include <iostream> #include "verificationTest.h" double nthRoot(double num, double frac); double power(double base, double exp); int main(int , char**) { using namespace nsNumber; nsTest::Tester tester; //tester.runAll(); BigNumber base("2.5"); BigNumber exp("2.5"); std::cout << pow(base, exp) << '\n'; ...
ALGO
0.927538
4.605683
bb20b11c-bdd8-47b4-97e9-42ba36ce043d
keijak/comp-pub
codechef/problems/XRQRS/main_XRQRS.cpp
#include <bits/stdc++.h> #define REP_(i, a_, b_, a, b, ...) \ for (int i = (a), END_##i = (b); i < END_##i; ++i) #define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__) #define ALL(x) std::begin(x), std::end(x) using Int = long long; using Real = long double; template<typename T, typename U> inline boo...
ALGO
0.999447
4.914526
88db942f-4a53-4637-85b0-b5429a7c73b1
fact-project/weather_station
yellow_box/src/checksum_fletcher16.cpp
#include "checksum_fletcher16.h" uint16_t checksum_fletcher16( uint8_t const *data, uint16_t bytes ) { uint16_t sum1 = 0xff, sum2 = 0xff; while (bytes) { uint16_t tlen = bytes > 20 ? 20 : bytes; bytes -= tlen; do { sum2 += sum1 += *data++; } ...
ALGO
0.985892
5.178369