uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
c1bffbcf-169b-47fb-a86f-46127bf34482
Tubbz-alt/JCFLIGHT
src/EscCalibration/CALIBESC.cpp
#include "CALIBESC.h" #include "Common/VARIABLES.h" #include "MotorsControl/MOTORS.h" #include "LedRGB/LEDRGB.h" #include "PPM/PPM.h" #include "RadioControl/RCCONFIG.h" #include "Buzzer/BUZZER.h" #include "Scheduler/SCHEDULERTIME.h" ClassESC ESC; #define THROTTLEFAIL RadioControllOutput[THROTTLE] < 1600 //VALOR MAX...
TOOL
0.855693
4.126902
0027dbb5-f6aa-47eb-9ea8-29bde2ad0aa7
Musanna47/XPSC-Problem-Solving
Week 6/Day 1 (18-May-2024)/K - Factory Machines.cpp
// Problem Name - Source // Date: -/-/2024 #include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr) #define nl '\n' #define ll long long #define ld long double #define ull unsigned ll #define fi first #define se second #define pb push_back #de...
ALGO
0.999895
5.546532
a3e82831-75ce-48d7-83a4-78b8b3a0e7d8
thisisnitish/cp-dsa
Trie/designaddandsearchwordsdatastructure.cpp
/* Leetcode Question 211. Design Add and Search Words Data Structure https://leetcode.com/problems/design-add-and-search-words-data-structure/ */ /* No need to write the generic functions in the data structure that we do usually. It will give TLE, so to simulate the functionality (insert, get, setEnd, isEnd) we will b...
ALGO
0.99976
6.995631
4e79b090-17b8-441f-93b5-2c655aebec42
ArtemitchGGWP/Training-cpp
11.3.0.Pyramid/main.cpp
#include <iostream> #include <string> #include <iomanip> // for std::setw int main() { std::string input; std::cout << "Enter a string: "; std::getline(std::cin, input); int length = input.length(); // Loop to print each row of the pyramid for (int i = 0; i < length; ++i) { // Print l...
TOOL
0.987848
5.212687
bdc12d7d-3fb4-48c4-a1bb-c8cec7b2c286
jeevanpuchakay/a2oj
codeforces/Div2/676Round/A/main.cpp
#include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long int ll; #define endl "\n" vector<vector<ll>> adjlist; ll max(ll x, ll y) { return (x > y) ? x : y; } ll min(ll x, ll y) { return (x > y) ? y : x; } #define mod 1000000007 #define precision(precision) cout << fixed << setprecision(p...
ALGO
0.999852
4.466398
8c3aace1-3877-484e-b3a0-f368909f7e04
satya2022/-DSA-tree_for_placement
binary2_tree_bild.cpp
#include<bits\stdc++.h> using namespace std; class Node{ public: int data; Node* left; Node* right; //constructor Node(int data){ this->data = data; this->left = NULL; this->right = NULL; } }; Node* buildTree(Node* root) { cout << "Enter the data: " << endl; ...
ALGO
0.999761
4.566249
38942f78-ba36-4d2f-a761-1d9519911e60
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_3302_2.cpp
#include <bits/stdc++.h> using namespace std; int dx[] = {0, 0, 1, -1}; int dy[] = {1, -1, 0, 0}; void moha() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); } const long double eps = 1e-10; const long long N = 1e5 + 1, MOD = 1000000007; int n, ans; long long a[N], mn = 1e9 + 1; long long calc(int x, int ...
ALGO
0.999984
4.62281
97c86b92-5882-4034-a8a6-f0176bc19440
SHarpreetSingh/julyTypescript
c++/deque.cpp
#include <bits/stdc++.h> // #include <vector> #include <deque> using namespace std; int main(){ deque<int> d; d.push_back(1); d.push_back(2); d.push_front(2); for(auto i:d){ cout<<i<<" logg "<<endl; }cout<<endl; }
TOOL
0.960348
3.84531
0c7d1ead-9f39-4ed1-8eda-24e55b86d339
Shivamsamediya/DSA
BTreesBSTs/bt.cpp
#include<iostream> #include<queue> using namespace std; class Node { public: int data; Node* left; Node* right; //constructor bhai saab Node(int value){ this->data=value; this->left=NULL; this->right=NULL; } }; // Function to build the tree Node* buildTree() { int ...
ALGO
0.999488
6.393261
95998249-9d47-43f3-ae1a-aa0ea69ad56e
easyfly007/carnd_term2_proj
proj_MPC/src/util.cpp
#include <vector> #include "Eigen-3.3/Eigen/Core" #include "Eigen-3.3/Eigen/QR" // Evaluate a polynomial. double polyeval(Eigen::VectorXd coeffs, double x) { double result = 0.0; for (int i = 0; i < coeffs.size(); i++) { result += coeffs[i] * pow(x, i); } return result; } double polyderive(Eigen::VectorXd...
ALGO
0.99769
5.609148
20f7436d-aa42-49b0-862d-9eec9c4146bb
Wally4Ever/Programare_C_1
Valentin.P_L11_08.cpp
//Valentin Ples, 2012 //tablou nou cu valoarea radicalului #include <iostream> #include <math.h> using namespace std; int* read(int); void afisf(float*, int); void afis(int*, int); float* calcul(int*, int); int main() { int n, i; cout << "Introdu nr. de elemente: "; cin >> n; int* p;...
ALGO
0.999581
3.284238
753c1f18-bb78-4f99-8eab-18aa4e2ceecc
CodeCamper-Sub/Problem_Solving
codeforce/Codeforces Round (Div. 2)/807/C/C/main.cpp
// // main.cpp // // Created by 한경수 on 2022/07/15. // #include <iostream> #include <vector> #include <string> typedef long long ll; using namespace std; ll tt, n, c, q, l, r, k; string s; ll sum[50]; ll binary_search_find(ll k) { ll lower_bound = 0; ll upper_bound = c; while(lower_bound <= upper_bound) { ...
ALGO
0.99994
4.190917
6affee25-37f9-4b93-af8c-6bf2bfc6da87
karunsehwag/leetcode_daily
0098-validate-binary-search-tree/0098-validate-binary-search-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999968
6.470598
e7c36c4b-e0d6-4d45-84ae-9ae04665eae2
zhouxs1023/WildMagic
LibMathematics/Approximation/Wm5ApprSphereFit3.cpp
#include "Wm5MathematicsPCH.h" #include "Wm5ApprSphereFit3.h" #include "Wm5ApprQuadraticFit3.h" namespace Wm5 { //---------------------------------------------------------------------------- template <typename Real> bool SphereFit3 (int numPoints, const Vector3<Real>* points, int maxIterations, Sphere3<Real>& sphe...
ALGO
0.999129
7.130882
7c6bc0ec-ceae-4917-95d0-3e6c7b843ed6
ishandutta2007/codeforces
gediminas/normal/707/B.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; template<typename T> struct seti : public tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update> { seti(): tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update...
ALGO
0.999994
3.867668
f144ccd1-84d8-4d99-a67a-9d343e1e4894
MikeySH/CS3505_A9-Rubiks-Cube-Edu-App
A9_RubiksCubeTutorial/model.cpp
/* * Jimmy Trinh && Jacob Day && Amitoj Singh && Michael Shin * Software Practice II, CS 3505 * Fall 2021 * A9: An Educational App * Video: Video: https://youtu.be/uIMg9xUNVgY */ #include "model.h" #include <QBrush> /*! * \brief Model::Model Method constructs model object and initializes paramaeters * \param ...
TOOL
0.91618
5.650639
f8ce1c0b-a59d-4b24-921a-80aabbae0437
HappyLittlePill/Algorithm
Brute_force_modulus.cpp
// 暴力取模算法 // 转载于:https://www.cnblogs.com/zuilehongdou/p/5462484.html // 密码学中RSA算法就经常要用到对一个数做高次幂运算后取余,我们称之为高次幂函数的取模运算。 /* 由于高次幂函数往往拥有很高的幂,而计算机中只有int、float、double、long long这几种变量类型, 远远不能满足对于大数字运算的要求,从而导致数据溢出无法完成运算。 所以这里需要在每次迭代取模的过程中进行取模运算,从而保证数据不会溢出。 但是如果幂指数太大的话,需要耗费的时间就更多,直接导致运算效率低下,所以只适用于指数不大的情况. */ #include <stdio.h> ...
ALGO
0.999785
3.416418
4d180cb6-be97-4e01-b437-5ef06ba331cd
ghulamyazdani/c-c-atom
primeno..cpp
#include <iostream> using namespace std; int main() { int firstnum,secondnum,n,i,count; cout << "Enter first number" << '\n'; cin >> firstnum; cout << "Enter second number" << '\n'; cin >> secondnum; for(n=firstnum;n<=secondnum;n++) { count=0; for(i=2;i<=n/2;i++) { if(n%i==0) ...
ALGO
0.999897
3.489435
0f882810-060f-47a6-9ead-9dbf821d919d
wabiverse/UnrealEngineOldArchived
Engine/Plugins/Animation/ControlRig/Source/ControlRig/Private/Math/Simulation/CRSimLinearSpring.cpp
#include "Math/Simulation/CRSimLinearSpring.h" #include "Math/Simulation/CRSimUtils.h" void FCRSimLinearSpring::CalculateForPoints(const FCRSimPoint& InPointA, const FCRSimPoint& InPointB, FVector& ForceA, FVector& ForceB) const { ForceA = ForceB = FVector::ZeroVector; float WeightA = 0.f, WeightB = 0.f; FCRSimUti...
ALGO
0.992619
5.182573
41908bbf-9855-45c6-b3d1-9dfde7cf5f68
ambujtripathi988/Coding
LeetCode/Duplicate Zeros.cpp
// https://leetcode.com/problems/duplicate-zeros/description/ class Solution { public: void duplicateZeros(vector<int>& arr) { int n = arr.size(); vector<int> ans; for (int i = 0; i < n; i++) { if (ans.size() >= n) break; if (arr[i] == 0) { ...
ALGO
0.999706
7.344957
3cb7d028-282c-4a2f-8253-6b15ecb06622
raincross7/code-similarity
codes/train_code/problem261/problem261_407.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; using vl = vector<ll>; using vi = vector<int>; #define _GLIBCXX_DEBUG #define IO_STREAM cin.tie(0);ios::sync_with_stdio(false) #define all(x) x.begin(),x.end() #define rep(i,sta,end) for(int i=sta;i<end;++i) #define lcm(a,b) (a)/__gcd((a),(b))*(b) #d...
ALGO
0.999867
4.252893
a609e9e9-74cb-4d0d-8081-b362f9eda181
bluekds/OpenMP-Programming
Lecture8/Shared_Private_Clause/Shared_Private_Clause.cpp
#include <stdio.h> #include <stdlib.h> #include <omp.h> void main(void) { int a = 0; int result[4] = { 0 }; #pragma omp parallel for num_threads(4) shared(result) private(a) for (int i = 0; i < 4; i++) { a = i; a = a * a; result[i] = a; } for (int i = 0; i < 4; i++) printf("result[%d] a = %d\n", i, r...
ALGO
0.999547
3.803792
df337d30-a72f-41d5-84b7-7ad3f628439a
shrddhakukadiya/widget_list
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
d93bb4bb-2005-4893-8750-2509c0c27cad
kbg8146/Cplusplus_codetree
250325/최소공배수 구하기/find-the-least-common-multiple.cpp
#include <iostream> using namespace std; void func(int n, int m){ for(int i=1;i<10000;i++){ if(i%n==0){ if(i%m==0){ cout << i; break; } } } } int main() { int n , m; cin >> n >> m; func(n,m); // Please write your code here....
ALGO
0.999882
3.360538
2cff45f4-4904-48d8-a5cd-8e6f859b857e
minhluu2000/algorithms
School/PA/PA5/Main/graph.cpp
#include "graph.h" void Graph::buildGraph(ifstream &input) { int new_node; while (input >> new_node) { // Insert the root node node_list.push_back(Vertex(new_node, 0)); // Insert nodes into node_list adj_list.push_back(new list<int>); adj_list[adj_list.size() - 1]->push_back...
ALGO
0.953618
4.532634
7b18e140-58f5-42fa-bc8b-e41be7586d64
AleksandarProjekat/SURF_project
ostalo/za promenljive u delovima/za promenljive/spec/fasthessian.cpp
#include <iostream> #include <math.h> #include <assert.h> #include "fasthessian.h" #include "image.h" #include "ipoint.h" namespace surf { using namespace std; void SolveLinearSystem(double *solution, double sq[3][3], int size); double DotProd(double *v1, double *v2, int len); // Solve the square system of linear ...
ALGO
0.999071
4.15062
f611faa1-c8cc-42ba-adc1-6c4799f7b9f5
batman-rises/GFG-160
two_pointer/Trapping Rain Water.cpp
int maxWater(vector<int> &arr) { // code here int n = arr.size(); if (n == 0) return 0; int left = 0, right = n - 1; int leftMax = 0, rightMax = 0; int wt = 0; while (left <= right) { if (arr[left] <= arr[right]) { if (arr[left] >= leftMax) ...
ALGO
0.99997
5.826385
3d969d6e-ba2e-476c-8964-f0b2b47ebf53
anhtu-pham/Keystroke-Detection-AI-System-to-Combat-HID-Attacks
hid_attacker_defence_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.997565
6.76775
b5f223d5-7a26-4be5-a019-9b89b6ec64ba
ishandutta2007/codeforces
matrixcascade_qwq/normal/1031/E.cpp
//This code is made by Yiran Empty. //GrandMaster When?? //#pragma GCC optimize("Ofast", "unroll-loops") //#pragma GCC target("sse", "sse2", "sse3", "ssse3", "sse4", "avx") #include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define YES puts("YES") #define NO puts("NO") #define Yes puts("Yes")...
ALGO
0.999947
3.211226
d5a97037-00ce-4771-a5bf-da33e86bf762
vuquangsang/VQS
bingchilling.cpp
/* Vu Quang Sang from Le Khiet High School for Gifted */ #include <bits/stdc++.h> using namespace std; //#define ll int #define lg(x) __lg(x) #define alla(a,n) a+1,a+n+1 #define el "\n" #define all(x) x.begin(),x.end() #define pb push_back #define ll long long #define fi first #define ...
ALGO
0.999824
3.426753
e6b8a4b1-e109-4e69-ba7e-5ac67f85c8a7
greensci/greensoupmod-src
mp/src/game/server/ai_network.cpp
#include "cbase.h" #include "ai_network.h" #include "ai_node.h" #include "ai_basenpc.h" #include "ai_link.h" #include "ai_navigator.h" #include "world.h" #include "ai_moveprobe.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" ConVar ai_no_node_cache( "ai_no_node_cache", "0" ...
ALGO
0.979756
6.947123
6ed13cbe-7229-4d93-97f9-a982f7425da7
Gobson995/Cplusplus-BRUTE
Neps/CFaleatorio/110neps.cpp
#include <bits/stdc++.h> using namespace std; int main () { int n; int c = 1; int maior; int conta = 1; cin >> n; vector<int> vec(n); vector<int> contador(2); contador[0] = 1; for (int i = 0; i < n; i++) { cin >> vec[i]; } for (int i = 0;i < n - 1; i++) { if (vec[i] == vec[i+1])...
ALGO
0.999855
3.877518
fc17107e-d5c8-48b9-af30-45d0fa3fe631
ishandutta2007/codeforces
pyqe/normal/787/B.cpp
#include <bits/stdc++.h> using namespace std; long long n,m,ls[2][10069]; int main() { long long i,j,dd,u,k; bool bad; scanf("%lld%lld",&n,&m); for(i=1;i<=m;i++) { scanf("%lld",&dd); bad=1; for(j=0;j<dd;j++) { scanf("%lld",&k); u=k<0; k=abs(k); bad&=ls[!u][k]<i; ls[u][k]=i; } if(bad...
ALGO
0.999992
3.362683
54e60c27-f7ba-4b99-bd36-fddffdf98582
ptquanh/leetcode-cpp-practices
1546. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target.cpp
//TLE //62 / 69 test cases passed. class Solution { public: int maxNonOverlapping(vector<int>& nums, int target) { int n = nums.size(); vector<int> accsum = nums; // cout << accsum[0] << " "; for(int i = 1; i < n; ++i){ accsum[i] += accsum[i-1]; ...
ALGO
0.99996
6.089559
5e2b73ea-109a-400e-a9e4-eecb7feac3b2
onkar-03/Striver-A2Z-DSA-Sheet
03. Solve Problems On Arrays/01. Easy/04. Remove duplicates from Sorted array.cpp
#include <bits/stdc++.h> using namespace std; /* * Approach: Two Pointer * --------------- * - i keeps track of the last unique element's position, while j traverses through the array. * - If nums[i] is not equal to nums[j], it means nums[j] is a unique element, so we increment i and assign nums[j] to nums[i]. * ...
ALGO
0.999942
7.277366
191ad14a-3b5d-4d57-9df7-73dc2ccb3dbb
Ausaf1/DSA_AND_CP
2260-minimum-consecutive-cards-to-pick-up/2260-minimum-consecutive-cards-to-pick-up.cpp
class Solution { public: int minimumCardPickup(vector<int>& cards) { int n = cards.size(); unordered_map<int,int> m; int j = -1,len,ans = INT_MAX; for(int i = 0;i < n;i++){ if(m.find(cards[i]) != m.end()){ len = i - m[cards[i]] + 1; ans = m...
ALGO
0.999935
5.683721
5c0d642a-43fc-4952-934b-04170b60873e
gangadhar652/DSA-0196-C-
diamo2.cpp
#include<iostream> using namespace std; int main () { int n = 5; for(int i = 1 ;i<=n;i++){ for (int j = i ; j < n;j++){ cout<<" "; } for (int j = 1 ;j<=(2 * i-1);j++){ cout<<"*"; } cout<<endl; } for(int i = n -1;i >= 1;--i){ for(int j =1;j>i;--i){ cout<<" "; } for...
ALGO
0.999586
3.392434
319eb65f-bfeb-4437-8e09-1dfe89c323a5
Symom-Hossain-Shohan/Competitive_Programming
CoreAlgoImplementation/DSU.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod=1e9+7; const ll MX=2e5+5; inline void norm(ll &a) {a%=mod; (a<0) && (a+=mod) ;} //positive mod value inline ll modAdd(ll a,ll b) {a%=mod, b%=mod; norm(a),norm(b); return (a+b)%mod;} //modular addition inline ll ...
ALGO
0.998738
3.655239
e3449098-4c49-4ddf-884b-8ad0d91e9cfc
Gaabuto/Gaabuto-Gaabuto-Nguyen-Tran-Bao-Khanh_HN-ENG-KS24B_C_session-8
8.9.cpp
#include<stdio.h> int main(){ // in ra phan tu dau tien xuat hien nhieu nhat trong mang // khai bao 1 mag so nguyen bat ki int arr[]={1,2,1,2,4,1,7,9,2}; int maxCount;// so lan phan tu xuat hien int maxItem;// phan tu xuat hien nhieu nhat int lengthArr=sizeof(arr)/sizeof(arr[0]) ; for(int i=0;i<lengthArr;i++){ int...
ALGO
0.999846
3.142042
8eb27dca-7586-48e7-a5c0-071f48675e3f
TonyTroeff/Training-SoftUni
C++ Fundamentals/Strings and Streams/Replace All/Replace All.cpp
#include <iostream> #include <string> using namespace std; int main() { string text, query, replace; getline(cin, text); getline(cin, query); getline(cin, replace); int offset = 0, index; while ((index = text.find(query, offset)) != -1) { text.replace(index, query.length(), replace); offset = index + replac...
ALGO
0.940857
4.494363
5b1da5de-5224-4064-a2d1-e9bba2576543
karthik6516/Leetcode_GFG
Max sum path in two arrays - GFG/max-sum-path-in-two-arrays.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: /*You are required to complete this method*/ int max_path_sum(int A[], int B[], int l1, int l2) { //Your code here int ans=0; int i=0,j=0; int sumi=0,s...
ALGO
0.999975
5.144769
efa8c4f7-ab4e-4a25-b9f7-0f399c421b2c
JsimonH/CPP
findMagicIndex.cpp
/* 魔术索引 A magic index in an array A[0...n-1] is defined to be an index such that A[i] = i. Given a sorted array of integers, write a method to find a magic index, if one exists, in array A. If not, return -1. If there are more than one magic index, return the smallest one. Example1: Input: nums = [0, 2, 3, 4, 5] Outp...
ALGO
0.999974
5.894204
0a0e8d44-55b9-462b-b135-3e80fd1f9b04
Pricecoin/PricecoinX
src/support/lockedpool.cpp
#include <support/lockedpool.h> #include <support/cleanse.h> #if defined(HAVE_CONFIG_H) #include <config/bitcoin-config.h> #endif #ifdef WIN32 #ifndef NOMINMAX #define NOMINMAX #endif #include <windows.h> #else #include <sys/mman.h> // for mmap #include <sys/resource.h> // for getrlimit #include <limits.h> // for PAG...
TOOL
0.869998
7.528677
037a7ee8-cf15-4652-a46a-d7eae535dfb0
steineggerlab/foldmason
lib/foldseek/lib/mmseqs/src/util/pairaln.cpp
#include "Util.h" #include "Parameters.h" #include "Matcher.h" #include "Debug.h" #include "DBReader.h" #include "DBWriter.h" #include "IndexReader.h" #include "MemoryMapped.h" #include "NcbiTaxonomy.h" #include "MappingReader.h" #include <map> #ifdef OPENMP #include <omp.h> #endif // need for sorting the results st...
DATA
0.965871
4.58847
ed5ba834-0ccb-429b-966b-de6812bce37c
awais019/30DaysofLeetcode
0153-find-minimum-in-rotated-sorted-array/0153-find-minimum-in-rotated-sorted-array.cpp
class Solution { public: int find(vector<int>& nums, int low, int high) { if (high <= low) return nums[low]; int mid = low + (high - low) / 2; if (nums[mid] > nums[high]) return find(nums, mid + 1, high); return find(nums, low, mid); } int findMin(...
ALGO
0.999991
6.091705
c9cb499b-fc9c-47d9-95d7-c6bf5d237e11
Mechazo11/ros2_monocular_object_detection
src/plane_detection.cpp
#include "ros2_monocular_object_detection/plane_detection.h" PlaneDetection::PlaneDetection() { // Constructor } PlaneDetection::~PlaneDetection() { color_img_.release(); seg_img_.release(); imDepth.release(); } bool PlaneDetection::readIntrinsicParameterFile(string &filename) { std::cout << "start reading cali...
TOOL
0.931571
5.053512
77332572-2aae-4573-8ecc-1dd26d3ab6e8
archana-9430/DSA-Practice
Level - 2/Strings/ZigZag.cpp
class Solution { public: string convert(string s, int n) { //OM GAN GANAPATHAYE NAMO NAMAH //JAI SHRI RAM //JAI BAJRANGBALI //AMME NARAYANA, DEVI NARAYANA, LAKSHMI NARAYANA, BHADRE NARAYANA if(n == 0 || n == 1) return s; string res; for(int i = ...
ALGO
0.999964
6.671217
eb4846b4-14b7-4b5e-a3b7-1bc5757b21bd
victorliking/LeetCode
Binary_Tree_Upside_Down.cpp
/* Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it upside down and turn it into a tree where the original right nodes turned into left leaf nodes. Return the new root. For example: Given a binary tree {1,2,3,4,5}, 1...
ALGO
0.999997
6.387373
0673b3e5-4d8f-43f6-a694-acf8bdc40ea4
hzfsls/leetcode-supercrawl
data/1059.all-paths-from-source-lead-to-destination/code_snippets/sol.cpp
class Solution { public: bool leadsToDestination(int n, vector<vector<int>>& edges, int source, int destination) { } };
ALGO
0.999861
4.095068
0611878f-ba44-4910-a62b-700dde1c77ac
risingstar213/oceanbase
src/storage/memtable/ob_row_conflict_handler.cpp
#define USING_LOG_PREFIX TRANS #include "ob_row_conflict_handler.h" #include "storage/memtable/ob_memtable.h" #include "storage/blocksstable/ob_sstable.h" #include "storage/memtable/mvcc/ob_mvcc_iterator.h" #include "storage/memtable/ob_lock_wait_mgr.h" #include "storage/tx_table/ob_tx_table_guards.h" namespace oceanb...
TOOL
0.984106
6.452628
ced3b09c-b2b7-4886-a13b-d91655d69bde
CInet/CInet-Alien-CaDiCaL
cadical/src/score.cpp
#include "internal.hpp" namespace CaDiCaL { // This initializes variables on the binary 'scores' heap also with // smallest variable index first (thus picked first) and larger indices at // the end. // void Internal::init_scores (int old_max_var, int new_max_var) { LOG ("initializing EVSIDS scores from %d to %d", ...
ALGO
0.965124
6.569246
acf7167a-1781-432b-b62d-37b231f2cd2b
p4shant/leetcode
2090-k-radius-subarray-averages/2090-k-radius-subarray-averages.cpp
class Solution { public: vector<int> getAverages(vector<int>& nums, int k) { int n=nums.size(); //finding the prefix sum of array vector<long long int> prfx(n); prfx[0]=nums[0]; for(int i=1;i<n;i++) prfx[i]=prfx[i-1]+nums[i]; vector<int> ans(n); fo...
ALGO
0.999943
5.909868
d4f4b460-d87a-4480-9625-3222f073d445
twoo0220/algorithm
BOJ/C++/2903.cpp
#include <iostream> int main() { std::ios_base::sync_with_stdio(0); std::cout.tie(0); std::cin.tie(0); int32_t size = 0; std::cin >> size; int32_t pointCount = 2; for (int32_t i = 0; i < size; ++i) { pointCount += pointCount - 1; } std::cout << (pointCount * pointCount); return 0; }
ALGO
0.999305
3.623184
f1e9521c-2260-4c5a-9dac-c817a75fce2c
VietHoangg03/DSA_UET
CodeTuan_UET_DSA/tuan3&4/main 2.cpp
// Cho 1 mảng gồm N số nguyên dương. Với mỗi số trong mảng, in ra số các số trong mảng nhỏ hơn nó. // VD: Mảng gồm 5 số là [5, 4, 3, 2, 1] // Số đầu tiên là 5; trong mảng có 4 số nhỏ hơn nó -> in ra 4. // Tương tự -> kết quả là 4, 3, 2, 1, 0 // For example: // Input Result // 5 // 1 2 3 4 5 0 1 2 3 4...
ALGO
0.999964
3.978606
7f33c359-61ba-441a-a66a-e3be3765be1e
sinian666/codes_41_10
cpp_副本8/chapter_tree/binary_tree_dfs.cpp
/** * File: binary_tree_dfs.cpp * Created Time: 2022-11-25 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" // 初始化列表,用于存储遍历序列 vector<int> vec; /* 前序遍历 */ void preOrder(TreeNode *root) { if (root == nullptr) return; // 访问优先级:根节点 -> 左子树 -> 右子树 vec.push_back(root->val); preOrder...
ALGO
0.999731
6.116714
dc0dd458-3d2e-4ea3-bf56-b1bbf1c2c6ac
Skydive18/OpenSkydiveAltimeter
src/altimeter/automatics.cpp
#include <Arduino.h> #include <EEPROM.h> #include "hwconfig.h" #include "common.h" #include "MPL.h" #include "RTC.h" #include "logbook.h" #include "automatics.h" // // State machine points // #define EXIT_TH -jump_profile.exit #define BEGIN_FREEFALL_TH -jump_profile.begin_freefall #define FREEFALL_TH -jump_profile.fre...
ALGO
0.975123
5.076909
e6c3e01b-3761-415d-8e3e-88fdb26f81e5
ashu-dadhich/Competitive-Programming
codechef/challenge/long challenge/feb16/try/MT.cpp
#include<iostream> #include<stdio.h> #include<math.h> #include<algorithm> #include<string.h> #define max(a,b) a>b?a:b #define min(a,b) a<b?a:b #define mod 1000000007 using namespace std; void checktrue() { return; } void checksum() { checktrue(); return; } int main() { long long int n; scanf("%lld",&n); long...
ALGO
0.999986
3.004005
8aaccad9-0513-45f1-97bf-69cddb024449
MiroshnikovAleksandr/QAM-Simulation
main.cpp
#include <iostream> #include <fstream> #include <random> #include "Modulator.h" #include "AWGN.h" #include "Demodulator.h" using namespace std; void simulateQAMSystem(int num_bits, Modulator::ModulationType modType) { vector<uint8_t> original_bits(num_bits); random_device rd; mt19937 gen(rd()); unifor...
ALGO
0.925861
5.975115
033ae79f-bca8-4690-ba8b-8d40efbc0c9b
Ranadipgithub/Problems
cp-31 800/A_Halloumi_Boxes.cpp
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while(t--){ int n, k; cin >> n >> k; vector<int> a(n); for(int i = 0; i < n; i++){ cin >> a[i]; } vector<int> co...
ALGO
0.999949
4.03946
67ab7ca4-f4e3-41be-8952-372d278569ed
ahmedemadl/codeforces
Juniors Phase 1 Practice #1: (D).cpp
//===================================================== // Author : ahmedgbr367 // Date : 2025-08-14 23:42:40 // Problem Name: D_Array_Stabilization // Learned : //===================================================== #include <bits/stdc++.h> using namespace std; #define ll long long int main(){ c...
ALGO
0.999945
4.487152
6ccb2ba8-a0f2-408a-ae5d-11576993189c
sarvex/leetcode-swift
solution/1300-1399/1323.Maximum 69 Number/Solution.cpp
class Solution { public: int maximum69Number(int num) { string s = to_string(num); for (char& ch : s) { if (ch == '6') { ch = '9'; break; } } return stoi(s); } };
ALGO
0.998512
6.630774
8ea47f58-f23e-4914-9b4e-03b8f741217c
shashiraaaz13457/Function-Supreme-1.0
Function_PrintNPrime.cpp
#include<iostream> using namespace std; //NOt solved by self taking hint by java . bool printPrime(int j){ // int k = 2; for (int i = 2; i*i <= j; i++) { if (j%i == 0) { return false; } // cout<<i<<endl; } return true; // cout<<k<<endl; } ...
ALGO
0.999723
4.000405
df0c6c69-dc8e-4c42-a7a8-f67aca2ba1f7
cakuang1/codeforces
cses/additional/writing.cpp
#include <bits/stdc++.h> using namespace std; using ull = unsigned long long; using i128 = __int128_t; // Count occurrences of digit d in [1..m] ull countDigit(ull m, int d) { if (m == 0) return 0; i128 cnt = 0; for (i128 p = 1; p <= (i128)m; p *= 10) { i128 high = m / (p * 10); i128 cur =...
ALGO
0.999963
5.695937
6de2c550-c7ed-4825-a247-640392ceca2d
BoHauHuang/PCCA-exercise
Codeforces/Contest/508/A.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n, k; string s; cin >> n >> k >> s; int cnt[26], ans = 100010; memset(cnt, 0, sizeof(cnt)); for(int i = 0 ; i < s.size() ; i++) cnt[(int)s[i]-'A']++; for(int i = 0 ; i < k ; i++){ if(cnt[i] != 0) ans = (ans < cnt[i])? ans : cnt[i]; else{...
ALGO
0.99998
3.762411
be050c7e-5f5e-4c6b-94a9-26a49ee4000b
ALIZE-Speaker-Recognition/LIA_RAL
LIA_Utils/GmmTokenizer/src/GmmTokenizer.cpp
#if !defined(ALIZE_GMMTokenizer_cpp) #define ALIZE_GMMTokenizer_cpp #include <iostream> #include <fstream> // pour outFile #include <cstdio> // pour printf() #include <cassert> // pour le debug pratique #include <cmath> #include "GmmTokenizer.h" #include "liatools.h" using namespace alize; using namespace std; vo...
ALGO
0.995188
5.615743
ea0db102-5b87-4bf9-a7df-5412d39b2105
wumaoland/OI
src/Problems/Luogu/B2093.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; short n, a[10000 + 10], x; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; for (short i = 0; i < n; i++) cin >> a[i]; cin >> x; for (short i = 0; i < n; i++) if (a[i] == x) { ...
ALGO
0.999697
5.35803
50639cfc-a6ed-4e5a-b3d7-fec34094e164
gpeegpee/opencv-3.1.0-build
samples/gpu/farneback_optical_flow.cpp
#include <iostream> #include <vector> #include <sstream> #include "opencv2/core.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/highgui.hpp" #include "opencv2/video.hpp" #include "opencv2/cudaoptflow.hpp" #include "opencv2/cudaarithm.hpp" using namespace std; using namespace cv; using namespace cv::cuda; ...
ALGO
0.985963
5.814729
12bf8fcf-8339-4270-83f8-2d7c1fa1038d
sachin-611/gfg_leetcode_solutions
1372-longest-zigzag-path-in-a-binary-tree/1372-longest-zigzag-path-in-a-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999798
5.849318
d3ba596c-0178-4382-b561-1c41b473ca89
tecton/Leetcode-Exercise
Sudoku Solver.cpp
class Solution { public: bool dfs(vector<vector<char> > &board, int g, bool rows[9][9], bool cols[9][9], bool grids[9][9]) { int r = g / 9, c = g % 9; while (g < 81 && board[r][c] != '.') { g++; r = g / 9; c = g % 9; } if (g >= 81) return true; for (int i = ...
ALGO
0.999846
6.708945
5cfe4718-1319-456b-8216-632b06f173df
pvthuyet/CppInAction
lib/boost_1_70_0/libs/math/example/root_finding_multiprecision_example.cpp
// Note that this file contains Quickbook mark-up as well as code // and comments, don't change any of the special comment mark-ups! // Example of root finding using Boost.Multiprecision. #include <boost/math/tools/roots.hpp> //using boost::math::policies::policy; //using boost::math::tools::newton_raphson_iterate; /...
ALGO
0.999056
3.604619
f692c3c6-fc68-4c43-b8d1-95295d333423
shyu61/program-competition
code/rasen/045.cpp
#include <iostream> #include <queue> #include <vector> using namespace std; const int NIL = -1; vector<vector<int> > A; vector<int> visited; int n; int next(int v) { for (int k = 0; k < A[v].size(); k++) { int id = A[v][k]; if (visited[id] == 0) return id; } return NIL; } void bfs(int v, ...
ALGO
0.999997
4.77011
abd166f2-2116-4d74-b1b4-005da8448162
ianmolnarang/DAA_Material
week-4/k_smallest.cpp
#include<iostream> #include<cstdlib> using namespace std; void swap(int *n1,int *n2) { int t=*n1; *n1=*n2; *n2=t; } int partition(int *a,int l,int r) { int x=rand()%(r-l+1)+l; swap(&a[x],&a[r]); int pivot=a[r]; int i,j; for(i=l-1,j=l;j<r;j++) { if(a[j]<pivot) { ...
ALGO
0.999873
3.405951
2d87b2a9-c01a-48e1-b57b-f6440053de84
ZhaCong2017/USACO
4.1.1BeefMcNuggets.cpp
/* ID:chac161 TASK:nuggets LANG:C++ */ #include <iostream> #include<fstream> using namespace std; int num[12]; bool have[70000]; int gcd(int a, int b) { return a == 0 ? b : gcd(b % a, a); } int main() { ifstream fin("nuggets.in"); ofstream fout("nuggets.out"); int n; fin >> n; for (int i = 0; i < n; i++) fin...
ALGO
0.999991
3.466271
27819527-6a0c-4049-b352-543f693aae93
codingksj/Baekjoon-Solution
백준/31000~31999/31700~31799/31796.cpp
#include<bits/stdc++.h> #include<unordered_set> // ---------- 사용자 정의 자료형 ---------- using namespace std; typedef long long LL; typedef unsigned long long ULL; typedef long double LD; typedef pair<char, char> Pcc; typedef pair<char, int> Pci; typedef pair<char, string> PcS; typedef pair<int, bool> Pib; typedef pair<i...
ALGO
0.999993
4.292729
c7a28c9a-e1f4-4bae-b077-ec1c5fd07322
rwightman/boost
libs/numeric/odeint/examples/harmonic_oscillator_units.cpp
#include <iostream> #include <vector> /* WARNING: Compilation in debug mode might consume enormous memory (e.g. ~2GB on gcc 4.4 ) */ // first increase fusion macro variables (now done by odeint itself) //#define BOOST_FUSION_INVOKE_MAX_ARITY 15 //#define BOOST_RESULT_OF_NUM_ARGS 15 //[ units_define_basic_quanti...
ALGO
0.907271
7.393019
042f1f85-b14f-46fb-90fd-4f9eb47b4f71
Jumpat/SegAnyGAussians
submodules/diff-gaussian-rasterization_contrastive_f/third_party/glm/test/core/core_func_integer_find_msb.cpp
#include <glm/glm.hpp> #include <cstdio> #include <cstdlib> // To define "exit", req'd by XLC. #include <ctime> #define LE 1 // 1 for little-endian, 0 for big-endian. int pop(unsigned x) { x = x - ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x + (x >> 4)) & 0x0...
ALGO
0.998417
3.60046
22bf44ce-b4a5-4b64-a000-e36e5f8bf9fe
Risman04/flutter-getx
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
5b4542f9-a37a-497b-b307-615600d98624
tarffy/pokemon
pokemon_battle/pokemon.cpp
#include "pokemon.h" #include <iostream> using std::cout; using std::endl; using std::to_string; string pokemon_r::use_skills(pokemon_base * enemy) { auto &skills = this->get_skills(); string skill_used; //skills[0]->skill_use(this,enemy); int flag = 1; for (auto &skill : skills) { if (skill) { int used=skil...
TOOL
0.890561
4.329109
93bcb812-5799-42db-a32b-b8216907d5b3
yusifaliyevpro/Competitive-Programming
LeetCode/Medium/3350. Adjacent Increasing Subarrays Detection II.cpp
// 3350. Adjacent Increasing Subarrays Detection II // https://leetcode.com/problems/adjacent-increasing-subarrays-detection-ii/ #include <iostream> #include <vector> using namespace std; class Solution { public: int maxIncreasingSubarrays(vector<int>& nums) { } };
ALGO
0.999811
5.9325
999d2260-7584-4d9e-b79a-c77f93cccf88
phamminhquoccodinggithub/Cpp
day11/checkEmpty.cpp
#include <cassert> #include <iostream> #include <stack> using namespace std; template <typename T> class MyQueue { private: std::stack<T> s1, s2; public: /** * Constructor for queue. */ MyQueue() = default; /** * Pushes x to the back of queue. */ void push(T x); /** *...
TOOL
0.968779
5.098806
4a388a63-4d39-489d-82f5-5c16e1bedc58
xHexTexx/TOI
TOI/TOI13/TOI13_timeswitch.cpp
#include<bits/stdc++.h> using namespace std; int n ; string s , ss ; const long long hashcode = 3 ; long long hashing(){ long long res = 0 ; for(int i = 0 ; i < n ; i ++ ){ res *= hashcode ; res += s[i] - '0' ; } return res ; } int main(){ ios_base :: sync_with_stdio(0) ,...
ALGO
0.999979
4.103936
a57be8ac-a360-4057-b0af-55938666d38f
Codemigod-666/CodingNinjasDSA-CPP
Priority Queue/mergeK-SortedArrays.cpp
#include <iostream> #include <vector> using namespace std; #include <queue> // #include <vector> vector<int> mergeKSortedArrays(vector<vector<int>*> input) { priority_queue<int, vector<int>, greater<int>> pq; for(int i = 0 ; i < input.size() ; i++){ for(int j = 0 ; j< input[i]->size() ; j++){ ...
ALGO
0.999963
4.272289
51384a38-7b9a-4d58-bc1c-73919f3367bc
koba-e964/contest
atcoder/abc032/d.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include ...
ALGO
0.999998
3.813398
f67cecf0-b5fe-4304-8572-b0843cc8f797
dannguyenmessi1705/Cpp
InSoChiaHetCho3.cpp
#include <iostream> using namespace std; int main(){ int a, b; do{ cin>>a>>b; } while(a>b); int i=b-1, k=0; for(;i>a;i--){ if(i%3==0){ k=1; cout<<i<<" "; } } if(k==0) cout<<"NOT FOUND"; }
ALGO
0.999912
3.405932
b443229f-8f33-476f-818c-e4470498c326
HyeonJunSong/Baekjoon
백준_3 Gold/01068_트리.cpp
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >> N; vector<vector<int>> tree(N, vector<int>()); int root; for(int i = 0; i < N; i++){ int inp; cin >> inp; if(inp == -1){ root = i; continue; } tree[inp].push_back(i); } int del; cin >> del; int cnt = 0...
ALGO
0.999949
4.432559
7e24f526-2305-4c09-a47b-0f27b50910d8
NemoNology/SDPA
V/Lab-s/AVL-tree/C++/Program.cpp
#include <iostream> #include <ctime> #include "AVLTree.h" using namespace std; using type = int; using TreeNode = AVLTreeNode<type>; using Tree = AVLTree<type>; int main() { Tree tree = Tree(); int size = 15; for (int i = 0; i < size; i++) tree.Add(i); cout << "Start:\n"; tree.PrintVert...
ALGO
0.997462
4.249623
bdf44e36-5b22-4b83-9370-8d3b4a348ca6
AdnanSalazzar/Solution-UVa
11417.GCD With Easy Explanation.cpp
/* basically just find GCD in another function then sum them up; */ #include<bits/stdc++.h> using namespace std ; int GCD(int i , int j); int main() { int i, j, num , G , N; while(1) { cin >> N ; if(N == 0) break ; else { G=0; ...
ALGO
0.999878
4.50754
ff6b310a-5024-4661-ba4e-f1383f633fe1
ZongleiJiao/OntologyViewer
libogdf/src/decomposition/DynamicSPQRTree.cpp
/* * $Revision: 1.2 $ * * last checkin: * $Author: gutwenger $ * $Date: 2008-11-28 21:35:35 +1100 (Fri, 28 Nov 2008) $ ***************************************************************/ #include <ogdf/decomposition/DynamicSPQRTree.h> namespace ogdf { //-----------------------------------------------------...
ALGO
0.985835
6.32508
eb8b4355-2601-4ce3-91e6-8c2290183965
Ali-Noghabi/QR-Factorization
eigen-3.4.0/eigen-3.4.0/doc/examples/class_CwiseUnaryOp_ptrfun.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; // define function to be applied coefficient-wise double ramp(double x) { if (x > 0) return x; else return 0; } int main(int, char**) { Matrix4d m1 = Matrix4d::Random(); cout << m1 << endl << "becomes: " << endl << ...
ALGO
0.943798
4.120226
c67c1158-d9e2-40ee-ab90-12e3cbf7b0e2
sirraghavgupta/cpp-data-structures-and-algorithms
problems/euclidsAlgoOfGCD.cpp
/****************************************************************************** PROBLM : to calculate the hcf and lcm of 2 numbers by euclid's algorithm AUTHOR : RAGHAV GUPTA STATUS : !!! SUCCESS !! NOTE : nothing new, just the maths wala method of finding gcd taught to children, only name is new. **********...
ALGO
0.995622
3.866726
d04b211f-888c-415f-9744-33dae55f14c3
DavidLi7/Competitive-Programming
Kattis/Battle of the Brains 2/b.cpp
#include <iostream> #include <vector> #include <map> #include <set> using namespace std; const int MAXN = 1e5 + 5; int N; long double x[MAXN], v[MAXN]; map<long double, map<int, set<int> > > m; long double collisionTime(int i, int j){ if(v[i] == v[j]) return 1; long double t = (x[i] - x[j]) / (v[i] ...
ALGO
0.999995
3.899652
4f5bc31b-dd27-4310-811f-a99f1b47fd33
SuprDewd/Forritunarkeppnin-2
2005/Alfa/Fyrri Hluti/10.cpp
#include <vector> #include <map> #include <set> #include <queue> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> #include <...
ALGO
0.985548
3.800974
61b89e05-1bdf-4ec0-94fc-875fde6823a4
Harshhhh1701/GO-375-DSA
arrays/8.cpp
//profit from stocks class Solution { public: int maxProfit(vector<int>& prices) { if(prices.size()==0) return 0; int ans=0; int start=prices[0]; int end=prices[0]; for(int i=0;i<prices.size();i++){ if(prices[i]<start){ ans=max(ans,end-sta...
ALGO
0.999659
6.039821
ec17b44e-6acd-47fb-8137-090101e1796e
rsnemmen/Chombo
lib/src/EBAMRElliptic/NeumannPoissonDomainBC.cpp
#ifdef CH_LANG_CC #endif #include "BoxIterator.H" #include "PolyGeom.H" #include "NeumannPoissonDomainBC.H" #include "NamespaceHeader.H" NeumannPoissonDomainBC::NeumannPoissonDomainBC() { m_value = 12345.6789; m_flux = RefCountedPtr<BaseBCValue>(); m_onlyHomogeneous = true; m_isFunction = false; } Neumann...
ALGO
0.998552
7.174407
863a8cc0-fd5c-48a1-9a3b-9e4a7fc4ef9f
AmrElsayyad/core-cpp-tutorial
007-variadic_merge_sort.cpp
#include <array> #include <iostream> using namespace std; template <int... Vals> struct Ints {}; template <typename Ints1, typename Ints2> struct Concat; template <int... Vals1, int... Vals2> struct Concat<Ints<Vals1...>, Ints<Vals2...>> { typedef Ints<Vals1..., Vals2...> type; }; template <typename Ints1, typena...
ALGO
0.999648
5.424193
2ddfbdf9-41b3-427c-b472-177177a11ed1
aman3107/Revision_DSA_CPP
Basics_CPP/Revision/Arrays/Corrsp_Pair_Sum.cpp
#include <iostream> using namespace std; void corrspPairSum(int arr[], int n) { int i = 0; int j = n - 1; while (i < j) { int sum = arr[i] + arr[j]; arr[i] = sum; i++; j--; } } int main() { int n; cout << "Enter value of n :" << endl; cin >> n; int arr[n]; cout << "Enter elements ...
ALGO
0.99994
5.087411
5ed68236-29de-4d3c-8126-b6100e8ab1fe
TrustAGI-Lab/MTG
MALSAR/c_files/calibration/segL2.cpp
/* ---------------------------------------------------------- */ /* mexFunction: segL2 */ /* */ /* compute L2 norm for each provided segment */ /* ...
ALGO
0.999482
6.088047
3016bb0f-1d69-4746-a554-8c35b6700b8d
ishandutta2007/codeforces
zhouyuyang/normal/1012/D.cpp
#include<bits/stdc++.h> #define ll long long #define ull unsigned ll #define uint unsigned #define db long double #define pii pair<int,int> #define pll pair<ll,ll> #define IT iterator #define PB push_back #define MK make_pair #define LB lower_bound #define UB upper_bound #define EB emplace_back #define fi first #defin...
ALGO
0.999988
3.150698
6d7d8a79-c77c-4e1c-a323-759167345003
yanbcxf/cpp
MyToolKit/NumericalRecipes/recipes/fdjac.cpp
#include <cmath> #include "nr.h" using namespace std; void NR::fdjac(Vec_IO_DP &x, Vec_I_DP &fvec, Mat_O_DP &df, void vecfunc(Vec_I_DP &, Vec_O_DP &)) { const DP EPS=1.0e-8; int i,j; DP h,temp; int n=x.size(); Vec_DP f(n); for (j=0;j<n;j++) { temp=x[j]; h=EPS*fabs(temp); if (h == 0.0) h=EPS; x[j]=temp+...
ALGO
0.999854
4.583916
5e91966a-5184-4a7c-a2a6-9353fe67f9a9
vipulkumar2002/Leetcode
1888-minimum-number-of-flips-to-make-the-binary-string-alternating/1888-minimum-number-of-flips-to-make-the-binary-string-alternating.cpp
class Solution { public: int minFlips(string s) { const int n = s.length(); vector<vector<int>> count(2, vector<int>(2)); for (int i = 0; i < n; ++i) ++count[s[i] - '0'][i % 2]; int ans = min(count[1][0] + count[0][1], count[0][0] + count[1][1]); for (int i ...
ALGO
0.999993
5.989992