uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
6e6e60d7-a26c-4006-982f-6d41f18f4038
MAD-CRAZY-MAN/backup-control-FC1
src/lib/landing_slope/Landingslope.cpp
/* * @file landingslope.cpp * * @author Thomas Gubler <<EMAIL>> */ #include "Landingslope.hpp" #include <mathlib/mathlib.h> #include <matrix/math.hpp> void Landingslope::update(float landing_slope_angle_rad_new, float flare_relative_alt_new, float motor_lim_relative_alt_new, float H1_virt_ne...
TOOL
0.991068
5.968948
6b9e66c7-bc6a-49f8-92d7-38f15bcf06c8
aqfaridi/Competitve-Programming-Codes
Contests/practo/practice/pair.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <sstream> #include <vector> #include <iomanip> #include <cmath> #include <set> #include <map> #include <queue> #include <climits> #include <cassert> using namespace std; typedef long long LL; typedef pair<int,int> pii; #define pb ...
ALGO
0.999959
3.661189
2441ddb8-7982-465e-964f-3ebd84aa4b64
JVT3228/Sorting
Sorting/src/exchange_sort.cpp
#include "exchange_sort.h" #include <algorithm> template <typename T> void exchangeSort(T* arr, int size) { for (int i = 0; i < size - 1; ++i) { for (int j = i + 1; j < size; ++j) { if (arr[i] > arr[j]) { std::swap(arr[i], arr[j]); } } } } template void ...
ALGO
0.999602
4.697907
d3eefc1f-705a-4a27-b0db-8077e48dcfad
ryudo87/CPP
githubCPP/Standard Template Library (STL)/Algorithm/sort函数.cpp
//only list, forward_list has member function sort() class B { public: int b; B(int c): b(c){} bool operator<(const B& rhs) const { return b<rhs.b; } }; bool comp(const B& b1, const B& b2) { return b1.b<b2.b; } bool comp2(B b1, B b2) { return b1.b<b2.b; } //但sort是不支持使用类的成员函数来做比较函数的。...
TOOL
0.998888
4.599996
1bfda15c-f0df-4f77-a526-05df77971d4e
RustyStove/LabAssignments
-InputOutput-/Pokemen.cpp
#include <stdio.h> int main() { double x; double y; scanf("%d %d", &x, &y); double result = (x * 100) / y; printf("%.2f%%\n", result); return 0; }
ALGO
0.993763
3.860121
eeedeafd-3632-450d-9f99-bb31d6534ced
yohm/sim_indirect_opinion_sync
inspect_SolitaryObsGame.cpp
#include <iostream> #include <fstream> #include <chrono> #include <vector> #include <queue> #include <string> #include <nlohmann/json.hpp> #include "SolitaryObsGame.hpp" int main(int argc, char *argv[]) { std::vector<std::string> args; nlohmann::json params = nlohmann::json::object(); // -j param.json : set par...
ALGO
0.99146
5.161806
4171b64f-7133-425f-8451-30d40d2025a1
Koby1997/UF-Classes
Freshman and Sophmore year/Programming 2/Pa3.cpp
/* Name: Koby Miller UF ID: 51714009 Project 3 */ #include <iostream> #include <string> #include <vector> #include <sstream> #include <fstream> using namespace std; #include "Pa3.h" stack::stack(int size) { storage = new string[size]; for(int i = 0; i < size; i++) { storage[i] = "empty"; ...
TOOL
0.918177
3.726279
4d69c1e9-00a7-4ba7-8de9-eb9c75692837
sikuner/book-code
Practical C++ Financial Programming/FinancialCppSamples/FinancialSamples/MonteCarloIntegration.cpp
// // MonteCarloIntegration.cpp // // (c) 2015 Carlos Oliveira // This code is part of the book "Practical C++ Financial Programming" // by Carlos Oliveira, Apress, 2015. // For more information, visit http://coliveira.net #include "MonteCarloIntegration.h" #include <cmath> #include <cstdlib> #include <iostream> ...
ALGO
0.979734
7.149519
6942b7ca-5241-47c3-b128-a31729ed140c
ishandutta2007/codeforces
gary2005/normal/132/E.cpp
/** * author: gary * created: 17.05.2022 19:32:48 **/ #include<bits/stdc++.h> #define rb(a,b,c) for(int a=b;a<=c;++a) #define rl(a,b,c) for(int a=b;a>=c;--a) #define rep(a,b) for(int a=0;a<b;++a) #define LL long long #define PB push_back #define POB pop_back #define II(a,b) make_pair(a,b) #define FIR first #de...
ALGO
0.99997
3.358019
9522cd90-85f1-4878-8bc9-42951c9a4f92
OmJadhav1/c-DSA
c++/recursion/LastOccurence.cpp
#include <bits/stdc++.h> using namespace std; int lastocc(int arr[], int n, int key) { if (n == 0) { return -1; } int subindex = lastocc(arr + 1, n - 1, key); if (subindex == -1) { if (arr[0] == key) { return 0; } else { r...
ALGO
0.99991
5.892807
5cbed3ca-7afb-4697-9485-257f7c6ad07b
omidm/nimbus
applications/physbam/physbam-lib/Public_Library/PhysBAM_Fluids/PhysBAM_Incompressible/Incompressible_Flows/PROJECTION_RLE.cpp
using namespace PhysBAM; //##################################################################### // Constructor //##################################################################### template<class T_GRID> PROJECTION_RLE<T_GRID>:: PROJECTION_RLE(const T_GRID& grid_input,ARRAY<T>& V_input) :PROJECTION<T>(false),gri...
ALGO
0.999931
5.521396
028e8aea-c5cd-4a70-b938-af1c49722bab
sischei/OSE2019
day3/Exercise_day3/supplementary_material_mpi/scatter.cpp
#include <stdio.h> #include <stdlib.h> #include <mpi.h> int main(int argc, char *argv[]) { int i, rank, size, senddata[20], receivedata; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); if (size>20) { if (rank==0) printf("do not...
ALGO
0.998833
3.124198
631a5e08-6730-49c3-8c8c-4565caa4f8bb
meherun05/Basic-Data-Structures
DS/Module-13/stack_implement_array.cpp
#include <bits/stdc++.h> using namespace std; class myStack{ vector<int> v; public: void push(int val){ v.push_back(val); } void pop(){ v.pop_back(); } int top(){ return v.back(); } int size(){ re...
ALGO
0.945979
4.509164
372fc8c5-4b2f-42e9-a5d9-8c9c9d38e046
ishandutta2007/codeforces
radewoosh/normal/730/L.cpp
#include <bits/stdc++.h> #define debug(a) using namespace std; using ll = long long int; constexpr int mod = 1000 * 1000 * 1000 + 7; ll Add(ll a, ll b) { return (a + b) % mod; } ll Mul(ll a, ll b) { return (a * b) % mod; } ll pot10[1000 * 1000 + 5]; char buf[1000 * 1000 + 5]; int position = 1; char Read() { r...
ALGO
0.999846
4.343133
96ec8c80-304b-4bb8-84c9-3d13b6fadcaf
zhangchunbao515/leetcode
leetcode-02/400. Nth Digit/s1.cpp
// OJ: https://leetcode.com/problems/nth-digit/ // Author: github.com/lzl124631x // Time: O(lgN) // Space: O(1) class Solution { public: int findNthDigit(int n) { int k, r, len = 1; long long total = 0, p = 1; while (n > total + p * 9 * len) { total += p * 9 * len; p ...
ALGO
0.999591
6.746344
29815bc8-d7e5-4f1d-bb7b-1ac2f5ddc6e5
minukk/Algo
PSALGO/PS/remainder_10430.cpp
#include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int A, B, C; cin >> A >> B >> C; cout << (A+B)%C << "\n"; cout << ((A%C) + (B%C))%C << "\n"; cout << (A*B)%C << "\n"; cout << ((A%C) * (B%C))%C << "\n"; }
ALGO
0.999872
3.823024
a2fb18ae-73ce-4cc3-8eda-447f0e599e86
humanoid1708/LabAssignments
4thSem/CN/HammingCode.cpp
#include <iostream> #include <cmath> #include <vector> using namespace std; void HammingCode(string input) { int m = input.length(); int r = 0; while (pow(2, r) < m + r + 1) { r++; } cout << "No. of bits in input: " << m << endl; cout << "No. of redundant bits to be added: " << r <...
ALGO
0.999998
6.585206
f9a3fcc0-1cac-40dc-9c57-6f1828754a27
kipchumba/CSCI-340-Assignments
hw6/src/hw6.cpp
#include <string> #include <fstream> #include <vector> #include <iostream> #include <time.h> #include <iomanip> #include <algorithm> #include "heapsort.h" #include "scramble.h" std::string toLower (const std::string&); using namespace std; struct greaterThan { bool operator() (const string& right, const string& ...
ALGO
0.990504
4.137119
247a4560-af2f-4b3c-8cc7-be0deda0ed82
marcinsokolowski/transientlib
src/ccd_datares.cpp
#include "ccd_datares.h" #include "ccd_dataconst.h" #include "ccd_globals.h" #include <tab2Ddesc.h> #include <math.h> #include <ccd_astro_const.h> #include <mathdefs.h> #include <mymacros.h> #include <myutil.h> #include <mathfunc.h> #include <cfg.h> #include "ccd_astro.h" #include "ccd_procstate.h" // TABLES ENUMERAT...
ALGO
0.994263
4.165396
782a2286-fea7-4786-a3e7-9ad4408a6c9c
nao-kobayashi/playground_c-
ModernC++/3or5divide/main.cpp
#include <iostream> using namespace std; int main() { unsigned int limit = 0; cout << "Upper limit:"; cin >> limit; unsigned long long sum = 0; for (unsigned int i = 3; i <= limit; i++) { if (i % 3 == 0 || i % 5 == 0) { sum += i; } } cout << "sum=" << sum <<...
ALGO
0.999734
4.17975
38fe20db-b80f-4208-a050-85ca4e46fea3
ankitraj900/foodie
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.998733
6.76775
10ea1fea-2e12-4ef5-96f9-31c6ee4e55e0
Sigaxe/Tutti-per-uni
Esercizi/Esercizi Fondamenti di Programmazione/Svolti parte A/6 compito 2_9_14/compito 2_9_14.cpp
#include <iostream> #include <cstring> using namespace std; struct Elem { char nome[100]; //dichiarazione della struct int cont; }; void modifica (Elem A[], int& m, char s[]){ // bool v=false; for (int i=0; i<m; i++){ if (strcmp(A[i].nome, s)==0){ //controllo se...
ALGO
0.992365
3.859468
f0071ec4-e84f-419d-9c4b-a33291d4d3c5
crinard/netblocks-desert
DESERT_Addons/security/uwflooding_sec/uwflooding-sec.cpp
/** * @file uwflooding-sec.cpp * @author Giovanni Toso, Alberto Signori * @version 1.0.0 * * \brief Implements UwFlooding class. * */ #include "uwflooding-sec.h" #include "uwsecurity_clmsg.h" #include <clmsg-discovery.h> #include "uwstats-utilities.h" #include "uwphysical.h" extern packet_t PT_UWFLOODING; i...
TOOL
0.85648
6.363798
08e4906b-2a4c-4e35-a83d-5ec79b93c75a
mikematty/sp_dynamics
simulation_src/Random_numbers/randomc/sfmt.cpp
#include "sfmt.h" // Class definition and other declarations void CRandomSFMT::RandomInit(int seed) { // Re-seed uint32_t i; // Loop counter uint32_t y = seed; // Temporary uint32_t statesize = SFMT_N*4; // Size of state vector if (UseMo...
ALGO
0.98315
6.183762
f12785cf-b9a7-4e45-b155-09fa095b4e01
imnooy/algorithm
BOJ/Dynamic Programming(DP)/Dynamic Programming(DP)/[1904번] 01타일.cpp
#include <bits/stdc++.h> using namespace std; long long d[1000001]; int main() { cin.tie(0); ios::sync_with_stdio(0); d[1] = 1; d[2] = 2; for (int i = 3; i <= 1000000; i++) { d[i] = (d[i - 1] + d[i - 2]) % 15746; } int n; cin >> n; cout << d[n]; return 0; }
ALGO
0.999949
4.156257
49ac987b-d564-4f9d-a417-a428ddd1c730
jamieangelm/MarchDailyCode
ForLoopsPractice0314/ForLoopsPractice0314/Main.cpp
#include <iostream> using namespace std; int main() { int biggest = 0; int num; for (int i = 0; i < 3; i++) { cout << "enter a number" << endl; cin >> num; if (num > biggest) biggest = num; } cout << "the biggest number is " << biggest << endl; }
ALGO
0.968311
3.461222
e2c95e92-e549-4897-a655-7930b683570e
Canbomm/Disciplina-PC
CodeForces/Listas/Lista de exercícios 1/g-deivis e o ano bonito.cpp
#include <bits/stdc++.h> // Esse codigo ficou muito feio kkkkkkk int main(){ int atual,bonito = -1; // ano atual, ano bonito int milhar,centena,dezena,unidade; scanf("%d",&atual); for(int i = atual+1; i < 10000; i++){ // o ano so vai ate 9999 int unidade = i%10; int dezena = (i%100-unidade)/10; ...
ALGO
0.997851
4.092658
9f84fad0-c2ef-45cd-b5fe-5f98635ebf5f
gruberjulius/Baruch_Advanced_Cpp
ZIPS/Level1 2/1.3/1.3.2/Level1_Section3_Exercise2.cpp
#include<iostream> #include<array> //Solve this problem with the template variadic function void rotate(double factor){} // Variadic function Template that takes // variable number of arguments and prints // all of them. template <typename T, typename... Types> void rotate(double factor, T var1, Types... var2) { ...
TOOL
0.940621
6.549024
ba34b0bd-67bf-40e7-88eb-73f1dbe5fab5
ArielQuinn/AIProject
Competition/solvers/enumerative/esolver-synth-lib/src/z3-4.3.1/src/smt/smt_context_inv.cpp
#include"smt_context.h" #include"ast_pp.h" #include"ast_ll_pp.h" #include"ast_smt2_pp.h" namespace smt { #ifdef Z3DEBUG bool context::is_watching_clause(literal l, clause const * cls) const { watch_list & wl = const_cast<watch_list &>(m_watches[l.index()]); return wl.find_clause(cls) != wl.end_cla...
TOOL
0.982622
6.812558
2e815874-0ad3-4b90-bf5c-7fbac01e5eeb
mlowe12/C-Language-Programming
counting_bits.cpp
#include <iostream> #include <vector> int set_bits(unsigned int n) { int counter = 0; while(n) { n = n&(n-1); ++counter; } return counter; } std::vector<int> counting_bits(int n) { std::vector<int> result; int count; for(int i = 0; i <= n; ++i) { count =...
ALGO
0.99983
6.239186
9fd3f57a-428d-4a2e-b20f-4017b74d8c88
a920604a/leetcode
C_plus/316*_RemoveDuplicateLetters.cpp
class Solution { public: string removeDuplicateLetters(string s) { // option 1 O(N) time and O(N) space stack<char> sta; vector<bool> instack(256,false); vector<int> count(256); for(char c:s) count[c]++; for(char c:s){ count...
ALGO
0.999988
6.477147
699ec809-90b1-4133-8b5a-76e902e2ce57
ishandutta2007/codeforces
bmerry/normal/480/E.cpp
#include <bits/stdc++.h> /*** TEMPLATE CODE STARTS HERE ***/ using namespace std; typedef vector<int> vi; typedef vector<string> vs; typedef long long ll; typedef complex<double> pnt; typedef pair<int, int> pii; #define RA(x) begin(x), end(x) #define FE(i, x) for (auto i = begin(x); i != end(x); ++i) #define SZ(x) ...
ALGO
0.999904
4.301581
e3f09632-54ab-4fd8-93c3-24e498cfedab
devX-shub/LeetCode
0102-binary-tree-level-order-traversal/0102-binary-tree-level-order-traversal.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.999936
6.154728
7a1f86e1-e13b-47d3-998c-f122b8f366ed
bitcoinzerox/bitcoinzerox
src/xnode-payments.cpp
#include "activexnode.h" #include "darksend.h" #include "xnode-payments.h" #include "xnode-sync.h" #include "xnodeman.h" #include "netfulfilledman.h" #include "spork.h" #include "util.h" #include "consensus/consensus.h" #include <boost/lexical_cast.hpp> /** Object for who's going to get paid on which blocks */ CXnodeP...
TOOL
0.956976
5.805805
b23c7622-f206-4783-a503-dc08eed611be
HongSon28/Training
General training/tim kiem nhi phan/Bai5.2.cpp
#include<bits/stdc++.h> using namespace std; vector <unsigned long long> nt; unsigned long long mm=1000000; bool checknt (unsigned long long a) { for (unsigned long long i=2;i<=sqrt(a);i++) { if (a%i==0) return false; } return true; } unsigned long long tim(unsigned long long n) { in...
ALGO
0.999829
3.909882
abbd18ed-0fc7-4ef0-a4cd-9be5027107b5
Abhi52811/Cpp-Java
C++/OOP/Pointers/ArraysAsFunctionArgs.cpp
/* * Arrays are alwaya passed as refrence parameters. we cannot increment and decrement here like other pointer variables. */ #include <stdio.h> int SumoFElements(int *A, int size) { int i, sum = 0; printf("SOE - size of A = %d, size of A[0] = %d\n", sizeof(A), sizeof(A[0])); for (i = 0; i < size; i+...
TOOL
0.97155
4.834558
d7e3045d-a698-4732-b41d-2b15de317342
PremThakareitm/Cpp_101_Codes
Q.29.cpp
#include <iostream> using namespace std; int reverseNumber(int num) { int reversedNumber = 0; while (num != 0) { int remainder = num % 10; reversedNumber = reversedNumber * 10 + remainder; num /= 10; } return reversedNumber; } int main() { int number; cout << "Enter a...
ALGO
0.993929
5.176517
5e548c3c-1183-4be1-8a96-9926a6cf57d4
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_7869_12.cpp
#include <bits/stdc++.h> using namespace std; long long mod = 1e9 + 7; int main() { int n, m, q, i, j, k, mat[505][505], sd[505], l[505], inv[] = {0, 1, 3, 2, 4}; string s, str; cin >> n >> m; for (i = 0; i < n; i++) { cin >> s; for (j = 0; j < m; j++) mat[i][j] = s[j] - 'a'; } int b = 0; for (i =...
ALGO
0.999991
5.080964
bb0382fb-39b1-4780-b2e2-016770b3a9e5
vikasmalik22/MPC
src/Eigen-3.3/bench/sparse_dense_product.cpp
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out //g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out // -DNOGMM -DNOMTL -DCSPARSE // -I /home/gael/Coding/LinearAlgebr...
ALGO
0.99348
4.386344
f518e167-7828-4a85-bbf6-8032ac182407
Ishita-Trivedi/DailyDSA
0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divuber-divdiv-classcompanytagscontainer-tagoccurence12-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10...
class Solution { public: int calculateMinimumHP(vector<vector<int>>& dungeon) { int m=dungeon.size(),n=dungeon[0].size(); vector<vector<int>>dp(m,vector<int>(n,-1)); dp[m-1][n-1]=max(1,1-dungeon[m-1][n-1]); for(int i=m-1;i>=0;i--){ for(int j=n-1;j>=0;j--){ ...
ALGO
0.999589
6.218957
fdeec5ae-bf9a-4bd3-8878-4acdadb8e0df
hughjazzman/cs2040c-kattis
Kattis/humancannonball.cpp
#include <iostream> #include <vector> #include <utility> #include <set> #include <cfloat> #include <cmath> #include <algorithm> using namespace std; typedef pair<int,int> ii; typedef pair<double,double> dd; typedef pair<double, int> di; typedef pair<int, ii> iii; double edist(dd lhs, dd rhs) { double dx = lhs.fi...
ALGO
0.99996
3.883602
836568de-3c02-4e03-9f67-1c2768883643
mfs6174/mfs6174-ACM
HDU-dx2012-3-1006.cpp
/* ID: mfs6174 email: <EMAIL> PROG: ti LANG: C++ */ #include<iostream> #include<fstream> #include<string> #include<sstream> #include<cstring> #include<algorithm> #include<map> #include<vector> #include<queue> #include<deque> #include<iomanip> #include<cmath> #include<set> #define sf scanf #define pf printf #define llg...
ALGO
0.999807
3.85843
bdf7b23d-c5ec-4c96-8201-4bd51ded115b
ishandutta2007/codeforces
froggyzhang/normal/1023/F.cpp
#include<bits/stdc++.h> using namespace std; #define N 500010 typedef long long ll; typedef pair<int,int> pii; vector<pii> G[N]; ll ans; class Union_Set{ public: int f[N]; void init(int n){ for(int i=1;i<=n;++i){ f[i]=i; } } inline int getf(int x){ return f[x]==x?x:f[x]=getf(f[x]); } }S; int dep[N],n,m1,m...
ALGO
0.999745
4.031234
a080405d-3fdd-4300-9f6c-16ba407673f3
pallab17/Leetcode_daily
1387-find-elements-in-a-contaminated-binary-tree/find-elements-in-a-contaminated-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999822
5.853156
736a0f6c-798e-4a41-a37b-54c3ed8e56ec
ABRAR1467/Leetcode
1038-binary-search-tree-to-greater-sum-tree/1038-binary-search-tree-to-greater-sum-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999869
5.120624
ed2cc688-e853-41ed-95ed-a791decf4e1e
pnv2003/competitive-programming
kattis/tarifa.cpp
#include <iostream> using namespace std; #define FASTIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define FILEIO freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout) int main(int argc, char const *argv[]) { FASTIO; // FILEIO; int x, n; cin >> x >> n; int val = 0; wh...
ALGO
0.999733
3.528288
cc9c4bd1-8e0d-4662-9b83-10c85ce9cf06
7sakshi7/LeetCode-Solutions
42. Trapping Rain Water.cpp
class Solution { public: int trap(vector<int>& height) { int n = height.size(); vector<int>leftMax(n),rightMax(n); leftMax[0] = height[0]; rightMax[n-1] = height[n-1]; for(int i=1;i<n;i++){ leftMax[i] = max(height[i],leftMax[i-1]); } ...
ALGO
0.999974
6.775014
440d5eda-9014-4342-9161-612945750f6a
jhasan2026/Road_To_Grandmaster
2_Data_Structure_and_Algorithm/5_BrinaryTree/10_sum_k_level.cpp
#include "iostream" #include "queue" using namespace std; struct TreeNode{ int val; TreeNode *left; TreeNode *right; TreeNode(int val){ this->val = val; this->left = NULL; this->right = NULL; } TreeNode(int val,TreeNode *left,TreeNode *right){ this->val = val; ...
ALGO
0.999958
5.387334
aa01d8bf-5057-4e99-a6f0-2e472e5b725d
FormerSama/uva-
10018 - Reverse and Add.cpp
#include <bits/stdc++.h> using namespace std; #define fastio ios::sync_with_stdio(0), cin.tie(0) #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma comment(linker, "/stack:200000000") inline unsigned long long...
ALGO
0.999493
3.742946
016a4979-1948-4049-aaf6-15b33ab11c72
squaresLab/BatFix
results/transcoder/python/references/MODULAR_EXPONENTIATION_POWER_IN_MODULAR_ARITHMETIC.cpp
#include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include <vector> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <numeric> #include <algorithm> using namespace std; int f_gold ( int x, unsigned int y, int p ) { ...
ALGO
0.999871
5.563443
85b97e7a-eabc-4bfa-9eb0-65eb6522c2c4
raincross7/code-similarity
codes/train_code/problem119/problem119_326.cpp
#include <bits/stdc++.h> #define F first #define S second #define ll long long #define pb push_back #define endl '\n' using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); string a, b; cin >> a >> b; int ans = INT_MAX; for (int i = 0; i <= (int)(a.size()) - (int)(b.size(...
ALGO
0.999982
4.100166
b760c87f-db0e-4d6c-b8d2-5c3936748923
the0s/DriverSim
HCRF2.0b/libs/shared/hCRF/src/InferenceEngine.cpp
//------------------------------------------------------------- // Hidden Conditional Random Field Library - Inference Engine // // February 2, 2006 #include "inferenceengine.h" #ifdef _OPENMP #include <omp.h> #endif //------------------------------------------------------------- // InferenceEngineBP Class //---------...
ALGO
0.997166
4.314091
8dd4890b-472d-4e8d-a4f6-2f7dd9d12bb6
Pperez4/C-plus-plus
ch3/testAverage.cpp
//---------------------------------------- // Write a program that ask's for five // test scores. The program shoul calculate // the average test score and diplay it. // The number displayed shoul be formated // in fixed point notation with a decimal // point of precision. //---------------------------------------- ...
ALGO
0.981285
6.60743
47f9b3c4-9f48-4747-bfe2-f6a7d9a73bbe
ohhnate/BestoSource
thirdparty/meshoptimizer/stripifier.cpp
#include <assert.h> #include <limits.h> #include <string.h> // This work is based on: // Francine Evans, Steven Skiena and Amitabh Varshney. Optimizing Triangle Strips for Fast Rendering. 1996 namespace meshopt { static unsigned int findStripFirst(const unsigned int buffer[][3], unsigned int buffer_size, const unsign...
ALGO
0.999017
7.616971
61854ceb-6a31-4f57-915b-72111d617e33
TranHoangDatSC/Upcoder
Study-Code/Upcoder/CTDL - Data_Structure /Ex_Book_CTDL/2.5.Ex/Lesson_3.cpp
#include <iostream> using namespace std; int binary_search(int arr[],int n,int target) { int cnt = 0; int left = 0, right = n - 1; while(left <= right) { int mid = (left + right) / 2; if(arr[mid] == target) return cnt; else if(arr[mid] < target) { ...
ALGO
0.999912
6.315954
7c5af348-c8b4-4d2c-9e55-fb26e716910b
druxorey/ucv-ayed
S02-backtracking/E09-domino-trancado.cpp
#include <iostream> // Biblioteca para entrada y salida estándar #include <string> // Biblioteca para manipulación de strings #include "../S99-libraries/dxarray.hpp" // Biblioteca personalizada para manejo de arreglos // Constante que define el tamaño del conjunto de fichas de dominó const short DOMINO_SET_SIZE = 28...
ALGO
0.998748
6.690886
95a4c867-366e-4d20-8cbf-568c02863741
JosephYSF/RU_Cpp503
Homework6/Homework6.cpp
// Name: Sifan Yuan // Time: 10/12/2019 // Course: 16:332:503, Programming Finance //Homework 6 /* Please implement the booklist assignment using classes. You can modify and reuse much of the code you wrote for Homework 4, but make sure to implement the functions as members of the class Booklist. The main func...
TOOL
0.998794
4.601408
44d2fa6f-ebc2-4edb-8cd4-3ce92a961394
lakshmank6300/Leetcode
368-largest-divisible-subset/largest-divisible-subset.cpp
class Solution { public: vector<int> largestDivisibleSubset(vector<int>& nums) { // return {}; sort(nums.begin(),nums.end()); int n=nums.size(),mx=0,tar; vector<int>res; vector<int>dp(n+1,1); vector<int>hash(n+1); for(int i=0;i<n;i++){ hash[i]=i; ...
ALGO
0.999986
4.837063
3a98e808-c865-4ade-8d5a-9121a9bd9e1f
Adi2209/DSA
0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divamazon-divdiv-classcompanytagscontainer-tagoccurence21-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-...
class Solution { public: int maxArea(vector<int>& height) { int ans = 0; int n = height.size(); int left = 0, right =n-1; while(left<=right){ int length = min(height[left],height[right]); int breadth = right-left; int area = length*breadth; ...
ALGO
0.999944
6.588691
a144ce86-909f-41ad-8cf0-8c29257f1e38
joydip007x/CompetitiveCodeArchive
URAL/1014/21582906_WA_1ms_424kB.cpp
#include<bits/stdc++.h> using namespace std ; #define ll long long #define pb push_back #define nikal_laura ios::sync_with_stdio(false); cin.tie(nullptr);cout.tie(nullptr); #define sc(c) scanf("%d",&c); ll n,x,q,t ; int main() { cin>>n; vector<ll>v,v2; v.clear();v2.clear(...
ALGO
0.999453
4.491847
4a5638dc-ef4a-49e8-8fc2-466e739eae26
shikharfearow/dsa
Linked List/Doubly.cpp
#include<iostream> using namespace std; class Node{ public: int data; Node* next; Node* prev; Node(int data){ this->data = data; this->next = NULL; this->prev = NULL; } ~Node(){ int val = this->data; if(this->next != NULL && this->prev != NULL){ ...
ALGO
0.999915
4.434475
d1f75248-2904-480d-9481-321cf12cee9b
sadgal/windage
windageLightVer/src/Algorithms/Spilltree.cpp
/* ======================================================================== * PROJECT: windage Library * ======================================================================== * This work is based on the original windage Library developed by * Woonhyuk Baek (<EMAIL> / <EMAIL>) * Woontack Woo (<EMAIL>) * U...
ALGO
0.965275
5.512727
be025db3-7523-4b30-b36f-af91416d51d0
devgoel186/SIP-Prep-CPP
RandomProblems/tilingProblem.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int tiling(int n) { if (n == 0 || n == 1) return n; return tiling(n - 1) + tiling(n - 2); } int main() { int n; cin >> n; cout << tiling(n) << endl; }
ALGO
0.999989
5.581217
5d2ff617-c909-4f7c-8155-fed32ca1e8fd
PhoenixGS/Test
Test000166.cpp
//head #include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <cmath> #include <cstdlib> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pr; const double pi = acos(-1); #define rep(i, a, n) for (int i = a; i <= n; i++) #define per(i, n, a) fo...
ALGO
0.999817
3.991871
92bfb921-9b67-4eef-8eb3-72dcb8296bf2
H-Shen/MyCodeCollection
Luogu/CF1183A.cpp
#include <bits/extc++.h> using namespace std; using ll = long long; namespace IO { template<typename T> inline void read(T &t) { int n = 0; int c = getchar(); t = 0; while (!isdigit(c)) n |= c == '-', c = getchar(); while (isdigit(c)) t = t * 10 + c - 48, c = getcha...
ALGO
0.999967
4.558906
c8fd9b7f-2b5f-4177-83f8-7965717531ae
umcann123/llvm_lowrisc
libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
// <random> // template<class RealType = double> // class piecewise_linear_distribution // template<class _URNG> result_type operator()(_URNG& g, const param_type& parm); #include <random> #include <vector> #include <iterator> #include <numeric> #include <algorithm> // for sort #include <cassert> #include <limits>...
TEST
0.991096
4.559328
8148cde8-5ee8-45da-a678-9c59ff9a48c3
AmberYen/coursera
Intro_Computer/Code/sumoffraction.cpp
#include <iostream> using namespace std; int main(){ int n; cin >> n; int sumn = 0, sumd = 1; while(n--){ int num, deno; char slash; cin >> num >> slash >> deno; sumn = sumn*deno + num*sumd; sumd = sumd*deno; } int a = sumd, b = sumn, c; while(a != 0){ c = a; a = b%a; b=c; } int gcd = b; sumd /...
ALGO
0.999827
4.411986
0dbb5528-5c95-4d4c-bf03-bbddc817120f
ZealanL/RLReorientTesting
src/Math/Math.cpp
#include "Math.h" float Math::RotMatDist(const RotMat& a, const RotMat& b) { btQuaternion qA, qB; ((btMatrix3x3)a).getRotation(qA); ((btMatrix3x3)b).getRotation(qB); return qA.angleShortestPath(qB); } float Math::ErrorToScorePercent(float error, float scale) { return (1 / (1 + error / scale)) * 100; }
TOOL
0.908779
5.300604
63c0858b-a590-4e5c-90e9-ea5b4603d717
danielsofran/UBB
A1/Semestrul 2/Grafuri/Lab/Test/main.cpp
#include <bits/stdc++.h> using namespace std; ifstream fin("input.txt"); ofstream fout("output.txt"); #define inf 0x3f3f3f3f #define NIL (-1) #define cost first #define nod second #define eq(a, b) (abs((a)-(b))<1e-6) #define patrat(a) ((a)*(a)) int n, startn, stopn; vector<vector<pair<double, int>>> G; // graful vec...
ALGO
0.99999
4.02973
24593c38-e3dd-4cfe-8e70-d7752ac6f72f
raincross7/code-similarity
codes/train_code/problem264/problem264_95.cpp
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; using namespace std; int main() { int n; cin >> n; ll a[n + 1], max[n + 1], min[n + 1]; rep(i, n + 1) cin >> a[i]; max[n] = min[n] = a[n]; for (int i = n - 1; i >= 0; i--) { max[i] = max[i + 1]...
ALGO
0.999741
3.720957
82189435-a90e-4fdb-af56-95d6e94c9605
zeroplusone/AlgorithmPractice
Leetcode/630. Course Schedule III.cpp
class Solution { public: static bool comparator(vector<int> a, vector<int> b) { return a[1]==b[1]?a[0]<b[0]:a[1]<b[1]; } int scheduleCourse(vector<vector<int>>& courses) { sort(courses.begin(), courses.end(), comparator); int currentTotalTime = 0; priority_queue<int> pq; ...
ALGO
0.999951
6.097841
563cdcac-e991-442f-a238-649af8e476e3
Youssef-Bahaa/LeetCode-Solutions
2148-minimum-number-of-moves-to-seat-everyone/minimum-number-of-moves-to-seat-everyone.cpp
class Solution { public: int minMovesToSeat(vector<int>& seats, vector<int>& students) { sort(seats.begin(),seats.end()); sort(students.begin(),students.end()); int mini = 0; for(int i = 0 ; i < seats.size() ; i++){ mini += abs(seats[i] - students[i]); } r...
ALGO
0.99995
4.975235
bb19972e-74cd-4699-8ca1-9a4c4c159852
kevinforsterch/Unicoin
src/script/sign.cpp
#include <script/sign.h> #include <key.h> #include <policy/policy.h> #include <primitives/transaction.h> #include <script/standard.h> #include <uint256.h> typedef std::vector<unsigned char> valtype; MutableTransactionSignatureCreator::MutableTransactionSignatureCreator(const CMutableTransaction* txToIn, unsigned int...
TOOL
0.913801
6.804442
4d0d0a00-e08b-47a4-bcfb-8bacd1c44756
Zhuangzicong04/my-code
一/p20.cpp
#include<iostream> #include<cstdio> using namespace std; int main() { int a,z = 1; unsigned int n; cin >> a >> n; for(int i = 0;i < n; ++ i ) { z = z * a ; } cout << z; return 0; }
ALGO
0.999851
3.385563
5149f132-1677-43e9-91b4-b5bee9c4602a
shouzafzafar/vs-codes
vs/ttn/class/cpp/dog.cpp
// #include<iostream> // using namespace std; // int main(){ // int a=0,b=1,sum=0,n=6; // for(int i=0;i<n;i++){ // cout<<a<<" "; // sum=a+b; // a=b; // b=sum; // } // cout<<sum; // return 0; // } #include<iostream> using namespace std; int main(){ int n=7; for(int i=0;i<n;i++){ for(int...
ALGO
0.999264
3.229105
e98fee33-4366-4e86-a03b-d0c2ae0b14e2
kanadkapil/CPP_Combined_Repo
Assignment, Fib.cpp
#include <iostream> using namespace std; //Print Fibonacci series int fib(int x) { if((x==1)||(x==0)) { return(x); }else { return(fib(x-1)+fib(x-2)); } } int main() { int x , i=0; cout << "Enter the number of terms of series : "; cin >> x; cout << "\nFibonnaci Series : "; while(i < x...
ALGO
0.999422
3.672059
d664df87-a503-4236-b387-da91279b5b51
stevenandrewcarter/Nineworlds
LinMaths.cpp
#include "LinMaths.h" double lm_dst(Vector p1, Vector p2) { double ReturnAnswer; double x = p2.x - p1.x; double y = p2.y - p1.y; double z = p2.z - p1.z; ReturnAnswer = sqrt((x * x) + (y * y) + (z * z)); return ReturnAnswer; } double lm_radians(double Angle) { const float PI = 3.14159265358...
ALGO
0.995442
5.869791
60226218-c51f-4a1b-a183-f89b6d471dc5
sauravgpt2/hacktoberfest36_2021
MergeSort.cpp
// C++ program for Merge Sort #include <iostream> using namespace std; // Merges two subarrays of array[]. // First subarray is arr[begin..mid] // Second subarray is arr[mid+1..end] void merge(int array[], int const left, int const mid, int const right) { auto const subArrayOne = mid - left + 1; auto const s...
ALGO
0.999986
6.058642
24a25717-a8a4-4551-92c7-a37cdfb2758f
LoiNguyennn/CompetitiveProgramming4_Solutions
UVa_OJ/12541.cpp
#include <bits/stdc++.h> using namespace std; struct Person { string name; int day, month, year; }; int LessThan(Person a, Person b) { if (a.year != b.year) return a.year > b.year; if (a.month != b.month) return a.month > b.month; return a.day > b.day; } void heapify(Person a[], int n, int id) {...
ALGO
0.999903
3.839173
efde30fb-aa82-40db-8e6f-d764bbb70a32
Hin1209/PS
IN/WEEK11/BOJ1865웜홀_TIN.cpp
#include <iostream> #include <vector> #include <algorithm> #include <utility> #include <queue> using namespace std; vector< vector< pair<int, int> > > road; vector<int> costs; int INF = int(1e9); int main(void){ int test, n, m, w; scanf("%d", &test); for(int i = 0; i < test; ++i){ scanf("%d %d %...
ALGO
0.999958
4.170218
16d6d1f6-abb2-4aa1-ab05-9beb75e97a1c
rajibdpi/leetcodes
algorithms/cpp/binaryTreeUpsideDown/binaryTreeUpsideDown.cpp
// Source : https://oj.leetcode.com/problems/binary-tree-upside-down/ // Author : Hao Chen // Date : 2014-11-17 /********************************************************************************** * Given a binary tree where all the right nodes are either leaf nodes with * a sibling (a left node that shares the sam...
ALGO
0.999999
5.76043
131d207e-6f03-4e2e-b80b-a0abda9a29d9
ashokabairwaideology/Leet-code-problem
solution/0400-0499/0405.Convert a Number to Hexadecimal/Solution.cpp
class Solution { public: string toHex(int num) { if (num == 0) return "0"; string s = ""; for (int i = 7; i >= 0; --i) { int x = (num >> (4 * i)) & 0xf; if (s.size() > 0 || x != 0) { char c = x < 10 ? (char) (x + '0') : (char) (x - 10 + 'a'); ...
ALGO
0.999299
5.73564
0487292e-fb17-41ce-bb72-b6d3a6dd10a5
htimko/ArcPIC
pic2d/src/vdf.cpp
#include <cmath> #include <cstddef> #include "pic.h" #include "mydef.h" #include "dim.h" void vel_dst_along_2D( double* fvz, double* fvr, double* fvabs, Particle pa[], size_t np, int nr, int nz, double dvt, int n_av ) { int nvall = nr*nz*Nvdst/4; int offset = Nvdst/2; // symmetric around v=0 ...
ALGO
0.993492
4.546732
c3a51b45-25ae-484c-a4f6-1f240ef01ae6
yash-patni/GFG
Difficulty: Medium/Rotate a Linked List/rotate-a-linked-list.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node* next; Node(int x) { data = x; next = NULL; } }; void printList(Node* node) { while (node != NULL) { cout << node->data << " "; node...
ALGO
0.999547
6.487305
b49634d9-915e-44e1-9242-9254c66fa8e2
mjsyam/3d-workspace
GraphicsLibrary/Slice/Slicer.cpp
#include "Slicer.h" void Slicer::FindSliceStrip(QSurfaceMesh * mesh, Vector<int> & facesIndices, const Plane& plane, StdSet<int> & cutPoints, IntSet & cutPointsTable, IntSet & cutFaces, EdgeSet & cutEdges) { // POINTS StdSet<int> cutPointsFirst; // FACES IntSet cutFacesFirst; // EDGES E...
ALGO
0.918436
4.507529
86dbe166-03a7-456c-8316-b20a9cc5b18f
JAlthea/Algorithm
Implementation/Programmers 방문 길이.cpp
#include <string> #include <vector> #include <set> using namespace std; int solution(string dirs) { int answer = 0; set<vector<int>> s; vector<int> a(4), b(4); int x = 0, y = 0; for (int i = 0; i < dirs.size(); ++i) { a[0] = x; b[2] = x; a[1] = y; b[3] = y; if (dirs[i] == 'L' && x > -5) --x; else if (dir...
ALGO
0.999764
4.328718
4d21a2d0-20e3-40ae-9972-98a3d7791dcb
Garrrruii/BOJ
Greedy/BOJ1898 Greedy.cpp
#include <cstdio> using namespace std; // ϸ տ A ΰ? // 1. A 1~n // 2. |S[i]-A[i]| < 2 int pos[50001]; int A[50001]; int main() { int N, tmp; scanf("%d", &N); for (int i = 0; i < N; ++i) scanf("%d", &tmp), pos[tmp] = i; A[pos[N]] = N; for (int i = N - 1; i; --i) { if (pos[i + 1] < pos[i]) { A[pos[i + 1...
ALGO
0.99998
3.683053
4afc28e2-446a-4b5c-9fdd-6bff629d0aaf
kris524/Cpp_sandbox
katas/string_removal.cpp
#include <string> #include <algorithm> std::string no_space(const std::string &x) { std::string copy = x; copy.erase(std::remove(copy.begin(), copy.end(), ' '), copy.end()); return copy; }
ALGO
0.97132
3.299009
3af42efe-4836-4f32-bf93-3a04e4862108
tomas-sucena/leetcode
1325-path-with-maximum-probability/1325-path-with-maximum-probability.cpp
class Solution { struct Edge { int dest; double prob; /* CONSTRUCTOR */ Edge(int dest, double prob) : dest(dest), prob(prob) {} }; public: double maxProbability(int n, vector<vector<int>>& edges, vector<double>& succProb, int start_node, int end_node) { // initializ...
ALGO
0.999979
6.622677
0bd9c5e8-1df0-4350-81b4-847a47918100
ishandutta2007/codeforces
glebshp/normal/301/B.cpp
#include <cstdio> #include <cmath> #include <cstdlib> #include <cassert> #include <ctime> #include <cstring> #include <string> #include <set> #include <map> #include <vector> #include <iostream> #include <algorithm> using namespace std; #define pb push_back #define mp make_pair #define fs first #define sc second const ...
ALGO
0.999894
3.438718
b3ca51fe-9a4e-4271-9ccb-4bd2c7ba379c
ishandutta2007/codeforces
hehezhoutxdy/normal/1494/C.cpp
#include<bits/stdc++.h> #define int long long using namespace std; inline int read(){ int s=0,w=1; char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();} while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar(); return s*w; } int a[1000003],b[1000003]; int c[1000003],d[1000003]; int A,B; int p...
ALGO
0.999967
3.98577
2d3822f4-64d7-4904-a1bf-ca10c83ef633
alexoz12v2/cuda-optix-pathtracing
extern/imgui/misc/fonts/binary_to_compressed_c.cpp
// dear imgui // (binary_to_compressed_c.cpp) // Helper tool to turn a file into a C array, if you want to embed font data in your source code. // The data is first compressed with stb_compress() to reduce source code size. // Then stored in a C array: // - Base85: ~5 bytes of source code for 4 bytes of input data. ...
TOOL
0.90671
7.095417
fa66132b-a87b-4501-8f90-432c1576636e
zeyihou/object-tracking
MOT(2)/tracker.cpp
#include "tracker.h" #define IM_NUM 50 //处理图片的张数 #define REMOTE 20 //相邻帧之前匹配的距离上限,距离超过REMOTE,则进行轨迹切断 #define TRACKLET_REMOTE 30 //相邻tracklet之前匹配的距离上限 //权重超参数 #define W_Euclidean 1 #define PI 3.1415926 #define INF 1000 //无穷大 //#define LENGTH 50 tracker::tracker() { minellipse.resize(IM_NUM); matching.resize(I...
ALGO
0.994706
3.785976
99c6ef35-c174-464b-9529-c11b16407995
Frank-Z7/openGausserver
src/gausskernel/cbb/instruments/percentile/percentile.cpp
#include "iostream" #include "postgres.h" #include "knl/knl_variable.h" #include "access/xact.h" #include "postmaster/postmaster.h" #include "utils/memutils.h" #include "utils/lsyscache.h" #include "storage/proc.h" #include "catalog/pg_database.h" #include "gssignal/gs_signal.h" #include "pgxc/pgxc.h" #include "pgxc/pg...
TOOL
0.958185
3.771637
b3a99e1f-10e6-4251-bb7f-db393c20e741
gabriel-candeia/Competitive-Programming-Solutions
Codeforces/617E.cpp
#include<bits/stdc++.h> #define block 500 #define ll long long using namespace std; struct query{ ll l, r, id; query(ll l, ll r, ll id){ this->l = l, this->r = r, this->id = id; } bool operator<(query x){ return pair<ll,ll>{l/block, r} < pair<ll,ll>{x.l/block, x.r}; } }; int mai...
ALGO
0.99999
4.257043
42973352-0165-4e7d-95c2-54ebab0b7b4a
ngng628/competitive-programming
atcoder/ABC/ABC186/C/main.cpp
/** * AtCoder Beginner Contest 186 **/ # ifndef ngng628_library # define ngng628_library # include <iostream> # include <string> # include <vector> # include <algorithm> # include <functional> # include <cmath> # include <iomanip> # include <stack> # include <queue> # include <numeric> # include <map> # include <set>...
ALGO
0.998426
4.460263
98e7ff78-6241-45db-9c0e-e1331ca82f4b
deep4nshu1228/Cp
A_Display_Size.cpp
#include <bits/stdc++.h> #define all(n) (n).begin(), (n).end() using namespace std; typedef long long int ll; int arr[10000000]; void solve(){ int n,i,c,k; while (cin >> n) { c = 0, k = 0; for (i=1; i<=n; i++) { if (n % i == 0) { arr[k] = i; ...
ALGO
0.999894
3.82433
eff4b5b1-0969-4e43-b2f4-ef5cb6c78ee1
PrajaktaKeer/Programming
A2OJ/Codeforces Div 2 A/cheap_travel.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n, m, a, b; cin>>n>>m>>a>>b; if(m * a <= b) cout<<n * a; else cout<<(n / m) * b + min((n % m) * a, b); return 0; }
ALGO
0.999392
3.652369
675e8276-0555-46e7-a000-dfe666f9f917
BilalSajid173/LeetcodeSolutions
373-find-k-pairs-with-smallest-sums/373-find-k-pairs-with-smallest-sums.cpp
class Solution { public: int min(int a, int b){ if(a<=b)return a; else return b; } vector<vector<int>> kSmallestPairs(vector<int>& nums1, vector<int>& nums2, int k) { vector<vector<int>> ans; priority_queue<pair<int,pair<int,int>>>pqmax; for(int i = 0; i<min(...
ALGO
0.999992
5.729076
1d7c2bbf-62c5-4dfb-9a55-1ed7b28b19bc
akkapakasaikiran/Competitive-Programming
New Codeforces/1362d.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vector<int> >; using vb = vector<bool>; #define pb push_back #define llmax 9223372036854775807 #define intmax 2147483647 #define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) const ll ...
ALGO
0.999984
4.132004