uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
c1f55108-e96b-46e3-8635-aa25f46502f6
Narasimha200/C-Practice-Problems
linkedListStructure.cpp
#include<iostream> using namespace std; int main(){ int arr[]={1,2,3,4}; for(int i = 0; i< 3; i++){ cout<<arr[i]<<"->"; } }
ALGO
0.986051
3.082025
5058409f-ee73-495f-ab07-87ce9f2dadca
Tribushkov/algorithms-and-data-structures
2_5/src/ads12.cpp
#include <iostream> #include <cstdio> #include <list> void Heapify(std::list<int> **a, size_t size, size_t i) { size_t left = 2 * i + 1; size_t right = 2 * i + 2; size_t min = i; if (left < size && a[left]->front() < a[i]->front()) { min = left; } if (right < size && a[right]->front() < ...
ALGO
0.999958
3.46721
a42c8091-ee73-48cd-9147-82d36660d2ea
AljonViray/CPP_Algorithms_Coursework
hw8/code/kruskals.cpp
// Code by Aljon Viray (86285526) // ICS 46 - Homework #8 - kruskals.cpp // Kruskal's Algorithm #include <iostream> #include <fstream> #include <string> #include <sstream> #include <vector> #include <queue> using namespace std; ///////////////////// Classes ///////////////////// class Edge { public: int src; ...
ALGO
0.999778
5.101277
3af626e9-fded-42f4-9f08-97aafdd880ee
surya9770/media.html
C++PROGRAMS/IFELSEIF.cpp
//A PROGRAM FIR FINDING THE MAXIMUM NUMBERAMING 3 THREE #include<iostream> using namespace std; int main() { int a , b,c; cin>>a>>b>>c; if(a>b){ if(a>c){ cout<<a<<endl; } else{ cout<<c<<endl; } } else{ if(b>c) { ...
ALGO
0.999152
3.940521
1a72a6cb-cbc5-4efa-ad84-c7daa36874be
eh2ll/algorithm
30-39/bj1339.cpp
#include <bits/stdc++.h> using namespace std; int N, idx; int mp[30], res; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> N; for(int i = 0; i < N; i += 1){ string s; cin >> s; for(int j = s.size() - 1, k = 1; j >= 0; j -= 1, k *= 10){ if(mp[s[j] - 'A'] == 0) idx ...
ALGO
0.999618
4.211617
3c88d395-7ca6-4883-a910-a144c9719861
qiaozishun4/CSP2024_BJ
BJ-Senior/answers/BJ-S01657/color/color.cpp
#include<iostream> #include<cstdio> #include<vector> #include<cstring> using namespace std; const int sz = 300000; #define lf (x<<1) #define rt (x<<1|1) #define mid ((l+r)>>1) int pos[200001],t[800001]; int x[200001],a[200001],lst[1000001],val[800001]; vector<int> v[800001]; inline void init(int x,int l,int r) { if...
ALGO
0.999727
3.641143
9759210c-7b34-4b01-81de-cb5a3678dd99
zoumson/Challenge
Mathematics/Bracket Sequences I.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9+7; ll N, numerator, denominator; ll fastpow(ll a, ll b){ ll res = 1; while(b > 0){ if(b&1) res = (res * a) % MOD; a = (a * a) % MOD; b >>= 1; } return res; } ll inverse(ll a){ ...
ALGO
0.999988
4.981837
cb76340f-c3ec-4aec-8f8a-d57f84dffb16
hawslc/spin-up
src/main.cpp
/*----------------------------------------------------------------------------*/ /* */ /* Module: main.cpp */ /* Author: VEX ...
TOOL
0.860045
4.495199
19d929f1-bc9f-4a47-9994-c4c0b3410601
manasvi83/Leetcode
Second Largest - GFG/second-largest.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: // Function returns the second // largest elements int print2largest(int arr[], int n) { int max,max2,flag=0; max=INT_MIN; for (int i=0;i<n;i++) ...
ALGO
0.999662
5.55464
370be1d5-3b03-4441-b9b2-1a46fd9b4df3
ShreyasV7/Leetcode-Problems
869-reordered-power-of-2/869-reordered-power-of-2.cpp
class Solution { public: bool reorderedPowerOf2(int n) { vector<int>freq1(31,0) ; while(n>0){ // if(n%10!=0){ int m = n % 10 ; freq1[m]++ ; // } n=n/10 ; } for(int bit = 0 ; bit < 31 ; bit++){ ...
ALGO
0.998464
5.64769
52c809f0-b63f-4be2-b9f7-ff1ac411cd28
RiyaRanka/Cpp-Programs
vector-sort.cpp
// Problem: Enter values of vector by user and sort the vector in ascending order. #include <iostream> #include <vector> #include <algorithm> using namespace std; int main () { int num, size; cout << "Enter size of vector: "; cin >> size; if (size <= 0) { cout << "Enter valid size of vector!"; ...
ALGO
0.999607
4.658795
b02795ca-f556-4d36-9ba0-39a913233157
Suraj-2003/LB_Assignments
Assignment No35/Program3.cpp
#include<iostream> using namespace std; template <class T> int SearchFirst(T *Arr, int iSize, T no) { int i = 0; for(i = 0; i < iSize; i++) { if(Arr[i] == no) { break; } } if(i == iSize) { return -1; } else { retur...
ALGO
0.999772
4.215198
59439d5f-f5dc-4b81-848e-ad5d2c724c00
yuforest/contests
abc_222/d/main.cpp
// ここは競プロではサボりがちです #include <bits/stdc++.h> using namespace std; // デバッグ用マクロです。詳しくは https://naskya.net/post/0002/ #ifdef LOCAL #include <debug_print.hpp> #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast<void>(0)) #endif // 節操ないですが、競プロでは便利です。 using ll = long ...
ALGO
0.999858
4.887747
93dc4820-ab9a-4bcb-a9fb-9f343a0a44a1
sharmakavya7/Leetcode_solutions
0121-best-time-to-buy-and-sell-stock/0121-best-time-to-buy-and-sell-stock.cpp
class Solution { public: int maxProfit(vector<int>& prices) { int minPrice = prices[0]; int maxProfit = 0; for(int i = 1; i<prices.size(); i++) { minPrice = min(minPrice, prices[i]); maxProfit = max(maxProfit, prices[i] - minPrice); } return maxProfit;...
ALGO
0.999714
6.278639
00d4a171-2780-43c8-a900-057f0c29b1cc
sigma04/cs_106-b
assign3.1/assign3.1-starter/merge.cpp
/* * TODO: remove and replace this file header comment * You will edit and turn in this file. * Remove starter comments and add your own * comments on each function and on complex code sections. */ #include <iostream> // for cout, endl #include "queue.h" #include "testing/SimpleTest.h" using namespace std; /* ...
TEST
0.891922
5.678623
8039c93a-2788-4d10-9c12-bf74c36a7803
WildChildx/hackerrank-Solutions
30daysOfCode/classesVsInstance.cpp
#include <iostream> using namespace std; class Person { public: int age; Person(int initialAge); void amIOld(); void yearPasses(); }; Person::Person(int initialAge) { // Add some more code to run some checks on initialAge if (initialAge < 0) { cout << "Age is not valid, setting age...
ALGO
0.998914
6.047348
8f72af19-9538-412f-8473-3538790568d4
benjaminhuanghuang/ben-leetcode
0676_Implement_Magic_Dictionary/solution.cpp
/* 676. Implement Magic Dictionary Level: Medium https://leetcode.com/problems/implement-magic-dictionary */ #include <iostream> #include <vector> #include <string> #include <stack> #include <queue> #include <unordered_map> #include <unordered_set> #include <numeric> #include <algorithm> #include "common/ListNode.h"...
ALGO
0.999316
6.13572
71f5120c-0838-4947-b2ed-6436f1be7b69
wujiewujie/rl_klee
lib/Solver/QueryLoggingSolver.cpp
#include "klee/Config/config.h" #include "klee/Internal/Support/ErrorHandling.h" #include "klee/Internal/Support/FileHandling.h" #include "klee/Internal/System/Time.h" #include "klee/OptionCategories.h" #include "klee/Statistics.h" namespace { llvm::cl::opt<bool> DumpPartialQueryiesEarly( "log-partial-queries-earl...
TOOL
0.909222
7.821592
cbf4a07c-d7d5-4568-b2d0-0451af76523f
raincross7/code-similarity
codes/train_code/problem151/problem151_247.cpp
#include <bits/stdc++.h> using namespace std; const unsigned int MOD = 1000000007; #define ll long long #define PI 3.1416 string day [] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"}; vector <string> v; void dfs (string str, string t = "", int cnt = 0) { if (cnt == 2) { v.push_back (t); return;...
ALGO
0.999795
4.052454
69b41934-9c0f-4023-8bcf-8f87e5c42b99
joker-eph/llvm-unified
libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.symmetric.difference/set_symmetric_difference_comp.pass.cpp
// <algorithm> // template<InputIterator InIter1, InputIterator InIter2, typename OutIter, // CopyConstructible Compare> // requires OutputIterator<OutIter, InIter1::reference> // && OutputIterator<OutIter, InIter2::reference> // && Predicate<Compare, InIter1::value_type, InIter2::value_type...
TEST
0.889147
6.472109
2f23746e-485c-474c-8799-28e07dbc1297
Raghu-938/Data-Structures-programs
Data Structures/Loops And Patterns/InvertedPyramid pattern.cpp
#include <iostream> using namespace std; int main() { int n; cin>>n; for(int i=1;i<=n;i++){ for(int j=n-i;j>=1;j--){ cout<<" "; } for(int k=1;k<=(2*i)-1;k++){ cout<<"*"; } cout<<endl; } return 0; }
ALGO
0.999755
3.74118
c0560404-f79b-4a3b-8de6-a4b73b187308
Bigcheese/llvm-test-suite
MultiSource/Benchmarks/Prolangs-C++/primes/primes.cpp
// From Ravi Sethi's book on Programming Languages. #include <stdio.h> class item { public: item *source; item(item *src) {source = src;} virtual int out() {return 0;} }; class counter : public item { int value; public: int out() {return value++;} counter(int v) : item(0) {value = v;} }; class sieve : public ite...
ALGO
0.99808
4.728747
a1a49fdf-a20f-43bf-9504-f95702bd8892
i-manish-3/DSA-SUPREME
Love Babbar Sheet/reverseLL_in_group_k.cpp
#include<bits/stdc++.h> using namespace std; struct node { int data; struct node* next; node(int x){ data = x; next = NULL; } }; /* Function to print linked list */ void printList(struct node *node) { while (node != NULL) { printf("%d ", node->data); n...
ALGO
0.999949
4.56509
a48483a8-eaac-4214-88aa-e828d1954b35
zzzl-523/Univ
2019_CreativeSoftwareDesign/4-2-1/print_people.cpp
#include<iostream> using namespace std; typedef struct Person { char name[10]; int age; }person; int main() { int N; cin >> N; person* p=new person[N]; for (int i = 0; i < N; i++) { cin >> p[i].name >> p[i].age; } for (int i = 0; i < N; i++) { cout << "Name:" << p[i].name << ", Age:" << p[i].age<<endl; ...
ALGO
0.957756
4.008366
97cf8ece-2514-4bfa-952f-86cd597c7e18
SoumyabrataBanik/OOPS-with-C-
1. Recap Exercises/Exercise7.cpp
# include <bits/stdc++.h> # include <vector> # include <string> using namespace std; void print(int [], int); int *apply_all(int [], int, int [], int); int main () { const size_t array1_size {5}; const size_t array2_size {3}; int array1[] {1, 2, 3, 4, 5}; int array2[] {10, 20, 30}; cout << "\...
ALGO
0.999777
4.095538
1b72be6c-d50b-4718-8ed3-795a0e3cb408
CallMeTwitch/CSES
CountingRooms.cpp
#include <iostream> #include <string> using namespace std; char grid[1001][1001]; void DFS(int q, int w) { grid[q][w] = '#'; if (grid[q + 1][w] == '.') DFS(q + 1, w); if (grid[q - 1][w] == '.') DFS(q - 1, w); if (grid[q][w + 1] == '.') DFS(q, w + 1); if (grid[q][w - 1] == '.') DFS(q, w - 1); } ...
ALGO
0.99891
4.044012
99783ffb-e8bc-4dd3-9d76-418a990ea724
Fu-jingqi/Fu-jingqi
lanqiaobei/2019/C.cpp
#include<bits/stdc++.h> using namespace std; int check(int x){ int k = x ; while(k){ if(k % 10 == 2 || k % 10 == 4) return 0; k /= 10 ; } return 1 ; } int main() { int cnt = 0; for(int i = 1 ; i < 2019 ; i ++){ for(int j = i + 1 ; j < 2019 ; j ++){ int k = 2019 - i - j ; if(k != i && k != j && k > i &...
ALGO
0.999809
4.132618
3bcc243d-38bf-4d61-b037-5055f248b672
solareenlo/atcoder
05_AtCoder-Beginner-Contest/abc026/C/C_001.cpp
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<vector<int> > sub(n); REP(i, n - 1) { int tmp; cin >> tmp; sub[tmp - 1].push_back(i + 1); } ...
ALGO
0.999112
3.615813
728765a2-598d-4d13-a7aa-4ab962cfadeb
MKG0007/DSA_Practice_Questions
3307-find-the-k-th-character-in-string-game-ii/3307-find-the-k-th-character-in-string-game-ii.cpp
class Solution { public: char kthCharacter(long long k, vector<int>& operations) { int shift = 0; vector<long long> lengths; long long len = 1; for (int op : operations) { len *= 2; lengths.push_back(len); if (len >= k) break; ...
ALGO
0.999917
5.956769
79d0a782-4da7-4791-a032-809cfaea6c1d
Vivek1340/C-plus-plus
Backtracking/N-queen-all_ways.cpp
#include<iostream> using namespace std; bool canPlace(int board[][20],int n,int x,int y){ //column for(int k=0;k<x;k++){ if(board[k][y] == 1){ return false; } } //left diagonal int i = x; int j = y; while(i>=0 and j>=0){ if(board[i][j] == 1){ ...
ALGO
0.999882
5.734687
167ead3b-e68b-4b71-9dc4-466bb312af87
Anshtripathi079/Problem-solving
Hackerrank/beautiful_days_at_the_movies.cpp
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); /* * Complete the 'beautifulDays' function below. * * The function is expected to return an INTEGER. * The function accepts following parameters: * 1. INTEGER i * 2....
ALGO
0.999925
4.4782
26e51ca6-44ad-470d-87c5-3967ee2bd5ab
keshavvijay092/POTD_LeetCode-GFG
28.03.2024/GFG.cpp
class Solution { public: int dijkstra(int n, vector<pair<int, int>> adj[], int k, int src) { priority_queue<int> q; q.push(src); // Initializing a vector to store the minimum distance from the source vector<int> dist(n, INT_MAX); dist[src] = 0; while (!q.empty()) ...
ALGO
0.999928
5.892302
9adea0a5-88ea-4ea6-a3b5-bf567092b984
MamoonaIlyas/Programing_Fundamental
FindFactorial.cpp
//Q:Write a program that get a number from user and find factorial up to its ? //Recursive function #include<iostream> using namespace std; int factorial(int); int main() { int number; int fact; cout<<"Please enter a positive integer "<<endl; cin>>number; if(number<0) cout<<"This is not a positive integer "<...
ALGO
0.999831
4.403311
95f67e3c-65ea-4977-970b-59d2fe8141b4
sherenlim/algo22
ppt3/praktik3.cpp
#include <iostream> using namespace std; #define tinggi 10 #define garis "---" int main(){ const double pi = 3.14; double vol,r; cout<<"program cari volume kerucut"<<endl; cout<<garis<<endl; cout<<"masukkan jarijari= "; cin>>r; vol = (pi * r * r * tinggi) / 3; cout<<"volume kerucut = "<<vol; ret...
ALGO
0.986184
4.225059
b75040fe-5306-4c89-a37c-b8b772c47614
joyjoyboy/leetcode
Simplify Path/Simplify Path.cpp
class Solution { public: string simplifyPath(string path) { std::string out; std::stack<std::string> stk; std::string element; for(unsigned int i = 0; i < path.size(); ++i){ char c = path[i]; if((c == '/') || (i == (path.size() - 1))){ ...
ALGO
0.999662
6.162863
54bebc75-e98f-4aca-aed3-8c0726c3f34a
cxhx441/cs450
sample_code_modded/win_glm_vbocube/loadobjfile.cpp
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> #include <ctype.h> #include <GL/gl.h> #include <vector> // delimiters for parsing the obj file: #define OBJDELIMS " \t" struct Vertex { float x, y, z; }; struct Normal { float nx, ny, nz; }; struct TextureCoord { float s, t, p; }; s...
TOOL
0.884176
4.501684
57980152-d40c-4a4a-8a3f-a0f3f0f69ec4
Mayank-MP05/CPP-Codes-Contests
DSA Starter/DSA02-LinearDataStructures/matchedBrackets.cpp
#include<bits/stdc++.h> using namespace std; #define fo(i,n) for(i=0;i<n;i++) #define ll long long #define deb(x) cout << #x << "=" << x << endl #define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl #define pb push_back #define mp make_pair #define F first #define S second #define all(x) x.begin(),...
ALGO
0.999615
3.491144
feb83ced-7471-470c-aca2-a01a429bfed5
dannguyenmessi1705/Cpp
DSA02027(NguoiDuLich).cpp
#include<bits/stdc++.h> using namespace std; int n,c[16][16],x[16],check[16],res=1e18,cmin=1e18,s; void Try(int i){ for(int j=2;j<=n;j++){ if(!check[j]){ check[j]=1; x[i]=j; s+=c[x[i-1]][j]; if(i==n){ if(s+c[j][1]<res){ res=s+c[j][1]; } } else if(s+(n-i+1)*cmin<res){ Try(i+1); }...
ALGO
0.999945
3.336048
747a627e-9aaf-4d9c-875e-aa95c1cfefdf
Mitesh12ehd/DSA
23. Graph Assignment/q5_leetcode_daily.cpp
#include<iostream> #include<vector> using namespace std; //leetcode 2685 //count the number of complete component //for a completely connected graph //n = number of nodes //total edges = n*(n-1) / 2 void dfs(int node,vector<vector<int>>& adj,vector<int>& visited,int& countEdges,int& countNodes){ visited[node] = ...
ALGO
0.999735
5.882472
d5ae4782-31cb-49df-9de6-a96553bee5a7
technojam/Ultimate_Algorithms_Repository
Basic Algorithms/CountingSort.cpp
// C++ code to solve couting sort (A sorting algorithm) // It works fine when you have less range of number. /* Algorithm */ // step-1 : Find the maximum value in the array; // step-2 : Create an array (count_array) of that size and put 0 in all the index; // step-3 : Store the frequencies of each distinct element of...
ALGO
0.999959
5.291022
312a8e67-401f-4a82-bc4c-2965aa18e6b1
GuiZ88/dilbert-cascade-classifier
opencv-3.4.19/samples/cpp/tutorial_code/features2D/Homography/homography_from_camera_displacement.cpp
#include <iostream> #include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> #include <opencv2/calib3d.hpp> using namespace std; using namespace cv; namespace { enum Pattern { CHESSBOARD, CIRCLES_GRID, ASYMMETRIC_CIRCLES_GRID }; void calcChessboardCorners(Size boardSize, float square...
ALGO
0.995489
4.122779
dc16b2c7-d995-4fc2-8aa6-79fa4ac0a70c
ishandutta2007/codeforces
yp155136/normal/710/C.cpp
#include <iostream> #include <stdio.h> using namespace std; const int MAX_N = 50; int a[MAX_N][MAX_N]; int main () { int n; while (scanf("%d",&n) != EOF) { int i=0,j=n/2; int tmp=0; int id=1; for (int x=0;n*n>x;x++) { a[i][j] = id++; tmp++; if (tmp==n) { i++; tmp=0; } else { ...
ALGO
0.999881
3.203115
d8023145-b3ed-43f3-9dab-21bb505eed8f
abhinandansingh22/LeetcodeProblems
1544-make-the-string-great/1544-make-the-string-great.cpp
class Solution { public: string makeGood(string s) { stack<char> st; string str = ""; for(int i =0;i<s.size();i++){ if(st.empty()) st.push(s[i]); else { char ch = st.top(); if(ch-s[i] == 32 || ch - s[i]==-32) st.pop(); else st.push...
ALGO
0.999878
5.513163
e9b079bb-a559-487e-9493-9c04b30e1619
zhenglab/HLP
Stage3/recursion/funEmbedCall.cpp
#include <iostream> #include <cmath> using namespace std; bool checkPrime(int); int main() { int a; cout<<"Please enter an integer: "<<endl; while(cin>>a) { if(checkPrime(a)) cout<<a<<" is a prime."<<endl; else cout<<a<<" is not a prime."<<endl; } return 0; } bool checkPrime(int num...
ALGO
0.999497
3.747866
b5923676-c8ba-4434-adf5-6ee54e34b508
Dr-Hong/Algorithm
jisu/Week1/10828.cpp
#include <iostream> #include <stack> #include <string> using namespace std; stack<int> st; // C++ Stack 자료구조 사용 void push() { int t; cin >> t; st.push(t); return; } int pop() { if (st.empty()) { return -1; } else { int top = st.top(); st.pop(); return top; } } int size() { return st.size(); } int ...
ALGO
0.997242
4.54117
0ca8a40d-5837-4d3f-8bbc-8d9a9878ddd4
schost/NTL-extras
code/ZZ_CRT/test/test_CRT_tbl.cpp
#include <NTL/ZZ.h> #include <NTL/vector.h> #include "magma_output.h" #include "ZZ_CRT.h" NTL_CLIENT /*------------------------------------------------------------*/ /* does a multimod */ /* check takes an extra argument, not used here */ /*-------------------...
ALGO
0.998831
3.798774
c28fa750-d766-44cb-838f-691f49b0fa7e
tanmayysain/Cpp
Codeforces/prime.cpp
#include <iostream> #include <cmath> using namespace std; // Function to check if a number is prime bool is_prime(int n) { // Check if n is less than 2 if (n < 2) return false; // Check if n is divisible by any number from 2 to sqrt(n) for (int i = 2; i <= sqrt(n); i++) { if (n % i == 0) retur...
ALGO
0.999918
4.329648
ed407ed7-cc6f-4554-9d87-45543b022682
fernandomartin04/programacion_loyola
PRIMERO/1/practica4/ej12/cabecera.cpp
#include<iostream> #include"cabecera.h" using namespace std; void leer(int matriz[][DIM], int f, int c) { int cont = 0; for (int i = 0; i < f; i++){ for(int j = 0; j < c; j++){ matriz[i][j] = cont; cont++; } } } void mostrar (int matriz[][DIM], int f, int c) { for (int i = 0; i < f; i++){ for(int j =...
ALGO
0.997612
3.229102
2b4fe8f5-259e-4049-ab61-c109848740d5
jcharbon/freebsd
contrib/llvm/utils/TableGen/OptParserEmitter.cpp
#include "llvm/TableGen/Error.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Twine.h" #include "llvm/TableGen/Record.h" #include "llvm/TableGen/TableGenBackend.h" #include <cctype> #include <cstring> #include <map> using namespace llvm; // Ordering on Info. The logic should ma...
TOOL
0.884095
7.945189
adfaa463-b379-4d22-9322-2f2915a16d7a
SkydevilK/SWEA
D2/1966.cpp
#include<stdio.h> #include<algorithm> //using sort function int T; int N; int main() { scanf("%d", &T); for (int t = 1; t <= T; ++t) { int arr[51]; scanf("%d", &N); for (int i = 0; i < N; ++i) { scanf("%d", &arr[i]); } std::sort(arr, arr+N); printf("#%d", t); for (int i = 0; i < N;...
ALGO
0.997541
3.445311
956c1ea7-653e-4f0f-b35b-c1a1d6770e1a
ishandutta2007/codeforces
endagorion/normal/1408/F.cpp
#include <bits/stdc++.h> #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define forn(i, n) for (int i = 0; i < (int)(n); ++i) #define for1(i, n) for (int i = 1; i <= (int)(n); ++i) #define...
ALGO
0.999567
3.157679
e18a6420-04d3-42c5-af38-36eb8daa0cdb
OnlineAlgorismStudy/OnAlSt
year2020/month09/day0924/Y_0924.cpp
#include <iostream> #include <math.h> using namespace std; int main() { int n[5]; for(int i=0; i<5; i++) scanf("%d", &n[i]); int sum = 0; for(int i=0; i<5; i++) sum += abs(n[i]); printf("%d\n", sum); return 0; }
ALGO
0.999572
3.431144
d4d319ad-2a69-4ee3-9293-e2b4f26da6ba
songhn233/Algorithm-Packages
luogu/problems/P5614.cpp
#include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #define ll long long using namespace std; const int N=10; int a[N],b[N],c[N]; int n,m; int main() { cin>>n>>m; ll ans=0; for(int i=1;i<=n;i++) cin>>a[i]>>b[i]>>c[i]; for(int x=1;x<=m;x++) { for(int y=1;y<=m;y++) { int temp=abs(x-a[1])...
ALGO
0.999775
3.26954
6c7967ba-8ee6-4734-af50-0860560e329b
alokverma18/C--
P-and-C-function.cpp
#include <iostream> using namespace std; int factorial(int n){ if(n==0) return 1; return n*factorial(n-1); } float combination(int n, int r){ return (float)factorial(n)/(factorial(n-r)*factorial(r)); } float permutation(int n, int r){ return (float)factorial(n)/factorial(n-r); } int main()...
ALGO
0.998044
4.111877
c83e503c-6227-4f4a-bdf1-48feac0bba98
nasa/gunns
ms-utils/math/elementary_functions/LambertW.cpp
/** @file LambertW.cpp @brief Lamber W Function implementation @copyright Copyright 2024 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved. LIBRARY DEPENDENCY: ((software/exceptions/TsOutOfBoundsException.o)) ...
ALGO
0.999996
6.661843
82e16b02-b708-421a-93cb-f7ca5263a4fa
bughunter9/DataStructuresandAlgorithms
Practice/Arrays/Linear_Binary_Search.cpp
#include <bits/stdc++.h> using namespace std; int linearSearch(int arr[],int n,int key) { for(int i=0;i<n;i++) { if(arr[i]==key) { return i+1; } } return -1; } int binarySearch(int arr[],int n,int key) { int low=arr[0]; int high=arr[n-1]; int mid; while(low < high) { mid=(low + high)/2; if(arr[...
ALGO
0.999961
5.539957
92e354ae-ce9a-4600-8ec3-de5f8c28a5db
iamdeepak199/Udemy
TrailingZeroesinN.cpp
#include<iostream> using namespace std; void fastio(bool read = false) { if(read) { #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); freopen("error.txt","w",stderr); #endif } ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); return; } int main(){ ...
ALGO
0.999904
4.06922
65533e71-3680-455c-b4ea-a2870bda5c94
mohsin0176/HandNotes-onCPlusCPlus
Arrays/11.cpp
#include<iostream> #include<bits/stdc++.h> #include<math.h> #include<limits.h> using namespace std; int main() { int i,j,tmp; int n[]={0,30,40,50,10,20}; cout<<"Before Sorting"<<endl; for (int i = 0; i <= 5; ++i) { cout<<n[i]<<endl; } n[0]=INT_MIN; for (int i = 1; i <=5; ++i) { tmp...
ALGO
0.999559
3.134193
dd55273b-19eb-4a16-862d-e309d25bca29
UKPLab/vldb2018-sherlock
ukpsummarizer-be/cplex/cpoptimizer/examples/src/cpp/sched_openshop.cpp
/* ------------------------------------------------------------ Problem Description ------------------- This problem can be described as follows: a finite set of operations has to be processed on a given set of machines. Each operation has a specific processing time during which it may not be interrupted. Operations ...
ALGO
0.999328
6.296281
25bba20f-14f5-4018-a919-0470525ae16a
shleeen/special-chainsaw
experiment.cpp
// file to use best agent from evolution, and then run simulations #include "main.h" #include <string> #include <vector> // global constants const int TRIALS = 50; const float TARGET_MIN = 0.5; const float TARGET_MAX = 1.0; // Function to plot a diachronic look at behaviour of best agent for a single target. void d...
ALGO
0.995842
5.29124
af9bbff6-ddbb-4b64-bf17-230440176f4e
andrzejjurga/Fractal_Explorer
Fractal Explorer/libraries/BOX2D/src/collision/b2_collide_polygon.cpp
#include "box2d/b2_collision.h" #include "box2d/b2_polygon_shape.h" // Find the max separation between poly1 and poly2 using edge normals from poly1. static float b2FindMaxSeparation(int32* edgeIndex, const b2PolygonShape* poly1, const b2Transform& xf1, const b2PolygonShape* poly2, const b2Transform&...
ALGO
0.999711
6.855521
d4045432-d499-49cb-bdeb-2f86cc08d892
RudolfWeeber/espresso-alt
src/tcl/metadynamics_tcl.cpp
#include "parser.hpp" #ifdef METADYNAMICS #include "metadynamics.hpp" int tclcommand_metadynamics_print_status(Tcl_Interp *interp) { char buffer[TCL_DOUBLE_SPACE]; /* metadynamics not initialized */ if(meta_pid1 == -1 || meta_pid2 == -1) { Tcl_AppendResult(interp,"{ not initialized } ", (char *)NULL); r...
TOOL
0.954889
5.728059
f916dd60-0286-4f80-8386-eefebec8cbfc
Asad-Bin/cf-ac-problems
codeforces/1937/C..cpp
// . . . Bismillahir Rahmanir Rahim . . . #include <bits/stdc++.h> using namespace std; typedef long long ll; #ifndef ONLINE_JUDGE #define dbg_out cout #define debug(...) dbg_out << "DBG )> "; __f(#__VA_ARGS__, __VA_ARGS__); template<typename T1, typename T2> ostream& operator<<(ostream& out, pair<T1, T2> pr) { out <...
ALGO
0.999902
3.546448
0d1275a0-e7e6-4b37-851c-9873320683df
raincross7/code-similarity
codes/train_code/problem500/problem500_456.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; const long double PI = (acos(-1)); const long long MOD = 1000000007; struct Edge { long long to; long long cost; }; using Graph = vector<vector<Edge>>; using P = pair<ll, ll>; const long long INF = 1LL << 60; #d...
ALGO
0.999819
3.758845
6f929db7-6ee5-4a46-9106-daeca5e1d053
G0lDenis/config-file-parser
lib/parser/parser.cpp
#include "parser.h" #include <iostream> bool omfl::Parser::valid() const { return valid_; } void omfl::Parser::SetValidity() { valid_ = true; } const param::Parameter& omfl::Parser::GetRoot() const { return data_; } omfl::Parser::Parser() : data_(param::Parameter{PARAMETER_VALUE(std::map<std::strin...
TOOL
0.961779
5.212974
61e69603-3658-49a5-b2fb-b3b54369f801
gondshailesh/cpp-programming
C++ Tutorial/p162.cpp
// program to display a pattern ======= Important ======= /* 5 4 5 3 4 5 2 3 4 5 1 2 3 4 5 */ #include<iostream> using namespace std; int main() { int n, i, j, k; cout<<"enter rows : "; cin>>n; k = n; for(i = n; i>=1; i--) { for(j = n; j<=k; j++) ...
ALGO
0.998869
4.440044
d25fa4c4-ed65-4826-b763-4e6e25b9b03d
taiZhaa/prog
lab1/lab1.cpp
#include <iostream> #include <string> using namespace std; class LinkedList { private: struct Node { string name; int amount; double price; Node* next; }; Node* head; Node* CreateNode(const string& newName, int n, double p) { return new Node{newName, n, p, null...
TOOL
0.993236
5.269265
b1b7d235-df83-443f-bc8c-384508bfc83f
Fovir-GitHub/My_Algorithm
LeetCode/169. Majority Element/majority_element.cpp
#include <algorithm> #include <vector> using namespace std; class Solution { public: int majorityElement(vector<int> & nums) { int count = 0; int candidate = 0; for (auto x : nums) { if (count == 0) candidate = x; if (x == candidate) ...
ALGO
0.999874
5.808087
3e42801c-67f0-46ee-93e2-b6401e3dc79c
MetSystem/winradius
WinRadius/src/modules/rlm_preprocess/rlm_preprocess.cpp
#include "stdafx.h" #include <freeradius-devel/ident.h> RCSID("$Id$") #include <freeradius-devel/radiusd.h> #include <freeradius-devel/modules.h> #include <freeradius-devel/rad_assert.h> #include <ctype.h> typedef struct rlm_preprocess_t { char *huntgroup_file; char *hints_file; PAIR_LIST *huntgroups; PAIR_LIS...
WEB
0.857567
4.340821
a355fe42-c848-40af-8d01-403f47c81ddf
Nickx58/Problem-Solving
Data_Structure/Linked_List/LinkedListMergePoint.cpp
#include <iostream> using namespace std; class Node { public: int data; Node *next; }; int getCount(Node *head) { Node *current = head; int count = 0; while (current != NULL) { count++; current = current->next; } return count; } int _getIntesectionNode(int d, Node *head1, Node *head2) { Nod...
ALGO
0.999911
5.374245
edd1a373-0d81-48f1-a0a6-1dc6bf9ec93e
jaxxzer/open-esc-firmware
src/example/retired/example-spwm-complementary.cpp
#include "../sine-lookup.h" #include "stm32lib-conf.h" #include <math.h> #include "arm_math.h" // open loop sine wave modulated pwm (3 phase ac) // duty and resolution/speed are set by genlookup.py (sine-lookup.h) #define RESOLUTION 300 #define RESOLUTION1 100 #define RESOLUTION2 200 Timer &timer = PHASE_OUTPUT_TIME...
TOOL
0.99365
4.672574
f616b8cd-f80c-49dd-9a50-8fda640ac434
Siddharthm10/Competitive-Coding-Repo
LeetCode/medium/kthSmallestElementInABst.cpp
/* * @lc app=leetcode id=230 lang=cpp * * [230] Kth Smallest Element in a BST */ // @lc code=start /** * 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(...
ALGO
0.99998
6.692921
b0127a81-71ec-4b5d-8933-e0ddd72bdbf0
ishandutta2007/codeforces
fop_zzz/normal/957/A.cpp
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<ctime> #include<cstdlib> #include<algorithm> #include<queue> #define For(i,j,k) for(int i=j;i<=k;++i) #define Dow(i,j,k) for(int i=k;i>=j;--i) #define ll long long #define inf 1e9 #define pb push_back #define c(x,y) ((x-1))*m+(y) using na...
ALGO
0.999987
3.083275
2238a3a5-bb9e-4874-ada1-3045591c54ab
JJuSH/ps
problem solving1/Baekjun1967.cpp
#include<iostream> #include<vector> #include<utility> #include<string.h> #include<queue> #define INF 987654321 std::vector<std::pair<int, int> > line[10001]; std::queue<std::pair<int, int> > qu; int N; bool explored[10001]; int max_dist, max_idx; void bfs(){ while(qu.size() != 0){ int cur_dist = qu.front...
ALGO
0.999764
4.093585
c1724653-119a-45c2-8f8b-e32282f6fcd9
extr3m3-subs/serenity
Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp
#include <AK/Debug.h> #include <LibCrypto/BigInt/Algorithms/UnsignedBigIntegerAlgorithms.h> #include <LibCrypto/NumberTheory/ModularFunctions.h> namespace Crypto::NumberTheory { UnsignedBigInteger Mod(UnsignedBigInteger const& a, UnsignedBigInteger const& b) { UnsignedBigInteger result; result.set_to(a); ...
ALGO
0.984554
7.239154
c9b48c42-f9b6-4840-a576-126023d9c15c
rzn0v/Data-Structures-and-Algorithms
linearStack.cpp
#include<iostream> using namespace std; class Stack{ private: int arr[5]; int top; public: Stack(){ for(int i = 0; i < 5; i++){ arr[i] = 0; } top = -1; } bool isFull(){ return top == 4; } bool isEmpty(){ return top == -1; } void pu...
ALGO
0.933819
4.714764
1b432a55-bd3e-4b08-a700-6bc0eb1b6d77
akarsh957/50-days-Coding-challange
Day3.cpp
Perfect Number class Solution { public: bool checkPerfectNumber(int num) { vector<int> arr; for(int i = 1; i<=(num/2);i++){ if(num%i==0){ arr.push_back(i); } } int sum = 0; for(int a : arr){ sum+=a; } if(sum=...
ALGO
0.999672
4.533962
a1b64daf-c45d-4578-9471-576e38e0d1af
Elitedj/codeforces_sloved
Round672/c.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define inf 0x3f3f3f3f #define INF 0x3f3f3f3f3f3f3f3f #define IO ios::sync_with_stdio(0) #define DEBUG(x) cout<<"--->"<<(x)<<endl; typedef pair<ll, ll> P; const ll mod = 998244353; const double eps = 1e-9; const double PI...
ALGO
0.999947
4.347516
c7663467-df26-452a-846a-c1bf8171bb60
sword-jin/HackerRank-Solution
C++/Introdution/5-c-tutorial-for-loop.cpp
#include <iostream> #include <map> #include <string> using namespace std; int main(int argc, char const *argv[]) { int a, b; cin >> a >> b; map<int, string> nums = { {1, "one"}, {2, "two"}, {3, "three"}, {4, "four"}, {5, "five"}, {6, "six"}, {7, "se...
ALGO
0.999904
4.548161
f0f60307-400e-4bd7-9806-9b165549ee85
nachiketkanore/CP-Snippets
trieusing2d-array.cpp
const int N = 1200005; class TRIE { private: vector<vector<int>> adj; vector<int> cnt, endNode; int nodeId; public: TRIE() { for (int i = 0; i < N; i++) { vector<int> add(3, -1); adj.push_back(add); cnt.push_back(0); endNode.push_back(0); } nodeId = 1; } void insert(...
ALGO
0.999928
4.364196
c9ba6a48-8c63-462d-a640-359e3379fd13
proofrepo/MadboxpcWOW_3.0
dep/g3dlite/source/MeshAlgAdjacency.cpp
#include "G3D/Table.h" #include "G3D/MeshAlg.h" #include "G3D/Set.h" #include "G3D/Stopwatch.h" #include "G3D/SmallArray.h" #include "G3D/AreaMemoryManager.h" namespace G3D { /** Two-level table mapping index 0 -> index 1 -> list of face indices */ class MeshEdgeTable { public: /** We expect 2 faces per edge. *...
ALGO
0.99939
7.234952
bb0e05ce-c8ba-4beb-af86-e05ed766f922
Hou-Xiaoxuan/AlgorithmCompetition
algorithm_prictice/Grap Theory/Euler path or circuit and Topsort/D-D.cpp
#include<bits/stdc++.h> using namespace std; //˵Ҫ /*Ȼԭìݣеݣ1 5 4 2 3-1 5 2 4 2 1 5 4 1 4 4 2 5 3 3 2 */ int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int T; cin>>T; const int N=200; while(T--) { int n,m; cin>>n>>m; vector<bool> vis(N+1); vect...
ALGO
0.999953
4.45657
1b9b7a0e-db32-4ad6-a51b-b81bfc377688
mr2space/DSA_2024
COURSE/lecture88/cycleDetectionInUNdirectedGraph.cpp
#include<iostream> #include <vector> #include <unordered_map> #include <list> #include <queue> using namespace std; bool isCycle(unordered_map<int, list<int>>& adj,unordered_map<int, bool>& visited, int node){ queue<int> q; q.push(node); visited[node] = true; unordered_map<int,int> parent; parent[n...
ALGO
0.999991
5.836227
9e008185-fbf1-42ac-a807-a387abd18e50
Byakko97/Competitive-programming
Estructuras/LinkCutTree.cpp
//Gracias el-rayo struct Node { Node *left, *right, *parent; bool revert; Node() : left(0), right(0), parent(0), revert(false) {} bool isRoot() { return parent == NULL || (parent->left != this && parent->right != this); } void push() { if (revert) { rever...
ALGO
0.999959
4.437901
ffc0002d-fbc6-4a43-8aae-7bd900b4c820
Jason910315/Jason_Leetcode_code
Array/238.Products of Array Except Self(Medium)/version1.cpp
#include <vector> #include <iostream> using namespace std; class Solution { public: vector<int> productExceptSelf(vector<int>& nums) { int i,n = nums.size(); vector<int> ans(n); vector<int> leftProduct(n); vector<int> rightProduct(n); leftProduct[0] = 1; for(i = 1;i ...
ALGO
0.999937
5.415878
b991a660-6466-4f77-b24d-2a5d2860a07d
husk214/stopt
test/test.cpp
#include "algorithm.h" #include "cmdline.h" #include "catalyst.hpp" using namespace stopt; using namespace Eigen; using namespace std; template <class Rerm> void set_parameters_train(Rerm &r, cmdline::parser &p) { r.set_parameters( static_cast<stopt::regularization_term>(p.get<int>("regularization")), s...
ALGO
0.983435
6.001103
c084e804-469c-4901-87a5-bb0a88d0f319
xixu-me/Some-Cpp-Files
Practical-Teaching/OPP-in-C++/12/1.cpp
// 写一个程序,将 24 小时格式时间转换为 12 小时格式。定义一个名为 TimeMistake 的异常类,处理用户输入的非法时间,比如 10:65 或者无效字符。 #include <bits/stdc++.h> using namespace std; class TimeMistake { string message; public: TimeMistake(string msg) { message = msg; } string getMessage() { return message; } }; void test() { cout << "Please enter a time in 24-h...
TOOL
0.901875
5.839008
8af3454c-b726-4f20-9eee-ee01ae6206a1
BrunoReX/palemoon
storage/src/mozStorageSQLFunctions.cpp
#include "mozilla/Util.h" #include "mozStorageSQLFunctions.h" #include "nsUnicharUtils.h" #include <algorithm> namespace mozilla { namespace storage { //////////////////////////////////////////////////////////////////////////////// //// Local Helper Functions namespace { /** * Performs the LIKE comparison of a st...
TOOL
0.908894
6.73267
1a7b1b3a-ced8-462f-82ec-93a2cae5e334
himanshu062/leetcode-problems
2232-adding-spaces-to-a-string/adding-spaces-to-a-string.cpp
class Solution { public: string addSpaces(string s, vector<int>& spaces) { const int m = spaces.size(), n = s.size(); string t(n + m, ' '); int j = 0; for (int i = 0; i < n; i++) { if (j < m && i == spaces[j]) { t[i + j] = ' '; j++; ...
ALGO
0.999706
6.432392
e26f52a3-62ef-4c1e-b377-2edc59495049
shu8Cream/atcoder-archive
atcoder.jp/dwacon6th-prelims/dwacon6th_prelims_a/Main.cpp
/** * author: shu8Cream * created: 01.01.2022 14:16:13 **/ #include <bits/stdc++.h> using namespace std; #define rep(i,n) for (int i=0; i<(n); i++) #define rrep(i,n) for (int i=(n-1); i>=0; i--) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) int((x).size()) using ll...
ALGO
0.999927
4.881563
1b518401-74fe-4b4f-b0b3-868dbbd25b06
RiyadunNabi/DSA
Graph_Series/01_Basic-Graph, DFS-BFS/007_no_of_components.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { private: void dfs(vector<vector<int>>& isConnected, vector<bool> &visited, int node) { visited[node] = true; for (int i = 0; i < isConnected.size(); ++i) { ...
ALGO
0.999696
6.838937
5d85ff1f-b554-47f5-8a97-e16560a950ac
rudra4365/Algorithmic-toolbox
week4_divide_and_conquer/6_closest_points/closest.cpp
#include <algorithm> #include <iostream> #include <sstream> #include <iomanip> #include <vector> #include <string> #include <cmath> using std::vector; using std::string; using std::pair; using std::min; double minimal_distance(vector<int> x, vector<int> y) { //write your code here return 0.; } int main() { siz...
ALGO
0.999876
3.942443
98475883-ca0f-4084-a7f0-05855bb925c4
noko206/AtCoder
abc/1-50/9/d2.cpp
// clang-format off #include <bits/stdc++.h> using namespace std; #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; #endif #define _overload3(_1,_2,_3,name,...) name #define _REP(i,n) REPI(i,0,n) #define REPI(i,a,b) for(int i=int(a);i<int(b);++i) #define REP(...) _overload3(__VA_ARGS__,R...
ALGO
0.999979
3.493246
acdbd640-f824-4165-9a47-ffa7f4d11acc
shuimuyangsha/IntroductionToAlgorithms
022/022.10.2队列 链表实现.cpp
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <malloc.h> #include<assert.h> typedef struct QNode { int nValue; struct QNode *pNext; }QNode, *PQNode; typedef struct { PQNode pHead; PQNode pTail; }LinkQueue; void Create(LinkQueue *pLink) { PQNode pTmp = (PQNode)malloc(size...
ALGO
0.999493
3.661482
c8607a8c-14e5-4147-939b-51f0ac917769
ishandutta2007/codeforces
maksim1744/normal/1081/B.cpp
/* 20.12.2018 15:36:46 */ #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector< int > a(n); map< int, int > mp; for (int i = 0; i < n; ++i) { cin >> a[i]; a[i] = n - a[i]; ++mp[a[i]]; } for (auto& item : mp) { if (item.seco...
ALGO
0.99999
3.853956
67c0c6f4-37a3-4b26-8bc1-404e1acff931
mchill/advent-of-code
2015/cpp/day4/md5.cpp
/* interface header */ #include "md5.h" /* system implementation headers */ #include <cstdio> // Constants for MD5Transform routine. #define S11 7 #define S12 12 #define S13 17 #define S14 22 #define S21 5 #define S22 9 #define S23 14 #define S24 20 #define S31 4 #define S32 11 #define S33 16 #define S34 23 #define ...
ALGO
0.999345
6.541319
7308ee90-78a8-432c-bde9-d31ac430bb34
davidfornas/pm_pipeline
pm_perception/src/sq_pose_estimation.cpp
/* * sac_pose_estimation.cpp * * Created on: 29/09/2017 * Author: dfornas */ #include <pm_tools/timing.h> #include <pm_perception/sq_pose_estimation.h> #include <pm_perception/cluster_measure.h> #include <pm_perception/symmetry.h> #include <pm_superquadrics/fit_superquadric_lm.h> #include <pm_superquadric...
ALGO
0.996959
4.872374
a6c53b94-2223-4159-962a-804b51a42128
wcysai/Calabash
XIX Open Cup named after E.V. Pankratiev. Grand Prix of SPb, Division 1/I.cpp
#pragma GCC optimize(3) #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); i++) #define Rep(i, n) for (int i = 1; i <=int(n); i++) #define range(x) begin(x), end(x) #ifdef __LOCAL_DEBUG__ #define _debug(fmt, ...) fprintf(stderr, "[%s] " fmt "\n", __func__, ##__VA_ARGS__) #else ...
ALGO
0.999911
3.758605
dd482cf5-2687-4af6-969c-773fdf3d43f9
suwitiki/suwitiki-ENGCE117-Programming
HW14/HW14.1.cpp
/* ให้เข้าโปรแกรมสุ่มตัวเลขเข้าไปใส่ในตัวแปรอาเรย์ขนาด N ช่อง โดยที่ตัวแปร N คือค่าที่ผู้ใช้กรอกเข้ามา จากนั้นให้คุณเขียนโปรแกรมเพื่อหาค่าที่มากที่สุด และค่าที่น้อยที่สุดภายในตัวแปรอาเรย์นี้ พร้อมทั้งแสดงข้อมูลทุกอย่างภายในอาเรย์ออกมา (กำหนดให้ค่าที่สุ่มมา มีช่วงข้อมูลอยู่ที่ 10-99 เท่านั้น) (กำหนดให้ก...
ALGO
0.988523
3.962611
bf9437dd-1000-42f9-bb95-e8307be87f5c
ContestCoder/POTD
july14.cpp
class twoStacks { int *arr; int size; int top1, top2; public: twoStacks(int n=100) { size = n; arr = new int[n]; top1 = -1; top2 = size; } //Function to push an integer into the stack1. void push1(int x) { top1++; arr[to...
ALGO
0.999067
4.74634