uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
695cc913-690d-4e29-9915-487de687e05c
rdwebdev24/DSA
memory_allocation/tut5.cpp
/***** MACROS AND GLOBAL VARIABLES *****/ #include<iostream> using namespace std; #define PI 3.14 // jaha jaha PI hoga compile time pr waha 3.14 aa jayeg a // no extra space nothing required int main(){ int r; cin>>r; cout<<PI*r*r<<endl; // GLOBAL variable banana bahut ga...
ALGO
0.987056
3.314181
e1646fae-7d98-4328-8300-ffb267bf8760
raincross7/code-similarity
codes/train_code/problem360/problem360_492.cpp
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++) #define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend...
ALGO
0.999768
4.16455
832f9a99-1ca7-452a-948b-d5ba757191ed
amirphl/learning
data-structures/geeks-for-geeks/hashing/first-element-occurring-k-times-array.cpp
// https://www.geeksforgeeks.org/first-element-occurring-k-times-array/ //{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: // time: O(n), memory: O(n) int firstElement(int arr[], int n, int k) { unordered_map<int, int> m; int...
ALGO
0.999984
5.261752
3702f3cf-a5dd-4bb9-9f95-4ecd8c273dea
GlaucoMasi/CompetitiveProgramming
Olinfo/ois_police3.cpp
#include <bits/stdc++.h> using namespace std; ifstream fin("input.txt"); ofstream fout("output.txt"); int n; vector<int> v; vector<int> memo; int dp(int i){ if(i >= n) return 0; if(memo[i] != -1) return memo[i]; int salto = (i <= n-2) ? v[i+1] + dp(i+2) : 0; int aspetto = v[i] + dp(i+1); return memo[i] = ...
ALGO
0.999837
3.936108
417271db-63be-48ef-a5e5-162c5e1c614f
Rishabh6395/DSA-in-JS-and-Cpp
Code Help/BinarySearch/AggressiveCows.cpp
// Aggressive Cows Problem #include <iostream> #include <vector> #include <algorithm> using namespace std; // Function to check if it is possible to place 'k' cows with at least 'mid' distance apart bool isPossible(vector<int> &stalls, int k, int mid) { int cowCount = 1; // Place the first cow in the first...
ALGO
0.999999
6.145723
81cc5837-8752-4b30-afc7-c2b93cb8e9ab
Rishi-T2408/Leetcode-Questions
Triangle and Square - GFG/triangle-and-square.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: int countSquare(int B) { // code here int x=B/2; return (x*x-x)/2; } }; // { Driver Code Starts. int main() { int t; cin>>t; while(t--) { int B,count...
ALGO
0.999188
5.494252
f2cab49b-4be1-4e84-8895-f744b2a899e9
RoseAlice2018/Algorithm2024
HOT100/矩阵/240.搜索二维矩阵II.cpp
#include<vector> #include<stack> #include<queue> #include<string> #include<unordered_map> #include<unordered_set> using namespace std; struct ListNode{ int val; ListNode *next; ListNode() : val(0), next(nullptr) {} ListNode(int x):val(x), next(nullptr) {} ListNode(int x, ListNode *next):val(x), next...
ALGO
0.999971
5.904265
66a89114-f03b-41cf-b180-0cf8e1d3b942
junyjeon/Baekjoon-Online-Judge
2675.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array int main(void) { int T; cin >> T; for (int i = 0; i < T; ++i) { int R; string P; cin >> R; cin >> P; for (int j = 0; j < P.size(); ++j) { for (int k = 0; k < R; ++k) cout << P[j]; } cout << "\n"; } return...
ALGO
0.995518
3.659283
ae343545-115f-4d5a-9ef1-7fb080ce4787
fadilcse5bu/LeetCode-Problems-Solution
2. Medium/Pow(x, n).cpp
class Solution { public: double pow(double x, int n) { if(n == 0) return 1.0; if(n % 2 != 0) { if(n > 0) return x * pow(x, n - 1); else return x * pow(x, n + 1); } else { double temp = pow(x, n / 2); return temp * temp; } } ...
ALGO
0.998933
5.562897
b1d0921f-fcb9-46f2-ba9b-d849be3b0934
SaveTheOceanMovement/SaveTheOceanCoin
src/pbkdf2.cpp
#include <string.h> #include "pbkdf2.h" static inline uint32_t be32dec(const void *pp) { const uint8_t *p = (uint8_t const *)pp; return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) + ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24)); } static inline void be32enc(void *pp, uint32_t x) { uint8_t ...
ALGO
0.997248
6.905365
3b451006-7a66-4134-992c-111ad3ff3d2d
KienPT0610/COPEPTIT
LoiGiaiC++/HinhChuNhatLonNhat1.cpp
#include <bits/stdc++.h> typedef long long ll; typedef double db; using namespace std; //JohnBelus// int main(){ ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); int t; cin >> t; while(t--){ int n, m; cin >> n >> m; int a[n + 1][m + 1] = {}; for(int i = 1; i <= n; i+...
ALGO
0.999926
3.848992
e852baeb-f62d-4a32-a23d-5f930c8872dd
MeJerry215/learning_repo
leetcode/1170_compare-strings-by-frequency-of-the-smallest-character.cpp
#include "common.h" class Solution { public: int f(string& str) { int cnt = 1; char min_char = str[0]; for(int i = 1; i < str.size(); i++) { if (str[i] < min_char) { min_char = str[i]; cnt = 1; } else if (str[i] == min_char) { ...
ALGO
0.999941
5.938913
f77f0a20-d65a-4c42-8d29-ab000b525708
wong-bria/CS3520
asgn01-basic-brian-main/sum.cpp
#include <iostream> using namespace std; int main() { // TODO int sum = 0; int num; while (cin >> num) { sum += num; } cout << sum << endl; return 0; }
ALGO
0.980932
4.527637
873c3ce2-8ac9-44cf-9114-bb670bfed15c
JimmieKJ/unrealCode
UnrealEngineGitHub/Engine/Source/ThirdParty/CryptoPP/5.6.2/include/algebra.cpp
// algebra.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #ifndef CRYPTOPP_ALGEBRA_CPP // SunCC workaround: compiler could cause this file to be included twice #define CRYPTOPP_ALGEBRA_CPP #include "algebra.h" #include "integer.h" #include <vector> NAMESPACE_BEGIN(CryptoPP) template <cl...
ALGO
0.999019
6.893403
fcb35a17-62fd-4be2-8cdb-fd40f3e06817
Nezz7/Competitive-programming
Codeforces/#694 (Div. 2)/D.cpp
#include <bits/stdc++.h> #define endl '\n' #define LL long long #define LD long double #define pb push_back #define sz(a) (int)a.size() #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define debug(x) cerr << #x << " is " << x << endl; using namespace std; int const MAXN = 2e6 + 9; LL a[MAXN]; int ...
ALGO
0.999741
3.529138
bafe6f99-217c-4380-b41d-c3a0c92a6e3e
virtyaluk/coursera-competitive-programming-core-skills
week-2/2-c-minimums_sum/minimums_sum.cpp
/* * Note: This template uses some c++11 functions , so you have to compile it with c++11 flag. * Example: $ g++ -std=c++11 c++ source.cpp * * Author: Bohdan Shtepan * GitHub: https://github.com/virtyaluk * Site: https://modern-dev.com * */ #include <bits/stdc++.h> using namespace std; #define ar array #define ll lo...
ALGO
0.999976
4.821537
747ad17e-7caf-4661-a9d8-c597244cbe58
leolle/c-plus-plus
Level1/1.4/TestLoops.cpp
// TestLoops.cpp // // Comparing the different ways to loop and make decisions in code. We // take the example of solving a scalar nonlinear equation x = f(x) by the fixed point // method (contraction mapping): // // x(n+1) = f(x(n)), x(0) given. // // We iterate until either fabs(x(n+1) - x(n)) < TOL or n >= MAXITER...
ALGO
0.998732
5.047835
672cae71-3067-45da-8392-163bda9fbbc3
shivankar-p/codeforces
1400_prac/C_Berland_Regional.cpp
#include<bits/stdc++.h> using namespace std; #define fo(i,n) for(i=0;i<n;i++) #define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1) #define ll long long #define int long long #define mod 1000000007 #define vi vector<int> #define f first #define s second #define pb push_back int mfun(int i, int m) { if(i < 0) retur...
ALGO
0.999866
3.216053
38f4cceb-cc96-489f-98b6-de06add4c81a
alexshaoo/LeetCode
0881-boats-to-save-people/0881-boats-to-save-people.cpp
class Solution { public: int numRescueBoats(vector<int>& people, int limit) { int l = 0; int r = people.size()-1; int b = 0; sort(people.begin(), people.end()); while (l <= r) { if (people[l] + people[r] <= limit) { ++l; } --r; ++b; } return b; } };
ALGO
0.999997
6.113289
598bf137-36b4-435c-89f4-930cd8c264f4
henryzhuhr/interview-preparation
leetcode/dynamic-programming/509.斐波那契数.cpp
/* * @lc app=leetcode.cn id=509 lang=cpp * * [509] 斐波那契数 * * https://leetcode.cn/problems/fibonacci-number/description/ * * algorithms * Easy (66.13%) * Likes: 673 * Dislikes: 0 * Total Accepted: 576.6K * Total Submissions: 871.9K * Testcase Example: '2' * * 斐波那契数 (通常用 F(n) 表示)形成的序列称为 斐波那契数列 。该数列由...
ALGO
0.999933
6.150779
813651eb-6151-4c36-98f1-ce6c27fba204
manitbaser/LeetCode
problems/plus_one/solution.cpp
class Solution { public: vector<int> plusOne(vector<int>& digits) { int i = digits.size(); while(--i>=0){ digits[i]++; if(digits[i]<=9) break; digits[i] = 0; } if(i==-1) digits.insert(digits.begin(),1); return digits; } };
ALGO
0.99992
6.774289
253b627b-4e65-4bc6-bdcc-fdedca139091
JuHyeon-Lee/BOJ
10000-/10952.cpp
#include <iostream> using namespace std; int main(){ while(true){ int A, B; scanf("%d%d", &A, &B); if(A==0&&B==0) break; printf("%d\n", A+B); } return 0; }
ALGO
0.997663
3.541793
e03a5451-a0a5-4de5-9a9e-441bd1f26326
avniamitkumar/CODING-PLATFORM-PRACTICE
no_of_nodes_equal_to_avg_of_subtree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999916
6.420105
fa5150ba-04da-459b-b25b-8ef145a56bdf
ishandutta2007/codeforces
hellkitsune/normal/796/C.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define forn(i, n) for (int i = 0; i < (int)(n); ++i) typedef long long LL; typedef pair<int, int> PII; const int INF = int(1e9) + 123; int n; vector<int> g[300000]; int a[300000]; bool solve(int ans) { int bad = 0; for...
ALGO
0.999893
3.93507
48f4f121-7562-4879-8c45-ae7f6f24f730
szmybs/PhysIKA_Cloud
Extern/opencv-2.4.13/modules/contrib/src/parvoretinafilter.cpp
/*#****************************************************************************** ** IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. ** ** By downloading, copying, installing or using the software you agree to this license. ** If you do not agree to this license, do not download, install, ** copy or u...
ALGO
0.983925
6.13598
4ab1fa0c-88d5-4892-b6d4-fb806606cbba
goyalkartik773/A-Z_DSA
Recursion/print increasing decreasing.cpp
#include<iostream> using namespace std; //void print(int i,int n) void print(int n) { // if(i>n) // return; // cout<<i<<" "; // print(i+1,n); // if(i>1) // cout<<i-1<<" "; if(n==0) return; cout<<n-1<<" "; print(n-1); // if(i>1) cout<<n<<" "; } int main() {...
ALGO
0.999903
3.950174
9325668a-715b-4c57-9ca9-5e05c9773bf2
IoanaGabor/competitive-programming-problems
infoarena/namlei.cpp
#include <bits/stdc++.h> #define NMAX 30001 #define KMAX 10 #define MOD 997 using namespace std; ifstream fi("namlei.in"); ofstream fo("namlei.out"); int n,K,X,Y; struct matrice{ int m[KMAX][KMAX]; } aint[4*NMAX],sol; int cnt,ind,j,k,x,y; int nj,nk; matrice inmultire(matrice a,matrice b){ matrice ret; ...
ALGO
0.998965
3.806098
ae85dcdb-8344-4019-b630-10089f37b1df
HimanshuSingour/DSA---Sliding-Window-Algorithum
First_negative_number_with_in_K_size_of_window.cpp
#include<bits/stdc++.h> using namespace std; // Sliding Window Technique Uisng Dqueue // void solve(int arr[] , int size , int k){ int i = 0; int j = 0; deque<int> q; while(j < size){ // Calculations if(arr[j] < 0){ q.push_back(arr[j]); } // Calculations if(j - i +...
ALGO
0.999998
4.63347
ee997a95-4063-4d35-81fe-053c17f73dd7
Kuro-orzz/CP
Hsg/HaNoi/HSG TP HN - THPT - Round 1 - 2023/Bai1.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD (ll)(1e9+7) #define all(x) (x).begin(),(x).end() #define vi vector<int> #define pii pair<int, int> #define fi first #define se second void solve(){ ll n; cin >> n; ll ans = n/5; n %= 5; if(n == 4) ans += 2; else if(n ...
ALGO
0.999673
4.405182
b9dc9295-2a97-471b-b921-28a4a8638955
c4v4/LKH-SP
CVRPTW/SRC/ExtractRoutes.cpp
#include "extract_routes.hpp" extern "C" { #include "LKH.h" #include "Segment.h" }; class CvrptwChecker : public ConstraintChecker { public: inline void add_node(Node *N) { ConstraintChecker::add_node(N); current_demand += N->Demand; auto real_cost = current_cost + get_length(); if...
ALGO
0.998828
5.251281
75cdd600-dcc9-4176-880a-1dbd9047fe0e
deb8192/DeadlyDanceDeb
OpenGL_Tutoriales/GettingStarted/8-Transformaciones/librerias/reactphysics3d/src/collision/shapes/SphereShape.cpp
// Libraries #include "SphereShape.h" #include "collision/ProxyShape.h" #include "configuration.h" #include "collision/RaycastInfo.h" #include <cassert> using namespace reactphysics3d; // Constructor /** * @param radius Radius of the sphere (in meters) */ SphereShape::SphereShape(decimal radius) : Conve...
ALGO
0.919196
7.776476
e14aff49-dbdd-484d-8ffb-cd34fb982dd8
gukazma/Stone
Stone/Vendors/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp
#include <float.h> #include <string.h> #include "DetourNavMeshQuery.h" #include "DetourNavMesh.h" #include "DetourNode.h" #include "DetourCommon.h" #include "DetourMath.h" #include "DetourAlloc.h" #include "DetourAssert.h" #include <new> /// @class dtQueryFilter /// /// <b>The Default Implementation</b> /// /// At co...
ALGO
0.988833
5.986206
47c85c3a-0d89-4031-b0c5-0cc58bee5d85
wanyingkang/canoe-geyser
examples/2023-Chen-exo3/test_adiabat.cpp
// athena #include <athena/athena.hpp> #include <athena/athena_arrays.hpp> #include <athena/bvals/bvals.hpp> #include <athena/coordinates/coordinates.hpp> #include <athena/eos/eos.hpp> #include <athena/field/field.hpp> #include <athena/hydro/hydro.hpp> #include <athena/mesh/mesh.hpp> #include <athena/parameter_input.hp...
ALGO
0.985976
6.031459
3a078798-c03c-4b74-81a8-2687539b9c4a
Xilinx/IIoT-EDDP
Vitis/arty_z7_10_foc_pkg/petalinux/project-spec/meta-user/recipes-apps/libsmart/files/smart/Disk.cpp
#include <stdexcept> // std::exception #include <ctype.h> // isspace #include "File.h" // File::readAllLines #include "string.h" // uint_of, ssprintf #include "Disk.h" // ourselves. #if !defined(WIN32) #include <linux/limits.h> // PATH_MAX #include <sys/mount.h> // mount, umount. #include <unistd.h> // readlink #en...
TOOL
0.902841
5.961311
33948b65-9da3-4593-9e45-9551988a546f
PChaparro/coding-practices
atcoder/contest-351/A.cpp
#include <bits/stdc++.h> using namespace std; // Utils // #define ll long long // #define lld long double // #define umap unordered_map // #define uset unordered_set // typedef pair<int,int> pii; // Whether the input has multiple test cases bool multi = false; void solve() { int ttTotal = 0, taTotal = 0, ...
ALGO
0.99936
3.381985
6eaa024f-8650-4353-bfb4-3aacee163283
CL-BZH/CarND-MPC-Project
src/Eigen-3.3/doc/examples/Tutorial_ArrayClass_interop.cpp
#include <Eigen/Dense> #include <iostream> using namespace Eigen; using namespace std; int main() { MatrixXf m(2,2); MatrixXf n(2,2); MatrixXf result(2,2); m << 1,2, 3,4; n << 5,6, 7,8; result = (m.array() + 4).matrix() * m; cout << "-- Combination 1: --" << endl << result << endl << e...
ALGO
0.999445
4.531452
bbf9eeac-8b79-4e29-ab00-07322f6d5935
Stardust369/Coding-Platforms
1899A__Game_with_integrers.cpp
//Sauce:- https://codeforces.com/problemset/problem/1899/A #include<bits/stdc++.h> using namespace std; int main(){ int n, a; cin >> n; for (int i = 0; i < n; i++){ a = 0; cin >> a; // vova has to avoid getting the integer div by 3 // Vanya has to make the integer divisible ...
ALGO
0.999961
4.37628
d047e423-e13e-4330-b5fc-49a46bacd8bc
afflitto/Custom-Marlin
Marlin/ubl_motion.cpp
#include "MarlinConfig.h" #if ENABLED(AUTO_BED_LEVELING_UBL) #include "Marlin.h" #include "ubl.h" #include "planner.h" #include <avr/io.h> #include <math.h> extern float destination[XYZE]; extern void set_current_to_destination(); static void debug_echo_axis(const AxisEnum axis) { if (current_po...
TOOL
0.982976
7.61477
112207db-6883-4de7-b848-911c7a41b957
godra-y/pp1_2022
9.lab/9.G.cpp
#include <iostream> using namespace std; int main(){ string s; cin>>s; for(int i=0; i<s.size(); i++){ if(s[i]=='0') cout<<s[i]; else if(s[i]=='1' and s[i+1]=='1') i++; else cout<<s[i]; } return 0; }
ALGO
0.999963
3.931225
088980b5-e1f7-4937-8c4b-dca3c4f866b1
448744340/learning
learning/c++/LeetCode/interview17.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; class Solution{ public: vector<int> printNumbers(int n){ double maxnumber=pow(10.0,n); cout<<maxnumber<<endl; vector<int> result; for(int i=1;i<maxnumber;i++) result.push_back(i); retu...
ALGO
0.997985
4.826277
cca50858-d3e9-40eb-a328-09ed64033376
raincross7/code-similarity
codes/train_code/problem461/problem461_247.cpp
// #pragma GCC optimize("Ofast,no-stack-protector") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") #include<bits/stdc++.h> using namespace std; #define N 1000005 #define ll long long #define debug(a) cout<<#a<<": ";for(auto i:a)cout<<i<<" ";cout<<endl; #define trace(a) cout<<#a<<"...
ALGO
0.999979
3.974159
3b7b009d-32c7-4f53-a2ea-a0a73b33ce90
agwlprince617/Data_Structure_Algorithms_Quality_Questions_Code
Codeforces/Div 4/1741A.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int tc; cin>>tc; while(tc--){ string a,b; cin>>a>>b; char sa=a.back(); char sb=b.back(); if(sa==sb){ if(a.size()==b.size()) cout<<"="; else if(sa=='S'){ if(a.size()>b.size())...
ALGO
0.999946
4.493445
4d13c9c8-6a22-4cd0-92e9-90e3d635c03c
AugustoMorante/Asignacion17
Hoja2_Ejercicio1.cpp
#include "pch.h" #include <iostream> #include <conio.h> #include <math.h> using namespace std; void factorial(int n) { int factorial = 1, i = 1; cout << "Inserte numero: "; cin >> n; while (i <= n) { factorial = factorial * i; i++; } cout << "Factorial: " << factorial << endl; return; } void Exponencial(...
ALGO
0.991204
3.33648
f3888f4a-6cb5-4ae6-896a-2e6d0efaf7ff
ladaegorova18/CalculationMethods
Semester5/Lab4/Integrals/Integrals/Integrals.cpp
#include <iostream> #include "Integral.h" #include <locale> #include "PolynomialFirstDgr.h" #include "PolynomialThirdDegree.h" #include "PolynomialZeroDgr.h" #include "Exponenta.h" #include "SomeFunction.h" using namespace std; int main() { setlocale(LC_ALL, "Russian"); double A = 0; double B = 0; int ...
ALGO
0.988585
3.547073
04d969dc-24b1-4fc5-a66a-71e15d99ef6e
KmrAnish04/100DaysOfCode
Recursion-Backtracking/27-Flood_Fill.cpp
// *************************** RECURSION-BACKTRACKING *************************** /* Problem Description: Question Link: GFG: Leetcode: pepcoding: https://pepcoding.com/resources/online-java-foundation/recursion-backtracking/flood-fill-official/ojquestion nados.io: https://nad...
ALGO
0.999921
6.841369
c3086d84-a958-4931-b938-a66df1fc1151
CarlosDaniel111/competitive-programming
Codeforces/Div/Codeforces Round 957 (Div. 3)/F.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using pi = pair<ll, ll>; using vi = vector<ll>; #define pb push_back #define SZ(x) ((ll)(x).size()) #define ALL(x) begin(x), end(x) #define FOR(i, a, b) for (ll i = (ll)a; i < (ll)b; ++i) #define ROF(i, a, b) for (ll i = (ll)a - 1; i >= (ll)b; --i) #...
ALGO
0.999635
4.084306
97b3f7d6-c86c-46ed-afc3-95244b71338c
using-bipin/C-
breakandcont.cpp
#include <iostream> int main() { for (int i = 0; i <= 20; i++) { if (i == 13) { continue; } std::cout << i << std::endl; } }
TOOL
0.985206
3.549282
2f01703d-be28-4f63-ac83-6c2040483b4a
Nanipanyu/Nani_DSA
Graphs/kruskals_algo_mst.cpp
#include<iostream> #include<algorithm> #include<vector> using namespace std; bool cmp(vector<int> &a,vector<int> &b){ return a[2]<b[2]; } //find parent of a node , initially parent of all node is node itself int findParent(int node,vector<int> &parent){ if(parent[node]==node){ //if the node is root node return ...
ALGO
0.999989
5.267836
b92818ea-9aec-4424-9de8-344a42834863
Rodrigo61/GUAXINIM
UVa/10943/main.cpp
using namespace std; bool debug = true; //<editor-fold desc="GUAXINIM TEMPLATE"> /******** All Required Header Files ********/ #include <iostream> #include <string> #include <vector> #include <algorithm> #include <sstream> #include <queue> #include <deque> #include <bitset> #include <iterator> #include <list> #inclu...
ALGO
0.999817
4.115261
4fbb77f7-cba3-4bc2-b13b-6b6151d41a0c
kapg95/gadot
thirdparty/basis_universal/encoder/basisu_enc.cpp
#define MINIZ_HEADER_FILE_ONLY #define MINIZ_NO_ZLIB_COMPATIBLE_NAMES #include "basisu_miniz.h" #if defined(_WIN32) // For QueryPerformanceCounter/QueryPerformanceFrequency #define WIN32_LEAN_AND_MEAN #include <windows.h> #endif namespace basisu { uint64_t interval_timer::g_init_ticks, interval_timer::g_freq; doubl...
TOOL
0.916103
3.459127
57d2e196-186d-45ea-8e74-c7f95a7deb90
CodewithAnn/flutter-Calculator
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
ddb59fad-d27b-4269-a02a-90987559eebc
fadamaka/advent-of-code-2023
day_21/part1.cpp
#include <..\utils\aoc.h> #include <bits/stdc++.h> #include <iostream> #include <string> #include <vector> using namespace std; vector<int> stepDivisors; void primeFactors(int n) { while (n % 2 == 0) { stepDivisors.push_back(2); n = n / 2; } for (int i = 3; i <= sqrt(n); i = i + 2) { ...
ALGO
0.999563
5.453897
26b3c61f-d6a9-4028-8de1-92c506ebeae4
xieh1987/MyLeetCodeCpp
0279 Perfect Squares.cpp
class Solution { public: int numSquares(int n) { vector<int> dp(n+1, INT_MAX); dp[0] = 0; for(int i=1;i<n+1;++i) { for(int j=1;j*j<=i;++j) { dp[i] = min(dp[i], dp[i-j*j] + 1); } } return dp[n]; } };
ALGO
0.999954
5.626098
a404151d-ef25-47cb-97b3-156f45f31328
NamW00/Algorithm
Class1th (Insert Sort)/Source.cpp
#include<iostream> #include<string> #define SIZE 5 using namespace std; int main() { #pragma region ǰ (Bubble Sort) // Ҹ ˻Ͽ ϴ ˰ Դϴ. // ǰ ð ⵵ O(n^2)Դϴ. // 1ȸ -> n ŭ ݺ // 2ȸ -> n-1 ŭ ݺ // int count = 0; // int arr[SIZE] = { 1, 7, 3, 9, 2 }; // // // for (int i = 0; i < SIZE - 1; i++) // { // for...
ALGO
0.999481
4.005496
c831ac9a-a3ca-4c0f-92d3-c925c40f4007
Crespo-dong/PointCloudLibrary
tools/obj_rec_ransac_model_opps.cpp
/* * obj_rec_ransac_model_opps.cpp * * Created on: Jan 29, 2013 * Author: papazov * * Adds a model to the model library and visualizes the oriented point pairs (opps) sampled from the model. */ #include <pcl/recognition/ransac_based/obj_rec_ransac.h> #include <pcl/visualization/pcl_visualizer.h> #include...
TOOL
0.956017
7.316079
ffdedab7-cbf9-4ca1-b13c-70c0716d595f
DuGuYifei/LeetCode_Record
面试题 17.19. 消失的两个数字.cpp
#include<vector> using namespace std; class Solution { public: vector<int> missingTwo(vector<int>& nums) { int xorsum = nums[0]; int n = nums.size(); for(int i = 1; i < n ; i++) { xorsum ^= nums[i]; xorsum ^= i; } xorsum ^= n ^ (n+1) ^ (n+2); ...
ALGO
0.999583
4.763436
6ab18433-8d1f-4f1e-8fb0-2829d6d50635
ishandutta2007/codeforces
ivan100sic/normal/335/D.cpp
// Retired? #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long unsigned long ull; typedef double long ld; int n; int o[3005][3005], sol[100005]; int c[3005][3005]; int dl[3005][3005], dd[3005][3005], hul[3005][3005]; int main() { ios::sync_with_stdio(!cin.tie(0)); memset(hul, 255, ...
ALGO
0.999702
3.560805
4c0521ca-5c09-4261-9dde-d0af363d4d20
YiHsiu7893/UVa
10308.cpp
// UVa-10308: Roads in the North.cpp #include <iostream> #include <cstdlib> #include <utility> // for using "pair" #include <vector> // for using "vector" #include <cstring> // for using "memset" #include <sstream> // for using "string...
ALGO
0.999478
3.914599
d2ede265-39a0-4159-8229-bc5bf703984b
shettyy/const
leetcode/medium/19_remove-nth-node-from-end-of-list.cpp
// Definition for singly-linked list. struct ListNode { int val; ListNode *next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(x), next(nullptr) {} ListNode(int x, ListNode *next) : val(x), next(next) {} }; class Solution { public: ListNode *removeNthFromEnd(ListNode *head, int n...
ALGO
0.999968
5.991209
dad886a7-10ae-424e-9986-68dad463d123
ros008/algorithm
C++/BOJ/13549_BOJ_2/main.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; const int MAX = 100000; int N, K; int cost[MAX + 1]; int dijkstra(int start) { for (int i = 0; i <= MAX; i++) cost[i] = MAX; cost[N] = 0; priority_queue<pair<int, int>> q; q.push({0, N}); while (!q.empty()) ...
ALGO
0.999672
3.911404
cc86c7c4-bc3b-483e-96fb-4d57eab62a71
Oudarja/CP-algorithm-and-problem
My algos folder and application/huffman coding (encoding and decoding and making tree).cpp
#include<bits/stdc++.h> #define ll long long int using namespace std; unordered_map<string,char>decode; struct node { char ch; ll freq; node *left,*right; }; node* getnode(char _ch, ll _freq, node* _left, node* _right) { node* Node = new node(); Node->ch = _ch; Node->freq = _freq; Node->left = _left; N...
ALGO
0.999998
4.650556
b38dcfab-30c4-410f-b03b-5225bd3f530f
Omair95/A_prototype_MPEG-G_encoder
boost_1_66_0/libs/xpressive/perf/time_static_xpressive.cpp
#include "./regex_comparison.hpp" #include <map> #include <cassert> #include <boost/timer.hpp> #include <boost/xpressive/xpressive.hpp> namespace sxpr { using namespace boost::xpressive; // short matches char const * sz1 = "^([0-9]+)(\\-| |$)(.*)$"; sregex rx1 = bol >> (s1= +range('0','9')) >> (s2= as_xpr('-')|' '|e...
TEST
0.913124
5.566709
6f855a0e-6ab9-4e4a-9bde-cfbf36ed08c7
anng-mndz/Programacion-I-Tareas
AUTOEVALUACION/AUTOEVALUACION.CPP
#include <iostream> #include <iomanip> using namespace std; //calculos para nota finales y el porcentaje void calcularNotaFinal(int parcial1, int parcial2, int actividades, int examenFinal, int &notaFinal, float &porcentaje) { notaFinal = parcial1 + parcial2 + actividades + examenFinal; porcentaje = (float)no...
TOOL
0.926274
4.38798
08d3d162-3b90-40e9-b4de-bf12185f1e39
ishandutta2007/codeforces
jtnydv25/normal/1588/A.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define all(c) ((c).begin()), ((c).end()) #define sz(x) ((int)(x).size()) #ifdef LOCAL #include <print.h> #else #define trace(...) // remove in interactive #define endl '\n' #endif int main(){ ios_base::sync_with_stdio(fal...
ALGO
0.999974
4.235069
24ceb9e6-31fd-46fe-82d3-dd4097df3e43
aducrot/aducrot-cppcourse-brunel
main.cpp
#include "neuron.hpp" #include <iostream> #include <cassert> #include <random> using namespace std; void random_connection(vector <Neuron>& neuron_sim, int const CE, int const CI, int const nb_exc, int const nb_inh);//!< method that will generate random //!<connections. The values generated wi...
ALGO
0.969885
4.269083
3aee1754-0ffc-4599-bc4c-fc68f50efe35
raincross7/code-similarity
codes/train_code/problem486/problem486_464.cpp
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < n; ++i) #define rrep(i, n) for(int i = n-1; i >= 0; --i) #define fi first #define se second using namespace std; using lint = long long; using uint = unsigned int; using ulint = unsigned long long; using ldouble = long double; using pii = pair<int, int>; usi...
ALGO
0.999941
4.587092
56d32745-2c5e-4370-8032-f28a140cb26d
shivanshsanoria1/LeetcodeSolutions
CPP [501-1000]/731.my_calender_II [2].cpp
class MyCalendarTwo { private: // time -> count of net intervals added (+) or removed (-) at this time map<int, int> mp; public: MyCalendarTwo() { this->mp.clear(); } // T.C.=O(n*(n + log(n))) // n: num of times book() is called // Line-Sweep algo. bool book(int start, int ...
ALGO
0.999953
6.142315
b6f334ac-10a2-4e69-a761-e5112b5a17b8
ANkurNagila/Striver_SDE_Sheet
DAY_34/children_sum_property.cpp
/************************************************************* Following is the Binary Tree node structure class BinaryTreeNode { public : T data; BinaryTreeNode < T > *left; BinaryTreeNode < T > *right; BinaryTreeNode(T data) { this -> data = data; ...
ALGO
0.999963
4.725173
7b8f29a4-fb76-494f-a536-9817830faf6b
ishandutta2007/codeforces
smax/normal/1672/B.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__) #else #define DEBUG(...) 6 #endif template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";} template<typename C, typen...
ALGO
0.999683
5.656942
bcbb26a9-c967-471b-9a01-c4dce118d1c0
upizpp/PhiScript
src/phi/compiler/optimizer.cpp
#include "optimizer.hpp" namespace phi { void Optimizer::optimizeSimply(State &state) { for (auto &&code : state.getCodes()) { if (code.opt() == OPCode::Command::GOTO) { OPCode &target = state.getCode(state.label(code.value())); if (target.opt() == OPCode::Comman...
ALGO
0.983759
5.528466
2febdef8-cc31-48a1-b96a-6a45d169c60c
ayanavadas01/CodeHelp-DSA-Busted-Series
Lecture027 Double Pointers and MCQs/doublePointer.cpp
#include<iostream> using namespace std; void update(int **p2) { //p2 = p2 + 1; //kuch change hoga - NO //*p2 = *p2 + 1; //kuch change hoga - YES **p2 = **p2 + 1; //kuch change hoga - YES } void update(int *p){ *p = (*p) * 2; } void increment(int **p){ ++(**p...
ALGO
0.994032
3.496661
15dd734a-a69d-4408-9bf7-5144c18692c8
socc-io/algostudy
baekjoon/smilu/18187.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll n; int main() { cin >> n; ll a = n/3, b = n/3, c = n/3; if (n%3 == 2) { ++a, ++b; } else if (n%3 == 1) { ++a; } cout << (a+c+1)*(b+1)+a*c << '\n'; }
ALGO
0.999949
3.591668
6d65bb63-afc2-4154-b61c-caf01753d0d1
Ovijatri/Data_Structure
Graph/Power_matrix.cpp
#include<bits/stdc++.h> using namespace std; int adj_matrix[10][10]; int power_matrix[10][10]; void display_adjacency_list(int); void construct_power_Matix(int); void construct_matix(int); void number_of_path(int); void display_matrix(int); void construct_Matrix(int vertex){ for(int i = 0; i < vertex; i++){ ...
ALGO
0.999703
3.964969
2fb111dd-53f7-4436-b5ed-9b2966897609
RaedAbdelkefi/Problem-Solving
B. Gena's Code.cpp
#include <iostream> #include <bits/stdc++.h> #define ll long long using namespace std; pair <bool, int> beautifull(string ch) { int n=ch.size(); if (ch[0]=='1') { int s=0; for(int i=1;i<n;i++) { if (ch[i]=='0') s++; else return {false,-1}; ...
ALGO
0.999974
3.954873
0e88e230-3f26-40b6-9887-f576ccb785cb
camil0palacios/Competitive-programming
solutions/codeforce/Codeforces Round #539 (Div. 2)/A. Sasha and His Trip/solution.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n, v; while(cin >> n >> v){ int ans = (v < n ? v : n - 1), cur = v - 1; bool f = (v < n ? 0 : 1); for(int i = 2; i <= n; i++){ if(cur == n - i - 1 && !f){ ans += i; f = 1; ...
ALGO
0.999943
3.508313
68c3425b-72a9-4c62-aa58-4e6b65580e3d
aaditya8008/DAA-CPP
FractionalKnapsack.cpp
#include<iostream> #include<algorithm> using namespace std; class job { public: int idx; int weight; int profit; float ratio; job(){ idx=0; weight=0; profit=0; ratio=0; } job(int w, int p, int i) { idx = i; weight = w; profit = p; ratio = (float)p / w...
ALGO
0.999943
5.223679
3daba200-b027-4780-b1ec-808f43f31a7b
dhschall/gem5-fdp-old
src/systemc/tests/systemc/misc/sim_tests/popc/popc.cpp
/***************************************************************************** popc.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /***************************************************************************** ...
ALGO
0.960119
6.072726
4ec96165-56c5-4d6d-8029-f230c362101b
junlin-git/opencv_2.4
modules/calib3d/src/posit.cpp
#include "precomp.hpp" /* POSIT structure */ struct CvPOSITObject { int N; float* inv_matr; float* obj_vecs; float* img_vecs; }; static void icvPseudoInverse3D( float *a, float *b, int n, int method ); static CvStatus icvCreatePOSITObject( CvPoint3D32f *points, ...
ALGO
0.995827
4.431541
40fb86e4-272f-49dc-b4de-1eaa4e002ddd
asimhusain-ai/2nd-Sem-Assignment
Factorial.cpp
#include<iostream> using namespace std; int main(){ int n,fact=1; cout<<"Enter The Num To Find Factorial :- "; cin>>n; for(int i=1; i<=n; i++){ fact=fact*i; } cout<<"The Factorial Is :- "<<fact; return 0; }
ALGO
0.999627
3.469895
6cb7ae8f-a019-4a95-927f-8dcd9bb51a64
Youssab-William/Competitive-Programming
NOI/NOI 13-diesel.cpp
/* dp[x][y] = maximum fuel I can have reaching the cell (x,y) the first row in the dp has only one way to fill it which is from left to right then for each row from second to last you can update dp[i][j] from the above cell and then try updating the row with paths from left to right and...
ALGO
0.999786
3.864594
7d211e73-822d-48a9-beed-d8e93c769eb9
Maltysen/trd
code/mos.cpp
// Mo's algo, O(q*S+n*n/S), q is query idx's, [l,r] closed // update(idx, +-1) adds/dels to some DS (tot is cur ans) ll S = sqrtl(n); sort(q.begin(), q.end(), [&](ll a, ll b) { if (l[a]/S != l[b]/S) return l[a]/S < l[b]/S; return l[a]/S%2 ? r[a]>r[b] : r[a]<r[b]; }); ll curl=0, curr=-1; for (auto i:q) { while(curr<...
ALGO
0.999821
4.190662
2ada9382-eea3-4c3f-a167-2650b8478dd0
ravibhushankumarsonu/Competitive-Programming
CodeForces/441A_ValeraandAntiqueItems.cpp
/* Author: Ravibhushan Kumar College: IIT(ISM) Dhanbad Email id: <EMAIL> Linkdin: https://www.linkedin.com/in/ravibhushan-kumar-6ab881b0/ github : https://github.com/ravibhushankumarsonu */ #include <iostream> #include<vector> #include<algorithm> #include<limits> #include<string> #define MOD 1000000007 using namespa...
ALGO
0.99998
3.196315
5ed897ea-9e06-4dec-8b60-d9c121e17aa8
jnvshubham7/All_Programming
DSA_Code/DP_Code/diameter_of_binary_tree.cpp
//https://leetcode.com/problems/diameter-of-binary-tree/submissions/ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
ALGO
0.999927
6.390284
2e8c8490-358d-4dfe-8f98-b5a9b4185a8d
ainurbrr/praktikum-semester1
Pemrograman Dasar C/Ainur_diamond.cpp
#include<stdio.h> int main(){ int baris,kolom,batas; printf("Masukkan Batas diamond bolong :"); scanf("%d", &batas); for(baris=1;baris<=batas;baris++){ for(kolom=batas;kolom>=baris;kolom--){ printf(" "); }for(kolom=1;kolom<=baris;kolom++){ if(kolom==1){ printf("*"); }else{ printf("*"); } ...
ALGO
0.999343
3.448007
03cfbf5b-3730-4293-a755-93e2b59e7858
ishandutta2007/codeforces
s2speed/normal/1455/D.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll , ll> pll; const ll MAX_N = 510; ll tav(ll n , ll k){ ll res = 1; while(k > 0){ if(k & 1){ res *= n; } n *= n; } return res; } ll m[MAX_N] , x[MAX_N] , a[MAX_N]; void solve(){ ll n , h; cin>>n>>h; for(int i = 0 ; i ...
ALGO
0.999866
3.740474
190b754e-6717-4b8c-962e-ed432bba35a8
ishandutta2007/codeforces
mango_lassi/normal/1677/E.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; // Segment tree for query: "historic range sum" and operation: "set range to 0/1" class SegTree { private: struct Operation { int t0, t1, v, sum; Operation() : t0(0), t1(0), v(-1), sum(0) {} Operation(int t) : t0(t), t1(t), v(-1), sum(0) {...
ALGO
0.999934
4.23819
a807c066-d788-42ae-8ddd-0d8a76adf09b
abhishek2x/Leetcode
Easy/66.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999988
6.198503
4823fa16-b405-4b8e-bd54-f928bf7aea31
TemmaVN/KTLT-Y2-hk1
Queue.cpp
#include "Queue.h" QNode* MakeQN(char d) { QNode* temp = (QNode*)malloc(sizeof(QNode)); temp->data = d; temp->next = NULL; return temp; } void InitQueue(Queue* Q) { Q->front = NULL; Q->rear = NULL; } void Put(Queue* Q, char d) { QNode* temp = MakeQN(d); if (Q->rear == NULL) { Q->front = temp; Q->rear = ...
TOOL
0.96754
4.1784
7171115a-c106-4502-acb2-d6a6a6867272
Skrillite/informatics_contests
basic_structs/correct_bracket_sequence.cpp
#include <iostream> #include <string> // using namespace std; struct Node { char data; Node* prev_node; Node ( char& _data, Node* _prev_node ) : data ( _data ) , prev_node ( _prev_node ) {} }; struct Stack { void push ( char n ); void pop (); char back (); void size (); ...
ALGO
0.999913
4.628814
f6a07ae6-19ac-4c37-8a2d-751353a62e03
barjinderpaul/Programming
University/cse 329 (1)/GCD.cpp
#include<bits/stdc++.h> using namespace std; //Euclid's GCD Algo int gcd(int a,int b){ if(a==0) return b; else return gcd(b%a,a); } int main(){ //Defined in #include<algorithm> cout<<__gcd(6,12)<<endl; cout<<gcd(6,12)<<endl; //Numeber Theory : //Sets //Total sum of the subset; //Formula = n(n+1)/2*p...
ALGO
0.999646
3.465796
c9c4b62a-3a4f-408f-b125-e602251583f8
SyedaShafi/C_programming
CPP/binary_inversion.cpp
#include <bits/stdc++.h> #define ll long long int using namespace std; const int N = 1e7 + 1; int main() { int t; cin >> t; while (t--) { int n, index = -1; cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; if (a[i] == 0 && ind...
ALGO
0.999893
4.692562
6a7d8fd2-4e5f-4248-b31d-48c8a0f31930
amsraman/Competitive_Programming
Atcoder DP/P.cpp
#include <bits/stdc++.h> #define MOD 1000000007 typedef long long ll; using namespace std; int n, dp[100000][2]; vector<int> g[100000]; int add(int a, int b) { return (a+b)%MOD; } int mul(int a, int b) { return (ll(a)*ll(b))%MOD; } void dfs(int x, int p) { dp[x][0] = dp[x][1] = 1; for(int i = 0; i<...
ALGO
0.999624
4.313082
ac13add2-e321-4ac1-888d-f66cd39c6610
SQUARE-RG/csa-eh
llvm/lib/CodeGen/MachineSSAUpdater.cpp
#include "llvm/CodeGen/MachineSSAUpdater.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineOperand.h"...
TOOL
0.990439
7.932796
edd588b3-d57a-4f73-adac-f241c0941d34
khainacs/CS6001
Vscode/Big_O_code/Tich_max.cpp
#include<iostream> #include<algorithm> using namespace std; bool compare(int x, int y) { return x < y; } void multi_max(int N, int arr[]) { //cin >> N; /* for (int i = 0; i < N; i++) { cin >> arr[i]; } */ sort(arr, arr+N, compare); ...
ALGO
0.999828
3.598531
004e6142-f84f-4463-8729-c7b3bede0345
odon8411/iOSDev
arm/opencore-amr-0.1.3/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr_r.cpp
/* Filename: shr_r.cpp ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS Inputs: var1 = 16 bit short signed integer (Word16) whose value falls in the range : 0xffff 8000 <= var1 <= 0x0000 7fff. var2 = 16 bit short signed integer (Word16)...
ALGO
0.998701
6.31642
2093f6f1-ec6e-4959-af78-860762173dbf
HaidarFico/tugas13PPB
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
7062e72c-b798-4907-aba7-be58786e6fc9
Paradoxiao/old-work
C++/luogu/P1226.cpp
#include <bits/stdc++.h> using namespace std; int main() { unsigned long long a, b, c, base, sn = 1; scanf("%llu %llu %llu", &a, &b, &c); printf("%llu^%llu mod %llu", a, b, c); base = a; while (b) { if (b & 1) sn *= base; base *= base; b >>= 1; } printf("=%llu", sn % c); return 0; }
ALGO
0.999957
4.598505
3a0d94f3-cd1c-4ae7-86f3-1618d93780e1
tongkiet2004/TUAN_4
5_18.cpp
#include <bits/stdc++.h> using namespace std; vector<int> greaterFrequencyRight(vector<int>& arr) { int n = arr.size(); vector<int> res(n, -1); unordered_map<int, int> freq; stack<int> st; for (int i = 0; i < n; i++) freq[arr[i]]++; for (int i = 0; i < n; i++) { while (!st.emp...
ALGO
0.999991
5.599934
fe4425d0-41c1-4e73-85ac-22fe87aa2e20
vfolunin/archives-solutions
LeetCode/3133.cpp
class Solution { public: long long minEnd(int size, int andSum) { size--; long long res = andSum; for (int i = 0, j = 0; i < 60; i++) if ((res & (1LL << i)) == 0) res |= (((long long)size >> j++) & 1) << i; return res; } };
ALGO
0.999864
5.524716
b4f80874-d615-4c7f-81b0-dc813d38549a
gkokhabi/kokhabiLeetcode
c++/medium/letterCombinationsOfaphoneNumber.cpp
/* Leetcode number: 17 Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters. */ class So...
ALGO
0.999707
7.097672