uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
6ef57ad9-8a8e-474b-a064-692586658e5f
Stouse49/GoldCoinUnlimited
src/pow.cpp
#include "pow.h" #include "arith_uint256.h" #include "chain.h" #include "primitives/block.h" #include "uint256.h" #include "util.h" extern bool hardForkedNovember; extern bool hardForkedJuly; bool comp64(const int64_t& num1, const int64_t& num2) { return num1 > num2; } unsigned int static GetNextWorkRequired_Go...
ALGO
0.999285
6.467613
3a0f4fe1-e9a6-49ad-9ead-36e0f79d5eeb
Daejjyu/Algorithm
Baekjoon/6593.cpp
#include <iostream> #include <queue> #include <cstring> #include <utility> using namespace std; int const MAX = 31; int map[MAX][MAX][MAX]; int visited[MAX][MAX][MAX]; int XY[6][3] = { {0,1,0},{-1,0,0},{1,0,0}, {0, -1,0}, {0,0,1},{0,0,-1} }; int l, r, c, minute; int startX, startY, startZ; int endX, endY, endZ; voi...
ALGO
0.999948
3.440871
e1ee43cb-ec6f-4a64-862d-29c6d620b9e9
MarioEmilov/CPlusPlus_Sofituni
C++ Fundamentals/_5_Arrays - Exercise/1. Compare Arrays.cpp
#include <iostream> using namespace std; bool areEqual(int arr1[], int size1, int arr2[], int size2) { if (size1 != size2) { return false; } else { for (int i = 0; i < size1; ++i) { if (arr1[i] != arr2[i]) { return false; }...
ALGO
0.999897
4.243038
fa08252c-ed8a-46ee-a999-fdf05bb731c4
WJ-self/algorithm
.history/acwing/basic/数学知识/约数/870_约数个数_20230903183059.cpp
#include<bits/stdc++.h> using namespace std; unordered_map<int,int> mp; const int md = 7+1e9; typedef long long LL; int n,x; void divide(int x){ if(x < 2) return ; for (int i=2; i<=x/i; i++) { if(x % i == 0) } } int main() { cin >> n; for(int i=0; i<n; i++) { cin >> x; div...
ALGO
0.99995
4.071922
aafdebfc-66e6-4a36-a93a-1c97134b8de5
yzzupgo/MFTCG
Data/abc206_a/rt_roxxxxx/wa/23642394.cpp
#include<bits/stdc++.h> #define ll long long #define ull unsigned long long #define pb push_back #define re(i,a,b) for(int i=a;i<b;i++) #define mp make_pair #define vi vector<int> #define vll vector<ll> #define ss second #define ff first #define ll long long #define pii pair< int,int > #define pll pair< ll,ll > #define...
ALGO
0.996003
4.041093
d3800be2-8051-4091-8c72-4931741bc77e
cubercsl/The-road-to-ACMer
Misc/2019_Multi_University/Nowcoder/Day04/I.cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 1 << 19; struct Suffix_Array { char s[maxn]; int sa[maxn], t[maxn], t2[maxn], c[maxn], rank[maxn], height[maxn]; void build_sa(int m, int n) { n++; int *x = t, *y = t2; for (int i = 0; i < m; i++) c[i] = 0; f...
ALGO
0.999945
4.285019
203c9df4-e68e-4beb-af61-1af6f3429100
redwan-faris/leet-code
problems/1678. Goal Parser Interpretation/main.cpp
#include <bits/stdc++.h> using namespace std; string interpret(string command) { string result; for (int i = 0; i < command.size() - 1; i++) { if (command[i] == '(') { if (command[i + 1] == ')') { result.push_back('o'); i++; ...
ALGO
0.985423
4.647892
cc143409-9b84-49c8-b527-04b46410634e
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/Year2021/May/Golf_20210508113821.cpp
#include<bits/stdc++.h> #include<iostream> using namespace std; int main(){ int t; cin >> t; while(t--){ int n,x,k; cin >> n >> x >> k; if(x % k == 0){ cout } } return 0; }
ALGO
0.999719
3.422786
7187561e-7ce9-4462-8f19-24f5c6dedda1
arkaslittlemind/Placement-Preparation
Codechef/Starters 119 Division 3/K Odd Sums.cpp
#include <iostream> #include <algorithm> #include <numeric> #include <set> #include <queue> #include <climits> #include <deque> #include <map> #include <cmath> #include <vector> #include <cstring> #include <iomanip> #include <ctype.h> #include <bitset> #include <stack> #include <sstream> #include <ext/pb_ds/assoc_conta...
ALGO
0.99996
3.889422
0e647e22-0126-45c2-941e-55a21d1f8277
staroy/depends
boost_1_68_0/libs/range/test/algorithm_test/search_n.cpp
#include <boost/test/test_tools.hpp> #include <boost/test/unit_test.hpp> #include <boost/assign.hpp> #include <algorithm> #include <list> #include <set> #include <vector> namespace { template<typename ForwardIterator, typename Integer, typename Value> inline ForwardIterator reference_search_n(ForwardItera...
TEST
0.942473
7.531681
bd76af4d-0d37-4102-8f9e-5746f5b1ccc2
angelrocha000/Evidencias
64.2.cpp
//Juan Pablo Soriano González 24041242 //matriz diagonal normal e invertida #include <iostream> //#include<stdio.h> #include<time.h>//random #include<windows.h> using namespace std; int main( ) { SetConsoleCP(CP_UTF8); SetConsoleOutputCP(CP_UTF8); int m1[10][10], m2[10][10], m3[10][10];//declara 3 matrices i...
ALGO
0.921801
3.22542
f862415e-7af0-4931-94d3-440506da4fb4
ISOLDE-Project/riscv-llvm
mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
#include "TypeDetail.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/LLVMIR/LLVMTypes.h" #include "mlir/IR/BuiltinTypes.h" #include "mlir/IR/DialectImplementation.h" #include "mlir/IR/TypeSupport.h" #include "llvm/ADT/ScopeExit.h" #include "llvm/ADT/TypeSwitch.h" #include "llvm/Support/TypeSize...
TOOL
0.864064
3.382591
89469f36-17d4-4607-9446-d0e2fcaf3456
2809708153/WorkCG
joseph.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; class Joseph { private: int n, m, k; public: Joseph(int x, int y, int z) { n = x; m = y; k = z; } void simulate() { int lst[1000] = { 0 }, i, j = 0, t = 0; //ԪȫΪ㣬j¼Ƿһmѭt¼Ƿʣһ for (i = k - 1; t < n - 1; i++) { if (i == n) //ĩβʱͷֿʼ i =...
ALGO
0.999988
3.438917
0a27d93b-5164-4b61-80a8-a6031eb733b9
JayTheCoder77/Striver-Dsa
BinarySearch/2DArrays/PeakElement2d/brute/main.cpp
#include <bits/stdc++.h> vector<int> findPeakGrid(vector<vector<int>> &g){ // Write your code here. // multiple peak elements return any one int n = g.size(); int m = g[0].size(); int up = 0 , down = 0 , left = 0 , right = 0; for(int i = 0 ; i < n ; i++){ for(int j = 0 ; j < m ; j++)...
ALGO
0.999976
5.011336
5ffbc1e9-1288-4b68-9b18-034fee717a7e
anshmendpara-13/Competitive_Programming
Searching/LC_286__peak_index_in_a_mountain_array.cpp
#include <bits/stdc++.h> using namespace std; int binary_search_max(vector<int> &arr) { int s = 0; int e = arr.size() - 1; while (s < e) { int mid = s + ((e - s) / 2); if (arr[mid] < arr[mid + 1]) { s = mid + 1; } else { e = mid; ...
ALGO
0.99997
4.785286
14ad02d9-4d0d-4d57-8a2d-b99beb7d4f6e
MatSciTools/HFCalc
eigen-3.4.0/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.977174
3.495238
fef0a0af-eec5-4e8f-83e7-860686d4a6da
Bensoli-Inc/CPP-full-course
Pointers/DanglingPointers/main.cpp
#include <iostream> int main(){ //Case1 : Uninitialized pointer int * p_number; // Dangling uninitialized pointer std::cout << std::endl; std::cout << "Case 1 : Uninitialized pointer : ." << std::endl; std::cout << "p_number : " << p_number << std::endl; std::cout << "*p_number : " << *p_number << s...
TOOL
0.979801
4.015077
7401049a-b32c-4e54-bbe8-c314e9955537
tgool/Team2
Week2/paulolh168/week2_3040_paulolh168.cpp
#include <iostream> int main() { int arr[9], sum = 0; for (int i = 0;i < 9;i++)std::cin >> arr[i]; for (int i = 0;i < 9;i++)sum += arr[i]; for (int i = 0;i < 9;i++) { for (int j = i + 1;j < 9;j++) { if (sum - arr[i] - arr[j] == 100) { arr[i] = 0; arr[j] = 0; break; } } if (arr[i] == 0) { ...
ALGO
0.999731
3.253213
d2464b5d-65d6-4076-9b91-bc7e5e1d3501
OpenDigitalTwin-Dev/FENGSim
toolkit/Geometry/cgal/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp
#include "config.h" #include "Scene_points_with_normal_item.h" #include <CGAL/Three/Polyhedron_demo_plugin_helper.h> #include <CGAL/Three/Polyhedron_demo_plugin_interface.h> #include <CGAL/pca_estimate_normals.h> #include <CGAL/jet_estimate_normals.h> #include <CGAL/vcm_estimate_normals.h> #include <CGAL/mst_orient_no...
TOOL
0.957467
6.743927
b31b0b3b-cef8-44e5-b338-8a4a2c20d0c2
jmaralo/codeforces
1937/b/b.cpp
#include <bits/stdc++.h> using namespace std; typedef signed char schar; typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; typedef unsigned long long ull; typedef long long ll; enum rows { TOP, DOWN, }; #define TESTCASES true void solve(ul...
ALGO
0.999941
3.534764
f6aa95dc-d6e9-4b7d-bfed-75c0c6b4cb59
ishandutta2007/codeforces
orzfootballking/normal/633/D.cpp
#pragma GCC optimize("Ofast,unroll-loops") #include<bits/stdc++.h> #define ll long long #define F first #define S second #define P pair #define FOR(i,a,b) for(int i=a;i<=b;i++) #define rep(i,a,b) for(int i=a;i<b;i++) #define V vector #define RE return #define ALL(a) a.begin(),a.end() #define MP make_pair #define PB pus...
ALGO
0.999941
3.816839
bc4ad334-515a-4ca2-944f-c0214e015e71
twinkleughade/cpp_control-flow-statement
while_do/while_do_odd.cpp
# include <iostream> using namespace std; int main(){ int d =1; do { if (d % 2 != 0) cout << d << "\t"; d++; } while(d<=10); }
ALGO
0.988221
3.558091
d6d72d63-45ae-4314-9db1-eee35d2cb220
Awadesh365/Trees-Problems
Easy/Introduction to Trees/introduction-to-trees.cpp
//{ Driver Code Starts // Initial Template for C++ //{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // } Driver Code Ends // User function Template for C++ class Solution { public: int countNodes(int i) { return pow(2,i-1); } }; //{ Driver Code Starts. int...
ALGO
0.999634
6.005784
b48ed838-d768-4476-9ea3-199c074e523f
Yormus-Coin/Core
src/crypto/aes.cpp
#include <crypto/aes.h> #include <string.h> extern "C" { #include <crypto/ctaes/ctaes.c> } AES256Encrypt::AES256Encrypt(const unsigned char key[32]) { AES256_init(&ctx, key); } AES256Encrypt::~AES256Encrypt() { memset(&ctx, 0, sizeof(ctx)); } void AES256Encrypt::Encrypt(unsigned char ciphertext[16], const ...
TOOL
0.880316
7.549944
f9324798-8601-4baa-83de-1e8a02ebc9cf
busilapetrica/curs_programare
00bazele_programarii_c/pasul2/Calculul a doua numere cu maxim doua cifre/Calculul a doua numere cu maxim doua cifre.cpp
#include <iostream> using namespace std; /*#451 Se citeste de la tastatura un numar natural de maxim 2 cifre. Să se afiseze pe ecran valori astfel: daca numarul este mai mic sau egal cu 15 se va afisa pătratul valorii sale; dacă numărul este cuprins între 16 și 30 (inclusiv) se va afișa suma cifrelor sale; în caz co...
ALGO
0.992572
3.958584
e8203a13-46cd-4a23-99b0-f40af3f0a1a5
JunhaumHayden/C-
C++/ufsc/03vplQueue02/mainTest.cpp
#include <iostream> #include <stdexcept> #include <string> #include <cstdint> // std::size_t #include <stdexcept> // C++ Exceptions using namespace std; namespace structures { template<typename T> //! classe ArrayQueue class ArrayQueue { public: //! construtor padrao ArrayQueue(); //! construtor com p...
ALGO
0.994891
6.053257
4534993b-c06c-419a-8ea9-8bbb73b49d69
ravi2320/GFG-POTD
238_Multiply two linked lists.cpp
/* Multiply two linked lists Difficulty: EasyAccuracy: 46.33%Submissions: 71K+Points: 2 Given elements as nodes of the two singly linked lists. The task is to multiply these two linked lists, say L1 and L2. Note: The output could be large take modulo 109+7. Examples : Input: LinkedList L1 : 3->2 , LinkedList L2 : 2 ...
ALGO
0.999946
6.931632
c45ce528-8d81-4dc9-9a0d-b7dc8c6646b3
tamirgrBGU/EngineForAnimationCourse
igl/jet.cpp
template <typename T> IGL_INLINE void igl::jet(const T x, T * rgb) { igl::colormap(igl::COLOR_MAP_TYPE_JET, x, rgb); } template <typename T> IGL_INLINE void igl::jet(const T x_in, T & r, T & g, T & b) { // Only important if the number of colors is small. In which case the rest is // still wrong anyway // x = l...
ALGO
0.91395
6.010772
664bfb78-a72c-48f5-ab19-be2d26d2bb00
MasterIceZ/CP-COM
POSN_63/CAMP1/055-081_ProgrammingTechnique_2-3/71_OverSort.cpp
#include<bits/stdc++.h> using namespace std; const int mxN = 1e5+1; int a[mxN]; char c[mxN]; double d[mxN]; struct String { char a[105]; bool operator < (const String& o) const { if(strcmp(a, o.a)<0) return true; return false; } } s[mxN]; int main() { int opr,n; scanf("%d %d", &opr, &n); if(opr==1) { for(in...
ALGO
0.999143
3.340819
c259dba7-5936-446b-bada-f084dc853a4d
lunaisnotaboy/vbox
src/VBox/Runtime/common/math/frexp.cpp
/* $Id$ */ /** @file * IPRT - No-CRT - frexp(). */ /********************************************************************************************************************************* * Header Files * ****...
ALGO
0.988817
5.029159
9271dade-42df-45da-beb1-c5e77d58bb72
subratkumar10/6Companies30Days
amazon/tree_burning.cpp
class Solution { public: Node* find_target(Node* root,int target) { if(!root) return NULL; if(root->data==target) return root; Node* left=find_target(root->left,target); if(left) return left; Node* right=find_target(root->right,target); if(right) ...
ALGO
0.999973
6.305972
cfa06bc8-04c4-41f6-91e0-c7eef2a20e7f
ruurdadema/dnssd
examples/dnssd-advertiser.cpp
#include <dnssd/Advertiser.h> #include <iostream> #include <string> #include <vector> bool parseTxtRecord (dnssd::TxtRecord& txtRecord, const std::string& stringValue) { if (stringValue.empty()) return false; size_t pos = stringValue.find ('='); if (pos != std::string::npos) txtRecord[st...
TOOL
0.910784
6.151804
9378d258-f16c-4390-9cb6-970c5e1e66f7
hasnat0006/CP_SOLUTION
LightOJ/Graph/Best Picnic Ever.cpp
//!-----------------------------------------------------!// //! YUSUF REZA HASNAT !// //!-----------------------------------------------------!// #include <bits/stdc++.h> // #include "debug.h" using namespace std; #define pb push_back #define vf(v) (v).begin(), (v).end() #define vr(v...
ALGO
0.999969
4.546428
17d167c8-3a66-459b-9796-651b84c78fe8
turzo06/vscode
A_Repeating_Cipher.cpp
/******************CODE*********************/ // Library #include <bits/stdc++.h> using namespace std; // Type Definition typedef vector<string> vstr; typedef vector<long long> vll; // STL Operation #define pb push_back #define ll long long #define acs(v, x) accumulate(v.begin(), v.end(), x); #define acm(v,x) accumu...
ALGO
0.99998
4.533676
127b4540-d2f0-4ed7-9586-d9241dfeb517
bhyeanhasan/Competitive-Programming-Solutions
Code Forces Problem Solutions/A. Patrick and Shopping.cpp
#include<bits/stdc++.h> using namespace std; int main() { int a,b,c,x,y,z,l; cin>>a>>b>>c; x=a+b+c; y=(a+c)*2; z=(b+c)*2; l=(a+b)*2; int ans=min(x,min(y,min(z,l))); cout<<ans<<endl; }
ALGO
0.999761
3.695169
59fe5061-6da9-4d40-b5b8-1db1623dc302
SahilKundu19/DSA-Programs
CodingNinjas_Problems_Solutions/Sorting Techniques/InsertionSort.cpp
/* Problem statement You are given an integer array 'arr' of size 'N'. You must sort this array using 'Insertion Sort' recursively. Note: Change in the input array itself. You don't need to return or print the elements. Example: Input: ‘N’ = 7 'arr' = [2, 13, 4, 1, 3, 6, 28] Output: [1 2 3 4 6 13 28] Explanation: Af...
ALGO
0.999993
5.689662
7b886ecc-db89-445a-9c81-4561a819d55f
sderrien/spechls-circt
lib/Transforms/Simplifier/MergeGammas.cpp
#include "Dialect/SpecHLS/SpecHLSDialect.h" #include "Dialect/SpecHLS/SpecHLSOps.h" #include "Dialect/SpecHLS/SpecHLSUtils.h" #include "Transforms/Passes.h" #include "circt/Dialect/Comb/CombOps.h" #include "circt/Dialect/HW/HWOpInterfaces.h" #include "circt/Dialect/HW/HWOps.h" #include "mlir/Dialect/Arith/IR/Arith.h" #...
ALGO
0.870529
6.459079
9e7d2091-5652-4099-b134-941db4c57cc4
alexandraback/datacollection
solutions_1483485_0/C++/maddoctor/main.cpp
/* ID: CUGB-wwj PROG: LANG: C++ */ #include <iostream> #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iomanip> #include <cst...
ALGO
0.999607
3.553039
369c0111-09a7-438a-b941-ec63b025ce8b
praveepannu/X01BD
gps/utils/loc_misc_utils.cpp
#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_misc_utils" #include <stdio.h> #include <string.h> #include <log_util.h> #include <loc_misc_utils.h> #include <ctype.h> int loc_util_split_string(char *raw_string, char **split_strings_ptr, int max_num_substrings, char delimiter) { int raw_stri...
TOOL
0.954149
5.32358
0b949ae3-72a3-4e1a-a6cf-237bf48c2f56
zabhishekz/LeetCode_DSA
1769. Minimum Number of Operations to Move All Balls to Each Box.cpp
class Solution { public: vector<int> minOperations(string boxes) { vector<int> v; vector<int> res; for(int i= 0; i < boxes.length(); i++){ if(boxes[i] == '1'){ v.push_back(i); } } int cnt; for(int i = 0; i < boxes.length(); i++)...
ALGO
0.999961
5.666718
f3b97f16-eb82-41b8-9ee5-e02fe2d5d732
ishandutta2007/codeforces
antoine/normal/1133/C.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int Mx = (int) 4e5; int a[Mx + 9]; int main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); int n; cin >> n; for (int i = 0; i < n; ++i) cin >> a[i]; sort(a, a + n); int ans = 0; for (int i = 0, j = 0; i < n; ++i) { while (j...
ALGO
0.999825
3.757297
a098cdf0-6896-425b-922e-f8a56dc11c70
phumipatc/C_Competitive_Programming
C++ - 2560/1.50_Camp/Number.cpp
/* TASK: AUTHOR: Phumipat Chaiprasertsud SCHOOL:RYW LANG: C++ */ #include<bits/stdc++.h> using namespace std; int a[500002],n,m,r=1,start=0; int findd(int num){ if(r) return (num+start-1)%n; else return (n+start-num+1)%n; } int main(){ int i,j,k,x,y,temp; char c; scanf("%d %d",&n,&m); for(i=0...
ALGO
0.999859
3.50255
cc4b7dc6-39af-4804-bf72-a008ee5b8389
behnejad/quera
university-66860.cpp
#include <iostream> #include <cmath> using namespace std; typedef unsigned long long ull; ull cnt[70]; void calc(ull w, ull h) { if (w > h) { swap(w, h); } if (w == 0) { return; } int p = log2(w); ull x = pow(2, p); for (ull i = p, y = h; i >= 0 && y != 0; --i...
ALGO
0.999815
4.423081
c77d45f8-f22c-4ca0-b465-18b2cedefc7f
yangyy1234/hello-world
dll1/MathClient/MathClient/MathClient.cpp
// MathClient.cpp : Client app for MathLibrary DLL. // #include "pch.h" Uncomment for Visual Studio 2017 and earlier #include <iostream> #include "MathLibrary.h" int main() { // Initialize a Fibonacci relation sequence. fibonacci_init(1, 1); // Write out the sequence values until overflow. do { std::cout << fibo...
ALGO
0.884968
6.238745
b67f9259-55e2-4cfa-8cc4-08f7faa96e71
safrastyan/PuzzlingClarity
resources/cp/LeetCode/27. Remove Element.cpp
class Solution { public: int removeElement(vector<int>& nums, int val) { std::vector<int> res; for (auto elem: nums) { if (elem == val) { continue; } res.push_back(elem); } nums = res; return nums.size(); } };
ALGO
0.999844
6.290796
20bdc67f-f495-47dc-8d2b-48c4a3cffd66
Achira16/My_codes
try8.cpp
#include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define endl '\n' long solve(vector<int>& arr){ int n = arr.size(); vector<int> prefix(n); prefix[0] = arr[0]; for(int i=1;i<n;i++){ prefix[i] = arr[i]^prefix[i-1]; } int e = 0,o = 0...
ALGO
0.999949
4.630411
d67c3cb5-f1a6-4504-b817-603b9bc17ac7
AreebaShahid111/PFTasksWEEK4
pftask8w4.cpp
#include<iostream> using namespace std; float calculatePayableAmount(string day,float amount){ if(day == "Sunday"){ return amount - (amount*0.1); } else { return amount; } } main(){ float amount; string day; cout<<"Enter the day of purchase: "; cin>>day; cout<<"Enter the total purchase amount: $"; cin>>amount; cou...
TOOL
0.989823
3.945748
d28b2ad1-f57a-47fd-9a80-09eb825942e8
palter09/2025_NAVER
2차원 배열/2566번 최댓값.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<vector<int>> v(9, vector<int>(9, 0)); int max = -1; int x=0, y=0; for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { cin >> v[i][j]; if (max < v[i][j]) { max = v[i][j]; x = i; y = j; ...
ALGO
0.99937
4.276962
69ec82cb-e8eb-42b5-af45-a6d850f92341
jwseph/competitive-programming
cses/2207.cpp
#include <bits/stdc++.h> using namespace std; const int N = 2e4+5; int n = 2e3, nt; int gr[N], mex[N]; int main() { for (int h = 2; h <= n; ++h) { for (int i = 1; i < (h+1)/2; ++i) { mex[gr[i]^gr[h-i]] = h; } for (int i = 0; i < N; ++i) { if (mex[i] == h) continue; ...
ALGO
0.999949
4.955239
689fb855-4c56-44e7-a81d-c05600f712d3
stwuhan/leetcode
solution/0800-0899/0879.Profitable Schemes/Solution.cpp
class Solution { public: int profitableSchemes(int n, int minProfit, vector<int>& group, vector<int>& profit) { int m = group.size(); int f[m + 1][n + 1][minProfit + 1]; memset(f, 0, sizeof(f)); for (int j = 0; j <= n; ++j) { f[0][j][0] = 1; } const int mo...
ALGO
0.999992
5.503184
556b3768-6ac5-4b62-9e23-98c2cdc48a4d
mdmishu199088/week_2_topicwice
A_topic_wice.cpp
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string s;cin>>s; vector<char>v; int n=s.size(),ans=0; for(int i=0;i<n;i++){ if(s[i]=='/') ans++; } if(ans==n) cout<<"/"<<endl; else { for(int i=0;i<n;i++){ if(s[i]!='...
ALGO
0.999468
3.146098
dbc90f1b-ac50-4686-ab61-2f1473d5c47c
guben/offer
55_2_balancedBinaryTree.cpp
// // Created by 67598 on 2021/9/13. // #include <cstdio> #include "Utilities\BinaryTree.h" int TreeDepth(const BinaryTreeNode* pRoot) { if(pRoot == nullptr) return 0; int nLeft = TreeDepth(pRoot->m_pLeft); int nRight = TreeDepth(pRoot->m_pRight); return (nLeft > nRight) ? (nLeft + 1) : (nRight + 1); } bool IsBalan...
ALGO
0.997741
6.072187
b7282eae-0c77-40bf-8c49-fc2e61c01483
dbywsc/xcpcCode
数据结构/Trie.cpp
//必须建立静态对象并且每次init(),不然会炸 struct Trie { static const int M = 1e6 + 10, size = 128; int idx = 0; int son[M][size] = {0}; int pre[M] = {0}, cnt[M] = {0}; void init() { for(int i = 0; i < size; i++) son[0][i] = 0; memset(pre, 0, (idx + 1) * 4); memset(cnt, 0, (idx + 1) * 4); ...
ALGO
0.998625
4.35496
8e8f0a23-8964-4026-8e9d-6eb7011cb812
Gibyeng/GLP
tools/convert_graph500.cpp
// -*- coding: utf-8 -*- #include <iostream> #include <vector> #include <fstream> #include <sstream> #include <string> #include <map> #include <set> #include <algorithm> void convert_graph500(std::string filename){ long progress = 0; std::ifstream ifs(filename, std::ios::binary | std::ios::ate); ifs.seekg...
DATA
0.90587
4.170763
94e406e6-cad0-46aa-8371-c88b98b51f4c
BernatRosello/SofTrees
src/b2_utils.cpp
#include "b2_utils.h" #include "box2d/box2d.h" #include <vector> #include <algorithm> struct CastResult { b2Vec2 point; b2Vec2 normal; b2BodyId bodyId; float fraction; bool hit; }; static float CastCallback( b2ShapeId shapeId, b2Vec2 point, b2Vec2 normal, float fraction, void* context ) { CastResult* result = ...
ALGO
0.988537
7.195831
58c254bc-af83-44cf-a2c7-28f6dbe362b0
raincross7/code-similarity
codes/train_code/problem303/problem303_345.cpp
#include <bits/stdc++.h> using namespace std; int main() { string s, t; int c = 0; cin >> s >> t; int x = s.length(); for (size_t i = 0; i < x; i++) { if(s[i] != t[i]) { c++; } } cout << c; return 0; }
ALGO
0.999906
4.089849
d2856f1b-2f57-481f-b376-112d84e58275
donggoolosori/programmers-solve
Level3/풍선터트리기/3-other-stack.cpp
#include <stack> #include <string> #include <vector> using namespace std; int solution(vector<int> a) { int answer = a.size(); stack<int> stk; for (const auto &el : a) { while (!stk.empty() && el < stk.top()) { stk.pop(); if (!stk.empty()) answer--; } stk.push(el); } return answer; }
ALGO
0.99988
5.500647
7149c7bf-0e80-429d-8a73-e7f708ec89a3
minigalaxy/Baekjoon
cpp/33161/main.cpp
#include <iostream> using namespace std; int A; int main() { cin >> A; cout << A / 5; return 0; }
ALGO
0.995961
3.310989
6f419024-6570-4d1a-bdee-bd3d3dd79b04
neamul-haq/graph-algorithms
checkNodeConnectingBFS.cpp
//TC:O(V+E) //SC:O(V) #include<bits/stdc++.h> using namespace std; const int N=1e5; int visited[N]; vector<int>adj_list[N]; bool bfs(int src) { queue<int>q; visited[src]=1; q.push(src); while(!q.empty()) { int head = q.front(); q.pop(); if(head==6) return true; ...
ALGO
0.999907
4.542655
0dc6f0f0-c903-4aa2-a40c-939920b617fb
lclpsoz/competitive-programming
ARCHIVE/2018-04-28-1205/1522-wa-only-greedy.cpp
#include <bits/stdc++.h> using namespace std; int n; int main () { int a, b, c; queue<int> pi[3]; while (scanf ("%d", &n), n) { int ans = 1; while (n--) { scanf ("%d %d %d", &a, &b, &c); if (a%3) pi[0].push (a%3); if (b%3) pi[1].push (b%3); if (c%3) pi[2].push (c%3); } bool test = t...
ALGO
0.999697
3.47866
7ecc245a-3543-4c4d-bda9-04fbe41f4a6d
juliogdomingues/estruturas_de_dados_ufmg
tp03/src/main.cpp
#include <iostream> #include "../include/matriz.hpp" #include "../include/segtree.hpp" int main() { int instantesTempo, nOperacoes; if (!(std::cin >> instantesTempo >> nOperacoes) || instantesTempo <= 0 || nOperacoes < 0) { std::cerr << "Erro: Entrada inválida para instantes de tempo ou número de oper...
ALGO
0.975716
6.082183
d6ab206e-073b-495f-a732-4be21139f59f
korostik/Task
leetcode/147.InsertionSortList.cpp
// https://leetcode.com/problems/insertion-sort-list/?envType=problem-list-v2&envId=linked-list class Solution { public: int len; ListNode* insertionSortList(ListNode* &node) { len = len_f(node); if (len <= 1){ return node; } for (int i = 0; i < 2 * len; i++) { ...
ALGO
0.999987
6.03717
8b199d40-44d0-4afc-af3e-a6242f52db0e
tanmayysain/Cpp
Sliding Window/contest.cpp
// #include<bits/stdc++.h> // using namespace std; // int main(){ // int n; // cin>>n; // vector<string>words(n); // for(int i=0;i<n;i++){ // cin>>words[i]; // } // int k=0; // vector<int> res; // vector<int>nums; // int x=nums.size(); // for(auto i: words){ // i...
ALGO
0.99996
5.715091
c85075a2-4f65-46c5-ae1e-a54e0dc009f2
abtahi2024/Algorithms_practice_2023
final contest 2/123_Ka_4.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; if(n==1) { cout<<1<<endl; return 0; } for(int i=1;i<=n;i++) { cout<<i; } cout<<endl; for(int i=2;i<=n-1;i++) { cout<<i; for(int j=1;j<=n-2;j++) { ...
ALGO
0.999946
3.237973
2fc1f34a-c54c-4886-8779-e3f94b5ebd37
gifsyn/AtCoder
ABC/ABC161/abc161d.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ll K; cin >> K; queue<ll> Q; for(int i=1; i<=9; i++){ Q.push(i); } for(int i=0; i<K-1; i++){ ll s = Q.front(); // i番目のLunlun Number Q.pop(); for(int j=-1; j<=1; j++){ ll...
ALGO
0.999783
4.015813
f70e0dc7-c2e6-4386-b35d-564ff6111b97
JoaquinPolonuer/algo3
taller2/oil_deposits.cpp
#include <iostream> #include <map> #include <string> #include <vector> using namespace std; int n, m; char a; vector<vector<int>> visitados; vector<pair<int, int>> posiciones; int main() { while (true) { cin >> n >> m; posiciones = vector<pair<int,int>>(); visitados = vector<vector<in...
ALGO
0.999265
4.577941
080d6935-63d2-4b52-b092-173dca0eef38
Dexter-99/Coding-Library
Trie/Search.cpp
bool search(TrieNode *root, string key) { TrieNode *curr = root; for (int i = 0; i < key.length(); i++) { int idx = key[i] - 'a'; if (curr->child[idx] == NULL) return false; curr = curr->child[idx]; } return curr->isEnd; }
ALGO
0.999959
5.303581
5393521d-2453-4acb-b222-7c7bd4bb9781
alexandraback/datacollection
solutions_5658571765186560_0/C++/cegprakash/gcj4.cpp
#include <iostream> #include <cmath> #include <cstdlib> #include <map> #include <algorithm> #include <sstream> #include <set> #include <cstring> #include <vector> using namespace std; int main(){ ios::sync_with_stdio(false); freopen("gcj4.txt","r",stdin); freopen("output.txt","w",stdout); int t,c=1,x,R,C; string ...
ALGO
0.999793
3.060816
b791a62c-2bef-401d-a9b0-2aa8f4f599d9
sarvex/leetcode-g-forth
solution/0900-0999/0978.Longest Turbulent Subarray/Solution.cpp
class Solution { public: int maxTurbulenceSize(vector<int>& arr) { int ans = 1, f = 1, g = 1; for (int i = 1; i < arr.size(); ++i) { int ff = arr[i - 1] < arr[i] ? g + 1 : 1; int gg = arr[i - 1] > arr[i] ? f + 1 : 1; f = ff; g = gg; ans = m...
ALGO
0.999945
5.973201
59860ce6-2e9c-45f4-9198-4a203cdcb023
alejandrocof/DeltaWEB
eigen-eigen-323c052e1731/bench/benchmark.cpp
// g++ -O3 -DNDEBUG -DMATSIZE=<x> benchmark.cpp -o benchmark && time ./benchmark #include <iostream> #include <Eigen/Core> #ifndef MATSIZE #define MATSIZE 3 #endif using namespace std; using namespace Eigen; #ifndef REPEAT #define REPEAT 40000000 #endif #ifndef SCALAR #define SCALAR double #endif int main(int ar...
ALGO
0.991688
3.675187
4f1e77b5-e709-4486-830d-18e23592526f
Shiveshdixit07/LeetCode_Problem_Solutions
LeetcodePotdSolutions/983. Minimum Cost For Tickets.cpp
class Solution { public: int dp[366][4]; int solve(vector<int> &d, vector<int> &c, int dur, int idx) { if (idx >= d.size()) return 0; if (dp[idx][dur + 1] != -1) { return dp[idx][dur + 1]; } int op1, op2, op3; op1 = solve(d, c, 0, idx +...
ALGO
0.999308
4.658297
197e0bb4-9d47-483e-af21-9ffc19d6115a
victorswan/SensorsCalibration
SensorX2car/radar2car/eigen3/doc/examples/Tutorial_PartialLU_solve.cpp
#include <Eigen/Core> #include <Eigen/LU> #include <iostream> using namespace std; using namespace Eigen; int main() { Matrix3f A; Vector3f b; A << 1,2,3, 4,5,6, 7,8,10; b << 3, 3, 4; cout << "Here is the matrix A:" << endl << A << endl; cout << "Here is the vector b:" << endl << b << endl; Vec...
ALGO
0.999906
3.142099
025d0ce9-db80-4cdd-ab08-bc491473f542
brown0394/algorithm_practice
chessBoard.cpp
#include <iostream> class ChessPainter { private: char board[50][51]; char wFirst[9]; char bFirst[9]; int x, y, height, width; int calcPlaceToPaint(char* line); public: ChessPainter(int h, int w): wFirst{"WBWBWBWB"}, bFirst{"BWBWBWBW"}, height(h), width(w) { for (int i = 0; i < ...
ALGO
0.999124
4.433842
4db4a068-4a5d-4596-ba40-d10c76c0b8d9
ishabhray/Competitive-Programming
atcoder/abc293b.cpp
#include <bits/stdc++.h> using namespace std; #define PI 3.141592653589 #define ll long long int #define ld long double #define vi vector<int> #define vl vector<ll> #define ii pair<int,int> #define pb push_back #define mp make_pair #define ff first #define ss second #define pll pair<ll,ll> #define vv vector #define al...
ALGO
0.999876
3.798143
599d75d5-a8b4-4142-a2e8-19e2da79c9f1
morris821028/UVa
volume103/10397 - Connect the Campus[Delaunay].cpp
#include <stdio.h> #include <math.h> #include <algorithm> #include <set> #include <map> #include <queue> #include <vector> #include <string> #include <iostream> #include <assert.h> #include <string.h> #include <list> using namespace std; #define eps 1e-8 #define MAXN (1048576) #define MAXV 1024 struct Point { dou...
ALGO
0.999856
3.857518
c5a026e4-0977-48ba-9bc2-ffb7b7f5dd66
JiaWenHa/CoScan_ws
src/CGAL-4.9.1/src/CGAL/Turkowski_numeric_solver.cpp
#ifndef CGAL_HEADER_ONLY #include <CGAL/Polynomial/internal/numeric_solvers.h> #include <CGAL/Polynomial/internal/Turkowski_numeric_solvers_impl.h> #endif
TOOL
0.939149
4.318243
4a2bc7e5-8aec-462f-bfd6-401802539cc6
El-sakka/GPA-Calculator
GPA Calculator.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; typedef vector<int> V; typedef map<int, int> M; typedef map<string, string> mss; typedef map<char, int> MC; typedef set<int> S; typedef long long ll; #define mp make_pair #define pb push_back #define all(c) c.begin(),c.end() #define For(i,n) for(...
TOOL
0.885662
3.639199
4e9e6b7c-f008-40ff-9f53-0d2c5685e339
sudarshanvm/problem-solving
juniorsheet/contests/CF923/923-b.cpp
#include<iostream> #include<unordered_map> #include<vector> using namespace std; char solve(int count, unordered_map<char,int> &m) { for(auto ele:m) { if(ele.second==count) return ele.first; } return 'a'; } string reconstructString(vector<int>& trace, unordered_map<char,int> &m) { string result; char...
ALGO
0.999957
4.294106
3c238793-c6b9-4472-aa99-feca826f6982
strivedi4u/hacktoberfest2024
Implementing_Kadane's_Algorithm.cpp
// C++ Program to find the maximum subarray sum using nested loops #include <bits/stdc++.h> using namespace std; // Function to find the sum of subarray with maximum sum int maxSubarraySum(vector<int> &arr) { int res = arr[0]; // Outer loop for starting point of subarray for(int i = 0; i < arr.size(...
ALGO
0.999942
5.363865
0464b1d2-1630-4745-857a-775518792287
abdelqayyim/C-Tic-Tac-Toe
build-mac/Boost/libs/numeric/odeint/examples/openmp/lorenz_ensemble_simple.cpp
#include <omp.h> #include <vector> #include <iostream> #include <boost/numeric/odeint.hpp> #include <boost/numeric/odeint/external/openmp/openmp.hpp> #include "point_type.hpp" using namespace std; typedef vector<double> vector_type; typedef point<double, 3> point_type; typedef vector<point_type> state_type; const do...
ALGO
0.999951
5.410702
da976990-3c93-40d4-a82d-859279fca43c
NguyenNhuDi/Kattis-solutions
TODO/simple_factoring.cpp
//simple factoring #include<iostream> #include<algorithm> #include<vector> #include<set> #include<unordered_set> #include<cmath> #include<climits> #include<queue> #include<map> #define FOR(i,a,b) for(int i = a; i < b; i++) #define FORD(i,a,b) for(int i = b; i >= a; i--) #define FORE(i,a,b) for(int i = a; i <=b; i++) ...
ALGO
0.999919
4.112413
273e9fc3-0da5-4fe6-aaab-c4f4bd8634dc
Burlesque1/tic-tac-toe
tic_tac_toe.cpp
#include "tic_tac_toe.h" tic_tac_toe::tic_tac_toe(){ // curr_player = X; last_move = make_pair(-1, -1); step_count = 1; board = vector<vector<entry>>(BOARD_ROW, vector<entry>(BOARD_COLUMN, E)); // step_count = 13; // board = {{X, X, O, O}, {X, X, O, O}, {E, X, X, E}, {O, E, O, E}}; } in...
ALGO
0.994281
4.093908
de11c5c3-f79d-41f0-8a6a-00f77bb816fe
M-A-D-A-R-A/CP
CodeForces/Div2/#769/A/a.cpp
#include <bits/stdc++.h> using namespace std; #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define pii <pair<int,int> #define vi vector <int> #define vp vector <pair<int,int>> #define vpp vector <pair<pair<int,int>,int>> #define si set<int> #define ll long long #define ld long double #defi...
ALGO
0.999785
4.427099
8de567e6-96c4-4ccf-9914-068e5f6de060
righthand0521/LeetCode
src/1026.cpp
#include <algorithm> #include <iostream> #include <vector> using namespace std; #include "tree.h" /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x),...
ALGO
0.999427
6.22124
3f1ba0dc-5542-43b0-bb77-4f26ea9a98d4
PPER/cs530_final
tree_binary.cpp
#include<iostream> #include<fstream> #include<string> #include <math.h> #include <map> #include <algorithm> #include <vector> #include<set> #include <stdlib.h> #include<queue> #include <math.h> #include <algorithm> // std::min using namespace std; class Tree { public: Tree(int datain, vector<Tree*> chi...
ALGO
0.98987
3.894123
f68b93d0-8fa6-4dff-9272-53db8d0f9051
UnknownGi/Codechef-Solution-Closed-
Easy/Problem #30 - Chef-jumping/sol.cpp
#include<stdio.h> #define llu unsigned long long int using namespace std; int main ( ) { freopen("input.txt", "r", stdin); llu n; scanf("%llu", &n); int m = n%6; m==0 || m==1 || m==3? printf("yes\n") : printf("no\n"); }
ALGO
0.999907
3.211927
127f58fc-8137-4434-bbde-9f168bc5b1d6
PradipKun/OOP
Bibek/cpp examples/operatoroverloading2.cpp
//loading preincrement operator by using friend function #include<iostream> using namespace std; class rectangle { int length,breadth; public: rectangle(int l,int b){ length = l; breadth = b; } friend void operator ++(rectangle &); void display(){ cout<<"Length = "<<length<<endl<...
ALGO
0.860476
3.809957
f92b9c24-6907-483d-b979-e5fdc0c95ef7
gioitrongxuan/algorithm
BACP.cpp
#include<bits/stdc++.h> #define N 17 #define M 6 using namespace std; int n,m; int load[M]; int loadMin = INT_MAX; int c[N], x[N]; int a[N][N]; bool Check(int v, int k) { for(int i=1; i<k; i++) { if(a[i][k]) { if(x[i]>=v) return false; }else if(a[k][i]) { if(v>=x[i]) return false; } } return t...
ALGO
0.999971
3.704324
083865a5-bf94-4250-adcd-a383882c239c
navneetk2001/CPP_Programs
Topic Wise Coding Questions/19. Segment Trees/2. Lazy Propagation in Segment Tree _ Point and Range Updates.cpp
#include <bits/stdc++.h> using namespace std; int a[100005], tree[100005 * 4]; //globally declare array and segment tree void build(int ind, int low, int high) { if(low == high){ // Leaf node will have a single element :- Base Case tree[ind] = a[low]; return; } int mi...
ALGO
0.99997
5.692658
4e20a62b-10ca-4126-afbc-c0aad6e7c932
Epliskey/DATA_-structure
DATA_ structure/单链表的插入和删除.cpp
#include <iostream> using namespace std; //int &e: ôһͱڷرɾڵֵ //LinkList & L: ôͷָ룬޸ //ͷָλ typedef struct LNode { //LNode㣬嵥ڵ int data; //ÿڵһԪ struct LNode* next; //ָָһڵ }LNode, * LinkList; //LNodeΪڵLinkListΪṹָ //ڵ i λòԪe (ͷ) bool ListInsert(LinkList& L, int i, int e) { if (i < 1) re...
ALGO
0.999175
3.377371
45119456-809d-402b-b9ca-0b4c07c47b73
tahsinsoha/Problem-solving-
Codeforces/two round dances.cpp
#include<bits/stdc++.h> #define ll long long using namespace std; long long arr[1000007]; long long cs[1000007]; long long ps[1000007]; int main() { long long n; cin>>n; long long r = n/2; long long facn=1, facr=1,facrn=1,facro=1; for(int i=1; i<=n; i++) { facn*=i; } for(in...
ALGO
0.999965
4.03689
8c222b11-2006-4315-b271-ba169a8d8df3
ZHymLumine/ICT_EXPERIENTS
ICT_2/Assignment1/21B12111_shannon.cpp
//張 一鳴、21B12111、ICT.E218 //プログラミング言語:C++ //コンパイル方法:g++ 21B12111_shannon.cpp -o 21B12111_shannon //実行方法:ターミナル上で.\21B12111_shannon を実行 #include <iostream> #include <cstring> #include <cmath> #include <algorithm> #include <vector> using namespace std; const int CODE_SIZE = 128; const int MAX_NODES = 256; const int BUFFER...
ALGO
0.999389
3.712242
316af7dc-f872-445d-92ba-9179d6e452cf
dernDren161/DataStructuresAndAlgorithms
LeetcodeContest/Tiles.cpp
// Problem Link: https://leetcode.com/problems/maximum-white-tiles-covered-by-a-carpet/ class Solution { public: int maximumWhiteTiles(vector<vector<int>>& tiles, int len) { int n = tiles.size(); int i; int j; i= 0; j = 0; int ans = 0; int cover = 0; int partial; ...
ALGO
0.999065
6.204876
21899263-311c-416d-b14c-f52303d322f4
harish3110/SDCND-Capstone_Project-Path_Planning
src/Eigen-3.3/unsupported/test/NumericalDiff.cpp
#include <stdio.h> #include "main.h" #include <unsupported/Eigen/NumericalDiff> // Generic functor template<typename _Scalar, int NX=Dynamic, int NY=Dynamic> struct Functor { typedef _Scalar Scalar; enum { InputsAtCompileTime = NX, ValuesAtCompileTime = NY }; typedef Matrix<Scalar,InputsAtCompileT...
TEST
0.979605
6.21049
93cee445-d110-4714-bf7a-8f921832d2bf
KARNAMSAISANJANA/CSA0638-DAA-192110680
PRO 39 INSERT NUMBER.cpp
#include <stdio.h> #define MAX_SIZE 100 void insertNumber(int list[], int *size, int position, int number) { if (*size >= MAX_SIZE) { printf("List is full. Cannot insert.\n"); return; } if (position < 0 || position > *size) { printf("Invalid position.\n"); return; } ...
ALGO
0.999511
5.40588
c3a1bbeb-5e1f-49bd-91a4-35b3dc6b5683
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/October/PositiveAnd_20201003203347.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #define vv vector #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define printM...
ALGO
0.999414
3.378868
2e831e2b-44f1-4e64-8178-17f81b38b68a
raincross7/code-similarity
codes/train_code/problem314/problem314_464.cpp
#include <bits/stdc++.h> #define rep(i, start, end) for (long long i = start; i < end; ++i) #define repreverse(i, start, end) for (long long i = start; i >= end; --i) #define all(x) (x).begin(), (x).end() #define len(x) ((long long)(x).size()) #define lcm(a, b) ((a) / __gcd((a), (b)) * (b)) using namespace std; using l...
ALGO
0.999936
3.879137
494343e0-31e8-49ee-9ae9-7b1c0a8e344a
lyz05/Sources
OI/jzoj/19330.cpp
#include<iostream> #include<cstring> #include<cstdio> #define T 10001 #define inf 0x7fffffff #define FOR for(int i=1;i<=n;i++)for(int j=1;j<=m;j++) using namespace std; int n,m,cnt=1,tot,ans,head[10001],h[10002]; int a[101][101],b[101][101],c[101][101]; int xx[4]={0,0,1,-1},yy[4]={1,-1,0,0}; int color[101][101]; struct...
ALGO
0.999865
3.570595
b4e271ed-a6e4-4ea9-b135-361ce038aa33
shivamm-jha/leet-code
2435-paths-in-matrix-whose-sum-is-divisible-by-k/2435-paths-in-matrix-whose-sum-is-divisible-by-k.cpp
class Solution { public: // int mod = 1e9+7; // int solve(vector<vector<int>>&nums,int i, int j, int k,int sum,vector<vector<vector<int>>> &dp){ // if(i>=nums.size() || j>=nums[0].size())return 0; // if(dp[i][j][sum]!=-1)return dp[i][j][sum]; // if(i==nums.size()-1...
ALGO
0.999973
5.872636
b7eb1c92-e0a9-45ee-b229-310e6eb6e25a
islamrahat/codes
900-1000/A_Mocha_and_Math.cpp
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> #include<bits/stdc++.h> using namespace std; int gcd(int a, int b) {while (b != 0) {int temp = b;b = a % b;a = temp;}return a;} #define inparr(n, arr) for(int i=0; i<n; i++){scanf("%d", &arr[i]);} #define outparr(n, arr) for(int i=0; i<n; i++){pri...
ALGO
0.999847
4.251382