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
42399ca8-9f91-430f-b4f4-75bb52b2f50f
pavankumar130/LeetCode
4-median-of-two-sorted-arrays/median-of-two-sorted-arrays.cpp
class Solution { public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { int n1 = nums1.size(); int n2 = nums2.size(); // Make nums1 small always if(n1 > n2){ return findMedianSortedArrays(nums2,nums1); } int low = 0, high = n1; ...
ALGO
0.999994
6.322857
{ "github_metadata": { "branch": "main", "commit_count": 1593, "repo_created_at": "2023-07-28T14:09: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": "722a4fedc...
ff44999c-2432-41b5-bbe9-e9866f4554c3
ishandutta2007/codeforces-r
radewoosh/normal/717/B.cpp
//#ifndef LOCAL //#define NDEBUG //#endif #include <bits/stdc++.h> using namespace std; #define sim template < class c #define ris return * this #define dor > debug & operator << #define eni(x) sim > typename \ enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) { sim > struct rge { c b, e; }; sim > rge<c...
ALGO
0.999924
3.272735
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:58: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": "fa42d6ebb4cc...
235b050e-c81d-4bcf-8376-3e74da327737
Manzood/CodeChef
Starters/Starters-86/D/D.cpp
#include "bits/stdc++.h" #ifdef local #include "custom/debugger.h" #else #define debug(...) 42; #endif using namespace std; #define int long long int dfs(int node, vector<vector<int>>& adj, vector<int>& subtree, vector<bool>& vis) { if (vis[node]) return 0; vis[node] = true; subtree[node] = 1; ...
ALGO
0.999985
4.816647
{ "github_metadata": { "branch": "master", "commit_count": 61, "repo_created_at": "2020-03-01T16:35: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": "104d190fa...
57336fbf-54de-4712-b174-730d8f79739f
codersyl/leetcode
cpp/cpp_1000-/1036_need_do.cc
// C++ // leetcode 1036 // https://leetcode-cn.com/problems/escape-a-large-maze/ // out of memory class Solution { public: int dirs[5] = {-1, 0, 1, 0, -1}; bool isEscapePossible(vector<vector<int>>& blocked, vector<int>& source, vector<int>& target) { int s[1000000][1000000]; memset(s, 0, sizeof(s)); ...
ALGO
0.999501
5.59583
{ "github_metadata": { "branch": "main", "commit_count": 138, "repo_created_at": "2021-06-23T05:02: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": "38094f3f04...
dea1e24d-503a-406a-9675-cc8292e6e6a8
legendsovermyths/DSA
C++/PrimitiveCalculator_test.cpp
#include <iostream> #include <climits> #include <vector> #include <list> void primitive_calculator(int64_t number) { std::vector<int64_t> min_steps(number + 1, INT_MAX); std::list<int64_t> *path = new std::list<int64_t>[number + 1]; min_steps[0] = 0; min_steps[1] = 0; path[0].push_back(0); path[...
ALGO
0.999974
4.350076
{ "github_metadata": { "branch": "master", "commit_count": 159, "repo_created_at": "2020-09-28T20:13: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": "6e520300...
8f06d08c-0117-4db2-a7cc-2070242853ee
afraztahir231/Tic_Tac_Toe_Game_CPP
2020041_1D_Array_Implementation.cpp
#include <iostream> #include <ctime> #include <cstdlib> using namespace std; void display (); void display_array ( char* ); void replace_array ( char* ); void player_turnX ( char* ); void computer_turnO ( char* ); void player_turnO ( char* ); void computer_turnX ( char* ); void delay ( int ); int main () { int play_...
ALGO
0.982481
3.324165
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-04-19T00:26: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": "8e06237c31f2...
10f7ef06-8259-4dee-9355-1a7abe114f5a
keineahnung2345/leetcode-cpp-practices
1039. Minimum Score Triangulation of Polygon.cpp
//recursion //TLE //73 / 93 test cases passed. class Solution { public: int minScoreTriangulation(vector<int>& A, int i, int j) { // if(j == 0) j = A.size()-1; //we cannot find a k between i and j if(j - i < 2) return 0; int res = INT_MAX; for(int k...
ALGO
0.999975
5.299047
{ "github_metadata": { "branch": "master", "commit_count": 2080, "repo_created_at": "2018-11-25T06:48:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 284, "forks": 120, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "69b...
db63222b-353d-4594-85de-340d0c5338b9
SWEG-2014-EC-Batch/Ravenclaw
FoP-I/Michael Kumilachew/Playing_with_digits.cpp
#include <iostream> #include <math.h> using namespace std; int menu; int num; int rem; int digit; int numDigit; int r = 0; long factorial; int i; int main() { cout << "1. Reverse of number" << endl; cout << "2. Number of digits " << endl; cout << "3. Sum of digits" << endl; cout << "4. Product of eve...
ALGO
0.98027
3.088708
{ "github_metadata": { "branch": "main", "commit_count": 421, "repo_created_at": "2023-03-11T05:18:31.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "0cb262a4a38...
dba04deb-e27a-4c89-bc03-4c71de1bd627
abhayarya91/Classes_C-_start
STCK_ARR.CPP
//#include <iostream> //using namespace std; // //int top = -1; // //void push(int stack[], int size); //void pop(int stack[]); //void peek(int stack[]); //void display(int stack[]); // //int main() //{ // int stack[100]; // int size; // int choice; // // cout << "\nEnter size of stack: "; // cin >> size...
ALGO
0.994729
4.264375
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-09-20T11:56: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": "590b5832fa01...
b2117e38-fabe-47b3-bef6-a1f819cbb4d6
BryanValeriano/marathon
codeforces/gym/imeUspTryOuts16/f.cpp
#include <bits/stdc++.h> using namespace std; #define fr(i,n) _back #define pb push_back #define eb emplace_back #define mk make_pair #define fi first #define se second #define endl '\n' typedef long long ll; typedef pair<int,int> ii; typedef vector<ii> vii; const int INF = 0x3f3f3f3f; const double PI = acos(-1.0); c...
ALGO
0.999948
4.122269
{ "github_metadata": { "branch": "master", "commit_count": 188, "repo_created_at": "2018-07-19T13:13:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7b0294db...
e7aff2a7-43e1-4f18-bfe4-7a10e80bee91
chandrakeshram/LinkedList
DoublyLinkedList.cpp
/*********************<NAME>***************************/ /*=======================PROBLEM STATEMENT==============*/ #include <bits/stdc++.h> using namespace std; class Node{ public: int data; Node* next; Node* prev; Node(int val){ data=val; next=NULL; prev=NULL; } }; vo...
ALGO
0.999852
4.512988
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2022-01-19T05:37: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": "7ca0dfb9009...
5442e242-f7a4-4f37-ac3a-66e2fa5e1114
yusei-wy/atcoder
abc/cpp/172_c.cpp
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; int main() { ll N, M, K; cin >> N >> M >> K; vector<ll> A(N), B(M); vector<ll> a(N + 1, 0), b(M + 1, 0); rep(i, N) { cin >> A[i]; a[i + 1] = a[i] + A[i]; } rep(i, M) { cin ...
ALGO
0.999972
3.714318
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2020-08-31T10:36: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": "5107c30cb...
3695b0e7-47c8-42f2-9abc-3f146ed24347
petarjukic/OOP_vjezbe
Vjezba10/main.cpp
#include <fstream> #include <iostream> #include<string> #include <iterator> #include <vector> #include<algorithm> #include"Vece.h" #include"Manje.h" #include"Usporedba.h" using namespace std; bool comp(string a, string b) { return stoi(a) < stoi(b); } int main() { vector<string> v; string line; try{ ifstream...
ALGO
0.997591
3.598216
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-06-29T15:04: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": "eee6047aea...
e3bbddc5-fe5e-418d-b4aa-213aa3c182c0
FresherDev/CP-setup-code
Graph/Exercise/781C.cpp
#include <bits/stdc++.h> using namespace std; #define Cerr cerr << "\nTest: " #define endl "\n" #define mp make_pair #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define fastio { ios_base::sync_with_stdio(false), cin.tie(NULL); ...
ALGO
0.999989
3.780697
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-08-10T08:09:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ee8b1623b6...
60736683-4f58-46fc-977d-6944a1da7e34
yancouto/competitive-programming
ojs/cf/790C.cpp
#include <bits/stdc++.h> using namespace std; #define fst first #define snd second typedef long long ll; typedef pair<int, int> pii; #define pb push_back const ll modn = 1000000007; inline ll mod(ll x) { return x % modn; } #ifdef ONLINE_JUDGE # define debug(args...) {} #else # define debug(args...) fprintf(stderr, args...
ALGO
0.99994
3.655881
{ "github_metadata": { "branch": "master", "commit_count": 143, "repo_created_at": "2016-08-26T11:17:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0d167f85...
e4808899-53c7-436d-b421-58495edbb554
Ross-Simon/classes-and-objects
Library Management System.cpp
// Library Management System (Eguia, <NAME> - 08/28/2024) #include <iostream> #include <string> using namespace std; const int MAX_BOOKS = 10; class Detail{ public: string title; string author; int year; Detail() : title(""), author(""), year(0) {} }; class Library{ private: Detail books[MAX...
TOOL
0.971815
6.459885
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-08-30T06:13: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": "572a73c23c50...
9e077116-ebda-46ed-ac31-79febe56155f
Panda381/PicoLibSDK
_tools/DviTmds/DviTmds_AllTab/DviTmds.cpp
// Generator of DVI TMDS 16-bit 2-symbol table // Based on "Figure 3-5. T.M.D.S. Encode Algorithm" on page 29 of DVI 1.0 spec // PicoLibSDK - Alternative SDK library for Raspberry Pico and RP2040 // Copyright (c) 2023 <NAME>, <EMAIL>, <EMAIL> // https://github.com/Panda381/PicoLibSDK // https://www.breatharian.eu/hw/...
TOOL
0.905325
5.015912
{ "github_metadata": { "branch": "main", "commit_count": 89, "repo_created_at": "2023-07-30T18:30:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 71, "forks": 11, "issues": 4, "pull_requests": 1 }, "file_meta": { "content_id": "36572bd1d...
3a20bc6e-2240-4ec7-9b29-c7146c01519d
ABenazzou/Competitive-Programming
Codeforces.2060/B.cpp
/* * Author: @adnanebenazzou */ #include <bits/stdc++.h> using namespace std; template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; } template<typename T_container, typename T = typename enable_if<!is_same<T_container, stri...
ALGO
0.999985
3.501669
{ "github_metadata": { "branch": "main", "commit_count": 93, "repo_created_at": "2025-01-05T21:03: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": "8046143746c...
36908e3d-11cf-4ff0-91bd-31926d1e702f
KY2001/atcoder-all-my-submissions
agc023/agc023_a_1588697303.cpp
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author <NAME> */ #include "bits/stdc++.h" #define int long long #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(obj) begin(obj), end(obj) #define...
ALGO
0.999657
3.954581
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2022-08-13T14:39: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": "0c56a50974...
a6abbe70-1422-48bf-b42d-01cd277e3cc9
Avi-141/Competitive_Programming
CODECHEF-Practice/GCDMOD.cpp
#include <stdio.h> #include<math.h> #include<bits/stdc++.h> #include<boost/multiprecision/cpp_int.hpp> using namespace boost::multiprecision; using namespace std; /* Iterative Function to calculate (x^y)%p in O(log y) */ /* geeks for geeks function*/ cpp_int power(long long int x, long long int y, long long int p) { ...
ALGO
0.999973
4.149195
{ "github_metadata": { "branch": "master", "commit_count": 97, "repo_created_at": "2019-03-17T05:55:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e59ce8869...
c111ee82-384c-4295-804b-e7ffee76f9d9
rockybala/Analyses_codes
Codes_13TeV/PostAnalyzer_Run2015Data_2p5fbinv/PostAnalyzer_Qstar13TeV/LimitCode/BAT-0.9.2/models/base/BCEfficiencyFitter.h
#ifndef __BCEFFICIENCYFITTER__H #define __BCEFFICIENCYFITTER__H /*! * \class BCEfficiencyFitter * \brief A class for fitting histograms with functions * \author <NAME> * \author <NAME> * \version 1.0 * \date 11.2008 * \detail This class allows fitting of efficiencies defined as * a ratio of two TH1D histograms...
TOOL
0.950508
6.764602
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2018-05-16T08:12:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f550275af...
668568ad-8b94-4976-a2fd-caaa928f5015
Alemediii/Fundamentals-of-Programming
examsPractice/2nd partial/CPPFILES/01.posOfEach.cpp
#include <iostream> #include <vector> #include <string> using namespace std; const int MAXDIF = 15; const int MAXFREQ = 3; typedef vector<string> Words; void readWords(Words& s, int& size); void runArray(Words s, int& size); int main(){ Words s(100); int size = 0; readWords(s, size); runArray(s, siz...
ALGO
0.999429
3.972083
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-03-09T09:58: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": "422029287a3e...
0bc3e6c0-2f12-415c-a9ef-0a13b78fa3e6
dchandran/tinkercell
ExternalCode/copasi/utilities/CIndexedPriorityQueue.cpp
// Begin CVS Header // $Source: /fs/turing/cvs/copasi_dev/copasi/utilities/CIndexedPriorityQueue.cpp,v $ // $Revision: 1.18 $ // $Name: Build-33 $ // $Author: shoops $ // $Date: 2009/01/07 19:38:35 $ // End CVS Header // Copyright (C) 2008 by <NAME>, Virginia Tech Intellectual // Properties, Inc., EML Resear...
ALGO
0.994525
4.457274
{ "github_metadata": { "branch": "master", "commit_count": 2932, "repo_created_at": "2016-02-24T04:29:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7d570e0...
87de5698-c5a0-4c4e-8a6f-1fb4c973b6d6
ishandutta2007/codeforces-s
smax/normal/1141/D.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__); #else #define DEBUG(...) 6; #endif template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";} template<typename C, typ...
ALGO
0.999987
3.347272
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:07:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "691ef6c4930d...
394e0595-9a41-4353-8499-7ad12fb34a5c
7hokerz/bakjoon
previous/중요유형(잘 모르는)/그래프/깊이우선탐색/16932번(그룹화).cpp
#include <iostream> #include <stack> #include <queue> #include <vector> #include <string> #include <cstring> #include <algorithm> #include <cmath> #include <math.h> #include <stdlib.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll, ll> pll; #define mod 1'000'000'007 //서, 북, 동, 남,...
ALGO
0.999955
3.575145
{ "github_metadata": { "branch": "main", "commit_count": 84, "repo_created_at": "2024-05-02T12:50: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": "1ce6712dee4...
cb09469b-f46c-4370-af0d-3bc9e82f0d36
ishandutta2007/codeforces-k
krijgertje/normal/1385/B.cpp
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #include <cstring> #include <list> #include <cassert> #include <climits> #inclu...
ALGO
0.999865
3.738677
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06: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": "6da856b88db5...
4ef58cd8-31b3-42aa-be55-e9e9496666da
alexandraback/datacollection
solutions_5756407898963968_0/C++/zitmen/a.cpp
#include <iostream> #include <set> using namespace std; int main() { int first[4][4], second[4][4]; int T, r1, r2; cin >> T; for (int t = 1; t <= T; t++) { cin >> r1; r1 -= 1; for (int r = 0; r < 4; r++) { for (int c = 0; c < 4; c++) { cin >> first[r][c]; ...
ALGO
0.999238
4.36493
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7d72aa326...
8e0a5bea-d4aa-4f08-ba21-a7c12f759e93
swiftlang/swift
lib/SILOptimizer/Utils/ValueLifetime.cpp
//===--- ValueLifetime.cpp - ValueLifetimeAnalysis ------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
ALGO
0.999774
5.834569
{ "github_metadata": { "branch": "main", "commit_count": 185715, "repo_created_at": "2015-10-23T21:15:07.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 68847, "forks": 10498, "issues": 5000, "pull_requests": 1122 }, "file_meta": { "content_...
6b24910e-3be2-4e24-bae8-08834856861e
TedLiAz/MySTL
binTree/binTree.h
#include "binNode.h" #pragma once #define stature(p) ((p)?p->height:-1) template <typename T> class binTree{ protected: int _size; binNodePos(T) _root; virtual int updateHeight(binNodePos(T) x); /*更新节点x的高度*/ void updateHeightAbove(binNodePos(T) x); /*更新x及祖先的高度*/ public: bi...
ALGO
0.99886
4.43178
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2021-01-29T15:06: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": "1968a058ee2...
d3ac60af-17b9-441d-bab6-f2191d7797b6
chmnchiang/bcw_codebook
Contest/PetrWinterFeb2007/pK.cpp
//bcw0x1bd2 {{{ #include<bits/stdc++.h> #include<unistd.h> using namespace std; #define F first #define S second #define MP make_pair #define PB push_back #define IOS ios_base::sync_with_stdio(0); cin.tie(0); #define SZ(x) ((int)((x).size())) #define ALL(x) begin(x),end(x) #define REP(i,x) for (int i=0; i<(x); i++) #de...
ALGO
0.999864
3.640896
{ "github_metadata": { "branch": "master", "commit_count": 361, "repo_created_at": "2014-06-03T11:38:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 111, "forks": 22, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "291f0...
03f8e183-3e8e-46c5-b7fb-a0537c7449fd
se-ashishgupta/Data-Structure-and-Algorithm-Code
Graph/DFSDisConnectedGraph.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; void addEdge(vector<int> adj[], int u, int v) { adj[u].push_back(v); adj[v].push_back(u); } void dfsRec(vector<int> adj[], int s, bool visited[]) // TC: O(V+E) { visited[s] = true; cout << s << " "; for (int x : adj[s]) ...
ALGO
0.999981
4.973142
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2023-06-04T07:10: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": "590be081d04...
3d719a70-e2a7-4260-aa75-fa6d69ac55ae
jbikker/tmpl8
examples/verlet/game.cpp
// Template, 2024 IGAD Edition // Get the latest version from: https://github.com/jbikker/tmpl8 // IGAD/NHTV/BUAS/UU - <NAME> - 2006-2024 #include "precomp.h" #include "game.h" #define GRIDSIZE 128 struct Point { float3 pos, opos, fix; bool fixed; float restlength[4]; }; Point grid[GRIDSIZE][GRIDSIZE]; int xoffset[4...
ALGO
0.917886
4.288264
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2020-01-14T13:08:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1048200f...
f4360aef-19b8-40cb-9aef-10f953246ce1
fabiovandewaeter/2DGameEngine
src/systems/algorithms/PerlinNoise.cpp
#ifdef PROFILER #include "tracy_profiler/tracy/Tracy.hpp" #endif #include "systems/algorithms/PerlinNoise.hpp" PerlinNoise::PerlinNoise() {} PerlinNoise::~PerlinNoise() {} int PerlinNoise::noise2(int x, int y) { int yindex = (y + SEED) % 256; if (yindex < 0) yindex += 256; int xindex = (HASH[yind...
ALGO
0.997321
5.982248
{ "github_metadata": { "branch": "main", "commit_count": 382, "repo_created_at": "2024-08-29T21:48: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": "0516aa088b...
0101d900-8b5c-4832-8a1b-c62b92e6113a
habib-here/Inventory-Management-System-using-BST
main.cpp
#include "tree.h" // Assuming you have the necessary tree class header int main() { tree t1; int choice; bool running = true; while (running) { cout << "\nInventory Management System\n"; cout << "01. Insert Item\n"; cout << "02. Check Stock Availability\n"; cout << "0...
TOOL
0.996436
5.926463
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2024-10-26T02:54: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": "c60cf5356b1...
cbadebc9-c9c5-4ac5-a4ce-8d94c3a44091
nasa/icarous
Modules/ACCoRD/inc/CDII.h
/* * CDII - conflict detection between two aircraft with intent information for each. * * Contact: <NAME> (<EMAIL>), <NAME> * * Copyright (c) 2011-2019 United States Government as represented by * the National Aeronautics and Space Administration. No copyright * is claimed in the United States under Title 17, U...
TOOL
0.942711
6.733265
{ "github_metadata": { "branch": "master", "commit_count": 2747, "repo_created_at": "2016-08-19T15:04:43.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 169, "forks": 74, "issues": 1, "pull_requests": 5 }, "file_meta": { "content_id": "bfc39...
01e5017d-58a3-483a-9edc-37279b3dec51
striveAgain/CSP
202212-T3.cpp
/* 注意将矩阵 Z 字扫描成一维数组以及用一维数组来 Z 字填充矩阵的方法和下标映射关系即可 */ #include <bits/stdc++.h> using namespace std; const int N = 10; int n, T; int Q[N][N], M[N][N], QM[N][N]; double Mprime[N][N]; void fillup(int n) { for (int i = 1; i <= 8; ++i) { if (n) { if (!(i & 1)) { for (int j = 1; j <= i && n; ++j) { cin >> M[j...
ALGO
0.999809
3.837099
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2022-05-11T03:36: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": "2ea1be20848...
7d8205e9-8142-45c6-ba71-ed69289bfac4
Klaus1710/problemSolving
Shortest path in Undirected Graph having unit distance - GFG/shortest-path-in-undirected-graph-having-unit-distance.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: int dfs(int src, int dest, vector<vector<int>>& graph, int MinC, int count, vector<int>& Vis) { if(src==dest) return count...
ALGO
0.999956
5.538562
{ "github_metadata": { "branch": "main", "commit_count": 75, "repo_created_at": "2022-10-11T12:54: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": "fe95cea3d52...
218df756-fddf-4d46-9927-c16f28d3d12e
sitz/UVa-Online-Judge
455.cpp
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
ALGO
0.999856
3.714679
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2011-07-05T04:41:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 14, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "f3db3c1...
d3d260bf-443d-4599-9c7a-f027adb60a4d
b0gdan0v-bagi/codewars
Directions Reduction/Directions Reduction/Directions Reduction.cpp
#include <iostream> #include <vector> class DirReduction { public: static std::vector<std::string> dirReduc(std::vector<std::string>& arr); }; std::vector<std::string> DirReduction::dirReduc(std::vector<std::string>& arr) { bool isEnd = true; if (arr.size() < 2) return arr; while (isEnd) { ...
ALGO
0.998418
5.029852
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2020-10-27T11:09: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": "67f125ecf...
0366f64c-dd6e-4db6-9244-5d98cdd35300
opwarp/Leetcode
289. Game of Life.cpp
289. Game of Life.cpp class Solution { public: int m = 0; int n = 0; int v(vector<vector<int>>& board, int a, int b){ if(!(a<0 || a>=m || b<0 || b>=n)) { // cout<<board[a][b]<<">"; if( board[a][b]==5 || board[a][b]==4 || board[a][b]==1 ){ return 1; ...
ALGO
0.999938
5.800265
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2020-12-26T22:50:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a93ee320f...
fe5c52cb-c50c-4f0e-8bbb-2ee797f43324
LacraDanciu/Fundamental-Algorithms
Assignment4/MergeKLists.cpp
/*************************************************************************************************************/ /* <NAME> * Group 30421 * Started date: 22.03.2016 * Ended date: 29.03.2016 * Merging k ordered lists was following this principle : single linked lists and a heap were used as * data structures. The initial...
ALGO
0.999647
5.456738
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-03-11T21:02: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": "ed9dc7108a...
f91f56c6-ffea-4398-ba65-c17de3e0c33f
Flecart/CompetitiveProgramming
old_stuff/cses/searching_sort/Sum_of_Three_Values.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; // SUM OF THREE VALUES: // just an extension of sum of 2 values #define MAX 5003 pair<int ,int> arr[MAX]; int n, k, tmp; bool can_sum_of_two(int start, int target) { int l = start, h = n - 1; while (l < h) { int sum = arr[l].first ...
ALGO
0.999994
3.759115
{ "github_metadata": { "branch": "master", "commit_count": 122, "repo_created_at": "2021-07-27T12:22: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": "b6ae8b3a...
4d7f433a-416f-4868-8acc-24d651f0d518
ankitsultana/competitive
LightOJ/DataStructures/BinaryIndexedTree/1085.cc
/* Author: <NAME> * Problem Name: All Possible Increasing Subsequences (1085) * * * * * * * * * * * * * * * * */ #include <stdio.h> #include <algorithm> #define LL long long #define mod 1000000007ll #define MAXN 100001 using namespace std; LL bitpool[10][MAXN]; LL arr[MAXN], cmp[MAXN]; LL *bit = bitpool[0]; void up...
ALGO
0.999898
4.118346
{ "github_metadata": { "branch": "master", "commit_count": 105, "repo_created_at": "2016-01-31T18:46:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1ddb253f...
ec03d713-d890-43a9-b4e6-39aab1a9809b
Pratim-Kumar-Hazarika/DSA-Prep
Trees/30-Count-total-Nodes/main.cpp
#include <iostream> using namespace std; class Node { public: int val; Node* left; Node* right; Node(int x) { val = x; left = right = NULL; } }; class Solution { public: int countNodes(Node* root) { if (root == NULL) return 0; int lh = findlh(root); in...
ALGO
0.999972
6.224321
{ "github_metadata": { "branch": "main", "commit_count": 227, "repo_created_at": "2025-06-04T15: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": "8b95eb4e97...
c6f7311f-df13-4460-a193-e2c6f3f6535c
TiagoCSoares/Aeds1
trabalho-2-aeds-1/Trabalho2/main.cpp
#include <cstdlib> #include <ctime> #include <fstream> #include <sstream> #include <iostream> #include <iomanip> using namespace std; void printResults(const string& method, const string& vectorType, double time_spent, long long int comparisonCount, long long int swapCount) { printf("\nMetodo de ordenacao: %s\n",...
ALGO
0.998806
5.130162
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-07-04T03:53: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": "cc0d342d1cd2...
9cbcd680-c053-4379-92c5-3c895f6e6e6b
Anish168/Utsav_Session
Capsule/DAY 1/Union.cpp
#include <iostream> #include <vector> #include <set> using namespace std; // Brute force:- // T.C:- O(nlogn) + O(mlogm) + O(m +n) S.C:- O(m + n) // vector<int> FindUnion(int arr1[], int arr2[], int n, int m) // { // set<int> s; // vector<int> Union; // for (int i = 0; i < n; i++) // s.insert(arr1[i...
ALGO
0.999995
5.510071
{ "github_metadata": { "branch": "main", "commit_count": 205, "repo_created_at": "2022-06-26T19:18: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": "468de83afe...
9cb0adb2-018d-423c-891d-f2b021c8d7c4
sammcdo/Kattis-Problems
problems/flipfive/flipfive.cpp
#include #include #include #include using namespace std; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define For(i, a) for (int i = 0; i < (a); ++i) #define all(x) begin(x), end(x) #define is_in(x, s) ((s).find(x) != (s).end()) #define endl '\n' #define pi acos(-1.0) typedef long long ll; template using V...
ALGO
0.999785
4.539569
{ "github_metadata": { "branch": "main", "commit_count": 60, "repo_created_at": "2023-10-05T13:19:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "28721e90192...
08a6db1d-92f3-47ef-af3e-3ad73faa3afe
salmaan25/Algorithms-DS
Algorithms-DS/graph/UFDS +storing all elements of set separately + bipartite check using odd cycle/gears.cpp
//UFDS +storing all elements of a connected component separately + bipartite check using odd cycle #include <bits/stdc++.h> using namespace std; typedef vector<int> vi; int color[100005]; bool isBlocked[100005]; class UnionFind { // OOP sty...
ALGO
0.999931
4.528133
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2020-04-03T06:33: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": "58f4a826c...
e678b755-8487-4208-9218-becc29430abb
JianZJ-75/demo1
Code/leetcode-hot100/543.cpp
#include <bits/stdc++.h> 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(left), righ...
ALGO
0.999777
4.613719
{ "github_metadata": { "branch": "master", "commit_count": 555, "repo_created_at": "2024-01-09T06: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": "592b96ad...
a302a8e5-21ae-4e96-b145-155ae5ec6e50
saurabh175/cp
D_X-Sum.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define vi vector<int> #define vvi vector<vector<int>> #define vs vector<string> #define set set<int> #define sets set<string> #define vp vector<pair<int, int>> #define map map<int, int> #define umap unordered_map<int> #define pi (3.141592653589) #defi...
ALGO
0.99997
4.461663
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2022-07-08T04:15: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": "65c5b37850...
3152a11d-d904-4b5c-8967-2939a654b735
GuilhermeGSartori/Advanced-Algorithms---INF-5016
deep_mining-push_relabel-/code/src/util.cpp
#include <sstream> #include <iostream> #include "../include/util.h" #define INF 10000000 void read_graph(std::istream& in, unsigned& n, unsigned& m, unsigned& s, unsigned& t, PushRelabel& graph_in_solver) { std::string line="", dummy; unsigned w, h; getline(in,line); std::stringstream s_line(line);...
ALGO
0.998256
3.989885
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2022-11-11T00:45:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cae91b3a9e3...
625b776c-948f-4aac-8f80-c9be8d6d77e1
NitinVadadoriyaa/CodeForces
28-mar-e.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; using ll = long long; #define mod 1e9 + 7 //ctrl + space to run exsiting file. int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #else #endif int t; cin >> t; while (...
ALGO
0.999892
3.756901
{ "github_metadata": { "branch": "master", "commit_count": 104, "repo_created_at": "2024-01-30T05:24:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "83ead772...
eec0cc96-203f-4e5b-869b-22521feb083e
maiphuong0599/BTPHUONG
BAI_11.cpp
#include <iostream> #include <ctime> #include <cstdlib> using namespace std; #define MAX 15 void NhapMang(int a[],int n) { srand((unsigned)time(NULL)); for(int i=0;i<n;i++) { a[i]=1 + rand()%n; } } void XuatMang(int a[], int n) { for(int i=0; i<n; i++) cout<< a[i] <<"\t"; } int Tongam(int a[],int n) { int ...
ALGO
0.998566
3.4045
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-03-11T03:10: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": "6272fda77e...
da65d78f-a467-4638-b8eb-c713520f75f6
Exevald/algorithms-and-data-structures
Infotech/lw7/WorkWithBinaryTree/BinaryTreeUnitImplementationcpp.cpp
/*#include <iostream> #include "BinaryTreeUnitInterface.h" STree* newPtr; STree* tempPtr; STree* root; void InitTree() { root = NULL; } void InfixFind(STree*& ptr, TreeType& item) { if (ptr != NULL && tempPtr == NULL) { if (ptr->item == item) { tempPtr = ptr; } else { InfixFind(ptr->left, item); ...
ALGO
0.999282
3.251368
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2022-09-10T19:20: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": "c752559b8...
5659cde5-50d7-41a0-9cb4-84332bc43a6d
ayushashi11/dsa
01_knapsack.cpp
#include <iostream> #include <vector> #include <algorithm> #include <cmath> using namespace std; int stepCount = 0; struct Item { int weight; int value; }; bool cmp(Item a, Item b) { return (double) a.value / a.weight > (double) b.value / b.weight; } int knapsack(int capacity, vector<Item> items) { ...
ALGO
0.999996
5.163251
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2019-12-27T15: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": "5f90ad8eb...
d877ec5b-0560-44dc-8eaf-600d34605c91
alvinalvord/CPL
codeforces/div2/485/C/a.cpp
#include <iostream> #include <cstdlib> using namespace std; typedef struct { long long int s; long long int c; int index; } node; void mergesort (node *arr, int n); void merge (node *left, node *right, int n, int m) { if (n > 1) mergesort (left, n); if (m > 1) mergesort (right, m); int i = 0, j = 0, len = n...
ALGO
0.999969
3.346434
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2018-06-20T13:32: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": "5ee9f1d94...
f41f4689-48d1-4a09-9df2-6a791d7135a6
BaiGang/recomm_engine
src/util/containers/producer_consumer_queue.h
// Copyright 2013. Sina .com. All rights reserved. // Author: <EMAIL> (<NAME>) // Description: Producer-Consumer Queue with timeout. #ifndef _UTIL_CONTAINERS_PRODUCER_CONSUMER_QUEUE_H_ #define _UTIL_CONTAINERS_PRODUCER_CONSUMER_QUEUE_H_ #include <deque> #include "glog/logging.h" #include "util/base/timer.h" using s...
TOOL
0.935667
6.695397
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2014-06-17T07:48:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 9, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "ed23a626a...
b7987bec-4cdc-4874-968c-4c6844de345a
IM-DM4AI/IMBridge
deps/oblib/src/lib/codec/ob_generated_unalign_simd_bp_func.cpp
/** * Copyright (c) 2021 OceanBase * OceanBase CE is licensed under Mulan PubL v2. * You can use this software according to the terms and conditions of the Mulan PubL v2. * You may obtain a copy of Mulan PubL v2 at: * http://license.coscl.org.cn/MulanPubL-2.0 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BAS...
ALGO
0.998766
3.715559
{ "github_metadata": { "branch": "main", "commit_count": 12491, "repo_created_at": "2025-01-17T07:27:29.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d5051b833...
66932ea9-9cb2-43b2-89b5-c11e6a797f00
Sungmoo030/DSA
implementation of queue using array.cpp
#include<stdio.h> #include<conio.h> #define SIZE 5 void enQueue(int); void deQueue(); void display(); int queue[SIZE], front = -1, rear = -1; int main() { int value, choice; printf("\tLINEAR QUEUE USING ARRAY \n"); printf("\t------------------------\n"); printf("\t1.Insertion\n\t2. Deletion\n\t3....
ALGO
0.999805
3.848334
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-11-23T12:49: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": "4455f830b4b7...
d8c2e49f-1026-4da8-b104-cb535cf26a9c
Sarwar05/LightOJ
1196 - Inhabitants.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long struct Point { ll x; ll y; }; double dist(Point a, Point b) { return sqrt((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y)); } ll triArea(Point p1, Point p2, Point p3) { return (p1.x*(p2.y-p3.y) + p2.x*(p3.y-p1.y) + p3.x*(p1.y-p2.y)); } Point po...
ALGO
0.999964
4.123454
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2017-04-18T11:57:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0e4fba461...
8d4707f6-39d3-4b01-b240-1509853af22a
khaledGadelhaQ/LeetCode-Solutions
0839-similar-string-groups/0839-similar-string-groups.cpp
#include <bits/stdc++.h> using namespace std; class UnionFind { private: vector<int> parent, rank; void link(int x, int y) { if (rank[x] > rank[y]) { swap(x, y); } parent[x] = y; if (rank[x] == rank[y]) { rank[y] += 1; } } public: int fore...
ALGO
0.999992
5.628442
{ "github_metadata": { "branch": "main", "commit_count": 823, "repo_created_at": "2023-08-16T18:20:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e406c1290a...
e97a5e56-7ba4-43ff-b3c3-f83edd4fde35
DragonKrissash/TLE
Practice/1300/D_Permutation_Game.cpp
//#pragma GCC optimize("Ofast") //#pragma GCC target("avx2") #include <bits/stdc++.h> #include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <vector> #include <cassert> #include <array> #include <string> #include <cstring> #include <chrono> using namespace std; using nam...
ALGO
0.999581
3.771437
{ "github_metadata": { "branch": "main", "commit_count": 600, "repo_created_at": "2024-06-23T13:41: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": "f20d608d19...
af4f02da-56e5-4833-bcfb-350095a1ac8f
CarpeNecopinum/Plugin-InteractiveMCPT
Sampling.cc
#include "Sampling.hh" using namespace ACG; namespace Sampling { std::vector<Vec3d> randomDirectionCosPowerTheta(int number, Vec3d n, double exponent) { std::vector<Vec3d> dirs; Vec3d x_dir, y_dir; generateTangentSystem(n, x_dir, y_dir); while (number--) { double xi1 = random(); do...
ALGO
0.957689
4.707431
{ "github_metadata": { "branch": "master", "commit_count": 67, "repo_created_at": "2015-06-22T12:17: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": "1cbf38b47...
0911e3d6-0f14-4e39-930b-1127b7750f7a
ishandutta2007/codeforces-t
tinsane/normal/928/B.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define dbg(...) fprintf(stderr, __VA_ARGS__) #define dbgv(x) cerr << #x << " = " << x << endl #define dbga(arr, len) {cerr << #arr << " = "; for (int _ = 0; _ < len; _++) cerr << arr[_] << " "; cerr << endl;} #define dbgi(it) {cerr << #it << " = "; for (const...
ALGO
0.999859
4.009417
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:27: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": "625383c53982...
d336c28f-1771-40b5-a05f-5206d679632c
QuickSorting/Codeforces
Global Round 12/F.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 3; int n, a[N], cnt[N]; bool check(int cnt_x, int cnt_other){ if((cnt_x + cnt_other) & 1) return cnt_x <= cnt_other + 1; return cnt_x <= cnt_other; } void solve(){ cin >> n; for(int i = 0; i < n; ++i) ...
ALGO
0.999478
3.653945
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2021-12-13T18: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": "48ecc5409ebf...
757b0a96-3fda-4c95-9d7a-63f58c27b286
alexandraback/datacollection
solutions_5634947029139456_0/C++/aman1893/main.cpp
#include <iostream> #include <cstdio> #include <climits> #include <algorithm> #include <queue> #include <cstring> #include <cmath> #include <vector> #include <list> #include <stack> #include <bitset> #include <string> #include <stack> #include <set> #include <map> #include<string> #include <deque> #include <ctime> #de...
ALGO
0.999931
3.634407
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4c17d4900...
ff7c368e-c919-45df-9283-3d3aab5e4e92
alex1989h/omnetpp
ballwerfen/src/Actor.cc
// // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it wil...
ALGO
0.953264
4.127597
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2017-10-24T08:58: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": "607d432ce...
f2f0d90a-92c9-44da-ad2b-f8d0a8aabc1d
InterTriplete2010/Notch_Peak_Filter
Notch_Peak_F.h
#pragma once #include <stdio.h> #include <vector> #ifndef Notch_Peak_F_H #define Notch_Peak_F_H #ifdef __cplusplus extern "C" { // only need to export C interface if // used by C++ source code #endif namespace NOP_FI { class Notch_Peak_F { public: //Esti...
TOOL
0.919237
5.361665
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-12-04T23:27:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "52c8bd1b8e6...
878f9081-b882-484d-a10a-b1ba03c53928
MeghanaKS96/C-Plus-Abstract-Class-and-Interfaces
shape.h
//Abstract Class class Shape { virtual double area()=0; }; //Interface class Polygon { virtual int num_sides()=0; }; //Interface class Circumference { virtual double circumference()=0; }; //Derived Class class Circle :public Shape, public Circumference{ protected: int radius; public: ...
TOOL
0.907765
5.647614
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-02-20T11:04: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": "04d855c0b146...
bd8478f6-cfbd-4245-946a-b710f230f48c
mittalprince/Data-Structures-and-Algorithm
CodeForces/683-Div2/Catching-Cheaters.cpp
// https://codeforces.com/contest/1447/problem/D #include<iostream> #include<vector> using namespace std; typedef long long ll; #define ip(arr, n) for(int i=0; i<n; i++) cin>>arr[i]; #define ip1(arr, n) for(int i=1; i<=n; i++) cin>>arr[i]; #define op(arr, n) for(int i=0; i<n; i++) cout<<arr[i]<<" "; #define fstIO ios_b...
ALGO
0.99998
4.073785
{ "github_metadata": { "branch": "master", "commit_count": 516, "repo_created_at": "2020-07-28T16:36:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 5 }, "file_meta": { "content_id": "daedfb25...
0861b4c4-1d05-4cba-8495-09d7b45a035f
ZewStream947/ProblemSolution
Disjoint Sets Union/3B - Number of Connected Components on Segments.cpp
#include <cstdio> #include <algorithm> #include <stack> #include <cmath> using namespace std; class DSU { private: stack<int> stk; int *par, *rank, curr_connected; int path_cp(int x) { return (x == par[x] ? x : par[x] = path_cp(par[x])); } int get_par(int x) { while (x !=...
ALGO
0.999942
4.864347
{ "github_metadata": { "branch": "master", "commit_count": 228, "repo_created_at": "2020-07-23T14:42: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": "90d32c98...
18dad927-a764-4216-8232-2ece82ea2f2e
Barrywu223/mtrn4110_war_machines
Integrated Project/controllers/PhaseAB_controller/PathPlanner.cpp
#include <PathPlanner.hpp> PathPlanner::PathPlanner() { // Open file to read in map std::ifstream file; file.open(mapPath); if (!file.is_open()) { std::cout << "Error: could not find map file" << mapPath; exit(1); } // Open file to output data outputFile.open(outputPath); if (!outputFile.is...
ALGO
0.996931
4.23188
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2021-08-06T02:13:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1686a86fe27...
a2101dfa-8b7d-400f-8203-e7e887766800
ViktorMaksimoski/competitive
cses/tree algorithms/Path_Queries.cpp
#include <iostream> #include <iomanip> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <vector> #include <set> #include <map> #include <queue> #include <unordered_map> #include <unordered_set> #include <ctime> #include <cassert> #include <complex> #include <string> #include <stack> #...
ALGO
0.999909
4.477858
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2023-06-07T09:26:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "392e3c9b8...
7f1b4307-165d-48b1-bed8-e3d88b8f16e4
cursorhu/myleetcode
list/234. 回文链表.cpp
234. 回文链表.cpp 请判断一个链表是否为回文链表。 示例: 输入: 1->2->2->1 输出: true /* 题解: 先使用快慢指针找到链表中点,再把链表切成两半; 然后把后半段翻转;最后同速度遍历,比较两半是否相等 */ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: bool isPal...
ALGO
0.9999
4.86856
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2020-11-05T09:52: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": "3ce5ded7fe...
d5649308-4c85-41c7-8460-57a960bec73d
s235714/C-Cpp-apps
Lista 7/Wojciech Czarnecki zadanie 1.cpp
#include <iostream> #include <cstdlib> #include <stdio.h> #include <conio.h> #include <ctime> #include <string> #include <math.h> using namespace std; struct PUNKT { double x, y; string nazwa; double odleglosc(const PUNKT P) { return sqrt((P.x-x)*(P.x-x)+(P.y-y)*(P.y-y)); } }; void loso...
ALGO
0.992958
3.397535
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-03-27T15:22: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": "db234751379e...
f2ba5cbb-932d-4545-9a44-40831d4c4607
piano-man/coding
linked_list/q4.cpp
//reverse linked list in groups of given size #include<stdio.h> #include<stdlib.h> struct node { int data; struct node* next; }*head; struct node *reverse (struct node *head, int k); void insert() { int n,value,i; scanf("%d",&n); struct node *temp; for(i=0;i<n;i++) { scanf("%d",&va...
ALGO
0.999818
3.708539
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2018-01-17T19:31:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0b590b417...
427ed226-db2a-4048-85e7-41235b0bc220
roguekishore/LeetCode-Solutions
0893-all-nodes-distance-k-in-binary-tree/0893-all-nodes-distance-k-in-binary-tree.cpp
class Solution { public: vector<int> distanceK(TreeNode* root, TreeNode* target, int k) { // if(!root->left && !root->right) { // if(k==1) { // return {root->val}; // } else { // return {}; // } // } unordered_map<TreeNode*,...
ALGO
0.999994
6.157672
{ "github_metadata": { "branch": "main", "commit_count": 869, "repo_created_at": "2025-04-24T18:03: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": "15f5b60933...
038b9447-b43b-4146-be1b-d121019f6023
mdunggggg/SPOJ-PTIT
P181PROC.cpp
#include<bits/stdc++.h> #define faster() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define pi 2*acos(0) #define MOD 1000000007 #define MAX 1000000 #define For(i, a, b) for (ll i = a; i <= b; i++) #define Ford(i, a, b) for (ll i = a; i >= b; i--) #define forr(i, a, b) for (ll i = a; i < b; i++) usin...
ALGO
0.999974
3.541651
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-02-16T13:10:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "270a440246...
71f712ce-a3c7-4e11-b17d-01c48d91021f
SoleMin/Algorithmic_Problems
111101/2.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef struct EL{ int num; int we; int iq; int value; int parent; }el; bool cmp(const el & a, const el & b) { if (a.we < b.we) return true; else if (a.we == b.we){ if (a.iq < b.iq) return true; else if (a.iq == b.iq){ if (...
ALGO
0.999994
3.554641
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-06-29T13:51: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": "39ff3fc4aef6...
6b4f9dc4-1cee-4f4e-9002-3be5c5413658
zhzh2001/Learning-public
c++实用代码/平衡树code/启发式合并平衡树(treap)_dhh.cpp
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<time.h> #define N 200005 int f[N],d[N],c[N],sum[N],n,ans=0,l=0; int data[N+N],next[N+N],ed[N+N],son[N]; int key[N],ran[N],L[N],R[N],size[N],root[N]; void bfs(){ int h=0,t=1; f[1]=1; d[1]=0; memset(c,0,sizeof(c)); c[1]=1; while (h<t){ int i=f[++h]; ...
ALGO
0.999957
3.562924
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-09-23T04:45: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": "28df554cc5...
63a1070b-9f67-4e80-af3f-0b16add9c3b3
vejmarie/Netgen
netgen-5.3.1/libsrc/meshing/paralleltop.cpp
#ifdef PARALLEL #include <meshing.hpp> #include "paralleltop.hpp" namespace netgen { ParallelMeshTopology :: ParallelMeshTopology (const Mesh & amesh) : mesh(amesh) { is_updated = false; } ParallelMeshTopology :: ~ParallelMeshTopology () { ; } void ParallelMeshTopology :: Reset () ...
ALGO
0.982859
4.619068
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2016-04-28T07:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bdbcec7f07...
bd1070d5-cf78-4067-8fea-b9fb60706842
projeto-de-algoritmos-2024/DeC-ProblemasJuizOnline
medianSorted/mediansortedarrays.cpp
#include <iostream> #include <vector> #include <algorithm> #include <climits> using namespace std; class Solution { public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { if (nums1.size() > nums2.size()) { return findMedianSortedArrays(nums2, nums1); } /...
ALGO
0.999979
5.869033
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2024-12-17T21:33:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cfbd2e8f1d...
2272b23d-de1e-45ae-8842-63178189ea28
OpenXRay/xray-15
cs/sdk/include/boost/mpl/aux_/preprocessed/no_ttp/fold_backward_impl.hpp
// preprocessed version of 'boost/mpl/aux_/fold_backward_impl.hpp' header // see the original for copyright information namespace boost { namespace mpl { namespace aux { // forward declaration template< long N , typename First , typename Last , typename State , typename BackwardOp , typename...
ALGO
0.98755
4.530058
{ "github_metadata": { "branch": "xd_dev", "commit_count": 610, "repo_created_at": "2014-08-22T12:09:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 175, "forks": 64, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "85e350...
9245fa5e-d866-443b-bdab-b626b0842e2e
AndrewYGHUB/leet
solution/0100-0199/0113.Path Sum II/Solution.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.99999
6.174507
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-07-21T06:56: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": "f8701b5cc9e8...
f51714f5-0c43-4add-a97b-fcc8809b5e30
TanvirFahimBD/learning
phitron/Basic-Data-Structures/week2-linked-list/m6_5-week2-practice-day1/practice_problem5.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: int val; Node *next; Node(int val){ this->val = val; this->next = NULL; } }; void insert_at_tail(Node* &head, Node* &tail, int val){ Node* newNode = new Node(val); if(head == NULL){ ...
ALGO
0.999904
4.099954
{ "github_metadata": { "branch": "main", "commit_count": 47, "repo_created_at": "2024-08-24T10:35: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": "44de402be5f...
d1c6ee14-0156-4e38-a462-73518acba896
netdebug/StaticNFrame
Server/StaticNFrame/NFComm/NFCore/NFHash.hpp
// ------------------------------------------------------------------------- // @FileName : NFHash.hpp // @Author : GaoYi // @Date : 2018-05-14 // @Email : <EMAIL> // @Module : NFCore // // ----------------------------------------------------------...
ALGO
0.941253
6.397675
{ "github_metadata": { "branch": "master", "commit_count": 668, "repo_created_at": "2019-02-14T02:31:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4da43f9f...
cafc4330-157c-412e-b75e-2020276a04bd
rennaMAhcuS/PlagiarismChecker
autograder/phase1/fellowship/frodo.cpp
#include <array> #include <cstdlib> #include <iostream> #include <memory> #include <span> #include <string> #include <vector> #define MAX_SIZE 9 struct node_t { long val = 0; virtual ~node_t() {} }; struct n_ary_node_t : public node_t { class std::vector<std::shared_ptr<node_t>> children; }; template <si...
ALGO
0.981394
6.034611
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2024-10-11T08:55:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b595114395b...
37389835-631a-4c96-b229-d5d4fb564dcf
enamcse/ACM-Programming-Codes
HDU/4417 Super Mario.cpp
/* * @Author: <NAME> * @Date: 2015-04-11 09:10:44 * @Last Modified by: Enamul * @Last Modified time: 2015-04-11 15:55:43 * @Verdict: Not Solved * @File Path: H:\Dropbox\Code\HDU\4417 Super Mario.cpp */ #include <bits/stdc++.h> #define _ ios_base::sync_with_stdio(0);cin.tie(0); #define sz 100005 #define pb(a) pus...
ALGO
0.99965
3.109802
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2015-03-31T21:45:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d4054adac...
7d4546d8-4491-43e5-87d4-f6d9ede7735a
zengjingjing/LeetCode-Solution
153.cpp
/********************************************* Note: 当只有两个元素的时候,或者最后收缩到只有nums[0-1]时,一定要注意循环跳出的判断 method 1 : 最开始的想法,非常SB。各种判断。我觉得只要出现了这种很多判断、很碎的,基本上就没理解到问题的精髓。 method 2 : 这才是针对问题的最好的方法。 *******************************************/ #include <iostream> #include <vector> #include <string> using namespace std; class S...
ALGO
0.999995
5.333683
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2015-04-11T03:05:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b4afa0645...
6cd08a88-61bb-404e-94bd-971809176329
kaspermarstal/elastix
src/Components/Metrics/BendingEnergyPenalty/itkTransformBendingEnergyPenaltyTerm.hxx
/*========================================================================= * * Copyright UMC Utrecht and contributors * * 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 * * h...
ALGO
0.999187
6.735891
{ "github_metadata": { "branch": "master", "commit_count": 906, "repo_created_at": "2016-03-07T18:52:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a1095c1...
eacce55c-fee0-4736-b4d9-17c308ea8475
pcvittin/Aula-ED-I
bubble.cpp
#include <iostream> #include <vector> #include <random> #include <ctime> #include <algorithm> #include <chrono> using namespace std; vector<int> array_original; std::random_device rd; std::mt19937 gerador(rd()); std::uniform_int_distribution<int> numall(0, 100000); void preenche() { for (int i =...
ALGO
0.998158
5.607598
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-06-08T17:46: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": "6178290b1b6c...
4f6f9d26-fe05-497a-a621-fe538f8ba4b2
faasm/cpp
func/mpi/mpi_barrier.cpp
#include <faasm/faasm.h> #include <mpi.h> #include <stdio.h> #include <unistd.h> int main(int argc, char* argv[]) { MPI_Init(NULL, NULL); int rank; int worldSize; MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &worldSize); if (worldSize < 3) { printf("Need world o...
TEST
0.906717
4.374934
{ "github_metadata": { "branch": "main", "commit_count": 255, "repo_created_at": "2020-08-25T12:44:09.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 6, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "58abfda48bb...
4c1edd96-b1f7-4522-925f-70f128c8b879
zhantong/leetcode
535. Encode and Decode TinyURL/C++/Solution.cpp
class Solution { public: unordered_map<string, string> short2long; unordered_map<string, string> long2short; string generate(int n) { string pool = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; string result = ""; for (int i = 0; i < n; i++) { result ...
ALGO
0.997727
5.931275
{ "github_metadata": { "branch": "master", "commit_count": 538, "repo_created_at": "2017-02-11T10:56:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 34, "forks": 15, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c50153...
6281c8fa-3452-4116-8bf5-d81c62c62ce9
erfan4323/Maze-Gen
Gen V1.0/Gen V1.0.cpp
//std includes #include <stack> #include <random> #include <vector> //renderer #define OLC_PGE_APPLICATION #include "olcPixelGameEngine.h" using namespace std; class Maze : public olc::PixelGameEngine { public: Maze() { sAppName = "Maze V1.0"; } private: static const int _mazeWidth = 40; static const int _ma...
ALGO
0.98514
4.43982
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2023-11-07T18:33: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": "0f8e185979f...
7f40efd2-e9fd-4df1-9b31-dc31aca17a8d
Eatabekyan/Algorithms-Data-Structures
9_contest/C_1.cpp
#include <iostream> #include <queue> #include <vector> #include <set> class Graph { public: const int64_t kInf = INT64_MAX; struct Edge { int64_t first = 0; int64_t second = 0; int64_t cap = 0; int64_t flow = 0; }; int64_t vert_num = 0; int64_t start = 0; int64_t target = 0; std::vect...
ALGO
0.999931
4.359484
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2022-10-15T18:38: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": "732c181f8c5...
71128b2d-a7ca-4dce-b008-4829ca80ff28
04kumarisakshi/dsa-
SDE Sheet/Array IV/3Sum.cpp
// Problem Statement: Given an array of N integers, your task is to find unique triplets that add up to give a sum of zero. In short, you need to return an array of all the unique triplets [arr[a], arr[b], arr[c]] such that i!=j, j!=k, k!=i, and their sum is equal to zero. // Pre-requisite: 2 Sum Problem // Examples ...
ALGO
0.999634
5.920223
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2022-12-06T10:19: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": "d6ad8e650e2...
e38075a9-c7a3-4206-a16a-5c441066c0f1
mjeffe/arduino-sandbox
sketchbook/Arrays_1/Arrays_1.ino
/* Arrays Demonstrates the use of an array to hold pin numbers in order to iterate over the pins in a sequence. Lights multiple LEDs in sequence, then in reverse. Unlike the For Loop tutorial, where the pins have to be contiguous, here the pins can be in any random order. The circuit: * LEDs from pins ...
ALGO
0.990413
5.035065
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-04-14T20:38: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": "2484839443...
ea40b78e-506d-4be0-87d6-e454f4c7faeb
PratyakshSinha/CppPrograms
GeeksForGeeks/LinkedLists/IntersectionOfTwoLinkedLists.cpp
// { Driver Code Starts // #include <bits/stdc++.h> using namespace std; struct Node { int data; Node *next; Node(int val) { data=val; next=NULL; } }; Node* inputList(int size) { Node *head, *tail; int val; cin>>val; head = tail = new Node(val); while...
ALGO
0.99986
5.184216
{ "github_metadata": { "branch": "main", "commit_count": 117, "repo_created_at": "2021-11-13T13:53:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "89390b1864...
05670b1a-6ece-49bf-8d15-871153ebc4f4
priyankapiba/load_boston
HPC2Merge.cpp
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. ******************************************...
ALGO
0.999992
5.613666
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2023-05-21T19:21: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": "6c27bf3d6430...
4f107c15-49db-4357-8bbd-ceb0afe54454
nikki1016/Codes-and-other-system-stuffs
daacodes/lab9.cpp
#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #define N 3 using namespace std; struct Node { Node* parent; int mat[N][N]; int x, y; int cost; int level; }; int getInvCount(int arr[]) { int inv_count = 0; for (int i = 0; i < 9 - 1; i++) for (int j = i+1; j < 9; j++) // Value 0 is used...
ALGO
0.999979
3.830644
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2017-02-26T14:38: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": "95331c430a...