uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
4e2a1a6b-fce1-4897-984f-3574a56f006b
Nishikawa5/Competitive-Programming
CP4 Exercises/Chapter1/1.6AdHoc/realLife.cpp
#include <stdio.h> #include <stdlib.h> #include <iostream> #include <sstream> #include <string> #include <unordered_map> using namespace std; // chopin /* Easy, use map and print */ int main(void) { string note; unordered_map <string, string> map; map["A#"] = "Bb"; map["Bb"] = "A#"; map["C#"] = "...
ALGO
0.995977
4.884446
bd44bdc0-cc7e-473f-ad1b-86de47c935ec
PratheekB/suv
llvm/libcxx/test/libcxx/fuzzing/unique_copy.pass.cpp
// UNSUPPORTED: c++03, c++11 #include <algorithm> #include <cstddef> #include <cstdint> #include <iterator> #include <vector> #include "fuzz.h" extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) { std::vector<std::uint8_t> working(data, data + size); std::sort(working.begin(), ...
TEST
0.979335
5.963343
50f0ebff-68a8-438b-a2fc-d55d1d9a3123
imraghavagr/DSA-cpp
Binary Tree/12.buildTreeFromPreAndInOrder.cpp
//given the preorder and inorder traversal of a tree X, build this tree X. #include<iostream> #include<queue> using namespace std; class node{ public: int data; node* left; node* right; node(int d){ data = d; left = NULL; right = NULL; } ...
ALGO
0.999995
5.378574
1a3168a4-56f1-419d-ac6b-319cbf6edc78
JasirVoriya/algorithm-data-structure
天梯/2023年天梯赛第三次练习/7-5 红色警报.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> PII; #define UM unordered_map const int maxn = 5e2 + 5; bool arr[maxn][maxn], vis[maxn]; int n, m; void dfs(int x) { vis[x] = true; for (int i = 0; i < n; i++) if (!vis[i] && arr[x][i]) dfs...
ALGO
0.999941
3.9903
8ad813ef-e168-42df-83dc-61f051ce2728
strin/HeteroSampler
src/corpus.cpp
#include "corpus.h" #include "boost/algorithm/string.hpp" #include "boost/foreach.hpp" #include <map> #include <fstream> #include <iostream> #include <sstream> #include "feature.h" using namespace std; using namespace boost; namespace HeteroSampler { // implement Token. Token::Token() {} Token::Token(const stri...
TOOL
0.857623
6.02471
16a0956f-b440-4a28-a6fe-2d4bee9a95f7
shuxian12/UVA
110/11113_Continuous_Fractions.cpp
#include<iostream> #include<vector> using namespace std; string sub(string a, string b){ int n = a.length(), m = b.length(), i, j, k, carry = 0; vector<int> table(n, 0); for(i = m-1, j = 0, k = n-1; i >= 0; i--, j++, k--){ table[j] += a[k] - b[i]; // cout<<table[j]<<endl; if(table[...
ALGO
0.999492
3.8773
0043bc99-15d2-4a66-b5a3-0aab47f09f0d
thermotools/lammps_mie_fh
lib/gpu/lal_lj.cpp
/*************************************************************************** lj.cpp ------------------- W. Michael Brown (ORNL) Class for acceleration of the lj/cut pair style. ______________________________________________...
ALGO
0.978059
5.629344
65bdddf3-d6b6-4fdc-92b5-fd1bfe5cac86
yashsiwach/Leetcode-CPP
0304-range-sum-query-2d-immutable/0304-range-sum-query-2d-immutable.cpp
class NumMatrix { public: int n,m; vector<vector<int>>pref; NumMatrix(vector<vector<int>>& matrix) { n = matrix.size(); m = n>0 ? matrix[0].size() : 0; pref = vector<vector<int>>(n+1, vector<int>(m+1, 0)); for(int i=1; i<=n; i++){ for(int j=1; j<=m; j++){ ...
ALGO
0.999768
6.291884
fb2d8afd-985b-4a12-9dae-521bc85d537d
ashmin-yoon/baekjoon
14002.cpp
#include <iostream> #include <vector> using namespace std; const int MAX = 1000; int arr[MAX]; int ans = 0; int N; int preIndex[MAX]; int dp[MAX]; int ansIndex = -1; vector<int> v; int main() { cin >> N; for (int i = 0; i < N; i++) { cin >> arr[i]; } for (int i = 0; i < N; i++) { dp[i] = 1; preIndex[i...
ALGO
0.999998
4.396986
45a84acc-9943-49cf-b140-e6786c07fda6
itgimpi/ii5
DS/stek/preth2.cpp
#include <bits/stdc++.h> using namespace std; int najpreth(const vector<int>&a, int k) {// vraća poziciju najbližeg većeg prethodnika elementa a[k], if (k == 0) // tj. -1 ako a[k] nema većih prethodnika return -1; // prvi element nema prethodnika int p = k-1; // pretraga od prethodnika k-tog elementa ...
ALGO
0.999973
4.031503
2c5f4820-9eac-4535-b19a-1a4c37f4e330
sonal1201/EVERYDAY-DSA
String/captialize_consonants.cpp
// TAKE WORD(STRING) INPUT FROM USER AND CAPTIALIZE ALL THE CONSONANTS // #include <iostream> // using namespace std; // int main() // { // string str; // cin >> str; // for (int i = 0; i < str.size(); i++) // { // if (str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' || str[i] =...
ALGO
0.976736
5.271488
c86ab921-9996-4a6f-a751-5a55ec12fa90
stefano-marchese-its/its-cpp
220/Deques.cpp
// Learning C++ // Deque examples #include <iostream> #include <deque> #include <algorithm> using namespace std; #define MY_ENDL cout << endl << endl int main() { deque<int> myDeque; for (int i = 0; i < 11; ++i) { myDeque.push_back(i); } for (auto& d : myDeque) { cout << d << " ";...
ALGO
0.94115
4.962152
b3a4aa28-7158-4453-b3f9-3973b170a5fd
KanishAnand/CompetitiveCoding
CodeforcesPractice/1209D.cpp
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> using namespace std; // using namespace __gnu_pbds; #define lli long long int #define llu unsigned long long int #define fr(va, beg, end) for (lli va = beg; va < end; va++) #define pb push_back #define rt return...
ALGO
0.999957
4.10652
59796435-2be0-4e14-9624-2a2244420883
Kanishk-tiwari-045/DSA-work-files
priorheap.cpp
#include <iostream> using namespace std; class Heap{ public: int arr[100]; int size = 0; void insert(){ int val; cout<<"Enter the number: "; cin>>val; size++; int k = size; arr[k] = val; while(k > 1){ int parent = k/2; if(arr[k]...
ALGO
0.992112
4.034598
df9b10a4-7069-496a-8dee-35d186b81077
archun39/Ctudy
week10/9017.cpp
#include <iostream> #include <vector> #include <set> #include <algorithm> using namespace std; const int TEAM_SIZE = 6; // 팀의 인원 수 const int MAX = 201; // 최대 팀 번호 int N; // 참가자의 수 vector<int> ranking; // 참가자 순위 vector<int> v[MAX]; // 각 팀에 속한 참가자 순위 int total[MAX]; // 각 팀의 점수 합산 set<int> team; ...
ALGO
0.99998
6.282763
febc94ac-90a2-4d13-8c8f-1cd853aba1d1
johnalexiv/Project3
scheduler.cpp
#define ALLOWPRINTING #include "scheduler.h" Scheduler::Scheduler(std::vector<Process> processes) { initializeScheduler(processes); } Scheduler::~Scheduler() { delete _startQueue; delete _activeQueue; delete _expiredQueue; delete _ioQueue; delete _finishedQueue; delete _cpu; } void Sched...
TOOL
0.91955
4.974165
e03267ad-3986-4d91-b875-78faf0e93a0f
untuned07/CodeChef
ChefAndBirdFarm.cpp
// Codechef Problem: https://www.codechef.com/problems/BIRDFARM #include <iostream> using namespace std; int main() { // your code goes here int t, x, y, z; cin >>t; while(t--){ cin >>x >>y >>z; if (z % x ==0 && z % y == 0){ cout <<"ANY" <<endl; }else if (z % x == 0){ cout <<"CHIC...
ALGO
0.999057
5.052868
3083ea64-3f9d-4db1-8646-567d6bdfbbad
Sudhir769/LeetCode-GFG-Daily
26 September 2024/lc-/Solution.cpp
#include <bits/stdc++.h> using namespace std; class MyCalendar { public: unordered_map<int, int> um; MyCalendar() { } bool book(int x, int y) { for (auto &val : um) { int a = val.first, b = val.second; if (!(y <= a || x >= b)) { ...
ALGO
0.999807
5.288194
4d418ecf-8480-4ace-a5a9-3a672086cb4d
Bruni-Lee/Coding-test
프로그래머스/lv2/12945. 피보나치 수/피보나치 수.cpp
#include <string> #include <vector> using namespace std; long long solution(int n) { long long answer = 0; vector<int> F; F.push_back(0); F.push_back(1); if (n > 1) { for (int i =2; i <= n; i++) { F.push_back((F[i - 1] + F[i - 2]) % 1234567); } } re...
ALGO
0.999974
4.635057
776066e7-0d09-4efc-bc25-80e81288c626
jc-bao/crazyswarm2-adaptive
src/motion_capture_tracking/motion_capture_tracking/deps/librigidbodytracker/src/rigid_body_tracker.cpp
#include "librigidbodytracker/rigid_body_tracker.h" // PCL #include <pcl/point_cloud.h> #include <pcl/point_types.h> #include <pcl/common/transforms.h> #include <pcl/registration/icp.h> #include <pcl/registration/transformation_estimation_2D.h> // #include <pcl/registration/transformation_estimation_lm.h> #include <pc...
ALGO
0.941478
7.235983
0701b9bd-ba7c-4f79-8463-51be6a7fdbd1
ranak8811/Personal_Projects
C++/debug.cpp
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; int carry = 0; int sum = a + b; while (sum > 9) { carry = sum / 10; sum %= 10; } if (carry > 0) { cout << "Yes" << endl; } else { cout << "No" << endl; ...
ALGO
0.999972
3.787894
20a1f79e-42da-453a-b434-0c530d4fe896
shab0001/codeforces-practice-problems
mikshikaandcontest.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n, i, j, k, count = 0; cin >> n >> k; int a[n]; for (i = 0; i < n; i++) { cin >> a[i]; } i = 0; j = n - 1; while (i <= j) { if (a[i] <= k) { i++; count++; } else if (a[j] <= k) { j--; count++; } else { break; } }...
ALGO
0.999955
3.944286
ab4cf1ff-1403-4ad8-bebd-9ca960c8de6d
FazeelUsmani/Scaler-Academy
017 String Algorithm/reverseWordsInSentence.cpp
#include <bits/stdc++.h> using namespace std; string reverse(string s){ int n = s.size(); for (int i = 0; i < n/2; i++) swap(s[i], s[n-i-1]); return s; } int main(){ string x = "the sky is blue"; stringstream s(x); string word; string res; while (s >> word){ r...
ALGO
0.999316
4.536429
aa422972-7607-4fbb-8647-72de9957493d
markap/CPP-Playground
templates.cpp
#include <iostream> template <typename Type> Type max(Type tX, Type tY) { return (tX > tY) ? tX : tY; } template <typename Type> void print(Type a) { std::cout << a << std::endl; } class Cents { private: int m_Cents; public: Cents(int cents) : m_Cents(cents) { } friend bool opera...
ALGO
0.984279
4.406491
01c72934-1367-4efb-84aa-54677f7c48d5
hrishi7/techInterviewPrep
Dynamic Programming/maxSumSubArray.cpp
#include<iostream> using namespace std; int maxSumSubArray(int *a, int n){ int curr_max_end=0,best_so_far=0; int dp[n]; dp[0] = if() } int main(){ int n = 8; int a[] = {-5,6,7,-20,3,5,8,-9}; return maxSumSubArray(a,n); return 0; }
ALGO
0.999554
4.445055
48648590-9808-45a6-aa76-c26408c77fd6
Vortexx2/DSA-questions
leetcode/medium/98-validate-bst/rec.cpp
/** * @file rec.cpp * @author Vortexx2 * @brief Problem 98 - Validate BST * @date 29-08-2021 * * Runtime - 4 ms O(n) * Memory Usage - 21.5 MB O(h) */ #include <algorithm> #include <climits> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #inc...
ALGO
0.999916
6.792379
de9068df-b3c3-4c7f-b92e-6f86c423b2a6
er-chetan/Complete_DSA
recursion/printNnumbersbeforeRecCall.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; void print(int n){ if(n==0){ return ;//base case } cout<<n<<endl;//work print(n-1);//call } int main(){ print(5); return 0; }
ALGO
0.999916
4.659893
bf406c13-e213-4add-add6-38f1ef0f9286
satvikc15/leetcode-dsa
2107-find-unique-binary-string/find-unique-binary-string.cpp
class Solution { public: string fun(string temp, int n, unordered_map<string, int>& mpp) { if (temp.size() == n) { if (mpp.find(temp) == mpp.end()) return temp; return ""; } string res = fun(temp + '0', n, mpp); if (!res.empty()) return res; ...
ALGO
0.999873
6.162796
4cee2d9b-27a0-4b6a-b9da-62112c77ac2f
Ranveer098/Leedcode-
2706-buy-two-chocolates/2706-buy-two-chocolates.cpp
class Solution { public: int buyChoco(vector<int>& prices, int money) { sort(prices.begin(),prices.end()); int leftmoney=prices[0]+prices[1]; if(money>=leftmoney){ int a=money-leftmoney; return a; } else{ return money; } } };
ALGO
0.999039
5.168184
eb9a2ab6-dc5e-4c9f-8ac1-1693672be964
TanmayVig/6Companies30days
day1-5[Goldman Sachs]/w1q5.cpp
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long class Solution{ public: ull getNthUglyNo(int n) { set<ull> s; // memset(arr,0,sizeof(arr)); s.insert(1); n--; while(n-->0){ // cout<<"loop"; auto i = s.begin(); s.erase(i); ull t = *i; ...
ALGO
0.999971
4.318752
1f9a10ca-f5cf-468c-b73c-e417fe41d525
vergecurrency/verge
src/chain.cpp
#include <chain.h> #include <pow.h> /** * CChain implementation */ void CChain::SetTip(CBlockIndex *pindex) { if (pindex == nullptr) { vChain.clear(); return; } vChain.resize(pindex->nHeight + 1); while (pindex && vChain[pindex->nHeight] != pindex) { vChain[pindex->nHeight] = ...
ALGO
0.99974
6.943908
5b97b095-3d35-4d0b-ae38-ecddd7f30845
MohamedMamdouh18/Problem-Solving
SPOJ/Bytelandian Blingors Network/main.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define eb emplace_back #define se second #define fi first #define el "\n" #define ll long long #define all(a) a.begin(),a.end() #define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define PREC cout.precision(20); const ll mod = 1e9 + 7,...
ALGO
0.999774
4.189167
0c1e7012-5352-4a46-800b-5dede0a1e29f
meghmajmundar/ASSIGNMENT_M4
M4_5.1_Swap_Two_Values.cpp
/* 1. Write a program of to swap the two values using template */ #include <iostream> using namespace std; class Swap { int n1,n2; public : template <class X, class Y> void swap_num(X n1, Y n2) { Y c; c = n1; n1 = n2; n2 = c; cout<<"\n\n\t After Swaping............."; cout<<"\n\n\t...
ALGO
0.990174
5.269991
5ed6b984-8b34-40bf-959f-d73f58934523
raincross7/code-similarity
codes/train_code/problem018/problem018_460.cpp
#include<iostream> using namespace std; int main(){ string s; cin >> s; if(s[1]=='R'){ if(s[0]=='R'&& s[2]=='R'){ printf("%d\n",3); }else if(s[0]=='R'|| s[2]=='R'){ printf("%d\n",2); }else{ printf("%d\n",1); } }else if(s[0]=='R' || s[2]...
ALGO
0.999849
3.236842
0ae2fa69-2de3-4d37-b26d-c1c85b43f80b
ishandutta2007/codeforces
yamunaku/normal/1270/C.cpp
// // Created by yamunaku on 2019/12/29. // #include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (n); i++) #define repl(i, l, r) for(int i = (l); i < (r); i++) #define per(i, n) for(int i = ((n)-1); i >= 0; i--) #define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--) #define all(x) (x...
ALGO
0.999784
3.962517
9770ca67-90d7-49a8-8ff7-358b34a82be3
pointer-authentication/parts-llvm
lib/Transforms/Scalar/LoopSimplifyCFG.cpp
#include "llvm/Transforms/Scalar/LoopSimplifyCFG.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/AssumptionCache.h" #include "llvm/Analysis/BasicAliasAnalysis.h" #include "llvm/Analysis/DependenceAnalysis.h" #include "llvm/Analysis/Gl...
TOOL
0.904553
7.776727
86412b0e-8395-49a5-b754-3ad3a4876f17
MjBarbosa1/Lab3
Problema15.cpp
#include <iostream> #include"funciones.h" using namespace std; struct Rectangulo { int x, y, ancho, altura; }; void encontrarInterseccion(Rectangulo A, Rectangulo B, Rectangulo &C) { int x1 = max(A.x, B.x); int y1 = max(A.y, B.y); int x2 = min(A.x + A.ancho, B.x + B.ancho); int y2 = min(A.y + A.al...
ALGO
0.995796
4.087961
28e89909-8dec-4e94-9cea-f65c6e3620f4
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_11205_13.cpp
#include <bits/stdc++.h> using namespace std; struct Point { long double x, y; Point() {} Point(long double _, long double __) : x(_), y(__) {} friend istream &operator>>(istream &_, Point &p) { return _ >> p.x >> p.y; } friend Point operator+(const Point &p1, const Point &p2) { return Point(p1.x + p2.x, ...
ALGO
0.999894
4.603066
e6982184-fa90-4939-a12b-4c71f87b5209
VincentLau0928/Leetcode
20_ValidParentheses.cpp
// 20. Valid Parentheses // Given a string containing just the characters '(', ')', '{', '}', '[' and ']', // determine if the input string is valid. // The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not. class Solution { public: bool isValid(string s) { ...
ALGO
0.996183
6.038249
dbfe52cd-05fe-4f3b-938b-acffa8519e20
LakshaySK106/Algorithms
graph/cpp/Kruskal's_Algorithm.cpp
#include<bits/stdc++.h> using namespace std; struct node{ int u; int v; int wt; node(int a, int b, int weight){ u = a; v = b; wt = weight; } }; bool comp(node a, node b){ return a.wt < b.wt; } int findPar(int u, vector<int> &parent){ if(u == parent[u]) return u; ...
ALGO
0.999995
4.646786
404335ae-c521-4845-a786-85726dede70e
3378950/Algorithm-Template
Graph/Kruskal.cpp
#include <cstdio> #include <algorithm> using namespace std; const int N = 1e5 + 10, M = 2e5 + 10, INF = 0x3f3f3f3f; int n, m, fa[N]; struct edge { int a, b, w; bool operator < (const edge & T) const { return w < T.w; } }edges[M]; int getfa(int x) { return fa[x] = (fa[x] == x) ? x : getfa(fa[...
ALGO
0.999979
4.545069
811477d9-6b75-435e-895d-fd30803f15f5
awahab111/RushHourDriver
game.cpp
#ifndef RushHour_CPP_ #define RushHour_CPP_ #include "util.h" #include <iostream> #include<string> #include<cmath> // for basic math functions such as cos, sin, sqrt using namespace std; int * spawn_cars(bool &); int global_false = 0; // seed the random numbers generator by current time (see the documentation of sran...
ALGO
0.923279
3.012657
072b8152-72c7-4283-9727-a44da80c40eb
kedoshim/Grupo1
source/Graph.cpp
#include <bits/stdc++.h> #include "../headers/Graph.h" Graph::Graph(char **argv) { isDirectioned = std::stoi(argv[3]); edgeIsWeighted = std::stoi(argv[4]); vertexIsWeighted = std::stoi(argv[5]); readArchives(argv); } Graph::~Graph() { } void Graph::readArchives(char **argv) { std::ifstream arch...
ALGO
0.998681
4.810153
35d08abf-07f8-4aea-a98d-5661f862b1fa
imakshaysoni/LeetCode
412-fizz-buzz/412-fizz-buzz.cpp
class Solution { public: vector<string> fizzBuzz(int n) { vector<string> result; for(int i=1;i<=n;i++){ if(i%5==0 and i%3==0){ result.push_back("FizzBuzz"); } else if (i%5==0){ result.push_back("Buzz"); } els...
ALGO
0.99985
6.666239
62785fa6-3630-4aa2-8139-da904eb71b8f
jeete121/Coding
Programs/Practice/Prac/GraphAlgorithms/complement_base10.cpp
#include <bits/stdc++.h> using namespace std; int bitwiseComplement(int N) { if (N == 0) return 1; vector<int> arr; while (N > 0) { if (N % 2 == 0) arr.push_back(1); else arr.push_back(0); N = N / 2; } int res = 0; for (int i = 0; i < ...
ALGO
0.999988
5.774317
d38a0257-8aec-4f7e-86dd-e86f0a2cddfd
chensx00/gem5_custom
src/systemc/tests/systemc/misc/v1.0/dash5/dist.cpp
/***************************************************************************** dist.cpp -- Implementation of the odometers. Original Author: Ali Dasdan, Synopsys, Inc. *****************************************************************************/ /************************************************************...
ALGO
0.994121
6.581426
ed76175c-26fc-4aa8-84dc-ed3b8e169c7a
cris-pevi/Fundamentos_UNI
week_04/011_exercise.cpp
#include <iostream> using namespace std; int main() { int numeros[] = {10, 20, 30, 40, 50}; int *ptr = numeros; cout << "Elementos del arreglo usando el puntero:" << endl; for (int i = 0; i < 5; i++) { cout << *(ptr + i) << " "; // Accede a cada elemento usando el puntero //cout << *(...
ALGO
0.996561
4.149786
61f582f4-c889-4fa4-92b2-140aff31a950
alby0701/Simulation_laboratory_exercise
Exercise_9/9/.ipynb_checkpoints/main-checkpoint.cpp
#include <cmath> #include <vector> #include <valarray> #include <random> // #include "tsp.h" #include <iostream> int main(){ std::default_random_engine generator; std::uniform_real_distribution<double> randunif(0.0,1.0); std::cout << randunif(generator) << std::endl; unsigned int NUM_CITIES = 32;...
ALGO
0.999652
4.239855
19621eb5-1dd1-4845-9cb5-f5a50edc7484
SoyOscarRH/ThingsWithCryptography
Code/AES/BinaryField.cpp
#include <bitset> #include <cstdint> #include <iostream> #include <string> using namespace std; template <int T = 8> class binary_field { private: constexpr static auto elements = 2 * T; bitset<elements> data; template <typename num> constexpr static auto get_most_significant_bit(num n) { if (n == 0) re...
ALGO
0.999696
5.998312
57ea32d3-e018-450c-9892-055b104b0f8f
NLS-SJTU/CdRv_ORB_SLAM2
Thirdparty/DBoW2/DBoW2/BowVector.cpp
#include <iostream> #include <fstream> #include <vector> #include <algorithm> #include <cmath> #include "BowVector.h" namespace DBoW2 { // -------------------------------------------------------------------------- BowVector::BowVector(void) { } // -------------------------------------------------------------------...
TOOL
0.941831
5.320169
257f57cf-bea6-4144-9b28-929785c1fd0d
Esrappelt/PAT-AdvancedLevel
1089Insert or Merge/main.cpp
#include <bits/stdc++.h> using namespace std; int n; vector<int> ans,t; bool Equal() { for(int i = 0; i < n; ++i) if(ans[i] != t[i]) return false; return true; } void solve() { int p = 0,q = 0,x = 1,flag = 0; while(t[p + 1] >= t[p] && p < n - 1) ++p; q = p + 1; while(t[q] == ans[q] && q ...
ALGO
0.999991
3.873119
88286929-d008-4248-aea0-56d859b64f30
JatinSingh08/Leetcode-DSA
2541-minimum-operations-to-make-array-equal-ii/2541-minimum-operations-to-make-array-equal-ii.cpp
class Solution { public: long long minOperations(vector<int>& nums1, vector<int>& nums2, int k) { long long n = nums1.size(), m = nums2.size(); long long positiveDiff = 0; long long negativeDiff = 0; if(k==0) { if(nums1 == nums2) return 0; return -1; ...
ALGO
0.999974
5.396449
4d72342b-78ef-4a2f-a985-55fc8ef9f488
AdityaPrajapati1210/DSA
day_8/mergesort.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) { // Step 1: Remove all placeholder 0s beyond the m valid elements nums1.resize(m); // keep only first m elements // Step 2: Append nums2 nums1....
ALGO
0.999989
6.099942
77acfca0-ad1f-433d-a3c8-887b57e685ff
Jayendhra/Spider-Algos
Sorting.cpp
//Shiva 110117037 //Jayendhra 110117037 //Sorting in ascending order #include<iostream.h> #include<conio.h> const int s=40; void bubblesort(int a[s],int n) { int temp; for(i=0;i<n;i++) { for(int j=0;j<n-i-1;j++) { if(a[j>=a[j+1]) temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } } ...
ALGO
0.999076
3.389769
c23907ee-d152-43b5-8cc8-287ac17266be
everx-labs/TVM-Compiler
llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp
#include "llvm/Transforms/Utils/LowerMemIntrinsics.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" using namespace llvm; static unsigned getLoopOperandSizeInBytes(Type *Type) { // TVM local begin ...
ALGO
0.985662
4.843776
35138677-c8c1-485a-9494-b95c16022d25
jenasuman/LeetCode-Solutions
1701-average-waiting-time/1701-average-waiting-time.cpp
class Solution { public: double averageWaitingTime(vector<vector<int>>& customers) { double prev=1; double sum=0; for(auto v:customers){ if(prev>v[0]){ sum=sum+(prev+v[1]-v[0]); prev+=v[1]; } else{ ...
ALGO
0.999931
5.752887
61bfab38-6c8b-46d3-a9ed-5ff65330a536
snehatiwari224/GeekForGeeks_160
Day_39/basic_array.cpp
// Given an array, arr of n integers, and an integer element x, find whether element x is present in the array. Return the index of the first occurrence of x in the array, or -1 if it doesn't exist. // Examples: // Input: arr[] = [1, 2, 3, 4], x = 3 // Output: 2 // Explanation: There is one test case with array as [...
ALGO
0.99908
6.127936
78b656af-b0f2-43ae-9dca-8d55b87cc127
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_4487_18.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); int n; cin >> n; n = 2 * n; long long arr[n], ans; for (int i = 0; i < n; i++) cin >> arr[i]; sort(arr, arr + n); ans = (arr[n / 2 - 1] - arr[0]) * (arr[n - 1] - arr[n / 2]); long long max_col_diff = arr[n - 1] - arr[0...
ALGO
0.999964
3.824543
349aa727-8a56-4be2-bed0-51cc6f76ebb5
yijuanhu/LOCOM
simulation_Com2seq/Code_com2seq_exch/Newton_rho_v2.cpp
#include <RcppArmadillo.h> #include <cmath> //[[Rcpp::depends(RcppArmadillo)]] using namespace Rcpp; using namespace arma; // [[Rcpp::export]] arma::cube CalculateXY(const arma::mat & X, const arma::mat & Y){ int K = X.n_cols; int n_sam = X.n_rows; arma::cube XY(K, K, n_sam); for (int s = 0; s < n...
ALGO
0.999955
5.87287
8dd756f5-01b5-40cf-9c37-8065963eaee0
Omarkhaleed/Codewars-kata-8
104-101 Dalmatians - squash the bugs, not the dogs!.cpp
#include<vector> #include <string> std::string howManyDalmatians( int number){ std::vector<std::string> dogs{ "Hardly any", "More than a handful!", "Woah that's a lot of dogs!", "101 DALMATIONS!!!" }; std::string vvv=""; if(number<=10) vvv= dogs[0]; else if(number<=50) vvv=dogs[1]; else if(number==...
ALGO
0.926865
5.381754
1b951ffb-11b8-4818-9222-4e449afe7d0b
zouxiaopochuan/AI_For_CV
HoughCirles.cpp
#include<opencv2\opencv.hpp> #include<opencv2\highgui\highgui.hpp> #include<opencv2\imgproc\imgproc.hpp> using namespace std; using namespace cv; int main(int argc, char** argv) { Mat image = imread("circle.jpg"); imshow("原始图", image); Mat grayImage; //cvtColor(image, grayImage, COLOR_GRAY2BGR); Canny(image, gr...
ALGO
0.937562
3.889427
a6d5096a-0d86-4601-b55a-c388a4585158
StanPlatinum/proofGen
llvm/lib/CodeGen/CalcSpillWeights.cpp
#include "llvm/CodeGen/CalcSpillWeights.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/CodeGen/LiveInterval.h" #include "llvm/CodeGen/LiveIntervals.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineOperand.h" ...
ALGO
0.99578
7.806491
9a3fc3d1-601b-4393-8c32-eb4133116cb2
11Gentleman11/ClassSample
ClassSample/ClassSample.cpp
#include<iostream> #include <chrono> #include <random> using namespace std; template <typename T> class card { private: T crd; public: card() {} card(T crd1) { crd = crd1; } T getcrd() { return crd; } }; class Base { int amount; string type; public: Base(int amount, string type) { th...
TOOL
0.922648
3.699574
7adcb04f-d112-4311-b990-15213ede72e5
Zhanghq8/Leetcode_notes
392_Is_Subsequence/submission1.cpp
#include <iostream> #include <string> #include <vector> using namespace std; class Solution { public: bool isSubsequence(string s, string t) { int sIndex = 0; int tIndex = 0; while (sIndex < s.size() && tIndex < t.size()) { if (s[sIndex] == t[tIndex]) { sIndex++...
ALGO
0.999637
6.166743
bb56893f-ea06-4f42-acdc-3ed604a249aa
cslate42/senior-design
Test/vivado-sys-gen-tutorial/SysGen_Tutorial/Lab2/C_code/MedianFilter.cpp
#include "MedianFilter.h" #define WINDOW_SIZE 3 typedef unsigned char PixelType; #define PIX_SWAP(a,b) { PixelType temp=(a);(a)=(b);(b)=temp; } #define PIX_SORT(a,b) { if ((a)>(b)) PIX_SWAP((a),(b)); } PixelType OptMedian9(PixelType * p) { PIX_SORT(p[1], p[2]) ; PIX_SORT(p[4], p[5]) ; PIX_SORT(p[7], p[8]) ; PIX_SO...
ALGO
0.999716
5.12685
d88997a9-c939-4442-961b-fd3c1ec35341
Bo2874/DSA
Divide and Conquer/DSA04009 - LŨY THỪA MA TRẬN 1.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int n, mod = 1e9 + 7; struct matrix{ ll a[10][10]; friend matrix operator * (matrix x, matrix y){ matrix kq; for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ kq.a[i][j] = 0; for(int k = 0; k < n; k++){ kq.a[i][j] += x.a[i][...
ALGO
0.999865
3.768166
de3960e5-7190-4c43-a4c4-3367a20896bb
kmk9846/3D_Reconstruction
Voxel/src/voxelUpdate.cpp
#include "../include/voxelUpdate.h" #include "cmath" float VoxelUpdate::getSDF(const Point& camera, const Point& point, VoxelIndex targetIndex) { Point voxelCenter; if(targetIndex.index_x <= 0 || targetIndex.index_y <= 0 || targetIndex.index_z <= 0) return 0; else { voxelCenter = centerVoxel(ta...
ALGO
0.998686
5.413055
994fb0b2-52e3-4882-83ae-ad10f44917ea
chaobing/baseAlgo
leet/2_struct/05_tree.cpp
#include "../leetcommon.hpp" static const int NaN = 0xffffffff; TreeNode *buildBST(vector<int> &data) { if (data.empty()) return nullptr; vector<TreeNode *> Q; for (int i = 0; i < data.size(); ++i) { if (data[i] == NaN) { Q.push_back(nullptr); } else { Q.push_back(new TreeNode(data[i]));...
ALGO
0.998574
6.064822
0e7a3f52-0fcc-4e4d-8c74-c189f6ae66ef
kitagawa-hr/Project_Euler
cpp/library/Matrices/Matrix Operations/matrix_modular.cpp
//Matrix library implementations (In modular arithemetic terms) #include <bits/stdc++.h> using namespace std; const int SZ = 102; //size of matrix const int LN = 32; //equals ceil(log2(n)), where n is maximum power to which matrix is raised const int MOD = 1e9 + 7; int N; //size of matrix as given in inp...
ALGO
0.999965
3.747833
3d81e5a7-48b7-438e-aa55-4253484eb876
kimjihyo/daily-coding-challenge
boj/1966/solution.cpp
#include <iostream> #include <queue> #include <vector> using namespace std; struct compare { bool operator()(int &a, int &b) { return b > a; } }; struct PrinterQueue { int n; queue<pair<int, int>> q; priority_queue<int, vector<int>, compare> pq; PrinterQueue(int size) { n = size; } void enqueue(int id, i...
ALGO
0.999988
4.483494
dc2357ea-f65d-49f0-ab61-3dba48828f49
Kwontaebin/flutter_sns
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.998784
6.761023
ccb3b6b4-d0a7-45a0-a4a6-c3d663b4cf7e
Vkrisztian01/Competitive-Programming-Portfolio
Graph Algorithms/Course Schedule.cpp
// Problem Name: Course Schedule // Link to the Problem: https://cses.fi/problemset/task/1679 // Link to the Solution: https://cses.fi/paste/fd005679fd014c7694940d/ #include <iostream> #include<bits/stdc++.h> typedef long long ll; using ll = long long; using namespace std; int n,m; vector<vector<int> > adj; vector...
ALGO
0.999991
4.473645
9a13708d-2b37-4dc4-b4e6-33118450a5cd
sharmistha2021/light-oj
opposite task/main.cpp
#include <bits/stdc++.h> using namespace std; int main() { int num, t; cin >> t; for(int i = 0; i < t; i++){ cin >> num; // int r; if(num <= 10) cout << num << " 0" << endl; else cout << num - 10 << " 10" << endl; // r = rand()% 10; // cout << r << " " << num - r << e...
ALGO
0.997372
3.266728
4348b5bb-a379-4d14-a3fd-dc87ae7e3633
LeoJY/Leetcode
111_Minimum_Depth_of_Binary_Tree.cpp
//111. Minimum Depth of Binary Tree //Given a binary tree, find its minimum depth. //The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *r...
ALGO
0.999895
6.458548
ea7c5ce3-8637-45ae-83dd-10a3c7f83456
shazraz/MPC-Controller
src/Eigen-3.3/doc/examples/Tutorial_ArrayClass_interop.cpp
#include <Eigen/Dense> #include <iostream> using namespace Eigen; using namespace std; int main() { MatrixXf m(2,2); MatrixXf n(2,2); MatrixXf result(2,2); m << 1,2, 3,4; n << 5,6, 7,8; result = (m.array() + 4).matrix() * m; cout << "-- Combination 1: --" << endl << result << endl << e...
ALGO
0.999469
4.541172
1c202719-233a-4f9d-8d83-f2124c1db130
Mindjolt2406/Competitive-Programming
TopCoder/SRM/779/250.cpp
#include<bits/stdc++.h> #define mt make_tuple #define mp make_pair #define pu push_back #define INF 1000000001 #define MOD 1000000007 #define EPS 1e-6 #define ll long long int #define ld long double #define fi first #define se second #define all(v) v.begin(),v.end() #define pr(v) { for(int i=0;i<v.size();i++) { v[i]==I...
ALGO
0.999958
4.316443
dc12310a-44c0-44e8-acb4-70dfd189e48b
levudung555/study-code
baitap12/ConsoleApplication26/ConsoleApplication26/ConsoleApplication26.cpp
// ConsoleApplication26.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> using namespace std; int main() { int sodong; cout << "Vui long nhap so dong :"; cin >> sodong; for (int i = 1; i <= sodong; i++) { for (int j = 1; j <= i-1; j++...
ALGO
0.986004
3.850208
b22309d9-80aa-469d-bf13-822ab425a1e5
math10/Solved-Problem
SPOJ 1837. Pie.cpp
/* Author :: MD. Musfiqur Rahman Sanim Aust cse 28th Batch ID:11.02.04.097 */ //{ Template using namespace std; //{ C-headers #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <climits> #include <cfloat> #include <cctype> #include <cassert> #include <ctime> //} //{ C++-headers #include ...
ALGO
0.999643
3.455185
7adfa985-e137-478a-a0bd-e08f6a649c00
SWMFsoftware/AMPS
srcPhotonTest/radiation.cpp
#include "radiation.h" //particle weight == energy carried by a model particle [eV] long int Radiation::PhotonFreqOffset=-1; int Radiation::MaterialTemperatureOffset=-1; int Radiation::AbsorptionCounterOffset=-1; int Radiation::EmissionCounterOffset=-1; void Radiation::ProcessCenterNodeAssociatedData(char *TargetBl...
ALGO
0.975715
4.626825
20963e3e-d286-4c8b-a080-87d9f467505b
netrix4/DesaAppMoviles
insta_clone/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.998772
6.776823
63ee90a7-fda0-4fac-89fa-b3b13fea7646
MarvelousAudio/CPlusPlus-How-to-program-tenth-edition
Chapter 22/Using memcmp/Using memcmp/main.cpp
#include <iostream> #include <iomanip> #include <cstring> // memcmp prototype using namespace std; int main(int argc, const char * argv[]) { // insert code here... char s1[]{"ABCDEFG"}; char s2[]{"ABCDXYZ"}; cout << "s1 = " << s1 << "\ns2 = " << s2 << endl; cout << "\nmemcmp(s1, s2, 4) = " << se...
ALGO
0.997229
3.665317
74afd053-5f38-4e62-ba37-c02e58706290
wildcat-rocketry/llvm
libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
// <algorithm> // template <class InputIterator, class Predicate> // constexpr bool // constexpr after C++17 // is_partitioned(InputIterator first, InputIterator last, Predicate pred); #include <algorithm> #include <functional> #include <cstddef> #include <cassert> #include "test_macros.h" #include "te...
TEST
0.948291
7.259173
8a0d5dec-8943-4644-865b-221054c63980
Sagarragad/ProblemSolving
program192.cpp
#include<iostream> using namespace std; class Array { public: int *Arr; int iSize; Array(int A) { iSize = A; Arr = new int[iSize]; } ~Array() { delete []Arr; } void Accept() { int iCnt...
ALGO
0.955709
3.589548
84924e3c-de8a-45fc-a661-1a5805c2c326
Yanhaoxi/xinan1
reverse_question/week2/question5/template.cpp
#include <iostream> #include <cstring> #include <stdio.h> ###exec: def to_cx_string(s): t = '' for i in s: t += '\\x%02x' % ord(i) return '"' + t + '"' encrypted_flag =[ord(flag[i])^0x66^i for i in range(len(flag))] for i in range(len(flag)-3): encrypted_flag[i] = chr(encrypted_flag[i]^encrypted_flag[i+1]^enc...
ALGO
0.989356
3.651031
e6738562-2147-488f-ac7d-5b6e1efd1515
sunnysetia93/competitive-coding-problems
HackerRank/ProblemSolving/cppSolutions/Data Structures/Trees/treePreorderTraversal.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: int data; Node *left; Node *right; Node(int d) { data = d; left = NULL; right = NULL; } }; class Solution { public: Node* insert(Node* root, int data) { ...
ALGO
0.999926
5.826612
7d398046-b158-4d84-9dbf-1c90ba0709e3
HybridGraph/GraphLab-PowerGraph
toolkits/graph_analytics/warp_pagerank.cpp
#include <vector> #include <string> #include <fstream> #include <graphlab.hpp> #include <graphlab/engine/gl3engine.hpp> // #include <graphlab/macros_def.hpp> using namespace graphlab; #define PAGERANK_MAP_REDUCE 0 // Global random reset probability double RESET_PROB = 0.15; double TOLERANCE = 1E-2; // The vertex d...
ALGO
0.999605
6.186528
81940042-7f97-45c8-a5ea-88f7f23a7765
kkj53051000/Algorithm_LeetCode_cpp
src/1971_Find if Path Exists in Graph_1.cpp
class Solution { public: bool validPath(int n, vector<vector<int>>& edges, int source, int destination) { queue<int> q; map<int, bool> m; // 맵 key value 세팅 for(int i = 0; i < n; i++) { m[i] = true; } // 시작 값 넣기 q.push(source); // 탐색 ...
ALGO
0.999952
6.112178
63b2edbd-10a9-4ed3-ad6c-62d04a290e77
spfrood/CPP-references
Examples/LOOPS/ALT-Gaddis_8thEd_Chap5_Prob7_PenniesForPay_1/main.cpp
/* * File: main.cpp * Author: Scott Parker * Created on January 18, 2017, 11:08 PM * Purpose: Gaddis, 8th Edition, Chapter 5, Problem 7, Pennies for Pay * calculating salary penny a day doubled for 31 days */ //System Libraries #include <iostream> //input output library #include <iomanip> //formatting librar...
ALGO
0.998543
3.898994
5b280324-ec6d-4d40-b912-14b566bfa18d
Ufowoqqqo/Online-Judge
Codeforces/490A.cpp
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <vector> using namespace std; int main(void) { int n; int i; int x, o; vector<int> v[5]; for(i = 0; i < 5; i ++) v[i].clear(); scanf("%d", &n); for(i = 1; i <= n; i ++) { ...
ALGO
0.999844
3.111572
876c94ab-bbd2-4c81-993a-c00d1684e2ab
nyue/libWetHair
libWetHair/liangbarsky.cpp
#include "liangbarsky.h" #include "MathDefs.h" namespace liangbarsky { int clip_line(const Vector4s& c, Vector2s& q1, Vector2s& q2, scalar& t0, scalar& t1) { t0 = 0.0; t1 = 1.0; double xdelta = q2(0)-q1(0); double ydelta = q2(1)-q1(1); double p=1.0,q=0.0,r; for(int edge=0; edge<4; edge...
ALGO
0.996908
5.276219
52e4cc21-2242-4952-900b-6b06df69cce8
PJSliable/Algorithm_study
BOJ/BFS&DFS/4179_불!.cpp
#include <bits/stdc++.h> using namespace std; int R, C, visited[1000][1000], ret, x, y, jx, jy; char m[1000][1000]; queue<pair<int, int>> mv; queue<pair<int, int>> fi; int dy[4] = {-1, 0, 1, 0}; int dx[4] = {0, 1, 0, -1}; int move(){ queue<pair<int, int>> v1; while (mv.size()) { tie(x, y) = mv.fron...
ALGO
0.999929
4.677874
f517a5d0-333f-4b5d-a9a6-55c339b2da22
manishsingh0418/Language-and-DSA-
Practice Problem/Array/MaximumSubarrayEfficient.cpp
#include <iostream> #include <vector> using namespace std; int MaximumSubarraySum(vector<int> arr, int n) { int res=arr[0]; int maxEnding=arr[0]; for(int i=1;i<n;i++) { maxEnding=max(maxEnding+arr[i],arr[i]); res=max(res,maxEnding); } return res; } int main() { int n; cout << "Enter the value of N "; ...
ALGO
0.999554
5.207889
8e2ef4ea-a9cd-45ba-8959-28c61c6ea35d
SophieXin9636/UVa-Online-Judge-exercise
3/10433/10433.cpp
#include <iostream> #include <string> #include <cstring> #include <sstream> #include <algorithm> #include <cmath> using namespace std; int big[4000]; int main(){ int n; string num; while(cin >> num){ if(num[num.size()-1] != '5' && num[num.size()-1] != '6'){ printf("Not an Automorphic number.\n"); continue;...
ALGO
0.964502
4.127757
20aee279-98f1-41df-960f-ca5fb13fc4c4
singhdivyansh0/Social-Network-Simulation
set_func_old.cpp
#include <iostream> // std::cout #include <algorithm> // std:set_union, std:sort #include <vector> // std::vector #include <string> using namespace std ; //Compartor function //bool myfunction (int i,int j) { return (i<j); } // i and j are the node id of the respective node bool myfunction (Node i,Node ...
ALGO
0.990292
4.306385
7901d931-5d0e-4b14-bc83-66be1ea86aa5
ishandutta2007/codeforces
-skyline-/normal/274/D.cpp
#include<cmath> #include<math.h> #include<ctype.h> #include<algorithm> #include<bitset> #include<cassert> #include<cctype> #include<cerrno> #include<cfloat> #include<ciso646> #include<climits> #include<clocale> #include<complex> #include<csetjmp> #include<csignal> #include<cstdarg> #include<cstddef> #include<cstdio> #i...
ALGO
0.99991
3.143029
5f3e187a-3bc3-4727-a6fb-fd5217400227
stanny880913/leetcode
c++/medium/leetcode2130.cpp
#include <iostream> #include <algorithm> #include "header/ListNode.h" using namespace std; int pairSum(ListNode *head) { ListNode *curr_node = head; vector<int> list_val; while (curr_node) { list_val.push_back(curr_node->val); curr_node = curr_node->next; } int start = 0, e...
ALGO
0.999865
5.031776
4a44d1e5-d710-4a55-bdd5-f2de4aba3acc
lucasbravi2019/Cpp
EjercicioClaseTP7/Ejercicio3.cpp
#include <iostream> using namespace std; void Ganador(string Pilotos[15], int Tiempos[15][3]) { string ganador; int tiempo = 0; for (int i = 0; i <= 14; i++) { if (tiempo == 0) { tiempo == Tiempos[i][2]; } if (tiempo > Tiempos[i][2]) { gana...
ALGO
0.980454
4.510608
0553528d-8383-48ba-b76c-e164b32ead00
habiburrahmantalha/UVA-online-Judge
568_Just_the_Facts.cpp
#include<stdio.h> int last_digit_factorial(int N) { int ans=1,a2=0,a5=0,i,j,a; for(i=1;i<=N;i++) { j=i; while(j%2==0) { j/=2; a2++; } while(j%5==0) { j/=5; a5++; } ans=(ans*(j%10))%10; } ...
ALGO
0.999874
3.890118
ee0e7e3f-1f49-4b94-8f90-3039bab1156a
GoatGirl98/Walkthrough-of-ACCoding-in-BUAA
2018级-理科-大学计算机基础/E1-大学计算机基础(理科)五一假期-思维试炼/BUAAOJ2219.cpp
#include<iostream> #include<cstdlib> #include<cmath> #define maxn 10010 #define eps 1e-10 using namespace std; /************************************ 本题是一个隐形的二分答案问题 转换一个说法就是 每个人最多分所有派中面积最大的 要么就是无限小 卡答案的条件就在于是否能分这个派 ************************************/ int n, m; double pie[maxn]; int main() { ios::sync_with_stdio(f...
ALGO
0.999974
3.487694
3b12bf2b-ffec-469d-9045-5c38536dee62
Shahbaz898414/Code_Cheff
Pratice/Maximum Weight Difference.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 #define Time cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl; #define pb push_back #define mp make_pair #define line cout << endl; #define ff first #define ss second #define vi vector<int> #define no...
ALGO
0.999983
5.078403