uuid
stringlengths
36
36
repo_name
stringlengths
5
123
relative_path
stringlengths
5
4k
content
stringlengths
33
2.85M
category
stringclasses
6 values
algo_rel_score
float64
0.85
1
quality_score
float64
3
8.76
14a815bc-6a17-4d81-9bc2-3f7b881b2a2d
KexinAnswer/CPlusPlus
每日一题-5_20/每日一题-5_20/test.cpp
//#include <iostream> //#include <string> //#include <stdio.h> //int main() //{ // std::string str1; // std::string str2; // while (getline(std::cin,str1)) // { // getline(std::cin, str2); // // if (!str2.empty()) // { // for (int i = 0; i < str1.size(); ++i) // { // for (int j = 0; j < str2.size(); ++j) // ...
ALGO
0.999948
3.549674
7a483692-6984-42e5-9cf7-6fefb1e1922a
teopartesi/udp_audio
managed_components/espressif__esp-dsp/examples/applications/azure_board_apps/graphics/3d_matrix/3d_matrix_src/graphics_support.cpp
#include <malloc.h> #include <math.h> #include "graphics_support.h" void init_perspective_matrix(dspm::Mat &P_m) { const float fov = 90; // field of view in degrees const float near = 0.0001; const float far = 1; const float S = 1 / (tan((fov / 2) * DEG_TO_RAD)); // Init...
ALGO
0.984004
5.801321
7ba4855d-db20-4313-bdec-9bb323cace6e
Prakhar-002/LEETCODE
🍄 Daily Challenge 2025 🍳/🔬 Examine Thoroughly 🧬/08 Aug 🌸/21 - 08 - 2025 --- 1504. Count Submatrices With All Ones ☃️ 🍁 🍰 🎲/🎲CPP - 1504. Count Submatrices With All Ones.cpp
//! https://github.com/Prakhar-002/LEETCODE // Todo 💎 QUESTION NUMBER 1504 //? ⌚ Time complexity ➺ O(n * m) 👉🏻 n = len(nums) //? 🧺 Space complexity ➺ O(n) #include <vector> #include <stack> using namespace std; class Solution { public: int numSubmat(vector<vector<int>>& mat) { int rows = mat...
ALGO
0.999882
6.971906
5b13106e-f016-48e2-ab97-96a7c9b633b1
ishandutta2007/codeforces
ehnryx/normal/1491/C.cpp
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES //#define FILENAME sadcactus #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_u...
ALGO
0.999897
4.851368
83ec7e43-7b0c-4136-b479-a884e576804f
ishandutta2007/codeforces
marckess/normal/1322/A.cpp
#include <bits/stdc++.h> #define endl '\n' #define fi first #define se second #define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k)) #define forn(i,n) for (int i = 0; i < n; i++) #define forr(i,a,b) for (int i = a; i <= b; i++) #define all(v) v.begin(), v.end() #define pb push_back using namespace std; typedef long long ...
ALGO
0.999951
4.121401
d343e7f4-3d5a-491a-8c1c-139ec64bb3d9
chai2010/qrcode
internal/libdecodeqr/opencv110/cvaux/src/cvcorrimages.cpp
#include "_cvaux.h" //#include "cvtypes.h" //#include <float.h> //#include <limits.h> //#include "cv.h" //#include "highgui.h" #include <stdio.h> /* Valery Mosyagin */ /* ===== Function for find corresponding between images ===== */ /* Create feature points on image and return number of them. Array points fills by ...
ALGO
0.951448
3.553633
aee92dbb-2358-4912-afeb-4fbd938c1170
ajbinky/CIS161
Rate of Inflation.cpp
/* Andrew Behncke Rate of Inflation 9/2014 <EMAIL> */ #include <iostream> using namespace std; // Prototyping. double Rate(double, double); int main() { double current = 1000; double ROE = .00; const int years = 10; // Simple number checking for the rate. while (ROE < .01 || ROE > .15) { cout << "Enter rat...
ALGO
0.984251
4.131342
bf4ec3e3-434b-401b-9f43-600daffca81c
racoci/ImageEditor
TestCpp/boost_1_60_0/libs/math/test/compile_test/tools_toms748_inc_test.cpp
#define T double #define Tol boost::math::tools::eps_tolerance<double> typedef T (*F)(T); template std::pair<T, T> boost::math::tools::toms748_solve<F, T, Tol >(F, const T&, const T&, const T&, const T&, Tol, boost::uintmax_t&); template std::pair<T, T> boost::math::tools::toms748_solve<F, T, Tol>(F f, const T& ax, c...
TOOL
0.999399
3.996881
703b84c2-2a8b-4372-ae7a-c958802e880b
Emkave/leetcode-solutions
is_subsequence.cpp
// https://leetcode.com/problems/is-subsequence/ class Solution { public: inline bool isSubsequence(const string s, const string t) noexcept { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); std::cout.tie(NULL); unsigned l = 0, r = 0; unsigned correct = 0; ...
ALGO
0.999807
6.759764
e85c5e71-f688-40c6-9320-2327edff1038
stephenjhs/backupLaptop
penjadwalan-proses/sjf.cpp
#include <iostream> using namespace std; int main () { int bt[20],p[20],wt[20],tat[20],pr[20],i,j,n,total=0,pos,temp,avg_wt,avg_tat; cout<<"Input Total Proses:"; cin>>n; cout<<"\nInput Burst Time dan Prioritas\n"; for(i=0;i<n;i++) { cout<<"\nP["<<i+1<<"]\n"; cout<<"Burst Time:...
ALGO
0.99998
3.420335
c17c1b50-70d0-41d0-8885-215f725839ad
alexandraback/datacollection
solutions_5634697451274240_0/C++/TankEngineer/B.cpp
#include<vector> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; char s[105]; int main() { int t; scanf("%d", &t); while (t--) { scanf("%s", s); int l = strlen(s); int ans = 0; for (int i = 0; i + 1 < l; ++i) { if (s[i] != s[i + 1]) { ++ans; } } ...
ALGO
0.999241
3.889213
e7b0ac01-0a46-4092-baa5-00c325bcafe0
QuietkidAniket/codeforces
1016/b.cpp
#include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; mt19937_64 RNG(chrono::steady_clock::now().time_since_epoch().count()); bool multi = true; static const int mod = 1e9 + 7; void Solve(){ string s; cin>> s; int n = s.size(); // check for the indices for the first non zero...
ALGO
0.999828
4.482685
7df391ae-2bbf-4afc-b70a-c6dfd6ab2e3d
guptasukant1/DSA-Practice
Arrays/SortedArray.cpp
#include<bits/stdc++.h> using namespace std; // $ Check if the array is sorted or not // $ OA // $ TC: O(n) | SC: O(1) bool isSorted(int arr[], int n){ for(int i = 0; i < n - 1; i++){ if(arr[i] > arr[i + 1]) return false; } return true; } int main() { int arr[] = {1, 2, 3, 4, 5}, n = 5; p...
ALGO
0.999717
5.149961
ed0354a4-dd6a-41b0-9f1b-1db35a816e86
mshafeeqkn/ds-study
recursion/subset_sum.cpp
#include <iostream> #include <vector> #include <bits/stdc++.h> #include <unistd.h> void print_list(std::vector<int> &ds) { std::vector<int>::iterator itr; for(itr = ds.begin(); itr != ds.end(); itr++) { std::cout << *itr << " "; } std::cout << std::endl; } void subset_sum_power_set(int *arr, ...
ALGO
0.999825
5.227893
a5a2f2f0-1ce6-4315-bc46-7849aa2904ae
hackerkid/LightOJ-Solutions
1127-Funny-Knapsack.cpp
#include <iostream> #include <vector> #include <algorithm> #include <stdio.h> using namespace std; long long n; long long w; long long inp[100]; vector <long long> a; vector <long long> b; long long create_a(long long i,long long sum, long long max) { if(sum > w) { return 0; } if( i == max) { a.push_back(s...
ALGO
0.99997
3.788463
ec483681-8cc6-465d-a777-e22e4fc68be5
WILDCHAP/LanQiao-Cup
递归整数转换成字符/Untitled6.cpp
#include<iostream> #include<cstdio> using namespace std; char a[10]; void f(int n) { int t=n/10; if(t) f(t); putchar('0'+n%10); } int main() { int n;cin>>n; f(n); cout<<a; return 0; }
ALGO
0.999567
3.664569
8949fbfa-49bc-404d-b622-3069fd85eafc
wbhima/CodeforALL
AnagramCheck.cpp
#include<iostream> using namespace std; int main() { string str1,str2; cout<<"Enter String 1: "; cin>>str1; cout<<"Enter String 2: "; cin>>str2; int H1[26]={0}; int H2[26]={0}; for (int i = 0; str1[i]!='\0'; i++) { H1[str1[i]-97]++; } for (int i = 0; str2[i]!='\0'; i...
ALGO
0.999945
3.569844
dc8eec46-20fa-49b7-bacc-083da24d3b66
doho-ho/Coding-test-practice
BOJ/1753 최단경로.cpp
#include <iostream> #include <vector> #include <map> #include <queue> int main() { std::cin.tie(0); std::ios_base::sync_with_stdio(false); int V, E, K; std::cin >> V >> E >> K; std::map<int, std::vector<std::pair<int, int>>> nodes; int u, v, w; for (int i = 0; i < E; i++) { std::cin >> u >> v >> w; node...
ALGO
0.999974
4.454618
4c81876b-79d1-4f09-ae43-6ff1faa7397f
qxiaofan/ukf_demo
src/UKF.cpp
#include "UKF.h" Matrix sigmas(Matrix x, Matrix P, Type c); Matrix Cholesky(Matrix A); void UKF::ukf( Matrix& x, const Matrix z) { const int L=2*n+1; const Type alpha = 1e-3; //default, tunable const Type ki = 0.0; //default, tunable const Type ...
ALGO
0.999611
5.327431
44fff0bb-6310-473a-9aea-03cd0a53a371
Mateusz-Birembaut/HAI719I-Programmation-3D
TP-Transformations/src/quaternion_utils.cpp
#include <glm/gtc/quaternion.hpp> #include <glm/gtx/quaternion.hpp> #include <glm/gtx/euler_angles.hpp> #include <glm/gtx/norm.hpp> using namespace glm; #include "quaternion_utils.hpp" // Returns a quaternion such that q*start = dest quat RotationBetweenVectors(vec3 start, vec3 dest){ start = normalize(start); dest...
TOOL
0.971382
6.701675
92673f23-22eb-4856-b87e-a742dc086eb1
MatheusR42/ufabc-poo
estudos/NumerosInteiros3.cpp
#include <iostream> int main() { long long a; long long b; long long c; std::cin >> a >> b >> c; std::cout << a << " " << b << " " << c << std::endl; return 0; }
ALGO
0.964321
3.881836
b34b4247-a9f8-4e4a-9b4d-c6c4e18b75c9
Meta3DCompany/MetaSlicer
src/libigl/igl/flipped_triangles.cpp
#include "list_to_matrix.h" #include <vector> template <typename DerivedV, typename DerivedF, typename DerivedX> IGL_INLINE void igl::flipped_triangles( const Eigen::PlainObjectBase<DerivedV> & V, const Eigen::PlainObjectBase<DerivedF> & F, Eigen::PlainObjectBase<DerivedX> & X) { assert(V.cols() == 2 && "V shou...
ALGO
0.998037
6.569572
ff9055e8-1001-460b-813d-48098a650db7
abhiXsliet/DSA-SHEETS
Love Babbar DSA Sheet/001-Arrays/018-count-pairs-with-given-sum.cpp
// https://practice.geeksforgeeks.org/problems/count-pairs-with-given-sum5022/1 //{ Driver Code Starts //Initial template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ private: // TC = O(N * N) // SC = O(1) int solve_brute(i...
ALGO
0.999824
6.200279
bc9701b6-a2e2-4bd3-808f-fe42173a9400
leggedrobotics/ocs2
ocs2_robotic_examples/ocs2_perceptive_anymal/ocs2_anymal_loopshaping_mpc/src/PerceptiveMpcDemo.cpp
// // Created by rgrandia on 31.03.22. // #include <ros/init.h> #include <ros/node_handle.h> #include <grid_map_ros/GridMapRosConverter.hpp> // Plane segmentation #include <convex_plane_decomposition/LoadGridmapFromImage.h> #include <convex_plane_decomposition/PlaneDecompositionPipeline.h> #include <convex_plane_dec...
TOOL
0.942802
6.432187
fa2a50eb-a38b-4ce4-b16c-d7f4b7205345
RakhiChaudhary/SDE_SHEET
75-sort-colors/75-sort-colors.cpp
class Solution { public: void sortColors(vector<int>& nums) { int s=0; int e=nums.size()-1; int mid=0; while(mid<=e){ switch(nums[mid]){ case 0:swap(nums[s++],nums[mid++]); break; case 1:mid++; ...
ALGO
0.999987
6.148347
a001d660-e7f9-4639-a5a3-bb41638cb138
Haidar57/haidar
Haidar_4.cpp
#include <iostream> using namespace std; int main(){ int kehadiran, tugas, uts, uas; int hitung, nilai_akhir; cout << "kehadiran = "; cin >> kehadiran; cout << "tugas = "; cin >> tugas; cout << "UTS = "; cin >> uts; cout << "UAS = "; cin >> uas; hitung = kehadiran + tugas + uts + uas; nilai_akh...
ALGO
0.995699
3.379705
77f66e53-755e-4310-9c34-673cc37f16b0
TKRchamak/Phitron_Course
course_2/c++/begin practice/0/tropizoidal.cpp
#include<bits/stdc++.h> using namespace std; int troizoidal_area(int fast_length, int secound_length, int height) { int area = (fast_length + secound_length)*(height/2); return area; } int main() { int a, b, h, res; cin>>a>>b>>h; res = troizoidal_area(a,b,h); cout<<res<<endl; return 0; }
ALGO
0.997562
3.998486
bb5bf7af-8496-48f4-84c9-7450d0a762b1
yusufkucukoner12/Hacettepe-Bachelor-CS-Degree
Data Structures ~ C++ Assignments/Assignment 4_LLRBT/src/KD_Tree.cpp
#include "KD_Tree.h" // Default constructor implementation KD_Tree::KD_Tree() : root(nullptr), split_threshold(0.1) { } // Parameterized constructor implementation KD_Tree::KD_Tree(double threshold) : root(nullptr), split_threshold(threshold) { } // Destructor implementation KD_Tree::~KD_Tree() { // Implementati...
ALGO
0.887504
6.02793
5ffc16fa-83fb-4ce1-ad10-36b72ff356e7
sos0911/PS_Cpluslplus
Algorithm/2019/Mon_06/Alg2075.cpp
#include <iostream> #include <queue> #include <functional> using namespace std; int main(){ // 수 받으면서 저장할 필요없이 // n순위 안에 들어가면 저장, 아니면 skip(pq) cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false); int n; cin>>n; priority_queue<int, vector<int>, greater<int>> pq; // 제일 작은 놈이 우선순위가 높게 int size=0, inpu...
ALGO
0.999987
3.625944
ee9d153a-a19f-4e05-a29b-723984e7e200
77Arafat383/Previous-contest-problem
Amphibian_Escape.cpp
//**************BISMILLAHIR RAHMANIR RAHIM**************** #include<bits/stdc++.h> using namespace std; #define ll long long const int M = 1e9+7; #define all(x) x.begin(), x.end() #define w(x) while(x--) #define pi acos(-1.00) #define rev(v) reverse(all(v))...
ALGO
0.999831
3.34063
b658c0c9-1037-4ee5-bb82-0ae3a7398e57
redblackbst/ALGO
LeetCode/archived/LC.0219.contains-nearby-duplicate/contains-nearby-duplicate.cpp
#include "../utils/abel_macro.h" class Solution { public: bool containsNearbyDuplicate(vector<int>& nums, int k) { unordered_map<int,int> idx; for (int j=0; j<nums.size(); ++j) { int num = nums[j]; if (idx.count(num) && j - idx[num] <= k) return true; idx[num] =...
ALGO
0.99996
5.875076
ce20b833-e941-45ea-a04b-0b192673b85d
omjee17/DS_Algo_Questions
Searching and Sorting/find pair with given differene.cpp
#include<bits/stdc++.h> using namespace std; bool findPair(int arr[], int size, int n) { map<int,int>m; for (int i = 0; i < size; i++) { m[arr[i]]++; } for (int i = 0; i < size; i++) { if (m[abs(n - arr[i])] >= 1) { return true; } } return f...
ALGO
0.999892
4.959804
1b05e430-7efb-4b94-b0f8-a414e9e049b0
Qasak/cpp_notes
0.C到C++/code/enum.cpp
#include<iostream> #include<iomanip> using namespace std; int main(){ enum color_set {red,yellow,blue,white,black}; //声明枚举类型color color_set color; int i,j,k,counter=0,loop; //counter是累计不同颜色的组合数 for(i=red;i<=black;i++) { for(j=red;j<=black;j++) { if(i!=j){ //前两...
ALGO
0.938492
3.224303
be146399-9742-4414-96e0-e3d366431c91
alex-rarzola/Trapezoide
WXY/12015.cpp
#include <iostream> #include <cstring> #include <vector> using namespace std; struct url { string dir; int relevancia; }; vector<url> v; int main(int argc, char const *argv[]) { int N; int max; int i = 1; url aux; cin >> N; while(N--) { v.clear(); max = 0; for (int i = 0; i < 10; ++i) { cin >> au...
ALGO
0.999419
4.426785
a7c72e16-55ea-4901-a007-6dabf05edbd3
HenriqueSabino/Neuralcpp
src/math/ActivationFunction.cpp
#include <cmath> #include "ActivationFunction.hpp" Matrix ReLU::apply(Matrix mat) const { for (int i = 0; i < mat.getRows(); i++) { for (int j = 0; j < mat.getCols(); j++) { if (mat(i, j) <= 0) mat(i, j) = 0; } } return mat; } Matrix ReLU::applyDeri...
ALGO
0.998456
6.211071
e090b57c-57ef-4d46-a31f-b7067b2972a6
RitikRajThakur/CPP
Greater.cpp.cpp
// Find Greater Among Three #include <iostream> using namespace std; int main() { int x,y,z; cout<<"Enter the three numbers"<<endl; cin>>x>>y>>z; // which no. is greater if(x>y&&x>z){ cout<<"x is greater"<<endl;} else if(y>x&&y>z){ cout<<"Y is greater"<<endl;} else{ cout<<"z is greater"<<endl;} return 0...
ALGO
0.999808
3.741212
3b95b460-f131-4bda-b2e3-92140a9eb0ba
aazdiallo/ClassProjects
a06/a6q015/test_Fraction.cpp
/* * File: main.cpp * Author: Abdoul Diallo * * Created on October 24, 2018, 9:46 AM */ #include <iostream> #include "Fraction.h" /* * */ void test_print() { int n = 0, d = 0; std::cin >> n >> d; Fraction f = {n, d}; reduce(f); // Making sure that the fraction is not reducible std::cou...
TOOL
0.985768
5.142976
c234504d-9dc9-41db-b824-b29618ca7f3a
Zhigden/labs
18.cpp
#include <iostream> #include <vector> using namespace std; int main() { setlocale(LC_ALL, "RU"); // Константа const double A = 3.5; // Вектор для хранения значений X vector<double> x; // Заполнение вектора X значениями от 1 до 10 с шагом 1 for (double i = 1; i <= 10; i++) { x.p...
ALGO
0.999384
4.111676
d927cdf6-e477-4040-a4ae-e797abe9720b
shuichih/oreoren
src/BVH.cpp
#include "Scene.h" #include "BVH.h" #include <cassert> using namespace std; BVH::BVH() : pLeft_(NULL) , pRight_(NULL) { } BVH::~BVH() { if (pLeft_->IsBVH()) delete pLeft_; if (pRight_->IsBVH()) delete pRight_; } inline BVH::BVH(const IShape* pLeft, const IShape* pRight, const BBox& bbox) : bbox_(bbox) , pLe...
ALGO
0.997862
5.971739
91840a96-ff8b-4b4c-902c-aaa486dcbdbf
AnandaAzmi/CodeTugasDevCpp
Algoritma/Tabel Kuadrat.cpp
#include <iostream> using namespace std; int main () { cout << "Menghitung Kuadrat 1 - 10"<<endl; cout << "==============================="<<endl; int X, X2, X3; cout << "X "; cout << "X^2 "; cout << "X^3 "<<endl; cout << "==============================="; for (X=1, X2 = 1; X<=10, X2<=100;X++){ X = X; X2 ...
ALGO
0.971063
3.401713
d0199e6e-420c-4f2c-b893-ee4d8e704c77
andrua-joshua/ProstaCare.info
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.998784
6.761023
c99d8141-e185-4818-818e-7f55b5fbe009
coffree0123/Leetcode
solutions/110_Easy_Balanced 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.999876
6.656085
c176718a-bbd2-4563-9d2e-3440c43d95ad
Oziach/Code-Challenges-And-Practice
HackerRank/C++/8.ArraysIntroduction.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { int n; cin >> n; int nums[n]; for(int i = 0; i < n; i++){ cin >> nums[n-1-i]; } for(int i = 0; i < n; i++){ cout << nums[i] << " "; } r...
ALGO
0.999201
3.458993
5dfe41e5-765e-40fa-8394-7edc24378524
troylow97/ComputationalGeometry
CGEngine/Shapes/Polygon.cpp
#include "pch.h" #include "Polygon.h" namespace Shape { Polygon::Polygon() : m_Vertices{} {} Polygon::Polygon(const glm::vec2& one) { m_Vertices.push_back(one); } Polygon::Polygon(const std::vector<glm::vec2>& dots) : m_Vertices{ dots } {} Polygon::Polygon(const Polygon& other) { m_Vertices = other....
TOOL
0.974544
6.195439
c2cc7cd8-8d3b-4e25-93b1-dd639d0d22ec
alimdneaz/cpp_main_course_apna_college_last
005_trees/116_recover_BST.cpp
#include"bits/stdc++.h" using namespace std; struct node{ int data; node* left; node* right; node(int val) { data = val; left = NULL; right = NULL; } }; //! the following code has some issues to be fiexd //******************************************************************...
ALGO
0.999985
4.493938
e5d601dc-912c-4088-a3d9-414ef1507f75
yamini3701/Striver-SDE-Sheet
Arrays/16-MajorityElement(Nby3)(3).cpp
class Solution { public: vector<int> majorityElement(vector<int>& nums) { int sz = nums.size(); int num1 = -1, num2 = -1, count1 = 0, count2 = 0, i; for (i = 0; i < sz; i++) { if (nums[i] == num1) count1++; else if (nums[i] == num2) ...
ALGO
0.999981
5.434602
dd80dd47-0086-4f19-8c92-453a9735085d
theodore/olympiads
HOJ/1072/bf.cpp
#include <cstdio> #include <cstring> #include <iostream> typedef long long ll; int n; char str[13]; ll ans; bool vis[13]; int l; void search(int d, ll v) { if (d == l) { ans += (v % n == 0); return; } v *= 10; bool used[13]; memset(used, 0, sizeof used); for (int i = 0; i < l; ++i) if ...
ALGO
0.999488
4.040845
d7feb234-c293-4ea5-92fc-e58641529df3
Blonck/consus
exe/WHAM/NVT/makeHist.cpp
#include <chrono> #include <iostream> #include <string> #include "../../src/DiscreteAxis.hpp" #include "../../src/WHAM/WHAM.hpp" #include "../../src/data/all_matching.hpp" #include "../../src/data/load_file.hpp" #include "../../src/eigenvalues/add_eigenvalues.hpp" #include "../../src/vector/helper.hpp" #include "boos...
DATA
0.866803
4.05968
45a7ae2f-827b-4622-869c-d520b57d3f9e
LonxunQuantum/Lammps_for_PWMLFF
lammps_neigh_mlff_20230508/src/PHONON/dynamical_matrix.cpp
// clang-format off /* ---------------------------------------------------------------------- Contributing author: Charlie Sievers (UC Davis), charliesievers at cox.net ------------------------------------------------------------------------- */ #include "dynamical_matrix.h" #include "angle.h" #include "atom.h" #...
ALGO
0.992354
6.738544
bcd3dfe4-7735-4de7-9cf5-60d607d46fc7
tinalny/cpp_project
code practice/0428/0428/test2.cpp
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int n; while (cin >> n) { string s; vector<string> vs; int count = 0; for (int i = 0; i < n; i++) { cin >> s; vs.push_back(s); } for (int i = 0; i < vs.size(); i++) { string str = vs[i]; if (str.si...
ALGO
0.999817
4.278177
446d33b9-1d79-4c8e-810e-a7fc8e733a4d
Arijeet2580/Waste_Management_System
Interfacing_Code_EdgeImpulse/Waste_Management_Project_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/batch_matmul.cpp
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/batch_matmul.h" #include <algorithm> #include <cstdint> #include <limits> #include "edge-impulse-sdk/tensorflow/lite/c/common.h" #include "edge-impulse-sdk/tensorflow/lite/kernels/internal/quantization_util.h" #include "edge-impulse-sdk/tensorflow/...
ALGO
0.909299
5.439179
79290368-dc27-495e-89a0-2879cc18202f
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Gemma/top0-100/shortest-subarray-with-sum-at-least-k-Solution.shortestSubarray/177840_+Info.cpp
static int ldb_dn_escape_internal(char *dst, const char *src, int len) { const char *p, *s; char *d; size_t l; p = s = src; d = dst; while (p - src < len) { p += strcspn(p, ",=\n\r+<>#;\\\" "); if (p - src == len) /* found no escapable chars ...
ALGO
0.994804
3.973711
c4ce4c98-a9e2-4ced-a559-aea51a328195
Crowndev/crown-evo
src/miner.cpp
#include <miner.h> #include <amount.h> #include <chain.h> #include <chainparams.h> #include <coins.h> #include <consensus/consensus.h> #include <consensus/merkle.h> #include <consensus/tx_verify.h> #include <consensus/validation.h> #include <policy/feerate.h> #include <policy/policy.h> #include <pow.h> #include <primi...
ALGO
0.987682
6.422894
5d829e8e-8c8e-4fa1-8c0a-d40bc805874a
havel-therock/dumpster
leetcode/1457.cpp
// 1457. Pseudo Palindromic Paths In Binary Tree #include <algorithm> #include <array> #include <iostream> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> // Definition for a bin struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode() : val(0...
ALGO
0.999921
6.173549
2c5f329e-d0de-41d1-bb26-f6a97609e1b7
Saleh7127/CPP-solution-by-Fellow_junior
CSES/cses 1094.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int main() { ll a[200005],n,i,j,c=0; cin>>n; for(i=0;i<n;i++) { cin>>a[i]; } for(i=1;i<n;i++) { if(a[i]<a[i-1]) { c+=(a[i-1]-a[i]); a[i]=a[i-1]; } } cout<<c<<endl...
ALGO
0.999954
3.742983
d712ee45-0bd8-4700-a132-3004861b0954
Git-Pratik97/recursive
moveallx.cpp
#include<iostream> using namespace std; string move_allx(string s) { if (s.length() == 0) { return ""; } char ch = s[0]; string ans = move_allx(s.substr(1)); if (ch == 'x') { return ans+ch; } else { return ch+ans; } } int main() { string s =...
ALGO
0.999463
3.825089
5eba901b-c409-4140-a353-aa3c4dce4eb6
reese60525/LeetCode
LeetCode/NotReview/LeetCode-46.cpp
#include <iostream> using namespace std; static const auto io_sync_off = []() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); return nullptr; }(); void recursive_ans(vector<vector<int>> &ans, vector<int> nums, vector<int> current) { if (nums.size() == 0) { ans.push_back(current); ...
ALGO
0.999997
6.072852
e34ffb33-6a48-47d9-af40-fb1b5c05d709
codewar193/Placement-Company-Coding-Quesstion
Accenture/Binary number system.cpp
#include<bits/stdc++.h> using namespace std; int OperationsBinaryString (char *str) { if (str == NULL) return -1; int i = 1; int a = *str - '0'; str++; while (*str != '\0') { char p = *str; str++; if (p == 'A') a &= (*str - '0'); else if (p == 'B') a |= (*str - '0'); el...
ALGO
0.999908
4.325109
879e43d1-c2b5-4cef-82b2-5a5a0d7e1b70
DovRine/neuralink-compression-challenge-solution
src/encode.cpp
#include "encode.h" std::vector<std::pair<int, int>> indexedRunLengthEncode(const std::vector<int>& data) { std::vector<std::pair<int, int>> encodedData; for (size_t i = 0; i < data.size(); ++i) { if (data[i] == 1) { int startIndex = i; int count = 0; while (i < data...
ALGO
0.984163
5.13794
bd62376a-58d2-4a2b-8140-ab7c2fe1d84b
HRF05/DMOJSolutions
dmopc22c5p1.cpp
#pragma GCC optimize("Ofast,unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef long long unsigned llu; #define int ll typedef pair<int,i...
ALGO
0.999795
4.085741
c6265122-b219-4ffa-967d-7d381af6d28c
snai2019/greenhouse_forecast
fastapiserver/Lib/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/libs/geometry/index/example/benchmark_experimental.cpp
// Boost.Geometry Index // Additional tests #define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL #include <iostream> #include <boost/chrono.hpp> #include <boost/foreach.hpp> #include <boost/random.hpp> #include <boost/range/algorithm/copy.hpp> #include <boost/geometry.hpp> #include <boost/geometry/index/rtree.hpp> #inc...
TEST
0.986943
4.901151
d05fda75-5544-4f00-aa99-7c0ceb4ef224
HaadifSadat/Miscellaneous
Miscellaneous-cpp/a_3.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; int arr[n+1]; for (int i = 0; i < n; i++) { cin>>arr[i]; } int mx = -1; int ans = -1; arr[n] = -1; for(int i = 0; i < n; i++) { if(arr[i] > mx && arr[i] > arr[i+1]) { ...
ALGO
0.99994
4.031858
757b18fb-113f-48cf-9aaf-449df6cab8c5
aftabfarhanarko/Comparative-Programming-all-Code
C++_Pattine_Printing/letter_pitting.cpp
#include<iostream> using namespace std; int main(){ int n; cout<<"Enter n : "; cin>>n; for(int i= 1;i<=n;i++){ for(int j = 1;j<=i;j++){ cout<<char(j+64); } cout<<endl; } for(int i=n-1;i>=1;i--){ for(int j = 1;j<=i;j++){ cout<<char(j+64);...
ALGO
0.999743
3.663054
875fb5ca-cfcb-4e66-b1e5-99ec26c6419a
MatthewDZane/UnrealQRCodeScanner
Source/ThirdParty/ZXingLibrary/Hololens/core/src/zxing/common/BitMatrix.cpp
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- #include <zxing/common/BitMatrix.h> #include <zxing/common/IllegalArgumentException.h> #include <iostream> #include <sstream> #include <string> using std::ostream; using std::ostringstream; using zxing::BitMatrix; using zxing::BitArray; using ...
TOOL
0.898071
6.887934
15eb0aa8-4340-4b96-8be7-15025e5f4a0f
rashmitha520/AlgoBloom
Sliding Window/Number of Subarrays with Bounded Maximum Solution.cpp
/*We are given an array nums of positive integers, and two positive integers left and right (left <= right). Return the number of (contiguous, non-empty) subarrays such that the value of the maximum array element in that subarray is at least left and at most right. Example: Input: nums = [2, 1, 4, 3] left = 2 right ...
ALGO
0.999985
5.202625
baeb2d7f-4712-4c73-bc80-f520ce3208c1
hitoshiQQ/LeetCode
2331. Evaluate Boolean Binary Tree/2331. Evaluate Boolean 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.999955
7.088619
4cdd0bf9-1cb9-47f4-b5a9-febfe513bdf2
ishandutta2007/codeforces
mnaeraxr/normal/678/F.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int64; typedef pair<int,int> pii; typedef vector<int> vi; typedef pair<int64,bool> answer; const int oo = 0x3f3f3f3f; const double eps = 1e-9; const int maxn = 100010; #define value first #define valid second struct rect { int64 p, q, idx; in...
ALGO
0.99995
4.551326
88e3cb8c-7adb-491a-9bb4-db2a8b324599
ishandutta2007/codeforces
dorost/normal/1354/C1.cpp
/* * In the name of GOD * Thanks God */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define F first #define S second const ld P = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679; int32_t main(){ cout << fixed <...
ALGO
0.998971
3.785363
20f28198-76e2-46f2-a6e4-b07662591178
Shelfcol/slam-book-master_GaoXiang
ch12/gen_vocab_large.cpp
#include "DBoW3/DBoW3.h" #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/features2d/features2d.hpp> #include <iostream> #include <vector> #include <string> using namespace cv; using namespace std; int main( int argc, char** argv ) { string dataset_dir = argv[1]; ifstr...
DATA
0.86755
5.436244
939d41e0-abdb-4e70-accb-2f1610f0c66c
yufeifly/leetcode
cpp/src/66.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; class Solution { public: vector<int> plusOne(vector<int>& digits) { reverse(digits.begin(),digits.end()); int carry = 0; for(int i=0;i<(int)digits.size();++i) { digits[i] += (i == 0) ? 1 + carry : carry; carry = digit...
ALGO
0.999927
5.926094
0200b653-90d1-4090-a183-67e02e4dff00
skjha1/Aditya-verma-youtube-playlist-code
Dynamic Programming/31 Palindrome Partitioning Memoized optimization.cpp
#include <bits/stdc++.h> using namespace std; const int D = 1001; int t[D][D]; bool isPallindrome(string X, int i, int j) { while (i <= j) { if (X[i] != X[j]) return false; i++, j--; } return true; } int Solve(string X, int i, int j) { if (t[i][j] != -1) return t[i][j]; if (i >= j || isPallindrome(X,...
ALGO
0.999983
5.245227
f2b95490-83eb-47c6-b98f-9ea8db08f39c
sarvex/leetcode-umka
solution/2500-2599/2598.Smallest Missing Non-negative Integer After Operations/Solution.cpp
class Solution { public: int findSmallestInteger(vector<int>& nums, int value) { int cnt[value]; memset(cnt, 0, sizeof(cnt)); for (int x : nums) { ++cnt[(x % value + value) % value]; } for (int i = 0;; ++i) { if (cnt[i % value]-- == 0) { ...
ALGO
0.999981
5.62042
92f7b595-c145-4a56-a292-de934a313ac2
vusec/stickytags
llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.stable.pass.cpp
// UNSUPPORTED: c++03, c++11, c++14 // <algorithm> // template <class PopulationIterator, class SampleIterator, class Distance, // class UniformRandomNumberGenerator> // SampleIterator sample(PopulationIterator first, PopulationIterator last, // SampleIterator out, Distance n, // ...
TEST
0.908018
7.583549
b5b1a23c-4c51-4046-a0bf-d3068938f4e3
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_7561_1.cpp
#include <bits/stdc++.h> using namespace std; class Trie { class TrieNode { public: TrieNode* children[2]; pair<bool, int> isEndOfWord; TrieNode() { children[0] = NULL; children[1] = NULL; isEndOfWord.first = false; isEndOfWord.second = 0; } int number_of_children() { ...
ALGO
0.999995
4.58323
869d91dd-ca5f-4f21-b0a8-29f828aee1df
sujal2048/SDE-Question_series
New_Algorithms/BIT_Segmentedtree.cpp
#include<bits/stdc++.h> //https://www.youtube.com/watch?v=DPiY9wFxGIw using namespace std; #define ll long long #define ld long double const int MOD = 1000000007; ll power(ll a, ll b){ ll res=1;a=a%MOD; while(b>0){ if(b&1){ res=(res*a)%MOD;b--; } a=(a*a)%MOD;b>>=1;} retu...
ALGO
0.999707
3.596014
0ca7a3f1-90fb-422e-8663-581957fddc89
seokhyunpark/algorithm-practice
AP.7/7.1.cpp
def prim(W): n = len(W) - 1 F = [] nearest = [-1] * (n + 1) distance = [-1] * (n + 1) for i in range(2, n + 1): nearest[i] = 1 distance[i] = W[1][i] print_nearest(nearest) for _ in range(n - 1): minValue = INF for i in range(2, n + 1): if (0 <= dis...
ALGO
0.999926
4.721701
95f06a81-50ed-46ae-bd3a-1407ea7acc5f
huxingyi/autoremesher
thirdparty/cgal/CGAL-5.1-beta1/demo/AABB_tree/benchmarks.cpp
#include "Scene.h" #include <QInputDialog> #include <CGAL/Memory_sizer.h> #include <CGAL/Timer.h> void Scene::benchmark_intersections(const double duration) { if(m_pPolyhedron == NULL) { std::cout << "Load polyhedron first." << std::endl; return; } // constructs tree std::cout << ...
TEST
0.909256
4.208987
db01dcfb-866a-40d3-9a37-ffb8df6dbda1
Brijesh-code388/Problem-solve-DSA
DSA/linkedlist/palidrome.cpp
#include <bits/stdc++.h> #include <math.h> #define mod 1000000007 #define ll long long int #define pii pair<int, int> #define n cout << "\n"; #define s cout << " "; using namespace std; struct Node { int data; struct Node *next; Node(int data) { this->data = data; next = NULL; } };...
ALGO
0.999629
3.517181
57f0f0ce-9b21-42f7-93ec-76c940787bf9
KMsojib/LeetCode
Year-2025 Problem List/May 2025/2894. Divisible and Non-divisible Sums Difference.cpp
# Problem : 2894. Divisible and Non-divisible Sums Difference # Time Complexity : O(n) # C++ / Python Solution class Solution { public: int differenceOfSums(int n, int m) { int sum1 = 0, sum2 = 0; for (int i = 1; i <= n; i++) { if (i % m == 0) { sum2 += i; ...
ALGO
0.999981
5.600927
a1afa953-8e8c-417c-8ca9-b446c2517402
QinHongZhe/hongzhe-leetcode
solution/0300-0399/0303.Range Sum Query - Immutable/Solution.cpp
class NumArray { public: vector<int> s; NumArray(vector<int>& nums) { int n = nums.size(); s.resize(n + 1); for (int i = 0; i < n; ++i) s[i + 1] = s[i] + nums[i]; } int sumRange(int left, int right) { return s[right + 1] - s[left]; } }; /** * Your NumArray obj...
ALGO
0.99985
6.583949
aa5fbf03-dfdd-444b-aaf4-ef7bea76219e
LauraKoraeva/CPP
module_2_lesson_2/2_Introduction_to_vector_task_2.cpp
//Урок 2. Знакомство с std::vector v2 //1. Введение в тип vector //Задание 2 #include <iostream> #include <vector> #include <limits> #include <numeric> bool correctInput(float input) { if (std::cin.fail() || std::cin.peek() != '\n') { std::cerr << "Error!\n"; std::cin.clear(); std::cin.ignore(std::numeric_l...
TOOL
0.910451
4.154416
f5a940b9-4a49-4919-8816-72c6375fe6fa
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Phi/top0-100/count-almost-equal-pairs-ii-Solution2.countPairs/177901_Overflow.cpp
_asn1_ltostr (long v, char *str) { long d, r; char temp[LTOSTR_MAX_SIZE]; int count, k, start; if (v < 0) { str[0] = '-'; start = 1; v = -v; } else start = 0; count = 0; do { d = v / 10; r = v - d * 10; temp[start + count] = '0' + (char) r; c...
ALGO
0.998873
4.978889
a83cc9d8-8164-455d-88f9-a7c1af2f07e1
gaoxy914/Dynamic-MIS
src/DyTwoSwap.cpp
#include "DyTwoSwap.h" bool Node::_exist_edge(const int& id) { for (int w : edges) if (w == id) return true; return false; } void Node::_insert_edge(const int& id) { degree ++; edges.push_back(id); } void Node::_delete_edge(const int& id) { for (int i = 0; i < degree; ++ i) { if (edges[i]...
ALGO
0.993928
4.196887
d63c7e7d-8a06-49de-9a8c-f5cd005506a9
leducphy/PRF192
src/shape/HinhVe/bai36 hcn C3.cpp
/* bai 36 HCN nguyen tac C3 */ #include<stdio.h> int main(){ int i,j,n; scanf("%d", &n); for(i=1;i<=n;i++){ for(j=1;j<=n-i+1;j++){ printf("%d", j); } printf("\n"); } }
ALGO
0.999442
3.484803
f58f2f84-ca25-437d-9d26-c172b207a6c6
kplabs-pl/opencv_contrib_akaze_gpu
modules/ximgproc/src/slic.cpp
/* "SLIC Superpixels Compared to State-of-the-art Superpixel Methods" Radhakrishna Achanta, Appu Shaji, Kevin Smith, Aurelien Lucchi, Pascal Fua, and Sabine Susstrunk, IEEE TPAMI, Volume 34, Issue 11, Pages 2274-2282, November 2012. "SLIC Superpixels" Radhakrishna Achanta, Appu Shaji, Kevin Smith, Aurelien Lucch...
ALGO
0.997366
5.368155
301f3df9-9ed9-4eb8-8a3b-f569584408a8
shudhanshu435/LeetCode
2316-count-hills-and-valleys-in-an-array/2316-count-hills-and-valleys-in-an-array.cpp
class Solution { public: int countHillValley(vector<int>& nums) { for(int i=1;i<nums.size();i++){ if(nums[i]==nums[i-1]){ nums.erase(nums.begin()+i); i--; } } // for(auto i:nums)cout<<i<<" "; int c=0; // cout<<endl<<nums...
ALGO
0.999946
5.353832
4b02d917-35a5-4fe1-9988-dfef0071a547
harshitgupta2019/khatarnakcoder
codechef/JAM11.cpp
#include <iostream> using namespace std; int main() { long long int t,n; cin>>t; while(t--) { cin>>n; long long int dp[100001],i,m=1000000007; dp[0]=0; dp[1]=1; dp[2]=2; dp[3]=4; for(i=4;i<=n;i++) dp[i]=(dp[i-1]+dp[i-2]+dp[i-3])%m; cout<<dp[n]<<endl; } return 0; }
ALGO
0.999977
3.825634
c8efb4cd-ee72-4a0e-9382-c0ce4e209b84
joaocc/torcs-git
src/modules/simu/simuv2/SOLID-2.0/src/Object.cpp
#ifdef _MSC_VER #pragma warning(disable:4786) // identifier was truncated to '255' #endif // _MSC_VER #include "Object.h" #include "AlgoTable.h" #include "Convex.h" #include "Complex.h" #include <new> Object::Object(DtObjectRef obj, ShapePtr shape) : ref(obj), shapePtr(shape), bbox(Point(INFINITY_, INFINIT...
ALGO
0.966426
7.179277
93525f23-cb87-4fb2-b338-d6d39a132cb2
shreejitverma/SDE-Interview-Prep
LeetCode/C++/minimum-operations-to-write-the-letter-y-on-a-grid.cpp
// Time: O(n^2) // Space: O(1) // array class Solution { public: int minimumOperationsToWriteY(vector<vector<int>>& grid) { vector<vector<int>> cnt(2, vector<int>(3)); for (int i = 0; i < size(grid); ++i) { for (int j = 0; j < size(grid[0]); ++j) { ++cnt[(i <= (size(gri...
ALGO
0.999887
6.287641
96def9e0-b22b-4286-b8a0-e73cfa9a3e20
Krythz43/CP-Archieve
spoj/permut2.cpp
#include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL) #define rep(i,n,z) for(int i=z;i<n;i++) #define rrep(i,z) for(int i=z;i>=0;i--) #define lli long long int #define nl cout<<endl #define vi vector<int> #define vlli vector<long long int> #define umap u...
ALGO
0.997351
3.47456
8164ef5f-192e-4cde-8818-7aa0f008be50
nvnnv/Leetcode
383. Ransom Note.cpp
bool canConstruct(string ransomNote, string magazine) { if (magazine == "" && ransomNote == "") return true; int len_m = magazine.size(); unordered_map<char, int> f; for (auto c : magazine) { f[c]++; } unordered_map<char, int> ff; for (auto c : ransomNote) { ff[c]++; ...
ALGO
0.99981
5.794145
7287c816-f20b-415d-b7e5-ce80e472eac1
eEmmFinity/ProblemSolving
Beecrowed/Ad-hoc/1414.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; int main() { string str; int a, b, po; while (cin >> a >> b && a) { int p = 3 * a; int d = 0; for (int i = 0; i < b; i++) { cin >> str >> po; d += po; } cout << p - ...
ALGO
0.996486
3.13981
017d181e-7e31-4e42-b588-a4ccba116058
mushfiq-906/cp__training
Codeforces__Problems/contest/1325/d/73263606_wrong_answer_1.cpp
// Author : Abdallah Hemdan // For Hassanosama, ICPC next year ISA. #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS #endif #include <bits\stdc++.h> #define vll vector<ll> #define vi vector<int> #define sz size() #define pii pair<int,int> #define IO ios_base::sync_with_stdio(0),ios::sync_with_stdio(0),cin.tie(0),cout.ti...
ALGO
0.998076
3.878501
71f051da-2e7c-4e25-a57c-c3fa22cceef1
ishandutta2007/codeforces
yosupo/normal/559/B.cpp
#include <iostream> #include <cstdio> #include <cassert> #include <cstring> #include <vector> #include <valarray> #include <array> #include <queue> #include <set> #include <unordered_set> #include <map> #include <unordered_map> #include <algorithm> #include <cmath> #include <complex> #include <random> using namespace...
ALGO
0.999996
3.232579
28a5110d-e5b4-4211-afca-01d9b3f51a04
khanhnamle1994/technical-interview-prep
LeetCode/Number-of-Boomerangs.cpp
// Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between // i and j equals the distance between i and k (the order of the tuple matters). // Find the number of boomerangs. You may assume that n will be at most 500 and coordinates of poin...
ALGO
0.999485
6.541035
b336eef2-2d37-41fa-b423-5ec3c199a557
PavanRaj26/LeetCode
July/word_break_2.cpp
class Solution { private: unordered_map<string, vector<string> > mp; // Unordered_set used // to store the dictionary. unordered_set<string> dict; public: vector<string> combine( vector<string> prev, string word){ // Loop to find the append string // whic...
ALGO
0.999627
6.103076
88bdcf8d-a07f-4be6-8908-99b6fc69e5a9
christopherwj/a_code_a_day
c++/generic_code/elevator/elevator.cpp
#include <iostream> #define FLOORS 10 using namespace std; struct elevator { int floorSelected; int floorNumber; int getFloor(); void initialize(); void selectFloor(int floor); void go(); }; int elevator::getFloor() { return floorNumber; } void elevator::initialize() { floorSelected = 0; floorNumber = 0; ...
TOOL
0.88584
4.019859
22ef5034-d250-4643-abbd-d01d55596be0
lixiao-18792732127/Point-at-offer
09Fibonacci2.cpp
//QƲеչ̬ //һֻһοһ̨ףҲ //һn̨ж #include<iostream> using namespace std; long long Sum(int n) { int arr[2] = { 0, 1 }; if (n < 2) { return arr[n]; } long F1 = 1; long F2 = 0; long ret = 0; for (unsigned int i = 0; i <= n; i++) { ret = F1 + F2; F2 = F1; F1 = ret; } return ret; } int main() { int n = 0; int...
ALGO
0.999889
3.26753
192f49f9-1415-4007-aefd-75a71e811677
nebulaed/My_LeetCode_Road
Code/103.二叉树的锯齿形层序遍历.cpp
#include<vector> #include<queue> #include<algorithm> 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, TreeNod...
ALGO
0.999998
6.183891
a96c4f3a-0c66-499c-ae27-80a58a666f0c
mingfulsnack/BT01-BT10
BT05/7.cpp
#include <bits/stdc++.h> using namespace std; void in(int n, int m) { while (n--) cout << " "; while (m--) cout << "*"; cout << endl; } int main() { int n; cin >> n; for (int i = 1, j = n - 1; i <= n * 2 - 1; i += 2, j--) { in(j, i); } }
ALGO
0.999902
3.105842