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
736cf372-0164-4972-a2bc-89a4378b6b06
lipsapraharaj/data-structures
Sorting_And_Searching/Sorting.cpp
#include<iostream> #include<conio.h> #include<process.h> using namespace std; template <class T> class sort { private: T array[size]; T i,j,k,count=0; public: void swap(T,T); void bubblesort(T,T); void insertsort(T,T); void selectionSort(T,T); }; /* ...
ALGO
0.99988
4.174254
{ "github_metadata": { "branch": "master", "commit_count": 180, "repo_created_at": "2020-08-12T12:41: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": "fc51ca5c...
d4d2cb06-22e0-4d41-ac87-19bb009a8013
AlexanderClanton/Multi-Threaded-Radix-Sorter
radix.h
#include <vector> /* * Parallel Radix Sort with support for Most Significant Digit sorting only. * * If allowed to use ten cores or more, should sort a large set of randomly * selected unsigned integers apromixmately ten times faster than a single * threaded sort of the same random set. * * Whilst the choice of...
ALGO
0.999844
6.579355
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-08-15T03:23: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": "e3c570b369fb...
2f087c82-fc45-4b38-b52a-8b5966fb38dc
tusharmohod/DSA
Strings/AlphabetBoardPath.cpp
string getMovement(int curr, int target) { int dx = target % 5 - curr % 5; int dy = target / 5 - curr / 5; char cx = (dx > 0) ? 'R' : 'L'; char cy = (dy > 0) ? 'D' : 'U'; if(curr == 'z' - 'a') { return string(abs(dy), cy) + string(abs(dx), cx); } else { return strin...
ALGO
0.999876
5.522675
{ "github_metadata": { "branch": "master", "commit_count": 142, "repo_created_at": "2022-03-21T15:47: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": "b242c0ec...
ec5e7ef7-de8d-4897-8fea-c6abec483c2a
merisabesirovic/OOP1-cpp
Vocnjak.cpp
// (укупно 70 поена) Написати на језику C++ следеће класе (класе опремити оним конструкторима, // деструктором и операторима доделе који су потребни за безбедно и ефикасно коришћење класа): // • (15 поена) Воћка има назив, реалан годишњи приход и целобројан животни век изражен у // годинама који се задају при стварању ...
ALGO
0.905612
3.431548
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2023-04-11T15:22:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d6af92038fa...
9a2861bb-e6f4-4a79-bfd6-6948879d05d6
yashk9293/Striver-A2Z-Sheet
Step 03 - Arrays/Lec 2/02_Sort 0's 1's and 2's.cpp
// Question Link - https://leetcode.com/problems/sort-colors/ // Sort Colors // Method - 1 // T.C = O(N) + O(N) // S.C = O(1) class Solution { public: void sortColors(vector<int>& arr) { int cnt_0 = 0, cnt_1=0; for (int i=0; i<arr.size(); i++) { if(arr[i] == 0) { cnt_0+...
ALGO
0.999876
5.823769
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-05-19T17:36:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9c1fedeaedd4...
4b2ed85f-232e-4df4-b0b1-b4365179b237
m4oughi/100DaysofCode
pureCPP/0033. Day 33/Multithreading Basics/016. stdtry_lock/003. Using stdtry_lock for Resource Sharing/main.cpp
#include <iostream> #include <thread> #include <mutex> std::mutex resourceA; std::mutex resourceB; void accessResourceAFirst() { if (std::try_lock(resourceA, resourceB) == -1) { // Try locking both resources std::cout << "Thread 1 locked Resource A and Resource B" << std::endl; std::this_thread::...
ALGO
0.950392
5.407862
{ "github_metadata": { "branch": "main", "commit_count": 67, "repo_created_at": "2024-08-31T09:18:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e63b6d3d79f...
7a2735b1-2ede-4f38-8d6d-d1323db83d63
shirishbahirat/algorithm
msr.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: Solution() : arr{6, 5, 4, 1, 2, 8, 3, 9} {} void msort(int arr[], int lo, int mid, int hi) { int ln = mid - lo + 1; int lm = hi - mid; int left[ln], right[lm]; for (int i = 0; i < ln; ++i) { left[i]...
ALGO
0.999982
5.362834
{ "github_metadata": { "branch": "main", "commit_count": 1988, "repo_created_at": "2021-02-19T04:26:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fc5ebbf38...
50829b6e-68d5-436b-8277-4ed731e654fe
vbonnici/grafe-sim
analysis/data/p03170/s980327843.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(ll i = 0; i < (n); ++i) #define repA(i, a, n) for(ll i = a; i < (n); ++i) #define repD(i, a, n) for(ll i = a; i > (n); --i) #define trav(a, x) for(auto& a : x) #define all(x) x.begin(), x.end() #define sz(x) (long long) (x).size() #define fill(a) memse...
ALGO
0.999993
4.128946
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-07-10T13:21: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": "4bea36b1c73...
9f04b93a-48dc-47b0-be54-cf8cf03f62ad
jmfaleiro/multiversioning
include/concurrent_queue.h
// Author: <NAME> (<EMAIL>) // CACHE_PAD macro stolen from Corey (http://pdos.csail.mit.edu/corey/) // #ifndef CONCURRENT_QUEUE_HH #define CONCURRENT_QUEUE_HH #include <stdint.h> #include <cstddef> #include <iostream> #include <cassert> #include <cstring> #include "util.h" #include "machine.h" #define CACHE_PAD 6...
TOOL
0.907867
6.531308
{ "github_metadata": { "branch": "master", "commit_count": 175, "repo_created_at": "2014-09-16T00:16:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ad8ad36c...
e28a8743-595e-46e2-898e-0298a810528b
danwsong/programming-contests
CCC/2006/S5.cpp
#include <bits/stdc++.h> using namespace std; int main() { int rows, cols, lonely, full, birth; cin >> rows >> cols >> lonely >> full >> birth; int original = 0; for (int r = 1; r <= rows; r++) { string row; cin >> row; for (int c = 1; c <= cols; c++) { origina...
ALGO
0.999561
3.715629
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2019-02-21T19:11: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": "25771e527...
87fd2cd8-8487-4ae1-a3eb-e6f0566a1a5c
BassBoulder/CPlusPlus
C++/Udemy Professor/Section 9 Challenge/If statements.cpp
#include <iostream> using namespace std; int main() { int num{}; const int min{ 10 }; const int max{ 100 }; cout << "Enter a number between 10 and 100" << endl; cin >> num; if (num < min) { cout << "============= IF STATEMENT #1 ============= " << endl; int diff(min - num); cout << "Your number is: " ...
TOOL
0.967403
3.584336
{ "github_metadata": { "branch": "PROD", "commit_count": 125, "repo_created_at": "2023-03-09T10:48:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6b3c916314...
d4ab165a-73fc-4eae-9722-e3c5b9401cd3
aman1-2/Programming-Pratice
C++ Programs/25 Greedy Algorithm/3_fractional_knapsack.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; bool compare(pair<int, int> p1, pair<int, int> p2) { return p1.first > p2.first; } //Time complexity is - O(nlogn) int knapsack(vector<int> &value, vector<int> &weight, int totalWeight) { vector<pair<int, int>> ratio; //Vector for st...
ALGO
0.999962
4.985022
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2024-12-07T16:41: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": "57f6b7866...
90a051f7-0021-4c7a-859a-8bc6754ab21f
physicallaw/BOJ-Algorithm
DFS와 BFS/1260/1260.cpp
#include <algorithm> #include <iostream> #include <queue> using namespace std; void dfs(vector<vector<int>> &, vector<int> &, int); void bfs(vector<vector<int>> &, vector<int> &, int); int main() { int n, m, l, a, b; cin >> n >> m >> l; vector<vector<int>> v(n); for (int i = 0; i < m; ++i) { cin...
ALGO
0.999989
3.73158
{ "github_metadata": { "branch": "main", "commit_count": 242, "repo_created_at": "2022-01-03T23:28:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 5, "pull_requests": 0 }, "file_meta": { "content_id": "7c4591cb8f...
32688c4d-7761-4239-9277-22e72b23e683
DavidMax2006/The-Materials-Of-Cpp-
InsertSort.cpp
#include <iostream> using namespace std; void sertSort(int a[], int len) { for (int i = 1; i < len; ++i) { int key = a[i]; int left = 0, right = i-1; while (!(left > right)) { //在区间内查找位置 int middle = (left + right) / 2; if (a[middle] > key) right = middle-1; else left = middl...
ALGO
0.999987
4.391585
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2019-03-16T06:04: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": "297cfbee3...
8652af6b-95db-4172-b210-80c1f0548870
xforcevesa/pytorch-riscv64-oe24
third_party/XNNPACK/src/f32-igemm/MRx8-wasmsimd32-x86-splat.cc
// Copyright 2023 Google LLC // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #include <cstddef> #include <wasm_simd128.h> #include <xnnpack/assembler.h> #include <xnnpack/microparams.h> #include <xnnpack/post-operation.h> #include...
ALGO
0.961086
3.027349
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-06-26T06:06:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "93d77472d93...
7b854187-dfcd-4570-82e4-99d271373549
gaoneto/maratona
Tokyo 2012/stylish.cpp
#include <bits/stdc++.h> using namespace std; #define MAX 20 #define INF 1000000000 typedef pair<int, int> pii; typedef pair<int, pii> piii; const int N=22; char sp[N][4*N], sq[N][4*N]; //cnt[line][r/c/s][open/close][text p/q] int cnt[N][3][2][2], cp[N]; void add(int i, int t, char c) { if(c=='(') cnt[i][0][0][t]...
ALGO
0.999173
3.246512
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2013-07-22T17:46:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3513b9269...
53c62a32-8d89-4728-9241-016b8ffcab71
ashokplvd001/cpp_training
Assignments/28_4_day10/problem22.cpp
/* Description :A code is considered valid only if its first non-zero digit from the left is even. Write a program that extracts the first non-zero digit and checks if it's even. Auther : <NAME> ( 293950 ) Date of Creation : 28-4-24 DAte of modification : 28-4-24 Vesrion : 0.1 */ #include <iostream> int problem22Fun...
ALGO
0.999095
5.370366
{ "github_metadata": { "branch": "main", "commit_count": 55, "repo_created_at": "2025-04-25T15:57: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": "28cfa8c1b0a...
ea391588-d54a-41d4-a7bf-b2c292369c09
iASL-Gifu/aichallenge2023-integration-final
src/universe/autoware.universe/planning/obstacle_avoidance_planner/include/obstacle_avoidance_planner/eb_path_smoother.hpp
// Copyright 2023 TIER IV, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
ALGO
0.99903
7.30243
{ "github_metadata": { "branch": "main", "commit_count": 156, "repo_created_at": "2023-11-03T01:53:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3a6c037bd54...
1dbf47b6-707c-485d-a280-51ceba147d2a
NullAwe/competitive-programming
cses/introductory-problems/PalindromeReorder.cpp
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; vector<int> d(26); for (int i = 0; i < str.size(); ++i) ++d[str[i] - 'A']; int odds = 0; for (int num : d) if (num % 2 == 1) ++odds; // Outputs if we cannot create a palindrome: if (odds > 1) { cout << "NO SOLUTION" <<...
ALGO
0.999998
4.534768
{ "github_metadata": { "branch": "master", "commit_count": 893, "repo_created_at": "2021-08-19T17:09:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d0f0c2f6...
facd972c-26b4-4d7e-9b22-64239e897b38
SI-Abid/ACM
S2E22/e.cpp
#include "bits/stdc++.h" using namespace std; #define ll long long #define ull unsigned long long #define pb push_back #define mp make_pair #define F first #define S second #define be begin() #define en end() #define rb rbegin() #define re rend() #define all(x) (x).begin(),(x).end() #define out cout<<setprecision(20) ...
ALGO
0.999599
3.253975
{ "github_metadata": { "branch": "main", "commit_count": 109, "repo_created_at": "2021-03-04T15:16: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": "23c23ed1cd...
5b89d1a0-8f02-4018-83eb-e2ec79ba07d6
himanshusagar/CS759_HPC
HW08/msort.cpp
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include "msort.h" using std::vector; void insertionSort(vector<int>& vec, int begin, int end) { //Simple insertion sort implementation for vec size less than threshold for(int j = begin + 1; j <= end; j++) { int key = vec...
ALGO
0.999985
5.577643
{ "github_metadata": { "branch": "main", "commit_count": 115, "repo_created_at": "2022-12-24T18:44:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5c7eb54a97...
79b5d112-b4fd-4955-ba52-b63e5e0867da
Shariar365/Cisc-3142
exercise-7/rectangle.cpp
#include <iostream> #include<cmath> using namespace std; class Rectangle { private: float length; float width; public: void setlength(float); void setwidth(float); float perimeter(); float area(); void show(); int sameArea(Rectangle); }; void Rectangle::setlength(float l) { length = l; } void Rectang...
TOOL
0.990044
4.142703
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2022-09-07T01:50:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d95a0a8753d...
49309957-b0af-43c8-a2fd-733fb1a6619f
ASHISHYADAV85270/DataStructureAndAlgo
BINARY_SEARCH/adityaverma/book_allotment.cpp
#include <bits/stdc++.h> #include <iostream> using namespace std; class Solution { public: int arraySum(int a[], int n) { int initial_sum = 0; return accumulate(a, a + n, initial_sum); } int min_element_values(int A[], int N) { int m_e = -1; for (int i = 0; i < N; i+...
ALGO
0.999975
4.495173
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-09-02T07:52: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": "dcbd086f685d...
af8ff753-030b-4a37-b820-36232c7f6c8a
mansi05041/LeetCode
2444-count-subarrays-with-fixed-bounds/2444-count-subarrays-with-fixed-bounds.cpp
class Solution { public: long long countSubarrays(vector<int>& nums, int minK, int maxK) { long long count =0; int lastInvalidEle = -1; // track the last invalid element in array int lastMinIdx = -1; // track the index of min value in the last of subarray int lastMaxIdx = -1; // trac...
ALGO
0.999718
5.919178
{ "github_metadata": { "branch": "main", "commit_count": 995, "repo_created_at": "2022-09-25T06:10: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": "394c31f4c8...
8d7916cd-dd59-4401-8247-d8fe53156c7f
MatiasE/ParadigmasDeProgramacion
Estructurado/C++/Ejercicio23.cpp
#include <iostream> #include <vector> using namespace std; /* Ej. MI-24: Dada una serie de M pares {color, número} que corresponden a los tiros de una ruleta. Se pide informar: 1. cuántas veces salió el número cero y el número anterior a cada cero 2. cuántas veces seguidas llegó a repetirse el color ...
ALGO
0.999056
4.402038
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-11-28T15:21: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": "fc9540647343...
165b6bf9-c6d0-4653-83ef-806490f53aa4
Ecolash/Data-Structures-Algorithms
Graphs for CP/graphs8.cpp
// 0-1 BFS IMPLEMENTATION #include <bits/stdc++.h> using namespace std; #define ll long long #define pl pair<ll, ll> #define vl vector<long long> #define vvl vector<vl> #define vp vector<pl> ll MAX = 1e9; #define F first #define S second #define mset(m, v) memset(m, v, sizeof(m)) const int N = 1e5; /* -------------...
ALGO
0.999929
3.962928
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2024-06-14T19:57:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e19834840...
2dfee4a4-90df-4aa1-8577-e2006aa284d9
MaiPhuongne/btvn
Hàm.tinhtong.cpp
#include <iostream> using namespace std; void Nhap_day_so (int a[] , int n) { for (int i=0 ; i < n ; i++) { cout << "a[" << i << "]= "; cin >> a[i]; } cout << endl; } void Hien_thi_day_so (int a[] , int n) { for (int i = 0 ; i < n ; i++) { cout << a[i] <<" "; } cout <<...
ALGO
0.968041
3.286007
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-03-22T01:02:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c69da2167afb...
a4be92f4-be6c-4e0d-a42b-61a0f83c7b39
mjjq/ballEngine
source/Simulation/CollisionEngine/contactPoints.cpp
#include <iostream> #include <SFML/Graphics.hpp> #include <cmath> #include <thread> #include <limits> #include <tuple> #include <cassert> #include "collisionDetection.h" #include "Math.h" #include "stringConversion.h" void Collisions::generateContacts(PhysicsObject* p1, PhysicsObject*p2, ...
ALGO
0.999305
5.058388
{ "github_metadata": { "branch": "master", "commit_count": 468, "repo_created_at": "2018-01-26T23:47:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 10, "pull_requests": 0 }, "file_meta": { "content_id": "b47e0ba...
1d7b8e14-1659-4805-b958-150b201479c5
ziyaArslan34/mySolutions
addNodes.cpp
#include <iostream> #include <cstdlib> #include <ctime> typedef struct _ll { int data; _ll *next; }ll; ll *add(ll *l, int num) { if(l == NULL) { ll *list = (ll*)malloc(sizeof(ll)); list->data = num; list->next = NULL; return list; } ll* temp; temp = l; while(temp->next != NULL) { temp = temp->next;...
ALGO
0.999262
3.886198
{ "github_metadata": { "branch": "main", "commit_count": 294, "repo_created_at": "2021-10-11T19:09:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "33eac8b64e...
dfe13899-6b07-42c6-b357-5d9b13c072d5
hyperk/Geant4
source/4.9.6.p04/source/processes/hadronic/models/radioactive_decay/src/G4BetaFermiFunction.cc
// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration...
ALGO
0.99244
4.899076
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2015-01-26T21:29:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 11, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2410393c358...
ea58f68d-c886-4f47-bc0f-3a58f5ec0592
PJ-Leyden/cs_projects
cs2/profiler/sort.cpp
/** * @brief Application to run sorting algorithms on random int data * * @author <NAME> * @date 2012-04-19 */ //============================================================================== #include "sort_lib.h" #include <iostream> #include <iomanip> #include <vector> #include <cstdlib> //==================...
ALGO
0.997998
5.665092
{ "github_metadata": { "branch": "master", "commit_count": 141, "repo_created_at": "2018-09-22T17:32:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "34732a8d...
e7d8195f-c5ac-45c6-a700-29b6edc3158b
Vladnwx/Labs
lr3/mod4.cpp
// Задача 4 #include <iostream> #include <conio.h> #include <windows.h> int main(int argc, char *argv[]) { SetConsoleOutputCP(CP_UTF8); std::cout << "\033[2J\033[H"; // Очистка экрана и перемещение курсора int mas[] = {2, 5, -8, 1, -4, 6, 3, -5, -9, 13, 0, 4, 9}; constexpr int n = sizeof(mas) / size...
ALGO
0.999929
4.409728
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2025-03-20T09:53:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "07f0a952139...
5c29a1d5-13c4-44b6-b671-dab8057097df
zsz12251665/CodeHub
POJ/3233/POJ.3233.0.cpp
#include <cstdio> #include <cstring> using namespace std; const int SIZE = 30; typedef long long Matrix[SIZE][SIZE]; int n, k, m; Matrix A, S, P, T, M, tmp; void add(const Matrix &a, const Matrix &b, Matrix &res) // Matrix addition { for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) res[i][j] = (a[i][j] + b...
ALGO
0.999985
3.531287
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2021-01-17T12:53: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": "084a69a07...
524b87d3-0a16-407a-8809-e312f4bc8835
raincross7/code-similarity
codes/train_code/problem252/problem252_138.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll X ,Y,A,B,C; cin >> X >> Y >> A >> B >> C; vector<ll> p(A,0); vector<ll> q(B,0); vector<ll> r(C,0); for(int i = 0; i < A; i++) cin >> p[i]; for(int i = 0; i < B; i++) cin >> q[i]; for(int i = 0; i < C; ...
ALGO
0.999847
3.145646
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07: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": "348b7146b9eb...
e8bcaaf4-8ff0-474b-9803-4e1bf18fa53d
ray569569/coding
ooplab/lab11.cpp
#include <algorithm> #include <fstream> #include <iostream> #include <map> #include <set> #include <vector> using namespace std; class I { public: string type, name; int value; bool friend operator<(I a, I b); protected: int f; }; bool operator<(I a, I b) { if (a.type < b.type) { ...
ALGO
0.960472
3.446569
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2023-02-06T11:41:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "75ec3690f22...
4403f7f1-c534-48de-b7c3-fd79788e9994
HarshSahuH/DSA-Questions
Delete middle element of a stack - GFG/delete-middle-element-of-a-stack.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: //Function to delete middle element of a stack. void deleteMid(stack<int>&s, int sizeOfStack) { // code here.. ...
ALGO
0.999208
6.178236
{ "github_metadata": { "branch": "main", "commit_count": 1034, "repo_created_at": "2023-02-18T11:46:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c87af9993...
fb69ad28-5c01-438d-9a87-9c2b9b05aa95
G33k1973/CodingGames
TheXORproblem.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; using ui = unsigned int; #define pb push_back vector<ui> p2; void init() { for (ui i = 0; i < 32; ++i) { ui val = 1 << i; p2.pb(val); } return; } ui UpdateValue(ui x) { ui y = x; string bstring(32, '0'); int j = 31; int k = -1; int c = 0; fo...
ALGO
0.999995
4.937186
{ "github_metadata": { "branch": "master", "commit_count": 151, "repo_created_at": "2019-05-03T07:17:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "050f0a4e...
5203e865-3f4d-4c04-b215-4243a68f9b87
milkyicedtea/infoclass
Secondo anno/C++/Puntatori/Puntatori.cpp
// Puntatori.cpp : This file contains the 'main' function. Program execution begins and ends there. #include <iostream> #include <cstdlib> using namespace std; int x = 1; int y = 2; int z = 3; int *pointer1 = &x; int *pointer2 = &y; int *pointer3 = &z; void maggiore() { if (*pointer1 > *pointer2) { ...
TOOL
0.998796
4.917503
{ "github_metadata": { "branch": "master", "commit_count": 157, "repo_created_at": "2021-10-17T13:36:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a1a31920...
b708d21a-33a0-4fdc-bcb0-8efad8e80e28
zdeneklapes/prl-mpi-game-of-life-2
life.cpp
/* * Game of Life * Author: <NAME> <<EMAIL>> (xlapes02) * Date: 2024-04-14 * Description: Parallel implementation of the Game of Life using MPI. (Wrap-around) * Compile: mpic++ -o life life.cpp * Run: mpirun -np <number of processes> ./life <path to the game field file> <number of steps> * <number of processes>...
ALGO
0.999848
6.21622
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-04-01T14:52:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6ba5e935d4f...
1fa17de6-1e26-4a4e-9bfe-6b174dd6d458
dhasane/geometria-computacional
ejercicios/test_simplex/simplex.cxx
#include <CGAL/Distance_2/Line_2_Line_2.h> #include <CGAL/Surface_mesh/Surface_mesh.h> #include <functional> #include <iostream> #include <CGAL/Cartesian.h> #include <CGAL/Surface_mesh.h> using TKernel = CGAL::Cartesian< double >; using TReal = TKernel::FT; using TPoint = TKernel::Point_3; using TLine = TKernel::Line...
ALGO
0.997635
4.687768
{ "github_metadata": { "branch": "main", "commit_count": 90, "repo_created_at": "2023-02-28T00:02: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": "c810a60bf63...
41093c27-899d-4f8c-9024-30564e0478ce
yhalcyon/Interesting_Problems
WOW the game/equipment.cpp
/* A cpp program for mimic the game 'WOW'*/ /* This the part II of the program*/ /* The production of the warriors: * given the * 1. first line: the number of test cases * 2. second line: an interger number, means the * value of the life source at the beginning. * 3. third line: five integers, means the initi...
ALGO
0.99778
3.767758
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2015-09-21T20:34: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": "e2137cf76a...
ef83dce9-670f-4271-ac62-c8940f1e233c
ydb-platform/ydb
library/cpp/digest/old_crc/crc.cpp
#include "crc.h" #include <library/cpp/digest/old_crc/crc.inc> #include <util/system/defaults.h> static const ui64 CRCTAB64[256] = { ULL(0x0000000000000000), ULL(0xE543279765927881), ULL(0x2FC568B9AEB68983), ULL(0xCA864F2ECB24F102), ULL(0x5F8AD1735D6D1306), ULL(0xBAC9F6E438FF6B87), ULL(0x...
ALGO
0.956946
5.816659
{ "github_metadata": { "branch": "main", "commit_count": 35208, "repo_created_at": "2022-02-07T14:52:36.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4512, "forks": 701, "issues": 2263, "pull_requests": 682 }, "file_meta": { "content_id": ...
ff226ea3-8317-465b-a9b2-3496bbc7b457
Kaminyou/MyLeetcode
cpp_solutions/1900.cpp
class Solution { public: int dp1[30][30][30]; int dp2[30][30][30]; vector<int> earliestAndLatest(int n, int firstPlayer, int secondPlayer) { return dp(n, firstPlayer, secondPlayer); } vector<int> dp(int n, int a, int b) { if (a + b == n + 1) return {1, 1}; if (dp1[n][a][b] !=...
ALGO
0.99994
4.989809
{ "github_metadata": { "branch": "main", "commit_count": 1983, "repo_created_at": "2022-04-30T05:11:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 3, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "6e2c0aef...
b6a5096b-d398-4766-b272-b50456fcf1d9
ArnabSaha1999/DSA
CPP/Trie/LexicographicalNumber/main.cpp
#include<iostream> #include<vector> #include<unordered_map> using namespace std; // TrieNode represents a single node in the trie class TrieNode { public: // Map to store child nodes unordered_map<char, TrieNode*> children; // Flag to indicate if the node represents the end of a word bool isEndOfWord;...
ALGO
0.999765
6.510127
{ "github_metadata": { "branch": "main", "commit_count": 993, "repo_created_at": "2021-07-30T13:40:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d87f823623...
444b6f04-0789-4d46-a92d-4a6b5155a2e7
Thenaidn/codetree_practice
241128/트리 순회법 변경 2/change-tree-traversal-2.cpp
#include <iostream> #include <vector> #include <unordered_map> using namespace std; // 후위 순회 결과를 계산하는 재귀 함수 void buildPostOrder(const vector<int>& preorder, const vector<int>& inorder, int preStart, int preEnd, int inStart, int inEnd, unordered_map<int, int>& indexMap, vector<...
ALGO
1
6.475601
{ "github_metadata": { "branch": "main", "commit_count": 870, "repo_created_at": "2024-10-15T07:46:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c70ab6f13e...
44aa15f2-e4f8-457b-84ea-7c3bd23d333f
wjialei/DuringColloge
sophomore/Data Structure/DSHW5/5/5.5.1/TBTree.h
#pragma once /* 1. 将新节点作为的s的左孩子插入线索二叉树。 4. 实现一个函数按先序遍历二叉树。给出时间和空间复杂度。 时间复杂度为O(n), 空间复杂度为O(1)。 */ #include <iostream> #include <stack> using namespace std; template<class Type> class ThreadedNode { template<class Type> friend class ThreadedTree; public: ThreadedNode(Type d) { data = d; } private: Type data;...
ALGO
0.990075
3.738473
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-01-16T13:21: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": "2c1dde3e21...
52f4266e-d613-43a8-bc60-6b7020a46789
n0IQ/Competitive-Programming
codeforces/1463/B.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define mp make_pair #define ff first #define ss second #define vi vector<int> #define pii pair<int, int> #define all(x) x.begin(),x.end() #define mod 1000000007 #define ps(x,y) fixed << setprecision(y) << x #...
ALGO
0.999899
4.054422
{ "github_metadata": { "branch": "main", "commit_count": 1677, "repo_created_at": "2022-06-02T21:26: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": "c7913467a...
e9cc70b6-ee34-4aac-84be-6257b00eab14
GDieser/Ejercicios-C-1C
2 - C++ CONDICIONALES/eje12.cpp
#include <iostream> using namespace std; /*Hacer un programa para leer tres números diferentes y determinar e informar el número del medio. Sugerimos probar CADA UNA de las siguientes 6 combinaciones. N1=8, N2=6, N3=10. Valor del medio: 8. N1=8, N2=10, N3=6. Valor del medio: 8 N1=6, N2=8, N3=10. Valor del medio: 8. N...
ALGO
0.999217
3.907886
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2024-04-07T15:25: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": "0a8a7e8b8e1...
d73072fd-239f-4059-82f7-213352bc2664
HPC-Fortran2CPP/Fortran2Cpp
data/readable_format/cpp/file1686.cpp
#include <iostream> #include <vector> void fd(const std::vector<double>& data_in, std::vector<double>& df_out, int N, double dx, int kd) { std::vector<double> temp_data_in(N + 2 * kd); std::vector<double> cd1(9); // For coefficients -4 to 4, but in 0-based indexing // Copy data_in to the middle part of te...
ALGO
0.999818
5.892608
{ "github_metadata": { "branch": "main", "commit_count": 95, "repo_created_at": "2024-04-05T20:02:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13, "forks": 5, "issues": 55, "pull_requests": 0 }, "file_meta": { "content_id": "1d487a92ce...
cab1cce7-c257-462b-bf73-bdfb78ffd4a1
wesley-archives/tiny-backends
src/fatec/dsa/cpp/alg_search_binary.cpp
// ----------------------------------------------- // Lab. : VETORES - OPERACOES DE BUSCA // Ano/S: 2022/1S // Atividade: Binary Search // ----------------------------------------------- #include <iostream> #include <vector> int binarySearch(const std::vector<int>& arr, int target) { int left = 0; int right =...
ALGO
0.999926
6.578807
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2025-05-30T17:16:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b27b5e6cb7f2...
2a0084cd-9f12-4c03-b0ac-259e2bb7af4b
Hoangtruong48/DSA
chiadetri/chiavatri_luythuamatran.cpp
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long const int MOD = 1e9 + 7; struct matrix { ll a[2][2]; matrix operator * (matrix b){ matrix res; for (int i = 0; i < 2; i++){ for (int j = 0; j < 2; j++){ res.a[i][j] = 0; for (int k = 0; k < 2; k++){ res.a[i][j]...
ALGO
0.999952
3.662381
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-12-04T10:48:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef5a9b1bb20d...
1ca179ed-5cc1-46ff-9d2c-f8201aa06606
the-stranded-alien/Competitive_Programming_CPP
03_Mathematics/02_Combinatorics/01_Birthday_Paradox_Problem.cc
#include<iostream> using namespace std; // Birthday Paradox Problem // What Is The Minimum Number Of People That Should Be // Present In A Hall So That There's N % Chance Of Two // People Having The Same Birthday ? int main(){ // X Denotes The Probability Of 2 People Having Same B'day. float x = 1.0; int...
ALGO
0.999876
3.679885
{ "github_metadata": { "branch": "master", "commit_count": 349, "repo_created_at": "2020-06-19T10: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": "c3390644...
040111b3-ce07-4f97-9bb1-b325fabd9654
Furqan1208/Hotel-Reservation-System-DSA
HRS.hpp
#define HRS_HPP #include <iostream> #include <string> #include <conio.h> #include <fstream> #include <cstdlib> #include <algorithm> #include <sstream> using namespace std; // Structure for client information struct Client { string name; string email; string contactNo; string username; string pass...
ALGO
0.99064
6.427608
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-08-10T03:42:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "35393df33fa1...
9f01eb32-0bef-469e-85e1-b7b429eaa29c
pocafup/my-code
flower3.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; vector<vector<int> > vec; vector<int> memory; int grid[101][101]; int vis[101]; int a,b; int dfs(int num, int curr, int pa){ if (curr == pa) return 0; int my = 0; vis[num] = true; for (int i=0;i<b;i++){ if (!vis[i]){ // i...
ALGO
0.999671
3.274201
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2020-02-20T04:14:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "51965bd8b...
9645b47a-b565-4a7e-8470-276cd1d83ed1
xxng1/algorithm
goormlevel/194982/1. 장마/장마.cc
#include <iostream> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> home(N); vector<bool> visited(N, false); for (int i = 0; i < N; i++) { cin >> home[i]; } for (int i = 0; i < M; i++) { int a, b; cin >> a >> b; fo...
ALGO
0.999997
4.270517
{ "github_metadata": { "branch": "main", "commit_count": 128, "repo_created_at": "2024-03-06T01:37: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": "833edd56b7...
0bf12178-7066-478f-9cd7-3c613c72aaea
Slin58/Medieninformatik
jGehring/Raytrace-XCode/raytrace/Ray.cpp
#include "Ray.h" #include "math.h" #include "float.h" using namespace std; /*----------------------------------------------------------------------------*/ /* shade arbeitet den folgenden Algorithmus ab: */ /* Schneide den Sichtstrahl mit jedem Objekt. Merke, welches Objekt den */...
ALGO
0.999531
4.444109
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-12-10T15:11: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": "1f25783b06c...
37fd7fef-7fa1-43e0-afe0-e923bda21251
ompl/ompl
src/ompl/geometric/planners/informedtrees/BITstar.h
/********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2014, University of Toronto * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the followi...
ALGO
0.997813
5.659156
{ "github_metadata": { "branch": "main", "commit_count": 4948, "repo_created_at": "2014-05-20T14:22:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1776, "forks": 636, "issues": 80, "pull_requests": 28 }, "file_meta": { "content_id": "063...
08428e7b-b103-4157-a465-2217f468ec2f
minseok-oh/problem-solving
SWEA/1209-Sum/solution.cpp
#include <bits/stdc++.h> using namespace std; int board[100][100]; void input() { int count; cin >> count; for (int i = 0; i < 100; i++) { for (int j = 0; j < 100; j++) { cin >> board[i][j]; } } } int getLineSum(int line) { int col_result = 0, row_result = 0; f...
ALGO
0.99974
4.205509
{ "github_metadata": { "branch": "main", "commit_count": 169, "repo_created_at": "2022-06-14T14:16: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": "e7bf9a07ff...
f7ade477-1904-4f63-b260-f506ddd720e1
sugaim/egret
src/core/math/solver/newton1d.h
#pragma once #include <ranges> #include <concepts> #include <functional> #include <list> #include "iteration_result.h" namespace egret::math::solver { // ----------------------------------------------------------------------------- // [struct] newton1d_iteration_log // -----------------------------------------------...
ALGO
0.999808
6.239286
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2022-10-18T13:52: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": "d212c853d37...
9432a07b-4b83-4d08-b3fb-73a56dbdf32a
thegamer1907/Code_Analysis
contest/1542576971.cpp
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back #define fio ios::sync_with_stdio(0),cin.tie(0),cout.tie(0) using namespace std; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<vi> vvi; typedef long long ll; int n,k; int type[16]={}; int bc(int x) { in...
ALGO
0.999877
3.979298
{ "github_metadata": { "branch": "master", "commit_count": 73, "repo_created_at": "2019-05-24T10:35:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd60b2e6e...
beb89a40-6211-4f8a-a2b7-61d26223c603
jopemachine-playground/algorithm-practice
Programmers/Level2/43162.cpp
#include <string> #include <vector> #include <unordered_set> using namespace std; class DisjointSet { public: vector<int> parents; DisjointSet(int n) { parents = vector<int>(n); for (int i = 0; i < n; ++i) parents[i] = i; } int find(int u) { if (parents[u]...
ALGO
0.999977
5.743088
{ "github_metadata": { "branch": "master", "commit_count": 519, "repo_created_at": "2019-06-28T10:30:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "554030de...
aad795d2-c2c7-4606-a8bf-c7a2a680a0bf
iquintasALT/DOME
utils/ray_cast.h
#ifndef RAYCAST_H_ #define RAYCAST_H_ #include "Vector2D.h" #include "Collisions.h" #include <array> #include <limits> #include <list> #include "../utils/checkML.h" #include "../ecs/Entity.h" #include "../ecs/Manager.h" class Transform; class Entity; class RayCast { private: Point2D origin_ = Point2D(); Vector2D di...
ALGO
0.966101
6.789577
{ "github_metadata": { "branch": "main", "commit_count": 1770, "repo_created_at": "2021-02-15T18:41:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6ed328bb3...
f634d37b-21aa-4e32-956a-d3473a069e74
mitsu-a/cp_library
modint.hpp
#include<bits/stdc++.h> /* 実行時modint: template<int &mod> struct Fp{}; int main(){ static int mod;cin >> mod; using mint = Fp<mod>; } */ template<int mod> struct Fp{ long long x; constexpr Fp(const long long _x=0)noexcept:x((_x%mod+mod)%mod){} constexpr Fp operator-()const noexcept{ return x...
ALGO
0.999703
4.412848
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-07-03T08:19: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": "0741b76382d4...
b7abc57f-86fd-4182-857d-c0d3147ca947
kitkat1424/Basic-Algos
Sorting Algorithms/quicksort.cpp
//Coded by ~AS //25th June 2023 //QUICKSORT #include<bits/stdc++.h> using namespace std; int partition(int *array, int p, int r); //Where p is the first index and r is the last index void quicksort(int* array, int p, int r); int main() { int arr[10] = {10, 9, 4, 7, 1, 5, 8, 3, 2, 6}; quicksort(ar...
ALGO
0.999984
5.604359
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2023-06-24T17:52:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0c9fbf308f7...
1692dad0-c9af-4f24-86c1-5f0cc4cbdd99
bholagabbar/algorithmic-programming
Code/WorkspaceB/C++_Files/CF/Practice/558_C.cpp
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define pii pair<int,int> #define mp make_pair #define f first #define s second //Created by <NAME> [bholagabbar] int visited[1000005]; int cnt[1000005]; int steps[1000005]; int a[1000005]; int main() { ios_base::sync_with_stdio(false); //freopen(...
ALGO
0.99995
3.59495
{ "github_metadata": { "branch": "master", "commit_count": 90, "repo_created_at": "2015-08-24T18:02:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 24, "forks": 17, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ec207de...
5850f87b-46ab-47ff-9d7f-3d885e28e5b6
tstanvir/mySolutionRepo
codeforces/758/B.cpp
#include<bits/stdc++.h> using namespace std; const long long MOD = 1000000007; #define SET(x) memset(x, 0, sizeof(x)) #define SETBOOL(x) memset(x,false,sizeof(x)) #define CLR(x) memset(x, -1, sizeof(x)) #define mp make_pair #define PII pair<int, int> #define pf printf #define sf scanf #define ALL(x) x.begin(),x.end...
ALGO
0.996815
3.277459
{ "github_metadata": { "branch": "master", "commit_count": 1669, "repo_created_at": "2021-03-31T23:56:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "094d58b...
96fe1075-b14a-470f-b799-2d10f344acc1
astaXmjy/my_algo
todo or jodo/quick_sort.cpp
#include <bits/stdc++.h> using namespace std; int partition(vector<int> &arr, int low, int high) { int pivot = arr[high]; int i = low - 1; for (int j = low; j <= high-1; j++) { if (arr[j] < pivot) { i++; swap(arr[i], arr[j]); } } swap(arr[i + 1]...
ALGO
0.99997
5.765349
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2024-06-27T09:48:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0ce206004...
02141de9-4450-42ce-b5b1-05790e7685b5
shaihitdin/CP
Olymp/CF/306/E1.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 100; int n, a[N], ans[N]; bool op[2][2]; inline void no () { cout << "NO\n"; exit (0); } inline void yes () { cout << "YES\n"; for (int i = 1; i < n; ++i) { if (ans[i] == -2) { cout << "(("; } else if (ans[i] == -1) { cout << "("; }...
ALGO
0.999986
3.678598
{ "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": "f903683b6...
e076cd87-318d-471a-b2c3-ecc091d62c29
lorensen/VTKExamples
src/Cxx/Graphs/AdjacencyMatrixToEdgeTable.cxx
/* The output is: 10 20 30 40 50 60 70 80 90 +-----------------+------------------+ | | value | +-----------------+------------------+ | 2 | 30 | | 1 | 20 | | 0 | 10 | | 2 | 60 | ...
ALGO
0.968244
5.089052
{ "github_metadata": { "branch": "master", "commit_count": 5302, "repo_created_at": "2017-05-07T19:12:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 358, "forks": 159, "issues": 24, "pull_requests": 2 }, "file_meta": { "content_id": "be...
138a373f-fc21-4d0d-933a-3ba975ac901d
tarunpodavu1/dsa_gfg
arrays/waveArray.cpp
#include<iostream> #include<vector> using namespace std; // Given a sorted array arr[] of distinct integers. Sort the array into a wave-like array and return it // In other words, arrange the elements into a sequence such that arr[1] >= arr[2] <= arr[3] >= arr[4] <= arr[5]..... // Input: // n = 5 // arr[] = {1,2,3,4,...
ALGO
0.999996
5.419766
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2021-10-13T17:06: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": "518799ba8...
b557a68b-0370-47d1-8127-2d469dae8c47
morsalins/UVA
10004 - Bicoloring.cpp
#include <cstdio> #include <iostream> #include <vector> #include <algorithm> #include <bitset> #include <functional> #include <map> #include <cstring> #include <string> #include <sstream> #include <set> #include <stack> #include <queue> #include <cctype> #include <math.h> #include <cstdlib> using namespace std; #defi...
ALGO
0.999053
4.386797
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2015-01-22T17:29: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": "437b9ffa2...
6a0e9651-9a92-4670-851e-6a7fe6ef1f22
0xamitdutta/Leetcode-Solutions
Kth Largest Element in an Array.cpp
// You can sort or use a min heap which are 2 basic solutions // Using quickselect class Solution { public: int findKthLargest(vector<int>& nums, int k) { int low = 0, high = nums.size()-1; k = nums.size() - k + 1; while(low <= high){ int pivot = partition(nums, low, high); ...
ALGO
0.999991
5.766277
{ "github_metadata": { "branch": "master", "commit_count": 540, "repo_created_at": "2020-02-28T17:03: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": "156ca4c7...
72f4f581-1621-48d0-a79d-005d4f301966
tmuttaqueen/MyCodes
Online Judge Code/codeforces/Codeforces Round #558 (Div. 2)/D.cpp
#include<bits/stdc++.h> using namespace std; #define ld long double #define intl long long #define pii pair<int,int> #define xx first #define yy second #define mp make_pair #define pb push_back #define SZ(x) (int)(x).size() #def...
ALGO
0.999969
3.620721
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-01-27T09:25: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": "434c8359ec...
7815042f-1d6b-4b93-bddf-4edc26310332
SxmCodes/coding
love/tail_head_ll.cpp
#include <bits/stdc++.h> using namespace std; class node { public: int data; node *next; node(int val) { data = val; next = NULL; } }; void insertAtTail(node *&head, int val) { node *n = new node(val); if (head == NULL) { head = n; return; } node *...
ALGO
0.999787
4.37209
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2022-01-24T11:39: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": "fbba4f006...
44eadb50-f225-43cf-8940-1b58df07c566
sailor-ux/mycodes
leetcode_vscode/leetcode_110/leetcode_110.cpp
#include <iostream> #include <vector> using namespace std; 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), left(...
ALGO
0.999959
5.383337
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2019-10-11T08:27:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0246ba2f027...
e8d04eb6-376b-44fe-801f-71ee074f9e1e
satashun/algorithm
test/learning/four_element.cpp
#pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; template <class T> using V = vector<T>; template <class T> using VV = V<V<T>>; #define pb push_back #define eb emplace_back #define mp make_pair #define fi fi...
ALGO
0.999796
4.753439
{ "github_metadata": { "branch": "master", "commit_count": 249, "repo_created_at": "2019-03-01T07:54:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "53a3c4c2...
3363d4fe-65a1-405e-b1af-7fe5ff1ee580
xuwei5311/leetcode
leetcode recovery binary search tree.cpp
// leetcode recovery binary search tree.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <stack> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; void inordertraverse(TreeNode *root) { if(!root) r...
ALGO
0.999998
5.87152
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2018-03-29T02:33: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": "98f7e58c19...
861800af-2276-46f2-a30a-ff0d70e25ea7
nvcc1701/dsa
dsa_a_loc/contest10_two_pointer/bai11_sum_of_three_values.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll LINF = 1e18 + 5; const int INF = 1e9; const int MOD = 1e9 + 7; const int MAX = 1e6 + 5; int main() { #ifndef ONLINE_JUDGE freopen("../input.txt ", "r", stdin); freopen("../output.txt ", "w", stdout); #endif ios::sync_with_stdio(f...
ALGO
0.999998
4.887081
{ "github_metadata": { "branch": "master", "commit_count": 199, "repo_created_at": "2020-10-06T05:07:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b1ba5bda...
91eb93cf-ad3d-4f71-b469-8309ea8373b6
Jack1eNgBaro/JustCp
CodeForces/C++20 (GCC 11-64)/1846D | Rudolph and Christmas Tree/212654836.cpp
#include<bits/stdc++.h> #define MOD 1000000007 #define fi first #define se second #define ll long long #define ii pair<int,int> #define Dennis "" #define heap_max(a) priority_queue<a> #define heap_min(a) priority_queue<a, vector<a>, greater <a>> #define all(x) (x).begin(), (x).end() #define pb push_back #define eb empl...
ALGO
0.999708
3.654884
{ "github_metadata": { "branch": "main", "commit_count": 896, "repo_created_at": "2024-06-16T11:06:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bf60f30c95...
a76543e8-5f60-4115-bdc6-eca4fdfd8ff4
tanveer-shaikh-90/DataStructresUsingCpp
c++ Tuturial/Graphs&Trees/kruskalAlgoVersion2.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 7; // This DFS will check for the cycle void dfs(int vertex, int parent, vector<vector<int>> g, vector<bool> vis, bool &check) { if (vis[vertex]) { check = true; return; } vis[vertex] = true; for (...
ALGO
0.999973
4.562872
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-07-26T01:00: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": "f56d4b67d9c1...
689c1b8b-1055-487c-8a3e-66d614f3153c
dwax1324/baekjoon
code/2567 색종이 - 2.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define pii pair<int, int> #define pic pair<int, char> #define pci pair<int, char> #define pipii pair<int, pii> #define pll pair<long, long> #define sz(x) (int)(x).size() #define ff(begin, i, end) for (__typeof(end) i = (b...
ALGO
0.999519
4.239518
{ "github_metadata": { "branch": "main", "commit_count": 116, "repo_created_at": "2020-11-07T09:27: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": "ed88e5cdc5...
75f84269-5c1a-4914-bb80-209f8f0cf89d
Ruslan515/Competitions
coding/Leetcode/Tasks/task_1086.cpp
// https://leetcode.com/problems/high-five/description/?envType=study-plan-v2&envId=premium-algo-100 // Created by omega515 on 22.07.24. // #include <bits/stdc++.h> using namespace std; class Solution { public: vector<vector<int>> highFive(vector<vector<int>> &items) { ios_base::sync_with_stdio(false); ...
ALGO
0.999948
5.92753
{ "github_metadata": { "branch": "main", "commit_count": 271, "repo_created_at": "2022-05-31T16:17:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e9533ff15f...
693d4591-5daf-449d-a9ff-cf3f3434b15b
GadyPu/OnlineJudge
hdu/1228 A + B.cpp
#include<algorithm> #include<iostream> #include<cstdlib> #include<cstring> #include<cstdio> #include<string> #include<vector> #include<map> #include<set> using std::map; using std::cin; using std::cout; using std::endl; using std::vector; using std::string; #define sz(c) (int)(c).size() #define all(c) (c).begin(), (c)....
ALGO
0.999891
3.794677
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2016-05-21T12:18: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": "07b8f9688f...
5e35db38-ad9a-4a29-bd4e-92d5b6a3d018
kingroryg/DSA
CPP/SegmentTrees.cpp
//saru95 #include <fstream> #include <iostream> #include <string> #include <cstring> #include <complex> #include <math.h> #include <utility> #include <cmath> #include <set> #include <vector> #include <map> #include <cctype> #include <queue> #include <stdio.h> #include <cstdio> #include <stack> #include <algorithm> #inc...
ALGO
0.998951
3.569006
{ "github_metadata": { "branch": "master", "commit_count": 403, "repo_created_at": "2015-08-20T16:27:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 108, "forks": 178, "issues": 2, "pull_requests": 52 }, "file_meta": { "content_id": "d8e...
0dffc1e9-c41f-4a21-99a3-3a41ab292e96
digant2482/CSES
C++/TreeAlgorithms/PathQueries.cpp
#include <bits/stdc++.h> typedef long long ll; int n, q; int array[200005]; int start[200005]; int end[200005]; ll s_tree[800005]; std::vector<int> tree[200005]; void update(int pos, int node) { pos += 2*n; s_tree[pos] = node; pos >>= 1; while (pos >= 1) { s_tree[pos] = s_tree[2*pos] + s_t...
ALGO
0.999856
4.244388
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2023-07-12T13:06:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4e4dfb170ed...
554b2c9a-3eca-435f-a707-d62849f736e2
markunya/hse_projects
tasks/poly/poly.cpp
#include <unordered_set> #include "poly.h" size_t Pow(int64_t value, size_t power) { size_t result = 1; for (size_t i = 0; i < power; ++i) { result *= value; } return result; } Poly::Poly() { monomials_ = {}; } Poly::Poly(std::vector<int64_t> monomials) { for (size_t i = 0; i < monomi...
ALGO
0.994074
5.798925
{ "github_metadata": { "branch": "main", "commit_count": 259, "repo_created_at": "2023-04-03T16:27:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ce566acad6...
d075712c-a28f-4ded-a882-c82526b68556
weichnn/aero_detection
src/Tracker.cpp
#include "Tracker.h" #include "System.h" #include "CameraModel.h" namespace devo { Tracker::Tracker() { _unfound_count = 0; } Tracker::~Tracker() { } bool Tracker::findCircleCenter_Color(cv::Mat image_input, Vec3 &result_return) { int th = 10; int num = 0; cv::Mat image; cv::undistort(image_inp...
ALGO
0.996709
4.149272
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2018-11-18T02:06: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": "feae3916f...
dc196685-cd42-488f-9598-8a25a30746c0
ancrs/LeetCode
82_Remove Duplicates from Sorted List II.cpp
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1->2->3->3->4->4->5, return 1->2->5. Given 1->1->1->2->3, return 2->3. /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNo...
ALGO
0.99993
4.162824
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2016-05-18T03:17:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3b60e45afe...
31fa1279-61e9-4285-ae9e-8788708b71c4
Priyo002/DSA
ACD Ladder/1300/25A-IQ_Test.cpp
#include<bits/stdc++.h> using namespace std; #define int long long #define pb emplace_back #define setbits(x) __builtin_popcountll(x) #define zerobits(x) __builtin_ctzll(x) #define endl '\n' #define sort(X) sort(X.begin(),X.end()) const int mod = 1e9 + 7; const long long INF = 1e18; void init() { ios::sync_with_stdi...
ALGO
0.999961
3.849075
{ "github_metadata": { "branch": "master", "commit_count": 238, "repo_created_at": "2023-06-21T09:23:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "685db9c1...
a2ebb43c-eb02-4478-b535-b1cc579a6adb
Sinha-Gaurav/Boid-Simulation
Boid Simulation/simulation.h
#include "flock.h" #include "SFML/Window.hpp" #include "SFML/Graphics.hpp" #ifndef SIMULATION_H #define SIMULATION_H /** * Class to handle the instantiation of a flock of boids, the model to compute the next step in the stimulation, and to handle all of the program's interaction with SFML. */ class Simulation { pr...
TOOL
0.977339
5.279031
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-07-06T08:55:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "68024177f9d8...
0447dbb1-9c97-434e-a5d2-1363cf4b4337
king2125252/learnningC-
025_quickSort/main.cpp
#include <iostream> #include <iomanip> #include <cstdlib> #include <ctime> using namespace std; void showArray(int* ary, int from=0, int to=0, int countPerLine = 10, int widthPerNum = 6){ for(int i = from; i < to; i++) { if(i % countPerLine == 0) { cout << endl; } cou...
ALGO
0.999274
4.263739
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2024-05-03T00:17: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": "a79fc2556d...
e2a019f8-a8a9-40ec-b0ba-3ae8dc810f12
Bayyys/Algorithm
Leetcode/practice/450.delete-node-in-a-bst.cpp
/* * @lc app=leetcode.cn id=450 lang=cpp * @lcpr version=30111 * * [450] 删除二叉搜索树中的节点 */ // @lcpr-template-start using namespace std; #include <algorithm> #include <array> #include <bitset> #include <climits> #include <deque> #include <functional> #include <iostream> #include <list> #include <queue> #include <stac...
ALGO
0.999998
6.920284
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2024-03-06T08:58: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": "5e6b56bc871...
315b4d8b-9a65-41fa-b4ee-99b269698bcb
pranavsindura/CompetitiveProgramming
topcoder/IterateOverACube.cpp
#include <bits/stdc++.h> #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define sz(x) ((int)x.size()) #define ln(x) ((int)x.length()) #define mp make_pair #define pb push_back #define ff first #define ss second #define endl '\n' #define dbg(x) cou...
ALGO
0.99992
4.607449
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2021-01-26T05:15:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "54162999a...
808db39d-6182-41bf-90ef-2bac9adfb2a9
c2gup/DSA-Notes
Array/class1-3rdQ.cpp
#include <iostream> using namespace std; void printReverse(int arr[], int size) { int left = 0; int right = size - 1; while (left <= right) { swap(arr[left], arr[right]); left++; right--; } } int main() { int size = 5; int arr[size] = {1, 2, 3, 4, 5}; cout << "Ori...
ALGO
0.999933
5.714466
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2024-05-22T05:35: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": "d28dacd28b1...
21a023f5-1615-4f0b-867e-9d9e42238ea9
YingshuoZhang22/leetcode
分治/quickSort.cpp
#include <iostream> #include <vector> using namespace std; void quicksort(vector<int>& v, int l, int r) { if (l >= r) return; int mid = v[l + (r-l) / 2], lptr = l - 1, rptr = r + 1; while (lptr < rptr) { do lptr++; while(v[lptr] < mid); // 这里必须写mid,不能写v[l + (r-l) / 2] do rptr--; while(v[...
ALGO
0.999996
4.761454
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2021-09-14T12:32:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "06bb6eebbd34...
c8b8cc75-3c4c-4147-9f0f-b760b730956a
TaahirKolia/Beginner-CPP-Gomoku-Project
main.cpp
#include <iostream> #include <fstream> #include<cstdlib> #include "gomoku.h" #include <iomanip> using namespace std; int main() { //Declare input and output variables ifstream inputData; ofstream outputData; //Open input and output files inputData.open("input.txt"); outputData.open("gomokuResult...
ALGO
0.998884
4.04605
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2022-12-02T18:31:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "88bcbd51abad...
9c265ed9-4ac5-4fd4-9b9b-5abdc5b356fb
levilelis/psvn
chen/ida/Solver.h
#ifndef Solver_h__ #define Solver_h__ #include <time.h> #include <iostream> #include <iomanip> #include <map> #include "../../AbstractionHeuristic.h" using namespace::std; #define getNodesExpandedByLevel 1 //#define getNodesExpandedByLevelByIteration 1 //#define MAX_SEARCH_DEPTH 63 //#define VERBOSE class Solver {...
ALGO
0.999858
3.907338
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2019-02-06T03:10:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1024c8351...
92b3f2cf-c08c-4ba9-9fd9-b91ed75cc670
SouthLotus/TheFuckingBrain
TheFuckingBrain/tool/MathTool.cpp
#include "MathTool.hpp" #include <vector> #include <cstdio> #include <glm\glm.hpp> #include <chrono> glm::mat3 matht::changeBasis(glm::vec3 nxb, glm::vec3 nyb, glm::vec3 nzb) { nxb = glm::normalize(nxb); nyb = glm::normalize(nyb); nzb = glm::normalize(nzb); return glm::mat3( glm::vec3(nxb.x, nxb.x, nzb.x), glm...
TOOL
0.987585
3.459863
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2018-04-15T11:40: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": "2b47b34f8...
75f96f69-f955-4286-acfd-3fe5273c993f
okpyo12/Algorithm
Algolab-Algorithm(2022)/KMP/Fail/KMP_Fail.cpp
#include <iostream> using namespace std; #define MAX_SIZE 1001 int patLength, txtLength; int fail[MAX_SIZE]; int KMP(char text[], char pattern[]); void getFail(char pattern[]); int main() { int numTestCase; cin >> numTestCase; for (int i = 0; i < numTestCase; i++) { string a, b; cin >...
ALGO
0.999379
4.310421
{ "github_metadata": { "branch": "master", "commit_count": 821, "repo_created_at": "2021-08-06T11:23:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c344826a...
2dc44b5f-f22e-4192-a8fb-309cdb9a5734
vaibhavmangla07/C-PLUS-PLUS
08 Vector & Array/17_Spiral_Matrix.cpp
// Spiral Matrix #include<bits/stdc++.h> using namespace std; vector<int> spiralOrder(vector<vector<int>>& matrix) { vector<int> result; if (matrix.empty() || matrix[0].empty()) { return result; } int n = matrix.size(); int m = matrix[0].size(); int row_start = 0; ...
ALGO
0.999991
6.161241
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2024-08-26T09:02: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": "a95d3f155e2...