uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
8b95d453-0dae-44ac-89b8-597c8d4cd2dc
Thairam/URI
Códigos - URI/2018/Mount Marathon - URI 2915.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n, c; vector<int> v; scanf("%d", &n); for(int i = 0; i < n; i++){ scanf("%d", &c); v.push_back(c); } for(int i = n - 1; i > 0; i--){ if(v[i - 1] >= v[i]){ v.erase(v.begin() + i); } } printf("%d\n", v.size()); return 0; }
ALGO
0.999805
4.146959
20bdce32-f0d5-48aa-99e1-05c81d78cbda
sapna833/DSA-Supremebatch
binary search/peak.cpp
#include<iostream> #include<vector> using namespace std; int findpeakindex(vector<int>arr){ int s=0; int e=arr.size()-1; int mid=s+(e-s)/2; while(s<e){ if(arr[mid]<arr[mid+1]){ s=mid+1; } else{ e=mid; } return mid; } return s; } in...
ALGO
0.999755
4.876308
7bbbf21a-6eb0-461d-850c-bdb8d81f970c
jakebeal/BioCompiler
grn-emitter/optimizers/DoubleNegativeEliminator.cpp
#include "config.h" #include "grn_optimizers.h" DoubleNegativeEliminator::DoubleNegativeEliminator(GRNEmitter* parent, Args* args) { verbosity = args->extract_switch("--double-negative-verbosity") ? args->pop_number() : parent->verbosity; } // one-one chemical relation returns producer CDS; else returns null. ...
ALGO
0.874899
6.215484
d397e3b7-4949-4535-8245-27f75e131682
RaulMurillo/ANNSIM_22
physic_probs/lorenz_ode/src/lorenz_ode.cpp
// https://people.math.sc.edu/Burkardt/cpp_src/lorenz_ode/lorenz_ode.html # include <cstdlib> # include <iostream> # include <fstream> # include <iomanip> # include <cmath> # include <ctime> #include <universal/number/posit/posit.hpp> #include <universal/number/cfloat/cfloat.hpp> using namespace std; using namespace ...
ALGO
0.997014
5.91495
8fcd717e-f061-4f10-8ada-8bd7f851a883
privateLLM001/Private-LLM-Inference
OpenCheetah/SCI/extern/eigen/doc/examples/QuickStart_example.cpp
#include <iostream> #include <Eigen/Dense> using Eigen::MatrixXd; int main() { MatrixXd m(2,2); m(0,0) = 3; m(1,0) = 2.5; m(0,1) = -1; m(1,1) = m(1,0) + m(0,1); std::cout << m << std::endl; }
ALGO
0.992458
3.474624
867e26d1-dfc9-4c95-9dfa-fdc874c07f12
blue-oil/blueoil
blueoil/converter/templates/src/func/conv2d.cpp
#include <cassert> #include <cstring> #include <memory> #include "global.h" #include "parameters.h" #include "func/conv2d.h" #include "matrix_view.h" #include "matrix/shift_add.h" #include "matrix/multiplication.h" #include "operators.h" // FIXME(nikolay): for convolution_parameters definition, rid of it later #inclu...
ALGO
0.949795
6.098262
642ad38a-310f-44bc-a1e0-ac75741edbf6
sinian666/codes_41_19
cpp_副本10/chapter_stack_and_queue/array_queue.cpp
/** * File: array_queue.cpp * Created Time: 2022-11-25 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 基于环形数组实现的队列 */ class ArrayQueue { private: int *nums; // 用于存储队列元素的数组 int front; // 队首指针,指向队首元素 int queSize; // 队列长度 int queCapacity; // 队列容量 public: Arra...
ALGO
0.994151
5.574481
913fb996-6e57-4ba5-a147-9af4ea1819be
nnnlog/codeforces
2020.08.05_Round_661/R661_B.cpp
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin >> T; while (T--) { long long n, minA = 1e9, minB = 1e9, ans = 0; cin >> n; vector<long long> a(n), b(n); for (int i = 0; i < n; i++) { cin >> a[i]; minA = min(minA, a[i]); } ...
ALGO
0.999989
3.884653
5916f384-6036-472c-92f6-835d813e174d
sudhanshu442/Hacktoberfest-2022-
ifelse.cpp
#include<iostream> using namespace std; int main(){ #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); #endif int saving; cin>>saving; if(saving>5000) { if(saving>10000){ cout<<"oyo\n";} else cout<<"chai\n"; } else if(saving>2000){ cout...
ALGO
0.981188
3.093125
811c3f0f-0e3f-4984-b6c7-0bf760812690
nazeer-18/Dsa-with-Cpp
codes/LCA.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int data; Node *left, *right; Node(int val){ data = val; left=NULL; right=NULL; } }; Node* LCA(Node* root,int n1,int n2){ if(!root) return NULL; if(root->data== n1 || root->da...
ALGO
0.999993
4.69254
04c508ed-ac81-4859-8294-6bfb9cfed993
Beisenbek/FallPP12021
week5/g2/8.cpp
#include <iostream> using namespace std; int main(){ string s; getline(cin, s); for(int i = s.size() - 1; i >=0; --i){ cout << s[i]; } return 0; }
ALGO
0.997798
3.8041
83232b28-b0c5-46f4-83b0-687162fda698
curiousguy13/advanced-prog
fft.cpp
//fast fourier transform /* 8 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 */ #include <bits/stdc++.h> #define MAX 1000 #define MOD 1000000007 #define INF 99999 #define for_each(i,x,n) for(i=x;i<n;++i) #define for_each_dec(i,x,n) for(i=n-1;i>=x;--i) typedef long long int LL; using namespace std; typedef pair<int,int> ii; typedef ...
ALGO
0.9987
3.277832
5ac99d09-7205-4daa-bddc-a647b4a915fd
CarlosDaniel111/competitive-programming
Codeforces/Div/Codeforces Round 888 (Div. 3)/C.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using pi = pair<int, int>; using vi = vector<int>; #define fi first #define se second #define pb push_back #define SZ(x) int((x).size()) #define ALL(x) begin(x), end(x) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define ROF(i, a, b) for (in...
ALGO
0.999976
4.87677
ba2577c2-e90c-4420-9f0f-5931837a69e6
Sambit57/LeetCode
C++/sum-of-two-integers.cpp
// Time: O(1) // Space: O(1) class Solution { public: int getSum(int a, int b) { while (b) { uint32_t carry = a & b; a ^= b; b = carry << 1; } return a; } };
ALGO
0.999758
6.191248
c2e91553-077c-48d3-9eee-217416bc407a
HammadBullah/Maze_game
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
15503986-bba4-439c-bb98-0e649e8ffb71
manasch/gp_notes
material/CS331/Unit_5/Day_56_57_16_04/8_space_ship.cpp
#include <iostream> using namespace std; struct Pair { Pair(int x, int y) : x(x), y(y) {} auto operator<=>(const Pair &) const = default; int x; int y; }; int main() { cout << ((10 <=> 10) == strong_ordering::equal) << "\n"; cout << ((10 <=> 20) == strong_ordering::less) << "\n"; // cout << ...
ALGO
0.996399
3.65825
3d8f72f9-f166-413b-a52a-2bddcde3c731
aryannnn17/DailyProblems_Leetcode
1368.cpp
// class Solution { // public: // vector<vector<int>> dir = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; // int m, n; // int dfs(int i, int j, vector<vector<int>>& grid, // vector<vector<bool>>& visited, int cost) { // if (i == m - 1 && j == n - 1) // return cost; // // ...
ALGO
0.999898
6.070981
8fc3cba0-7453-4cbe-91bd-0242ede6cc15
LucasGuima04/ATP1
Test_Study/upgradedCalculator.cpp
#include<stdio.h> //bibliotecas #include<stdlib.h> int main(){ //Defeinindo Variaveis int result,opcao = 0; int num1 = 0; int num2 = 0; char c; while (opcao != 9){ if (opcao == 0){ //input dos valores dos numeros printf("Numero 1: "); scanf("%d",&nu...
ALGO
0.940069
3.072747
d6d874e5-cb45-4ff3-8930-25aee2cea628
HANNN-YOLO/Switch
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.99874
6.767714
361db02a-b6c8-4220-b4de-dcad5374cada
NCMBMania/Flutter_Auth_Apple
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
e41fd2ac-2592-488d-b6d0-69872261c7fa
ekansh2403/ICPC-Assiut-Sheet-Solution
Sheet_2/K_Divisors.cpp
#include <bits/stdc++.h> using namespace std; using vi=vector<int>; using vvi=vector<vi>; using pi=pair<int,int>; using vpii=vector<pi>; #define pb push_back #define ll long long #define vec vector<long long> #define test int tc; cin>>tc; while(tc--) #define all(a) (a).begin(),(a).end() #define MOD 1000000007 #define ...
ALGO
0.99988
3.888955
60185cee-51a7-44b9-a0a0-5c333c0fe265
ayushpatel5475/LEETCODE-Daily-Problem-Solutions
2706. Buy Two Chocolates.cpp
//SORT INPUT ARRAY //SUBSTARCT THEM FROM MONEY AVAILABLE AND IF IT IS !<0 then Return money left else return MONEY Available class Solution { public: int buyChoco(vector<int>& prices, int money) { sort(prices.begin(), prices.end()); int cost = prices[0] + prices[1]; return money < cost ? mo...
ALGO
0.999727
5.37329
6d7492fa-a6e1-4bf9-a5e8-c0f9f6893108
jahidul17/Data_Structure_with_Programming_Hero
Module 2/vector_capasity.cpp
#include <bits/stdc++.h> using namespace std; int main(){ vector<int> v; //cout<<v.max_size()<<endl; // cout<<v.capacity()<<endl; // v.push_back(10); // cout<<v.capacity()<<endl; // v.push_back(20); // cout<<v.capacity()<<endl; // v.push_back(30); ...
TOOL
0.944293
3.631079
5abee4e4-a520-46a5-bf15-dafd0f9cd8c6
ahmedhany14/Hany-s_leetcode
2762-continuous-subarrays/2762-continuous-subarrays.cpp
class Solution { public: long long continuousSubarrays(vector<int>& nums) { int l = 0, r = 0; map<int,int> mp; long long answer = 0; while(r < nums.size()){ mp[nums[r]]++; int mn = mp.begin()-> first; int mx = mp.rbegin()-> first; ...
ALGO
0.999969
6.109796
65afd2f5-5b36-4322-ae4c-6345c840582b
Joslynn20/algorithm
단계별풀이/dac/BOJ_1629.cpp
#include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long A, B, mod; int answer; // a의 b 제곱 int solution(int a, int b){ if(b==0) return 1; if(b==1) return a % mod; long long temp = solution(a, b/2); if(b % 2 == 0) { // 짝수 승이라면 ...
ALGO
0.999975
5.000769
53a6f577-1959-4aca-b8d7-cc5dd5c1ad00
ansh04196/DSA-Daily
Indexes of Subarray Sum.cpp
class Solution { public: vector<int> subarraySum(vector<int> &arr, int target) { // code here int start = 0, end = 0; vector<int> result; int curr= 0; for(int i = 0 ; i < arr.size();i++) { curr += arr[i]; if(curr >= target) { ...
ALGO
0.999706
6.396551
27a99abf-e622-4794-bebf-54d66ae0ebab
YoramVanSpijk/Project2.4
Kataru/lib/opencv/sources/samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp
/** * @file HoughCircle_Demo.cpp * @brief Demo code for Hough Transform * @author OpenCV team */ #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include <iostream> using namespace std; using namespace cv; namespace { // windows and trackbars name const std:...
ALGO
0.927214
6.526987
d92e90b6-748a-4f9b-befd-37da60ad9dda
Voxelab-64/Aquila_X3
Marlin/src/gcode/calibrate/G34_M422.cpp
#include "../../inc/MarlinConfig.h" #if ENABLED(Z_STEPPER_AUTO_ALIGN) #include "../../feature/z_stepper_align.h" #include "../gcode.h" #include "../../module/planner.h" #include "../../module/stepper.h" #include "../../module/motion.h" #include "../../module/probe.h" #if HAS_MULTI_HOTEND #include "../../module/to...
TOOL
0.87964
6.188863
193049ff-51b4-4dde-a16b-9166a42aedfe
kmjp/procon
srm/771-810/803/MarriageAndTravelingChallenge.cpp
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<to;x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZERO(...
ALGO
0.999969
4.45781
89321499-ebe9-4ef7-966f-af818d1ac8dd
ishandutta2007/codeforces
lucaperju/normal/1051/C.cpp
#include <bits/stdc++.h> using namespace std; long long cmmdc(long long a,long long b) { long long r; while(b) { r=a%b; a=b; b=r; } return a; } long long lgput (long long cnt, long long mod,long long put) { long long r=1,p=put; if(cnt==0) return 1; else if...
ALGO
0.99999
3.739889
89ebba71-bc8e-4a8c-a0c6-b38810adf2a0
melaniejanellolivares/hw6
str-hash-test.cpp
#include "hash.h" #include <iostream> #include <cstdlib> #include <string> using namespace std; int main(int argc, char* argv[]) { if(argc < 2){ cout << "Please provide a string to hash" << endl; return 1; } // use debug r values so we get repeated results MyStringHash h1(true); ...
ALGO
0.899858
5.286095
4af17c09-27f4-4a21-9c69-3f404b517883
strange-tiger/Baekjoon_practice
JosephusProblem0/JosephusProblem0/JosephusProblem0.cpp
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <queue> int N, K; std::queue<int> people; int main() { scanf("%d %d", &N, &K); int i = 0; while (N--) { i++; people.push(i); } printf("<"); do { for (int i = 1; i < K; ++i) { people.push(people.front()); people.pop(); } printf("%...
ALGO
0.999965
3.447611
ac2ef801-66c2-400e-941a-638582532bfd
sjsimps/Robot-Kinematics-Compiler
symboliccpp/examples/lie1.cpp
// lie1.cpp #include <iostream> #include "symbolicc++.h" using namespace std; Symbolic Z(const Symbolic &V, const Symbolic &x, const Symbolic &P) { return V * df(P, x); } int main(void) { int n = 4; Symbolic Q("Q"), V("V"), x("x"), ep("ep"); Q = Q[x]; V = V[x]; Symbolic SD = ep * Z(V, x, Q); Symbolic RES = ...
ALGO
0.999646
3.313404
8408c2e7-4a0b-4254-a589-fff43b9fd7c7
DionysiosB/HackerRank
RussianPeasantExponentiation.cpp
#include <cstdio> #include <iostream> std::pair<int64_t, int64_t> complexMult(std::pair<int64_t, int64_t> a, std::pair<int64_t, int64_t> b, int64_t M){ int64_t re = (((a.first * b.first) % M) - ((a.second * b.second) % M)) % M; int64_t im = (((a.first * b.second) % M) + ((a.second * b.first) % M)) % M; ...
ALGO
0.999924
4.16221
c35d6f97-df74-472d-af67-10e29c3e01dc
cjxnew/Programming-Training
剑指offer(Sword for offer)/求1+2+3+...+n.cpp
// 求1+2+3+...+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)。 #include<vector> #include<iostream> using namespace std; // 这题我没做出来,看看别人的做法 // 方法1:利用短路原理,实现递归 // &&就是逻辑与,逻辑与有个短路特点,前面为假,后面不计算。 class Solution { public: int Sum_Solution(int n) { int ans = n; ans && (ans += Sum_Solution(n -...
ALGO
0.999872
3.695658
efb66267-264f-4894-b39a-316c31ab100d
act1lazi0N/cPlusPlusInThePass
Teaser/teaser 21.cpp
#include<bits/stdc++.h> using namespace std; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t; cin >> t; while(t--) { long long m, n; cin >> m >> n; if ((m % 2 =...
ALGO
0.999068
3.351575
e29e65b0-f755-416f-894b-0888809bc781
zeusees/HyperLabelImg
labelimg-src/ncnn-master/layer/x86/convolution_x86.cpp
#include "convolution_x86.h" namespace ncnn { #include "convolution_1x1.h" #include "convolution_3x3.h" #include "convolution_5x5.h" DEFINE_LAYER_CREATOR(Convolution_x86) int Convolution_x86::forwardDilation(const Mat& bottom_blob, Mat& top_blob, conv_func conv) const { int w = bottom_blob.w; int h = bottom...
ALGO
0.973116
6.028978
02a66dc7-2eab-4062-bf1f-8bf823383034
SAYAN-DEV-NATH/Phitron_Course
Basic Data Structures/W-2 Singly Linked List/M-6 Singly Linked List Operations/Input_linked_list.cpp
#include <bits/stdc++.h> using namespace std; class node { public: int data; node *next; node(int data) { this->data = data; this->next = NULL; } }; void InsertAtTail(node *&head, int data) { node *n = new node(data); if (head == NULL) { head = n; return; ...
ALGO
0.999231
4.935229
cf5cd9aa-1af9-45d1-816b-ad922ab37efb
yy-nm/LeetCode
vs-project/110. Balanced Binary Tree/110. Balanced Binary Tree.cpp
// 110. Balanced Binary Tree.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), righ...
ALGO
0.999839
6.735692
559628f2-583b-4b76-b0ca-ce349e829384
unzela/Problem-solving
Stack/12.Next smaller element.cpp
#include <iostream> #include <stack> #include <vector> using namespace std; vector<int> findNearestSmallerElement(const vector<int> &A) { int n = A.size(); vector<int> result(n, -1); stack<int> s; for (int i = 0; i < n; ++i) { // Pop elements from the stack while they are greater than the current // ...
ALGO
0.999998
6.37619
3d4a55df-1083-4ecf-b110-08a580f91c24
Deep-anjali101/LeetCode-Solutions
2163. Kth Distinct String in an Array/Solution.cpp
class Solution { public: string kthDistinct(vector<string>& arr, int k) { map<string,int>m; for(auto &a:arr){ ++m[a]; } for(auto &a: arr){ if(m[a]==1)--k; if(k==0) return a; } return ""; } };
ALGO
0.999954
5.858916
14d5b97d-10e7-41c3-90b4-645502ffad13
AlecVitoCeppetelliSpano/OpenSees
SRC/analysis/integrator/CentralDifferenceNoDamping.cpp
// $Revision$ // $Date$ // $URL$ // Written: fmk // Created: 11/98 // // Description: This file contains the implementation of the CentralDifferenceNoDamping // class. #include <CentralDifferenceNoDamping.h> #include <FE_Element.h> #include <FE_EleIter.h> #include <LinearSOE.h> #include <AnalysisModel.h> #include <...
ALGO
0.999676
6.339052
eda58984-befe-4ee9-a545-5d64be5e4a25
SrUnicornio/Primero-Ingenieria-Informatica
PC/MIPS/Practicas/P2/Untitled-1.cpp
#include<iostream> #include<cmath> int main(void) { std::cout << "\n\nAproximación a sen(x) (-1 <= x <= 1) con un error máximo, usando Taylor\n"; do { double x; do { std::cout << "\n\nIntroduzca el valor de x (-1 <= x <= 1): "; std::cin >> x; } while ( (x < -1) || (x > 1)); double error...
ALGO
0.999673
4.64415
0e246040-26f0-4c46-ab4e-fb55129ae894
isi-nlp/LSTM_PARSER
3rdparty/eigen-eigen-09a8e2186610/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; int main() { Eigen::MatrixXf mat(2,4); mat << 1, 2, 6, 9, 3, 1, 7, 2; std::cout << "Column's maximum: " << std::endl << mat.colwise().maxCoeff() << std::endl; }
ALGO
0.999775
3.779679
38147977-003d-462c-9aa1-cb270c37400f
gratus907/Gratus_PS
Contests/ICPC/Regionals/[AP] Asia Pacific/Korea/2017 Daejeon Regional/L_Vacation Plans.cpp
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC optimine("O3") using namespace std; #define int ll #define ll long long typedef pair<int, int> pii; int dp[4][55][2]; int airport[4]; int p; vector <pii> graph[4][55]; //source, dist int32_t main() { cin >> p; for (int person = 1; person<=p; person++...
ALGO
0.999734
3.877278
09122d24-d614-47d6-8827-d70e12a0790f
SenseLogic/MYST
BOOST/boost_1_76_0/libs/spirit/classic/phoenix/example/fundamental/sample4.cpp
#include <vector> #include <algorithm> #include <iostream> #include <boost/spirit/include/phoenix1_operators.hpp> #include <boost/spirit/include/phoenix1_primitives.hpp> #include <boost/spirit/include/phoenix1_statements.hpp> #include <boost/spirit/include/phoenix1_special_ops.hpp> using namespace std; using namespace...
TOOL
0.867934
4.742697
c27e561d-215c-44d9-8745-b16653b6df43
vidhan13j07/Randomized-Algorithm
q1/sort.cpp
#include<bits/stdc++.h> using namespace std; template <typename T, typename Container=vector<T> > bool test_sort(const Container& array) { for(int i = 1;i < (int)array.size();i++) if(array[i] < array[i - 1]) return false; return true; } template <typename T, typename Container=vector<T> > ...
ALGO
0.999938
3.967863
1582dc53-5ecf-4ce1-863d-fc8f34fb1d17
marieKarnaukh/misis
karnaukh_m_v/1669d.cpp
#include <iostream> #include <string> int main() { int t = 0; std::cin >> t; int leight = 0; std::string s; bool flag_1 = false; // нашли WCС.. bool flag_2 = false; // нашли ..CCW for (int i = 0; i < t; i += 1) { std::cin >> leight; std::cin >> s; s = 'W' + s + ...
ALGO
0.999933
3.981681
6315824d-5d3a-49f8-9972-8d7bc82f68f1
GuacheSuede/MSSubmission1234567890
submission/macd/boost_1_69_0/libs/graph/example/dijkstra-example.cpp
#include <boost/graph/graph_traits.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/dijkstra_shortest_paths.hpp> #include <boost/property_map/property_map.hpp> using namespace boost; int main(int, char *[]) { typedef adjacency_list < listS, vecS, directedS, no_property, property < edge_weigh...
ALGO
0.999936
5.257607
66222eda-a6d9-4723-bf7d-a2b04f46cfb5
zhangliangkai1992/zlk-leetcode
src/leetcode_97.cpp
/** * @Copyright (c) 2021 The Authors All rights reserved * @Author: zhangliangkai * @create: 2021-10-15 15:09 */ #include <gtest/gtest.h> class Solution { std::unordered_map<std::string, bool> cache_; std::string buildKey(const std::string &s1, const std::string &s2, const std::string ...
TEST
0.990419
6.796096
80fa7419-c0f0-4725-84c4-3c8e3f8e1fc7
wotsushi/competitive-programming
arc/048/b.cpp
#pragma region template 2.4 #include <bits/stdc++.h> using namespace std; template <typename T> using pq_asc = priority_queue<T, vector<T>, greater<T>>; typedef long long ll; typedef vector<ll> vi; typedef vector<vi> vvi; typedef pair<ll, ll> ii; typedef vector<ii> vii; typedef vector<string> vs; #define REP(i, n) for ...
ALGO
0.999897
3.352475
ae1aa971-b125-4f36-85ae-c10d22b417fe
yashtekade21/LeetCode_Solved
3160_Find_the_Number_of_Distinct_Colors_Among_the_Balls.cpp
class Solution { public: vector<int> queryResults(int limit, vector<vector<int>>& queries) { int n = queries.size(); vector<int> result; unordered_map<int, int> color_mp; // ith color count unordered_map<int,int> ball_mp; // ith ball changed to new color for (auto& query...
ALGO
0.999936
6.085882
19b63576-7aba-4bcc-ac79-41e40808c24b
ishandutta2007/codeforces
allvik06/normal/1670/C.cpp
#include <iostream> #include <string> #include <algorithm> #include <cmath> #include <vector> #include <array> #include <map> #include <utility> #include <set> #include <cassert> using namespace std; #define int long long const int mod = 1e9 + 7; signed main() { if (1) { ios_base::sync_with_stdio(false); ...
ALGO
0.999862
4.169122
0966ba74-db3e-490c-9e05-41cf4a2bcec8
HosamEissa/Competitive-programming-
Codeforces/CF546-D2-E.cpp
/* Author: Hossam Eissa Idea: draw graph and do maximum flow if sum==sum2==maximum flow print answer */ #include <bits/stdc++.h> using namespace std; const int INF = 2000000000; struct Edge { int from, to, cap, flow, index; Edge(int from, int to, int cap, int flow, int index) : from...
ALGO
0.999962
3.702147
fb3687aa-e003-4e05-b4f6-521cba571043
facebookarchive/clangir
libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitialized_fill_n.pass.cpp
// UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: libcpp-no-concepts, libcpp-has-no-incomplete-ranges // <memory> // template <nothrow-forward-iterator ForwardIterator, class T> // requires constructible_from<iter_value_t<ForwardIterator>, const T&> // ForwardIterator ranges::uninitialized_fill_n(ForwardIt...
TEST
0.867274
7.608438
4e3faa96-eb46-4763-aba0-d844b4d35804
akhilsimha/Artery
extern/vanetza/tools/benchmark/cases/security/signing.cpp
#include "signing.hpp" #include <boost/program_options.hpp> #include <iostream> #include <random> using namespace vanetza; using namespace vanetza::security; namespace po = boost::program_options; bool SecuritySigningCase::parse(const std::vector<std::string>& opts) { po::options_description desc("Available optio...
TOOL
0.962891
6.578562
c1fd11f0-799a-4274-b858-3562ec36c1a0
ishandutta2007/codeforces
leapfrog/normal/1550/C.cpp
//{{{ #include<bits/stdc++.h> using namespace std;typedef long long ll; template<typename T>inline void read(T &x) { x=0;char c=getchar(),f=0; for(;c<'0'||c>'9';c=getchar()) if(c=='-') f=1; for(;c>='0'&&c<='9';c=getchar()) x=(x<<1)+(x<<3)+(c^48); if(f) x=-x; }/*}}}*/ int n,a[200005]; //1 2 3 4 inline int chk(int a,...
ALGO
0.999948
3.613239
e5701873-ce19-4f0c-8fbe-687652c72991
raincross7/code-similarity
codes/train_code/problem109/problem109_214.cpp
#include <algorithm> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <numeric> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; using P = pair<int, int>; int main() { string s; cin >> s; deque<char>...
ALGO
0.999739
3.590219
7053aae9-9533-43d8-966c-33b87c6fc630
alphaprojectv1/Programming
Competitive-Programming/A_Game_with_Integers.cpp
#include<bits/stdc++.h> #include <stdio.h> #define int long long #define nl "\n" #define blk " " #ifndef ONLINE_JUDGE #define debug(a) cout<<#a<<blk<<a<<nl; #else #define debug(a) #endif const int N=1e5+5; using namespace std; int32_t main() { int ts; cin>>ts; while(ts--) { int n; cin>>n; ...
ALGO
0.999894
3.947629
1c0d4cad-8258-4f51-be5a-10b61f15dc6f
twilight1794/tily-utils
graphop/mult.cpp
#include <iostream> #include <string> #include <stdlib.h> using namespace std; int num1, num2, width, height, diff1, diff2, space; string genChars(int i, const char* chars); int main(int argc, char *argv[]){ if (argc == 3){ num1 = atoi(argv[1]); num2 = atoi(argv[2]); width = to_string(num1 * num2).leng...
ALGO
0.996013
4.133909
91d6568c-c08f-4593-994f-98f7fa45df0b
son0179/ttt
_PSmine/PS모음/codeblock/정올모의고사17회-1/main.cpp
// #include<stdio.h> #include<algorithm> using namespace std; int t,n; pair <int,int> m[111111]; int main(){ scanf("%d",&t); for(int i=0;i<t;i++){ int cnt=0; scanf("%d",&n); for(int j=0;j<n;j++){ scanf("%d %d",&m[j].first,&m[j].second); } sort(m,m+n); ...
ALGO
0.999776
3.632088
2df0a3ba-9ab5-4b5c-87a3-0f180f67cb7a
rjw57/tiw-computer
emulator/src/emu/http.cpp
/*************************************************************************** http.cpp HTTP server handling ***************************************************************************/ #include "emu.h" #include "server_ws_impl.hpp" #include "server_http_impl.hpp" #include <fstream> #include <inttypes.h> #include <s...
WEB
0.911842
3.98397
1be1cd5a-1813-4a4d-a753-0afd39e7e20a
sed-int/algorithm
Backtracking/15652_N과M_4.cpp
#include <iostream> using namespace std; int n, m; int arr[20]; void solve(int k){ if (k == m){ for (int i = 0; i < m; i++) cout << arr[i] << ' '; cout << '\n'; return; } for (int i = 1; i <= n; i++){ if (k > 0 && i < arr[k - 1]) continue; arr[k] = i; solve(k + 1); } } int main(void){ ios::sync_w...
ALGO
0.999735
3.702394
e6522fe9-0402-4642-9c1c-0e01c9803b89
Vision-99/Competitive-Programming
CF/practice/2024/oct/17/B_Sort_the_Array.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define fl(i,n) for(ll i=0;i<n;i++) #define nl endl #define pb push_back #define mod 1000000007 #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() using vi = vector<ll>; ll fact(ll x){if(x==1 || x==0)return 1;else return x*fact(x-...
ALGO
0.999957
3.601817
94f3d009-84c7-4575-8346-bc77a56ce4d2
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_395_13.cpp
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << (a+b>=c?"Yes":"No") << endl; return 0; }
ALGO
0.999958
3.913969
11ec3adc-7892-4e75-8c79-ff02c22bfa1b
YeKYLI/leetcode
待整理/leetcode-0.2.0/solution/0500-0599/0531.Lonely Pixel I/Solution.cpp
class Solution { public: int findLonelyPixel(vector<vector<char>>& picture) { int m = picture.size(), n = picture[0].size(); vector<int> rows(m); vector<int> cols(n); for (int i = 0; i < m; ++i) { for (int j = 0; j < n; ++j) { if (picture[i][j] == 'B') { ...
ALGO
0.998771
6.167639
40341cfc-bf4a-42f5-b5a9-b179f4e2a9e3
wenliangsun/LeetCode
回溯深搜广搜/子集II.cpp
#include <algorithm> #include <vector> using namespace std; /** * 题目90:子集II */ class LeeCode90 { public: /** * 思路:回溯法 深度优先 构建树 * 有重复元素的排列、组合、子集等都需要先将数组进行排序 * 然后在深度优先的时候设置限制条件进行剪枝 */ vector<vector<int>> subsetsWithDup(vector<int>& nums) { if (nums.size() == 0) { ret...
ALGO
0.999948
5.938211
f513eb9f-9773-4e8d-b61a-3c2d73e2dfc0
sriram-vidadala950/DSA01_C-
58_Conversion_Decimal_To_Binary.cpp
#include<iostream> #include<vector> using namespace std; int main(){ int num,rem = 0; int b = 0; vector<int> bin; cout<<"Enter a decimal number.."; cin>>num; while(num>0){ rem = num%2; bin.push_back(rem); num = num/2; } cout<<"Decimal to Binary conversion : "; ...
ALGO
0.999256
4.6741
97ba4528-a0c8-470f-8617-142f7cd68d97
brycelelbach/upcxx
src/team.cpp
/** * team.cpp */ #include "upcxx.h" #include "upcxx/upcxx_internal.h" #ifndef GASNET_COLL_SCRATCH_SEG_SIZE #define GASNET_COLL_SCRATCH_SEG_SIZE (2048*1024) #endif using namespace std; namespace upcxx { team team_all; uint32_t my_team_seq = 1; gasnet_hsl_t team::_tid_lock = GASNET_HSL_INITIALIZER; vector...
TOOL
0.871352
5.700906
db7c5b07-6cb2-402a-8db4-18cafc1c9c47
EunSeong-Seo/coding_test
Greedy/잃어버린 괄호.cpp
#include <iostream> #include <string> using namespace std; string str; int minResult(void) { int result = 0; string temp = ""; bool minus = false; for (int i = 0; i <= str.size(); i++) { // if (str[i] == '+' || str[i] == '-' || str[i...
ALGO
0.99996
4.248287
54bd1914-fdf0-4bf6-82b7-6732cbbb4f13
allen-quad-robot/MiLAB-Cheetah-Software
user/MiLAB_Controller/Controllers/BalanceController/ReferenceGRF.cpp
/* References: [R1] M. Focchi, A. del Prete, I. Havoutis, R. Featherstone, D. G. Caldwell, and C. Semini. High-slope terrain locomotion for torque-controlled quadruped robots. Autonomous Robots, 2016. [R2] R. M. Murray, S. S. Sastry, and L. Zexiang. A Mathematical Introduction to Robotic Manipulation. CRC ...
ALGO
0.999857
4.695873
2eec034b-e7fc-4d2c-b5f0-2399df7b2596
raincross7/code-similarity
codes/train_code/problem193/problem193_417.cpp
#include "bits/stdc++.h" using namespace std; using ll = long long; using Pii = pair<int, int>; using Pll = pair<ll, ll>; #define rep(i, begin, n) for (int i = begin; i < n; i++) #define repe(i, begin, n) for (int i = begin; i <= n; i++) #define repr(i, begin, n) for (int i = begin; i > begin - n; i--) #define repre(i,...
ALGO
0.999465
3.938937
cc35979d-3ca9-48d3-b10e-d2a5453cdee0
whippingdot/AOC-2020
aoc/day-6/06-1.cpp
#include "../aoc.h" #include <iostream> #include <string> #include <algorithm> void Day6Part1() { vector<string> input = read_file("aoc/day-6/input.txt"); auto start = std::chrono::steady_clock::now(); vector<int> groups = vector<int>(); vector<char> answered = vector<char>(); for (int i = 0; i < input.si...
ALGO
0.990421
5.898701
f62688a4-27ab-4ebc-a59a-1f7579cf613f
hzfsls/leetcode-supercrawl
data/1472.design-browser-history/code_snippets/sol.cpp
class BrowserHistory { public: BrowserHistory(string homepage) { } void visit(string url) { } string back(int steps) { } string forward(int steps) { } }; /** * Your BrowserHistory object will be instantiated and called as such: * BrowserHistory* obj = new BrowserHis...
ALGO
0.958024
5.139627
41985d9c-447e-4a91-b2f6-913d40895416
Gaurang03/DSA-Questions
DPP8/4_cycle_detection.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 const long long ONE_SIXTH = 166666668; const int N = 1e5 + 10; vector<int> g[N]; bool vis[N]; bool dfs(int vertex, int par) { vis[vertex] = true; bool isLoopExists = false; for (int child : g[vertex]) { ...
ALGO
0.999919
4.883073
403f636a-a3dd-4bee-8033-2458427e6ac3
kevinzhang334455/Scout
boost_1_56_0/libs/msm/doc/PDF/examples/DirectEntryTutorial.cpp
#include <vector> #include <iostream> // back-end #include <boost/msm/back/state_machine.hpp> //front-end #include <boost/msm/front/state_machine_def.hpp> namespace msm = boost::msm; namespace mpl = boost::mpl; namespace { // events struct event1 {}; struct event2 {}; struct event3 {}; struct eve...
TOOL
0.91078
5.6443
130f5586-7d63-4a88-b360-acd59010284e
kosakowski/OGS6-MP-LT-Drum
ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp
#include "CreatePhaseFieldProcess.h" #include <cassert> #include "MaterialLib/SolidModels/CreateConstitutiveRelation.h" #include "MaterialLib/SolidModels/MechanicsBase.h" #include "ParameterLib/Utils.h" #include "ProcessLib/Output/CreateSecondaryVariables.h" #include "ProcessLib/Utils/ProcessUtils.h" #include "Phase...
TOOL
0.898273
3.855707
f52cc733-0a65-491b-9dec-fdb575440c22
arkayyy/codeforces
Easy Practice/791A-Bear and Big Brother/try.cpp
#include<bits/stdc++.h> using namespace std; int main() { int a, b; cin>>a>>b; int res=0; while(a<=b) { a*=3; b*=2; res++; } cout<<res<<endl; return 0; }
ALGO
0.999706
3.872222
ba0d30d2-a50e-441b-ae1b-f4b012ca0dfc
crystalhd/codes_and_notes
65_median-of-two-sorted-arrays/median-of-two-sorted-arrays.cpp
/* @Copyright:LintCode @Author: holiday_0802 @Problem: http://www.lintcode.com/problem/median-of-two-sorted-arrays @Language: C++ @Datetime: 16-07-18 23:03 */ class Solution { public: /** * @param A: An integer array. * @param B: An integer array. * @return: a double whose format is *.5 or *.0 ...
ALGO
0.999821
5.650194
3d00ca81-f144-457a-a1b6-d1920c2f62cf
Ash-codes18/Lpu-colab-CPP-DSA-Soln
CSE-205 DSA/Unit-2/Lecture 10/Delete_last_node.cpp
#include <iostream> using namespace std; int main(){ int n; cin>>n; string arr[n-1]; for(int i=0 ;i<n-1;++i) { cin>>arr[i]; cout<<arr[i]<<" "; } return 0; }
ALGO
0.995297
3.036726
1597fedb-5b5f-437c-b7c9-fac49afad601
0-5-blood-prince/code-llm
cpu-inference/llama.cpp/common/ngram-cache.cpp
#include "ngram-cache.h" #include "common.h" #include "log.h" #include <cstdint> #include <fstream> void llama_ngram_cache_update(llama_ngram_cache & ngram_cache, int ngram_min, int ngram_max, std::vector<llama_token> & inp, int nnew, bool print_progress) { const int64_t t_start_ms =...
ALGO
0.99023
5.323458
edebcb3a-6ed5-480d-8ac4-f2762ef2a132
kmjp/procon
atcoder/abc251-300/abc262/c.cpp
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define ...
ALGO
0.999549
3.534363
34d2079c-df57-43c1-a1ab-a354ed6edbc0
featattach/CLab2
Lab2/Lab2.cpp
#include <iostream> #include <iomanip> #include <cstdlib> #include <ctime> #include <cmath> #include <limits> #define N 5 void printMatrix(float matrix[N][N]) { for (int i = 0; i < N; ++i) { for (int j = 0; j < N; ++j) { std::cout << std::setprecision(5) << std::setw(10) << matrix[i][j]; ...
ALGO
0.999779
4.201925
271ec059-c108-42ae-805d-13235899e878
MohamedAbdelhakam/self-diagnosis
sp-main (1)/sp-main/30.cpp
#include <iostream> #include <algorithm> using namespace std; void histo(int n,char x){ for(int i = 0;i<n;i++) cout<<x; cout<<endl; } main() { cout<<"enter size : "; int n;cin>>n; cout<<"enter char : "; char x;cin>>x; cout<<"enter array elements : "; int *arr = new int[n]; fo...
ALGO
0.970994
3.100973
6ce1977d-f3c1-4a14-ad6e-ea494a11ef88
hideoussquid/deuscoin-core-gui
src/wallet/crypter.cpp
#include "crypter.h" #include "crypto/aes.h" #include "crypto/sha512.h" #include "script/script.h" #include "script/standard.h" #include "util.h" #include <string> #include <vector> #include <boost/foreach.hpp> int CCrypter::BytesToKeySHA512AES(const std::vector<unsigned char>& chSalt, const SecureString& strKeyData...
TOOL
0.913094
7.578944
d9fa4909-ab78-4fce-86e2-a91f382f05c7
md-jonayed/Phitron_Course
Semester 1/DSA/Module 22.5 (practice)/4.TwoSum_IV_InputisaBST.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.999978
5.942837
4cd5f8cd-8c71-4172-ace2-b73a1e717ddf
mhwen/competitive-programming
AtCoder/ABC333/B.cpp
#include <iostream> #include <vector> #include <algorithm> #include <queue> #include <map> #include <set> #include <functional> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string s; string t; cin >> s >> t; int d1 = 0; while(s[0] != s[1]) { s[0]++; ...
ALGO
0.999997
3.910929
36ebe298-8fa2-4f3c-809f-f324ef2510b8
mrdrivingduck/leet-code
61.RotateList.cpp
/** * @author Mr Dk. * @version 2021/03/27 */ /* 统计链表的长度,并对旋转次数取模,防止重复的旋转。使用快慢指针找到要旋转 的区间的前一个结点和尾结点,将这段区间从链表上摘下来,插入到链表头部。 */ #include <cassert> #include <iostream> #include <vector> using std::cout; using std::endl; using std::vector; /** * Definition for singly-linked list. * struct ListNode { * ...
ALGO
0.999948
5.495553
c08726e5-f62a-4897-865e-ab1616f28b4a
WUSTL-CSPL/Kairos-Middleware
laser_filters/src/sector_filter.cpp
#include <math.h> #include <laser_filters/sector_filter.h> #include <ros/node_handle.h> namespace laser_filters { LaserScanSectorFilter::LaserScanSectorFilter() { } bool LaserScanSectorFilter::configure() { ros::NodeHandle private_nh("~" + getName()); dyn_server_.reset(new dynamic_reconfigure::Server<SectorFilt...
TOOL
0.880701
6.200891
2831ac75-fbf7-428d-a255-50177fd77c0c
TamiTo13/algorithms-and-tasks
Introduction(c++)/практикум/7ма final/treta.cpp
#include <iostream> const int dx[4] = {1,0,-1,0}; const int dy[4] = {0,1,0,-1}; bool out(int x, int y) { return x<0 || x>=128 || y<0 || y>=128; } bool findRoute(int N[][128], int currentX, int currentY,int volume,bool** path,int finishX, int finishY, int MAX_VOLUME, int startX, int startY) { if(out(currentX...
ALGO
0.999874
3.973528
ea60b7b3-67dc-4156-9217-a3fce7ebf9c9
yashparmar15/Cpp-Codes
Number_of_Minimum_Picks_to_get_K_Pairs_of_Socks_from_a_Drawer.cpp
/*A drawer contains socks of n different colours. The number of socks available of ith colour is given by a[i] where a is an array of n elements. Tony wants to take k pairs of socks out of the drawer. However, he cannot see the colour of the sock that he is picking. You have to tell what is the minimum number of socks ...
ALGO
0.999992
4.912385
720163dd-c678-4cf8-acf0-927ea859cdde
rofi93/Codeforces
B. Barnicle.cpp
/* -------------------------------- */ /* Name: MD. Khairul Basar */ /* Institute: HSTU */ /* Dept: CSE */ /* Email: <EMAIL> */ /* -------------------------------- */ #include <bits/stdc++.h> /* all header files included */ #define fs first #define sc ...
ALGO
0.998484
3.134887
693d87a0-ba05-44b0-ab02-f6ccdf67dc9d
tmudda/crack_interview
sort012.cpp
/*** Write a program to sort 0s,1s and 2s in O(n) time without using sorting techniques. Given an array arr[] consisting of only 0s, 1s, and 2s. The task is to sort the array, i.e., put all 0s first, then all 1s and all 2s in last. Input: arr[] = {0, 1, 2, 0, 1, 2} Output: {0, 0, 1, 1, 2, 2} Input: arr[] = {0, 1, 1,...
ALGO
0.999813
5.582954
661a6ab2-8901-48db-9445-fa287fd9e6c2
2021-2022-2-TIN1083-014/KyThuatLapTrinh
TEAM12/NNDQuy/locsonguyento.cpp
#include <iostream> #include <string> #include "../../_src/Log.h" using namespace std; bool songuyento(int n) { if (n < 2) return false; else if (n == 2) return true; else { for (int i = 2; i < n; i++) if (n % i == 0) return false; } return tru...
ALGO
0.999425
4.437398
f912e215-05cc-414f-9f15-58c9812e983f
LemonPrefect/BugRepoForACM
mckm2000's Bug_Code/杭电OJ/2003.cpp
#include <iostream> #include<stdio.h> #include<iomanip> using namespace std; int main() { double number; while (cin>>number) { cout << fixed << setprecision(2); if (number <= 0)number = (-number); cout << number << endl; } return 0; }
ALGO
0.998934
3.257529
044bb21c-1d8a-40b0-a93a-0e21307db0e2
quocdung2603/ALL_OF_C
CodeForces/A_Payment_Without_Change.cpp
#include <bits/stdc++.h> using namespace std; #define nl << '\n' #define fi first #define se second #define vd vector<double> #define vi vector<int> #define vii vector<pair<int, int>> #define vtr vector<string> #define yes cout << "YES" #define no cout << "NO" #define int long long #define ld long double #define bb pus...
ALGO
0.996189
3.813885
d631c932-b37d-4d8a-95d9-f2df3733ed02
Shintaro0105/Competitive-programming
atcoder/abc/232/e.cpp
#include <iostream> #include <vector> #include <set> #include <array> #include <cmath> #include <string> #include <algorithm> #include <functional> #include <map> #include <tuple> #include <queue> #include <stack> #include <bitset> #include <deque> #include <iomanip> #define rep(i,n) for(int i = 0;i < (n);i++) using na...
ALGO
0.999692
3.825388
2be963c6-58fa-49f6-a8fc-83b64f722a04
sarvex/leetcode-bash
solution/1200-1299/1208.Get Equal Substrings Within Budget/Solution.cpp
class Solution { public: int equalSubstring(string s, string t, int maxCost) { int n = s.size(); int ans = 0, sum = 0; for (int i = 0, j = 0; i < n; ++i) { sum += abs(s[i] - t[i]); while (sum > maxCost) { sum -= abs(s[j] - t[j]); ++j; ...
ALGO
0.999993
6.158046
3f6a8e28-a61b-495a-803a-706d83ea5bb2
caixiaomo/leetcode-ans1
leetcode C++/Two_Pointers/Valid_Palindrome/answer.cpp
/* Valid Palindrome Total Accepted: 9173 Total Submissions: 42252 My Submissions Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Panama" is a palindrome. "race a car" is not a palindrome. Note: Have you consider that t...
ALGO
0.999841
5.908365
f67812c7-da93-44a5-893a-56a76cade7bf
NotRtro/BlockChain-
src/app/blockchain.cpp
// // Created by Leonardo Candio on 7/02/23. // #include "blockchain.h" #include "iostream" #include "sstream" #include <utility> bool blockchain::isChainValid() const { return false; } blockchain::blockchain(size_t _size, unsigned short difficulty) : _size(_size), difficulty(difficulty), lastBlock(firstBlock) { ...
TOOL
0.98643
5.322935