uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
57ed831f-8ff1-4f8c-9e77-ca080b1c733f
WizardPenguin/competative-programming
787 div3/1678A.cpp
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef pair<double,double> p...
ALGO
0.998965
4.804273
de6a7dce-2d3e-424f-81d6-e9d874d35d84
nmnnrb/DSA
3379-score-of-a-string/score-of-a-string.cpp
class Solution { public: int scoreOfString(string s) { vector<int> val; for(int i = 0; i< s.size() ; i++){ if('a' <= s[i] && s[i] <= 'z'){ val.push_back(int(s[i])); } } int ans = 0; for(int i = 0 ; i< val.size() -1 ; i++){ ...
ALGO
0.999775
5.451037
b8936ffe-28df-4c8d-bdd3-73a7441ad44b
JinuSpace/Algorithm
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค/1/68644.โ€…๋‘โ€…๊ฐœโ€…๋ฝ‘์•„์„œโ€…๋”ํ•˜๊ธฐ/๋‘โ€…๊ฐœโ€…๋ฝ‘์•„์„œโ€…๋”ํ•˜๊ธฐ.cpp
#include <string> #include <vector> #include <set> #include <algorithm> using namespace std; vector<int> solution(vector<int> numbers) { set<int> answer_set; int size = numbers.size(); for (int i = 0; i < size - 1; ++i) { for (int j = i + 1; j < size; ++j) { answer_set.insert(nu...
ALGO
0.999841
5.448258
03f38a27-2c39-4e69-ae69-b9aa2e67dc19
qtcyy/LeetCode-Record-3.17
ๆ•ฐๆฎ็ป“ๆž„/chapter1/1.6/No1277/main.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: int countSquares(vector<vector<int>> &matrix) { int n = matrix.size(), m = matrix[0].size(); vector<vector<int>> sum(n + 1, vector<int>(m + 1, 0)); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { ...
ALGO
0.998399
5.223182
cbd89b9e-4c2e-4670-b2e1-46562893cfa6
buiducnhat/code-signal-solutions
Arcade/Intro/LandOfLogic/53-valid-time/solution.cpp
bool solution(string t) { regex r("(2[0-3]|[0-1][0-9]):[0-5][0-9]"); return regex_match(t, r); }
TEST
0.965903
5.358085
70e17f6f-80d8-4e4c-bf48-eb8b699dbf60
linkeLi0421/llvm-project15-IRDumperPass
libcxx/test/std/containers/associative/multiset/equal_range_transparent.pass.cpp
// UNSUPPORTED: c++03, c++11 // <set> // class multiset // template<typename K> // pair<iterator,iterator> equal_range(const K& x); // // C++14 // template<typename K> // pair<const_iterator,const_iterator> equal_range(const K& x) const; // // C++14 #include <cassert> #include <s...
TEST
0.993508
5.212717
3349339b-9f38-41fd-866e-8fef206cc01e
Jh-jaehyuk/BOJ
BOJ/10000++/16000~/16920.cpp
// // 16920.cpp // BOJ // // Created by J213h on 10/19/23. // #include <bits/stdc++.h> using namespace std; static int N, M, P; static char board[1001][1001]; static int dx[4] = { -1, 1, 0, 0 }; static int dy[4] = { 0, 0, -1, 1 }; static vector<queue<pair<int, int>>> V; static int S[10]; static int result[10]; v...
ALGO
0.999943
4.614117
9e8cdf2c-5702-467e-94c1-e7a7f8972a8f
iSoron/multirow
onerow/library/src/cplex_helper.cpp
#include <cassert> #include <cstdio> #include <iostream> #include <map> #include <stdexcept> #include <algorithm> #include <ilcplex/cplex.h> #include <qxx/rational.hpp> #include <string> #include <time.h> #include <onerow/single_row_cut_generator.hpp> #include <onerow/cplex_helper.hpp> #include <onerow/geometry.hpp> #...
ALGO
0.999488
4.856493
611d557b-79ec-4a99-aa04-f6044dedba00
AdvikKunta/Chess
classes/Chess.cpp
#include "Chess.h" #include "../log.h" #include <cctype> #include <cstddef> #include <cstring> #include <ctype.h> #include <memory> #include <string> #include <utility> #include <vector> using namespace std; Chess::Chess() = default; Chess::~Chess() = default; void Chess::FENtoBoard(const string& fen) { for (int...
TOOL
0.89114
3.389863
290228d5-8417-4173-9bfb-12437dc81b2b
Hieu0112/Data-Structure-and-Algorithms-ptit
1SinhKeTiep/2SoThuTuToHop.cpp
#include<bits/stdc++.h> using namespace std; int a[20],arr[20]; int n,stt,k; void nhap(){ stt=0; cin>>n>>k; for(int i=1;i<=k;i++) cin>>a[i]; arr[0]=0; } void checks(int *arr,int k){ bool checkstt=false; stt++; for(int i=1;i<=k;i++) if(a[i]!=arr[i]) { checkstt=true; break; } if(!checkstt) { cout<<stt<<endl...
ALGO
0.999742
3.570986
46fe5542-f92c-423b-afb8-688dd65f21ff
wcysai/Calabash
Moscow Pre-Finals Workshop 2016. National Taiwan U Selection/D.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); i++) #define Rep(i, n) for (int i = 1; i <=int(n); i++) #define range(x) begin(x), end(x) #ifdef __LOCAL_DEBUG__ #define _debug(fmt, ...) fprintf(stderr, "[%s] " fmt "\n", __func__, ##__VA_ARGS__) #else #define _debug(...) ((vo...
ALGO
0.999153
4.486637
41c559fc-0a90-492b-829b-0a929e66a038
123pk/100DaysCodingChallenege
Day12/Stone Game VI.cpp
/* Platform :- Leetcode Problem :- Stone Game VI Approach :- The approach that I have used here is for each index I have calculated A[i]+B[i] and paired it with the corresponding index and then sorted it on the basis of values of A[i]+B[i] . I have done so because everyone would love to play a move which...
ALGO
0.999996
5.358099
eaeb2d77-0012-4f45-b3ae-b8282632d93b
parkmineum/Algorithm
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค/0/120866.โ€…์•ˆ์ „์ง€๋Œ€/์•ˆ์ „์ง€๋Œ€.cpp
#include <string> #include <vector> using namespace std; int solution(vector<vector<int>> board) { int dx[8]={1, 1, 1, 0, 0, -1, -1, -1}; int dy[8]={1, 0, -1, 1, -1, 1, 0, -1}; // ์ƒํ•˜์ขŒ์šฐ + ๋Œ€๊ฐ์„  ์ด๋™ int n = board.size(); for(int i=0; i<n; i++){ for(int j=0; j<n; j++){ if(boar...
ALGO
0.998982
5.476705
81575aa2-fccf-4118-9f6e-d5fc6ca120fc
cgao3/benzene-vanilla-cmake
src/hex/HexBoard.cpp
//---------------------------------------------------------------------------- /** @file HexBoard.cpp */ //---------------------------------------------------------------------------- #include "SgSystem.h" #include "SgTimer.h" #include "BitsetIterator.hpp" #include "BoardUtil.hpp" #include "Decompositions.hpp" #inclu...
ALGO
0.990513
7.425846
819602a3-0ff9-452c-80ad-f3fc59fc518f
nantsou/algopraxis
coderunner/workplace/c_cpp/sample/main.cpp
#include <memory> #include "Factory.h" #include "main.h" #include "sols.cpp" int main(int argc, char* argv[]) { string path = GetFilePath(argc, argv); Factory factory; unique_ptr<IParser<int>> integerParser(factory.create<int>("integer")); integerParser->set_input_path(path); Solution sol = Soluti...
ALGO
0.946276
5.341611
8998f2d8-da47-4c36-a5bb-c07f0e0e0453
lithiumfleet/ACW_lq_exercises
acw/acw1239.cpp
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; const int N = 100010, mod = 1000000009; int n, k; int a[N]; int main() { scanf("%d%d", &n, &k); for (int i = 0; i < n; i ++) scanf("%d", &a[i]); sort(a, a+n); int res = 1; int l ...
ALGO
0.999991
4.045226
ec7f0974-a78b-4aaf-ac7d-706689e7563e
habibrahmanbd/LongestCommonTokenSequence
Datasets/8.cpp
using namespace std; int main() { int t=II; int c=1; while(t--) { db R=ID; db n=ID; OC(c++); PF(" %lf\n",(R*sin(PI/n)/(1+sin(PI/n)))); } return 0; }
ALGO
0.995999
3.349719
69d2bb16-59c5-427a-8c46-e95b79b179ac
shaafsalman/Data-Structures
.history/Ds-ori/Part 4/ethics_20241016030527.cpp
#include <iostream> #include <queue> #include <memory> #include "../Part 3/avl.h" // This function calculates the total number of applicants that can be shortlisted. // It is the height of the tree along the right-most path. template <class T, class S, class C> int AVL<T, S, C>::number_to_shortlist(shared_ptr<node<T, ...
ALGO
0.99436
5.411926
1f620142-2c82-404d-a933-fc459f49e7e3
Tokubara/DSA_PA
PA3-4/main.cpp
//#include "kth.h" #include <stdlib.h> #include <stdio.h> #include <iostream> using namespace std; static int *a; static int *b; static int *c; static int n; int compare(int x, int y, int z, int u, int v, int w) { if (x < 1 || x > n || y < 1 || y > n || z < 1 || z > n) { printf("ไธๅœจ่Œƒๅ›ด1\n"); puts("W...
ALGO
0.99995
3.629167
5abd6025-d9e9-48bf-8b83-472c0f743569
codernotme/hacker-rank-solution
Restaurant/solution.cpp
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); /* * Complete the 'restaurant' function below. * * The function is expected to return an INTEGER. * The function accepts following parameters: * 1. INTEGER l * 2. IN...
ALGO
0.999818
6.554073
61d127a3-59a8-401a-8a80-bed6cacf33da
GOBbluth89/arduplane-custom-tamu
libraries/PID/PID.cpp
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*- /// @file PID.cpp /// @brief Generic PID algorithm #include <math.h> #include "PID.h" const AP_Param::GroupInfo PID::var_info[] PROGMEM = { AP_GROUPINFO("P", 0, PID, _kp), AP_GROUPINFO("I", 1, PID, _ki), AP_GROUPINFO("D", 2, PID,...
ALGO
0.914749
6.103773
53be5584-3613-4999-91d2-2b81a3bc9314
doocs/leetcode
solution/0000-0099/0086.Partition List/Solution.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* partition(L...
ALGO
0.999998
5.50844
f542fa92-017f-4620-9d50-cb5a0b74fb56
HubbardHuang/data_structures_and_algorithms
CodingInterviews/ci_37.cpp
/* ้ข˜็›ฎ๏ผšๆ•ฐๅญ—ๅœจๆŽ’ๅบๆ•ฐ็ป„ไธญๅ‡บ็Žฐ็š„ๆฌกๆ•ฐ ้ข˜็›ฎๆ่ฟฐ๏ผš ็ปŸ่ฎกไธ€ไธชๆ•ฐๅญ—ๅœจๆŽ’ๅบๆ•ฐ็ป„ไธญๅ‡บ็Žฐ็š„ๆฌกๆ•ฐใ€‚ */ class Solution { private: // ๆณ•ไธ€๏ผŒ้€’ๅฝ’็‰ˆ int BinarySearch(const vector<int>& data, double target, int start, int end) { if (start > end) { return start; } int mid = (end - start) / 2 + start; if (data[mid] < target) { ...
ALGO
0.999897
5.777454
1793834e-82a4-4821-870b-c68579d07410
NeotokyoRevamp/neo
mp/src/game/server/hl2/npc_enemyfinder.cpp
#include "cbase.h" #include "basecombatcharacter.h" #include "ai_basenpc.h" #include "decals.h" #include "IEffects.h" #include "ai_squad.h" #include "ai_utils.h" #include "ai_senses.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" #define SF_ENEMY_FINDER_CHECK_VIS (1 << 16) #...
ALGO
0.960658
5.863801
af96b288-2443-41c9-b938-cb76db4cb3d0
Abhinav200207/CrackYourPlacement
Sorting/numrectangle.cpp
#include <bits/stdc++.h> using namespace std; int next(vector<pair<int,int>> arr, int target, int end) { int start = 0; int ans = -1; while (start <= end) { int mid = (start + end) / 2; if (arr[mid].first < target) start = mid + 1; else { ans = mi...
ALGO
0.999868
5.304417
3ed2d42f-be5f-4839-9b7e-8c730817c640
MehaShukla/Meha-DSA-Cracker
0443-string-compression/0443-string-compression.cpp
class Solution { public: int compress(vector<char>& chars) { int i = 0, res = 0; while (i < chars.size()) { int groupLength = 1; while (i + groupLength < chars.size() && chars[i + groupLength] == chars[i]) { groupLength++; } chars[res++...
ALGO
0.999991
6.629416
67252c02-ac6c-42e7-bda9-ff65f811f42f
murphygroup/cellorganizer
utilities/3D/LDDMM_fast/armadillo-6.700.6/examples/example1.cpp
#include <iostream> #include <armadillo> using namespace std; using namespace arma; // Armadillo documentation is available at: // http://arma.sourceforge.net/docs.html int main(int argc, char** argv) { cout << "Armadillo version: " << arma_version::as_string() << endl; mat A(2,3); // directly specify the ...
ALGO
0.932454
4.216438
70b6ea89-5769-4ff0-b28b-ad82b5117900
hrithik32/basic-c-
Swaping using 3rd variable.cpp
#include<bits/stdc++.h> using namespace std; int main() { ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #ifdef EPSILON freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif cout<<"Enter x and y"<<endl; int x,y,temp; cin>>x>>y; cout<<"Before swap...
ALGO
0.999732
3.349233
923deef8-ef47-4380-b116-c76a1a46e26f
war1oc/cocos2d-x-admob
cocos2d/cocos/math/Mat4.cpp
#include "math/Mat4.h" #include "math/Quaternion.h" #include "math/MathUtil.h" #include "base/ccMacros.h" NS_CC_MATH_BEGIN Mat4::Mat4() { *this = IDENTITY; } Mat4::Mat4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m3...
TOOL
0.983405
7.266848
0c2f8b7b-b8c6-4827-bb8c-82b6fbea7e34
0bi0n3/one_MBComp
Source/butterworthFilter.cpp
#include <cmath> #include <vector> #include <stdexcept> #include <JuceHeader.h> #include "butterworthFilter.h" // Constructor definition ButterFilter::ButterFilter(double sampleRate, FilterType type) : filterType(type), sampleRate(sampleRate), ...
ALGO
0.938178
5.757062
59275492-6e73-44a9-b7e7-ec4bede037af
parsiyte/GPPRMon
gpu4s_bench/cudaApplications/matrix_multiplication_bench/hip/lib_hip.cpp
#include "hip/hip_runtime.h" #include "../benchmark_library.h" /** * CUDA Kernel Device code * * Computes the vector addition of A and B into C. The 3 vectors have the same * number of elements numElements. */ __global__ void matrix_multiplication_kernel(const bench_t *A,const bench_t *B, bench_t *C, const int n...
ALGO
0.917705
4.83827
fb22f490-b835-41bb-9346-71a0d81a962f
JingCheng26/programme
AdvancedLevel/linklist/1133_2.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; //25โ€˜ const int maxn=100010; struct Node{ int data,next; }node[maxn]; //vไธญๅˆ†ๅˆซไฟๅญ˜็š„ๆ˜ฏ็ฌฆๅˆๆกไปถ็š„ไธ‹ๆ ‡ๅœฐๅ€ vector<int> v[3]; int main() { int first,n,k,addr,data; cin >> first >> n >> k; for(int i=0;i<n;i++){ cin >> addr; cin >>...
ALGO
0.999963
3.025137
a80daaf2-b1b6-46cb-871b-c71ee9661238
machinelv/Kernels-Optimization
GEMM/cpu/serial/DGEMM_sve.cpp
#define _XOPEN_SOURCE 600 #define _POSIX_C_SOURCE 200112L #include <time.h> #include <sys/time.h> #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <stdint.h> #include <unistd.h> #include "arm_sve.h" #include "kblas.h" #include "omp.h" #define VEC_LEN 4 #defi...
ALGO
0.993509
5.727038
9c29d319-a559-438a-b8ba-2f30c6de1da5
mandagod/LeetCode
LinkedListCycle/LinkedListCycleII.cpp
/* Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space? Hide Tags Linked List Two Pointers Author: mandagod Nov 07, 2014 */ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode...
ALGO
0.999969
5.863303
1ae8d536-44a8-4f86-b9c6-e8cd1ed1baaf
elliotproject/elli
src/libzerocoin/Commitment.cpp
/** * @file Commitment.cpp * * @brief Commitment and CommitmentProof classes for the Zerocoin library. * * @author Ian Miers, Christina Garman and Matthew Green * @date June 2013 * * @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green * @license This project is rele...
ALGO
0.998092
7.173681
f9a8bd96-1d1c-4e1a-9b0b-dbe8abafa031
xulixue/yolo_binocular
Binucular/src/SURF.cpp
// SURF.cpp : ฬจำฆรณฺตใกฃ // #include "stdafx.h" #if 0 //#include <opencv2/opencv.hpp> //#include <opencv2/nonfree/nonfree.hpp> #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/contrib/contrib.hpp" #include "opencv2/features2d/features2d.h...
ALGO
0.966715
3.35114
9a45034e-e3df-4fc0-acfa-039aa815fee8
jzlung/graphics
raytracer/eigen/doc/examples/tut_arithmetic_matrix_mul.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; int main() { Matrix2d mat; mat << 1, 2, 3, 4; Vector2d u(-1,1), v(2,0); std::cout << "Here is mat*mat:\n" << mat*mat << std::endl; std::cout << "Here is mat*u:\n" << mat*u << std::endl; std::cout << "Here is u^T*mat:\n" << u.transpo...
ALGO
0.999248
3.810731
10a9274e-f89f-40ad-86f9-e8ba355b4f8a
IvyLH03/algo-contest-archive
contest-algo-archive/lg/2590.cpp
#include<cstdio> //ืขโฃบะธึต #include<algorithm> using namespace std; const int N=200007; long long ts[N],tm[N]; int v[N],vt[N],dep[N],fa[N],son[N],size[N],top[N],at[N],lazytag[N]; char s[10]; struct node{ int next,to; }e[N]; int head[N],n,q,etot,atot; void adde(int x,int y) { e[++etot].next=head[x]; e[etot].to=y; hea...
ALGO
0.999871
3.984993
e2e75608-049b-4861-bb42-721f4dc0e02d
ishandutta2007/codeforces
waynetuinfor/normal/1023/E.cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 5000 + 5; char s[10], ans[maxn]; int n; bool ask(int r1, int c1, int r2, int c2) { if (r1 > r2 || c1 > c2) return false; assert(r1 >= 1 && r1 <= n); assert(c1 >= 1 && c1 <= n); assert(r2 >= 1 && r2 <= n); assert(c2 >= 1 && c2 <= n); ...
ALGO
0.99998
3.188763
a84271fa-03ae-410b-b173-c5b48f832102
huwenao/mteasan
llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.find.first.of/ranges.find_first_of.pass.cpp
// <algorithm> // UNSUPPORTED: c++03, c++11, c++14, c++17 // template<input_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2, // class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> // requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2> // conste...
TEST
0.988827
7.327816
6c32875a-bdc9-43b9-867e-f34d2f36c09b
ishandutta2007/codeforces
platelet/normal/986/E.cpp
#include <bits/stdc++.h> #define rep(i, l, r) for(int i = (l); i <= (r); i++) #define per(i, r, l) for(int i = (r); i >= (l); i--) #define mem(a, b) memset(a, b, sizeof a) #define For(i, l, r) for(int i = (l), i##e = (r); i < i##e; i++) #define fi first #define se second #define pb push_back using namespace std; const...
ALGO
0.999894
4.169989
da05677e-b853-4f46-9247-5edcde7b57fa
ipaddr/MPLJJ25-138-KEL-10
user/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.998178
6.771107
a3ed29c3-2bb9-409c-9747-34f2a346ccdf
ranamihir/CPP-Programs
mte1q4.cpp
#include <iostream> using namespace std; int gcd(int x, int y) { int rem = 0; do { rem = x%y; x = y; y = rem; } while (y != 0); return x; } int lcm(int x, int y) { int LCM = x*y/gcd(x, y); return LCM; } int main() { int x = 0, y = 0; cout << "Enter any two positive integers whose LCM is to be f...
ALGO
0.99798
5.364691
e284aa3e-4db8-42d2-8a82-405bd0019bd8
DmitryPogrebnoy/Parallel_Algo_Data_Analysis_ITMO
OmpiTasks/Task15/Assignment15.cpp
#include "mpi.h" using namespace std; int main(int argc, char **argv) { int rank, size, i, rbuf; MPI_Init(&argc, &argv); MPI_Group group, new_group; MPI_Comm new_comm; int ranks[128], new_rank; // Get the number of processes associated with the communicator MPI_Comm_size(MPI_COMM_WORLD, &size); // Get the ran...
ALGO
0.999824
3.548923
bdffda9b-80f3-4ffa-9003-a5db98a6224d
chauhansatyam3112/DSA-problems
0516-longest-palindromic-subsequence/0516-longest-palindromic-subsequence.cpp
class Solution { public: int solve(string &a,string &b,int i,int j,vector<vector<int>>&dp) { if(i==a.length()) return 0; if(j==b.length()) return 0; if(dp[i][j]!=-1) { return dp[i][j]; } int ans=0; if(a[i]==b[j])...
ALGO
0.99994
5.945064
3a70e943-c702-4776-b0e9-364a53ef29b2
Ayandip244/Leetcode_Daily-Questions
19.08.2025.cpp
class Solution { public: long long zeroFilledSubarray(vector<int>& nums) { long long ans = 0; int cnt = 0; for (int x : nums) { if (x == 0) { ans += ++cnt; } else { cnt = 0; } } return ans; } };
ALGO
0.999844
6.310574
87c0dae3-4ed8-4f95-96fe-967f1b7d3e6b
ishandutta2007/codeforces
abc864197532/normal/1601/C.cpp
/* * ## ##### #### #### # # #### * # # # # # # # # # # # # * # # ##### # # # # # # # * ###### # # # # # # ## # # # * # # # # # # # # ## ## # # * # # ##### #### #### # # #### */ #include <bits/stdc++.h> us...
ALGO
0.99999
5.073275
e0c2311b-cec6-4b83-87fd-cb752f189917
Subhanmalik138/PF__LAB
manual 12/task4.cpp
#include<iostream> using namespace std; main() { int rowsize; cout<<" Enter the rowsize: "; cin>> rowsize; int col=rowsize; cout<<" Enter the elements of matrix:"<<endl; int elements[rowsize][col]; for(int i=0; i<rowsize; i++) { for(int j=0; j<rowsize; j++) { ...
ALGO
0.959777
3.052516
43ddaf1f-682c-45e0-be0c-91dc6a7381c6
pranjalnehete02/CDAC
DSA/Competitive Programming/Love babbar 450/59.Array.cpp
/* Given an array arr of N elements we need to find the contiguous sub array with max-sum. KADANE'S ALGORITHM */ #include<bits/stdc++.h> using namespace std; int main(){ return 0; }
ALGO
0.999739
4.623539
dcac878c-67be-47c0-a950-5111e55387f5
Lee0701/OpenTTD.old
src/pathfinder/yapf/yapf_road.cpp
/** @file yapf_road.cpp The road pathfinding. */ #include "../../stdafx.h" #include "yapf.hpp" #include "yapf_node_road.hpp" #include "../../roadstop_base.h" #include "../../safeguards.h" template <class Types> class CYapfCostRoadT { public: typedef typename Types::Tpf Tpf; ///< pathfinder (derived from THIS class)...
ALGO
0.999549
7.41829
9690662f-219d-4649-a73d-e54e0b233312
EmptyBlueBox/Data_Structures_And_Algorithms_A-zl-2022Fall-PKU
06-ๆ ‘/0615 ็”ต่ฏๅท็ .cpp
#include <iostream> #include <vector> #include <string> using namespace std; //ๅญ—ๅ…ธๆ ‘ struct node { node *ch[10] = {NULL}; int cnt = 0; bool is_end = false; //ๅญ˜ๆ˜ฏๅฆๆ˜ฏๆœ€ๅŽไธ€ไธชๅญ—็ฌฆ }; //ๆœ‰ไบ’็›ธไธบๅ‰็ผ€็š„ไธคไธชๅญ—็ฌฆไธฒ bool has_contradict_prefix = false; void insert(node *root, string a) { int len = a.length(); node *cur = root; ...
ALGO
0.999902
4.29343
203476df-c376-4a7e-b3dd-2d3f11170937
vineetsharma36/LeetCode
1170-compare-strings-by-frequency-of-the-smallest-character/1170-compare-strings-by-frequency-of-the-smallest-character.cpp
class Solution { public: vector<int> numSmallerByFrequency(vector<string>& queries, vector<string>& words) { vector<int> f1, f2, res; for(int i=0;i<queries.size();i++){ vector<int> freq(26,0); for(auto& x: queries[i]){ freq[x-'a']++; } ...
ALGO
0.999956
5.767946
81b09e6c-1367-4368-bc13-bd50bfc87127
rbee3u/leetcode
src/p0168/cpp/solution.cpp
class Solution { public: string convertToTitle(int n) { if (n <= 0) return ""; string ret = ""; while (1) { --n; ret = char(n%26+'A') + ret; n = n / 26; if (n <= 0) break; } return ret; } };
ALGO
0.999948
6.460518
464e0705-88c9-4c78-9db9-0b268b21f93d
Hrk01221/TemplateCP
Data Structures/Others/Mo'sAlgo.cpp
int Mx = 100005; struct Query{int l,r,ind;}; bool cmp(Query &a,Query &b){ int blocks_size = sqrt(Mx); if(a.l/blocks_size!=b.l/blocks_size) return a.l/blocks_size < b.l/blocks_size; return a.r < b.r; } void add(int ind,int &d){} void remove(int ind,int &d){} vector<Query>qu(q); for(int i=0;i<q;i++){ ...
ALGO
0.999408
4.387563
d442a3fb-0a9d-4d1a-83f7-c185e1bf068a
chinmayjainnnn/CPP
191-number-of-1-bits/number-of-1-bits.cpp
class Solution { public: int hammingWeight(int n) { int ans=0; while(n>0){ ans+=n%2; n=n/2; } return ans; } };
ALGO
0.999977
6.185554
9ce8ba22-fe74-45e5-85bd-9674309d8c50
vbonnici/grafe-sim
analysis/data/p02255/s387605121.cpp
#include <bits/stdc++.h> using namespace std; #define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++) #define REP(i,e) FOR(i,0,e) #define all(o) (o).begin(), (o).end() #define psb(x) push_back(x) #define mp(x,y) make_pair((x),(y)) typedef long long ll; typedef pair<int, int> PII; const double EPS = 1e-10; const int N ...
ALGO
0.999946
3.241482
c9bdb8f8-d248-429c-be28-95da4f8c6364
pantq1711/DSA_CodePTIT
DSA03003.cpp
#include<bits/stdc++.h> using namespace std; #define faster() ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); #define mod 1000000007 #define ll long long int main(){ int t; cin >> t; while(t--){ int n; cin >> n; int a[n]; for(int i=0; i<n; ++i) cin >> a[i]; sort(a, a+n); ll sum = 0; for(int ...
ALGO
0.999727
4.047455
dce5c003-b1ac-4964-a19c-260539bae53a
songdaegeun/ps_backjoon
backjoon/week9_sort(2)9_bfs4_simul1/14442.cpp
#include <iostream> #include <queue> #include <tuple> using namespace std; int n, m, k; char map[1001][1001]; int dist[1001][1001][11]; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int bfs() { queue<tuple<int,int,int>> q; dist[0][0][0] = 1; q.push({0,0,0}); while(!q.empty()) { int x,...
ALGO
0.999961
5.010922
e6e5cdd7-20d5-43c8-9bd7-d644c55a4e9f
Chandan017/Coder-s-Byte
42-trapping-rain-water/42-trapping-rain-water.cpp
class Solution { public: int trap(vector<int>& height) { int n=height.size(); vector<int> leftMax; vector<int> rightMax(n); int maxiL=-1 , maxiR=-1; for(int i=0;i<n;i++) { leftMax.push_back(maxiL); maxiL=max(maxiL , height[i])...
ALGO
0.999994
6.637868
696cbce9-39a1-401d-8189-e5066bf245da
divyansiranpariya/C--_language
Phase 5/task10.cpp
#include <iostream> using namespace std; void arm(int n) { int sum=0,r,d; d=n; while(n>0){ r=n%10; sum=(r*r*r)+sum; n=n/10; } cout<<endl; if(d==sum){ cout<<"this is armstrong number"; } else{ cout<<"this is not armstrong number"; } } int main() { int n1; cout << "Enter a number: "; cin >...
ALGO
0.999706
4.86974
4fae9075-60a8-4437-97d8-f36b3370ac4a
zilongshanren/Spine-Cocos2D-X
cocos/3d/CCAABB.cpp
#include "3d/CCAABB.h" NS_CC_BEGIN AABB::AABB() { reset(); } AABB::AABB(const Vec3& min, const Vec3& max) { set(min, max); } AABB::AABB(const AABB& box) { set(box._min,box._max); } Vec3 AABB::getCenter() { Vec3 center; center.x = 0.5f*(_min.x+_max.x); center.y = 0.5f*(_min.y+_max.y); center.z = 0.5...
TOOL
0.873353
7.53548
d95d2f86-c5ee-4aea-a997-3f20d47643a8
AmpleCoder/DSA-Repo
Trees/MorrisTraversal.cpp
/* Morris Traversal basically sets the temporary link between node and its predecessor we set predecessor->right = node i)we start with the root node ii)if there is left child of the node 1)we compute it's predecessor 2)check is there any link between node and its predecessor a)if there's no lin...
ALGO
1
6.276926
69ff89fd-12ab-4283-b96f-be59099f50b6
AhmedEssamYassin/Problem-Solving
Data Structures/Policy Based Data Structures/Policy_based_data_structures.cpp
#include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> #include <functional> // For less<T> or less_equal<T> #include <iostream> using namespace __gnu_pbds; using namespace std; // Be careful with less<T> or less_equal<T> template <typename T> using ordered_set = tree<T, null_type,...
ALGO
0.999943
4.363381
549de8d2-c0b9-40aa-b2b7-d8af9d0b49f3
lchyeon0123/Kairos
libraries/opencv/samples/dnn/human_parsing.cpp
// // this sample demonstrates parsing (segmenting) human body parts from an image using opencv's dnn, // based on https://github.com/Engineering-Course/LIP_JPPNet // // get the pretrained model from: https://www.dropbox.com/s/qag9vzambhhkvxr/lip_jppnet_384.pb?dl=0 // #include <opencv2/dnn.hpp> #include <opencv2/highg...
DATA
0.977424
5.5254
9a359e32-9d35-40fc-b4ef-d0e8b097e47f
prathampithalia/CP
LeetCode/1922. Count Good Numbers.cpp
class Solution { public: const int N = 1e9 + 7; long int pwx(long int base, long int exp) { if (exp == 0) return 1; if (exp == 1) return base % N; long int t = pwx(base, exp / 2); t = (t * t) % N; // if exponent is even value if (exp % 2...
ALGO
0.99996
5.692332
446b46a7-eb02-48e3-9bee-db3436f68ab2
Sho1007/Algorithm
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค/2/154540.โ€…๋ฌด์ธ๋„โ€…์—ฌํ–‰/๋ฌด์ธ๋„โ€…์—ฌํ–‰.cpp
#include <string> #include <queue> #include <algorithm> using namespace std; vector<vector<bool>> Visit; int dy[4] = {0, 0, -1, 1}; int dx[4] = {-1, 1, 0, 0}; int BFS(int Y, int X, const vector<string>& maps) { queue<pair<int,int>> Queue; Visit[Y][X] = true; int Day = maps[Y][X] - '0'; Queue.pus...
ALGO
0.999724
4.848313
7d468e97-2b0e-4cf1-a741-a1ca4bc55648
mosabbeer/Problem_Solving
B_Paint_a_Strip.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int main(){ int t; cin>>t; while(t--){ int n; cin>>n; int sum=1,count=1; if(n<=4) { if(n==1) cout<<"1\n"; else cout<<"2\n"; } else ...
ALGO
0.999973
4.293716
3d415754-d989-470d-86bc-426a7206c004
MrJabiulla/Unsplash_wallpaper_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.998784
6.761023
f0e017af-8ad3-4da3-9eb5-a0bdee82a1eb
Dat-TG/FS_Project_OS
File system/EncryptData.cpp
#include "EncryptData.h" void encryptDecrypt(char*& toEncrypt, uint32_t dataSize) { for (uint32_t i = 0; i < dataSize; i++) { toEncrypt[i] = toEncrypt[i] ^ key[i % (sizeof(key) / sizeof(char))]; } }
ALGO
0.992193
3.934814
12935873-68fc-406b-8ab3-b3fd9ab9ed52
Stareat0707/HackerRank
Alternating Characters/Main.cpp
#include <iostream> #include <string> using namespace std; int alternatingCharacters(string s) { int count = 0; for (int i = 1; i < s.size(); ++i) { if (s[i] == s[i - 1]) ++count; } return count; } int main() { int q; cin >> q; for (int i = 0; i < q; ++i) { string s; cin >> s; cout << alternat...
ALGO
0.999626
4.727112
e0aef9b4-2f14-4341-a3d1-721999bac219
splax-s/flutter-food-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.998693
6.797273
a6a32790-b002-4136-beb6-3794531e240c
OugaMehdi/berlin52
main.cpp
#include <iostream> #include <fstream> #include <algorithm> #include "berlin.h" /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { ifstream file("berlin52"); int n; file >> n; vector<Ville> villes(n); for (int i = ...
ALGO
0.999899
4.339986
046838f7-9cd6-479c-9951-62509f5cc33d
GitHub-Sanjit/allProgramsPhitron
PhitronAllPrograms-main/DSA/DATA STRUCTURE/Week 3/Module11/Middle_Element_Leet_code.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: int find_Size(ListNod...
ALGO
0.9996
5.686535
009d7cbc-a103-46f3-9cfd-1285b954ec9b
sakib3201/My_codes
UVA solve/UVA 11559 Event planning/main.cpp
#include<bits/stdc++.h> using namespace std; int main() { unsigned long long int i,j,num_per,budget,h_num,n_weeks,per_person,week,min_cost=2000000,total_cost=0; int sf=0,bf=0; while(scanf("%llu %llu %llu %llu",&num_per,&budget,&h_num,&n_weeks)==4) { for(i=0;i<h_num;i++) { scanf("%llu"...
ALGO
0.999883
3.495873
4a85dc02-2ae0-484f-9173-6982d2190ed6
RogerEC/CP-ICPC-Training
Online-Judges/Codeforces/Cpp/1062-C.cpp
#include<iostream> #include<vector> using namespace std; int main() { const int MOD = 1e9 + 7; vector<int> POT2(100001); POT2[0] = 1; for (auto i{1}; i <= 100001; i++) POT2[i] = (POT2[i - 1] * 2) % MOD; int N, Q; cin >> N >> Q; vector<int> x(N + 1); { string str; ...
ALGO
0.999777
4.619766
66fb65c8-b2d8-46e8-8b8b-38e49dd08485
su-giana/algorithm
baekjoon/1764.cpp
#include <iostream> #include <set> #include <vector> #include <algorithm> using namespace std; int n, m; set<string> s; void init() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); } int main() { init(); cin>>n>>m; vector<string> answer; while(n--) { string ss; ...
ALGO
0.999986
3.91923
365c13e1-cdb3-4522-a61b-97e84c443856
jiho7407/PS
BaekJoon/Morgorithm_Daily/2024-M7/0710/20533.cpp
#include <bits/stdc++.h> #define ll long long #define lll __int128 #define ld long double #define rep(i,l,r)for(int i=(l);i<(r);i++) using namespace std; typedef pair<int, int> pii; typedef pair<ll, ll> pll; void fastio(){ cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); } int N; int A[500000]; ...
ALGO
0.999991
4.257887
461df2f1-0a9d-4bff-823a-08f08fdb0582
Rookie0208/Learnings
Cpp DSA/rearrange_elements_by_sign.cpp
#include<bits/stdc++.h> using namespace std; vector<int> solve(vector<int> &v) { // 3 1 -2 -5 2 -4 int i = 1; int j = 0; while(i < v.size()) { if(v[i] > 0 && v[i-1] > 0) { i++; j++; swap(v[i], v[j]); } i++; } return v; } int main() { ...
ALGO
0.999987
4.29842
f1209495-e3b8-4cf3-93f3-3308c8895583
qhb1001/For-that-dream
Codeforces/Round #482/qhb/C.cpp
#include <iostream> #include <cstring> #include <queue> #include <cstdio> #include <vector> using namespace std; int n, x, y; const int MAX = 3e5 + 5; vector<int>G[MAX]; void in() { cin >> n >> x >> y; int from, to; for (int i = 1; i < n; ++i) { cin >> from >> to; G[from].push_back(to); G[to].push_back(from); ...
ALGO
0.999681
3.809039
da9e3683-8c4e-4753-a0e8-f6a1bb5aeef4
tr0j4n034/HPC-2019
Examples/MPI/point_to_point_messages.cpp
// to compile: mpicxx filename.cpp -o main // to run: mpirun -np numprocesses ./main #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <mpi.h> int main(int argc, char** argv) { int rank, size; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_...
ALGO
0.931811
4.355365
dccbbf1b-a169-46d4-ab7d-8f1dcfc390eb
Zlin0509/Zlin_ACM
_CF/CONTEST/1500-1999/1986/F.cpp
// // Created by Zlin on 2024/9/18. // #include "bits/stdc++.h" using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<long long> vll; typedef pair<int, int> pii; typedef pair<long long, long long> pll; int n, m; ll ans; const int N = 2e5 + 5; ll dfn[N], lo...
ALGO
0.99994
5.729828
3c7e1248-9111-456f-9f1d-c5053864dc22
franv314/competitive
olinfo/OIS/words2/words2.cpp
// NOTE: it is recommended to use this even if you don't understand the following code. #include <bits/stdc++.h> #define MOD 1000000007 using namespace std; // input data string W; int main() { // uncomment the following lines if you want to read/write from files // ifstream cin("input.txt"); // ofstream cout("...
ALGO
0.999967
4.627075
9a5d3db6-abab-4003-b89e-ca19cd65f227
Aditya-Mishra19/Leetcode-problems
78-subsets/78-subsets.cpp
class Solution { private: void solve(vector<int> nums, vector<int> output, int index, vector<vector<int>>& ans) { // base case if(index >= nums.size()) { ans.push_back(output); return; } //exclude case (increamenting index value only) solve(nu...
ALGO
0.999943
6.412202
d6ce1667-01a3-4963-b2b9-7ad139bd6af6
VanjaRo/Algorithms-and-Datastructures-ITMO-Course
code/13/13B.cpp
#include <iostream> #include <vector> #include <fstream> using namespace std; vector<int> prefix_function(string s){ int n = (int) s.size(); vector<int> result (n); for(int i = 1; i < n; i++){ int k = result[i - 1]; while (k > 0 && s[i] != s[k]){ k = result[k-1]; } ...
ALGO
0.999895
4.393868
bcce2160-4c38-464e-91a8-f6b85a4f54c7
afrin-sadiaa/Codeforces
be like hasib.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n,x,count=0; cin >> n >> x; int lo=1,hi=n,mid; while(hi-lo>=1) { count++; mid=(hi+lo)/2; if(mid<x) { lo = mid+1; } else ...
ALGO
0.99987
3.343381
04e4e00d-3f81-4002-ae3d-a8cee69e6ae2
hjiang13/LLMs-in-IR
POJ-104/55/1186.cpp
#include <iostream> using namespace std; int main() { long int b,i=0,j=0,n_number[500],decdec=0,a2[10],k,ans[500],l; int mi; double a; char n[500],ans2[500],a1[10]; a1[1]=48; while((a1[i]=getchar())>=48) //??a { i++; } a2[0]=a1[0]-48; a2[1]=a1[1]-48; if(a2[1]>=0&&a2[1]<=9) a=a2[0]*10+a2[1]; else a=a2[0]; i=0; while((...
ALGO
0.999961
3.406423
1c6f00a0-0ecc-4934-8837-09cb67d81ad6
shivam710/CS204
Pre_midsem/lab1_multiple.cpp
#include <iostream> #include <cstring> #include <cstdlib> using namespace std; //single element multiple char* multiple(char*a,char c) { int p=strlen(a); int b=c-'0'; char* m=(char*)(malloc (100*sizeof(char))); int carry=0; for(int i=p-1;i>=0;i--) { m[i+1]=(((a[i]-'0')*b+carry)%10)+'0';...
ALGO
0.999926
4.786807
5bbf10c5-51bb-45ad-8adb-1e82b451d966
DwayneCrous/CPP
creditCardValidator/creditCardValidator.cpp
#include <iostream> int getDigit(const int number); int sumOddDigits(const std::string cardNumber); int sumEvenDigits(const std::string cardNumber); int main() { std::string cardNumber; int result = 0; std::cout << "Enter a credit card number: "; std::cin >> cardNumber; result = sumEvenDigits(cardNumber)...
ALGO
0.998597
6.073468
2b904859-3702-445d-b900-d12ab2b57dfc
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_2345_12.cpp
#include <bits/stdc++.h> using namespace std; int main() { long long n, c; cin >> n; c = n / 1890; cout << c; return 0; }
ALGO
0.997717
3.307164
77e20347-dc36-4aa2-8355-77a71368d302
barrystyle/SUQA-0.17.1
src/merkleblock.cpp
#include <merkleblock.h> #include <hash.h> #include <consensus/consensus.h> #include <utilstrencodings.h> CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter* filter, const std::set<uint256>* txids) { header = block.GetBlockHeader(); std::vector<bool> vMatch; std::vector<uint256> vHashes; v...
ALGO
0.99851
6.175004
3e26fe7d-6809-49f2-a7fd-cdf9dc28801b
Bisgates/PAT-zju
1106.cpp
#include<stdio.h> #include<vector> #include<cmath> using namespace std; vector<int> G[100010]; int dep[100010] = {0}; void DFS(int root,int depth){ if(G[root].size() == 0){ dep[depth]++; } else{ for(int i = 0;i < G[root].size(); i++){ DFS(G[root][i],depth+1); } } } int main() { int n; ...
ALGO
0.999586
3.557132
7bbcee66-0b85-4709-98ec-d30fe762f4d3
jaupi-enrico/oii_exercises
Lezioni_2025/STL_Terry_25_03/main.cpp
#include <bits/stdc++.h> // Include tutte le librerie using namespace std; int main() { int i = 0, N = 0; for (;i == N;) // equivalente al while { i++; } // ifstream cin("input.txt"); //lettura file se tutto nel main // ofstream cout("output.txt"); //scrittura file se tutto nel main ...
ALGO
0.982205
4.419142
eccbd61a-4e6c-4a13-b11a-470042606f86
itskartike910/Coding-Ninja-CPP---DSA
2. DSA in C++/Codings/Lecture-20_Graphs1/codingNinjas.cpp
#include <iostream> #include <vector> using namespace std; // #include "solution.h" bool hasPath(vector<vector<char>> &board, int n, int m){ // Write your code here. } int main() { int n, m; cin >> n >> m; vector<vector<char>> board(n, vector<char>(m)); for (int i = 0; i < n; ++i) { ...
ALGO
0.999869
4.778607
d47cfae3-183e-46cb-a6b9-3af5a6e22ed2
NguyenNhuDi/Kattis-solutions
TODO/undead_or_alive.cpp
//undead or alive #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++) #d...
ALGO
0.99969
3.25454
544562e8-e54c-4d07-a5a5-66230340ff34
samuelloza/solutions
coj/1842.cpp
#include <iostream> #include <cstdio> #include <cstdlib> using namespace std; int main() { int x1,x2,y1,y2,n; scanf("%d",&n); while(n--){ scanf("%d%d%d%d",&x1,&y1,&x2,&y2); printf("%d\n",(abs(x2-x1)+abs(y2-y1))); } return 0; }
ALGO
0.993177
3.310419
88e1f2fb-3484-4d7e-b55f-67114b88aecf
dlvguo/NoobOJCollection
LeetCode/Normal/1300-1399/1342.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int numberOfSteps(int num) { int step = 0; while (num) { if (num & 1) num--; else num /= 2; step++; } return step; } };
ALGO
0.999582
5.557952
b6d34f60-f775-444a-a213-7209c0124b1c
tanishq252/myLeetcodeSolutions
1396-design-underground-system/1396-design-underground-system.cpp
class UndergroundSystem { public: public: //startStation:endStation -> {totalTime, numberOfTrips} unordered_map<string, pair<long long, int>> stationTimes; //customerId -> startStation unordered_map<int, pair<string,int>> inTransit; UndergroundSystem() { stationTimes.clear(); inTrans...
ALGO
0.982385
6.506073
38372f1e-e61b-4251-86b0-de3630dc511c
jhsotoglz/practice-problems
Top-Interview-150/189.Rotate-Array/189.Rotate-Array.cpp
// Given an integer array `nums`, rotate the array to the right by `k` steps, where `k` is non-negative. // Example 1: // Input: nums = [1,2,3,4,5,6,7], k = 3 // Output: [5,6,7,1,2,3,4] // Explanation: // Rotate 1 step to the right: [7,1,2,3,4,5,6] // Rotate 2 steps to the right: [6,7,1,2,3,4,5] // Rotate 3 steps to t...
ALGO
0.999946
7.152132
2fcf4a05-7a42-45c7-8d84-d8c2b87ff45c
tonickkozlov/algorithms
trees/print_levels/print_levels.cpp
/* Given a tree, e.g. A B E C DF G print all the paths from root to leaves respecting horizontal offset of each in in-order traversal, e.g. _A B _D __A _B C A _E F .. and so on */ #include <iostream> #include <map> #include <vector> #include <stack> #incl...
ALGO
0.999907
4.875995
9b35359e-8145-4832-84fa-2bac3a81172f
ChaomengOrion/CompetitiveSave
Codeforces/Educational Codeforces Round 169 (Rated for Div. 2)/D_Colored_Portals.cpp
#include <bits/stdc++.h> using u32 = unsigned int; using i64 = long long; using u64 = unsigned long long; #define string std::string #define cin std::cin #define cout std::cout #define endl std::endl #define DEBUG(n) cout << "DEBUG: " << n << endl; #define OUT(n) cout << n; int gcd(int a, int b) { return b == 0 ? a...
ALGO
0.999316
4.693365