uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
253cf626-d3a7-4090-b0ea-7a456cf69ff9
ihelshal/CarND-Path-Planning-Project
src/Eigen-3.3/doc/special_examples/Tutorial_sparse_example.cpp
#include <Eigen/Sparse> #include <vector> typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double typedef Eigen::Triplet<double> T; void buildProblem(std::vector<T>& coefficients, Eigen::VectorXd& b, int n); void saveAsBitmap(const Eigen::VectorXd& x, int n, const char* file...
ALGO
0.993504
5.429372
66c029ca-2ba1-4477-8b04-3ec4887b038a
zatursure/yuji
垃圾装袋.cpp
#include <bits/stdc++.h> using namespace std; int a[1145140]; multiset<int> b; int main(){ int n,m,x=0,em=0; scanf("%d %d",&n,&m); for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=1;i<=m;i++){scanf("%d",&x);b.insert(x);} for(int i=1;i<=n;i++){ auto w= lower_bound(b.begin(),b.end(),a[i]); ...
ALGO
0.999971
3.312751
61004c66-04e0-4e96-b8e4-da5fd4489f6e
maxrenke/gppc-2015
scripts/gppc-2014/entries/Rabin_AStarEntry/BucketPriorityQueue.cpp
#include "BucketPriorityQueue.h" #include "UnsortedPriorityQueue.h" BucketPriorityQueue::BucketPriorityQueue() { Reset(); m_bin = new UnsortedPriorityQueue*[NUM_BUCKETS]; for (int m = 0; m < NUM_BUCKETS; m++) { m_bin[m] = new UnsortedPriorityQueue(); } } BucketPriorityQueue::~BucketPriorityQueue() { } void Bu...
ALGO
0.998107
4.940525
bca27069-5ee2-4867-b0f0-2e4473101e5b
tokotoko9981/AtCoder
ABC/ABC228/B.cpp
#include <bits/stdc++.h> using namespace std; using vi = vector<int>; using vii = vector<vector<int>>; using vc = vector<char>; using vcc = vector<vector<char>>; using vs = vector<string>; using ll = long long; #define rep(i, n) for (ll i = 0; i < (n); i++) #define all(x) x.begin(), x.end() #define FI first #define SE...
ALGO
0.99988
3.638763
87121f14-aefb-44a5-bd4a-040620c02a0f
hanyuelaoda/leetcode
file/位运算/根据数字的二进制下 1 的数目排.cpp
class Solution { public: vector<int> sortByBits(vector<int>& arr) { sort(arr.begin(), arr.end(),compare()); return arr; } struct compare { bool operator()(int lhs, int rhs) { int l = bitcount(lhs); int r = bitcount(rhs); if (l > r) { return false; } else if (l == r) { if (lhs >...
ALGO
0.999982
5.589146
0ecb236a-3962-49b2-b863-6ef450d5daf5
zecht12/C
.history/220103092_Binary Search_20230316112046.cpp
#include<iostream.h> #include<conio.h> main() { int Nilai[20]; int Posisi[20]; int i, N, Bilangan, Banyak=0; bool ketemu; cout<<"Masukkan Banyaknya Bilangan = "; cin>>N; cout<<endl; //Membaca elemen Array for(i=0; i<N; i++) { cout<<"Masukkan elemen ke-"<<i<<" = "; cin>>Nilai[i]; } ...
ALGO
0.999203
3.588998
a02cd7b1-46c1-41d0-b163-479c5a792a90
showmic96/Online-Judge-Solution
LightOJ/1215/11797402_AC_0ms_0kB.cpp
// In the name of Allah the Lord of the Worlds. #include<bits/stdc++.h> using namespace std; typedef long long ll; ll lcm(ll a , ll b) { ll gcd = __gcd(a , b); return (a*b)/gcd; } int main(void) { int t , c = 0; scanf("%d",&t); while(t--){ ll a , b , l; scanf("%lld %lld %lld"...
ALGO
0.999825
4.323059
05cfaf7c-e974-4938-9d2e-9421b6729d97
ProdanRaduMatei/Probleme-Pbinfo
Solutions/Bile2/main.cpp
#include <fstream> using namespace std; ifstream fin("bile2.in"); ofstream fout("bile2.out"); int n, m, h, k, x, t; struct { int height; int constanta; } v[100001]; void solve() { int anterior = v[x].height; k = v[x].constanta; h = v[x].height; bool show = 0; int temp = 0; if (h - t ...
ALGO
0.999964
3.754977
57a2815c-6054-4c4d-bdf6-3fe85aa75f76
CarbonROM/android_external_icu
icu4c/source/common/propsvec.cpp
#include <stdlib.h> #include "unicode/utypes.h" #include "cmemory.h" #include "utrie.h" #include "utrie2.h" #include "uarrsort.h" #include "propsvec.h" #include "uassert.h" struct UPropsVectors { uint32_t *v; int32_t columns; /* number of columns, plus two for start & limit values */ int32_t maxRows; ...
TOOL
0.992224
6.298489
078a75c1-0a86-4fdd-b7a2-db77e44ede9f
agentlans/libnumarray
Templates/RealGetterSetter.cpp
// No bounds checking `'TTYPE`' nar_`'VECTORTYPE`'_get(nar_`'VECTORTYPE`' v, int i) { return (*v)[i]; } void nar_`'VECTORTYPE`'_set(nar_`'VECTORTYPE`' v, int i, `'TTYPE`' x) { (*v)[i] = x; } `'TTYPE`' nar_`'MATRIXTYPE`'_get(nar_`'MATRIXTYPE`' mat, int i, int j) { return (*mat)(i,j); } void nar_`'MATRIXTY...
ALGO
0.90745
5.952216
b3bf3c6e-d95e-4884-9ad2-aa07e3c5eefc
yash2723/Codechef
Starters 51 Division 2 (Rated)/Split_N.cpp
#include <bits/stdc++.h> using namespace std; #define PI 3.141592653589793 #define FAST ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define ll long long int #define vi vector <int> #define vll vector < ll > #define pb push_back #define endl '\n' #define max3(a,b,c) max(max(a,b),c) #define min3(a,b,c) min(m...
ALGO
0.99773
4.387144
d1e8c1f9-dbf0-45e5-a0b2-73b32bfb68fd
Routing-Problems-in-Green-Logistic/ENIAC23_2E_EVRP_TW
src/CONSTRUTIVO/Construtivo2.cpp
/* **************************************** * **************************************** * Nome: *********************** * Data: 13/12/22 * Arquivo: Construtivo2.cpp * **************************************** * ****************************************/ #include "Construtivo2.h" #include "../mersenne-twister....
ALGO
0.998033
4.540679
cfe5b50e-eed0-4daf-b77a-817e77bf2d94
Hamdanaleem/pd-6
task2cp.cpp
#include<iostream> using namespace std; float calculateAverage(float marksEnglish, float marksMaths, float marksChemistry, float marksSocialScience, float marksBiology); string calculateGrade(float average); main() { string name; float marksEnglish, marksMaths, marksChemistry, marksSocialScience, marksBiology; cout...
TOOL
0.901442
4.328966
15aeb9b4-1a95-4905-96ca-91b6c9fc5c69
23f2002007/leetcode
solution/0100-0199/0137.Single Number II/Solution.cpp
class Solution { public: int singleNumber(vector<int>& nums) { int ans = 0; for (int i = 0; i < 32; ++i) { int cnt = 0; for (int num : nums) { cnt += ((num >> i) & 1); } cnt %= 3; ans |= cnt << i; } return an...
ALGO
0.999961
5.62976
f003254a-c57f-4089-9f13-1d04dbeb53d6
dogdie233/ACM
nowcoder/81605/F.cpp
#include <iostream> #include <vector> #include <numeric> using namespace std; int n; struct Point { int x, y; Point() : x(0), y(0) {} Point(int x, int y) : x(x), y(y) {} operator size_t() const // ToIndex { return y * n + x; } Point operator+(const Point &other) const { ...
ALGO
0.999853
3.619539
1dcb0636-88e4-4a0d-b9dd-0edd0f557449
Pankajn19/CP-Solutions
CodeForces/GNU C++14/1697B | Promo/166616231.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int main() { int n, q; cin >> n >> q; int p[n]; vector<long long> maxval(n + 1, 0); for (int i = 0; i < n; i++) { cin >> p[i]; } int query[q][2]; for (int i = 0; i < q; i++) ...
ALGO
0.999921
3.782099
f2fb2502-13e1-42b6-a4ae-875390e7ba7c
wazedrifat/Vjudge
CodeChef/INTEST/11823098_AC_140ms_15257kB.cpp
//wazed rifat #include<bits/stdc++.h> using namespace std; #define LLI long long int LLI i,j,n,test,sum,ans,cnt,t,k,x; int main( ) { ios_base::sync_with_stdio(0); cin.tie(0); // freopen("input1.txt","r",stdin); cin>>n>>k; for(i=0 ; i<n ; i++) { cin>>x; if(x%k==0) cnt++; } cout<<cnt; }
ALGO
0.999916
3.485655
f46cf1a1-b20b-4ecd-b48b-7e36adebe7bd
Hemanthsai18/6Companies30Days
Goldman/DecodeTheString.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: string decodedString(string s){ stack<char> st; for (int i = 0; i < s.length(); i++) { if (s[i] == ']') { ...
ALGO
0.997886
5.969297
243738d6-4d45-4453-b993-cbee35b6ce83
HONGYANGGAN/leetcode
solution/2400-2499/2414.Length of the Longest Alphabetical Continuous Substring/Solution.cpp
class Solution { public: int longestContinuousSubstring(string s) { int ans = 0; int i = 0, j = 1; for (; j < s.size(); ++j) { ans = max(ans, j - i); if (s[j] - s[j - 1] != 1) { i = j; } } ans = max(ans, j - i); retu...
ALGO
0.999966
5.816013
45509a7e-b9f8-49ad-bcf7-81dc8f547035
a-ma-n/Leetcode-Solutions
226-invert-binary-tree/226-invert-binary-tree.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.999995
6.258795
084459db-4344-4f90-909e-91dae1df2162
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/CodeLlama/top0-100/minimum-operations-to-convert-number-Solution.minimumOperations/177887_DoS_Overflow.cpp
gs_heap_alloc_bytes(gs_memory_t * mem, uint size, client_name_t cname) { gs_malloc_memory_t *mmem = (gs_malloc_memory_t *) mem; byte *ptr = 0; #ifdef DEBUG const char *msg; static const char *const ok_msg = "OK"; # define set_msg(str) (msg = (str)) #else # define set_msg(str) DO_NOTHING #endif ...
ALGO
0.999492
5.750543
40c6f406-1f39-4a3c-94bd-0139c78c7bf6
amaan8302/gfg
Difficulty: Medium/Clone an Undirected Graph/clone-an-undirected-graph.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> #include <sstream> using namespace std; struct Node { int val; vector<Node*> neighbors; Node() { val = 0; neighbors = vector<Node*>(); } Node(int _val) { val = _val; neighbors = vector<Nod...
ALGO
0.99973
6.345879
01c8b77f-d468-4dc0-993c-f1e91dab2986
ishandutta2007/codeforces
elegia/normal/1110/D.cpp
#include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <ctime> #include <cctype> #include <algorithm> #include <functional> #include <set> #include <map> #include <vector> #include <iostream> #include <limits> #include <numeric> #define LOG(FMT...) fprintf(stderr, FMT) using namespace std;...
ALGO
0.999904
3.362771
a9d6b735-3565-4d26-a6ea-2f8483c75871
kedixa/LeetCode
C++/11.cpp
class Solution { public: int maxArea(vector<int>& height) { int max_area = 0; int s = 0, t = height.size() - 1; while(s < t) { max_area = max(max_area, (t - s) * min(height[s], height[t])); if(height[s] <= height[t]) ++s; else --t; } ...
ALGO
0.999948
6.735595
4ed7d3ba-be5a-49b3-be1f-ba898b1ade29
BovenPeng/LightGBM-GPU-Compiled-Source
LightGBM/compute/perf/perf_partition_point.cpp
#include <algorithm> #include <iostream> #include <numeric> #include <vector> #include <boost/compute/system.hpp> #include <boost/compute/lambda.hpp> #include <boost/compute/algorithm/partition.hpp> #include <boost/compute/algorithm/partition_point.hpp> #include <boost/compute/container/vector.hpp> #include "perf.hpp...
ALGO
0.990103
5.860407
85940e96-eb6a-4eee-b9e2-03a4abc10cb4
ishandutta2007/codeforces
nikolapesic2802/normal/1144/C.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> #define ll long long #define pb push_back #define sz(x) (int)(x).size() #define mp make_pair #define f first #define s second #define all(x) x.begin(), x.end() #define D(x) cerr << #x << " is " <<...
ALGO
0.999984
3.425619
945990e0-14a3-4942-9a46-9e303e5f871f
ChiragRathod25/DSA
2CP06 DSA/Hari ADIT material/4_Singly_LL.cpp
#include<iostream> using namespace std; class Node { public: int data; // Declare an integer data field for the node. Node* next; // Declare a pointer to the next node in the linked list. Node() { this->data = 0; // Default constructor: Initialize data to 0. this->next = NULL;...
ALGO
0.999888
5.487979
8f5a71f3-8876-4633-9e7c-af5e9a873357
yousuf7902/CF_Auto_Generate
codeforces/1741/C.cpp
// Problem: C. Minimize the Thickness // Contest: Codeforces - Codeforces Round #826 (Div. 3) // URL: https://codeforces.com/problemset/problem/1741/C?fbclid=IwAR2puHW2YwdB2rsovc93mzZF4jMIHXMwnUGHInzie2hncKixPNxu455bofA // Memory Limit: 256 MB // Time Limit: 2000 ms //~"~"~"~"~"~"~"~"~"~"~"~"~ ♥ B I S M I L L A H I R...
ALGO
0.999954
5.233871
c40c5f04-f803-41d1-8ad0-1a7f7ecc4099
mariant21/Pbc
speedlimit-kattis/Source.cpp
//https://open.kattis.com/problems/speedlimit #include <iostream> using namespace std; int main() { int n, s, t, t1, d; cin >> n; while (n != -1){ t1 = 0; d = 0; for (int i = 1; i <= n; i++) { cin >> s >> t ; t1 = t - t1; d = d + s * t1; t1 = t; } cout << d << " miles" << endl; cin...
ALGO
0.993395
3.702049
ca0af683-c74d-4fe3-ab92-0ae72e26e087
redcpp/Competitive-Programming
codejam/2017/1C/A/A.cpp
#include <bits/stdc++.h> using namespace std; #define PB push_back typedef long long ll; typedef long double ld; const ll INF = ll(1e18); ll T, N, M, K; struct Node { ld R; ld H; } ; bool operator >(const Node& x, const Node& y) { return x.R * x.H > y.R * y.H; } ld calculate(auto& arr, int x) { ld an...
ALGO
0.999865
4.039145
99e210e2-5a5c-49bf-85d2-a95ee1833a67
efeslab/nvm-file-indexing
api/p-hot/boost_1_73_0/libs/geometry/doc/src/examples/algorithms/simplify_insert.cpp
// Boost.Geometry (aka GGL, Generic Geometry Library) // QuickBook Example //[simplify_inserter //` Simplify a linestring using a back inserter #include <iostream> #include <boost/geometry.hpp> #include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/geometries/point_xy.hpp> int main() { typ...
ALGO
0.997855
7.537558
c04e8b67-6b4d-4ae4-9ec7-5696b87ab301
jhonatangopereira/LearningCpp
Libraries/cstdlib_2.cpp
#include <cstdlib> #include <iostream> using namespace std; void end(void); int sort(const void *a, const void *b); int main(void) { // getenv() - get environments variables and returns in a pointer const char *ptrPath = getenv("PATH"); cout << ptrPath << endl; int array[] {9, 1, 8, 7, 3, 6, 0, 5, 4}; in...
ALGO
0.99631
3.51424
e2bd9a40-d4d6-4ca9-ae78-781f51788648
Nobles3689/practice
20230814_1_#15650.cpp
//Beakjoon Online Judge #15650 #include <iostream> #include <vector> #include <algorithm> using namespace std; vector<int> list; vector<int> tmp; /* int com(int n, int r){ if(n==r || r == 0) return 1; else return com(n-1, r-1) + com(n-1, r); } */ void com(int n, int m){ for(int i = 0; i<m; i++) tmp.em...
ALGO
0.999942
3.670824
0c8540e9-0848-4f98-894f-15320780b690
davidinfante/Metodologia-Programacion
Practica 4/Ejercicio7/src/Precuencias.cpp
#include "Precuencias.h" //Constructor por defecto y con parametros Precuencias::Precuencias(int npares){ this->npares = npares; parejas = new Pareja[npares]; Pareja par; for (int i = 0; i < npares; ++i) parejas[i] = par; } //Constructor de copia Precuencias::Precuencias(const Precuencias & otra){ ...
ALGO
0.89712
3.370355
89cb5f5e-2fc7-4691-a6cf-ded64e53e964
kmjp/procon
csacademy/041-060/043/d.cpp
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZER...
ALGO
0.999947
3.529604
33cccc02-47b4-4c61-8009-f9ec4ee86cdf
DamianZawolski/SDiZO-Projekt-2
Prim.cpp
#include "Prim.h" #include <iostream> #include <fstream> using namespace std; // Algorytm Prima void prim(int** graf, int rozmiar, int start) { // Zmienne pomocnicze int* dystans = new int[rozmiar]; int* rodzic = new int[rozmiar]; bool* odwiedzone = new bool[rozmiar]; // Inicjalizacja for (in...
ALGO
0.999545
4.277932
f7062829-ae23-4f97-b26e-34e447c1722c
brkdnmz/advent-of-code
2024/day18/day18-1.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 71; int main() { freopen("day18-modified.txt", "r", stdin); vector<vector<bool>> g(N, vector<bool>(N)); int cnt = 1024; while (cnt--) { int x, y; cin >> y >> x; g[x][y] = 1; } queue<array<...
ALGO
0.999586
4.627545
16f07348-d584-405b-ba41-be457a5dfe94
Akash-Raj-ST/Competitive-Programming
others/code_wednesday_3.cpp
#include <iostream> #include <vector> #include <algorithm> #include <map> #include <queue> #define ll long long int using namespace std; const ll M=1e9+7; int dim_size(int f_r,int l_r,int f_c,int l_c){ return (l_r-f_r)*(l_c-f_c); } int arr_sum(vector<vector<int>> arr,int f_r,int l_r,int f_c,int l_c){ int s...
ALGO
0.999554
4.760336
ee95b202-7196-4f82-9523-a97f84dd38e0
Tech-Lksh/DSA-Placement-Preparation-Question
1_Array Question/8_ Find Union and Intersection of two arrays/Hello.cpp
#include<iostream> using namespace std; int findIntersection(int arr1[], int arr2[], int size) { for(int i=0; i<size; i++) { for(int j=0; j<size; j++) { if(arr1[i] == arr2[j]) { cout << arr1[i] << " "; } } } } int main () { int arr1[] = {2,3,4,5,6,7}...
ALGO
0.999582
4.446021
b3d4e3b5-ad3f-4c20-93c0-eaa3886453db
Cgfyufsygsm/OI-Codes
Luogu/P1313.cpp
#include <cstdio> #include <cctype> #define il inline #define FOR(i, a, b) for (int i = (a); i <= (b); ++i) #define DEC(i, a, b) for (int i = (a); i >= (b); --i) namespace fastIO { const int maxc = 1 << 23; char ibuf[maxc], *__p1 = ibuf, *__p2 = ibuf; il char getchar() {return __p1 == __p2 && (__p2 = (__p1 = ibuf) + f...
ALGO
0.99997
4.052997
49584de6-e710-42f4-96c7-fb40c7f98e89
abduljalilmaulani/uts-dasar-pemrograman
bab3/notasi matematika dalam ekspresi.cpp
#include <iostream> #include <cmath> using namespace std; int main() { double sudut = 40; double kecepatan = 32; double radian = sudut * 3.14 / 100; double jarak = 2 * kecepatan * kecepatan * sin(radian) * cos(radian) / 9.8; cout << "Jarak = " << j...
ALGO
0.999112
3.472401
f310fc93-9ed8-4812-92d1-ebeceed88cdd
iliyian/LuoguOJ
OfficialTrainings/T115/P1918/main.cpp
#include <bits/stdc++.h> using namespace std; set<int> s; map<int, int> id; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { int x; cin >> x; s.insert(x); id[x] = i; } int q; cin >> q; for (int i = 0; i < q; i++) { int m; cin >> m; if (!s.count(m)) cout << "0\n"; ...
ALGO
0.999914
4.530592
fcca21b2-0292-4f36-8e3c-8cac464070f8
Adamya-Kumar/data-structures-and-algorithms
0189-rotate-array/0189-rotate-array.cpp
class Solution { public: void rotate(vector<int>& nums, int k) { int n=nums.size(); k=k%n; int l=0,r=n-1; while(l<r){ int temp = nums[l]; nums[l] = nums[r]; nums[r] = temp; l++; r--; } l=0,r=k-1; while(l<r){ ...
ALGO
0.999995
5.737397
a4b81ddf-9d40-488b-9bf9-7c3eaf1fbb7c
ShiraiLab/Cpp2017
W07/W07Q2.cpp
/* pvO~OA 7 z ۑ2FIuWFNgz̏ */ #include<iostream> using namespace std; class Coord { double x, y, z; public : Coord(double s, double t, double u) { x = s; y = t; z = u; } //̃o͊܂I }; int main() { Coord ob[4] = { Coord(1,2,3), Coord(4,5,6), Coord(7,8,9), Coord(-1,-2,-3) }; return 0; }
TOOL
0.860989
3.141102
5b379967-dbd6-4f43-abb1-8bba6f36d8b5
karenhuaman/semana05
ejercicio1.cpp
#include <iostream> using namespace std; int main () { int var = 50; cin >> var; int total = 0; for (int i = 0; i<=var; i++) { total = total + i; } cout << "suma: " << total << endl; return 0; }
ALGO
0.993201
3.807889
683513ba-6abe-4733-8d76-eb3e72fad321
Yili-code/LeetCode-CPP-Optimal-Solutions
medium/0045-Jump-Game-II/solution.cpp
class Solution { public: int jump(vector<int> &nums) { int jumps = 0; // Minimum number of jumps int end = 0; // The farthest position reachable by the current jump int farthest = 0; // The farthest position reachable by the next jump for (int i = 0; i < nums.size() - 1; ++i) { farthest...
ALGO
0.999992
6.396039
1261c812-123a-44e1-ae61-3f6ea5b918c8
LqhResearch/Basic-Programming-And-Algorithms
Chapter 01/Bai1_28.cpp
#include<stdio.h> #include<math.h> /* Tnh S(x, n) = -1+x^2/2!-x^4/4!+...+(-1)^(n+1)*x^2n/((2n)!). */ int main() { int n, giaiThua; float x, sum = 0; printf("Nhap x = "); scanf("%f", &x); do{ printf("Nhap n = "); scanf("%d", &n); if(n < 0) printf("Vui long nhap so nguyen duong\n"); }while(n < 0); for(...
ALGO
0.999934
3.545888
e6ab6270-d753-4e31-9080-33c3b3d8d444
Mohammad-Ashikul-Islam/Competitive_Programming
Preliminary/Untitled3.cpp
#include <bits/stdc++.h> using namespace std; void oddFactors(int n) { int count=0; for (int i = 1; i <= sqrt(n); i++) { if(n%i==0){ if(i%2==1) count++; if((n/i) %2==1) count++; if(i== (n/i)) count--; } } cout<<count; } int main() { oddFactors(5); return 0...
ALGO
0.999934
4.974854
fe518beb-7e2d-46e8-bbb8-273269329dad
YangKlee/C-plus-learning
KTLT/gapgiay.cpp
#include <bits/stdc++.h> using namespace std; int main() { long long cm; cin >> cm; float solan = 1; if( cm <= 2) solan = 0; else solan = log2(cm) - 1.0; cout << (long long)ceil(solan) << endl; }
ALGO
0.999358
3.941272
e0eb8b10-f1ff-456f-b6eb-90899310cd49
PedroDariva36/Desktop
Beecrowd/1221/a.cpp
#include <bits/stdc++.h> #include <ios> #define ll long long using namespace std; ll modpow(ll x, ll n, ll m) { if (n == 0) return 1%m; long long u = modpow(x,n/2,m); u = (u*u)%m; if (n%2 == 1) u = (u*x)%m; return u; } bool check_composite(ll n, ll a, ll d, int s) { ll x = modpow(a, d, n); ...
ALGO
0.999665
4.624597
5adad473-3ad8-4147-b316-f7feb94b9f77
jefferyyellow/UE4
UnrealEngine-4.26/Engine/Source/ThirdParty/Intel/TBB/IntelTBB-2019u8/examples/graph/dining_philosophers/dining_philosophers.cpp
#if _MSC_VER // Suppress "decorated name length exceeded, name was truncated" warning #pragma warning (disable: 4503) #endif #include "tbb/flow_graph.h" #include "tbb/task_scheduler_init.h" #include "tbb/tick_count.h" #include "tbb/tbb_thread.h" #include "tbb/atomic.h" #include "tbb/spin_mutex.h" #include <ios...
ALGO
0.979225
4.725851
588051bf-e644-4727-b476-06d5bea73427
AleksandarTulic/CCC-competition
CCC01_Strategic_Bombing.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; vector <string> a; bool flag=true; void put(vector <bool> prov, char poc) { if (flag == false) return; if ( poc == 'B' ) { flag=false; return; } for (int i=0;i<a.size();i++) { if ( poc == ...
ALGO
0.999886
3.496429
7e725492-3625-4482-b612-6420a2b731d8
mjayalam/Problems-Solutions
Omegaup/Nebulosas.cpp
#include <cstdio> using namespace std; int n,m,k,x,y,maximo=0,in,f,c=0,anterior; int neb [502][502]; bool visits[502][502]; void busqueda(int x,int y,int anterior){ if(x>0 && x<=n) { if(y>0 && y<=m) { if(visits[x][y]==0) { if( anterior-neb[x][y] <=k ){ visits[x][y]=1; ...
ALGO
0.999843
3.267758
63992e3c-82b9-4eae-8c76-a1a2f1fde751
Aranch422/Algorithm_Study
2022/String/1786_KMP.cpp
#include <iostream> #include <string> #include <vector> using namespace std; int fail[1000000]; int n,m; void makeFail(string str){ int cnt = 0; for(int i=1;i<m;i++){ if(str[cnt] == str[i]){ fail[i] = ++cnt; } else{ while(str[i]!=str[cnt] && cnt!=0){ cnt = fail[cnt-1]; } if(str[i] == str[cnt...
ALGO
0.999954
4.496553
f92407f2-60fb-4995-b997-0bdc688a6ec1
AllanKT/competitive_programming
URI/1799 - O Rato no Labirinto.cpp
#include<bits/stdc++.h> #define MAX 1000000 #define oo (1<<30) #define fori(i, ini, lim) for(int i = int(ini); i < int(lim); i++) #define ford(i, ini, lim) for(int i = int(ini); i >= int(lim); i--) using namespace std; using ii = pair<int, int>; typedef struct ponto { string nome; int id; } ponto; vector<int...
ALGO
0.99984
3.962827
24af86e4-6c28-46ab-be65-df4523e86b52
NavaDroid/frameworks_av
media/utils/TimeCheck.cpp
#include <csignal> #include "mediautils/TimerThread.h" #define LOG_TAG "TimeCheck" #include <optional> #include <android-base/logging.h> #include <android-base/strings.h> #include <audio_utils/clock.h> #include <mediautils/EventLog.h> #include <mediautils/FixedString.h> #include <mediautils/MethodStatistics.h> #inclu...
TOOL
0.923279
7.809053
3a1947e9-36c4-47a1-91d9-971e2efc8a00
Glaff10/problems_cplusplus
CodCad/movimento_cavalo.cpp
#include<bits/stdc++.h> using namespace std; typedef pair<int, int> pii; int matriz[100][100]; int dist[100][100]; int bfs(int x, int y){ int _x[] = {1, 1, 2, 2, -1, -1, -2, -2}, _y[] = {2, -2, -1, 1, 2, -2, -1, 1}; queue<pii> fila; pii aux; aux.first = x; aux.second = y; fila.push(aux); while(!fila.emp...
ALGO
0.998626
4.029799
a5cdfe3e-a691-43d9-8628-98e37f8be2d1
WalberMota/vcode_workspace_linux
Estudos - Daniel Gakwaya/método_manipuladores_stream/showpositive.cpp
#include<iostream> int main(int argc, char const *argv[]) { int pos_num{35}; int neg_num(-46); std::cout << "pos_num: " << pos_num << '\n'; std::cout << "neg_num: " << neg_num << "\n\n"; std::cout << std::showpos; std::cout << "pos_num: " << pos_num << '\n'; std::cout << "neg_num: " << ne...
TOOL
0.858565
3.566065
830e7f64-64fc-43be-9614-fc66b7d10115
Nih1tGupta/Leetcode-GFG
Medium/Max sum in the configuration/max-sum-in-the-configuration.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends /*You are required to complete this method*/ class Solution { public: long long max_sum(int a[], int n) { long long sum=0; for(long long i=0;i<n;i++){ sum+=a[i]; } long l...
ALGO
0.999788
6.289103
082c59b5-ddbd-4814-acb7-6bcf7951c280
SamProkopchuk/coding-problems
hackerrank/gena/solution.cpp
#include <bits/stdc++.h> typedef signed long long ll; #define FOR(x, to) for (x = 0; x < (to); ++x) #define FORG(x, fm, to) for (x = (fm); x < (to); ++x) #define FORREV(x, to) for (x = (to)-1; x >= 0; --x) #define FORR(x, arr) for (auto &x : arr) using namespace std; bool visited[1 << 20] = {false}; int hashDisks(...
ALGO
0.999941
4.999304
7ae6f196-2cc5-4333-a682-fd57b2ff05b1
saranv01/code
0493-reverse-pairs/0493-reverse-pairs.cpp
class Solution { public: void merge(vector<int>&nums,int low,int mid,int high){ int ans=0; int left=low; int right=mid+1; vector<int>temp; while(left<=mid&&right<=high){ if(nums[left]<nums[right]){ temp.push_back(nums[left]); left+...
ALGO
0.999958
5.492589
6931d778-1a1e-4b0e-9ffa-bf5aa0305515
Mag1cPanda/flutter_news
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.998693
6.797273
e3dfc7bb-c761-4fc8-b14f-8b1b253f3462
pavanbirnale/dsashhet
BinaryTrees/22_buildTree.cpp
// https://practice.geeksforgeeks.org/problems/construct-tree-1/1# // Construct Binary tree from Inorder and preorder traversal /* Algo: 1.each time we have to find first number of preorder array in inorder array and then divide the inoderder array in two parts one part send to left and anothe sent to right if we use...
ALGO
0.999994
6.308868
20daaacb-cd91-43df-b8de-59c7b38c2846
GOOOL-UFMS/Algoritmos-e-Programacao-II
1 - Introdução à linguagem C e C++/Questionário 1 sobre a linguagem C e C++/Everton Oliveira/5.cpp
#include<stdio.h> #include<math.h> int main(){ double lado_a, lado_b, lado_c, perimetro, area; scanf("%lf %lf %lf", &lado_a, &lado_b, &lado_c); perimetro = (lado_a+lado_b+lado_c)/2; area = sqrt(perimetro*(perimetro-lado_a)*(perimetro-lado_b)*(perimetro-lado_...
ALGO
0.997454
3.875826
a7e4b7a7-b815-4196-9e0b-9ada0d6cf961
DotOS-Extended/android_external_skia
src/core/SkMath.cpp
#include "SkMathPriv.h" #include "SkFloatBits.h" #include "SkFloatingPoint.h" #include "SkSafeMath.h" #include "SkScalar.h" const uint32_t gIEEENotANumber = 0x7FFFFFFF; const uint32_t gIEEEInfinity = 0x7F800000; const uint32_t gIEEENegativeInfinity = 0xFF800000; #define sub_shift(zeros, x, n) \ zeros -= n; ...
ALGO
0.998093
6.706935
c8ae0645-be3d-49ce-b541-7b83e212d0b7
xuanthu2002/DSA_PTIT_He_2023
DSAKT110_nha khong ke nhau.cpp
#include <iostream> using namespace std; int main() { int t; cin >> t; while(t--) { int n; cin >> n; int a[n + 3], f[n + 3] = {}; for(int i = 3; i <= n + 2; i++) { cin >> a[i]; f[i] = max(f[i - 2], f[i - 3]) + a[i]; } cout << max(f[n + 2], f[n + 1]) << endl; } return 0; }
ALGO
0.99925
3.845969
663170ac-70a4-4c08-8bc9-add87a241591
ajioka2310/AtCoder
ABC/bk/abc074/c/main.cpp
// abc074 C - Sugar Water // abc046 B - Painting Balls with AtCoDeer #ifdef DEFINED_ONLY_IN_LOCAL #include "/workspaces/AtCoder-cpp-env-main/cpp-dump/cpp-dump.hpp" // <次のセクションの内容はここに追加する> #define dump(...) cpp_dump(__VA_ARGS__) namespace cp = cpp_dump; CPP_DUMP_SET_OPTION_GLOBAL(max_line_width, 80); CPP_DUMP_SET_OPTION...
ALGO
0.999659
3.908325
208b6c0b-89a9-4bfe-9a85-e19c598c8367
ishandutta2007/codeforces
krijgertje/normal/1428/G2.cpp
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #include <cstring> #include <list> #include <cassert> #include <climits> #inclu...
ALGO
0.998581
3.667732
b4ac7eff-3500-44cf-92d2-fffbc587a2b0
xfw5/Fear-SDK-1.08
Game/ObjectDLL/AIGoalCircleFlamePot.cpp
#include "Stdafx.h" #include "AIGoalCircleFlamePot.h" #include "AINavMeshLinkAbstract.h" #include "AINavMesh.h" #include "AIGoalMgr.h" DEFINE_AI_FACTORY_CLASS_SPECIFIC( Goal, CAIGoalCircleFlamePot, kGoal_CircleFlamePot ); // If an AI deactivates the CircleFlamePot goal within this distance of an AI // who is not blit...
TOOL
0.892874
6.759815
bef8e137-752d-4768-9289-71e86a4e6d1f
harsh-quare/LeetRoad
2323-minimum-bit-flips-to-convert-number/2323-minimum-bit-flips-to-convert-number.cpp
class Solution { public: int minBitFlips(int start, int goal) { int cnt = 0; for(int i = 31; i>=0; i--){ bool b1 = start & (1 << i); bool b2 = goal & (1 << i); if(b1 != b2) cnt++; } return cnt; } };
ALGO
0.999984
5.865031
a5029a14-7990-47d3-ab77-6c8c8b289aae
alexmav04/cpp-primer-5th-edition-exercise
ch01/01-13.cpp
#include<iostream> int main(){ int sum = 0; for (int val = 50; val <= 100; val++){ sum += val; } std::cout << "Sum of 50 to 100 inclusive is " << sum << std::endl; for (int val = 10; val >= 0; val--){ std::cout << val << std::endl; } return 0; } /*output: Sum...
ALGO
0.987287
3.867583
ec175872-7cea-42fc-9748-9ca4f921b42b
ishandutta2007/codeforces
davoth/normal/1453/A.cpp
#include <bits/stdc++.h> #pragma GCC optimize("O2") using namespace std; using ll = long long int; #define F first #define S second #define fast_io ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr); const int N=2e5+10,LN=20,SQ=550,M=5e4+10; const ll INF=1e18; const int MOD=1000000007 /*998244353*/; #includ...
ALGO
0.999947
4.322543
84b1fbd0-98a6-43d9-83df-28a986d0d4f1
YakoViTo/UDO
cpp/Dividir Pila/Source.cpp
#include <iostream> #include <stdexcept> #include <string> using namespace std; constexpr int max = 2; template<class T> class Pila { T s[max]; int tope; public: Pila() { tope = -1; } void push(T x); T pop(); string dividirPila(Pila& pos, Pila& neg); bool isPilaVacia(); }; template <class T> bool Pila<T>::is...
ALGO
0.942547
4.334428
7971d756-9a3a-42ba-8a48-c8d9c91ccfc7
mikoro/raycer
src/Rendering/Filters/MitchellFilter.cpp
#include "stdafx.h" #include "Rendering/Filters/MitchellFilter.h" using namespace Raycer; namespace { double calculateWeight(double s, double B, double C) { s = std::abs(s); if (s <= 1.0) return ((12.0 - 9.0 * B - 6.0 * C) * (s * s * s) + (-18.0 + 12.0 * B + 6.0 * C) * (s * s) + (6.0 - 2.0 * B)) * (1.0 / 6...
ALGO
0.994617
6.20857
efb081fc-5c14-4bf2-8747-1cddc1b6c7b3
Efrain-DiazM/clean_architecture_flutter
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.998733
6.76775
4af11c34-167e-4007-9505-13e1356f3a6e
pranit-mishra/C-lab
lab 9/lab 9 qn 10.cpp
#include<iostream> using namespace std; class Complex { private: int real; int imag; public: Complex() { } Complex(int r ,int i) { real = r ; imag = i; } void display() { cout<<real<<" +"<<" "<<imag<<" i"<<endl; } friend Complex operator ++(Complex &c); friend Complex operator +(Com...
ALGO
0.953793
4.463421
33301f7f-f0cd-418a-8586-8b6ccaa79582
sarvex/leetcode-checked-c
lcof2/剑指 Offer II 092. 翻转字符/Solution.cpp
class Solution { public: int minFlipsMonoIncr(string s) { int n = s.size(); vector<int> left(n + 1, 0), right(n + 1, 0); int ans = INT_MAX; for (int i = 1; i <= n; ++i) { left[i] = left[i - 1] + (s[i - 1] == '1'); } for (int i = n - 1; i >= 0; --i) { ...
ALGO
0.999993
6.259055
794f63a3-e5b1-4306-9137-fb85980a20af
savirsingh/dmoj-solutions
dmopc21c6p3.cpp
// code by savir singh // https://dmoj.ca/problem/dmopc21c6p3 // 15/15 #include <bits/stdc++.h> using namespace std; // macros #define int long long #define double long double #define bit32 int32_t #define del erase #define pb push_back #define str string #define scani(x) scanf("%lld", &x) #define scan(x) scanf("%s", ...
ALGO
0.999973
3.664455
77c914fa-ab29-4d07-af8a-b5b211ba43b2
ebayboy/cpp_stl_2ed_book
src/examples/iter/reviter3.cpp
#include <iostream> #include <deque> #include <algorithm> using namespace std; void print (int elem) { cout << elem << ' '; } int main() { deque<int> coll; // insert elements from 1 to 9 for (int i=1; i<=9; ++i) { coll.push_back(i); } // find position of element with value 2 dequ...
ALGO
0.997141
4.584638
e59e1b98-97c5-4c1c-91c3-281224155e93
tr1ten/DNA
usaco/Silver/C_Covered_Points_Count.cpp
#include <cstdio> #include <bits/stdc++.h> using namespace std; #include "ext/pb_ds/assoc_container.hpp" #include "ext/pb_ds/tree_policy.hpp" using namespace __gnu_pbds; template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update> ; template<typename T> using order...
ALGO
0.99971
3.887666
8803a9ce-3ee1-4042-af10-709649c6bd87
RussellDash332/kattis
src/Stanovi/stanovi.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll n, m, k; cin >> n >> m >> k; vector<ll> D(16*301*301, 1e9); for (int a = 1; a <= n; ++a) for (int b = 1; b <= m; ++b) for (int c = 0; c < 15; ++c) { ll v = (a*b-k)*(a*b-k); for (int i = 1; i < a; ++i) v = ...
ALGO
0.999861
3.946253
6b482e37-5b15-4170-8e4f-9274bb97385e
Ivan-71-ua/Competitive-Programming
C++ Uzhu/Audut-29-03-2024/H.cpp
#include <bits/stdc++.h> int main() { std::string boards; const double INF = std::numeric_limits<double>::infinity(); while (std::cin >> boards) { boards = " " + boards; // Добавляем пробел для сдвига позиций std::vector<double> c(boards.length()); // Инициализируем вектор для хранения стоимости починки c[0] ...
ALGO
0.999271
4.444791
d63f3ee2-8f6c-4d91-babe-fab8d3e98e11
nayemhasan45/Phitron
C++/week 1/module 2.5p/M_Capital_or_Small_or_Digit.cpp
#include<bits/stdc++.h> using namespace std; int main (){ char n; cin>>n; int ans = int(n); if (ans>=48 && ans<=57) { cout<<"IS DIGIT"; }else if(ans>=65 && ans<=90){ cout<<"ALPHA"<< endl <<"IS CAPITAL"; }else { cout<<"ALPHA"<<endl<<"IS SMALL"; } return 0;...
ALGO
0.995461
3.131581
1596b195-9ff9-497d-8744-61e3b902106f
yjaiswal05/Face-recognition-
opencv/OpenCV 4.5.2.tar/opencv-opencv-39d2578/3rdparty/carotene/src/median_filter.cpp
#include "common.hpp" /* * The code here is based on the code in * <http://ndevilla.free.fr/median/median/src/optmed.c>, which is in public domain. * See also <http://ndevilla.free.fr/median/median/index.html>. */ namespace CAROTENE_NS { #ifdef CAROTENE_NEON namespace { uint8x16_t getLeftReplicate(uint8x16_...
ALGO
0.999191
6.723718
99dc9dac-6f43-42cb-abef-bee7cdb6119d
KylusheL/CppPractice
Daily PS/BOJ/ACM Craft(1005, G3).cpp
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; void solve() { int n, k, i; cin >> n >> k; vector<vector<int>> edge(n + 1, vector<int>()); vector<int> cost(n + 1, 0); vector<int> dp(n + 1, 0); vector<int> indegree(n + 1, 0); for (i = 1; i <=...
ALGO
0.999927
4.440248
4a10dc86-1b39-48b2-9bfa-e250b4710251
anmoltiwari0712/Mission_DSA
3. Solve problems on array/3.3 Hard Problems/4sum.cpp
// Brute Approach T.C - O(N^4) #include<bits/stdc++.h> vector<vector<int>> fourSum(vector<int>& nums, int target) { // Write your code here int n=nums.size(); set<vector<int>> st; for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ for(int k=j+1;k<n;k++){ for(int l=k+1;l<n...
ALGO
0.999864
5.978216
26fc8614-f06b-4863-a142-fe113c66ab0b
blueboy/portaltbc
dep/src/g3dlite/GImage_bayer.cpp
/** @file GImage_bayer.cpp @author Morgan McGuire, http://graphics.cs.williams.edu @created 2002-05-27 @edited 2006-05-10 */ #include "G3D/platform.h" #include "G3D/GImage.h" namespace G3D { void GImage::BAYER_G8B8_R8G8_to_Quarter_R8G8B8(int width, int height, const uint8* in, uint8* out) { debugAssert(...
ALGO
0.927149
6.124008
cc555a3a-47dc-453c-9dbb-902c2b071d1f
jacob-moore22/RANN_Refactor
OG_lammps/pair_dsmc.cpp
// clang-format off /* ---------------------------------------------------------------------- Contributing authors: Paul Crozier (SNL) ------------------------------------------------------------------------- */ #include "pair_dsmc.h" #include "atom.h" #include "comm.h" #include "domain.h" #include "error.h" #inc...
ALGO
0.995188
5.378374
608c0a6f-8a1a-49d4-a09e-7abdae4b8749
shivangigoel1302/leetcode_solutions
Sum_of_Subsequence_Widths.cpp
class Solution { public: int m = 1e9+7; int sumSubseqWidths(vector<int>& A) { sort(A.begin(),A.end()); long long ans = 0; int n = A.size(); vector<long long>pow(n,0); pow[0] = 1; for(int i = 1; i < n ; i++){ pow[i] = (pow[i-1]*2 )%m; } ...
ALGO
0.999994
5.46722
62023406-8e8c-4072-8a6b-c8969c17347e
Singh-Vibhor/Competitive-Programming---Cpp
F_Card_Substrings.cpp
#include <bits/stdc++.h> using namespace std ; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m ; string s, t ; cin >> s >> t ; map<char, int> mpp ; for(auto it: t){ mpp[it]++ ; } int i = 0, j = 0 ; //int n = s.size() ; long...
ALGO
0.999933
3.971692
4326b4f9-6043-4406-a409-f8293241bec3
xiaomo9/studyCgg
test2_study.cpp
#include<iostream> using namespace std; #include<vector> class Solution { public: vector<string> result; void add_kuohao(string s1,int left,int right){ if(left == 0 &&right==0){ result.push_back(s1); return; } if(left<right){ if(left>0) add_kuohao(s1...
ALGO
0.999798
5.054609
e4e49e68-57cc-4aae-aca8-07b2df4f074f
tnameera/CSCI135
class_excercise/lab12/vectors.cpp
/* Author: Syeda Nameera Tahseen Course: CSCI-135 Instructor: Melissa Lynch Assignment: TaskA For this task, program a function called vector<int> makeVector(int n) that returns a vector of n integers that range from 0 to n-1. Call your program vectors.cpp. Your function must be implemented outside the main function ...
ALGO
0.989774
5.62514
d5150fb6-0754-442c-8d38-edb46002130e
yash3001/Competitve-Programming
Algorithms/Dynamic Programming/2. Unbounded Knapsack/3. Coin Change Problem: Maximum Ways/coin_change_maximum_ways_recursive.cpp
/* @author -> gamma30 */ #include <bits/stdc++.h> using namespace std; int coin_change(vector<int> &value, int sum, int n); int main(){ cout<<"Enter the number of coins: "; int n; cin>>n; vector<int> value(n); cout<<"Enter the value of the elements: "; for(int i=0; i<n; i++){ cin>>value...
ALGO
0.999919
4.5596
3ccf6e56-96d5-4be6-88f2-595749a060c9
jiayuanmark/hackerrank
hackrank-week-32/fight-monsters.cpp
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, hit, t; cin >> n >> hit >> t; vector<int> h(n); for (int i = 0; i < n; ++i) { cin >> h[i]; if (h[i] % hit) { h[i] = h[i] / hit + 1; } else { h[i] /= hit; } } sort(h.begin(), h.en...
ALGO
0.999937
4.071523
107aa3cb-8336-4d0b-90ef-e3919f904c8f
kamal-singh819/LeetCodeLeetHub
Frequency Game - GFG/frequency-game.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 LargButMinFreq(int arr[], int n) { unordered_map<int, int> mp; for(int i =0; i<n; i++) mp[arr[i]]++; int ans...
ALGO
0.999924
5.700919
44d3ac22-1f32-4f6e-97e8-f3cb9b687f3a
vedanty3/dsa-codeground
leetcode-gfg-solutions/gfg-solutions/Longest consecutive subsequence.cpp
// https : // practice.geeksforgeeks.org/problems/longest-consecutive-subsequence2449/1# class Solution { public: int findLongestConseqSubseq(int arr[], int N) { unordered_set<int> st; for (int i = 0; i < N; i++) st.insert(arr[i]); int largest = 1; for (auto s : st...
ALGO
0.999867
5.236485
9be7c059-2345-46e6-8c9c-da5d33f5f962
The-Thought-Magician/Algozenithcode
334.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 void solve() { int q; cin >> q; set<int> se; int x; string s; for (int i = 0; i < q; i++) { cin >> s; if (s == "add") { cin >> x; se.insert(x); } ...
ALGO
0.998424
5.334806
ad0c0d00-bb11-4ffe-a062-2b3b8a9fdc86
fmvazquez/Competitive-Programming
OIAJ/Selectivos/Determinar dondeSeCongestiona/Determinar dondeSeCongestiona.cpp
#include <bits/stdc++.h> using namespace std; vector<vector<pair<int, int>>> adj; vector<vector<int>> id; vector<int> trafic; int num_nodes, num_conexions; int a, b, cost; int recorrer (int node, int from, vector<vector<int>>& new_adj) { if (new_adj[node].size() == 0) { trafic[id[from][node]] += 1; ...
ALGO
0.999867
3.816397
c63caf5e-96c0-479b-ab2c-6f38526d2f7a
destroy314/Object_Oriented_Programming
code/14_class_circle.cpp
#include <iostream> #define pi 3.14 using namespace std; class circle { float x, y, r; public: circle(float x_in, float y_in, float r_in) { x = x_in; y = y_in; r = r_in; } float area() { return 2 * pi * r; } float circumference() { return pi * r * r; } }; int main() { ...
ALGO
0.984821
4.174726
0f82eabb-b795-47ae-a700-780fc2fe7d98
fursund/EmguCV-Unity
opencv/src/cv/cvoptflowlk.cpp
#include "_cv.h" typedef struct { float xx; float xy; float yy; float xt; float yt; } icvDerProduct; #define CONV( A, B, C) ((float)( A + (B<<1) + C )) /*F/////////////////////////////////////////////////////////////////////////////////////// // Name: icvCalcOpticalFlowLK_8u32fR ( Lucas & Ka...
ALGO
0.999714
6.731121