uuid
stringlengths
36
36
repo_name
stringlengths
5
123
relative_path
stringlengths
5
4k
content
stringlengths
33
2.85M
category
stringclasses
6 values
algo_rel_score
float64
0.85
1
quality_score
float64
3
8.76
b081cfb7-df98-49c0-bfd4-e8def388f7d6
sarvex/leetcode-giz
solution/0200-0299/0207.Course Schedule/Solution.cpp
class Solution { public: bool canFinish(int numCourses, vector<vector<int>>& prerequisites) { vector<vector<int>> g(numCourses); vector<int> indeg(numCourses); for (auto& p : prerequisites) { int a = p[0], b = p[1]; g[b].push_back(a); ++indeg[a]; }...
ALGO
0.99992
6.494435
a9326f21-7fa9-435a-a4ec-2c509aa2e080
JeanBonna/Beecrowd
AC-HOC/Achando os Monótonos Não-Triviais Maximais.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; string x; cin >> x; int ans = 0; for(int i=0; i<n;i++){ if(i>0){ if(x[i]=='a' && (x[i-1]=='a' || x[i+1]=='a')) ans++; }else{ if(x[i]=='a' && x[i+1]=='a') ans++; } ...
ALGO
0.999939
4.059462
95fde607-9a21-468c-abd3-6d28612774a3
casys-kaist/glet
src/standalone_scheduler.cpp
#include <iostream> #include <vector> #include <map> #include <algorithm> #include <fstream> #include <assert.h> #include "config.h" #include "boost/program_options.hpp" #include "scheduler_incremental.h" #include "scheduler_utils.h" #include "common_utils.h" namespace po = boost::program_options; std::vector<int> AV...
ALGO
0.986809
4.223029
9e0026fa-322b-4f59-8c02-5990b59f1dd7
DSafr2506/semestr_2
algoritm.cpp
#include<iostream> #include <vector> #include <queue> void bfs(int start, const std::vector<std::vector<int>>& graph){ std::vector<bool>visited(graph.size(), false); std::queue<int> q; q.push(start); visited[start] = true; while (!q.empty()){ int node = q.front(); q.pop(); s...
ALGO
0.99988
5.654757
824c46dd-3435-4a63-90fd-938abeab1ad6
ioleon13/LeetCode
Palindrome Partitioning II.cpp
class Solution { public: int minCut(string s) { // Start typing your C/C++ solution below // DO NOT write int main() function if(s.empty()) return 0; int n = s.size(); vector<vector<int> > check(n+1,vector<int>(n+1)); vector<int> vec(n+1); for(int ...
ALGO
0.999977
5.461668
d70321c9-e8c0-42ae-b356-f1374ffebc37
perewodchik/CPP
contest/#5/B/B.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <map> using namespace std; int main() { freopen("subseq.in", "r", stdin); freopen("subseq.out", "w", stdout); ios::sync_with_stdio(0); int sequence = 0; int max_sequence = 0; int input; int previous; cin >> input; previous =...
ALGO
0.999738
3.504626
ab5049f4-3f19-468a-b52e-d0ac01da3602
i-pu/riscv-llvm-target
llvm-project/llvm/lib/CodeGen/SpillPlacement.cpp
#include "SpillPlacement.h" #include "llvm/ADT/BitVector.h" #include "llvm/CodeGen/EdgeBundles.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineBlockFrequencyInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/Passes.h" #include ...
ALGO
0.999446
7.761207
e90d3603-256d-42c0-b191-da36110eeae8
skeeto/pixelcity
Visible.cpp
/*----------------------------------------------------------------------------- Visible.cpp 2009 Shamus Young ------------------------------------------------------------------------------- This module runs the visibility grid, a 2-dimensional array that aids in culling objects during rendering. There a...
TOOL
0.96926
6.197879
da0a7d81-1028-4be2-ac1c-3613f5a6ce0b
samarthcode1/LeetCode1
2808-painting-the-walls/painting-the-walls.cpp
class Solution { public: int check(vector<int>& cost, vector<int>& time, int idx, int rem,vector<vector<int>>& dp) { if (rem <= 0) { return 0; } if (idx >= cost.size()) { return 1e9; } if (dp[idx][rem] != -1) { return dp[idx][rem]; ...
ALGO
0.999906
5.720513
c1e823db-af8d-4b8b-b986-e84b52140b43
SunshengGu/Highway_Driving
src/Eigen-3.3/bench/dense_solvers.cpp
#include <iostream> #include "BenchTimer.h" #include <Eigen/Dense> #include <map> #include <vector> #include <string> #include <sstream> using namespace Eigen; std::map<std::string,Array<float,1,8,DontAlign|RowMajor> > results; std::vector<std::string> labels; std::vector<Array2i> sizes; template<typename Solver,type...
TOOL
0.997494
6.326138
37bf70de-99cd-4763-b644-7bdecb9d6a43
atli164/Code-library
code/string/min_rot.cpp
string min_rot(string s) { int n = s.size(); string res = s; s = s + s; int rot = 0; rep(i,0,n) rep(j,0,n) { if(rot + j == i || s[rot + j] < s[i + j]) { i += max(0, j - 1); break; } if(s[rot + j] > s[i + j]) { rot = i; break; ...
ALGO
0.999988
4.92282
e8f704f3-42a1-4239-9128-b96b440494d3
LucasAlbergoni/lucasalbergoni.github.io
portfolio/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.998492
6.76073
5f1d5d91-9935-434f-b914-cdc351f2a1b8
ShuoHe97/CS239-Final-Project
chrono/chrono-dev/src/demos/fea/demo_FEA_cables.cpp
#include "chrono/physics/ChSystemNSC.h" #include "chrono/solver/ChSolverMINRES.h" #include "chrono/solver/ChSolverPMINRES.h" #include "chrono/timestepper/ChTimestepper.h" #include "chrono_irrlicht/ChIrrApp.h" #include "FEAcables.h" using namespace chrono; using namespace chrono::fea; using namespace chrono::irrlicht;...
ALGO
0.878812
5.110474
fa0b5211-807f-463c-884e-a75b57e12920
ddimitrov-fmi/up-2022-2023
practicum_inf/group 2/week03/week03-solutions/task3.cpp
#include<iostream> using namespace std; int main(){ int n, t1 = 0, t2 = 1, nextTerm = 0; cin >> n; for(int i = 0; i < n; i++){ if(i == 1){ continue; } if(i == 2){ continue; } nextTerm = t1 + t2; t1 = t2; t2 = nextTerm; } cout<<nextTerm; cout<<(1,2,3,4,5); return 0; }
ALGO
0.999754
3.086545
57128795-26ee-4d43-84d1-becae2583366
JavierMHdz/ElectricalEngineering
IntroductionToProgramming/hw4.cpp
//******************************************************************** // Program Name: hw4.cpp // Author: Javier Jesus Macossay Hernandez // UTPA Student ID: 20228488 // Due Date: 06/18/2013 // Course: 1380.01 // HW Assignment: Four // // Description: This is a program is to do fractional arithmetic. // T...
TOOL
0.952447
4.319931
67931277-4cb9-4b24-9465-26ff03f4b40f
aRiQdark/MuhammadAriq_tesQTI
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
2a763af1-7b13-4e31-85a7-1e8c517e8052
berak/opencv_smallfry
bow/cbir.cpp
#include "opencv2/opencv.hpp" #include "opencv2/core/ocl.hpp" #include <opencv2/core/utils/filesystem.hpp> #include "opencv2/xfeatures2d.hpp" #include "BowKMajorityTrainer.h" #include "profile.h" #include <cstdio> #include <vector> #include <iostream> using namespace std; using namespace cv; int missedImg=0; int mi...
ALGO
0.947456
5.679747
bd3acd14-5bfb-4837-a2f9-4da526c34908
EssJimmy/leetcode
capital-one/copyRandomList.cpp
#include <bits/stdc++.h> using namespace std; class ListNode { public: int val; ListNode* next; ListNode* random; ListNode (int _val) { val = _val; next = NULL; random = NULL; } }; class Solution{ public: ListNode* copyRandomList(ListNode* head) { if(!head) r...
ALGO
0.990249
5.026316
547740d9-7994-4aaa-a08a-ca7580771e99
thushan/flsun-superracer-v1.3-firmware
Marlin/src/lcd/menu/game/maze.cpp
#include "../../../inc/MarlinConfigPre.h" #if ENABLED(MARLIN_MAZE) #include "game.h" int8_t move_dir, last_move_dir, // NESW0 prizex, prizey, prize_cnt, old_encoder; fixed_t playerx, playery; // Up to 50 lines, then you win! typedef struct { int8_t x, y; } pos_t; uint8_t head_ind; pos_t maze_walls[50] = { ...
ALGO
0.929765
5.047589
e6fe9d68-bb0c-460a-9682-e2962c3b69f0
lizuoyue/LeetCode
187-repeatedDNASequences.cpp
class Solution { public: vector<string> findRepeatedDnaSequences(string s) { vector<string> result; if (s.length() < 10) { return result; } unordered_map<string, int> table; for (int i = 0; i <= (s.length() - 10); ++i) { table[s.substr(i, 10)] += 1; } unordered_map<string, int>::iterator iter; fo...
ALGO
0.997883
4.955624
107d0fe5-166c-4077-9c67-286add3252f6
eugnsp/competitive_programming
src/uva/00222_budget_travel.cpp
#include "base.hpp" #include <algorithm> #include <cassert> #include <cstddef> #include <iomanip> #include <vector> struct Station { double distance; double price; }; class Budget_travel { public: Budget_travel(double distance, double tank_capacity, double miles_per_gallon, double cost, const std::vect...
ALGO
0.988472
5.289759
c9ccf515-3a06-4083-8a72-59085ea63745
lukehutch/flutter_reactive_widget
example/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.998905
6.785645
29085a45-0ccd-42a6-8ed2-053fd4b8d772
manikanta2901/ubuntu
.history/SRM/elab/DataStructures/LinkedList/LL6_20200929105143.cpp
// deleted the nodes #include<bits/stdc++.h> #include<iostream> using namespace std; struct node{ int data; struct node* next; }; void printList(struct node *a){ cout << "List : "; while(a != NULL){ cout << a->data << " "; a = a->next; } cout << endl; } int main(){ int siz...
ALGO
0.999793
3.445329
dd912b1e-5c05-4e38-8805-c9e86c59d4f5
p-mazhnik/mipt-cpp
Contest_3sem_1/U/U.cpp
// // Created by pavel on 06.11.2017. // #include <iostream> #include <queue> enum Color {WHITE, GRAY, BLACK}; void BFS(const std::vector<std::vector<bool> > &input, std::vector<std::vector<int> > &d_time, std::pair<int, int> v) { std::queue<std::pair<int, int> > q; q.push(v); std::vector<std::vec...
ALGO
0.999928
4.480687
a557bbe0-cf94-4903-807b-9abcf56d73a1
ishandutta2007/codeforces
dlalswp25/normal/1699/D.cpp
#include <bits/stdc++.h> using namespace std; int N; int A[5050]; int C[5050][5050]; int cnt[5050]; int D[5050]; int main() { int tc; scanf("%d", &tc); while(tc--) { scanf("%d", &N); for(int i = 1; i <= N + 1; i++) for(int j = 1; j <= N; j++) C[i][j] = 0; for(int i = 1; i <= N; i++) scanf("%d", &A[i]); for...
ALGO
0.999616
4.208164
27a63497-49aa-4620-91ed-34880a4769c2
Dipeshmaurya1/C-Language
For Loop/factorial of n by for loop.cpp
#include<stdio.h> main() { int x=1; int sum=1; int n; printf("Enter Any Value: "); scanf("%d",& n); for(x=1;x<=n;x++) { sum=sum*x; } printf("%d",sum); }
ALGO
0.999914
3.362936
3a1089d7-ba48-4016-99aa-cb839574c6fb
jbob555/slimfox
gfx/skia/skia/src/core/SkQuadClipper.cpp
#include "SkQuadClipper.h" #include "SkGeometry.h" SkQuadClipper::SkQuadClipper() { fClip.setEmpty(); } void SkQuadClipper::setClip(const SkIRect& clip) { // conver to scalars, since that's where we'll see the points fClip.set(clip); } /////////////////////////////////////////////////////////////////////...
ALGO
0.994954
6.753691
55b38ee2-e45d-4965-9cf8-d6430f90731e
Domain-Cmap/assignments-day-1-to-day-9-pulkitagg17
Day 3/Hard/2.cpp
#include <iostream> using namespace std; class Solution { public: ListNode *reverseKGroup(ListNode *head, int k) { if (!head || k == 1) return head; ListNode dummy(0); dummy.next = head; ListNode *prev = &dummy; ListNode *curr = head; int count = 0;...
ALGO
0.999996
5.406891
86009a9f-0874-4e94-a0bb-9333282cbd96
VuPham252/github
bai tap buoi 4/bai6.cpp
#include<stdio.h> int main(){ // int n; // printf("Nhap so nguyen n: "); // scanf("%d",&n); // int a1=1,a2=1; // int a; // for(int i=3;i<=n;i++){ // a=a1+a2; // a1=a2; // a2=a; // } // printf("so thu %d cua day Fibonacci la %d",n,a); //} // giai // if(n<=0){ // printf("So thu %d la: %d",n,0); // }else if(n<=2){ ...
ALGO
0.999971
3.004777
4125cf5c-2f21-44ef-8391-53a2dc9cabce
Mohamed-Adel2/LeetCode-Solutions
368-largest-divisible-subset/largest-divisible-subset.cpp
class Solution { public: vector<int> ans; vector<int> nums; vector<vector<int>> dp; int n; vector<int> largestDivisibleSubset(vector<int> &num) { nums = num; nums.push_back(1); sort(nums.begin(), nums.end()); n = nums.size(); dp.resize(n + 1, vector<int>(n + ...
ALGO
0.999991
5.092261
5cd26c6d-f3c0-4413-a88d-d4295462569e
yeongsbook/algorithm-study
baekjoon/2884.cpp
// https://www.acmicpc.net/problem/2884 #include <stdio.h> int main(int argc, char const *argv[]) { int A, B; scanf("%d %d", &A, &B); int minute = B - 45; int hour = minute < 0 ? A - 1 : A; if (hour < 0) { hour += 24; } if (minute < 0) { minute += 60; } printf("%d %d", hour, minute); ret...
ALGO
0.99992
5.501524
c99630f4-7df8-4898-b71d-1d2be16d7d2a
ishandutta2007/codeforces
galen_colin/normal/1131/C.cpp
#include <bits/stdc++.h> #include <chrono> using namespace std::chrono; using namespace std; #define f0r(a, b) for (int a = 0; a < b; a++) #define f1r(a, b, c) for (int a = b; a < c; a++) #define ms(arr, v) memset(arr, v, sizeof(arr)) #define pb push_back #define io ios_base::sync_with_stdio(false); cin.tie(NULL); ...
ALGO
0.999983
3.462531
316b3085-abb9-4653-862f-76e48757b29e
S-Virendra/OOPS
maxsum_subarray.cpp
#include<iostream> using namespace std; int maxsumsubarray(int*arr,int n){ int maxsum= INT16_MIN; for(int i=0;i<n;i++){ for(int j=i;j<n;j++){ int currsum=0; for(int k=i;k<=j;k++){ currsum=currsum+arr[k]; } maxsum=max(maxsum,currsum); ...
ALGO
0.999821
4.925656
1c250c2b-2c7c-4e6c-81d6-8c714b933729
jimpei8989/APCSC-2021
Arrays/array_global.cpp
#include <iostream> int arr[1000000]; int main() { int N = 1000000; for (int i = 0; i < N; i++) { arr[i] = i; } }
ALGO
0.973243
3.683485
24662e60-47ed-439d-8937-bf20d03caaa3
Ged0oo/ICPCMinyaCommunity
Week 2 Sheet/J - Four Digits.cpp
#include <iostream> #include <algorithm> using namespace std; int main() { int n, n1, n2 ,n3, n4; cin >> n; n1 = n % 10; n /= 10; n2 = n % 10; n /= 10; n3 = n % 10; n /= 10; n4 = n % 10; cout << n4<<n3<<n2<<n1; return 0; }
ALGO
0.999381
4.149149
a850ee84-4317-4cd1-aeff-9bc244a7c2d5
SalvageMod/platform_frameworks_base
media/libstagefright/codecs/amrnb/common/src/norm_l.cpp
/* Pathname: ./gsm-amr/c/src/norm_l.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Created separate file for the norm_l function. Sync'ed up with the current template and fixed tabs. Description: Updated module description to be the same a...
ALGO
0.998646
6.376004
9db6fe4f-7626-4ab0-8d4e-35d3d34eac5a
zgqinc/yuzu-android
src/shader_recompiler/ir_opt/texture_pass.cpp
#include <algorithm> #include <bit> #include <optional> #include <boost/container/small_vector.hpp> #include "shader_recompiler/environment.h" #include "shader_recompiler/frontend/ir/basic_block.h" #include "shader_recompiler/frontend/ir/breadth_first_search.h" #include "shader_recompiler/frontend/ir/ir_emitter.h" #i...
ALGO
0.941441
6.235106
8609baf0-a849-47cb-bd21-a68536851a23
MrGxsheng/MyProblem
abc262/D.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; typedef long long LL; typedef pair<int,int> PII; const int N = 1000010; int n,m; constexpr int P = 998244353; using i64 = long long; // assume -P <= x < 2P int norm(int x) { if (x < 0) { x += P; } if (x >= P) { x -= P; } ...
ALGO
0.999941
4.228961
d58821a6-f898-4c9b-a5d9-297c4a362f10
BakytzhanSapy2002/ShareKnowledge
backtracking/40.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; class Solution { public: vector<vector<int> >total_result; vector<vector<bool> >all_cases; void recursive_comb(vector<int>comb,vector<bool>bb, int current_sum,int current_position,vector<int>candidates,int target){ // St...
ALGO
0.999983
4.034524
b5564449-6523-4a44-940f-01e5f47345fb
Ali300805/Ataque_cibernetico
Act-Integradora-1_equipo15/main.cpp
#include "ataque.h" #include <fstream> #include <iostream> #include <sstream> #include <vector> using namespace std; void leer_datos(ifstream &archivo, vector<ataque> &bitacora) { bitacora.clear(); string linea; while (getline(archivo, linea)) { bitacora.push_back(linea); } archivo.close(); } void guard...
ALGO
0.996068
4.290594
c079755a-ebd7-432f-93a1-8add110225dd
xxxcoder-ui/mixx
src/track/beatutils.cpp
#include "track/beatutils.h" #include <QList> #include <QMap> #include <QString> #include <QtDebug> #include <algorithm> #include "util/math.h" namespace { // When ironing the grid for long sequences of const tempo we use // a 25 ms tolerance because this small of a difference is inaudible // This is > 2 * 12 ms, t...
TOOL
0.994253
3.258723
768d64b1-cc86-4272-bdb0-44227ce77765
piskareviv/blog_aux_ntt_1
C/test.cpp
#include <array> #include <cassert> #include <cstring> #include <iostream> #include <random> #include <vector> #include "ntt.hpp" int32_t main() { constexpr auto prime_list = std::array{ 3, 5, 17, 233, 257, 12289, 65537, int(1e9 + 7), int(1e9...
TEST
0.975801
5.07616
dc714404-fceb-419b-8cc8-d5a6ed8f7790
sins621/cxx_learning
Udemy/Beginning C++ Programming - From Beginner to Beyond/Section12/Section Challenges/Section12_SwapValuesUsingPointers.cpp
#include <iostream> using namespace std; void swapPointers(int *ptr1, int *ptr2); int main() { int a{5}, b{10}; int *ptrA{nullptr}, *ptrB{nullptr}; ptrA = &a; ptrB = &b; swapPointers(ptrA, ptrB); cout << "\na == " << a << ", b == " << b; cout << endl; return 0; } void swapPointers(int *ptr1, int *pt...
ALGO
0.994673
5.337678
64dcbddc-4232-4f4f-8197-b3619b3174d9
Glasspham/Summary_exercises
Bai_30/main.cpp
#include<iostream> #include<cmath> #include <fstream> using namespace std; bool KTSCP(int x) { int n = sqrt(x); if(n * n == x) return true; return false; } int main() { int x, y; std::ifstream fileinp("E:\\Project Visual Studio Code\\Summary_exercises\\Bai_30\\CHINHPHUONG.INP"); std::o...
ALGO
0.99959
3.782777
edda885d-c371-4aab-8d60-2ef3a9a208d5
john-echelon/cpp-dsa
dsa-specialization/course-2/week-1/tree-height.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; class TreeHeight { int n; std::vector<int> parent; public: void read() { std::cin >> n; parent.resize(n); for (int i = 0; i < n; i++) std::cin >> parent[i]; } int compute_height2() { int ma...
ALGO
0.999668
4.608306
4dae8cf3-6824-4bf3-8921-cb5110f5f7cd
AugustoOliveira099/Advanced-Programming
3° unidade/Material das Aulas/Pong/pong.cpp
#include <iostream> #include <cmath> #include <cstdlib> // para srand #include <chrono> #include "pong.h" using namespace std; /// Retorna um numero aleatorio entre -1.0 e 1.0 static inline double rnd() { return ((2.0*rand())/RAND_MAX)-1.0; } /// Retorna o sinal de um numero: +1 ou -1 static inline double sgn(doub...
TOOL
0.960314
5.595379
3a4df5c4-abca-43db-bba5-80fbb88951c5
satyamgupta0202/Interview-Preparation
Anagram - GFG/anagram.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function is to check whether two strings are anagram of each other or not. bool isAnagram(string a, string b){ // Your code here sort(a.begin(),a.end()); ...
ALGO
0.999894
6.28921
2f45b397-e623-4701-8fd0-c56c611a7fa9
jterrace/craq
cryptopp560/serpent.cpp
// serpent.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #include "serpent.h" #include "misc.h" #include "serpentp.h" NAMESPACE_BEGIN(CryptoPP) void Serpent_KeySchedule(word32 *k, unsigned int rounds, const byte *userKey, size_t keylen) { FixedSizeSecBlock<word32, 8> k0; GetUserKey(LIT...
ALGO
0.999715
7.486692
00fd7f87-568a-4e96-a732-5c5144b65ab9
gpdoud/primes
primes.cpp
#include <iostream> #include <bitset> using namespace std; const long MAX_PRIME = 1000000; bitset<MAX_PRIME> bits; void set_bit_false(long n) { bits.set(n, 0); } void set_multiples_false(long n) { for(auto i = 2; n * i < MAX_PRIME; i++) { bits.set(n * i, false); } } void check_prime(long n) { ...
ALGO
0.998649
4.475342
5a534b35-da9d-4a0b-b8e7-91f29a9cc2bd
asztell/leetcode-screenshotter
editorial_code/1-999/673. Number of Longest Increasing Subsequence/cpp-1.cpp
class Solution { public: int findNumberOfLIS(std::vector<int>& nums) { int n = nums.size(); vector<int> length(n, 0); vector<int> count(n, 0); function<void(int)> calculateDP = [&](int i) { if (length[i] != 0) return; length[i] = 1; ...
ALGO
0.999996
6.413112
220f09a2-4ffc-4403-ae61-331d19190077
KingNNT/C-CPP
Source/General/Basic/Demo27.cpp
/* Code by KingNNT */ #include <bits/stdc++.h> #define pathio "/mnt/Learning And Working/Code/C-CPP/GNU-Compiler/In-Out/" // #define pathio "E:/Code/C-CPP/GNU-Compiler/In-Out/" #define lfi pathio"input.txt","r",stdin #define lfo pathio"output.txt","w",stdout using namespace std; int main() { freopen(lfi); fr...
ALGO
0.999612
3.337755
3c4a9ba4-e919-44bc-92a5-d56b6086db35
ML4SE2022/group3
data/walkccc-1666132586/C++/1509 Minimum Difference Between Largest and Smallest Value in Three Moves.cpp
class Solution { public: int minDifference(vector<int>& nums) { const int n = nums.size(); if (n < 5) return 0; int ans = INT_MAX; sort(begin(nums), end(nums)); // Change nums[0..i) to nums[i] and // Change nums[n - 3 + i..n) to nums[n - 4 + i] for (int i = 0; i <= 3; ++i) ...
ALGO
0.999898
5.871884
aa5ef148-4306-4567-abf3-25f26103270a
VamshiJanagani/DSA-Progress
Beginner Problems/Basic Hashing/Sum of Highest and Lowest freq in an array.cpp
//Input: arr = [4, 4, 5, 5, 6] //Output: 3 //Explanation: The highest frequency is 2 (elements 4 and 5), and the lowest frequency is 1 (element 6). Their sum is 2 + 1 = 3. #include<bits/stdc++.h> using namespace std; class Solution{ public: int sumofHighandLow(vector<int> &arr){ //Finding maximum elem...
ALGO
0.999877
5.34072
cecbbf1f-884b-434d-a476-5c3e9527ded5
Rohitdhakad1/Operating-System
Priority Scheduling (Without Arrival Time).cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; struct Process { int id; int burstTime; int priority; }; bool comparePriority(const Process& a, const Process& b) { return a.priority < b.priority; } void calculateWaitingTurnaroundTime(vector<Process>& processes) { ...
ALGO
0.999969
5.511821
3f69270f-9ea3-481e-8a40-3f0123548c87
over-fitted/CP
Kattis/success/oddities/oddities.cpp
#include <bits/stdc++.h> using namespace std; #define ar array #define ll long long #define ld long double typedef vector<int> vi; typedef pair<int,int> pi; #define sza(x) ((int)x.size()) #define all(a) (a).begin(), (a).end() #define REP(i,a,b) for (int i = a; i < b; i++) #define elif else if const int MAX_N = 1e5 +...
ALGO
0.999248
4.795968
2d120f46-e18d-466f-b839-609267af0ab5
bsh0315/BaekjoonPS
algorithm/알고리즘 필요 개념/빠른정렬.cpp
// 10989, 모든 수를 표현할 수 있는 배열을 만든 후에 해결. #include<iostream> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int N = 0, temp = 0; cin >> N; int arr[10000] {0,}; for(int i = 0; i<N; ++i){ cin >> temp; ++arr[temp-1]; } ...
ALGO
0.999979
4.721639
232829d5-db38-4cc7-9082-89ef84c5bd87
BoyC/GW2TacO
Bedrock/BaseLib/Quaternion.cpp
#include "BaseLib.h" CQuaternion Lerp( const CQuaternion &v1, const CQuaternion &v2, const TF32 t ) { return ( ( v2 - v1 )*t + v1 ).Normalized(); } CQuaternion Slerp( const CQuaternion &v1, const CQuaternion &v2, const TF32 t ) { TF32 multiplier = 1; TF32 dot = CQuaternion::Dot( v1, v2 ); if ( dot < 0 ) //v1...
ALGO
0.991706
6.616974
7fa76b33-ca8f-4526-b32f-59b34970208a
fuadhasan1122/Codeforces-
days.cpp
#include <bits/stdc++.h> using namespace std; int main() { int age; cin >> age; int year = age \ 365; cout << year << " years" << endl; age -= year * 365; int month = age / 30; cout << month << " months" << endl; age -= month * 30; int day = age; cout << day << " days" << endl; return 0; }
ALGO
0.978351
3.622513
6b55d324-7797-4ec0-8a37-763cdc8ba2ad
BurtinThomas/42Project-FT_IRC
utils/utils.cpp
#include "utils.hpp" std::string trim(const std::string &str) { size_t start = str.find_first_not_of(" \t\n\r\f\v"); if (start == std::string::npos) return ""; size_t end = str.find_last_not_of(" \t\n\r\f\v"); return str.substr(start, end - start + 1); } std::vector<std::string>...
TOOL
0.992611
5.104335
45da3728-6992-434b-9fae-d9bf775fd3a2
yoon20002000/DataStructure
Pracs/Prac15/Sort/BubbleSort/Bubble15.cpp
#include "Bubble15.h" #include <valarray> void Bubble15::sort(std::span<int>& arr) { size_t size = arr.size(); for (size_t i = 0; i < size - 1; ++i) { bool bIsSwapped = false; for (size_t j = 0; j < size - i - 1; ++j) { if (arr[j] > arr[j+1]) { ...
ALGO
0.998816
4.299004
00aa8e50-737d-44d1-9164-a855ade2e8f6
RohitBishla/LeetCode_Practice
Minimum Steps Required - GFG/minimum-steps-required.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ int minSteps(string str) { int a = 0; int b = 0; int i = 0; while(i < str.size()){ char temp = str[i]; if(temp == 'a'){ ...
ALGO
0.999425
6.244174
f55d6028-a2a8-4532-9948-39f045da8cc3
MishkatIT/codeforces-atcoder-submissions
codeforces/1944/1944C MEX Game 1.cpp
/* author : MishkatIT created : Sunday 2024-03-17-20.45.48 */ #include<bits/stdc++.h> #define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define debug(_) cout << #_ << " is " << _ << '\n'; using namespace std; using ll = long long; using ld = long double; const ll mod = 1e9...
ALGO
0.999757
4.899085
8e3df718-92ea-429f-9556-dc1b0d1fa96d
Hijiongfeng/Likou
daily/504.cpp
#include<iostream> #include<string> #include<algorithm> using namespace std; /* 十进制 转 7 进制 */ class Solution { public: string convertToBase7(int num) { string s; if(num == 0) return to_string(num); int new_num = abs(num); while(new_num){ int a = new_num % 7; ...
ALGO
0.999239
4.406418
06c6b602-6e17-4eef-8126-d32693d1a63e
Gurucharan1999/CGProj
CGProj/Ellipse_.cpp
#include "Ellipse_.h" void Ellipse_::draw() { int a = P.X, b = P.Y; int d = b * (b - a * a), x = 0, y = b; mat2<float> R = rotator(A), T = translator((float)C.X, (float)C.Y); while (b * b * x <= a * a * y) { for (int i = 0; i < 4; i++) { vec2<float> V((1 - 2 * ((i / 2) % 2)) * x, (1 - 2 * (i % 2)) * y); ...
ALGO
0.960485
4.225941
b250c128-1d00-42c4-be76-237e76798acd
artificialcoder02/leetcodesolved
907.Sum of Subarray Minimum/sumofminsubarray.cpp
class Solution { public: int sumSubarrayMins(vector<int>& A) { int n = A.size(); int MOD = 1e9 + 7; vector<int> left(n), right(n); // Left Stack stack<int>Left_st; Left_st.push(0); left[0] = 1; // distance = 1 for(int i=1; i<n; i++) { ...
ALGO
0.999983
5.798025
da90de86-7eaf-468b-b49c-6500d5003b7a
silencelee/leetcode
algorithm/322.coin-change.cpp
/* * @lc app=leetcode id=322 lang=cpp * * [322] Coin Change * * https://leetcode.com/problems/coin-change/description/ * * algorithms * Medium (33.43%) * Likes: 3111 * Dislikes: 104 * Total Accepted: 325.4K * Total Submissions: 966.1K * Testcase Example: '[1,2,5]\n11' * * You are given coins of di...
ALGO
0.999987
6.217443
69a5fcda-9870-4116-a480-882e5878e557
furquanuddin94/SPOJ
onp.cpp
#include<stdio.h> #include<stack> #include<string.h> int p(char ); using namespace std; char x[400]; int main() { int t; scanf("%d",&t); while(t--) { scanf("%s",x); stack<char> mystack; // printf("%d",mystack.top()); for(int i=0;i<strlen(x);i++) { if(x[i]=='+'||x[i]=='-'||x[i]=='*'||x[i]=='/'||x[i]=='^'...
ALGO
0.999917
3.70542
75ad9ac6-4d51-4794-9af0-fd5851e09013
taut0logy/Arduino_
_vscode.ino.hex/sketch/J_-_Exactly_N_points.cpp
#line 1 "C:\\Users\\LENOVO\\OneDrive\\Documents\\C\\_VScode\\J_-_Exactly_N_points.cpp" #include <bits/stdc++.h> using namespace std; #define f(i, a, b, x) for (long long i = a; i < b; i += x) #define fr(i, a, b, x) for (long long i = a; i >= b; i -= x) #define pb push_back #define pf push_front #define pp pop_back() #d...
ALGO
0.999888
4.230583
e0395084-db88-43ff-a7b5-94664a08c922
csqs/leetcode
034-search-for-a-range/search-for-a-range.cpp
// Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. // // Your algorithm's runtime complexity must be in the order of O(log n). // // If the target is not found in the array, return [-1, -1]. // // Example 1: // // // Input: nums = [5,7,7,8,8,10],...
ALGO
0.999954
6.962624
c5be2b21-05d4-4478-86a8-8f8a79510126
AvadheshChamola/LeetCode
222_Count_Complete_Tree_Nodes.cpp
/* 222. Count Complete Tree Nodes Medium Given the root of a complete binary tree, return the number of the nodes in the tree. According to Wikipedia, every level, except possibly the last, is completely filled in a complete binary tree, and all nodes in the last level are as far left as possible. It can have between ...
ALGO
0.999763
7.093095
52cd37e8-399d-4300-8141-f29c305238c0
danik25/infinity-course
cpp/ws1/15.cpp
#include <iostream> #include "15.hpp" int main() { int arr[12]; std::cout<<Max<int>(3,5)<<"\n"<<Max<double>(3.7, 12.9)<<"\n"; std::cout<<Max<int*>(arr, arr+8)<<std::endl; std::cout<<Max('a','b')<<std::endl<<"\n"; return(0); }
ALGO
0.913953
4.251755
e1f36235-dcee-4b66-be73-b18e9c42a758
GuilhermeC13/rhitmo-list
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
7dd85948-90ec-4fcf-b5cd-24d1a9d1184d
ishandutta2007/codeforces
fsouza/normal/576/D.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <unordered_map> #include <vector> ...
ALGO
0.999853
4.209961
71fa5abf-0f3a-4476-93ac-fb9f9db1830b
Wangwenjing1996/Sirloin
faiss-main/demos/demo_nndescent.cpp
#include <chrono> #include <cstdio> #include <cstdlib> #include <random> #include <faiss/IndexFlat.h> #include <faiss/IndexNNDescent.h> using namespace std::chrono; int main(void) { // dimension of the vectors to index int d = 64; int K = 64; // size of the database we plan to index size_t nb = ...
ALGO
0.998632
5.851392
2b3a0513-795e-4545-92ad-1c43b1a6a108
ishandutta2007/codeforces
lonefox/normal/960/H.cpp
#define DEBUG 0 #include <algorithm> #include <functional> #include <numeric> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <complex> #include <cstdlib> #include <ctime> #include <cstring> #include <cassert> #include <string> #include <vector> #include <list> #include <map> #includ...
ALGO
0.999927
3.623005
091d5dc8-6dbe-4490-bbaf-5678d823b719
samuel21119/Cpp
CodeForces/contest/1037/b.cpp
#include <bits/stdc++.h> using namespace std; long long n, s, ans; long long in[200010]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n >> s; for (int i = 0; i < n; i++) cin >> in[i]; sort(in, in + n); if (in[n / 2] < s) { for (int i = n / 2; i < n; i++) ...
ALGO
0.999773
3.590252
277830ed-3eb6-47b9-9ccc-e3381b12f438
nachoyegro/algoritmosunq
Entrega 7 - Dijkstra/11492.cpp
#include <iostream> #include <vector> #include <sstream> #include <queue> #include <map> using namespace std; typedef pair<string, bool> letra_usada; typedef pair<int, letra_usada> leng_letra; typedef vector<leng_letra> ll; typedef vector<ll> grafo; //Par con largo total y ultima letra typedef pair<int, char> largo_...
ALGO
0.999773
4.393922
59179ded-90b4-4419-ac0a-86d7e5d66f3f
itkingnb/cf-atc-and-so-on
XCPCs/The 2024 International Collegiate Programming Contest in Hubei Province, China/std.cpp
#include<bits/stdc++.h> using ll=long long; using LL=long long; #define int ll const int N=110; const int mod=998244353; int c[N]; int k=0; int g[N][N]; ll lcm(ll a,ll b) { return (ll)a/std::__gcd(a,b)*b; } void floyd() { for(int i=1;i<=k;i++) { for(int j=1;j<=k;j++) { if(i==j)...
ALGO
0.999941
5.196649
5f02e321-640c-4583-99d2-e4b9ad256da0
TJSchlueter/SATSolver
SATSolver/WalkSAT.cpp
#include "stdafx.h" #include "WalkSAT.h" /// <summary> /// Default constructor. /// </summary> WalkSAT::WalkSAT() { } /// <summary> /// Constructor. /// </summary> /// <param name="inPuzzle">SAT_puzzle object to be solved.</param> WalkSAT::WalkSAT(SAT_puzzle inPuzzle) { baseFormula = inPuzzle; baseFormula.check_tr...
ALGO
0.999965
4.276573
09a50888-0f12-4112-83ee-e7a4a0d8fcca
Hafiz-Sakib/Competetive-Programming
DS__Algorithm/karatsuba_polynomial_multiplication.cpp
/** * Description: Karatsuba Algorithm (Fast polynomial multiplication) * Usage: multiply O(N^1.583) * Source: https://github.com/dragonslayerx */ #include <iostream> #include <cstdio> using namespace std; #define MOD 99991 //m should be a power of 2 class Karatsuba { public: static void multiply(int *...
ALGO
0.999983
3.547736
1d9c05af-20e5-44c9-b7ac-9fdb853732e7
Ramdev-Lodhi/DataStructure-Algorithm
Array/findUniqueElement.cpp
#include <iostream> using namespace std; void duplicate(int arr[], int n) { int arrD[100] = {0}; int k = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (arr[i] == arr[j]) { bool isDuplicate = false; for (int l = 0; l < k; l++) { ...
ALGO
0.999029
4.40467
d802e319-9076-4ad5-bb81-5802a9200056
SONTAX/KNU
4_term/OOOP/lab1/DateOperations.cpp
#include "DateOperations.h" DateOperations::DateOperations(Date first, Date second) { date1 = first; date2 = second; } string DateOperations::DateDifference() { int JDN_1 = date1.GetJDN(); int JDN_2 = date2.GetJDN(); int SEC_1 = date1.GetTimeInSeconds(); int SEC_2 = date2.GetTimeInSeconds(); days_difference = ...
TOOL
0.990537
4.866057
a262eb4e-38b3-4a6d-9876-94aaedb8d06a
khbminus/code2020
contests/spbkoshp/g.cpp
#include <bits/stdc++.h> #include <ostream> using namespace std; using ll = long long; #define SZ(x) (int)((x).size()) #define ALL(x) (x).begin(), (x).end() #define RALL(x) (x).rbegin(), (x).rend() #define TMAX(type) numeric_limits<type>::max() #define TMIN(type) numeric_limits<type>::min() #ifdef LOCAL #define as...
ALGO
0.999856
4.71876
57e1ffdd-812f-4c55-adb1-2e27b919316a
guilhermesvm/data-structures-cpp
beecrowd/1180.cpp
#include <iostream> using namespace std; int main() { int N; cin >> N; int X[N]; // Lê os elementos do vetor X for (int i = 0; i < N; i++) { cin >> X[i]; } int menor_valor = X[0]; int posicao = 0; // Encontra o menor valor e sua posição no vetor for (int i = 1; i < ...
ALGO
0.999968
5.513433
39631024-ac8e-41c6-aa99-3f23c11789df
Renuka-deshpande/Data-Structures-Algorithm
binary-trees/maxPathSum.cpp
#include<iostream> #include <climits> // Include to use INT_MIN using namespace std; struct treenode{ public: int data; treenode*right; treenode*left; treenode(int data1){ data=data1; right=nullptr; left=nullptr; } }; class solution{ public: int maxpathsum(treenod...
ALGO
0.999984
5.257443
79d740cf-1198-44d3-baec-7eb11d580724
RahulK4102/LeetCode
124-binary-tree-maximum-path-sum/binary-tree-maximum-path-sum.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.999954
6.218523
0c7c0e3c-c654-4ccc-88ee-4363e579d278
gokunwu/crf
FlexCRFs-0.3/src/crfs/viterbi/viterbi.cpp
#include <math.h> #include "../../../include/viterbi.h" #include "../../../include/model.h" using namespace std; viterbi::viterbi() { pmodel = NULL; popt = NULL; pdata = NULL; pdict = NULL; pfgen = NULL; Mi = NULL; Vi = NULL; } viterbi::~viterbi() { if (Mi) { delete Mi; ...
ALGO
0.999752
4.896027
f8ac8a77-6003-4768-a4ae-3ccd6c92d5ab
ArdxWe/leetcode
medium/82-Remove-Duplicates-from-Sorted-List-II.cpp
/* Given the head of a sorted linked list, delete all nodes that have duplicate * numbers, leaving only distinct numbers from the original list. Return the * linked list sorted as well. */ // Definition for singly-linked list. struct ListNode { int val; ListNode* next; ListNode() : val(0), next(nullptr) {} ...
ALGO
0.999932
5.637959
d3ce0966-f065-4afb-906f-2ce57aec691e
NHN-Rex/TDMU_2022-2023
HK1/Data-structure-and-algorithm/Stack-Queue/demo-queue-arr.cpp
#include<iostream> using namespace std; #define max 100 typedef struct tagQueue{ int a[max]; int f; //index head element int r; //index tail element }Queue; void InitQueue(Queue &q){ q.f = q.r = -1; } char IsEmpty(Queue &q){ return (q.a[q.f]==NULLDATA); } char IsFull(Queue &q){ return (q.a[q...
ALGO
0.994372
3.257734
c42f838c-d0b0-4b9e-b3d1-fc35f19d4788
sarvex/leetcode-coffeescript
solution/0800-0899/0873.Length of Longest Fibonacci Subsequence/Solution.cpp
class Solution { public: int lenLongestFibSubseq(vector<int>& arr) { unordered_map<int, int> mp; int n = arr.size(); for (int i = 0; i < n; ++i) mp[arr[i]] = i; vector<vector<int>> dp(n, vector<int>(n)); for (int i = 0; i < n; ++i) for (int j = 0; j < i; ++j) ...
ALGO
0.99996
5.430672
de1e7022-2c2d-4505-9c53-1bdb565c678f
hjlee6824/Problem-Solving
Baekjoon/5000~5999/5565/5565.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int total_price; cin >> total_price; int sum = 0; for (int i = 0; i < 9; ++i) { int input; cin >> input; sum += input; } cout << total_price - s...
ALGO
0.993434
3.468427
b472f215-89f5-4252-8742-409a0351da25
Shwet310/LeetCode__Practice
2924-find-champion-ii/2924-find-champion-ii.cpp
class Solution { public: int findChampion(int n, vector<vector<int>>& edges) { bitset<100> losses; for (const auto& edge : edges) { losses.set(edge[1]); } int champion = -1; for (int i = 0; i < n; i++) { if (!losses[i]) { ...
ALGO
0.999926
5.686473
b384884b-8888-4e5c-becd-f3e15c63c5a8
BlenderCN-Org/chakio_dockerfiles
cameras/kinect_v2/packages/perception_pcl/pcl_ros/src/pcl_ros/surface/moving_least_squares.cpp
#include <pluginlib/class_list_macros.h> #include "pcl_ros/surface/moving_least_squares.h" #include <pcl/io/io.h> ////////////////////////////////////////////////////////////////////////////////////////////// void pcl_ros::MovingLeastSquares::onInit () { PCLNodelet::onInit (); //ros::NodeHandle private_nh = getM...
TOOL
0.864505
5.989987
05b12171-0913-49d4-9663-484c0db59f47
Noyan759/face_recognition_python
dlib-19.4/dlib/test/mpc.cpp
#include <string> #include <sstream> #include <dlib/control.h> #include <dlib/optimization.h> #include "tester.h" namespace { using namespace test; using namespace std; using namespace dlib; logger dlog("test.mpc"); template < typename EXP1, typename EXP2, typename T,...
ALGO
0.981048
6.363253
d42fc126-a21f-492b-91e5-3ef9c8b5328f
whileman133/LMB_Toolkit
GEN2_UTILITY/MODEL_REGRESSION/gpml/util/lbfgsb/matlabprogram.cpp
#include "matlabprogram.h" #include "array.h" // Function definitions. // ----------------------------------------------------------------- // Copy the matrix elements to the destination array. It is assumed // that sufficient memory has been allocated for the destination // array. The copying preserves the column-maj...
ALGO
0.997845
7.330986
8ec44097-feab-4da9-8848-859d150863c2
CleanerC/IntroToAlg
HW3/main.cpp
#include <iostream> #include <limits.h> #include "LinkedList.h" int main(int argc, const char * argv[]) { LinkedList<int> *myLL = new LinkedList<int>(INT_MIN, INT_MAX); Node<int> *newNodeLoc; newNodeLoc = myLL->search(myLL->head, 3); myLL->insert(newNodeLoc, 3); newNodeLoc = myLL->search(myLL->head, 1); myLL-...
ALGO
0.986834
3.714604
356b9f48-2474-472e-b7d6-2d53c77518c5
VeloxChem/VeloxChem
src/t2c_overlap/OverlapPrimRecPP.cpp
#include "OverlapPrimRecPP.hpp" namespace ovlrec { // ovlrec namespace auto comp_prim_overlap_pp(CSimdArray<double>& pbuffer, const size_t idx_ovl_pp, const size_t idx_ovl_ss, const size_t idx_ovl_sp, ...
ALGO
0.993991
5.642755
61de5e01-524c-4695-91a4-51fc4119d0d7
BenjaminOyarzun17/competitive-programming
codeforces/longJumps.cpp
#include<bits/stdc++.h> typedef long long ll; using namespace std; void DFS(vector<ll> &solutions, vector<ll> &a, ll i, ll node , ll n){ solutions[i]+= a[node]; node= node+ a[node]; if(node<n){ DFS(solutions, a, i, node, n); } } void solve(){ int t; cin>>t; while(t--){ ll n; cin>>n; vector<ll> a(n); ...
ALGO
0.999807
4.402484
bc5a0421-6cd3-4aab-853f-ca42bd3e52b0
m-varadhan/CPP
boost/boost-library/boost_1_60_0/libs/graph/test/copy.cpp
#include <boost/graph/adjacency_list.hpp> #include <boost/graph/copy.hpp> using namespace boost; class copier { public: template<class V1, class V2> void operator()(const V1&, const V2&) const {} }; int main() { adjacency_list<vecS, vecS, directedS, property<vertex_root_t, int> > g1, g2; adjacency_li...
ALGO
0.881578
4.147507
cb0715b8-0a98-4108-aac5-6b80ce3781a2
ishandutta2007/codeforces
batrr/normal/1666/F.cpp
#include <bits/stdc++.h> #define f first #define s second #define pb push_back #define mp make_pair using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<long long, long long> pll; const int N = 5050, mod = 998244353; int n, cnt[N]; int dp[N], tmp[N]; int C[N][N]; void solve() { ...
ALGO
0.999991
4.959247