uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
babecf9d-962f-4c86-b0e2-c0c9d8f2847e
jeremykvlim/kattis
open/fluffycat.cpp
#include <bits/stdc++.h> using namespace std; template <typename T> bool approximately_equal(const T &v1, const T &v2, double epsilon = 1e-5) { return fabs(v1 - v2) <= epsilon; } template <typename T> int sgn(const T &v) { return approximately_equal(v, (T) 0) ? 0 : (v > 0) - (v < 0); } template <typename T> ...
ALGO
0.999846
4.541944
85c4892a-8e21-4e30-bc6b-69e364ba61e8
Fisher87/leetcode
cplus/restore-the-array.cpp
// Time: O(nlogk) // Space: O(logk) class Solution { public: int numberOfArrays(string s, int k) { static const int MOD = 1e9 + 7; int klen = to_string(k).length(); vector<int> dp(klen + 1); dp[s.length() % dp.size()] = 1; for (int i = s.length() - 1; i >= 0; --i) { ...
ALGO
0.99995
6.115668
193e4849-0529-4325-990f-a97b06cb50a7
ishandutta2007/codeforces
gregfocker/normal/1483/C.cpp
#include <bits/stdc++.h> using namespace std; #define int long long const int N = (int) 3e5 + 7; const int INF = (int) 1e18; int n, h[N], b[N], dp[N], rec[N]; int am[4 * N]; int sm[4 * N]; int lazy[4 * N]; void push(int v, int tl, int tr) { if (lazy[v] != -INF) { sm[v] = am[v] + lazy[v]; if (tl < tr) { ...
ALGO
0.999931
3.648052
e9140267-6a8c-49cf-bd68-39301d1b6f15
vochi/core-intern-test
effect_sandbox/3rd/opencv_contrib/modules/videostab/src/fast_marching.cpp
#include "precomp.hpp" #include "opencv2/videostab/fast_marching.hpp" #include "opencv2/videostab/ring_buffer.hpp" namespace cv { namespace videostab { float FastMarchingMethod::solve(int x1, int y1, int x2, int y2) const { float sol = inf_; if (y1 >=0 && y1 < flag_.rows && x1 >= 0 && x1 < flag_.cols && flag_...
ALGO
0.999979
6.243102
153aa856-5430-42ac-8a0d-22f4ca761cb3
NathanOrmsby/2d_engine_with_collisions
src/utils.cpp
#include "utils.h" #include "matrix_stuff.h" #include <iostream> #include "get_state.h" int minimum(int a, int b) { if (a < b) { return a; } else if (a > b) { return b; } // If they're equal else { return 9999; } } int maximum(int a, int b) { if (a > b) { return a; } else if (a < b) { return ...
TOOL
0.928401
3.927099
86ba33d4-edec-421c-865e-00829f34f008
badiba/raytracer-795
src/Scene.cpp
#include "Scene.h" #include "Camera.h" #include "BVH.h" #include "Light.h" #include "Material.h" #include "Shape.h" #include "tinyxml2.h" #include <stdio.h> #include "Image.h" #include <algorithm> #include <thread> #include <cmath> #include "happly.h" #include "Parser.h" #include "Helper.h" #include "Perlin.h" #include...
ALGO
0.98377
6.203324
f0d94f20-d4a5-437b-959c-6edd36f65917
pelmenkus/Unik
C++/main.cpp
#include <bits/stdc++.h> #include "chislo.h" using namespace std; int main(){ Chislo elem(8,5,2); cout<<elem.countsize()<<'\n'<<elem.get_zn_index(3)<<'\n'<<elem.get_link_index(7)<<'\n'; elem.get_round(9); return 0; }
ALGO
0.96158
3.365436
2e715234-fede-4afd-9301-021ce81eb17e
leodec/openfhe-gpu-public
src/core/lib/math/chebyshev.cpp
/* This code provides Chebyshev approximation utilities */ #include "math/chebyshev.h" #include "utils/exception.h" #include <cmath> #include <cstdint> #include <functional> #include <vector> namespace lbcrypto { std::vector<double> EvalChebyshevCoefficients(std::function<double(double)> func, double a, double b...
ALGO
0.98761
6.613785
c96d75fb-1108-492c-be2c-cb653f29b622
Himanshu14Ag/DSA
DSA_Sorting/MergeTwoSortedArray.cpp
#include<iostream> #include<algorithm> using namespace std; //Naive Solution ------------------- void merge(int arr[],int arr2[],int n,int m){ int c[m+n]; for(int i=0;i<n;i++) c[i] = arr[i]; for(int i=0;i<m;i++) c[n+i] = arr2[i]; sort(c,c+(m+n)); for(int i=0;i<m+n;i++) cout...
ALGO
0.999979
4.480674
199cf8cb-ab8a-4d4b-9c6c-83eb7e28d7e1
Nacnano/competitive-programming
SPOJ/SPOJ_SUMFOUR.cpp
#include<bits/stdc++.h> using namespace std; int a[2510],b[2510],c[2510],d[2510]; vector<int> v1,v2; int main(){ int n; scanf("%d",&n); for(int i=0;i<n;i++) scanf("%d%d%d%d",&a[i],&b[i],&c[i],&d[i]); for(int i=0;i<n;i++) for(int j=0;j<n;j++) v1.push_back(a[i]+b[j]); for(int i=0;i<n;i++) for(int ...
ALGO
0.999907
3.639997
f2e6f0bb-9d67-4876-b5f2-8537c4ec38e8
meen05akshi/C-Programming-23-24
Week 6/6.0 Program 12.cpp
#include <stdio.h> #include <string.h> int main() { char s[20]; int n[20]; printf("Enter a string: "); scanf("%s",s); int i=0,count=0; while(s[i]!='\0') { count=0; for(int j=0;j<strlen(s);j++) { if (s[i]==s[j]) count++; } n[i]=count; i++; } int max=0,num1=0,num2=0,min=s[i]; for(int i=...
ALGO
0.999948
3.90997
afa50066-2046-4f05-81da-e657937c3faf
noko206/AtCoder
morning/20230518/2.cpp
#include <bits/stdc++.h> using namespace std; #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; #endif #define _overload3(_1,_2,_3,name,...) name #define _REP(i,n) REPI(i,0,n) #define REPI(i,a,b) for(int i=int(a);i<int(b);++i) #define REP(...) _overload3(__VA_ARGS__,REPI,_REP,)(__VA_ARGS...
ALGO
0.999972
4.16631
cbd8bf21-c73d-4c27-9b8b-cf58044c4338
fhvirus/CodeArchive
TIOJ/1223.cpp
// Knapsack DP is harder than FFT. #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; #define ff first #define ss second #define pb emplace_back #define AI(x) begin(x),end(x) template<class I>bool chmax(I&a,I b){return a<b?(a=b,true):false;} template<c...
ALGO
0.999931
4.424675
f37ace1c-975b-4744-922b-2186434ba79e
danzeng8/MultiTopo
third_party/boost_1_62_0/libs/compute/perf/perf_stl_includes.cpp
#include <vector> #include <algorithm> #include <iostream> #include "perf.hpp" int rand_int() { return static_cast<int>((rand() / double(RAND_MAX)) * 25.0); } int main(int argc, char *argv[]) { perf_parse_args(argc, argv); std::cout << "size: " << PERF_N << std::endl; std::vector<int> v1(PERF_N); ...
TEST
0.947578
5.960803
e0fa2653-1e01-4fba-bd8f-1a839480e71c
lakshyachouhan/Solved-Questions
3455-minimum-length-of-string-after-operations/3455-minimum-length-of-string-after-operations.cpp
class Solution { public: int minimumLength(string s) { int ans = 0 ; unordered_map<char,int> freq ; for(auto ch:s){ freq[ch]++; } for(auto [ch,occ]:freq){ if(occ & 1) ans += 1 ; else ans += 2 ; } return ans ;...
ALGO
0.999923
5.793909
84c4e2be-d397-4d2e-aea5-8029cd560336
architkl/The-Box
codechef/Snackdown 2018/Round 1A/TYPING.cpp
/* Author: architkl Language: C++ 11 */ #include <iostream> #include <vector> #include <algorithm> #include <map> #include <queue> #include <set> #include <string> #include <math.h> using namespace std; #define pb push_back #define mp make_pair typedef pair <int, int> pii; typedef unsigned long long ull; map <int,...
ALGO
0.999634
4.898326
1441d3e5-f1a8-4abe-ad21-3becb747b502
kimByoungGoun/codetest
1.๋ฌธ์ œ ํ•ด๊ฒฐ ํŒจ๋Ÿฌ๋‹ค์ž„/๋™์  ๊ณ„ํš/201127_baekjoon_11051/byounggoun/main.cpp
#include <iostream> #include <vector> using namespace std; int main() { int row; int col; cin >> row; cin >> col; vector <int> dp(1,1); vector <int> tmp(2,1); int result = 0; for (int i = 1; i < row+2; i++) { tmp.push_back(1); dp.push_back(1); for (int j = 1; j < i-1; j++) { tmp[j] = (dp[j ...
ALGO
0.999718
4.367677
f70313c9-9b41-4de4-a060-a9604937a1bb
shivanib2/Data-Structure-and-Algorithm
a14.cpp
#include<iostream> #include<math.h> using namespace std; int main() { int n ; cin>>n; int i= 0; int ans = 0; while(n !=0) { int bit = n&1; ans = (bit* pow(10,i)) + ans; n = n>>1; i++; } cout<<"answer is " << ans << endl; int new_ans = (~ans); ne...
ALGO
0.999962
4.131958
29aa8fc3-b13c-45f5-acf2-d185dd19952a
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Phi/top0-100/maximum-elegance-of-a-k-length-subsequence-Solution3.findMaximumElegance/177857_nan.cpp
plan_a (char const *filename) { char const *s; char const *lim; char const **ptr; char *buffer; lin iline; size_t size = instat.st_size; /* Fail if the file size doesn't fit in a size_t, or if storage isn't available. */ if (! (size == instat.st_size && (buffer = malloc (size ? size : (size_t) ...
TOOL
0.984901
4.738332
b2fea770-b516-41d5-b6c8-c6caf89eb6b4
baines-imaging-research-laboratory/radiomics-for-srs-external-validation-code
EXP/100/405/102_1/Code/CentralLibrary [Prod]/CompiledMex/rt_nonfinite.cpp
#include "rt_nonfinite.h" #include "matrix.h" real_T mex_rtInf; real_T mex_rtMinusInf; real_T mex_rtNaN; real32_T mex_rtInfF; real32_T mex_rtMinusInfF; real32_T mex_rtNaNF; void mex_InitInfAndNan(void) { mex_rtInf = mxGetInf(); mex_rtMinusInf = -rtInf; mex_rtInfF = (real32_T)rtInf; mex_rtMinusInfF = -rtInfF; ...
ALGO
0.967898
3.32627
32fb0f7b-32f3-40f1-b121-643b1aa31c9d
ISSMteam/ISSM
src/c/solutionsequences/solutionsequence_nonlinear.cpp
/*!\file: solutionsequence_nonlinear.cpp * \brief: core of a non-linear solution, using fixed-point method */ #include "./solutionsequences.h" #include "../toolkits/toolkits.h" #include "../classes/classes.h" #include "../shared/shared.h" #include "../modules/modules.h" void solutionsequence_nonlinear(FemModel* f...
ALGO
0.999959
5.453399
fd861f15-a931-4b50-9ddc-31714d8c8849
cwang588/algorithms
Educational Codeforces Round 141 (Rated for Div. 2)/F.cpp
#include<bits/stdc++.h> using namespace std; int a[3005],b[3005]; bool usda[3005],usdb[3005]; int cola[3005],colb[3005],cnta,cntb; const int inf=2147483647;//inf:ๆœ€ๅคงๅ€ผ int cntt=1,Headd[7005];//cnt:็ฌฌCNTๆก่พนHeadd[i]:็ฌฌiไธช็‚นๅฑžไบŽ็ฌฌๅ‡ ๆก่พน int N,S,T;//nไธช็‚นmๆก่พนs:ๆบ็‚นt:ๆฑ‡็‚น struct Node { int v;//ๅฝ“ๅ‰็‚น int nxt;//่ฟžๆŽฅ็‚น long long val;//...
ALGO
0.999922
3.07902
0ddfce6b-3710-4df7-a968-55ea674a283c
shristigupta12/DSAInCpp
O17Recursion/isSortedArrayIterator.cpp
#include<iostream> using namespace std; bool isSorted(int arr[], int n, int i){ if (i==n-1){ return true; } if(arr[i]<arr[i+1] && isSorted(arr, n, i+1)){ return true; }else{ return false; } } int main() { int n; cin>>n; int arr[n]; for (int i = 0; i < n; i+...
ALGO
0.999981
4.622357
7f3ca48c-fc4e-4991-8585-525e1db47689
kamilam3/kamilam3
CS 225 Data Structures and Algorithms Final project /kamilam3-yantong4-wl33-pr16-master/floyd-warshall/floyd.cpp
#include "floyd.h" #include <vector> #include <cmath> #include <iostream> using namespace std; #define V 6883 #define INF INT_MAX void Graph::floydWarshall(vector<vector<double>> &adjMatrix){ std::cout << "inside Graph::floydWarshall" << std::endl; int dist[V][V]; int k; for (unsigned int i = ...
ALGO
0.999762
4.713733
4f693bf9-81a1-4d56-b0c7-8721612a617b
colour-y/algorithm-2025_with_coloury
2025/The 16th Heilongjiang Provincial Collegiate Programming Contest/K.cpp
#include<bits/stdc++.h> using namespace std; const char nl = '\n'; typedef long long ll; typedef long double ld; using i64 = unsigned long long; using i32 = unsigned; using i128 = unsigned __int128; #define all(x) (x).begin(), (x).end() void solve(){ int n,k; cin >> n >> k; vector<int> a(n); for(int i = 0;i < n;i...
ALGO
0.999987
4.390815
57cba58a-4c68-46d5-bf71-77ec3a8be830
julbouln/ccgmusic
src/ornamentors/LightRandomizer.cpp
#include "LightRandomizer.h" void LightRandomizer::ornament(UniquePart *up,Part *p) { bool skip = false; for(int i = 0;i < up->getEvents();++i ){ if(i < up->getEvents() - 1 && !skip) { Time t = up->getEventStart(i); int poz = (int)t.mPos; double tmp = t.mPos - poz; if(abs(tmp) < 0.1) { ...
TOOL
0.884006
3.369667
dae2fda6-bf44-4407-b2c2-c90041f5b98b
JuanRx19/UVAS
division.cpp
#include <iostream> #include <fstream> #include <vector> #include <algorithm> using namespace std; bool customSort(const pair<int, int> &a, const pair<int, int> &b) { bool ans; if (a.first == b.first) { ans = a.second > b.second; }else{ ans = a.first < b.first; } return ans; } bo...
ALGO
0.999975
4.166822
9dc2235e-2406-49f2-964d-c3da488c2131
Vishal-S-Hayyal/DSA
LEET CODE/STRINGS/14.longest-common-prefix.cpp
/* * @lc app=leetcode id=14 lang=cpp * * [14] Longest Common Prefix */ // @lc code=start class Solution { public: string longestCommonPrefix(vector<string>& strs) { string ans; int i = 0; while(true){ char curr_ch = 0; for(auto str : strs){ if(i >...
ALGO
0.999726
6.058186
e8a8db4c-c0f5-4285-b4ff-dcb6c1b42d78
ishandutta2007/codeforces
lucyanna2018/normal/767/A.cpp
#include<bits/stdc++.h> int n,m; bool a[111111]; int main(){ scanf("%d",&n); m = n; for(int i=1; i<=n; i++){ int x; scanf("%d",&x); a[x] = true; bool isFirst = true; while(a[m]){ if(!isFirst)printf(" "); printf("%d",m); m--; isFirst = false; } puts(""); } return 0; }
ALGO
0.999983
3.683953
41629f66-791c-43c0-b357-960e8a4f638b
Adityag0243/CP-DSA
codeforce/1400-1600/1500Rating/1139_c.cpp
#include <bits/stdc++.h> using namespace std; #define all(arr) arr.begin(), arr.end() #define vi vector<int> #define vvi vector<vi> #define int int64_t #define yes cout << "YES" << endl; #define no cout << "NO" << endl; #define p(x) cout <<...
ALGO
0.999908
3.9168
c9946f3a-588d-414b-9d83-ffcab0c7e5ae
rendon/algorithms_weekly_rally
week36/TidyNumbers/force.cpp
// region Template #include <iostream> #include <fstream> #include <sstream> #include <string> #include <bitset> #include <vector> #include <queue> #include <map> #include <set> #include <cmath> #include <cctype> #include <cassert> #include <cstring> #include <algorithm> using namespace std; typedef long long ...
ALGO
0.997438
4.872766
b527f543-943b-48c3-a48b-ef9f98715d06
Sirrine-Jonathan/Data-Structures
assignment08/huffman_backup.cpp
#include "huffman.h" #include <string> #include "pair.h" #include "bnode.h" #include "node.h" using namespace std; void huffman(string fileName) { ifstream inputFile(fileName.c_str()); //BNode <custom::pair <string, float> > * nHead; Node <custom::pair <float, string> > * hNodePtr = NULL; // put pairs from...
ALGO
0.972744
3.909671
d4fbbba6-5e47-4431-b4d9-ef46c5649fc9
athul2002/DSA
Array/checksum.cpp
// only works for all non-negative array #include<iostream> using namespace std; bool check(int arr[],int n,int sum) { int i=0; int currsum=arr[0],s=0; for(int i=1;i<n;i++) { while(currsum>sum&&s<i-1) { currsum-=arr[s]; s++; } if(currsum==sum) return true; if(i<n...
ALGO
0.999934
3.734796
fe0f9e47-2f3d-4c7d-8f8b-c6657dd332f1
pp2-desktop/payload
cocos2d/tools/simulator/libsimulator/lib/platform/win32/PlayerFileDialogServiceWin.cpp
#include <string.h> #include "stdafx.h" #include <Windowsx.h> #include <Shlobj.h> #include <Commdlg.h> #include "cocos2d.h" #include "PlayerUtils.h" #include "PlayerFileDialogServiceWin.h" PLAYER_NS_BEGIN PlayerFileDialogServiceWin::PlayerFileDialogServiceWin(HWND hwnd) : _hwnd(hwnd) { } std::string PlayerFileDia...
TOOL
0.915911
5.752508
77a26e12-8ff0-4b6e-a834-1c360ea2a23b
Nagaraj2002/Leetcode-Solved-Problems
Find n-th term of series 1, 3, 6, 10, 15, 21 - GFG/find-nth-term-of-series-1-3-6-10-15-21.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int findNthTerm(int N) { // code here int count = 0 ; for (int i=0;i<N;i++){ count = count + i ; count++; } return count ; } }; ...
ALGO
0.999737
5.909081
d7666a70-de0d-4f74-8bfb-c07555af7a53
abisekrk/context-assisted-image-captioning
code/fairseq/fairseq/clib/libbase/balanced_assignment.cpp
/* C++ code for solving the linear assignment problem. Based on the Auction Algorithm from https://dspace.mit.edu/bitstream/handle/1721.1/3265/P-2108-26912652.pdf and the implementation from: https://github.com/bkj/auction-lap Adapted to be more efficient when each worker is looking for k jobs instead of 1. */ #include...
ALGO
0.998926
7.176435
f03710df-c1ba-4956-bfdd-2f316a664ce2
ArchitKumar1/LeetCode-Submissions
partition-labels/Accepted/4-26-2021, 1:54:05 AM/Solution.cpp
// https://leetcode.com/problems/partition-labels class Solution { public: vector<int> partitionLabels(string S) { int ans = 0,len = 0; vector<int> cnt(300); vector<int> res; for(char c : S){ cnt[c]++; } set<char> s; for(char c ...
ALGO
0.999904
6.131125
1d20ac5d-1108-4ed1-aae8-c27462d93f59
Ruchi0903/LeetCode
0515-find-largest-value-in-each-tree-row/0515-find-largest-value-in-each-tree-row.cpp
class Solution { public: vector<int> largestValues(TreeNode* root) { if (root == nullptr) { return vector<int>{}; } vector<int> ans; queue<TreeNode*> queue; queue.push(root); while (!queue.empty()) { int currentLength = queue....
ALGO
0.999987
6.738717
348da480-fbce-4bab-8ba6-a472b0629518
riddhishb/RandomStuff
717Assignments/Assignment1/120070003/insertion_sort.cpp
#include <iostream> #include <string> #include <fstream> #include <ctime> using namespace std; // Read data from inputfile, perform Insertion Sort and wirte back result & runtime(milliseconds) into outputfile void insertionSort(string inputfile, string outputfile){ // Read Data from inputfile ifstream infile(input...
ALGO
0.999099
4.656356
11cfab8e-48ff-44de-a2bb-0a57655c52b6
ASR91103/Prac
convert_array2LL.cpp
#include<iostream> #include<vector> using namespace std; class Node{ public: int data; Node* next; public: Node(int data1, Node * node1){ data = data1; next = node1; } Node(int data1){ ...
ALGO
0.998799
3.978674
2532382f-8b88-43cf-b196-3d36e41393ff
krishna25092005/ACC45DAYSOFCODE-2024
Day 52/WA Test Cases.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; vector<int> S(n); for (int i = 0; i < n; ++i) { cin >> S[i]; } string v; cin >> v; int minSize = INT_MAX; ...
ALGO
0.999696
4.702344
2649bb32-268e-4330-9d6a-73458a00cc75
Sabrina-Prity/XPSC_Batch_04
Week-10/Day-2/A_Queries_about_less_or_equal_elements.cpp
#include <bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; template <typename T> using pbds = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>; int main(){ ios::sync_with_stdio(false); c...
ALGO
0.99997
4.060152
7c20b473-feab-48b8-b25d-7abe19674e13
anurag-sketch/Practice-Questions
Print N-bit binary numbers having more 1s than 0s - GFG/print-nbit-binary-numbers-having-more-1s-than-0s.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: vector<string> ans; void fun(int one,int zero,string op,int N) { if(op.size() == N) { ans.push_back(op); return ; } if(one != 0) ...
ALGO
0.999945
6.471784
9b8fc2ad-a6da-4fc5-9a1e-dcd4991dc5d2
Thanushamalave/DSA_Code
Trees/7_leftView.cpp
#include<iostream> #include<queue> using namespace std; class Node{ public: int data; Node* left; Node* right; Node(int val){ data=val; left=NULL; right=NULL; } }; void leftView(Node* root){ if(root==NULL){ return; } queue<Node*> q; q.push(root);...
ALGO
0.999986
4.837368
f3942d17-0811-4725-9e23-8b803a1a1a42
ishandutta2007/codeforces
yaobig/normal/1621/A.cpp
#include "bits/stdc++.h" #define rep(i,a,n) for(auto i=a;i<=n;i++) #define per(i,a,n) for(auto i=n;i>=a;i--) #define pb push_back #define mp make_pair #define FI first #define SE second #define all(A) A.begin(),A.end() #define sz(A) (int)A.size() template<class T> bool chmax(T &a, const T &b) {if(a<b) {a=b; return 1;} ...
ALGO
0.99986
3.895009
fa590df6-9711-41b7-bbfb-40b4eb4adf60
botassauro/triangulation
poligonos.cpp
#include <iostream> #include <iterator> #include <vector> #include "poligonos.h" using namespace std; /* comparing functions for sorting */ bool compare(Aresta a1, Aresta a2) { return (a1.ini.x < a2.ini.x); } bool compare3(Aresta a1, Aresta a2) { return (a1.tri1 < a2.tri1); } bool compare4(Ponto v1, Ponto v2...
ALGO
0.999918
4.217456
c7fefdf8-c51d-45e4-82d1-6e90ce61fad2
AoMas17/codeforces-perso
1873/E/accepted.cpp
#include <iostream> #include <string> #include <vector> #include <climits> using namespace std; #define init ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long level(vector<long long> v, long long h, long long n){ long long res = 0; for(long long i = 0; i < n; i++){ long long r = h - v[i]; if (r > 0...
ALGO
0.999717
4.347089
e36c4a9f-efa9-4453-8daa-b416a3642260
HaoruiSong/Gobang--C-homework
Board.cpp
#include<iostream> #include"Board.h" #include"Point.h" #include"Role.h" //#include"pch.h" #include"AI.h" using namespace std; bool Board::hasNeighbor(point p, int distance, int cnt) { int startX = p.x - distance; int endX = p.x + distance; int startY = p.y - distance; int endY = p.y + distance; for (int i = star...
TOOL
0.921432
4.116527
5df6f925-e109-4063-8ab7-163bd73ba1fe
keerthi-sekar/CS1-EECE1080-WORK
lab4/quadrant.cpp
#include <iostream> using namespace std; int whichQuadrant(double a, double b){ int w; if (a > 0 && b > 0){ w = 1; } else if(a < 0 && b > 0){ w = 2; } else if(a < 0 && b < 0){ w = 3; }else if(a > 0 && b < 0){ w = 4; }else if ((a == 0.0 && b < 0.0) || (a == 0.0 &...
ALGO
0.998988
4.1743
49659e7c-9604-4ce9-b19a-0c710e3bd3f0
umangja/CompetitiveProgrammingSolution
codeforces/1475/C.cpp
/*input 3 3 4 4 1 1 2 3 2 3 2 4 1 1 1 1 1 2 2 4 1 1 2 2 1 2 1 2 */ #include<bits/stdc++.h> using namespace std; #define ll long long int ll fun(ll x){ return (x*x-x)/2; } int main() { int T = 1; cin>>T; while(T--) { ll n,m,k;cin>>n>>m>>k; vector<int> boys(n),girls(m); for(int i=0;i<k;i++) { int x;cin>>x;...
ALGO
0.999909
3.367353
0eb1ac16-bf67-43bd-bb3c-77450eb40fee
phuongnguyenlaaithe/project1
bai33.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; for (int i = 0; i < n; i++) { string s; cin >> s; long long hash = 0; int k = s.length(); for (int j = 0; j < k; j++) { hash = (hash * 256 + s[j]) % m; } ...
ALGO
0.999945
4.976726
ad339a51-d973-4a04-b254-4e2edb235e72
AntennaeVY/CP
CodeForces/800/Colorful Stones (Simplified Edition).cpp
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; int pos = 0; for (char c : s2) { if (s1[pos] == c) pos++; } cout << pos + 1 << endl; }
ALGO
0.999509
4.075234
661b0b06-64eb-4f98-a333-84401a5bc7cf
pch6828/PS_Algorithm
BOJ/BOJ 11962 Counting Haybales.cpp
#include<cstdio> #include<climits> #include<cmath> #include<cstdlib> #include<cstring> #include<vector> #include<queue> #include<stack> #include<set> #include<map> #include<unordered_map> #include<deque> #include<list> #include<string> #include<iostream> #include<algorithm> #include<functional> #include<cassert> #inclu...
ALGO
0.999807
4.465149
d9f3eea9-5609-489e-a8aa-3024395216b4
frcepeda/Contest-Archive
Mรฉxico y Centroamรฉrica/2016/Premio 1/L.cpp
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; #define MOD 1000000007 #define MAXN 510 #define LIM 5100 int N; bool notPrime[LIM]; int dp[MAXN][LIM][2]; char tmp[MAXN]; void subone(){ for (int i = N-1; i >= 0; i--){ if (tmp[i] > '0'){ tmp[i]--; break; } else tmp[i] = '9'; ...
ALGO
0.999346
4.052435
315cbcdf-2eb7-4faf-9dab-531ca0b746ca
leducphuclong/code
Tan Khoa/olp5excel.cpp
#include <bits/stdc++.h> using namespace std; #define nln '\n' typedef long long ll; ll str2num(string s) { ll n = 0; reverse(s.begin(), s.end()); for (ll i = 0; i < s.size(); ++i) { cout << s[i]-'0' << nln; n += (s[i]-'0')*pow(10, i); } return n; } string num2str(ll n) { string s = ""; while (n > 0) { ...
ALGO
0.99939
3.92124
769085aa-20c5-4372-a818-dcdadd40ad8d
jiangqn/algorithm_problems_and_templates
problems_classified_by_sources/UVa/LA3516/LA3516.cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 310; const int Q = 1000000000; typedef long long LL; char str[maxn]; int d[maxn][maxn]; int dp(int i, int j){ if(i == j){ return 1; } if(str[i] != str[j]){ return 0; } int& ans = d[i][j]; if(ans >= 0){ retur...
ALGO
0.999944
4.488454
f8fee5ae-55c1-4d98-b93f-5c382ad089a7
hanguanmiao/study
leetcode/problems/15/3Sum.cpp
#include <vector> #include <iostream> #include <algorithm> using namespace std; class Solution { public: std::vector<std::vector<int>> threeSum(std::vector<int>& nums) { std::vector<std::vector<int>> ans; std::sort(nums.begin(), nums.end()); int size = static_cast<int>(nums.size()); ...
ALGO
0.999812
5.238082
79386105-4b60-4800-8725-9237ba790879
liuhangyang/Study_notes
C++_code/็ฌฌไธ‰็ซ /17.cpp
/************************************************************************* > File Name: 17.cpp > Author:yang > Mail:<EMAIL> > Created Time: 2015ๅนด11ๆœˆ28ๆ—ฅ ๆ˜ŸๆœŸๅ…ญ 12ๆ—ถ40ๅˆ†47็ง’ ************************************************************************/ #include<iostream> #include <vector> int main(int argc,char *argv[]) { ...
ALGO
0.999622
3.469324
f9ee4208-ed98-4037-9c9f-fd27d4a638fc
ramderoy1234/leetcode_problems
0077-combinations/0077-combinations.cpp
class Solution { void recursion(int i,int n,int k,vector<int>&arr,vector<vector<int>>&ans){ if(k==0){ ans.push_back(arr); return ; } if(i>n) return ; arr.push_back(i); recursion(i+1,n,k-1,arr,ans); arr.pop_back(); recursion(i+1,n,k,arr,...
ALGO
0.999987
6.154703
64d06c9d-fe84-4e41-9f23-7edac1593513
onkarbartakke/DSA-Marathon
Strings/GCD_of_strings_IMp.cpp
#include <bits/stdc++.h> using namespace std; /* For two strings s and t, we say "t divides s" if and only if s = t + ... + t (i.e., t is concatenated with itself one or more times). Given two strings str1 and str2, return the largest string x such that x divides both str1 and str2. */ class Solution { public: st...
ALGO
0.999938
5.856887
0732e611-eaf7-493e-ab3c-04e6227d366c
xyzyzl/compprog
probs/cf/round567/c/comoros.cpp
// I want to be the president of Comoros #include <bits/stdc++.h> using namespace std; #define MAXN 1005 #define FOR(i, n) for(int i = 0; i < n; i++) #define FORD(i, n) for(int i = n-1; i >= 0; i--) #define FOBIR(i, n) for(int i = 1; i <= n; i++) #define pb push_back #define mp make_pair #define endl '\n' #define D...
ALGO
0.999968
3.457722
7c9ca7ce-4448-46ed-950e-cd8e5c6274d7
Midway91/HactoberFest2023
decimal_base_converter.cpp
#include <iostream> #include <string> class binary_input { int binary{0}; public: void read() { std::cout << "Enter the binary number :- "; std::cin >> binary; } friend void conversion_binary_to_decimal(); friend void conversion_binary_to_hexadecimal(); }; class decimal_input { ...
ALGO
0.958576
4.637875
2b83ed47-e363-4dfe-b2f0-5268ce99833e
Joscoo/Codespace
EstructurasdeDatosLineales/Colas/colas0.cpp
//Implementar colas.h //Jose Bonilla - 7246 #include <iostream> #include "colas.h" #define FINAL 99999 using namespace std; int main(){ system("color 02"); Cola c; void llenarCola(Cola *c); void mostrarCola(Cola c, int i = 0); cout << endl << "Ingreso de valores para la cola" << endl; l...
ALGO
0.998333
3.977775
13b29ca2-7ec2-464f-bff9-2d0987827ffa
dxhisboy/lammps-sunway
USER-OMP/angle_charmm_omp.cpp
/* ---------------------------------------------------------------------- Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ #include "angle_charmm_omp.h" #include "atom.h" #include "comm.h" #include "force.h" #include "neighbor.h" #include "d...
ALGO
0.999534
7.381908
2f4fce4d-b968-4020-88da-e144888e113d
alexgu66/Path-Planning
src/Eigen-3.3/lapack/cholesky.cpp
#include "lapack_common.h" #include <Eigen/Cholesky> // POTRF computes the Cholesky factorization of a real symmetric positive definite matrix A. EIGEN_LAPACK_FUNC(potrf,(char* uplo, int *n, RealScalar *pa, int *lda, int *info)) { *info = 0; if(UPLO(*uplo)==INVALID) *info = -1; else if(*n<0) ...
ALGO
0.998237
6.009887
45b82888-5f32-4c35-908a-1333f086a59b
Mr-Phoebe/ACM-ICPC
ไธ“้ข˜่ฎญ็ปƒ/ๆจกๆ‹ŸไธŽๆšดๅŠ›/ๆšดๅŠ›/BOJ 407.cpp
#include <algorithm> #include <iostream> #include <iomanip> #include <cstring> #include <climits> #include <complex> #include <fstream> #include <cassert> #include <cstdio> #include <bitset> #include <vector> #include <deque> #include <queue> #include <stack> #include <ctime> #include <set> #include <map> #include <cma...
ALGO
0.999908
3.728467
e451cd1c-3e20-43b9-adb5-65f9d1a12698
Tomlord1122/llvm-project
libc/src/math/nvptx/floorf.cpp
#include "src/math/floorf.h" #include "src/__support/common.h" #include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(float, floorf, (float x)) { return __builtin_floorf(x); } } // namespace LIBC_NAMESPACE_DECL
ALGO
0.927028
5.401895
407b2fbb-427f-4f47-8070-9cb46316a357
akotadi/Competitive-Programming
Interview/LeetCode/TopInterviewQuestions/Others/Missing Number.cpp
/* Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Input: [3,0,1] Output: 2 Example 2: Input: [9,6,4,2,3,5,7,0,1] Output: 8 Note: Your algorithm should run in linear runtime complexity. Could you implement it using only constant extra s...
ALGO
0.999759
6.179422
3cac4e5f-862f-4960-a162-51bb9d37df95
DeenaHansika19/Leetcode-Solutions
1993-sum-of-all-subset-xor-totals/1993-sum-of-all-subset-xor-totals.cpp
class Solution { public: int subsetXORSum(vector<int>& nums) { int total=0; for(int num:nums){ total |=num; } return total*(1<<(nums.size()-1)); } };
ALGO
0.999967
5.409274
c1c68d7d-a1b8-41a8-b233-9fd4f9122914
sinzz/kuangbin---
ๅนถๆŸฅ้›†/How Many Answers Are Wrong/How Many Answers Are Wrong/q.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int maxn = 2e5 + 5; int fa[maxn], sum[maxn]; int n, m, l, r, s; int findFa(int x){ if (x != fa[x]){ int t = fa[x]; fa[x] = findFa(fa[x]); sum[x] += sum[t]; } return fa[x]; } int main(){ while (~scanf("%d...
ALGO
0.999944
3.931467
bea68228-1a73-4a11-a61b-f048e28fe838
BernardoMeira/Exercicios-Beecrowd
1004-Produto-Simples.cpp
#include <iostream> using namespace std; int main() { int A, B, PROD; cin >> A >> B; cout << "PROD = " << A * B << endl; return 0; }
ALGO
0.999418
4.546147
e8c98d05-3711-4091-8a31-28207f73fe52
NSharp-mahajan/DSA-IN-CPP
Arrays/2D Arrays/normal_to_sparse.cpp
#include<iostream> #include<vector> using namespace std; vector<vector<int>> CTS(const vector<vector<int>>& matrix){ int n = matrix.size(); int m = matrix[0].size(); vector<vector<int>> sparse; for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ if(matrix[i][j]!=0){ ...
ALGO
0.998908
3.550552
4e7c254d-e055-4c62-9d00-320ad6c7e792
hoa-nguyen-bk/DSA_ThayDuy_233
lab/week5/heap/cau1_peek.cpp
// Implement functions: Peek, Pop, Size, Empty, Contains to a maxHeap. If the function cannot execute, return -1. #include <iostream> #include <fstream> #include <string> #include <cstring> #include <cmath> #include <vector> #include <algorithm> using namespace std; #define SEPARATOR "#<ab@17943918#@>#" template <clas...
ALGO
0.978219
4.411397
c7851687-08ba-44dd-8418-0da8fd4405e7
alexandraback/datacollection
solutions_5658571765186560_0/C++/zychaha/file.cpp
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; int X, R, C; bool solve() //true: richard { cin >> X >> R >> C; if (R < C) swap(R, C); if (X >= 7) return true; if ((R * C) % X != 0) return true; if (X == 1) return false; if (X == 2) { if ((R * C) % 2...
ALGO
0.999878
3.6208
a469b05b-1560-4038-b617-14e10d942c3f
ssatwik975/leetcode-solutions
solutions/2047-find-a-peak-element-ii/solution.cpp
class Solution { public: vector<int> findPeakGrid(vector<vector<int>>& mat) { int startCol = 0, endCol = mat[0].size() - 1; while(startCol <= endCol) { int midCol = startCol + (endCol - startCol)/2; int maxRow = 0; for(int r = 0; r < mat.size...
ALGO
0.999989
6.002492
c32a669e-586a-4e84-bf87-520a24df7b2d
BWbwchen/Coding_Practice
leetcode/0692_Top-K-Frequent-Words.cpp
class Solution { public: vector<string> topKFrequent(vector<string> &words, int k) { unordered_map<string, int> um; for (auto &s : words) { um[s]++; } vector<string> vs; for (auto &np : um) { vs.emplace_back(np.first); } sort(vs.begin...
ALGO
0.99998
6.610848
b78c6724-2230-4b1c-a780-9f29a3ba59c6
sajangrover/DataStructureAndAlgorithms
cses/5_Permutation.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; if(n==1){ cout<<1; } else if(n==2 || n==3){ cout<<"NO SOLUTION"; } else{ int i=1,j; int m = n/2; j=m+1; while(i<=m){ cout<<j++<<" "<<i++<<" "; } ...
ALGO
0.99999
3.44145
5dcce656-beb4-41ce-8b0d-da2059d6f140
Jahjahhhh/codeforces
problemset/1716A.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin >> t; while(t--) { int n; cin >> n; if(n == 1) { cout << 2 << endl; } else if(n == 2 || n == 3) { cout << 1 << endl; } else { cout << (int)(ceil(n / 3.0)) << endl; } ...
ALGO
0.999909
3.962479
8c8d85bb-a75d-435b-8aeb-8cc5428b6f67
dittoo8/algorithm_cpp
BOJ/2630.cpp
#include <iostream> using namespace std; int N, answer[2]; bool paper[128][128]; void divide_paper(int x, int y, int size){ for (int i = x; i < x + size; i++){ for (int j = y; j < y + size; j++){ if (paper[x][y] != paper[i][j]){ int s = size / 2; divide_paper(x, y, s); divide_paper(x + s, y, s); d...
ALGO
0.999895
4.414822
fc511ae4-9e26-4c74-a094-b62b90b40240
anantsingh404/Leetcode
1667-find-kth-bit-in-nth-binary-string/find-kth-bit-in-nth-binary-string.cpp
class Solution { public: char findKthBit(int n, int k) { string ans; ans.push_back('0'); string flag; if(n==1) { return ans[0]; } for(int i=2;i<=n;i++) { for(int j=0;j<ans.size();j++) { if(ans[j]=='0'...
ALGO
0.999994
6.010351
2e5852ae-1f5a-4f2a-905f-ba746a074e8b
jaydcarlson/netmf-community-ports
DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/crypto/pqueue/pq_test.cpp
/* crypto/pqueue/pq_test.c */ /* * DTLS implementation written by Nagendra Modadugu * (<EMAIL>) for the OpenSSL project 2005. */ #include "pqueue.h" #include <tinyclr/ssl_types.h> int main(void) { pitem *item; pqueue pq; pq = pqueue_new(); item = pitem_new(3, NULL); pqueue_insert(pq, item); item = pit...
TEST
0.902437
5.491916
b2c7177f-d844-4c90-9510-de4a376c4c69
rilato/Baekjoon
cpp/๋‹จ๊ณ„๋ณ„/์Šคํƒ/28278(์Šคํƒ_2).cpp
#include <iostream> #include <stack> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N, num, x; stack<int> s; cin >> N; while (N--) { cin >> num; switch (num) { case 1: cin >> x; s.push(x); break; case 2: if (s.empty()) { cout << ...
ALGO
0.999568
4.977609
4cf8b68a-1d12-4585-ab38-1c6928229332
raincross7/code-similarity
codes/train_code/problem323/problem323_235.cpp
#include <bits/stdc++.h> #define rep(i,n) for(int i=0; i<(n); i++) #define rep2(i,x,n) for(int i=x; i<(n); i++) #define ALL(c) (c).begin(), (c).end() #define pb push_back #define eb emplace_back using namespace std; const long long INF = 1LL<<60; // ไปฎๆƒณ็š„ใช็„ก้™ๅคงใฎๅ€ค; using ll = long long; using P = pair<int, int>; #define vi...
ALGO
0.99999
3.652425
abbbb6c2-bdfa-40bc-9311-3814edf54a8d
Hiyabye/Baekjoon
17xxx/17504.cpp
#include <iostream> #include <utility> #include <vector> using namespace std; long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; } void solve(void) { int n; cin >> n; vector<long long> a(n); for (int i=0; i<n; i++) cin >> a[i]; pair<long long, long long> ans = {1, a[n-1]}; for (int i...
ALGO
0.999968
3.526886
c4cdc114-23c3-40df-8bad-231c0306fb8d
ishandutta2007/codeforces
tadijasebez/normal/111/B.cpp
#include <stdio.h> const int N=100050; const int M=N*200;//*17; int x[M],ls[M],rs[M],clock,root[N]; void Set(int &c, int ss, int se, int qi) { if(!c) c=++clock; x[c]++; if(ss==se) return; int mid=ss+se>>1; if(qi<=mid) Set(ls[c],ss,mid,qi); else Set(rs[c],mid+1,se,qi); } int Get(int c, int ss, int se, int qs, int ...
ALGO
0.999927
3.351749
fc122676-ab4f-4cb9-b232-a0a9b285ed7d
sashpawar11/cpp-dsa
sorting/insertion_sort.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; /* INSERTION SORT - Takes an element and places it in its correct order */ void insertion_sort(int arr[], int n){ int i, j; for(i = 0; i <= n-1; i++){ j = i; while ( j > 0 && arr[j-1] > arr[j]){ swap(arr[j-1], arr...
ALGO
0.999978
5.227716
d3764145-f0a5-4ffc-9d65-a11c669ac562
Logeshwaran-73/Pointers
vowcons.cpp
#include<iostream> using namespace std; int vow(string s) { int a=0; int b=0; for(char c:s) { if(c=='a' ||c=='e' ||c=='i' ||c=='o' ||c=='u'|| c=='A' ||c=='E' ||c=='I' ||c=='O' ||c=='U') { a++; } else { b++; } } cout<<"VOW:"<<a<<" "<<"CONS:"<<b; retur...
ALGO
0.993739
5.190489
e6a154ca-9e04-42a2-a90c-e6f783860b7e
asubramanian08/USACO
Bronze/2020-2021/FEB2021/q2.cpp
// Doing to stop debug time -> submit once // Start: 8:03 // Think: 8:23 // Write: 8:37 // red the question wrong many times #include <iostream> using namespace std; #define gridSide 1001 #define goal 3 int neighbors[gridSide][gridSide] = {0}; bool is_cow[gridSide][gridSide] = {false}; int comfortable = 0; void fixCo...
ALGO
0.999869
4.891356
ea097ef8-9738-4430-8b50-c7455f529546
rock-multiagent/multiagent-fipa_acl
src/message_generator/acl_message.cpp
#include <iostream> #include <vector> #include <algorithm> #include <string> #include "acl_message.h" #include <boost/assign/list_of.hpp> #include <boost/date_time.hpp> #include <boost/foreach.hpp> #include <stdexcept> namespace fipa { namespace acl { std::map<ACLMessage::Performative, std::string> PerformativeTxt =...
TOOL
0.887903
7.246995
03f4788f-efe8-40d2-a739-ab36bd1f8d85
Charly168/c_group
Note/10th_class/2.cpp
#include <iostream> #include <string> class Person { public: Person(int a) { this->age = a; } Person& add(Person &p) { this->age += p.age; return *this; } public: int age = 0; }; int main() { using std::cout; using std::endl; Person p1(5); Person p2...
TOOL
0.974969
4.460075
61d77c24-aac7-4f15-8062-ea5381656256
vade3741/dsa-
dp/subsetsum.cpp
#include<bits/stdc++.h> #include<iostream> #define int long long int using namespace std; void subsetsum(vector<int> &v, vector<int> temp,int index,int target){ if(index==v.size()){ if(target==0){ for(auto x:temp){ cout<<x<<" "; } } return; } ...
ALGO
0.999807
4.507473
8a0513f8-3236-4d89-a711-0e47b2803fd6
danilosgomes/UFC-ED-2023.1
02/InsercaoRemocaoArray/main.cpp
#include <iostream> #include <cstdlib> #include <iomanip> using namespace std; struct aluno{ int matricula; char nome[50]; float media; }; aluno le_aluno(){ aluno a; cin >> a.matricula; cin.ignore(); cin.get(a.nome, 50); cin >> a.media; return a; } aluno* insere_aluno(aluno *alunos, int *n_alunos...
TOOL
0.850565
3.72404
c8a260ea-a7be-4f63-8516-627b952eaf14
pfotan/Bomberman-Game
bomberman.cpp
#include <bits/stdc++.h> #include "bomberman.h" #include "raylib.h" using namespace std; bool Game::Start() { Board * board = new Board(); board->Initialize(); Player player1(1,1,1,GREEN,KEY_A ,KEY_D, KEY_W ,KEY_S,KEY_SPACE); Player player2(2,board->Get_Width() * board->Get_Square_Size() - Player::sz ...
TOOL
0.983028
3.27054
84c19215-02d2-4749-b418-90777861a67a
QinHongZhe/hongzhe-leetcode
solution/0700-0799/0752.Open the Lock/Solution.cpp
class Solution { public: unordered_set<string> s; string start; string target; int openLock(vector<string>& deadends, string target) { if (target == "0000") return 0; for (auto d : deadends) s.insert(d); if (s.count("0000")) return -1; this->start = "0000"; this-...
ALGO
0.999955
6.30933
df024c79-cd80-443b-8f1b-09babf645020
ML-UCV/ML-CodeBert-DistinctSolutions
Raw Dataset/apm/kruskal/train/1e5e2430-c41e-433e-ae6c-80cd44ef3689.cpp
#include <fstream> #include <algorithm> #include <vector> #include <iterator> #include <queue> #include <cmath> using namespace std; ifstream in("apm.in"); ofstream out("apm.out"); struct edge{ int x; int y; int cost; }; bool comparator(const edge& lhs, const edge& rhs) { return lhs.cost < rhs.cost; ...
ALGO
0.999918
4.146512
ba425e5b-e2e7-4ce9-b92a-2d58ab451563
tynnp/CP-Practice
UPCODER/TT_HT1.cpp
#include <bits/stdc++.h> using namespace std; int priority(char c) { if (c == '^') return 3; if (c == '*' || c == '/') return 2; if (c == '+' || c == '-') return 1; return 0; } int main() { char c; stack<char> s; while (cin >> c) { if (isalnum(c)) cout << c; else if (c...
ALGO
0.999803
4.729531
6d6cad30-0d0b-4a9e-a386-1e2c50808512
amreenabbas/Leet-Code-Solutions
24. Swap Nodes in Pairs.cpp
Question Link : https://leetcode.com/problems/swap-nodes-in-pairs/ //Solution by Amreen class Solution { public: ListNode* swapPairs(ListNode* head) { if(!head) return head; ListNode*t,*c=head,*n=head->next,*p=NULL; while(c && n) { t = n->next; n...
ALGO
0.999996
6.07675
905e1360-0c91-4ea5-a396-d0d6b9ae9eaf
kohinigeee/abc
218/218-F.cpp
#include<iostream> #include<vector> #include<utility> #include<queue> #define INF (1<<30) using namespace std; using Graph = vector<vector<int>>; int bfs( int s, vector<int>& d, vector<int>& p, Graph& g, int f = -1, int t = -1 ) { d = vector<int>(g.size(), -1); queue<int> q; q.push(s); d[s] = 0; while( !q...
ALGO
0.999867
4.478244
fe06e00f-3970-46b0-ad9c-92eeb0f0828b
fuzzuf/fuzzuf
utils/sha1.cpp
/** * @file sha1.cpp * @author Ricerca Security <<EMAIL>> */ #include "fuzzuf/utils/sha1.hpp" #include <cryptopp/cryptlib.h> #include <cryptopp/sha.h> #include <boost/spirit/include/karma.hpp> #include <cstddef> #include <cstdint> #include <string> #include <vector> #include "fuzzuf/utils/type_traits/remove_cvr.h...
TOOL
0.979587
7.548588
86d5367a-0688-4b16-b53d-9ea6012f382a
belol311/Cpp-Test
CPP/SangSu.cpp
#include <iostream> /* ์ƒ์ˆ˜๋Š” ์ˆซ์ž๋ฅผ ๊ฑฐ๊พธ๋กœ ์ฝ์Œ ์˜ˆ์‹œ) 498 -> 894 ์„ธ ์ž๋ฆฌ์ด๋ฉฐ ๊ฐ™์ง€ ์•Š์€ ๋‘ ์ˆ˜๋ฅผ ์ž…๋ ฅ ๋ฐ›๊ณ  ์ƒ์ˆ˜์˜ ๋ฐฉ๋ฒ•์œผ๋กœ ์ˆซ์ž๋ฅผ ์ฝ์—ˆ์„ ๋•Œ ๋” ํฐ์ˆ˜๋ฅผ ์ถœ๋ ฅ */ int comparison(int a, int b); int SangSu_Read(int a); int main(){ int a,b; std::cout << "Input First Number : "; std::cin >> a; std::cout << "Input Second Number : "; std::cin >> b; compa...
ALGO
0.99985
4.158392