uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
4158cbfd-4ea6-4d6e-97ee-e0c31a3ef4dd
Cryptossss/CHPS1004_Projet_M2
src/kuhn_munkres.cpp
#include "kuhn_munkres.h" namespace kuhn_munkres { using std::max; KuhnMunkres::KuhnMunkres() { } KuhnMunkres::~KuhnMunkres() { } vector<pair<int, int> > KuhnMunkres::compute(const Vec2f& costMatrix) { this->C = KuhnMunkres::padMatrix(costMatrix); this->n = C.size(); this->originalLength = costMatrix....
ALGO
0.999822
5.797154
ab3da0c6-8c6b-4ac5-9f0b-463a9aa28aca
alexprivalov/Computer-Vision-for-Faces-2018
week1/cpp/perspectiveCorrection.cpp
#include <opencv2/opencv.hpp> using namespace cv; using namespace std; struct userdata{ Mat im; vector<Point2f> points; }; void mouseHandler(int event, int x, int y, int flags, void* data_ptr) { if ( event == EVENT_LBUTTONDOWN ) { userdata *data = ((userdata *) data_ptr); circle(data...
ALGO
0.966516
5.588315
881ad525-75eb-4e02-8efd-7b36a138ceb6
CaiCandong/daydayone
src/1-30/day8/main.cpp
#include <stdio.h> #include <malloc.h> float solution(int n) { if (n < 3) { return 0.0; } // 规律:每增加两条边,面积增加2 if (n % 2 == 1) { //奇数,在3的基础上增加 // 奇数起点3: return (n - 3) + 0.5; } else { //偶数起点为4 return (n - 4) + 2.0; } } int main() { prin...
ALGO
0.998833
3.281488
4e1739ab-a52e-4779-895d-c95048130817
openucx/ODOS
libcxx/test/std/containers/associative/map/map.modifiers/try.emplace.pass.cpp
// <map> // class map // template <class... Args> // pair<iterator, bool> try_emplace(const key_type& k, Args&&... args); // C++17 // template <class... Args> // pair<iterator, bool> try_emplace(key_type&& k, Args&&... args); // C++17 // template <class... Args> // iterator try_emplace(const...
TEST
0.8985
6.668758
6fde13eb-7b10-4f91-afc6-4dba854252b4
Gleb1611/Revition-project
Revition project/Task1.cpp
//#include "Header.h" // //int calculetHowManyNuts(int squirrels, int nuts) //{ // return nuts / squirrels; //} // //int main() //{ // //int n; // //int k; // // //cout << "Input squirrels: " << endl; // //cin >> n; // // //cout << "Input nuts: " << endl; // //cin >> k; // // cout << (calculetHowManyNuts(3, 14) == 4 ? ...
TOOL
0.881084
3.036359
39047558-5817-46f6-ab1a-10d963c5d939
somasekhar200310/c-c-training
11-11-24/const array increment.cpp
#include <iostream> using namespace std; int main() { // Case 1: Constant pointer to non-constant data int value1 = 10, value2 = 20; int* const ptr1 = &value1; *ptr1 = 30; // Valid: can modify the value // ptr1 = &value2; // Invalid: cannot modify pointer // Case 2: Non-constant pointer to c...
TOOL
0.979168
6.26703
5cdfb83e-03be-4556-bfad-8c721721cd3a
chengyiwei/algorithm
lanqiao/2023 B C++/C/C.cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; int a[maxn][2]; int dp[10]; int main() { // freopen ("C.in" ,"r", stdin); ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 1; i <= n; i++) { string s; cin >> s; a[i][0] = s.front() - '0'; a[i][1] = s.back() - '0'; } for ...
ALGO
0.999827
3.752517
824e216d-17f5-458c-8825-908c74688cf9
deepakbalodiya21/cred
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.9988
6.76073
8df07f69-5c3c-4733-abe0-cced9cb1c3b7
ehnryx/acm
calgary2021/g.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.999857
5.237021
cbb40e24-ae62-4c93-ba86-a95b36dc596a
izzyBonilla/APC523S2022PS2
p1/lg_interp.cpp
#include <iostream> #include <math.h> #include <iomanip> #include <fstream> #include <limits> #include <vector> #include <string> #define NDEF 10 // default n #define NF 1001 // fine grid #define HF 0.002 // h for fine grid // forward declarations int runge_exact(std::vector<double> &x, std::vector<double> &f, const ...
ALGO
0.998662
5.680358
9b84eeb1-5222-485f-a787-c6155f6a5688
llllIIIIllll/c-
2018/code4speed/find_rect.cpp
#include <opencv2\opencv.hpp> #include <iostream> #include <algorithm> #include <vector> using namespace cv; using namespace std; void find_rect() { vector<Rect> rect; //! Init data // ------------------------------------------------------------------------ srand((unsigned)time(NULL)); for (int i = 0; i < 20; ++...
TOOL
0.913397
3.514999
240d8bc8-b44f-4c2b-9888-9ba21e330b40
kiseop91/Multi_Theading
Atomic_Scope_lock/race_condition.cpp
#include <iostream> #include <thread> #include <Windows.h> #include <mutex> using namespace std; // //CRITICAL_SECTION CS; mutex mtx; long shared_memory = 0; void inc() { InterlockedIncrement(&shared_memory); } int main() { //InitializeCriticalSection(&CS); auto count_func = []() { for (int i = 0; i < 100000...
TOOL
0.87421
3.874204
a8b226e5-158f-42ef-8703-f4d21e042810
datatsuo/model_predictive_control
src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Eigen::MatrixXf m(2,4); Eigen::VectorXf v(2); m << 1, 23, 6, 9, 3, 11, 7, 2; v << 2, 3; MatrixXf::Index index; // find nearest neighbour (m.colwise() - v).colwise().squaredNorm()...
ALGO
0.999885
4.138078
a6f7c036-b317-466f-a6fb-7e9e109d7618
katzhang/algorithms-in-cplusplus
3.18.adjacency-matrix-graph.cpp
/* author: Robert Sedgewick PROG: Adjacency-matrix graph representation */ #include <iostream> using namespace std; static const int V = 100; int main() { int i, j, adj[V][V]; for ( i = 0; i < V; ++i) { for (j = 0; j < V; ++j) { adj[i][j] = 0; } } for (i = 0; i < V; ++i) { adj[i][i] = 1; } while (ci...
ALGO
0.99952
4.236749
defe4528-bc2b-4816-9f08-dce9e372f6a9
ImadaKakeru/IMM_filter_cpp
src/modelInteraction.cpp
#include "IMM.h" void IMM::modelInteraction(){ //事前確率の計算 // c0 = M[0,0]*mu[0] + M[1,0]*mu[1] + M[2,0]*mu[2] for(int i = 0; i < modelNum; i++){ cj[i] = 0.0f; for(int j = 0; j < modelNum; j++){ cj[i] += mu[j] * M(j,i); } } //ミキシング確率の計算 // omega[i,j] = M[i,j] ...
ALGO
0.999451
3.20087
8013a8dd-61e8-4b2d-8934-83d29b26bf9f
coisin/Competitive-Programming
USACO/Training Pages/Controlling_Companies.cpp
/* TASK: concom LANG: C++11 */ #include <bits/stdc++.h> using namespace std; int num_vertices; int percent[101][101], ownership[101][101], controls[101][101]; int main() { freopen("concom.in", "r", stdin); freopen("concom.out", "w", stdout); cin >> num_vertices; for(int i = 0; i < num_vertices; i++) { int ...
ALGO
0.999956
3.925791
72bb8be5-465f-4b11-b611-69b043291cd0
SyedaSana01/A-Z-DSA
Step4/Lecture1/SingleElement/BF1.cpp
#include<bits/stdc++.h> using namespace std; int SE(vector<int>&arr,int n){ if(n==0) return arr[0]; for(int i=0;i<n;i++){ if(arr[i]==0){ if(arr[i]!=arr[i+1]){ return arr[i]; } }else if(arr[i]==n-1){ if(arr[i]!=arr[i-1]){ return arr[i]; } }else{...
ALGO
0.999956
3.946904
84c1beec-019e-43cf-885d-be001fa67cb7
amirsed76/cpp_projects
codes_19/951209/linklist.cpp
#include <iostream> using namespace std ; #include "linklist.h" void student::chap () { cout << "__________________" << endl ; cout << this->name << endl ; cout << avg << endl ; cout << addr << endl ; } void linklist::pushfront ( student z) { node * p = new node ; p->data = z; p->next = this->head ; head = p ;...
TOOL
0.910713
3.617477
67087522-e178-4d56-ae9f-b9f55822a87f
bhaveshmankar/Competitive-Programming
Number Theory - 1/Sieve of Erastothenes.cpp
// Problem statement // Given a number N, find number of primes in the range [1,N]. // Detailed explanation ( Input/output format, Notes, Images ) // Input Format: // The only line of input consists of a number N // Output Format: // Print the number of primes in the range [1,N]. // Constraints: // 1 ≤ N ≤ 10^6 // Sam...
ALGO
0.999842
6.281914
76c06075-e3f8-4101-8cb7-5beaa1f1b7bf
OneBitPython/Codeforces
B_Buttons.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define all(c) c.begin(), c.end() #define endl "\n" const double PI=3.141592653589; void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __print(unsigned x) {cerr << x;} void __print(unsigned long x) {cerr << ...
ALGO
0.996591
3.512611
ca44c88a-46bb-4c19-bb9d-ffb0587fd5d1
rekhav55/LeetcodeSolutions
1254-number-of-closed-islands/1254-number-of-closed-islands.cpp
class Solution { public: void dfs(int i,int j,vector<vector<int>>&grid){ if(i<0 || j<0 || i>=grid.size() || j>=grid[0].size()||grid[i][j]==1 || grid[i][j]==-1){ return; } grid[i][j]=-1; dfs(i+1,j,grid); dfs(i-1,j,grid); dfs(i,j+1,grid); dfs(i,j-1,g...
ALGO
0.999976
5.921852
cc4bc2c5-4cd9-4091-b5e1-39bb439b32ae
DereckLuo/Coding-Exercises
107. Binary Tree Level Order Traversal II/107. Binary Tree Level Order Traversal II/LevelOrderBottom.cpp
/** * 107. Binary Tree Level Order Traversal II * Given a binary tree, return the bottom-up level order traversal of its nodes' value, * (ie, from left to right, level by level from leaf to root) * For example: * Given binary tree [3, 9, 20, null, null, 15, 17] * 3 * / \ * 9 20 * / \ * 15 7...
ALGO
0.999975
6.06248
2b2f16b8-6d86-40a9-a938-531dca7952dc
Susovan88/DSA
Recursion/subsets.cpp
#include <iostream> #include <vector> using namespace std; void subset(string subS, int i, string& str, vector<string>& ans) { if (i == str.length()) { ans.push_back(subS); return; } subset(subS, i + 1, str, ans); subset(subS + str[i], i + 1, str, ans); } void printArr(vector<string>&...
ALGO
0.999718
5.322587
634b6248-f290-4cd9-be64-6bd52a40621e
parve3j/Foreground-and-Background-push-notification-using-Firebase-Updated-2025
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.998757
6.771107
f83a990a-2954-4236-9100-98a5322c5950
ishandutta2007/codeforces
wifiiii/normal/1203/F2.cpp
#include<bits/stdc++.h> typedef long long ll; typedef long double ld; using namespace std; mt19937_64 mrand(chrono::steady_clock::now().time_since_epoch().count()); //mt19937_64 mrand(42); #define ii for(int i=1;i<=n;++i) #define ji for(int j=1;j<=n;++j) #define jj for(int j=1;j<=m;++j) #define ij for(int i=1;i<=m;++i...
ALGO
0.999887
4.061679
4dc542ac-52db-4616-b7b3-5935343a6334
kevinzhang334455/Scout
boost_1_56_0/libs/math/example/inverse_chi_squared_find_df_example.cpp
// inverse_chi_squared_distribution_find_df_example.cpp //#define BOOST_MATH_INSTRUMENT // Example 1 of using inverse chi squared distribution #include <boost/math/distributions/inverse_chi_squared.hpp> using boost::math::inverse_chi_squared_distribution; // inverse_chi_squared_distribution. using boost::math::inver...
ALGO
0.992227
3.771122
509e4f4d-c895-4022-8e17-f7ac1a6d2cb9
AtharvaPanegai/CppLearning
DSA/Stack/StackUsingQueue/popCostly.cpp
#include "bits/stdc++.h" using namespace std; class Stack{ int N; queue<int> q1; queue<int> q2; public: Stack(){ N = 0; } void pop(){ if(q1.empty()){ return; } while(q1.size()!=1){ q2.push(q1.front()); q1.pop(); }...
ALGO
0.999247
4.41576
564f9a0c-de7c-44d6-aff1-75c23a3d739b
jesuswr/cp-codes-and-problems
27E.cpp
#include <iostream> #include <vector> #include <queue> #include <stack> #include <algorithm> #include <math.h> #include <string> #include <cstring> #include <set> #include <map> #include <unordered_map> #include <assert.h> #include <array> #include <random> #include <chrono> using namespace std; typedef long long ll;...
ALGO
0.999724
4.56295
a42d2429-efa7-4584-940b-86c14edfcc58
redto0/planner-demo-cpp-mk2
main.cpp
#include <fstream> #include <iostream> #include <vector> #include <cmath> #include <cstring> #include <sstream> // #include <bits/regex.h> // #include "/home/alex/IdeaProjects/Derek Cant Clean Data/src/dereksDataCleaned.txt" // #include "Data/Datav1.txt" #include <vector> int main() { class Polynomial { privat...
DATA
0.915405
4.236483
7d5ebfd5-46ec-4a98-8560-85de1d49e25c
zygoloid/clang
lib/Analysis/CFGReachabilityAnalysis.cpp
#include "llvm/ADT/SmallVector.h" #include "clang/Analysis/Analyses/CFGReachabilityAnalysis.h" #include "clang/Analysis/CFG.h" using namespace clang; CFGReverseBlockReachabilityAnalysis::CFGReverseBlockReachabilityAnalysis(const CFG &cfg) : analyzed(cfg.getNumBlockIDs(), false) {} bool CFGReverseBlockReachabilityA...
TOOL
0.991189
7.059165
c0e2aa9c-b48f-48fc-a73c-b8def80ff51c
evialbert/LeetCode
3708-zigzag-grid-traversal-with-skip/zigzag-grid-traversal-with-skip.cpp
class Solution { public: vector<int> zigzagTraversal(vector<vector<int>>& grid) { int n = grid.size(); // Number of rows int m=grid[0].size(); // Number of columns vector<int>ans; // Resultant vector for(int i=0;i<n;i++){ if(i%2==0){ // Traverse lef...
ALGO
0.999997
5.833932
58021151-01b9-45a9-8bc9-44cfcf243fc4
mahmoud-elbanna53/Data-Structure-Algorithms
Lab 3/BinarySearchArray/main.cpp
#include <iostream> #include "LinkedList.h" using namespace std; int binarySearchArray(int target, int size, int *arr){ int start = 0; int end = size-1; int counter=0; int mid; while(start<end){ counter++; mid=(start+end)/2; if(arr[mid] == target){ return mid; ...
ALGO
0.999909
3.639717
90574fc5-dffe-42e7-9c9a-aa6037acc440
victorduta/shadowkernel
tools/llvm/lib/Transforms/Utils/ASanStackFrameLayout.cpp
namespace llvm { // We sort the stack variables by alignment (largest first) to minimize // unnecessary large gaps due to alignment. // It is tempting to also sort variables by size so that larger variables // have larger redzones at both ends. But reordering will make report analysis // harder, especially when tempor...
TOOL
0.877726
7.884057
2441ed9f-9f81-4cad-8275-e6eb75287ae8
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/MixtralExpert/top0-100/maximum-number-of-moves-to-kill-all-pawns-Solution.maxMoves/177812_Bypass.cpp
void sum_update(const char *p, int32 len) { switch (cursum_type) { case CSUM_MD5: md5_update(&md, (uchar *)p, len); break; case CSUM_MD4: case CSUM_MD4_OLD: case CSUM_MD4_BUSTED: if (len + sumresidue < CSUM_CHUNK) { memcpy(md.buffer + sumresi...
ALGO
0.999757
4.604792
51aa6b3c-2311-4406-84f4-039d10f10a43
Surbhi-Kohli/DSandAlgo
Trees/BinaryTrees/FindMaxValInEachRow.cpp
/* Given the level order traversal of a binary tree , Print the maximum value in each row of the given binary tree. Input Format First line contains level order traversal of the tree.The values in the input are in the order of level order traversal of the tree where, an positive integer denotes node values, and a -1 d...
ALGO
0.999989
4.317754
105e7755-8b4e-4c40-b365-de7bbf4af245
framp/joystick-mapper
opencv-sys/opencv/3rdparty/openexr/Imath/ImathVec.cpp
//---------------------------------------------------------------------------- // // Specializations of the Vec2<T> and Vec3<T> templates. // //---------------------------------------------------------------------------- #include "ImathVec.h" #if (defined _WIN32 || defined _WIN64) && defined _MSC_VER // suppress...
TOOL
0.854917
7.474672
26090c3f-1438-4577-b31b-6537d22310a0
ishandutta2007/codeforces
orzdevinwang/normal/744/E.cpp
#include<bits/stdc++.h> #define L(i, j, k) for(int i = (j); i <= (k); ++i) #define R(i, j, k) for(int i = (j); i >= (k); --i) #define ll long long #define sz(a) ((int) (a).size()) #define vi vector < int > #define me(a, x) memset(a, x, sizeof(a)) #define ull unsigned long long #define rs(x) resize(x) using namespace s...
ALGO
0.999984
4.074511
05df323a-1bdc-47a1-bef1-9313173e3c80
Leapense/problems
12809번: Train in a Tunnel/Train in a Tunnel.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { int n; ll h; cin >> n >> h; vector<ll> a(n); for (int i = 0; i ...
ALGO
0.999803
3.812348
05485e3d-2ade-4755-ae05-97315a22287f
ishandutta2007/codeforces
zlt1117/normal/1575/E.cpp
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> #define FOR(i,a,b) for(int i=a;i<=b;++i) #define PII pair<int,int> #define ll long long #define pb push_back #define sz(x) (int)(x.size()) #define rd (rand()<<16^rand()) #define db double #define gc getchar() #define mk make_pair #define iter set<int>::iterator //#d...
ALGO
0.999948
3.869866
be804058-41b9-4eeb-a9d5-069cf1f18560
SanthoshiBoyina/DataStructures-Algorithms
merge-sort/solution.cpp
#include <bits/stdc++.h> using namespace std; void display(vector<int> &arr) { for(int i=0; i<arr.size(); i++) { cout << arr[i] << " "; } cout << "\n"; } void merge(vector<int> &arr, int low, int mid, int high) { int p1 = low, p2 = mid+1, k=0; vector<int> temp (high - low + 1); while(p...
ALGO
0.999977
5.619166
34ce615c-09a7-47d1-b08c-9110611c9776
harsh70568/Daily_Problems_Solution
Maximize sum(arr[i]*i) of an Array - GFG/maximize-sumarrii-of-an-array.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: int mod = 1e9+7; int Maximize(int a[],int n) { // Complete the function sort(a,a+n); long long pro = 0LL; for(int i = 0; i < n; i++) { p...
ALGO
0.999923
5.527612
28a2ba04-ed3e-4e92-8dcd-4eddb7f692c5
Toorandokht/simpleCpp
22- Show factorial of an integer number/main-v2.cpp
#include <iostream> // Show factorial of an integer number - with function using namespace std; int factorial(int t) { int f; if (t == 0) return 1; else if (t > 0) { f=1; for(int i=1;i<=t;i++) f=f*i; } return f; } int main() { int a; cout<<"Please enter the number you want to get its ...
ALGO
0.998851
4.303498
8c619559-ff67-4f1a-94d9-713b40cd932a
yixiang0706/cpe
uva-10282.cpp
#include<iostream> #include<map> #include<string> using namespace std; int main() { map<string, string> Map; string ans; while (getline(cin,ans) && ans!= "") { string Eng = ans; string Unknown = ans; size_t i; for (i = 0; i < ans.length(); i++) { if (ans[i] == ' ') break; } Eng.resize(i); i++; ...
ALGO
0.977339
3.36111
c38bd719-5230-46f8-85bd-acdb794703f5
CTRoundTable/Encrypted.Cash
src/ecwrapper.cpp
#include "ecwrapper.h" #include "serialize.h" #include "uint256.h" #include <openssl/bn.h> #include <openssl/ecdsa.h> #include <openssl/obj_mac.h> namespace { class ecgroup_order { public: static const EC_GROUP* get() { static const ecgroup_order wrapper; return wrapper.pgroup; } private: ecgro...
TOOL
0.967145
7.463551
edc1ccc4-62e5-4686-ac68-c286ee719f44
eric-erki/conceal-core
src/Miner/MiningConfig.cpp
#include "MiningConfig.h" #include <iostream> #include <thread> #include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/split.hpp> #include <boost/lexical_cast.hpp> #include <boost/program_options.hpp> #include "CryptoNoteConfig.h" #include "Logging/ILogger.h" namespace po = boost::pro...
CONFIG
0.930586
6.510551
c2a59347-5c0b-4447-bbbf-2b119899da8a
megablazikenabhishek/CPP-DSA
Array/Subarray_with_givenSum.cpp
#include<iostream> using namespace std; int main() { int n,sum; cin>>n; int arr[n]; for(int i=0; i<n; i++) { cin>>arr[i]; } cin>>sum; int i=0,j=0,curr=0; while(j<n && curr<=sum) { curr += arr[j]; j++; } j--; if(sum == curr) { c...
ALGO
0.999925
4.285141
ba9ba9c1-22b0-40c2-8add-fb3081a6d519
Tasdingo17/practicum_7sem
task-2/src/Functions.cpp
#include "Functions.h" #include <cmath> #include <stdexcept> #include <sstream> template <typename T> std::string to_string_with_precision(const T a_value, const int n = 6){ std::ostringstream out; out.precision(n); out << std::fixed << a_value; return out.str(); } // IDENT FUNCTION double IdentF::ope...
TOOL
0.98835
6.457145
61abdfdd-faa0-4b1c-834d-99250489d51f
KeshavaOfficial/CPP
day7Q2.cpp
#include <iostream> using namespace std; int main(){ int i, j , n; cout << "Enter the Number "<< endl; cin>> n; for(i = n ; i >=1; i-- ){ for(j = 1; j<=i; j++){ cout<< "*"; }cout << endl; } return 0 ; }
ALGO
0.999895
3.691386
d143d284-98cd-4340-ab68-28354fbb0ae4
Oscar-gg/TC2038_algoritmos
Actividades/Act1.2.1/main.cpp
// Oscar Arreola (A01178076) y Alejandra Coeto (A01285221) // Última modificación: Martes 20 de Agosto // Programa para calcular la cantidad de monedas que se deben dar como cambio #include "libs.h" #include <iostream> #include <vector> #include <map> using namespace std; // Función para obtener la cantidad mínima...
ALGO
0.999463
4.314566
35208543-f5a8-4c3b-929e-055ea6cf5661
argyrosan/llvm-hy546
libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/sorted_iter_iter.pass.cpp
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // <flat_map> // template <class InputIterator> // flat_map(sorted_unique_t, InputIterator first, InputIterator last, const key_compare& comp = key_compare()); // template<class InputIterator, class Alloc> // flat_map(InputIterator first, InputIterator last, const...
TEST
0.87564
6.958207
9b9cca40-f381-453d-828c-b6cb87297d3d
adarshpand3y/CPP-Programs
mathematics.cpp
// Students have got individual marks of mathematics, // using class-object concept add all their marks. // Adarsh ka code hai. Copy mat kariyo. #include <iostream> using namespace std; class Student { public: int m; }; int main() { int n, sum=0; cout<<"Enter the number of students: "; cin>>n; ...
ALGO
0.980629
4.126066
547b5224-1d9e-472b-977c-64c49276707e
MahdiGolmohamadii/Shape-Detection-OpenCv
ShapeDetection/ShapeDetection.cpp
#include <opencv2/imgcodecs.hpp> #include <opencv2/highgui.hpp> #include <opencv2/imgproc.hpp> #include <iostream> using namespace cv; using namespace std; void getContours(Mat Dilatedimage, Mat imageRes) { vector<vector<Point>> contours; vector<Vec4i> hierarchy; findContours(Dilatedimage, contours, hierarchy, R...
TOOL
0.978466
4.225951
ef843927-1202-411b-ba1f-7c0d217bc82c
mentebinaria/elfparser-ng
src/datastructures/search_tree.cpp
#include "search_tree.hpp" #include <boost/concept_check.hpp> SearchTree::SearchTree() : m_rootNode(), m_ready(false), m_nodeVector() { } SearchTree::~SearchTree() { m_nodeVector.release(); } void SearchTree::addWord(const std::string& p_string, void* p_storeData) { addWord(reinterpret_cast<const...
ALGO
0.986455
5.925229
04e7afab-f2e7-442b-b232-3d556e274786
ishandutta2007/codeforces
evilbuggy/normal/985/A.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair int main(){ int n, m; cin>>n; m = n/2; int p[m]; for(int i = 0; i < m; i++)cin>>p[i]; sort(p, p+m); int ans1 = 0, ans2 = 0; for(int i = 0; i < m; i++){ ans1 += abs(p[i] - 2*i - 1); ...
ALGO
0.999567
3.622776
15837ed6-e1f1-4e58-848f-142b46cb9573
ishandutta2007/codeforces
xay5421/normal/1034/D.cpp
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=(a);i<=(b);++i) #define PB push_back #define LL long long using namespace std; const int N=300005,INF=0X3F3F3F3F; int n,m,f[N]; struct data{ int x,y; bool operator<(const data&k2)const{return x^k2.x?x<k2.x:y<k2.y;} }; set<data>S; set<data>::iterator jt,it; vector<d...
ALGO
0.999913
3.240508
46ca9ce4-e27c-4ce4-abb5-24d976119193
1303575952/Data-Structure-And-Algorithms
Play-With-Algorithm-Interview/08-Recurion-and-Backstracking/Course Code (C++)/04-Combinations/main.cpp
#include <iostream> #include <vector> using namespace std; /// 77. Combinations /// https://leetcode.com/problems/combinations/description/ /// 时间复杂度: O(n^k) /// 空间复杂度: O(k) class Solution { private: vector<vector<int>> res; // 求解C(n,k), 当前已经找到的组合存储在c中, 需要从start开始搜索新的元素 void generateCombinations(int n, i...
ALGO
0.999947
5.391412
349b69ac-6802-46af-8f70-05440c6c5db7
abdo00xdd/BLING
Full project/bling/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.997731
6.76775
bae701e2-6971-4c7a-a800-0f7ae6097dc5
jaehyeonha/Lab_Algorithm_class
Project6/4.cpp
#include <iostream> #include <vector> using namespace std; int count(int A) { int cnt = 0; for (; A != 0; A >>= 1){ if (A & 1){ cnt++; } } return cnt; } bool isIn(int i, int A) { return (A & (1 << (i - 2))) != 0; } int diff(int A, int j) { return (A & ~(1 << (j - ...
ALGO
0.999958
4.241189
e3525f0f-f826-4cd7-a6f8-227b8d6dface
ayan-1999/CODES
basic/switch_problem.cpp
// to devide the given amount in variuos types of notes #include <iostream> using namespace std; int main() { int amnt; cout << "Give the amount." << endl; cin >> amnt; if (amnt > 100) { int h = amnt / 100; cout << "There are " << h << " '100' rupees note." << endl; amnt = am...
TOOL
0.962513
3.995787
647049fa-dc4a-49f6-9a9c-02781fff035e
moon1198/Leetcode
hot100/solution124.cpp
#include <bits/stdc++.h> #include "TreeNode.h" using namespace std; int max_res = INT_MIN; int postorder(TreeNode *root) { if (!root) return 0; int left = postorder(root->left); int right = postorder(root->right); //获取当前最大值 int ret = root->val; ret = ret + (left > 0 ? left : 0); ret = ret ...
ALGO
0.999965
5.390694
6ce741ae-d016-4077-a5f1-f252c2b12ddf
Nrupal-w/PX4-Autopilot
src/modules/navigator/GeofenceBreachAvoidance/geofence_breach_avoidance.cpp
#include "geofence_breach_avoidance.h" #include <lib/geo/geo.h> #include <motion_planning/VelocitySmoothing.hpp> using Vector2d = matrix::Vector2<double>; GeofenceBreachAvoidance::GeofenceBreachAvoidance(ModuleParams *parent) : ModuleParams(parent) { _paramHandle.param_mpc_jerk_max = param_find("MPC_JERK_MAX"); _p...
TOOL
0.906553
6.143464
8af59ea2-46f5-4b57-88a9-f78e4450e971
Ig-dolci/Nektar_sensitivity_stability
library/LibUtilities/Foundations/FourierPoints.cpp
#include <LibUtilities/Foundations/FourierPoints.h> #include <LibUtilities/Foundations/Points.h> #include <LibUtilities/LinearAlgebra/NekMatrix.hpp> #include <LibUtilities/BasicUtils/ErrorUtil.hpp> #include <LibUtilities/Foundations/ManagerAccess.h> // for PointsManager, etc namespace Nektar { namespace LibUtili...
ALGO
0.986418
5.181331
c8b0deee-c9f4-49f0-a930-efc6ebb25070
blacksea3/leetcode
cpp/leetcode/42. Trapping Rain Water.cpp
#include "public.h" //8ms, 98.33% //use double pointer //note: record the max of left locs and the max of right locs //update the max of left locs and the max of right locs, or add to the sum class Solution { public: int trap(vector<int>& height) { int res = 0; int leftmax = 0; int rightmax = 0; int left =...
ALGO
0.999969
6.413517
8b89b3f6-6f60-45e3-b8f8-221b46912fdf
hoanganh04-11/Cpp
De_Quy/Kiem_Tra_Chu_So_Chan.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long bool check(ll n){ if(n == 0) return true; else if(n % 2 == 1) return false; return check(n/10); } int main(){ ll n; cin >> n; if(check(n)) cout << "YES"; else cout << "NO"; }
ALGO
0.999919
4.364922
4f6d17bb-d73b-4c02-af4b-6078388d3c6b
shreyamalogi/DSA-BOOK
arrays/026_maximum profit.cpp
//author :shreyamalogi //Maximum profit by buying and selling a share at most twice. #include<bits/stdc++.h> using namespace std; //this is the general code for any buying and selling problem with atmost k times int maxprofit(int a[], int n,int k) { if(k>=n/2) { int maxp=0,i; for(i=0;i<n;i++) { if(a[i]>a...
ALGO
0.999348
3.869744
a4bc9308-3ea0-4d0e-a70f-088dc9bfa42f
SaifHaiderMalik/OOP
C++ Tutorial/Official/Functions.cpp
#include <cstdlib> #include <iostream> #include <string> #include <vector> #include <sstream> // Needed for std::iota #include <numeric> // ----- FUNCTION PROTOTYPES ----- // You define the return type and data types for functions // using a function prototype so main knows what is to be expected // from this funct...
TOOL
0.904862
4.711212
583b945e-df48-4ada-bd97-05a0e627c701
Shreyanshsingh23/Competitive-Programming
B_Startup.cpp
#include <bits/stdc++.h> using namespace std; #define ShreyanshSinghGautam cin.tie(nullptr);cout.tie(nullptr);ios::sync_with_stdio(false); #define int long long #define ln '\n'; #define all(x) x.begin(), x.end() #define MAX LLONG_MAX #define MIN LLONG_MIN #define sz(x) x.size() #define vi vector<int> #define v vecto...
ALGO
0.999952
4.165618
d7e28d4a-1b31-46da-b8a1-1b70997af947
JyVenom/Competitive-Programming
CodeForces/C++/P314C.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 ll n, m=0; vector <ll> numbers; vector <ll> bit; vector <ll> p; void update_bit(ll amount, ll index) { while (index <= m) { bit[index] = (bit[index]+amount)%MOD; index+= index & (-index); } } ll query(ll ...
ALGO
0.999975
4.150049
ecbd0af0-2dc2-44ab-83c5-48b5e63ee94f
Manmeet11/6-Companies-30-Days
Milestone-5(Intuit)/10. No of Provinces.cpp
class Solution { public: int find(vector<int> &dsuf, int val){ if(dsuf[val]==-1) return val; return dsuf[val]=find(dsuf, dsuf[val]); } void unionSet(vector<int> &dsuf, int x, int y){ int parentX=find(dsuf, x); int parentY=find(dsuf, y); if(parentX==parentY...
ALGO
0.999984
5.857869
37311733-f551-4c68-8e73-d30461106f35
Chandrapalumath/LeetCode
0009-palindrome-number/0009-palindrome-number.cpp
class Solution { public: bool isPalindrome(int x) { if(x<0){ return false; } long a=x,sum=0,p; while(a){ p=a%10; sum=sum*10+p; a=a/10; } if(sum==x){ return true; }else{ return false; ...
ALGO
0.999993
5.865076
44480873-4020-4203-87cc-74b8ba0eab44
namanofficial10/alphabetsincpp
J.cpp
#include<iostream> using namespace std; int main(){ int n; cout<<"Enter the Number of rows: "; cin>>n; int i,j; int front_space=0, mid_space=n-2; for(i=0;i<n;i++){ if(i==0){ for(j=0;j<n;j++){ cout<<"*"; } } else if(i<2*n/3 && i!=0...
ALGO
0.999867
3.79602
f6d8e8c0-37bc-4b6b-8288-991837829444
NII-o9i2/AutoPilotMath
algorithm/cilqr/ref/cilqr_solver/src/bicycle_dynamic.cpp
#include <cmath> #include "bicycle_dynamic.hpp" #include <iostream> namespace senseAD { namespace planning { BicycleDynamic::BicycleDynamic(const double delta_t) : cilqr::Dynamic<6, 2>(), delta_t_(delta_t) {} void BicycleDynamic::GetDerivates(const VectorNd& state, const VectorM...
ALGO
0.999691
6.016009
186ae08f-ede6-4f06-b6c4-c172f90178e9
developer-bin/algorithm
boj/boj_2851.cpp
#include <iostream> #include <algorithm> #include <cstring> #include <string> #include <queue> #include <map> #include <vector> #include <cmath> #include <set> #include <unordered_map> #include <unordered_set> #include <sstream> #include <stack> #define MIN_VALUE -200000000 #define MAX_VALUE 200000000 #define ll long l...
ALGO
0.999553
3.511177
be02e0bf-1846-47ae-8851-da9499a4d4b9
Suryansh555/CPP
InorderTraversal.cpp
#include<bits/stdc++.h> using namespace std ; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; void Inorder(TreeNode * root , vector<int> &ans){ if(root == NULL){ return ; } Inorder(root -> left,ans); ...
ALGO
0.99998
5.632406
fc777831-025f-45ed-b9cf-da1ba3a3e910
dkangtext/Data-Structures-and-Algorithms
inclass/[Inclass14] Simple Graphs (Intermediate)/BAI01/main.cpp
/*###Begin banned keyword - each of the following line if appear in code will raise error. regex supported ###End banned keyword*/ // ###INSERT CODE HERE - #include <iostream> #include <vector> using namespace std; int main() { int m, n; cin >> m >> n; vector<int> degree(m, 0); for (int i = 0; i < n...
ALGO
0.999565
4.881682
f9201663-98e9-4587-afa3-b98d9ea7cc0b
devararendy/tcp_proxy
sdk/boost_1_77_0/doc/html/boost_asio/example/cpp11/executors/fork_join.cpp
#include <boost/asio/execution.hpp> #include <boost/asio/static_thread_pool.hpp> #include <algorithm> #include <condition_variable> #include <memory> #include <mutex> #include <queue> #include <thread> #include <numeric> using boost::asio::static_thread_pool; namespace execution = boost::asio::execution; // A fixed-s...
ALGO
0.998928
7.536862
ea458f22-4f91-4b19-b226-119194772a35
ishandutta2007/codeforces
candybar/normal/1642/E.cpp
/* start thinking: BULB: result of thinking: start coding: AC: */ #include <bits/stdc++.h> #define mp make_pair using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ldouble; typedef pair<int, int> P; typedef pair<ll, ll> Pll; const int inf = 0x3f3f3f3f; const ll infll = 0x3f3f...
ALGO
0.999888
4.749756
86b84181-4fea-4900-9255-388650cf9ecd
rust20/aoc2024
cpp/day3/main.cpp
#include <algorithm> #include <boost/tokenizer.hpp> #include <cstddef> #include <cstdlib> #include <cstring> #include <execution> #include <fstream> #include <iostream> #include <ostream> #include <sstream> #include <string> #include <unordered_map> #include <utility> #include <vector> #include <chrono> std::pair<int...
ALGO
0.99152
5.004313
576e82c2-95d2-4600-96df-b451f682e40c
asvikr/SPOJ_SOL
SWAPS/14525800.cpp
#include<bits/stdc++.h> using namespace std; #define MAXI 50001 #define MAXN 250005 #define MAXSQRT 500 typedef long long int LL; int A[MAXN],N,M,bit[MAXSQRT+1][MAXI+1],sqrtN; void bitins(int x,int y,int val) { while(x<=sqrtN){ for(int i=y;i<=MAXI;i+=i&-i){ bit[x][i]+=val; } x+=x...
ALGO
0.999991
4.209345
88beae85-ed13-409d-b68e-e354e0ddc711
sbmaruf/Algorithms-Code-Library
Graph/BellmanFord.cpp
#include<bits/stdc++.h> using namespace std ; int N , R , P ; int U[9900+1] , V[9900+1] , C[9900+1] , D[101] ; int main() { int cases , caseno = 1 ; //scanf("%d",&cases ) ; cases = readInt() ; while( cases -- ) { //scanf("%d%d%d",&N,&R,&P) ; N = readInt() ; R = readInt() ; ...
ALGO
0.999852
3.475053
77e1a64a-49eb-4234-bc45-13ac512fc409
iagorrr/Competitive-Programming-Solutions
submissions/Codeforces/1180A.cpp
// iagorr ;) #include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); using ll = long long; const int maxn = 1000; ll dp[maxn]; inline ll solve(int x){ // already calculed. if(dp[x] != -1) return dp[x]; dp[x] = solve(x-1) + (x-1) * 4; ret...
ALGO
0.999989
5.049439
58513bc0-c2a9-4e33-8afa-d6d39eb076de
nmhienbn/Competitive-Programming
Mr.Minh/$History/20210811155141916_063764380270207[BNMINHHIEN][double].cpp
#include <bits/stdc++.h> #define fi(i, a, b) for(int i = a; i <= b; i++) #define fid(i, a, b) for(int i = a; i >= b; i--) #define pii pair<int,int> #define pb push_back #define ll long long #define faster ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); #define Seraphine "double" const int maxn = 5e4+5, max...
ALGO
0.999957
3.578208
cb918cd3-c8f8-453d-b321-9c390429f29f
qianlizhixing12/coding-training
leetcode/15.cpp
#include <vector> #include <algorithm> using namespace std; class Solution { public: vector<vector<int>> threeSum(vector<int> &nums) { vector<vector<int>> result; if (nums.size() < 3) { return result; } // 辅助数组,不改动实参 vector<int> help(nums.begin(), nums.end()); // 排序 sort(help.begin...
ALGO
0.999972
5.287631
4a3ea951-464a-46ad-bdc8-75a4c67c1c6d
Espinosa-12/Beginner-DSA-problems
0658-find-k-closest-elements/0658-find-k-closest-elements.cpp
class Solution { public: vector<int> findClosestElements(vector<int>& arr, int k, int x) { vector<int> ans; auto lowerBound=lower_bound(arr.begin(),arr.end(),x); int idx=lowerBound-arr.begin(); int i=idx-1,j=idx; while(i>=0 && j<arr.size()) { int...
ALGO
0.999999
5.556959
f3ceb206-05ea-4b7a-ae3c-ed9eb4258aca
Henrik-Yao/NEUQ-ACM-Solution
winter-day2/徐睿康/后序和中序构造二叉树.cpp
#include<bits/stdc++.h> using namespace std; int n,a[15],b[15],x,ye[10000010]; struct node{ int l,r; }vec[15]; void print(int x){ cout<<x<<' '; if(vec[x].l!=-1) print(vec[x].l); if(vec[x].r!=-1) print(vec[x].r); } int dfs(int l1,int r1,int l2,int r2){ //printf("%d %d %d %d\n",l1,r1,l2,r2); if(l1==r1&&l2==r2){ ...
ALGO
0.999953
3.363779
fe502a61-d46f-4c90-9991-ee92620b3867
NaderYehia/Competitive-Programming
Vjudge/CodeForces/292E/31602575_AC_342ms_2344kB.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int n, m, a[N], b[N], tree[4 * N]; void push_down(int si, int ss, int se) { if (ss == se || tree[si] == -1) return; int md = ss + (se - ss) / 2, lf = si * 2 + 1, rt = si * 2 + 2; tree[lf] = tree[si]; tree[rt] = tree[si] + (md - ss...
ALGO
0.999934
4.225238
8f7711b8-a395-41e3-96b6-8ecbeb55cea0
hugobergeret/cpp_option_pricer
OptionPricer/OptionPricer/option.cpp
#include "option.h" #include "../Payoff/payoff.h" #include "../Payoff/payoffs.h" #include "../MonteCarlo/random.h" #include "../NumericSchemes/numericSchemes.h" #include <cmath> // Vanilla Option constructor Option::Option(double Strike_, double Vol_, double r_, double Expiry_, const Payoff& ThePayoff_ ): Strike(Strik...
ALGO
0.995939
6.130064
8fd6a660-54ff-4303-a313-8d107f8a7a4a
tranbaoanhh27/my-cpp-library
test/test-sorting-algorithms.cpp
#include <iostream> #include <sstream> #include <string> #include <cmath> #include <chrono> using namespace std; #include "DataGenerator.h" void printArray(int *a, int n) { for (int i = 0; i < n; i++) cout << a[i] << " "; cout << endl; } void MySwapFunction(int &a, int &b) { int temp = a; a ...
ALGO
0.998985
4.555869
0fe323c7-a8fd-4852-a114-fa851ecca3da
f-a-h-a-d/MY-OJ-SOLUTIONS
Spoj/COSTLY CHESS.cpp
#include<bits/stdc++.h> using namespace std; #define PI acos(-1.0) #define lcm(a,b) (a * (b / __gcd(a,b))) #define en '\n' #define READ_IN freopen("Input.txt","r",stdin); #define READ_OUT freopen("Output.txt","w",stdout); #define Infi 0x3f3f3f3f const int dx[] = {+1,-1,+0,+0...
ALGO
0.999176
3.954764
a2cc1f03-dc58-433f-b521-c749e09d8259
tkh-ab/cuda_ultrasound_toolkit
cuda_toolkit/src/image_processing/image_processor.cpp
#include <format> #include <chrono> #include <algorithm> #include "kernels/block_match.h" #include "image_processor.h" NppStreamContext ImageProcessor::_create_stream_context(cudaStream_t stream) { NppStreamContext ctx = {}; int device = -1; cudaGetDevice(&device); // this always returns the device ...
ALGO
0.970116
6.610985
faeea989-58db-4564-903d-bcfb9b549027
ishandutta2007/codeforces
onionpringles/normal/983/E.cpp
#include <bits/stdc++.h> using namespace std; const int N=201010; const int B=1<<18; const int LG=18; int cnt[N],hv[N],srt[N],ord[N],orde[N],up[N],rnk[N],anc[N][LG],clk,go[N][LG]; pair<int,int> tr[B<<1]; vector<int> adj[N]; vector<pair<int,int>> rs; vector<int> tr2[B<<1]; void dfs0(int u){ cnt[u]=1;hv[u]=-1; for(auto...
ALGO
0.999911
4.284286
6026d564-d39a-43ef-961d-6f3d8ab08882
priyanshumaitra/ccp-assignments
c_lang/A7/q7.cpp
/*7. Write a C program to search an element in array using pointers.*/ #include <stdio.h> int main(){ int arr[100], n, *ptr; int key, i, flag = 0; printf("Enter no. elements: "); scanf("%d", &n); printf("Enter elements: "); for (i = 0; i < n; i++) scanf("%d", &arr[i]); pri...
ALGO
0.99981
3.643502
f1e01961-3f70-4e81-84ce-23731af69aff
boatinw99/CompetitiveProgramming
SSWT 2.2/Kamehameha.cpp
#include<bits/stdc++.h> using namespace std ; typedef pair<int,int> pii ; #define fi first #define se second const int N = 2009 ,inf = 2e9 ; int n,m ; queue<int> q ; vector<int> L,R,g[N]; vector<pii> edge ; int dist[N],match[N] ; void init() { L.clear(); R.clear(); edge.clear(); memset(match,0,sizeof ma...
ALGO
0.999794
4.199618
271715a8-792d-49a9-a7a4-c20d059a899b
Amitchaudhary04/c-programs
c programs/Pattern Program 5.cpp
#include <stdio.h> int main() { int rows, cols, i, j; printf("Enter number of rows: "); scanf("%d", &rows); printf("Enter number of columns: "); scanf("%d", &cols); for(i=1; i<=rows; i++) { for(j=1; j<=cols; j++) { if(i%2 == 1) { printf("...
ALGO
0.997802
3.25413
271272eb-6b11-4a12-b721-8495ff022dc4
Kaan-Karaoglan/CarDetectionAndCountingYOLOv1
third_party/opencv4.10/opencv-4.10.0/modules/stitching/src/autocalib.cpp
#include "precomp.hpp" #include "opencv2/core/hal/hal.hpp" using namespace cv; namespace { static inline bool decomposeCholesky(double* A, size_t astep, int m) { if (!hal::Cholesky64f(A, astep, m, 0, 0, 0)) return false; return true; } } // namespace namespace cv { namespace detail { void focalsFr...
ALGO
0.999464
6.453257
ce74a839-cd87-4826-a783-564b8abe420b
Zhenghao-Liu/LeetCode_problem-and-solution
1544.整理字符串/solution2_stack.cpp
class Solution { public: string makeGood(string s) { int size=s.size(); string ans; for (int i=0;i<size;++i) { ans.push_back(s.at(i)); int ans_size=ans.size(); while (ans_size>=2 && judge(ans.at(ans_size-1),ans.at(ans_size-2))) { ...
ALGO
0.999923
6.178691
85ccaee6-4016-4903-9f5c-0690ed69271a
ss3359/Enigma_Machine
main.cpp
// // main.cpp // Flowers // // Created by Owner on 8/28/24. // #include <iostream> #include <cmath> #include <vector> #include <thread> #include <iomanip> #include <complex> #include "Rose.hpp" #include "Petunia.hpp" #include "Marigold.hpp" #include "Iris.hpp" #include "Daisy.hpp" #include <fstream> using namespac...
ALGO
0.994989
4.313437
8c77e015-90d8-4ce8-bc02-4c8473002b05
parth134/DSA
0203-remove-linked-list-elements/0203-remove-linked-list-elements.cpp
class Solution { public: ListNode* removeElements(ListNode* head, int val) { while(head &&(head->val == val)){ ListNode *temp = head; head = head -> next; delete(temp); } ListNode *q = head, *p = head; while(p!=NULL){ if(p->val == val){...
ALGO
0.99974
5.664813
85d279c5-b8ef-490e-8d07-5a9ec1e10496
ishandutta2007/codeforces
_menhera/normal/612/F.cpp
#include<bits/stdc++.h> using namespace std; const int MAXN = 2000; int N, S, K; int A[MAXN], dp0[MAXN], dp1[MAXN]; vector<int> next0[MAXN], next1[MAXN]; void p(int x){ if(x<0) printf("%d\n", x); else printf("+%d\n", x);} void track(int x) { while(true) { int y = x; for(auto v: next0[x]) p(v), y += v; y = (y...
ALGO
0.999984
3.172669
41ccaf27-612e-46f1-a9fa-d31a0b2731da
anupambiswas/meshAFM
test_and_debug/cdbug.cpp
#include<iostream> #include<cstdlib> #include<cmath> #include<fstream> #include<sstream> using namespace std; void getIntersectionPoints(double a0,double b0,double c0,double a1,double b1,double c1,double& xp,double &yp) { double den=a0*b1-a1*b0; xp=(b0*c1-b1*c0)/den; yp=(a1*c0-a0*c1)/den; } void circumcentre(d...
ALGO
0.994551
3.435169