uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
dd818320-7ee3-4f0a-87f6-4d183569ba1c
jaisat/CP_Codes
graphs/MinFuel.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define ff first #define ss second #define int long long #define pb push_back #define mp make_pair #define pii pair<int,int> #def...
ALGO
0.99993
3.725075
fe36d273-4815-4086-8347-163d897c1b65
jchnelson/project_euler_solutions
22_name_scores.cpp
#include <fstream> #include <string> #include <vector> #include <iostream> #include <cstddef> #include <algorithm> using std::size_t; using std::cout; int main() { std::ifstream bob("names.txt"); char nextname[100]{}; char garbage[10]{}; std::vector<std::string> names; names.reserve(5200); whi...
ALGO
0.985531
3.922169
009028de-24f3-4b18-b24d-7c6f41ea3b47
dmacia49/CS_5781_Project
WakeUp/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.998354
6.76775
870d8f83-564b-4746-97d7-ca56d03690f5
Divyanshu9794/GFG_POTD
Easy/Delete without head pointer/delete-without-head-pointer.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; /* Link list node */ struct Node { int data; struct Node *next; Node(int x) { data = x; next = NULL; } }*head; Node *findNode(Node* head, int search_for) { Node* current = head; while (current != NULL) { if (curren...
ALGO
0.999851
5.689968
aaf35645-b892-43c8-bb2a-09655dbdb194
aikit0846/atcoder
ABC340/ABC340_E.cpp
// not submitted #include <bits/stdc++.h> using namespace std; int main() { int i, j, N, M; cin >> N >> M; vector<int> A(N), B(M), nowNum(N); for (i = 0; i < N; i++) { cin >> A[i]; nowNum[i] = A[i]; } for (i = 0; i < M; i++) { cin >> B[i]; } for (i = 0; i < M;...
ALGO
0.999985
3.357255
b99f1896-eaad-4413-951d-f60b813c3caa
Luckily777/C-
Niuke070405.cpp
//˫ /* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } };*/ class Solution { public: void _Convert(TreeNode* root, TreeNode** prev) { if (root) { // _Convert(root->left, p...
ALGO
0.999988
5.256399
8d6c2580-6a3e-4f77-a05e-235fba27145e
Strongc/sheshouyingyin
src/filters/renderer/MpcAudioRenderer/SoundTouch/source/sse_optimized.cpp
#include "cpu_detect.h" #include "STTypes.h" using namespace soundtouch; #ifdef ALLOW_SSE // SSE routines available only with float sample type ////////////////////////////////////////////////////////////////////////////// // // implementation of SSE optimized functions of class 'TDStretchSSE' // //////////////...
TOOL
0.948363
6.189564
c16f2fc9-0a6a-4a49-80b5-d340822a08a5
ishandutta2007/codeforces
agua_podrida/normal/1326/D2.cpp
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<vvi> vvvi; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef vector<vvll> vvvll; typedef vector<char> vc; typedef vector<vc> vvc; typedef vector<vvc> vvvc; typedef vector<double> ...
ALGO
0.999777
4.168353
e9c1e6c6-f62c-4396-a66f-6ab148045107
ishandutta2007/codeforces
geothermal/normal/1367/D.cpp
#pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef complex<ld> cd; typedef pair<int, int> pi; typedef pair<ll,ll> pl; typedef pair<ld,ld> pd; typedef vector<int> vi; typedef vector<ld> vd; typedef vector<l...
ALGO
0.999846
4.569456
99cfe43b-0607-4b74-8efa-b4c7300e4be8
akira4O4/Opencv-100-Questions
A41.cpp
#include <iostream> #include <stdio.h> #include <opencv2/opencv.hpp> #include "A_41_50.h" #include <math.h> #include <time.h> using namespace cv; float Clip(float value, float min, float max) { return fmin(fmax(value, 0), 255); } //ͼҶȻ Mat ImgGray(Mat img) { int imgHeight = img.rows; int imgWidth = img.cols; i...
ALGO
0.976513
4.597047
72a084c9-1527-4e5a-b3e2-df2ff95c9c24
ishandutta2007/codeforces
bigbag/normal/1148/A.cpp
#include <bits/stdc++.h> using namespace std; long long a, b, c; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); cin >> a >> b >> c; long long ans = 2 * c; if (a == b) { ans += a + b; } else { ans += 2 * min(a, b) + 1; } cout << a...
ALGO
0.999659
3.906085
311e1b6d-b7a7-4993-9042-b882477451fd
JaideepYadav/LeetCode-Question
153-find-minimum-in-rotated-sorted-array/find-minimum-in-rotated-sorted-array.cpp
class Solution { public: int findMin(vector<int>& nums) { int n=nums.size(); int ans=0; if(nums.size() <= 1) return nums[0]; for(int i=0;i<n-1;i++){ if(nums[i]>nums[i+1]){ ans=nums[i+1]; break; }else{ ans = nums[0]; ...
ALGO
0.99997
5.684781
54bcb95c-7934-4203-b89a-08c24174cc9e
eastgerm/eastgerm-algo
BOJ/Math/3009. 네 번째 점.cpp
// // Created by kimdong on 2019-05-25. // #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { ios::sync_with_stdio(false), cin.tie(NULL); vector<int> xs,ys; int x,y; int xSum = 0, ySum = 0; for(int i=0; i<3; i++) cin >> x >> y, xs.push_back(x), ys.push_bac...
ALGO
0.999938
4.144324
138896da-cd29-4bd1-aa97-345a851173af
natanielruiz/caffe-rebase-rcnn
src/caffe/layers/argmax_layer.cpp
#include <algorithm> #include <functional> #include <utility> #include <vector> #include "caffe/layers/argmax_layer.hpp" namespace caffe { template <typename Dtype> void ArgMaxLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { const ArgMaxParameter& argmax_param =...
DATA
0.942553
6.650991
7c86a801-8eab-4d75-a2d8-16b472cf1231
bmx-ng/b3d.mod
newtondynamics.mod/NewtonDynamics/source/physics/dgCorkscrewConstraint.cpp
#include "dgPhysicsStdafx.h" #include "dgBody.h" #include "dgWorld.h" #include "dgCorkscrewConstraint.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// dgCorkscrewConstraint::dgCorkscrewConstrain...
TOOL
0.944481
5.797915
7b558c66-f2a6-45ba-a35a-cd172fb4cfaa
SumitRaikwar18/Hacktoberfest
c++ problems asked in interview/145. Binary Tree Postorder Traversal.cpp
Given the root of a binary tree, return the postorder traversal of its nodes' values. Example 1: Input: root = [1,null,2,3] Output: [3,2,1] Example 2: Input: root = [] Output: [] Example 3: Input: root = [1] Output: [1] Example 4: Input: root = [1,2] Output: [2,1] Example 5: Input: root = [1,null,2] Output: [2,1]...
ALGO
0.999994
6.029181
c27f12d4-5b51-4db6-97e3-2cfee9932940
benjaminhuanghuang/ben-leetcode
0539_Minimum_Time_Difference/solution.cpp
/* 539. Minimum Time Difference https://leetcode.com/problems/minimum-time-difference/ */ #include <string> #include <vector> #include <set> using namespace std; /* https://zxi.mytechroad.com/blog/string/leetcode-539-minimum-time-difference/ Time complexity: O(nlog1440) Space complexity: O(n) */ class Solution { pub...
ALGO
0.999905
6.628563
3e289615-7ff1-4d91-a212-3fa0bf04964d
vaca22/FFTjni
jnifft/src/main/cpp/kiss_fftr.cpp
#include "kiss_fftr.h" #include "_kiss_fft_guts.h" struct kiss_fftr_state{ kiss_fft_cfg substate; kiss_fft_cpx * tmpbuf; kiss_fft_cpx * super_twiddles; }; kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem) { int i; kiss_fftr_cfg st = nullptr; size_t subsize, mem...
ALGO
0.999741
6.10323
3cc85884-08b5-4e57-86a8-90893af26636
Sambodhi-Roy/cses-problem-set
sorting_and_searching/Subarray_Sums_II.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long inline int power(int a, int b) { int x = 1; while (b) { if (b & 1) x *= a; a *= a; b >>= 1; } return x; } const int N = 200005; void solve() { int n, x; cin >> n >> x; vector<int> a...
ALGO
0.999869
4.58288
60ee1db9-31b9-4f14-a810-e411e0d10e41
kks227/BOJ
2300/2381.cpp
#include <cstdio> #include <algorithm> using namespace std; const int MAX = 1e9; int main(){ int N, P1 = -MAX, P2 = MAX, Q1 = -MAX, Q2 = MAX; scanf("%d", &N); for(int i=0; i<N; i++){ int x, y, P, Q; scanf("%d %d", &x, &y); P = x + y; Q = y - x; P1 = max(P1, P); P2 = min(P2, P); Q1 = max(Q1, Q); Q2 = min...
ALGO
0.999804
4.070566
9bc4fc85-289f-41c7-aa28-07906e4c8fee
yzharko/spbspu-labs-2024-aads
khoroshkin.maksim/S1/main.cpp
#include <iostream> #include <string> #include <memory> #include <limits> #include "list.hpp" #include "funcs.hpp" int main() { using namespace khoroshkin; List< std::pair< std::string, List< unsigned long long > > > allPairs; std::string input; size_t count = 0; size_t maxLength = 0; while (std::cin >> in...
ALGO
0.95386
4.423021
8abfd5ec-d54a-43d9-95bc-124aac34908c
pascal-the-elf/TIOJ-ASE
solutions/#01199_神奇的模術.cpp
#include <bits/stdc++.h> #define Hina ios_base::sync_with_stdio(0),cin.tie(0) #define int long long using namespace std; int a, n, y; int cnt; int pw(int a, int k) { int cnt = 1, mul = 1; for (; cnt <= k; cnt <<= 1) { if (cnt & k) mul = (mul * a) % y; a = (a * a) % y; } return mul; } signed main() { Hina; ...
ALGO
0.999805
3.909129
893ca51c-009c-44ae-a0d7-57da2bb5e4c6
Neem-Sheth/Academic-Codebase
OOP_Codes/Labs/Lab-12/2.cpp
#include <iostream> #include <string> #include <sstream> #include <iomanip> #include <vector> using namespace std; int main() { cout << "Enter text (press Ctrl + Z to exit typing):" << endl; stringstream inputTextStream; inputTextStream << cin.rdbuf(); string inputText = inputTextStream.str(); is...
TOOL
0.908894
3.722465
56eb1cef-dc89-401a-9f2d-4e6d7cac83df
directpi/MyProjects
CPP_Yandex_algorithms_4.0/2/C/z_func.cpp
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; void z_function(string str) { int n = (int)str.length(); vector<int> z(n); for (int i = 1, l = 0, r = 0; i < n; ++i) { if (i <= r) z[i] = min(r - i + 1, z[i - l]); while (i + z[i] < n && str[z...
ALGO
0.999582
5.035437
df8b69a6-7672-4588-97b4-dd55a11f4fb3
NikhilTheNoob/SoC25
week2/w2_q1.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define FOR(i,a,b) for(int i=a; i<=b; i++) #define REP(p) for(int j=0; j<=p-1;j++) int main() { ios::sync_with_stdio(0); cin.tie(0); ll k; cin >> k; set<int> s; int arr[k]; for(int i=0;i<k;i++){ cin >> arr[i]; } ll l=0,r=0, max=0; s.insert(arr[0])...
ALGO
0.999808
3.699159
cb1f5207-cd18-4418-98ba-5a611602a87d
rochawennis/c
dobroparimparfuncao.cpp
#include <stdio.h> int n1, n; int ENTRADA () { printf("Digite o primeiro valor: "); scanf("%d", &n1); } void DOBRO() { n = n1 * 2; printf ("\nDobro: %d", n); } int PARIDADE() { if (n1 % 2 == 0) { return(1); } else { return (0); } } int main (void) { ENTRADA (); DOBRO (); n1 = PARIDADE(); if (n1 == 1)...
ALGO
0.998731
3.980268
8f1046db-d66f-45c2-9def-929755ec1442
ishandutta2007/codeforces
magga/normal/1342/B.cpp
#include<bits/stdc++.h> using namespace std; void pre(){} void solve(){ string s; cin>>s; int n = s.size(); bool flag = false; for(int i=0;i<n-1;i++){ if(s[i]!=s[i+1]){ flag=true; break; } } if(!flag){ cout<<s<<"\n"; return; } f...
ALGO
0.999837
3.227188
6283655b-a74e-45a9-8634-bb4b889921f8
core-code/Core3D
_DEPENDENCIES/sources/bullet/Demos/CellSpuDemo/BasicDemo2.cpp
//#define USE_GROUND_BOX 1 #define PRINT_CONTACT_STATISTICS 1 #define USE_PARALLEL_DISPATCHER 1 //#define USE_SIMPLE_DYNAMICS_WORLD 1 int gNumObjects = 5; #define HALF_EXTENTS btScalar(1.) #include "btBulletDynamicsCommon.h" #include "BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h" #include "LinearMath/bt...
ALGO
0.936269
5.395537
b6cad7c2-c723-45c0-a4bf-2c6c36ae4831
JenilGajjar20/Competitive-Programming_problems
Cpp/1903-largest-odd-number-in-string/solution.cpp
class Solution { public: string largestOddNumber(string num) { // Get the size of the string int n = num.size(); // Loop backwards through the string for(int i = n; i >= 0; i--){ // Get the char number value of the character at position i int last = num[i]; ...
ALGO
0.999895
6.523984
3a3358d4-9114-49d2-9740-7e4703ff3dc8
zannie-hg/Data-Structure-and-Algorithms-codelearn-
Array data structure/8.cpp
#include <bits/stdc++.h> using namespace std; int a[100001]; int main() { int n; cin >> n; for (int i = 0; i < n; i++){ cin >> a[i]; } bool kt1 = true; // kiểm tra dãy tăng. bool kt2 = true; // kiểm tra dãy giảm. for (int i = 1; i < n; i++){ if (a[i] <= a[i-1]) kt1 = false;...
ALGO
0.999998
4.772002
f22d7b8b-bd65-4adb-b70f-94cb0480bd38
anuragbansals/Cpp-Programs
DAA/jumpSearch.cpp
#include <iostream> #include<algorithm> #include<math.h> using namespace std; int jumpSearch(int arr[], int x, int n) { int compa=1,step = sqrt(n),prev = 0; while (arr[min(step, n)-1] < x) { compa++; prev = step; step += sqrt(n); if (prev >= n) return -compa; }...
ALGO
0.999072
3.743597
4e20c69e-17a3-4f2d-98db-135cfe8b8ffc
AlexChr2/StringGenerator
Process.cpp
// Necessary imports #include <iostream> #include "Random.h" #include "Process.h" /* * Generates a random String, based on * the given Grammar rules. */ void Process::MgenerateString( std::list<Symbols> &list ) { list.push_front( Symbols::Z ); std::list<Symbols>::iterator genListIterator { list.begin() }; cons...
ALGO
0.979652
4.76977
702750f1-1052-448c-9739-034bb97bb0e3
alvinzhaowei/VD-STAR
boost_1_66_0/libs/multi_index/example/composite_keys.cpp
#if !defined(NDEBUG) #define BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING #define BOOST_MULTI_INDEX_ENABLE_SAFE_MODE #endif #include <boost/call_traits.hpp> #include <boost/multi_index_container.hpp> #include <boost/multi_index/composite_key.hpp> #include <boost/multi_index/member.hpp> #include <boost/multi_index/order...
TOOL
0.927906
6.667601
263c057c-96c1-4a78-82c7-56066f991968
gorj97/antiplagiat-for-source-code
datasets/С/Дейкстра и флойд-беллман/9.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <fstream> #include <vector> #include <time.h> #include <iomanip> #define INF 100000000 using namespace std; // class G class GraphClass { // public public: bool minus = false; //флаг отрицательного ребра long **G; unsigned long size; //function func...
ALGO
0.998857
3.650095
53103775-4030-41b3-88ab-062198286c7c
haru210/atcoder
ABC309/B.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const int inf = 2147483647; const long long l_inf = 9223372036854775807; char a[100][100] = {0}; char b[100][100] = {0}; int main() { int n; cin >> n; rep(i, n) rep(j,n) cin >> a[i][j];...
ALGO
0.999993
3.243868
41ad76d8-8bf3-4980-b1d6-5cc0535fab97
sDaman830/Codeforces_solution
1303/855div3/c.cpp
#include <bits/stdc++.h> #include <iostream> using namespace std; #define int long long #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define _sort(x) sort(all(x)) #define _rsort(x) sort(rall(x)) #define REP(i, a, b) for (int i = a; i <= b; i++) #define loop(i, N) for (int i = 0; i < N; i++) #d...
ALGO
0.99987
5.534761
45b78208-6cd6-477d-840f-4961c2ac1253
raypretam/SPOJ_Solutions
addrev.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long long int int64; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef pair<ll,int> pli; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<pii> vpii; typedef vector<pll> vpll; #define F first #define S second typedef vector...
ALGO
0.999921
4.432909
e6ab1442-bc30-45f8-b5ee-5da9e8f93c84
AleksandrPanov/parallel-programming
task1/task1/Source.cpp
#include <mpi.h> #include<iostream> #include <random> #include <ctime> #include <cmath> #define tag 1 double const pi = 3.14159265358979323846; using std::cin; using std::cout; inline int getDelta(int numPoint, int size, int rank) { int delta = (numPoint % size) - rank; return delta > 0; } inline double fx(double x)...
ALGO
0.999895
4.036222
e3595b2d-d7d1-4405-a7d3-11157b557a69
prashi23/Algorithms
searching.cpp
#include <iostream> #include <cmath> using namespace std; void display(int *ar,int n){ for(int i=0;i<n;i++) cout<<ar[i]<<" "; } //O(log N) int bin_search(int *ar,int l,int n,int val){ if(l<=n){ int mid= l +(n-l)/2; if(ar[mid]==val) return mid; else if(ar[mid]>val) ...
ALGO
0.999993
4.341335
a68b6291-0947-4f91-82ac-7b346b1c28c7
HimanshiNayak/GFG-Solutions
Difficulty: Easy/Square Root/square-root.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // Function to find square root // x: element to find square root class Solution { public: int floorSqrt(int n) { int l =0; int h =n ; int ans =-1; while(l<=h){ int mid = l + (h-l)/2; if( m...
ALGO
0.99994
5.808739
77e25346-4b77-4e9e-95b4-f95873d1536b
hirakuuuu/kyopro
library/math/素数/エラトステネス.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for(int i = a; i < n; i++) #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> const int MOD = 1000000007; const int mod = 998244353; // 0ならば素数, 0でないなら最小の素因数 const int MAX_N = 1000005; vector<int> min_prime(MAX_N+1); void eratosthe...
ALGO
0.999119
3.779192
df15183f-2b27-4374-b132-0be1ff8f9d35
janpipek/advent-of-code-2020
advent_of_code/day16.cpp
#include <iostream> #include <map> #include <numeric> #include <string> #include <algorithm> #include "aoc/task.hh" using namespace std; struct Range { int low; int high; bool matches(int number) const { return (number >= low) && (number <= high); } }; struct RangeChoice { Range first; ...
ALGO
0.995264
6.519601
9f99e63d-15cd-4ce9-a24e-c75b7c800f1f
Chayan9991/flutter_spotify_clone
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
642148ed-f4fc-4136-b951-ebcad2b47196
ishandutta2007/codeforces
axiomofchoice/normal/1455/D.cpp
//#pragma GCC optimize(3) #include <bits/stdc++.h> using namespace std; #define repeat(i,a,b) for(int i=(a),_=(b);i<_;i++) #define repeat_back(i,a,b) for(int i=(b)-1,_=(a);i>=_;i--) #define mst(a,x) memset(a,x,sizeof(a)) #define fi first #define se second mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoc...
ALGO
0.999928
4.106746
878a230e-b755-450a-85f1-c95e0087a48a
x-tools-author/siyiqgroundcontrol
libs/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; using namespace Eigen; int main() { ArrayXXf a(2,2); a << 1,2, 3,4; cout << "(a > 0).all() = " << (a > 0).all() << endl; cout << "(a > 0).any() = " << (a > 0).any() << endl; cout << "(a > 0).count() = " << (a > 0).count() << endl...
ALGO
0.963544
3.835741
7ba537e2-b824-44d5-99e7-9f41b47def3a
shaileshKumar55/GFG-Problems
Union of Two Linked Lists.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; struct Node { int data; struct Node* next; Node(int x){ data = x; next = NULL; } }; // } Driver Code Ends /* // structure of the node is as follows struct Node { int data; struct Node* next; Node(int x){ data = x; n...
ALGO
0.999917
4.616819
12eec988-273b-4f2c-9b4e-bce8cecc49ba
Puneetbisarwal/DTU-Coding-Practice-Questions
Practice New/pireplace.cpp
#include<bits/stdc++.h> using namespace std; void revdup(char *s,int start) { if(start>=strlen(s)-1) { return ; } revdup(s,start+1); if(s[start]==s[start+1] ) { int e=strlen(s); s[e+1]='\0'; for(int i=e-1;i>=start+1;i--) { s[i+1]=s[i]; } s[start+1]='*'; } } int main() { char s[100]; cin>>...
ALGO
0.999983
3.450391
6295865f-101a-424c-ab77-2933865a55bc
sarvex/leetcode-cpp
solution/1400-1499/1429.First Unique Number/Solution.cpp
class FirstUnique { public: FirstUnique(vector<int>& nums) { for (int& v : nums) { ++cnt[v]; q.push_back(v); } } int showFirstUnique() { while (q.size() && cnt[q.front()] != 1) q.pop_front(); return q.size() ? q.front() : -1; } void add(int v...
ALGO
0.999789
6.526232
d2ebc17f-42ee-4f68-8114-bf18ce11dae7
A01798012/Problems
Cemcontst/B.cpp
#include <bits/stdc++.h> using namespace std; int main(){ cin.tie(0); ios_base::sync_with_stdio(0); int t; cin >> t; int n,a,b; string alpha = "abcdefghijklmnopqrstuvwxyz"; while(t--){ cin >> n >> a >> b; int cont = 0; for(int i = 0; i < n;i++){ cout << alpha[cont%b]; cont++; } ...
ALGO
0.99975
3.820883
8f81a863-4827-48b9-a8e1-a8549ab438c1
neoml-lib/neoml
NeoMathEngine/src/CPU/mlas/lib/transpose.cpp
#include "mlasi.h" #if defined(MLAS_SSE2_INTRINSICS) MLAS_FORCEINLINE void MlasTranspose4x4Block( const uint32_t* Input, size_t InputStride, uint32_t* Output, size_t OutputStride ) { __m128i a0 = _mm_loadu_si128((const __m128i*)&Input[InputStride * 0]); __m128i a1 = _mm_loadu_si128((const ...
ALGO
0.984301
5.699403
41f77599-ba4b-4a05-af6b-4affb2354449
ashutosh-singh83/DSA
Hashmap/hashmap7.cpp
//T.c=O(N),N=sum of s1 and s2 #include<iostream> #include<unordered_map> using namespace std; bool isAnagram(string s1,string s2){ if(s1.length()!=s2.length()){ return false; } unordered_map<char,int> m; for(char c1:s1){ m[c1]++; } for(char c2:s2){ if(m.find(c2)==m.end())...
ALGO
0.999994
4.559587
237eea28-270d-4b8d-89eb-32143ba57c7b
srbcheema1/Algo_Ds
Mathematical Challenges/C:C++/gcd/gcd.cpp
#include<stdio.h> /* * be careful a must not be zero * if so then ans is b */ int gcd(int a,int b){ if(b%a==0) return a; return gcd(b%a,a); } int main() { int t=1,a,b,ans; scanf("%d",&t); while(t--) { scanf("%d %d",&a,&b); if(a==0)//gcd throw exception on a = 0 ans = b; else a...
ALGO
0.999769
3.94389
9481280f-5412-4e44-b86c-f7fbd3d8093a
CrimsonTheLegoBuilder/MyBaekjoonSolve
Cpp/boj_solve/boj12865_knapsack.cpp
#include <iostream> #include <algorithm> int N, K, W, V, DP[100'001]; int main() { std::cin.tie(0)->sync_with_stdio(0); std::cout.tie(0); std::cin >> N >> K; for (int i = 0; i < N; i++) { std::cin >> W >> V; for (int l = K; l >= W; l--) { DP[l] = std::max(DP[l - W] + V, DP[l]); } } std::cout << DP[K] <<...
ALGO
0.999938
4.115323
e90951ea-608f-43bd-8c7d-8ce00972ec87
yongkangSun/Games101
homework/1/code/eigen/eigen3/doc/examples/TutorialLinAlgComputeTwice.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix2f A, b; LLT<Matrix2f> llt; A << 2, -1, -1, 3; b << 1, 2, 3, 1; cout << "Here is the matrix A:\n" << A << endl; cout << "Here is the right hand side b:\n" << b << endl; cout << "Computing LLT...
ALGO
0.999922
3.137396
8cd2e131-755d-4758-8c6d-dfcf57e45b4b
Mahendra5495/Cpp-Learnings
02_Pointers/04_str-2.cpp
// Implement a function to find the length of a null-terminated string using // pointers. #include <bits/stdc++.h> using namespace std; int length(char s[]) { int x = 0; char c = ' '; while (c != '\0') { c = s[x]; x++; } return x - 1; } int main() { char name[] = "Mahendra Bh...
TOOL
0.997837
4.927544
30d09d5c-86b1-4785-a258-915f395215d2
PRANAVJARANDE/Leetcode-Solutions
medium/Longest Subarray with Majority Greater than K.cpp
class Solution { public: int longestSubarray(vector<int> &a, int k) { int n=a.size(); int s=0; int ans=0; map<int,int>m; for(int i=0;i<n;i++) { if(a[i]>k)s++; else s--; if(s>0)ans=max(ans,i+1); else if(m.find(s...
ALGO
0.999938
5.284773
61f0251b-cc02-45a1-9dba-1cdfb4dc596d
SJMA11723/Problem-solving
codeforces/Codeforces Round 445 (Div. 2, based on Technocup 2018 Elimination Round 3)/C.cpp
/** * Author: Jorge Raul Tzab Lopez * Github: https://github.com/SJMA11723 */ #include <bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; map<int, int> cnt; cnt[0]++; for(int i = 1; i <= n; ++i){ int x; cin >> x...
ALGO
0.999921
3.819751
43692874-9d3d-4f31-8931-260ef4a20bed
drunkwater/leetcode
hard/cpp/c0003_25_reverse-nodes-in-k-group/00_leetcode_0003.cpp
// DRUNKWATER TEMPLATE(add description and prototypes) // Question Title and Description on leetcode.com // Function Declaration and Function Prototypes on leetcode.com //25. Reverse Nodes in k-Group //Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. //k is a positive in...
ALGO
0.999947
5.130301
82e1650b-3847-4c56-8247-b0908bbc6abe
MMeowJiang/Zero-judge
a263 日期差幾天.cpp
#include <iostream> #include <cmath> using namespace std; int months[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; bool leap(int y) { return ( y % 4 == 0 && y % 100 != 0) || y % 400 == 0; } int ds( int y, int m, ...
ALGO
0.999864
4.424332
83565a1e-e7b1-4b78-9fea-9dd8f0d1b37c
taruarora/CrackYourInternship
206-reverse-linked-list/206-reverse-linked-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* reverseList...
ALGO
0.999729
5.460375
33b8e736-6d7e-457e-b463-6465f7a61847
chenzeyuczy/Sicily
2403.cpp
#include<iostream> #include<cstring> using namespace std; int main() { int a,b,c,s,t,i; char v[70]; while(cin>>v){ if(v[0]=='#')break; s=strlen(v); a=0;b=0;c=0;t=0; for(i=0;i<s;i++){ if(v[i]=='Y')a++; else if(v[i]=='N')b++; else if(v[i]=='A...
ALGO
0.999605
3.525101
d40c676a-ff83-4d59-8629-52c020343acd
Tasneem205/ICPC-Assuit-Sheets-Solution
juniors1/practice/practice#2/R. Histogram.cpp
#include <iostream> #include <vector> #include <set> #include <bits/stdc++.h> #include <string> #include <algorithm> #include <map> #include <iomanip> typedef unsigned long long ull; typedef long long ll; typedef long double ld; using namespace std; int main() { std::ios_base::sync_with_stdio(false); cin.tie(...
ALGO
0.99995
4.939167
4546f16a-33c1-4800-b22e-38d9ad63e370
harshit283/coding_blocks_launchpad
coding blocks lectures and programs/unordered_set_linear_probing.cpp
#include<iostream> #include<vector> #include<list> #include<queue> #include<algorithm> #include<iterator> using namespace std; template<typename t> class unordered_set_linear_probing { vector<t> table; unsigned int count; public: unordered_set_linear_probing(unsigned int size=10):count(0),table(size,-1){} ...
ALGO
0.999354
4.086185
04e5636c-26ad-4e53-9d86-8174609e80ab
Noborita9/Dividimos-y-no-Conquistamos
src/Graph/konig.cpp
vec<int> cover[2]; // if cover[i][j] = 1 -> node i, j is part of cover int konig() { cover[0].assign(L_S,true); // L_S left size cover[1].assign(R_S,false); // R_S right size int size = hopkarp(); // alternativamente, tambien funciona con Kuhn auto dfs = [&](auto&& me, int u) -> void { cover[0]...
ALGO
0.999204
4.009652
9ae5920d-845d-4732-91b4-512d0591f79b
tanghongxiang/Libs
android-ndk-r14b/sources/cxx-stl/llvm-libc++/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp
// <algorithm> // template<class T> // pair<T, T> // minmax(initializer_list<T> t); #include <algorithm> #include <cassert> int main() { #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS assert((std::minmax({1, 2, 3}) == std::pair<int, int>(1, 3))); assert((std::minmax({1, 3, 2}) == std::pair<int, int>(1, ...
TEST
0.966828
6.039687
d9c26753-40e9-45db-8819-08c257213407
jenkinnk/Mutation_Testing_Application
output/mutations/386/lucas.cpp
/* Joshua Breeden Section #1003 Assignment #8 * The following program is designed to read pairs of integers from a file using * Linux redirection. All of the integers in the file will be >= 1. The first number * in each pair (n1) will be >= the second number (n2). * For each pair of numbers the program will: * c...
ALGO
0.981687
6.090867
4365e47d-31c4-48f5-9057-d734386bc83e
vijaykumar0710/Leetcode
3430-count-days-without-meetings/3430-count-days-without-meetings.cpp
class Solution { public: int countDays(int days, vector<vector<int>>& meetings) { int n = meetings.size(); if(n == 0) return days; sort(meetings.begin(), meetings.end()); // Step 2: Count total meeting days (including overlaps) long long totalDays = 0; for(auto &meet...
ALGO
0.999988
6.073396
8259b584-eb2b-41c4-ba6c-d3fc855d91b5
slender789/icpc
cp4/marco/3.5/LIS.cpp
#include <algorithm> #include <cstdio> #include <stack> #include <iostream> using namespace std; #define MAX_N 100000 void print_array(const char *s, int a[], int n) { for (int i = 0; i < n; ++i) { if (i) printf(", "); else printf("%s: [", s); printf("%d", a[i]); } printf("]\n"); } void reconstruct...
ALGO
0.99999
4.416748
ca02a6ac-950c-49fa-b77a-0c1e81c50326
tom3q/openfimg
libsgl/eglAndroid.cpp
#ifdef HAVE_CONFIG_H # include <config.h> #endif #include <assert.h> #include <errno.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <sys/types.h> #include <EGL/egl.h> #include <EGL/eglext.h> #include "eglComm...
TOOL
0.887928
6.18013
617693ea-fec1-4f75-9d5f-c7469f0909d8
lurenjia399/games101homework
games101homework/eigen-3.4.0/bench/eig33.cpp
#include <iostream> #include <Eigen/Core> #include <Eigen/Eigenvalues> #include <Eigen/Geometry> #include <bench/BenchTimer.h> using namespace Eigen; using namespace std; template<typename Matrix, typename Roots> inline void computeRoots(const Matrix& m, Roots& roots) { typedef typename Matrix::Scalar Scalar; con...
ALGO
0.9994
5.666831
0afee399-5429-4bc6-a36b-84565f3c0c43
Empty0Qc/New-Empty
题目练习/牛客/牛客/构建乘积数组.cpp
////https://www.nowcoder.com/questionTerminal/94a4d381a68b47b7a8bed86f2975db46 //#include<iostream> //#include<vector> //using namespace std; //// ////class Solution { ////public: // vector<int> multiply(const vector<int>& A) // { // int n = A.size(); // vector<int> b(n); // int ret = 1; // // // for (int i = 0; ...
ALGO
0.999941
4.009561
08ff9039-dc9b-49e9-841b-9f8f015087e4
413085646/15445
third_party/murmur3/MurmurHash3.cpp
// This source file was originally from: // https://github.com/PeterScott/murmur3 // // We've changed it for use with VoltDB: // - We changed the top-level functions defined below to return // their hash by value, rather than accept a pointer to storage // for the result // Note - The x86 and x64 versions ...
ALGO
0.984485
7.048966
7a282535-758e-498c-8cc5-4277207dd812
denniswandering/sichen_data_structure
mySort.cpp
#include "mySort.hpp" namespace sichen{ template <typename Dtype> void MySort<Dtype>::swap(Dtype *data, int i, int j) { Dtype tmp = data[i]; data[i] = data[j]; data[j] = tmp; } template <typename Dtype> bool MySort<Dtype>::compare(Dtype a, Dtype b) { return a < b; } template <typename Dtype> void My...
ALGO
0.998723
4.580798
a1fb1dbd-31a6-4fa6-9257-3e656ed2acc1
WarpspeedSCP/godot
thirdparty/bullet/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
#include "btPersistentManifold.h" #include "LinearMath/btTransform.h" #include "LinearMath/btSerializer.h" #ifdef BT_USE_DOUBLE_PRECISION #define btCollisionObjectData btCollisionObjectDoubleData #else #define btCollisionObjectData btCollisionObjectFloatData #endif btScalar gContactBreakingThreshold = btScalar(0.02);...
ALGO
0.947019
5.011851
4e89e77c-3e8b-4410-a0ae-a3b8ea9b9aa6
ishandutta2007/codeforces
heno239/normal/808/G.cpp
#pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include<iostream> #include<string> #include<cstdio> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<bitset> #include<stack>...
ALGO
0.999966
4.290777
939d5ffb-0c46-429a-b291-843b42fe0def
rahatutzaman-rizon/data-structure-and-algorithom
Data Structures and Problem Solving Part-II/Week - 09 Heap and STL/Module_32 - Introduction to Heap/MaxHeap_Operations.cpp
#include<bits/stdc++.h> using namespace std; class MaxHeap{ public: vector<int>nodes; MaxHeap() { } //O (Log N) void up_heapify(int idx) { while(idx > 0 && nodes[idx] > nodes[(idx-1)/2]){ swap(nodes[idx], nodes[(idx-1)/2]); idx = (idx-1)/2; } } ...
ALGO
0.999681
4.113032
6b5fa189-4cca-4973-b057-5531d149bc0a
ishandutta2007/codeforces
rush_d_cat/normal/1286/A.cpp
#include <iostream> #include <cstring> #include <vector> using namespace std; typedef long long LL; const int N=200+10; int n,a[N],dp[N][N][2]; int main() { scanf("%d",&n); int x=(n+1)/2,y=n/2; for(int i=1;i<=n;i++){ scanf("%d",&a[i]); if(a[i]){ if(a[i]%2==1)--x; else...
ALGO
0.999978
3.525639
ed028191-11d4-45b2-b709-fcbe15efa189
Arjun3000/DSA_FUll_using_cpp
cpp/leetcode_problems/two_sum.cpp
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { int i,j; vector<int>ans; for(i=0;i<nums.size()-1;i++) { for(j=i+1;j<nums.size();j++) { if(nums[i]+nums[j]==target) { ans.push_back...
ALGO
0.999769
6.055604
dde49fff-e9ba-464e-9fbd-794dd8aecdb4
polyethylene/OJ-Note
1038_Josephus/O(N).cpp
#include <iostream> int main() { int size; std::cin >> size; int* times = new int[size - 1]; for (int i = 0; i<size - 1; i++) { std::cin >> times[i]; } int ret = 0; for (int i = 2; i <= size; i++) { std::cin >> times; ret = (ret + times[size - i]) % i; } std::cout << ret + 1; return 0; }
ALGO
0.999952
3.307351
d742657a-66ce-4bd2-9022-872fd51523f4
Horidas-Roy/Fundamental
XPSC/NewBie Zone/week - 8/contest/B_Room_Allocation.cpp
#include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while(t--){ int n; cin >> n; vector<int> v(n); for(int i=0; i<n; i++){ cin >> v[i]; } int mnRoom = 0; for(int i=0; i<n; i+...
ALGO
0.998917
4.357388
9129611c-ce19-4e2d-b541-07a6129ff7fc
mushfiq-906/cp__training
Codeforces__Problems/contest/88/b/52510773.cpp
/*Author : Abdallah Hemdan */ /**************************/ /* Dear online judge: * I've read the problem, and tried to solve it. * Even if you don't accept my solution, you should respect my effort. * I hope my code compiles and gets accepted. * ___ __ * |\ \|\ \ * \ \ \_\ \ * \ \ ___ \emdan * \ \ \\ \ \ *...
ALGO
0.999708
3.961857
b15ebb10-e3ed-429b-9077-cf0497e9e14d
lge88/OpenSees
SRC/reliability/analysis/telm/NewDiscretizedRandomProcessSeries.cpp
// $Revision: 1.4 $ // $Date: 2010-02-04 18:31:13 $ // $Source: /usr/local/cvs/OpenSees/SRC/reliability/analysis/telm/NewDiscretizedRandomProcessSeries.cpp,v $ #include <NewDiscretizedRandomProcessSeries.h> #include <Vector.h> #include <Channel.h> #include <ModulatingFunction.h> #include <Filter.h> #include <classTags...
ALGO
0.86897
5.535423
b6c64076-e9c2-46d5-b2a6-9ff2ddd189c3
ye-yo/Algorithm
그래프탐색/boj_1012.cpp
#include <iostream> #include <queue> using namespace std; int n, m, k, t; int arr[50][50] = {0,}; int visited[50][50] = {0,}; queue<pair<int,int>> q; int dx[4] = {-1, 0, 1, 0}; int dy[4] = {0, 1, 0, -1}; int bfs(int i, int j){ q.push({i,j}); while(!q.empty()){ pair<int,int> current = q.front(); ...
ALGO
0.999833
3.798519
16df011f-1711-4569-81e6-c16cc83ec27e
firmanhp/aoc2024
d6-guard-gallivant/p1_sol.cpp
#include <algorithm> #include <cassert> #include <chrono> #include <fstream> #include <iostream> #include <span> #include <sstream> #include <thread> namespace { template <typename T> struct Vector2D { public: Vector2D(int row, int col) : row_(row), col_(col), container(row * col) {} static Vector2D<T> unsized() ...
ALGO
0.999574
6.306831
389f1e6c-4f92-4933-b37a-280f3a379cc6
MostafaMohamed2001/C-Data-Structure
.history/hello_20240713110717.cpp
#include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std; int main(){ int arr[4] , repeated = 0; for(int i=0; i<4; i++) cin >> arr[i]; sort(arr, arr+4); // check if num repeated in arr bool repeated = false; for(int i=0; i<3; i++) ...
ALGO
0.99928
3.819251
5f626269-a184-4dbc-af43-3af1a221853d
AaronWu-train/onlinejudges
tioj/1745.cpp
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define endl '\n' #define AI(x) begin(x),end(x) #ifdef DEBUG #define debug(args...) LKJ("\033[1;32m[ "+string(#args)+" ]\033[0m", args) template<class I> void LKJ(I&&x){ cerr << x << '\n'; } template<c...
ALGO
0.999662
3.527285
39de7296-c7f1-40b6-8c5e-969bbe3445b5
Sidhupaji-2004/6Companies30Days2025
Google/FindInMountainArray.cpp
/** * // This is the MountainArray's API interface. * // You should not implement it, or speculate about its implementation * class MountainArray { * public: * int get(int index); * int length(); * }; */ class Solution { public: int findInMountainArray(int target, MountainArray &mountainArr) ...
ALGO
0.999989
6.219929
68a90732-8365-4d44-8baa-fdc3e1c73056
halloTheCoder/Algorithm
game theory/minimaxAlgorithmAIFindingOptimalMoveTicTAc/minimaxAlgorithmAIFindingOptimalMoveTicTAc/Board.cpp
#include "stdafx.h" #include "Board.h" #include <iostream> #include <algorithm> #include <climits> Board::Board(char b[][3],int row,int col) { move = false; won = 0; this->m = row; this->n = col; player = 'x'; oponent = 'o'; std::copy(b[0], b[0] + m*n, &this->board[0][0]); row = -1; col = -1; } bool Boa...
ALGO
0.963601
4.585086
c57133b4-e65b-4f87-b6c9-8e20b0a11bdf
GameArchitectureTeam2/monster_mash
third_party/libigl/include/igl/rotate_vectors.cpp
#include "rotate_vectors.h" IGL_INLINE Eigen::MatrixXd igl::rotate_vectors( const Eigen::MatrixXd& V, const Eigen::VectorXd& A, const Eigen::MatrixXd& B1, const Eigen::MatrixXd& B2) { Eigen::MatrixXd RV(V.rows(),V.cols()); for (unsigne...
ALGO
0.998767
7.497553
3a0710e4-c484-4178-80f7-88649709ffcd
ishandutta2007/codeforces
gullesnuffs/normal/1142/C.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = (a); i < int(b); ++i) #define rrep(i, a, b) for(int i = (a) - 1; i >= int(b); --i) #define trav(it, v) for(auto &it : (v)) #define all(v) (v).begin(), (v).end() #define what_is(x) cerr << #x << " is " << x << endl; #define sz(x) (int)(x).si...
ALGO
0.999879
4.638809
0aa3ff38-13bb-45d9-ac43-cdd8f3aba113
joseAntZam/INTELIGENCIA-ARTIFICIAL
practica2/jugador.cpp
#include "../Comportamientos_Jugador/jugador.hpp" #include "motorlib/util.h" #include <queue> #include <iostream> #include <cmath> #include <set> #include <stack> //FUNCIONES AUXILIARES //INICIO //************************************************************************************************************************...
ALGO
0.998788
3.115828
ef209de4-0f10-4cd4-8418-0eff200557d2
Rustam-Singh-Bhadouriya/Cpp-with-DSA
C++ With DSA/Chapters/Day5/p3.cpp
#include <iostream> using namespace std; bool isprime(int y){ if (y <= 1) { /* code */ return false; } for (int i = 2; i*i <= y; i++) { /* code */ if (y% i == 0) { /* code */ return false; } } return true;...
ALGO
0.999824
4.555336
921af157-0808-46eb-be3b-1d74f2d02e23
Husain0007/HackerBlocks
Today'sCodeByte/PythagoreanChallenge/p.cpp
#include <iostream> #include <cmath> using namespace std; void pythagorean(int c) { for (int a = 0; a * a <= c; a++) { for (int b = a; b * b <= c; b++) { if (a * a + b * b == c) { cout << "(" << a << "," << b << ") "; } } } c...
ALGO
0.999628
4.414905
3c42d670-30a3-42b6-a764-23fc1e8e3314
dheerajsingh89/DSA
GeeksForGeeks/Largest_square_formed_in_a_matrix.cpp
class Solution{ public: int solve(vector<vector<int>>&mat,int i,int j,int &ans,vector<vector<int>>&dp){ if(i>=mat.size() || j>=mat[0].size())return 0; if(dp[i][j]!=-1)return dp[i][j]; int right_solution=solve(mat,i,j+1,ans,dp); int diagonal_solution=solve(mat,i+1,j+1,ans,dp); ...
ALGO
0.999993
5.912085
a4f50e01-0fc2-492a-a793-ba6af1421dbe
zm2417/luogu-cpp
1560.cpp
#include <iostream> using namespace std; int n, b; int d[130][130]; int mask[130][130][4]; int ans; int dx[] = {-1, 1, 0, 0}; int dy[] = {0, 0, -1, 1}; void dfs(int x, int y, int p, int c); bool check(int x) { return x > 0 && x <= n; } void deal(int x, int y, int p, int c) { if (mask[x][y][p] == 0 && d[x + ...
ALGO
0.999652
4.018991
31f9188a-7167-4408-8e01-2f2cf8a45556
fpw/avitab
src/platform/Platform.cpp
#ifdef _WIN32 # define WIN32_LEAN_AND_MEAN # include <windows.h> # include <shellapi.h> #else # include <unistd.h> # include <uuid/uuid.h> #endif #include <locale> #include <codecvt> #include <ctime> #include <dirent.h> #include <sys/stat.h> #include <cstdlib> #include <climits> #include <libgen.h> #include ...
TOOL
0.919443
6.531099
f1a34635-cde0-4807-81b9-f62e50575e8c
codulluiandrei/pbinfo
pbinfo-1485/main.cpp
#include <bits/stdc++.h> using namespace std; ifstream in("jumatate1.in"); ofstream out("jumatate1.out"); #define cin in #define cout out long long int n, js = 0, jd = 0, nrcif = 0, mid; int main() { cin >> n; long long int copie = n; while (copie > 0) { nrcif++; copie = copie ...
ALGO
0.99989
4.13565
4d217e5e-870a-4533-a29b-bc0f15f04a6a
SohagMollik/LeetCode
1431-kids-with-the-greatest-number-of-candies/1431-kids-with-the-greatest-number-of-candies.cpp
class Solution { public: vector<bool> kidsWithCandies(vector<int>& candies, int extraCandies) { int mx=*max_element(candies.begin(),candies.end()); vector<bool>b; for(int i=0;i<candies.size();++i){ int total=candies[i]+ extraCandies; if(total>=mx)b.push_back(1); ...
ALGO
0.999954
5.9293
c27e9a03-2fcb-4a7a-a7c8-1e44684dd37a
Lydxn/Competitive-Programming
DMOJ/DMOPC/dmopc17c1p4.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll dp[2][5001][2]; int main() { cin.sync_with_stdio(0); cin.tie(0); int N, H, g, h, q, t; cin >> N >> H; for (int i = 0; i < N; i++) { cin >> g >> h >> q >> t; for (int j = 0; j <= H; j++) { dp[i & 1][j][0] = j - h >= 0 ? max(dp[(i & ...
ALGO
0.999808
3.982514
77e6967f-de16-44c9-bea9-f94a089ea750
Tejaganipisetty/LeetCode
0219-contains-duplicate-ii/0219-contains-duplicate-ii.cpp
class Solution { public: bool containsNearbyDuplicate(vector<int>& nums, int k) { unordered_map<int,int> um; for(int i=0;i<nums.size();i++) { int tar=nums[i]; if(um.find(tar)!=um.end()) { if(abs(um[tar]-i)<=k) return true; } ...
ALGO
0.999922
5.964155