uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
a67b125c-2df1-4eca-8bd8-a42cec3deba4
ChuanSWT/Codeforces_codes
F_Maximum_modulo_equality.cpp
#include<iostream> #include<vector> #include<string> #include<map> #include<unordered_map> #include<cmath> #include<algorithm> #include<set> #include<tuple> #include<cmath> #include<queue> #include<iomanip> #include<numeric> using namespace std; void compete_s...
ALGO
0.999995
4.595569
a9f3323b-b603-46aa-9d41-f659cfafdfc7
HiteshFractal31/cpp
practical_exercises/10_day_practice/day2/hanoi.cpp
/* 汉诺塔.cpp */ #include <iostream> using namespace std; void move(char A, char B); void hanoi(int n, char A, char B, char C); int main(int argc, char const *argv[]) { cout << "请输入盘子数量:"; int disks; cin >> disks; hanoi(disks, 'A', 'B', 'C'); return 0; } void move(char A, char B) { cout << A << "->" << B << ...
ALGO
0.998756
5.601284
a43893b5-5326-4b11-ad82-5a781245d54c
rlagksql219/algorithm
프로그래머스/0/181933. flag에 따라 다른 값 반환하기/flag에 따라 다른 값 반환하기.cpp
#include <string> #include <vector> using namespace std; int solution(int a, int b, bool flag) { int answer = a - b; if(flag) answer = a + b; return answer; }
ALGO
0.999497
4.678064
2670ec99-67eb-44ca-8f0b-fb2432ff8a6f
ITC-Vanadzor/ITC-7
Meruzh_Janoyan/Homeworks/c_plus_plus/8_Dec/process.cpp
//creating 5 processes every 3 seconds. // proces duration 60 seconds #include <unistd.h> #include <iostream> int main(){ std::cout<<"Hello I'm main process, my PID:"<<getpid()<<std::endl; int x=0; while(x<5){ pid_t a=fork(); ++x; if(a){ ...
TOOL
0.945222
3.133205
0119e3e7-f649-461d-9609-433647148622
lamdev3107/CodePTIT-CPP
to hop tong bang k.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int n, a[100], S, X[100]; vector<int> v; void nhap(){ cin >> n >> S; for(int i = 0; i < n; i++){ cin >> a[i]; } sort(a, a + n); } void Try(int pos, int sum){ for(int j = pos; j < n; j++){ // X[i] = a[j] ...
ALGO
0.999797
3.404541
90621715-72e5-484c-ba82-12632e68b11d
PengYu-Lei/CPSC221
Labs/lab_dict/anagram_dict.cpp
/** * @file anagram_dict.cpp * Implementation of the AnagramDict class. * * @author Matt Joras * @date Winter 2013 */ #include "anagram_dict.h" #include <algorithm> #include <fstream> using std::string; using std::vector; using std::ifstream; /** * Constructs an AnagramDict from a filename with newline-separa...
TOOL
0.899411
6.18696
332dcf6e-0f78-4a7a-a446-2323b87cb155
Shivangi541/leetcode_solutions
0118-pascals-triangle/0118-pascals-triangle.cpp
class Solution { public: int nCr(int n, int r) { long long res = 1; // calculating nCr: for (int i = 0; i < r; i++) { res = res * (n - i); res = res / (i + 1); } return (int)(res); } vector<vector<int>> generate(int n) { vector<vector<int>> ans; //Store the enti...
ALGO
0.999985
6.27626
c95074ce-9418-4c82-8e63-c291acd50a36
raincross7/code-similarity
codes/train_code/problem134/problem134_442.cpp
#include <bits/stdc++.h> using namespace std; #define For(I,A,B) for(int I=(A); I < (B); ++I) int c[1005][1005]; int main() { int t; string p; cin>>t; getline(cin,p); while(t--){ int x,y,z,k=0,l,i,j; string a,b; For(i,0,1005) For(j,0,1005) c[i][j]=0; getline(cin,a); getline(cin,b); x=a.length(); y=b.length();...
ALGO
0.999858
3.907985
5aa5873f-95b9-49b1-9891-c73c6b37f1e8
5ko99/FMI-Semester-2
Classwork/09.05.19/arrays.cpp
#include <iostream> #include <string> using namespace std; template <typename T> class Arr{ private: int len; T* arr; void copyArr(const int,const T*); void deleteArr(); public: Arr(const int); Arr(const Arr&); ~Arr(); Arr& operator=(const Arr&); T& operator[](int); bool operator...
TOOL
0.930511
3.271397
da53bb0c-4c79-4dd9-a568-7272d54c0db7
roobiul/codeforce
Watermelon.cpp
#include<iostream> using namespace std; int main() { int num; cin>>num; if (num==2 || num %2) cout << "NO" << endl; else cout <<"YES"<<endl; }
ALGO
0.999834
3.334528
15cfa69c-e8b2-4284-a1b6-0ccc40787c8b
Justdwiwt/Cpp_basic
src/algorithm/TopologicalSort.cpp
#include <queue> #include <list> #include <iostream> using namespace std; class Graph { int v; list<int> *adj; queue<int> q; int *deep; public: Graph(int v); ~Graph(); void addEdge(int v, int w); bool topological_sort(); }; Graph::Graph(int v) { this->v = v; adj = new lis...
ALGO
0.999983
5.342685
a471e284-bb64-4386-b1d9-7cfd5c6147ad
Jackiemin233/tram-mast3r
thirdparty/MASt3R-SLAM/thirdparty/eigen/unsupported/doc/examples/FFT.cpp
// To use the simple FFT implementation // g++ -o demofft -I.. -Wall -O3 FFT.cpp // To use the FFTW implementation // g++ -o demofft -I.. -DUSE_FFTW -Wall -O3 FFT.cpp -lfftw3 -lfftw3f -lfftw3l #ifdef USE_FFTW #include <fftw3.h> #endif #include <vector> #include <complex> #include <algorithm> #include <iterator> ...
ALGO
0.995276
6.39609
5aefc091-1686-4c0c-b8f0-f6e87539faa3
materialgram/materialgram
Telegram/SourceFiles/calls/calls_call.cpp
#include "calls/calls_call.h" #include "apiwrap.h" #include "base/openssl_help.h" #include "base/platform/base_platform_info.h" #include "base/random.h" #include "boxes/abstract_box.h" #include "calls/group/calls_group_common.h" #include "calls/calls_instance.h" #include "calls/calls_panel.h" #include "core/applicatio...
TOOL
0.896361
5.791081
61221904-aadf-43ff-bd39-943e237c4bb7
PealMazumder/Online-Judges
Uva/10300 - Ecological Premium.cpp
#include<bits/stdc++.h> #define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(NULL); #define all(p) p.begin(),p.end() #define mem(ar, val) memset(ar, val, sizeof(ar)) #define sz(c) (int)c.size() #define pb(x) push_back(x) #define ll long long #define nl "\n"...
ALGO
0.995088
3.497895
9038fd80-d748-4a34-95fc-ff119f766344
Andwerpz/Competitive-Programming-Practice
- cpp -/rudolphandtictactoe.cpp
#include <bits/stdc++.h> typedef long long ll; typedef long double ld; using namespace std; //Codeforces - 1846B //just do normal tic tac toe win checking. bool solve(vector<string>& a, char c) { for(int i = 0; i < 3; i++){ if(a[i][0] == a[i][1] && a[i][1] == a[i][2] && a[i][2] == c){ return...
ALGO
0.999978
5.208914
c5a6ea0c-44d2-440d-a981-39c8210c97bc
Abhijit25Mishra/code-forces
PolynomailR/A_Add_Plus_Minus_Sign.cpp
// Aur Bhai Dekhne aagaye ;) // Author: Abhijit Mishra #pragma GCC optimize("Ofast") #pragma GCC optimize("no-stack-protector") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native") #pragma GCC optimize("fast-math") #pragma GCC optimize("Ofast") #pragma GCC optimize(...
ALGO
0.999918
3.988847
fbe84d14-1db0-4a94-89aa-614855e61a79
ishandutta2007/codeforces
couplefire/normal/1312/F.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1000; int grundy[N][3]; int mex[5]; void solve(){ int n, x, y, z; cin >> n >> x >> y >> z; for(int i = 1; i < N; i ++ ){ for(int j = 0 ; j < 3; j ++ ){ for(int k = 0 ; k < 5 ; k ++ ) mex[k]=0; grundy[i][j] = 0; ...
ALGO
0.999964
3.986886
04f06e3d-8ca3-410d-87c3-e5cf454d10da
tusharmalhotra20/DSA
Cpp_Training/Level_1/1_Fundamentals/p0031.cpp
/*A program to read coordinates of two points and calculate the distance between them as per following formula*/ #include <iostream> #include <math.h> using namespace std; int main() { float x1, y1, x2, y2; cin >> x1 >> y1; cin >> x2 >> y2; float dist = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2...
ALGO
0.99895
4.686038
18385014-faa2-4ad2-93b0-59a5bbe5a6ff
ermaccer/MK1Hook
MK1Hook/utils/Patterns.cpp
#include "Patterns.h" #define WIN32_LEAN_AND_MEAN #define NOMINMAX #include <windows.h> #include <algorithm> #if PATTERNS_USE_HINTS #include <map> #endif #if PATTERNS_USE_HINTS // from boost someplace template <std::uint64_t FnvPrime, std::uint64_t OffsetBasis> struct basic_fnv_1 { std::uint64_t operator()(std::st...
TOOL
0.893689
5.631343
28488f7b-d7f4-4722-b01e-8317dce271d0
Ldotexe/Algo_2023
str/A-cmp/main.cpp
#include <iostream> #include <string> #include <vector> class FindStr { private: size_t size_; size_t pattern_size_; std::string str_; std::vector<size_t> prefix_; public: void GetPatternStr(); std::vector<size_t> FindPatternPlaces(); }; void PrintVector(std::vector<size_t> vec); int main() ...
ALGO
0.996388
4.313793
0ca1a495-a72e-419b-ad18-18978a5ec074
sarvex/leetcode-nushell
solution/1500-1599/1562.Find Latest Group of Size M/Solution.cpp
class Solution { public: int findLatestStep(vector<int>& arr, int m) { int n = arr.size(); if (m == n) return n; vector<int> cnt(n + 2); int ans = -1; for (int i = 0; i < n; ++i) { int v = arr[i]; int l = cnt[v - 1], r = cnt[v + 1]; if (l =...
ALGO
0.999997
5.955956
10be218d-1bb5-48bd-b924-f1a9d36b09bd
hc20000702/oceanbase_jp
deps/common/io/io.cpp
// // Created by Longda on 2010 // #include <dirent.h> #include <iostream> #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include "common/io/io.h" #include "common/lang/string.h" #include "common/log/log.h" #include "common/math/regex.h" #include "common/mm/mem.h" namespace comm...
TOOL
0.887846
5.416564
6b617f66-494d-4ea2-aec0-ebf61c6ac960
luodiweiyu/3D_fitting_2020
3D_fitting_2020/eigen-3.3.7/failtest/fullpivqr_int.cpp
#include "../Eigen/QR" #ifdef EIGEN_SHOULD_FAIL_TO_BUILD #define SCALAR int #else #define SCALAR float #endif using namespace Eigen; int main() { FullPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10)); }
TEST
0.89693
3.150836
e5a8c588-ffe9-482e-9067-84e5f78f9197
Shahraaz/CP_P_S5
ICPC_Mirrors/Nitc_8.0/NWERC-2013-Problems-Solutions-Testcases/problems/Absurdistan_Roads/checker/check_roads.cpp
#include <iostream> #include <vector> #include <set> #include <algorithm> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> using namespace std; #define rep(i,a,b) for(__typeof(b) i=a; i<(b); ++i) #define trav(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) typedef pair<int...
ALGO
0.97576
3.484846
c8d1f57c-be8f-4fb6-ae1e-7e037eccf073
sudo-vaibhav/leetcode-solutions
374-guess-number-higher-or-lower/374-guess-number-higher-or-lower.cpp
/** * Forward declaration of guess API. * @param num your guess * @return -1 if num is higher than the picked number * 1 if num is lower than the picked number * otherwise return 0 * int guess(int num); */ class Solution { public: int guessNumber(int n) { int low= 1,h...
ALGO
0.999991
6.022106
fab30f91-b784-41b4-9e0b-731204832333
dreaife/backOnGithub
c/cf/cf1523/b.cpp
#include<bits/stdc++.h> typedef long long ll; using namespace std; const int N=1e3+10; ll q[N]; int main(){ int t=0;cin>>t; while(t--){ int n=0;cin>>n; for(int i=1;i<=n;i++) cin>>q[i]; cout<<3*n<<endl; for(int i=1;i<=n;i+=2){ cout<<"2 "<<i<<' '<<i+1<<endl; ...
ALGO
0.999709
3.212089
783c6f0a-8827-428b-895e-4caac9f75866
sagarthecoder/Problem_Solving
UVA_Solution/uva_1112_mice_and_maze.cpp
#include <bits/stdc++.h> using namespace std; struct data{ int v,cost; friend bool operator < (data a,data b) { return a.cost>b.cost; } }; vector<data>edges[100002]; int cost[123]; void djk(int n) { priority_queue<data>Q; Q.push({n, 0}); cost[n]=0; while(!Q.empty()) { ...
ALGO
0.999722
3.663071
e57ab50a-a5d2-421b-8ace-6af0a057ea39
aish-jamdar/CG
dda.cpp
#include <iostream> #include <GL/glut.h> #include <math.h> using namespace std; int wl = 1400; int wh = 1000; // Flags for menu options bool showLine = false; bool showDottedLine = false; bool showDashedLine = false; bool showBoat = false; bool showSquareWave = false; bool showTriangularWave = false; void myInit(vo...
ALGO
0.984295
5.957588
cfe5cf18-a6f5-4e1d-8a1a-2e628ce0185d
rbtre/rbtre.github.io
assets/code/P1035.cpp
#include <iostream> using namespace std; int main() { double item = 0; int pos = 0, k; cin >> k; while(item < k) { item += 1.0 / ++pos; } cout << pos; return 0; }
ALGO
0.999876
3.248836
0d2b926b-b015-4c28-8814-4edc8858b27f
Piero16301/Proyecto_POO_2
Juego.cpp
#include "Partida.h" #include "Juego.h" #include <vector> #include <chrono> #include <random> #include <algorithm> int presionar_enter; template <typename T> T maxim(T n, T m){ if(n > m){ return n; } else { return m; } } int contarcero(int n[][4]){ int ceros = 0; for(int i=0; i<4;...
ALGO
0.968527
4.051584
e96408fe-616b-4063-b9e3-22dc037dcb49
Chan-Heee/baekjoon
BFS/2206.cpp
#include <iostream> #include <tuple> #include <queue> using namespace std; int map[1002][1002]; int dist[1002][1002][2]; bool visited[1002][1002][2]; int main() { int m, n; cin >> m >> n; string in; for (int i = 0; i < m; i++) { cin >> in; for (int j = 0; j < n; j++) { ...
ALGO
0.999894
4.24595
9384322b-54c0-4a8d-bcfc-5179ffa712a4
Karan7566/assignment
c++ assignment/12.cpp
//calc using function overloding. #include<iostream> using namespace std; class calc{ public: int A() { int a,b; cout<<"Enter Two values :"<<endl; cin>>a>>b; cout<<"Addition : "<<a+b<<endl; } int A(int a) { int b; cout<<"Enter value of b :"<<endl; cin>>b; cout<<"Subtraction : "<<a-b<...
TOOL
0.950904
4.705994
ae9a425e-675b-4ba0-b1e2-06151a76c22b
CaptainOrb/Cawu1
2. OJ/BAB05/D.cpp
#include <stdio.h> int main() { int X, Y; scanf("%d %d", &X, &Y); // get garden int garden[100][100]; for (int i = 1; i <= X; i++) { for (int j = 1; j <= Y; j++) { scanf("%d", &garden[i][j]); } } // get changes int change; scanf("%d", &chang...
ALGO
0.998235
3.564987
ee61e17e-b40c-424d-b142-3e1b8142080e
AMIRIOX/MyLuoguRepo
luogu/P1057.cpp
#include <iostream> #include <cstdio> using namespace std; // 设f[i][j]为传了i次1球在j手上的方案数。 // 转移:f[i][j]=f[i-1][j-1]+f[i-1][j+1] // f[m][n] int f[100][100]; int main() { int n,m; cin >> n >> m; f[0][1]=1; for(int i=1;i<=m;i++) { for(int j=1;j<=n;j++) { if(j==1) f[i][j]=f[i-1][n]+f[i-1][2]; else if(j==n) { ...
ALGO
0.999985
3.034341
47c84e6c-3d0e-40aa-a89e-088560dac66f
DaenyK/HW15StacksAndQueues
Project1/Source.cpp
#include "DateTime.h" #include "bubbleSort.h" #include "stack.h" #include "stack.cpp" #include <stack> template <typename T> void bubbleSortMethod(T *a, int size) { int j; for (int i = 0; i < size; i++) { for (j = (size - 1); j > i; j--) { if (a[j - 1] > a[j]) { T temp = a[j - 1]; a[j - 1] = a[j];...
ALGO
0.978594
3.924667
aef7ebad-c869-4947-98a2-fc2ed3226e63
ManarM2000/amazon_mob
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.998859
6.785645
eac9c693-c224-4a2a-a0a8-1c0e64680389
HirofumiTsuda/LeetCode
10.IntegerToRoman/ans.cpp
class Solution { public: #define NUM 13 typedef pair<int, string> p; p nums[NUM] = {p(1000, "M"), p(900, "CM"), p(500, "D"), p(400, "CD"), p(100, "C"), p(90, "XC"), p(50, "L"), p(40, "XL"), p(10, "X"), p(9, "IX"), p(5, "V"), p(4, "IV"), p(1, "I")}; string intToRoman(int num) { string s = ""; ...
ALGO
0.999519
6.311475
2af9d25a-38ab-4a10-851e-bdf0f2993e86
MustafaAhmed313/Codeforses-PS-Training
A/RemoveSmallest.cpp
#include <iostream> #include <algorithm> #include <cmath> using namespace std; int main() { int t;cin >> t; while (t--) { int n;cin >> n; int a[n]; for (int i = 0 ; i < n ; i++) cin >> a[i]; sort(a , a+n); bool flag = false; for (int i = 1 ; i < n ; i++) { ...
ALGO
0.999859
4.429346
3e8f2213-7f4b-4c7c-a9b3-7a1ad1cb4a70
Yash5588/leetcode
2096-find-the-longest-valid-obstacle-course-at-each-position/find-the-longest-valid-obstacle-course-at-each-position.cpp
class SegmentTree{ vector<int> segTree; public: SegmentTree(int n) { segTree.resize(4*n, 0); } void update(int idx, int val, int i, int left, int right) { if(left == right) { segTree[i] = val; return; } int ...
ALGO
0.999892
5.673378
1cab591b-ed76-4315-abf5-102bb567c48d
bigdatacon/C-train_course
print_interval.cpp
#include <iostream> #include <string> #include <vector> #include <iterator> #include <algorithm> #include <set> using namespace std; template <typename It> void PrintRange(It range_begin, It range_end){ for (auto it = range_begin; it != range_end; it++) { cout << *it << " "s; } ...
ALGO
0.976196
4.52778
47239a0d-38c3-4e58-a85a-455fbb2cd2eb
ishandutta2007/codeforces
jovanb/normal/1556/A.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; void solve(){ ll a, b; cin >> a >> b; if(a == 0 && b == 0){ cout << "0\n"; return; } if(a == b){ cout << "1\n"; return; } if(a%2 != b%2) cout << "-1\n"; else cout...
ALGO
0.999881
4.711143
4bcf76b1-2093-4a7b-a666-814d25686e9b
hjiang13/LLMs-in-IR
POJ-104/76/1664.cpp
#include <iostream> using namespace std; int main(){ int n,i,j,z,e; struct point{ int a; int b; } m[5000],t; cin >> "%d",&n); for(i=0; i<n; i++){ cin >> "%d%d",&m[i].a,&m[i].b); } for(i=1; i<=n; i++){ for(j=0; j<n-i; j++){ if(m[j].a>m[j+1].a){ t=m[j]; m[j]=m[j+1]; m[j+1]=t; } } } for(i=1; i<=n; i++){ for(j=0; j<n-i; j+...
ALGO
0.999968
3.226901
94a3f15c-889c-46e4-8880-9ac804065e16
rahulrawat100/compititiveProblems
3391-maximum-difference-score-in-a-grid/maximum-difference-score-in-a-grid.cpp
class Solution { public: int calc(vector<vector<int>>& grid, int i, int j, vector<vector<int>>& DP) { //cout<<i<<" "<<j<<endl; int m = grid.size(); int n = grid[0].size(); if(i == m-1 && j==n-1) return 0; if(DP[i][j]!=INT_MIN) return DP[i][j]; ...
ALGO
0.999992
5.455137
96708575-7c29-45fd-8c2d-73775cc2c71b
itscharanp/Ds-Algo
Linked_Lists/segregate.cpp
Node* segregate(Node *head) { list <int> l1; Node* temp = head; while(temp!=NULL){ l1.push_back(temp->data); temp = temp->next; } l1.sort(); Node* temp2 = head; for(int x: l1){ temp2->data = x; temp2 = temp2->next; } return(head); }
ALGO
0.999994
3.951936
cc82893d-8476-491f-80c7-bcc4c544766b
guilhermedelyra/competitive-programming
graphs/codeforces/506solutA.cpp
#include <bits/stdc++.h> #define fle(i, a, b) for (int (i) = (a); (i) <= (b); (i)++) #define flt(i, a, b) for (int (i) = (a); (i) < (b); (i)++) #define fgt(i, a, b) for (int (i) = (a); (i) > (b); (i)--) #define fge(i, a, b) for (int (i) = (a); (i) >= (b); (i)--) #define log(var, sep) (cerr << #var << " = " << (var) << ...
ALGO
0.999849
4.168978
615a7bea-0d59-4ccc-932a-1ee043acf6c3
novo52/project-euler
archive/[18] Maximum path sum I.cpp
#include <iostream> using namespace std; const int size = 15; int pyramid[size][size] = { { 75 }, { 95, 64 }, { 17, 47, 82 }, { 18, 35, 87, 10 }, { 20, 4, 82, 47, 65 }, { 19, 1, 23, 75, 3, 34 }, { 88, 2, 77, 73, 7, 63, 67 }, { 99, 65, 4, 28, 6, 1...
ALGO
0.999475
3.760064
4f8200c5-a108-4e28-b557-8a9047f57b86
Pragna235/LeetCode_Problems
Max Consecutive Ones.cpp
class Solution { public: int findMaxConsecutiveOnes(vector<int>& nums) { int n = nums.size(); int count=0, maxi=0; for(int i=0;i<n;i++){ if(nums[i]==1){ count++; maxi = max(maxi,count); } else{ count=0; ...
ALGO
0.999958
6.122902
5a1a9b51-bc72-4dca-b9cd-0b934f970ab0
chengn/AlgorithmRun
数值分析/lon.cpp
//25-11-06 19:54 /* νʹθιʽηְ뷨ѷƷ£ 1Ƚ[a,b]𲽵ȷ֣Ϊ h= 2(b-a),j=012k øιʽ T TT ѾTTΣѷƷʽ TT TTTҪƹ̽ */ #include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> float x[100]; float f[100]; float a,b; int n; void trapezia(float y,float *S) { int i,t; t=(b-a)/y; for(i=0;i<=t;i++) x[i]=a+y*i; for...
ALGO
0.999464
3.432765
de37c54e-a234-4566-a096-2f8b494308b8
VenkataAnilKumar/LeetCode
Solutions/WordPattern.cpp
// Source : https://leetcode.com/problems/word-pattern/ // Author : Venkata Anil Kumar /*************************************************************************************** * * Given a pattern and a string str, find if str follows the same pattern. * Here follow means a full match, such that there is a bijecti...
ALGO
0.998502
6.508513
b509f10c-b773-444e-85a3-b0b3e194a4ee
CSsaan/BokehDepthByCS
include/eigen-3.4.0/doc/examples/Tutorial_BlockOperations_block_assignment.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; using namespace Eigen; int main() { Array22f m; m << 1,2, 3,4; Array44f a = Array44f::Constant(0.6); cout << "Here is the array a:" << endl << a << endl << endl; a.block<2,2>(1,1) = m; cout << "Here is now a with m copied into its cent...
ALGO
0.979559
3.290376
df0e21db-71a7-46af-b7d6-d0f183f23e39
Justinkuruvila54/musickk_appp
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
3cfb26dd-39ab-4a0e-9a2d-723e1a6285f8
NightmareDreemurr/luogu
C++/P5721/main.cpp
#include <iostream> using namespace std; int main() { int a,b,number; cin >> a; b = a; number = 1; for (int i = 1; i <= a; i++) { if (b == 0) { break; } for(int j = 1; j <= b; j++) { if (number < 10) { printf("0%d", number); ...
ALGO
0.999933
3.965211
ba38ab2f-a966-4b68-bfc4-124de81a1df7
PandeyAditya14/APS2020
Competition/CodeForces/COOK1119B/cachehit.cpp
#include <bits/stdc++.h> using namespace std; using vi = vector <int> ; using ll = long long; #define IOS ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); #define endl #define mp make_pair #define pb push_back #define fi first #define se second #define sz(x) (int)((x).size()) #define fill(x, y) mems...
ALGO
0.99969
4.002449
9ad1b0a1-af99-4336-babb-b73c7a4d6bf7
aadhilmsyed/librarybooks
HonorsProject.cpp
// ************************************************************************************ // Spring 2022 | Las Positas Honors Transfer Program (Program Development) // ************************************************************************************ // Project Mentor | Professor Carlos Moreno // Honors Course | CS2 -...
TOOL
0.996661
3.2777
acb293ef-e54b-4a34-9ada-3855816dcf2d
SaniyaParveenCode/My-Code
0424-longest-repeating-character-replacement/0424-longest-repeating-character-replacement.cpp
class Solution { public: int characterReplacement(string s, int k) { int n = s.size() , maxl = 0 , ans = 0; int l = 0 , r = 0; unordered_map<int , int>count; while(r < n) { count[s[r]]++; maxl = max(maxl , count[s[r]]); if((r - l +1) - maxl > k) ...
ALGO
0.99998
6.459809
d61c122f-33c4-4a28-be9b-f9274102557d
ameen-sid/Supreme-3.0
Week - 6/Basic Maths & Pointers/Assignments/question-9.cpp
#include<iostream> using namespace std; int main() { int a[5]; int* c; cout << sizeof(a) << " " << sizeof(c) << endl; // Output: 20 4 return 0; }
ALGO
0.918922
3.325772
f260e77b-b3f1-44af-9b1e-2dae4888302c
humachine/AlgoLearning
leetcode/CppSession/Done/212_WordSearch.cpp
//https://leetcode.com/problems/word-search-ii/ #include<iostream> #include<vector> #include<unordered_set> #include<unordered_map> #include<algorithm> using namespace std; class TrieNode{ public: TrieNode *children[26]; bool is_word; TrieNode(){ for(int i=0;i<26;i++) ...
ALGO
0.99984
5.837188
e9e37f19-a90b-48f5-b6f2-a302e40cf2f6
saishagoel27/OS-Algorithms
priority_cpu_sechP.cpp
#include <iostream> #include <vector> #include <algorithm> #include <climits> using namespace std; struct Process { int id, arrival_time,burst_time,remaining_burst_time, priority,start_time,completion_time,waiting_time, turnaround_time;}; void priorityScheduling(vector<Process>& processes, int n) { int current_...
ALGO
0.999981
5.473972
01d80edb-dca8-406d-8343-5d7e8edbb170
lixiang0405/ACM
数据结构/启发式合并/梦幻布丁.cpp
/*n个布丁摆成一行,进行m次操作。 每次将某个颜色的布丁全部变成另一种颜色的, 然后再询问当前一共有多少段颜色。 例如颜色分别为1,2,2,1的四个布丁一共有3段颜色。*/ int a[N],n,m,ans=0; vector<int> pos[M]; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); scanf("%d%d",&n,&m); for(int i=1;i<=n;++i){ scanf("%d",&a[i]); pos[a[i]].push_back(i); } fo...
ALGO
0.999903
4.298985
03495a68-41ca-4381-b5cb-1369319fbdf3
Pavitragandhi/GFG_solutions
Easy/Word with maximum frequency/word-with-maximum-frequency.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; string maximumFrequency(string s); int main() { int t;cin>>t; cin.ignore(); for(int i=0;i<t;i++) { string s; getline(cin,s); cout << maximumFrequency(s) << endl; } return 0; } // } Driver Code End...
ALGO
0.999904
6.030732
66993c8a-5d9c-4629-8214-b8984f321ce4
LSH3333/PS
baekjoon/11909.cpp
#include <iostream> #include <queue> using namespace std; #define INF 100000000 int N; int board[2230][2230]; int d[2230][2230]; int dr[] = {0, 1}; int dc[] = {1, 0}; int answer = INF; struct Data { int r, c; int distance; }; struct cmp { bool operator()(const Data &a, const Data &b) { return a.d...
ALGO
0.999759
4.488843
568ed4ad-75c4-4f55-aa7a-3e5cd99ba628
RISHYAVANDHAN/Peridynamics
CPP/cmake-build-debug/_deps/eigen-build/doc/snippets/compile_MatrixBase_template_int_int_bottomLeftCorner_int_int.cpp
static bool eigen_did_assert = false; #define eigen_assert(X) if(!eigen_did_assert && !(X)){ std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X << "\n### The following would happen without assertions:\n"; eigen_did_assert = true;} #include <iostream> #include <Eigen/Eigen> #ifndef M_PI...
TOOL
0.874919
3.60022
ceb0213d-b46c-4409-961f-46fe3eb96536
raulmorales05/Algorithm-and-Data-Structures
A/aprendiendo2.cpp
#include<stdio.h> int main(){ float totCo, descuento, precio; printf("cual es el total de la compra: "); scanf("%f",&totCo); descuento = totCo* 0.25; precio = totCo-descuento; printf("el precio es: %.2f", precio); return 0; }
ALGO
0.944046
3.086905
0201ebe9-0d61-4e9c-aafd-6bc2f67ea3a7
raincross7/code-similarity
codes/train_code/problem084/problem084_474.cpp
#include <bits/stdc++.h> #include <iostream> #include <string> #include <string.h> #include <ctype.h> #include <algorithm> using namespace std; int main() { int n; long L[87]; cin >> n; L[0] = 2; L[1] = 1; for(int i = 2; i <= n; i++) { L[i] = L[i-1] + L[i-2]; } cout << L[n] << endl; }
ALGO
0.999984
3.839024
9e0d539e-4681-40b5-88d0-b2dcd28a9f3b
Hagemii/asio-rdma
libs/math/src/tr1/fminl.cpp
extern "C" long double BOOST_MATH_TR1_DECL boost_fminl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y) BOOST_MATH_C99_THROW_SPEC { if((boost::math::isnan)(x)) return y; if((boost::math::isnan)(y)) return x; return (std::min)(x, y); }
ALGO
0.974738
5.033185
1fe7744d-c2ce-4362-896f-c8935ff3c801
loicloic/Dolphin-Core
Core/Externals/wxWidgets3/src/common/filefn.cpp
// ============================================================================ // declarations // ============================================================================ // ---------------------------------------------------------------------------- // headers // -------------------------------------------------...
TOOL
0.959435
7.335256
822241d9-3243-4657-945d-2af4ffd26eaa
chinhan1405/DSAAsm
Lab2/BubbleSort.cpp
#include <iostream> #include <sstream> using namespace std; template <class T> class SLinkedList { public: class Node; // Forward declaration protected: Node* head; Node* tail; int count; public: SLinkedList() { this->head = nullptr; this->tail = nullptr; this->count = 0; ...
ALGO
0.999937
5.143293
9231f391-dac8-4c0e-8976-a10c64888371
shobhit162/DSA-Questions
Move all zeros to the front of the linked list - GFG/move-all-zeros-to-the-front-of-the-linked-list.cpp
// { Driver Code Starts //Initial Template for C++ #include<bits/stdc++.h> using namespace std; struct Node { int data; struct Node* next; Node(int x){ data = x; next = NULL; } }; void push(struct Node **head_ref, int new_data) { struct Node *new_node = new Node(new_data);...
ALGO
0.999454
4.161778
3f25d7df-9b21-466b-8b2e-7c7a3d7d3666
Biu-G/libtorch_source
aten/src/ATen/native/UpSampleTrilinear3d.cpp
// Adapted from interp.cpp from Caffe util by Pauline Luc // Originally developed by George Papandreou #include <ATen/ATen.h> #include <ATen/NativeFunctions.h> #include <ATen/native/UpSample.h> namespace at { namespace native { namespace { template <typename scalar_t> static void upsample_trilinear3d_out_frame( ...
DATA
0.86207
7.2151
5fbbea50-86b5-4266-8735-691ecf467631
rueiminl/Leetcode
Search in Rotated Sorted Array.cpp
class Solution { public: int search(int A[], int target, int start, int end) { if (target == A[start]) return start; if (target == A[end]) return end; if (end <= start) return -1; int mid = (start + end) / 2; if( A[start] < target && target...
ALGO
0.999957
6.17711
05dc2392-1ed3-4c89-b0e7-cc44d596c61c
ishandutta2007/codeforces
.tx/normal/1389/C.cpp
#ifndef CONTESTSMTH_HEADER_H #define CONTESTSMTH_HEADER_H #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; template <typename K, typename V = __gnu_pbds::null_type> using tree = __gnu_pbds::tree<K, V, less<K>, __gnu_pbds::rb_tree_tag, __gnu_pb...
ALGO
0.999817
5.377917
6c4e172e-1e04-4c94-ad07-66a8acf0638e
kaluginpeter/Algorithms_and_structures_tasks
Yandex/Practicum/Algorightms_and_Data_Structures/1_sprint/K.Списочная_форма/solution.cpp
#include <iostream> #include <vector> void solution(int xLength, std::vector<int>& x, int k) { /* Time Complexity O(N), where N is the length of the largest number Memory Complexity O(N), where N is the length of the largest number */ std::vector<int> output; int addition = 0; for (int inde...
ALGO
0.999922
5.757253
494feee7-f32f-485c-b2fd-1b1a56dea679
KW-BBIBBI/AUTO-DELIVERY
cartographer_ws/src/fast_gicp/thirdparty/Eigen/doc/examples/TutorialInplaceLU.cpp
#include <iostream> struct init { init() { std::cout << "[" << "init" << "]" << std::endl; } }; init init_obj; // [init] #include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { MatrixXd A(2,2); A << 2, -1, 1, 3; cout << "Here is the input matrix A before decompositi...
ALGO
0.999333
3.804785
c4b813c4-b7fd-4845-bf55-1a45d2975092
Marinovsky/AlgorithmsUN2021I
Algorithms_Graphs/week6/travelling_salesman_problem/travelling_salesman_problem.cpp
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> #include <limits> #include <queue> #include <iostream> #include <memory> #include <cassert> class Graph { typedef int Distance; typedef int Vertex; // Number of nodes int N; // Source and target int s, t; // Estima...
ALGO
0.999912
5.59275
2cd07644-71fc-4e9d-82ba-e7403f7e7d2c
pradyotprksh/news_flutter
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.998693
6.797273
0a6ad318-37da-47d0-bb4c-4adc92f6cb4f
justwait/PandaCore
dep/tbb/src/rml/perfor/tbb_simple.cpp
#include <cstddef> #include <cstdlib> #include <cstdio> #include <float.h> #include <math.h> #include <time.h> #include <unistd.h> #include <pthread.h> #include <omp.h> #include <assert.h> #include "thread_level.h" #include "tbb/task.h" #include "tbb/tick_count.h" #include "tbb/task_scheduler_init.h" #include "tbb/s...
TOOL
0.954862
4.64421
dc4c8ebf-2e8b-4757-9aaa-ac33bdf026fa
avniamitkumar/CODING-PLATFORM-PRACTICE
kthlagsmall.cpp
//{ Driver Code Starts //Initial function template for C++ #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: // arr : given array // l : starting index of the array i.e 0 // r : ending index of the array i.e size-1 // k : f...
ALGO
0.999842
5.489819
b08176e8-8d82-4aac-9242-9d4e603cfcc4
ishandutta2007/codeforces
mr.robot_28/normal/1386/B.cpp
#include<bits/stdc++.h> using namespace std; #define int long long struct cmp { bool operator() (pair <int, int> a, pair <int, int> b) { if(a == b) { return false; } if(a == make_pair(-1LL, 0LL)) { return true; } if(b == make_pair(-1LL, 0LL)) { return false; } if(a.second == 0) { return b.second > ...
ALGO
0.999712
3.769633
7f576249-099b-4898-9813-ad0949915c20
PaukIsUha/optimizing_formating_code
predictions/submissions-aizu-gpt35/Codenet/p02242/309211760/response_0.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; static const int MAX = 100; static const int INFTY = (1 << 21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[MAX][MAX]; void dijkstra() { int minv; int d[MAX], color[MAX]; for (int i = 0;...
ALGO
0.999657
4.143678
8738945e-6af5-43c1-be83-57bbc0acfd27
fate7902/study
Programmers/Lv.0/l로 만들기.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; string solution(string myString) { for_each(myString.begin(), myString.end(), [](auto& c){ if(c < 'l') c = 'l'; }); return myString; }
ALGO
0.997797
5.52571
25f42aba-f369-47f3-9c2a-32e37e6e3a5a
ParticulateFlow/LIGGGHTS-PFM
src/procmap.cpp
/* ---------------------------------------------------------------------- Contributing author (NUMA option) : Mike Brown (ORNL) ------------------------------------------------------------------------- */ #include "procmap.h" #include "universe.h" #include "domain.h" #include "math_extra.h" #include "memory.h" #inc...
ALGO
0.995959
5.130592
061f397f-ab25-4038-93ad-9231bdb157b3
Rocket-xiaowu/learn-C-language
C3/求素数.cpp
//#include<stdio.h> // //int main() //{ // int a; // void judge_sushu(int data); // scanf_s("%d", &a); // if (a > 1 && a < 100000000) judge_sushu(a); // else printf("input error!"); // return 0; //} // //void judge_sushu(int data) //{ // int time = 0; // for (int i = 1; i <= data; i++) // if (data % i == 0) // time+...
ALGO
0.999768
3.394617
6f7d1550-01bf-43aa-a3d5-a6e522b4c56f
Kulikova-A18/leetcode_part1
567.cpp
/* Учитывая две строки s1 и s2, верните true, если s2 содержит Перестановка s1 или false в противном случае. Другими словами, верните true, если одна из перестановок s1 является подстрокой s2. */ bool checkInclusion(string s1, string s2) { int n = s1.size(), m = s2.size(); if (n > m) return false; ...
ALGO
0.99977
5.879649
b0085291-328e-4186-a7a7-92f2ea21e254
aseemx/RM_TaskPhase
5.cpp
#include<iostream> using namespace std; string bin(int num) { int num_b,b=0; num_b=num; while (num_b!=0) { b=b*10+(num_b%2); num_b=num_b/2; } string s = to_string(b); for(int i=0;i<(s.size()/2)-1;i++) { char temp=s[i]; s[s.size()-i-1]=s[i]; s[i]=t...
ALGO
0.999575
4.292502
31d3cf79-313a-4618-9dbe-acf444610a7a
slwilliams/stegasis
lib/crypto/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.999675
7.656251
978fce2e-a647-4bca-a109-1c49ceffd6ef
anurag-111/allSubmissions
validate-stack-sequences/Accepted/4-13-2023, 6_19_07 AM/Solution.cpp
// https://leetcode.com/problems/validate-stack-sequences class Solution { public: bool validateStackSequences(vector<int>& pushed, vector<int>& popped) { stack <int> stk; int j = 0; for(int itr : pushed) { stk.push(itr); while(!stk.empty() && j < popped.size() && st...
ALGO
0.999486
6.591823
4e79a5a5-28bd-492d-93d5-2d4114632e56
XsenIva/tasks_1_course
maths1.15.cpp
// ConsoleApplication31.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. // #include <iostream> using namespace std; int main() { setlocale(LC_ALL, "Russian"); int n; float a1, a2, a; cout << "Введите n= "; cin >> n; cout << "Введите первые два члена последовательнос...
ALGO
0.996775
3.075598
1210b1eb-e10b-4332-ac40-6bf5a33cff69
envoydead7/dsa
sheet3(arrays)/posInArray.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n;i++){ if(a[i]<=10){ cout<<"A"<<"["<<i<<"]"<<" = "<<a[i]<<endl; } } }
ALGO
0.944562
3.719434
434c44dd-4af0-487e-94ee-cf1f596456ae
Chan531/BaekJoon_Online_Judge
크냐.cpp
#include <iostream> using namespace std; int main(void) { int n, m; while (1) { cin >> n >> m; if (n == 0 && m == 0) break; if (n > m) cout << "Yes\n"; else cout << "No\n"; } return 0; }
ALGO
0.99968
3.363472
f95c7c7f-2381-44dd-82a0-8145c6e5eff8
everx-labs/TVM-Compiler
llvm/lib/CodeGen/ScheduleDAG.cpp
#include "llvm/CodeGen/ScheduleDAG.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/iterator_range.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/ScheduleHazardRecognizer.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetInstrInfo.h" ...
ALGO
0.99931
7.49778
06480c98-6031-469a-ac52-774f837e9cb1
percona/debian-percona-galera-3
galerautils/src/gu_config.cpp
// Copyright (C) 2010-2014 Codership Oy <<EMAIL>> /** * @file * Configuration management implementation * * $Id$ */ #include "gu_config.h" #include "gu_config.hpp" #include "gu_logger.hpp" #include "gu_assert.hpp" const char gu::Config::PARAM_SEP = ';'; // parameter separator const char gu::Config::KEY_VA...
TOOL
0.871583
7.08209
2d3d9044-ba6f-4415-bcf7-d22a8c18c788
r-d-s-l-w/competitive-programming
USACO/Superprime Rib.cpp
/* ID: radek.m1 TASK: sprime LANG: C++11 */ #include <bits/stdc++.h> #pragma GCC optimize("O3") using namespace std; #define F first #define S second #define PB push_back #define MP make_pair #define ALL(x) (x).begin(),(x).end() #define endl '\n' #define DEBUG(x) cout << '>' << #x << ": " << x << endl; #define REP(i,...
ALGO
0.99849
5.320723
711c537c-ffae-49ff-8f02-7d76a82dbd5f
ishandutta2007/codeforces
zdolny_kaczor/normal/1045/E.cpp
#ifndef LOCAL #pragma GCC optimize("O3") #endif #include <bits/stdc++.h> using namespace std; #define sim template <class c #define mor > muu & operator<< ( #define ris return *this #define R22(r) sim> typename enable_if<1 r sizeof(dud<c>(0)), muu&>::type operator<<(c g) { sim> struct rge {c h, n;}; sim> rge<c> range(c...
ALGO
0.999984
3.942492
c124fa7f-1772-49b6-93fd-335cef7cdabb
infeex/SkyNet
dep/tbb/src/old/concurrent_vector_v2.cpp
#include "concurrent_vector_v2.h" #include "tbb/tbb_machine.h" #include <stdexcept> #include "../tbb/itt_notify.h" #include "tbb/task.h" #include <cstring> #if defined(_MSC_VER) && defined(_Wp64) // Workaround for overzealous compiler warnings in /Wp64 mode #pragma warning (disable: 4267) #endif namespace tbb...
TOOL
0.946971
7.29021
f65e07a6-f6a4-48fd-9e7a-aaebcf45d2ad
savioteles/estruturas-de-dados-algoritmos
lista1/beecrowd_2729.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <map> #include <set> #include <stack> #include <sstream> using namespace std; void print(set<string> s) { string last = *s.rbegin(); s.erase(std::prev(s.end())); for (const auto & it : s) cout << it << ' '; ...
ALGO
0.999548
5.446822
3ebf106b-e2c1-4fe3-9108-5cfd11eeaa1c
dineshvipe/Computer-graphics
EdgeFill.cpp
#include <GL/glut.h> #include <math.h> #include <stdio.h> int pix[480][640]; void fillpix(){ int k,l; for(k=0;k<480;k++){ for(l=0;l<640;l++){ pix[k][l]=0; } } } void edgefill(double x1,double y1,double x2,double y2){ double i,m; int j; m=(y2-y1)/(x2-x1); if(x2==x...
ALGO
0.897755
4.288057
34c0802b-2721-4d5b-8c68-2abfae889ef7
niamulhasan/flutter-course-source-code
33 ecom-2/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.998502
6.785645
534ffc8b-b1a4-45ba-a365-5a2a25dda54e
sarvex/leetcode-intercal
solution/2500-2599/2521.Distinct Prime Factors of Product of Array/Solution.cpp
class Solution { public: int distinctPrimeFactors(vector<int>& nums) { unordered_set<int> s; for (int& n : nums) { for (int i = 2; i <= n / i; ++i) { if (n % i == 0) { s.insert(i); while (n % i == 0) { n /= i...
ALGO
0.999846
6.14986
d2b4e782-e9e6-4811-b74c-f27892f2d403
lnidogon/AOC
AOC/AdventOfCode15/19_MedicineForRudolph2.cpp
#include<bits/stdc++.h> #define breturn return using namespace std; void readline(vector<pair<string, string> > &v, string &s) { fstream f; f.open("19_input.txt"); while(getline(f, s)) { if(s == "") break; string s1, s2; if(s[1] == ' ') { s1 = s.substr(0, 1); s2 = s.substr(5); } else { s1 = s.substr...
ALGO
0.982855
3.843442
b6c6eced-3fb5-4eb5-a939-c93b5e60607f
raincross7/code-similarity
codes/train_code/problem361/problem361_405.cpp
#include <iostream> #include <string> #include <vector> #define rep(i,n) for (int i = 0; i < (n); ++i) using std::cin; using std::cout; using std::endl; using std::string; using std::vector; int main() { long long N, M; cin >> N >> M; if (N >= M / 2) cout << M / 2 << endl; else { long long m = M - (2 * ...
ALGO
0.999945
3.339966