uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
bfaaac52-ef76-4182-9564-68dc0a871960
dwent/MEFTop
Fea37/MathTool.cpp
#include "MathTool.hpp" const double PI=3.1415926535897932384626433832795028841971693993751; const double EXTRA=1.0e-10; void Mysubtract(const vector<double> &c1, const vector<double> &c2, double *cc) { cc[0] = c1[0] - c2[0]; cc[1] = c1[1] - c2[1]; cc[2] = c1[2] - c2[2]; } //==============================...
ALGO
0.996046
4.764178
54599a8c-e5a0-4c9e-8454-8f3caddd2820
magnusl/sshd
src/diffie-server.cpp
#include "CDiffieHellman.h" #include "CTransport.h" #include "messages.h" #include "debug.h" #include "errors.h" #include "ArrayStream.h" #include "sshd.h" namespace ssh { /* CDiffieHellman::ServerKeyExchange * Performs the Diffie-Hellman keyexchange. */ int CDiffieHellman::ServerKeyExchange( ...
ALGO
0.99669
6.466434
35244792-5b4f-4289-b62d-eba95cd231e8
akgcoin/akg-core
src/rpc/client.cpp
#include <rpc/client.h> #include <rpc/protocol.h> #include <util.h> #include <set> #include <stdint.h> class CRPCConvertParam { public: std::string methodName; //!< method whose params want conversion int paramIdx; //!< 0-based idx of param to convert std::string paramName; //!< parameter name ...
CONFIG
0.945521
7.31784
13b0240f-47a0-4c3d-8873-6174adafef0f
xanarry/ACM-ICPC
区间内素数个数.cpp
#include <iostream> #include <cmath> using namespace std; int main(int argc, char const *argv[]) { int a, b, ans = 0; cin >> a >> b; for (int i = a; i <= b; i++) { int j = 2; for (; j <= sqrt(i); j++) if (i % j == 0) break; if (j > sqrt(i)) ...
ALGO
0.999831
4.15043
0f7333f4-e46b-4d7c-90fa-8753ac376115
CostaHector/FileXplorer
Tools/LongPathFinder.cpp
#include "LongPathFinder.h" #include "Logger.h" int LongPathFinder::MAX_PATH_LENGTH {260}; void LongPathFinder::SetMaxPathLength(const QString& maxPathLengthStr) { bool isnumeric = false; int maxPathLength = maxPathLengthStr.toInt(&isnumeric); if (!isnumeric) { LOG_W("Insert index[%s] must be a number, uncha...
TOOL
0.917
4.847469
bbc98c6f-0ea0-4481-a11f-207ed6bcf984
Prabhat-2101/Data_Structures_Basic_To_Advance
GreedyAlgorithm/kruskals_algorithm.cpp
// User function Template for C++ class Solution { public: int find(int idx, vector<int> &parent){ if(parent[idx] == -1) return idx; return parent[idx] = find(parent[idx],parent); } void union_(int a,int b, vector<int> &parent){ parent[b] = a; } bool detect_cycle(int a,int ...
ALGO
0.999952
5.504115
a9e32671-3640-4a27-9748-8edcc7e3fb85
Kujakuh/EssentiaEngine
thirdparty/opencv-4.10.0/samples/cpp/tutorial_code/snippets/imgproc_HoughLinesCircles.cpp
#include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> #include <math.h> using namespace cv; using namespace std; int main(int argc, char** argv) { Mat img, gray; if( argc != 2 || !(img=imread(argv[1], IMREAD_COLOR)).data) return -1; cvtColor(img, gray, COLOR_BGR2GRAY); // smooth it, ot...
ALGO
0.942717
4.571236
09208c33-b958-4097-a471-ab82c9d8e205
iwts/data-structure
trie-tree(static).cpp
// 静态字典树,数组实现。样例参考POJ3630 #include<iostream> #include<algorithm> #include<string> #include<vector> #define MAXLIST 110000 using namespace std; int trie[MAXLIST][10]; int tree_point; void init_tree() { tree_point = 1; memset(trie, 0, sizeof(trie)); } void insert_tree(string s) { int next_p = 0, temp; int len = ...
ALGO
0.999987
4.512352
ef511e01-fc47-4504-851f-b2bb8766e26d
akashnayakx/Coding-practice
cops and thieves/main.cpp
//https://www.codechef.com/problems/COPS #include <iostream> #include <vector> //#include <cstdef> using namespace std; int main() { int t; cin>>t; while(t--) { int arr[101]={0}; int count1=0; int M,x,y; cin>>M>>x>>y; int pos; int dis=x*y; fo...
ALGO
0.999355
3.429499
affdf018-909b-43ac-b8c1-972a70b0231a
DorseyChen/Dorsey_Chen
OOP/Lab04/2_sample.cpp
#include <iostream> using namespace std; class Fraction { private: int numer; int denom; // Calculate the "greatest common divisor" of the two integers int gcd(int, int); // Calculate the "least common multiple" of the two integers int lcm(int, int); public: // If the initial values are not as...
ALGO
0.994407
4.947794
3a008b9d-4f9e-465e-8715-3197fb1394ad
Vishu-Kaushik/Good-DSA-Codes-
Matrix/introduction.cpp
#include <iostream> using namespace std; /* 1. Elements can be stored in row major order(C++ follows this order) int arr[m][n] where m is the number of rows and n is the number of columns 2. Internal curly brackets are optional : int arr[3][2] ={10,20,30,40,50,60} 3. Only the first dimension can be ommitted when ...
ALGO
0.957315
4.547765
07a9b4d3-81f2-440b-ba41-6a551603359b
DenizBraven/Codeforces
45I - TCMCF+++.cpp
#include <cstdio> #include <vector> #include <algorithm> int main(){ long n; scanf("%ld", &n); std::vector<long> pos, neg; long z(0); for(long p = 0; p < n; p++){ long x; scanf("%ld", &x); if(x > 0){pos.push_back(x);} else if(x < 0){neg.push_back(x);} else if(x == 0){++z;} ...
ALGO
0.999938
3.595237
7a9e7097-ef4f-4f7c-b726-5c6fe43c4d17
NeoClear/leetcode-archive
LinkedListCycleII/main.cpp
#include <bits/stdc++.h> using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution { public: unordered_set<ListNode *> visited; ListNode *detectCycle(ListNode *head) { if (head == NULL) return NULL; auto p...
ALGO
0.999951
5.101783
0a20632e-6d57-4ba9-a953-5cba02596eb8
ih-rakib/Data-Structure-and-Algorithm
GFG160/String/Integer to Words.cpp
// https://www.geeksforgeeks.org/batch/gfg-160-problems/track/string-bonus-problems/problem/number-to-words0335 class Solution { public: vector<string> belowTwenty = {"", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen...
ALGO
0.996641
7.014248
fc3f536d-b3bd-44e4-9b81-9df99eb632c9
arleynm/Exercicios--Ciencia-da-Computacao
1º Período/AESD I/Lista 2/Exercicios Função/exe017.cpp
/*Faça uma função que receba um vetor A(25) “inteiros” e substitua todos os valores negativos de ‘A’ por zero. Imprima o vetor na função principal*/ #include <stdlib.h> #include <stdio.h> void neg(int num[25]) { for(int i=0;i<25;i++) { if(num[i] < 0){ num[i] = 0; } } } int main() { int num[25]; ...
ALGO
0.99822
3.719204
3fc4d7a9-c9c1-4d8c-a4c7-08284d334826
mnhtng/C-plus-Algorithm
C++/TH3/csChanLeVaThuanNghich.cpp
#include <iostream> using namespace std; int main(){ int n; cout << "Nhap so nguyen n : "; cin >> n; int m = n, temp = 0; int even = 0, odd = 0; while( m ){ temp = m % 10; m /= 10; if( temp % 2 == 0 ) even++; else odd++; } cout <<...
ALGO
0.999682
3.781308
bbc43480-20f9-4f8d-bf41-8b7f9e5d134d
aokblast/LeetCode_Problem_Solving
Eazy/21_Merge_Two_Sorted_Lists.cpp
// //Runtime 4 //Memory Usage 15.1 /** * 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...
ALGO
0.999611
5.7989
d8ae7c9f-7e68-4960-80b7-9a3da6d6084a
Padm0069/Leetcode-DSA
0403-frog-jump/0403-frog-jump.cpp
class Solution { public: bool canCross(vector<int>& stones) { int n = stones.size(); map<int, int> mp; for(int i=0; i<n; i++){ mp[stones[i]] = i; } vector<vector<int>> dp(n+1, vector<int>(n+1, -1)); return recur(stones, mp, 0, 0, dp); } bool r...
ALGO
0.99994
5.676035
9d0d33ce-eee8-461d-9d9f-68ec10584c41
igoingdown/leetcode
139.cpp
class Solution { public: bool wordBreak(string s, vector<string>& wordDict) { int ss = s.size(); unordered_set<string> dict; for (string word : wordDict) dict.insert(word); vector<bool> dp(ss + 1, false); dp[0] = true; for (int j = 1; j <= ss; j++) { for...
ALGO
0.999391
6.333603
fc90305a-6925-462f-b512-315d321168d7
arafat-fullstackdev/Basic-Data-Structures
week_3/testCode/assignment/Get_Difference.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: int val; Node* next; Node(int val) { this->val = val; this->next = NULL; } }; void insert_tail(Node*& head, Node*& tail, int val) { Node* newNode = new Node(val); if (head == NULL) { head = newNode; ...
ALGO
0.9997
4.002251
4788b4fe-f885-4f93-aedc-1026476223d8
Julianchan-cyberforce/learn_from_cpp
ch8/8.8/q4.cpp
#include <iostream> int main(){ int outer{ 1 }; while (outer <= 5){ int inner{ 5 }; while (inner >= 1){ if (inner > outer){ std::cout << " "; } else{ std::cout << inner << ' '; } --inner; } std::cout << '\n'; ++outer; } return 0; }
ALGO
0.999266
3.488176
0fa3d76f-8ad8-43e9-9c79-e3fc731b55e3
Bhavik1603/My-Leetcode-Solutions
My Leetcode Solutions/Minimum Operations to Make Array Equal/Minimum Operations to Make Array Equal.cpp
// https://leetcode.com/problems/minimum-operations-to-make-array-equal class Solution { public: int minOperations(int n) { n=pow(n,2); return n/4; } };
ALGO
0.99992
6.02393
644e0616-4954-4248-80b6-7357edbf7548
digant73/Artillery-Sidewinder-X1_releases_main_board
artillery_swx1_marlin_fw_2.0.8.2/standard/source/Marlin-2.0.x/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.cpp
#include "pins_arduino.h" #ifdef __cplusplus extern "C" { #endif // Digital PinName array const PinName digitalPin[] = { PA_0, // Digital pin 0 PA_1, // Digital pin 1 PA_2, // Digital pin 2 PA_3, // Digital pin 3 PA_4, // Digital pin 4 PA_5, // Digital pin 5 PA_6, // Digital pin 6 PA_7, // Dig...
CONFIG
0.878043
6.185098
cb576b53-cc47-4faa-910f-8a2dd966411a
yueyangw/CodeForces
std/607B.cpp
#include <cstdio> #include <climits> #include <vector> using namespace std; bool AssignMin(int* p, int v) { if (v < *p) return *p = v, true; return false; } struct Solution { int N; vector<int> A; vector<vector<int> > F; void Solve() { scanf("%d", &N); A.resize(N); for...
ALGO
0.999894
3.906434
b753beac-24ef-4a79-ada2-b9ffc92c16b5
P79N6A/Codes-1
2015.9~2016.3/ChongQing University Winter Training(160120)F.cpp
#include<algorithm> #include<cctype> #include<cmath> #include<cstdio> #include<cstring> #include<iomanip> #include<iostream> #include<map> #include<queue> #include<set> #include<sstream> #include<stack> #include<string> #define lowbit(x) (x & (-x)) #define root 1, n, 1 #define lson l, m, rt << 1 #define rson m + 1, r, ...
ALGO
0.994361
3.939069
e0639d0a-4da3-46f0-ae16-3a960a87bb33
fxianchao/start_github_cpp
cpp/cpp_primer源代码/10/newcount-size.cpp
#include <algorithm> using std::find_if; using std::for_each; using std::sort; using std::stable_sort; using std::unique; #include <vector> using std::vector; #include <string> using std::string; #include <fstream> using std::ifstream; #include <cstddef> using std::size_t; #include <functional> using std::bind; ...
ALGO
0.998459
5.218729
1a061204-2499-48ca-98fb-b92172da33e6
cupeedrl/CODE
DSA PTIT/CODE PTIT/Divide and Conquer/DSA04025_DAY_SO_VO_HAN.cpp
#include <bits/stdc++.h> using namespace std; int n; const long long MOD = 1e9+7; struct Matrix { long long x[2][2]; friend Matrix operator * (Matrix a, Matrix b) { Matrix c; for(int i = 0; i < 2; i++) { for(int j = 0; j < 2; j++) { c.x[i][j] ...
ALGO
0.999875
4.287003
3ee8d635-f34a-48a1-abdf-cdfc0d86f306
dattocngan/THCS2_PTIT
Homework/bai78_UcnnBcln.cpp
#include<stdio.h> #include<math.h> #include<string.h> long long ucnn(long long a, long long b){ while(a != b){ if( a > b ){ a -= b; }else{ b -= a; } } return a; } int main(){ long long a,b; scanf("%lld%lld",&a,&b); printf("%lld\n%lld",ucnn(a,b),(a/ucnn(a,b))*b); return 0; }
ALGO
0.999871
3.705825
284ea18c-6827-4678-9f0e-5ec5dbebf746
JoaoxVictorMS/Ads_IFSP
Estrutura de Dados II/Exercícios - Slide 8/Qucik Sort/main.cpp
#include <iostream> // Função para trocar dois elementos no array void trocar(int& a, int& b) { int temp = a; a = b; b = temp; } // Função para particionar o array int particionar(int arr[], int inicio, int fim) { int pivo = arr[fim]; // Escolhe o último elemento como pivô int i = inicio - 1; // ...
ALGO
0.999916
6.602844
17c8b367-3f02-4da7-acb1-62a50f41414f
Princelad/DSA-Problems
sortingAlgorithms.cpp
#include <iostream> #include <algorithm> #include <numeric> using namespace std; void printArr(int arr[], int size) { cout << endl; for(int i = 0; i < size; i++) { cout << arr[i] << " "; } cout << endl; } void bubbleSort(int arr[], int size) { bool flag; for (int i = 0; i < size ...
ALGO
0.99991
5.117627
8d0e4f49-2b9c-4ca1-876c-45d73035283c
otavioon/COLA-2022-Tools
datasets/src/algo/codenet/2/s206575925.cpp
#include <iostream> #include <algorithm> using namespace std; bool check(long long a, long long b) { long long c = a + b; while (1) { if (c == 1) { return true; } else if (c % 2 == 1) { return false; } c /= 2; } } int main() { long long n; static long long a[200000]; static bool b[200000]; lon...
ALGO
0.999701
3.80748
eff7a6a6-bc12-4a32-8638-8d0492456495
imulan/procon
atcoder/jag2017autumn/g.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define all(x) (x).begin(),(x).end() typedef complex<double> Point; typedef vector<Point> VP; const double EPS = 1e-5; #define X real() #define Y imag() double dot(Point a,Point b){ return a.X*b.X+a.Y*b.Y; } double...
ALGO
0.999698
3.848698
71beb87f-9e7e-4779-ac26-0967854dbee4
lkc8426/mando_ws
src/ros_tutorials_topic/src/tutorial.cpp
#include <ros/ros.h> #include <carla_msgs/CarlaEgoVehicleControl.h> #include <cmath> #include <nav_msgs/Odometry.h> #include <geometry_msgs/Pose2D.h> #include <tf/tf.h> #include <std_msgs/String.h> #include <visualization_msgs/MarkerArray.h> #include <fstream> #include <vector> #include <sstream> #include <geometry_msg...
TOOL
0.941101
3.773226
7dc14fe3-7621-4e02-985d-42d8d9ce398a
amitrege/CSCI1300-2024-public
lecture/week1/lec4/log_op2.cpp
#include <iostream> using namespace std; int main() { int y = -23; int x = 17; // logical operators &&, ||, ! bool var1 = ( (x < y) || (x != 0) ); cout << "the value of var1 is: " << var1 << endl; // cout << "example evaluations" << endl; cout << "(0 < 200 && 200 < 100) = " << ...
TOOL
0.93232
3.874072
1273e7a5-7a15-4907-99c6-0419aa2e4238
Sandeepvanga22/450-DSA-Questions
c++/Heap/reorganizeString.cpp
#include <bits/stdc++.h> using namespace std; // O(NlogN) approach // class Pair // { // public: // char ch; // int freq; // }; // bool operator<(const Pair &p1, const Pair &p2) // { // return p1.freq < p2.freq; // } // string reorganizeString(string s) // { // priority_queue<Pair> pq; // unorder...
ALGO
0.999994
5.798085
5976cfe6-ec1a-43dc-9761-74671f8f42b1
ishandutta2007/codeforces
jdurie/normal/1348/C.cpp
#pragma GCC target ("avx2") #pragma GCC optimize ("O3") #pragma GCC optimize ("unroll-loops") #include <bits/stdc++.h> using namespace std; template<class T, class S> ostream& operator << (ostream &o, const pair<T, S> &p) { return o << '(' << p.first << ", " << p.second << ')'; } template<template<class, class...> ...
ALGO
0.999963
4.008197
83376185-b81e-41a0-a2ce-1ac2029b514d
qreal/qreal
plugins/robots/thirdparty/Box2D/Dynamics/Joints/b2WeldJoint.cpp
#include <Box2D/Dynamics/Joints/b2WeldJoint.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2TimeStep.h> // Point-to-point constraint // C = p2 - p1 // Cdot = v2 - v1 // = v2 + cross(w2, r2) - v1 - cross(w1, r1) // J = [-I -r1_skew I r2_skew ] // Identity used: // w k % (rx i + ry j) = w * (-ry i ...
ALGO
0.983902
6.806552
b4858f73-b5b9-46de-8fc9-ba86137e340f
giggioo/Prog2
liste/liste.cpp
#include <iostream> using namespace std; struct elem{ int val; elem* next; }; typedef elem* lista; int head(lista l){return l->val;} lista tail(lista l){return l->next;} void stampalista(lista l){ while(l!=NULL){ cout<<head(l)<<" "; l=tail(l); } cout<<endl; } lista insert_elem(l...
ALGO
0.999781
4.188902
b47f7849-8fd5-486c-8277-3a7fdba560d5
sjtu-imperishable-night/code-library
Template/Template of Other Teams/Grimoire/source/computational-geometry/point-in-polygon.cpp
bool inPoly(P p,vector<P>poly){ int cnt=0; for(int i=0;i<poly.size();i++){ P a=poly[i],b=poly[(i+1)%poly.size()]; if(onSeg(p,L(a,b))) return false; int x=sgn(det(a,p,b)); int y=sgn(a.y-p.y); int z=sgn(b.y-p.y); cnt+=(x>0&&y<=0&&z>0); cnt-=(x<0&&z<=0&&y>0); } return cnt; }
ALGO
0.999796
4.406827
760e6dae-aa82-42b9-8ef4-2c1c6f4f0248
AYUSHMOHANJHA/Code4CP
_Online/Codechef/2021/FebLogChallenge/TEAMNAME.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int #define mod 1000000007 int min(int a, int b); int binomialCoeff(int n, int k) { int C[n + 1][k + 1]; int i, j; // Caculate value of Binomial Coefficient // in bottom up manner for (i = 0; i <= n; i++) { for (j = 0; j...
ALGO
0.999922
4.681147
4d5975ff-31fb-4734-bf00-2b81de42810b
mamelnikov/mamelnikov
5 урок/13.cpp
//самостоятельная продвинутая 5, 13 #include <iostream> #include <cmath> using namespace std; double rms(double arr[], int n, int start = 0, int end = -1) { if (end == -1) { end = n; } double sum = 0; for (int i = start; i < end; i++) { sum += pow(arr[i], 2); } return...
ALGO
0.999371
4.906043
5cac4831-9127-47c7-8ade-0eb53fe2bbbe
JoshWolper/MountStHelens
eigen/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp
MatrixXd A = MatrixXd::Random(6,6); cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl; EigenSolver<MatrixXd> es(A); cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl; cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl; complex<double> l...
ALGO
0.999342
3.093769
5d801147-746e-45d5-b9ed-406f06c6fd1f
M4t30/Single-Linked-List
AiSD_node/Source.cpp
#include <iostream> #include <ctime> using namespace std; //************************************************************************************************************************* struct node; void insertNode(node * &Head, int x); void insertNNodesWithRandomValues(node * &Head, int amount); void deleteHead(node * ...
ALGO
0.999588
4.186455
9844f6a4-07d4-4dd6-99ee-bb01135aa05e
tar3q-az1z/Codeforces-solutions
1832B.cpp
// @Author: Mars_Coder // @date: 12-May-23 8:51:52 PM +06 // https://codeforces.com/problemset/problem/1832/B #define _USE_MATH_DEFINES #include<bits/stdc++.h> using namespace std; using lli = long long int; using uInt = unsigned int; using ulli = unsigned long long int; using vi = vector<int>; using vii = vector<lli...
ALGO
0.999902
4.335772
3d9bf89a-a84c-4e7b-bfd5-5cd57702bdef
adityay72/Competitive-Programming-Stuff
Codeforces/anton.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll n,ans; string x; int main() { cin >> n; cin >> x; int k_a =0 ; int k_d=0; for(int i=0;i<n;i++) if(x[i]=='A') k_a++ ;else k_d++; if(k_a>k_d) cout << "Anton\n"; if(k_a<k_d) cout << "Danik\n"; if(k_a==k_d) cout << "Friendship\n"; retur...
ALGO
0.999959
3.955576
a643a28f-965e-43fc-9cdb-11af1d249acf
ishandutta2007/codeforces
lichenkoh/normal/1012/B.cpp
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native") #include "bits/stdc++.h" #include <assert.h> using namespace std; typedef long long ll; typedef long double ld; #define PB push_back #define MP make_pair const int MOD=1000000007; #define endl "\n" ...
ALGO
0.999893
3.807929
ae8dd57b-f901-42ad-adac-45d6d3236f83
sonhl0723/algorithm
BOJ/11441.cpp
#include <iostream> #include <vector> using namespace std; int main(void){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N; cin >> N; vector<int> v; for(int i = 0; i < N; i++){ int a; cin >> a; if(i == 0){ v.push_back(a); } else{ int sum = a + v...
ALGO
0.999805
4.558647
50360945-47a9-41fe-8f1d-be623eb91bd2
sppalkia/tpch-benches
handwritten/utils.cpp
#include <cstdlib> #include <string> #include <cstdio> #include "utils.h" #define BUF_SIZE 4096 bool load_sf(int argc, char** argv, int& SF) { for (int i=1; i<argc; i++) { if (i+1 != argc) { if (strcmp(argv[i], "-sf") == 0) { SF = atoi(argv[i+1]); return true; } } } return ...
DATA
0.878072
3.81494
ef03b085-5345-4367-a5e9-62cf4a8e3ed0
UmamaK47/dsaLab4
main.cpp
#include<iostream> typedef int itemType; using namespace std; class Queue { private: itemType* items; int front; int rear; int maxQue; public: Queue(); Queue(int n); ~Queue(); void insert(itemType item); void remove(); bool isEmpty(); bool isFull(); int peek(); }; Queue::Queue() { maxQue=100; items = ne...
ALGO
0.948003
4.82642
1ca62053-377c-44f8-8cc9-42c1dcd1a90b
bhavenrathod/DSA-LEARNINGS
07 - Array Problems/Easy/Move all zeroes to the end/optimal.cpp
#include <bits/stdc++.h> using namespace std; vector<int> moveZeroes(vector<int> arr, int n) { int j = -1; // finding the 1st index where we have a 0 for (int i = 0; i < n; i++) { if (arr[i] == 0) { j = i; break; } } // check and swap for (in...
ALGO
0.999962
5.9642
a792787f-da6d-419b-b1c7-8f4648440316
nawadkar/codeforces-solutions
1624B-Make AP/4) CODE.cpp
#include<bits/stdc++.h> using namespace std; bool ans(int a1,int a2,int a3){ int d; for(int i = 1;i<=3;i++){ if(i == 1){ d = a3-a2; if((a2-d)%a1 == 0){ if((a2-d) > 0){ return true; } } } else if(i == 2 && (a3-a1)%2 == 0){ d = (a3-a1)/2; if((a1+d)%a2 == 0){ if((a...
ALGO
0.999954
4.592691
612fbff9-fc88-4506-9f48-29831f490806
ethan-mino/Algorithm
Baekjoon/BarkingDog/simulation/14888.cpp
#include <bits/stdc++.h> using namespace std; long long num[11]; long long b = LONG_MIN; long long s = LONG_MAX; char op[4] = {'+', '-', '*', '/'}; int main(){ ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for(int i =0; i < n; i++) cin >> num[i]; vector<char> np; for(int i...
ALGO
0.999978
3.72172
fea52a4f-ba28-4d63-accd-84d3fdfe4202
rahanapr/counter_app
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
4e218e63-d7de-4b4c-9ff4-5539f1024716
mdraselislam1944/leed-code-problem-solving
adjacenc-matrix.cpp
#include <iostream> #include <vector> using namespace std; void addEdge(vector<vector<int>>& adjMatrix, int u, int v) { adjMatrix[u][v] = 1; adjMatrix[v][u] = 1; } void showEdge( vector<vector<int>>& adjMatrix) { int v = adjMatrix.size(); for (int i = 0; i < v; i++) { for (int j = 0; j < v; j+...
ALGO
0.999766
5.215682
bea66a77-96e5-4b86-a1f0-14c222684e77
Sudipta-Trisha/Codeforces_Problems_Solve
1351B. Square.cpp
// Problem: B. Square? // Contest: Codeforces - Testing Round #16 (Unrated) // URL: https://codeforces.com/problemset/problem/1351/B // Memory Limit: 256 MB // Time Limit: 1000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include<bits/stdc++.h> using namespace std; int main() { int test; cin ...
ALGO
0.999729
3.978363
581c7ef2-85b8-462d-9d03-654f7d86c144
Nirbhay-Gupta/Top-notch-DSA-Problem
Graph/Dijkstra's Algorithm/main.cpp
#include <bits/stdc++.h> using namespace std; int getMinVertex(int* dist,bool* visited,int n){ int getMin=-1; for(int i=0;i<n;i++){ if(!visited[i] && getMin==-1 || dist[i]<dist[getMin]) getMin=i; } return getMin; } void dijsktra(int** edges,int n){ bool* visited=new bool[n]();...
ALGO
0.999993
3.85196
b1073e76-8684-4c22-a611-48773cabbd3f
ayushraut2111/DSA-revision-question
distinct elements in every window.cpp
#include<bits/stdc++.h> #define ll long long using namespace std; int main() { int n,k; cin>>n>>k; vector<int>a(n); for(auto &x:a)cin>>x; unordered_map<int,int>mp; for(int i=0;i<k;i++) { mp[a[i]]++; } cout<<mp.size()<<" "; for(int i=k;i<n;i++) { mp[a[i-k]]--; ...
ALGO
0.999972
3.127185
0b20b860-ba2c-4694-8fbc-1c91a64bfe29
Syed-56/DSA
Arrays/Two-Pointer/09_Two-Sum-II-Sorted/TwoSumSorted.cpp
#include <iostream> #include <vector> using namespace std; vector<int> twoSumII(vector<int> nums, int target) { int start=0, end = nums.size()-1; while(start < end) { int sum = nums[start] + nums[end]; if(sum > target) end--; else if(sum < target) start++; else return {...
ALGO
0.999767
5.358502
3c29ac66-dc4c-4cfa-8d77-02739ca04470
Surajmishra17/C-and-DSA
Dynamic Programming/Coin.cpp
#include<bits/stdc++.h> using namespace std; double dp[3005][3005]; double f(vector<double>& p, int i, int x){ if(x==0) return 1; if(i==-1) return 0; if(dp[i][x]>-0.9) return dp[i][x]; return dp[i][x] = f(p,i-1,x-1)*p[i] + f(p,i-1,x)*(1-p[i]); } int main(){ int n; cin>>n; vector<double> p...
ALGO
0.999945
4.030472
9b973fe8-0969-4e56-b57b-0526d3bd4813
ombhamare4/My-CP-Practice
TCS NQT Sheet/A11.cpp
/*Remove Duplicates in-place from Sorted Array*/ #include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; //set vala easy so skip that method vector<int> arr(n); for(auto&itr:arr){ cin>>itr; } //two pointer method sort(arr.begin(),arr.end()); ...
ALGO
0.999957
4.689467
c933e313-e002-4b4f-ab34-2951d3b1216b
ishandutta2007/codeforces
kdh9949/normal/1175/C.cpp
#include <bits/stdc++.h> using namespace std; const int N = 200005; int n, k, a[N]; int main(){ int t; scanf("%d", &t); for(; t--; ){ scanf("%d%d", &n, &k); for(int i = 0; i < n; i++) scanf("%d", a + i); int mn = int(2e9), mi; for(int i = 0; i + k < n; i++){ if(mn > a[i + k] - a[i]){ mn = a[i + k] ...
ALGO
0.999963
3.595036
3a14ad4a-a1ca-4bc3-928b-dbcd1eb0e409
rahulkarhale/stateless-widgets
centercolumn/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.99838
6.772262
7fd6f333-f066-4cf1-baa8-c39d02d05350
AlanFreySpace/algorithm_contest
leetcode/C++/week2/19.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* removeNthFr...
ALGO
0.999984
5.823803
2debdac7-eac5-4ac2-b504-95cc2f15f368
agg-yash/Codeforces
LittleElephantandFunction.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; cout << n; for (int i = 1; i < n; ++i) { cout << " " << i; } cout << endl; return 0; }
ALGO
0.998626
4.016112
b1c15924-7969-442e-bde1-6498434a09ef
eunaJung01/Algorithm-Solving
BOJ/Prefix_Sum/BOJ2143.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; using ll = long long; const int MAX_NUMBERS = 1000; ll A[MAX_NUMBERS]; ll B[MAX_NUMBERS]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; int n; cin >> n; for (int i = 0; i < n;...
ALGO
0.999977
5.356361
81ffef1b-fc39-44b6-a939-991327e639bf
mcoder2014/myNotes
sources/Leetcodes/src/144_binary_tree_preorder_traversal.cpp
#include <iostream> #include <vector> #include <stack> using namespace std; /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ struct TreeNode { int val; TreeNode *...
ALGO
0.999995
6.518292
c0042c60-9e7d-4726-a921-ea269c7b7ff7
josuehfa/DAASystem
CoreSystem/lib/CGAL/examples/Convex_hull_3/dynamic_hull_3.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/point_generators_3.h> #include <CGAL/Delaunay_triangulation_3.h> #include <CGAL/Surface_mesh.h> #include <CGAL/algorithm.h> #include <CGAL/convex_hull_3_to_face_graph.h> #include <list> typedef CGAL::Exact_predicates_inexact_constructions_...
ALGO
0.999231
6.362216
040594dc-c29a-40d1-bbe6-6ca65f12e69c
alesbolka/advent2024
src/day11/day11.cpp
#include "./day11.h" #include "../helpers/helpers.h" #include <iostream> namespace day11 { using std::vector; using std::map; map<uint64_t, uint64_t> blink(map<uint64_t, uint64_t>* stones, int blinkNumber) { map<uint64_t, uint64_t> result(*stones); for (int ii = 0; ii < blinkNumber; ii++) { // std::cout ...
ALGO
0.992729
6.477496
e47f18bd-048e-4ea4-b4fb-27a01f38fc24
charlescoyne1/C--Projects
Module 7/ThreadConcurrency.cpp
#include <iostream> #include <thread> #include <mutex> std::mutex mtx; // Function counting up void countUp() { for (int i = 0; i <= 20; ++i) { std::lock_guard<std::mutex> lock(mtx); std::cout << "Counting up: " << i << std::endl; } } // Function counting down void countDown() { for ...
ALGO
0.981205
7.501234
aaa110c7-6667-4ebf-8116-63853cabac40
assaferan/quinary_birch
src/polyhedral_common/src_poly/Temp_PolytopeEquiStab.cpp
#include "Temp_PolytopeEquiStab.h" int GetNeededPower(int nb) { int h=0; int eExpo=1; while(true) { if (nb < eExpo) return h; h++; eExpo *= 2; } } #ifdef USE_PAIRS /* Unfortunately, the use of pairs while allowing for a graph with a smaller number of vertices gives a running time that is ...
ALGO
0.999207
6.060006
ff26130b-8f00-4988-90b5-9f900b4fc44c
askarakshabayev/PP1-2018
Additional classes/lab5_f.cpp
#include <iostream> using namespace std; int main() { string s; int l, r; cin >> s >> l >> r; cout << s.substr(l, r - l + 1); return 0; }
ALGO
0.981896
3.220682
159b7bea-da3b-451c-9da6-cfbf6b99cbaa
yjjunkim/STT-MRAM_Cache_ieeeAcess
gem5/src/systemc/tests/systemc/misc/sim_tests/srlatch/nor.cpp
/***************************************************************************** nor.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /***************************************************************************** ...
ALGO
0.985932
6.382857
10b6c78a-ef23-42ec-844d-daf7ab4deeaf
Ranjukumari-202114/GFG_problems
gfg16.cpp/main.cpp
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. ******************************************...
ALGO
0.999909
5.487228
6592a71d-d506-4243-a325-1c3828b6965c
YeonWon123/2019_Winter_Data_Structure
Week 9/명신/최대힙/최대힙.cpp
#include <iostream> using namespace std; #define TRUE 1 #define FALSE 0 #define HEAP_LEN 10000 typedef int HData; //Heap  ͸ char typedef int PriorityComp(HData d1, HData d2); // int Լ ĺȯ..? typedef struct _heap //Heap Node { PriorityComp* comp; int numOfData; HData heapArr[HEAP_LEN]; //  Node ִ Ȯϱ }Heap;...
ALGO
0.999972
4.336013
0d8b7c30-bec2-41e1-b8fa-c98df455e23d
Priyanshu2022/crackYourInternship
zday10/segregateEvenAndOddNodesInAList.cpp
// segregate even and odd Node* divide(int N, Node *head){ Node* even=new Node(-1); Node* evenP=even; Node* odd=new Node(-1); Node* oddP=odd; while(head){ if((head->data)&1){ oddP->next=head; oddP=head; } else{ ...
ALGO
0.999875
3.456021
e6bd4553-6fd7-42c3-8ee7-2ac77b254cad
Vishal-RAJ-DEV/DSA
pattern/rombus.cpp
#include <iostream> using namespace std; int main(){ int n; cout<<"enter your number"; cin>>n; for(int i =1;i<=n;i++){ for(int j=1;j<=n-i;j++){ cout<<" "; } for(int j=1;j<=n;j++){ cout<<"*"; } cout<<endl; } }
ALGO
0.99917
3.819609
9b92570b-f99e-47aa-8021-7252334117eb
joaoportolan93/StringsEArrays.cpp
arrays3.cpp
#include <iostream> using namespace std; int main(){ string letra; cout << "Digite uma letra: " << endl; cin >> letra; if(letra == "a" || letra == "e" || letra == "i" || letra == "o" || letra == "u"){ cout << "É vogal!! uaaaau" << endl;} else { printf( "Num é vogal né querido. \n"); } retu...
ALGO
0.986666
3.376691
7b36b2e7-0121-4f66-83f4-e8287ee937e6
jyotsnatiwary/Data-structures-algo
c++ vit ques/salary.cpp
#include<iostream> using namespace std; int main() { float basic_salary, gross_salary, HRA, DA; cout<<"Enter basic salary of Employee : "; cin>>basic_salary; if (basic_salary<1500) { HRA=0.1*basic_salary; DA=0.9*basic_salary; } else { HRA=500; DA=0.98*basic_salary; } gross_salary=basic_salary+HRA+...
ALGO
0.995475
3.116501
0b0ab620-4e1e-4e13-9eb2-71df667029d4
Jazz-45/LeetCode
0110-balanced-binary-tree/0110-balanced-binary-tree.cpp
class Solution { public: int check(TreeNode* root){ if(root==NULL) return 0; int lh=check(root->left); int rh=check(root->right); if(lh==-1 || rh==-1) return -1; if(abs(lh-rh)>1) return -1; return max(lh,rh)+1; } bool isBalanced(TreeNode* root) { ...
ALGO
0.999797
6.354992
b703a88c-435a-4452-9691-26b29e388610
jkelling/openacctests
hostClass/hostClass.cpp
#include <iostream> template<int N> struct HostClass { struct Nested { int a[N]; }; int a; template<typename T> int operator() (const T &b) const {return a+b;} int f(int b) {return a+b;} }; template<class T, class ...Args> void f(size_t nGangs, size_t nWorkers, T t, Args ...args) { #pragma acc parallel num...
ALGO
0.936058
4.549798
ef2a50e9-14ac-422c-8fd0-59486baf0726
gauss1986/optimization_cpp
OLS.cpp
#include <numeric> #include <math.h> #include <sstream> #include <vector> #include <iterator> #include <fstream> #include <iostream> #include <mkl_lapacke.h> #include <txtIO.h> #include <stdlib.h> #include <stdio.h> #include <OLS.h> #include <ticktock.h> #include <misc.h> #include "armadillo" #include <boost/math/distr...
ALGO
0.999062
4.674479
3c2729bc-a88d-4ed5-83a5-94c9facd8ea3
githubcai/Thinking_In_C
Two/C05/OurMin.cpp
#ifndef OURMIN_CPP #define OURMIN_CPP #include "OurMin.h" template<typename T> const T& min(const T& a, const T& b){ return (a<b) ? a : b; } #endif //OURMIN_CPP
TOOL
0.85111
4.158226
612a8b4f-a7e3-4dba-aef2-b2b1bc0e10a7
Rohith-Rao/DSA-codes
trees/rotations and treaps/left rotations.cpp
#include <iostream> using namespace std; struct bstnode { int data; bstnode *lc; bstnode *rc; }; typedef bstnode *bstptr; void left_rotation(bstptr &BT) { bstptr r = BT->rc; BT->rc = r->lc; r->lc = BT; BT = r; } void Rrotate(bstptr &BT, int a) { if(BT->data == a){ left_rotation(BT); ...
ALGO
0.999987
3.970073
af65e7da-24e0-47ed-a1b8-3482a21d7b4d
losfair/cloudkernel
ck-hypervisor/src/profile.cpp
#include <arpa/inet.h> #include <ck-hypervisor/byteutils.h> #include <ck-hypervisor/profile.h> #include <json.hpp> #include <stdexcept> #include <stdint.h> #include <stdio.h> using json = nlohmann::json; bool GlobalProfile::parse(const std::string &_input) { try { json input = json::parse(_input); module_pa...
TOOL
0.907988
5.491498
02f50f74-f9a8-4c52-9f30-64be32d3e073
MRSlothAlan/CodeForcePractice
363B_fence/Source.cpp
#pragma warning(disable : 4996) #include <cstdio> #include <cstring> const int MAX = 1000000; int arr[MAX]; // fence. int main() { int n, k; scanf("%d %d", &n, &k); arr[0] = 0; for (int i = 1; i <= n; i++) { scanf("%d", &arr[i]); // arr[i] += arr[i - 1]; // this approach sometimes fails since the diff can be sm...
ALGO
0.999982
3.838473
5d234b88-121c-42e6-a3df-db7b0ea71a16
ishandutta2007/codeforces
ivan100sic/normal/1519/D.cpp
// Retired? #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long unsigned long ull; typedef double long ld; int n; ll a[5005], b[5005]; int main() { ios::sync_with_stdio(!cin.tie(0)); cin >> n; for (int i=0; i<n; i++) { cin >> a[i]; } for (int i=0; i<n; i++) { cin >> b[...
ALGO
0.999953
3.627162
a3490a5c-f71b-4d1d-988e-8661c67d2e96
sachinsrivastava1028/DSA--Rohit-Negi
Day 15-While and Do-while/Divby3and5-continue.cpp
#include<iostream> using namespace std; int main() { int n; cout<<"Enter the value of 'n': "; cin>>n; for(int i=1;i<=n;i++) { if(i%3==0) continue; if(i%5==0) continue; cout<<i<<" "; } }
ALGO
0.998687
3.167629
a7981be7-234c-4315-a57a-32cb3820514b
oneLuckyman/cpp_pratices
7-18_fun_ptr.cpp
// fun_ptr.cpp -- pointers to functions #include <iostream> double betsy(int); double pam(int); // second argument is pointer to a type double function that // takes a type int argument void estimate(int lines, double (*pf)(int)); int main() { using namespace std; int code; cout << "How many lines of cod...
TOOL
0.984894
6.315677
8ecde864-5cdd-4001-a776-4ec77094987b
Sumanth-NR/CompetitiveProgramming
Platforms/CodeForces/Rounds_0851-0900/Round871_Div4/C_Mr_Perfectly_Fine.cpp
#include <bits/stdc++.h> using namespace std; constexpr int INF = 1e8 + 7; void solve() { int n; cin >> n; int fMin = INF, sMin = INF, bMin = INF; for (int i = 0; i < n; i++) { int t; cin >> t; string s; cin >> s; if (s[0] == '1') fMin = min(fMin, t); if (s[1] == '1') sMin = min(sMin, t); if (s == "11") ...
ALGO
0.99975
5.164272
233db34b-72f1-42db-a910-d607d90dc3bd
artvns/SimpleFvm
simplefvm/src/FVMSolver/CoeffsPartsVelocity/DifferencingScheme/DifferencingSchemeCreator.cpp
#include "DifferencingSchemeCreator.h" namespace fvmsolver { DifferencingSchemeCreator::DifferencingSchemeCreator( Config& config) : config_(config), schemeType_(config_.differencingScheme) { } std::shared_ptr<IDifferencingScheme> Differen...
TOOL
0.97909
5.327977
d9a15423-dd71-4a22-a792-2161ff3c224c
IngenuityCoin/Ingenuity
src/rpc/mining.cpp
#include "amount.h" #include "base58.h" #include "chainparams.h" #include "core_io.h" #include "init.h" #include "main.h" #include "miner.h" #include "net.h" #include "pow.h" #include "rpc/server.h" #include "util.h" #ifdef ENABLE_WALLET #include "db.h" #include "wallet.h" #endif #include <stdint.h> #include <boost/a...
WEB
0.98936
6.104659
1e3c3c68-9218-4737-bedd-499a55fe633b
7ANJ0I2407/Competitive-Coding-Codeforces
B_Binary_Colouring.cpp
#include<iostream> #include<vector> #include<map> #include<unordered_map> #include<set> #include<unordered_set> #include <deque> #include <bits/stdc++.h> using namespace std; #define pb push_back #define pp pop_back #define ll long long #define ld long double #define int long long #define pair pair<int,int> typedef vec...
ALGO
0.999948
4.617133
d9937a31-e932-430a-abc7-3fee49b01a50
freda997/Algorithmic-Experiments-of-Real-World-Network
algorithm/graph.cpp
#include "graph.h" #include <algorithm> Graph make_graph(int num_nodes, std::vector<int> u, std::vector<int> v) { return Graph(num_nodes, u, v); } int Graph::get_num_nodes() { return Node_size; } int Graph::get_num_edges() {// number of edges return edge_size; } bool Graph::is_neighbor(Node u, Node v) { vector<i...
ALGO
0.998356
5.19713
12e5dd1d-b12c-4643-b0f1-61af63af58cc
benedicka/Competitive-Programming
Gym/101020E/15721556_AC_124ms_0kB.cpp
#include<bits/stdc++.h> using namespace std; int t,ans; int x_1,x_2,y_1,y_2,n; int main() { scanf("%d",&t); scanf("%d",&n); while(t--) { scanf("%d %d %d %d",&x_1,&y_1,&x_2,&y_2); if((x_1+y_1)%2!=(x_2+y_2)%2) printf("can't reach!\n"); else { printf("%d\n",max(abs(x_1-x_2),abs(y_1-y_2)) ); } } return 0...
ALGO
0.999849
4.028694
d4abf175-7815-4d2e-9a3c-ba2c546326c1
Hironobu-Kawaguchi/atcoder
Codeforces/Codeforces1406_c_WA.cpp
// https://codeforces.com/contest/1406/problem/C #include<iostream> // #include<algorithm> // #include<string> // #include<numeric> // #include<vector> // #include<map> // #include<tuple> // #include<set> // #include<queue> // #include<deque> // #include<regex> // #include<bitset> // #include<iomanip> // #include<compl...
ALGO
0.999944
4.683628
6969e50b-68e9-4266-961d-9e0628829605
Divyanshu-yadav-18/fore-caster
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
746d4cef-ee81-47de-9269-bbd4e39ae939
codingwill/competitive-programming
Gameloft_Pair_Programming 2020/glid-hard-coinchange.cpp
#include <bits/stdc++.h> //BIAR MANTAB LAH YA #define Willy using #define Indrayana namespace #define Komara std Willy Indrayana Komara; using ll = long long int; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll kem; cin >> kem; ll t; cin >> t; ll coin[t]; for (int ...
ALGO
0.999925
4.135335
aa9bf003-d6b2-4520-94d3-c224448852b1
Vanilla-chan-nya/Contest_Code
Atcoder/abc402/F-zxs.cpp
/************************************************************** * Problem: F-主席树!啊! * Author: Vanilla_chan * Date: * E-Mail: <EMAIL> **************************************************************/ #include<bits/stdc++.h> #define IL inline #define re register #define LL long long #define ll long long #define ULL u...
ALGO
0.999979
4.274706
916783ed-e93c-46f3-b80d-7475272ff324
kajaveom/LeetCodeSolutions
0494-target-sum/0494-target-sum.cpp
class Solution { public: int countWays(vector<int> &nums, int i, int sum, int t, vector<vector<int>> &dp, int th){ if(i>= nums.size() && sum==t) return 1; if(i >= nums.size()) return 0; if(dp[i][sum+th]!=-1) return dp[i][sum...
ALGO
0.999988
6.004391
ac50e361-9029-44de-8aac-df58bc8b4af5
imulan/procon
aoj/vol22/2255.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second #define dbg(x) cout<<#x" = "<<((x))<<endl template<class T,class U> ostream& operator<<(ostream& o, const pa...
ALGO
0.999496
4.040389