uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
441f42c3-48e0-40bc-bcdf-e118cbed999f
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/August/ChefAndWeddingArrange_20200809185420.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #define vv vector #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define printM...
ALGO
0.999565
3.329879
04156a9c-1351-4451-ad62-4d4e77ec2597
MichaelRabinovich/DOG-editor
ext/libigl/include/igl/outer_element.cpp
template < typename DerivedV, typename DerivedF, typename DerivedI, typename IndexType, typename DerivedA > IGL_INLINE void igl::outer_vertex( const Eigen::PlainObjectBase<DerivedV> & V, const Eigen::PlainObjectBase<DerivedF> & F, const Eigen::PlainObjectBase<Derive...
ALGO
0.999706
5.88952
648ce170-d201-44f6-ba57-15b4b51ac4f0
AndySomogyi/chombo
src/lib/src/EBAMRElliptic/BaseDomainBC.cpp
#ifdef CH_LANG_CC #endif #include "BaseDomainBC.H" #include "ViscousTensorOpF_F.H" #include "EBViscousTensorOpF_F.H" #include "BaseBCFuncEval.H" #include "DirichletPoissonEBBC.H" #include "ViscousTensorOp.H" #include "NamespaceHeader.H" //called by MAC projector enforceFaceVel void BaseDomainBC:: enforceFaceVel(Leve...
ALGO
0.996702
7.196517
c1591426-27e0-47bb-80f7-531929b3ff7a
ganghe74/algo
baekjoon/9656_돌 게임 2.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); puts((n%2) ? "CY" : "SK"); }
ALGO
0.998357
3.146082
6954bdd6-2929-42da-ae77-a532ddc0eeea
SpeedyGhost/SNAKE-GAME
PRACTICE/PRACTICE.cpp
#include <iostream> #include <cstdlib> #include <ncurses.h> using namespace std; bool gameOver; const int width = 20, height = 20; int x, y, FruitX, FruitY, score; enum eDirection { STOP, LEFT, RIGHT, UP, DOWN }; eDirection dir; int TailX[100], TailY[100]; int nTail = 0; void Setup(); void Draw(); void Input(); vo...
ALGO
0.968677
4.885262
cdfcde57-2a66-45bb-899a-5d63b385fc73
TerminatedCoder/CPP-Class-Code
Loops/PrimeChecker.cpp
#include <iostream> using namespace std; int main() { int num, c = 0; cout<<"Enter a number: "; cin>>num; for (int i=1; i <= num; i++){ if(num%i==0){ c++; } } if(c==2){ cout<<"The number is prime"; } else { cout<<"Number is not a prime number"; } }
ALGO
0.99941
3.618646
6f6b38cc-98f2-4788-9e9e-eab0d2a3ebc3
hellojarvish61/backchodiiiiiiiii
C++/LL/2.cpp
#include <iostream> using namespace std; class Node{ public: int data; Node * next; Node (){ this ->data = 0; this-> next = NULL; } Node (int data){ this-> data = data; this -> next = NULL; } ~Node(){ ...
ALGO
0.999716
3.855739
48891413-676c-40a3-902b-c3d0e87c47ec
jmartintoro/M07-EditorVectorial-DaniVilla-JoelMartin
editor_vectorial_dj/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.998913
6.76073
402109b1-bcb7-4619-aa2b-9a624fbfabac
KanakornMek/CodePractice
prog23.cpp
#include <iostream> #include <stdio.h> using namespace std; int main() { int rank; cin >> rank; switch(rank) { case 1 : cout << "Your Salary: 2,50,000 BDT"; break; case 2 : cout << "Your Salary: 2,10,000 BDT"; break; case 3 : ...
ALGO
0.986511
3.520681
4ea0b8f9-2de4-466f-9b70-4a3eb16e563f
ayushpatel497/LeetCode_75_Challenge
Product_Of_Array_Except_Self.cpp
class Solution { public: vector<int> productExceptSelf(vector<int>& nums) { int n=nums.size(); vector<int>ans(n); ans[0]=1; int last=1; for(int i=1;i<n;i++) ans[i]=ans[i-1]*nums[i-1]; for(int i=n-1;i>=0;i--){ ans[i]=ans[i]*last; las...
ALGO
0.999956
6.244119
e851d5c9-f037-411e-9db2-d5edd4cbc98b
ishandutta2007/codeforces
aaaaajack/normal/494/B.cpp
#include<cstdio> #include<cstring> #include<algorithm> #define N 100100 #define Q 1000000007 int ed[N],f[N],cnt=0,dp[N],dp2[N]; char s[N],t[N]; using namespace std; int main(){ scanf("%s%s",s,t); int i,j,len,slen; f[0]=-1; for(i=1;t[i];i++){ for(j=f[i-1];j>=0;j=f[j]){ if(t[j+1]==t[i]) break; } if(j>=0) f[i...
ALGO
0.999992
3.98033
136390a7-87fe-493a-8f3a-1b96e2921087
luanzito010/CSES
Sorting and Searching/Maximum Subarray Sum.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long int; const ll maxn=2e5+10,inf=1e18+10; int n,v[maxn]; ll pref[maxn],aux=inf,resp=-inf; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cin>>n; for(int i=1;i<=n;i++){ cin>>v[i]; pref[i]=v...
ALGO
0.99978
3.374613
f4012cf8-2e63-4da0-9262-5b4876f9eb96
ishandutta2007/codeforces
stevenkplus/normal/627/A.cpp
#include <cstdio> #include <iostream> using namespace std; typedef long long ll; ll s, x; int main() { cin >> s >> x; ll diff = s - x; if ((diff & (x << 1)) || diff & 1) { cout << "0\n"; return 0; } ll ans = 1; for(int i = 0; i < 60; ++i) { if ((x >> i) & 1) { ans *= 2; } } if ...
ALGO
0.999744
3.730285
21828968-bf68-4f8e-93bc-aa14aa96b753
AlvyPiper/MoreGreenTea
csgosdk/game/client/splinepatch.cpp
#include "mathlib/VMatrix.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" //----------------------------------------------------------------------------- // Catmull rom blend weights //----------------------------------------------------------------------------- static VMat...
ALGO
0.931425
4.700703
03129ec0-cad7-473d-bb41-40dbbfe1d34c
ishandutta2007/codeforces
froggyzhang/normal/1004/F.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<vector> #include<algorithm> using namespace std; #define N 100010 typedef long long ll; inline ll read(){ ll x=0,f=1; char c=getchar(); while(c<'0'||c>'9'){ if(c=='-')f=-1; c=getchar(); } while(c>='0'&&c<='9'){ x=(x<<1)+(x<<3)+c-'0'; c=getchar(...
ALGO
0.999849
4.335208
d05e9c70-b1a1-40df-9fd8-12a5ac6dcd93
behradesg/LIGGGHTS-magnificationLens
src/GPU/pair_table_gpu.cpp
/* ---------------------------------------------------------------------- Contributing authors: Trung Dac Nguyen (ORNL) ------------------------------------------------------------------------- */ #include <math.h> #include <stdio.h> #include <stdlib.h> #include "pair_table_gpu.h" #include "atom.h" #include "atom_v...
ALGO
0.99271
6.623958
b86de8ef-5c1a-4728-b4cc-2713d2733055
camil0palacios/Competitive-programming
solutions/codeforce/Educational Codeforces Round 83 (Rated for Div. 2)/B. Bogosort/solution.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while(t--) { int n; cin >> n; int a[n]; for(int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); ...
ALGO
0.999876
5.013075
53173137-6c5d-4065-8dd3-1cf9e2d1fcd5
ottodranik/parallel-programming-labs2
shared/Matrix.cpp
#include "Matrix.hpp" using namespace std; int defaultValue = 1; /** * Example - https://java.mazurok.com/?p=2509 */ Matrix::Matrix(int n, int m) { this->n = n; this->m = m; this->mainMatrix.resize(this->n, vector<int>(this->m, defaultValue)); } Matrix::Matrix(int n) { this->n = n; this->m = 1; this->...
ALGO
0.998023
4.296485
6300bd17-bd23-45c9-8c58-c296dd7d78be
SagenHansda19/Daily-CPP
_1352C_K-th_Not_Divisible_by_n.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int rnk(int n, int mid) { int bef = (int)mid / n; return mid - bef; } void solve() { int n, k; cin >> n >> k; ll l = 1, r = 2LL * k, ans = 0; while(l <= r) { ll mid = l + (r - l) / 2; if(rnk(n, mid) >= k) { ...
ALGO
0.999934
4.148812
906f3cc6-ad9c-441d-a086-cf29ce7a6989
y-yao/kagome2
projection/dimers.cpp
#include <fstream> #include <hps/src/hps.h> #include <iostream> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <vector> #include <chrono> #include <omp.h> unsigned long long site[100], size; std::vector<unsigned long long> bits; int sites, pair[100][2], edges, edge[100][2], defects, defect[100][3]; ...
ALGO
0.999463
4.063299
b06b83ea-3903-4781-a2a5-c5166b548ef5
TheFenrisLycaon/DSA-C--
cp/CodeForces/0600-0699/624A.cpp
#include <cstdio> int main(){ double d, L, v1, v2; scanf("%lf %lf %lf %lf\n", &d, &L, &v1, &v2); double t = (L - d) / (v1 + v2); printf("%.15lf\n", t); return 0; }
ALGO
0.999207
3.541472
b26b9aa9-14ac-47bd-a390-47f0ac659b2a
ishandutta2007/codeforces
saost/normal/1644/D.cpp
#include <bits/stdc++.h> #define FOR(i,l,r) for(int i=(l); i<=(r); ++i) #define REP(i,l,r) for(int i=(l); i<(r); ++i) #define FORD(i,r,l) for(int i=(r); i>=(l); --i) #define REPD(i,r,l) for(int i=(r)-1; i>=(l); --i) using namespace std; const int N = 2e5 + 5, MOD = 998244353; int t, n, m, k, q, x[N], y[N]; int tmp, res...
ALGO
0.999892
4.18373
00401738-b10a-4abb-9c11-a40ca14983d2
AbdallahZerfaoui/HeatEquationSolver
cpp_version/backup/eigen-3.4.0/doc/examples/TutorialInplaceLU.cpp
#include <iostream> struct init { init() { std::cout << "[" << "init" << "]" << std::endl; } }; init init_obj; // [init] #include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { MatrixXd A(2,2); A << 2, -1, 1, 3; cout << "Here is the input matrix A before decompositi...
ALGO
0.99968
3.804785
fa9bf38e-7efc-4565-b9f8-b0d23f5b6a1b
caoxu2000/cplusplus-practice
cpp/pointers.cpp
// This program demonstrates the use of pointer variables // It finds the area of a rectangle given length and width // It prints the length and width in ascending order // PLACE YOUR NAME HERE #include <iostream> using namespace std; int main() { int length; // holds length int width; // holds width int area;...
TOOL
0.999536
4.952868
40751032-3e9d-4ff8-8c29-859257b0e4bf
thtiiz/programming.in.th
1024.cpp
#include <stdio.h> int fac[1010], cdf[1010], facof2, facof3, dif=99999; int main() { int n; scanf("%d" ,&n); for(int i=1; i<=n; i++) { scanf("%d", &fac[i]); cdf[i] = fac[i]+cdf[i-1]; } // for(int j=1;j<=n;j++)printf("%d ",cdf[j]);; int son1, son2, son3, max, min; for(int i=1...
ALGO
0.999967
3.135349
a3dce0dc-6671-41da-a341-84b784d19b5c
brubakerconnor/fbam-extra
BMARD/CPPcode/BMARD_V112020.cpp
#include <iostream> #include <string> #include <cmath> #include <RcppArmadillo.h> #include <Rcpp.h> #include <math.h> // [[Rcpp::depends(RcppArmadillo)]] using namespace arma; using namespace Rcpp; using namespace std; // modification based on spectral splines prior from the SDF estimation method of Choudhury (2014) ...
ALGO
0.99995
3.232539
a0acf7b5-c42d-42f1-b396-c99aaccf238b
ZYLZhuPP/OI
NFLS/P1272.cpp
#pragma GCC optimize(3) #pragma GCC optimize("Ofast,unroll-loops") #include<bits/stdc++.h> using namespace std; #define rFor(i, r, l) for (int i = (r); i >= (l); --i) #define For(i, l, r) for (int i = (l); i <= (r); ++i) const int N = 405; template<class C> inline bool cmax(C &x, const C &y) { return y>x? x=y, 1: 0; }...
ALGO
0.999896
4.402373
7e902884-0083-4fc2-8fcb-ac4f6e33b7bf
moto-sm7325/android_device_motorola_sm7325-common
gps/utils/LocHeap.cpp
#include <LocHeap.h> namespace loc_util { class LocHeapNode { friend class LocHeap; // size of of the subtree, excluding self, 1 if no subtree int mSize; LocHeapNode* mLeft; LocHeapNode* mRight; LocRankable* mData; public: inline LocHeapNode(LocRankable& data) : mSize(1), mLeft(NU...
ALGO
0.998238
6.593742
9ff66694-89b7-43b4-bc57-cca7311a6784
SyedaShafi/Algorithm_Phitron
final_selection_contest/emperor_alexander.cpp
#include <bits/stdc++.h> #define ll long long int #define pii pair<int, int> using namespace std; const int N = 1e5 + 1; vector<pair<int, int>> graph[N]; bool vis[N]; class Edge { public: int a, b, w; Edge(int a, int b, int w) { this->a = a; this->b = b; this->w = w; } }; class...
ALGO
0.999765
4.341961
1eb2c530-ac60-48e8-80e0-54586522913b
shelltdf/osgall
prebuild/boost_1_82_0/libs/geometry/doc/src/examples/geometries/adapted/boost_range/sliced.cpp
// Boost.Geometry (aka GGL, Generic Geometry Library) // QuickBook Example //[boost_range_sliced //` Shows how to use a Boost.Geometry linestring, sliced by Boost.Range adaptor #include <iostream> #include <boost/geometry.hpp> #include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/geometries/po...
TOOL
0.859082
4.707787
4cc5594a-b408-462a-957b-ce3f889146e3
wangtongxue-369/xcpc_Code_file
file/vjudge/2025spring_practice/4.1_shu/Q..cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define INF 0x3f3f3f3f #define PII pair<ll, ll> const ll mod = 1e9 + 7; const ll MAXN = 500005; const ll base1 = 131; const ll base2 = 127; ll _ = 1, n, m, ans = 0, a[MAXN], f[MAXN]; // 线段树节点定义 struct SegmentTree { ve...
ALGO
0.999679
4.003909
b4ed6ab5-d72d-435a-b01f-8a1ba796d5c3
Dawid-Witkowski/WIT
2019-2023/semestr-2/Podstawy programowania/2020/podstawy-programowania-2/cw3-zad08.cpp
//Igor Nowicki //IZ02P03 //18608 #include <iostream> using namespace std; int main() { cout << "Podaj długość boku: "; int n; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cout << "*"; } cout << endl; } }
ALGO
0.998714
3.655211
74ba5d26-de5b-4a68-8439-4b3d5c9db3c0
azartheen/leetcode
problems/easy/997-find-the-town-judge.cpp
/* Find the Town Judge In a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town judge. If the town judge exists, then: The town judge trusts nobody. Everybody (except for the town judge) trusts the town judge. There is exactly one person that satisfies prope...
ALGO
0.999877
5.533148
e59a3dcd-e7fc-4e4c-98e2-9ed6e9c62e8e
underscoreanuj/Codes
LeetCode/973_k_closest_points_to_origin.cpp
// divide and conquer solution class Solution { public: void swapPoints(vector<int> &a, vector<int> &b) { vector<int> tmp = a; a = b; b = tmp; } int distance(vector<int> &a) { return (a[0] * a[0] + a[1] * a[1]); } int partition(vector<vector<int>> &points, ...
ALGO
0.999997
5.934932
622ab88f-5574-49b2-b7f0-e222bd74ffc7
Baltzer77/LeetCode
2966.divide-array-into-arrays-with-max-difference.cpp
/* * @lc app=leetcode id=2966 lang=cpp * * [2966] Divide Array Into Arrays With Max Difference */ // @lc code=start class Solution { public: vector<vector<int>> divideArray(vector<int>& nums, int k) { sort(nums.begin(), nums.end()); vector<vector<int>> res; int n = nums.size(); ...
ALGO
0.999649
6.276003
64a6cdde-6d0d-40f0-b399-95837e4f3545
ishi2110/ECE244-Introduction-to-OOP
lab2-release (1)/playMove.cpp
#include "GameState.h" #include "globals.h" // Function prototypes (if you need) void playMove(GameState& game_state) { // Change turn if move is valid, // Change gameOver // Change winner }
ALGO
0.929729
4.213048
9755d7a3-3a40-482f-bfa2-ec4e3807fce0
saikatbishal/final450
doubl_LL.cpp
#include <iostream> using namespace std; struct node { int data; node *prev; node *next; }; node *head; void Insert(int data) { node *temp = new node; temp->data = data; temp->next = head; temp->prev = NULL; if (head != NULL) { head->prev = temp; } head = temp; } void...
ALGO
0.999827
4.281989
bb082c7a-5292-41e4-8230-994f26e41a3e
TheFenrisLycaon/DSA-C--
cp/CodeForces/0900-0999/918A.cpp
#include <cstdio> #include <vector> int main(){ long n; scanf("%ld", &n); std::vector<bool> name(n + 1); long a(1), b(1); name[a] = 1; while(b <= n){long x = b; b += a; a = x; name[b] = 1;} for(long p = 1; p <= n; p++){putchar(name[p] ? 'O' : 'o');} return 0; }
ALGO
0.999489
3.704634
c8378f89-7418-419e-bc08-4959f943ab28
jer22/OI
bzoj/2819/2819.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 500005; int n, q; int val[MAXN], xo[MAXN]; bool rev[MAXN]; int tr[MAXN][2], fa[MAXN]; int st[MAXN], top = 0; void pushup(int x) { int l = tr[x][0], r = tr[x][1]; xo[x] = xo[l] ^ xo[r] ^ val[x]; } void pushdown(int x) { if (rev[x]) { int l = tr[x][...
ALGO
0.999993
4.356743
33c40857-41b7-4120-a636-159e673816d5
ruturajch/neetcode-main
cpp/0763-partition-labels.cpp
/* Partition string so each letter appears in at most 1 part, return sizes Ex. s = "ababcbacadefegdehijhklij" -> [9,7,8] Greedy: determine last occurrence of each char, then loop thru & get sizes Time: O(n) Space: O(1) */ class Solution { public: vector<int> partitionLabels(string s) { ...
ALGO
0.999835
6.71836
636fde7d-825b-4ce7-a3e9-2f0d7ae6ca5d
chaeonee/baekjoon
C++/4991_로봇청소기.cpp
#include <iostream> #include <deque> #include <cstring> using namespace std; struct Pos{ int x, y, time; }; int getDist(int w, int h, Pos s, Pos e, char **room); int getTime(int s, int move, int now, int prev, int n_dust, bool visit[], int **dist); int main() { while(true){ int w, h; cin >> w >> h; if(w =...
ALGO
0.999438
4.102136
c6f4cf83-3ccd-41a2-8465-6d03270921c9
Sarthakdtu/C-Codes
graphs/permutation_swaps.cpp
/* Permutation Swaps Send Feedback Kevin has a permutation P of N integers 1, 2, ..., N, but he doesn't like it. Kevin wants to get a permutation Q. Also he believes that there are M good pairs of integers (ai , bi). Kevin can perform following operation with his permutation: Swap Px and Py only if (x, y) is a good...
ALGO
0.999992
4.698406
a4e14acd-f102-4245-9f5b-f24f12996ec9
DionysiosB/CodeForces
0300-0399/382A-KseniaAndPanScales.cpp
#include <cstdio> #include <iostream> #include <string> int main(){ std::string current(""); getline(std::cin, current); std::string remaining(""); getline(std::cin, remaining); int left = current.find("|"); int right = current.size() - 1 - left; int diff = left - right; if(diff < 0){diff *= -1;...
ALGO
0.999153
3.867629
1a21509a-21ae-421c-ad22-a69b66e7109c
priya-thv/Algorithm
assignment 9/noofgudpairs.cpp
class Solution { public: int numIdenticalPairs(vector<int>& nums) { unordered_map<int,int>mp; int l=0; for(int i=0;i<nums.size();i++){ mp[nums[i]]++; if(mp[nums[i]]>1){ l+=mp[nums[i]]-1; } }return l; } };
ALGO
0.999968
5.807225
d68241eb-3e88-498f-8858-170053a5b678
vektort13/AntidetectFirefox
gfx/skia/skia/src/pathops/SkOpEdgeBuilder.cpp
#include "SkGeometry.h" #include "SkOpEdgeBuilder.h" #include "SkReduceOrder.h" void SkOpEdgeBuilder::init() { fCurrentContour = fContoursHead; fOperand = false; fXorMask[0] = fXorMask[1] = (fPath->getFillType() & 1) ? kEvenOdd_PathOpsMask : kWinding_PathOpsMask; fUnparseable = false; f...
TOOL
0.874997
7.254365
fad7ce1f-64a9-4b7d-8b21-1e1d3eb76da0
tal-athena/BinaryClassifier35
active-learning/trainer.cpp
/* Implementation of Active Learning SVM with DLIB */ #include <iostream> #include <dlib/svm.h> #include <dlib/data_io.h> using namespace std; using namespace dlib; int main(int argc, const char *argv[]) { // Load libsvm data file typedef std::vector<std::pair<unsigned int, double> > sparse_vect_type; std::vecto...
DATA
0.920851
6.472406
d480a47c-3524-4bbf-ab9d-c7dc8f2044bd
Sohel440/gfg
Difficulty: Hard/Sub-arrays with equal number of occurences/subarrays-with-equal-number-of-occurences.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int sameOccurrence(vector<int>& arr, int x, int y) { // code here unordered_map<int,int>mp; int one =0; int two = 0; mp[0]=1; int cnt =0; f...
ALGO
0.999934
5.799615
edf45f1e-cc03-4fd6-adcb-8b3c01f7afe8
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_8728_8.cpp
#include <cmath> #include <iostream> using namespace std; int main() { long X, Y; cin >> X >> Y; cout << (abs(X - Y) <= 1 ? "Brown" : "Alice") << endl; return 0; }
ALGO
0.990846
3.467065
1b439470-da4a-4c2f-8193-b31318be3e35
RUFAID6898/counter_app_ui
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.9988
6.76073
71ad3d52-fffa-4927-b11e-3e6fa8b41427
Sunny9507/dsa
1197-parsing-a-boolean-expression/1197-parsing-a-boolean-expression.cpp
//Approach (Using stack) //T.C : O(n) //S.C : O(n) class Solution { public: char solveOp(char op, vector<char>& values) { if (op == '!') return values[0] == 't' ? 'f' : 't'; if (op == '&') return any_of(values.begin(), values.end(), [](char ch) { return ch == 'f'; }) ?...
ALGO
0.999952
6.559362
93341be8-3d8f-4faf-af40-dc50b00f7a00
ishandutta2007/codeforces
ichyo/normal/246/D.cpp
#include <iostream> #include <sstream> #include <string> #include <algorithm> #include <vector> #include <stack> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <cassert> using namespace std; #define FOR(i,k,n) for(int i=(k); i<(int)(n);...
ALGO
0.999961
4.297185
fa504250-033d-4165-8493-a9c52284a0ae
Iana-Vla-Sidiuk/LabWork
Lab18/Lab18.cpp
// Даны две строки. Определите, совпадают ли они, сравнив их посимвольно. Напишите для этого функцию bool Compare(string S1, string S2). // Вход: две строки. Выход : слово yes, если строки совпадают, слово no в противном случае. #include <iostream> #include <windows.h> #include <string> using namespace std; bool Comp...
ALGO
0.998841
4.036962
6fd40af3-102f-415d-a6b2-c4f0c12ce68b
MatosThiago/Algoritmos
C++/For range declaration.cpp
#include <bits/stdc++.h> using namespace std; int main() { string S{"String"}; vector<int> V{1, 2, 3, 4, 5}; for(auto i:S) { cout << i << " "; } cout << endl; for(auto i:V) { cout << i << " "; } cout << endl; return 0; }
TOOL
0.955637
3.150139
a3fc14c3-7f8b-4830-be61-2579f71d2052
pranavbharadwaj007/Data-structure-and-Algorithm
Mathematics/Exponentiation-II.cpp
// pow of a,b,c #include<bits/stdc++.h> using namespace std; #define MOD (int) (1e9+7) #define int long long int powfast(int a,int b,int m){ if(b==0)return 1; int val=powfast(a,b/2,m); if(b & 1){ return (((a*val)%m)*val)%m; } else{ return (val*val)%m; } } signed main() { int t; cin>>t; while(t--){ int ...
ALGO
0.999961
4.741302
2077ca5e-6bc4-4019-b636-ff58ee6d91a0
Vishal-Ansari/LeetCode-Repo
974 Subarray Sums Divisible by K Medium.cpp
class Solution { public: int subarraysDivByK(vector<int>& nums, int k) { int n=nums.size(); unordered_map<int,int>mp; int ans=0; int sum=0,rem=0; for(int i=0;i<n;i++){ sum+=nums[i]; rem=sum%k; if(rem<0) rem=rem+7; ...
ALGO
0.999887
5.520851
a7ae4ec4-edf0-413c-9ff5-9f326d1762de
ishandutta2007/codeforces
.tx/normal/1417/B.cpp
#ifndef CONTESTSMTH_HEADER_H #define CONTESTSMTH_HEADER_H #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; template <typename K, typename V = __gnu_pbds::null_type> using tree = __gnu_pbds::tree<K, V, less<K>, __gnu_pbds::rb_tree_tag, __gnu_pb...
ALGO
0.999804
4.620485
77991da6-f1f2-4686-9672-4de797ce376c
YuryChebiryak/CCI
chapter3/ex3.4/ex3.4/ex3.4/main.cpp
//3.5 Implement a MyQueue class which implements a queue using two stacks. // a queue has the following functions: push, pop, size // if a push() is invoked, we move all the elements into the first stack and put the new element atop // if the pop() is invoked, we move all the elements into the second stack and pop fro...
ALGO
0.947366
4.945554
340d73e1-c065-4b73-b8d9-dc9532f95e87
BBuf/Image-processing-algorithm
Feature Extraction/WaterSegment.cpp
#include "opencv2/opencv.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "iostream" #include "algorithm" #include "vector" #include "stdio.h" #include "map" #include "unordered_map" #include <math.h> #include <ctime> using namespace std; using namespace cv; Mat speed_rgb2gray(Mat src) { Mat dst(src.rows, src.co...
ALGO
0.994188
3.694516
f5b5a47a-db98-4e8a-8776-2e69274050e3
ge2668/HW
CPP/MOOC/mandantory/Chap4/mooc4_3.cpp
#include<iostream> #include<cmath> #include<iomanip> using namespace std; class Equation { private: int _a, _b, _c; public: Equation(int a, int b, int c){_a = a; _b = b; _c = c;} void solve(); }; void Equation::solve() { if (_a == 0) { if (_b == 0) { ...
ALGO
0.999445
4.194248
c23d8833-f259-4e4a-b935-8a3d08124fa1
Bhavik1603/My-Leetcode-Solutions
My Leetcode Solutions/Convert Binary Number in a Linked List to Integer/Convert Binary Number in a Linked List to Integer.cpp
// https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer /** * 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) ...
ALGO
0.999917
6.24919
372939c1-d7ec-4352-856a-4354c097334b
wildmichael/ParaView3-enhancements-old
VTK/Utilities/verdict/V_HexMetric.cpp
/* * * HexMetric.cpp contains quality calculations for hexes * * This file is part of VERDICT * */ #define VERDICT_EXPORTS #include "verdict.h" #include "VerdictVector.hpp" #include "V_GaussIntegration.hpp" #include "verdict_defines.hpp" #include <memory.h> #if defined(__BORLANDC__) #pragma warn -8004 /* "assi...
ALGO
0.99284
5.610339
35a81984-1507-4181-bab9-9ddcbc1fd8ed
BhuvanBeri/DSA-Begineer-to-Advanced
01. Love Babbar Live DSA/02. Programming_Basics_2/02_if_else.cpp
#include<iostream> using namespace std; int main() { int num; cout << "Enter the value of num" << endl; cin >> num; if (num > 5) { cout << "Num is greater than 5" << endl; } else if (num < 5 && num >= 0) { cout << "Num is not greater than 5" << endl; } else { cout << "...
ALGO
0.994544
3.07073
f42d7bab-7218-4ddf-8d7a-39d43f0c37f1
Saifu0/Competitive-Programming
CP/1500/chef_weird_queries.cpp
#include<bits/stdc++.h> using namespace std; #define NINJA ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define fo(i,n) for(int i=0;i<n;i++) #define Fo(i,k,n) for(int i=k;i<n;i++) #define iii tuple<int,int,int> #define vi vector<int> #define ii pair<int,int> #define vii vector<ii> #define int long long #defin...
ALGO
0.99962
3.939936
17b77c1e-3551-43bb-8193-29939881503c
NickLennonLiu/cpp
bpd/Homework/HW4/carpet.cpp
#include <iostream> using namespace std; int carpets[10000][4]; int n; int x,y, id; bool inArea(int s,int t,int w,int l,int x, int y) { return (x >= s) && (x <= s + w) && (y >= t) && (y <= t + l); } int main() { cin >> n; for(int i = 0; i < n; ++i) cin >> carpets[i][0] >> carpets[i][1] >> carpets...
ALGO
0.999242
4.004446
05f23eb8-5b03-4aaa-828f-96e7d5ed6dde
callowidealist/Algorithms
Kadane's/C++/Kadanes.cpp
#include<bits/stdc++.h> using namespace std; int main(){ vector<int> v={-2,-1,-5,3,7,-2,5,11,-10,-20,11}; int n=v.size(); int mini=*min_element(v.begin(),v.end()); int maxval=mini,curval=mini; for(int i=0;i<n;i++){ curval=max(curval+v[i],v[i]); maxval=max(maxval,curval); } cout<<"Maximum Subarray Sum = "<<ma...
ALGO
0.999963
4.141521
b2562015-5551-44bc-9077-66deeb2ac38c
Rillmo/Baekjoon
p_2436/main.cpp
#include <iostream> #include <cmath> using namespace std; int getGCD(int a, int b) { if (b == 0) return a; return getGCD(b, a % b); } int main() { long long int lcm, gcd; long long int div, a, b, A, B; cin >> gcd; cin >> lcm; div = lcm / gcd; for (int i=1; i<=sqrt(div); i++) { if (div % i == 0) { a = i...
ALGO
0.999909
4.718834
127faf5a-c6e7-4512-8c70-2aceb4dd4b45
matk86/spparks
src/app_membrane.cpp
#include "math.h" #include "mpi.h" #include "string.h" #include "stdlib.h" #include "app_membrane.h" #include "solve.h" #include "random_park.h" #include "memory.h" #include "error.h" using namespace SPPARKS_NS; enum{NONE,LIPID,FLUID,PROTEIN}; /* ----------------------------------------------------------------------...
ALGO
0.999206
5.380408
fea3c9ad-8373-4e74-8eaf-319dd3d50f27
asorgejr/ams-objectmerge
src/ams_utils.cpp
// // Created by asorgejr on 7/11/2021. // #include "ams_utils.h" #include <regex> #include <vector> #include <map> #include <iostream> #include <sstream> using std::regex; using std::regex_search; using std::sregex_iterator; using std::string; using std::smatch; using std::vector; using std::map; using std::cout; us...
TOOL
0.943033
5.942563
44b4eb1c-c977-4fa1-b1a2-42ddc6949ee9
alamgir5/Online-Judge
UVA/3n+1.cpp
#include<bits/stdc++.h> using namespace std; #define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define sq(x) (x)*(x) #define PI acos(-1.0) #define all(x) x.begin(),x.end() #define nl '\n' typedef long long int ll; typedef unsigned long long int llu; int main() { faster int ...
ALGO
0.999938
3.983093
e85753a3-d694-49c6-a832-9e3cd85724fa
mahima-shetty/CodingInterviewPrepCodes
type_of_triangle2.cpp
// * // ** // *** // **** // ***** // Type of triangle 2 #include <iostream> using namespace std; void print_triangles(int n){ for(int i = 1; i<=n; i++){ for(int j = n-i; j>=1;j--){ cout<<" "; } for(int k =1; k<=i; k++){ cout<<"*"; } cout<<...
ALGO
0.999949
3.909074
119d41da-48ed-4d9e-81fd-5cee37d53cf8
ghostbsd/ghostbsd-src
contrib/kyua/utils/config/tree.cpp
#include "utils/config/tree.ipp" #include "utils/config/exceptions.hpp" #include "utils/config/keys.hpp" #include "utils/config/nodes.ipp" #include "utils/format/macros.hpp" namespace config = utils::config; /// Constructor. /// /// \param strict Whether keys must be validated at "set" time. config::tree::tree(const...
TOOL
0.946116
7.204351
49771b6f-300b-4cb2-a698-b7d8982b43d7
rayz1065/competitive-programming
itoi/2022/glass/main.cpp
#include <bits/stdc++.h> #define MAXN 500005 using namespace std; int n_nodes, m_branches; int colors[MAXN]; int other_colors[MAXN]; int other_colors_dist[MAXN]; vector<int> graph[MAXN]; bool set_other_color (int node, int color, int dist) { // cout << "coloring " << node << " in " << color << " with dist " << ...
ALGO
0.999829
4.324144
ac36fe96-c43e-46d9-bf79-463e59a6af96
alibaba/nann
blaze-benchmark/thirdparty/boost_1_53_0/libs/math/src/tr1/assoc_legendrel.cpp
extern "C" long double BOOST_MATH_TR1_DECL boost_assoc_legendrel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, long double x) BOOST_MATH_C99_THROW_SPEC { return (m&1 ? -1 : 1) * c_policies::legendre_p BOOST_PREVENT_MACRO_SUBSTITUTION(l, m, x); }
TOOL
0.978479
4.163469
fdd5fa4e-83b8-4f3b-9721-ee9435d909ee
DDLGitGzzhM/DailyAlgorithm
牛客/小白月赛65/A.cpp
// Problem: 牛牛去购物 // Contest: NowCoder // URL: https://ac.nowcoder.com/acm/contest/49888/A // Memory Limit: 524288 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org) #include <bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(false); #define CIT cin.tie(0); #define COT ...
ALGO
0.999498
3.397005
852f482a-53f3-49eb-88e1-e54bbc47fac6
Oziach/Code-Challenges-And-Practice
GFG/implementQueueUsingArray.cpp
/* The structure of the class is class MyQueue { private: int arr[100005]; int front; int rear; public : MyQueue(){front=0;rear=0;} void push(int); int pop(); }; */ //Function to push an element x in a queue. void MyQueue :: push(int x) { if(front == 0){front = rear = 1; arr[rear] = x;}...
ALGO
0.999776
4.881625
5d39172c-3f17-4046-99b5-2de691972252
mmalohlava/babylon-sandbox
c++/tests/streams/test3.cpp
#include <iostream> using namespace std; template<typename T, typename C> class manip_comma { public: manip_comma(basic_ostream<C>& (*pFun) (basic_ostream<C> &,T), T val): _x(val), manip_fce(val) {}; void operator() (basic_ostream<C>& os) const { manip_fce(os, _x); } private: T _x; basic_ostream<C>& (*manip_f...
TOOL
0.935932
5.47787
be57b152-d9cf-4eea-9d3c-41e29bb22f82
Ishwarendra/Contests
CODECHEF/Starters107/B.cpp
#include "bits/stdc++.h" #ifdef LOCAL #include "F:\CPP\Debug\debug.h" #else #define print(...) 1; #endif using i64 = long long; void solve() { int n, k; std::cin >> n >> k; int c = n % k; auto f = [&](int x) { if (x > n) x = 0; i64 res = 1LL * (x % k) * ((n ...
ALGO
0.999952
4.493848
7d005583-038e-4314-9d13-7001ae022b90
C-2023-1-3/8209230217Lijingwen
project4.8.cpp
#include<iostream> #include<cstring> #include<cmath> using namespace std; int parseHex(const char* const hexString); int main() { int size = 999; char* s=new char[size]; cout << "Please enter a number in hexChar : \n"; cin.getline(s, size); cout << "Tne number " << s << " in hexChar is " << parseHex(s) << " in d...
ALGO
0.909445
4.822259
814be7db-5227-4faa-b059-a480f06ab07c
gtanish2003/DSA_in_CPP
Stack/LargestRectangleInHistogram.cpp
#include <iostream> #include <stack> #include <vector> #include<climits> using namespace std; vector<int> nextSmallerElement(vector<int> &heights, int n) { stack<int> s; s.push(-1); vector<int> ans(4); for (int i = n - 1; i >= 0; i--) { int curr = heights[i]; while (s.top() != -1 &...
ALGO
0.999847
5.486537
6766da67-2ad1-432f-bed8-85a3fc72ec9d
Vikhyath-vec/temp_repo
World_Record.cpp
#include<iostream> using namespace std; int main() { int T, i, temp; float k1, k2, k3, v, time, temp2; cin >> T; for(i=1; i<=T; i++) { cin >> k1 >> k2 >> k3 >> v; time = 100/(k1*k2*k3*v); // cout<<time<<endl; temp2 = (time*100) + 0.5; temp = temp2; ti...
ALGO
0.998085
3.263978
95e56b30-9516-4f1f-8b1c-a05e0db1fe02
cmiyachi/CygWinAlgorithms
Leetcode/searchRotatedArrayUdemy.cpp
/// https://leetcode.com/problems/search-in-rotated-sorted-array/ #include <bits/stdc++.h> using namespace std; class Solution { public: int search(vector<int>& a, int key) { int s = 0; int e = a.size() - 1; while(s<=e){ int mid = (s+e)/2; if(a[mid] == key){ ...
ALGO
0.999995
6.207305
dcefc346-9b05-4c86-ba28-ed464fa39a31
yusei-wy/atcoder
abc/cpp/062_b.cpp
#include <bits/stdc++.h> #define rep(i, f, n) for (ll i = (f); i < (ll)(n); i++) #define repe(i, f, n) for (ll i = (f); i <= (ll)(n); i++) using namespace std; using ll = long long; using GraphI = vector<vector<int>>; using GraphC = vector<vector<char>>; using pint = pair<int, int>; int main() { int H, W; cin >> H...
ALGO
0.997919
3.655208
18295c84-6a5a-47b8-9c0c-7dc6ec4ca098
AFcPPe/FSD-Renewed
fsd/cluser.cpp
#include <cstdio> #include <cstdlib> #ifndef WIN32 #include <unistd.h> #endif #include <cctype> #include <cstring> #include <iostream> #include "global.h" #include "cluser.h" #include "support.h" #include "server.h" #include "fsd.h" #include "protocol.h" #include "mm.h" #include "fsdpaths.h" #include "httplib.h" /* ...
WEB
0.91849
3.405528
e0fc16f2-ec80-4c3e-8645-26bfd03139e0
andyyang200/CP
Competitive Programming/Contests/CodeForces/Contests/Rounds/400s/Codeforces Round 443/Short Program/program.cpp
//Andrew Yang #include <iostream> #include <stdio.h> #include <sstream> #include <fstream> #include <string> #include <string.h> #include <vector> #include <deque> #include <queue> #include <stack> #include <set> #include <unordered_set> #include <map> #include <unordered_map> #include <algorithm> #include <functional>...
ALGO
0.999978
3.775992
265a44d5-b203-483d-b44c-2406e44f764f
AhmedFathi-Aziz/CP
PSetSolutions/Codeforces/Longest k-Good Segment.cpp
#include <bits/stdc++.h> using namespace std; void doWork() { int n, k; cin >> n >> k; int a[n]; for (int &i : a) cin >> i; map<int, int> mp; int l = 0, r = 0; int s = 0, e = 0; while (r < n) { if (mp.size() <= k) { mp[a[r++]]++; if (mp.size...
ALGO
0.999942
4.706169
cb955278-1f24-484b-a9ee-94d6da8883b1
iblackcat/QtObjRenderer
include/eigen3/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix2f A; A << 1, 2, 2, 3; cout << "Here is the matrix A:\n" << A << endl; SelfAdjointEigenSolver<Matrix2f> eigensolver(A); if (eigensolver.info() != Success) abort(); cout << "The eigenvalues of A ...
ALGO
0.99971
3.846247
95c38125-492c-45dc-914b-26356feb1e26
ishandutta2007/codeforces
ei133333/normal/1726/C.cpp
#include<bits/stdc++.h> using namespace std; using int64 = long long; const int mod = 998244353; const int64 infll = (1LL << 62) - 1; const int inf = (1 << 30) - 1; struct IoSetup { IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); cerr << fixed << set...
ALGO
0.999804
5.412774
06c25cea-1594-4d7d-b4eb-4a4c9507e96c
shahnehal0407/CPP
2793-count-the-number-of-complete-components/count-the-number-of-complete-components.cpp
class Solution { public: void dfs(int node, vector<vector<int>>& adj, vector<bool>& visited, vector<int>& nodes, int& edgeCount) { visited[node] = true; nodes.push_back(node); for (int neighbor : adj[node]) { edgeCount++; // Count both directions if (!visited[neighbo...
ALGO
0.999966
7.117633
4c16229e-7a64-49dc-a33f-e8e44f47b729
ruved/180DaysProblemSolving
2299-merge-nodes-in-between-zeros/merge-nodes-in-between-zeros.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* mergeNodes(...
ALGO
0.999964
5.159831
f8152813-e7da-427d-aaef-042cc5dfe8c8
divcs/DSA-Practice-Learning
Platforms/Strivers/Recursion/L5/Fibonacci.cpp
#include <iostream> using namespace std; int fib(int n) { if (n <= 1) return n; int last = fib(n - 1); int slast = fib(n - 2); return last + slast; } int main() { cout << fib(4); return 0; }
ALGO
0.999845
4.534415
8b13ffbf-ac12-41db-92d6-6840ce68e967
vfolunin/archives-solutions
URI Online Judge/1047.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> using namespace std; int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int h1, m1, h2, m2; cin >> h1 >> m1 >> h2 >> m2; int t1 = h1 * 60 + m1; int t2 = h...
ALGO
0.999798
4.318004
9cde396d-315d-4853-80d4-69b9025df968
jeongbbn/Algorithm
BOJ/2933.cpp
#include <bits/stdc++.h> using namespace std; #define INF 1e9 typedef pair<int, int>pi; typedef pair<int, pair<int, int>>pii; int r, c; char arr[105][105]; bool visit[105][105]; vector<pi>v; queue<pi>q; int dx[] = { 0,0,1,-1 }; int dy[] = { -1,1,0,0 }; bool outrange(int x, int y) { if (x < 0 || y < 0 || x >= r || y...
ALGO
0.999901
3.555029
67ecbef6-59e1-4fbc-81d6-2acb40463c8d
romulobn/bmd
src/imageevaluator.cpp
#include "imageevaluator.h" #include <QDir> #include <QDate> #include <QTextStream> #include <QDebug> #include <opencv/cv.h> #include <caib/imgproc.h> ImageEvaluator::ImageEvaluator() { } void ImageEvaluator::evaluateImages(const QString &srcDirPath, const QString &binDirPath, const QStringList &filters, const QSt...
TOOL
0.856876
5.382102
4a96b743-1681-4b68-aeba-22d83a6abbb0
Baungarten-CINVESTAV/Towards-On-Board-SAR-Processing-with-FPGA-Accelerators-and-a-PCIe-Interface
HLS/FFT_Optimization_test/Reorder_FFT_test.cpp
#include <iostream> #include <stdlib.h> #include <fstream> #include <complex> #include <stdio.h> #include "FFT_reorder.h" #define N 1025 #define N_2 1024 #define TOL 0.00001 //error tolerance int main() { // -------------------LOAD INIT VALUE ----------------------------------------------- int i=1, retval=0; // i =...
ALGO
0.95211
3.334745
614fd223-818c-4738-a218-cdccfbf02fae
cl-user/mohs
MOHS/Problem/CEC09/Unconstrained/CEC09UnProb3.cpp
#include "Problem/CEC09/Unconstrained/CEC09UnProb3.h" #include "Variable/RealVariable.h" #include <cmath> using namespace std; CEC09UnProb3::CEC09UnProb3(const char *path, HS_Params *hsParams, VariableBuilder *varBuilder) : CEC09UnProb1to7(path, hsParams, varBuilder) { } CEC09UnProb3::~CEC09UnProb3() { ...
ALGO
0.999921
4.032753
d7535e44-b050-4664-b7ae-254953a8551b
Liyuanyuan05/leg-control
legged_control/legged_estimation/src/StateEstimateBase.cpp
// // Created by qiayuan on 2021/11/15. // #include <pinocchio/fwd.hpp> #include <pinocchio/algorithm/frames.hpp> #include <pinocchio/algorithm/kinematics.hpp> #include "legged_estimation/StateEstimateBase.h" #include <ocs2_centroidal_model/FactoryFunctions.h> #include <ocs2_legged_robot/common/Types.h> #include <o...
ALGO
0.870574
6.504794
dfe39fdf-5042-4de8-9654-6420dba9a00c
huangallen2008/cppcode
code/ZeroJudge/c833/c833.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define int long long #define FOR(i,a,b) for(int i=a;i<b;i++) #define REP(i,n) FOR(i,0,n) #define REP1(i,n) FOR(i,1,(n)+1) #define RREP(i,n) for(int i=(n)-1;i>=0;i--) #define f first #define s second #define pb push_back #define ALL(x) x.begin(),x.end() ...
ALGO
0.999787
3.120003
865bd5f0-d575-4bf3-9173-5764a0439abc
zjiash/leetcode
src/061_Unique_Paths.cpp
/* * ===================================================================================== * * Filename: 061_Unique_Paths.cpp * * Description: * * Version: 1.0 * Created: 2013年05月11日 23时05分58秒 * Revision: none * Compiler: gcc * * Author: YOUR NAME (), * ...
ALGO
0.998486
5.684229
cb2a152c-d8fe-4d25-868f-e46a1be55c2e
ROSHAN0931/DATASTRUCTURES
CPP/linkedlist/circular.cpp
#include <iostream> // Node structure for a circular linked list struct Node { int data; Node* next; }; // Function to insert a new node at the beginning of the circular linked list Node* insertAtBeginning(Node* head, int value) { Node* newNode = new Node; newNode->data = value; if (head == nullpt...
ALGO
0.97039
5.906321
b3bcab5a-79d1-4d2f-92f0-6791c9379b29
VinInn/ctest
vectorize/vrand/PoissHist.cpp
#include <cstdint> #include<cmath> #include<vector> #include<cassert> #include<iostream> template<typename T> class PoissonHist { public: PoissonHist(T mu) : m_mu(mu), m_expmmu(std::exp(-mu)) { auto poiss = m_expmmu; m_cumulative.push_back(m_expmmu); for(;;) { poiss = poiss*mu/T(size()); if ...
ALGO
0.993685
5.48607