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
fd13e04e-312c-4081-a8aa-9c58fd786d4f
markap/DataMining
cpp/kmeans_pairs.cpp
#include <utility> #include <iostream> #include <vector> #include <random> #include <map> #include <cmath> using std::cout; using std::endl; using std::vector; using std::pair; using std::make_pair; using std::map; using std::pow; using std::sqrt; void make_random_points(vector<pair<double, double> > *points, int num...
ALGO
0.999619
5.258311
3c1359d8-6e82-4618-8984-41795cf985e1
baton/adventofcode-2021
04/1.cpp
#include <iostream> #include <fstream> #include <iterator> #include <string> #include <vector> #include <array> #include <algorithm> #include <numeric> #include <boost/spirit/include/qi.hpp> namespace qi = boost::spirit::qi; size_t constexpr game_size{ 5 }; using value_t = std::pair< uint64_t, bool >; using line_t ...
ALGO
0.999273
4.188943
4b97b82b-5168-4c43-b5e5-1bccdcb0476f
MPTCP-FreeBSD/FB13.1-ML-MPTCP-SRC
contrib/llvm-project/compiler-rt/lib/scudo/standalone/linux.cpp
#include "platform.h" #if SCUDO_LINUX #include "common.h" #include "linux.h" #include "mutex.h" #include "string_utils.h" #include <errno.h> #include <fcntl.h> #include <linux/futex.h> #include <sched.h> #include <stdlib.h> #include <string.h> #include <sys/mman.h> #include <sys/stat.h> #include <sys/syscall.h> #inc...
TOOL
0.864024
7.558115
4e1e6cfd-07f4-4eb6-997b-ac6d90095816
barrinjo/maze
printMaze.cpp
#include <iostream> #include <fstream> #include <vector> #include <unistd.h> #include <termios.h> #include <sstream> #include <ctime> using namespace std; string line; string input; //int y = 0; vector<string> mazeInit; vector<string> lines; int coordX, coordY; void printMaze(); void printMazeSlow(); void printMazeFa...
ALGO
0.99333
3.616085
b46985a9-6a36-471a-818e-a218e3e413dd
cimkoreauniv/bojstudy
24_04/16236.cpp
#include <stdio.h> #include <memory.h> #include <queue> int curx, cury; int size, left; int board[30][30]; int ans; struct node { int dist; int x, y; }; bool solve() { std::queue<node> q; bool vis[30][30]; int dst_x = 29, dst_y = 29; memset(vis, 0, sizeof(vis)); q.push({0, curx, cury}); ...
ALGO
0.999918
3.189911
830823ed-6108-4222-a8a1-4384d2fbdae2
Avhad-Shashwat/Standard-Problems
Sorting/UnionOfArray(Efficient).cpp
#include<bits/stdc++.h> using namespace std; int Union(int a[],int b[],int m,int n) { int i=0,j=0; while(i<m && j<n) { if(i>0 && a[i]==a[i-1]){ i++; continue; } if(j>0 && b[j]==b[j-1]){ j++; continue; } if(a[i]<b[j]) { cout<<a[i]<<" "; i++; } else if(a[i]>b[j]){ cout<<b[j]<<" ";...
ALGO
0.999957
3.414511
1da2aa06-cddd-4853-8765-68adfcd74d54
offensive-vk/Classics
C++/strings.cpp
#include <iostream> #include <string> #include <conio.h> int main() { std::string greeting = "Hello, "; std::string name = "Alice"; std::string message; // Concatenation message = greeting + name; std::cout << "Concatenated message: " << message << std::endl; // String length std::co...
TOOL
0.884496
3.702648
efc68daf-4327-4517-b7ea-6b6983a59cd4
Yongfanchen/DailyProblem
202306/20230626/2-653两数之和IV-输入二叉搜索树/main.cpp
#include <algorithm> #include <cctype> #include <iostream> #include <stack> #include <string> #include <unordered_map> #include <vector> #include <unordered_set> using namespace std; // Definition for a binary tree node. struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), l...
ALGO
0.999995
6.395894
a0a5ae5c-9d8c-4825-ad6d-332a8562faf9
omgnishantyadav/codeforces
D_Retaliation.cpp
#include <bits/stdc++.h> using namespace std; void solve(){ int n; cin>>n; vector<int> v(n); for(int i=0; i<n; i++) cin>>v[i]; string ans="YES"; int d=(v[1]-v[0]); for(int i=1; i<n; i++){ if(abs(v[i]-v[i-1])!=abs(d)){ ans="NO"; break; } } if(ans="...
ALGO
0.999698
4.064035
0b2f62ce-a9cd-495b-9988-efa32f781cd1
Keyu-He/Enhancing-Debugging-Skills-of-LLMs-with-Prompt-Engineering
solutions_correct/algorithms/F/Fair Distribution of Cookies/Fair Distribution of Cookies.cpp
// Runtime: 2993 ms (Top 5.08%) | Memory: 7 MB (Top 43.65%) class Solution { public: int maxi=INT_MAX; void explore(vector<int>&cookies,int n,int k,vector<int>&vec) { if(n==cookies.size()) { int m=0; for(int i=0;i<k;i++) { m=max(m,vec[i]); }...
ALGO
0.999946
5.179165
ebb4e52c-c832-482e-b083-93ab6f272b58
camilonull/ProyectoClase
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.99874
6.767714
10bf7176-0caa-40cc-913d-3dce42a15bb2
ZJU-DAILY/PSAMS
pivot_selection_algorithms/codes/SC/vantage.cpp
#include <string> #include <cstring> #include <cmath> #include <ctime> #include <fstream> #include "../dis.h" #include <sys/time.h> #include <iostream> using namespace std; struct timeval start, end1; int stack[NUUM],top=0; int od[NUUM],ot=0; int nd[NUUM],nt=0; double ssg[NUUM]; double sig[NUUM]; double svg[NUUM]; do...
ALGO
0.999753
3.029038
5536d466-b964-49d1-9901-76dadc90e9a2
miguelarauj1o/URI
src/UOJ_1583 - (1808461) Accepted.cpp
#include <cstdio> #include <cstring> #include <iostream> using namespace std; #define sc1(a) scanf("%d", &a) #define sc2(a,b) scanf("%d %d", &a, &b) #define for(i,a,n) for(int (i) = (a); (i) < (n); (i)++) int n, m, sz; struct toV { int i, j; }; const int dir[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; char map[64][...
ALGO
0.997707
3.243207
63b458cc-dd72-4e4f-9cff-a3acad3d1ff6
Rajveer-CSE-27/Coding-Journey-CPP
Graph/William Fiset Graph Theory/30_prims_lazy_version.cpp
// || जय जय जय बजरंग बली || #include<bits/stdc++.h> using namespace std; #define ll long long /** https://www.youtube.com/watch?v=jsmMtJpPnhU&list=PLDV1Zeh2NRsDGO4--qE8yH72HFL1Km93P&index=30 https://www.geeksforgeeks.org/problems/minimum-spanning-tree/1 Lazy version of Prim's algorithm for MST -> MST :: Given an u...
ALGO
0.999981
4.607832
27e254b0-cdd6-4d57-9d54-ae678d788409
Abunyawa/contests
hello2023/b.cpp
// chrono::system_clock::now().time_since_epoch().count() #include <bits/stdc++.h> #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define debug(...
ALGO
0.999954
4.634307
9fa971dd-694d-490a-9ca3-a4c80cd1ff16
satyaswarup129/Data-Structure-And-Algorithms
Day-2/Merge Intervals.cpp
class Solution { public: vector<vector<int>> merge(vector<vector<int>>& intervals) { int n=intervals.size(); sort(intervals.begin(),intervals.end()); vector<vector<int>> output; for(auto i :intervals){ if(output.empty() || output.back()[1]<i[0]){ output.pu...
ALGO
0.999999
6.139919
96781b23-9c50-4af0-a92c-684c1a0e6ebc
ishandutta2007/codeforces
cerberus97/normal/1158/B.cpp
/* cerberus97 - Hanit Banga */ #include <iostream> #include <iomanip> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <cstdlib> #include <map> #include <set> #include <queue> #include <stack> #include <vector> #include <algorithm> using namespace std; #define pb push_back #define fa...
ALGO
0.999984
3.554767
04d0b375-fae3-4d1f-a935-7c0468c3bec5
AmberzzZZ/walkingEngine
Src/Modules/Modeling/BallLocator/BallLocator.cpp
/** * @file BallLocator.cpp * Implementation of the BallLocator module. * @author Colin Graf */ #include <algorithm> #include "BallLocator.h" #include "Tools/Debugging/DebugDrawings.h" #include "Tools/Math/Transformation.h" #include "Tools/Modeling/BallPhysics.h" #include <iostream> MAKE_MODULE(BallLocator, modeling)...
ALGO
0.996708
5.379551
68763349-1b0a-4fbe-9103-fe121acc54e7
oudream/struct-c
zh/哈希表/分离链接法/HashTable.cpp
#include "stdafx.h" /* ϣʼͷ */ HashTable InitializeTable(int TableSize) { HashTable H; int i; //˴ӦΪжϹϣȴСΪ //Ȳȡķʽ֮ //if (TableSize < MinTableSize) //{ // printf("Table size too smal.\n"); // return NULL; //} //ϣṹռ H = (HashTable)malloc(sizeof(struct HashTb)); if (NULL == H) { printf("Out of space.\n"); ...
ALGO
0.99893
4.262625
c2f1ba28-7db3-4d85-b136-63ff84cf84ce
ANJALI-80/all-c-work
ch8-2/8.2-22.cpp
#include<stdio.h> main() { int i,k,j,s; for(i=5;i>=1;i--){ for(s=1;s<=5-i;s++){ printf(" "); } for(j=1;j<=i;j++){ if(j%2==1){ printf("-"); } else{ printf("|"); } } printf("\n"); } }
ALGO
0.999539
3.646546
e146b057-8563-4fdb-bac8-6a660d804331
pwilkins05/CS246-Assignment-W15
Number Guess.cpp
// Number Guess Game // created by James Rogers // 01/30/2015 //I fixed all the code. Program works as intended. #include <iostream> #include <cmath> #include <cstdlib> #include <ctime> using namespace std; int main() { srand (time(NULL)); //////////////////////Fixed int randomNum = (rand() % 20) + 1; /...
ALGO
0.911323
3.929402
4e620b52-508a-46eb-9e88-a6d1803d83d5
takfarinassaber/VRPH
VRPH_For_CCVRP/dev/VRPH-1.0.8/src/ClarkeWright.cpp
#include "VRPH.h" ClarkeWright::ClarkeWright(int n) { /// /// Sets up the data structure for the Clarke Wright savings algorithm /// including a matrix of size n(n-1)/2 for the savings values /// s=new VRPSavingsElement[n*(n-1)/2]; has_savings_matrix = false; // Set this to true once we ha...
ALGO
0.999846
4.37243
aeb78db4-3469-466c-8187-6f2b237ed248
judyboon/BASS
code/BASS.cpp
#include"BASS.h" #include"funWrapper.h" #include"gig_par.h" #include <gsl/gsl_statistics.h> #include <gsl/gsl_linalg.h> #include <gsl/gsl_blas.h> #include <gsl/gsl_randist.h> #include <fstream> #include <sstream> #include <time.h> // used for setting seed #include <sys/stat.h> #include <sys/types.h> #include <unistd....
ALGO
0.998311
3.294969
121d1f3e-b607-486a-9f60-d95c98cf393a
DiegoCV/programacion_competitiva
book/book5.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; if(n == 1){ cout << 1; }else if(n <= 3){ cout << "NO SOLUTION"; }else{ for(int i = 2; i <= n; i = i + 2){ cout << i << " "; } for(int i = 1; i <= n; i = i + 2){ cout << i << " "; ...
ALGO
0.999988
3.875636
ae536f5b-4a40-4606-a03f-3829833c2ca1
Shrey9015/Go-Game
BoardValue.cpp
#include <cassert> #include "BoardValue.h" bool isBoardValueValid(char value_in) { switch (value_in) { case BOARD_VALUE_EMPTY: case BOARD_VALUE_BLACK: case BOARD_VALUE_WHITE: case BOARD_VALUE_MARKED: return true; default: return false; } } bool isBoardValuePlayer(char value_in) { switch (value_in) { c...
TOOL
0.922601
5.95348
7ecb01e6-243c-4bb3-b334-7ff61f891774
jing-ge/Jing-leetcode
118.cpp
// Given a non-negative integer numRows, generate the first numRows of Pascal's triangle. // In Pascal's triangle, each number is the sum of the two numbers directly above it. // Example: // Input: 5 // Output: // [ // [1], // [1,1], // [1,2,1], // [1,3,3,1], // [1,4,6,4,1] // ] #include <iostream> #...
ALGO
0.999918
6.959781
ec6100bf-2220-4914-b82c-609c5cb8fd74
nbinayak02/Data-Structures-And-Algorithms
Bubble Sort in C.cpp
#include<stdio.h> void bubbleSort(int b[], int n) { int i, j, temp; for(i=0; i<n-1; i++) { for(j=0; j<n-1-i; j++) { if(b[j]>b[j+1]) { temp=b[j]; b[j]=b[j+1]; b[j+1]=temp; } } } printf("\nAfter Sorting the Array using Bubble Sort: \n"); for(i=0; i<n; i++) { printf(" %d ", b[i])...
ALGO
0.999941
4.611261
5c3f5554-6b84-49a4-aa75-9a5933848868
AlvinJ15/CompetitiveProgramming
ACM-contest/DP-numeros/DRACULA.cpp
#include <bits/stdc++.h> using namespace std; int N=19; int cont; int numero[19]; long long memo[164][164][20]; long long recur(int sum,int index,bool flag){ if(index==N) return sum==cont?1:0; if(memo[cont][sum][index]>=0&&!flag){ return memo[cont][sum][index];} if(sum>cont) return 0; long long ...
ALGO
0.999425
3.756347
486de6e3-93e9-4d09-a0fd-2e95e06c34c5
ashutosh2706/leetcode-solutions
Arrays/2366-minimum-replacements-to-sort-the-array.cpp
class Solution { public: long long minimumReplacement(vector<int>& nums) { long long op = 0; for(int i=nums.size()-2; i>=0; --i) { if(nums[i] <= nums[i+1]) continue; int parts = nums[i]/nums[i+1]; if(nums[i] % nums[i+1]) ++parts; op+=(parts-1); ...
ALGO
0.999862
5.487805
ddf3a4e9-31ea-42f8-bc88-d8501c8e4447
bhuppidhamii/myLeetCode
1360-maximum-length-of-a-concatenated-string-with-unique-characters/maximum-length-of-a-concatenated-string-with-unique-characters.cpp
class Solution { public: unordered_map<string,int>m; bool hasDuplicate(string s1, string s2) { int arr[26] = {0}; for (auto s : s1) { arr[s - 'a']++; if (arr[s - 'a'] > 1) { return true; } } for (auto s : s2) { arr[s...
ALGO
0.99996
5.54928
1926ba54-59de-4a01-aba6-7f05ce60f8f1
403ABHIJEET/Data-Structure-Algorithm
Functions/binaryToDecimal.cpp
#include<iostream> using namespace std; int binaryToDecimal(string s) { int ans = 0; int power = 1; for(int i=s.size()-1; i>=0; i--) { if(s[i]=='1') { ans += power; } power *= 2; } return ans; } int main() { string s; cin>>s; int ans = binaryToDecimal(s)...
ALGO
0.999841
4.790441
f5eb2380-dc35-415f-9443-7a0d9cf35528
quocanh1897/FundamentalC-Lab
lab7/33.cpp
#include <iostream> #include <random> #include <iomanip> using namespace std; int main() { int N; cout << "Nhap chieu dai vector: "; cin >> N; int **matrix = new int *[N]; for (int i = 0; i < N; i++) matrix[i] = new int [N]; random_device rd; mt19937 rng(rd()); uniform_int_distribution<int> dis(-40, 50); for (...
ALGO
0.959591
3.065097
68883384-bcb8-4e28-a1e6-4df3c3ee9943
J9214/Baekjoon
c++/카드_1.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 ll; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<vector<int>> vvi; typedef vector<vector<ll>> vvll; typede...
ALGO
0.999956
3.962397
d943ec78-a417-4cac-9241-c52bbce7a9ae
flknwr/boost
libs/sort/example/keyplusdatasample.cpp
// See http://www.boost.org/libs/sort for library home page. #include <boost/sort/spreadsort/spreadsort.hpp> #include <time.h> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <vector> #include <string> #include <fstream> #include <sstream> #include <iostream> using namespace boost::sort::spreadso...
ALGO
0.998613
4.633251
5e665698-264e-49f5-bcb9-01d94efe5bbc
sevenalarm/Codeforces
A_Tir1403/1163.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define rpt(a) for (int i=0; i<(a); i++) #define range(a, b) for (int j=(a); j<(b); j++) #define ft first #define sd second #define pb push_back #define fori(a, b) for (int i=(a); i<(b); i++) #define lb lower_bound set<int> st; multiset<int> sz; const...
ALGO
0.99999
3.507684
e6e816c0-be7d-41dc-a77c-ed45f98c43e9
HongYouBin/Programmers
42890.cpp
// 42890 // 후보키 #include <string> #include <vector> #include <algorithm> #include <queue> #include <map> using namespace std; vector<int> candid; int ans; void check(int bit) { for (int i = 0; i < candid.size(); ++i) { if ((bit & candid[i]) == candid[i]) return; } candid.emplace_back(bit); a...
ALGO
0.999726
5.109034
ddd76777-bc38-487f-a7a9-d768fc14cb39
gaberoo/exploder
cpp/expoTreeSIR.cpp
#include "expoTreeSIR.h" bool checkParams(int parVecLen, double* K, double* beta, double* mu, double* psi, double rho, int nroot) { for (int i = 0; i < parVecLen; ++i) { if (K[i] <= 0.0 || beta[i] <= 0.0 || mu[i] < 0.0 || psi[i] < 0.0) { return false; } } double maxK = 0.0; for...
ALGO
0.997744
4.926997
cbd3938c-755f-48d4-9f6a-3d8fa9230f5f
raypretam/Project_Euler
problem15.cpp
#include<iostream> using namespace std; typedef long long int int64; int main(){ int m,n; cin>>m>>n; int64 arr[m+1][n+1]; for(int i=0;i<=m;i++) arr[i][0]=1; for(int j=0;j<=n;j++) arr[0][j]=1; for(int i=1;i<=m;i++){ for(int j=1;j<=n;j++){ arr[i][j]=arr[i-1][j]+...
ALGO
0.999801
3.853833
58412cb2-c2aa-4dbd-b758-304bce55716b
rafaturRakin/ProblemSolving
CodeChef/ReverseTheNumber.cpp
#include<bits/stdc++.h> using namespace std; /* Author: Rakin Date: 31-03-2022 Language: C++ OJ: CodeChef Problem: [Reverse The Number] */ int main() { int test, number, reverseNumber; cin >> test; while(test--) { cin >> number; reverseNumber = 0; while(n...
ALGO
0.999939
5.867339
477030e1-4186-4c2c-8c8d-ab000ba82045
dinarayus/KFU
27sentex2cpp.cpp
#include<iostream> using namespace std; int DigitsBack(int num) { int i = 1; int n = 1; int k = num; int j = 0; int counter = 0; while (k != 0) { k = k / 10; j++; } while (i < j) { n = n * 10; i++; } while (num != 0) { counter = counter + (num % 10) * n; n = n / 10; num = num / 10; } return co...
ALGO
0.999847
3.810264
cb9922ad-1463-4899-b362-f66da8c3a045
suryakaushik46/CompetativeProgramming
.ccls-cache/@home@runner@A-Soft-Drinking/Implementation ans Constructive: (10*5=50)@Diverse Substring.cpp
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; cin>>n; string s; cin>>s; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ int arr[26]={0}; string ans=""; for(int k=i;k<j;k++){ arr[s[k]-'a']++; ...
ALGO
0.999999
3.551753
6a4d0496-9b8f-4e11-b024-41e961c48e81
riyo264/lit
0111-minimum-depth-of-binary-tree/0111-minimum-depth-of-binary-tree.cpp
class Solution { public: int minDepth(TreeNode* root) { if (root == nullptr) return 0; queue<TreeNode*> q; q.push(root); int depth = 1; while (!q.empty()) { int sz = q.size(); for (int i = 0; i < sz; ++i) { TreeNode* cur = q.front(); ...
ALGO
0.999969
6.762544
6053eb12-7220-4904-b469-4d042860f7f3
LAGxHATER/CSCI-1010
Lab/week7_1.cpp
// Noah Warren // CSCI 1010 002 // Lab 7, Problem 1 // Determine if 3 angles can form a triangle #include<iostream> using namespace std; int main(){ // Declare variables double angle1; double angle2; double angle3; double sum; // Ask user for three angle values cout << "Enter the v...
ALGO
0.99869
4.844291
4efeb450-2465-4511-a2ef-a6d5b08e2651
bkrish17/C-_Practice_Problems
cpp7.cpp
#include <iostream> using namespace std; int main() { int A[]={1,1,2,2,3,4,4,5}; int n=sizeof(A)/sizeof(A[0]); if(n==0 || n==1) { cout<<"length of distinct sorted part "<<n<<endl; return 0; } int j=0; for(int i=0;i<n-1;i++) { if(A[i]!=A[i+1]) { ...
ALGO
0.999822
3.82431
e3360bf2-6e1d-48b1-9e7f-909c4a2ad254
bhoomikaseth001/PSIT
SEMESTER 2/LECTURE11/hollowrectangle.cpp
//WAP in CPP to print hollow rectangle #include<iostream> using namespace std; int main(){ int l,b,i,j; cout<<"Enter the number of length of a rectangle"; cin>>l; cout<<"Enter the number of breadth of a rectangle"; cin>>b; for(i=1;i<=b;i++){ for(j=1;j<=l;j++){ if(i==1||j==1|...
ALGO
0.913878
3.015616
0fded0b3-1e82-4383-83d3-7b1683652df6
rsk0315/library
test/yc_306.test.cpp
#define PROBLEM "https://yukicoder.me/problems/no/306" #define ERROR 1e-6 #include <cstdio> #include <cmath> #include "algorithm/ternary_search.cpp" int main() { long double xa, ya, xb, yb; scanf("%Lf %Lf %Lf %Lf", &xa, &ya, &xb, &yb); auto f = [&](auto y) { return std::hypot(xa, y-ya) + std::hypot(xb, yb-y);...
ALGO
0.999646
4.068082
27a3b381-c9fd-4a25-9ffd-c3445757d033
matteolangella/RL-23-24-HW4
src/aruco_ros/aruco/src/aruco/markerdetector_impl.cpp
#include "markerdetector_impl.h" #include "cameraparameters.h" #include "markerlabeler.h" #include "timers.h" #include <opencv2/core/core.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/features2d/features2d.hpp> #include <opencv2/calib3d/calib3d.hpp> #include <fstream> #include <iostream> #include <vala...
TOOL
0.983901
6.574464
495b6691-894c-4a49-8b81-f05fff5c865c
Matvey-1212/Supercomputer-HSE
OpenMP/problem3/task_1/cp-1/3.2-quadratic.cpp
#include <iostream> #include <memory> #include <cstdint> #include <iomanip> #include <random> #include "array_types.hpp" #include <omp.h> using ptrdiff_t = std::ptrdiff_t; using size_t = std::size_t; template <class T> void fill_random(vec<T> x, T xmin, T xmax, size_t seed) { std::mt19937_64 rng(seed); std::...
ALGO
0.998931
4.376423
2a006494-e655-4502-8660-edb14c9b3a2a
geekboxzone/lollipop_frameworks_av
media/libstagefright/codecs/amrnb/enc/src/qgain475.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/qgain475.c Funtions: MR475_quant_store_results MR475_update_unq_pred MR475_gain_quant ------------------------------------------------------------------------------ MODULE DESCRIP...
ALGO
0.979641
5.330545
55e15a2e-1b4b-441e-b877-2eafe3cdef52
ArrowOS/android_hardware_qcom_sdm845_gps
msm8998/utils/LocHeap.cpp
#include <LocHeap.h> class LocHeapNode { friend class LocHeap; // size of of the subtree, excluding self, 1 if no subtree int mSize; LocHeapNode* mLeft; LocHeapNode* mRight; LocRankable* mData; public: inline LocHeapNode(LocRankable& data) : mSize(1), mLeft(NULL), mRight(NULL), mDa...
ALGO
0.998052
6.413697
87c5aada-d5e2-4658-95aa-dae24d1d309e
savitansh/Contest-Programs
interview_qtn26.cpp
#include <iostream> #include <algorithm> using namespace std; int main(){ int x1=0,y1=0; int x2=x1,y2=y1; string str1; cin>>str1; for(int i=0; str1[i] != '\0'; i++){ if(str1[i]=='N') y2++; else if(str1[i]=='S') y2--; else if(str1[i]=='E') x2++; else if(str1[i]=='W') x2--; } int path[1000]; ...
ALGO
0.999995
3.357542
1061b3ea-951d-4c03-8215-f764129cd5a5
wvu-navLab/gnss-ins-zupt
GNSS_INS_ZUPT/3rdparty/RobustGNSS/gtsam/gtsam/3rdparty/GeographicLib/examples/example-Geodesic.cpp
// Example of using the GeographicLib::Geodesic class #include <iostream> #include <exception> #include <GeographicLib/Geodesic.hpp> #include <GeographicLib/Constants.hpp> using namespace std; using namespace GeographicLib; int main() { try { Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f()); // Al...
ALGO
0.85048
6.144534
bc69543c-164e-4a34-ab81-6a0a2361526b
jubaerkhan49/hackerrank
Practices/Designer_PDF_Viewer.cpp
#include <bits/stdc++.h> using namespace std; int main() { int max = 0, ct[130] = {0}; string s; for (int i = 97; i <= 122; ++i) { cin >> ct[i]; } getchar(); getline(cin, s); int l = s.size(); for (int i = 0; i < l; ++i) { if (max < ct[(int)s[i]]) { max = ct[(int)s[i]]; } } cout << l * ma...
ALGO
0.999659
3.667883
31b7745c-3180-43ba-8b41-14e02cb34cb8
Giatroo/Competitive-Programming
Codeforces/1331B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double lld; typedef pair<ll, ll> pll; typedef vector<ll> vl; #define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) #define fr(i, n) for (ll i = 0; i < n; i++) #define frr(...
ALGO
0.999138
4.128339
3e1449c0-4fcc-4373-8246-2fc4fea1eca6
chengshunzhang/my_leetcode
1-100/94_Binary_Tree_Inorder_Traversal/94_Binary_Tree_Inorder_Traversal.cpp
#include <vector> #include <iostream> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; class Solution { private: void inTraverse(TreeNode* root, vector<int>& result) { if(root == NULL) { ret...
ALGO
0.999992
5.930811
6a962a8a-666d-41a8-a449-d35f9b22dc83
Sandip-Kanzariya/Codeforces
Daily Dose/12_A_Boy_or_Girl.cpp
#include <iostream> #include <string> #include <unordered_set> using namespace std; // S@ndip // https://codeforces.com/problemset/problem/236/A int main() { string name; cin >> name; // store distince elements only unordered_set<char> s; for (int i = 0; i < name.size(); i++) { s.inse...
ALGO
0.999556
4.247474
c6c249b4-70fc-4f10-a903-d3e753578e5f
GrandOrgue/LoopAuditioneer
src/AutoLooping.cpp
#include "AutoLooping.h" #include <cmath> AutoLooping::AutoLooping( double threshold, double minLoopDuration, double distanceBetweenLoops, double quality, unsigned maxCandidates, unsigned loopsToReturn, unsigned maxLoopsMultiple) { m_derivativeThreshold = threshold; m_minLoopDuration = ...
ALGO
0.995472
5.369347
2df081ff-96a4-4672-9988-e196eb076d43
leahglang/Weather-app
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998799
6.776823
ad55bc0c-2539-41d2-aa43-ccb1e7a90fda
origamimantis/SJTU_2019
shared/opencv3/modules/core/src/convert.fp16.cpp
#include "precomp.hpp" #include "convert.hpp" namespace cv { namespace opt_FP16 { #if !defined(CV_NEON) || !CV_NEON const static int cVectorWidth = 8; void cvtScaleHalf_SIMD32f16f( const float* src, size_t sstep, short* dst, size_t dstep, cv::Size size ) { CV_INSTRUMENT_REGION() sstep /= sizeof(src[0]); ...
TOOL
0.962677
6.759126
0a3bc9cd-140f-4f9e-9976-cbc2a42487a5
bogdancoste/CalcByte
components/services/IEEE_754_Representation/utils/utils.cpp
#include <iostream> #include <fstream> #include <string> #include <algorithm> #include <bitset> #include <stdexcept> #include <cmath> #include "../components//SubUnitaryMantissa.h" #include "../components//SupraUnitaryMantissa.h" #include "utils.h" // Converts a decimal integer to an 8-bit binary string std::string ut...
TOOL
0.987131
6.148035
5e0c151b-4db6-4f23-a245-b99de3344f02
li924579/ACM
2015暑假集训/DAY-6/E.cpp
const double eps=1e-9; const double pi=acos(-1); typedef long long ll; using namespace std; string card[53]; typedef stack<string> P; vector<P> pile[53]; int main(){ #ifdef LOCAL freopen("C:\\Users\\john\\Desktop\\in.txt","r",stdin); // freopen("C:\\Users\\john\\Desktop\\out.txt","w",stdout); #endif string s; wh...
ALGO
0.984736
3.299248
e7f3fdfe-3991-4104-ac7c-ac23857cba0b
ludopulles/tcr
code/datastructures/lazy_segment_tree.cpp
struct node { int l, r, x, lazy; node() {} node(int _l, int _r) : l(_l), r(_r), x(INT_MAX), lazy(0){} node(int _l, int _r, int _x) : node(_l,_r){x=_x;} node(node a,node b):node(a.l,b.r){x=min(a.x,b.x);} void update(int v) { x = v; } void range_update(int v) { lazy = v; } void apply() { x += lazy; lazy = 0; } v...
ALGO
0.99992
4.437601
030aa817-a447-462f-8ca9-4f733721f7a0
roufy235/blume_shopping_app
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
4b04c082-cc63-4220-95fe-fc6a1b834bd1
rianbowgift/Algorithm_Cpp
Algorithm_Cpp/Programmers/Level1/Sort/PM_138477.cpp
//#include<iostream> //#include <string> //#include <vector> //#include<algorithm> // //using namespace std; // //vector<int> solution(int k, vector<int> score) { // vector<int> answer; // // vector<int> rank; // // // for (int i = 0; i < score.size(); i++) { // rank.push_back(score[i]); // // ...
ALGO
0.999983
4.254233
b37e8ef3-9fb5-4fef-98fd-a31d10da70c2
fairy-stockfish/variant-nnue-tools
src/tools/stats.cpp
#include "stats.h" #include "sfen_stream.h" #include "packed_sfen.h" #include "sfen_writer.h" #include "thread.h" #include "position.h" #include "evaluate.h" #include "search.h" #include "nnue/evaluate_nnue.h" #include <array> #include <string> #include <map> #include <set> #include <iostream> #include <cmath> #inc...
TOOL
0.891228
7.745206
ed4e188a-bf66-4c0e-b272-9ca85d9124b7
Melodiz/dailycode
Algorithms/HSE/AMI_HW3/LVZ_Encode.cpp
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <string> #include <unordered_map> std::vector<int> LVZ_encode(std::string message) { // return the ecoded message as a vector of integers (with a ten-base representation) // add ascii values to the hesh table std::unor...
ALGO
0.999612
5.211485
083621d4-93b3-4a2a-8169-f6be0b0e0d4d
PatchouliTIS/MicrosoftIntern
Modules/OpenSourceLightGBM/external_libs/compute/perf/perf_stl_partition_point.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <vector> #include "perf.hpp" int rand_int() { return static_cast<int>((rand() / double(RAND_MAX)) * 25.0); } bool less_than_20(int value) { return value < 20; } int main(int argc, char *argv[]) { perf_parse_args(argc, argv); std::c...
ALGO
0.990477
6.115492
97268a7d-eb58-44aa-bae3-2cda89c97804
jcd1994/MatlabTools
Compiled/blaze-3.2/blazemark/src/blitz/TMat6Mat6Mult.cpp
//================================================================================================= //================================================================================================= //************************************************************************************************* // Includes //****...
ALGO
0.996651
5.305209
e176f733-66fa-4961-a7f2-f6af58a95da8
opendemjapan/LIGGGHTS-PFM-24.01-Unofficial-
lib/gpu/lal_lj_class2_long_ext.cpp
/*************************************************************************** lj_class2_long_ext.cpp ------------------- W. Michael Brown LAMMPS Wrappers for COMMPASS LJ long Acceleration _________________________________________...
TOOL
0.94528
4.831083
b6a3c8cb-35b1-4b8c-87c9-867caedf886b
ChanekarSankalp/cs_theory
A_coinrows.cpp
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false);cin.tie(NULL); int t; cin>>t; while(t--){ int m; cin>>m; int a[m+2],b[m+2]; int pa[m+2],pb[m+2],sa[m+2],sb[m+2]; memset(pa,0,sizeof(pa));memset(pb,0,sizeof(pb));memset(sa,0,s...
ALGO
0.999986
3.541709
d93bbde8-72d6-4671-85f7-5c9d38069690
lucaceschi/tri-mesh-developability
src/opt.cpp
#include "opt.hpp" #include "energy_grad.hpp" #include <iostream> #include <iomanip> /*/ OPTIMIZER INTERFACE /*/ Optimizer::Optimizer(MyMesh& m, double stepSize) : m(m), stepSize(stepSize), nFunEval(0) { vAttrStar = vcg::tri::Allocator<MyMesh>::GetPerVertexAttribute<Star>(m, std::string("Star")); ...
ALGO
0.999561
6.362547
551361e3-37a7-4ed2-a62c-64bd7c8501b4
takashigoto1207/atcoder
abc0xx/abc095/abc095_a.cpp
#include <bits/stdc++.h> #include <atcoder/all> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using namespace atcoder; using ll = long long; int main() { string S; cin >> S; cout << 700 + count(S.begin(), S.end(), 'o') * 100 << endl; return 0; }
ALGO
0.995996
4.306443
aa5a5e83-2e02-4114-8d38-8851b331eb6d
mayankkaushik187/AlgoViser
SegmentTrees/Ashish and Bit Operations.cpp
#include<bits/stdc++.h> using namespace std; struct sgmntree { int n; vector<int> st; void init(int _n) { this->n = _n; st.resize(4 * n, 0); } void build(int start, int ending, int node, vector<int> &arr, int operation) { //base case if (start == ending) { st[node] = arr[start]; return; } //Fin...
ALGO
0.999995
5.499713
a5b4e81f-768f-4cb8-ab01-f67251e084ea
bhu619/Fast-Planner-Noetic
uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/mtl/gauss_packet.cpp
#include <iostream> #include <complex> #include <boost/numeric/odeint.hpp> #include <boost/numeric/odeint/external/mtl4/mtl4_resize.hpp> #include <boost/numeric/mtl/mtl.hpp> using namespace std; using namespace boost::numeric::odeint; typedef mtl::dense_vector< complex< double > > state_type; struct hamiltonian { ...
ALGO
0.999833
4.861836
a929868b-649f-4b92-8ea9-25ba0fa8d898
dhruvin0064/project-3-C-
pattern-2.cpp
#include<iostream> using namespace std; int main(){ int a = 11; for (int i = 1; i <= 4; i++) { for (int j = 0; j < i; j++) { cout << a << " "; a++; } cout << endl; } return 0; }
ALGO
0.999802
3.76988
a1a43b68-a887-4087-bfb0-46dc89d944c2
pratyushpanda91/Leetcode_DCC
2025/3.March/14_2226. Maximum Candies Allocated to K Children.cpp
class Solution { public: int maximumCandies(vector<int>& candies, long long k) { long long left = 1, right = *max_element(candies.begin(), candies.end()); int result = 0; while (left <= right) { long long mid = left + (right - left) / 2; long long children_count = 0;...
ALGO
0.999982
5.994761
0120a69b-b4cb-41e6-949e-7c23ce93b25b
wercsrsr/signSGD
OpenCheetah/SCI/src/LinearHE/fc-field.cpp
#include "LinearHE/fc-field.h" using namespace std; using namespace seal; using namespace sci; Ciphertext preprocess_vec(const uint64_t *input, const FCMetadata &data, Encryptor &encryptor, BatchEncoder &batch_encoder) { // Create copies of the input vector to fill the ciphertext appropiat...
ALGO
0.988927
4.450737
e5199c4a-d47c-4121-b55d-312079738c3b
Sumu154/CP_Techniques
C_Number Theory/5_prime_factorization_seive.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long /* time complexity: O(nlog(logn)) */ int main() { int n; cin >> n; vector<bool> prime(n+1, true); for(int i=2 ; i*i<=n ; i++){ if(prime[i]){ for(int j=2*i ; j<=n ; j+=i){ prime[j] = false; ...
ALGO
0.999626
3.721317
68d5f58b-9161-45a2-8814-0bc03ff9888b
Dsumanth11/Leetcode-problems
0044-wildcard-matching/0044-wildcard-matching.cpp
class Solution { public: bool findAns(int i1,int i2,string &s1,string &s2,vector<vector<int>> &dp) { if(i1==s1.size() && i2==s2.size()) { return true; } if(i2==s2.size()) { return false; } if(i1==s1.size()) { boo...
ALGO
0.999989
4.630633
36d01109-36f4-4711-94bc-d2a04a08894e
haoping0901/LeetCode-Practice-Records
1468-check-if-n-and-its-double-exist/1468-check-if-n-and-its-double-exist.cpp
class Solution { bool IsDivisibleBy2(const int& num) const { return num & 1; } public: bool checkIfExist(vector<int>& arr) { // brute force: n^2 // for each numbers, we iterate all numbers to find the target // number // sort and binary search: nlogn...
ALGO
0.999733
5.606753
bcb49769-4f06-4a03-92f6-f7061ec63ca6
raviRB/SPOJ-backup
character_stuffing.cpp
#include <bits/stdc++.h> #define MAX 10 #define mod 1000007 #define psize 10 using namespace std; int main(){ string str,prefix,suffix,temp; int index,pindex=0; cout<<"Enter String \n"; getline(cin,str); prefix="DLESTX"; suffix="DLEETX"; int i=0; while(pindex+10<=str.length()){ cout<<prefix<<" "; temp =str...
ALGO
0.997741
3.015825
fcb58824-cea3-463a-8292-6f6c1531f069
zukas/optimization-testing
SoA/glm/test/core/core_func_matrix.cpp
#include <glm/matrix.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/ulp.hpp> #include <glm/gtc/epsilon.hpp> #include <glm/gtc/constants.hpp> #include <vector> #include <ctime> #include <cstdio> using namespace glm; int test_matrixCompMult() { int Error(0); { mat2 m(0, 1, 2, 3); mat2 n = matrixC...
TEST
0.915302
6.670993
3edb191b-70e7-4f8d-97f5-c3cb8783ceb7
seyoung-Oh/learning
bj4344.cpp
#include<iostream> #include <memory.h> using namespace std; int main() { int c; cin >> c; int n; int arr[1000]; int sum, count; float average; for (int i = 0;i < c;i++) { cin >> n; sum = 0; for (int j = 0;j < n;j++) { cin >> arr[j]; sum += arr[j]; } average = sum / n; count = 0; for (i...
ALGO
0.999264
3.856429
4b6dda9d-d063-4e46-a39a-0089041f6629
Jitisha-khede/leetcode
String/medium/1456_Maximum_Number_of_Vowels_in_a_Substring_of_Given_Length.cpp
class Solution { public: int maxVowels(string s, int k) { int maxi=0; for(int i=0;i<=s.size()-k;i++){ int count = 0; for(int j=i;j<k+i;j++){ if(s[j]=='a'||s[j]=='e'||s[j]=='i'||s[j]=='o'||s[j]=='u'){ count++; } ...
ALGO
0.999956
6.046776
2c4ba7e1-3b75-41e8-b135-683b8320d786
yamaji-hironori/AtCoder
ABC/245/e_3_AC.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; #ifdef _DEBUG #define debug(x) cout<<#x<<": "<<x<<endl #define debug_vec(x) cout<<#x<<" ->"<<endl;for(size_t i=0;i<x.size();i++){cout<<x.at(i)<<"; ";}cout<<endl; #define debug_vecvec(x) cout<<#x<<" ->"...
ALGO
0.999986
3.862741
6721e88e-1bd3-4189-ac1d-08fdf95396d1
danyaKlmov/programming
01 04 22/01 04 22/array47.cpp
#include<iostream> using namespace std; int main() { int n; cin >> n; int* a = new int[n]; for (int i = 0; i < n; ++i) { cin >> a[i]; } int i2, k = 1; for (int i = 1; i < n; i++) { k++; for (int i2 = i - 1; i2 >= 0; i2--) { if (a[i] == a[i2]) { k--; break; } } } cout << k; return 0; }
ALGO
0.999961
3.703389
a5797007-ad64-4e51-a049-7a12b3a8c023
deepak-ky/cpp-codes
cpp-codes/Book_Allocation.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; #define int long long #define varname(name) #name #define mod 1000000007 #define wer(x) cout<<"\n"<<varname(x)<<" here : "<<x<<"\n" #define asdf(a,n) ...
ALGO
0.999935
4.326686
8a60bb55-f828-4be6-822d-65662468485a
dmehrab06/Time_wasters
hackerrank/week of code 22/F.cpp
#include <bits/stdc++.h> #define MIN(X,Y) X<Y?X:Y #define MAX(X,Y) X>Y?X:Y #define ISNUM(a) ('0'<=(a) && (a)<='9') #define ISCAP(a) ('A'<=(a) && (a)<='Z') #define ISSML(a) ('a'<=(a) && (a)<='z') #define ISALP(a) (ISCAP(a) || ISSML(a)) #define MXX 100000000000000000 #define MNN -MXX #define VALID(X,Y,N,M) ((X)>=0 && (X)...
ALGO
0.999979
3.689798
662cb8e3-3dd9-4387-a2fb-d163dc99923b
thisinnocence/leetcode
algorithms/118_Pascal'sTriangle.cpp
class Solution { public: vector<vector<int>> generate(int numRows) { vector<vector<int>> ans; if (numRows == 0) return ans; vector<int> row; row.push_back(1); ans.push_back(row); if (numRows == 1) return ans; row.push_back(1); ans.push_back(row); ...
ALGO
0.999993
6.041284
6167200b-e399-4c42-8062-10fe36a3b1ef
nakamurafahagi/OwnCrew
src/common/config.cpp
#include <common/args.h> #include <common/settings.h> #include <logging.h> #include <sync.h> #include <tinyformat.h> #include <univalue.h> #include <util/chaintype.h> #include <util/fs.h> #include <util/string.h> #include <algorithm> #include <cassert> #include <cstdlib> #include <filesystem> #include <fstream> #incl...
CONFIG
0.991238
7.561878
bf49fa1d-d670-451a-9dbc-1203f61bdac4
hojin35/CodingTest
1340.cpp
#include <iostream> #include <vector> #include <algorithm> #include<string> using namespace std; int main() { cin.tie(NULL); cout.tie(NULL); string month; int day; int year; int hour; int minutes; bool isLeapYear = false; int countMonthDays[12] = { 31,28,31,30,31,30,31,31,30,31,30,31}; vector<string> alpab...
ALGO
0.998084
3.570358
704841d8-0766-4e2b-9a9a-5be0467e9eb5
Devikasarwade/coding-question-
ipo.cpp
class Solution { public: // for same capital, we give more priority to the // project with higher profit static bool compare(pair<int,int>& a, pair<int,int>& b) { if(a.first == b.first) return a.second>b.second; return a.first<b.first; } int findMaximizedCapital(int k, int w, vector<...
ALGO
0.999989
5.317462
0988b9b1-4404-44b3-8739-738ed289c7ba
vitor27melo/MAC439-SAS-FrontEnd
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
67e5c667-1bce-4c94-a3bd-0b3167954464
saumyap48/GeeksforGeeks
Difficulty: Easy/Row with Minimum 1s/row-with-minimum-1s.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 minRow(vector<vector<int>> &mat) { // code here int m = mat.size(); int n = mat[0].size(); ...
ALGO
0.999807
6.567739
466d654f-d079-4e95-9fa6-e4e6b94b59e4
hantwofish/recode
leetcode/leetcode/754到达终点数字.cpp
#include<iostream> using namespace std; class Solution { public: int reachNumber(int target) { return 0; } }; int main() { Solution s1; int target = 9; int resu = s1.reachNumber(target); cout<< "main:: resu= " << resu << endl; return 0; }
ALGO
0.999846
4.038243
c2b212d9-e34c-4016-b319-a55dd44317ef
Sarwar-Emon/Algorithm
Module 10.5/undirected_shortest_path.cpp
#include <iostream> #include <vector> #include <stack> #include <queue> #include <string.h> #include <algorithm> using namespace std; typedef pair<int, int> p; const int N = 1e3 + 5; const int INF = 1e9 + 7; vector<p> g[N]; vector<int> dist(N, INF); // have to understand vector<bool> visited(N); // have to understand...
ALGO
0.999978
4.967051
ea9cab75-b5db-4015-8e74-e236cdb34630
CodingMadeEasy786/BasicProblemforbeginners
ArraySum.cpp
#include <iostream> using namespace std; int main() { int arr[]={1,2,3,4,5}; int sum=0; int arrSize = sizeof(arr)/sizeof(arr[0]); //size of arr gives 20 because it counts in date type size. so divide it be same data type gives exact size. for(int i=0;i<arrSize;i++) { sum=sum+arr[i]; ...
ALGO
0.99364
3.290024
9fe6552e-a2df-46cb-bade-4b18bcc0fda4
quynezz/LeetCodeProblems
easy and medium/1975. Maximum Matrix Sum/maxMatrixSum.cpp
class Solution { public: long long maxMatrixSum(vector<vector<int>>& matrix) { long long sum = 0; long long small = LLONG_MAX; int count = 0; for(int i = 0; i < matrix.size(); i++){ for(int j = 0; j < matrix[i].size(); j++){ if(matrix[i][j] < 0){ ...
ALGO
0.999985
6.053265
1c10ab29-7eeb-438d-8d1c-678ff4ae5dcb
qwerty2024/LeetCode
mideum/3468.cpp
class Solution { public: int countArrays(vector<int>& original, vector<vector<int>>& bounds) { int n = original.size(); //if (original[0] < bounds[0][0] || original[0] > bounds[0][1]) // return 0; int lower = original[0] - bounds[0][0]; int upper = bounds[0...
ALGO
0.997666
5.590858
6291447a-36ac-4d1a-be44-6ade0eea8aff
datsu0/cpp
KisokaraCpp-samples/09/09-random.cpp
#include <iostream> #include <random> #include <map> using namespace std; int main() { random_device engine; uniform_int_distribution<unsigned> dist1(1, 6); for (int i = 0; i < 10; ++i) { cout << dist1(engine) << ", "; } cout << endl; //o͗F1, 1, 3, 6, 1, 1, 2, 3, 5, 4, uniform_real_distribution<dou...
TOOL
0.991209
3.411089