uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
2c74a516-6244-474a-8c16-e2d2c876a98d
GNAQ/CP4Fun
icpc23hefei/G.cpp
#include <bits/stdc++.h> typedef long long ll; using namespace std; int n, m, K; int dp[200010][7]; char s[200010]; int pre0pos[200010], pfsum[200010]; bool valid(int val) { memset(dp, 0x3f, sizeof(dp)); for (int i = 0; i <= n; i++) { dp[i][0] = 0; } for (int i = val + 1; i <= n; i++) { // must select consecu...
ALGO
0.999942
4.589321
0e732498-750d-4e41-a8ea-4e6eef9f88e0
SpidiMun/2-Semester
Lab № 10/Лабораторная работа № 10/Лабораторная работа № 10/Лабораторная работа № 10.cpp
#include <iostream> #include <string> using namespace std; string RecordInMassive(string* Arr, int Size) // Функция записи массива { int i; cout << "Запись массива..." << endl << endl; cin.ignore(); for (i = 0; i < Size; i++) { cout << "Введите " << i + 1 << " строку:" << endl; getline(cin, Arr[i]); c...
TOOL
0.986484
4.14821
0cf36181-e16c-487b-9675-3138b60f8681
ShimuGuyue/AlgorithmPractice-Codes
Codeforces/比赛/Codeforces Round/Codeforces Round 1033 (Div. 2)-DEFG/CF2120B.cpp
/*-----------------------------------head-----------------------------------*/ #pragma region template // https://github.com/ShimuGuyue/AlgorithmPractice-Codes /* /$$$$$$\ $$\ $$\ $$\ $$$$$$\ $$$$$$\ $$$$$$\ $$ __$$\ $$ | \$$\ $$ |$$ __$$\ \_$$ _|$$ __$$\ $$ / $$ |$$ | \$$\ $$ / $$ / \__| $$ |...
ALGO
0.999357
4.47894
39f1c97d-4eb2-48cd-a529-f05bcb5a5b27
guanlnny/SVMProgramByWinDesign
Source/BHashStrK.cpp
////////////////////////////////////////////////////////////////////// // CBHashStrK: ַͼֵĹϣʵ // ////////////////////////////////////////////////////////////////////// #include "BHashStrK.h" #include <memory.h> #include <string.h> ////////////////////////////////////////////////////////////////////// // Static ֵ /////...
TOOL
0.946961
4.09467
1eee43c4-c8e6-477b-b48d-6b54ce4b53f5
FarrukhCyber/Data-Structures
PA-2/BST and AVL/test3.cpp
// Test file for AVL Tree Implementation #include <iostream> #include <cstdio> #include <cstdlib> #include <memory> #include "avl.hpp" using namespace std; int marks = 0; int total_values = 25; int values[25] = {55,43,26,82,93,04,39,95,50,6,62,17,21,49,77,5,32,60,88,16,44,72,80,8,36}; int TreeAfterAddition[25] = {4,5,...
TEST
0.991938
4.492926
3a3baed1-5b7b-4684-b9f0-c551780b414a
Nakib-Arman/CSE318---ArtificialIntelligence
4.DecisionTree/.history/decision_tree_20250707184348.cpp
#include<bits/stdc++.h> using namespace std; class Node { int column_num; string label; unordered_map<string,Node*> children; Node* parent; float threshold; public: Node(int column_num){ this->column_num = column_num; this->parent = NULL; this->label = ""; t...
ALGO
0.996939
4.315688
7a0c18f7-79a5-4227-9cea-ca3d8b22859b
mangowar/leetcode
minWindow.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <unordered_set> using namespace std; class Solution { public: string minWindow(string s, string t) { if(s.size() < t.size()) return {}; unordered_map<char, int> t_dict; unordered_map<char, int> t_chars; ...
ALGO
0.999943
6.479727
4d009ce2-730e-4508-9e1c-e36dbdfe5d8f
raincross7/code-similarity
codes/train_code/problem311/problem311_186.cpp
#include <bits/stdc++.h> using namespace std; int main() { int N,sum=0; cin >> N; vector<string> s(N+10); vector<int> t(N+10); for(int i=1; i<=N; i++) cin >> s[i] >> t[i]; string X; cin >> X; for(int i=1; i<=N; i++) { if(s[i] == X) { for(int j=i+1; j<=N; j++) sum += t[j]; } } cout ...
ALGO
0.999876
4.062212
ce41e1b4-a90e-4ea2-a08b-9b0c8700f7f0
sinian666/codes_102_2
cpp_副本21/chapter_backtracking/preorder_traversal_ii_compact.cpp
/** * File: preorder_traversal_ii_compact.cpp * Created Time: 2023-04-16 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" vector<TreeNode *> path; vector<vector<TreeNode *>> res; /* 前序遍历:例题二 */ static void preOrder(TreeNode *root) { if (root == nullptr) { return; } // 尝试 path...
ALGO
0.999867
5.658733
a7cc8029-d6ef-4cbe-bbd9-90c85d54f937
c0sta90/my_cpp_lessons
1º ano/C++/trabalho_aula/numsorte.cpp
#include <iostream> using namespace std; int main(){ int numSorte = 1+(rand()%100); srand((unsigned) time(0)); int num = 0; while(numSorte != num){ cout <<"Qual o numero da sorte? "; cin >> num; if (numSorte > num){ cout << "O número da sorte é maior " << num << endl; ...
ALGO
0.926239
3.125449
aafcb77d-efec-4897-b4f0-67f2621d7ccb
nafi103/Solved-Problems
Practice/2025/June/D_Extended_Traffic.cpp
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace chrono; using namespace __gnu_pbds; /****************************************************************/ #define int long long #define pi acos(-1.0) const int mod = 998244353; #defin...
ALGO
0.99998
5.075578
b8a0716a-2946-4bb0-afce-b613ba6d16f8
joncmu/supercop
cryptopp-562/shark.cpp
// shark.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #include "shark.h" #include "misc.h" #include "modes.h" #include "gf256.h" NAMESPACE_BEGIN(CryptoPP) static word64 SHARKTransform(word64 a) { static const byte iG[8][8] = { 0xe7, 0x30, 0x90, 0x85, 0xd0, 0x4b, 0x91, 0x41, 0x53, 0...
ALGO
0.999546
7.655563
44ca6ea9-46f8-46f5-8c5a-85f29a2cc3a1
jamesyaputra/CS2040C
Labs/ch2/ch2_09_segmenttree_ds.cpp
#include <cmath> #include <cstdio> #include <vector> using namespace std; typedef vector<int> vi; class SegmentTree { // the segment tree is stored like a heap array private: vi st, A; // recall that vi is: typedef vector<int> vi; int n; int left (int p) { return p << 1; } // same as binary...
ALGO
0.99998
5.053854
c57df29d-39aa-430f-a7c7-519439e5d609
Jazz-45/LeetCode
0503-next-greater-element-ii/0503-next-greater-element-ii.cpp
class Solution { public: vector<int> nextGreaterElements(vector<int>& nums) { int n=nums.size(); stack<int> st; vector<int> ans(n,0); // Back traversal the array -> virtually doubling the array for(int i=2*n-1;i>=0;i--){ int idx=i%n; while(!st.empty(...
ALGO
0.999828
5.962994
c6f0c3ad-71b2-46bb-ab83-c236c8484ac3
robotronik/cdfr2024-programme-pamis
lib/STM32duino_VL53L7CX/src/vl53l7cx_plugin_detection_thresholds.cpp
/** ****************************************************************************** * @file vl53l7cx_plugin_detection_thresholds.cpp * @author STMicroelectronics * @version V1.0.0 * @date 13 January 2023 * @brief Implementation of the VL53L7CX APIs for thresholds detection. ******************************...
TOOL
0.877793
7.561352
af8dcf37-6acb-4deb-95fd-e9c61624bb97
FangLiu68/LC2016
LC2016/Populating Next Right Pointers.cpp
/* Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. Initially, all next pointers are set to NULL. Note: You may only u...
ALGO
0.999981
5.109086
e960b8ac-2fc2-4490-8347-f28abd2a938d
koushik395/LeetCodeProblems
0011-container-with-most-water/0011-container-with-most-water.cpp
class Solution { public: int maxArea(vector<int>& height) { int i = 0,j = height.size()-1; int cap = 0; while(i<j) { cap = max(cap,(j-i)*min(height[i],height[j])); if(height[i]<height[j]) i++; else j--; ...
ALGO
0.999971
6.546123
8b76c4bb-d88e-48b6-b631-9b8eb7de9044
trilinos/Sundance
tests-std-framework/Problem/HighOrderPoisson1DCubicHermite.cpp
/* @HEADER@ */ /* @HEADER@ */ #define DISABLE #ifndef DISABLE #include "Sundance.hpp" #include "SundanceCubicHermite.hpp" #include <unistd.h> #include <sys/types.h> /** * Solves the Poisson equation in 1D */ CELL_PREDICATE(LeftPointTest, {return fabs(x[0]) < 1.0e-10;}) CELL_PREDICATE(RightPointTest, {return fabs...
ALGO
0.99318
5.967999
85ebdadd-499d-49c0-8d8c-488e5694fa18
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Gemma/top0-100/minimum-jumps-to-reach-home-Solution.minimumJumps/177856_nan.cpp
do_ed_script (char const *inname, char const *outname, bool *outname_needs_removal, FILE *ofp) { static char const editor_program[] = EDITOR_PROGRAM; file_offset beginning_of_this_line; size_t chars_read; FILE *tmpfp = 0; char const *tmpname; int tmpfd; pid_t pid; if (! dry_run ...
TOOL
0.877173
3.968425
2813758c-1aee-4760-aecb-95fa4a0e359a
PoisonedPoi/SocialVerificationWebsite
checker2/Rover/prism-library/prism/ext/lp_solve_5.5_java/src/c/lpsolve5j.cpp
#include <stdio.h> #include <stdlib.h> #include "lpsolve_LpSolve.h" #include "lp_lib.h" // ======================================================================= // ----------------- global variables ---------------------------------- // ======================================================================= /* Th...
TOOL
0.961966
5.472926
78341486-2d09-42e6-9131-dc8134504190
Ahnaf-41M/Codeforces_AtCoder
codeforces/233/A.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n,i; cin>>n; if(n&1) cout<<-1<<endl; else { for(i = 2; i <= n; i+=2) { cout<<i<<" "<<i-1<<" "; } cout<<endl; } }
ALGO
0.999107
3.83656
885dc28f-6912-40ee-a7ee-8ddf5b5d4f19
justwizhhh/cpp-top-down-game
src/Level/Pathfinder.cpp
#include "Pathfinder.h" /* Loads in the relevant level map info for the object to pathfind through */ void Pathfinder::loadMap( std::vector<std::vector<int>> new_map, Vector2 new_bounds) { current_map = new_map; current_bounds = new_bounds; } /* This uses A* pathfinding to find the quickest path towards 'end_...
ALGO
0.980717
5.096857
5fa941bc-bf52-4c95-a72d-ee092d5b0619
Sampurankishoresrivastava/DSA
gfg/potd./Smallest window containing 0, 1 and 2.cpp
// User function Template for C++ class Solution { public: int smallestSubstring(string S) { // Code here int ans=INT_MAX; int i=0,j=0,n=S.size(); int a[3]={0}; int cnt=0; while(j<n){ a[S[j]-'0']++; if(a[(S[j]-'0')]==1) cnt++; if...
ALGO
0.999496
5.258874
1340c48d-4be6-4dec-a8e1-5a4f72ce96df
abhilash370/Leetcode-solutions
letter_of_phone_number.cpp
class Solution{ public: vector<string> letterCombinations(string digits) { vector<string> res; string charmap[10] = {"", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"}; res.push_back(""); for (int i = 0; i < digits.size(); i++) { ...
ALGO
0.999968
6.669705
885ae97c-b193-4195-971f-a4d78cabc133
ggarabs/competitive-programming
problems/Beecrowd/3103-Numero-da-Sorte.cpp
#include <bits/stdc++.h> #define MAXN 107 using namespace std; int main(){ int t; cin >> t; for(int i = 0; i < t; i++){ string num; cin >> num; sort(num.begin(), num.end()); int p = 0; while(num[p] == '0') p++; swap(num[p], num[0]); cout << num << endl; } return 0; }
ALGO
0.999523
4.930277
6613e2c7-d92c-4e1e-9dc7-7135a6b58cc0
fabiobr05/Prog_II_UFMS
Listas/Lista 4/Exercicio2.cpp
#include <cstdio> #include <cstdlib> /* Dizemos que uma matriz quadrada de inteiros distintos é um quadrado mágico se a soma dos elementos de cada linha, a soma dos elementos de cada coluna e a soma dos elementos da diagonal principal e secundária são iguais. Escreva um programa que seja capaz de responder se uma matr...
ALGO
0.999735
4.114945
3eae734f-51f2-4167-8c19-0fffeb91326b
PiperBetle/MyCode
CF628D Magic Numbers.cpp
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cassert> #define siz(x) int((x).size()) #define cauto const auto #define all(x) (x).begin(),(x).end() #define fi first #define se second using std::cin;using std::cout; using std::max;using std::min; template<typename any>inline void cmi...
ALGO
0.999469
3.915689
f49863c7-be8e-4611-b13b-85d9e1b1644d
Tamimkhan7/CF
1200/B. Same Parity Summands.cpp
#include <bits/stdc++.h> using namespace std; #define MTK \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define mem(a, b) memset(a, b, sizeof(a)) #define show(x) cout << #x << ' ' << x << endl #define all(x) (x).begin(), (x).end() #define ll int long lo...
ALGO
0.999902
4.117712
74cd8c2a-ace8-4610-b62d-38b7003af759
Nafyaz/my-codes
Codeforces/1169B(2).cpp
//Credit goes to NiloyRafi #include<bits/stdc++.h> using namespace std; int n,m,v,a[300009],b[300009],i; bool check(int x,int y) { for(int i = 0; i<m; i++) { if(a[i]==x||a[i]==y|| b[i]==x||b[i]==y) continue; if(y) return false; return (check(x,a[i])||check(x,b[i...
ALGO
0.999978
3.85352
887e8b74-a656-4db3-bb17-b266e4352dfc
chrauch/irhint
indices/hint_m_subs+sort+ss+cm.cpp
#include "hint_m.h" //#define INTERSECT_WITH_SHRINKING //#define INTERSECT_USING_MWAY_MERGESORT inline void mergeSort(RelationIdIterator iterPBegin, RelationIdIterator iterPEnd, RelationId &candidates, RelationId &result) { auto iterP = iterPBegin; auto iterC = candidates.begin(); auto iterCEnd = candi...
ALGO
0.999689
3.937107
2ad1656b-ba24-4b00-92f4-7ebde8be2aa2
fer-marino/Training
problem14.cpp
using namespace std; unsigned int collatz(unsigned int n) { if(n%2 == 0) return n/2; else return 3*n +1; } unsigned int countCollatz(unsigned int start) { unsigned int count = 1; while(start != 1) { //cout << start << ' '; start = collatz(start); count++; } ...
ALGO
0.999988
5.828232
a867dab4-a18a-45e7-974d-d89bfa9c0d7c
kang9366/Algorithm
BOJ_10814.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; struct person { int age, idx; string name; }; bool compare(const person& now, const person& last) { if(now.age != last.age) return now.age < last.age; return now.idx < last.idx; } int main() { ios::sync_with_stdio(fa...
ALGO
0.999659
4.677432
c90022d5-6fa0-48f8-b855-6d230a6aad0d
Yashwanth-Ramamurthi/TopoDistMF-v.1
OGDF/src/ogdf/energybased/LinearQuadtreeBuilder.cpp
/* * $Revision: 2552 $ * * last checkin: * $Author: gutwenger $ * $Date: 2012-07-05 16:45:20 +0200 (Thu, 05 Jul 2012) $ ***************************************************************/ #include "LinearQuadtree.h" #include "LinearQuadtreeBuilder.h" namespace ogdf { void LinearQuadtreeBuilder::prepareNodeAnd...
ALGO
0.995843
5.431798
02160c5a-4689-4448-8e3c-53c92b9b5e8f
nrdyava/Competitive-Coding
LeetCode/largest number.cpp
class Solution { public: string largestNumber(vector<int>& nums) { sort(nums.begin(), nums.end(), [](const int &a, const int &b){return to_string(a)+to_string(b)>to_string(b)+to_string(a);}); string ans = ""; for(int i=0; i<nums.size(); i++){ ans = ans+to_string(nums[i]); ...
ALGO
0.999982
6.224287
c589dd39-95e5-47f5-ba22-835102c46c02
ishandutta2007/codeforces
hitman623/normal/1000/C.cpp
#include <bits/stdc++.h> #define int long long #define pb push_back #define pii pair<int,int> #define vi vector<int> #define vii vector<pii> #define mi map<int,int> #define mii map<pii,int> #define all(a) (a).begin(),(a).end() #define x first #d...
ALGO
0.99991
3.968446
38c13403-f0e0-4d28-8c7a-a8cea50b34c7
Prateek-agrawal04/DSA_Basic
C++/binary.cpp
#include<iostream> #include<math.h> using namespace std; int main() { int n; cin>>n; int arr[n]; for (int i=0;i<n;i++){ int b; cin>>b; int no=0; for(int j=0;;j++){ int bs=b%10; no=no + bs*pow(2,j); b=b/10; ...
ALGO
0.999632
3.454743
4fd0564b-6268-44e4-b19e-84c9ad405548
m3nf1s/Modern-Cplusplus
White Belt/Week_3/Task_7/Task_7.cpp
/* Дополните класс Person из задачи «Имена и фамилии — 2» конструктором, позволяющим задать имя и фамилию человека при рождении, а также сам год рождения. Класс не должен иметь конструктора по умолчанию. При получении на вход года, который меньше года рождения: * методы GetFullName и GetFullNameWithHistory должны отд...
ALGO
0.972322
5.858238
8bfee7b4-8fc2-4760-94e1-3e337148f4e5
nextpagesoft/HivEstInfTime_private
src/exports.cpp
#include "header.h" // [[Rcpp::export]] Rcpp::NumericVector Lspline( const Rcpp::NumericVector& x, const Rcpp::NumericVector& knots ) { return HivEstInfTime::Lspline(x, knots); }; // [[Rcpp::export]] double GetLogMVNPdf( const arma::dvec& x, const arma::dvec& mu, const arma::dmat& sigma ) { return HivEs...
ALGO
0.998667
5.941977
c5def977-44d9-4f06-82b5-5744f58111c6
aashishshinde/Data-Structures-and-Algorithms
Src/Interviews/Pubmatic/heightOfBT.cpp
#include <bits/stdc++.h> using namespace std; /* Time: O(N) : N is number of nodes Space: O(h) : height of binary tree */ class Node{ public: int val; Node* left, *right; Node(int _val){ val = _val; left = NULL; right = NULL; } }; class BinaryTree { public: void insertNode...
ALGO
0.999455
5.271075
0965e6d6-c8d8-43b0-9617-acfed226cbd9
yuxw2009/gw
service/gw/erlang_source_so/my_amr/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/c8_31pf.cpp
/* ------------------------------------------------------------------------------ Filename: c8_31pf.cpp ------------------------------------------------------------------------------ MODULE DESCRIPTION Purpose : Searches a 31 bit algebraic codebook containing : 8 pulses in a frame of 40...
ALGO
0.999971
3.888426
8c7884b8-4619-42d1-a58a-8840d88bb1f7
cornyum/acm_summer
Day_12/G.cpp
#include <bits/stdc++.h> #define FAST_IO std::ios::sync_with_stdio(false),std::cin.tie(0),std::cout.tie(0) #define pause system("pause"); typedef long long ll; typedef unsigned int UINT; typedef unsigned long long ull; using namespace std; int main(void) { FAST_IO; string s; cin >> s; int len = s.leng...
ALGO
0.999852
4.499303
4640188c-c154-4ccd-957e-3ad5fbd07bf8
raptoravis/forwardplusrendering
thirdparty/boost_1_70_0/libs/compute/perf/perf_bolt_inner_product.cpp
#include <iostream> #include <algorithm> #include <vector> #include <bolt/cl/inner_product.h> #include <bolt/cl/copy.h> #include <bolt/cl/device_vector.h> #include "perf.hpp" int main(int argc, char *argv[]) { perf_parse_args(argc, argv); std::cout << "size: " << PERF_N << std::endl; bolt::cl::control ...
ALGO
0.966614
5.112864
7d673a02-27c4-4ced-a011-d5ab5cf72122
hjiang13/LLMs-in-IR
POJ-104/15/2325.cpp
#include <iostream> using namespace std; int a[1005][1005]; int main() { int n; cin>>n; for(int i=0; i<=1004; i++) { for(int j=0; j<=1004; j++) { a[i][j]=255; } } for(int i=1; i<=n; i++) { for(int j=1; j<=n; j++) { cin>>a[i][j]; } } int x1=0,y1=0,x2=0,y2=0; ; for(int i=1; i<=n; i++) { for(int j=1; j<=n; j++) { if(a[i][...
ALGO
0.999465
3.141468
9281357b-56bd-4bf2-9ec4-7544bc20cf7b
kapil4457/Striver-A2Z-Sheet
9. Stack and Queues [Pre-In-Post-fix, Monotonic Stack]/9.3/Remove K Digits.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: string removeKdigits(string S, int K) { int n = S.length(); stack<char>st; for(int i =0 ; i...
ALGO
0.998933
6.576775
d6cd615a-34ae-42be-8bf3-b978f74dec49
ishandutta2007/codeforces
lhic/normal/361/B.cpp
#include <iostream> using namespace std; int main() { int n,k; cin>>n>>k; k=n-k; if (k==0) { cout<<-1; return 0; } for (int i=0;i<k;i++) { cout<<(i+1)%k+1<<" "; } for (int i=k;i<n;i++) { cout<<i+1<<" "; } }
ALGO
0.999965
3.395636
6270f2a8-acf0-4451-9984-fa907c4ba8b4
bobjonesss/Programmirovanie_na_jazyke_CPP_v_srede_Qt_Creator
__ALL_PAGE_p-namber-page/p110_task_4.5.cpp
// Задача 4.5. #include <iostream> #include <stdio.h> #include <math.h> using namespace std ; unsigned long long int DecNC(unsigned long long int N, unsigned int b) { //Функция выполняет перевод числа N, //заданного в b-ичной системе счисления, //в десятичную систему счисления unsigned long long int S, P; for (S ...
ALGO
0.999349
4.347913
dc7537c9-d43f-4df6-b113-ab6b453eb4f0
stackMerchant/DSA
DP/LongestValidParentheses.cpp
// https://www.interviewbit.com/problems/longest-valid-parentheses/ int Solution::longestValidParentheses(string A) { int n = A.size(); int ret = 0; stack<int> stk; stk.push(-1); for (int i=0; i<n; i++) { if (A[i] == '(') stk.push(i); else if (stk.size()==1) { st...
ALGO
0.997464
4.769322
e1892789-15ba-4a52-806a-5ab4149085b0
ShammiAnand/cp-problemset
CF-4C.cpp
//This code is written by Shammi Anand #include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define f first #define s second #define mod 1000000007 #define INF 1e9+7 #define...
ALGO
0.999859
4.711427
c4d7eaec-8e70-4934-8b29-268a3308c75a
wss/cpp_primer_work
练习1/练习1_12.cpp
#include <iostream> int main() { int sum = 0; for(int i = -100;i<=100;++i) { sum+=i; } std::cout<<sum; }
ALGO
0.997966
3.838127
25f0bfb3-6936-4215-8cb2-e99277bb74c0
neongm/terver_lab2_UI
terver_lab2_UI/Rnd.cpp
#include "Rnd.h" double Rnd::random_real(const double& min, const double& max) { std::random_device rd; // obtaining seed; std::mt19937 gen(rd()); // standard engine seeded with rd() std::uniform_real_distribution<> distribution(min, max); // transforming int into our bounds return distribution(gen); } double R...
TOOL
0.950341
3.530141
6aae58ee-9032-4208-b0a6-8c561fc47331
RayoNicks/Cracking-the-Coding-Interview
ch17/17.18 Shortest Supersequence-2.cpp
class Solution { private: vector<int> BuildAndFind(const vector<int> &big, const vector<int> &small) { vector<int> Table(big.size(), -1); const int MAX = static_cast<int>(big.size()); for(size_t i = 0; i < small.size(); i++) { size_t closestIdx = big.size(); ...
ALGO
0.999985
5.534382
562c817f-e749-4932-869f-1a4a815ce43b
Katie927/CTDLGT_CodePTIT
DSA05008.cpp
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<set> #define MAX_ARR_SIZE 107 using namespace std; bool qhd(int arr[], int n, int s){ int f[s+1] = {0}; f[0] = 1; for(int i=0 ; i<n ; i++){ for(int j = s ; j>=arr[i] ; j--){ if(f[j] == 0 && f[j-arr[i]] ==...
ALGO
0.999887
3.73391
9ca40556-d452-4716-9c52-cbd9bf8404e4
ihaagrawal/Daily-Coding-Practice
Greedy/45. Jump Game II.cpp
// 45. Jump Game II (MEDIUM) // https://leetcode.com/problems/jump-game-ii/description/ //we basically use a form of BFS traversal //we start at index 0 and assign left=right=0 //we assign left = right + 1 //we take the max index we can jump to using the elements of our window //then we assign the said max index to ri...
ALGO
0.999995
6.36559
9f4f6156-557f-4f04-9a13-f9d3ccf1c1df
Anshu1Gupta/Leetcode_-_GFG_Solved_Problems
2022-convert-1d-array-into-2d-array/2022-convert-1d-array-into-2d-array.cpp
class Solution { public: vector<vector<int>> construct2DArray(vector<int>& original, int m, int n) { int size=original.size(); int part=size/m; int k=0; int pp=min(m,n); int kk=max(m,n); if(m*n !=size)return {}; vector<vector<int>>res; for(int i=0;i<m;...
ALGO
0.999835
6.031301
ee3b5362-f588-45f2-beab-9be3a47d97fa
iamtasir/Competitive-programming
2022/february/B_Array_Eversion.cpp
///* ***Bismillahir Rahmanir Rahim*** */ /* Algorithm Used: */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double dl; typedef unsigned long long ull; #define pb push_back #define eb emplace_back #define PB pop_back #define nn "\n" #define O_O \ i...
ALGO
0.999833
4.813548
b4bc3af3-205b-4e7d-8b75-dff933948acc
ashish4kmax/GFG_Potd
String Permutations.cpp
void permute(string str, int i,int j,vector<string>& s) { if (i == j-1) { s.push_back(str); return; } else { for (int k= i; k <= j-1; k++) { swap(str[i], str[k]); // STL `swap()` used // recur for substring `str[i+1, n-1]` permute(str, i + 1, j,s); ...
ALGO
0.999949
4.925764
f0d7f67f-7365-4441-867d-1d91e1073374
Amanthink/practices
233. Number of Digit One tle.cpp
/*233. Number of Digit One Attempted Hard Topics Companies Hint Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. Example 1: Input: n = 13 Output: 6 Example 2: Input: n = 0 Output: 0 */ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||...
ALGO
0.999919
7.093216
9b74247d-13d1-4b01-b85d-18d095ba432f
KN-2018-Praktikum/up-problems-groups-1-2
exercise-02/problem05.cpp
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << a; if((b / 10) == a % 10) { cout << "\'" << b %10; } else { cout << b; } if((c / 10) == b % 10) { cout << "\'" << c %10 << endl; } else { cout << c << end...
ALGO
0.999714
4.021247
67cefd78-8d91-425a-8fe8-b5718bbbfc28
Abhinav200207/CrackYourPlacement
Tree/ConstructBST.cpp
#include <bits/stdc++.h> using namespace std; 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), left(left), right...
ALGO
0.99998
6.621867
bab9c4ab-a78d-4acd-80ac-7d758dd1a31c
zli34/pursuit-evasion
src/main/pursuer.cpp
#include "pursuer.hpp" #include <glog/logging.h> namespace coopPE { Pursuer::Pursuer(const uint32_t & num_units, const std::shared_ptr<const Network> & network, const std::vector<std::vector<uint32_t> > & starting_locs_choices) : num_units_(num_units), starting_locs_choices_(starting_locs_choices...
ALGO
0.959218
6.924827
5beb3823-c624-4c80-a76e-678ff976b63a
79134054/VSEngine2.1
VSMath/VSOBB3.cpp
#include "VSMath.h" #include "VSOBB3.h" #include "VSMatrix3X3.h" #include "VSLine3.h" #include "VSAABB3.h" using namespace VSEngine2; /*----------------------------------------------------------------*/ VSOBB3::VSOBB3() { } /*----------------------------------------------------------------*/ VSOBB3::~VSOBB3() { } /*-...
ALGO
0.978312
4.465867
17c6cd6f-9509-4ac7-a0ae-d95e486dacc2
watertree34/ImageProcessing
opencv-master/opencv-master/samples/cpp/tutorial_code/gapi/porting_anisotropic_image_segmentation/porting_anisotropic_image_segmentation_gapi_fluid.cpp
/** * @brief You will learn how port an existing algorithm to G-API * @author Dmitry Matveev, <EMAIL>, based * on sample by Karpushin Vladislav, <EMAIL> */ #include "opencv2/opencv_modules.hpp" #ifdef HAVE_OPENCV_GAPI //! [full_sample] #include <iostream> #include <utility> #include "opencv2/imgproc.hpp" #include ...
ALGO
0.991745
6.736092
e0024626-b18b-40f2-a845-48f305a09adf
lychees/ACM-Training
Note/多校/2013/2013多校/2013多校5/数据+标程+解题报告/标程+数据/B/B_std.cpp
#include <iostream> #include <cstdio> #include <vector> #include <string> #include <algorithm> using namespace std; const int N = 26; const int M = 1000010; int pre[M]; char buffer[M]; void buildkmp(const string& mch) { int i = 1 , j = -1; pre[0] = -1; while(i < mch.size()) { while( j>=0 && mch[...
ALGO
0.99975
3.846278
d7517d7e-deb5-41da-81be-81dd0ae69672
ishandutta2007/codeforces
nikgaevoy/normal/1737/B.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; mt19937 mt(736); constexpr ll sq_naive(ll x) { int ans = 0; for (int i = 1; i < x; i++) if (i % int(floor(sqrt(i))) == 0) ans++; return ans; } template<int add> constexpr ll sq_smart(ll x) { ll l = 0, r =...
ALGO
0.999903
4.539443
48eac84d-7988-49c5-b6a9-5dc9fb177ecf
noodlescodes/weiner_index
cpp_code/weiner_index.cpp
#include <cstdlib> #include <iostream> #include "Graph.h" using namespace std; using namespace VAN_MAASTRICHT; int main(int argc, char* argv[]) { Graph g = Graph(6); g.AddUndirectedEdge(0, 1); g.AddUndirectedEdge(1, 2); g.AddUndirectedEdge(2, 3); g.AddUndirectedEdge(3, 4); g.AddUndirectedEdge(4, 5); g.AddUndi...
ALGO
0.998979
4.106359
fd07923e-98a9-42f3-a5cb-26ecb491a36c
blackbox47/UVA-Problem-Solution-Using-C-or-C-Plus-Plus
10038 - Jolly Jumpers.cpp
#include<stdio.h> #include<stdlib.h> int cp(void const *x,void const *y); int main(void) { // freopen("ee.txt","w", stdout); int a,i,arr[10000],j,kl,str[10000],p,flag,q; while(scanf("%d", &a)==1) { if(a==0) break; for(i=0;i<a;i++) scanf("%d", &arr[i]); j=0; kl=0; for(i=0...
ALGO
0.999953
3.277754
590e1c9d-0cca-478f-bce3-0004a928bfc0
Abhi-0324/LeetcodeSolutions
746-min-cost-climbing-stairs/746-min-cost-climbing-stairs.cpp
class Solution { public: int f(int index , vector<int>& cost , vector<int> &dp){ if(index ==0 || index ==1){ return cost[index]; } if(dp[index] != -1) return dp[index]; int left = f(index-1 , cost , dp) ; int right = INT_MAX; if(right>1) right = f(...
ALGO
0.999962
5.815326
339c99e5-2f86-40af-b1b3-6de340328826
ZahidTurjo/Algorithm
Dijkstra Algo/Dijkstra_Optimized.cpp
#include<bits/stdc++.h> using namespace std; vector<pair<int,int>>adj_list[105]; int dis[105]; void dijkstra(int src){ priority_queue<pair<int ,int>,vector<pair<int,int>>,greater<pair<int,int>>> pq; pq.push({0,src}); dis[src]=0; while(!pq.empty()){ pair<int,int> par=pq.top(); pq.pop(...
ALGO
0.999996
3.909902
942bef3f-68b3-441a-9fc2-5aabff44f7d2
vinhuchi/cp-chap-may-thang-nhoc
CodeForce/1837/1837C.cpp
#include <bits/stdc++.h> using namespace std; //Type using LL = long long; //Functions #define IO(value) freopen(value".inp", "r", stdin); freopen(value".out", "w", stdout); #define loop(x, start, end) for(int x=start; x < end; x++) // pass x as start to end #define loop2(x, start, end) for(int x=end-1; x >= start;...
ALGO
0.999874
3.335477
819d270c-f65a-4a36-969c-7e0e42cab65f
qingxinlianshui/CFDEM2
LIGGGHTS/LIGGGHTS-PUBLIC/lib/gpu/lal_yukawa_colloid_ext.cpp
/*************************************************************************** yukawa_colloid_ext.cpp ------------------- Trung Dac Nguyen (ORNL) Functions for LAMMPS access to colloid acceleration routines. _______________________...
TOOL
0.974506
5.972449
a3e43538-763d-4c79-a81c-5107045aa6da
0-jij-0/CompetitiveProgramming
Problems Archive/1000 - 1999/1998 - Fall Down.cpp
#include <iostream> #include <vector> #include <algorithm> #include <functional> using namespace std; vector<string> G; void simulateFallDown(string &s) { int l = 0, r = 0, n = (int)s.size(); while (l != n) { if (s[l] == 'o') { r = l = l + 1; continue; } if (r != n && s[r] != 'o') { r++; continue; } sort(s.be...
ALGO
0.999593
4.994395
2a12ec28-87b7-458d-a4d1-94658919f3d1
yzzupgo/MFTCG
Data/abc170_b/VusatOrujov/wa/17909418.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> #define black_tree tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> #define pair_black_tree tree<pair<ll,ll>,null_type,less_equal<pair<ll,ll>>,rb_tree_tag,tree_order_statistics_node_update> #d...
ALGO
0.999674
3.115077
ea5f1e10-b3ea-4d21-a1d8-852cc9770c6f
YJK0805/onlinejudge_ac_code
TOJ/44 E. Theory.cpp
#include <bits/stdc++.h> using namespace std; struct node{ int x,y,dis; }; int n,m,sx,sy,ex,ey; int board[1010][1010],dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};; node q[2000000]; bool used[1010][1010]; int bfs(int sy,int sx,int ey,int ex){ node cur,nxt; memset(used,false,sizeof(used)); q[0].y=sy; q[0].x=sx; q[0].dis=0; ...
ALGO
0.999784
5.115607
5c80338a-4e3b-47bb-8dac-015abb4d1885
hgiangcao/HW2ML
beta-binomial.cpp
#include<iostream> #include<cmath> #include<cstdio> #include<cstring> #include<vector> using namespace std; vector <string> sequence; string tempStr; double a, b; int nSize =0; int main() { freopen ("test2.txt","r",stdin); while (cin >> tempStr) { sequence.push_back(tempStr); tempStr.assign(""); } nSize...
ALGO
0.994884
3.071503
75c50993-c9e1-426b-9cdb-9350af3fc16c
greenbeanpie/OI-training
NOIP2023-ZJ/ZJ-0710/dict/dict.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int n, m; char words[3005][3005]; bool cmp(char a, char b) { return a > b; } int main() { freopen("dict.in", "r", stdin); freopen("dict.out", "w", stdout); cin >> n >> m; if(n == 1) cout << 1 << endl; else if(m == 1) { char s = '...
ALGO
0.999971
3.287689
0a8d759e-922f-44df-a58b-e39e4e892ccb
camilagomes05/CG-GA
dependencies/glm/test/gtx/gtx_fast_trigonometry.cpp
#include <glm/gtc/type_precision.hpp> #include <glm/gtx/fast_trigonometry.hpp> #include <glm/gtx/integer.hpp> #include <glm/gtx/common.hpp> #include <glm/gtc/constants.hpp> #include <glm/gtc/ulp.hpp> #include <glm/gtc/vec1.hpp> #include <glm/trigonometric.hpp> #include <cmath> #include <ctime> #include <cstdio> #includ...
TEST
0.982012
6.199861
99149bfe-1067-48f5-b931-d6a6d0445836
morpheus-30/LeetCode
1036-rotting-oranges/rotting-oranges.cpp
class Solution { public: int orangesRotting(vector<vector<int>>& grid) { int m = grid.size(); int n = grid[0].size(); queue<pair<int,int>> q; vector<vector<int>> visited = grid; int countFreshOrange = 0; for(int i=0;i<m;i++){ for(int j =0 ;j<n;j++){ ...
ALGO
0.999981
6.178379
3c053297-651e-47b3-bd63-888a74f00a86
hajimeIppo-cmd/cp-codes
Baekjoon OJ/02000-02999/2875.cpp
#include <iostream> using namespace std; int main() { int n, m, k; scanf("%d %d %d", &n, &m, &k); while (k > 0) { if (n > 2 * m) n--, k--; else m--, k--; } printf("%d", (n > m * 2) ? m : n / 2); return 0; } /* ع : : : : 1. 2. */ //////////////////////////////////////////////////////////...
ALGO
0.999852
3.653162
d6374184-040b-496b-8cc4-dc730f5110a1
Srivastava/Hello-World
CodeForces/461A.cpp
#include <iostream> #include <vector> #include <cmath> #include <stdio.h> #include <algorithm> #include <iterator> #include <climits> #include <numeric> #include <queue> int main() { unsigned long long n; std::cin>>n; std::vector<unsigned long long> value; unsigned long long sum=0,score=0; while(n--) { unsi...
ALGO
0.999835
3.942083
70103c42-e9c9-496c-8ea9-2465d05f3473
SovietPower/My-OI-ACM
计算几何/BZOJ.1007.[HNOI2008]水平可见直线(凸壳 单调栈).cpp
/* 1800kb 160ms ԿҪάһ͹ǡ ȶбʴСбСֱһᱣģΪ͹ϵΡ άһջջΪǰɼֱ(б) һֱlʱԷ lջֱl'Ľp l'ջǰջֱ Ľp'࣬ôlḲl'(ֱһֱߵĽҲԣ)l'l pp'Ҳ࣬ջֱߣlջغϣôֱӦûḲl'l'l бʷŸıʱҲһġջĹӦpp'Ҳࡣ жֱбͬؾֱ߻ḲǽؾСֱߡɡ */ #include <cstdio> #include <cctype> #include <algorithm> #define gc() getchar() const int N=5e4+5; int n,sk[N],top,Ans[N]; struct Line{ int k,b,id; bool operator <(co...
ALGO
0.999998
3.952245
c343acb6-e4ed-496e-a674-92021b27160a
ploynapat10/DevC-Practice
6.1.cpp
#include <iostream> using namespace std; int main() { int a; int b; cin >> a; cin >> b; int sum = a + b; cout << sum; return 0; }
ALGO
0.967269
3.487273
588c3486-8589-4f6e-8593-d843c998e0ef
SPFA-newbie/leet-code-answer
#2611.cpp
#include<vector> #include<algorithm> using namespace std; inline bool cmp(int a, int b) {return a>b;} class Solution { public: int miceAndCheese(vector<int>& reward1, vector<int>& reward2, int k) { vector<int> sub; int sum=0; for(auto i=reward1.begin(),j=reward2.begin(); i!=reward1.end(); ...
ALGO
0.99995
4.714479
ddf4b4cd-01a9-4397-9c8f-366c154102bb
TrellixVulnTeam/pytorch_woodside_H60Q
aten/src/ATen/native/ReplicationPadding.cpp
#include "ATen/ATen.h" #include "ATen/NativeFunctions.h" #include <ATen/Parallel.h> #include <algorithm> namespace at { namespace native { namespace { template <typename scalar_t> static void replication_pad1d_out_frame( scalar_t *input_p, scalar_t *output_p, long nslices, long iwidth, long owidth, ...
DATA
0.950747
5.927725
e85d7f29-fa1f-4015-95ee-947c7ccb70ed
xuxu998/DataStructureAndAl
IndividualContestProblem/SumRootToLeafNumber.cpp
// https://leetcode.com/problems/sum-root-to-leaf-numbers/ #include <bits/stdc++.h> using namespace std; 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...
ALGO
0.999987
5.90081
b50a4b09-7a2a-454a-a282-a5dcf88f5498
maheshjainckd/Hacktoberfest2022-for-everyone
CPP/Graph-patterns/dfs/10-employee-importance.cpp
/* // Definition for Employee. class Employee { public: int id; int importance; vector<int> subordinates; }; */ class Solution { unordered_map<int, Employee *> mp; int dfs(int id) { auto it = mp[id]; int ans = it->importance; for (auto &s : it->subordinates) ...
ALGO
0.999964
6.323638
e5895e74-ee1c-46d4-a344-78b8da25ff33
niazlv/universityKPFU1courseC--
laba11/src/labwork11_1.cpp
#include <stdio.h> #include <stdlib.h> #include <time.h> // a) Функция для вывода матрицы void printMatrix(int **matrix, int rows, int cols) { for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { printf("%d ", matrix[i][j]); } printf("\n"); } } // b...
ALGO
0.99908
4.87111
caf07f8b-79b4-4b2a-85b1-e54ffe1fe64f
pranay0-2/DSA-2.0
4loops/2.cpp
// print n natural number #include <iostream> using namespace std; int main(){ int n; cout<<"Enter n: "; cin>>n; for(int i = 1; i <= n; i++){ cout<<i<<endl; } return 0; }
ALGO
0.986307
3.504737
02e3fc61-9646-4b73-bd95-5b6a831fc799
gcowan/RapidFit
pdfs/src/Bd2JpsiKstar_withTimeRes_withAverageAngAcc_rTerms.cpp
// $Id: Bd2JpsiPhi_mistagParameter_withTimeRes_withAverageAngAcc.cpp,v 1.1 2009/11/10 10:35:49 gcowan Exp $ /** @class Bd2JpsiPhi_mistagParameter_withTimeRes_withAverageAngAcc Bd2JpsiPhi_mistagParameter_withTimeRes_withAverageAngAcc.cpp * * RatagFit PDF for Bd2JpsiPhi with average angular acceptance input as a param...
DATA
0.9284
5.891704
148cae0a-5943-4ac1-9e3c-49d2e4a443f8
Venkat-Gowtham/Leet_Code_Problems
117-populating-next-right-pointers-in-each-node-ii/populating-next-right-pointers-in-each-node-ii.cpp
/* // Definition for a Node. class Node { public: int val; Node* left; Node* right; Node* next; Node() : val(0), left(NULL), right(NULL), next(NULL) {} Node(int _val) : val(_val), left(NULL), right(NULL), next(NULL) {} Node(int _val, Node* _left, Node* _right, Node* _next) : val(_...
ALGO
0.999894
5.56105
b8629f10-5f7b-41fe-874a-000a00c33675
WayneYann/OpenFOAMTrainingCombustionTest
Libraries/eigen-3.3.3/doc/examples/TutorialLinAlgRankRevealing.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix3f A; A << 1, 2, 5, 2, 1, 4, 3, 0, 3; cout << "Here is the matrix A:\n" << A << endl; FullPivLU<Matrix3f> lu_decomp(A); cout << "The rank of A is " << lu_decomp.rank() << endl; c...
ALGO
0.999806
3.725084
c74856ab-9a43-490b-876a-4c9d4cc0a9a8
mooooonoe/BAEKJOON
프로그래머스/0/181876. 소문자로 바꾸기/소문자로 바꾸기.cpp
#include <string> #include <vector> #include <iostream> #include <cctype> using namespace std; string solution(string myString) { string answer = ""; for(char c : myString){ if(c<'a'){ c = tolower(c); answer.push_back(c); } else{ answer.push_bac...
ALGO
0.999591
5.657206
36dd0aa1-2e4f-4f1c-86ba-e0e8b8d9d59f
RAJA-CHITTINEEDI/DSA0151-C-
unit II/medium/8.remove duplicates medium.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> arr = {15, 14, 25, 14, 32, 14, 31}; sort(arr.begin(), arr.end()); auto last = unique(arr.begin(), arr.end()); arr.erase(last, arr.end()); cout << "Sorted Array = {"; for(size_t i = 0; i <...
ALGO
0.999324
5.500719
a7ae1e90-1c44-4c73-9563-d9f053ca17d6
koba-e964/contest
atcoder/code-formula-2014-final/f.cpp
#include <cassert> #include <cmath> #include <cstdlib> #include <iostream> #include <vector> #define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++) using namespace std; vector<pair<int, int> > gacha(void) { const int W = 1500; const int N = 100; const int TH = 100; vector<pair<int, int> > res(N); for (int i = N;...
ALGO
0.995922
3.377948
520e913a-aed7-4189-a125-5fe6f4682da8
ishandutta2007/codeforces
aid/normal/627/E.cpp
#include <iostream> #include <algorithm> #include <set> using namespace std; const int MAXN = 3005; pair<pair<int, int>, int> p[MAXN]; char col[MAXN]; int x[MAXN], y[MAXN], id[MAXN], prv[MAXN], nxt[MAXN]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int r, c, n, k; cin >> r >> c >> n >>...
ALGO
0.99967
3.107497
d909c3c9-b671-46d3-a985-b288db38c587
MichaelSedrak/Interactive-ARAP
ARAP/libs/libigl-2.2.0/tests/include/igl/circulation.cpp
#include <test_common.h> #include <igl/circulation.h> #include <igl/edge_flaps.h> #include <igl/unique_edge_map.h> #include <igl/matlab_format.h> TEST_CASE("circulation: single_edge", "[igl]") { // 7 // /₆|₇\ // 4 - 5 - 6 // |₂/₃|₄\₅| // 1 - 2 - 3 // \₀|₁/ // 0 cons...
TEST
0.932782
5.176156
16ee7c53-d5ff-4242-b8fd-f8f59d74a79a
mikechen66/CPP-Programming
CPP-Primer-Plus/chapter06-branching/ifelseif.cpp
// ifelseif.cpp -- using if else if else #include <iostream> const int Fave = 27; int main() { using namespace std; int n; cout << "Enter a number in the range 1-100 to find "; cout << "my favorite number: "; do { cin >> n; if (n < Fave) cout << "Too low -- guess a...
ALGO
0.98303
3.170077
0fbb8661-54a5-473c-8ae2-16ee8917224f
hajimeIppo-cmd/cp-codes
ICPC/The 2021 ICPC Asia Jakarta Regional Contest/I.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define sz(a) (int)(a).size() #define all(x) (x).begin(), (x).end() const int MAXN = 202020; int n; struct Planet { int r, d, t; }; vector<Planet> a; vector<Planet> arr[MAXN]; void input() { cin >> n; a.resize(n); for (auto& i : a) ...
ALGO
0.999668
4.401743
66309378-5fe8-46f8-9ddf-267d250ac004
fernando-ff/LP
Ranges/min/main.cpp
#include <iostream> #include <iterator> using namespace std; const int *min( const int *first, const int *last) { auto min { first+1 }; while( first != last ){ if( *min > *first ){ min = first; } first++; } return min; } int main(void){ int A[] { 1, 2, -3, -4, 5...
ALGO
0.999578
4.969281
7250fe56-1aa9-4ab8-bc7c-1d34875c92da
MohamadCM/Parallel-Programming-Practice
OpenMP_3-Tensor multiplication.cpp
// // Created by mohamad on ۲۰۲۱/۵/۶. // #define dimension 128 #define n_threads 1 #include <iostream> #include <ctime> #include <omp.h> using namespace std; void init_fill_array(int ***array, bool fill); void print3D(int ***); int main() { int size; int ***A = (int ***) malloc(dimension * sizeof(int **));...
ALGO
0.994031
3.815175
dc058910-1e1b-454e-a3d6-eaea2cd28a54
tinhngovnptho/Code
CP/Code THPT/DTQG 25/ThinhGiang 25/Le Minh Hoang/11-10/join/join.cpp
// Author: tinhnopro (ngh) #include<bits/stdc++.h> using namespace std; #define el '\n' #define fi first #define se second #define REP(i, a, b) for (int i = (a); i < (b); ++i) #define FOR(i, a, b) for (int i = (a); i <= (int) (b); ++i) #define FORD(i, a, b) for (int i = (a); i >= (int) (b); --i) #define all(v) (v).be...
ALGO
0.999982
3.68921