uuid
stringlengths
36
36
repo_name
stringlengths
5
133
relative_path
stringlengths
3
3.76k
content
stringlengths
282
4.03M
category
stringclasses
6 values
algo_rel_score
float32
0.9
1
quality_score
float32
3
8.13
source_meta
dict
deda395b-f3a7-4215-913a-585a1034932d
andjelatodorovic/DesignPatterns
SimplePatterns/visitor.cpp
#include "visitor.h" #include <iostream> #include <algorithm> using namespace std; template<class T> KruzniNiz<T>::KruzniNiz(const VNiz<T>& x) : n(x.size()), a(new T[n]) { for (size_t i = 0; i < n; i++) a[i] = x[i]; } template<class T> void SabiracPosetilac<T>::poseti(VNiz<T>& x) { T suma = T(); for (size_t i = 0...
ALGO
0.970438
4.555989
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2019-02-10T17:23:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 80, "forks": 35, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7fbc649...
92d2c2e5-972c-45f4-bf1c-4d9751460e33
liuyubobobo/Play-Leetcode
0001-0500/0001-Two-Sum/cpp-0001/main2.cpp
/// Source : https://leetcode.com/problems/two-sum/description/ /// Author : liuyubobobo /// Time : 2017-11-15 #include <iostream> #include <vector> #include <cassert> #include <unordered_map> using namespace std; /// Two-Pass Hash Table /// Time Complexity: O(n) /// Space Complexity: O(n) class Solution { public...
ALGO
0.999173
5.580302
{ "github_metadata": { "branch": "master", "commit_count": 2592, "repo_created_at": "2016-12-01T17:08:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2732, "forks": 718, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "78...
9fd6bbdf-1d5b-4c74-85e5-a8ac8b38911f
sumair-ce/Web-Brower-and-local-Search-Engine-in-C-plus-plus
graph.h
#pragma once #include <iostream> #include <list> #include <queue> #include <stack> #include <string> #include <unordered_map> using namespace std; struct flist { string data; list<pair<string, int>> seclist; }; class graphs { public: list<flist> mainlist; public: void insertvertex(const string& d) { ...
ALGO
0.99772
4.594018
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-06-24T16:02:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eb8451fd8ffd...
01eb0d51-7abb-4168-bb71-ef3798541cda
tjfruddnjs1/File-Data-structure-Task
대체 선택 방법.cpp
#include <stdio.h> #include <stdlib.h> #define COUNT 66 int main() { int i, j, k, temp; int data[COUNT]; int run[COUNT], memory[6], frozen[6]; // 버퍼의 크기 : 6 printf("66 Input data \n"); for (i = 0; i < COUNT; i++) { scanf_s("%d", &data[i]); } for (i = 0; i < 6; i++) { frozen[i] = 1; } printf("========...
ALGO
0.999849
3.268541
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2019-12-30T03:27:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "98a1f46fb2...
6743861f-00b4-4b23-85d0-36833aa84a89
JiyeonJeong01/Algorithm
백준/Silver/18352. 특정 거리의 도시 찾기/특정 거리의 도시 찾기.cc
#include <iostream> #include <vector> #include <queue> #include <list> #include <algorithm> using namespace std; struct Params { int N, M, K, X; }; void bfs(const vector<list<int>>& vec, const Params& p) { int n = p.N, k = p.K, x = p.X; queue<int> q; vector<int> visited(n+1, -1); q.push(x);...
ALGO
0.999954
4.36164
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2024-12-26T13:21:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "69a6ffc0ea7...
c0981fc3-e7ed-4778-ad3f-45375d6e36d6
code233trainee/lijiminbest
CodeForese/div2/979_2030_div2/D.cpp
#include <bits/stdc++.h> using namespace std; void solve() { // int n, q; // cin >> n >> q; // vector<int> perm(n); // for(int i = 0; i < n; i++) // { // cin >> perm[i]; // } // for(int i = 0; i < n; i++) // { // perm[i]--; // } // vector<int> invperm(n); // f...
ALGO
0.999929
4.29224
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2024-11-26T08:49:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a7a57f94e0...
89dad240-719b-4fde-ab91-6cdca8b46498
anonymous-i/Parallel-and-Concurrent-Programs-
MRMW_AS.cpp
#include<iostream> #include<thread> #include<fstream> #include<string> #include<cstdlib> #include<atomic> #include<time.h> #include<unistd.h> #include<chrono> #include <iomanip> #include<vector> using namespace std; time_t t= time(NULL); tm* tPtr= localtime(&t); ifstream inp_file("inp-parms.txt"); ofstream out_fil...
TOOL
0.988456
4.059372
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2021-01-21T06:32:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d287ae1d536...
92ec536d-fb9c-4afd-8d77-9212e492bb24
root-project/root
geom/geom/inc/bvh/v2/reinsertion_optimizer.h
#ifndef BVH_V2_REINSERTION_OPTIMIZER_H #define BVH_V2_REINSERTION_OPTIMIZER_H #include "bvh/v2/bvh.h" #include "bvh/v2/thread_pool.h" #include "bvh/v2/executor.h" #include <vector> #include <algorithm> namespace bvh::v2 { template <typename Node> class ReinsertionOptimizer { using Scalar = typename Node::Scalar...
ALGO
0.999252
7.36816
{ "github_metadata": { "branch": "master", "commit_count": 93033, "repo_created_at": "2013-06-27T10:46:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2899, "forks": 1363, "issues": 467, "pull_requests": 269 }, "file_meta": { "content_id"...
1537a0a4-cadf-424a-af8f-56dfd2e69304
AlnOsvaldo/PB-1795868
Tarea 3/Suma aritmetica.cpp
#include <iostream> using namespace std; void main() { cout << "Este programa encuentra la suma de los primeros `n` numeros multiplos de `m`" << endl; cout << "Introduce la cantidad de numeros (n): "; int n; cin >> n; cout << "introduce el numero multiplo deseado (m): "; int m; cin >> m; int f; f = (n * (n + ...
ALGO
0.999753
3.374858
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2018-08-15T02:19:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4589141a6...
567e9a61-5dd0-4903-9bbf-3b1baa71aa03
shaihitdin/CP
Olymp/WCS/5/I.cpp
#include <bits/stdc++.h> using namespace std; struct pt { int *x, y; }; const int N = 5e5 + 100, K = 52; vector <pt> st; int p[K][N + N], h[K][N + N]; pair <int, int> e[N]; vector <int> t[4 * N + 100]; int q_col[N], nxt[N], e_num[N], pre[N], done[N], prev_q[N]; int q; inline int get_p (int k, int v) { if (p[k][...
ALGO
0.999985
4.263973
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2017-01-22T16:38:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3d17c3a0a...
c7325d6c-b429-40e3-a7f5-50325b4bf9e9
NetBSD/pkgsrc
textproc/isearch/patches/patch-src_merge.cxx
$NetBSD: patch-src_merge.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $ In C++, deleting void pointers is undefined. --- src/merge.cxx~ 1998-11-04 05:12:25.000000000 +0000 +++ src/merge.cxx @@ -125,7 +125,7 @@ void buildHeap(void *data, size_t heapsi if (cmpstatus > 0) { memcpy( ((char *)data + (position * wid...
TOOL
0.947345
4.088756
{ "github_metadata": { "branch": "trunk", "commit_count": 429006, "repo_created_at": "2017-04-16T20:04:15.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 340, "forks": 168, "issues": 17, "pull_requests": 4 }, "file_meta": { "content_id": "24...
711e2dea-fa91-4d69-8fb4-0b96246ab990
pritykovskaya/deriviative
PROBDIST.CPP
// // Copyright (c) 1995 Crescent Division of Progress Software Corporation // #include <math.h> #include "probdist.h" const double Eps = 1e-15; int fequal( double a, double b ) { return (fabs(a-b) < Eps ) ? 1 : 0; } int fcompare( double a, double b ) { double d = a-b; int res; if( fabs(d) < Eps ) res = 0; ...
ALGO
0.999767
4.656365
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2011-07-06T12:05:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "979863c1e6...
433ddba0-a8b0-4d28-83b0-7281ec7f51c3
raykong1/Competitive-Programming-sols
Dmoj/dmopc13c1p4.cpp
#include <bits/stdc++.h> #define INF 0x3f3f3f3f #define ll long long #define ull unsigned long long #define pii pair<int, int> #define pll pair<ll, ll> #define pdd pair<double, double> #define fi first #define se second #define REP(i,a,b) for (int i = int(a); i <= int(b); i++) using namespace std; int r, c, N; int grid...
ALGO
0.999578
3.825429
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-05-08T00:29:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b889d5e48a...
eb9ece83-86cd-4b55-a453-755031341638
physense/master
Estimation_of_Purkinje_Trees/src/DToptimo3d.cpp
/* Copyright (c) <NAME> 22/03/2002 */ #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <sys/time.h> #include <assert.h> #define MAX_ELEM_IN_BUCKET 1000000 #define NUM_BUCKETS 400 #define MAXPATTERNS (16384*4) #define MAXCLASSNUMBER MAXPATTERNS #define MAXDIM 20 #ifndef UCHAR #defi...
ALGO
0.999591
3.422667
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2015-02-09T10:47:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "645cd15354...
630649c1-a61c-4d17-b1b6-c857173701f9
Vaibhav9520/DsaCpp
DSA/Stack/byLinkedList.c++
#include<iostream> using namespace std; struct Node{ int data; struct Node *next; }; void push(struct Node **top,int value){ struct Node *newnode = new Node(); newnode->data = value; newnode->next = *top; *top = newnode; } void pop(struct Node **top){ if(*top == NULL){ cout<<"Stack i...
ALGO
0.999488
3.933501
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-08T07:55:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "40b5d8698a64...
e9f848ee-3284-4370-a5fc-c89ae20a5d28
JeongChangBeom/Algorithm
boj2776.cpp
//boj2776번_암기왕_이분탐색 #include<iostream> #include<vector> #include<algorithm> using namespace std; bool binary_search(vector<int>& v, int length, int key) { int start = 0; int end = length - 1; while (start <= end) { int mid = (start + end) / 2; if (key == v[mid]) { return true; } if (key < v[mid]) { ...
ALGO
0.999992
5.019142
{ "github_metadata": { "branch": "master", "commit_count": 595, "repo_created_at": "2023-02-22T05:32:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "00b240ac...
e85d15c3-5f1d-49d1-95cd-d9cc2950793a
Infus3d/CP-solutions
Cpp/1132F.cpp
#include "bits/stdc++.h" // #include "ext/pb_ds/assoc_container.hpp" #define mp make_pair #define pb push_back #define ppb pop_back #define db puts("*****") #define mid(x , y) ((x+y)>>1) #define ff first #define ss second #define all(x) x.begin(),x.end() #define ll long long #define sqr(x) ((x)*(x)) #define pii pair ...
ALGO
0.999992
3.972429
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2021-10-10T04:02:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "295a302e7...
81ad0071-efd4-4c0b-b1db-822b493047a6
abdullah-166/Module_6_Linked_List
inser_any_position.cpp
#include<bits/stdc++.h> using namespace std; class Node { public: int value; Node* next; Node(int value) { this->value=value; this->next=NULL; } }; void insert(Node *&head, int a) { Node *newnode = new Node(a); if(head==NULL) { head...
ALGO
0.998548
4.062088
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-06-14T02:38:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f1c0f5b1e932...
98ab9789-5b11-4122-8779-f0ffea145764
forocto23aug05/tunglam_dev_oop
Bai002_Struct_Date/Bai002_Struct_Date.cpp
#include <iostream> using namespace std; struct Date { int day; int month; int year; }; bool isLeapyear(int year) { return (year%4==0&&year%100!=0 ||year%400==0); } void Nhap(Date &x) { cout<<"Nhap ngay theo dinh dang dd mm yy"; cin>>x.day; cin>>x.month; cin>>x.year; } int DaysInMont...
ALGO
0.999591
3.710776
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2025-01-31T09:40:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1a986ba1d21...
0c41a834-3609-49a9-85f5-640c1e66fde8
anantkataria/DSA
arrays/maximum_sum_path_in_two_arrays.cpp
// https://leetcode.com/problems/get-the-maximum-score/ class Solution { public: int maxSum(vector<int>& nums1, vector<int>& nums2) { int i1 = 0, i2 = 0; long sum1 = 0, sum2 = 0; while(i1 < nums1.size() || i2 < nums2.size()){ if(i1 < nums1.size() && (i2 == nums2.size() || nums1[...
ALGO
0.999992
5.214865
{ "github_metadata": { "branch": "main", "commit_count": 106, "repo_created_at": "2022-05-15T06:25:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "523e5a388a...
c95ca8f8-f05f-473d-8ee5-8110b8c2504d
Bammuri/Algorithm_PS
200113_BOJ_2458번_키순서.cpp
#include <iostream> #define INF 987654321 using namespace std; int N, M, a, b,ans; int d[505][505]; int con[505]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> N >> M; for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) { d[i][j] = INF; } } for (int i = 0; i < M; i++) { cin >> a >...
ALGO
0.999894
3.001473
{ "github_metadata": { "branch": "master", "commit_count": 144, "repo_created_at": "2019-03-08T06:28:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a805de4e...
a56f25e5-d5a1-43f4-a82b-a4ed720793a8
Zeyad2003/LeetCode
Medium/1786. Number of Restricted Paths From First to Last Node/Solution.cpp
class Solution { public: vector<long long> dis; // Stores the distance from the source to each node const static int M = 1e9 + 7, N = 2e4 + 5; int dp[N]; // dp[i] = the number of ways to reach n from 1 using restricted paths void dijkstra(vector<vector<pair<int, int> > > &adj, int src) { priori...
ALGO
0.999995
5.448059
{ "github_metadata": { "branch": "master", "commit_count": 171, "repo_created_at": "2023-03-01T07:30:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "40413d63...
8babc904-27c9-4409-aae4-a3feb2225594
PhanAnh9496/BtC-
BG-BT-Hàm/BTTRL/vd3/main.cpp
#include <iostream> using namespace std; int SoHoanThien(int n); int main(int argc, char** argv) { int n; cout << "Nhap n: "; cin >> n; int kq = SoHoanThien(n); if(kq == n) { cout << "\nTong cac uoc cua " << n << " khong tinh " << n << " la " << kq << endl; cout << n << " la so hoan hao"; } else { cou...
ALGO
0.999714
4.398667
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2018-06-18T14:24:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aecd01c9c...
fdb17720-2330-4444-aaa8-d229eabc3d2d
longathelstan/learncplusplus
ONVAOCHUYEN10/6-5/E.cpp
#include <bits/stdc++.h> #define io ios_base::sync_with_stdio(false); cin.tie(0); using namespace std; const int limit = 1e6+8; bool prime[limit]; bool isPrime(int n) { if (n < limit) return prime[n]; if (n < 2) return false; if (n < 4) return true; if (n % 2 == 0 || n % 3 == 0) return false; for (...
ALGO
0.99991
4.186574
{ "github_metadata": { "branch": "main", "commit_count": 81, "repo_created_at": "2024-11-29T07:36:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9e9af056ebd...
0f4e7f98-5a1b-4b3c-a3c8-9efb354d6667
ypandey700/DAA-4-Semester
Week4/Q2.cpp
#include <iostream> #include <cstdlib> // For rand() function #include <ctime> // For seeding random number generator using namespace std; int comparisons = 0, swaps = 0; int partition(int arr[], int si, int ei) { // Select a random pivot and swap it with the first element int randomIndex = si + rand() % ...
ALGO
0.999953
5.92746
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2025-02-10T17:28:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "52315bbf3aa...
ca633738-e489-4052-96ac-07da9a147f12
mohamedGamalAbuGalala/Practice
Train/El_Sageer/El_Sageer_Specialist/01 - [SP]/01 - 03 - [SP]/01 - 03 - [SP] Dynamic Programming/02 - [SP] Dynamic Programming/02.extra/3.CF [250C].cpp
#include <bits/stdc++.h> using namespace std; void fl() { #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); // freopen("ot.txt", "w", stdout); #else // freopen("jumping.in", "r", stdin); // HERE #endif } #define in(n) scanf("%d",&n) //scan int #define ot(x) printf("%d", x) //output int #define forr(i,j, n) for(int i...
ALGO
0.999987
3.538485
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2017-11-24T03:37:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1317e1448...
c63a6419-a8df-4205-85f5-d00fddce3d54
durgeshsonii/PracticeCodes
HackerEarth/SeptemberCircuits16/G.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define ff first #define ss second #define INF 2047483647 #define INFLL 9023372036854775807LL #define PI acos...
ALGO
0.999974
3.99214
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2017-03-07T06:23:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a07eef19...
386112ec-f312-4f66-a575-90752f44b2a5
OwenBrunty/Cpp-Projects
Hash Table/hashtable.cpp
/* <NAME> 4/22/21 Hash Table Used article for refrence: https://www.journaldev.com/35238/hash-table-in-c-plus-plus */ #include <iostream> #include <list> #include <cstring> #include <iomanip> using namespace std; //creates a struct that groups all info for a student struct Student { char firstname[20]; char las...
ALGO
0.959472
5.042523
{ "github_metadata": { "branch": "main", "commit_count": 59, "repo_created_at": "2021-02-26T00:54:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6038f83e585...
6cb62d1e-493c-4406-826b-dcbff99876af
CrabOnTheBeach/FightingGameLab
game.cpp
#include "game.h" #include <iostream> Game::Game(std::shared_ptr<Hero> p1, std::shared_ptr<Hero> p2) { player[0] = p1; player[1] = p2; } int Game::choose_attack(int i) const { if (!player[i]->is_attack_availible(0) && !player[i]->is_attack_availible(1) && !player[i]->is_attack_availible(2)) return...
ALGO
0.964936
3.398238
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-10-01T20:52:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "490c373294...
6d6e5f38-ae5a-456c-bb01-1f53453522f8
tushar854rawat/LeetCode
0632-smallest-range-covering-elements-from-k-lists/0632-smallest-range-covering-elements-from-k-lists.cpp
class Solution { private: bool chk(int a,int b, int c, int d){ // if new numbers are answer if(b-a < d-c){ return true; } else if(b-a == d-c){ if(a<c){return true;} } // new number dont have minimum difference // uptill now ret...
ALGO
0.99999
5.050916
{ "github_metadata": { "branch": "main", "commit_count": 1207, "repo_created_at": "2024-07-11T13:48:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2e62d2e85...
41d74082-e5a0-49f3-b480-dac402068254
akash4-sys/DSA
Codeforces/contest1352/B.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define vec vector<ll> #define vv vector<vec> #define vvv vector<vv> #define all(v) v.begin(), v.end() #define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define II ({ int a; cin>>a; a; }) #define LL ({ ll a; cin>>a ; a; }) #...
ALGO
0.999585
3.843879
{ "github_metadata": { "branch": "main", "commit_count": 272, "repo_created_at": "2022-07-17T09:39:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0c10832a10...
b0acd848-76d9-4d1e-9669-c6df99cca860
DILET1/usacoarchive
Alphastar/CC41B/Dynamic Programming on a 2D Array/radiocontact.cpp
#include <bits/stdc++.h> using namespace std; //AHHH SO MANY METHODS READABILITY SO GUD AHHHHUIHDSIOUBOYIUHIUH /* I wrote this during a thanksgiving party there are epic college students with me they do cs/ee nice */ pair<int,int> conv(char c){ //turns N,E,S,W into pairs indicating how much of each coordinate is modifi...
ALGO
0.999998
4.003946
{ "github_metadata": { "branch": "main", "commit_count": 250, "repo_created_at": "2022-01-28T18:13:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a5da885dc2...
7ce394f9-5ff1-4dc6-92f8-60180f196fb1
jedrzejowski/sokar-app
src/SokarAlg/BoundingConvexDecomposition.cpp
// // Created by adam on 30.08.2021. // #include "BoundingConvexDecomposition.hpp" #include "boundingmesh/Decimator.h" #include "boundingmesh/Mesh.h" #include "boundingmesh/SegmenterDownsampling.h" #include "optionparser/optionparser.h" using namespace SokarAlg; BoundingConvexDecomposition::BoundingConvexDecompositi...
ALGO
0.958802
3.859372
{ "github_metadata": { "branch": "master", "commit_count": 217, "repo_created_at": "2018-05-07T22:07:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c54b1bdc...
5d300818-804b-4f3b-9fa7-3b276c44fe2f
Tejas-2107/DSA
Binary Search/searchInSortedRotatedArray.cpp
#include <bits/stdc++.h> using namespace std; int findPeak(vector<int> arr, int start, int end) { int mid = 0; while (start < end) { mid = (start + end) / 2; // check if mid is on the first part that is 3,4,5 in this array if (arr[mid] >= arr[0]) { start = mid +...
ALGO
0.999989
5.156317
{ "github_metadata": { "branch": "main", "commit_count": 121, "repo_created_at": "2023-04-08T05:52:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "542ed66c05...
5811c77c-a765-4470-9adc-6595f41047bf
delta4d/AlgoSolution
zoj/09/1857.cpp
#include <queue> #include <cstdio> #include <vector> #include <cstring> using namespace std; const int INF = 0x3f3f3f3f; const int MAXN = 500; const int MAXL = 80; struct node { int t; int w; node(int _t=0, int _w=0):t(_t), w(_w) {} }; vector<node> e[MAXN]; bool fire[MAXN], visit[MAXN]; char buff[MAXN]; int d[MAXN...
ALGO
0.999935
3.708413
{ "github_metadata": { "branch": "master", "commit_count": 154, "repo_created_at": "2013-02-15T16:09:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "626b8780...
8725a083-f46b-4cf6-a373-5ec9349b07d8
amir-hosen7/Dynamic-Programming
Basic/Codechef/Easy Tiling.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define pb push_back #define F first #define S second #define all(v) v.begin(),v.end() #define Mid(b,e) b+(e-b)/2 #define inf 2147483647 //---------------------------------------------------------------------------// //T...
ALGO
0.999891
4.10276
{ "github_metadata": { "branch": "master", "commit_count": 90, "repo_created_at": "2020-01-16T09:31:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1e4f2d729...
fa95e182-ccf2-45be-951c-fe318473d08d
anuragjana/CP-Solutions
CodeForces/GNU C++17/1618A | Polycarp and Sums of Subsequences/139237475.cpp
#include <bits/stdc++.h> #include<iostream> #include<climits> using namespace std; #define vi vector<int> #define vll vector<ll> #define pll pair<ll, ll> #define pii pair<int, int> #define ld long double #define ll long long #define ff ...
ALGO
0.999464
3.499696
{ "github_metadata": { "branch": "main", "commit_count": 426, "repo_created_at": "2022-09-04T11:04:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c1ac200c44...
3f2fd351-3a7e-4c8e-8699-d921e95250e9
sansriti14/Leetcode
1609-even-odd-tree/1609-even-odd-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.999935
5.881581
{ "github_metadata": { "branch": "main", "commit_count": 2249, "repo_created_at": "2023-10-31T20:16:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f60062c20...
91b1b84e-bb66-4862-945a-6d474770bc94
w-mj/leetcode
43.multiply-strings.cpp
/* * @lc app=leetcode id=43 lang=cpp * * [43] Multiply Strings * * https://leetcode.com/problems/multiply-strings/description/ * * algorithms * Medium (29.93%) * Total Accepted: 186K * Total Submissions: 619.3K * Testcase Example: '"2"\n"3"' * * Given two non-negative integers num1 and num2 represented...
ALGO
0.999977
6.285459
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2018-10-14T06:52:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f72883f5a...
36e2e342-5230-4448-a0cb-bcbd9738dfa4
AntonAmstadt/Algorithms-in-Cpp
MediansAndOrderStatistics/main.cpp
#include <vector> #include <random> #include <iostream> // this is the same function that can be used in quicksort. // it used in randomized_select // O(n) int randomized_partition(std::vector<int>& v, int p, int r) { //randomize input vector (well enough) std::random_device rd; std::mt19937 gen(rd()); int size =...
ALGO
0.999952
5.367839
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2022-01-11T22:50:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7bf79b4f8d9...
02f32894-e28f-4f01-b633-503c6cafc042
GaussGreen/old-code
arm/ARMProject/armgenpricer/gp_closedforms/smile_sabr.cpp
/*! * Copyright (c) CDC IXIS CM July 2003 Paris * * Version initiale 01/15/2004 * * basic functions for the closed form framework * * \file smile_sabr.cpp * * \brief * * \author <NAME> * \version 1.0 * \date January 2004 */ #include "firsttoinc.h" #include <cmath> #include <vector> #include <iostre...
ALGO
0.999927
3.353526
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2022-02-17T09:58:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "95ed0ed7c211...
2fe6e972-36ad-4919-b67f-dc52a2e66ece
Mayank9mare/Codeforces
766div2/de.cpp
// ,;;;;;;, // ,;;;'""`;;\ // ,;;;/ .'`',;\ // ,;;;;/ | \|_ // /;;;;; \ / .\ // ,;;;;;;| '. \/_/ // /;;;;;;;| ...
ALGO
0.999842
3.288263
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2021-06-14T15:01:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fa6d064ab...
414863e6-97a4-4d48-a375-74f550e31a06
undr22/cppass
clipboard.cpp
#include <fstream> #include <iostream> #include <map> #include <memory> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; using line_no = vector<string>::size_type; class QueryResult { friend ostream &print(ostream &, const QueryResult &); public: QueryResult(string s, ...
TOOL
0.91188
4.063717
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2021-05-06T16:17:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9a971bb22...
cfe6fd8c-20ab-46c9-b7c3-f23f82ab94ed
anujjain-dev/unitree-go2-ros2
champ/champ_base/src/state_estimation.cpp
/* Copyright (c) 2019-2020, <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo...
ALGO
0.942908
6.648511
{ "github_metadata": { "branch": "humble", "commit_count": 11, "repo_created_at": "2024-08-18T20:08:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 121, "forks": 31, "issues": 10, "pull_requests": 0 }, "file_meta": { "content_id": "37f80...
2b1c4c6d-07de-4463-87cb-c051185fb9e1
gky2009514/lintcode
C++/056_2 Sum.cpp
class Solution { public: /* * @param numbers : An array of Integer * @param target : target = numbers[index1] + numbers[index2] * @return : [index1+1, index2+1] (index1 < index2) */ vector<int> twoSum(vector<int> &nums, int target) { vector<int> res; map<int, int> mp; ...
ALGO
0.999981
5.823506
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2015-05-12T10:42:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "5aa0642876...
373ad10a-69d8-4b18-af58-7178a65480d6
Joao-vpf/Algoritmos
segtree/treap(bruno).cpp
#define maxn 100010 #define maxalloc maxn // nº máximo de nós alocados durante toda execução typedef int Int; #define int long long struct no { int pri; // prioridade int size; // qtde de elementos na sub-árvore int val; // valor do nó int sum; // soma do intervalo int lz; // lazy no* l, *r; no() {}...
ALGO
0.999709
4.07047
{ "github_metadata": { "branch": "main", "commit_count": 263, "repo_created_at": "2022-08-10T14:17:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "58470991d7...
bab9d0c5-9ab2-4a61-90bd-7962cc2ac71b
chanhihi/Swift-Storage
BOJ/_CPP/2623번: 음악프로그램/음악프로그램.cpp
/* ************************************************************************** */ /* */ /* ::: ::: ::: */ /* Problem Number: 2623 :+: :+: :+: ...
ALGO
0.999989
4.661433
{ "github_metadata": { "branch": "main", "commit_count": 649, "repo_created_at": "2021-09-10T15:52:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bdd6a21f01...
f6bd81f0-2c45-4dd0-aa20-caa07580956f
ishandutta2007/codeforces-u
uryuuu/normal/1109/D.cpp
#include<iostream> #include<stdio.h> #include<cstdio> #include<vector> #include<algorithm> #include<cstring> #include<cmath> #include<queue> #include<string> #include<stack> #include<set> #include<map> #include<bitset> //#include<unordered_map> #include<time.h> #include<cstdlib> typedef long long ll; //#pragma comment(...
ALGO
0.99994
3.715686
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:31:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "37813f89f916...
eafd741e-37bd-4347-a12b-ec450e29a732
buiquochuy2508/DSA_SAMSUNG_PTIT
DSA07041-BIEUTHUCDUNGDAINHAT.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vii; typedef vector<pll> vll; typedef vector<ll> vl; typedef vector<vl> vvl; #define ms(s,n) memse...
ALGO
0.9959
4.010194
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2022-11-26T03:03:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e09bdbd7801...
efb5f7ee-4ee6-4f11-a312-54562294aa85
NeoHW/leetcode
2438-find-closest-node-to-given-two-nodes/find-closest-node-to-given-two-nodes.cpp
class Solution { public: int closestMeetingNode(vector<int>& edges, int node1, int node2) { int n = edges.size(); vector<int> AL(n, -1); for (int i = 0; i < n; ++i) { AL[i] = edges[i]; } vector<int> dist1 = bfs(AL, node1); vector<int> dist2 = bfs(AL, nod...
ALGO
0.999997
5.908206
{ "github_metadata": { "branch": "main", "commit_count": 680, "repo_created_at": "2024-08-08T08:09:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3964bb22f6...
edf36606-4b97-4ab9-b3e1-68d72c620995
yangzeyu23/C--Summer
Homework/Homework12-14/14/14_1.cpp
//考虑作业队列的容量限制,修改代码,实现标准的生产者—消费者模型。设作业队列最多容量amount个作业,有m个接收作业的线程,有n个处理作业的线程。 #include <iostream> #include <pthread.h> #include <semaphore.h> #include <list> struct Job { Job( int x = 0, int y = 0) : x(x), y(y) { } int x, y; }; std::list<Job *> job_queue; pthread_mutex_t job_queue_mutex = PTHREAD_MUTEX_INITIAL...
ALGO
0.999586
5.435121
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2025-06-27T06:00:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fa0e5726005...
a384473f-bd8d-4484-b9e4-f7f3da4cb6ea
gky2009514/lintcode
C++/401_Kth Smallest Number in Sorted Matrix.cpp
class Solution { public: /** * @param matrix: a matrix of integers * @param k: an integer * @return: the kth smallest number in the matrix */ int kthSmallest(vector<vector<int> > &matrix, int k) { int n = static_cast<int>(matrix.size()); int m = static_cast<int>(matrix[0].siz...
ALGO
0.999991
6.069729
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2015-05-12T10:42:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "fcc18ab1f1...
d4f8b319-d290-4d8f-b5ec-b19b5d99f988
Deeplearning-JorD/DAIMA
H_旅行计划.cpp
/* * @Author: JorD * @LastEditTime: 2023-04-20 11:55:08 */ #include <bits/stdc++.h> using namespace std; using ll = long long; using db = double; #define endl '\n' #define PII pair<ll, ll> #define siz(s) (ll)(s.size()) #define all(a) a.begin(), a.end() #define all1(a) a.begin() + 1, a.end() #define priq priority_que...
ALGO
0.999934
4.118097
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-12-26T13:33:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "daeebf2ddcb9...
fa023ab1-b875-454c-b2af-629b22592cd1
LiuXingrui/Work_Space-1
BP/fast_bp.cpp
#include <iostream> #include<cstring> #include<string> #include<vector> #include <fstream> #include <math.h> #include <random> #include"BP1.h" using namespace std; #include <itpp/itbase.h> #include <itpp/itcomm.h> using namespace itpp; int main(){ GlobalRNG_randomize (); double p=0.01; int lmax=20; int num_o...
ALGO
0.999364
3.638485
{ "github_metadata": { "branch": "master", "commit_count": 264, "repo_created_at": "2020-07-12T22:59:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a5a894e7...
0566b49f-f555-4153-9ffc-d99d4b86ecd5
lichenk/AlgorithmContest
codeforces/749/E/E.cc
#include <bits/stdc++.h> #include <assert.h> using namespace std; typedef long long ll; typedef long double ld; #define PB push_back #define MP make_pair #define MOD 1000000007LL #define endl "\n" const ll UNDEF = -1; const ll INF=1e18; template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, tr...
ALGO
0.999319
3.336588
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2018-07-29T03:21:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "36a21f004...
50f70afe-79d2-403f-aded-b9a4b5958bff
mew177/cpp-practice
leetcode/662 - Maximum Width of Binary Tree/662 - Maximum Width of Binary Tree/main.cpp
// // main.cpp // 662 - Maximum Width of Binary Tree // // Created by Wu, <NAME> on 2020/3/30. // Copyright © 2020 Pitt. All rights reserved. // #include <iostream> #include <map> #include <algorithm> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) ...
ALGO
0.999761
5.966428
{ "github_metadata": { "branch": "master", "commit_count": 166, "repo_created_at": "2020-03-26T20:48:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f08eab39...
95b68512-54fb-4e3e-acf6-a4a0f0a35301
sngvahmed/Problem
solving problem/greedy/Voting.cpp
//Mar 4, 2014 :: Voting.cpp #include <cstring> #include <string.h> #include <map> #include <deque> #include <queue> #include <stack> #include <sstream> #include <bitset> #include <iostream> #include <iomanip> #include <cstdio> #include <fstream> #include <cmath> #include <cstdlib> #include <ctime> #include <algorithm> ...
ALGO
0.999941
3.634393
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2014-10-15T17:16:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "550cccb21...
9b133326-e9c9-4ebc-a0dd-2bc9323d08b2
lingwangqs/SU2DMRG
su2struct.cpp
#include <iostream> #include <stdlib.h> #include <math.h> #include "su2struct.hpp" using namespace std; extern "C"{ void isort2_(int*,int*,int*); } //-------------------------------------------------------------------------------------- su2struct::su2struct(){ //-----------------------------------------------------...
ALGO
0.939268
3.206321
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-10-07T02:58:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f2723da56449...
13d3eb61-16e0-49e1-b2e6-0f7b791dd93e
SayaUrobuchi/uvachan
UVa/10129.cpp
#include <stdio.h> #include <string.h> int main() { int path[26], count, n, check, tmp, tmp2, i, j, k; char buf[1001], connect[26][26], appear[26]; scanf("%d", &count); while(count--) { scanf("%d", &n); memset(path, 0, 104); memset(appear, 0, 26); memset(connect, 0, 26 * 26); while(n--) { scanf("%s...
ALGO
0.999881
3.536725
{ "github_metadata": { "branch": "master", "commit_count": 105, "repo_created_at": "2017-06-12T06:49:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ab5dfc7e...
59349ce2-e934-4fb6-9817-74fcfedfb000
RosaryXiang/CS271A
tabu.h
#include <fstream> #include <iostream> #include <random> #include <sstream> #include <vector> using namespace std; // init current solution vector<int> init_current_solution(int n) { vector<int> current_solution; for (int i = 0; i < n; i++) { current_solution.push_back(i); } std::random_device...
ALGO
0.999932
5.619436
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-02-20T00:54:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8513b2bdff...
97e12ea5-0964-41bb-bf56-5b7fac5e5e0d
FilippoCiarlo/Algorithms-and-DataStructures
Exercises/SourceCode_by_Topic/BST/2018-09-11_Q7.b&c.cc
/* * ! Attention * Compile the program with the option: -Wno-write-strings * g++ -Wno-write-strings 2018-09-11_Q7.b\&c.cc */ #include <iostream> #include <cstring> using namespace std; struct libro{ char* autore; char* titolo; }; /************TREE************/ struct bnode{ libro key; bnode* l...
ALGO
0.999489
3.492147
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2022-09-21T16:44:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fcb7dc45b4c...
40ef6a26-3ad1-4e6a-a51f-be12c98460e0
arnau1741/eda-jutge
dfs/X64801.cc
#include <iostream> #include <vector> using namespace std; typedef vector<vector<int>> Graf; bool cicles(const Graf& g, int u, vector<bool>& visited) { if(visited[u]) { return true; } visited[u] = true; for(int i = 0; i < g[u].size(); ++i) { int adj = g[u][i]; if(cicles(g...
ALGO
0.99996
4.98841
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2024-06-04T16:47:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7e329c2b50ff...
701ce36d-423c-4ce3-9ffd-28f7b9277635
NoorRafi13/tugas-3_struktur_data
menu.cpp
#include <iostream> #include <conio.h> using namespace std; int n; void tukar(int *a,int *b){ int t=*a; *a=*b; *b=t; } void dMenu() { system("cls"); cout<<"Aplikasi Sorting Bubble"<<"\n"; cout<<"1. masukan data"<<"\n"; cout<<"2. tampilkan data"<<"\n"; cout<<"3. sorting asc"<<"\n...
ALGO
0.998304
3.088725
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-12-13T06:33:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0ddc50dd413f...
0f92f489-af8a-4826-9823-3f5bd07ca806
nehalgarg7/DSA-C-
PW_Assignment/Assignment_24_06/Q7.cpp
/***Q7.** Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the nonzero elements. Note that you must do this in-place without making a copy of the array. **Example 1:** Input: nums = [0,1,0,3,12] Output: [1,3,12,0,0] */ #include <iostream> using namespace std; int main...
ALGO
0.999286
4.499272
{ "github_metadata": { "branch": "master", "commit_count": 111, "repo_created_at": "2023-02-10T19:25:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "368678b7...
c3ca867f-7844-41eb-a5e2-e8a523cc45a6
dyjung123/kakao_colorbook
kakao_colorFriends_answer2/main.cpp
#include <iostream> #include <vector> #include <utility> #include <queue> using namespace std; vector<vector<int>> picture{{1,1,1,0},{1,2,2,0},{1,0,0,1},{0,0,0,1},{0,0,0,3},{0,0,0,3}}; vector<int> solution(int m, int n, vector<vector<int>> picture) { for (int i = 0;i < m; ++i) { for (int j = 0;j < n; ++j)...
ALGO
0.999973
4.880406
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-04-04T10:07:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "58d7a9c13c...
2de0d03e-9ab3-419c-842a-228c198093e1
arnaud-neny/rePlayer
source/Replays/Psycle/psycle-helpers/src/psycle/helpers/mersennetwister.cpp
/* A C-program for MT19937, with initialization improved 2002/1/26. Coded by <NAME> and <NAME>. Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, <NAME> and <NAME>, All rights reserved. Redistribution ...
ALGO
0.99816
5.73567
{ "github_metadata": { "branch": "main", "commit_count": 866, "repo_created_at": "2023-04-06T16:55:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 75, "forks": 5, "issues": 6, "pull_requests": 0 }, "file_meta": { "content_id": "186451b83...
ee2589d8-5057-41f8-8357-303f2a63b9cf
ytw0728/BOJ
11404.cpp
#include <stdio.h> #include <vector> #define INF 99999999 using namespace std; int n, m; int dist[101][101]; int main() { scanf("%d", &n); scanf("%d", &m); for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (i == j) dist[i][j] = 0; else dist[i][j] = INF; } } for (int i = 0; i < m; i++...
ALGO
0.999995
3.880404
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2017-12-02T18:11:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd2c1f719...
45e71ebb-0cfa-451c-a491-ef88903cc1f4
aiamateur/miniprojects
CPP/Lafore/ch5/ch5problem12.cpp
#include <iostream> using namespace std; struct Fraction { int numerator; int denominator; }; Fraction fadd(Fraction, Fraction); Fraction fsub(Fraction, Fraction); Fraction fmul(Fraction, Fraction); Fraction fdiv(Fraction, Fraction); int main() { Fraction f1, f2, f3; char over; char operation; ...
ALGO
0.970378
5.085416
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-05-03T13:59:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d6b4c287f987...
ec607048-4bc0-44db-aef4-a4c73c70b87c
SuYuxi/yuxi
Algorithms/Greedy/621. Task Scheduler.cpp
//Greedy class Solution { public: int leastInterval(vector<char>& tasks, int n) { map<char, int> counter; int maxCount = 0; int maxNum = 0; for(char& task : tasks) { counter[task] += 1; if(counter[task] > maxNum) { maxNum = ...
ALGO
0.999989
6.28652
{ "github_metadata": { "branch": "master", "commit_count": 596, "repo_created_at": "2016-08-27T08:00:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "18dff5cf...
c4e9c2e0-6d80-498b-a56e-82d396cfff7e
ishandutta2007/codeforces-n
njwrz/normal/1555/F.cpp
#pragma GCC optimize(2) #include<bits/stdc++.h> #define ll long long #define gmax(x,y) x=max(x,y) #define gmin(x,y) x=min(x,y) #define F first #define S second #define P pair #define FOR(i,a,b) for(int i=a;i<=b;i++) #define rep(i,a,b) for(int i=a;i<b;i++) #define V vector #define RE return #define ALL(a) a.begin(),a.en...
ALGO
0.999965
4.009946
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:35:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1fcadb89fc6c...
57301359-efc0-435b-bb4c-15287760dc61
zhang35/PAT-Advanced-Level
1003.cpp
#include <iostream> #include <vector> #include <climits> #include <algorithm> using namespace std; int main(){ int n, m, c1, c2; cin >> n >> m >> c1 >> c2; vector<int> v(n); vector<vector<int> > e(n, vector<int>(n, INT_MAX)); for (int i=0; i<n; i++){ cin >> v[i]; } for (int i=0; i<m...
ALGO
0.999919
3.548444
{ "github_metadata": { "branch": "master", "commit_count": 124, "repo_created_at": "2020-01-18T13:03:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9d2e1b76...
d9e581cf-26ff-4b96-b057-00138ac4d8bc
guptanikshay/DSA
066_largest_rectangle_in_histogram.cpp
#include <bits/stdc++.h> using namespace std; vector<int> nextSmallEle(vector<int> arr, int n) { vector<int> ans(n); stack<int> st; st.push(-1); for (int i = n - 1; i >= 0; i--) { while (st.top() != -1 && arr[st.top()] >= arr[i]) st.pop(); ans[i] = st.top(); st.p...
ALGO
0.999833
5.293763
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2023-07-03T20:01:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fa7d9b3bb...
be087ffd-f190-4e04-994a-8f1a2c0baa06
ishandutta2007/codeforces-l
laycurse/normal/1343/E.cpp
#pragma GCC optimize ("Ofast") #include<bits/stdc++.h> using namespace std; void *wmem; char memarr[96000000]; template<class T> inline void walloc1d(T **arr, int x, void **mem = &wmem){ static int skip[16] = {0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; (*mem) = (void*)( ((char*)(*mem)) + skip[((unsigned...
ALGO
0.999854
4.448885
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:17:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "228ea26ddc73...
8adaeb4b-2cc6-4962-bb26-33abb1294200
SymbianSource/oss.FCL.sf.mw.classicui
ode/src/capsule.cpp
/************************************************************************* * * * Open Dynamics Engine, Copyright (C) 2001-2003 <NAME>. * * All rights reserved. Email: <EMAIL> Web: www.q12.org * * ...
TOOL
0.929279
5.235546
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2016-10-14T20:11:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9fa12412b2...
3bce666a-edab-43d6-8210-0281fd10a479
Pinkii-/Maxflow
entrega/main.cpp
#include "edmonds.hpp" #include "preflow.hpp" using namespace std; int personas, viajes; void printNetwork(Network n) { for (int i = 0; i < n.size(); ++i) { cout << endl << "El nodo " << i << " está conectado a: " << endl; for (auto it = n[i].begin(); it != n[i].end(); ++it){ cout << ...
ALGO
0.999958
4.257267
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2015-06-02T13:44:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9ab8588cb...
07455d65-c503-430a-8fc0-aca968cb86cc
fireofearth/acm
2019/sept21/g-graduation2.cpp
#include <iostream> #include <string> #include <vector> #include <stack> #include <set> using namespace std; void debug() { printf("DEBUG\n"); } void debug(int i) { printf("DEBUG: %d\n", i); } class Graph { public: Graph(int n) { if(n <= 0) throw std::invalid_argument( "n must be positive" ); ...
ALGO
0.999908
4.099351
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2018-02-11T09:05:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "26baf86bc...
b410c71b-8990-400b-8a00-63ac19685098
ShahjalalShohag/code-library
Basics/Bitwise Operations.cpp
#include<bits/stdc++.h> using namespace std; // Checks if kth bit of x is set (1) or not (0) int check_kth_bit(int x, int k) { return (x >> k) & 1; } // Prints the positions of all set (1) bits in binary representation of x void print_on_bits(int x) { for (int k = 0; k < 32; k++) { if (check_kth_bit(x, k)) { ...
ALGO
0.999266
5.946063
{ "github_metadata": { "branch": "main", "commit_count": 952, "repo_created_at": "2018-11-18T08:49:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3240, "forks": 840, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "0e14e...
ca4a8b09-325f-4d63-9d74-6f056ebed027
DanielCasquino/AED_EC6
isBalanced.cpp
#include <iostream> #include <vector> #include <queue> #include <cassert> #include <unordered_map> #include <cmath> using namespace std; /*INTEGRANTES: -><NAME> -><NAME> -> <NAME> */ struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int ...
ALGO
0.999881
5.52047
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-01-24T16:41:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f49144f64e7...
1bb420cf-c35c-4ba4-a9cd-26e526dec5eb
burritoOverflow/RayTracingInOneWeekend
src/config.cc
#include "config.h" #include <filesystem> #include <iostream> #include <string> #if defined(__APPLE__) #include <sstream> #endif std::string config::GetCurrentDateStr(const std::string& time_fmt_str) { auto t = std::time(nullptr); auto tm = *std::localtime(&t); std::ostringstream oss; oss << std::put_...
TOOL
0.915911
6.244617
{ "github_metadata": { "branch": "master", "commit_count": 89, "repo_created_at": "2023-08-20T18:02:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a8e771103...
5b0bc42b-5e23-428c-b450-186aa0a00f70
SeoWJ/CodingTest
CodingTest/'오픈채팅방'.cpp
#include <string> #include <vector> #include <unordered_map> using namespace std; vector<string> solution(vector<string> record) { vector<string> answer; unordered_map<string, string> userTable; for (unsigned int i = 0; i < record.size(); i++) { string command = record[i].substr(0, 5); string userId; string...
ALGO
0.960258
4.586961
{ "github_metadata": { "branch": "master", "commit_count": 181, "repo_created_at": "2020-12-12T06:07:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "59c23f13...
f313836a-b610-4831-8ed2-b8a1a829305d
ChandanTech2023/Algorithm_Sem-04
practical/matrix_multiplication.cpp
#include <iostream> using namespace std; int main() { int row1, col1, row2, col2, row, col; // Matrix 1: cout << "Enter no of rows in 1st Matrix : "; cin >> row1; cout << "Enter no of columns in 1st Matrix : "; cin >> col1; int matrix1[row1][col1]; cout << "Enter all elements of Matr...
ALGO
0.999538
4.022406
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-05-15T12:57:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "88e10cc1fd...
ad9f2e8b-6f4b-443e-97fb-798af0c94938
FelixMatrixx/BT_04_23521215_23521704_23521494_23521821_23521208_23521327
Bai007/Bai007.cpp
#include <iostream> #include <fstream> #include <iomanip> using namespace std; void Nhap(string, int[][100], int&, int&); void Xuat(int[][100], int, int); int main() { int b[100][100]; int k, l; Nhap("intdata01.inp", b, k, l); cout << "\nMa tran ban dau: "; Xuat(b, k, l); return 0; } void Nhap...
TOOL
0.917088
3.913658
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2023-10-15T03:27:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5f339ea49...
43298714-a875-4bc2-9737-742ea9e2f62d
cardiamc/SPM_Project
tsp_parallel_thread.cpp
/** * Parallel and Distributed Systems: Paradigms and Models * Accademic Year 2019/2020 * Final Project * <NAME> * Student ID: 530567 */ /* File: tsp_parallel_thread.cpp It contains the formalization of the Travelling Salesman Problem. Moreover it initialize its solutions by means of Genetic Algorithm....
ALGO
0.999918
5.081821
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2021-01-23T19:02:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a253bf975...
0640b2b7-fa32-4b49-9b93-0a3ebb7bb019
nguyenson2003/ontapk63
season 3 - ctdlgt/ctdl/vector.cpp
//cai dat vector by tichpx 25_10_2022 #include<bits/stdc++.h> using namespace std; #ifndef __my_vector_cpp__ #define __my_vector_cpp__ //Cai dat bo lap nguoc cho Vector template <class T> class vec_rit { T*cur; //vi tri tro hien thoi public: vec_rit<T>(T*c=NULL) {cur=c;} //ham tao vec_rit<T> &operator=(vec_rit...
TOOL
0.997342
3.666538
{ "github_metadata": { "branch": "main", "commit_count": 49, "repo_created_at": "2022-11-10T13:11:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "83ed5b448c5...
554fb694-5c6b-4d8a-b9a9-ade016e59000
ForMyPainandForMyWay/DIP_JackHomework
filter.cpp
#include "filter.h" // 卷积函数(串行),仅仅计算卷积的float结果,不保证数值大小 float colv(const Mat& orign, int midrow, int midcolumn, const Mat& kernel, const bool ProcessBrink = false) { float mid = 0; int covsize = (kernel.rows - 1) / 2; if (not ProcessBrink and (midrow - covsize < 0 or midcolumn - covsize < 0)) mid = orign.at<uchar>(...
ALGO
0.986649
4.368506
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-12-02T07:45:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2465c39017...
71c80e9f-1108-4c6c-833d-07b200023c8c
Ujala-2110/DSA_Cpp
DP/Binomial_coeff.cpp
#include <bits/stdc++.h> #define mod 1000000007 using namespace std; // Recursion /* int binomialCoeff(int n, int k) { if (k > n) return 0; if (k == 0 || k == n) return 1; return binomialCoeff(n - 1, k - 1) + binomialCoeff(n - 1, k); } */ // Memoization /* int binomialCoeff(int n, int k,vector<vector<int...
ALGO
0.999987
5.223604
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-07-14T13:16:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4da9acb2ae7d...
54a0d02e-0d5a-43cf-a6e8-dab7433cb5a8
believe-that-23/random-practise
B_Flip_the_Bits.cpp
#include <bits/stdc++.h> #include <cmath> #include <regex> #define fi first #define se second #define pb push_back #define mp make_pair #define ll long long #define all(x) (x).begin(),(x).end() #define vll vector<long long int> #define FAST ios_base :: sync_with_stdio (false); cin.tie (NULL) using namespace std; #defin...
ALGO
0.999995
3.976542
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-05-28T13:14:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5950de772184...
7f3ecc70-56fd-48c0-8808-14c0d1a01407
ajaysharma388/Compititive_Programming_CB
Recursion and Backtracking/Lec16_quick_sort_algorithm.cc
#include <bits/stdc++.h> using namespace std; #define ll long long int #define vi vector<int> #define vii vector<vector<int>> #define pb(x) push_back(x) #define ppb() pop_back() #define endl "\n" void fastio(bool read = false) { if(read) { #ifndef ONLINE_JUGDE freopen("input.txt","r",stdin); freopen("output.tx...
ALGO
0.999978
5.439641
{ "github_metadata": { "branch": "master", "commit_count": 72, "repo_created_at": "2020-03-30T06:38:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "03e24784c...
36dc32f7-0947-4f48-b487-d766060cfa22
kimtaehyun98/Jandi
2021.8/boj_2565.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; int dp[107][2]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, x, y; cin >> n; vector<pii>v; for (int i = 0; i < n; i++) { cin >> x >> y; v.push_back(pii(x, y)); } sort(v.begin(), v.end()); // ...
ALGO
0.999991
4.189597
{ "github_metadata": { "branch": "main", "commit_count": 337, "repo_created_at": "2021-07-26T12:19:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8f85567f03...
3be2f779-09a5-404c-9d22-5982de0e8967
Gaurav-singh101/Strivers-A2Z-DSA-Course
BinarySearch/2-D Array/Median in a Row wise sorted/Optimal.cpp
#include<bits/stdc++.h> using namespace std ; int upperBound(vector<int> &arr , int x , int n){ int low = 0 , high = n - 1 ; int ans = n ; while(low <= high){ int mid = (low + high) / 2 ; if(arr[mid] > x){ ans = mid ; high = mid - 1; }else{ low =...
ALGO
0.999974
5.369034
{ "github_metadata": { "branch": "main", "commit_count": 143, "repo_created_at": "2024-10-22T15:56:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "073ace9f2b...
edccbc82-f90a-4925-be18-a38aa593ddfd
AdrianPrice/Domain-Independent-Deception
centroids-minimun_covering/landmark-downward/src/search/cegar/abstraction.h
#ifndef CEGAR_ABSTRACTION_H #define CEGAR_ABSTRACTION_H #include "types.h" #include "../task_proxy.h" #include "../utils/collections.h" #include <memory> #include <vector> namespace cegar { class AbstractState; class RefinementHierarchy; class TransitionSystem; /* Store the set of AbstractStates, use AbstractSe...
ALGO
0.98691
6.242219
{ "github_metadata": { "branch": "main", "commit_count": 77, "repo_created_at": "2022-07-31T03:49:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "52860c8a241...
5907a7a0-955c-4ba7-9fc7-3519b90778ce
pr0g/sdl-bgfx-imgui-as_1d-nonlinear-transformations
math-utils.cpp
#include "math-utils.h" as::quat getRotationBetween(const as::vec3& u, const as::vec3& v) { float k_cos_theta = as::vec_dot(u, v); float k = std::sqrt(as::vec_length_sq(u) * as::vec_length_sq(v)); if (k_cos_theta / k == -1) { // 180 degree rotation around any orthogonal vector return as::quat(0.0f, as::...
ALGO
0.944138
6.927436
{ "github_metadata": { "branch": "main", "commit_count": 339, "repo_created_at": "2020-09-26T16:35:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7b95078922...
91aa262e-02a2-4491-9f84-d9a5381a0412
munh-orgil/leetcode
2024/10. oct/(20) 1106. Parsing A Boolean Expression.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: Solution() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } vector<bool> rec(const string& s, int l, int r) { int n = s.size(); vector<bool> ret; for (int i = l; i < r;...
ALGO
0.999878
4.665958
{ "github_metadata": { "branch": "main", "commit_count": 430, "repo_created_at": "2024-01-03T02:25:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "87f22eb1b8...
1b998d8e-fb88-4bad-be6a-d3174feefecc
cy2016-1/Robotway-Open-Robots
212/OverallTest/OverallTest.ino
/*------------------------------------------------------------------------------------ 版权说明:Copyright 2022 Robottime(Beijing) Technology Co., Ltd. All Rights Reserved. Distributed under MIT license.See file LICENSE for detail or copy at https://opensource.org/licenses/MIT by 机器谱 2022-...
TOOL
0.950812
3.87668
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2024-03-17T13:55:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b2a98c6b6...
492a9b51-801f-4bf4-a055-5b903fc85e2d
woshiZS/CS_learning
games101hmwk/GAMES101_Homework6_S2021/Homework6/Assignment6/Bounds3.hpp
// // Created by <NAME> on 5/16/19. // #ifndef RAYTRACING_BOUNDS3_H #define RAYTRACING_BOUNDS3_H #include "Ray.hpp" #include "Vector.hpp" #include <limits> #include <array> class Bounds3 { public: Vector3f pMin, pMax; // two points to specify the bounding box Bounds3() { double minNum = std::num...
ALGO
0.959477
7.033152
{ "github_metadata": { "branch": "master", "commit_count": 95, "repo_created_at": "2020-08-10T13:01:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2be3b1471...
ab758754-242d-4bf1-8ea0-7c1c75fba169
ash-stark-lm/Codeforces-Soln
1979A - Guess the Maximum.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define fo(i, n) for (int i = 0; i < n; i++) #define inputarr(arr, n) \ for (int i = 0; i < n; i++) \ cin >> arr[i]; #define endl "\n" #define ...
ALGO
0.999942
4.369756
{ "github_metadata": { "branch": "main", "commit_count": 51, "repo_created_at": "2024-12-20T07:04:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a1b78e78acc...
2191264e-2c8f-4062-b733-d7815fd6076a
DVLPR-AMDIN/shivom-dsa-files
Stack/FallingWater.cpp
#include <bits/stdc++.h> using namespace std; int FallingWater(int arr[], int n) { stack<int> st; int pl[n]; int nl[n]; for (int i = 0; i < n; i++) { while (!st.empty() && st.top() <= arr[i]) { st.pop(); } if (st.empty()) { pl[i] = -1; ...
ALGO
0.999988
4.663023
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2024-08-09T14:11:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0f94117cd78...
b1f6abf2-a8a3-4c95-bbe7-4031c4518567
NephrenCake/Algorithm
AcWing/算法基础课/第二讲 数据结构/838. 堆排序.cpp
#include <iostream> using namespace std; const int N = 1e5 + 10; int n, m, a[N]; void down(int i) { int t = i; if (i * 2 <= n && a[t] > a[i * 2]) t = i * 2; if (i * 2 + 1 <= n && a[t] > a[i * 2 + 1]) t = i * 2 + 1; if (t != i) { swap(a[i], a[t]); down(t); } } int ...
ALGO
0.999979
3.742735
{ "github_metadata": { "branch": "master", "commit_count": 91, "repo_created_at": "2022-03-05T10:21:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "96c546ff0...
eb38e4e4-76fe-4ec4-86c6-80621f8439f3
zwynepsena/Process-Management-System
src/execution_functions.cpp
#include "execution_functions.h" #include <iostream> void read_process_file(const char *filename, PROCESS_MANAGER *pm) { FILE* processFile = fopen(filename, "r"); if (!processFile) { printf("File could not be opened.\n"); return; } PROCESS_QUEUE pq; initialize_process_queue(&pq); ...
TOOL
0.910572
4.252243
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-01-05T19:02:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "04a8c4190b3a...
694dc54b-2926-4dfd-a9c8-910fd4ef36d4
xdai02/Data_Structure_and_Algorithm
code/C++/Chapter4/4-3/postfix.cpp
#include <iostream> #include <string> #include <stack> #include <sstream> using namespace std; double calculate(const string expression) { stack<double> s; stringstream ss(expression); string token; while (ss >> token) { if (token == "+") { double right = s.top(); s.po...
ALGO
0.999848
6.062261
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2021-03-28T12:20:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8c4986610ce...