uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
a75fb7ba-1ae9-43ad-aeda-29234315356d
Sunnyjha007/LeetCode---Daily-Challenge
April/Day_28_Similar String Groups.cpp
class Solution { public: bool similar(string &s,string &t){ int dif=0; for(int i=0;i<s.size();i++){ if(s[i]!=t[i]){ dif++; } } return dif<=2; } void dfs(int node,vector<int>&vis,vector<vector<int>>&graph){ vis[node]=1; f...
ALGO
0.999986
6.084806
2f35568e-8587-43fa-be80-edfb1552b74d
satyamtiwari736182/CP
pepcoding/Level 2/DP/4_mx_gold_goldmine.cpp
#include "../header.h" class Pair { public: int i, j; string path; Pair(int ii, int jj, string ppath) { i = ii; j = jj; path = ppath; } }; int main() { int n, m; cin >> n >> m; int arr[100][100], dp[100][100]; fill(*dp, *dp + (n + 1) * (m + 1), 0); rma...
ALGO
0.999985
4.127678
1f4376a6-c8c9-496f-b3e2-645ef8028578
orkunsengur/Cpp
Inheritance/Exercises/Exercise11/Exercise11/Exercise11.cpp
// Exercise11.cpp : Bu dosya 'main' işlevi içeriyor. Program yürütme orada başlayıp biter. // #include <iostream> #include <sstream> using namespace std; #include <process.h> typedef struct pair { float x; float y; }mypair; /// <summary> /// //////////// /// </summary> class Stack { protected: //NOTE: can’t ...
ALGO
0.996238
5.022614
b20bda7c-aeb2-413b-be90-ec302f2fc8ef
arinatyurina/cpp
module_08/ex01/Span.cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Span.cpp :+: :+: :+: ...
ALGO
0.937985
5.113095
f1abeed0-6193-4e68-9fd0-160187a8f138
alphaninja27/Hackerrank-solutions
CPP/variablearray.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int x,y,s=0; cin>>x>>y; int *arr[x]; while(x--) { int num; cin>>num; ...
ALGO
0.999607
3.270848
0192af4a-0bc6-4ddc-a78c-b9bfbc98a33c
WuShaoa/Lua-game-ai
1336OS_Code/src/freeimage/src/freeimagetoolkit/BSplineRotate.cpp
/* ========================================================== This code was taken and adapted from the following reference : [1] Philippe Th関enaz, Spline interpolation, a C source code implementation. http://bigwww.epfl.ch/thevenaz/ It implements ideas described in the following papers : [2] Unser M., Splines: A...
ALGO
0.999849
5.629413
42deb8d4-a7aa-4789-9cdb-eb5ec5aac889
ishandutta2007/codeforces
wo_/normal/559/E.cpp
#include<cstdio> #include<utility> #include<algorithm> using namespace std; typedef pair<int,int> P; const int inf=1e9; P ps[110]; int N; int vals[330]; int ln; inline int getId(int x){ return lower_bound(vals,vals+ln,x)-vals; } int left[110][110][330]; int dp[110][330]; void precalc(){ sort(ps,ps+N); for(in...
ALGO
0.999945
3.47529
bc363ce5-bb1b-41d7-acb8-c15dc739a5d7
sahaniaditya/dsa_labs
lab6/final2.cpp
#include <iostream> #include <vector> #include<bits/stdc++.h> using namespace std; class HybridNode { public: string key; string element; //int color; string color = ""; unordered_map<string,int> mpp; //1 for color black //0 for color red HybridNode* parent; HybridNode* left_chi...
ALGO
0.999078
5.057201
0bef1430-e0ec-4d24-9f35-d1976a8921b6
doocs/leetcode
solution/3200-3299/3203.Find Minimum Diameter After Merging Two Trees/Solution.cpp
class Solution { public: int minimumDiameterAfterMerge(vector<vector<int>>& edges1, vector<vector<int>>& edges2) { int d1 = treeDiameter(edges1); int d2 = treeDiameter(edges2); return max({d1, d2, (d1 + 1) / 2 + (d2 + 1) / 2 + 1}); } int treeDiameter(vector<vector<int>>& edges) { ...
ALGO
0.999868
5.981095
04579bc7-b91e-488a-9801-94d1be604dbb
o-zhongchong/leetcode
Leetcode/468.cpp
class Solution { public: vector<string> split(string &IP, char delimiter) { vector<string> ret; int len = IP.size(); int pre = 0; for(int i=0; i<len; ++i) { if(IP[i] == delimiter) { string s = IP.substr(pre, i-pre); ...
ALGO
0.999198
6.368175
87ab9d13-d9f0-4ef6-b9d9-d75bcb1dd3d8
Brovetrue/TheDesignandAnalysisOfAlgorithmCode
src/teacherCode/动态规划和备忘录/最长公共子序列备忘.cpp
#include<stdio.h> #include<string.h> const int N = 1001; char X[N]; char Y[N] ;//ദ1000 int n,m;//¼X Yеij int memory[N+1][N+1];//ȫʼ-1 int dp(int i,int j){//dp(6,7) if(memory[i][j]!=-1) return memory[i][j]; if(i==0||j==0) return memory[i][j]=0; if(X[i-1]==Y[j-1]) return memory[i][j]=dp(i-1,j-1)+1; else { int...
ALGO
0.999931
3.215849
e7bcdc9a-f9a8-451a-aab6-68e2b2b2dee6
tintando/multiprocessing-NN
pthreads/NOtes/accomulators2.cpp
#include <pthread.h> #include <stdio.h> #include <unistd.h> #include <cstdlib> // Include the <cstdlib> header to define the malloc function #include<math.h> // To compile this file, run the following command: //g++ Accomulators_optimization.cpp ../src/mlp.cpp -o accomulators -lpthread /* - double **weights[layer][hi...
ALGO
0.997941
3.376642
aaefacda-c7c8-4176-868e-708c5d726443
ishandutta2007/codeforces
tokusakurai/normal/1696/F.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, x, n) for (int i = x; i <= n; i++) #define rep3(i, x, n) for (int i = x; i >= n; i--) #define each(e, v) for (auto &e : v) #define pb push_back #define eb emplace_back #define all(x) x.begin(), x.end() #define ra...
ALGO
0.999973
5.035535
d2690921-5271-47b9-b300-25500d2d205c
Lotuses-robot/Codes
Contest/Luogu/NOIp2023/20230824/B/B.cpp
template<typename T> void read(T &r) { r = 0; static char ch, last; ch = getchar(), last = 'z'; while (ch < '0' || ch > '9') last = ch, ch = getchar(); while (ch >= '0' && ch <= '9') r = (r << 1) + (r << 3) + (ch ^ 48), ch = getchar(); r = (last == '-') ? -r : r; } template<typename T, typename...Ts> void read(T &arg, ...
ALGO
0.99995
3.484952
c0e04e33-f5f3-435b-837f-94aa95d0c57a
raindirve/popup_labs
lab3/GCRT.cpp
#include "modmath.h" #include <bits/stdc++.h> using namespace std; typedef long long llong; /** * Returns x (mod nm) where x = a mod n = b mod m * Requires that n*m, a, and b are * less than half of LLONG_MAX, and of course * a < n, b < m */ llong crt_coprime(llong a, llong n, llong b, llong m){ // cerr << "C...
ALGO
0.999896
4.353941
b4028bb5-d68a-45d3-be34-a0531d497eb3
mjsaikot/Data_Structure
EXAM/Mid Term/RemoveDuplicatesSingly.cpp
#include <bits/stdc++.h> /*You need to take a singly linked list of integer value as input. You need to remove the duplicate values and print the unique values in ascending order.*/ using namespace std; class Node { public: int val; Node *next; Node(int val) { this->val = val; this->nex...
ALGO
0.999955
5.086842
6f09ac66-2ada-4fe7-b401-f0236b1e1847
nguyenphan2601/phanducnguyen2601
cau17.cpp
#include<iostream> #include<math.h> using namespace std; int main(){ double x,y; cout<<"nhap vao gia tri x: ";cin>>x; if(x>=5){ y=2*pow(x,2)+5*x+9; }else y=-2*pow(x,2)+4*x-9; cout<<"Gia tri bieu thuc la: "<<y; return 0; }
ALGO
0.999425
3.744531
6c1c60cb-0187-4b69-b459-9a273b42599a
TimidLion/baekjoon
11021_A+B-7.cpp
#include<stdio.h> int main() { int T; scanf("%d",&T); for(int i=1; i <= T ;i++) { int A,B; scanf("%d %d",&A,&B); printf("Case #%d: %d\n",i,A+B); } }
ALGO
0.994857
4.66517
04f053de-f5ef-4846-bf27-d5344f41e262
xmyqsh/leetcode2016
501_find-mode-in-binary-search-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: vector<int> findMode(TreeNode* root) { maxFreq = 0, curFreq = 0, curVal = (long)INT_MAX...
ALGO
0.999984
6.185774
6b4384f4-cd7a-4039-886f-3a95f89571aa
ishandutta2007/codeforces
chinese_zjc_/normal/1496/B.cpp
// This Code was made by Chinese_zjc_. #include <bits/stdc++.h> // #define debug int max, mex, T, n, k; std::set<int> app; signed main() { std::ios::sync_with_stdio(false); std::cin >> T; while (T--) { std::cin >> n >> k; max = mex = 0; app.clear(); for (int i = 0, x; i !...
ALGO
0.999764
4.511803
761ba6ff-d0d7-443d-90fe-9c717c71c0a6
niniwzw/macoin
src/key.cpp
#include <map> #include <openssl/ecdsa.h> #include <openssl/obj_mac.h> #include "key.h" // Generate a private key from just the secret parameter int EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key) { int ok = 0; BN_CTX *ctx = NULL; EC_POINT *pub_key = NULL; if (!eckey) return 0; const EC_...
TOOL
0.96313
6.649374
8ee0ef72-137a-46e5-b8c7-fc4720ff3ac8
mono-1729/AtCoder_cpp
ARC/192/b.cpp
#include <bits/stdc++.h> #include <unordered_map> #include <stdlib.h> #include <boost/multiprecision/cpp_int.hpp> #include <atcoder/all> using namespace atcoder; using namespace boost::multiprecision; using namespace std; #define rep(i, a, n) for(ll i = a; i < n; i++) #define rrep(i, a, n) for(ll i = a; i >= n; i--) #d...
ALGO
0.999984
5.05011
c05bf0bf-a1ca-428e-aba8-610c133ef1d8
haswelliris/CPC2018-GROMACS
src/gromacs/gmxlib/copyrite.cpp
#include "gmxpre.h" #include "gromacs/legacyheaders/copyrite.h" #include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <algorithm> #ifdef HAVE_LIBMKL #include <mkl.h> #endif #ifdef HAVE_EXTRAE #include <extrae_user_events.h> #endif #include <boost/version.hpp> /*...
TOOL
0.945168
4.309808
0b28a5b0-f07a-4dba-a2f6-4dbbec3d7861
abdalla3yash/splacher
example/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.998848
6.76073
eec2daf9-86b7-48ec-8dac-a462d4a5210c
hc-tt/cpp-homework
2024-12-13/mkpddhzfxdgx.cpp
/* #41. 马克判断点和正方形的关系 内存限制:256 MiB 时间限制:1000 ms 标准输入输出 题目类型:传统 评测方式:文本比较 上传者: FionaMeng 用户限制: Lv.0 题目描述 有一个正方形,四个角的坐标(x,y)分别是(1,-1),(1,1),(-1,-1),(-1,1),x是横轴,y是纵轴。写一个程序,判断一个给定的点是否在这个正方形内(包括正方形边界)。 输入格式 输入一行,包括两个整数x、y,以一个空格分开,表示坐标(x,y)。 输出格式 输出一行,如果点在正方形内,则输出yes,否则输出no 样例 input: 1 1 output: yes */ #include<bits/stdc+...
ALGO
0.999882
3.759531
b4ccb9b7-e498-4dff-8798-c45b627fb46e
AndreyStulov/VisualStudio_project
Bits/Source.cpp
#include <bitset> #include <iostream> //#define SHOW_DETALS using namespace std; unsigned char ReverseBits(unsigned char &number) { number = (number & 0x55) << 1 | (number & 0xAA) >> 1; #ifdef SHOW_DETALS bitset <8> binary2(number); cout << int(number) << " = " << binary2 << endl; #endif number = (number & 0x...
ALGO
0.99945
4.33932
ffdb6e18-bd96-49e5-a621-d196a3035ad0
sabrinasseba/hacker_rank
semana 1/1.5 for_loop/for_loop.cpp
#include <iostream> #include <cstdio> using namespace std; int main() { int inicio, fim; cin >> inicio >> fim; for (int i = inicio; i<=fim; i++){ if (1<=i && i<=9){ if (i==1){ cout << "one" << endl; } else if (i==2){ cout << "...
ALGO
0.999905
3.752953
120761e6-42c7-457d-a5d8-4c46b85b8ae9
kd1995-max/Data-Structure-and-algos
LinkedList/getNthFromLast.cpp
int getNthFromLast(Node *head, int n) { // Your code if(head == NULL || head->next == NULL) return -1; Node *fast = head; Node *slow = head; for(int jump = 1; jump <= n; jump++) { if(fast == NULL) return -1; ...
ALGO
0.99979
4.775635
c684904a-ac0e-4e71-b2e5-25fe0ccefdc1
vuthilananh1912/LTHT
TC/EXAMPLES/INTRO22.CPP
// INTRO22.CPP--Example from Chapter 3, "An Introduction to C++" #include <iostream.h> int main() { int number = 1, total = 0; while (number < 11) { total += number; number++; } cout << "\nTotal of numbers from 1 to 10 is " << total; return 0; }
TOOL
0.900872
3.900352
05aeeaba-9efe-4be7-b367-05c5ac54f6a9
Linsanity81/TileableShell
ext/libigl/include/igl/forward_kinematics.cpp
IGL_INLINE void igl::forward_kinematics( const Eigen::MatrixXd & C, const Eigen::MatrixXi & BE, const Eigen::VectorXi & P, const std::vector< Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & dQ, const std::vector<Eigen::Vector3d> & dT, std::vector< Eigen::Quaterniond,Eigen::aligne...
ALGO
0.999718
6.279635
1c56078a-938d-4ca5-a340-abb928a836fb
Sumit6307/Encryptix-cpp-internship
Task_3.cpp
#include <iostream> using namespace std; char board[3][3] = { {'1', '2', '3'}, {'4', '5', '6'}, {'7', '8', '9'} }; char currentMarker; int currentPlayer; void drawBoard() { cout << "\n"; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cout << board[i][j] << " "; } ...
ALGO
0.99846
7.109963
df49148b-38e7-4730-902f-6d555ba2bbe7
heapsheeps/opencv-ios-framework
opencv/samples/tapi/squares.cpp
#include "opencv2/core.hpp" #include "opencv2/core/ocl.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include <iostream> using namespace cv; using namespace std; int thresh = 50, N = 11; const char* wndname = "Square Detection ...
TOOL
0.99687
6.865051
640fb46a-3c99-4eb4-9353-95169faf0ebe
sign60intel/llvm-typescript
llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
#include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Twine.h" #include "llvm/Analysis/CFG.h" #include "llvm/Analysis/DomTreeUpdater.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/MemoryDep...
ALGO
0.990446
7.924527
222230c8-af27-475b-894c-f14d8e3d2912
hashcodez2004/DSA
0493-reverse-pairs/0493-reverse-pairs.cpp
//Much Cleaner and Good Practices class Solution { private: void merge(vector<int> &arr, int low, int mid, int high) { vector<int> temp; int left = low, right = mid + 1; // merge two sorted halves while (left <= mid && right <= high) { if (arr[left] <= arr[right]) { ...
ALGO
0.999931
5.730055
c96f5f56-8b2b-460b-bb25-05995dd678fe
iambaangkok/CPE102-Lab22
lab22_3.cpp
#include<iostream> #include<set> using namespace std; int count(int* data, int size){ set<int> num; for(int i = 0 ; i < size; ++i){ num.insert(data[i]); } return num.size(); } int main(){ int data[] = {1,2,4,5,4,8,2,1,2,4,6,1,4,4,4,2,1,0,12}; cout << "There are " << count(data,sizeof(data)/sizeof(int)); ...
ALGO
0.99692
3.862069
189138d0-60cd-4a65-be2c-5a1030d19359
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/CodeLlama/top0-100/minimum-cost-to-merge-stones-Solution.mergeStones/177875_Exec_Code_Overflow.cpp
s_aes_process(stream_state * ss, stream_cursor_read * pr, stream_cursor_write * pw, bool last) { stream_aes_state *const state = (stream_aes_state *) ss; const unsigned char *limit; const long in_size = pr->limit - pr->ptr; const long out_size = pw->limit - pw->ptr; unsigned char t...
ALGO
0.943205
6.879409
6ae828bf-55bc-45b6-9e3a-1c33076d21b1
VishvmPatel/DSA
Arrays/ArrayADT/BasicOperationInArray/InsertingInASortedArray.cpp
#include <iostream> using namespace std; // Function to insert x into a sorted array of size n void insertSorted(int arr[], int& n, int x, int capacity) { if (n >= capacity) { cout << "Array is full, cannot insert." << endl; return; } int i = n - 1; // Shift elements right until the c...
ALGO
0.999462
6.134218
ea7c65e4-ae68-4246-94b2-089b147815f1
wcysai/Calabash
2018牛客网暑期ACM多校训练营(第八场)/G.cpp
/************************************************************************* > File Name: G.cpp > Author: Roundgod > Mail: <EMAIL> > Created Time: 2018-08-11 12:10:50 ************************************************************************/ #pragma GCC optimize(3) #include<bits/stdc++.h> #define MAXN 1...
ALGO
0.999955
3.86429
5106b10e-c9f6-4974-8d3b-f0038b90f7fd
nxphuc/GoogleCodingCompetitions
2022/KickStart/Round C/New Password.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ii = pair<int, int>; using vi = vector<int>; #define fi first #define se second #define mp make_pair #define pb push_back #define ep emplace_back const int MAX = 1e6 + 10; const int MOD = 1e9 + 7; const int INF ...
ALGO
0.9989
5.218835
1e1f1fc6-6c24-49fd-9419-3579a1ce359a
yara30999/sprints_tourist_guide_app
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.998733
6.76775
6a44ddcd-d34a-4528-9e84-1001787f59d2
debugster/UVa
uva-11550.cpp
#include <bits/stdc++.h> using namespace std; /* typedef starts */ typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; /* typedef ends */ /* macro starts */ #define PI acos(-1.0) #define MAX_N 10 #define MAX_M 30 /* macro ends */ /* function starts */ /// calculates n-th (0-based)...
ALGO
0.999883
4.51966
76401450-2ee6-4b5c-a704-fd9a583731c9
harshit283/coding_blocks_launchpad
coding blocks lectures and programs/dijkstra's_algorithm.cpp
#include<bits/stdc++.h> using namespace std; class Graph { vector<list<pair<int,int> > > adjlist; public: Graph(int size) { adjlist.resize(size); } void add_edges(int src,int dest,int wt) { pair<int,int>my_pair1(dest,wt); pair<int,int>my_pair2(src,wt); adjli...
ALGO
0.999975
4.304058
f3d5c920-d004-44e4-bb05-4916ae4347bf
harsh70568/Daily_Problems_Solution
342-power-of-four/342-power-of-four.cpp
class Solution { public: bool isPowerOfFour(int n) { if(n == 0) return false; while(1) { if(n == 1) return true; if(n % 4 != 0) return false; n /= 4; } return true; } };
ALGO
0.999479
5.775391
6010462c-bad0-4dc1-8531-03eeb0b3d3b4
ACyming/OI
c++/图论/树的直径.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 20; /* 假设从任意的点是树根,找出离他最远的点 这个点一定是直径的某个端点a 假设a是数根,求离a最远的点b b就是直径的另一个端点了 */ int n, r, x, y, k, p; int pre[N]; int dep[N]; struct Node { int v, next; } a[N * 2]; void add(int u, int v) { a[++k] = {v, pre[u]}; pre[u] = k; } void dfs(int x, int...
ALGO
0.999092
3.863254
84c7c9b8-5336-4445-83a9-09ff97b505cd
Ultron011/DSA
GRAPHS/HARD/NUMBER OF ISLANDS-I/BFS APPROACH/noOfIslands.cpp
#include <bits/stdc++.h> using namespace std; /* Time complexity - O(N^2) Space complexity - O(N^2) */ class Solution { void bfs(vector<vector<char>> &grid, int i , int j, vector<vector<int>> &vis) { vis[i][j] = 1; queue<pair<int, int>> q; q.push({i, j}); ...
ALGO
0.999985
6.306329
d682a442-151e-4b59-8f66-94237d6c1fa6
yuguoshao/boost
libs/math/test/test_chi_squared_quan_nvrtc_double.cpp
#define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error #define BOOST_MATH_PROMOTE_DOUBLE_POLICY false // Must be included first #include <nvrtc.h> #include <cuda.h> #include <cuda_runtime.h> #include <iostream> #include <iomanip> #include <vector> #include <random> #include <exception> #include <boost/math/distributio...
TEST
0.95067
6.10217
6ded6545-b264-4cf4-9e5f-013821b4062d
piash76/LIGHT-OJ
lightoj 1447.cpp
///Bismillahir Rahmanir Rahim #include<bits/stdc++.h> #define ll long long #define pll pair<ll,ll> #define ff first #define ss second #define mp make_pair #define pb push_back #define cy cout<<"YES"<<endl #define cn cout<<"NO"<<endl using namespace std; const ll inf=1e18; const int mod=1e9+7; const...
ALGO
0.999786
4.21383
80d8777a-f86a-47a3-93d6-2da6c8275cc0
diamantisk/openjdk9-sctp
hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp
#include "precompiled.hpp" #include "oops/metadata.hpp" #include "runtime/os.hpp" #include "code/relocInfo.hpp" #include "interpreter/invocationCounter.hpp" #include "runtime/arguments.hpp" #include "runtime/commandLineFlagConstraintsCompiler.hpp" #include "runtime/commandLineFlagRangeList.hpp" #include "runtime/global...
TOOL
0.919851
4.821742
d3213b13-ccdd-4585-ad12-fe98e98bd255
3AceShowHand/algorithms-cpp
recursion/peasant-multiply.cpp
#include<iostream> using namespace std; int peasant_multiply(int x, int y) { if (x == 0) { return 0; } else { int _x = x / 2; int _y = y * 2; int prod = peasant_multiply(_x, _y); if (x % 2 == 1) { prod += y; } return prod; } } int main() ...
ALGO
0.999912
4.710729
35d76f16-9229-470b-a75d-14a223ba2762
tanaxiusi/Qt4.8.6-my-modified-version
src/3rdparty/md4/md4.cpp
/* * MD4 (RFC-1320) message digest. * Modified from MD5 code by Andrey Panin <<EMAIL>> * * Written by Solar Designer <<EMAIL>> in 2001, and placed in * the public domain. There's absolutely no warranty. * * This differs from Colin Plumb's older public domain implementation in * that no 32-bit integer data type...
ALGO
0.999339
6.953258
5a572250-c475-47d5-b1b7-a2d6e6be038c
kamyu104/LeetCode-Solutions
C++/select-k-disjoint-special-substrings.cpp
// Time: O(n + 26^3) // Space: O(26) // hash table, sort, greedy class Solution { public: bool maxSubstringLength(string s, int k) { const auto& erase_overlap_intervals = [](auto& intervals) { sort(begin(intervals), end(intervals), [](const auto& a, const auto& b) { return a[1] < b[1]; }); ...
ALGO
0.999859
6.414041
b0dc23cd-3834-4d24-8575-4b5563678d1f
ComputationalBiomechanicsLab/opensim-creator
third_party/libosim/simbody/Simbody/src/CompliantContactSubsystem.cpp
/**@file Private implementation of CompliantContactSubsystem and the built in contact patch analysis methods. **/ #include "SimTKcommon.h" #include "simbody/internal/common.h" #include "simbody/internal/ForceSubsystem.h" #include "simbody/internal/ForceSubsystemGuts.h" #include "simbody/internal/CompliantContactSubsy...
TOOL
0.948193
6.959721
d8370d38-8ad4-45ef-bdb1-dc1161b86b94
wendelcmoro/trabalho-1-inteligencia-artificial
flood_it.cpp
#include <bits/stdc++.h> #include <unistd.h> #include <omp.h> #define esp ' ' #define MAX_SIZE 200 #define MAX_COLOR 20 #define all(x) (x).begin(), (x).end() #define mset(x, y) memset(&x, (y), sizeof(x)) using namespace std; using ll = long long; using ii = pair<int, int>; using matrix = vector<vector<char>>; int n...
ALGO
0.999883
4.384576
e8fc114c-bccc-47e8-81dd-e73a5fed8cc5
GUDHI/gudhi-devel
src/Contraction/example/Garland_heckbert.cpp
#ifndef GARLAND_HECKBERT_H_ #define GARLAND_HECKBERT_H_ #include <gudhi/Point.h> #include <gudhi/Edge_contraction.h> #include <gudhi/Skeleton_blocker.h> #include <gudhi/Off_reader.h> #include <iostream> #include "Garland_heckbert/Error_quadric.h" struct Geometry_trait { typedef Point_d Point; }; /** * The verte...
ALGO
0.999609
5.575192
234c8871-cd01-48db-9f34-cbd7489d0f2a
mriveralee/3d-printer-configs
OWL-ender3v2/Marlin-2.0.x/Marlin/src/lcd/menu/menu_motion.cpp
// // Motion Menu // #include "../../inc/MarlinConfigPre.h" #if HAS_MARLINUI_MENU #define LARGE_AREA_TEST ((X_BED_SIZE) >= 1000 || (Y_BED_SIZE) >= 1000 || (Z_MAX_POS) >= 1000) #include "menu_item.h" #include "menu_addon.h" #include "../../module/motion.h" #include "../../gcode/parser.h" // for inch support #if EN...
TOOL
0.857966
6.645585
7cf6a238-0b06-4d32-97db-ddf12c5145c3
ishandutta2007/codeforces
killerx/normal/1132/F.cpp
#include <bits/stdc++.h> using namespace std; #define ld double #define ll long long #define pii pair <int, int> #define ull unsigned long long #define F first #define S second #define PB push_back #define MP make_pair #define rep(i, n) for (int i = 0; i < (int)(n); ++ i) #define PI acos(-1) #define MOD 1000000007 #d...
ALGO
0.999542
3.64932
9de2dfb6-e2fc-41c5-ab39-23d8a5fc19a6
raincross7/code-similarity
codes/train_code/problem211/problem211_214.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(ll i=0; i<n; i++) #define eb(t) emplace_back(t) typedef long long ll; typedef long long unsigned int llu; ll INF = 1000000009; ll MOD = 1000000007; void solve(){ ll k; cin >> k; ll a[100010]; rep(i,k){ cin >> a[i]; } ll...
ALGO
0.999986
3.61781
325a173a-8093-4ff4-a263-5e2550986b35
rubal2508/CodingBlocks_Hackerblocks_Algo
sorting and searching/BOOK ALLOCATION PROBLEM.cpp
#include <iostream> #include <algorithm> #include <cmath> #include <cstring> #include <vector> #define ll long long using namespace std; ll maxbookallocation(ll books[], ll n, ll m, ll totalpages){ ll s=books[n-1], e = totalpages, final_ans= s; while(s <= e) { ll mid = (s...
ALGO
0.999976
4.317397
2864e43a-1a4f-4fd3-a4f3-f19209952cdc
imranZMiko/Algorithm
DP contest/c.cpp
#include <bits/stdc++.h> using namespace std; long long int vi[505][505], dp[505][505],n; long long int f(long long int m, long long int amount) { if(amount==0) return 1; if(amount<0) return 0; if(m==0) return 0; if(vi[m][amount]) return dp[m][amount]; long long int ans=0,a,b; a=f(m-1,amount); b=f(m-1,amount...
ALGO
0.999985
4.088834
03f6adf2-abef-4d32-827c-867430de789d
dmilos/math
example/check/geometry/projective/check.cpp
#include <cstdlib> #include <iostream> #include <iomanip> #include "math/math.hpp" using namespace std; void camera_triangle1( ) { double w = 1; double a = ::math::geometry::deg2rad( 90 ); double f = 1; f = ::math::geometry::projective::camera::w2f( w, ::math::geometry::deg2rad( 120 ) ); f = ::math::ge...
ALGO
0.986136
4.891619
3c1d9058-6eb4-4c0c-b857-0a29751cdf0d
manikanta2901/ubuntu
.history/SRM/elab/DAA/GreedyAlgorithm/InSearchOfSamosa_20210319154517.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int size,money; cin >> size >> money; vector<int> cost; for(int i = 0; i < size; i++){ int a; cin >> a; money.push_back(a); } sort(c) return 0; }
ALGO
0.99987
3.291277
0d8ff11b-f37a-4164-a626-f6e24c13a270
igorjoz/cpp-course
!! loops/^ Sumowanie Przedziałów/Przedziały, sumowanie - uniwersalny zliczacz liczb parzystych/main.cpp
/* Przedzialy i sumowanie */ #include <iostream> using namespace std; int i, suma, liczba, a, b, c; int main() { cout<<"Podaj liczby. Tylko liczby parzyste z podanych zostana zsumowane.\nLiczby: "; cin>>a; cin>>b; { if (a%2==0 && b%2==0) suma=a+b; if (a%2!=0 && b%2!=0) suma=0; if (a%2==0 && ...
ALGO
0.999488
4.196554
267b3af1-01ce-4c4d-a9fd-ade1c38e811c
srivaayush/LeetHub-Practice
2432-the-employee-that-worked-on-the-longest-task/2432-the-employee-that-worked-on-the-longest-task.cpp
class Solution { public: int hardestWorker(int n, vector<vector<int>>& logs) { int diff=logs[0][1]-0; int id=logs[0][0]; for(int i=1;i<=logs.size()-1;i++){ int ans=logs[i][1]-logs[i-1][1]; if(ans==diff){ id=min(id,logs[i][0]); } ...
ALGO
0.99991
6.063187
ded5c8bd-8664-413f-a39b-a8077868bcb6
C-2023-1-3/8209230118-
8209230118马思凯/实验四/指针2.cpp
#include <iostream> #include <cstring> #include <cmath> using namespace std; int parseHex(const char* const hexString) { int len = strlen(hexString); int decimal = 0; for (int i = 0; i < len; i++) { char c = hexString[i]; int digit; if (c >= '0' && c <= '9') { digit = c ...
ALGO
0.929515
6.459013
e72599dc-8e66-43a1-b5f1-30a93143ca72
ritwikgoel/CodeChef-Beginner-Level-Codes
Coding Solutions/FCTRL2.cpp
//Dev Wadhwa #include<bits/stdc++.h> #include <boost/multiprecision/cpp_int.hpp> //Used to increase precision as 100 factorial has more than 150 digits, 'int' cannot store it using namespace boost::multiprecision; //Used to increase precision as 100 factorial has more than 150 digit...
ALGO
0.999773
5.239049
19defe12-a327-4197-a691-c6b90e08a025
HeZez/Algorithm-Question-Solution
leetcode/278第一个错误的版本.cpp
/* 你是产品经理,目前正在带领一个团队开发新的产品。不幸的是,你的产品的最新版本没有通过质量检测。由于每个版本都是基于之前的版本开发的,所以错误的版本之后的所有版本都是错的。 假设你有 n 个版本 [1, 2, ..., n],你想找出导致之后所有版本出错的第一个错误的版本。 你可以通过调用 bool isBadVersion(version) 接口来判断版本号 version 是否在单元测试中出错。实现一个函数来查找第一个错误的版本。你应该尽量减少对调用 API 的次数。 示例: 给定 n = 5,并且 version = 4 是第一个错误的版本。 调用 isBa...
ALGO
0.999836
6.432158
95761635-2699-4f82-aa80-25869cec4d28
SIC1740/LaptrinhC
binhphuongsonguyento.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long ; int squarePrime(ll n){ ll a = n ; for (int i = 2 ; i <= sqrt(n) ; i ++){ int count = 0 ; while (n % i == 0){ ++ count ; n /= i ; } if (count > 1) return 1 ; } return 0; } int main() { ll n , m ; cin >> n >> m ; for (int i = n ; i...
ALGO
0.999894
3.349465
7460c19a-07d2-4196-8a2b-ca4a6fa39a2b
MohamedMamdouh18/Problem-Solving
Code Forces Problems/Level A/The Monster/main.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define el "\n" #define se second #define fi first #define ll long long #define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); int main() { IOS int a, b, c, d; cin >> a >> b >> c >> d; int rick = b, morty = d; f...
ALGO
0.999891
3.485857
74f3ba98-ab92-4bed-86d2-30f7e0a93620
naxocist/naxocist-cp
TOI-zero/A2-003.cpp
#include <bits/stdc++.h> using namespace std; #define ln '\n' #define ll long long #define all(x) begin(x), end(x) #define pb emplace_back int32_t main() { cin.tie(nullptr)->sync_with_stdio(0); int n; cin >> n; vector<int> v(n + 2); for(int i=1; i<=n; ++i) cin >> v[i]; int res = 0; for(int i=1; i<=n; ++i...
ALGO
0.999874
4.160459
bd233d79-d806-4db4-b8ae-80bf785716fb
FergiFtA12/flutter_uts_mobile
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
9d626759-933b-4d73-8fe9-f0ae55fd274f
PratheekB/suv
llvm/libcxx/test/std/containers/sequences/vector.bool/find.pass.cpp
// <vector> // vector<bool> // std::find with vector<bool>::iterator // https://llvm.org/PR16816 #include <vector> #include <algorithm> #include <cassert> #include <cstddef> #include "test_macros.h" TEST_CONSTEXPR_CXX20 bool tests() { { for (unsigned i = 1; i < 256; ++i) { std::vect...
TEST
0.987525
5.720006
015e9e3c-f5b4-43aa-912c-fe54233fbf36
emanmustafa2050/Birthday-Card-UI
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
fcf41e0f-3821-4d0b-9c60-db77fc26e2dc
junseok16/Programmers
Programmers/Lv. 1/문자열 내림차순으로 배치하기.cpp
/* * @title : 문자열 내림차순으로 배치하기(Lv. 1) * @content : 연습문제 * @author : 탁준석 * @date : 230104 * @state : 완료 */ #include <string> #include <vector> #include <iostream> #include <algorithm> using namespace std; string solution(string s) { string answer = ""; sort(s.begin(), s.end(), greater<>()); ans...
ALGO
0.999288
5.973145
806f10e6-0cbe-4d80-83b0-1845d56e6f1b
raihanalam/StartWithC-Programming
Programming Ground/b1.cpp
#include <stdio.h> #include <string.h> int main() { char str[100],ch; int i,j,l; printf("Input the string : "); gets(str); l=strlen(str); for(i=1;i<l;i++) for(j=0;j<l-i;j++) if(str[j]>str[j+1]) { ch=str[j]; str[j] = str[j+1]; str[j+1]=ch; } printf("After sorting the string a...
ALGO
0.99998
3.387834
cbc80d03-b877-4c90-9a7a-f983f4457f9a
ibrahimhabibeg/codeforces
problems/1792/D/sol.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int calcScore(vector<int> a, vector<int> b){ int i = 0; while(i<a.size() && a[i]==b[i]) i++; return i; } int main(){ int TC, n, m; cin >> TC; while (TC--) { cin >> n >> m; vector<vector<int>> a(n,vector<int>(m)), b(n,vector<int>...
ALGO
0.999896
4.205047
e943e01f-e70c-4183-8cc7-796409b17779
sxyugao/Codes
Codeforces/CF1041C/CF1041C.cpp
#include <cctype> #include <cstdio> #include <algorithm> using namespace std; #define gc c = getchar() int read(){ int x = 0, f = 1; char gc; for(; !isdigit(c); gc) if(c == '-') f = -1; for(; isdigit(c); gc) x = x * 10 + c - '0'; return x * f; } #undef gc int n, m, d, Ans[200005]; pair<int, int>a[200005]; bool chec...
ALGO
0.999994
3.376981
bdf6dcd4-bed1-4a6f-8885-a53010eaf648
Hust-wayne/yolov5-onnxruntime-cpp
src/utils.cpp
#include "utils.h" size_t utils::vectorProduct(const std::vector<int64_t>& vector) { if (vector.empty()) return 0; size_t product = 1; for (const auto& element : vector) product *= element; return product; } std::wstring utils::charToWstring(const char* str) { typedef std::codecv...
TOOL
0.976581
6.138775
6c96ce48-007a-4e27-b141-b5760c003518
kindcoincore/kindcoin
src/crypto/hmac_sha512.cpp
#include <crypto/hmac_sha512.h> #include <string.h> CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen) { unsigned char rkey[128]; if (keylen <= 128) { memcpy(rkey, key, keylen); memset(rkey + keylen, 0, 128 - keylen); } else { CSHA512().Write(key, keylen).Finalize(...
ALGO
0.93776
5.726457
f652498e-2d7e-4abb-b165-3ea3c947b32c
kkirby54/Algorithms
SWEA/PRO/H2022 - 쪽지예약전송.cpp
#define MAXM 3 #include <set> #include <map> #include <cstring> #include <algorithm> using namespace std; typedef pair<bool, bool> P; struct Message { int mId; int uId1; int uId2; int timeStamp; int scheduleTimeStamp; }; // timeStamp이 높은 순으로 struct cmp { bool operator()(const Message& a, con...
ALGO
0.99629
4.511202
631054f2-920f-4190-a4d3-e058f5d147d9
arjunatapadkar/Data-Structures-Algorithms
week 1 Basics of programming 1/classWork/pattern3-holow-rectangle.cpp
#include<iostream> using namespace std; int main(){ int row_num, col_num; cout << "enter the rownum and column :" << endl; cin >> row_num >> col_num; for(int row=0; row<row_num; row++){ for(int col=0; col<col_num; col++){ if(row==0 || col==0 || row==row_num-1 || col== (col_nu...
ALGO
0.996911
3.377456
9b99b3b5-11a5-4fb3-b58f-b53ddc506cc9
YLlampi/Code-UNSA
ADA/LAB02/LAB02_Ejercicio01.cpp
#include <bits/stdc++.h> template <class T> void print_vector(const std::vector<T>& v){ for(const auto &i : v){ std::cout << i << ' '; } std::cout << '\n'; } template <class T> void merge(std::vector<T>& v, int left_index, int mid_index, int right_index){ int i, j, k; int left_size = mid_index - left_index + 1...
ALGO
0.999849
5.160621
a5808131-b5d3-48dd-b7f6-bd074fe5c277
anjali26sharma/Dynamic-Programming
Diameter of Binary tree.cpp
https://leetcode.com/problems/diameter-of-binary-tree/submissions/ class Solution { public: int solve(TreeNode* root, int &res) { if(root == NULL) return 0; int l = solve(root->left,res); int r = solve(root->right,res); int temp = max(l,r) +1; i...
ALGO
0.99992
6.248674
394524b7-9d9a-475b-9f89-45ab188e1d63
Abhideep22/DSA
codes/power.cpp
#include<iostream> using namespace std; int power(int a, int b) { int ans=1; for(int i=1; i<=b;i++) { ans*=a; } return ans; } int main() { int a, b; cout<<"Enter the value of a & b:"<<endl; cin>>a>>b; int answer=power(a,b); cout<<"Answer is:"<<answer; return 0; }
ALGO
0.999901
5.095869
64608194-0aee-4437-b224-b6a41baba1af
OctoCat-r/DSA
PrimeFactor.cpp
#include<iostream> #include<algorithm> #include<vector> using namespace std; int main() { int n = 42; if(n <= 1) return 0; for(int i = 2; i*i <=n; i++){ while(n % i == 0){ cout<<i<<endl; n = n/i; } } if(n > 1){ cout<<n; } return 0; }
ALGO
0.999988
4.058021
d43f81e4-bd5a-4d18-8434-6ba993b8bd31
Shahreyar11/DSA-Streak
day25.cpp
// Rest of the days not found for DSA // ...CHECK IF ARRAY IS SORTED #include <iostream> #include <vector> using namespace std; // Function to check if the array is sorted in non-decreasing order bool check(vector<int>& nums) { int n = nums.size(); for (int i = 1; i < n; i++) { if (nums[i] < nums[i -...
ALGO
0.999948
5.906625
c873e1bf-34d0-49b0-aa8e-c13db4990a07
mtarcinalli/estrutura-dados
01_revisao/aula01/ex25.cpp
#include <iostream> using namespace std; int main() { int num; cout << "Digite um número: "; cin >> num; switch(num) { case 1: cout << "\nVocê digitou um!"; break; case 2: cout << "\nVocê digitou dois!"; break; case 3: ...
ALGO
0.985966
4.244744
837952a9-8772-461d-ab14-746b07a546e4
CoffeeandMath/CylindricalShells
Cylindrical3DStability/eigen-3.3.9/doc/snippets/MatrixBase_all.cpp
Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones()); Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs(); // let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax: cout << "Is (" << p0.transpose() << ") inside the box: " << ((boxMin.array()<p0.array(...
ALGO
0.972136
3.51303
0570879b-6196-49c9-9409-2718ffe5b456
chiwenzhen/crf-word-segmenter
CRF++-0.58/encoder.cpp
#if defined(_WIN32) && !defined(__CYGWIN__) #define NOMINMAX #include <windows.h> #endif #include <algorithm> #include <fstream> #include "param.h" #include "encoder.h" #include "timer.h" #include "tagger.h" #include "lbfgs.h" #include "common.h" #include "feature_index.h" #include "scoped_ptr.h" #include "thread.h" ...
DATA
0.995092
6.531411
b90d8e2c-f58f-4b87-b48c-be73e0e93ff5
Rgtemze/MemoryEfficientTetMeshGen
Hybrid/include/igl/AABB.cpp
template <typename DerivedV, int DIM> template <typename DerivedEle, typename Derivedbb_mins, typename Derivedbb_maxs, typename Derivedelements> IGL_INLINE void igl::AABB<DerivedV,DIM>::init( const Eigen::MatrixBase<DerivedV> & V, const Eigen::MatrixBase<DerivedEle> & Ele, const Eigen::MatrixBase<Derivedbb_...
ALGO
0.998516
5.13483
0799644a-8948-458d-9f12-aad6afbc509a
mitali-kumari/TargetAAA
Algorithms/BoundaryPrint_Tree.cpp
// // Created by mitali on 28/09/19. // #include<iostream> using namespace std; struct node { int data; struct node *left, *right; node(int data){ this->data = data; left = right = NULL; } }; void Boundary_traversal_left(node *root) { if(root == NULL) return; if(root->left !=N...
ALGO
0.999716
4.761698
9a4b1454-12b6-49ab-9596-372f70bf3336
rprakashdass/Leetcode-Problems
DSA/Medium/47. Permutations II/recursiveWithFrequency.cpp
class Solution { private: void getPermutations(vector<int>& nums, vector<vector<int>>& result, vector<int>& ar, vector<bool>& visited){ if(ar.size() == nums.size()){ result.push_back(ar); return; } for(int i = 0;i < nums.size();i++){ if(visited[i]) continu...
ALGO
0.99999
6.164346
835638d4-db13-4716-a0f9-58301b58beda
dnbaker/dashing
src/union.cpp
#include "dashing.h" namespace bns { using sketch::hll_t; void show(const std::vector<std::string> &p) { for(const auto &x: p) std::fprintf(stderr, "%s ", x.data()); std::fputc('\n', stderr); } template<typename T> void par_reduce(T *x, size_t n) { const unsigned int ln = static_cast<int>(std::ceil(std::l...
ALGO
0.942305
5.390628
c4b87472-0a26-4a85-88cc-1e506ebdbff7
101magikarp101/USACO
magikarp-fools/blub-blub-sol.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 998244353 #define MOD2 1000000007 #define vt vector struct pii {int x, y;}; struct pll {ll x, y;}; int T, N; int a[200005]; void bubble() { for (int i = 1; i < N; i++) { if (a[i] > a[i+1]) { swap(a[i], a[i+1]); ...
ALGO
0.999973
4.533452
37e6ad53-569c-4e6a-8bf8-007a832276cd
deepakvit007/LeetCode
14-longest-common-prefix/longest-common-prefix.cpp
class Solution { public: string longestCommonPrefix(vector<string>& strs) { int n = strs.size(); sort(strs.begin(),strs.end()); string first = strs[0]; string last = strs[n-1]; int minLen = min(first.size(),last.size()); string longestPrefix = ""; for(int i=0;i<minLen;i++) ...
ALGO
0.999906
5.794493
2f4ec5b0-b9df-4427-a515-af8e9d2a9271
negishi-neko/EasyCpp
Other/PracticeProblem_7/Practice_4.cpp
#include <iostream> #include <cmath> using namespace std; template <class Template> Template square(Template x); void Newline(); int main(){ int in, out; double d_in, d_out; Newline(); //Integral number set. cout << "Please input integral number that you want to do square : "; cin >> in ;...
TOOL
0.944791
4.153639
4973a3a8-3939-45cd-90a5-66f669ba35e0
OhYee/sourcecode
Temp/problem/B.cpp
#include <cmath> #include <cstdio> using namespace std; const double eps = 1e-10; int sign(double x) { if (fabs(x) < eps) return 0; else return x < 0 ? -1 : 1; } struct Point { double x, y; Point(double _x = 0, double _y = 0) : x(_x), y(_y) {} Point operator+(const Point rhs) cons...
ALGO
0.999811
4.350397
08fa82d7-c4df-4aec-946c-eaccdc609077
TunasFC/Junior-Training-sheet-programs
Vanya and fence.cpp
// // Created by ivani on 3/27/2023. // #include <bits/stdc++.h> using namespace std; int main(){ int n=0,h=0,ai=0,ttl=0; cin>>n; cin>>h; cout<<"\n"; for(int i=0;i<n;i++){ cin>>ai; if(ai<=h){ ttl++; }else{ ttl+=2; } } cout<<"\n"; ...
ALGO
0.99992
3.781353
d94c17bc-15bd-4d6b-aef2-98d5acb74bfc
devraj2210/Operating-Systems
Efficient-Matrix-Squaring/Using-Mutual-Exclusion/Assgn3_Src-ES22BTECH11011_CAS.cpp
#include <iostream> #include <iomanip> #include <fstream> #include <string> #include <chrono> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> #include <pthread.h> #include <atomic> using namespace std; std::atomic_int lock(0); //atomic variable lock int n, k, rowInc, c = 0; //co...
ALGO
0.999404
3.778451
29e00f0b-85e6-48a8-9b88-73dc3ad5dd27
kohyatoh/contests
pku/1159/1159.cpp
#include <stdio.h> #include <algorithm> using namespace std; #define rep(i, n) for(int i=0; i<(int)(n); i++) int n; char f[6000]; int dp[3][6000]; int main() { scanf("%d%s", &n, f); rep(i, n-1) dp[1][i] = f[i]!=f[i+1]; for(int k=2; k<n; k++) { const int kx = k%3, k1 = (k+2)%3, k2 = (k+1)%3; ...
ALGO
0.999965
3.414118
535c5f22-1d36-439c-b3cf-415c6ad2d86f
juliolugo96/competitive-programming
codeforces/math/candies_and_two_sisters.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; cout << (n & 1 ? n / 2 : n / 2 - 1) << "\n"; } return 0; }
ALGO
0.999681
5.016225