uuid
stringlengths
36
36
repo_name
stringlengths
5
123
relative_path
stringlengths
5
4k
content
stringlengths
33
2.85M
category
stringclasses
6 values
algo_rel_score
float64
0.85
1
quality_score
float64
3
8.76
eff67d20-0422-4d4e-8156-503f28703db8
RokwonK/Problem_solving
algospot/삽입_정렬_시간_재기.cpp
#include <iostream> #include <vector> using namespace std; struct Fenwick { vector<int> tree; Fenwick(int n) : tree(n+1){} int sum (int pos) { pos++; int result = 0; while(pos > 0) { result+= tree[pos]; pos &= (pos-1); } return result; }...
ALGO
0.999571
5.039783
8c5d352c-5df5-417d-89ae-4c7425cb2032
AkhileshAher/FDS-Fundamentals-of-Data-Structure
Pizza Parlour Circular Queue.cpp
/* Problem Statement : Pizza parlor accepting maximum M orders. Orders are served in first come first served basis. Order once placed cannot be cancelled. Write C++ program to simulate the system using circular queue using array. */ // CODE : #include <iostream> const int MAX = 5; using namespace std; class PizzaPa...
ALGO
0.999038
6.589686
174d8c1b-5380-4e4e-ab38-9c0133704112
Shivam-Prajapati-59/Shivam-C-codes
All_Heaps_Codes_C++/Merge two binary Max heaps.cpp
class Solution{ public: void Heapify(vector<int> &arr, int n, int i) { int largest = i; int left = 2*i +1; int right = 2*i +2; if (left < n && arr[largest] < arr[left]) { largest = left; } if (right < n && arr[largest] < arr[right]) { largest = right; } if...
ALGO
0.999979
4.961723
1bf38982-db28-479b-91da-724dbf9f6e16
ramadhanhadiatmaa/jurnallangit
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.9988
6.76073
ec44515c-79f2-41ab-9dec-d558413f99ab
dhruveshpatel25/DSA
20-Dynamic Programming/133-Buy and Sell Stocks IV/BuyAndSellStocksIVUsingBottomUpApproach.cpp
/*Best Time to Buy and Sell Stock IV You are given an integer array prices where prices[i] is the price of a given stock on the ith day, and an integer k. Find the maximum profit you can achieve. You may complete at most k transactions: i.e. you may buy at most k times and sell at most k times. Note: You may not engage...
ALGO
0.999917
6.622589
7dc42685-3aae-44a4-9778-84d03c2ae8c5
giannagalard/CSC-Courses
Analysis of Algorithms/Lab 1/main.cpp
#include <iostream> #include <string> #include <iomanip> #include <ctime> #include <time.h> using namespace std; int const max1 = 10; // recursive algo int FiboR(int n); // non recursive algo int FiboNR(int n); // modified recursive algo int MODfibR(int n); int main() { // time required to execute clock_t tim...
ALGO
0.998666
4.787443
8de00b6b-f957-42b0-9a54-d7b29eb51149
FahimCC/Problem-Solving
Codeforces/B. Square Filling.cpp
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int rows,columns,aMatrix[52][52],bMatrix[52][52],a[100000],operationCount = 0,k = 1,flag = 0; cin>>rows>>columns; for(int i=1;i<=rows;i++) for(int j=1;j<=columns;j++) { ...
ALGO
0.999703
3.237638
4130ccb1-59ef-4f8c-8e18-e831c9c9d7b0
kLd-M/ProblemSolving
c++/medium/451. Sort Characters By Frequency.cpp
//Approach: Use a priority queue of type Pair to sort characters by frequency. // use a frequency array to count occurrences of each character // loop around the string to populate the frequency array // push each character and its frequency into the priority queue // pop elements from the priority queue to build the r...
ALGO
0.999987
6.244367
7352952f-5a52-4027-9d1e-235ad121c30a
Ansore/LeetcodeSolutions
18.valid-parentheses/ValidParentheses.cpp
#include <iostream> #include <stack> #include <string> using namespace std; class Solution { public: int getValue(char& c) { switch (c) { case '(': return 1; case ')': return -1; case '[': return 2; case ']': return -2; case '{': return 3; case '}': return -...
ALGO
0.999254
5.590436
abeb0f81-8640-4add-a14d-95926b86a543
rhks7410dyd/PSstoringplace
Dynamic_Programming/boj17070.cpp
#include <iostream> using namespace std; int N; int map[16][16]; int dp[16][16][3];//마지막 인덱스에서 0은 가로, 1은 세로, 2는 대각선의 형태이다. int main(){ cin.tie(NULL); cout.tie(NULL); ios::sync_with_stdio(false); cin >> N; for(int i = 0 ; i < N ; i++){ for(int j = 0 ; j < N ; j++){ cin >> map[i][j]; } } dp[0][1][0] ...
ALGO
0.999927
3.641988
b7c93829-6199-41c6-b6d5-60aefa85273d
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_7560_11.cpp
#include <bits/stdc++.h> using namespace std; int n, m; int f[100000 + 1109]; char s[100000 + 1109], a[100000 + 1109]; int slen, alen; int DP[100000 + 1109]; int Cnt[100000 + 1109]; int Pre[100000 + 1109]; bool b[100000 + 1109]; int main() { scanf("%d%s%d", &n, s, &m); int now = 0; for (int i = 0; i < n; i++) { ...
ALGO
0.99997
3.631622
28dc5474-c872-4e07-bfe0-968e09826b3d
mooner92/2022algo
1181-단어정렬/1181-단어정렬1.cpp
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; bool compare(string a,string b){ if(a.length()==b.length()){ return a<b; } //길이가 같으면 사전순으로 else return a.length()<b.length(); //길이가 다르면 길이순으로 } string s[20001]; int main(){ //vecto...
ALGO
0.999918
4.838736
9fe932b4-ebbe-4470-abc1-7718ecf35618
MSZ-006V/LeetcodeScript
TOP150/nt_Top K Frequent Elements.cpp
class Solution { public: vector<int> topKFrequent(vector<int>& nums, int k) { // tc O(nlogk), sc O(n) unordered_map<int, int> ht; for(auto& num : nums){ ht[num]++; } auto cmp = [](auto a, auto b){ return a.second > b.second; }; priori...
ALGO
0.999985
6.108781
5e40653f-ace1-4699-8c9a-33e429789f7a
adityanjr/code-DS-ALGO
CodeForces/Complete/1200-1299/1257C-DominatedSubarray.cpp
#include <cstdio> #include <map> int main(){ long t; scanf("%ld", &t); while(t--){ long n; scanf("%ld", &n); long res(-1); std::map<long, long> f; for(long p = 0; p < n; p++){ long a; scanf("%ld", &a); if(f.count(a)){ long dist = p - f[a] + 1; ...
ALGO
0.999843
3.686273
3942edf6-be0a-4329-9a68-953999596f5e
mwskibinski/stephen-prata-cpp-book
ch16_ex08/ex16_08_v2.cpp
#include <iostream> #include <list> #include <string> #include <algorithm> void print_name(const std::string & str) { std::cout << str << '\n'; } int main() { using std::cout; using std::cin; using std::list; using std::string; list<string> bolek_names; list<string> lolek_names; string tmp; cout << "\tImi...
ALGO
0.998238
5.007781
4f244486-0319-4820-a60a-315cbd94ad67
digesh099/diGeek
dp_programms/Cpp/cmlx.cpp
#include<iostream> using namespace std; class abc {int a,b; public: void get(int x,int y) {a=x; b=y; } void disp() {cout<<"a+ib="<<a<<"+i"<<b<<endl; } friend void sum(abc,abc); friend void diff(abc,abc); }; void diff(abc o1,abc o2) {cout<<"sum="<<o1.a-o2.a<<"+i"<<o1.b-o2.b<<endl; } void sum(abc o1,abc ...
ALGO
0.981813
4.506558
2bd25fba-4feb-4822-8bd3-e33625755208
ishandutta2007/codeforces
cheetose/normal/894/D.cpp
#include<cstdio> #include<cstdlib> #include<iostream> #include<vector> #include<queue> #include<bitset> #include<string> #include<stack> #include<set> #include<unordered_set> #include<map> #include<unordered_map> #include<cstring> #include<complex> #include<cmath> #include<iomanip> #include<numeric> #include<algorithm>...
ALGO
0.999945
3.723283
c62c326f-b274-4bd3-8e50-202e0e60e091
ishandutta2007/codeforces
rubikun/normal/843/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; } #define all(x) (x).begin(),(x).end() #define fi first #define ...
ALGO
0.999969
3.30927
aa0d8c83-6f09-417a-95db-3671dfcfaf29
Vishal9971/DataStructure-Algorithm-in-cpp
largestNumber.cpp
#include<iostream> using namespace std; int main(){ int n; cin >> n; int largestNo= 0; int no; int i = 0; while(i<n){ cin >> no; if(largestNo<no){ largestNo = no; } i++; } cout << largestNo<<endl; }
ALGO
0.999813
3.415936
753e7e48-1ff3-4782-8c24-11422d08a511
PhuocThien06/MyFirstRepo
Week 1/Ex5/Exercise5.cpp
#include <iostream> using namespace std; bool IsSorted(int arr[], int n) { if (n == 0 || n == 1) { return true; } if (arr[0] > arr[1]) { return false; } return IsSorted(arr + 1, n - 1); } int main() { int arr[] = { 1,2,3,4,5 }; int n = sizeof(arr) / sizeof(arr[0]); if (IsSorted) cout << "The array is sort...
ALGO
0.999752
4.969778
808797fd-605c-4eac-97f9-464673d2e0af
tsudu214/protbb
ch02/fig_2_17.cpp
#include <cmath> #include <iostream> #include <list> #include <map> #include <random> #include <utility> #include <vector> #include <tbb/tbb.h> using PrimesValue = std::pair<int, bool>; using PrimesList = std::list<PrimesValue>; bool isPrime(int n); void fig_2_17(PrimesList& values) { tbb::parallel_for_each(values...
ALGO
0.998291
5.851743
a44ee86d-605f-4151-945c-20d18d4de977
hacch141/Coding-Practice
LeetCode/869.Reordered-Power-of-2.cpp
// 869. Reordered Power of 2 class Solution { public: long count(int n) { long res = 0; while(n > 0) { res += pow(10,n%10); n /= 10; } return res; } bool reorderedPowerOf2(int n) { long num = count(n); for (int i = 0; i < 32; i++)...
ALGO
0.99911
6.382227
49382aea-edc0-49a5-b147-367242fb9af4
Heiuhoccode/CODE_CPP
TH3-6.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int t;cin>>t; while(t--){ int n; cin>> n; int a[n]={0}; int vitri; int cnt=0; for(int i=0;i<n;i++){cout << a[i];} cout << " "; while(cnt<pow(2,n)-1){ for(int i=n-1;i>=0;i--){if...
ALGO
0.999933
3.745418
a9a9c054-ecc3-4d03-8d04-115a0df7813c
choudhary12147/cpp_with_dsa
day_15.cpp
#include<iostream> #include<vector> using namespace std; // int main(){ // int *arr = new int[]; // cout<< // return 0; // } // int main(){ // // dynamic memory alloction // int size; // cin>>size; // int *arr = new int[size]; // int x = 1; // for (int i = 0; i < size; i...
ALGO
0.95957
3.710455
a0efd770-cba8-40be-86b8-930dba1e9bd1
Old-MvM-Events/Rafmod
mvm-reversed/server/tf/bot/behavior/scenario/payload/tf_bot_payload_guard.cpp
/* reverse engineering by sigsegv * based on TF2 version 20151007a * server/tf/bot/behavior/scenario/payload/tf_bot_payload_guard.cpp * used in MvM: TODO */ ConVar tf_bot_payload_guard_range("tf_bot_payload_guard_range", "1000", FCVAR_CHEAT); ConVar tf_bot_debug_payload_guard_vantage_points("tf_bot_debug_payload_g...
TOOL
0.854507
6.12783
34e2decc-57bc-4250-85c5-deca9dc034c9
kaloronahuang/KaloronaCodebase
Practices/POJ/POJ3417.cpp
// POJ3417.cpp #include <iostream> #include <cstdio> #include <cstring> using namespace std; const int MAX_N = 2e5 + 700; int head[MAX_N], current, n, m, val[MAX_N], fa[20][MAX_N], dep[MAX_N]; struct edge { int to, nxt; } edges[MAX_N << 1]; void addpath(int src, int dst) { edges[current].to = dst, edges[cu...
ALGO
0.999936
4.29295
26147531-810c-46bf-80b2-a731dc3ea83c
Regalith/UE_ORB_SLAM3
Source/ThirdParty/OrbSlam3Library/Includes/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.968084
5.33147
915d551b-154e-41f5-9bd2-e5da545e57bb
Abhi2083/DSA
Sorting Algorithms/bubbleSort.cpp
#include <iostream> using namespace std; void BubbleSort(int arr[], int n) { for (int i = 1; i < n; i++) { bool swapped = false; for (int j = 0; j < n - i; j++) { if (arr[j] > arr[j + 1]) swap(arr[j], arr[j + 1]); } if (swapped == false) ...
ALGO
0.999179
4.572519
94356b57-a425-4e1b-a111-4fbf3c2270bc
Slian22/CompGS-GSPLaT
SIBR_viewers/src/core/graphics/Frustum.cpp
// Partially based on: // http://www.lighthouse3d.com/tutorials/view-frustum-culling #include "core/graphics/Camera.hpp" #include "core/graphics/Frustum.hpp" namespace sibr { Frustum::Frustum(const Camera& cam) { float ratio = cam.aspect(); float angle = cam.fovy(); float nearD = cam.znear(); float farD = c...
ALGO
0.980314
7.004009
e41f7adf-aed9-465a-a7f7-a724621363a2
Umesh-JNU/LeetCode-Monthly-Challenge
smallest-range-i/smallest-range-i.cpp
class Solution { public: int smallestRangeI(vector<int> &nums, int k) { int max_num = *max_element(nums.begin(), nums.end()); int min_num = *min_element(nums.begin(), nums.end()); return max(max_num - min_num - 2*k, 0); } };
ALGO
0.999915
5.473993
63e337fe-1849-40d4-848e-2df0f895a029
MARAMK123/datastructure0372
tree transvels.cpp
#include <stdio.h> #include <malloc.h> struct node { struct node *left; int data; struct node *right; }; void main() { void insert(struct node **,int); void inorder(struct node *); void postorder(struct node *); void preorder(struct node *); struct nod...
ALGO
0.999585
5.16249
7412e430-2306-412b-9d6a-b53357d6c1fd
varunan-vara/AdventOfCode2022
Day 5/solution.cpp
#include <iostream> #include <stdlib.h> using namespace std; class Stack { private: char containers[100]; int size = 0; public: Stack(); void setVar(char containerlist[], int containersize); int getSize(); void addContainers( char containerList[], int container...
ALGO
0.999349
3.470658
d31e8695-4deb-494c-b2e1-05811c28b5d4
wuxxerno/aoc2023
day3.cpp
#include <iostream> #include <fstream> #include <string> #include <string.h> using namespace std; bool is_digit(int num) { //Returns wether a character is in the ascii number range return num >= 48 && num <= 57; } int main() { int sum = 0; string lines[1024]; ifstream f("data"); int lc = 0; in...
ALGO
0.999538
3.985452
0bb634ec-1731-430d-9105-ed379821e505
ehnryx/acm
kattis/inflation.cpp
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; typedef long long ll;...
ALGO
0.999948
3.755954
cfd8886f-8c26-4074-80d9-6b915502dce0
chanchann/Thread
src/01_inro/05_join.cpp
/* Suppose Main Thread has to start 5 Worker Threads and after starting all these threads, main function will wait for them to finish. After joining all the threads main function will continue, */ #include <iostream> #include <thread> #include <algorithm> #include <vector> #include <functional> class WorkerThread {...
TOOL
0.954786
5.417165
3f1862dd-5e4c-4a17-9a93-124f79f53e8a
codeSprinterss/codeSprinterss
chungchae/brute_force/PGS_카펫.cpp
#include <stdio.h> #include <stdlib.h> #include <iostream> #include <sstream> #include <string> #include <algorithm> #include <cmath> #include <vector> #include <numeric> #include <stack> #include <queue> #include <unordered_map> #include <map> #include <set> using namespace std; // PGS 카펫 (brute_force) (L2) vector<...
ALGO
0.999087
4.987247
dcfeaee8-5df2-4383-b23c-08b30aa8486a
jagjitalagh/100daycoding
0050-powx-n/0050-powx-n.cpp
class Solution { public: double myPow(double x, int n) { double ans=1.0; long long nn=n; if(n<0){nn=-1*nn;} while(nn){ if(nn%2==1){ ans=ans*x; nn=nn-1; } else{ x=x*x; nn=nn/2; ...
ALGO
0.999814
5.936806
15190f8d-8c0c-49a3-b587-af17f59ac5aa
KamilKrauze/Honours-Project
OpenCV-CPP/thirdparty/opencv_install/sources/modules/core/src/kmeans.cpp
#include "precomp.hpp" #include <opencv2/core/utils/configuration.private.hpp> #include <opencv2/core/hal/hal.hpp> ////////////////////////////////////////// kmeans //////////////////////////////////////////// namespace cv { static int CV_KMEANS_PARALLEL_GRANULARITY = (int)utils::getConfigurationParameterSizeT("OPEN...
ALGO
0.999781
6.582247
4cbd3367-0d3a-4479-9fbc-8e1491b323cc
christinazavou/ANNFASS_Structure
octree/octree/transform_points.cpp
#include "transform_points.h" #include <random> #include <ctime> DropPoints::DropPoints(int dim, float ratio, const float* bbmin, const float* bbmax) { dim_ = dim; ratio_ = ratio; for (int i = 0; i < 3; ++i) { bbmin_[i] = bbmin[i]; bbmax_[i] = bbmax[i]; iwidth_[i] = (float) dim / (bbmax[i] - bbmin[i]...
ALGO
0.991844
5.956439
1cbf3fed-febf-4eb4-b26b-e033e16d68d4
codewithnick/dsaandcp
codeforces/sheet 3/search in matrix.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int main(){ int n,m,i,j,x; cin>>n>>m; int arr[n][m]; for(i=0;i<n;i++){ for(j=0;j<m;j++){ cin>>arr[i][j]; } } cin>>x; for(i=0;i<n;i++){ for(j=0;j<m;j++){ if(x==arr[i][j]) ...
ALGO
0.99846
3.975261
7ae1e13c-f15a-4414-9342-84151d138b2a
devsamin/Learn-Data-Structure
Assignment_2_M_16/Same_or_Not.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n,m; cin>>n>>m; stack<int> st; queue<int> q; for(int i=0;i<n;i++) { int x; cin>>x; st.push(x); } for(int i=0;i<m;i++) { int y; cin>>y; q.push(y); } int flag = 1; ...
ALGO
0.99998
3.748733
340f40a8-17ed-4b88-b081-305ea7cdfcc0
bothemrun/CAP-Complete-Algorithmic-Programming
Leetcode_All_Solved/2495.cpp
class Solution { public: long long evenProduct(vector<int>& nums) { long long odd_cnt = 0; long long n = nums.size(); long long odd_low = 0; while(odd_low<n){ while(odd_low<n && !( nums[odd_low]%2 == 1) ) odd_low++; if(!(odd_low<n))break; ...
ALGO
0.999969
5.591573
03072ea5-9e92-49a8-8105-bc0159bb61dd
revbayes/revbayes.archive
src/revlanguage/functions/math/Func_standardDeviation.cpp
#include "StandardDeviationFunction.h" #include "Func_standardDeviation.h" #include "ModelVector.h" #include "Real.h" #include "RealPos.h" #include "RlDeterministicNode.h" #include "TypedDagNode.h" using namespace RevLanguage; /** default constructor */ Func_standardDeviation::Func_standardDeviation( void ) : TypedFu...
ALGO
0.96157
6.463933
d590af78-5c85-41db-a43d-3d4564ed4ddf
raincross7/code-similarity
codes/train_code/problem334/problem334_254.cpp
#include <algorithm> #include <bits/stdc++.h> #include<iostream> #include<string> using namespace std; #define rep(i, n) for (int i = 0; i <(int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long const ll MOD=100000007; const ll INF=1000000101001; int main(){ int n;cin >> n; string s,t;cin>>s>>t;...
ALGO
0.999989
3.502954
fcf2014d-0a17-4e0c-a47f-a32414f22541
Informatimukas/Solutions
Codeforces/2129/C3.cpp
#include <bits/stdc++.h> using namespace std; vector<int> Construct(int lef, int rig, int x) { int n = 1; while (n * (n + 1) / 2 <= x) n++; n--; vector res = {lef}; for (int i = 0; i < n - 1; i++) { res.push_back(lef); res.push_back(rig); } res.push_back(lef); in...
ALGO
0.999944
3.981374
c01011d3-9ad7-46d8-80ad-d23d9a1a940c
fanshixiong/slam-
vio/learn_vins/VINS-Mono-code-annotation/pose_graph/src/ThirdParty/DVision/BRIEF.cpp
#include "BRIEF.h" #include "../DUtils/DUtils.h" #include <boost/dynamic_bitset.hpp> #include <vector> using namespace std; using namespace DVision; // ---------------------------------------------------------------------------- BRIEF::BRIEF(int nbits, int patch_size, Type type): m_bit_length(nbits), m_patch_size(...
ALGO
0.980702
5.879892
dd08fbca-38bd-4f91-9f08-796dd7e8fbef
anhdung2k1/datastructure-algorithms
onclass/ex6/Stack.cpp
#include <iostream> using namespace std; struct LinkedList { char data; LinkedList* next; LinkedList(char c) { this->data = c; this->next = NULL; } }; class Stack { private: LinkedList* top; public: Stack() { top = NULL; } void push...
ALGO
0.993772
4.113769
2f2419be-2270-451e-96f1-f23de808f269
Kaileshwaran13/CodeChef
1600 - 1800 difficulty rating/Three Numbers.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { long long a[3]; cin >> a[0] >> a[1] >> a[2]; sort(a, a + 3); if ((a[1] - a[0]) % 2 == 0 && (a[2] - a[1]) % 2 == 0) { int temp = (a[1] - a[0]) / 2 + (a[2] - a[0])...
ALGO
0.999739
4.229975
cac8a702-4ffc-43fd-85fd-d6bad6ec568c
geekzzz/IntroToAlgorithm_CPP
PlayGround/530.二叉搜索树的最小绝对差.cpp
/* * @lc app=leetcode.cn id=530 lang=cpp * * [530] 二叉搜索树的最小绝对差 */ // @lc code=start /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullpt...
ALGO
0.999991
6.998248
8bdd94c5-aae3-43a4-a67e-9ae8bd7a192a
H-Shen/MyCodeCollection
Leetcode/96/96.cpp
using ull = unsigned long; constexpr ull N = 20; constexpr ull f(ull n, ull m) { ull sum = 1; m = min(n - m, m); for(ull i = 1, j = n;i <= m; i++, j--) sum = sum * j / i; return sum; } template<ull N> struct CombStruct { array<int, N> A; constexpr CombStruct() : A() { for (ull ...
ALGO
0.999967
6.036444
9220cc57-4575-490e-9329-659b9a4b8f30
takashigoto1207/atcoder
abc3xx/abc377/abc377_a.cpp
#include <bits/stdc++.h> #include <atcoder/all> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using namespace atcoder; using ll = long long; int main() { string S; cin >> S; sort(S.begin(), S.end()); if (S == "ABC") cout << "Yes" << endl; else cout << "No" << endl; return 0; ...
ALGO
0.999969
4.814515
37195591-3b12-489a-8083-3e4bb887ad80
kunal7bhalla/DSA
Difficulty: Easy/Armstrong Numbers/armstrong-numbers.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: bool armstrongNumber(int n) { // code here int temp=n; int count=0; while(temp>0...
ALGO
0.998549
6.539297
e71d6950-7164-4deb-bec4-095104ce49ed
Andreyhs04/exercicio1
exercicio1/exercicio1.cpp
#include <iostream> /*using namespace std; int main() { int instalacao = 300; int limpeza = 150; int manutencao = 499; int soma = instalacao + limpeza + manutencao; cout << soma; return 0; }*/ /*using namespace std; int main() { int receber = 35; int horas = 8; int mult = receber * horas; cout << mult; r...
TOOL
0.973193
3.421354
98c9f535-2c64-458b-8bef-d4d97b34b541
ishandutta2007/codeforces
gyz_gyz/normal/1182/E.cpp
#include<bits/stdc++.h> #define rep(i,x,y) for(int i=(x);i<=(y);++i) #define dep(i,x,y) for(int i=(x);i>=(y);--i) #define see(x) (cerr<<(#x)<<'='<<(x)<<endl) #define pb push_back #define fr first #define sc second using namespace std; typedef long long ll; const int N=1e6+10; const int mo=1e9+7; struct mt{ ll a[3][3];...
ALGO
0.999988
3.365169
6b47d932-3513-4626-9db6-c271f04aeca8
ApoorvaSharma7/C-plus-plus
7.cpp
// Check whether a character is uppercase, lowercase, digit, or special character. #include<iostream> using namespace std; int main(){ char n; cout<<"enter character: "; cin>>n; if(n>='A' &&n<='Z'){ cout<<"uppercase"<<endl; } else if(n>='a'&& n<='z'){ cout<<"lowercase"<<endl; ...
TOOL
0.958677
3.552424
3c47bee3-bdcc-4894-bf37-c3e60c3e963e
monissheikh1234/DSA
0451-sort-characters-by-frequency/0451-sort-characters-by-frequency.cpp
class Solution { public: string frequencySort(string s) { // Step 1: Count frequency of each character unordered_map<char, int> freq; for (char c : s) { freq[c]++; } // Step 2: Move data to vector<pair<char, int>> vector<pair<char, int>> vec(freq.begin(), freq.end()); // Step ...
ALGO
0.999982
6.525245
6aed060d-aa5f-455d-91db-a67fc2c124f5
Sonu08-Sto/Data-Structure-Algorithms
sorted_manner_DLL.cpp
#include<iostream> using namespace std; struct Node { int data; Node *next; Node *prev; Node(int x) { data=x; next=NULL; prev=NULL; } }; Node *insert(Node *head,int data) { Node *temp=new Node(data); if(head==NULL) return temp; if(head->data >= temp->dat...
ALGO
0.999973
4.18594
acf64350-0fd1-4b4b-b0e1-9d4257226790
EPM-HPC/Tool-Benchmark-Collection
Benchmark-Collection/Rodinia/openmp/bfs/bfs.cpp
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <omp.h> //#define NUM_THREAD 4 #define OPEN FILE *fp; //Structure to hold a node information struct Node { int starting; int no_of_edges; }; void BFSGraph(int argc, char** argv); void Usage(int argc, char**argv){ fprintf(stderr...
ALGO
0.996589
3.599262
5d5b8ac2-aede-4a72-8618-1d443487bdb1
Aicry/Algotithms
ACM/A1.cpp
#include<iostream> using namespace std; int main(){ string a; string b; cin >> a >> b; int m = a.length(); int n = b.length(); int count = 0; for (int i = 0; i < m;++i){ string t; t = a.substr(i, n); if(t==b){ count++; } if(count==2) ...
ALGO
0.99994
3.476274
0c020b88-12f7-4242-9fa1-285cb29b8dd0
SitiBanc/ComputerProgramingHomework
HW1/根.cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> int main(int argc, char *argv[]) { double a,b,c, bb_4ac; while(1){ printf("пJa,b,c\n"); scanf("%lf%lf%lf",&a,&b,&c); bb_4ac = b * b - 4.0 * a * c; if(bb_4ac > 0) printf("There are two real roots %.0f and %.0f...
ALGO
0.99612
3.732786
46666d27-44af-4f42-a4cb-461ced996dcd
Heisenberg71/Competitive-Programming
Online Judge Submissions/Lightoj/loj_1090.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; ll two(ll n) { ll tem = 2, cnt = 0; while(n >= tem){ cnt += n/tem; tem *= 2; } return cnt; } ll five(ll n) { ll tem = 5, cnt = 0; while(n >= tem){ cnt += n/tem; tem *= 5; } return cnt; } ll...
ALGO
0.999696
4.076536
26c0fbe2-c16b-4f32-b461-ea116b82b5c4
Caetano2005/Logic
TempoDeDownload.cpp
#include <iostream> #include <string> #include <iomanip> #include <cmath> using namespace std; int main(){ float Arquivo, MegabytesPorSegundo, TempoDeDownload; cout << "Quantos MBs tem o arquivo que voce quer baixar?" << endl; cin >> Arquivo; cout << "Quantos Megabytes Por Segundo sua internet faz download?" ...
ALGO
0.887693
3.995104
b939a879-5425-40a3-a04e-07e243e1df5b
ishandutta2007/codeforces
qwqcorz/normal/1195/E.cpp
#include<bits/stdc++.h> #define int long long using namespace std; const int N=3e3+5; int read() { int s=0; char c=getchar(),lc='+'; while (c<'0'||'9'<c) lc=c,c=getchar(); while ('0'<=c&&c<='9') s=s*10+c-'0',c=getchar(); return lc=='-'?-s:s; } void write(int x) { if (x<0) { putchar('-'); x=-x; } if (x<10)...
ALGO
0.999931
3.253633
201767e2-8224-48d5-93ef-fae384ca5c32
SAP/project-foxhound
intl/icu/source/i18n/collationsettings.cpp
#include "unicode/utypes.h" #if !UCONFIG_NO_COLLATION #include "unicode/ucol.h" #include "cmemory.h" #include "collation.h" #include "collationdata.h" #include "collationsettings.h" #include "sharedobject.h" #include "uassert.h" #include "umutex.h" #include "uvectr32.h" U_NAMESPACE_BEGIN CollationSettings::Collatio...
TOOL
0.913643
3.06778
cdceeef2-5819-4143-bb52-49b3f980048c
senior-kapitoshka/Solutions
coderun/381_calendar_formatting.cpp
#include <iostream> #include <string> #include <vector> #include <array> #include <algorithm> using namespace std::literals; void print(int n,const std::string& s){ std::array<std::pair<std::string,std::string>,7>mp={ std::pair<std::string,std::string>{"Sunday"s,".. .. .. .. .. .. .1\n"s}, std::pair<std::stri...
ALGO
0.999287
4.523337
a6be4307-58d7-4c85-97b7-b9414e93e8a7
ateschan/COSC-1336
mod3lab2-box/main.cpp
// Addison Teschan // Feb 1 2024 // This program will take in a width and length and print a box of that size with a character of the user's choice #include<iostream> using namespace std; int main(){ int len, wid; char character; cout << "Box width: " << endl; cin >> wid; cout << "Box length: " << endl; ...
TOOL
0.892312
4.127531
4c726d50-0ccd-46f7-aa81-2f81fd0d0986
codgician/competitive-programming
HDUOJ/6549/dp.cpp
#include <bits/stdc++.h> using namespace std; #define SIZE 100010 int dp[SIZE][20][26]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int len, modLim, secLim; while (cin >> len >> modLim >> secLim) { string str; cin >> str; int len = str.size(); for (int ...
ALGO
0.999879
3.799131
70c78876-2916-4edf-bfa1-ff420b528eea
Sohail-khan786/Competitve-Programming
Snackdown_qualify.cpp
#include<bits/stdc++.h> using namespace std; int main() { long long int t,n,k,i,x; vector<long long int> v; cin>>t; while(t--) { n=0; k=0; v.clear(); cin>>n>>k; for(i=1;i<=n;i++) { cin>>x; v.push_back(x); } sort(v.begin(),v.end...
ALGO
0.999904
3.723923
8b8cbbf5-7063-4687-bd3b-7633d4696327
HEltim7/cpcode
NowCoder/寒假/2022/3/E.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; #define endl '\n' typedef long long LL; const int N=1e5+10,mod=1e9+7; int color[N],num[N]; LL qpow(LL a,LL b){ LL res=1; while(b){ if(b&1) res=res*a%mod; b>>=1; a=a*a%mod; } return res; } int main() ...
ALGO
0.999692
4.079905
53209b00-d39c-4a02-8f0e-571e11f35911
Kartik2301/Recurrence
algorithms/queue_using_linked_lists.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; class QueueNode { public: int data; QueueNode* next; }; QueueNode* head = NULL; QueueNode* tail = NULL; QueueNode* create(int data) { QueueNode* node = new QueueNode(); node->data = data; node->next = NULL; return node; } bool isEmpty() { return ...
ALGO
0.999633
4.111194
d9554ad9-49e4-4360-a79b-46fa2c253acd
govindvarma1/LeetCode-Problems
0073-set-matrix-zeroes/0073-set-matrix-zeroes.cpp
class Solution { public: void setZeroes(vector<vector<int>>& matrix) { int n = matrix.size(), m = matrix[0].size(); bool isRow0 = false, isCol0 = false; for(int i=0; i<m; i++) { if(matrix[0][i] == 0) { isRow0 = true; break; } }...
ALGO
0.999233
6.201935
048d52cd-8b90-4d8a-b41d-ca42b2a5a4df
rajanraj2/-CrackYourInternship
SortingAndSearching/03_Find_Pair_Given_Diff.cpp
// Link - https://www.geeksforgeeks.org/problems/find-pair-given-difference1559/1 // Find pair with given difference class Solution { public: int findPair(int n, int x, vector<int> &arr) { // code here unordered_set<int> mpp; for (int i = 0; i < n; i++) { int look = arr[i] - x...
ALGO
0.999995
5.327457
2d788c76-44e3-4be9-829a-85eb53d35b14
21A91A05G9/GFG
Easy/Play With OR/play-with-or.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; int* game_with_number(int arr[], int n); int main() { int t;cin>> t; while(t--) { int n; cin >> n; int arr[n]; for(int i=0;i<n;i++) cin>>arr[i]; int *arr2; ...
ALGO
0.999872
4.974763
a57b96f7-c4c4-46b7-878b-11ab2f54c493
itkingnb/cf-atc-and-so-on
codeforces/Educational Codeforces Round 174 (Rated for Div. 2)/a.cpp
#include<bits/stdc++.h> #define pii pair<int,int> #define mii map<int,int> #define msi map<string,int> #define ll long long #define all(x) (x).begin(), (x).end() using namespace std; int maxint = INT_MAX;// 2147483647 int minint = INT_MIN;// -2147483648 long long maxll = LLONG_MAX;// 9223372036854775807 long long minll...
ALGO
0.999737
3.981142
41f19d35-61f2-465b-a1b4-99ebd9ca145b
PrinceSandal20/Leetcode
1129-shortest-path-with-alternating-colors/1129-shortest-path-with-alternating-colors.cpp
class Solution { public: vector<int> shortestAlternatingPaths(int n, vector<vector<int>>& redEdges, vector<vector<int>>& blueEdges) { unordered_map<int,vector<pair<int,int>>>m; for(int i=0;i<redEdges.size();i++){ m[redEdges[i][0]].push_back({redEdges[i][1],0}); } for(int ...
ALGO
0.999897
5.779324
52770d95-f32a-4756-aaa0-154f2d54ca94
MrTypename/jblade-code
src/XBEM/BData.cpp
#include "BData.h" #include <QDebug> #include <math.h> #include "../Objects/Polar.h" #include "../Globals.h" QList <void*> *BData::s_poa360Polar; BData::BData() { m_bShowPoints = false; m_bIsVisible = true; m_Style = 0; m_Width = 1; m_bTipLoss = false; m_bRootLoss=...
ALGO
0.962058
3.950828
e9b8e1bc-e915-4933-ab17-08fcabddd670
tanmayhinge/dsa
neetcode/150/two-sum.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int, int> store; int n = nums.size(); for (int i = 0; i<n; i++){ int complement = target - nums[i]; if (store.count(complement)){...
ALGO
0.999573
6.048589
b6ccb650-081e-43d3-b0dd-88731466f5ee
mehrshadina/quera.ir_solutions
questions/c++/hers_cardan.cpp
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; const int MAXN = 500000; vector<int> tree[MAXN]; int hangingIndex[MAXN]; int subtreeSize[MAXN]; void dfs(int node, int parent) { subtreeSize[node] = 1; int maxChildHanging = 0; for (int neighbor : tree[node])...
ALGO
0.999975
5.572104
1afae700-fe3c-4585-9ad7-969e9c8278f2
yanshiwei/leetcode-go
cpp/148.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ /* 给你链表的头结点 head ,请将其按 升序 排列并返回 排序后的链表 。 */ class ...
ALGO
0.999994
5.412915
2136effe-0cc9-46d4-8843-2e282de3f913
geonoo44/TIL
problemsolve/BOJ/동전_0.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, k; cin >> n >> k; vector<int> coins(n); int ans = 0; for (int i = 0; i < n; i++) { cin >> coins[i]; } for (int i = n - 1; i >= 0; i--) { if (coins[i] <= k) { ...
ALGO
0.999911
4.416452
3e8f618f-9d2b-4cf1-80c1-5925743cffc0
DevDreamer-J/learning-cxx
exercises/29_std_accumulate/main.cpp
#include "../exercise.h" #include <numeric> // READ: `std::accumulate` <https://zh.cppreference.com/w/cpp/algorithm/accumulate> int main(int argc, char **argv) { using DataType = float; int shape[]{1, 3, 224, 224}; // TODO: 调用 `std::accumulate` 计算 `shape` 的元素之积 int size = std::accumulate(&shape[0], &s...
ALGO
0.994648
4.820528
73fc7eac-945b-47ae-8a83-7a114783adc9
G0nov4/Programacion
C++/Primeros_Pasos_en_C++/1251_UMSA_Connection/1251_UMSA_Conection.cpp
#include <stdio.h> #include <iostream> using namespace std; int v[100010]; int st; static void initialize(int n){ for (int i = 0; i < n+1; ++i) v[i]=i; st=n; } static int in(int b){ if (b == v[b]) return b; else return (v[b] = in(v[b])); } static bool InsameSet(int a,int b){ if(in(a)==in(b)) return true; ...
ALGO
0.999715
3.681971
76c77117-6c37-4fad-8ad8-3292d86219a9
kingufl/omGraph
vari_rest_kmers.cpp
#include <iostream> #include <fstream> #include <vector> #include <string> #include <libgen.h> // basename #include "tclap/CmdLine.h" #include <sdsl/bit_vectors.hpp> #include <sdsl/wavelet_trees.hpp> #include "io.hpp" #include "debruijn_graph_shifted.hpp" #include "algorithm.hpp" #include "cosmo-color.hpp" using na...
ALGO
0.941639
3.453411
702e9069-24cf-46ff-bf33-05ede4d6732d
Mayank471/Striver-A2Z
Learn the Basics/Basic_Maths/Sum_Divisors.cpp
class Solution { public: long long sumOfDivisors(long long n) { long long sum = 0; for (long long d = 1; d <= n; d++) { sum += d * (n / d); } return sum; } };
ALGO
0.999907
6.269563
c0bc5328-b02a-450f-9118-d8806fcaacec
menyf/Code-Snippet
ACM-ICPC/HDU5327.cpp
// Wrote by MenYifan on 2016-04-03 21:09:33 // Exe.Time 15ms Exe.Memory 1992K #include <set> #include <map> #include <stack> #include <cmath> #include <queue> #include <cstdio> #include <string> #include <vector> #include <iomanip> #include <cstring> #include <iostream> #include <algorithm> #define Memset(a,val) memset...
ALGO
0.999649
4.072148
737817f5-0ebb-450c-a519-38b46f747084
klishevich/cpp-algorithms2
adventofcode/2022_day09/2022_day09.cpp
// Advent of code 2022 day 9 https://adventofcode.com/2022/day/9 #include <iostream> #include <string> #include <vector> #include <sstream> #include <set> using namespace std; string input(); void rope_simulation(vector<string>& lines, int num_knots); int main() { string str; vector<string> lines; for (s...
ALGO
0.999817
6.146477
c699767e-79ea-4cd5-aba9-0612db2410c8
raincross7/code-similarity
codes/train_code/problem067/problem067_110.cpp
#include <bits/stdc++.h> #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define pb push_back #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define ll long long using namespace std; const ll P = 1000000007; int gcd(int a, int b) { return b != 0 ? gcd...
ALGO
0.999846
4.021929
1ecde7ba-c1f1-45e4-b4ca-5b8c2f54faa4
maegom/c-study
0719/0719/mainmain.cpp
#include <iostream> #include <time.h> // enum SRP // ȣ ƴ { SISSOR = 1, //Ȱ +1 ROCK, PAPER }; int main() { srand((unsigned int)time(0)); //ȯ : (ȯ Ÿ) · ϸ,  ̳ ϴ Ÿ Ͻ νĽ rand(); int PlayerWinCount = 0, AiWinCount = 0; while (true) { system("cls"); // ܼâ std::cout << " Ͻÿ!\n" << std::endl; ...
ALGO
0.966805
3.394771
4dbf6512-bbad-46ac-a682-92a0d84f6bec
sarvex/leetcode-mini-kanren
solution/2000-2099/2027.Minimum Moves to Convert String/Solution.cpp
class Solution { public: int minimumMoves(string s) { int ans = 0; for (int i = 0; i < s.size(); ++i) { if (s[i] == 'X') { ++ans; i += 2; } } return ans; } };
ALGO
0.999793
5.269487
ae311312-fc67-486f-b009-923ff2bfdca7
snail23/ironpedal
dep/DaisySP/Source/Control/phasor.cpp
#include <math.h> #include "phasor.h" #include "../Utility/dsp.h" using namespace daisysp; void Phasor::SetFreq(float freq) { freq_ = freq; inc_ = (TWOPI_F * freq_) / sample_rate_; } float Phasor::Process() { float out; out = phs_ / TWOPI_F; phs_ += inc_; if(phs_ > TWOPI_F) { phs...
ALGO
0.991267
4.813602
7aa3e988-0903-4bd0-9a9c-9c2066937ba8
KwickSilver/Competitive-Programming
Random Codes/Sq_root.cpp
#include<iostream> using namespace std; #define EPS 0.00000001 inline double mod(double p){if(p>0)return p; else return(-p); } int main() {long double a,mid,left,right; cin>>a; left=0; right=a; int count=0; mid=left+(right-left)/2; while(mod((mid*mid)-a...
ALGO
0.999962
3.289316
55448c09-8165-447d-9a76-66de11a71220
MdAkdas/My_Codes
CodeChef/Long challenges/feb_long/chefrail4.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define N 100005 #define MOD 1000000007 #define dd double #define rep(i, n) for(int i = 0; i < n; i++) #define REP(i,a,b) for(int i=a;i<b;i++) #define rep1(i,b) for(int i=1;i<=b;i++) #define pb push_back #define mp make_pair const int inf=(int)1e9; i...
ALGO
0.99996
3.629236
487ce0a7-4c64-4886-af7a-7cd35b65a1cc
Arthmoor/AFKMud
src/act_move.cpp
#include "mud.h" #include "area.h" #include "mud_prog.h" #include "objindex.h" #include "overland.h" #include "roomindex.h" ch_ret move_ship( char_data *, exit_data *, int ); /* Movement if your on a ship */ ch_ret check_room_for_traps( char_data *, int ); /* Return the hide affect for sneaking PCs when they enter a ...
TOOL
0.917467
4.454954
56da3ce6-44c8-4def-8aa4-82fd3a060019
zmx4/MySteps
Others/lanqiao/P10425 [蓝桥杯 2024 省 B] R 格式.cpp
#include <bits/stdc++.h> #define endl "\n" using ll = long long; using ull = unsigned long long; using namespace std; const int inf = 0x3f3f3f3f; vector<int> ans; void x2() { int carry = 0; for(int i = 0;i < ans.size();i++) { int t = ans[i] * 2 + carry; carry = t / 10; ans[i] = t % 10; } if(carry)ans.push_b...
ALGO
0.999892
4.265311
eedfe939-686d-4932-94a0-8c5a9ae327aa
Howl144/GAMES202
Assignment2/prt/ext/eigen/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp
MatrixXd A = MatrixXd::Random(6,6); cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl; EigenSolver<MatrixXd> es(A); cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl; cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl; complex<double> l...
ALGO
0.99925
3.093769
c65f0d2e-4fd6-48a6-9b3e-68cb3683939b
DamianArado/LeetCode-tracker
85-maximal-rectangle/85-maximal-rectangle.cpp
class Solution { private: int largestRectangleArea(vector<int>& heights) { stack<int> st; int maxArea = 0, n = heights.size(); for(int i = 0; i <= n; ++i) { while(!st.empty() and (i == n or heights[st.top()] >= heights[i])) { int height = heights[st.top()]; ...
ALGO
0.999943
6.608651
54db194a-4f84-4869-b4da-044d5b586717
sanidhyajadaun/DSA-Problems-and-Solutions
Strings/2.cpp
class OrderedStream { public: int ptr = 0; vector<string> stream; OrderedStream(int n) { stream.resize(n); } vector<string> insert(int idKey, string value) { vector<string> ans; stream[idKey-1] = value; while(ptr<stream.size() and ...
ALGO
0.99926
6.12157
3f54a575-1041-4e23-88ba-49be962a50f7
Tizwolf/LP1
lab 02/ code 07 switch statement ingrese un diigito.cpp
//Puedes etiquetar un statement con muchos casos #include <iostream> using namespace std; int main() { cout<<"Por favor ingrese un digito\n"; char a; cin>>a; switch (a) { case '0': case '2' : case '4': case '6': case '8': cout<<"es par\n"; break; case '1': case '3': case '5' : case '7': case '9': c...
ALGO
0.994671
3.395084
8e79b706-17c4-404d-b2f7-db30065a4206
qbolec/c
euclidgame.cpp
#include<cstdio> #include<vector> using namespace std; int p,q; int main(){ while(1){ scanf("%d%d",&p,&q); if(!p && !q) return 0; if(p<q){ int t=p; p=q; q=t; } vector<int> g; while(q){ g.push_back(p/q); int t=p%q; p=q; q=t; } bool start_w...
ALGO
0.99987
3.240468
70cb577e-242d-4601-acc2-cd11f46b5208
ShelpAm/competitive_programming
competitest/Codeforces/JXNU ICPC Kunming Selection/I. Interference/main.cpp
#pragma once /*Problem: I. Interference*/ /*Contest: JXNU ICPC Kunming Selection*/ /*Judge: Codeforces*/ /*URL: https://codeforces.com/gym/563673/problem/I*/ /*Start: Mon 04 Nov 2024 06:13:57 PM CST*/ /*Author: ShelpAm*/ // #include <bits/stdc++.h> #include <algorithm> #include <bit> #include <bitset> #include <casse...
ALGO
0.99948
4.86143