uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
79c54728-3f27-4758-850a-a7852590c1ab
ProtoSol/Data-Structure-CPP
SelectionSort.cpp
#include<iostream> using namespace std; void printArray(int array[], int n){ for(int i=0; i<n; i++){ cout<<array[i]<<" "; } } void selectionSort(int arr[], int n){ for(int i = 0; i < n; i++){ int minIndex = i; for(int j = i+1; j < n; j++){ if(arr[j] < arr[minIndex]){...
ALGO
0.999937
5.181308
7397e467-d471-4437-b95e-6f67187c2df0
luyocarp/Algorithmic-Contests
Codeforces/cf_682E.cpp
#include <bits/stdc++.h> using namespace std; #define all(v) (v).begin(),(v).end() #define pb push_back #define sqr(x) ((x)*(x)) #define mp make_pair #define ones(x) __builtin_popcount(x) #define fast_io() ios_base::sync_with_stdio(0);cin.tie(0); #define debug(x) cerr << #x << ": " << x << endl; #define fst first #defi...
ALGO
0.999896
3.512767
d72cd4ee-d4b9-431f-a01d-57f951d39f82
yhchen/games101homework
homework/eigen/doc/examples/Tutorial_simple_example_dynamic_size.cpp
#include <Eigen/Core> #include <iostream> int main() { for (int size = 1; size <= 4; ++size) { Eigen::MatrixXi m(size, size + 1); // a (size)x(size+1)-matrix of int's for (int j = 0; j < m.cols(); ++j) // loop over columns for (int i = 0; i < m.rows(); ++i) // loop over rows m(i, j) = i ...
ALGO
0.97891
3.085938
b37345fa-cf28-4254-baa9-2e507a78944b
C0de871/todo_list
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
2697e7b7-3ab1-41dd-9879-37e34e4b5f0c
danielfelipe-df/Metodos-de-simulacion
1/1.cpp
#include<iostream> #include<cmath> #include<vector> #include <fstream> //constantes del problema// const double beta=0.35; const double g=0.08; const double h=0.1; const double tf=1000; const int size =2; //funciones void rk4(double t,double h,std::vector<double>&y); double f(double t, const std::vector<double> & y, in...
ALGO
0.99995
4.122975
91900f62-eb00-49df-81b8-223c0d9dd077
GarciaSolis7/pLogicPracticas
potencias/potenciaRecurciva.cpp
#include <iostream> //POTENCIAS CON SUMAS RECURSIVAS. int multiplicar(int a, int b) { if (b == 0) { return 0; } else { return a + multiplicar(a, b - 1); } } ////// int potencia(int bas, int exp){ if (exp==0){ return 1; } else { return multiplicar(bas, potencia(bas, exp - 1)); } } //...
ALGO
0.999722
4.581533
56561a51-69f5-488f-aaa7-112d5053168b
SaranshOp/DSA-Cpp-Python
love babbar dsa cpp notes/recursion/sum.cpp
#include <bits/stdc++.h> using namespace std; int getSum(int *arr, int size) { if (size == 0) return 0; if (size == 1) return arr[0]; int remainingPart = getSum(arr + 1, size - 1); int sum = arr[0] + remainingPart; return sum; } int main() { int arr[5] = {2, 4, 9, 9, 9}; ...
ALGO
0.999941
4.990149
79a9b3c7-efe4-4fe0-b6d5-ae7fde0207fc
toanmv-1729/DataStructures-Algorithms
DSLK2.cpp
#include <stdio.h> #include <iostream> #include <stdlib.h> struct Node{ int data; struct Node *pNext; }; typedef struct Node NODE; struct List{ NODE *pHead; NODE *pTail; }; typedef struct List LIST; void Init(LIST &l) { l.pHead= l.pTail = NULL; } NODE* TaoNode(int x) { NODE *p= new NODE; if (p == NULL) re...
ALGO
0.998189
3.749191
85c86e15-0f10-404c-80df-2541bd1e1cb0
Haelgarin/Hackerrank-Challenges
Divisible Sum Pairs/main.cpp
#include <vector> #include <iostream> int divisibleSumPairs(int n, int k, std::vector<int> ar) { int count{}; for (int i{ 0 }; i < ar.size(); ++i) { for (int j{ i + 1 }; j < ar.size(); ++j) { if ((ar[i] + ar[j]) % k == 0) { ++count; } } } return count; } int main(int argc, char** argv) { st...
ALGO
0.99735
5.324178
ee39f0e7-c8f5-4f67-9d70-eabb74d8264d
Brave123555/leetcod1
solution/2100-2199/2154.Keep Multiplying Found Values by Two/Solution.cpp
class Solution { public: int findFinalValue(vector<int>& nums, int original) { unordered_set<int> s; for (int num : nums) s.insert(num); while (s.count(original)) original <<= 1; return original; } };
ALGO
0.999992
5.819436
8e6d06bd-75b7-4816-8627-4ee0c139583c
Sinaghaniya/C-
BinarySearchChallenge.cpp
#include<bits/stdc++.h> using namespace std; bool isFeasible(int mid, int arr[],int n,int k){ int pos = arr[0], elements = 1; for(int i =1;i<n;i++){ if(arr[i] - pos >= mid){ pos = arr[i]; elements++; if(elements == k){ return true; ...
ALGO
0.999988
4.670885
a2879e1c-3836-4cfa-99d8-7db7fa89b960
UFOsonzz/Competitive-Programming
EXAM/Exam13_10_2024/P1/Sol.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 1 << 18; const int MAXV = 60; int n, a[MAXN + 5], dp[MAXV + 2][MAXN + 5]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; int ans = 0; for (int t = 1; t...
ALGO
0.999971
4.251653
4df39358-c1db-471e-a870-fd2c5eb20a27
chongin12/Problem_Solving
acmicpc.net/6086.cpp
#include <iostream> #include <queue> #include <vector> using namespace std; int N; int c[200][200]; // c[a][b] : a->b의 간선의 용량 int f[200][200]; // f[a][b] : a->b의 간선의 유량 vector<int> G[200]; int MaxFlow(int src, int snk) { // src에서 snk로 가는 최대 유량을 리턴한다. int ret = 0; while(1){ queue<int> q; q.push(src); ...
ALGO
0.999705
4.444552
124950b0-dfe8-4892-8188-6b945e415adb
MrinmoiHossain/LeetCode
101.SymmetricTree/SymmetricTree.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.999967
6.782098
584cf6ee-16e6-47a4-9bc4-e4142dbecaac
bashen1291/SimpleTest
cocos2d/tools/simulator/libsimulator/lib/ProjectConfig/ProjectConfig.cpp
#include <sstream> #include "ProjectConfig/ProjectConfig.h" #include "ProjectConfig/SimulatorConfig.h" #ifdef _MSC_VER #define strcasecmp _stricmp #endif #if defined(_WINDOWS) #define DIRECTORY_SEPARATOR "\\" #define DIRECTORY_SEPARATOR_CHAR '\\' #else #define DIRECTORY_SEPARATOR "/" #define DIRECTORY_SEPARATOR_CHA...
TOOL
0.988666
5.933113
2ce53ba2-3b65-4c09-b4ff-fad99ebd5ab4
SOAIB56/Problem-solving-club
week 5/day 3/T_Different_Differences.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int main() { ll t, n, k, i, j, diff; cin>>t; for(;t--;) { cin>>k>>n; j=1; diff=1; for(i=1; i<=k; i++){ cout<<j<<" "; if(n-(j+diff)>=(k-i-1)...
ALGO
0.999936
3.673035
6c268659-fef3-474e-aedd-4a5c4870f7c5
Itashi19/DSA-Practice
Arrays/factorial of a large number.cpp
//factorial of a large number #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i <= b; i++) using namespace std; // Made a class node containing data and previous pointer as // we are using tail pointer class Node { public: int data; Node* prev; Node(int n) { data = n; prev...
ALGO
0.999901
4.469513
c086d864-52c9-4910-a9a1-8e7eb9e93d19
loubrnt/Codeforces-solutions
BProblem/230b.cpp
#include <iostream> #include <vector> #include <chrono> #include <cmath> bool isInteger(double N) { // Convert float value // of N to integer int X = N; double temp2 = N - X; // If N is not equivalent // to any integer if (temp2 > 0) { return false; } return true; } int...
ALGO
0.999839
5.062704
c1b6d3a2-3c24-4e19-81b0-b0a7fce675f0
ShauryaManiTripathi/My-Codeverse
Cpp/003_BitManipulation/PlayingWithBits.cpp
#include <iostream> #include <algorithm> using namespace std; int countSetBits(int a, int b) { if (a > b) swap(a, b); int count = 0; for (int i = a; i <= b; i++) { int mask = 1, setBits = 0; for (int j = 0; j < 32; j++) { if (i & mask) setBits...
ALGO
0.999486
4.534126
85727ebf-b0b6-40bc-ac11-a48dbc56d74f
Wei-Fan/crazy_sim
include/Eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; int main() { Eigen::MatrixXf mat(2,4); Eigen::VectorXf v(4); mat << 1, 2, 6, 9, 3, 1, 7, 2; v << 0,1,2,3; //add v to each row of m mat.rowwise() += v.transpose(); std::cout << "Broadcasting result: " << std::...
ALGO
0.998818
4.296038
b6e60c45-cb90-494d-8b4b-30330d373b9f
haohaibo/tutorial
leetcode/598_range-addition.cpp
class Solution { public: int maxCount(int m, int n, vector<vector<int>>& ops) { int a = m, b = n; for (int i = 0; i < ops.size(); ++i) { a = a > ops[i][0] ? ops[i][0] : a; b = b > ops[i][1] ? ops[i][1] : b; } return a * b; } };
ALGO
0.999357
6.266134
541d0bbd-6a7b-4694-967f-41e46199d175
kinetic-rb/kinetic-rb.github.io
code/P1352.cpp
#import <iostream> #include <list> using namespace std; using tp = intmax_t; constexpr tp Hat_N = 6'003; bool root[Hat_N]; tp v[Hat_N], cf[Hat_N], nf[Hat_N]; list<tp> g[Hat_N]; void dp(tp loc) { for (auto&& i : g[loc]) { dp(i); nf[loc] += max(cf[i], nf[i]); cf[loc] += nf[i]; } cf[loc] += v[loc]; } ...
ALGO
0.999818
4.24078
d9a7c4d3-9fb9-4b1a-a84e-aa0594575c44
nithx0g/ELL781-SOFTWARE-FUNDAMENTALS-FOR-COMPUTER-TECHNOLOGY
assignment-3/node.cpp
#include <iostream> #ifndef __node__ #define __node__ using namespace std; //node struct for fibonacci heap struct nodePQ { int key=-1; int src=-1; int des=-1; struct nodePQ* parent = NULL; struct nodePQ* child = NULL; struct nodePQ* left = NULL; struct nodePQ* right = NULL; int degree ...
ALGO
0.999575
3.481902
58c4df47-2394-44b6-a1b4-8df7114659ab
Tazim43/cses-problem-solve
Sorting and Searching/Room Allocation.cpp
/* Author: Tazim(The_crawler) */ #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #define FAST_IO ios_base::sync_with_stdio(false); cin.tie(NULL) #define ll long long int #define dec greater<int>() #define lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower); #define upper(s) transform(s.begin(),...
ALGO
0.999988
4.048164
1734675d-a240-423c-a515-537a7bafdb83
KeshavTandon/Codes
recursion/basic.cpp
#include<bits/stdc++.h> using namespace std; // void print_1_to_n(int x) // { // if(x==0) // { // return; // } // print_1_to_n(x-1); // cout << x << " "; // } void print_n_to_1(int x) { if(x==0) { return; } cout << x << " "; print_n_to_1(x--); } int main() { ...
ALGO
0.999759
4.49551
88de0c8b-2ed0-4e81-8dc5-e7e107a0b26a
SuchanaNag002/Codeforces-and-Codechef
code2.cpp
#include<bits/stdc++.h> #define ll long long #define endl "\n" using namespace std; int main() { ll t,n,k,i,count; cin>>t; while(t--) { cin>>n>>k; vector<ll>arr(n); count=0; for(i=0;i<n;i++) { cin>>arr[i]; if(arr[i]==k) coun...
ALGO
0.999898
3.642109
1ada234e-2416-4061-867c-5c7a936b8973
freshsun97213/ACM-algorithm
codeforce/c7-27/jjc.cpp
#include <bits/stdc++.h> #include <iostream> using namespace std; #define debug(x) cerr << #x << " " << x << " "; using i64 = long long; void solve() { int n, m; std::cin >> n >> m; std::string s; std::cin >> s; std::set<std::pair<int, int>> S; std::vector<int> nxt(n + 1, n), lst(n + 1, -1); for (int...
ALGO
0.999485
4.131483
5a052a60-4feb-4659-99c9-16099a19b88e
thanh-son-lemelle/runtrackCPP
jour03/job09/job09.cpp
#include <iostream> int main() { int a, b, entier; std::cout << "Entrez la borne inferieure a : "; std::cin >> a; std::cout << "Entrez la borne superieure b : "; std::cin >> b; if (a >= b) { std::cout << "Erreur : a doit être strictement inférieur à b." << std::endl; return 1...
ALGO
0.994002
4.155332
d146d4c2-c253-471c-8da1-c7c54133813b
proywm/miniPerfBench
multi_step_benchmarks_minibenchV2_no_hint_V1_attemp_1/gpt-4o-mini/benchmark_744/step_6.cpp
// optimized.cpp #include <vector> #include <cstddef> #include <random> #include <cstring> constexpr size_t BUCKETS = 256; constexpr size_t THREADS = 8; // Disable vectorization to model loops before the pragma simd addition __attribute__((optimize("no-tree-vectorize"))) void radix_iter0(volatile unsigned int* src, u...
ALGO
0.99992
7.518361
44b99f7e-3c77-4c4e-a27d-1a76c1aaaff9
Babayayaga/Routing_on_the_hyperbolic_plane
experiment.cpp
#include <CGAL/Constrained_Delaunay_triangulation_2.h> #include <CGAL/Delaunay_mesh_face_base_2.h> #include "include/internal/BeltramiKleinTraits.h" #include "include/internal/PoincareDiskTraits.h" #include "include/internal/RandomDomainGenerator.h" #include "include/internal/Qt/Input/PointInput.h" #include "include/in...
ALGO
0.998838
7.047773
188a73c5-e307-4c79-8c22-2ce45a8734d3
Kecheng-Ye/My_Leetcode
Problem/By section/Math/Problem 43 */problem_43.cpp
#include <bits/stdc++.h> using namespace std; // #define charToNum(c) ((int)(c - '0')) // #define digitToChar(d) ((char)(d + '0')) // class Solution { // public: // Time: O((n * m) * (m + n)), Space: O(m + n) // string multiply(string num1, string num2) { // if (num1 == "0" || num2 == "0") { // ...
ALGO
0.999973
6.225604
863a08fd-651e-4c27-bfc5-a681b1a13b86
thegamer1907/Code_Analysis
DP/984.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; int ara[n]; for(int i = 0;i<n;i++) { cin >> ara[i]; } int max = 0; int zeroCount, oneCount, totalCount; for(int i = 0;i<n;i++) { for(int j = i;j<n;j++) { zeroCount = 0; ...
ALGO
0.999987
3.713794
0153847b-5242-4170-8b02-3ed6ef1d4894
soyeonjwa/algorithm_practice
SWEA/D3/16002. 합성수 방정식/합성수 방정식.cpp
///////////////////////////////////////////////////////////////////////////////////////////// // 기본 제공코드는 임의 수정해도 관계 없습니다. 단, 입출력 포맷 주의 // 아래 표준 입출력 예제 필요시 참고하세요. // 표준 입력 예제 // int a; // float b, c; // double d, e, f; // char g; // char var[256]; // long long AB; // cin >> a; // int 변수 1개 입력...
ALGO
0.995632
3.647624
e47e6597-7f5e-4630-9266-3f4c5f661668
NA-Siddiky/Phitron
Semester_1/02_C++_DSA/Week_02_Class_and_String/Module_6.5_Week_02_Practice_01/B_ICPC_Balloons.cpp
#include <iostream> #include <unordered_map> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; string s; cin >> s; unordered_map<char, int> solved_problems; int balloons = 0; int first_solved = 0; for (i...
ALGO
0.999852
4.823165
34372f97-bb1c-4c6d-8fe0-5e94aca607ba
ishandutta2007/codeforces
enem/normal/1556/A.cpp
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define M1 1000000007 #define M2 998244353 #define ll long long #define ld long double #define pll pair<ll,ll> #define REP(i,a,b) for(ll i=a;i<b;i++) #define REPI(i,a,b...
ALGO
0.999891
4.536357
6365f45a-e56b-433f-b244-1a2efc2471ef
Sp-177/CODEFORCES
A_Square.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; int main(){ long long m=1e9+7; int t;cin>>t; for(int i=0;i<t;i++){ int x,y; bool s=true; for(int j=0;j<4;j++){ int a,b; cin>>a>>b; if(s){x=a;y=b;s=false;} else if(x==a){ ...
ALGO
0.999538
4.507395
428c01b6-aa8b-4c09-aaf1-37feaa321af2
junstat/CppLearning
LeetCode/Q0099/Q0050/solution1/Solution.cpp
class Solution { public: double myPow(double x, int n) { long power = n; return power >= 0 ? myPowAux(x, power) : 1.0 / myPowAux(x, -power); } double myPowAux(double x, long n) { if (n == 0) return 1; return (n % 2 == 0) ? myPowAux(x * x, n / 2) : x * myPowAux(x * x, n / 2);...
ALGO
0.999881
6.067706
4edbe26c-1057-4d60-8441-a1840cd6f002
sradl1981/LIGGGHTS-PUBLIC-ParScale
examples/LAMMPS/COUPLE/lammps_spparks/lmpspk.cpp
// lmpspk = umbrella driver to couple LAMMPS + SPPARKS // for a strain-induced grain growth model // Syntax: lmpspk Niter Ndelta Sfactor in.spparks // Niter = # of outer iterations // Ndelta = time to run MC in each iteration // Sfactor = multiplier on strain effect // in.sppar...
TOOL
0.997304
5.441525
fe7bf6d8-a56f-41d7-9a4c-1a8aef3908b1
TinkerBoard-Android/rockchip-android-external-scudo
standalone/crc32_hw.cpp
#include "checksum.h" namespace scudo { #if defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32) u32 computeHardwareCRC32(u32 Crc, uptr Data) { return static_cast<u32>(CRC32_INTRINSIC(Crc, Data)); } #endif // defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32) } // namespace scudo
TOOL
0.95766
6.23137
2b813466-9aae-4f43-8046-7969ed567ab6
xf97/myLeetCodeSolutions
src/huawei09.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; //7.8%, 69% int main(){ //基本思路,读入字符串,从后向前扫描 //使用一个辅助结构来帮助去重,去重的同时保持数字间的前后关系 string num; vector<char> appearedNums; cin >> num; //要用到下标 for(int i = num.size() - 1; i >= 0; i--){ if(count(appearedNums.beg...
ALGO
0.999698
5.499887
b571e5b5-9ef0-4c86-8021-6db51d7c5666
jw291/Algorithm-Study
P10/main.cpp
#include <iostream> #include <stdio.h> using namespace std; int digit_sum(int x){ int res = 0; //10을 나눈 나머지는 첫번째 자릿수의 값을 구하는 방법 //그다음 10을 나눠서 다음 자릿수의 값을 구하도록함. while(x != 0){ res += (x % 10); x = x / 10; } return res; } int main() { int N, x, sum, res ,max = -2147000000; ...
ALGO
0.999856
5.354642
47014682-618d-4f09-99e9-96da9d6cfa1d
mr-jestin-roy/LeetCode-TaskList
C_Given_Length_and_Sum_of_Digits.cpp
// Author:: Jestin Roy // Institution:: Mar Athanasius College of Engineering #include <bits/stdc++.h> using namespace std; // #define int long long #define pb push_back #define ppb pop_back #define pf push_front #define ppf pop_front #define all(x) (x).begin(), (x).end() #define uniq(v) (v).erase(unique(all(v)), (v).e...
ALGO
0.999856
4.565756
c972ab40-ae2b-4996-97b6-0ff1ff009f0d
Vassu05/CSES
building_roads.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; vector<int> par(n); iota(par.begin(), par.end(), 0); auto find = [&](auto self, int x) -> int { return par[x] == x ? x : par[x] = self(self, par[x]); }; for(int i = 0; i < m; i++) { int x, y; cin >> x >> y; ...
ALGO
0.999991
4.075577
00ce94ca-f0e7-48c1-8ccb-baa91f69dab3
Gera-Mtz-Rdz/Proyecto-Final.
libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
// <vector> // iterator insert(const_iterator position, size_type n, const value_type& x); #include <vector> #include <cassert> #include <cstddef> #include "test_macros.h" #include "test_allocator.h" #include "min_allocator.h" #include "asan_testing.h" int main(int, char**) { { std::vector<int> v(100); ...
TEST
0.892984
4.674482
1ce5cd69-9954-4369-a229-6b5bb24c18d6
alexandraback/datacollection
solutions_5690574640250880_0/C++/Iskandar/Minesweeper.cpp
#include<iostream> #include<utility> #include<queue> using namespace std; /** Global variable */ char map[7][7]; int T, R, C, GM; bool check(int x, int y) { bool isChecked[7][7]; int num = R * C - GM; for (int p = 0; p <= R+1; p++) for (int q = 0; q <= C+1; q++) isChecked[p][q] = fal...
ALGO
0.999017
4.496036
9978f73d-6ce3-41a9-9bd2-c0ed7dd61276
hfchuan/LeetCode
100.相同的树.cpp
#include <iostream> #include <vector> #include <queue> struct TreeNode{ int val; TreeNode* left; TreeNode* right; TreeNode(int x):val(x),left(NULL),right(NULL){} }; class Solution{ public: bool isSameTree(TreeNode* p,TreeNode* q){ if(p==NULL && q==NULL){ return ...
ALGO
0.999944
5.322805
4ea60c26-76ae-4d2b-9715-f17e8d48f094
ltwwwww/acceleratedCpp
ch14/ch14-1/grade.cpp
#include <vector> #include <stdexcept> #include "median.h" #include "grade.h" using std::vector; using std::domain_error; double grade(double mid, double final, double hw){ return 0.2 * mid + 0.4 * final + 0.4 * hw; } double grade(double mid, double final, const vector<double>& hw){ if(hw.size() == 0){ ...
ALGO
0.99399
6.163756
f71ddab3-3a5d-4fe2-b4e0-ee77dc0e23af
devreeda/cp
battledev_mars2016/a.cpp
#include <bits/stdc++.h> using namespace std; /* const int MAX_N = 1e5 + 5; const int MAX_L = 20; // ~ Log N const long long MOD = 1e9 + 7; const long long INF = 1e9 + 7;*/ typedef long long ll; typedef vector<int> vi; typedef pair<int,int> ii; typedef vector<ii> vii; typedef vector<vi> vvi; #define LSOne(S) (S & (...
ALGO
0.999694
4.402123
6bacf482-b372-4bf1-bd0a-799644f86dd3
Zimse12345/Code
Luogu/P1474 [USACO2.3]Money System.cpp
#include <cstdio> #include <algorithm> #include <cstring> #include <vector> #include <cmath> #include <set> #include <map> #include <queue> #include <stack> #include <iostream> #include <cstdlib> #include <ctime> #define int long long #define ull unsigned long long using namespace std; int read(){int qrx=0,qry=1;cha...
ALGO
0.999976
3.775669
97b7535d-e510-4dc3-af82-c46617d8b89a
PranavMahara/CPP
Online Projects/Pattern/Pyramid-Alphabets-2.cpp
// A // rows --> 5 // A B // A B C // A B C D // A B C D E #include<iostream> using namespace std; int main(){ int rows; cout<<"Enter the number of rows: "; cin>>rows; for(int i=0; i<rows; i++){ int k = 0; for(int j=rows-i; j<=rows; j++){ cout<<(char)('A'+k)<<" "; ...
ALGO
0.994066
3.98399
7d03e04f-81d4-472b-875e-a0ec5207cb14
nave7693/leetcode
033-search-in-rotated-sorted-array.cpp
// https://leetcode.com/problems/search-in-rotated-sorted-array/ // really dumb solution that does one extra binary search when the array is rotated... can just do it in one binary search // by looking at which half-segment is ordered, and if the target is between the min/max of the ordered segment, use that // segmen...
ALGO
0.999997
6.638533
54de5d2b-ad8a-455c-9e03-0e7bac741c06
ishandutta2007/codeforces
orzdevinwang/normal/1434/C.cpp
#include<bits/stdc++.h> using namespace std; #define L(i, j, k) for(int i = (j), i##E = (k); i <= i##E; i++) #define R(i, j, k) for(int i = (j), i##E = (k); i >= i##E; i--) #define ll long long #define ull unsigned long long #define db double #define mp make_pair int T; ll a, b, c, d; int main() { scanf("%d", &...
ALGO
0.999789
3.434218
c58a2340-7538-48ab-bc05-0f07cd3793e7
alexandraback/datacollection
solutions_5753053697277952_1/C++/Erfaniaa/A2.cpp
#include <bits/stdc++.h> using namespace std; #define MAXN 110 int t, n; bool isValid(vector<int> v) { int sum = 0; for (auto x: v) { // cout << "-" << x << "-"; sum += x; } // cout << sum << endl; sort(v.begin(), v.end()); if (v[0] < 0) return false; return v[v.size() - 1] * 2 <= sum; } int main() {...
ALGO
0.999805
4.166664
00c418d7-e2c0-411f-8d22-a51282c6938b
ivabby/Competitive-Programming
LeetCode/LeetCode Practice Problems/541. Reverse String II.cpp
class Solution { public: string reverseStr(string s, int k) { string ans = ""; int n = s.length(); for(int i=0;i<n;) { string rev = ""; int j = i; while(j < min(n , i+k)) { rev = s[j] + rev; j++; ...
ALGO
0.999947
6.095713
f48f9fd7-cfd0-4a72-9883-c6333b06010f
KanishAnand/CompetitiveCoding
CodeforcesContests/contest#644/6.cpp
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> using namespace std; // using namespace __gnu_pbds; #define lli long long int #define llu unsigned long long int #define fr(va, beg, end) for (lli va = beg; va < end; va++) #define pb push_back #define rt return...
ALGO
0.999937
4.506906
be26988e-7f69-4f22-96b6-6f1328672bea
statco19/BOJ-problems
2512.cpp
#include <bits/stdc++.h> #define vt vector #define en '\n' #define ll long long #define ld long double #define ioa insert_or_assign #define umap unordered_map #define prq priority_queue #define pb push_back #define pii pair<int,int> #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() #define rev(c) (c)...
ALGO
0.999984
4.742819
0c346c37-f521-4236-b35b-90ac64ecef0c
Babushkin05/HSE_SE_ALGO
BDZ5/P2/bloom_filter.cpp
#include "bloom_filter.h" BloomFilter::BloomFilter(size_t hashes, size_t bits) : _hashes(hashes), _bits(bits) { _filter.resize(bits, false); } void BloomFilter::add(const std::string & str) { for(size_t i = 0; i< _hashes; ++i){ _filter[_get_hash(i, str)] = true; } _raw_set.insert(str); } boo...
ALGO
0.855591
5.716402
c348728c-f37d-475c-99e1-c4965cebecad
sb-shuvon/Problem-Solving
LeetCode/167. Two Sum II - Input Array Is Sorted.cpp
class Solution { public: vector<int> twoSum( vector<int> & numbers, int target) { int i = 0, j = numbers.size() - 1; while ( i < j ) { if ( numbers[i] + numbers[j] == target ) break; else if ( numbers[i] + number[j] < target ) i++; ...
ALGO
0.99995
5.883354
9664c955-aafd-440f-ad1a-2b8212f96da4
GagandeepCodes/Cpp_files
leetcode/twosum.cpp
#include<bits/stdc++.h> using namespace std; vector<int> twoSum(vector<int>& numbers, int target) { int s = 0; int e = numbers.size()-1; vector<int> ans; while (s<e) { if(numbers[s] + numbers[e] == target) { ans.push_back(s+1); ...
ALGO
0.999861
5.379423
65eba1b3-ac74-4b19-93e3-1e6a1ac128de
godxin999/Study
EffectiveModernC++/第八章/item42.cpp
/************************************************************************* > File Name: item42.cpp > Author: godxin999 > Mail: <EMAIL> > Created Time: 2023/5/20 12:07:32 ************************************************************************/ #include <iostream> #include <algorithm> #include <cstring> #include <...
TOOL
0.888652
3.671244
a7f8632e-29eb-429e-a480-a4f91a4b0382
y-aut/AtCoder
src/others/edpc/w.cpp
#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; // clang-format off /* accelration */ // 高速バイナリ生成 #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") // cin cout の結びつけ解除, stdioと同期しない(入出力非同期化) // cとstdの入出力を混在させるとバグるので注意 struct Fast {Fas...
ALGO
0.999735
5.027301
70b0ad97-2b39-483d-b282-0c6857a34ca6
romjanali01673/programming
xyz.cpp
class Solution { public: long long dp[501][501][3]; long long ans(int i,int j,int k,vector<vector<int>>& a) { if(i==a.size()-1 && j==a[0].size()-1) { if(a[i][j]<0 && k<2) { return 0; } return a[i][j]; } ...
ALGO
0.999969
5.463086
81871c34-343f-4e9d-a8f6-7e356b963c27
ogvanetwork/ogva-core
src/key.cpp
#include <key.h> #include <crypto/common.h> #include <crypto/hmac_sha512.h> #include <random.h> #include <secp256k1.h> #include <secp256k1_ellswift.h> #include <secp256k1_recovery.h> static secp256k1_context* secp256k1_context_sign = nullptr; /** These functions are taken from the libsecp256k1 distribution and are ...
TOOL
0.956853
7.364445
e56a7834-d064-4fae-99ea-083a3e4b1483
RitikaBhadani15/DAA
Depth-First-Search.cpp
#include<iostream> #include<conio.h> #include<stdlib.h> using namespace std; int cost[10][10],i,j,k,n,stk[10],top,v,visit[10],visited[10]; int main() { int m; cout <<"Enter the no of vertices\n"; cin >> n; cout <<"\nEnter the no of edges\n"; cin >> m; cout <<"\nEDGES \n"; for(k=1;k<=m;k++) { cin >>i>>j; cost[i][j]=1;...
ALGO
0.999979
3.795765
937eb23b-b989-49c6-99a8-dc5af5a6034c
devansh-kumar-jha/Advent_Of_Code
aoc2023/day8/day8.1.cpp
#include<bits/stdc++.h> #define int long long int using namespace std; #define inf 1e18 void dkj() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); } int read_num(string& s,int& i) { int num=0; while(i<s.length() && s[i]>='0' && s[i]<='9') { num=num*10+(s[i]-'0'); i++; } return num...
ALGO
0.999231
3.779903
bd0fc0b4-4130-42f0-8914-2417cb05be92
nandajigyansu/CSES-Problem-Set-Solutions
Dynamic Programming/10. Edit_Distance.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); string a, b; cin >> a >> b; int m = a.length(); int n = b.length(); int dp[m + 1][n + 1]; for (int j = 0; j <= n; j++) { dp[0][j] = j; } for (int i = 0; i <=...
ALGO
0.999963
4.143387
70567aab-bf86-48e0-bfe7-3db15ccc8ac5
H-sooyeon/Algorithm
Solved_ac/동전 뒤집기.cpp
#include <bits/stdc++.h> using namespace std; int n, bit_arr[21]; char arr[21][21]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n; string s; for (int i = 0; i < n; i++) { cin >> s; int bit = 0; for (int j = 0; j < n; j++) { arr[i][j] = s[j]; if (s[n-j-1] == ...
ALGO
0.999918
3.280583
3aa817ab-fcb9-402d-a7fd-4e1347725818
Dfkuaid/My_Files
cpp/Practice/Luogu/1000/P1390/P1390.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #define ll long long #define mset(l, x) memset(l, x, sizeof(l)) using namespace std; const int N = 4000100; const int INF = 0x3fffffff; int n, prm[N], pcnt, nprm[N]; ll phi[N], sphi[N], ssphi[N]; void prework(int x) { phi[1] = 1; f...
ALGO
0.999968
4.471768
658247d1-31ab-4ca9-8afe-ddecd22583a4
luketrenaman/competitive-programming
BPC/C.cpp
#include <bits/stdc++.h> using namespace std; template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; } template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::va...
ALGO
0.999979
4.556348
0d46c9b5-b010-448c-b5ce-1345b92ad208
ishandutta2007/codeforces
peterr/normal/1454/D.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while (t--) { long long n; cin >> n; vector<pair<long long, int>> primes; long long temp = n; for (int i = 2; (long long) i * i <...
ALGO
0.999938
4.38114
cf59a9ec-2be0-454a-9d3c-cb3a98938dac
priyanshugajera/bca4
priyanshu_c++/PRIME_CL.CPP
#include<iostream.h> #include<conio.h> class prime { private://access specifier int num; void fun(int); public://access specifier void demo() { cout<<"Enter a number="; cin>>num; fun(num); } }; void prime::fun(int num) { int a,count=0; for(a=1;a<=num;a++) { if(num%a==0) { count++; } } ...
ALGO
0.994535
3.223192
ed081e99-ce4f-4302-94e0-55717800a846
lamnd09/Blockchain-Dev-School
Simple_BlockChain_Cplus/blockchain/sha256.cpp
#include <cstring> #include <fstream> #include "sha256.h" const unsigned int SHA256::sha256_k[64] = //UL = uint32 { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1,...
ALGO
0.994328
6.033772
cc41de47-87d2-4a4f-a237-f45807eda44e
Ramzy842/ft_irc
commands/utils.cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* utils.cpp :+: :+: :+: ...
TOOL
0.879076
3.731
46d23910-bc40-40ec-adb0-c31844956a6e
DuyNguyen6080/monte-carlo-texas-poker
State/State.cpp
#include "State.h" int straightFlushValue = 1; int straightValue = 1; int flushValue = 1; int fourOfAKindValue = 1; int fullHouseValue = 1; int threeOfAKindValue = 1; int twoPairValue = 1; int onePairValue = 1; int highCardValue = 0; int State::checkStraightFlush(const std::vector<Card> &cards) { // Check each sui...
ALGO
0.999134
5.83099
0b4a7746-5e2f-41a6-9e71-4752f99cbeec
Shivaniyadav2910/DSA-Practice-problem
Move_All_nega_Array_DSA.cpp
#include<iostream> using namespace std; void shiftall(int arr[],int start,int end){ while(start<=end){ if(arr[start]<0 && arr[end]>0){ start++; end--; }else if(arr[start]>0 && arr[end]<0){ swap(arr[start],arr[end]); start++; end--; ...
ALGO
0.999942
3.919445
4b8320a3-34f4-4f78-8c9d-53b2a81974ae
RinCloud/TrickCatcher
Datasets/TrickyBugs/GenProgs/dpp_generated_progs_cpp/p02964/p02964_num7_parsed.cpp
#include <iostream> #include <vector> #include <unordered_set> int main() { int N, K; std::cin >> N >> K; std::vector<int> A(N); for (int i = 0; i < N; i++) { std::cin >> A[i]; } std::unordered_set<int> s; std::vector<int> result; for (int i = 0; i < N * K; i++) {...
ALGO
0.999972
4.080903
a79c4b55-7534-4835-83d7-7150d3244256
projeto-de-algoritmos/Greed_53_exercicios
Maximum Operation Count.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int N, K; // Lê os valores de N e K fornecidos pelo usuário cin >> N >> K; // Cria um vetor chamado 'vetor' com tamanho N para armazenar os valores vector<int> vetor(N); // Lê N valores do usuário e...
ALGO
0.999953
5.321185
35ed3d2a-b4ef-40aa-a2fe-a5b3dd037029
luke333z/pbinfo.ro
#2901_datapal.cpp
#include <iostream> #include <fstream> #include <iomanip> #include <cmath> std::string filename = "file"; std::ifstream in("datapal.in"); std::ofstream out("datapal.out"); bool verifyPal(int n) { int aux=n,pal=0; while(n) { pal=pal*10+n%10; n/=10; } return (aux==pal); } int main ()...
ALGO
0.99977
3.802766
ee216595-7b09-4d5b-b2ce-c174030be2c9
chuangao/BicMixC
myHeader.cpp
#include <stdlib.h> #include <gsl/gsl_sf_gamma.h> #include <math.h> #include <Eigen/Dense> #include <limits> #include <stdio.h> #include <fstream> #include <ostream> #include <string> #include <sstream> #include <iostream> #include <gsl/gsl_rng.h> #include <gsl/gsl_randist.h> #include <float.h> #include <gsl/gsl_s...
ALGO
0.998583
3.533184
d63675e0-eb99-4f54-b514-2646f75d39c9
ZERstar/Leetcode
0455-assign-cookies/0455-assign-cookies.cpp
class Solution { public: int findContentChildren(vector<int>& g, vector<int>& s) { int cnt=0; sort(begin(g),end(g)); sort(begin(s),end(s)); int i=0,j=0; while(i<g.size() && j<s.size()){ if(g[i] <= s[j]){ cnt++; i++; } ...
ALGO
0.999892
5.893775
6dc9db0b-52bb-4035-8c42-8e10735aca9e
jeonghoj/problem-solving
cpp/programmers/stack-queue/_2/_2.cpp
// // Created by Jeongho on 2019-10-31. // #include <string> #include <vector> #include <queue> #include <iostream> #include <algorithm> using namespace std; int main(){ vector<int> priorities; for(auto i : {1,1,9,1,1,1}){ priorities.push_back(i); } // // for(auto i : {2,1,3,2}){ // pri...
ALGO
0.999883
3.627542
7a669732-1acf-4967-94ce-b18fc36a9e68
SWEG-2015EC-Batch/Felix
ETS1067_15_NATNAEL_KEBEDE/Activity 3.1/grade_calculator/grade_calculator.cpp
#include <iostream> using namespace std; int main(){ float mark; cout<<"Enter the students mark out of 100: "; cin>>mark; if(mark >= 0 && mark <= 100){ if(mark < 30){ cout<<"result= "<< = "F"; } else if(mark < 45){ cout<<"result= " = "D"; } ...
TOOL
0.98369
3.021927
b94c6444-9c56-4b68-a136-aa7733dd8863
yielding/code
cpp.boost/compute/transform/transform_data.cpp
#include <iostream> #include <string> #include <vector> #include <cstdlib> #include <chrono> #include <boost/compute/event.hpp> #include <boost/compute/system.hpp> #include <boost/compute/algorithm/copy.hpp> #include <boost/compute/algorithm/transform.hpp> #include <boost/compute/async/future.hpp> #include <boost/comp...
ALGO
0.940058
4.274395
da4c7f25-2390-4c52-8f71-f57a8e1f8ec0
jaredramey/AutomationTest_Playground
Engine/Source/ThirdParty/nvTextureTools/nvTextureTools-2.0.8/src/src/nvimage/ColorBlock.cpp
// This code is in the public domain -- <EMAIL> #include <nvmath/Box.h> #include <nvimage/ColorBlock.h> #include <nvimage/Image.h> using namespace nv; namespace { // Get approximate luminance. inline static uint colorLuminance(Color32 c) { return c.r + c.g + c.b; } // Get the euclidean distance between th...
TOOL
0.91545
3.769066
b5821257-4deb-4176-95a0-a0bdf458e618
dhruv-vavliya/Codeforces
phase_2/test_69.cpp
/* ▄▄▄▄▄ ▄ ▄ ▄ ▄ ▄▄▄▄██▄████▀█▀█▀█▀██▄ @author ▀▄▀▄▀▄████▄█▄█▄█▄█████ DHRUV ▀▀▀▀▀▀▀▀██▀▀▀▀██▀ ▄██ VAVLIYA ▀▀ ▀▀ ▄▄██▀ AMMI JAAN KEHTI THI KOI CODE CHHOTA NAHI HOTA OR... */ //Let's define #include <bits/stdc++.h> using ...
ALGO
0.999913
4.27913
c892683e-284b-4140-ba98-514e55b41157
sk-aravind/model-predictive-control
src/Eigen-3.3/doc/examples/tut_arithmetic_scalar_mul_div.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; int main() { Matrix2d a; a << 1, 2, 3, 4; Vector3d v(1,2,3); std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl; std::cout << "0.1 * v =\n" << 0.1 * v << std::endl; std::cout << "Doing v *= 2;" << std::endl; v *= 2; std::cout << ...
ALGO
0.967439
3.669638
0be68d8e-9758-4930-874c-b4a75f042a84
Ravikisha/CodeArchive
LeetCode/cpp/RemoveKDigits.cpp
class Solution { public: string removeKdigits(string num, int k) { if (k >= num.size()) return "0"; stack<int> stk; for (int i = 0; i < num.size(); i++) { while (k > 0 && !stk.empty() && stk.top() > num[i]) { stk.pop(); ...
ALGO
0.999993
6.567216
2572bf70-980a-4deb-8a20-506041d07488
akommula/CompetitiveProgramming
codeforces/streets.cpp
#include <iostream> #include <algorithm> #include <string.h> #include <vector> #include <math.h> #define MAX_N 31005 #define f first #define s second using namespace std; string str; int DP[MAX_N], cnt[255]; int N, M, K, T; int main() { cin >> T; for (int ii = 0; ii < T; ii ++) { cin >> N >> M...
ALGO
0.999789
3.83579
e2c8aaeb-8fc9-4ee8-87b9-89c9f312c619
asuhacoder/AtCoder
ABC/161/a.cpp
#include<iostream> using namespace std; int main(void) { int X, Y, Z; cin >> X >> Y >> Z; cout << Z << " " << X << " " << Y << endl; }
ALGO
0.999711
3.499551
8332ffd2-7862-4b36-84db-d17814ad0da6
tahsinsoha/Problem-solving-
Codeforces/strings equalization.cpp
#include<bits/stdc++.h> using namespace std; int main(){ string s; string t; set<char>st,tt; set<char> :: iterator it,it2; int q; cin>>q; int flag ; while(q--){ cin>>s; cin>>t; flag=0; for(int i=0;i<s.size();i++){ st.insert(s[i]); } for(int i=0;i<t.size();i++){ tt.insert(t[i]); ...
ALGO
0.999869
4.480623
abc2d650-0165-415b-9cd2-dfb30692876f
RakibLiar/LeetCode
0129-sum-root-to-leaf-numbers/0129-sum-root-to-leaf-numbers.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.999943
6.581186
6600be9f-62b4-42c1-82a5-8c196bb2e0e6
sauravbania/Uncertainty-Quantification-CMS
cpp_substructure/compute_tauN.cpp
// compute_tauN.cpp #include <iostream> #include <vector> #include <string> #include "fastjet/PseudoJet.hh" #include "fastjet/ClusterSequence.hh" #include "fastjet/contrib/Nsubjettiness.hh" #include "fastjet/contrib/AxesDefinition.hh" #include "fastjet/contrib/MeasureDefinition.hh" #include <fstream> #include <sstrea...
DATA
0.994231
6.641824
1e17c698-3d65-445d-ab85-39b3bf79fc58
AnjaliPatle/Leetcode-Challenge
November_Challenge/Problem13.cpp
class Solution { public: Node* connect(Node* root) { if(!root) return NULL; queue<Node*> q; q.push(root); while(!q.empty()){ int n = q.size(); for(int i=0;i<n;++i){ Node* cur = q.front(); q.pop(); if(i == n-1) cu...
ALGO
0.999858
5.36722
65a1f671-5730-403f-9fd6-de09350e35f1
utchy-su/AtCoder
ABC163/b.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll N, M; cin >> N >> M; vector<int> A(M); for (int i = 0; i < M; i++) cin >> A[i]; ll sum = 0; for (int i = 0; i < M; i++) sum += A[i]; if (N - sum >= 0) cout << N - sum << endl; else cout << -1 << endl; return 0; }...
ALGO
0.999982
4.21027
f0cf7994-32fe-4e47-8f25-b28c1ffb5775
liaoy14866/algorithmic_code
code/BZOJ_1_of_10_NOIP.cpp
#include<cstdio> #include<cmath> #include<algorithm> #include<vector> const int none=1e9+7; using namespace std; char ch; inline void read(int &a){ for(ch=getchar();ch>'9'||ch<'0';ch=getchar()); for(a=0;ch<='9'&&ch>='0';ch=getchar())(a*=10)+=ch-'0'; } int n,m; struct rec{ int u,v,minn,maxn,num; }E[70010]; int L[7001...
ALGO
0.999974
4.015231
5d0df6cd-7d36-46b1-8a23-49b0025e7275
rohitbhatghare/c-c-
Sept-22-20/ArOfCylinderInside.cpp
#include<iostream> using namespace std; class area { public: float a,h,r; float pi=3.14; int get() { cout<<"Enter the value of radius \n"; cin>>r; cout<<"Enter the value of height \n"; cin>>h; } int cal() { return a=pi*r*r*h; } }; int main() { ar...
TOOL
0.895789
3.575098
68acf4e0-a839-40e4-a405-4b7ea9061a2b
yancouto/competitive-programming
ojs/cc/grect.cpp
#include <bits/stdc++.h> using namespace std; #define fst first #define snd second typedef unsigned long long ull; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; #define pb push_back #define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++) template<typename T> inline T ...
ALGO
0.999835
3.621242
03f6a24f-f146-4b02-8c8a-e5e16e2c8f60
Techno-o76/tech_learning_tinkering
cpp/oops_cpp/urinary_operator_overloading.cpp
// -x !x #include<bits/stdc++.h> using namespace std; class par { public: int x,y; par(int a,int b) { x=a; y=b; } par operator-() { x=-x; y=-y; return par(x,y); } void display() { cout<<x<<" "<<y<<e...
ALGO
0.988669
3.614838
a359d6cc-196a-48a6-81c5-d8321ced4465
littleDing/leetcode
4Sum.cpp
//Attemp #1 //from 2013-09-28 18:19 //to 2013-09-28 19:21 //failed before small AC: CE*3 + RTE*4 + WA //failed before large AC: None class Solution { map<int,vector<pair<int,int> > > pairs; vector<int> values,counts; map<int,int> idx; vector<vector<int> > ans; public: vector<vector<int> > fourSum...
ALGO
0.999943
5.399925
b1692032-ec74-4ed3-85c0-4076bca091a1
dgcnz/competitive-programming
atcoder/dpF-lcs.cpp
#include <algorithm> #include <iostream> #include <string> using namespace std; const int NMAX = 3e3 + 11; string s, t; int mem[NMAX][NMAX]; string reconstruct(int i, int j) { if (i == 0 or j == 0) return ""; if (s[i - 1] == t[j - 1]) return reconstruct(i - 1, j - 1) + s[i - 1]; else ...
ALGO
0.999954
4.86229