uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
4f6539ed-4d28-4753-88ae-e60d73d1dabb
sandialabs/nSIGHTS
objLib/objDFO/DFO_XYSmoothFilter.cpp
#include <genClass/U_Real.h> #include <genClass/SC_DoubleArray.h> #include <objDFO/DFO_XYSmoothFilter.h> DFO_XYSmoothFilter::DFO_XYSmoothFilter() : DFO_XYBase("Smooth/Filter") { smoothFilterOp = sfMedian; ptsInHalfWindow = 2; InitCommon(); } DFO_XYSmoothFilter::DFO_XYSmoothFilter(const DFO_XYSmoothFi...
TOOL
0.953451
6.196166
0f44dae1-c359-4eb1-9b61-256ad3a94695
coding-blocks-archives/AlgoNoidaS19
Lecture-3/N_Queen.cpp
// N_Queen #include <iostream> using namespace std; bool isSafeToPut(int board[][10],int n,int i,int j){ for(int k=0;k<n;k++){ if(board[i][k] || board[k][j]){ return false; } } int r=i; int c=j; while(r>=0 && c<n){ if(board[r][c]){ return false; } r--; c++; } r=i; c=j; while(r>=0 && c>=0){ ...
ALGO
0.999853
5.072589
55d41c1a-957a-4a03-b8d5-cc603413d1c6
taewookim03/codeforces
789b.cpp
#include <iostream> #include <vector> #include <unordered_set> #include <cmath> using namespace std; int main() { int b1, q, l, m; cin >> b1 >> q >> l >> m; unordered_set<int> a{}; int in_a = 0; for (int i = 0; i < m; i++){ int k; cin >> k; a.emplace(k); int c = 0; ...
ALGO
0.999882
3.3131
08322d53-4e01-4f41-a8ea-21141e6c9c87
viviana1982/taller5
ejercicio 11.cpp
#include <stdio.h> #include <stdlib.h> void pedirDatos(); void ordenAscendente(int vect[100], int tam); int vect[100], tam, *pvect, i; int main() { pedirDatos(); ordenAscendente(vect,tam); return 0; } void pedirDatos(){ printf("ingrese el numero de elementos \n"); scanf("%d",&tam); for(int i...
ALGO
0.998919
3.683559
9bed7694-6e86-4207-9fbf-e119201d49ee
oxygen-hunter/Flashboom
data/leetcode_cpp/minimum-number-of-operations-to-move-all-balls-to-each-box.cpp
// Time: O(n) // Space: O(1) class Solution { public: vector<int> minOperations(string boxes) { vector<int> result(size(boxes)); for (int i = 0, accu = 0, cnt = 0; i < size(boxes); ++i) { result[i] += accu; cnt += (boxes[i] == '1') ? 1 : 0; accu += cnt; } ...
ALGO
0.999996
6.100174
55608305-89b6-4a11-a76b-9da645970606
Artemgo7/cpp1901
lesson/lesson8/size.cpp
#include <iostream> using namespace std; int main() { unsigned int x = -2094967293; //32 bits unsigned int y = 4294967295 cout << x << endl; // cout << sizeof(x) << endl; // cout << sizeof(short) << endl; cout << sizeof(int8_t) << endl; cout << sizeof(uint8_t) << endl; cout << sizeof(int...
TOOL
0.864664
3.319289
2e60f3fa-53d8-4be6-b057-58d73c2e7600
lipeiyuuuuuu/PTA-
PTA code/7-3 谁先倒 .cpp
/*#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> #define N 100 int main() { int ajl, bjl, n, a=0, b=0, i,ah,aj,bh,bj; scanf("%d %d", &ajl, &bjl); scanf("%d", &n); int gc[N][4]; // printf("---------%d\n", n); for (i = 0; i < n; i++) { scanf("%d %d %d %d", &gc[i][0], &gc[i][1], &gc[i][2], &g...
ALGO
0.999776
3.501855
c6de2c2e-48d5-45e1-80bb-59f74651a45e
Subhransu888/OOP_finals
callbyreference.cpp
#include<iostream> using namespace std; void call_by_reference(int &x, int &y){ int temp=x; x=y; y=temp; } int main(){ int x=5; int y=6; cout<<"before swapping: x = "<<x<<" | y = "<<y<<endl; call_by_reference(x,y); cout<<"after swapping: x = "<<x<<" | y = "<<y<<endl; }
ALGO
0.99866
5.315614
0f59a66c-d5c9-450a-9f04-13ae368d2ada
grocre/sistemas-distribuidos
Philosophers/main.cpp
#include <iostream> #include <thread> #include <chrono> int myrand(int min, int max) { return rand()%(max-min)+min; } void lock(int& m) { m=1; } void unlock(int& m) { m=0; } void phil(int ph, int& ma, int& mb) { while(true) { int duration=myrand(1000, 2000); std::cout<<ph<<" thinks "<<duration<<"ms\...
ALGO
0.95796
3.552784
745bf49e-261e-431f-b5b1-1c37f8a2348f
Alexadid/Home-Tasks
spring/HW2-17.02.24/task1/main.cpp
#include "include/stopwatch.hpp" // Решил взять что-то помедленнее - бабл-сорт // Смешно, что за счёт его медлительности я некторое время считал, что таймер не работает, // т.к. он показывал 0 для std::sort void bubbleSort(std::vector<int>& vect) { bool swapped = true; int j = 0; while (swapped) { ...
ALGO
0.996899
4.889584
ce68bc49-ccb0-4530-83ba-5bf5412662e3
ishandutta2007/codeforces
amoo_safar/normal/450/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1000000007; int main(){ ll x,y; cin >> x >> y; ll k; cin >> k; k%=6; if(k==0) k =6; x+=MOD; y+=MOD; x%=MOD; y%=MOD; if(k==1){ cout << x%MOD ; return 0; } if(k==2){ ...
ALGO
0.999957
4.120179
0549a594-69cf-42aa-a762-662f19e9bc42
Sandeep-Raj-CSE/GFG_Practice_Question
Difficulty: Medium/Subarrays with sum K/subarrays-with-sum-k.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: int countSubarrays(vector<int> &arr, int k) { // code here int ans = 0; unordered_map<int,int>mp; ...
ALGO
0.99912
6.339311
9d0b6e8c-f7b2-4c3c-adb7-4798b50b49c1
shengyenlin/Deep-learning-computer-vision-2022-Fall
final/O-CNN_1/pytorch/cpp/octree_pad.cpp
#include <octree/octree_nn.h> #include <octree/octree_parser.h> #include "ocnn.h" Tensor octree_pad(Tensor data_in, Tensor octree_in, int depth, float val) { CHECK_GE(depth, 1) << "Depth should be larger than 1"; // in octree OctreeParser octree_; octree_.set_gpu(octree_in.data_ptr<uint8_t>()); // btm dat...
ALGO
0.95901
6.021247
847db806-d953-48a7-b46d-2dffd2a32d0b
ChiuTofu/2023aaib-2
week16/week16-2.cpp
#include <stdio.h> void myPrint(int a[10]){ for(int i=0;i<10;i++) printf("%d ", a[i]); printf("\n"); } int main() { int a[10] = {9,8,7,6,5,4,3,2,1,0}; myPrint(a); for(int i=0;i<10;i++){ for(int j=i+1;j<10;j++){ if(a[i]>a[j]){ int temp = a[i]; a[i...
ALGO
0.999853
3.581619
09a82093-f84e-4dbb-9f6d-eab86af539ce
gemmychen1406/CodePTIT---THCS-2
So_dep_3_xau.cpp
#include <stdio.h> #include <math.h> #include <string.h> int thuannghichnt(char a[]){ int n = strlen(a); for (int i = 0; i <= n/2; i++){ if (a[i] != a[n - i - 1]) return 0; if (a[i] != '2' && a[i] != '3' && a[i] != '5' && a[i] != '7') return 0; } if (n % 2 == 1 && a[n/2] != '2' && a[n/2] != '3' && a[n/2] != '5...
ALGO
0.99971
4.166655
ec2707db-f81f-45f3-b77a-ed90e0705168
geekpradd/USACO-Solutions
transform.cpp
/* ID: pradd1 PROG: transform LANG: C++ */ #include <iostream> #include <fstream> #include <vector> #define vc vector< vector<char> > using namespace std; vc transform(int code, vc vec){ int size = vec.size(); vc initial = vec; switch(code){ case 1: for (int i=0; i<size; ++i){ for (int j=0; j<size; ++j)...
ALGO
0.999978
3.49681
9143237a-c391-497a-8575-3008a38ac3f5
abmishra1234/Leetcode
52_Hard_Leetcode.cpp
using namespace std; #include<iostream> #include<vector> #include<string> #include<map> #include<unordered_map> #include<set> #include<unordered_set> #include<list> #include<stack> #include<queue> #include<algorithm> /* Note in this problem is for you to first solve problem by own and later check the other sol...
ALGO
0.999994
5.993361
c26028f5-6f05-445e-adcc-bd8761d63cf6
KavinPalanichamy/IndoorNavigation
Development_Files/NavDev.cpp
#include <iostream> #include <iomanip> #include <cmath> // Constants for unit conversions and Earth's radius // Structure to represent latitude, longitude, and altitude struct Geodetic_Coordinate { double Latitude; double Longitude; double Altitude; double bearing; Geodetic_Coordinate (double lat...
TOOL
0.994055
6.471139
5afe99f0-a422-4bab-9ff9-342d49fc0df4
ishandutta2007/codeforces
i_love_dasha_karpenko/normal/1121/A.cpp
#include <bits/stdc++.h> using namespace std; #define DIM 107 #define INF 1000000000007 typedef pair<long long,long long> pairll; long long n,m,k,P[DIM],S[DIM],res=0; priority_queue<long long> A[DIM],Q; int main() { //freopen("input.txt","r",stdin); cin>>n>>m>>k; for (int i = 1;i<=n;i++)cin>>P[i]; for...
ALGO
0.999938
3.508226
be6c986a-fb5c-41a5-bcfd-044476958d06
li-chiun-lin/MetaHackerCup
2022_2/perfectly_balanced_chapter_2.cpp
/* */ #include <algorithm> #include <climits> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; // Fenwick Tree (Binary Indexed Tree) implementatio...
ALGO
0.999781
5.496083
2940f5e2-85f6-49d1-a0b4-84ce7a28254a
Congee/leetcode
src/17.letter-combinations-of-a-phone-number.cpp
#ifdef __LOCAL__ #include <leetcode.h> #endif class Solution { public: vector<string> letterCombinations(string digits) { if (digits.empty()) return {}; std::vector<string> pool; for (auto d : digits) { switch (d) { case '2': pool.push_back("abc"); break; case '3': pool.push_back...
ALGO
0.999718
7.042519
251d9b76-225e-4133-87e5-31be349ac6da
tkillman/provider_clean_architecture
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
13e76219-fc1d-426c-8308-a2209f66c84b
Rajukumarsaw/PW-PPT-Assignment
maximum-number-of-vowels-in-a-substring-of-given-length/maximum-number-of-vowels-in-a-substring-of-given-length.cpp
class Solution { public: int maxVowels(string s, int k) { int vol=0; int i=0;int j=0; int maxvol=0; for(j=0;j<k;j++){ if(s[j]=='a' || s[j]=='e' || s[j]=='o' || s[j]=='i' || s[j]=='u' ){ vol++; } } j--; maxvol=vol; ...
ALGO
0.999987
6.128105
e46630ef-c199-4ee9-afa7-9365109f332e
saurabhjn76/Competitive-Coding
Hackerrank/Algorithms/Sorting/quicksort_sorting_2.cpp
#include <bits/stdc++.h> using namespace std; int partion(vector<int> &arr,int lower,int upper) { //int j=lower -1; //int pivot=arr[lower]; int pivot_pos=lower; int i=lower+1; int temp; while(i<=upper) { if(arr[i]<arr[pivot_pos]) { temp=arr[i]; for(int k=i-1;k>=pivot_pos;k--) arr[k+1]=arr[k]; a...
ALGO
0.99997
4.734395
09b1720e-aa51-4872-bd6b-e08bb433d2c3
rubylover4ever/scoala-it
Tema29august.cpp
#include <iostream> #include <vector> //============================Implementarea stivei CU vector======================================= class Stack { std::vector<int> v; public: void push(int e) { v.push_back(e); } int pop() { if (v.empty()) { std::cout << "The stack is empty\n"; return '\0'; }...
ALGO
0.991178
3.300084
70cf8564-d5b0-4476-9b55-5fc44e54d73e
FahidShadmanKarim/LeetCode
LinkedList/remove-nth-node-from-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 { public: ListNode* removeNthFr...
ALGO
0.999954
5.844249
a5bb3f34-49eb-4339-bafd-3458f9bd63e1
rajaditya-m/fantastic-dragon-telegram
libs/Eigen_Lin_Alg/unsupported/doc/examples/MatrixSquareRoot.cpp
#include <unsupported/Eigen/MatrixFunctions> #include <iostream> using namespace Eigen; int main() { const double pi = std::acos(-1.0); MatrixXd A(2,2); A << cos(pi/3), -sin(pi/3), sin(pi/3), cos(pi/3); std::cout << "The matrix A is:\n" << A << "\n\n"; std::cout << "The matrix square root of A is:...
ALGO
0.999423
3.930508
bdfb9b39-7f66-4e9f-8f5a-b24497d80ea4
glo/ee384b
opencv/src/cvaux/cvbgfg_codebook.cpp
#include "_cvaux.h" CvBGCodeBookModel* cvCreateBGCodeBookModel() { CvBGCodeBookModel* model = (CvBGCodeBookModel*)cvAlloc( sizeof(*model) ); memset( model, 0, sizeof(*model) ); model->cbBounds[0] = model->cbBounds[1] = model->cbBounds[2] = 10; model->modMin[0] = 3; model->modMax[0] = 10; model-...
ALGO
0.993839
5.207642
2638c4fd-bac6-4ca5-ab24-a4f726250c51
JustSalty/Lab_IV_Voronoi_Diagram
VParabola.cpp
#include "VParabola.h" #include "VPoint.h" /* Constructors */ VParabola::VParabola() { site = 0; isLeaf = false; cEvent = 0; edge = 0; parent = 0; } VParabola::VParabola(VPoint* s) { site = s; isLeaf = true; cEvent = 0; edge = 0; parent = 0; } /* Tree operations (described in the header file) */ VParab...
ALGO
0.941391
5.384514
054212a3-e575-42f9-a8d0-dacbc3f09506
arazm21/guitarPedal1
finished_code/guitarPedalEEPROMCPP3/Core/Src/EQ_Low_Butter.cpp
/* * EQ_Low_Butter.c * * Created on: Sep 19, 2024 * Author: x1_user */ #include "EQ_Low_Butter.h" void EQ_Low_Butter_Init(LP_Butter *filt, float fs, float fc){ /* Set up filter parameters */ filt->fc = fc; filt->fs = fs; EQ_Low_Butter_Set_Params(filt, filt->fc); /* Clear first samples */ filt->x_1=...
ALGO
0.999356
4.28865
56b9fd18-624c-4bd8-a41a-8d07d1702572
YttriumWillow/OI
Problems/ABC161F.cpp
#include <iostream> #define i64 long long #define endl '\n' #define qwq puts("fzy qwq ~"); using namespace std; i64 n, res; int main() { cin >> n; for (i64 i = 1; i * i <= n - 1; ++i) { i64 p = n - 1; if (!(p % i)) res += (i * i != p) + (i != 1); } for (i64 i = 2; i * i <= n; ++i) { i64 p = n; whi...
ALGO
0.999328
3.967014
2fb0f2c1-9c6b-4589-8187-2e9511093f04
mohamedameen93/Vehicle-Steering-Using-Model-Predictive-Control
src/Eigen-3.3/doc/examples/Tutorial_BlockOperations_print_block.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; int main() { Eigen::MatrixXf m(4,4); m << 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12, 13,14,15,16; cout << "Block in the middle" << endl; cout << m.block<2,2>(1,1) << endl << endl; for (int i = 1; i <= 3; ++i) { cout << "B...
ALGO
0.969002
3.6853
b31fdd86-db72-4440-bbb3-e2b6f05aeda5
fmemon/UpFrog
cutepult/libs/Box2D/Dynamics/Contacts/b2CircleContact.cpp
#include <Box2D/Dynamics/Contacts/b2CircleContact.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2Fixture.h> #include <Box2D/Dynamics/b2WorldCallbacks.h> #include <Box2D/Common/b2BlockAllocator.h> #include <Box2D/Collision/b2TimeOfImpact.h> #include <new> using namespace std; b2Contact* b2CircleConta...
ALGO
0.954987
6.887669
6b9a65a5-9a02-407b-984a-5de67a741967
Subhraneel77/Leetcodes-Solutions
1630-arithmetic-subarrays/1630-arithmetic-subarrays.cpp
class Solution { public: vector<bool> checkArithmeticSubarrays(vector<int>& nums, vector<int>& l, vector<int>& r) { vector<bool> result; for (int i = 0; i < l.size(); i++) { result.push_back(isArithmetic(nums, l[i], r[i])); } return result; } bool isArithmetic(ve...
ALGO
0.999907
6.514746
22052a27-83b5-4aee-b668-869a7af82de6
ishandutta2007/codeforces
yukihana0416/normal/1368/B.cpp
#include <bits/stdc++.h> using namespace std; #define LL long long //#define LL __int64 typedef pair<int, int> pii; typedef pair<LL, LL> pLL; typedef vector<int> VI; typedef vector< vector<int> > VVI; template< typename T > inline void read(T &x) { static char _c; static bool _f; x = 0; _f = 0; _...
ALGO
0.999995
3.397263
69951bd4-b20b-4c95-b59f-ff89360e0dcd
vbonnici/grafe-sim
analysis/data/p03170/s867915454.cpp
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i,n) for (int i = 0;i < (int)(n);i++) using ll = long long; const ll MOD=1000000007; const long long INF = 1LL << 60; const double pi=acos(-1.0); template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return f...
ALGO
0.999984
4.735323
53cd9597-a5f8-49c7-9a00-6ef224cc0df6
yoru4890/coding_test
프로그래머스/1/12931. 자릿수 더하기/자릿수 더하기.cpp
#include <iostream> using namespace std; int solution(int n) { int answer{}; while(n>0){ answer += n%10; n/=10; } return answer; }
ALGO
0.999741
4.698836
6a70ae22-4b77-4407-a854-233e1939a595
SachinBore/codes
Basics/patterns/pattern_7.cpp
#include <bits/stdc++.h> using namespace std; int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif // My Code int n; cin >> n; for (int i = 0; i < n; i++) { // space for (int j = n - i - 1; j > 0; j--) { cout << "-"; } // stars for (int...
ALGO
0.999979
4.179547
df0bb6b6-4c00-435c-b338-b609df2b920e
yuika-sama/code-ptit-solutions
C/c6019.cpp
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<stdbool.h> #define scan(n) scanf("%d",&n) #define print(n) printf("%d " , n) #define linedown printf("\n") main(){ char s[50]; gets(s); char a[20][50]; int n=0; char *token = strtok(s, " "); while (token != NULL){ strcpy(a[...
ALGO
0.999826
3.550027
a0cd8d8b-5332-483e-8a45-283cc56cf9c7
lorq8189/kalman
eigen-3.4.0/doc/examples/DenseBase_template_int_middleCols.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; int main(void) { int const N = 5; MatrixXi A(N,N); A.setRandom(); cout << "A =\n" << A << '\n' << endl; cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl; return 0; }
ALGO
0.971002
3.154174
1a7b28d7-2e73-4e7b-b55c-78050bd6aa14
Adhamelsaady/CAT-Reloaded---2024-Computer-Science-Circle-Task-6
DFS/Restoring the array.cpp
class Solution { public: map<int,vector<int>>adj; vector<int>ans; map<int,bool>vis; void dfs(int u){ vis[u] = 1; for(auto v : adj[u]){ if(!vis[v]) { ans.push_back(v); dfs(v); } } } vector<int> restoreArray(vector<vector<int>>& adjacentPairs) { int n = adjacentPairs.size(); for(int i = ...
ALGO
0.999991
5.602362
b9632410-5715-495d-8aa7-5b632d03fbf6
DomainMiller/c-
学校作业/第十二周作业缪秋语 2220182408/7.3/7.32.cpp
#include "stdio.h" #include"math.h" void ss(int m) { int k,i; k=sqrt(m); for(i=2;i<=k;i++) if(m%i==0)break; if(i>k&&m!=1) printf("%d \n",m); else printf("%d \n",m); } void main() { int a[5],i,k; for(i=0;i<5;i++) { scanf("%d",&a[i]); ss(a[i]); } }
ALGO
0.999931
3.129925
4b9babda-6d6f-4817-8870-c05cd5864619
Clixxzydev/FN-UnrealBuildver4.26
Engine/Plugins/Experimental/ControlRig/Source/ControlRig/Private/Units/Highlevel/Hierarchy/RigUnit_FitChainToCurve.cpp
#include "Units/Highlevel/Hierarchy/RigUnit_FitChainToCurve.h" #include "Units/RigUnitContext.h" FRigUnit_FitChainToCurve_Execute() { DECLARE_SCOPE_HIERARCHICAL_COUNTER_RIGUNIT() FRigBoneHierarchy* Hierarchy = ExecuteContext.GetBones(); if (Hierarchy == nullptr) { return; } float& ChainLength = WorkData.Ch...
ALGO
0.904065
5.98814
2bcdcca9-cd30-4f0a-88db-c01bba4ead36
Muses-lbz/Daily-Practice
2024_04/2024_04_24.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <queue> #include <unordered_set> #include <functional> // 添加此行 using namespace std; // Definition for a binary tree node. struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode() : val(0), left(nullptr), right(nullpt...
ALGO
0.999993
6.83757
77d1a3b6-2819-450b-9bb2-e0dc0ef092ff
azatalg/olympiad
sccAndTopSorting.cpp
#include <bits/stdc++.h> using namespace std; const int SIZE = 1e6+10; vector<int> adj[SIZE]; bool dead[SIZE]; int pre[SIZE], low[SIZE]; int ktoraSpojna[SIZE]; vector<int> spojne[SIZE]; stack<int> st; int timer = 0, ile = 0; int inc[SIZE]; void scc(int v) { dead[v] = 1; st.push(v); pre[v] = timer; ti...
ALGO
0.999978
5.151873
e338dc24-5256-4187-877d-2339176f662f
in-acio/comp-prog
problems/codeforces/easy/contests/bootcamp-errichto/exam3/b/main.cpp
#include <bits/stdc++.h> #define debug(x) cout<<(x)<<"\n" #define ll long long using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int l = 0; cin >> l; vector<int> a(l); for(int i = 0; i < l; i++) cin >> a[i]; sort(a.begin(), a.end()); bool ok =true; for(int i = 0; i < l; i++){ ...
ALGO
0.999983
3.740617
34916749-09d7-4075-bea6-8f115b4b06dd
youtube/cobalt_sandbox
third_party/icu/source/tools/toolutil/denseranges.cpp
#include "unicode/utypes.h" #include "denseranges.h" // Definitions in the anonymous namespace are invisible outside this file. namespace { /** * Collect up to 15 range gaps and sort them by ascending gap size. */ class LargestGaps { public: LargestGaps(int32_t max) : maxLength(max<=kCapacity ? max : kCapacity)...
ALGO
0.997836
7.416394
bddea074-9342-419c-a97f-3b97ddb8034c
winstonsmith1948/cos-democratic-mainstays
src/tests/kits/locale/collatorTest.cpp
#include <Collator.h> #include <Locale.h> #include <LocaleRoster.h> #include <Message.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> const char *kStrings[] = { "a-b-c", "a b c", "A.b.c", "ä,b,c", "abc", "gehen", "géhen", "aus", "äUß", "auss", "WO", "wÖ", "SO", "so", "a...
TEST
0.902517
6.364812
57f98723-ad23-4598-bd4e-711ccb834452
circleolami/circle_cpp-assignments
HW1/1-1/functions.cpp
#include <iostream> #include <string> #include <sstream> #include <fstream> #include <map> #include <vector> #include <algorithm> #include "functions.hpp" using namespace std; void ParseCSV(const std::string &filename, std::map<int, std::string> &header_cols, map<std::string, vector<std::string>> &data_map) { if...
DATA
0.960488
5.737772
d4bdb6c2-0bbd-4172-8efd-226125a114fe
thebesttv/00.ACM
00.Contests/26.GCJ_2020_Qualification/d.cpp
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<climits> #include<cmath> #include<ctime> #include<vector> #include<queue> #include<stack> #include<list> #include<set> #include<map> #include<utility> #include<algorithm> using namespace std; #define FOR(i,a,b) for(register int i=(a);i<(b...
ALGO
0.99982
3.010067
b60bf5ce-350a-4a27-b248-c63f65f2bddf
DeepInMind12345/UEToonShading
Engine/Source/ThirdParty/CryptoPP/5.6.2/include/cmac.cpp
// cmac.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #ifndef CRYPTOPP_IMPORTS #include "cmac.h" NAMESPACE_BEGIN(CryptoPP) static void MulU(byte *k, unsigned int length) { byte carry = 0; for (int i=length-1; i>=1; i-=2) { byte carry2 = k[i] >> 7; k[i] += k[i] + carry; carry =...
ALGO
0.96852
7.689518
bde4a55e-eaeb-4e52-874a-3e0e73db4c36
hedi-ben-maouiia/Junior-Training-Sheets
uva/uniform_generator.cpp
#include <cstring> #include <iomanip> #include <iostream> #include <algorithm> #define range(a,b) for(int i={a}; i < b; ++i) using std::cin, std::cout; void speed() { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); std::cout.tie(NULL); } void solve() { int step,mod,index = 0; while(cin ...
ALGO
0.996367
3.98836
43045101-8427-4ee5-9955-3ad6009a1fb3
NividhSingh/LeetCode
332/332.cpp
class Solution { public: int coinChange(vector<int>& coins, int amount) { map<int, int> m; for (auto c: coins) { m[c] = 1; } for (int i = 1; i <= amount; i++) { if (m.find(i) == m.end()) { calculate_change(m, i, coins); } }...
ALGO
0.999941
6.050207
6ecccdc2-fd98-418a-bbe3-8b583da2e4c0
tsxc-github/knowledge-base
docs/Learning Notes/code/p2040.cpp
#include<iostream> #include<cstdio> #include<iomanip> #include<algorithm> #include<cstring> #include<stack> #include<math.h> #include<cctype> #include<map> #include<queue> #include<vector> #define LL long long #define LD long double #define US unsigned short using namespace std; #define MAX 100 #ifdef ONLINE_JUDGE #def...
ALGO
0.999656
3.771733
2af5f6e4-5d5a-428c-b799-98049dab4f9c
viraajsinghgill/MY-VM-BOX
3sem/ooptheory/7sept21/volume1.cpp
#include<iostream> using namespace std; //#default pi 3.14 class volume { int r,h,s; public: int cube(int a) { return a*a*a; } int cyl(float r,float h) { return 3.14*r*r*h; } int sph(float r) { return (4/3)*3.14*r*r; } }; int main() { volume v1; cout<<"volume of cube:"<<v1.cube(3); cout<<"\nvolume ...
TOOL
0.925254
3.065152
a1a0479c-eaf2-4fef-96b9-b91efbeb2e4d
F-0728/atcoder
EDPC/1/N.cpp
#include <atcoder/all> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <set> using namespace std; using namespace atcoder; // using mint = modint1000000007; using mint = modint998244353; using ll = long long; const ll inf = 1 << 30; const ll INF = 1LL << 60; #define rep(i, n) for (ll i ...
ALGO
0.999785
4.163761
cedef409-a79a-485e-812d-b14cf0c90704
huan-end/p4c
backends/tofino/bf-p4c/midend/simplify_nested_if.cpp
#include "simplify_nested_if.h" #include <cmath> #include <functional> #include <numeric> #include "lib/bitvec.h" namespace P4 { const IR::Node *DoSimplifyNestedIf::preorder(IR::P4Control *control) { if (policy != nullptr && !policy->convert(control)) prune(); // skip this one return control; } std::vecto...
ALGO
0.973566
5.725976
21d57be5-7f1b-48b8-98ea-298575ff66c5
mohamedrefat98/cpp_tasks
4th lab/power/main.cpp
#include <iostream> using namespace std; int power (int base ,int ace); int main() { int x,y; cout << "enter base number : "; cin >> x; cout << "enter ace number : "; cin >> y; cout <<power(x,y); } int power(int base ,int ace){ int result = 0; if (ace != 0){ result = base *pow...
ALGO
0.999367
4.768559
d64a29e4-da09-40ed-b3d3-e441a54c54b9
necatiergin/OPTIONAL
monadic_02.cpp
// transform #include <optional> #include <iostream> int main(void) { std::optional opt = 10; opt = opt.transform([](int x) { return x * 2; }); std::cout << "opt = " << *opt<< '\n'; std::optional<int> empty; empty = empty.transform([](int x) { return x * 2; }); if (!empty) std::cout << "empty\n"; }
TOOL
0.859251
6.557293
c0b2cdfc-b28a-47bb-870c-3d6b63093721
sachi097/leetcode
0404-sum-of-left-leaves/0404-sum-of-left-leaves.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.999963
6.551476
f56aca0d-7406-4918-ae57-c67930aaad3f
ishandutta2007/codeforces
toxel/normal/1172/C1.cpp
#include <bits/stdc++.h> const int N = 110; const int moder = 998244353; int dp[2][N][N]; int a[N], w[N]; int powermod(int a, int exp){ int ret = 1; for ( ; exp > 0; exp >>= 1){ if (exp & 1){ ret = 1ll * ret * a % moder; } a = 1ll * a * a % moder; } return ret; ...
ALGO
0.999993
3.830217
24100145-e968-40f1-b728-9729b7a996e8
Jagansakharkar/DSA_Practice
Array/1-Operation/Insert/InsertIntoArray.cpp
#include <iostream> using namespace std; class Abc { int size; int *arr; public: // Constructor Abc() { cout << "Enter the size of array: "; cin >> size; arr = new int[size + 1]; } // Destructor to free dynamically allocated memory ~Abc() { delete[] arr; } // Method to add eleme...
ALGO
0.982604
5.549827
8823e148-3193-4f19-a7c3-0a373b2a8309
Dolyetyus/Leetcode-Problems
C++/FindMinDiameterAfterMergingTwoTrees.cpp
class Solution { public: int diameter(vector<vector<int>>& edges) { int m = edges.size() + 1, res = 0; vector<vector<int>> al(m); vector<int> degree(m), depth(m), vis(m); queue<int> q; for (const auto &e : edges) { al[e[0]].push_back(e[1]); al...
ALGO
0.999792
5.845513
13f900e3-230b-4af4-8d84-0be78fa8c2d1
c1phani1simha/Solutions_dynamic_A2OJ_below_1300
q47_system_of_equations.cpp
#include<bits/stdc++.h> using namespace std; #define fastIO ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) typedef long long int ll; ll mod=1e9+7; int main(){ fastIO; int n,m; cin>>n>>m;int cn(0); for(int a=0;a<=m&&a*a<=n;++a) { int b=(n-a*a); if(b*b==(m-a)) cn+=1; } cout<<cn<<endl; }
ALGO
0.999943
3.983201
f7fbd203-9be7-4b26-a7c7-b7b25e4eefc3
nickchen111/Leetcode
Graph/3249. Count the Number of Good Nodes.cpp
/* 3249. Count the Number of Good Nodes */ // TC:O(n) SC:O(n) class Solution { vector<vector<int>> next; int res = 0; public: int countGoodNodes(vector<vector<int>>& edges) { int n = edges.size(); next.resize(n+1); for(auto edge : edges){ next[edge[0]].push_back(edge[1])...
ALGO
0.999935
6.131599
81024baf-c06a-41b5-8fcd-090b72dba77d
sheikh-riyadh/c_plus_plus_programming
Module 6.5 and 7.5 (Practice day)/Q_Reverse_Words.cpp
#include <bits/stdc++.h> using namespace std; void reverse(string s, int *count) { for (int i = s.size() - 1; i >= 0; i--) { cout << s[i]; } if (1 <= (*count)) { (*count)--; cout<<" "; } } int main() { string s; getline(cin, s); stringstream ss(s); strin...
ALGO
0.998512
4.231218
1325170c-2328-4c3a-843a-cbeba09464fd
ZivFerdinand/CompetitiveProgramming
C++ Code/Effective_Approach.cpp
#include <iostream> #include <algorithm> #include <cmath> #include <string> #include <cstring> #include <iomanip> #include <map> #define ll long long using namespace std; int arr[100010]; int loc[100010]; int main() { int n, m; ll vasya = 0, petya = 0; cin >> n; for (int i = 0;i < n;i++) { cin >> arr[i]; loc...
ALGO
0.999885
3.666447
29d87f18-4523-4445-83a6-1cffc214878f
Sanskar-Saraf/Codeforces
codeforces/1397/A.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n,k=0; cin>>n; string arr[n]; int a[123]={0}; for(int i=0;i<n;i++) { cin>>arr[i]; } for(int i=0;i<n;i++) for(int j=0;j<arr[i].length();j++) { a[arr[i].at(j)]++; } for(int i=97;i<=122;i++) {...
ALGO
0.999949
4.104934
e45c6a7c-de4b-424c-af54-5bc8c968e71c
moondemon68/cp
Atcoder/ABC173/A.cpp
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back #define mp make_pair #define MOD 1000000007 #define INF 1234567890 #define pii pair<int,int> #define LL long long using namespace std; int main () { //clock_t start = clock(); ios_base::sync_with_stdio(false); cin.tie(NULL); ...
ALGO
0.999715
3.607834
a2ab66bf-f629-48e9-823d-cba29f966cc2
PranshuSwaroop15/MyLeetcode-Solved
0919-complete-binary-tree-inserter/0919-complete-binary-tree-inserter.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.9999
6.876688
caaa267a-577b-4d22-8a9f-962135d7cd43
demirmehmet0/GlobalOptFramework
XZLBZ/reduce.cpp
#include "reduce.h" #include <pthread.h> #include <cstdlib> // #define THREAD_NUM 2 vector<ROW> get_reduced_matrix(vector<xpair> seq, vector<ROW> m) { vector<ROW> tmp_m(m); for(int i = 0; i < seq.size(); i++) tmp_m[seq[i].dst] ^= tmp_m[seq[i].src]; return tmp_m; } vector<ROW> get_identity() { ...
ALGO
0.999974
3.438668
c0877944-7273-4f8b-9fee-d12a1959ff3f
UladzislauB/algo-acmp
157.cpp
#include <fstream> #include <iostream> #include <cstring> using namespace std; unsigned long long fact(unsigned long long N) { if(N<0) return 0; else if(N==0) return 1; else return N*fact(N-1); } int main() { ifstream fin("input.txt"); ofstream fout("output.txt"); char s[16]; fin.getline(s,16); unsigned l...
ALGO
0.999899
3.703364
72d24304-a800-4864-816f-170b52d761f3
TRYang/acm
sgu/sgu_220.cpp
#include <stdio.h> #include <string.h> #include <algorithm> #define maxn 15 using namespace std; int a[maxn],an; int n,m; long long f[maxn][maxn<<1],G[2][maxn<<1]; long long ans; bool cmp(int x,int y){ return x>y; } void work(int x){ int i,j,k; an=0; for (i=0;i<n;i++) if (i%2==x) a[an++]=i+1; for (i=1;i<n;i++...
ALGO
0.999977
3.197326
104a08c5-65a0-445f-ae43-57ca73f36bc3
Romasa102/CompetitiveProgramming
USACO/2024DecBronze/FarmerJohnActuallyFarms.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(ll i = 0; i < (n); ++i) #define repp(i,o,n) for(ll i = o; i < (n); ++i) using P = pair<ll,ll>; int main(){ ll T; cin >> T; rep(i,T){ ll N; cin >> N; pair<P,ll> hat[N];//height,acceleration,condit...
ALGO
0.999849
3.413923
21fb78cc-36f2-4134-85ce-99cbfc64a7fd
manu05X/Leetcode
0658-find-k-closest-elements/0658-find-k-closest-elements.cpp
class Solution { public: vector<int> findClosestElements(vector<int>& arr, int k, int x) { ios_base::sync_with_stdio(false); cin.tie(NULL); // Initialize the binary search bounds int left = 0; int right = arr.size() - k; // Perform binary search to find the ...
ALGO
0.999999
5.791924
60c5e03f-dff3-4713-b20d-a17f4fe5640b
riyaroy-tech/DSA
Linked List 1.0/2. Add Two Numbers/solution.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) {} * }; */ TC -> O(N) SC-> O(1) class Solution { public: ...
ALGO
0.999945
6.198073
6d15b8b3-d011-471f-9df9-debd6d13f5ea
raunakbhutani/CPP_DSA_Coding_Ninjas
Vectors & Pairs/transpose of matrix.cpp
/* Problem statement You are given a matrix ‘MAT’. Print and return the transpose of the matrix. The transpose of a matrix is obtained by changing rows to columns and columns to rows. In other words, transpose of a matrix A[][] is obtained by changing A[i][j] to A[j][i]. For example: Let matrix be : 1 2 3 4 Then tra...
ALGO
0.999926
5.325598
6c5fe18d-131c-4f9d-87ec-160de76624b1
hacch141/Coding-Practice
CODECHEF/JULY222/To-Divide-or-Not-To-Divide.cpp
// To Divide or Not To Divide #include "bits/stdc++.h" using namespace std; int main() { int t; cin >> t; while(t--) { int A, B, N; cin >> A >> B >> N; if(A%B==0) { cout << "-1" << endl; continue; } int a = N; if(a%A!=0) { ...
ALGO
0.999855
3.524263
d784ac45-acb5-4828-8419-86caefd0b94e
Minhaz-Mahmud/problem_solved_following_C2Ladder
even_odd_game.cpp
#include<bits/stdc++.h> #define ll long long int using namespace std; int main(){ ll t; cin>>t; while(t--){ ll n; cin>>n; vector<ll>a; for(ll i=0;i<n;i++){ ll x; cin>>x; a.push_back(x); } sort(a.begin(),a.end(),greater<ll>()); ll alice=0,bob=0; ll j=0; ...
ALGO
0.999975
4.616609
f53cf6d4-2a14-476e-9401-1abba4bd73d5
alexch-m/AlgAndSTL
TestMatrix/testMatrix.cpp
#define USE_AVX //#define USE_AVX512 // VS 2015 doesn't support AVX-512 #include <memory> #include <chrono> #include <iostream> #include <iomanip> #include <cmath> #ifdef USE_AVX #include <intrin.h> #include <immintrin.h> #include <malloc.h> #endif using namespace std::chrono; const int TestSeconds = 2; bool useAV...
TEST
0.893237
5.91308
962020c9-208a-4734-bb30-c94553d2ed4f
workingyifei/CarND-Path-Planning-Projects
src/Eigen-3.3/bench/sparse_transpose.cpp
//g++ -O3 -g0 -DNDEBUG sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out // -DNOGMM -DNOMTL // -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a #ifndef SIZE #define SIZE 10000 #endif #ifndef...
ALGO
0.982701
5.110691
cd566b2c-a52e-4ca0-9c7c-faa23e023b13
sheropen/Practice-of-Programming
Practice/Practice 12/2.0 and 1.cpp
#include <iostream> #include <cstring> using namespace std; int main(){ int n; cin >> n; while(n--){ string s; cin >> s; int len=s.length(),ans=1<<30; for(int i=0;i<len;i++){ int cnt=0; for(int j=0;j<=i;j++){ if(s[j]=='1') ...
ALGO
0.999965
4.019855
ccd8fcb7-5192-4924-a7ac-a4376e4ebd2c
ThanhTrucT/UIT_IT001
Assignment6/bai10.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; for(int i=0;i<n;i++) cin >> a[i]; int m; cin >> m; int b[m]; for(int i=0;i<m;i++) cin >> b[i]; int *c = new int[n+m]; int i =0, j = 0, k = 0; while(i<n&&j<m){ if(a[i]<=b[j]){ c[...
ALGO
0.999988
3.274194
5f81defa-b4c2-4234-9c9a-dcad1b535e91
Sihare/Binary-tree-dsa
2764-maximum-number-of-fish-in-a-grid/maximum-number-of-fish-in-a-grid.cpp
class Solution { public: const int d[5]={0, 1, 0, -1, 0}; int n, m; int dfs(int i, int j, vector<vector<int>>& grid){ int fish=grid[i][j]; grid[i][j]=0 ; for (int a=0; a<4; a++){ int r=i+d[a], c=j+d[a+1]; if (r<0 || r>=n || c<0 || c>=m || grid[r][c]==0) ...
ALGO
0.99998
6.108839
911ceac4-846e-4599-bc58-5c313e9665c1
ishandutta2007/codeforces
yeputons/normal/292/A.cpp
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <cassert> #include <ctime> #include <algorithm> #include <numeric> #include <string> #include <vector> #include <deque> #include <queue> #include <list> #include <map> #include <set> using namespace std; #define eprintf(...) fprintf(std...
ALGO
0.99994
4.23655
b980dc82-94a7-4af7-8264-be3465099608
thenamangoyal/data-structures
Hashing Map/interpretation2/q2.cpp
#include <iostream> #include <fstream> #include <sstream> #include <cmath> #include <string> #include <cstdlib> #include <ctime> #define load_factor 0.5 using namespace std; class hash_entry{ private: char* key; int start_index; int end_index; int hash; public: hash_entry(const char* v_key, int v_start_index, in...
ALGO
0.99755
3.608928
a346789b-013e-436b-a89f-a91f589cf0de
ddimitrov-fmi/up-2022-2023
practicum_inf/group 6/Week07-PointersDynamicMemory/lab/solutions/task06.cpp
#include <iostream> void swap(int* a, int* b); int* createArray(std::size_t size); void readArray(int* array, std::size_t size); void modifyArray(int* array, std::size_t size); const int* minElement(const int* array, std::size_t size); const int* maxElement(const int* array, std::size_t size); void selectionSort...
ALGO
0.999711
4.299065
e93dacab-1494-415b-adad-aa77c2e1d268
zhaohang921/LeetCode
掌握的题目/贪婪法/LeetCode算法——045跳跃游戏.cpp
/* 给定一个非负整数数组,你最初位于数组的第一个位置。 数组中的每个元素代表你在该位置可以跳跃的最大长度。 你的目标是使用最少的跳跃次数到达数组的最后一个位置。 示例: 输入: [2,3,1,1,4] 输出: 2 解释: 跳到最后一个位置的最小跳跃数是 2。 从下标为 0 跳到下标为 1 的位置,跳 1 步,然后跳 3 步到达数组的最后一个位置。 说明: 假设你总是可以到达数组的最后一个位置。 */ /* */ #include<vector> #include<string> using namespace std; class Solution{ public: int jump(vector...
ALGO
0.99999
5.840277
4c29dea7-c38a-492e-b2e5-b3905bcab379
usernameisavailablee/DMPA_individual_assignments
second_individual/modules/cpp_modules/opencv/modules/imgproc/src/cornersubpix.cpp
#include "precomp.hpp" void cv::cornerSubPix( InputArray _image, InputOutputArray _corners, Size win, Size zeroZone, TermCriteria criteria ) { CV_INSTRUMENT_REGION(); const int MAX_ITERS = 100; int win_w = win.width * 2 + 1, win_h = win.height * 2 + 1; int i, j, k; int max_i...
ALGO
0.99994
5.728745
d87c5432-4b69-48fa-b247-246210494b54
Aadish-jain/DSA
Basics/Basic C++/while-dowhile.cpp
#include<bits/stdc++.h> using namespace std; int main(){ /* while loops int num; cin >> num; while(num >= 0){ cout << "Hey Aadish " << num << endl; num -= 1; } cout << "Value of num is: " << num << endl; int i = 1; cout << "Enter value of num: "; cin >> num; while(i <= num){ cout << "Bye...
TOOL
0.993036
3.474161
59262080-982e-4ef3-89da-7be428cc8e10
nitinnsharma234/leet_code
2720-minimize-the-maximum-difference-of-pairs/minimize-the-maximum-difference-of-pairs.cpp
class Solution { public: bool countPair(vector<int>& nums, int t,int p){ int count=0; for(int i=0;i<nums.size()-1;i++){ if(abs(nums[i]-nums[i+1])<=t){ count++; i++; } if(count>=p){ return true; } } return false; } int minimizeMax(ve...
ALGO
0.999981
6.040554
e1e816c8-fc0a-43bb-ae3f-5f8f218f81f9
ningning772669569/algorithm
1/k.cpp
#include "cstdio" #include "iostream" #include "algorithm" #include "cstring" #include "vector" #include "queue" #include "utility" #define MAX 1000 #define INF 10000001 using namespace std; int anc[MAX][11]; int fa[MAX]; int times[MAX]; vector<int> tree[MAX]; int m,n; int dep[MAX]; void RMQ(int n) { memset(anc,0,s...
ALGO
0.998866
3.662955
eca9c70b-60f4-4ea9-a468-7a3404ab2739
vatsalsharma376/Algo-n-ds
ADALIST_ROPE.cpp
/* Queries : 1 k x means that you will add number x to position k 2 k means that you will erase number from position k 3 k means that you will print number from position k */ #include<bits/stdc++.h> #include<ext/rope> using namespace std; using namespace __gnu_cxx; rope<int>r; int main(){ ios_base::sync_with_st...
ALGO
0.999869
4.62334
2ffcd1bd-d717-4393-a9c6-6b6525bef631
SONGS4RI/42
codingtest_study/barrrking/0x0D_dp/boj11726.cpp
/* 2xn 타일링 */ /* 13:02 ~ 13:23 */ #include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, dp[1001]={0,1,2}; cin >> n; for(int i=3;i<=n;i++) dp[i] = (dp[i-2]%10007 + dp[i-1]%10007) % 10007; /* 피보나치 수열을 10007로 나누어준 나머지들을 저장해주면 된다. */ cout << dp[n] << "\n"; }
ALGO
0.999983
4.169216
03b93adb-884c-42ff-a753-ab82ba5ed814
JasonPV/mpi-tasks
integral.cpp
#include <mpi.h> #include <time.h> #include <cstdlib> #include <cmath> #include <iostream> using namespace std; int main(int argc, char* argv[]) { int id, np; double eTime,sTime,Time, gres; long long i, N=10000; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &id); ...
ALGO
0.999748
3.760326
dced7e0e-c845-4476-8a6f-73c56c5f55f8
dbyqs21/My_Code
C++/ShuiWang/ShuiWang/源.cpp
// 2.3.cpp : Defines the entry point for the console application. // #include <iostream> using namespace std; void Find(int ID[], int N); int ID[20] = { 1, 1, 1, 3, 2, 1, 11, 2, 3, 3, 4, 2, 3, 6, 2, 2, 3, 1, 2, 1 };//˵ID //int ID[20]={1,1,1,1,1,1,3,4,5,6,7,8,9,10,11,12,13,14,15}; int main(int argc, char* argv[]) { ...
ALGO
0.99955
4.022532
dbbe2b73-890e-4629-9076-456886841607
digitcrusher/algorytmy
tests/graph/scc.cpp
#include "graph/scc.hpp" #include "iostream.hpp" int main() { while(cin) { int n, m; cin >> n >> m; vector<vector<int>> adj(n), rev_adj(n); for(auto i: v::iota(0, m)) { int a, b; cin >> a >> b; a--, b--; adj[a].push_back(b); rev_adj[b].push_back(a); } auto resul...
ALGO
0.999948
4.966763
68821361-8967-462d-aa14-fc8459a36691
elrudrakssh/Dynamic-Programming
code-force-vault/1251B-BinaryPalindromes.cpp
#include <iostream> int main(){ long q; std::cin >> q; while(q--){ long n; std::cin >> n; int z(0), f(0); for(long p = 0; p < n; p++){ std::string s; std::cin >> s; f |= (s.size() % 2); for(long u = 0; u < s.size(); u++){z += (s[u] == '0');} ...
ALGO
0.999252
3.92482
63871c5c-fb10-46d0-b61e-5eab87a23ef9
monisha-82/CSES
Introductory Problems/2_MissingNumber.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int missingNumber(int n, vector<int> &a) { int ans = -1; sort(a.begin(), a.end()); if (a[0] != 1) { ans = 1; } else { for (int i = 0; i < n - 2; i++) { if (a[i + 1] - a[i] != ...
ALGO
0.999675
3.784061
5ccc5e43-07f8-4974-b248-7c7ed598ee2e
Vaishnavi2701-mk/Data_Structure_CPP_Coding_Ninjas
Trees/Contains-x.cpp
/* Contains x Given a generic tree and an integer x, check if x is present in the given tree or not. Return true if x is present, return false otherwise. Input format : The first line of input contains data of the nodes of the tree in level order form. The order is: data for root node, number of children to root node,...
ALGO
0.999911
5.803802