uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
4739fc11-27be-47df-ae01-7c656e26d60f
derinu/FlyFF
Source/boost_1_50_0/libs/serialization/src/extended_type_info.cpp
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // extended_type_info.cpp: implementation for portable version of type_info // See http://www.boost.org for updates, documentation, and revision history. #if (defined _MSC_VER) && (_MSC_VER == 1200) # pragma warning (disable : 4786) //...
TOOL
0.874329
6.773068
16f3dad4-8dc1-453d-9c44-4d160d8117b7
prachurjyo-ghub/Competitive-Programming
codeforce/Rank 900/2025/09-01-25/318A.cpp
// #include <bits/stdc++.h> // using namespace std; // int main() { // long long n, k; // cin >> n>>k; // vector<long long > finalNum; // for (int i = 1; i <= n; i += 2) { // finalNum.push_back(i); // } // for (int i = 2; i <= n; i += 2) { // finalNum.push_back(i); // } ...
ALGO
0.999777
4.239427
88b74cf2-c6dd-4d4b-8287-0cfb4f5a8756
EvetProject/EvetCoin
src/rpc/mining.cpp
#include "amount.h" #include "base58.h" #include "chainparams.h" #include "core_io.h" #include "init.h" #include "main.h" #include "miner.h" #include "net.h" #include "pow.h" #include "rpc/server.h" #include "util.h" #include "validationinterface.h" #ifdef ENABLE_WALLET #include "wallet/db.h" #include "wallet/wallet.h"...
WEB
0.975416
6.26101
9ab2046a-b5d3-4017-a1f7-cf5ff637b926
RicardoJavierH/FirstSoftware
neopz/Projects/HpAdaptivity/ToolsOptimal.cpp
// // ToolsOptimal.cpp // PZ // // Created by Denise de Siqueira on 6/18/15. // // #include "ToolsOptimal.h" #include "pzpoisson3d.h" #include"pzgeoelbc.h" #include "tpzgeoelrefpattern.h" #include "TPZGeoLinear.h" #include "tpztriangle.h" #include "pzgeoquad.h" #include "pzgengrid.h" #include "TPZSkylineNSymStructM...
ALGO
0.999395
4.704687
cd5453ee-0fe3-4197-8e25-08eb7f823f18
Parth1501/graph
prims.cpp
#include<bits/stdc++.h> using namespace std; class Prims { public: vector<vector<int>> edge; map<pair<int,int>,int> cost; Prims(int n) { edge.resize(n); } void addEdge(int source,int destination,int weight) { edge[source].push_back(destina...
ALGO
0.999944
4.624387
bc1336cf-36a3-43ba-8485-09acb85f24d1
brahimlamnaouar/Ftimeout
Brahim/ENSIAS@IT/Mathematics/D_Jeff_And_Furrik.cpp
#include <bits/stdc++.h> #define ll long long #define str string #define rep(i, f, l) for(ll i = f;i < l; i++) #define mrep(i, l, f) for(ll i = l;i > f; i--) #define MOD 1e6 using namespace std; inline int in() { int x; scanf("%d", &x); return x; } int main(){ ll n = in(); ll arr[n]; rep(i, 0, n) arr[...
ALGO
0.99949
3.488343
d83996e7-e3c7-4d5c-af40-259e5add80b6
SagunPanda/Basic-Question
reversenum.cpp
//write a program to reverse a number //code #include <iostream> using namespace std; int main() { int n, reverse=0, rem; cout<<"Enter a number: "; cin>>n; while(n!=0) { rem=n%10; reverse=reverse*10+rem; n/=10; } cout<<"Reversed Number: "<<reverse<<en...
ALGO
0.999418
3.065347
7ab0c9b7-34c7-4b29-92c4-a16aa8d5074f
MrStarman18/Kattis
animalv2.cpp
/*Kattis problem Abandoned Animal Developer: Justin T. Alexander Date: 6/1/2023 */ #include <iostream> #include <vector> #include <set> using namespace std; //This version of the program utilizes the "purchase" struct to form a path of what was bought where. //However, it exceeds the Kattis memory limit for test case 6...
ALGO
0.99995
4.938321
78238290-62a2-45f5-b92c-a72e6aa16e40
mrzhuzhe/lust
test_boost_geo/src/spatial_index.cpp
// https://www.boost.org/doc/libs/1_85_0/libs/geometry/doc/html/geometry/spatial_indexes/rtree_quickstart.html // topologic algorithem is quite good https://www.boost.org/doc/libs/1_83_0/libs/geometry/doc/html/geometry/reference/algorithms.html #include <boost/geometry.hpp> #include <boost/geometry/geometries/point.hpp...
ALGO
0.99934
6.086479
004c53b7-a2a2-4d0b-8854-bfa5632974a3
KaarLarax/The-Ultimate-Topic-List
Basics/Big O Notation and Time and Space Complexity Analysis/Tricky Sum.cpp
// BY LARA 1424 // https://codeforces.com/profile/DarkoLaraSlowed // https://github.com/KaarLarax // https://www.youtube.com/@KaarLarax #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using vi = vector<int>; using vll = vector<long long>; us...
ALGO
0.999835
5.121861
d99987c1-2794-411e-b2a2-096dd79da31d
mayank-jangid-moon/Fashion_Framework
Preprocessing/openpose/src/openpose/hand/handExtractorCaffe.cpp
#include <openpose/hand/handExtractorCaffe.hpp> #ifdef USE_CAFFE #include <caffe/blob.hpp> #endif #include <openpose/gpu/cuda.hpp> #include <openpose/hand/handParameters.hpp> #include <openpose/net/maximumCaffe.hpp> #include <openpose/net/netCaffe.hpp> #include <openpose/net/resizeAndMergeCaffe.hpp> #include <openp...
TOOL
0.884048
6.755662
0969d2d0-86bb-4817-8ec7-92b538edeaf7
DeepeshnotCool/LeetCode-Submissions
my-folder/problems/longest_path_with_different_adjacent_characters/solution.cpp
class Solution { public: vector < vector < int > > adj; string letters; int dfs(int u, int p, int& best_path){ int best_path_1 = 0, best_path_2 = 0; auto update_max = [&](int x){ if(x >= best_path_1) best_path_2 = best_path_1, best_path_1 = x; ...
ALGO
0.99994
5.017362
789756d3-04dc-4084-aac7-e996b6a6ebbb
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_5085_13.cpp
#include <bits/stdc++.h> using namespace std; int main() { int A,B,C; cin >> A >> B >> C; cout << min(A + B,B + C,C + A); }
ALGO
0.999556
4.07766
47135125-effa-4992-8c55-8ae0e2b35f2b
Syhawk/LeetCode
merge_two_sorted_lists.cpp
//uri: https://leetcode.com/problems/merge-two-sorted-lists/ /* * 将两个有序链表合并起来,新链表每次选取两个有序链表中当前节点值小的 * 节点作为下一个元素,直到两个有序链表全都遍历完毕。 * 空间复杂度:O(1). * 时间复杂度:O(m + n). * */ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {}...
ALGO
0.999964
6.021359
141877f7-717c-4e02-816b-92d52cc8129b
mitupatil18/Leetcode-Solutions
287-find-the-duplicate-number/find-the-duplicate-number.cpp
class Solution { public: int findDuplicate(vector<int>& nums) { set<int> s; for(auto x : nums) { if(s.find(x)!=s.end()) return x; s.insert(x); } return -1 ; } };
ALGO
0.999966
5.702856
8a0d118e-bf74-485c-b2cb-07e9e3d70fc5
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/MixtralExpert/top0-100/fair-distribution-of-cookies-Solution.distributeCookies/177913_Exec_Code_Overflow.cpp
tt_cmap8_validate( FT_Byte* table, FT_Validator valid ) { FT_Byte* p = table + 4; FT_Byte* is32; FT_UInt32 length; FT_UInt32 num_groups; if ( table + 16 + 8192 > valid->limit ) FT_INVALID_TOO_SHORT; length = TT_NEXT_ULONG( p ); if ( table + len...
ALGO
0.950636
4.683472
0e44abb8-8a2b-4ae5-ba1f-b10a2b1d0212
biyotte/Code_of_gunwookim
Codeforces/Edu Codeforces Round 101 (div2)/D.cpp
#include <bits/stdc++.h> #define x first #define y second #define pb push_back #define all(v) v.begin(),v.end() #pragma gcc optimize("O3") #pragma gcc optimize("Ofast") #pragma gcc optimize("unroll-loops") using namespace std; const int INF = 1e9; const int TMX = 1 << 18; const long long llINF = 2e18; const long long ...
ALGO
0.999538
4.029172
2f2850b9-3b9e-4cfe-961f-92a00b8c87e9
hongtaocai/code_interview
cpp/ConvertSortedArraytoBinarySearchTree.cpp
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode *sortedArrayToBST(vector<int> &num) { return sortedArrayToBST(num, 0, (int)num.size()-...
ALGO
0.999992
6.233964
fa9f1b31-2805-4738-a92e-d68a550d3a42
uzzzzin/Algorithm
LeetCode/0406-queue-reconstruction-by-height/0406-queue-reconstruction-by-height.cpp
class Solution { public: static bool compare(vector<int>& a, vector<int>& b) { if(a[0] == b[0]) { if(a[1] < b[1]) return true; return false; } else // a[0] != b[0] { if(a[0]>b[0]) return true; ...
ALGO
0.999999
5.89441
273e12c0-2e23-486f-9f73-2feec682905f
divykantsharma/Coding-Ninja-Solutions
Milestone 3/Recursion 2/Check AB.cpp
bool solve(char input[]) { if(input[0]=='\0') return true; // Write your code here bool so; if(input[0]=='a'&&(input[1]=='\0'||input[1]=='a')) so=solve(input+1); else if(input[0]=='a'&&(input[1]=='b'&&input[2]=='b')) so=solve(input+1); else if(input[0]=='b'&&input[1]=='b'&&(i...
ALGO
0.999932
3.867618
4f16fb6b-fa64-4bcc-9524-cec51403a358
Sudo42b/Problem_Solving-Algorithm-
Algorithm_Study/10810.cpp
#include <iostream> #include <cstring> using namespace std; int arr[300]; int main() { ios::sync_with_stdio(false); int N, M; cin >> N >> M; memset(arr, 0, sizeof(arr)); while (M--) { int i, j, k; cin >> i >> j >> k; for (int _i = i; _i <= j; _i++) { arr[_i] = k; } } for (int _i = 1; _i <= N; _i++...
ALGO
0.999978
3.310762
c2a82d17-5458-43a5-9bc8-4611045ec025
sohom09/DSA-USING-C
merge sort.cpp
//MEREGE SORT #include<stdio.h> int a[]={90,45,78,25,78,88,43,56,10,22,47,66,40}; int b[sizeof(a)/sizeof(a[0])]; void sort(int s,int m,int e) { int i=s,j=m+1,si=s; if(s<e) { while(i<=m && j<=e) { if (a[i]<a[j]) b[si++]=a[i++]; else b[si++]=a[j++]; } for (int k=i;k<=m;k++) b[si++]=a[k]; //le...
ALGO
0.999984
3.431851
d4cf8343-89c6-4da3-8099-f67968638cd2
488315-archive/mt8163-frameworks-av
media/libstagefright/codecs/amrnb/dec/src/pstfilt.cpp
/*---------------------------------------------------------------------------- ; INCLUDES ----------------------------------------------------------------------------*/ #include <string.h> #include "pstfilt.h" #include "typedef.h" #include "mode.h" #include "basicop_malloc.h" #include "basic_op.h" #include "weight_a.h...
ALGO
0.992522
4.827775
fc56c9b6-4689-461a-87cb-f150bfa9726c
Ankur2024/DSA
Tree/BinaryTree.cpp
#include <bits/stdc++.h> using namespace std; class node { public: int data; node *left; node *right; node(int d) { data = d; left = right = NULL; } }; node *buildTree(node *root) { cout << "Enter the data" << endl; int data; cin >> data; root = new node(data); ...
ALGO
0.999942
5.539965
bcf88f89-3017-4169-84bf-377b5f682d57
raincross7/code-similarity
codes/train_code/problem367/problem367_109.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <vector> #include <list> #include <set> #include <map> #include <queue> #include <stack> #include <cctype> #include <cassert> #include <climits> #include <string> #include <bitset> #include <cfloat> #include <unordered_set> #include <...
ALGO
0.999926
4.457448
2f3bc837-da19-4dc5-9ab3-bcc7aeaf5a59
abhiXsliet/Solved-DSA-Problems
Leetcode Contests/Weekly Contest 414/002-maximize-score-of-numbers-in-ranges.cpp
// https://leetcode.com/contest/weekly-contest-414/problems/maximize-score-of-numbers-in-ranges/ #include <bits/stdc++.h> using namespace std; class Solution { private: typedef long long ll; bool isPossible(vector<int>& start, ll x, int d) { // Check if it is possible to make a minimum absolute differ...
ALGO
0.999977
5.889557
bf03548b-1d8e-4eb3-855e-302557800697
devcbandung/clashofcode-testdata-and-solution
devc-meetup-venue/scorerhr.cpp
// Start of HEAD #include <map> #include <cmath> #include <cstdio> #include <vector> #include <fstream> #include <iostream> #include <algorithm> #ifdef __APPLE__ #include <json/json.h> #else #include <json/json.h> #endif using namespace std; using namespace Json; class TestStruct { public: size_t testcas...
ALGO
0.991915
5.71452
4dd31c64-ae77-4360-8dc0-0e29c04f7d16
jaiminb2512/365-Days-of-Code
day_208/2500. Delete Greatest Value in Each Row.cpp
class Solution { public: int deleteGreatestValue(vector<vector<int>>& grid) { int row = grid.size(); int col = grid[0].size(); int sum = 0; for (int i = 0; i < row; ++i) { sort(grid[i].begin(), grid[i].end()); } for (int c = col - 1; c >= 0; --c) { ...
ALGO
0.999986
6.251889
18c6e0b2-ba84-4798-9f17-0b7bc9264f95
pickledbees/semantic_slam_map_enhancement
ORB_SLAM2/Thirdparty/g2o/g2o/core/estimate_propagator.cpp
#include "estimate_propagator.h" #include <queue> #include <vector> #include <cassert> #include <iostream> #include <algorithm> #include <fstream> //#define DEBUG_ESTIMATE_PROPAGATOR using namespace std; namespace g2o { # ifdef DEBUG_ESTIMATE_PROPAGATOR struct FrontierLevelCmp { bool operator()(EstimatePropa...
ALGO
0.999907
5.590659
56d8b7ab-6d84-4a26-9a79-81b45cde3b9f
aarindey/Leetcode-Solution-By-aarindey
36-valid-sudoku/36-valid-sudoku.cpp
class Solution { public: bool isValid(int row,int col,vector<vector<char>>& board,char c) { int count=0; for(int i=0;i<9;i++) { if(board[row][i]==c) count++; if(board[i][col]==c) count++; if(board[3*(row/3)+i/3][3*(col/3...
ALGO
0.999882
6.800067
620265bd-6520-4f65-aa15-166c7bccba6d
mykolesiko/algo
week9_trees2/not_determined_key/main.cpp
#include <iostream> #include <string> #include <time.h> #include <random> /* * Научитесь быстро делать две операции с массивом: * add i x — добавить после i-го элемента x (0≤i≤n) * del i — удалить i-й элемент (1≤i≤n) Входные данные На первой строке n0 и m (1≤n0,m≤105) — длина исходного массива и количество запросо...
ALGO
0.999763
5.522573
70804ad0-0162-4efb-aa3f-7a7648c26a6f
ashik5757/CP
CodeForces/Contest/817_Div4/C.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long typedef vector<int> vi; typedef vector<string> vs; typedef vector<ll> vll; typedef map<int,int> mii; typedef map<string,int> msi; typedef set<int> si; typedef set<string> ss; #define YES cout<<"YES"<<endl #define NO cout<<"NO"<<endl #define yes cout<<...
ALGO
0.99966
3.912879
4c295425-ec4f-44e7-b980-c41b1516cf6d
akashdas95/problem-solving-and-practicing-
recursive sum.cpp
#include<bits/stdc++.h>//AC using namespace std; /*int fib(int n) { if(n==0 || n==1) { return n; } return fib(n-1)+fib(n-2); }*/ /*void aesc(int n) { if(n==1) { cout<<"1"<<endl; return ; } aesc(n-1); cout<<n<<endl; } int desc(int n) { if(n==1) { ...
ALGO
0.999989
4.427922
e17f7096-41c9-41f1-922a-eee5d75eb9ae
samishibli/Data_Structures
HomeWork8/table2.cpp
#include <cassert> // Provides assert #include <cstdlib> // Provides size_t #include <iostream> #include "table2.h" template <class RecordType> table<RecordType>::table() { total_records = 0; for (int i = 0; i < TABLE_SIZE; i++) { data[i] = NULL; } } template <class RecordType> table<RecordType>::table(c...
TOOL
0.946845
4.978318
601aad35-7d28-49d6-a513-e6a8992657c2
MuhammadShoaibKalim/C-code-from-scratch
week-2.cpp
// Write a C++ program that takes two integer inputs from users and displays the result after subtracting first number from second number. #include<iostream> using namespace std; int main(){ int num1, num2, sub; cout<<"Enter the value of num1 and num2 :"<<endl; cin>>num1>>num2; //15 25 sub=num2-num1; cout<<"Af...
ALGO
0.987683
4.03333
c70413cb-ed9a-4837-a379-420fb3ec6813
otavioon/COLA-2022-Tools
datasets/src/algo/codenet/3/s614358403.cpp
#include<bits/stdc++.h> using namespace std; int N,A[100000],B[100000],C[100000]; long long int b[100001],res; int main(){ cin>>N; for(int i=0;i!=N;++i) cin>>A[i]; for(int i=0;i!=N;++i) cin>>B[i]; for(int i=0;i!=N;++i) cin>>C[i]; sort(A,A+N); sort(B,B+N); sort(C,C+N); for(int i=0;i!=N;++i){ int l=-1,r...
ALGO
0.999781
3.630534
807a950f-3ef9-45da-a0da-6799736a14c7
pwolf15/puzzles
Trees/CountCompleteTreeNodes/CountCompleteTreeNodes.cpp
#include <vector> #include <iostream> #include <assert.h> #include <limits> #include <queue> #include <cmath> #include "Trees.hpp" using namespace std; /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullpt...
ALGO
0.998855
6.8154
6b541119-d18b-4652-a33c-8d79a69b17da
carl-221b/mds3d
ray_tracing/mds3d_td2/ext/nanogui/ext/eigen/doc/examples/DenseBase_middleCols_int.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; int main(void) { int const N = 5; MatrixXi A(N,N); A.setRandom(); cout << "A =\n" << A << '\n' << endl; cout << "A(1..3,:) =\n" << A.middleCols(1,3) << endl; return 0; }
ALGO
0.95817
3.133398
0aa392d6-2860-4d1d-a693-ccc1049c2d57
hansh0101/Algorithm_BaseCamp
c++_ps/baekjoon/2981.cpp
#include <iostream> #include <vector> #include <cmath> #include <set> #include <algorithm> using namespace std; int n, num, gcd; vector<int> nums; vector<int> diff; set<int> result; int getGcd(int a, int b) { if (a < b) { swap(a, b); } if (a % b == 0) { return b; } else { retu...
ALGO
0.99999
4.186649
ee9cae6a-8384-47ff-8aaf-f7c88bf8ed5d
JamesQAQ/Coding-Practices
ZeroJudge/Solutions/d427. 大數根號/2011-07-14_842685.cpp
#include <cstdio> int d[120]={},num,ans[60]; void print(){ for (int i=num-1;i>=0;i--) printf("%d",d[i]); puts(""); } void init(int n){ for (int i=0;i<100;i++) d[i]=0; num=100; while (n!=0){ d[num++]=n%10; n/=10; } if (num%2) d[num++]=0; } bool ok(int ...
ALGO
0.999849
4.007883
6c675b19-69f2-4ef4-9b90-e878c14e46fc
djm-1/CodingInterviewPrep
Detect cycle in an undirected graph - GFG/detect-cycle-in-an-undirected-graph.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: // Function to detect cycle in an undirected graph. bool solve(vector<int> adj[], int V, vector<bool>&visited, int node){ queue<pair<int,int>>q; visited[nod...
ALGO
0.999974
5.9706
c5a43c0c-f984-4388-825a-a9e7ebe66aa8
abhishek18yadav/tree
trees/inverttree.cpp
#include<iostream> using namespace std; void helper(TreeNode* root){ if(!root)return; TreeNode* temp= root->left; root->left = root->right; root->right = temp; invertTree(root->left); invertTree(root->right); } TreeNode* invertTree(TreeNode* root) { helpe...
ALGO
0.999987
5.499188
2f128546-ad31-4fa7-86c7-ab8ff3f9113c
RollinsonSoftware/MiraCosta-CS-150
Module 8/Lab/Part 1/main.cpp
//Author: Jack Rollinson W7252829 // CS150 Spring 2018 // Module 8 : Lab Part 1 //=============================== /*Program Description: To determine if a number is evenly divisible by 9, simply add all of the digits in that number. If the sum is divi...
ALGO
0.9984
5.612053
5d9cca80-3dd3-48f1-9365-d78e8bf4ac18
guiteixeirapimentel/SIMPLEFD
src/CellNode.cpp
#include "CellNode.h" #include <cmath> CellNode::CellNode(double dx, double dy, double xPressure, double yPressure, double initPressure, double initU, double initV, bool boundary) : cPPressureNode(nullptr), cPRightStaggeredNode(nullptr), cPTopStaggeredNode(nullptr), cPRightNeighbor(nullptr), cPBottomNeighbor(n...
ALGO
0.987875
5.779207
2aeb6c7a-bd91-4e95-8aae-6b187284f834
rezagvn/Face-Recognition
opencv-master/modules/imgproc/src/matchcontours.cpp
#include "precomp.hpp" double cv::matchShapes(InputArray contour1, InputArray contour2, int method, double) { CV_INSTRUMENT_REGION(); double ma[7], mb[7]; int i, sma, smb; double eps = 1.e-5; double mmm; double result = 0; bool anyA = false, anyB = false; HuMoments( moments(contour1),...
ALGO
0.994423
4.393213
7d7072f7-7e58-4506-a327-973e3ff56e13
joonyoong/IntroProgramming
Fall 2022/programfunction.cpp
/* Author: Junyeong Shin Date: 9-19-22 Description: For functions */ #include <iostream> #include <iomanip> #include <cmath> #include <cstdlib>touch #include <tigme.h> using namespace std; int main() { int baseValue = 3; int exponentValue = -2; float resultValue = pow(baseValue, exponentValue); int absValue = abs(...
ALGO
0.970828
4.072762
d3b2ea35-6003-4919-86ff-1fb7b384464c
YounesMakhlouf/CP-Preparation
String To Int/main.cpp
#include <iostream> #include <cmath> #include <cassert> using namespace std; int Convert(string s) { bool valid = true; if (s.empty()) valid = false; for (char i : s) valid &= ((i <= '9') && (i >= '0')); if (!valid) assert (false); int x = 0; for (int i = 0; i < s.size(...
ALGO
0.98474
4.859368
8d703069-de96-4586-8201-1f75f5a7162b
al-amin-bhuiyan/Leetcode-Solution
2337. Move Pieces to Obtain a String.cpp
class Solution { public: bool canChange(string start, string target) { int i=0; int j=0; int s=start.size(); int t=target.size(); for(int i=0, j=0; i<s || j<t; i++, j++){ while(i<s and start[i]=='_')i++; while(j<t and target[j]=='_')j++; int c=start[i]; ...
ALGO
0.999909
5.666249
c2075cb3-21e0-42e6-bfa0-8eb0b87ab7ea
new-commit/dsa
11kruskals.cpp
/*You have a business with several offices; you want to lease phone lines to connect them up with each other; and the phone company charges different amounts of money to connect different pairs of cities. You want a set of lines that connects all your offices with a minimum total cost. Solve the problem by suggesting...
ALGO
0.999993
5.256629
96edee99-9d64-4816-bb24-a93b59835459
ishandutta2007/codeforces
avinashkartik/normal/1520/F2.cpp
#include<bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define GODSPEED ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(15); #define f first #define s seco...
ALGO
0.999962
3.935174
3019dfbb-188a-49bf-9170-ce41e41a02ed
Altu-Bitu-2/Altu-Bitu-Algorithm
0311 스택,큐,덱/1213.cpp
#include <iostream> #include <map> #include <stack> using namespace std; string make_palindrome(map<char, int> &m) { string pal = ""; char mid; stack<char> st; for(auto iter = m.begin(); iter!=m.end(); iter++) { // 갯수가 홀수인 알파벳이 있는 경우 가운데에 놓기 위해 따로 빼둔다. if(iter->second%2){ m...
ALGO
0.99999
3.742693
5398aba9-e702-4eb3-9e3e-c99333f77a90
avmss3101/Programas
val11151.cpp
#include<iostream> #include <string.h> using namespace std; int n, m, TM[12345][12345]; char A[1001], B[1001], C[1001]; void SMC(){ n = strlen(A); m = strlen(B); for( int i=1; i<=n; i++ ) TM[i][0]=0; for( int j=1; j<=m; j++ ) TM[0][j]=0; for( int i=1; i<=n; i++ ) { for( int j=1; j<=m; j++ ) { if( ...
ALGO
0.999961
4.428151
da399b42-762d-427c-94fc-1cf3cdcba6de
MAHMOUDGAD123/Cpp
Hadhoud Course/3- Algorithms & Problem Solving level 2/10- Print A Number In The Same Order/A2.10/A2.10.cpp
#include <string> #include <iostream> using namespace std; //*************************************************************************************************** //************************************ Global Functions ********************************************* //*****************************************************...
TOOL
0.946595
4.051297
b9c088bb-0d6a-4ce3-9896-736d1f80091a
ishandutta2007/codeforces
lmoliver/normal/1041/D.cpp
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int N=200200; int l[N],s[N],e[N],sf[N]; int main(){ int n,h; cin>>n>>h; for(int i=0;i<n;i++){ scanf("%d%d",&s[i],&e[i]); l[i]=e[i]-s[i]; } for(int i=0;i<n;i++){ sf[i]=i?sf[i-1]+l[i]:l[i]; } int ans=0; for(int i=0;i<n;i++){ int l=i,...
ALGO
0.99983
3.568881
d048c82d-29ff-4b19-a1db-bf7b33010e39
NemanjaZarkovic/VHDL_projekat
sve/tlm1/ip.cpp
#ifndef IP_C #define IP_C #include "ip.hpp" SC_HAS_PROCESS(Ip); Ip::Ip(sc_module_name name) : sc_module(name), ready(1), ready_sum(1) { SC_THREAD(proc); _index.resize(_IndexSize, std::vector<std::vector<num_f>>(_IndexSize, std::vector<num_f>(4, 0.0f))); _lookup2.resize(40); interconne...
TOOL
0.970902
5.556307
ceb9b915-4420-4a10-9f34-0d151c28ce1d
hungry5656/Leetcode
medium/8_StringtoInteger(atoi)/myAtoi.cpp
#include <string> using namespace std; class Solution { public: int myAtoi(string s) { int i = 0; int factor = 1; int whitespace = 1; long int sum = 0; while(s[i] == ' '){ i++; } if (s[i] == '-'){ factor = -1; i++; ...
ALGO
0.997074
4.970552
3e3d6a8f-26f3-4468-9ab6-15a2f31632b6
chatter2050/GiraUno
src/crypter.cpp
#include "crypter.h" #include "script.h" #include <string> #include <vector> #include <boost/foreach.hpp> #include <openssl/aes.h> #include <openssl/evp.h> bool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::vector<unsigned char>& chSalt, const unsigned int nRounds, const unsigned int nDer...
TOOL
0.879023
7.322689
0d96de9b-0c74-4ce7-be08-401870850fae
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_5938_2.cpp
#include <iostream> #include<iomanip> #include<math.h> using namespace std; int main() { while(1){ int n; cin>>n; if(n==0)break; int s[n]; double sum=0; for(int i=0;i<n;i++){ cin>>s[i]; sum+=s[i]; } double a=0; sum/=n; for(int i=0;i<n;i++)a+=pow(s[i]-sum,2)/n; c...
ALGO
0.999279
3.404504
a6652ad1-cfd8-4253-841e-a571de1529b0
Ashita-Bansal/CPP_CN
const_pointers.cpp
#include <iostream> using namespace std; void g(int const &a){ a++; } void f(const int *p){ } int main(){ int const i=10; int const *p=&i; int j=12; int const *p2 = &j; cout<<*p2<<endl; j++; cout<<*p2<<endl; }
TOOL
0.966649
3.074426
8f511d97-fb17-4cd1-93db-fd63e85e9fcb
Gaurav-sable/DSA
Studentdata(main).cpp
#include <iostream> using namespace std; struct Student { string name; int rollno; float sgpa; }; class se11 { Student s[20]; int n; public: void setdata(); void showdata(); void searchdata(); void sortdata(); void sort1data(); int partition(int low, int high); void qu...
ALGO
0.999338
4.350549
9c1d65f6-cb99-4d26-acaf-0e65d05bb820
utkarshb1209/Leetcode
0474-ones-and-zeroes/0474-ones-and-zeroes.cpp
class Solution { public: int fn(vector<int> &v,int i,int m,int n,vector<string> &s,int n1,vector<vector<vector<int>>>&dp){ if(i>=n1 || m<0 || n<0) { return 0; } if(dp[i][m][n]!=-1) return dp[i][m][n]; string x=s[i]; int y=x.size(); int tk=0; if(v[i...
ALGO
0.999988
6.321376
2242fc02-a634-4c69-8a08-a59f8851b020
PPKorchagin/DE_Sprint-1
1.7/5.cpp
#include <iostream> using namespace std; int main() { int x1; for (x1=1; x1<=10; x1++) { cout << x1 << ": " << x1*x1 << endl; } return 0; }
TOOL
0.94041
3.896563
4af9f766-4f32-463f-b960-b4a5a0dc1bbe
aayush-chhabra/Learn-Practice
operators.cpp
# include <iostream> class test{ int count; public: test(): count(0){ } test(int c): count(c){ } void operator += (int i){ count+=i; } int getCount(){ return count; } }; int main(){ test t(10); t+=18; int z = t.getCount(); printf("%d\n", z); }
TOOL
0.872718
4.076793
3ffeb968-1803-48f5-a816-11fbbe417488
ravi2320/LeetCode
Day_59_1043_Partition_Array_for_Maximum_Sum.cpp
/* 1043. Partition Array for Maximum Sum Solved Medium Topics Companies Hint Given an integer array arr, partition the array into (contiguous) subarrays of length at most k. After partitioning, each subarray has their values changed to become the maximum value of that subarray. Return the largest sum of the given arra...
ALGO
0.99993
5.960254
d2a8864b-36d3-45e2-b712-54763890701a
ankushp9/FirstBit-Solutions
DSA/Intresting DSA/Linked List/Singlee Linked List/linkedlist.cpp
#include"linkedlist.h" linkedlist::linkedlist() { this->start=NULL; } void linkedlist::setStart(Node* start) { this->start=start; } Node* linkedlist::getStart() { return this->start; } void linkedlist::insertAtBegin(int ele) { Node* temp = new Node(ele); temp->setNext(start); start=temp; ...
ALGO
0.95648
3.188677
e9b446b0-8cc4-421d-92a8-b77183c5fd75
Pandey-SaurabhP/CP
Codeforces/1986/d.cpp
#include <bits/stdc++.h> using namespace std; // Macros #define pb push_back #define pf push_front #define ff first #define ss second #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define rep(i, x, n) for(ll i = x; i < n; ++i) #define rrep(i, x, ...
ALGO
0.999801
5.052249
d20bc095-b0e8-47b3-b010-003492a2f461
MahmoudMagdi20/SecurityContest
Contest1/C_Bonus/C_Bonus/Bonus.cpp
#include <iostream> #include <vector> #include <bits/stdc++.h> using namespace std; class Playfair { public: Playfair() : key_matrix(vector<vector<char>>(3, vector<char>(3))) {} void set_key_matrix(string key); string encrypt(string plain_text); private: pair<int, int> index_of(char c); vector<vector<char>> ke...
ALGO
0.999981
4.46936
8658c419-a0c3-4519-a0bc-75b3ed1f7a18
martykadlcek/trading-bot
src/main/strategy_hyperbolic.cpp
/* * strategy_keepvalue.cpp * * Created on: 20. 10. 2019 * Author: ondra */ #include "strategy_hyperbolic.h" #include <chrono> #include <imtjson/object.h> #include "../shared/logOutput.h" #include <cmath> #include "sgn.h" namespace { const double accuracy = 1e-5; } using ondra_shared::logDebug; std::...
ALGO
0.999864
5.734765
737f4050-667d-46c1-8ac7-93c14429e4a8
SasiniWanigathunga/200693D_CS2023-Data-Structures-and-Algorithms
In-class Lab Week 6/linkedlist.cpp
#include <iostream> using namespace std; struct Node { int data; Node* next; }; class Stack { private: Node* top; public: Stack() { top = nullptr; } void Push(int data) { Node* newNode = new Node; newNode->data = data; n...
ALGO
0.998676
4.72367
07d933ce-0f6c-45df-b979-5a5db793d6c6
icecocoa6/abc
41/D.cpp
#include <iostream> #include <vector> using namespace std; bool path[16][16]; bool reachto(int v, int set) { for (int i = 0; i < 16; i++) { if ((set & (1 << i)) && path[v][i]) return true; } return false; } int main(int argc, char *argv[]) { int N, M; cin >> N >> M; for (int i = 0; i < M; i++) { int x, ...
ALGO
0.999906
4.377229
ee2bdc52-bb25-4fe8-b168-112c14043f06
ZZAMBAs/baekjoon
problem_1747.cpp
/* // // Created by AppDeveloper on 2022-09-19. // #include <iostream> #include <stack> using namespace std; int deadEnd; bool isPrime[2000001]; bool isPalindrome(int n){ stack<int> q; int temp = n; while (temp != 0){ q.push(temp % 10); temp /= 10; } while (!q.empty()){ if...
ALGO
0.999869
5.117096
99d2b152-aef4-47e0-95f9-a1fdb373296f
cssl-unist/trust-sec23
rust/src/llvm-project/lldb/tools/lldb-vscode/VSCode.cpp
#include <stdarg.h> #include <fstream> #include <mutex> #include "LLDBUtils.h" #include "VSCode.h" #include "llvm/Support/FormatVariadic.h" #if defined(_WIN32) #define NOMINMAX #include <windows.h> #include <fcntl.h> #include <io.h> #endif using namespace lldb_vscode; namespace lldb_vscode { VSCode g_vsc; VSCode:...
TOOL
0.876036
7.117935
5bb477a1-a4df-4db3-bc13-64fd59bed20f
dakshgupta2002/long-lines
100DaysOfCode/day 37/longSubNoRepeating.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: int lengthOfLongestSubstring(string s) { int longest = 0; unordered_map<char, int> appear; int i=0, j=0; int currLen = 0; while (j<s.length()){ if (appear[s[j]] == 0){ appea...
ALGO
0.999804
5.584383
fd26c6e4-8847-48ed-86b8-870f95e4868d
AbhaHimani/Leetcode
0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.cpp
class Solution { public: //find minimum index int findKRotation(vector<int>&arr) { int n= arr.size(); int low = 0, high = n - 1; if(arr[low]<=arr[high]) return 0; while (low <= high) { int mid = low + (high - low) / 2; int prev = (mid - 1 + n) % n; ...
ALGO
0.999992
5.661577
99d1c9ce-01ba-4533-9fd5-0cff25c42794
vector-ag/dsa
BST(pair with given sum).cpp
// finding pair with given sum in a bst; #include<bits/stdc++.h> using namespace std; struct Node{ int data; Node *left; Node *right; }; Node* newNode(int data){ Node* node = new Node(); node-> data = data; node -> left = NULL; node -> right = NULL; return node; } // efficient solution...
ALGO
0.999945
5.982232
cfb61e6a-e4f6-4606-82a6-2a79ea17fd47
abhivk23/Random-Numbers
src/generate_hist.cpp
// Runner file for rnd_test.hpp // abhivk -- PHYS250 FALL 2020 #include "prng.hpp" #include <iostream> #include <fstream> #include <math.h> using std::cout; using std::endl; // General function to output Histogram Analysis of each PRNG void histogram_analysis(ofstream* random_output, ifstream* random_input, int averag...
TEST
0.876931
5.755785
6966774a-03e8-4bc6-a365-e2874e138c27
abhijitmondall/XPSC
Contests/Codechef/CC_C2-Div4/The_Ides_of_March.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; if (n == 15) { cout << "Yes" << '\n'; } else { cout << "No" << '\n'; } return 0; }
ALGO
0.999915
3.44049
e0abf17a-9c7b-44ec-abaa-dc0ee5d5a580
ishandutta2007/codeforces
zeliboba/normal/776/B.cpp
#include <stdio.h> #include <cstdlib> #include <cassert> #include <iostream> #include <set> #include <vector> #include <cstring> #include <string> #include <algorithm> #include <numeric> #include <cmath> #include <complex> #include <map> #include <queue> using namespace std; typedef long long ll; typedef vector<int> vi...
ALGO
0.99993
3.151585
277ecc85-14ef-4c26-bc31-97b1dc6cf20b
Harashporiya/Strivers_Sheet_A2Z
Strivers_A_to_Z_DSA_COURSE/Graphs/RottingOranges.cpp
#include<bits/stdc++.h> using namespace std; int orangesRotting(vector<vector<int>>& grid) { int n=grid.size(); int m=grid[0].size(); vector<vector<int>> vis(n,vector<int>(m,0)); queue<pair<pair<int,int>, int>> q; int cntFresh = 0; for(int i=0;i<n;i++){ ...
ALGO
0.999847
5.884207
f0285795-6935-4dc7-9cb8-a0c955c02b9e
wasn-lab/Taillight_Recognition_with_VGG16-WaveNet
src/sensing/drivable_area_filter/src/daf_node.cpp
#include "daf_node.h" namespace daf { boost::shared_ptr<ros::AsyncSpinner> g_spinner; bool g_trigger = false; void signal_handler(int sig) { if (sig == SIGINT) { LOG_INFO << "END Drivable_Area_Filter" << std::endl; g_spinner->stop(); ros::shutdown(); } } static bool done_with_profiling() { #if ENA...
TOOL
0.885488
6.309837
44114538-85c5-4df1-9aba-a270755a2560
HyeonJaePark/TIL
Problem Solving/Baekjoon/1003_피보나치 함수.cpp
#include <bits/stdc++.h> using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int dp[42] = {1}; for (int i = 2; i < 42; i++) { dp[i] = dp[i - 1] + dp[i - 2]; } int T; cin >> T; for (int i = 0; i < T; i++) { int n; cin >> n; cout << dp[n] << ' ' << dp[n + 1] << '\n'...
ALGO
0.999852
3.719909
4176e79d-7f1e-42f0-9ea6-df45c3d4f958
youssef7ussien/problemsolving-space
problems/UVA Online Judge/Volume 008/825 - Walking on the Safe Side/main.cpp
#include <iostream> #include <vector> #include <sstream> using namespace std; void initVector(vector<vector<int>> &matrix,int W,int N) { for(int i=0 ; i<=W ; i++) matrix[i].resize(N+1,0); matrix[0][1]=1; } void inputLines(vector<vector<int>> &matrix,int W,int N) { for(int i=1 ; i<=W ; i++) { ...
ALGO
0.999341
4.285933
eb50d556-89b8-4dba-ba72-d0bc65632bd0
computerphilosopher/BOJ
11399/11399.cpp11.cpp
#include <cstdio> #include <algorithm> using namespace std; int solve(int A[], int n){ sort(A, A+n); int ret = 0; for(int i=0; i<n; i++){ ret += A[i]; for(int j=0; j<i; j++){ ret += A[j]; } } return ret; } int main(){ int n = 0; scanf("%d", &n); ...
ALGO
0.999931
4.039165
b93be099-8bdb-486c-9a7f-33ab03726145
Skywt2003/codes
BZOJ/2763/15219060_AC_5076ms_3100kB.cpp
#include<cstdio> #include<cstring> #include<iostream> #include<queue> using namespace std; const int maxn=10005,maxe=100005,maxk=15; int n,m,k,s,t,dst[maxn][maxk],INF; int tot=0,lnk[maxn],nxt[maxe],son[maxe],w[maxe]; bool vis[maxn]; queue<int> que; inline int read(){ int ret=0,f=1;char ch=getchar(); while (ch<'0'||ch...
ALGO
0.999963
4.230464
1320d889-4c70-4729-a845-09508a4b0f81
raymondyfei/libwetcloth
include/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.999109
6.577977
d4ba3ade-3481-434d-80f9-9a6ea1dd5428
blossom2017/Leetcode
40.combination-sum-ii.161116053.ac.cpp
class Solution { public: void util(vector<vector<int>> &ans,vector<int> temp, int index, int sum, int target,vector<int> nums) { if(sum==target) { ans.push_back(temp); return; } if(index==nums.size()||sum>target)return; for(int i=index;i<nums.size(...
ALGO
0.999996
6.271561
98fca24f-06e4-4f74-949c-a400fc30ba00
Xav-la-program/Numericational
Solution/Tester/main.cpp
#include <iostream> #include "LinearCongruential.h" #include "HeadTail.h" #include "EcuyerCombined.h" #include "Bernoulli.h" #include "NormalBoxMuller.h" #include "SinglePath.h" #include "RandomProcess.h" #include "BS1D.h" #include "BSEULER1D.h" #include "Milstein1D.h" #include "EUCall.h" #include "BSEulerND.h" #includ...
ALGO
0.993926
3.526269
a21ebe4e-35af-4102-a0ce-6385b5c25c74
mit-pdos/ward
third_party/libcxx/benchmarks/algorithms.bench.cpp
#include <algorithm> #include <cstdint> #include <map> #include <random> #include <string> #include <utility> #include <vector> #include "CartesianBenchmarks.h" #include "GenerateInput.h" #include "benchmark/benchmark.h" #include "test_macros.h" namespace { enum class ValueType { Uint32, String }; struct AllValueTy...
TEST
0.965051
7.054835
c97eebfe-9ebc-40e0-a9b8-627a2f0ebf67
Meta3DCompany/MetaSlicer
src/libigl/igl/is_symmetric.cpp
template <typename T> IGL_INLINE bool igl::is_symmetric(const Eigen::SparseMatrix<T>& A) { if(A.rows() != A.cols()) { return false; } assert(A.size() != 0); Eigen::SparseMatrix<T> AT = A.transpose(); Eigen::SparseMatrix<T> AmAT = A-AT; //// Eigen screws up something with LLT if you try to do //Spars...
ALGO
0.928728
6.466157
d4d28d61-9bc7-40f8-a91f-07ba87e2bec7
AMReX-Combustion/PelePhysics
Mechanisms/methaneIons_diRenzo/mechanism.cpp
#include "mechanism.H" const int rmap[NUM_REACTIONS] = { 6, 19, 24, 43, 66, 67, 106, 107, 20, 3, 5, 97, 108, 120, 131, 132, 133, 0, 1, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40...
ALGO
0.999278
5.290413
0cabdd5e-b87e-4e42-879f-1c4d1982545a
GaurishIIITNR/CP-Problems-Solutions
1399C.cpp
// HHM // DATE: 12-07-2022 // TIME:16:47:03 #include <bits/stdc++.h> using namespace std; #define ll long long int #define dbl double #define deb(v) cout << #v << " " << v << "\n" #define deb2(v, k) cout << #v << " " << v << "\n" \ << #k << " " << k << "\n" #define vin(name, size) \ ...
ALGO
0.99975
4.371478
c284a53e-bd77-4a7f-b88c-c114e53f4684
ahussain5253/CIS-310
PROG4/PROG4/Source.cpp
#include <iostream> #include <fstream> #include <vector> #include <cstring> #include <cstdlib> #include <cmath> using namespace std; // Function that converts numbers from Hexadecimal to Decimal int hexToDec(string hexdecString) { int length = hexdecString.length(); int base = 1; int decimal = 0; int pos; //...
ALGO
0.991955
4.053751
20ef2720-305d-4517-8dd4-996389c60b8e
sarvex/leetcode-ksh
solution/2200-2299/2208.Minimum Operations to Halve Array Sum/Solution.cpp
class Solution { public: int halveArray(vector<int>& nums) { priority_queue<double> q; long long s = 0; for (int& v : nums) { s += v; q.push(v); } double d = s / 2.0; int ans = 0; while (d > 0) { double t = q.top() / 2; ...
ALGO
0.999889
5.823811
cfae5299-9093-4d9d-9600-eab63f8fe133
alvarobatrez/cpp_templates
Functions/Recursivity/src/main.cpp
#include <iostream> #include <iomanip> using namespace std; // ***** RECURSIVE FUNCTIONS ***** unsigned long long factorial(unsigned long long n) { if (n <= 1) { return 1; } return n * factorial(n - 1); } long double e(unsigned long long n) { if (n <= 1) { return 1; } ...
ALGO
0.999456
4.707706
3f34ef4e-41d1-4a96-93ee-9a05a0f5b3b4
atharvkhardekar/LeetCode-Daily-Challenge
Array/(Jul 25)_Maximum_Unique_Subarray_Sum_After_Deletion.cpp
// LeetCode Problem No. 3487 // Daily Challenge - 25/07/2025 class Solution{ public: int maxSum(vector<int> &nums) { bool allNegative = true; int maxValue = INT_MIN; for (int n : nums) { if (n >= 0) { allNegative = false; } ...
ALGO
0.999502
5.613173
c8fed48b-0dc8-4abd-bf59-fe8a80a564da
ABHISHEKBANKAWAT/leetcodequetions
Flattening a Linked List - GFG/flattening-a-linked-list.cpp
// { Driver Code Starts #include <bits/stdc++.h> struct Node{ int data; struct Node * next; struct Node * bottom; Node(int x){ data = x; next = NULL; bottom = NULL; } }; using namespace std; void printList(Node *Node) { while (Node != NULL) { printf("%d ", Node->data); ...
ALGO
0.999603
4.719172
9c72fd38-fb4a-4b63-ba27-7acd79fed0e1
AsHuToShSiNgH02/DSA-QUES
Linked List/Singly LL/reverseLL.cpp
#include <iostream> using namespace std; class Node{ public: int val; Node* next; Node(int data){ val = data; next = NULL; } }; class LinkedList{ public: Node* head; LinkedList(){ head = NULL; } void InsertAtTail(int value){ Node* new_node = n...
ALGO
0.99992
5.318471
e75340fe-c127-410f-b8f0-dfebd3a36e6c
RoteKekse/quantumchemistry
H2O/JD/ALSres.cpp
#include <xerus.h> using namespace xerus; class InternalResSolver { const size_t d; std::vector<Tensor> leftBStack; std::vector<Tensor> rightBStack; TTTensor& x; const TTOperator& A; const TTTensor& b; public: size_t maxIterations; InternalResSolver(const TTOperator& _A, TTTensor& _x, const TTTensor& _b...
ALGO
0.999548
5.11904
9d5dcba4-e9c7-4054-aab1-508eaadcbbe1
2mulin/brushQuestion
LeetCode/algorithm/301_400/324_wiggle.cpp
/** * @date 2022/6/28 * @author 2mu * @brief medium 摆动排序II * * 1. 排序 * 先将数组排序,接下来每次取最大值,最小值,按要求排序应该就可以了。(行不通,因为数字可能相等) * * 分为两半,题解的数学推理挺长的。 * * 时间复杂度:O(N*logN) * 空间复杂度:O(N) * * 2. 三向切分 */ #include <iostream> #include <vector> #include <algorithm> using namespace std; void wiggleSort(vector<int> &num...
ALGO
0.999996
5.233395
3b01ae93-55c8-46b5-bd76-f64878e70108
tanay4102/LeetCode-Practice
SearchForaRange.cpp
class Solution { public: int binRight(vector<int>& nums, int target,int l, int r) { if (l>r) { return -1; } int mid=l+(r-l)/2; if (nums[mid]==target && (mid==nums.size()-1 || nums[mid+1]!=target)) { return mid; } else if (nu...
ALGO
0.999995
6.319418