uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
2538c097-a094-452d-a3e7-ab5a9d4824e5
NOMFPS/csso-src
src/mathlib/spherical.cpp
#include <math.h> #include <float.h> // Needed for FLT_EPSILON #include "basetypes.h" #include <memory.h> #include "tier0/dbg.h" #include "mathlib/mathlib.h" #include "mathlib/vector.h" #include "mathlib/spherical_geometry.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" floa...
TOOL
0.998562
5.758006
45ca76e8-d69b-477f-b1f0-a70a6e243718
alinradut/PongCocos2D-x
libs/cocos2dx/menu_nodes/CCMenu.cpp
#include "CCMenu.h" #include "CCDirector.h" #include "CCApplication.h" #include "CCPointExtension.h" #include "CCTouchDispatcher.h" #include "CCTouch.h" #include "CCStdC.h" #include <vector> #include <stdarg.h> using namespace std; namespace cocos2d{ enum { kDefaultPadding = 5, }; // //CCMenu // ...
TOOL
0.879519
6.354153
4147b038-17e9-4ad6-b694-c2f11a180862
raincross7/code-similarity
codes/train_code/problem378/problem378_144.cpp
#include <iostream> using namespace std; int main(void){ int n; long long a[10001]={0}; cin >> n; for(int i=0;i<n;i++){ cin >> a[i]; } long long min =1000000,max=-1000000,sum=0; for(int i=0;i<n;i++){ if(a[i]<min){ min=a[i]; } } for(int i=0;i<n;i++){ if(...
ALGO
0.999849
3.416811
da864f58-b1e6-4ee4-975c-8c1bf52cfbaa
JayeshJain25/onboard_design
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
1b04a5b4-fb0a-4e66-b946-a6bc958edd8c
l3v11/Codeforces
1699B. Almost Ternary Matrix.cpp
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; using ll = long long; using ld = long double; using str = string; using pii = pair<int, int>; using pll = pair<ll, ll>; #define mp make...
ALGO
0.999866
4.976675
778cf4dd-f391-4e10-a0d5-264d7b45de5e
Akash-Shrivastava11/CN-Lab
Lab7/dvr.cpp
#include<bits/stdc++.h> using namespace std; struct node { int dist[15]; int from[15]; }; int main() { int a[15][15],n=0,i,j,k,count; struct node s[10]; printf("enter number of nodes\n"); scanf("%d",&n); printf("enter matrix\n"); for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { scanf("%d",&a[i][j]); s[i].dis...
ALGO
0.999874
3.097569
829b5d59-e45a-4bb1-98fc-173f37f5e623
yenanfei/bitprogram
组成最大数.cpp
#include<stdio.h> #include<string.h> int main() { char num[100],t; int i,n,p; gets(num); n=strlen(num); for(i=0;i<n-1;i++) { for(p=0;p<n-i-1;p++) { if(num[p+1]>num[p]) { t=num[p+1]; num[p+1]=num[p]; num[p]=t; } } } puts(num); }
ALGO
0.99999
3.2506
14ed8ff2-8f19-4727-9cfb-aeb16415b8d4
sourav-122/hacktoberfest2022
codechef_solutions/taller.cpp
#include <iostream> using namespace std; int main() { int i,t,x,y; cin>>t; for(i=0;i<t;i++) { cin>>x>>y; if(x>y) { cout<<"A"<<endl; } else { cout<<"B"<<endl; } } return 0; }
ALGO
0.99996
3.530962
e7a55baf-27a2-4e8b-9cbc-72bf6d8f8488
LuscaFreitas/Lista-1---LP1
Imprensadinho.cpp
#include <iostream> #include <locale.h> #include <time.h> #include <stdlib.h> using namespace std; bool Existe(int valores[],int tam, int valor){ for(int i = 0;i<tam;i++){ if(valores[i]==valor) return true; } return false; } void GeraAleatorios(int numeros[],int quantNumeros,int Limit...
TOOL
0.992793
3.566734
a78d99d0-1241-43cc-a97a-8250322ea040
HPC-AI-Team/lammps-fugaku-threadpool-sc23
src/compute_torque_chunk.cpp
#include "compute_torque_chunk.h" #include "atom.h" #include "compute_chunk_atom.h" #include "domain.h" #include "error.h" #include "memory.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeTorqueChunk::ComputeTorqueChunk(LAMMPS *lmp, int narg, char **...
ALGO
0.989784
6.121547
1adfdf1d-ba0a-4afc-b023-533469410eed
SandeepMaithani/DS_and_Algo_practice
Algo/Binary_Search/Index of First 1 in a Binary Sorted Infinite Array.cpp
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long int lli; int first_occur(vector<int>&nums, int target, int start, int end) { int answer = -1; while (start <= end) { int mid = start + (end - start) / 2; if (nums[mid] == target) { answer = mid; end = mid - 1; } ...
ALGO
0.999971
4.249015
eb53134e-e2cc-4e39-839a-2e59a66b9b6a
stdpain/vec
test/bench/bench_mem_access.cpp
// https://stackoverflow.com/questions/40950254/speed-up-random-memory-access-using-prefetch #include <benchmark/benchmark.h> #include <emmintrin.h> #include <limits.h> #include <cstdlib> constexpr int chunk_size = 4096; struct BenchContext { size_t buffer_size = 0; unsigned int* valueBuffer = nullptr; ...
TOOL
0.857573
6.131973
ddd9c43a-a0ae-4cfa-a5ab-ace36458e991
mertpasacukur/riscv_llvm
libc/src/math/generic/scalbn.cpp
#include "src/math/scalbn.h" #include "src/__support/FPUtil/ManipulationFunctions.h" #include "src/__support/common.h" namespace LIBC_NAMESPACE { LLVM_LIBC_FUNCTION(double, scalbn, (double x, int n)) { #if !defined(__FLT_RADIX__) #error __FLT_RADIX__ undefined. #elif __FLT_RADIX__ != 2 #error __FLT_RADIX__!=2, unimpl...
TOOL
0.869236
6.214728
c4af7b76-1d99-4ed3-920b-3bae136dbb56
ishandutta2007/codeforces
teja349/normal/1054/D.cpp
//teja349 #include <bits/stdc++.h> #include <vector> #include <set> #include <map> #include <string> #include <cstdio> #include <cstdlib> #include <climits> #include <utility> #include <algorithm> #include <cmath> #include <queue> #include <stack> #include <iomanip> //setbase - cout << setbase (16); cout << 100 << end...
ALGO
0.99998
3.9509
015ef66a-8680-4727-94df-30d2fe61d10b
QianQNanami/JSOI-WC25
PJ/judger/source/WC25-508/box.cpp
#include<bits/stdc++.h> using namespace std; int a[10], sum[10], ans, s; int main(){ while(1){ memset(sum, 0, sizeof(sum)); s = 0; for(int i = 1;i <= 6;i++){ cin >> a[i]; } if(a[1] == 0 && a[2] == 0 && a[3] == 0 && a[4] == 0 && a[5] == 0 && a[6] == 0){ continue; } for(int i = 1;i <= 6;i++){ su...
ALGO
0.9997
3.500449
cf949596-f9c0-43b8-b024-57768a68ae64
kenctxncy/c-go
contest_01/contest13.cpp
#include <iostream> int main() { int n; std::cin >> n; int c_l = 0, s_l = 1, m_l = 2, uod = 1; for (int i = 1; i <= n; i++) { std::cout << i << " "; c_l++; if (c_l==s_l) { std::cout << "\n"; s_l += uod; c_l = 0; } if (s_l==m_l||s_l==1) { uod *= -1; } if (s_l == m_l) { m_l++; }...
ALGO
0.999885
3.237955
e2da00ec-9ee1-4594-9c93-cdb5b9fbc5f8
dungnguyen2112/DSA_PTIT
DSA09018.cpp
// https://code.ptit.edu.vn/student/question/DSA09018 // LIỆT KÊ ĐỈNH TRỤ #include <bits/stdc++.h> using namespace std; int V, E, u, v, lien_thong; vector<vector<int>> G; vector<bool> Vs; void bfs(int S) { queue<int> q; q.push(S); Vs[S] = 1; while (!q.empty()) { u = q.front(); q.pop(); ...
ALGO
0.999893
5.323611
da8243d2-a8c5-466e-92c7-e7cbfd5df3a9
stalker5217/problem-solving
BAEKJOON/9020.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> using namespace std; bool isPrime(int n) { bool result = true; for (int i = 2; i <= n / 2; i++) { if (n%i == 0) { result = false; break; } } return result; } int main(int argc, char** argv) { //freopen("input.txt", "r", stdin); ...
ALGO
0.999907
4.175603
2884c3c3-76f0-4611-8790-f0b7be20987e
tinkunath/DSA-with-all-language
Digit_Count/Digit_Count.cpp
/* DIGIT COUNT OF A NUMBER The task is to count the number of digits present in the given number. */ #include<bits/stdc++.h> using namespace std; int getDigits(int n) { int ans = 0; while (n) { ans ++; n /= 10; } return ans; } int main() { cout<<"Enter N: "; int n; cin>>n...
ALGO
0.999769
4.670115
1e483b83-abed-4951-8b1d-40ea7350f0ea
Utkarsh9026/DSA
merge_sort.cpp
#include<iostream> using namespace std; void merge(int A[],int l,int m,int h) { int n1=(m-l+1); int n2=(h-m); int C[n1],D[n2]; for(int i=0;i<n1;i++) { C[i]=A[l+i]; } for(int i=0;i<n2;i++) { D[i]=A[m+1+i]; } int i=0,j=0,k=l; while(i<n1 && j<n2) ...
ALGO
0.999995
5.063015
aa9370a2-7751-4041-a125-f7f318501ca6
Jaydenxm419/Algorithms
AssignmentOne/sorting.cpp
#include "sorting.h" #include <string> /** This file contains all method calls for different sorting algortihms * @author Jayden Melendez * @date October 2nd, 2024 */ // Constructor Sorting::Sorting() { comparisonCounter = 0; // Counting the number of comparisons for each sort } // Selection Sort int Sorting:...
ALGO
0.999894
5.845887
9417e41f-e669-49da-8c86-c8d44107f74b
ishandutta2007/codeforces
mnaeraxr/normal/668/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int64; typedef vector<int> vi; typedef pair<int,int> pii; const int oo = 0x3f3f3f3f; const double eps = 1e-9; const int maxn = 100010; int main() { int n, q; scanf("%d%d", &n, &q); int odd = 0; int even = 0; for (int i = 0; i < q; ++i){ in...
ALGO
0.999982
3.526935
99a6d4d9-bd42-400b-9ad3-16daa954f6d0
prateek-workspace/DSA100
Day-03/P-06.cpp
// WAP to print sum upto n numbers where n is the number upto user wants to get sum calculated. #include<iostream> using namespace std; int main() { int n ; cout << "Enter number upto which you want to get sum calculated :---" << endl; cin >> n ; int i = 0; int sum = 0; while (i <= n) { sum = sum + i ; i ...
ALGO
0.993382
3.416577
27fc6836-ae0a-4dbb-a08f-cd751364e56c
ishandutta2007/codeforces
yyt16384/normal/339/E.cpp
#include <algorithm> #include <cstdio> #ifdef _WIN32 #define LLFORMAT "I64" #else #define LLFORMAT "ll" #endif const int MAXN = 1005; const int MAXP = 7; const int MAXS = 3; int n; int a[MAXN]; int c[MAXP]; int match[MAXP + 1]; void init() { scanf("%d", &n); for (int i = 0; i < n; ++i) scanf("%d", &a[i]); } bo...
ALGO
0.999919
3.486436
11f61945-5f86-4a82-be32-9847a49ed774
gabriel-gamboa/CPSC-323-Project
lexer.cpp
// // main.cpp // CPSC 323 Project 1 // // Created on 2/15/21. // #include <iostream> #include <fstream> #include <string> #include <stdio.h> #include <vector> #include <iomanip> #include "header.hpp" //std::ofstream fout("outputfile.txt"); std::string file = ""; std::vector<std::stri...
TOOL
0.877434
3.971284
ee64c121-c5e2-4852-94f2-491e65762082
danishkangwal/LeetCode
1129-shortest-path-with-alternating-colors/1129-shortest-path-with-alternating-colors.cpp
class Solution { public: vector<int> shortestAlternatingPaths(int n, vector<vector<int>>& redEdges, vector<vector<int>>& blueEdges) { vector<vector<pair<int, int>>> adj(n); for (auto& redEdge : redEdges) { adj[redEdge[0]].push_back({redEdge[1], 0}...
ALGO
0.999862
5.995183
69e18c8e-5f35-48d0-88b1-9573633813a4
ishandutta2007/codeforces
tankengineer/normal/217/B.cpp
#include<cstdio> #include<algorithm> using namespace std; int n, r, ans, t1, t2, t3, a, b; char anst[1000005]; int check(const int x, const int y) { a = x; b = y; int cnt = n, cot = 0, t1, t2, t3; while (b != 0 && cnt >= 0) { t1 = a / b; t2 = a % b; cnt -= t1; if (t1 > 0) cot += t1 - 1; a = ...
ALGO
0.999984
3.527572
a1b69c3d-53b0-423e-b779-10a41bc21185
ByteBrewer1/CPP
Work@Tech/Array/Even Number Of Digits.cpp
// AUTHOR :: RAHUL MISTRY // DATE :: 19/03/2023 #include <bits/stdc++.h> using namespace std; vector<int> getEvenDigitNumbers(vector<int> &arr) { vector<int> result; for (int i = 0; i < arr.size(); i++) { int digits = (int) log10(arr[i]) + 1; if (digits % 2 == 0) { result.push_bac...
ALGO
0.999421
6.27631
c71edd5a-f84d-4832-a312-e273cefb70a0
batdefi/UTN-
NumberFrequence.cpp
#include <iostream> #include <algorithm> using namespace std; int n,x,res; int arr[2001]; int main(){ cin >> n; for (int i=0;i<n;i++){ cin >> arr[i]; } res=1; sort(arr,arr+n); for (int i=1;i<n;i++){ if (arr[i] == arr[i-1]){ res++; }else { cout << arr[i-1] << " aparece " << res <<" vez(es)" << en...
ALGO
0.999795
3.645278
50f923a4-b66f-4876-b534-126696c96861
JasonRodrigues15/Libary_Book_Creator
a5_library.cpp
// Student Name : Jason Rodrigues and Brian Widjaja // Syde 121 Assignment 5 // Filename: a5.cpp, a5_book.cpp, a5_book.h, a5_library.h, a5_library.cpp // // I hereby declare that this code, submitted for credit for the course SYDE121, is a product of my own efforts. This coded solution has not been plagiarized from oth...
ALGO
0.993457
5.224533
6a328f5f-0c94-468a-aac9-4bf3e8c95957
oclron0421/Advent-Of-Code-2023
day7/day7_part2.cpp
#include <iostream> #include <fstream> #include <sstream> #include <vector> #include <unordered_map> #include <map> #include <algorithm> #include <string> #include <array> #include <cstring> #include <cmath> using namespace std; string filename = "day7.txt"; array<char, 13> cards = {'A', 'K', 'Q', 'J', 'T', ...
ALGO
0.999499
5.290074
8b14dfbf-eb05-42b2-b284-2e009fd96bea
old-man-teach-code/300-bai-code-thieu-nhi
150-Bai-Code-C++/Bai-021-Tinh-tien-hoa-hong/Tinh-tien-hoa-hong.cpp
#include <iostream> using namespace std; int main() { long int doanhso; float hoahong; cout << "Tong doanh so ban hang : " << endl; cin >> doanhso; if (doanhso <= 100) { hoahong = doanhso * 5 / 100; cout << "Voi tong doanh so la " << doanhso << ", "; cout << "thi hoa hon...
TOOL
0.997945
3.634095
3bdfb740-faa2-4a5c-8fc3-3ce6ce1e6ceb
fotimafozilova/working_with_google_map
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.998757
6.771107
d39f9f4c-249e-4efc-bb88-0bb26f65d241
gilbert-yangye/IC-ACSE-Resources
ACSE6/ACSE-6-master/Worksheet_2.cpp
#include <mpi.h> #include <iostream> #include <locale> using namespace std; int id, p; int send_total = 10000; int send_chunk = 100; int gcd_calc(int a, int b) { while (b != 0) { int t = b; b = a % b; a = t; } return a; } void Zero_Proc(void) { int *pairs = new int[send_total * 2]; int *gcd = new int...
ALGO
0.999851
3.416331
6c95ebff-08ac-48eb-8ed4-42dd5343cc5e
spacefarers/cp
problems/USACO/2021-feb/s-1.cpp
#include <iostream> #include <queue> #include <vector> #include <set> using namespace std; int adj[2005][2005], ans[100005]; bool has_cow[2005][2005]; queue<pair<int, int>> trouble; pair<int, int> dirs[4]={{1, 0}, {-1, 0}, {0, 1}, {0, -1}}; void add_cow(int a, int b){ adj[a+1][b]++; adj[a-1][b]++; adj[a][b+1]++; ...
ALGO
0.999824
4.227299
b29b3bc0-cff4-44fb-a373-48395b5a027f
Param129/CSES
sorting/subarray_distincT-val.cpp
#include<bits/stdc++.h> using namespace std; int cntdig(int n) { int cnt = (int)(log10(n) + 1); return cnt; } int revNum(int n) { int rev = 0; while(n > 0) { rev = rev * 10 + n % 10; n /= 10; } return rev; } bool checkNumPalindrome(int n) { return n == revNum(n); } int gc...
ALGO
0.999972
4.351115
78ed0bcf-93d5-423c-8bee-ae15f5b8091d
f1oating/PhysicsWithDirectX11
3DParty/Bullet/include/Bullet3Geometry/b3GeometryUtil.cpp
#include "b3GeometryUtil.h" /* Make sure this dummy function never changes so that it can be used by probes that are checking whether the library is actually installed. */ extern "C" { void b3BulletMathProbe(); void b3BulletMathProbe() {} } bool b3GeometryUtil::isPointInsidePlanes(const b3AlignedObjectArray<...
ALGO
0.995922
7.072573
d171617e-000f-41b9-b032-369811b89233
annusachan24/Codes
reverse_ll.cpp
//reversing a linked list recursive and iterative version #include<iostream> #include<stdio.h> #include<stdlib.h> using namespace std; struct node { int data; struct node* next; }; void print_ll(struct node** head_ref) { struct node* ptr=(*head_ref); while(ptr!=NULL) { cout<<ptr->data<<" "; ptr=ptr->next; }...
ALGO
0.999938
4.642591
6467941f-1b01-4437-b672-3f63bff33257
AxonDragonScale/Algorithms
Linked Lists/Partition List.cpp
// https://www.interviewbit.com/problems/partition-list/ // Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or // equal to x. You should preserve the original relative order of the nodes in each of the two partitions. // For example, Given 1->4->3->2->5->2...
ALGO
0.999993
5.303581
62b341b2-33f7-44b9-83b4-b45f69647597
TheLeftyCoder/A2Z-DSA-Course-Sheet
Array/Medium/1. Two Sum.cpp
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { int n = nums.size(); unordered_map<int,int>mp; for(int i=0;i<n;i++){ if(mp.size() > 0 && mp.find(target-nums[i]) != mp.end()){ return {mp[target-nums[i]],i}; } mp...
ALGO
0.999834
6.231442
80b1fd90-80ec-488f-973c-80c6c29a40d0
KThurmes/LangtonsAnt
Ant.cpp
/********************************************************************* ** Author: Katheen Thurmes ** Date: 8 Oct., 2019 ** Description: An ant object designed for use in the implementation of a Langton's Ant simulation. It keeps track of its location on the board and which direction it is facing. It can also turn 90...
ALGO
0.984453
5.505839
f6f21aa8-4ca6-4276-8a2b-5a1165b4410a
RustyStove/LabAssignments
lab6/game.cpp
#include <stdio.h> int main(){ int N,index; scanf("%d %d", &N, &index); char word[N]; int M; scanf("%s", &word); for (int i = 0; i<index; i++){ scanf("%d", &M); if(word[M] >= 'A' && word[M] <= 'Z') { word[M] = word[M] + 32; }else if(word[M] >= 'a' && word[...
ALGO
0.996488
3.64617
94a6c24d-472c-4be7-a21c-59d79863bf37
AdhityaRamadhanus/HackerRank
Algorithm/Implementation/AngryProfessor.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { int n,k,t,x; int pos=0; cin>>t; while(t--){ cin>>n>>k; pos=0; for(int i=0;i<n;i++){ cin>>x; if (x<=0) pos++; } ...
ALGO
0.999926
3.659104
5ee5235f-f001-43e5-aa5c-02ce673e6663
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_18_2.cpp
#include <bits/stdc++.h> const int maxn = 200000 + 10; class BIT { private: int n; int bit[maxn]; public: BIT(int size) { n = size; std::fill(bit, bit + size, 0); } void add(int x, int v) { while (x <= this->n) { bit[x] += v; x += ((x) & (-x)); } } int query(int x) { int...
ALGO
0.999935
3.803939
249cce62-2358-44bf-aa2a-aaed7e4e3ddb
biyotte/Code_of_gunwookim
BOJ_solve/8234.cpp
#include <bits/stdc++.h> #define x first #define y second #define pb push_back #define all(v) v.begin(),v.end() #pragma gcc optimize("O3") #pragma gcc optimize("Ofast") #pragma gcc optimize("unroll-loops") using namespace std; const long long INF = 1e9; const int TMX = 1 << 18; const long long llINF = 1e18; const long...
ALGO
0.999993
3.429685
d51cc622-0edd-46c3-a076-4b68c5d9084e
punkduckable/Soham_Optimization
CPP/Functions/tangent_drs.cpp
#include <iostream> #include "Eigen/Dense" using namespace Eigen; using namespace std; void tangent_drs(const Vector3d & a1, const Vector3d & a1r, const Vector3d & a1s, const double norm_a1, Vector3d & t) { double n = norm_a1; double Inv_n = 1/n; double Inv_n_squared = Inv_n*Inv_n; double Inv_n_cubed = Inv_n_squa...
ALGO
0.998228
3.513367
90d5455b-0703-4bd0-aa4e-80dded21819a
yashyadav-create/DSA-Problems
intersection of two arrays II.cpp
class Solution { public: vector<int> intersect(vector<int>& nums1, vector<int>& nums2) { sort(nums1.begin(), nums1.end()); sort(nums2.begin(), nums2.end()); vector<int> res; int i = 0, j = 0; while(i < nums1.size() && j < nums2.size()){ if(nums1[i] == nums2[j]){ ...
ALGO
0.999995
5.706561
419aebab-4460-4856-9685-f278c6db8703
ChessCoder1729/Competitive-Programming
CSES/Introductory Problems/AppleDivision.cpp
#include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); long long ans = INT_MAX; long long total = 0; void solve(vector<long long>&p, int i, int n,long long currentsum){ if(i==n){ ans = min(ans,abs(total-2*currentsum)); } else{ ...
ALGO
0.999834
3.77584
b25ea87a-d6a6-4653-af4a-f54b0eb7b39f
Orang123/ACMAlgorithmExercises
图论/最短路/CF 144D Missile Silos.cpp
#include<cstdio> #include<cstring> #include<queue> #include<algorithm> #define N 100100 #define INF 0x3f3f3f3f using namespace std; /* :nͼ,s̾Ϊlĵϵĵ жٸ. :https://codeforces.ml/problemset/problem/144/D ˼·:sĵֱ·,ڱߵĴԿ ڱߵ˵u,v,dis[u]<l dis[u]+w>l ,˵ һsΪl. */ int n,m,l,cnt,head[N],dis[N],vis[N]; struct Node{ int from,to,n...
ALGO
0.999971
3.867218
3f84164c-2260-4a5c-8cac-a34e89bd4a34
tr0j4n034/SPOJ
HS08PAUL.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <numeric> #include <algorithm> #include <functional> #include <vector> #include <queue> #include <stack> #include <set> #include <map> //#include <unordered_map> #include <bitset> #include <utility> #include <cassert> ...
ALGO
0.999574
3.787537
6f023d09-b67c-41be-b441-822a8a97fff1
cthbst/Competitive-Programming
contest/TOI2016/Greedy/T1/pF.cpp
#include<bits/stdc++.h> using namespace std ; int n ,d ,mx; vector<int> a ; priority_queue<int,vector<int>,greater<int> > que ; int check(int m){ while (!que.empty())que.pop() ; for (int i=0 ;i<m ;i++ )que.push(0) ; long long ans=0 ,ai ; for (int i=0 ;i<n ;i++ ){ ai = a[i] ; ai+=que.to...
ALGO
0.999519
3.896894
abbb2361-ffc2-4c22-87a4-ca99eab71ae2
Raghu-938/Data-Structures-programs
Data Structures/set & map/Nothing in Common.cpp
#include <iostream> #include<unordered_set> using namespace std; int main() { int t,a,b,count,num; cin>>t; while(t--){ cin>>a>>b; unordered_set<int> s; for(int i=0;i<a;i++){ cin>>num; s.insert(num); } count=0; for(int i=0;i<b;i++){ ...
ALGO
0.999575
3.315811
ab5f6fe2-b996-4f7d-9e21-d38bd03a7d0a
comprehensive9/vendor_qcom_proprietary
mm-video-utils/vtest-omx/common/src/vtest_Parser.cpp
#include "vtest_ComDef.h" #include "vtest_Parser.h" #include "vtest_File.h" #include "vtest_Debug.h" #include <stdio.h> #include <stdlib.h> #include <cctype> #include <string.h> namespace vtest { ParserStrVector::ParserStrVector() : count(0) { clear(); } ParserStrVector::~ParserStrVector() { clear(); } ...
TEST
0.860724
4.443082
0fc63561-4832-45bd-80e3-4a2d4f40093d
Elliot0122/leetcode_practice
155/solution.cpp
class MinStack { public: MinStack() { } void push(int val) { pair<int, int> p; p.first = val; p.second = (stack.empty())? val: min(val, stack.back().second); stack.push_back(p); } void pop() { stack.pop_back(); } int top() { ...
ALGO
0.999947
6.756607
ecddc152-7900-4c95-be3e-bdaac5e40707
checkedc/checkedc-llvm-project
clang/lib/Analysis/CFGReachabilityAnalysis.cpp
#include "clang/Analysis/Analyses/CFGReachabilityAnalysis.h" #include "clang/Analysis/CFG.h" #include "llvm/ADT/BitVector.h" #include "llvm/ADT/SmallVector.h" using namespace clang; CFGReverseBlockReachabilityAnalysis::CFGReverseBlockReachabilityAnalysis( const CFG &cfg) : analyzed(cfg.getNumBlockIDs(), false...
TOOL
0.989026
7.079948
34e35820-0a18-4a7d-b108-b7adfd4a4406
femhub/hermes-module-basic-adapt
src/main.cpp
// WARNING: Hermes needs to be compiled with Glut // for this module to work. Check the CMake.vars file // in ~/repos/hermes/hermes2d/. // How to run it: module-basicadapt model.cfg //#define HERMES_REPORT_INFO #define HERMES_REPORT_ALL #define HERMES_REPORT_FILE "application.log" #include "hermes2d.h" #include "...
ALGO
0.851946
5.706629
fc83ee49-22e0-4010-acfc-331f5330c6b8
iAndyHD3/GDPS-Editor-22
jni/include/cocos2dx_bak/base/CCConfiguration.cpp
#include "base/CCConfiguration.h" #include "platform/CCFileUtils.h" #include "base/CCEventCustom.h" #include "base/CCDirector.h" #include "base/CCEventDispatcher.h" NS_CC_BEGIN extern const char* cocos2dVersion(); Configuration* Configuration::s_sharedConfiguration = nullptr; const char* Configuration::CONFIG_FILE_...
CONFIG
0.89465
6.128992
9884d3c6-d11c-4bc2-900e-442a849e0978
Hanhuka/cpp_piscine
cpp_08/ex01/Span.cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Span.cpp :+: :+: :+: ...
ALGO
0.930677
4.692917
40771a3c-f421-4122-be1a-1c83b1bf96d7
singhankit62000/APS-Code-Library
XOR_WaitForIt.cpp
#include <bits/stdc++.h> using namespace std; long long int findXor(long long int n) { int mod=n%4; if(mod==0) return n; else if(mod==1) return 1; else if(mod==2) return n+1; else if(mod==3) return 0; } int main() { long long int t,l,r,x,i; scanf("%lld",&t); while(t--) { scanf("%lld%lld",&l,&r); x=...
ALGO
0.999968
4.180639
90d271bc-99a4-4dd7-9369-6de93eb09d92
sid-h-arth/DataStructures
Graphs/DSU[Graph].cpp
#include<iostream> using namespace std; int parent[1000]; int rrank[1000]; void init(int n) { for(int i=1; i<=n; i++) { parent[i]=i; rrank[i]=0; } } int findP(int node) { if(node==parent[node]) return node; return parent[node]=findP(parent[node]); } void Union(int u,int v) { u=findP(u); v=findP(v); if(r...
ALGO
0.999726
4.294131
f296b187-d4cc-4d12-943f-6ae2e7b11305
vieira-klgwn/Data-Structures-And-Algorithms-in-C-
linkedlistOperations/doubly/Deletion/deleteFromHead.cpp
#include <iostream> using namespace std; struct Node { int data; Node *prev; Node *next; Node(int value) : data(value), prev(NULL), next(NULL) {} }; // Function to delete a node from the head of the doubly linked list Node *deleteFromHead(Node *head) { // Check if the list is empty if (head ==...
ALGO
0.988797
6.278837
3af67a9c-daa5-41a1-8590-ed55fd2557a7
chawinkn/competitive-programming
OTOG/416.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define f first #define s second int main() { int n; while (scanf("%d", &n)) { if (n == 0) break; vector<int> h(n); for (auto &i : h) scanf("%d", &i); ll ans=0; stack<pair<int,int>> st; for (int i = 0; i < n; i++) { int start = i; ...
ALGO
0.999953
3.736069
4e090dee-7cfb-43ba-865e-65ac923d6121
migueldiascoelho/convolution
JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/Limiter.cpp
#include <algorithm> #include <math.h> #include <unistd.h> #include "FlowGraphNode.h" #include "Limiter.h" using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; Limiter::Limiter(int32_t channelCount) : FlowGraphFilter(channelCount) { } int32_t Limiter::onProcess(int32_t numFrames) { const float *inputBuf...
ALGO
0.991009
5.862957
42723e26-9b3c-4ecb-b155-1af2fc8104fa
isha141/LeetCode
Distance from the Source (Bellman-Ford Algorithm) - GFG/distance-from-the-source-bellman-ford-algorithm.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: /* Function to implement Bellman Ford * edges: vector of vectors which represents the graph * S: source vertex to start traversing graph with * ...
ALGO
0.999847
5.754473
952d7dd5-2c66-4046-8dde-b90c01c96887
Johniel/contests
codeforces/566div2/C/main.cpp
// codeforces/566div2/C/main.cpp // author: @___Johniel // github: https://github.com/johniel/ #include <bits/stdc++.h> #define each(i, c) for (auto& i : c) #define unless(cond) if (!(cond)) using namespace std; typedef long long int lli; typedef unsigned long long ull; typedef complex<double> point; template<type...
ALGO
0.999275
4.133168
4ea7e441-549d-4199-b258-c25887656b3d
yanisa24414/TomatoCare
myapp/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.9985
6.771107
67e6ebf0-4cf0-44a5-ac0b-7ba8db693b45
ron2015schmitt/coildes
oldsrc/current2flux.cpp
/************************************************************************* * * File Name : coilfwd2.cpp * Platform : gnu C++ compiler * Author : Ron Schmitt * Date : 16 May 2003 * * * SYNOPSIS * This file finds the plasma surface flux for a given coil current. * ...
ALGO
0.993458
3.802716
746009af-3203-4347-a5c0-8c851dfcfffa
sinian666/codes_41_13
cpp_副本4/chapter_stack_and_queue/linkedlist_deque.cpp
/** * File: linkedlist_deque.cpp * Created Time: 2023-03-02 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 双向链表节点 */ struct DoublyListNode { int val; // 节点值 DoublyListNode *next; // 后继节点指针 DoublyListNode *prev; // 前驱节点指针 DoublyListNode(int val) : val(val), prev(nullp...
ALGO
0.998965
5.943526
1afa68b7-13eb-4425-bc3e-9926ac278349
squaresLab/BatFix
results/transcoder/results/python/syntax/FIND_SUM_EVEN_INDEX_BINOMIAL_COEFFICIENTS.cpp
#include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include <vector> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <numeric> #include <algorithm> using namespace std; int f_gold ( int n ) { int C [ n + 1 ] [ n + 1...
ALGO
0.999969
5.744323
834c061f-271c-4d7f-a482-242b6f06179e
bae-sh/BOJ
16566/16566/16566.cpp
#include<iostream> #include<algorithm> #include<vector> using namespace std; int N, M, K; vector<int> v; vector<bool> checked; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> N >> M >> K; for (int i = 0; i < M; i++) { int x; cin >> x; v.push_back(x); checked.push_back(false); } sor...
ALGO
0.999997
3.823474
ca64748e-1c47-452e-907c-a950acc261e2
interkomon/pract4_sp
pract4/pract4/pract4.cpp
// pract4.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. // #include <iostream> #include <conio.h> #include <stdio.h> int main() { setlocale(LC_ALL, "RUS"); std::cout << "Hello World!\n"; float x, y; FILE* file; if (fopen_s(&file, "coordin...
TOOL
0.957555
3.083745
29a3a0e6-7ef5-4305-a41e-d72759d6c800
SouvikChan/-Leetcode_Souvik
728-self-dividing-numbers/728-self-dividing-numbers.cpp
class Solution { public: vector<int> selfDividingNumbers(int left, int right) { vector<int>v; for(int i=left;i<=right;i++){ int temp=i; while(temp>0){ int left=temp%10; if(left==0||i%left!=0){ break; } ...
ALGO
0.999889
5.477496
eaa63982-08c4-4865-a3bd-53fb3c9cb129
tush27/Solved-DSA-problems
1140-stone-game-ii/1140-stone-game-ii.cpp
class Solution { public: int stoneGameII(vector<int>& piles) { int length = piles.size(); vector<vector<int>>dp(length + 1, vector<int>(length + 1,0)); vector<int> sufsum (length + 1, 0); for (int i = length - 1; i >= 0; i--) { sufsum[i] = sufsum[i + 1] + piles[i]; ...
ALGO
0.999727
4.9348
c86bcec0-57cd-4c1b-b499-5ac6711ec87d
Kourin1996/CompetitiveProgramming
AtCoderProblems/ARC/055/a.cpp
#include <iostream> int N = 0; int main(void){ std::cin >> N; std::cout << '1' << std::string(N-1, '0') << '7' << std::endl; }
ALGO
0.999387
3.76041
b7a08e21-d568-49f1-a63a-34f01c0b24fe
BriannaBalamV/prog_example
multidimensionalArrays.cpp
/* Multidimensional arrays*/ #include <iostream> #include <stdio.h> using namespace std; int main(){ //Declare de matix int x[3][3][4] = { { {0,1,2,3}, {4,5,6,7}, {8,9,10,11} }, { {12,13,14,15}, {16,17,18,19}, {20,21,22,23} }, { {24,25,26,27}, {28,29,30,31}, {32,33,34,35} } }; //Print each eleme...
ALGO
0.954168
3.443737
018f36ce-c2a4-4dea-bc42-eff9b80d4133
Rohit312003/My-code
graph/graph.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long vector<int> graph[1000]; bool visited[1000]; void dfs(int vertex) { visited[vertex] = true; for (int child : graph[vertex]) { cout << vertex << " child " << child << endl; if (visited[child]) continue; d...
ALGO
0.999983
4.638516
d6f8b36e-4d41-405e-97c4-33611da61a3b
Amanraj0149/Decode-c---with-dsa
Day3 Pattern PRINTING/assignment1.cpp
// #include<iostream> // using namespace std; // int main(){ // int n; // cout<<"enter the number:"; // cin>>n; // for(int i=1;i<=n;i++){ // for(int j=1;j<=n;j++){ // cout<<i; // } // cout<<endl; // } // } // #include<iostream> // using namespace std; // int main(){ // int n; ...
ALGO
0.994753
3.098131
ae224058-33c8-46a7-bdb9-7fb641e4bc63
saarang123/Competitive-Programming
codeforces/1360D.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; // ----------------------------------------Defines and Template-------------------------------------// //#define int long long #define ll long long #define double long ...
ALGO
0.999916
4.823468
b3f9b51c-e7d0-4b8d-9928-ca972b6fc5f9
dx404/LeetCode
median-of-two-sorted-arrays.cpp
#define A(i) (((i) < 0) ? numeric_limits<int>::min() : ((i) < m) ? A[i] : numeric_limits<int>::max()) #define B(i) (((i) < 0) ? numeric_limits<int>::min() : ((i) < n) ? B[i] : numeric_limits<int>::max()) class Solution{ public: int *A, *B; double findMedianSortedArrays(int A[], int m, int B[], int n) { ...
ALGO
0.999987
5.465467
af2b2a77-d37b-4cc7-9706-032e127fa3b1
DarkmoonCore/DarkmoonCore-Cataclysm
src/tools/extractor/StormLib/src/adpcm/adpcm.cpp
/*****************************************************************************/ /*---------------------------------------------------------------------------*/ /* This module contains implementation of adpcm decompression method used by */ /* Storm.dll to decompress WAVE files. Thanks to Tom Amigo for releasing */...
ALGO
0.943929
3.316455
50679b1b-0465-49e9-9de0-83cac9cbf51b
easyhooon/BOJ_CODES
bipartite_matching.cpp
#include <iostream> #include <vector> #define MAX 101 using namespace std; vector<int> a[MAX]; int d[MAX]; // Ư ϰմ(ϰִ) bool c[MAX]; // ó int n = 3, m, s; // Ī True, False bool dfs(int x) { // 忡 ؼ  ִ õ for (int i = 0; i < a[x].size(); i++) { int t = a[x][i]; //̹ ó ̻ ʿ䰡 if (c[t]) continue; c[t...
ALGO
0.999908
3.769555
31eef650-23ce-4482-add3-26f002d486f4
nengshanty/Tugas_eLearning_Pertemuan7
Latihan_array3.cpp
#include <iostream> using namespace std; int main (){ string nama1, nama2, nama3; cin>>nama1; cin>>nama2; cin>>nama3; cout << nama1<<"-"<<nama2<<endl; cout << nama2<<"-"<<nama3<<endl; cout << nama3<<"-"<<nama1<<endl; return 0; }
ALGO
0.999069
3.101935
489d884e-2577-464b-9d97-205341840353
18-RAJAT/ONLINE-JUDGE
A_Almost_Prime.cpp
#include<bits/stdc++.h> using namespace std; #define int long long void sol() { int n; cin>>n; int count=0; for(int i=1;i<=n;++i) { int tmp=i; set<int>st; for(int j=2;j<=i;++j) { while(tmp%j==0) { st.insert(j); t...
ALGO
0.999636
5.032897
0c25d37b-6c7d-45c4-879c-da0532a818cc
athul2002/DSA
Bit Magic/countsetbit.cpp
#include<iostream> using namespace std; // int main() // { // int n; // cin>>n; // int ans=0; // while(n>0) // { // if(n&1==1) // { // ans++; // } // n=n>>1; // } // cout<<ans; // } int main() { int n; cin>>n; int ans=0; while(n>0) ...
ALGO
0.999915
4.652498
1196ae51-32c9-46bc-8df1-db020eb1ee7a
KangwonDo1209/PS_Code
BaekJoon/C++/자료구조/1927.cpp
#include <iostream> #include <algorithm> #include <queue> #include <vector> using namespace std; int main() { ios_base::sync_with_stdio(false); cout.tie(0); cin.tie(0); priority_queue<int, vector<int>, greater<int>> minQ; int n, item, item2; cin >> n; while (n--) { cin >> item; if (item)minQ.push(item); ...
ALGO
0.999915
4.080821
d21922ce-35ca-4f7e-aba2-bdb7aab79b82
SinestroWhite/Introduction-To-Programming
resources/solutions/vector/task04-2.cpp
#include <iostream> #include <vector> int main() { std::vector<int> arr1 = {1, 5, 1, 2, 1, 10, 23, 81, 0, 2, 6, 1, 8, 23, 1}; std::vector<int> arr2; for (int i = 0; i < arr1.size() - 1; i++) { for (int j = i + 1; j < arr1.size(); j++) { if (arr1[i] > arr1[j]) { int tmp ...
ALGO
0.999998
5.350784
a958affa-004c-43d0-83d1-119f610a1058
vanhhn/Data_Structures_and_Algorithms_Code_PTIT
CON6_12.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 int main() { int t; cin >> t; while (t--) { int n,k; cin>>n>>k; int a[n]; for(int &x:a)cin>>x; sort(a,a+n,greater<int>()); for(int i=0;i<k;i++){ cout<<a[i]<<" "; } ...
ALGO
0.99992
3.708225
6ccc616e-82f7-4578-839d-344c1dc45f96
fyshg/competitive-programming
Woche3/c.cpp
#include <iostream> #include <vector> using namespace std; typedef long long ll; struct segment_tree { segment_tree *left, *right; int from, to, value; bool isZero; segment_tree(int from, int to) : from(from), to(to), left(NULL), right(NULL), value(0), isZero(false) { } }; segment_tree* build(const vector<ll> &...
ALGO
0.998149
3.69787
20707a6d-4930-4a49-96be-5346f4fdac67
Aryanlanghanoja/NBS_Training
09-20-2024 Linked List Functions/Day_At_1_st_Jan.cpp
#include<bits/stdc++.h> using namespace std; int main() { int year; cout << "Enter The Year :- "; cin >> year; year--; int idx = (year + (year / 4)) % 7; string days[7] = { "Sunday" ,"Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday" }; cout << "At 1st Januarty " <...
ALGO
0.999707
3.934174
333a532c-8227-489f-b1a4-80d0735a1832
eaulisa/MyFEMuS
applications/PCFieldSplit/ex40/ex40.cpp
/** \file Ex11.cpp * \brief This example shows how to set and solve the weak form * of the Boussinesq appoximation of the Navier-Stokes Equation * * \f{eqnarray*} * && \mathbf{V} \cdot \nabla T - \nabla \cdot\alpha \nabla T = 0 \\ * && \mathbf{V} \cdot \nabla \mathbf{V} - \nabla \cdot \nu (\nabla \mathbf{V}...
ALGO
0.999861
4.261807
95ef8b2b-cb65-470f-92aa-124f90214313
taawraat/codeforces
1385B - Restore the Permutation by Merger.cpp
#include <bits/stdc++.h> using namespace std; int main() { short int T; cin >> T; while(T--) { bool exists[100] = {}; short int n; cin >> n; n = 2*n; while(n--) { short int num; cin >> num; if(!exists[num]){ cout << num << ' '; exists[num] = true; } ...
ALGO
0.999527
3.886188
93cdfb56-83ac-43c4-a36f-ec0449690ff8
PSUCompBio/compbio
third-party-libs/eigen3/unsupported/test/NumericalDiff.cpp
#include <stdio.h> #include "main.h" #include <unsupported/Eigen/NumericalDiff> // Generic functor template<typename _Scalar, int NX=Dynamic, int NY=Dynamic> struct Functor { typedef _Scalar Scalar; enum { InputsAtCompileTime = NX, ValuesAtCompileTime = NY }; typedef Matrix<Scalar,InputsAtCompileT...
TEST
0.958013
6.193336
936bc8d8-f35d-4f4f-bd03-86e108d5901b
PappAZsolt/CodeForces-Solutions
Contests/Round950/D.cpp
#include <iostream> #include <numeric> #include <vector> using namespace std; bool isNonDecreasing(const vector<int> &b) { for (int i = 1; i < b.size(); ++i) { if (b[i] < b[i - 1]) { return false; } } return true; } void solve() { int t; cin >> t; while (t--) { int n; cin >> ...
ALGO
0.999988
4.455714
54672ed3-fe6c-47e6-90cc-f0fcc52861d2
ShivamBajpai04/OOPs_Class
Max_Triple_Prod.cpp
//Max product of 3 int in an array //INT_MIN<arr[i]<INT_MAX //#solved #include <iostream> #include <bits/stdc++.h> using namespace std; int main(){ //Sorting O(nLog(n)) int n; cin>>n; int arr[n]; for(int i = 0;i<n;i++){ if (n < 3){ cout<< -1; break; } ...
ALGO
0.99995
4.426021
2dfcf675-b531-4592-a10a-e2f3e896c110
Rahulbudhiraja25/Java-Learning-DSA
Basic Programming/Programming/Data Structure And Algorithms/Rectangle_pttern.cpp
#include <iostream> using namespace std; int main() { int r, c; cout << "Enter the number of rows\n"; cin >> r; cout << "Enter the number of coloums\n"; cin >> c; for(int j=1;j<=r;j++){ for(int i=1;i<=c;i++){ cout<<"*"; } cout<<endl; } return 0; }
ALGO
0.984615
3.728996
991213d2-8441-4866-86ea-58d9f507ff96
maxime-tournier/meuh
tool/trajectory.cpp
#include "trajectory.h" #include <math/func/vector.h> #include <core/stl.h> #include <math/func/interp.h> #include <algorithm> #include <core/string.h> #include <gl/common.h> namespace tool { namespace impl { template<class Key, class Data> static Data interp_linear(const std::map<Key, Data>& map, math:...
ALGO
0.994903
5.684371
64582ba6-9ba4-4416-825d-ab7df54cafb8
emanueljuliano/Competitive_Programming
topics/matemagica/fastPow.cpp
// Exponenciacao rapida // // (x^y mod m) em O(log(y)) typedef long long int ll; ll pow(ll x, ll y, ll m) { // iterativo ll ret = 1; while (y) { if (y & 1) ret = (ret * x) % m; y >>= 1; x = (x * x) % m; } return ret; } ll pow(ll x, ll y, ll m) { // recursivo if (!y) return 1; ll ans = pow(x*x, y/2, m); ...
ALGO
0.999933
5.323802
3bfbd5af-febd-43e7-bda6-df2dba6ab059
vichua2006/Competitive_Programming_Cpp
USACO/Silver/USACO 2018 January Contest, Silver Problem 1. Lifeguards.cpp
/* the only time that will be lost when a lifeguard is fired is the time that the lifeguard spent working alone sort all the starting and ending points of the lifeguards shift, and then iterate through them for each lifeguard, compute the amount of time it spends working alone, and then take the minimum of that value ...
ALGO
0.999335
4.368459
f5d72bb3-eff6-4c1c-9c4c-6bcde0bab76c
mayankkaushik187/AlgoViser
Heap/Minimize Deviation in Array.cpp
class Solution { public: int minimumDeviation(vector<int>& nums) { priority_queue<int> pq;//maxheap int maxm = INT_MIN; int minm = INT_MAX; for(int i = 0 ; i < int(nums.size()) ; i++){ nums[i] = nums[i] & 1 ? nums[i] * 2 : nums[i]; maxm = max(maxm,num...
ALGO
0.999949
5.415181
cdb23d17-fa99-495e-93a4-95215bcca2f1
lalor/leetcode
chenhao/algorithms/numberOfIslands/NumberOfIslands.cpp
// Source : https://leetcode.com/problems/number-of-islands/ // Author : Hao Chen // Date : 2015-06-08 /********************************************************************************** * * Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. * An island is surrounded by water and...
ALGO
0.999948
5.972617