uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
3b3ae586-3e9a-431c-91f5-082cfe0fbf57
mahegupt/cplus
stack.cpp
#include <iostream> #include <stdexcept> // For exceptions class Stack { private: int* data; // Dynamic array to hold stack elements int topIndex; // Index of the top element int capacity; // Maximum capacity of the stack public: // Constructor to initialize the stack Stack(int size) :...
ALGO
0.957025
6.798636
b9d76c37-1dfc-44ed-a9a1-a2c90553aa8d
gurjotsc/gcheema-cp
Codeforces/buyingGifts.cpp
#include <algorithm> #include <bits/stdc++.h> #include <climits> using namespace std; using ll = long long; const ll inf = 1e18; using pii = pair<int, int>; using pll = pair<ll, ll>; #define endl "\n" #define all(x) begin(x), end(x) template<typename T> std::istream& operator >>(std::istream& input, std::vector<T>& da...
ALGO
0.999931
5.164085
ee4fac65-89d7-4376-ba26-18bf47c35f48
khadas/android_hardware_rockchip_camera_aidl
device/VirtualUtils.cpp
#define LOG_TAG "VirtualUtils" // #define LOG_NDEBUG 0 #include "VirtualUtils.h" #include <aidlcommonsupport/NativeHandle.h> #include <jpeglib.h> #include <linux/videodev2.h> #include <log/log.h> #include <algorithm> #include <cinttypes> #include <cmath> #define HAVE_JPEG // required for libyuv.h to export MJPEG de...
TOOL
0.916702
6.200637
8e6c7ef8-3aea-481c-89f1-b8706895bae3
sanskaar-sahu/DSA-SHEET
DP/q931.cpp
#include<bits/stdc++.h> class Solution { public: int solve(int row, int col, vector<vector<int>>& matrix) { if (col < 0 || col >= matrix[0].size()) return 1e9; // out of bounds if (row == matrix.size() - 1) { return matrix[row][col]; // base case: last row } int left...
ALGO
0.999994
6.320936
aec3532e-9870-4e02-85ac-4062000f932e
xhcstudy/Cplusplus
vector容器/vector容器/vector容器/vector构造函数.cpp
#define _CRT_SECURE_NO_WARNINGS 1 #include <iostream> using namespace std; #include <vector> //void printVector(vector<int> v) //{ // for (vector<int>::iterator it = v.begin(); it != v.end(); it++) // { // cout << *it << " "; // } // cout << endl; //} // ////vector //void Test1() //{ // vector<int> v1; //ĬϹ ޲ι // f...
TOOL
0.962428
3.875531
3ce23bbc-19de-4d7d-8dab-a846df00065f
starry-skyss/algorithm
luogu/p8711.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll n; cin >> n; while (n > 0) { cout << n << ' '; n /= 2; } return 0; }
ALGO
0.999977
4.388649
73462573-1012-411a-9f23-597334ba534a
Langtienh/DSA
Tham lam/GREGAME.cpp
#include <iostream> #include <algorithm> using namespace std; int n, h[100006], k; long long m; void enter() { scanf("%d%I64d%d", &n, &m, &k); for(int i=1; i<=n; ++i) scanf("%d", &h[i]); } void process() { if (n == 1) { cout << "YES\n"; return; } for(int i=1; i<n; ++i) { ...
ALGO
0.999912
3.432966
f1679edc-9d38-4ac3-b465-7226ff55a4ac
zhushuoz/Data_structure
haffman.cpp
/************************************************************************* > File Name: haffman.cpp > Author: > Mail: > Created Time: 2018年9月28日 星期日 10时01分46秒 ************************************************************************/ //哈夫曼树 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <in...
ALGO
0.999906
4.20789
61a76ca5-2a40-43f9-b567-5db508217a24
braydonwang/Leetcode-Solutions
173-binary-search-tree-iterator/173-binary-search-tree-iterator.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.999874
6.569455
54c56cba-ac34-493a-9238-83c1e007149c
Anmol-Sri/Competitive-Environment
Google Kick Start 2021 Round B/Consecutive_Primes.cpp
#include <bits/stdc++.h> #define ll long long int #define ld long double #define pb push_back #define MP make_pair #define mt make_tuple #define eb emplace_back #define ar array #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define mem(arr,x) memset(arr, x, sizeof arr) #define db(arr) for(auto ...
ALGO
0.999954
5.087107
01283097-c7f0-42e0-9d21-22dfd4f271f3
richelbilderbeek/CppTests
CppBoostUblasMatrixExample6/main.cpp
#ifdef _WIN32 #undef __STRICT_ANSI__ #endif #include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/io.hpp> #include <boost/numeric/ublas/matrix_proxy.hpp> double CalcDeterminant(const boost::numeric::ublas::matrix<double>& m) { assert(m.size1() == m.size2() && "Can only calculate the determinant of...
ALGO
0.999866
6.281923
e6ed07da-2f81-4e50-adc2-fd11e0f352e7
redsand/bl4ckJack
bl4ckJack/boost_1_45_0/libs/math/example/neg_binomial_sample_sizes.cpp
// neg_binomial_sample_sizes.cpp #include <boost/math/distributions/negative_binomial.hpp> using boost::math::negative_binomial; // Default RealType is double so this permits use of: double find_minimum_number_of_trials( double k, // number of failures (events), k >= 0. double p, // fraction of trails for whi...
ALGO
0.998204
7.258163
315f0f1c-792c-42ec-be52-faec16e8580f
kartnagrale/Summer-Camp-ICPSC
div 2 B/BAN BAN.cpp
//https://codeforces.com/contest/1747/problem/B #include<bits/stdc++.h> using namespace std; using ll = long long; void solve(){ ll n;cin>>n; cout<<(n+1)/2<<'\n'; vector<int> a1,a2; for(int i=0;i<n;i++){ a1.push_back(3*i+2); a2.push_back(3*i+3); } for(int i=0;i<(n+1)/2;i++){ ...
ALGO
0.999604
4.23087
75de4973-c7c9-4644-821d-fda80adafa9e
LuizHenriqueSena/ESBMC-GPU
regression/esbmc-cpp/cpp/ch4_20/main.cpp
// Fig. 4.22: fig04_22.cpp // Initializing multidimensional arrays. #include <iostream> using std::cout; using std::endl; void printArray( int [][ 3 ] ); int main() { int array1[ 2 ][ 3 ] = { { 1, 2, 3 }, { 4, 5, 6 } }; int array2[ 2 ][ 3 ] = { 1, 2, 3, 4, 5 }; int array3[ 2 ][ 3 ] = { { 1, 2 }, { 4 } }; ...
TOOL
0.909008
4.127697
e58f47b4-35d9-4990-ba29-f106d92e5e0f
meoyushi/cp-problems
YOGACLASS.cpp
#include<iostream> #include<vector> #include<string> #include<cmath> #include<algorithm> #include<cstring> using namespace std; void yc(){ int t; cin>>t; while(t--){ int n, x, y; cin>>n>>x>>y; int xi=2*x; int ans; if(xi>=y){ ans=n*x; } else{ ...
ALGO
0.999682
3.744527
f2f88918-69fa-4eb6-9ef8-527ac8b1bee9
DeyMass/Labs
SAOD/1_sem/Lab1/test1.cpp
#include "bible.cpp" main() { int *A, n, i, chsum, rnum; printf("Razmer massiva: "); scanf("%d",&n); A=new int [n]; if (A==NULL){ printf(" ERROR "); return 1; } FillInc(A, n); PrintMas(A, n); chsum=CheckSum(A, n); printf("\nChe...
TOOL
0.979958
3.433391
9f5b436c-46df-46ba-ace6-925c866cd452
ZehuaZhang/cs-fundamentals
data-structure-and-algorithm/cpp/rotate-array.cpp
// 189. Rotate Array // Difficulty: Easy // Rotate an array of n elements to the right by k steps. // For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. // Note: // Try to come up as many solutions as you can, there are at least 3 different ways to solve this problem. // Hin...
ALGO
0.999966
6.622648
4148a46a-abc9-4a33-862b-027d3d374c1b
zrythm/zrythm
ext/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.cpp
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ #include <cfloat> #include <cmath> #include "ClusterMeltSegmenter.h" #include "cluster_segmenter.h" #include "segment.h" #include "dsp/transforms/FFT.h" #include "dsp/chromagram/ConstantQ.h" #include "dsp/rateconversion/Decimator.h" #incl...
ALGO
0.95256
5.938127
b92954ca-2ff3-43e6-bc41-b80ea76e9dd0
vpk-11/IPMP
DSA Prep/Round 2/Trees/Tr_30.cpp
// Check if Sum Tree or Not #include <iostream> #include <queue> using namespace std; class Node { public: int data; Node *lchild; Node *rchild; }; Node *root = new Node; void create(Node *root) { queue<Node *> q; Node *p, *t; int x; cout << "Enter Root Value "; cin >> x; root->dat...
ALGO
0.999936
4.612448
d01dbde0-0e1f-4185-9514-987678e0d457
guohaoyu110/Self-Learning-DataStructure
蓝桥杯 programming /5-25 朋友圈/5-25 朋友圈/main.cpp
#include<iostream> #include<stdio.h> #include<math.h> #include<string.h> using namespace std; int a[30030]; int ans=0; int find(int x) { if(a[x]>=0){ a[x] = find(a[x]); return a[x]; } else return x; } void union_(int x,int y){ int tx = find(x); int ty = find(y); if(tx==ty...
ALGO
0.999937
3.561209
d537080d-1e5e-43b0-a0a3-57265611d707
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_9173_6.cpp
#include <bits/stdc++.h> #pragma GCC optimize(2) using namespace std; const long long mod = 998244353; vector<long long> d; int main() { long long n; while (cin >> n) { d.push_back(0); d[0] = 1; long long x = 1; for (long long i = 1; i <= n; i++) { x = x * i % mod; ; d.push_back(0)...
ALGO
0.999983
4.999106
c38ede68-2600-4007-ad2b-f96136abdaf9
Mengoe/AlgorithmPractice
DP_review/1932.cpp
#include <bits/stdc++.h> using namespace std; int d[502][502]; int score[502][502]; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) { cin >> score[i][j]; } } d[1][1] = ...
ALGO
0.999983
3.715244
780cc289-bbc3-44ec-85eb-34a218016292
khh7052/CodingTest
프로그래머스/1/161990. 바탕화면 정리/바탕화면 정리.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; vector<int> solution(vector<string> wallpaper) { vector<int> answer; int x, y = 0; int minX = 50, minY = 50, maxX = -1, maxY = -1; for(auto& paper : wallpaper){ x = 0; for(auto& c : paper){ ...
ALGO
0.999105
5.019775
ce3e9648-0da1-42f0-bc45-da94a0a58782
zmx4/MySteps
codeforces/2025年8月/A_Is_it_rated_2.cpp
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back #define gcd __gcd typedef int64_t i64; typedef int32_t i32; using ll = long long;using ull = unsigned long long;using LL = long long;using ULL = unsigned long long; using namespace std; const int inf = 0x3f3f3f3f,INF = 0x3f3f3f3f; ll gcd(l...
ALGO
0.99863
3.595049
a7715133-6476-40cc-8ec6-fec38f985d38
shantanu2002git/CODE903_FORCES_800-2500
Josephus_Problem_II.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 int main() { int n, k; cin >> n >> k; indexed_set<int> children; for (int i = 1; i <= n; i++) children.insert(i); int index = k + 1; while (children.size() > 1) { index %= children.size(); ...
ALGO
0.999993
3.445921
8690e2ea-827f-4816-968d-6dffa61b8821
Kaifislam48/I-am-Neo-DSA
UNIT-4.cpp/LEC-3_Q8.cpp
/* Imagine you are a computer programmer tasked with creating a program to organize a collection of years in ascending order. This program will take a list of years as input and efficiently sort them using the Quick-Sort algorithm, ensuring that the years are arranged chronologically. Input format : The first line of ...
ALGO
0.999971
6.110825
0e64950b-17c6-4106-90eb-8ef17cb799ab
shdhrubo/LeetCode
1290-convert-binary-number-in-a-linked-list-to-integer/1290-convert-binary-number-in-a-linked-list-to-integer.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: int getDecimalValue(L...
ALGO
0.999975
6.081785
e8385322-4745-45ec-a591-01b9458af4cb
LFuciarelli/esercizi-IP
Altri_esercizi/ricorsione/potenza/potenza.cpp
#include <iostream> using namespace std; // 3³ 3*3*3 int pow_rec(int n, unsigned int p){ if (p == 0) return 1; return n*pow_rec(n, p-1); } int main(){ cout << pow_rec(5, 2) << endl; // 25 cout << pow_rec(3, 3) << endl; // 27 cout << pow_rec(1, 0) << endl; // 1 }
ALGO
0.999888
4.993845
949d6738-6071-484e-8bb0-853723ce1ece
hei0v0/Algorithm-Exercises
PAT (Basic Level) Practice/1013.cpp
#include <cmath> #include <iostream> using namespace std; bool check(int x) { for (int i = 3; i <= sqrt(x); i++) { if (x % i == 0) return false; } return true; } int main() { int m, n; int a[10005]; a[1] = 2; a[2] = 3; int p = 3; cin >> m >> n; for (int i = ...
ALGO
0.999875
3.536481
13a37eb4-4106-4583-a02f-b2202d787cda
LonxunQuantum/Lammps_for_PWMLFF
lammps_neigh_mlff_20230508/lib/gpu/lal_lj_coul_msm_ext.cpp
/*************************************************************************** lj_coul_msm_ext.cpp ------------------- W. Michael Brown (ORNL) Functions for LAMMPS access to lj/cut/coul/msm acceleration routines. ___________________...
ALGO
0.94512
5.51115
525f264a-1e6b-4c67-84a3-6c6db870072f
qijiabao4113/CourseGradingOperatingSystemSimulationExperiment
osProject/osProject5/pagestoragehard.cpp
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> using namespace std; const int maxn = 320; //序列个数 const int max = maxn +20;//数组大小 const int maxp = max/10; //最大页数 int inst[max];//指令序列 int page[max];//页地址流 int size; //内存能容纳的页数 bool in[maxp]; //该页是否在内存里,提高效率 int pin[maxp]; //现在在内...
ALGO
0.999342
3.36552
ab6a0646-c25f-448b-8a56-1981743fb72d
jandersson/QuickestPath
main.cpp
//Quickest Path Algorithm //For ECE427 //By Jonas Andersson #include <iostream> #include <fstream> #include "Link.h" #include "Path.h" #include <string> #include <vector> #include <stdlib.h> #include "limits.h" #define ring_size 4 #define mesh_size 8 using namespace std; //TODO: The number of nodes is hardcoded into di...
ALGO
0.998613
3.936544
27bde845-3d2d-4bef-8852-60b3aa86d3df
HG-IMMORTALS/Leetcode
739-daily-temperatures/daily-temperatures.cpp
class Solution { public: vector<int> dailyTemperatures(vector<int>& temperatures) { int n = temperatures.size(); vector<int>nge(n, 0); stack<int>st{}; for(int i = n-1; i>=0; --i){ while(!st.empty() && temperatures[st.top()] <= temperatures[i]) st.pop(); ...
ALGO
0.999946
6.527952
86613ff2-4c70-4c26-9fea-1a77dacff48a
Heiliger4/DSA-Practice
Sorting/IndirectByIndex_sort.cpp.cpp
#include<iostream> using namespace std; void indirectSortingByIndex(int *array,int size); int main() { int array[] = {2,1,5,6,4,9,7,3, 8}; int size = sizeof(array)/sizeof(array[0]); for(int i: array) { cout<<i<<" "; } cout <<"\n"; indirectSortingByIndex(array,size); } void ind...
ALGO
0.999962
4.068439
171ace2c-5fea-4288-ade0-40bdcdeb96b8
Fomalhaut8751k/CppStudy01
15 类模板/main.cpp
#include<iostream> using namespace std; template<typename T> class SeqStack { public: // ü<T>,ҪõҪ<T> SeqStack(int size = 10): _top(-1), _size(size), _pstack(new T[size]){ } SeqStack(const SeqStack<T>& seq) { _pstack = new T[seq._size]; for (int i = 0; i <= seq._top; i++) { // TǸ󣬲ʹmemcpy _pstack[...
ALGO
0.985517
3.879851
1d2921d1-d548-485c-a97b-395a74be9083
MishkatIT/codeforces-atcoder-submissions
codeforces/1929/1929C Sasha and the Casino.cpp
/* author : MishkatIT created : Friday 2024-02-16-23.50.26 */ #include<bits/stdc++.h> #define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define debug(_) cout << #_ << " is " << _ << '\n'; using namespace std; using ll = long long; using ld = long double; const ll mod = 1e9...
ALGO
0.999285
4.560372
ed30befc-7eb6-4e65-a6e2-ba085627ff0b
sladewinter/CompetitveProgramming
Ch 3 Paradigms/Dynamic Programming/Bottom Up/uva-507-MaxSubarraySum.cpp
#include <iostream> using namespace std; int main() { int b, s; int r{ 0 }; int max, max_start, max_end, so_far, start, end; int stop; scanf( "%d", &b ); while( b-- ) { scanf( "%d", &s ); start = end = max_start = max_end = 1; max = so_far = 0; for( int i{1}...
ALGO
0.99934
4.242555
c06d9d89-c3c5-460c-ab9d-140e1938bf25
7cristovao/cpp
exercicios/capitulo12/12-14.cpp
#include <iostream> // declaracao da funcao // ----------------------------------- double Dobro (double x); void Dobro (double x, double &y); //------------------------------------ using namespace std; int main (int argc, char *argv[]) { double x, dx, y = 7.0, z, w; cout << "digite x: "; cin >> x; x = D...
ALGO
0.978182
5.517412
0a79bc33-ebe6-42d2-a667-e0bf4a27d183
naahio/IRC
srcs/tools/Commands.cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Commands.cpp :+: :+: :+: ...
WEB
0.877803
4.107513
c405e780-f493-44ba-b703-f5b4066335af
samyakjain07/DSA
String/min_dis_between_words.cpp
#include<bits/stdc++.h> using namespace std; int distance(string s, string w1, string w2){ vector<string> tmp; string str = ""; for (int i = 0; i < s.length(); i++) { if (s[i] == ' ') { tmp.push_back(str); str = ""; } else str += s[i]; } tmp.push_back(str); int i,m,n; for (i = 0; ...
ALGO
0.999813
4.604578
727e165e-ba99-4840-a980-e605d6c0fd64
fpdjsns/Algorithm
codejam/2020/QR/1. Vestigium.cpp
/** * problem : https://codingcompetitions.withgoogle.com/codejam/round/000000000019fd27/000000000020993c * data structure : set * time complexity : O(N^2) */ #include <string> #include <algorithm> #include <vector> #include <set> #include <queue> #include <iostream> using namespace std; int main() { int T; ci...
ALGO
0.999206
4.518334
ee6ac88d-8eaf-44a1-bf36-925d33ce5fa7
prateek27/Algorithms
Segment Tree RMQ.cpp
#include<iostream> #include<cmath> #include<climits> #include<cstdio> using namespace std ; int min(int a,int b) { return a>b?b:a; } int RMQUtil(int *st,int ss,int se,int qs,int qe,int index){ if(qs<=ss&&qe>=se) return st[index]; if(se<qs||qe<ss) return INT_MAX; int mid = (ss+se)/2;...
ALGO
0.999951
4.242137
038d42de-85f8-4123-964e-1555ddeb289b
C3Pool/xmrig-C3
src/crypto/randomx/randomx.cpp
#include "crypto/randomx/common.hpp" #include "crypto/randomx/randomx.h" #include "crypto/randomx/dataset.hpp" #include "crypto/randomx/vm_interpreted.hpp" #include "crypto/randomx/vm_interpreted_light.hpp" #include "crypto/randomx/vm_compiled.hpp" #include "crypto/randomx/vm_compiled_light.hpp" #include "crypto/random...
CONFIG
0.906726
5.451857
abeb5822-e7e4-49a2-b857-9915a550c231
vfolunin/archives-solutions
UVa Online Judge/1529.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> using namespace std; bool solve() { int h1, m1, h2, m2; if (scanf("%d%d%d%d", &h1, &m1, &h2, &m2) != 4) return 0; int t1 = h1 * 60 + m1; int t2 = h2 * 60 + m2; if (t2 < t1) t2...
ALGO
0.996948
3.351839
356b83cf-0465-47a1-81e3-208df4c5e214
amehmedic/TP-2021-22
Tutorijali/T2/Z2/main.cpp
//TP 2017/2018: Tutorijal 2, Zadatak 2 #include <iostream> #include <vector> bool TestPerioda (std::vector<double> v, int p) { if (p==0 || v.size()<=1 || p>=v.size()) { return false; } for (int i=0;i<v.size();i++) { if ((i+p)<v.size()) { if(v[i]!=v[i+p]) ...
ALGO
0.999332
4.414567
f684dc5e-a3c6-40e5-a650-8131a2a4ff34
solara0616/zerocopy-protobuf
iceoryx_posh/source/roudi/roudi_cmd_line_parser_config_file_option.cpp
#include "iceoryx_posh/roudi/roudi_cmd_line_parser_config_file_option.hpp" #include "iceoryx_platform/getopt.hpp" #include <iostream> namespace iox { namespace config { expected<CmdLineArgs_t, CmdLineParserResult> CmdLineParserConfigFileOption::parse( int argc, char* argv[], const CmdLineArgumentParsingMode cmdLi...
TOOL
0.851848
6.518375
0f582a64-2396-4640-ae51-9d65c67a9867
Grantzile/Algorithm_PS-CP
BOJ/Platinum/V/2123.cpp
#include <bits/stdc++.h> using namespace std; bool compare(pair<long long int,long long int>& a, pair<long long int,long long int>& b){ return (a.first + a.second) > (b.first + b.second); } int main(){ cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false); long long int n; cin >> n; ...
ALGO
0.999964
3.817903
ba726f2f-e71e-4fd7-b117-5508c00ad0f1
40Eairshiner7/Algorithms
_RLoong_treap.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #define MM 440004 #define INF 100000007 using namespace std; struct Treap { int root,treapCnt,key[MM],priority[MM],childs[MM][2],cnt[MM],size[MM]; Treap() { root=0; treapCnt=1; priority[0]=INF; size...
ALGO
0.999933
3.817135
7ccc2149-c2bb-488d-ba1b-57e60c819dd6
Ananya-Verma-24/450-DSA-Sheet
arrays/25_count_more_than_nk_occurence.cpp
/* Given an array arr of size N and an element k. The task is to find the count of elements in the array that appear more than n/k times. Example 1: Input: N = 8 arr = [3,1,2,2,1,2,3,3] k = 4 Output: 2 Explanation: In the given array, 3 and 2 are the only elements that appears more than n/k times. Example 2: Input...
ALGO
0.999942
5.291328
fb3e4313-67d8-44ef-af18-68c48bce76a9
xzxg001/miniob
src/observer/storage/index/latch_memo.cpp
// // Created by Wangyunlai on 2023/03/08. // #include "storage/index/latch_memo.h" #include "common/lang/mutex.h" #include "storage/buffer/disk_buffer_pool.h" #include "storage/buffer/frame.h" // LatchMemoItem构造函数 LatchMemoItem::LatchMemoItem(LatchMemoType type, Frame *frame) { this->type = type; // 设置锁类型 this...
TOOL
0.943391
6.009296
0a8c73fe-b5b6-42e4-9894-4e79ca77b892
amanlajpal/our_first_flutter_ap
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
7466d63a-dd0d-4989-94a8-f5461d7d6f70
Akash-1006/CSA0648--DAA
graph colouring.cpp
#include<stdio.h> int G[50][50],x[50]; void next_color(int k){ int i,j; x[k]=1; for(i=0;i<k;i++){ if(G[i][k]!=0 && x[k]==x[i]) x[k]=x[i]+1; } } int main(){ int n,e,i,j,k,l; printf("Enter no. of vertices : "); scanf("%d",&n); printf("Enter no. of edges : "); scanf("%d",&e); ...
ALGO
0.999819
3.836566
54b6311b-46ed-4f9f-a0cd-ca57fc21faae
lhy-loveworld/LeetCode
7_Tree/#235_LowestCommonAncesterBST.cpp
//#235 Lowest Common Ancestor of a Binary Search Tree //Easy //Method: Iteration / Recursion //Complexity: Time O(N); Space O(1) /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }...
ALGO
0.999996
6.49084
d26cdb69-002f-419e-b59d-6ca8229383ed
vikram-rathore1/competitive_programming
codechef/FEB17/SEAINVS/SEAINVS2.cpp
#include<bits/stdc++.h> using namespace std; int t, n, m, l1, r1, l2, r2, p[100000], s; // q is current permutation, s is number of elements in q (window size) long long perms; vector<vector<int> > options; // options available for each index in the permutation Q vector<pair<int, int> > number_sets(100000); int ...
ALGO
0.999931
4.137335
cb30eb66-b542-44ef-86e0-396977ad01a2
Saifu0/Competitive-Programming
CP/1500/arena21.cpp
#include<bits/stdc++.h> using namespace std; #define NINJA ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define fo(i,n) for(int i=0;i<n;i++) #define Fo(i,k,n) for(int i=k;i<n;i++) #define iii tuple<int,int,int> #define vi vector<int> #define ii pair<int,int> #define vii vector<ii> #define int long long #defin...
ALGO
0.999925
4.884338
5e48caa2-4f82-4d1c-955f-2769e2e562f1
2105022580/DSA-WITH-C-
revofarray1.cpp
#include<iostream> using namespace std; void printarr(int arr[],int n){ int start = 0; int end = n-1; for(int i=0;i<n;i++){ cout<<arr[i]<<","; } cout<<endl; } int main(){ int arr[]={5,4,3,9,2}; int n= sizeof(arr)/sizeof(int); int start=0,end=n-1; while(start<end){ swap (arr[start],arr[end]); start++; end-...
ALGO
0.999737
4.339834
74cf0902-30b7-4836-96b2-13fb517ed8c4
Seraj-Omar/Codeforces-Solution
376B - I.O.U..cpp
/* بسم الله الرحمن الرحيم Code by SerajOmar :) ███████ ███████ ██████ █████ ██████ ██ ██ ██ ██ ██ ██ ██ ███████ █████ ██████ ███████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███████ ███████ ██ ██ ██ ██ ████████ ...
ALGO
0.999947
3.626566
1bd91823-3b94-4bef-a6ac-cafa6a59bb06
AndPris/Algorithms_labs
src/Lab4/Ant.cpp
#include "Ant.h" Ant::Ant(Vertex *startVertex, int optimalCycleLength, int pheromoneDegree, int visibilityDegree) : optimalCycleLength(optimalCycleLength) { this->startVertex = startVertex; this->currentVertex = startVertex; this->pheromoneDegree = pheromoneDegree; this->visibilityDegree = visibilityDe...
ALGO
0.999424
3.78712
8c98f5ee-2eb4-4513-a82c-f07b251e98a6
Naoki-Hiraoka/ik_solvers2
ik_constraint2_vclip/src/VclipCollisionConstraint.cpp
#include <ik_constraint2_vclip/VclipCollisionConstraint.h> #include <iostream> #include <choreonoid_vclip/choreonoid_vclip.h> namespace ik_constraint2_vclip{ bool VclipCollisionConstraint::computeDistance(const cnoid::LinkPtr A_link, const cnoid::LinkPtr B_link, double& distance, cnoid::Vector3& direction/*B->A*/, c...
ALGO
0.997603
5.891158
2d435b36-8c75-4d2e-9ee3-052cec1d4b2a
shoutrain/LeetcodeByCPP11
src/ValidPerfectSquare.cpp
/* * ValidPerfectSquare.cpp * * Created on: Sep 23, 2016 * Author: rafael */ #include "ValidPerfectSquare.h" bool ValidPerfectSquare::isPerfectSquare(int num) { if (0 > num) { return false; } if (0 == num || 1 == num) { return true; } decltype(num) max = num / 2; if (0 == num % 2) { decltype...
ALGO
0.987548
5.288739
5748a2d8-21f8-418d-bd56-eff561aa7f63
bhavyawig/Competitive-Programming
STACK (2).CPP
#include<iostream> #include<stdlib.h> #include<conio.h> #define MAX_SIZE 5 using namespace std; int stack[MAX_SIZE]; void push(int a); int pop(); void traverse(); int is_empty1(); int top_element(); int top =-1; int p; int search1(); int main() { int element,choice; while(1) { cout<<"Stack Operations.\...
ALGO
0.998748
3.633906
c7bafc41-0c2f-4789-aa37-82feeb8743be
sivajayaraman/Interview-Preparation
pivotedBinarySearch.cpp
/* Find the Pivot Point. A Pivot Point of a Sorted,Rotated Array is the point after which the element following is smaller than the point. Now divide the Main array into two subarrays and proceed the Binary Search. NOTE: This Works only when the Array is sorted and it is Rotated.*/ #include <bits/stdc++.h> using n...
ALGO
0.999975
5.325047
a41659dd-b69b-424f-a3a1-ebf0b8ab6e94
Zeref-XXX/cpp-sheets
group-c/sheet3/part-2/6-even-odd.cpp
// 6. Write a program to check even or odd without modulus and bitwise operator. #include<iostream> #include<bits/stdc++.h> using namespace std; int main() { int number,n; cout<<"Enter the number : "; cin>>number; n=number; if((number/2)*2==n) cout<<"Even"; else cout<<"Odd"; return 0; }
ALGO
0.999548
3.698259
11e59c5e-1d84-4908-92b4-718933f80835
Shubhamprakash007/competative_coding
STL_and_preprocessing/12.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int x=4; int *p_x=&x; cout <<&x<<endl; cout <<p_x<<endl;//proved m store ho raha h address cout <<*p_x<<endl; cout <<p_x-1<<endl; *p_x=5; cout<<x<<endl; int **p_p_x=&p_x; cout<<&p_x<<endl; cout<<p_p_x<<endl; cout<<*...
TOOL
0.928172
3.126321
7b06ba94-fb2c-45bf-8530-755f8fc79527
YoungJooYoo/For_Coding_Test
Leet Code/2129. Capitalize the Title.cpp
class Solution { public: string capitalizeTitle(string title) { vector<string> words; string word; stringstream sstream(title); string result = ""; /* tokenize 공백 기준 토큰화, 문자길이에 따라 대소문자 변경 */ while(getline(sstream, word, ' ')) { if (word.size() <= 2) ...
ALGO
0.999574
6.296201
85552c5f-17eb-4a76-a497-ff8428ffd2bb
bankptrk/leetcode_exercise
0125-valid-palindrome/0125-valid-palindrome.cpp
class Solution { public: bool isPalindrome(string s) { int i=0, j=s.size()-1; while(i<=j){ if(!isalnum(s[i])){i++; continue;} if(!isalnum(s[j])){j--; continue;} if(tolower(s[i]) != tolower(s[j])) return false; i++; j--; } re...
ALGO
0.999695
6.39651
bc92fc9c-449c-4921-a665-a8e5ce3f8183
mozilla/spiderweb
toolkit/crashreporter/client/crashreporter.cpp
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ #include "crashreporter.h" #ifdef _MSC_VER // Disable exception handler warnings. # pragma warning( disable : 4530 ) #endif #include <fstream> #include <sstream> #include <memory> #include <time.h> #include <stdlib.h> #include <string.h>...
TOOL
0.903598
7.378695
bd63dd0a-e708-41a5-95b8-c9d04affd281
Adramalek/CppTestTask
example/Uniteller/Framework/Kernel/System/t0262/modules/Uniteller.Framework.Kernel.System/StringUtils.cpp
#include "StringUtils.h" #include <regex> namespace Uniteller { namespace Framework { namespace Kernel { namespace System { namespace StringUtils { /// <summary> /// /// </summary> /// <param name="s"> </param> /// <...
TOOL
0.880448
5.516582
e37fd968-de8a-4578-bc0d-0238f019bdf5
jki14/competitive-programming
2011/contest/SHO/p1002.cpp
#include<iostream> #include<sstream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<ctime> #include<climits> #include<algorithm> #include<vector> #include<string> #include<queue> #include<deque> #include<set> #include<map> using namespace std; struct TB{ int x,y; }; typedef struct TB t...
ALGO
0.999631
3.684812
2b753697-e175-4fad-ba16-211167d18234
gwcrepo/datastructure
哈希表(链地址法).cpp
#include <iostream> #define MAXSIZE 25 #define KEY 7 //ȡ࣬ѡ using namespace std; //ַֹͻ typedef struct link { int data; link* next; }hash_arr, * p_hash_arr, link, * p_link; //ݵ飬û int data_arr[MAXSIZE] = { 0 }; void input_data_arr(); p_hash_arr create_hash_arr(); p_link create_link(int data); void insert_hash...
ALGO
0.999535
4.297416
60c97d9c-f6c7-4928-a25f-bba330e9a412
ishefalichopra/CPP
378_Pattern19.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n = 5; for(int i=1;i<=n;i++){ for(int j=1;j<=i;j++){ cout<<"*"; } for(int j=(2*(n-i));j>=1;j--){ cout<<" "; } for(int j=1;j<=i;j++){ cout<<"*"; } cout<<endl; ...
ALGO
0.999943
3.553856
a83579e6-98ee-4d48-97fa-4e3e68d879bc
phyric/NELSON_PHYS401
HW02/H4B_b/Verlet.cpp
#include <fstream> #include <iostream> #include <algorithm> #include <cstdlib> #include <ctime> #include <cmath> #include <iomanip> using namespace std; // potential energy function x^4/4 double force (double var) { // negative derivative of the potential function double funx; funx =(double) -1*var*var*var; ...
ALGO
0.99978
3.402297
d137a3e2-843b-46ab-b643-ba80d566e069
Muakjwa/Depth_Foveated_Compression
opencv_contrib-4.x/modules/text/samples/segmented_word_recognition.cpp
/* * segmented_word_recognition.cpp * * A demo program on segmented word recognition. * Shows the use of the OCRHMMDecoder API with the two provided default character classifiers. * * Created on: Jul 31, 2015 * Author: Lluis Gomez i Bigorda <lgomez AT cvc.uab.es> */ #include "opencv2/text.hpp" #include "op...
TOOL
0.921054
6.348693
f990e2a5-160f-4ed4-add5-c470a579c59d
Falstring/smolderforge-core-709f33c6e865
dep/g3dlite/source/Line.cpp
/** @file Line.cpp Line class @maintainer Morgan McGuire, graphics3d.com @created 2001-06-02 @edited 2006-01-28 */ #include "G3D/Line.h" #include "G3D/Plane.h" namespace G3D { Vector3 Line::intersection(const Plane& plane) const { float d; Vector3 normal = plane.normal(); plane.getEquation(...
TOOL
0.943228
5.618376
74d5ed7f-0507-4c5f-b4f1-d6eb3ec054e4
JuanMeloSerrano/Trabajos-de-programacion
parcial3/fgfds.cpp
#include <iostream> using namespace std; int main(){ int A[5]; for(int i = 1; i<= 5 ; i++){ A[i]= i+i-1; cout<<A[i]; } return 0; }
ALGO
0.999374
3.08019
081f445b-8cf9-45fd-b523-abd6c3753be7
anu-0035/C-and-Cpp-Programming-Practice
a5.cpp
#include <iostream> #include <string> using namespace std; string solve (string p, string q) { string result = p; return result; } int main (void) { string p; cin >> p; string q; cin >> q; string ans = solve (p, q); cout << ans << endl; return 0; }
ALGO
0.999849
3.088608
ff679058-47be-47ed-be55-7c1b1bb1ee84
Jin-Myung/hacker_rank
cpp/stl/sets_stl.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <set> #include <algorithm> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int Q; cin >> Q; set<int> bag; while (Q--) { int cmd, value; ci...
ALGO
0.999613
4.47181
4187e753-ddf0-4608-8f6b-fa770e00394f
m4oughi/100DaysofCode
pureCPP/0037. Day 37/Standard Template Library Basics/037. Utilities - Pair/006. Parameterized Functor in STL Algorithm/main.cpp
#include <iostream> #include <vector> #include <algorithm> class GreaterThan { int threshold; public: GreaterThan(int t) : threshold(t) {} bool operator()(int value) const { return value > threshold; } }; int main() { std::vector<int> nums = {10, 20, 5, 30, 15}; auto it = std::find_if...
ALGO
0.99984
6.615387
600fbfbb-1e40-4388-bfbb-9a706f753d11
prateeek1/DS-Algo
Leetcode/DynamicProgramming/CountSortedVowelString.cpp
class Solution { public: int countVowelStrings(int n) { if (n == 0) return 0; // If length is zero return vector<vector<int>>dp(n + 1, vector<int>(5, -1)); return helper(n, 0, dp); // Helper function gets length , start and dp } int helper(int n, int i, vector<vector<...
ALGO
0.999985
6.725152
6994aaa6-e30a-4eb0-8592-b7d5ba957767
pdeitel/CPlusPlusHowToProgram11e
ch06/fig06_13.cpp
// fig06_13.cpp // Functional-style programming with C++20 ranges and views. #include <array> #include <format> #include <iostream> #include <numeric> #include <ranges> int main() { // lambda to display results of range operations auto showValues{ [](auto& values, const std::string& message) { std...
TOOL
0.894799
7.480781
49346255-4662-4124-b099-b00c9ee5da93
novaHardware/segmentation
CenterofBlob/single_blob.cpp
#include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include <stdio.h> #include <stdlib.h> using namespace cv; using namespace std; int main(int argc, char** argv) { // Declare Mat type images Mat src, gray,thr; //Load source image, convert it to gray ...
ALGO
0.934672
5.029251
f93c0cfe-50b5-4032-841f-a8c655cbf2e9
unKNOWN-G/Coding-Practise
DSA/Data Structures/Arrays/Array Rotation.cpp
/* 21-11-2020 02:49 Program for array rotation In this Question an array of size n will be given and a number 'k' will be given.We need to rotate the array d places Anti Clockwise Method-1 : Noob thing. Just create another arr2 of size k and store first k elements of arr1 there and then replace 0th element with...
ALGO
0.999484
4.782543
a975d58d-acea-480b-93c5-6d7c3e4efe31
Vedant285/LeetCode
2552-maximum-sum-of-distinct-subarrays-with-length-k/maximum-sum-of-distinct-subarrays-with-length-k.cpp
class Solution { public: long long maximumSubarraySum(vector<int>& nums, int k) { unordered_map<int, int> mp; long long maxi = 0; long long sum = 0; int i = 0, n = nums.size(); int j = 0; while (i < n) { mp[nums[i]]++; sum += nums[i]; ...
ALGO
0.999964
5.917822
24fdadf5-6fb0-4fae-b4f7-c0cb6bf38f12
krishnashah122/DSA-Practice
6. Arrays/3. Hard/Count-Inversions.cpp
// Count Inversions (GFG) // GFG Link : https://bit.ly/3PtLWLM // Algorithm Used : Merge Sort // Time Complexity : O(nLogn) // Space Complexity : O(n) class Solution{ public: // arr[]: Input Array // N : Size of the Array arr[] // Function to merge sort the array long long merge(long long arr[]...
ALGO
0.999946
5.6611
81b3b8b7-1184-4f24-9a09-e931094fd6ee
Adrienraynaudd/Flutter_Rendu
todo_app_sqlite_freezed/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.998692
6.76073
c920721b-b89c-4a34-8b05-5595bca2fd0a
ue007/robotic
cpp/function.cpp
#include <iostream> using namespace std; int max(int, int); void primer(); void quote(); int main() { cout << "Hello, world!" << endl; // hello world int result = max(10, 12); cout << "Max value is : " << result << endl; double balance[5] = {1000.0, 2.0, 3.4, 7.0, 50.0}; for (int i = 0; i < 5; i++) { ...
ALGO
0.935364
3.377183
c9e9408b-ff6b-4f5d-aa57-5d0f70d3831c
unclejimbo/Euclid
include/Euclid/Descriptor/src/Histogram.cpp
#include <cmath> #include <numeric> namespace Euclid { template<typename DerivedA, typename DerivedB, typename T, typename> T l1(const Eigen::ArrayBase<DerivedA>& d1, const Eigen::ArrayBase<DerivedB>& d2) { return (d1 - d2).abs().sum(); } template<typename DerivedA, typename DerivedB, typename T, typename> T l2(...
ALGO
0.995596
6.856339
0993457d-1e0c-4a48-9d91-6e82b2bc0b85
TrueStar02/Practice
S2-C++ Practice/Unit 1~6/20-filestruct/filestruct.cpp
#include<iostream> #include<fstream> using namespace std; struct Detail { string name; int money; }; int main(void) { ifstream fin; ofstream fout; fin.open("filestruct.in"); fout.open("filestruct.out"); int n,x; fin>>n; Detail people[n]; for(x=0;x<n;x++) { fin.get(); getline(fin,people[x].name); fin>>peopl...
ALGO
0.874511
3.421002
26538ad0-ecf1-45c8-90a7-16f70f70e3c5
Avhad-Shashwat/Standard-Problems
Searching/CountNumberOfOccurrence(Efficient).cpp
#include<bits/stdc++.h> using namespace std; int first(int arr[], int k, int n) { int s = 0, e = n - 1; while (s <= e) { int mid = (s + e) / 2; if (arr[mid] > k) { e = mid - 1; } else if (arr[mid] < k) { s = mid + 1; } ...
ALGO
0.999992
5.364589
2d8fdec7-2b60-4585-b67e-ae828ffea6bf
Sri-dhar/test
codes_DSA/CodeHelp-DSA-Busted-Series-main/Lecture010 Solving LeetCode Arrays/sort01.cpp
#include<iostream> using namespace std; void printArray(int arr[], int n) { for(int i=0; i<n; i++) { cout << arr[i] << " "; } cout << endl; } void sortOne(int arr[], int n) { int left = 0, right = n-1; while(left < right) { while(arr[left] == 0 && left < right ) { l...
ALGO
0.999978
5.104408
c8c3cfc1-4e72-4daa-93c8-b529d6ff056e
ishandutta2007/codeforces
fedoseev.timofey/normal/1621/G.cpp
#include <iostream> #include <string> #include <vector> #include <queue> #include <deque> #include <stack> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <cstring> #include <cmath> #include <cstdlib> #include <algorithm> #include <random> #include <iomanip> #include <functional...
ALGO
0.999967
5.014083
3487aaa5-16b0-44f3-8926-b9c0afa9d513
thinhcp123/Competitive_Programming_Resources
atcode/ABC043/A_Children_and_Candies_ABC_Edit.cpp
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; using vi = vector<int>; void solve() { int n, res = 0; cin >> n; for (int i = 1; i <= n; i++) { res += i; } cout << res; } int main() { ios::sync_with_stdio(false); cin.tie(0); solve();...
ALGO
0.999694
4.817555
53236cea-7134-4cf0-8ce5-57b71613c7f6
Rishav78/C_Plus_Plus
place name in brackets/main.cpp
#include <iostream> #include<fstream> #include<string> #include<conio.h> #include<cstring> using namespace std; int main() { ifstream in; ofstream out; out.open("out.txt"); in.open("in.txt"); char ch; string ob; while(1) { ch=in.get(); if(ch==EOF) { b...
ALGO
0.991002
3.311319
1cf3425d-4bbc-481d-a360-c09d7e57480b
razaOnGit/DSA-LB
Graph/BridgeInAGraph.CPP
#include<unordered_map> #include<list> void dfs(int node, int parent, unordered_map<int,bool> &vis, vector<int> &disc, vector<int> &low, int &timer,unordered_map<int, list<int> > &adj , vector<vector<int>> &result) { vis[node] = true; low[node] = disc[node] = timer++; for(auto neighbo...
ALGO
0.99993
5.270121
e02ce3c0-dbc1-448d-80e2-ceea0810945b
viegoz/abpweek12
tugas11viego/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.998326
6.76775
04e8e6c8-5f53-4b48-8b67-c45ede28bf45
pedrosoutinho/cp-dump
1213G.cpp
#include "lib/template.hpp" #include "lib/unionfind.hpp" void solve(int tc) { defi(n, q); V<array<int, 3>> E; rep(i, n - 1) { defi(u, v, w); E.pb({w, u, v}); } sort(all(E)); UnionFind uf(n + 2); const int MAXW = 2e5 + 9; vi dp(MAXW); for (auto [w, u, v] : E) { ...
ALGO
0.999926
5.00349
e24ba414-bb89-4924-9484-07e61198e912
benny5555/leetcode-problems
1162.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int maxDistance(vector<vector<int>>& grid) { int m = grid.size(), n = grid[0].size(); queue<pair<int, int>> que; for (int i = 0; i < m; ++i) { for (int j = 0; j < n; ++j) { if (grid[i][j]) { que.push(make_pair(...
ALGO
0.999623
5.53939
66e19826-842e-4e2c-8a3d-2ab0869715ec
xdcsystems/wxFortress
src/Common/Tools.cpp
// For compilers that support precompilation, includes "wx/wx.h". #include <wx/wxprec.h> // for all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWidgets headers) #ifndef WX_PRECOMP #include <wx/wx.h> #endif #include <map> #include <wx/std...
TOOL
0.896929
6.06805
45ee5057-4170-497e-8058-715e2f907d4a
jp41011/CSci41
lab7/sorts.cpp
// Implement Merge Sort and Quick Sort #include <vector> #include <iostream> #include <stdlib.h> // for rand() using namespace std; /*function xchg - takes in 2 references to short integers and will swap the values. */ void xchg(short& a, short & b) { short temp = a; a = b; b = temp; return; } /******************...
ALGO
0.999892
4.816286
fb43130c-d6a2-46f8-a232-d4bf315dcb20
ZERRY-000/2110327-ALGORITHM-DESIGN
OneTwoApart/0.cpp
#include <iostream> #include <vector> #include <algorithm> int main(){ int n; std::cin >> n; std::vector<int> dp0(n + 1), dp1n2(n + 1); if(n == 1){std::cout << 3 << "\n"; return 0;} if(n == 2){std::cout << 7 << "\n"; return 0;} if(n == 3){std::cout << 15 << "\n"; return 0;} dp0[0] = 1; dp1...
ALGO
0.999975
4.27313