uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
bf578ee5-2500-424d-848d-a0d8a40db2a4
ishandutta2007/codeforces
jjleo/normal/1400/D.cpp
#include <bits/stdc++.h> #define maxn 3086 using namespace std; int t; int a[maxn]; long long f[maxn][maxn]; long long ans; int n; int main(){ scanf("%d", &t); while(t--){ scanf("%d", &n); for(int i = 1;i <= n;i++) for(int j = 1;j <= n;j++) f[i][j] = 0; for(int i = 1;i <= n;i++) scanf("%d", &a[i]); ans =...
ALGO
0.999834
3.466097
fc7797bd-48f1-448f-a556-7888d997b6f2
nojhan/paradiseo
deprecated/eo/src/es/CMAState.cpp
/* --------------------------------------------------------- */ /* --------------------------------------------------------- */ /* --- File: cmaes.c -------- Author: Nikolaus Hansen --- */ /* --------------------------------------------------------- */ /* --- Changes : --- * 03/03/21: argument const double *rgFu...
ALGO
0.999996
6.200372
3103f50b-c5e9-4f72-b5b1-ec3d6aa304ad
Shubham-Choudhury/GeeksforGeeks-Problems
2024/11 November/Stock Buy and Sell – Max one Transaction Allowed/main.cpp
// Link: https://www.geeksforgeeks.org/problems/buy-stock-2/1 #include <iostream> #include <vector> #include <climits> using namespace std; class Solution { public: #define MAX(A, B) (A > B ? A : B) int maximumProfit(vector<int> &prices) { int i, N = prices.size(); int init = prices[0]; ...
ALGO
0.999197
5.774801
1451bc9c-3088-4d46-86f7-c1938a637bef
tf153/Leetcode
Questions/96_Unique_BST.cpp
class Solution { long binomialCoeff(int n,int k){ long res = 1; if (k > n - k) k = n - k; for (int i = 0; i < k; ++i){ res *= (n - i); res /= (i + 1); } return res; } int catalan(int n){ long c = binomialCoeff(2 * n, n); ...
ALGO
0.999975
6.492514
291cf63e-0cbe-49e8-abe0-b0c88a015e29
alittlekitten/AlgorithmStack
Baekjoon/Cpp/Greedy/G3_2437_저울.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; vector<int> v; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(NULL); // 2437 저울 // 그리디 int n, input; cin >> n; for (int i = 0; i < n; ++i) { cin >> input; v.push_back(i...
ALGO
0.999972
4.363361
1bff69bd-444e-429f-aadb-5635bb6ee269
ArmandLfd/GUI-TD
GUI TD/Dependecies/opencv/sources/3rdparty/carotene/src/blur.cpp
#include <vector> #include "common.hpp" #include "saturate_cast.hpp" namespace CAROTENE_NS { bool isBlur3x3Supported(const Size2D &size, BORDER_MODE border) { return isSupportedConfiguration() && size.width >= 8 && (border == BORDER_MODE_CONSTANT || border == BORDER_MODE_REPLICATE); } void b...
ALGO
0.99699
6.554525
08de2943-31e9-45dd-91cc-49dd8a74d291
usman-codes/Flutter_Practice
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
50a6fd3c-df18-4d86-b5c3-7117572eb679
visheshvats/450-DSA
aa.cpp
#include <bits/stdc++.h> using namespace std; void main() { int n; string str[10]= {"Greater than 9","one","two","three","four","five","six","seven","eight","nine"}; cin>>n; if(n<=9) cout<<str[n]; else cout<<str[0]; }
ALGO
0.999125
3.565577
80366317-05dc-4203-8aca-00ebec29f185
darkendth/solved_problems
tree/pathSumBT.cpp
# include "tree.h" #include <cstddef> bool hasPathSum(TreeNode* root, int targetSum) { if (!root) return false; if (root->left==NULL&&root->right==NULL){ if (targetSum-root->val==0) return true; else return false; } return (hasPathSum(root->left, ta...
ALGO
0.999497
5.381021
606a43c5-e9c9-4b43-a4ac-fd262b443dd1
digiou/chameleon-artifacts
chameleon/iot-spe/iot-spe-runtime/src/Execution/Operators/Streaming/Aggregations/NonKeyedTimeWindow/NonKeyedSliceMerging.cpp
#include <Execution/Operators/ExecutionContext.hpp> #include <Execution/Operators/Streaming/Aggregations/NonKeyedTimeWindow/NonKeyedSlice.hpp> #include <Execution/Operators/Streaming/Aggregations/NonKeyedTimeWindow/NonKeyedSliceMerging.hpp> #include <Execution/Operators/Streaming/Aggregations/NonKeyedTimeWindow/NonKeye...
TOOL
0.91645
7.146453
3b04c639-d336-40ac-a161-fac38ff7c447
dilnazxoxo/parallelizationofalgorithms
func3.cpp
#include <stdio.h> #include <stdbool.h> bool is_prime(int n) { if (n < 2) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; } int main() { printf("Prime numbers from 2 to 1000:\n"); for (int i = 2; i <= 1000; i++) { if (is_prime(i...
ALGO
0.997174
4.444178
a521565b-019a-4de3-a083-c9af72ed5e3d
chae-chae/lectopia_C_hw
hw16.cpp
#include <stdio.h> #pragma warning (disable : 4996) int input(void); int calc(int); void output(int); int main(void){ int i = 0; int stnum, fee; while ( i < 5){ stnum = input(); fee = calc(stnum); output(fee); i++; } return 0; } int input(void){ int stnum; p...
ALGO
0.991564
3.499557
26e92662-5a78-40d5-8780-fd1885ccfc16
ishandutta2007/codeforces
avinashkartik/normal/451/C.cpp
#pragma GCC optimize("Ofast") //Comment optimisations for interactive problems (use endl) #pragma GCC target("avx,avx2,fma") #pragma GCC optimization ("unroll-loops") #include<bits/stdc++.h> using namespace std; #define fastio ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(1...
ALGO
0.999753
3.701202
20e09b8a-031b-4d0f-b33c-c9cd7e73e508
BnnryMndy/unixTasks
task6_make/make_sort/Bubble.cpp
#include <stdio.h> #include "main.h" void Bubble(int data[], int lenD) { int tmp = 0; for(int i = 0;i<lenD;i++){ for(int j = (lenD-1);j>=(i+1);j--){ if(data[j]<data[j-1]){ tmp = data[j]; data[j]=data[j-1]; data[j-1]=tmp; } } } printf("Bubble end: \n"); for(int i=0;...
ALGO
0.999239
3.461265
fb2a5191-8fcd-4c56-8cb4-4aaa04ffdf18
BBBBBbruce/PhysicsSimPro
external_lib/MFEM/mfem-4.3/fem/bilininteg_hcurl.cpp
#include "../general/forall.hpp" #include "bilininteg.hpp" #include "gridfunc.hpp" using namespace std; namespace mfem { void PAHcurlMassApply2D(const int D1D, const int Q1D, const int NE, const bool symmetric, const Arra...
ALGO
0.996946
4.53274
29e8eef2-1ca6-4fef-82eb-5832b44b1948
akshaybaviskar/pin-3.16-98275-ge0db48c31-gcc-linux
source/tools/Mmx/mmx_test1_app.cpp
#include <windows.h> #include <stdio.h> extern "C" int MMXSequence (unsigned int a, unsigned int b, unsigned int c, UINT64 *aConcaTb); int main () { UINT64 aConcaTb; UINT32 *ptr = (UINT32 *)(&aConcaTb); UINT32 *ptr1 = ptr+1; unsigned int res = MMXSequence(0xdeadbeef, 0xbaadf00d, 0xfeedf00d, &aConcaTb)...
ALGO
0.985213
3.683093
7d32b25b-b116-4cd6-9376-04e992fafc08
Omar-Fetooh/leetCode
Data structures and algorithms/204-Count-Primes.cpp
class Solution { public: int countPrimes(int n) { vector<bool>isPrime(n + 1, true); isPrime[0] = isPrime[1]=0; for (long long i = 2;i * i <= n;i++) { if (isPrime[i]) { for (int j = i * 2;j <= n;j += i) { isPrime[j] = 0; } } } int cnt = 0;...
ALGO
0.999971
5.458261
e068fdd4-9b1b-4d28-a5bc-1a1b54075869
benwilliams140/MazeGeneration
MazeGeneration/Algorithm.cpp
#include "Algorithm.h" Algorithm::Algorithm(MazeCell* _start) : curCell(_start), startingCell(_start) { } bool Algorithm::update(Array2D<MazeCell*>& _maze) { if (!curCell) { curCell = _maze[0][0]; } else { int _nextCol = curCell->getCol() + 1; int _nextRow = curCell->getRow(); if (_nextCol >= _maze.get...
ALGO
0.999855
4.894182
4998b8fb-6218-45ad-8a66-a8633c8544a0
Resovijay/codeforces-codechef_contest_code
codeforces/A_Plus_or_Minus.cpp
#include<bits/stdc++.h> using namespace std; #define int long long void solve(){ int a,b,c; cin>>a>>b>>c; if(a+b==c){ cout<<"+"<<endl; } else{ cout<<"-"<<endl; } } signed main(){ #ifdef ONLINEJUDGE clock_t tStart = clock(); freopen("input.txt","r",stdin); //can...
ALGO
0.999957
4.848371
5d72f88b-04d9-4673-822f-f94b544ec05d
PSPritish/Code_Backup
Algozenith/SegmentedTree/RangeQueries.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define LD long double const int N = 200010; int inf = 1e9; int mod = 1e9 + 7; ll tree[4 * N]; void update(int node, int start, int end, int l, int r, int val) { if (start > r || end < l) return; if (start >= l && end <= r) ...
ALGO
0.999915
5.323733
9213fe8d-a4f0-41cc-a092-7091335ad612
joaomiguelvieira/gem5-accel
src/systemc/tests/systemc/misc/examples/datawidth_int_file/datawidth.cpp
/***************************************************************************** datawidth.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /**************************************************************************...
ALGO
0.933192
5.296662
cf24929f-77a4-4382-a0b7-de442eeaee63
DataLab12/graphBpp
graphBplusplusRDFS.cpp
#include <unistd.h> #include <ios> #include <fstream> #include <cstdio> #include <climits> #include <algorithm> #include <set> #include <map> #include <sys/time.h> #include <iostream> #include <random> #include <list> #include <vector> #include <set> #include<queue> #include <omp.h> #include <unordered_set> #include <i...
ALGO
0.998501
3.365479
bf92de66-5ca8-466e-9d3c-bada4a7f84f6
tanvi14001/Codes
441-arranging-coins/arranging-coins.cpp
class Solution { public: int arrangeCoins(int n) { int cnt = 0; if (n == 0) return 0; for (int i = 1; i <= n; i++) { if (n >= i) { n = n - i; cnt++; } else break; } return cnt; } };
ALGO
0.999944
6.526243
604ecedc-46c5-4d0d-a542-45f995496e6c
sarthak-sehgal/codeforces
640 (Div 4)/B.cpp
#include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" #define ll long long #define pii pair<int,int> #define all(x) begin(x), end(x) #define loop(i,n) for(int i=0; i<n; i++) #define rep(i,a,b,c) for(int i=a; i<b; i+=c) #define brep(i,a,b,c) for(int...
ALGO
0.999973
3.853111
a7b076d1-5e46-4a52-a518-30610965bcce
HarshK213/dsa
20_BinarySearchTree/basic.cpp
#include <iostream> #include <vector> using namespace std; class TreeNode{ public: int val; TreeNode* left; TreeNode* right; TreeNode(int x){ val = x; left = right = NULL; } }; TreeNode* insert(TreeNode* root, int Val){ if(root...
ALGO
0.999988
5.300113
6d6c3b07-2056-4eb7-b2da-b1ad8b35e541
vyaki1718/DSA-C-
mergesort/mergesort.cpp
#include<bits./stdc++.h> using namespace std; // void merge(int arr[], int l, int mid, int r){ // int n1=mid-l+1; // int n2=r-mid; // int a[n1]; // int b[n2]; // for(int i=0; i<n1; i++){ // a[i]=arr[l+i]; // } // for(int i=0; i<n2; i++){ // b[i]=arr[mid+1+i]; // ...
ALGO
0.999978
4.623441
2de94879-8aab-49a6-b6b0-c24f06f11d9f
TjalfeMonberg/TrackingFrequentDataItems
Algorithms/CountSketch.cpp
// // Created by Tjalfe on 14-03-2023. // #include <iostream> #include <fstream> #include <string> #include <vector> #include <regex> #include <set> #include <random> #include <cstdlib> #include <chrono> #include <stdint.h> using namespace std; class CountSketch { private: int t, k; // t for amount of arrays, k f...
ALGO
0.999447
5.791119
aa2bf90f-009b-4272-92e7-2debd9b5f5bd
aditya-mukherjee-127/Concepts_DSA_CP
Graphs/Subordinates_CSES.cpp
// https://cses.fi/problemset/task/1674/ #include <bits/stdc++.h> #define ll long long int #define mod 1000000007 #define inf (long long int)1e18 #define log(args...) { std::string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); std::stringstream _ss(_s); std::istream_iterator<std::string> _it(_ss); err(_it, ar...
ALGO
0.999975
4.17024
9153687c-4b3e-49ee-b319-3e0690ec3a55
vallagenakisu/my-github
new codes/max number.cpp
#include<bits/stdc++.h> #define f(i,n) for(int i=0;i<n;i++) using namespace std; const int N = 1e3; int a[N]; int maxx ; int rec(int n) { if(n == 0) return maxx = max(maxx,a[n]); rec(n-1); return maxx = max(maxx,a[n]); } void sol() { int n; cin >> n; f(i,n) cin >> a[i]; rec(n-1); cou...
ALGO
0.999917
3.857287
ac364f49-2e25-4c98-b65a-8fdd37aa5657
kangsw1025/TIL
SolveProblem/21/21.05/BOJ_2602_돌다리 건너기.cpp
#include<iostream> #include<string> using namespace std; int angel_dp[101][21][5]; // 0 = R 1 = I 2 = N 3 = G 4 = S int devil_dp[101][21][5]; int main() { ios::sync_with_stdio(false); cin.tie(NULL); string way, angel, devil; cin >> way >> angel >> devil; for (int i = 0; i < way.length(); i++) { int op; if...
ALGO
0.999769
3.677261
dea624c4-93eb-4005-9435-4568b7d852f4
minheenista/Algoritmos_Y_EstructurasDeDatos
busqueda.cpp
#include <iostream> using namespace std; class busqueda{ private: int datos[5]={4, 3, 89, 54, 98}; public: void secuencial (int); busqueda(); ~busqueda(); }; //constructor busqueda::busqueda(){ } //destructor busqueda::~busqueda(){ } void busqueda::secuencial(int dato){ int i; char...
ALGO
0.997232
3.847274
0ed4d3ed-ef8a-47d0-bece-f9f5ea69f566
xulerxyz/login_screen
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
49eac74e-6ee0-43a0-acdc-09bcd179bfe0
stoneatom/stonedb
storage/tianmu/compress/inc_wgraph.cpp
#include "inc_wgraph.h" #include <cstring> namespace Tianmu { namespace compress { // #define MAKESTAT const uint IncWGraph::MatchLenCoder::c2[] = {120, 128}; const uint IncWGraph::MatchLenCoder::c3[] = {102, 119, 128}; IncWGraph::IncWGraph() : memory_() { dump_ = nullptr; ROOT_ = NIL_ = START_ = nullptr; p_...
ALGO
0.984306
3.371371
47f6e2cf-296d-406e-b07e-870244187092
time-hxh/My-ACM-Template
07_Others/04_BigNum/02_Complete High-precision.cpp
#define N 10000 class bint { private: int a[N]; // 用 N 控制最大位数 int len; // 数字长度 public: // 构造函数 bint() { len = 1, clr(a, 0); } // int -> bint bint(int n) { len = 0; clr(a, 0); int d = n; while (n) d = n / 10 * 10, a[len++] = n - d, n = d / 10; ...
ALGO
0.999111
3.326424
0fcf85e2-b7fb-4e5e-b70a-07d6e216c35f
alexandraback/datacollection
solutions_2705486_0/C++/nuzelac/C.cpp
#include <cstdio> #include <string> #include <vector> #include <map> using namespace std; vector<string> dict; char tmp[200], s[100]; string ss; int mem[100]; map<string, int> mapa; int ok(string rijec) { if(mapa.count(rijec) > 0) return mapa[rijec]; //printf("%s\n", rijec.c_str()); int min_suma = -1; ...
ALGO
0.999745
4.217947
92de79e8-cede-46d4-bf50-2d7adebcf9a8
dhruv4115/CodeForces_Solutions
Round 962/C.cpp
#include <iostream> #include <map> #include <unordered_map> #include <vector> #include <string> #include <limits> #include <climits> #include <set> #include <algorithm> // For sort using namespace std; void Tests() { int n, q; cin >> n >> q; string a, b; cin >> a >> b; vector<vector<int>...
ALGO
0.999887
4.927047
25fe176d-997c-410f-b54d-55538d263002
devinar25/3110-l5
functions_to_implement.cpp
#include <iostream> #include <vector> /* String functions section */ // Splits a single string on separator into a vector of strings std::vector<std::string> Split(std::string whole, std::string separator); // takes two strings and returns a new string that is the result of removing all occurrences of s2 from s1. std...
TOOL
0.953333
4.360075
d0755e9c-75c3-4e78-ae7f-617750cab7b6
sehyunsix/Auto-Driving-Kmu-Compotetion-2024
xycar_ws/src/ar_track_alvar/ar_track_alvar/src/SfM.cpp
#include "SfM.h" namespace alvar { class CameraMoves { bool is_initialized; double prev[3]; public: CameraMoves() { is_initialized = false; memset(prev, 0, 3 * sizeof(double)); } bool UpdateDistance(Pose* pose, double limit = 10) { double trad[3]; CvMat tra = cvMat(3, 1, CV_64F, trad); ...
TOOL
0.947661
5.3956
371fb76c-515c-4c37-995e-37d34d56b302
rishwitha02/NTT-FTT
ntt_radix3.cpp
#include <bits/stdc++.h> #include <omp.h> using namespace std; #define int long long int root=362597; int invroot=249134; const int MOD = 472393; int add(int a, int b) { return (a + b) % MOD; } int add(int a, int b,int c) { return add(add(a,b),c); } int sub(int a, int b) { return (a - b + MOD) % MOD; } ...
ALGO
0.999993
4.063208
9ee120db-455a-48e3-9a79-8434e707604c
karandixit10/Interview_DS_Algo
3507-find-the-count-of-numbers-which-are-not-special/3507-find-the-count-of-numbers-which-are-not-special.cpp
class Solution { private: vector<int> sieveOfEratosthenes(int n) { vector<bool> is_prime(n + 1, true); is_prime[0] = is_prime[1] = false; for (int i = 2; i * i <= n; i++) { if (is_prime[i] == true) { for (int j = i * i; j <= n; j += i) { is_pri...
ALGO
0.99993
4.975258
080d8c11-d478-4c37-bab0-709d892391e9
coderemon24/cpp-practices
practice/binary_search.cpp
#include<iostream> using namespace std; int main() { int arr[] = {1,2,3,4,5,6,7,8,9,10}; int start = 0; int end = sizeof(arr)/sizeof(arr[0]) - 1; int n = 8; while(start <= end) { int mid = start + (end-start)/2; if(arr[mid] == n) { cout << arr[mid] << " foun...
ALGO
0.999478
4.109471
ba281e17-dd70-4826-bfee-540b87ba7e5b
triet4p/SearchAppQt
FibonacciSearchVisualizer.cpp
#include "SearchVisualizer.h" #include "FibonacciSearchVisualizer.h" #include <bits/stdc++.h> #include <QWidget> #include <QPainter> using namespace std; FibonacciSearchVisualizer::FibonacciSearchVisualizer(QWidget *parent): SearchVisualizer(parent) { nowIndex = -1; } void FibonacciSearchVisualizer::setIndex(int ...
ALGO
0.983081
5.33459
0bd1bf8e-ca4c-41d1-ace1-f27ec8c4fb79
FullteaR/CompetitiveProgramming
AOJ/Volume 0/Orthogonal.cpp
#include <iostream> #include <cmath> using namespace std; bool orthogonal(double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd); int main(void){ double xa,ya,xb,yb,xc,yc,xd,yd; while(cin>>xa>>ya>>xb>>yb>>xc>>yc>>xd>>yd){ if(orthogonal(xa,ya,xb,yb,xc,yc,xd,yd)){ cout<<"Y...
ALGO
0.996553
3.151136
e4c92c8f-bdf4-49dd-aa85-de18f992dee3
Koeunseooooo/Algorithm
10weeks/week1/10808.cpp
#include <bits/stdc++.h> using namespace std; string str; int cnt[26]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> str; for (char a: str){ cnt[a - 'a']++; } for (int i = 0; i < 26;i++){ cout << cnt[i] << " "; } }
ALGO
0.999685
4.497446
26cb518c-8e62-4c0f-8893-6701a1934d7f
imoiwm/dynamica2oj
1300to1399/vasilythebearandtriangle.cpp
#include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { int x, y; cin>>x>>y; int x1, y1, x2, y2; if (x > 0 && y > 0) { cout << 0 << ' ' << x + y << ' ' << x + y << ' ' << 0 << '\n'; } else if (x < 0 && y > 0) { cout << (abs(x) + y) * -1 << ' ' << 0 << ' ' << 0 << ' ' << ab...
ALGO
0.999947
3.643934
78782bc8-82ae-412d-b93d-4d1e51aa851d
Karthikraut/Leetcode-Questions
378-kth-smallest-element-in-a-sorted-matrix/kth-smallest-element-in-a-sorted-matrix.cpp
class Solution { public: int kthSmallest(vector<vector<int>>& matrix, int k) { priority_queue<int,vector<int> > pq; int m = matrix.size(), n = matrix[0].size(); for(int i=0;i<m;i++){ for(int j=0;j<n;j++){ pq.push(matrix[i][j]); if(pq.size()>k) pq.p...
ALGO
0.999993
5.530082
670f8b64-4189-454d-b982-326b78c02411
AshwinkumarPillai/LeetCode
Problems/0141_Linked_List_Cycle.cpp
class Solution { public: bool hasCycle(ListNode *head) { ListNode* slow = head, *fast = head; while(fast && fast->next){ slow = slow->next; fast = fast->next->next; if(slow == fast) return true; } return false; } };
ALGO
0.999797
5.519262
b95516bf-ea85-43b7-8387-7b4f7ffbcffb
Nanored4498/HackerCup
2024/Practice/a.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; using ll = long long; void solve() { int n; ll k; cin >> n >> k; vector<ll> s(n); for(ll &x : s) cin >> x; const ll y = max(1, 2*n-3) * *min_element(s.begin(), s.end()); if(y <= k) cout << "YES\n"; else cout << "NO\n"; } int main...
ALGO
0.999913
4.331994
9e62d4f6-fd5e-40ee-ac42-372937e340a3
ishandutta2007/codeforces
wild_hamster/normal/10/A.cpp
#include <iostream> #include <algorithm> #include <map> #include <vector> #include <cstring> #include <stdio.h> #include <time.h> using namespace std; typedef long long ll; typedef double db; #define tr 1000000007 ll rez,p[5],t1,t2,z,x,y1,y2,m,n,i,j,k1,k,a[3000]; vector <ll> f; ll gcd(ll a, ll b) { if (b==0) return a; ...
ALGO
0.999655
3.31403
a7aea94b-da31-4bba-9a63-d8c28748094f
LiunxPaisley/LeetCode
412. Fizz Buzz/412. Fizz Buzz/412. Fizz Buzz.cpp
#include <iostream> #include <fstream> #include <sstream> #include <array> #include <vector> #include <string> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <stack> #include <queue> #include <list> #include <deque> #include <tuple> #include <algorithm> #include <utility> #in...
ALGO
0.999875
5.882989
f29f1aa1-e361-49ea-9cc2-225509ea7833
marshadn/DSA-CPP
Array/linearSearch.cpp
#include <iostream> using namespace std; int linerSearch(int arr[], int num, int n) { for (int i = 0; i < n; i++) { if (arr[i] == num) { return i; } } return -1; } int main() { int n; cout << "Enter the size of the array: "; cin >> n; int arr[n]; ...
ALGO
0.999453
5.719403
9bdef9d2-c6da-488b-93ef-c9a7005d688a
CameliaBrochu/aoc2021
day02/Day02.cpp
// // Created by camelia on 2021-12-19. // #include <iostream> #include <vector> #include "Day02.h" #include "../utils/utils.h" AOC_2021::Day02::Day02() = default; void AOC_2021::Day02::run() { std::vector<std::string> input = utils::parseFile("day02/input.txt"); int position = 0; int depth = 0; ca...
ALGO
0.991696
5.858165
d7ff3f60-edaf-48a7-af5e-459816d3b138
raincross7/code-similarity
codes/train_code/problem416/problem416_18.cpp
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for (int i = (a); i <= (b); i++) #define FORD(i,a,b) for (int i = (a); i >= (b); i--) #define REP(i,a) FOR(i,0,(int)(a)-1) #define reset(a,b) memset(a,b,sizeof(a)) #define all(x) x.begin(), x.end() #define uni(x) x.erase(unique(all(x)), x.end()); #define ...
ALGO
0.999742
3.22856
104bd387-f9c6-4a86-b816-d67b20896371
koosaga/olympiad
Library/codes/data_structures/online_range_mode_query.cpp
#include <bits/stdc++.h> using namespace std; using lint = long long; using pi = array<int, 2>; #define sz(v) ((int)(v).size()) #define all(v) (v).begin(), (v).end() #define cr(v, n) (v).clear(), (v).resize(n); template <typename T> struct StaticRangeModeQuery { StaticRangeModeQuery() = default; explicit StaticRange...
ALGO
0.999957
5.094962
544765cc-72c1-435a-afb4-34b5d912017e
harsh9105/cpp-code-OOPS
if_else.cpp
#include <bits/stdc++.h> #include<iostream> #include<math.h> using namespace std; int main(){ int n; cin>>n; if(n==1){ cout<<"one"<<endl; } else if (n==2){ cout<<"two"<<endl; } else if (n==3){ cout<<"three"<<endl; } else if (n=...
ALGO
0.999208
3.691495
e37c8cea-a274-48f3-bb6c-08fc5d4b1ce5
PannenetsF/SelectiveFocus
mmdet/mmdet/ops/dcn/src/cuda/deform_pool_cuda.cpp
// modify from // https://github.com/chengdazhi/Deformable-Convolution-V2-PyTorch/blob/mmdetection/mmdet/ops/dcn/src/modulated_dcn_cuda.c // based on // author: Charles Shang // https://github.com/torch/cunn/blob/master/lib/THCUNN/generic/SpatialConvolutionMM.cu #include <torch/extension.h> #include <ATen/DeviceGuard...
DATA
0.872003
4.785217
fdda19a6-a30b-487d-8e5a-4066fe6c685a
RajdevKapoor/Leetcode-Practice
139-word-break/139-word-break.cpp
class Solution { public: int dp[301]; int help(int i,string &s, set<string> wordDist){ if(i == s.size()) return 1; string temp; if(dp[i]!=-1)return dp[i]; for(int j = i; j<s.size();j++){ temp+=s[j]; if(wordDist.find(temp...
ALGO
0.999918
5.801798
9e58f1a2-14e8-4764-8098-3e3109b6d285
shadercoder/photonray
VisualSPH/Render11/sorterGPU.cpp
#include "DXUT.h" #include "sorterGPU.h" sorterGPU::sorterGPU(void) { } sorterGPU::~sorterGPU(void) { } HRESULT sorterGPU::updateBuffer(void* newData) { data = newData; return S_OK; } //-------------------------------------------------------------------------------------- // Create the Resources //---------------...
ALGO
0.995208
5.676579
dd036ce3-f2c4-4621-8ac6-2769194a07e6
NahulRahman/C-_For_Noob_Steps
d5loop.cpp
#include <iostream> using namespace std; int main(){ int i, j, rows; int stars, spaces; cin>>rows; stars = 1; spaces = rows - 1; for(i=1; i<rows*2; i++){ for(j=1; j<=spaces; j++) cout<<" "; for(j=1; j<stars*2; j++) cout<<j; cout<<endl; if(i<rows){ spac...
ALGO
0.99991
3.509907
652a1af5-fd27-43c4-8035-0e3d085008d1
Tanishq2319/oops
overload.cpp
#include<iostream> using namespace std; int area(int s) { return(s*s); } float area(float r) { return(3.14*r*r); } float area(float bs,float ht) { return((bs*ht)/2); } int area(int l,int b) { return(l*b); } int main() { int s,l,b; float r,bs,ht; cout<<"Enter side of a square:"; cin>>s; cout<<"Enter radius of c...
ALGO
0.979544
3.264401
0309dd1c-9aca-4429-97e4-9bcf59335bb2
Jiwan/RADS
thirdparty/boost/libs/numeric/ublas/doc/samples/triangular_matrix.cpp
#include <boost/numeric/ublas/triangular.hpp> #include <boost/numeric/ublas/io.hpp> int main () { using namespace boost::numeric::ublas; triangular_matrix<double, lower> ml (3, 3); for (unsigned i = 0; i < ml.size1 (); ++ i) for (unsigned j = 0; j <= i; ++ j) ml (i, j) = 3 * i + j; ...
ALGO
0.931806
3.756057
b99cdd75-af7e-4e7e-92a4-24d9e3128ce6
PrithwishJana/CoTran
CodeGen/data/transcoder_evaluation_gfg/cpp/DETECT_IF_TWO_INTEGERS_HAVE_OPPOSITE_SIGNS.cpp
#include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include <bits/stdc++.h> using namespace std; bool f_gold ( int x, int y ) { return ( ( x ^ y ) < 0 ); } //TOFILL int main() { int n_success = 0; vector<int> param0 {59,-20,-100,54,-16,-23,93,24,...
ALGO
0.998676
5.556066
e82467c2-0d3f-4f4b-8ec8-b8252ae3dbe9
rishavnathpati/Terminal-File-Explorer
copycommand.cpp
#include "myheader.h" /// @brief Recursively copies all files and directories to the destination path /// @param sourcePath The source path /// @param destinationPath The destination path void copyDirectory(char *sourcePath, char *destinationPath) { int status = mkdir(destinationPath, S_IRWXU | S_IRWXG | S_IROTH | S_...
TOOL
0.892343
4.125131
5ee7371e-ee3f-4193-a2af-18d2d8d5c279
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_6933_0.cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 3; const int SQRT = 320; const int MOD = 1e9 + 7; const int INF = MOD; const long double PI = 3.141592653589793; const long double EPS = 1e-6; int sieve[2 * maxn]; long long n[4]; long long m[4]; long long s[4]; vector<pair<int, int>> ss; vector<pair<...
ALGO
0.999789
4.155013
ecea8692-4853-4732-9d23-42d2ede79eda
ducknife/240_bai_CPP_codeptit
THC++ThayThe/Buoi1/B4.cpp
#include <bits/stdc++.h> #define ll long long #define MOD 1000000007 #define maxN 10000005 using namespace std; int prime[maxN]; void seive(){ for (int i = 2; i <= maxN; i++) prime[i] = 1; for (int i = 2; i * i <= maxN; i++){ if (prime[i]){ for (int j = i * i; j <= maxN; j+=i){ ...
ALGO
0.999936
4.0258
4fb391b5-62f7-453c-bacb-49e364ca739b
ipaljak-tbtl/advent-of-code
2021/paljak/15/small.cpp
#include <bits/stdc++.h> using namespace std; struct Node { int r, s, dist; Node() {} Node(int r, int s, int dist) : r(r), s(s), dist(dist) {} friend bool operator<(const Node &A, const Node &B) { return A.dist > B.dist; } }; const int MAXN = 1010; const int dr[] = {0, 1, 0, -1}; const int ds[] = {1,...
ALGO
0.99942
4.135411
98c0f1c6-4849-4e4f-a990-0e240bb4881c
PrivateThommy/PROG-C-
Ativid 3/Exercicio 2.cpp
#include <stdio.h> void invt(int vet[]) { int i = 0; int j = 4; while (i < j) { int var = vet[i]; vet[i] = vet[j]; vet[j] = var; i++; j--; } } int main() { int taman = 5; int u[taman]; int item = 0; while (item <taman) { ...
ALGO
0.999847
3.965338
b965fb11-24f5-4f59-91c3-38ae876d6d2d
ishandutta2007/codeforces
lucaperju/normal/1437/F.cpp
#include <bits/stdc++.h> using namespace std; //* const long long mod = 998244353; //* long long lgput (long long a, long long exp) { long long rz=1; while(exp) if(exp&1) exp^=1,rz=rz*1LL*a%mod; else exp>>=1,a=a*1LL*a%mod; return rz; } long long fct[200005],invfct[2...
ALGO
0.999984
3.988644
3b91c196-fcd4-4dfe-ae89-c8210a785370
RamazanEmreErkan/Data-Structures
linkedlist.cpp
//This code is under development! #include <iostream> using namespace std; struct node { int data; node *next; }; class LinkedList { private: node *head, *tail; public: LinkedList() { head = NULL; tail = NULL; } node* gethead() { return head; } void viewlist() { node *iterator; iterator =...
ALGO
0.990599
3.850414
f8804f73-b2b6-49a6-b2af-36fb486d602b
wnsgus313/BOJ
프로그래머스/unrated/154540. 무인도 여행/무인도 여행.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; int w, h; int dy[4] = {-1, 0, 1, 0}; int dx[4] = {0, 1, 0, -1}; int dfs(int y, int x, vector<string>& maps){ int ret = maps[y][x] - '0'; maps[y][x] = 'X'; for(int i=0; i<4; i++){ int ny = y+dy[i], nx = x+dx[i]; ...
ALGO
0.99979
4.422791
dc54ee07-e592-4b08-ba08-f16cf3816f6a
sarvex/leetcode-chef
solution/0600-0699/0664.Strange Printer/Solution.cpp
class Solution { public: int strangePrinter(string s) { int n = s.size(); vector<vector<int>> dp(n, vector<int>(n, INT_MAX)); for (int i = n - 1; i >= 0; --i) { dp[i][i] = 1; for (int j = i + 1; j < n; ++j) { if (s[i] == s[j]) { dp[...
ALGO
0.999991
5.479582
34a992bc-0784-4c17-a887-add04afd2e79
CJSBinder-User/CJSBinder
experiment/correctness_efficiency/cjsbinder/MINIMUM_COST_MAKE_ARRAY_SIZE_1_REMOVING_LARGER_PAIRS/MINIMUM_COST_MAKE_ARRAY_SIZE_1_REMOVING_LARGER_PAIRS_GLUECODE.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <iostream> #include <fstream> #include "include/libplatform/libplatform.h" #include "include/v8.h" #include "CQuesHeader.h" using namespace v8; void Print(const FunctionCallbackInfo<Value>& args){ v8::Isolate* isolate = args.GetIsolate(); v8::Str...
ALGO
0.965854
4.041166
fe523647-14d8-4de6-b1b5-d418ccc288d1
Const5215/Leetcode
20180623/606.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: string res = ""; void dfs(TreeNode* t) { if (t == NULL) return; ...
ALGO
0.99978
6.273023
1b82ec65-387b-4110-a7da-0668874c3cc3
vaibhavgabani/Cpp
P01 Input , Output & Conditionals(If & Else)/P12_Factory_Worker_Payment_Extended.cpp
#include<iostream> using namespace std; int main(){ float hours; cout<<"Enter your working hours : "; cin>>hours; if(hours > 0 && hours <= 168){ float sal; if(hours > 40){ float overtime = hours - 40; if(overtime >= 1 && overtime <= 5){ sal = hours * 70.00; co...
ALGO
0.989969
3.599213
46099a49-fc16-4ca1-8308-b1e680212c8f
teamfx/openjfx-10-dev-rt
modules/javafx.web/src/main/native/Source/ThirdParty/icu/source/i18n/uspoof_conf.cpp
#include "unicode/utypes.h" #include "unicode/uspoof.h" #if !UCONFIG_NO_REGULAR_EXPRESSIONS #if !UCONFIG_NO_NORMALIZATION #include "unicode/unorm.h" #include "unicode/uregex.h" #include "unicode/ustring.h" #include "cmemory.h" #include "uspoof_impl.h" #include "uhash.h" #include "uvector.h" #include "uassert.h" #inclu...
TOOL
0.901311
3.224619
d8d7797d-fee2-4ba7-a142-7d5e2727533a
komukomo/competitive-programming
aoj/alds-1-2-b.cpp
#include <algorithm> #include <iostream> using namespace std; static const int MAX = 100; void trace(int data[], int n) { cout << data[0]; for (int i = 1; i < n; i++) { cout << " " << data[i]; } cout << endl; } int selectionSort(int A[], int len) { int count = 0; for (int i = 0; i < len; i++) { in...
ALGO
0.999691
4.379688
1818862f-19ff-4b65-917f-3cc2b2b5a7e4
rsmwall/ifpi-ads-course
module-ii/estrutura-dados-i/listas/lista-01/q15-consoante-vogal.cpp
// Leia uma letra e verifique se a letra digitada é vogal ou consoante #include <stdio.h> int main(){ char letra; printf("Digite uma letra: "); scanf("%s", &letra); if(letra == 'a' || letra == 'e' || letra == 'i' || letra == 'o' || letra == 'u' || letra == 'A' || letra == 'E' || letra == 'I' || letr...
ALGO
0.985147
3.953126
85139b12-df1d-403c-aad4-64b08e201707
lfq0921/NJU-Problem-Solving
OJ/final3C.cpp
#include<bits/stdc++.h> using namespace std; const int N = 40, M = 40; int n, m; int x[N][M], sum1, sum2; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) { scanf("%d", &x[i][j]); if ((i+j)%2==0)sum1+=x[i][j]; else sum2+=x[i][j]; } if (n == 2 && m == 2 || n*...
ALGO
0.999998
3.494976
a9faacc9-4db9-4449-b41a-a6729d3b5743
zyhustgithub/leetcode
hard/564.寻找最近的回文数.cpp
/* * @lc app=leetcode.cn id=564 lang=cpp * * [564] 寻找最近的回文数 */ // @lc code=start class Solution { public: string nearestPalindromic(string n) { long strSize = n.size(); long splitNum = (strSize - 1) / 2; long rightNum = strSize / 2; long num = stoul(n); long leftNum = s...
ALGO
0.99998
7.015724
f091d184-ce90-4388-bedc-02bf415ea4fe
jayant-07/DSA_Problems
78-subsets/78-subsets.cpp
class Solution { void helper(vector<int>&nums, vector<vector<int>>&ans, int i,vector<int>&vec) { if(i>nums.size()) return; if(i==nums.size()) { ans.push_back(vec); return; } vec.push_back(nums[i]); helper(nums,ans,i+1,vec);...
ALGO
0.999948
6.2888
ce89bcee-5bf7-44e5-99e7-d097af78b9fe
lisa-wolfgang/Vessel-Browser
source/gfx/skia/skia/src/gpu/effects/GrBicubicEffect.cpp
#include "src/core/SkMatrixPriv.h" #include "src/gpu/effects/GrBicubicEffect.h" #include "include/gpu/GrTexture.h" #include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h" #include "src/gpu/glsl/GrGLSLProgramDataManager.h" #include "src/gpu/glsl/GrGLSLUniformHandler.h" class GrGLBicubicEffect : public GrGLSLFragmentProc...
ALGO
0.964297
7.281932
a6baaaff-aa3f-4653-8d25-7ffb5e2d8bda
KishenSharma6/CPP_Syntax_Practice
cmake_tutorial/Adder/adder.cpp
#include "adder.h" //use quotes for programmer created header files float add(float a, float b) { return (a+b); }
TOOL
0.890381
3.666744
8c78d6e6-79c9-4dcb-9671-65aeabdef87e
TashinParvez/Competitive-Programming-Journey
Leetcode-Solutions/1. Two Sum.cpp
// **************** Author : Tashin.Parvez **************** // ************* United International University ************* #include <bits/stdc++.h> #define CRACKED return 0; #define nl endl #define int long long #define setDec(x) fixed << setprecision(x) #define tashin cout << "____Tashin____" << nl;...
ALGO
0.999716
5.877382
ab4ba43d-d394-4d29-8c6b-48988fba5db6
tanishq6818/DSA
POTD Jan 10th/Leetcode POTD.cpp
You are given the root of a binary tree with unique values, and an integer start. At minute 0, an infection starts from the node with value start. Each minute, a node becomes infected if: The node is currently uninfected. The node is adjacent to an infected node. Return the number of minutes needed for the entire tre...
ALGO
0.999983
6.606434
aae4ab0e-e981-4c3e-8c08-697341b5b0a7
qingbot/UEngine
Engine/Source/ThirdParty/Intel/ISPC/ispc-1.16.1/examples/cpu/gmres/matrix.cpp
#ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS #endif /**************************************************************\ | Includes \**************************************************************/ #include "matrix.h" #include "matrix_ispc.h" extern "C" { #include "mmio.h" } /*******************************************...
TOOL
0.989605
5.432703
8aec6222-5af7-4f32-8a2e-a892629c7fc5
mr-vicky/TCS-NQT-Coding-Sheet
Striver TCS Sheet/01]. Arrays/06_Rearrange_array_in_increasing_decreasing_order.cpp
/* Rearrange array in increasing-decreasing order Problem Statement: Rearrange the array such that the first half is arranged in increasing order, and the second half is arranged in decreasing order Examples: Example 1: Input: 8 7 1 6 5 9 Output: 1 5 6 9 8 7 Explanation: First three elements are in the ascending orde...
ALGO
0.999902
5.697733
dde02305-1b74-438d-8500-c946c23aa28f
Tejas2124/Cp-Solutions
soldiersandbananas.cpp
#include <iostream> #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include ...
ALGO
0.999959
3.441985
6543d186-9e30-4030-b57b-5a4cc71ff149
ishandutta2007/codeforces
ch_egor/normal/698/A.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <string> #include <cstring> #include <vector> #include <stack> #include <queue> #include <deque> #include <set> #include <map> #include <cassert> #include <algorithm> #include <iomanip> #include <ctime> #include <cmath> #include <bitset> #pragma comment...
ALGO
0.999855
3.833624
e4d55c98-5825-48aa-86ac-e81be65ec3d3
DevMayurJ/LeetCode
LeetcodeProblemsandSolutions/Array/977SquaresofaSortedArray.cpp
/* Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: Input: nums = [-4,-1,0,3,10] Output: [0,1,9,16,100] Explanation: After squaring, the array becomes [16,1,0,9,100]. After sorting, it becomes [0,1,9,16,100]. Example 2...
ALGO
0.999992
6.284064
ac260689-0081-4ead-9809-3a8d22b8930a
pragya644/Leetcode-Questions
107-binary-tree-level-order-traversal-ii/107-binary-tree-level-order-traversal-ii.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.999961
6.21374
993b8936-7c5e-4670-8b7a-f39f1f39ed3a
Zoselro/C-_200_example_questions
Chapter5_add_sub_mult_div/main.cpp
#include<iostream> using namespace std; int main(){ int one = 1; int two = 2; int three = 3; int four = 4; // 변수간에 연산이 가능하다. cout << "1 + 3 = " << one + three << endl; cout << "4 - 2 = " << four - two << endl; cout << "2 * 3 ...
ALGO
0.925946
3.526636
f2916baf-1629-4f3a-b1af-a1746eae37b7
jaewoopk/Cpp_Algorithm
Barking_Algorithm/B_1697.cpp
#include <bits/stdc++.h> using namespace std; int n,m; int board[1000002]; int dist[1000002]; int dx[2] = {-1,1}; void ft_BFS(queue<int> &Q, int n, int m) { if (n == m) { cout << 0 << endl; return ; } while (!Q.empty()) { int cur = Q.front(); Q.pop(); for (int dir = 0; dir < 2; dir++) { int nx = ...
ALGO
0.99998
3.261564
59e370e3-12d4-4ace-9989-3a508d830325
yash88990/GFG-Solution-CPP
Difficulty: Medium/Get Min from Stack/get-min-from-stack.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { private: stack<int>s , minstack; public: Solution() { // code here } // Add an element to the top of Stack void push(int x) { // code here s.push(x); i...
ALGO
0.999359
5.479861
3099e02a-998f-4971-a389-307a2765efe9
alvls/mp1-2024-1
dolov-VyV/task4/Source.cpp
#include <iostream> #include <map> #include <vector> #include <fstream> #include <sstream> #include <locale.h> struct Birthday { int day, month, year; }; class Contact { public: std::string surname, name, patronymic, phone; Birthday birthday; bool isFavorite; Contact() : surname(""), name(""), patronymic(""), p...
TOOL
0.93439
5.089575
6f11baa8-3f7c-40aa-b7ba-eb98238cec32
kavyakapoor420/Dsa_Practise_cpp
BasicArray/TwoSum.cpp
#include<iostream> #include<vector> #include<unordered_map> using namespace std ; //brute force vector<int> twoSum(vector<int>& nums,int target){ int n=nums.size() ; for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ if(nums[i]+nums[j]==target){ return {i,j} ; } ...
ALGO
0.999791
5.56285
1b510a36-25d9-4aa8-8bf1-eee0411abea8
ancedric/Attendance_system
Smart_ats_flutter/smart_ats/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.998381
6.76775
76806da7-3892-4253-8989-8e5c759750f4
manojborugadda/Leetcode-questions
86-partition-list/86-partition-list.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { //TC :O(N) SC:O(1) public: ...
ALGO
0.999994
5.185886
95d03d73-159e-4929-9163-a63b65f48577
ishandutta2007/codeforces
turmax/normal/1644/F.cpp
#pragma GCC optimize("O3","Ofast","unroll-loops") #pragma GCC target("avx2") #include <bits/stdc++.h> using namespace std; #define int long long const int p=998244353; const int maxn=4e5+5; int fact[maxn];int invf[maxn];int num[maxn];int lp[maxn];int pon[maxn];int h[maxn]; int po(int a,int b) { if(b==0) return 1; ...
ALGO
0.99998
4.136373
babf22ec-d939-4cd3-be49-c5575ba131f2
yash2032/-6Companies30days
Amazon/8.Count ways to N'th Stair(Order does not matter).cpp
class Solution { public: //Function to count number of ways to reach the nth stair //when order does not matter. long long countWays(int n) { return n/2+1; } };
ALGO
0.999913
4.623121
303efcc8-7537-4180-84e3-2e59ae2a2efc
kris-randen/Pathrise
assig_02_e_groupAnagrams.cpp
void swap(char* a, char* b) { char* temp = a; a = b; b = temp; } string signature(const string& v) { if (v.size() < 2) return v; string s = v; for (int i=0; i < s.size(); ++i) { char m = s[i]; for (int j=(i+1); j < s.size(); ++j) { if (s[j] < m...
ALGO
0.999995
6.410624