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
1324ef95-ffba-43e6-8a70-9fbb1d37bd0a
karan-bhatia22/dsa-training
day5/practice/randomizedQuickSort.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <queue> #include <stack> #include <random> #include <random> 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++) {...
ALGO
0.999966
5.399055
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2022-01-24T10: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": "6e56be132c1...
27261370-4346-49ce-aad3-fb1eb180cf52
ChoiJongman22/ProgrammersCPP
스킬트리_L2.cpp
#include <iostream> #include <vector> #include <map> #include <algorithm> using namespace std; //int solution(string skill, vector<string> skill_trees) { // int answer = 0; // // for (int i = 0; i < skill_trees.size(); i++) { // for (int j = 0; j < skill_trees[i].size(); i++) { // for() // ...
ALGO
0.999886
5.168013
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2020-10-14T07:22: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": "9c4d28e4e...
70fbcae7-ca5c-4b24-8efa-0c43ecbb82b0
harshr3107/Coding-problems
2385-amount-of-time-for-binary-tree-to-be-infected/2385-amount-of-time-for-binary-tree-to-be-infected.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.999971
5.268615
{ "github_metadata": { "branch": "main", "commit_count": 1831, "repo_created_at": "2024-06-17T15:07: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": "1349a107a...
bdad18e9-a222-4ffa-a080-c37bbbeb2c7b
nikolaygurev/MADE_algorithms_and_data_structures
Lesson_2/main.cpp
#include <iostream> using std::cout; using std::endl; using std::swap; struct Point { int x; int y; bool operator<(const Point &other) const; }; bool Point::operator<(const Point &other) const { return y < other.y; } // Использует для сравнения оператор < void BubbleSort(Point *arr, int size) {...
ALGO
0.999877
5.812862
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2019-10-20T13:31:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "f744967cf...
3e1afeb9-4cd2-4b4e-aea3-2505a961a01c
leducphuclong/code
Competitive Programming/codeforces/training/find-kth-permutation-O(n).cpp
//{ Driver Code Starts //Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ long long int fact[20]; class Solution { public: int find_idx(set<int> s, int &k, int n) { if (n == 1) return 0; int idx = k...
ALGO
0.999987
6.011378
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2024-02-22T10: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": "e22db7828e...
099a21d1-7a62-4887-82e2-d7d76e8a7a9b
YoungseokCh/problem-solving
baekjoon/2108.cpp
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(NULL); int N; cin >> N; vector<int> num(N, 0); map<int, int> count; int mean = 0; for (int i=0; i<N; i++){ cin >> num[i]; if (count.contains(num[i])){ count[num[i]...
ALGO
0.999966
3.978111
{ "github_metadata": { "branch": "main", "commit_count": 395, "repo_created_at": "2018-09-30T23:43:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ccd5314a40...
d9bb98dd-de36-4164-a54d-a8be2af7b689
wlf1998/AI
bjf/lab1-1.cpp
//#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> #include<iostream> #include<ctype.h> #include<math.h> #include<vector> #include<queue> #include<stack> #include<time.h> using namespace ::std; #define Height 30 #define Width 60 #define INF 0x7fffffff #define SUCCESSED 1 #define FAILED 2 ...
ALGO
0.999989
3.372842
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-05-17T15:36: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": "8f411c57a3...
78add02a-0f38-407f-96b7-8ebf199455c6
Arsh-2811/Dynamic-Programming
Trees.cpp
#include<bits/stdc++.h> using namespace std; struct Node{ int val; Node* left; Node* right; Node(int x){ val = x; left = right = NULL; } }; void preorder_iterative(Node* root){ if(root == NULL){ return; } stack<Node*> s; s.push(root); while(!s.empty()){ ...
ALGO
0.999973
4.93698
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2022-05-23T11:00: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": "873c8f6e2a...
50b719c9-797f-43e3-b4ba-b3cd446c9bd3
Nafa06/CircullarQueuesArray_0200
CircullarQueues.cpp
/** * @mainpage Documentation Project Circular Queues * @section Introduction * Projek ini merupakan projek struktur data * Menggunakan struktur data queues dengan pendekatan circular array.abort * @section Operations * Projek ini memiliki beberapa operasi diantaranya: * - Insert * - Delete * - Display * @se...
ALGO
0.999006
5.481171
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2025-06-12T03:07:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "875cb52e681...
869969e7-d919-4614-a5d4-e545031cee59
Dhliv/Competitiva
Codeforces/D/A-B-C Sort.cpp
#include <bits/stdc++.h> #define INF INT_MAX #define MINF INT_MIN #define ll long long #define PB push_back #define PF push_front #define P_F pop_front #define P_B pop_back #define F front #define B back #define f first #define s second #define MP make_pair #define FOR(i, a, b) for(ll i = a; i < b; i++) #define FORI(i...
ALGO
0.999877
4.315441
{ "github_metadata": { "branch": "master", "commit_count": 124, "repo_created_at": "2020-10-15T03:14:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2a5bbff9...
e5b857eb-3f2f-4a67-b4d7-83923aa48763
tanishq1306/DSA-Solved-Questions
String/42_isomorphic_strings/isomorphic_strings.cpp
/** * author: tanishq * created: 04.12.2020 **/ #include <bits/stdc++.h> #define int long long using namespace std; bool isomorphicStrings(string &str1, string &str2){ if (str1.length() != str2.length()) { return false; } int freq1[26] = {0}, freq2[26] = {0}; for (char ch : str1)...
ALGO
0.999998
5.698417
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2020-10-17T09:30:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1eaa673df5...
e8768f1a-2c3a-451b-84b3-b91392f8bb09
Asevenx174/CP-source-code-
02_OJ_solution/Cf contest/832 div2/d.cpp
#include<bits/stdc++.h> #define pb push_back #define mp make_pair #define pf printf #define ff first #define ss second #define sef second.first #define ses second.second #define PI 3.14159265 /// tan inverse = atan(value)*(180/PI) #define ms(a,b) memset(a, b, sizeof(a)) #define lp(i,a,b)...
ALGO
0.999966
3.314667
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-05-12T16:42: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": "95d89556f95e...
ec059895-5ebb-47ab-8e5d-cd2ad93cd474
7oSkaaa/LeetCode_DailyChallenge_2023
01- January/08- Max Points on a Line/08- Max Points on a Line (Ahmed Zedan).cpp
//author: <NAME> class Solution { public: // function to get slope between to point double slope(double x1 , double y1 , double x2 , double y2){ if(x2==x1) return INT_MAX ; return (y2-y1) / (x2-x1) ; } /* hint: if have three point (x , y , z) if slope(xy) = slope(xz...
ALGO
0.999909
5.405234
{ "github_metadata": { "branch": "main", "commit_count": 6874, "repo_created_at": "2023-01-02T11:28:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 104, "forks": 86, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "24c6fd...
620e8b60-4a95-46c5-9d11-deb6c4cffcb6
ishandutta2007/codeforces-s
s2speed/normal/1096/E.cpp
#include<bits/stdc++.h> using namespace std; #pragma GCC optimize ("Ofast") #define all(x) x.begin() , x.end() #define sze(x) (ll)(x.size()) #define mp(x , y) make_pair(x , y) #define wall cerr<<"--------------------------------------"<<endl typedef long long int ll; typedef pair<ll , ll> pll; typedef pair<int , int...
ALGO
0.999912
4.830972
{ "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": "521aa95f5ed0...
e6330100-aaee-43de-beb8-32bcc9f1f9cf
LLNL/psuade
Src/Analysis/ShapleyAnalyzer.cpp
// ************************************************************************ // Copyright (c) 2007 Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory. // Written by the PSUADE team. // All rights reserved. // // Please see the COPYRIGHT and LICENSE file for the copyri...
ALGO
0.998596
3.845165
{ "github_metadata": { "branch": "3.0.0", "commit_count": 27, "repo_created_at": "2017-09-28T17:20:29.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4ddfc75bd65...
5631d275-0b45-478a-a457-e44bde1310bb
habanero-rice/hclib
test/performance-regression/full-apps/qmcpack/src/QMCWaveFunctions/AtomicOrbital.h
#ifndef ATOMIC_ORBITAL_H #define ATOMIC_ORBITAL_H #include <config/stdlib/math.h> #include <einspline/bspline.h> #include <einspline/multi_bspline.h> #include <QMCWaveFunctions/SPOSetBase.h> #include <Lattice/CrystalLattice.h> #include <Configuration.h> #include <Utilities/NewTimer.h> namespace qmcplusplus { ///////...
ALGO
0.918477
6.711736
{ "github_metadata": { "branch": "master", "commit_count": 705, "repo_created_at": "2014-08-11T16:15:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 71, "forks": 36, "issues": 11, "pull_requests": 0 }, "file_meta": { "content_id": "0a759e...
d61ce7aa-63a8-4d51-8bce-db1ca5bf0182
gabriellerosa/Codigos-Maratona
atCoder/beginner169/D/d.cpp
#include <iostream> #include <bitset> #include <vector> #include <map> typedef long long ll; //typedef vector<ll> vll; using namespace std; bitset<10000007> e_composto; vector<ll> primos; void crivo(ll max){ e_composto.set(); e_composto[0] = e_composto[1] = 0; for(ll i = 2; i <= max + 1; i++){ ...
ALGO
0.999891
4.444798
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2019-05-31T00:15: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": "1f1f7c74b...
1ef3180d-59df-441a-a7ac-14abb597c0f5
sagittariusk2/CSES
Sorting and Searching/sum-of_two_values.cpp
/** * @file sum-of_two_values * @author <NAME> (https://sagittariusk2.github.io/) * @id sagittarius_k2 * @brief brief description * @version 0.1 * @date 2022-09-12 * @time 23:38 * @link link * @copyright Copyright (c) 2022 */ #include <bits/stdc++.h> #define int long long using namespace std; signed main(...
ALGO
0.999994
4.719706
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2021-12-26T01:30: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": "ea754ddccf6f...
700fdd78-fcc0-4905-9d46-a61f689ca779
roniahamed/Phitron-School
First semester/Data Structure and c++/Week 3/Module 9/Class 4.cpp
#include<bits/stdc++.h> using namespace std; void PrintArray(int array[], int size) { for(int i=0; i<size; i++) { cout<<array[i] << " "; } cout<<endl; } int main() { int array [50]; int size; cin>>size; for(int i=0; i<size; i++) { cin>>array[i]; } cout<<"Giv...
ALGO
0.999896
4.265107
{ "github_metadata": { "branch": "main", "commit_count": 63, "repo_created_at": "2022-08-13T14:23:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fa822c09c4c...
f413e3b3-0330-4f9d-9181-3d780026c8fb
alleyhide/gweyl
CartanMatrix/InverseCartanMatrix.cpp
/** * @file InverseCartanMatrix.cpp * @author <NAME> <<EMAIL>> * @date 2018/04/30 * * @brief inverse matrix of CartanMatrix * * Released under the MIT license */ #include <map> #include <functional> #include "gweyl.hpp" namespace gweyl{ // // invers matrix of Cartan matrix of type A // std::function<...
ALGO
0.991165
5.205959
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2018-01-19T09:04: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": "796510e92...
60ef27cc-9c42-44e7-b381-9d7083d76fbd
stan-alam/CPlusPlus
Chap7.8a_page229.cpp
/* Array of structures vs an array of arrays The alternative to an array of structures os a choice of several arrays of arrays. In fact, early languages did not have the ability to create structure arrays. The array of arrays aka multidimensional array was a means to represent different but related data types. Disad...
ALGO
0.994091
4.811834
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2016-06-26T17:49:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "66f311d21...
cc5b2994-a0fc-463f-9e61-e9ec102d6200
manishyadavv/codepractice
GRAPHS/DijkastraAlgo.cpp
// // Created by <NAME> on 03/08/20. // #include<iostream> #include<vector> #include<climits> #include<queue> using namespace std; class Edge{ public: int nbr; int wt; }; vector<vector<Edge>> graph; void addEdge(int v1,int v2, int wt) { Edge e1; e1.nbr=v2; e1.wt=wt; graph[v1].push_back...
ALGO
0.999818
4.765162
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2020-05-13T10:53: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": "9d11e3817...
548a3346-8c41-45fd-8261-7aa46f98880b
Piotrwroc/Programowanie
Studia PP/Lab2.cpp
/* Autor: <NAME> Temat: Laboratorium 2 */ #include <iostream> #include <stdio.h> #include <iomanip> #include <ctime> #include <cstdlib> #include <math.h> #include <string> using namespace std; int NWD(int x, int y) { while (x != y) { if (x < y) { y -= x; } else x -= y; } return x; } int NWW(int ...
ALGO
0.981727
3.487688
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-03-06T14:51:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "63f0cc307312...
2c8a8a1b-5372-4d47-a6a7-7beed118b52d
akiiishiii/oi_exercises
pub/1584.cpp
// 1584.cpp #include <iostream> #include <cstring> #include <algorithm> long long d[110][110]; int n, m; void read(int &x); void write(int x); int main(int argc, char const *argv[]) { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); read(n); read(m); memset(d, 0x3f, sizeof(d)); for ...
ALGO
0.999998
3.783237
{ "github_metadata": { "branch": "master", "commit_count": 502, "repo_created_at": "2022-01-01T12:41: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": "30b92288...
9c1e92c4-32ae-4d76-89bd-102e4b17535d
mingjiaojiaozhu/Euler
project_euler/Problem016/Problem016.cpp
#include <iostream> #include <vector> #include <cmath> using namespace std; class Problem016 { public: void solution() { int target = 1000; int length = (target + 4) / 5; Decimal *decimal = new Decimal(length, 0); vector<int> auxiliary(length); get_power(target, decimal, aux...
ALGO
0.999728
5.1098
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2023-05-10T10:44: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": "f18195e4135...
1e688324-801a-440b-a4fd-45e4a0ab4223
Disruptiive/AoC23
day2a.cpp
#include <iostream> #include <fstream> #include <string> #include <vector> using namespace std; typedef enum Color { r, g, b } color_t; class Game{ public: int red; int green; int blue; int idx; bool valid; Game(int r, int g, int b, int index){ red = r;...
ALGO
0.98992
4.551274
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2023-12-08T15:46: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": "ce91c033668...
03b1f4f7-d6d4-4ba6-9ba2-3c09e323d913
emilyju0314/gpt_code_plagiarism
dataset/code_content_classifier/ai_code/train/0_0_6617.cpp
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<pair<int, int>> edges; for (int i = 1; i < n; i++) { edges.push_back({i, i+1}); } edges.push_back({1, 4}); edges.push_back({1, 2}); edges.push_back({2, 3}); edges.push_back({3, ...
ALGO
0.999907
3.875677
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2024-04-28T03:59: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": "763ca2a59b1...
7408c418-be41-47c1-9545-d240b19f1ded
fnixTiago/Biomolecular
lab_11.cpp
#include <iostream> #include <map> #include <vector> #include <algorithm> using namespace std; int sumar_v(vector<int>&v){ int tmp=0; for (int i = 0; i < v.size(); ++i){ tmp +=v[i]; } return tmp; } string mezclar(vector<string> &v){ string tmp=""; for (int i = 0; i < v[0].size(); ++i){ char inicio= v[0][0]...
ALGO
0.999777
3.375504
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2017-05-10T01:01:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2937d0b67...
85060396-2c08-4cfe-8c8e-bf1558e79786
plasmatic1/other-judge-solutions
olympiads school/2020 Winter Break Practice/bobs-lazy-update.cpp
// ./bobs-lazy-update.yml #include "bits/stdc++.h" using namespace std; // Defines #define fs first #define sn second #define pb push_back #define eb emplace_back #define mpr make_pair #define mtp make_tuple #define all(x) (x).begin(), (x).end() // Basic type definitions using ll = long long; using ull = unsigned long...
ALGO
0.99997
5.298738
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2019-10-11T00:00: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": "5de59c4a4...
082585cd-6338-4ae7-9034-9f3884ddae0f
DurexRescue/Dynamic_Search_Simultaneously_DFS_Dijkstra_Prim
MapProj/Graph.cpp
#pragma once #include "stdafx.h" #include"Graph.h" Graphmtx::Graphmtx(int sz) { //构造函数 maxVertices = sz; numVertices = 0; numEdges = 0; int i, j; VerticesList = new int[maxVertices]; //创建顶点表 Edge = (int **) new int *[maxVertices]; //创建邻接矩阵 insertVertex(0); insertVertex(1); insertVertex(2); insertV...
ALGO
0.939788
3.209778
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-10-30T13:45: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": "493f0b0701a5...
424c80b9-15c6-4889-8c26-d6c2a5e018ef
saarang123/Competitive-Programming
usaco/milkmix.cpp
#include<bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define f first #define s second typedef long long ll; void pour(int c1, int m1, int c2, int m2) { int amt = min(m1, c2 - m2); m1 -= amt; m2 += amt; } int main() { ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); ...
ALGO
0.999987
3.006072
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2021-05-13T07:29:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5f9dd794...
1a25b810-8f89-489b-8544-b863d14d9860
PedroPignata/taa
TAA-LEE07/descartes.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int N; cin >> N; vector<int> cards(N); for (int i = 0; i < N; ++i) { cin >> cards[i]; } vector<vector<int>> dp(N, vector<int>(N)); for (int i = 0; i < N; ++i) { ...
ALGO
0.999986
4.60318
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2025-03-12T11:32: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": "f08d7c901fb...
4e27578b-186a-4b1e-b39e-801a67b28c94
giridhar7632/advent-of-code
2024/day-10/day-10.cpp
#include <iostream> #include <fstream> #include <vector> #include <string> #include <queue> #include <set> using namespace std; vector<string> topographicMap; vector<pair<int, int>> trailHeads; void loadData() { string line = ""; ifstream ip("ip.txt"); if (ip.is_open()) { int i = 0; while (getline(ip, ...
ALGO
0.998891
3.764279
{ "github_metadata": { "branch": "main", "commit_count": 39, "repo_created_at": "2023-12-01T02:38:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e071e2f19ba...
e526d6b2-b7fc-4107-8409-deb0aeb0d964
takeoverjp/leetcode
874.walking-robot-simulation.cpp
/* * @lc app=leetcode id=874 lang=cpp * * [874] Walking Robot Simulation */ #include <bits/stdc++.h> #include "lassert/lassert.h" using namespace std; // @lc code=start class Solution { public: Solution() : angle_(Angle::kNorth), x_(0), y_(0), distance_(0) {} int robotSim(vector<int>& commands, vector<vect...
ALGO
0.99998
5.895585
{ "github_metadata": { "branch": "master", "commit_count": 837, "repo_created_at": "2020-10-30T15:34:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3de6e470...
45cd4e2e-2f52-4f3c-b77f-acdc2cc067d8
ishandutta2007/codeforces-i
-imc-/normal/1630/B.cpp
#include <bits/stdc++.h> using namespace std; #define all(v) (v).begin(), (v).end() using li = long long; struct Solution { int x = -1, y = -1; vector<pair<int, int>> s; bool can() { return !s.empty(); } }; Solution solve(vector<int> a, int k, int delta) { auto sorted = a; sort(all(sorted)); in...
ALGO
0.999864
4.826839
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T05:39: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": "2cfcb2247f6e...
95f76300-9976-4476-9318-4b768c84796e
aka0909/Data-Structures-and-Algorithms
DATA STRUCTURES/STRINGS/Longest_Palindrome_Substring.cpp
//TC: O(n^2) // AS: O(1) // { Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: string longestPalin (string S) { int maxlength=1; int start=0; int n=S.length(); int low,high; for(int i=1;i<n;i++) ...
ALGO
0.999929
5.764087
{ "github_metadata": { "branch": "main", "commit_count": 347, "repo_created_at": "2021-01-19T11:08: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": "965aec51f1...
ec0d3826-2ca6-41ee-9ac5-2d5887ce0752
DanielGrad99/adventofcode2023
13/q13.2.cpp
#include <algorithm> #include <cassert> #include <fstream> #include <iostream> #include <mutex> #include <set> #include <sstream> #include <thread> #include <tuple> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> typedef std::vector<std::string> Map; void Print(const Map& map) {...
ALGO
0.998551
4.6164
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-12-16T21:18: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": "c58b96edec97...
b523429f-fee5-4a52-882f-2f300d1d7c2b
rustem24liu/ADS2023
lab_4/c.cpp
#include <bits/stdc++.h> using namespace std; struct Node{ Node *left, *right; int value; Node(int value = 0){ this->value = value; right = left = NULL; } Node(int value, Node *right, Node *left){ this->value = value; this->right = right; this->left = left; ...
ALGO
0.999982
4.521134
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2023-09-29T07:11:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3b07a28daf...
9cb7ceef-5c61-4117-bd2b-4629c4f8ea0b
adnanaziz/EPIJudge
epi_judge_cpp_solutions/random_subset.cc
#include <algorithm> #include <functional> #include <iterator> #include <numeric> #include <random> #include <unordered_map> #include <vector> #include "test_framework/generic_test.h" #include "test_framework/random_sequence_checker.h" #include "test_framework/timed_executor.h" using std::bind; using std::default_ran...
ALGO
0.962726
6.632802
{ "github_metadata": { "branch": "master", "commit_count": 191, "repo_created_at": "2017-12-21T06:15:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2874, "forks": 1899, "issues": 47, "pull_requests": 33 }, "file_meta": { "content_id": "...
3ba2f2e3-65ae-4093-9faf-3fe5a2f14cfd
manhtung001/Datastructure-Algorithm-PTIT
code-cua-Thuan/may ATM.cpp
#include<bits/stdc++.h> using namespace std; int a[30],n,soto,d; long s ;// int s // dung bool use[30];// mang duyet phan tu a[i];kiem tra xem cac gia tri a[i] duoc su dung hay chua // soto : so luong to tien :tra ra ket qua cuoi cung // d so to tien hien tai dang xet , dang co void quaylui(int i){ for(int j=1...
ALGO
0.999928
3.271737
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2021-03-06T03:06:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "df9da2946...
66a5a01b-ab05-4ef7-b46b-1e6773bbe9cf
lisamahotina/clab
lab2/new_long.cpp
#include <iostream> class Create { private: long long value; public: Create(long long alt) { value = alt; } Create(Create const &alt) { value = alt.value; } Create() { value = 0; } long long get_alt() { return value; } void operator=(Create ...
ALGO
0.999323
5.328937
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2020-06-15T10:58: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": "d98de2fc2...
19f92b5a-55f2-44ed-9e78-c24f09821b51
x3fang/socket_tunnel
include/plugin.h
/* @author: x3fang */ #ifndef clientPlugin_h #define clientPlugin_h #include <map> #include <string> #include <winsock2.h> #include <ws2tcpip.h> #include <locale> #include <codecvt> #include <queue> #include <iostream> #include "globalDefine.h" namespace PluginNamespace { std::vector<std::string> traverseFiles(c...
TOOL
0.925723
3.681451
{ "github_metadata": { "branch": "main", "commit_count": 43, "repo_created_at": "2024-09-17T01:29:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "547d0d9c982...
ade477c9-89ce-462e-a714-9b82d4da3ed7
krenemy/cpp
week5/day3/consecOne.cpp
#include <iostream> #include <vector> using namespace std; typedef long long ll; // signed main() { // ios_base::sync_with_stdio(false); // cin.tie(0);cout.tie(0); // int _t;cin>>_t; // while(_t--){ // ll n,k;cin>>n>>k; // vector<ll> a(n); // for(ll i=0;i<n;i++) cin>>a[i]; // ...
ALGO
0.999971
5.318992
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2023-12-05T07:08:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3830deaac37...
f1b7d5cd-72c8-4fa0-8775-1a57e6f66f19
uwsampa/grappa
applications/nativegraph/sssp/sssp.cpp
#include <Grappa.hpp> #include <GlobalVector.hpp> #include <graph/Graph.hpp> #include "sssp.hpp" /* Options */ DEFINE_bool(metrics, false, "Dump metrics"); DEFINE_int32(scale, 10, "Log2 number of vertices."); DEFINE_int32(edgefactor, 16, "Average number of edges per vertex."); DEFINE_int64(root, 16, "Average number o...
ALGO
0.992361
5.899431
{ "github_metadata": { "branch": "master", "commit_count": 3825, "repo_created_at": "2012-06-24T20:46:44.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 158, "forks": 50, "issues": 77, "pull_requests": 18 }, "file_meta": { "content_id": "14a...
90f0d768-0bd6-45db-9de2-d2678c87f57d
anmolahuja03/LeetCode
split-linked-list-in-parts/split-linked-list-in-parts.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: vector<ListNode*> spl...
ALGO
0.999783
5.83852
{ "github_metadata": { "branch": "main", "commit_count": 175, "repo_created_at": "2021-10-18T00:49: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": "609ff6bf41...
ddd9e510-2bca-423f-a6da-dcdb9af49bc7
toufique-imam/SOLVED-PROBLEMS
LightOJ/LOJ 1269 Consecutive Sum.cpp
/* ID: sabertooth LANG: C++11 TASK: */ #include<bits/stdc++.h> using namespace std; typedef long long ll; #define eps 1e-9 #define inf 0x3f3f3f3f #define INF 2e18 #define PI acos(-1.0) #define ff first #define ss second #define all(v) v...
ALGO
0.999793
3.585088
{ "github_metadata": { "branch": "master", "commit_count": 286, "repo_created_at": "2017-10-28T13:52:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7987b240...
4892f51a-942c-43c0-bf65-76748017d268
msyahruakbar/praktikumAP1
PraktikumAPminggu9/BinarySearch.cpp
#include <iostream> using namespace std; // Fungsi untuk pencarian biner int bnry(int arr[], int ukuran, int cari) { int kiri = 0; int kanan = ukuran - 1; while (kiri <= kanan) { int tengah = kiri + (kanan - kiri) / 2; if (arr[tengah] == cari) { return tengah; // Nilai ditemuk...
ALGO
0.999962
6.104956
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-10-04T05:53: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": "0979f15b37a...
26ad6213-d1af-415c-9200-8dfd11c22b4d
vansh0784/localrepo1
c++/leaderinarray.cpp
#include<bits/stdc++.h> using namespace std; // this is the brute force approach having the time complexity of O(n2). void brute(int a[], int n){ // space complexity is O(1) in order to return the answer we use a vector which has size of O(N) vector<int>ans; for(int i=0;i<n;i++){ bool leader=true; ...
ALGO
0.999985
4.400931
{ "github_metadata": { "branch": "main", "commit_count": 100, "repo_created_at": "2024-01-09T05:18:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b9f9c25a85...
b5ba59d9-f28f-4821-a351-988ef004435d
intel/torch-xpu-ops
src/ATen/native/xpu/sycl/WeightNormKernels.cpp
#include <ATen/AccumulateType.h> #include <ATen/core/Array.h> #include <ATen/native/xpu/sycl/BatchKernel.h> #include <ATen/native/xpu/sycl/Reduce.h> #include <comm/SYCLContext.h> #include <comm/TensorInfo.h> #include <comm/TensorOptions.h> #include "comm/Runtime.h" #include <ATen/native/xpu/sycl/WeightNormKernels.h> ...
TOOL
0.946954
6.324904
{ "github_metadata": { "branch": "main", "commit_count": 932, "repo_created_at": "2024-02-05T23:41:22.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 49, "forks": 46, "issues": 166, "pull_requests": 63 }, "file_meta": { "content_id": "c724be...
fe06f368-2b2e-42e7-87d0-f3e97474deb4
Kawser-nerd/CLCDSA
Source Codes/CodeJamData/14/21/2.cpp
#include <string> #include <vector> #include <set> #include <map> #include <iostream> #include <algorithm> #include <sstream> #include <cmath> #include <string.h> #include <queue> #include <cstdio> #include <cassert> #include <deque> #include <stack> #include <utility> #include <numeric> #include <ctime> using namespa...
ALGO
0.999904
4.270344
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2019-09-30T05:38:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 8, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "bd732a07...
fae45ef7-bc4f-4865-812a-954c6a87c4c4
tonmoy197/Road_to_1400_on_Codeforces
D_Sharky_Surfing.cpp
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; while(T--){ long long n,m,L; cin >> n >> m >> L; // We'll store hurdles as {l, r, 1}, power-ups as {x, v, 0} vector<array<long long,3>> ev; ev.reserve(n...
ALGO
0.999549
3.998943
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2024-12-20T03:27:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0924144a10d...
cc012eea-efab-46d9-9fdd-36ff734a951e
BakrN/vortex
tests/opencl/psort/main.cc
#include <stdio.h> #include <stdlib.h> #include <assert.h> #include <math.h> #include <CL/opencl.h> #include <unistd.h> #include <string.h> #include <chrono> #define KERNEL0_NAME "psorti" #define KERNEL1_NAME "psortf" #define CL_CHECK(_expr) \ do { ...
ALGO
0.989096
4.980967
{ "github_metadata": { "branch": "experiments", "commit_count": 2199, "repo_created_at": "2023-12-14T10:26:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a0...
077be7d5-e3e3-45de-8140-47b54723ca20
Mazen-Abdelfattah/DataStructures_SortingAlgorithms
Sorting Algorithms/Sort_Students.h
#ifndef _SORT_STUDENTS_H #define _SORT_STUDENTS_H #include "Student.h" #include "Sorting_Algorithms.h" class applySorting { private: int n; Student *students; public: // Constructor to read input from file applySorting(const std::string& filename) { std::ifstream file(filename); if...
ALGO
0.998112
5.829996
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-07-08T17:40: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": "8834be9fcb6c...
7ee6660d-5e77-483e-ba89-3ed0a1c4167e
lilypaad/mandelbrot-GL
main.cpp
#include "main.h" const unsigned int SCREEN_WIDTH = 1280; const unsigned int SCREEN_HEIGHT = 720; bool zoomingIn = false; bool zoomingOut = false; bool panning = false; int maxIterations = 64; glm::dvec2 startPan = { 0.0, 0.0 }; glm::dvec2 screenOffset = { 0.0, 0.0 }; glm::dvec2 screenScale = { double(SCREEN_WIDTH)...
TOOL
0.92336
5.297946
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2021-10-20T13:00: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": "77ca970e0...
5f4aa38a-93ca-46e2-85b6-ced7e5efb204
vivekdhir77/Everyday
cpp/Chef_and_Coupon.cpp
//https://www.codechef.com/START1C/problems/COUPON2 #include<iostream> using namespace std; int main() { #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif int T; cin>> T; while(T--) { int D, C; int a1, a2, a3, b1,b2,b3; i...
ALGO
0.99958
3.997826
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2021-02-17T10:03: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": "d1102d3544c...
2eff9dfe-dc17-4cd7-a559-27b58dd5743e
enburk/en-wiktionary
_bracketer.h
struct bracketer { str output; std::stack <std::pair<str,str>, std::vector<std::pair<str,str>>> stack; array<str> report; str closing; str & opening () { return stack.top().first; } str & payload () { return stack.top().second; } void dump () { str repair = closing; ...
TOOL
0.92569
5.869792
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2019-04-28T12:00: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": "0a355ca8b...
522eb92f-627e-4d4c-b8dc-928caae0ff04
opentoonz/opentoonz
toonz/sources/toonzlib/sandor_fxs/SDirection.cpp
#include <memory> // SDirection.cpp: implementation of the CSDirection class. // ////////////////////////////////////////////////////////////////////// #include <stdlib.h> #include <memory.h> #include <algorithm> #include "SDirection.h" #include "SError.h" /////////////////////////////////////////////////////////////...
ALGO
0.9792
5.440649
{ "github_metadata": { "branch": "master", "commit_count": 4450, "repo_created_at": "2016-03-18T17:55:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4880, "forks": 563, "issues": 736, "pull_requests": 12 }, "file_meta": { "content_id": "...
b80baac3-4041-46f0-9ec6-39aab7c40184
xMihai01/PolishFormCalculator
PolishFormCalculator/PolishFormCalculator.cpp
#include <iostream> #include <string> #include <fstream> #include <vector> #include <stack> int prec2(std::string elem) { if (elem == "(") return 0; else if (elem == "+" || elem == "-") return 1; else if (elem == "*" || elem == "/") return 2; else if (elem == "^") return 3; else if (elem == ")") return ...
ALGO
0.999872
4.459101
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2022-09-11T11:17: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": "0e906b2132...
c64993f9-b3ea-45fd-ab2f-c7b95cfd73a0
sainikcodes24x7/CodeHUB
Delete node in Doubly Linked List - GFG/delete-node-in-doubly-linked-list.cpp
//{ Driver Code Starts #include <stdio.h> #include <stdlib.h> /* a Node of the doubly linked list */ struct Node { int data; struct Node *next; struct Node *prev; Node(int x){ data = x; next = NULL; prev = NULL; } }; // } Driver Code Ends /* Structure of Node struct Node { int dat...
ALGO
0.999764
5.652383
{ "github_metadata": { "branch": "main", "commit_count": 1987, "repo_created_at": "2022-07-22T16:07:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 18, "forks": 55, "issues": 14, "pull_requests": 16 }, "file_meta": { "content_id": "2dea3...
add88f67-cc25-4424-9500-b3946b4799be
Jaystka/Semester2
Pertemuan1/Akar.Kuadrat/Main.cpp
#include <iostream> #include <math.h> using namespace std; int main() { int a, b, c, D; float x1, x2; cout << "----------------------------------------\n"; cout << "Menghitung akar - akar persamaan kuadrat\n"; cout << "----------------------------------------\n"; cout << "Rumus persamaan: ax^2 + b...
ALGO
0.999197
4.080673
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-07-19T15: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": "343da69305e5...
07116d04-418e-4d51-8351-811ce1164360
HanYouyang/Computer
数据结构与算法/PATCode/PAT-Code-master/A1017.cpp
#include <cstdio> #include <vector> #include <algorithm> using namespace std; const int K = 111; const int INF = 1000000000; struct Customer { int comeTime, serveTime; } newCustomer; vector<Customer> custom; int convertTime(int h, int m, int s) { return h * 3600 + m * 60 + s; } bool cmp(Customer a, Customer b) ...
ALGO
0.999586
4.035613
{ "github_metadata": { "branch": "master", "commit_count": 133, "repo_created_at": "2017-03-19T03:43:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4c4bd24e...
befd7d40-95df-499b-8c98-ac6420904cd2
harshthakur3/Codeforces-Solution
B_Pashmak_and_Flowers.cpp
#include<bits/stdc++.h> using namespace std; #define int long long long long combinations_formula(int n) { if(n < 2) return 0; return (1LL * n * (n-1)) / 2; } int32_t main() { int n; cin >> n; vector<int> v(n); int maxi = INT_MIN, mini = INT_MAX; for(int i = 0...
ALGO
0.999907
3.889831
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2024-10-19T12:02: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": "30ee94bdbcb...
206706e2-7937-4a3b-ba2b-38ad0d750d00
Jae-Hyun-Park/study
Address/Address.cpp
#include <iostream> using namespace std; struct Person { char name[20]; char phone[20]; int age; char address[20]; }; Person* people[10] = { 0, }; int personNumber = 0; void interval() { cout << "====================" << endl; } void insertData() { people[personNumber] = new Person; cout << (personNumber+1)...
TOOL
0.939508
3.478369
{ "github_metadata": { "branch": "master", "commit_count": 233, "repo_created_at": "2018-03-07T10:53:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1105fd22...
0dc7b0f9-fdb3-46c4-8061-ea386f5e30e0
dean757j/PAT-Basic-Level-Practice
patA1034.cpp
/* 1034 有理数四则运算 */ #include <iostream> using namespace std; long long gcd(long long x, long long y) { long long tmp; while (0 != y) { tmp = x % y; x = y; y = tmp; } return x; } void numPrint(long long a, long long b) { if (0 == a) cout << 0; else if (a > 0)...
ALGO
0.999802
4.373597
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-12-15T08:59: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": "402d6fd10d9d...
f6d1247e-99d6-4a0b-9e1b-e2baf747f845
sheraztariq22/Competitve_DSA_Programming
Linked List/Reverse_k_list.cpp
#include <iostream> using namespace std; class node { public: node *next; int data; node(int val) { next = NULL; data = val; } void insertatTail(node *&head, int val) { node *n = new node(val); if (head == NULL) { head = n; // 10 ...
ALGO
0.999708
4.863292
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2024-01-16T12:49:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "da520ac3e50...
760b557f-a562-444c-b07a-95a8527c0cc9
grahamrp/cs106b
Assignment1-xcode/1 - Consecutive Heads/ConsecutiveHeads.cpp
/* * File: ConsecutiveHeads.cpp * -------------------------- * Name: [TODO: enter name here] * Section: [TODO: enter section leader here] * This file is the starter project for the Consecutive Heads problem. * [TODO: rewrite the documentation] */ /* Write a program that simulates flipping a coin repeatedly and...
ALGO
0.999918
6.566391
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2020-09-20T17:11:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "292e662f6...
2d7bff09-143a-404a-a1af-3d926f44bb65
AR13202/DS
Stacks/Stackuisngll template.cpp
#include<iostream> using namespace std; template <typename T> class Node { public: T data; Node<T> *next = NULL; Node(T x){ data = x; next = NULL; } }; template <typename T> class Stackusingll{ Node<T> *head; int s; public: Stackusingll(){ Node<T> *hea...
ALGO
0.997533
3.948778
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-05-18T06:57:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "466d4d342757...
f8d8a67c-4201-4aa4-927e-3254906844ff
Connor-Wilhoit/schoolwork-code
First-Semester/clean_discount.cpp
#include <iostream> #include <fstream> #include <vector> #include <algorithm> #include <cstdlib> #include <ctime> using namespace std; const int SIM_NUM = 10000; const int AVG = SIM_NUM; void ball_vector(vector<int> &balls); void work_space(); int main() { work_space(); return 0; } void ball_vector(vector<int> &balls...
ALGO
0.996206
3.674585
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2019-05-15T23:29: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": "2ff0ba6b1...
db8ded46-5f7d-48e5-a2b9-f3cfece4c85a
Apress/Ray-Tracing-Gems-II
Chapter_20/program.cpp
#include "program_defs.h" #define STB_IMAGE_WRITE_IMPLEMENTATION #include "stb_image_write.h" #include <stdint.h> #include <vector> #include <random> #ifdef WIN32 #define PCG_LITTLE_ENDIAN 1 #endif #include "pcg_random.hpp" // NOTE: Include order is a bit brittle due to some of these appearing exactly as they are in...
TOOL
0.920843
5.576684
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2021-07-30T16:21:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 911, "forks": 99, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4e3f0f0f4...
bd6d7046-9898-4943-a829-5b72fdc642cb
MartinKlapacz/p2p-course-registration-client
main.cpp
#include <iostream> #include <boost/asio.hpp> #include <boost/endian/conversion.hpp> #include <crypto++/sha.h> #include <crypto++/hex.h> #include <crypto++/filters.h> #include <string> #include <vector> // first 3 bytes must be zeros #define RANGE 3 using namespace boost::asio; using ip::tcp; using std::byte; cons...
WEB
0.935772
5.224676
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-04-24T07:56: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": "90572d4f7f77...
4bb755da-764e-4675-bfef-25005f0bd901
raincross7/code-similarity
codes/train_code/problem450/problem450_36.cpp
#include <iostream> #include <vector> #include <set> #include <deque> #include <map> #include <iomanip> #include <queue> #include <stack> #include <algorithm> #include <cmath> #include <cstring> #include <utility> using namespace std; int ky[8] = {-1,1,-2,2,-2,2,-1,1}; int kx[8] = {-2,-2,-1,-1,1,1,2,2}; int dy[4] = {-...
ALGO
0.999929
4.065772
{ "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": "2c0428220c30...
12dfe176-1794-46e8-b59d-7e4f2fa23e5f
Sinio-Manoka/tsunami_lab
src/patches/wavepropagation2d/WavePropagation2d.cpp
/** * @author <NAME>, <NAME>, <NAME> * @section DESCRIPTION * tow-dimensional wave propagation patch. **/ #include "WavePropagation2d.h" #include "../../solvers/Roe.h" #include "../../solvers/fwave.h" #include <iostream> #include <omp.h> tsunami_lab::patches::WavePropagation2d::WavePropagation2d(t_idx i_xCells, t_...
ALGO
0.997089
4.6354
{ "github_metadata": { "branch": "main", "commit_count": 376, "repo_created_at": "2023-10-16T15:59:56.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "breuera/tsunami_lab", "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_...
b13b00ff-d28c-4546-9b2a-a98c677f5413
AveryMunny/CompSci1
Project 1 test 3.cpp
/* COPYRIGHT(C) 2017 Student Name(4796397) All rights reserved. CSI assignment 1 A Author.<NAME> <EMAIL> Version. 1.01 07.09.2017 Purpose: */ /* ACADEMIC INTEGRITY PLEDGE - I have not used source code obtained from another student nor any other unauthorized source, either modified or unmodified. - All source code and d...
ALGO
0.981231
3.59083
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-04-24T20:54: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": "05bfb592e5d7...
97627ac9-f726-498a-b735-2c4381226a72
marinadabova/DataStructures
Data Structures/LinkedList/LinkedList.cpp
#include <bits/stdc++.h> using namespace std; struct Node { int data; Node* next; Node(int value) { this->data = value; next = nullptr; } }; class SLList { private: Node* head; Node* tail; public: SLList() { this->head = NULL; this->tail = NULL; } void push_back(int value) { Node* newNode = new N...
ALGO
0.999161
4.505628
{ "github_metadata": { "branch": "main", "commit_count": 72, "repo_created_at": "2022-08-09T08:16: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": "4e7a277403a...
23c57a29-1123-4e4a-9c2a-57dc756c2c27
Barrilao/Fundamentos_de_Programaci-n
Sesion 8/Ejercicio 8 (sesion8).cpp
//<NAME> /*Cree otra función para calcular el área hasta un punto cualquiera x, es decir, CDF(x), usando la anterior aproximación. Para implementar esta función, use la función Potencia del ejercicio 2 cuando tenga que calcular los términos t^i. Modifique el programa principal del ejercicio 7 para que llame a la fun...
ALGO
0.999238
4.371305
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2017-10-24T15:27: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": "9bed7f7aca...
698ceafa-2a58-4a91-9bb4-601f0df12077
liangt/algorithms
type/hash/count_int.cpp
/* #include <iostream> #include <cstdlib> #include <ctime> #include <cstring> #include <algorithm> using namespace std; const int N = 11; const int EMPTY = -1; int hash_array[N], ct[N]; void insert(int k){ int j; for(int i=0; i<N; i++){ j = (k + i) % N; if(hash_array[j] == k) brea...
ALGO
0.999054
3.641228
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2015-04-12T04:56:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "93a69db5d...
56627079-1266-4194-9784-d2745c004afa
Kitware/VTK
Filters/General/vtkLoopBooleanPolyDataFilter.cxx
// SPDX-FileCopyrightText: Copyright (c) <NAME>, <NAME>, <NAME> // SPDX-License-Identifier: BSD-3-Clause /** @file vtkLoopBooleanPolyDataFilter.cxx * @brief This is the filter to perform boolean operations * @author <NAME> * @author <EMAIL> */ #include "vtkLoopBooleanPolyDataFilter.h" #include "vtkAppendPolyDa...
ALGO
0.983957
6.777066
{ "github_metadata": { "branch": "master", "commit_count": 94968, "repo_created_at": "2010-04-27T15:12:58.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2910, "forks": 1246, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2...
e3cdad3c-f9d5-493d-b84a-34b6d91d2e51
organicmaps/organicmaps
search/locality_scorer.cpp
#include "search/locality_scorer.hpp" #include "search/cbv.hpp" #include "search/geocoder_context.hpp" #include "search/idf_map.hpp" #include "search/ranking_utils.hpp" #include "search/retrieval.hpp" #include "indexer/search_string_utils.hpp" #include "base/dfa_helpers.hpp" #include "base/levenshtein_dfa.hpp" #inc...
ALGO
0.900906
7.030499
{ "github_metadata": { "branch": "master", "commit_count": 42613, "repo_created_at": "2020-12-27T19:02:26.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 11487, "forks": 1128, "issues": 2796, "pull_requests": 182 }, "file_meta": { "content_i...
23c4f59b-db2e-4b23-92a5-ace10eda41de
sarthak621/DYNAMIC-PROGRAMMING
11754-390-494-target-sum/11754-390-494-target-sum.cpp
class Solution { public: //reffereing from [dp 18] int countPartitions(vector<int>& arr, int d) { int n = arr.size(); int totSum = 0; for(int i = 0; i < n; i++){ totSum += arr[i]; } if((totSum - d) < 0 || (totSum - d) % 2 != 0) return 0; int tar...
ALGO
0.999985
5.508102
{ "github_metadata": { "branch": "main", "commit_count": 92, "repo_created_at": "2025-04-01T18:02:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4b38e6fe059...
ab7d5eab-b0d7-4637-a8e4-6f143967c443
GarDeN-bear/MAP7_3
MAP7_3_2/main.cpp
#include <iostream> #include <vector> #include <random> #include <future> template <typename It, typename F> void parallel_for_each(It begin, It end, F func); template <typename It> void printContainer(It begin, It end); int main() { int N = 10; std::vector<int> v; for (int i = 0; i < N; ++i) { v.push_back(std:...
ALGO
0.998996
5.914047
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-07-29T19:31:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9fe28e82f5...
dafa9ae1-ea71-4f3e-9249-1e1dbabb071d
wme7/Matlab2CPP
MPI/heatEquation3d_domainDecomp3d/heat3d.cpp
#include "heat3d.h" dmn Manage_Domain(int rank, int npcs, int *coord, int *ngbr){ // allocate sub-domain for a one-dimensional domain decomposition in the Y-direction dmn domain; domain.rank = rank; domain.npcs = npcs; domain.ny = NY/SY; domain.nx = NX/SX; domain.nz = NZ/SZ; domain.size = domain.nx*do...
ALGO
0.997948
4.21152
{ "github_metadata": { "branch": "master", "commit_count": 163, "repo_created_at": "2016-02-20T15:27:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9881c8d7...
021c56be-c584-45b7-8286-b645f6b4541f
weiming21/AoC-2023
Day13/sol.cpp
// -*- C++ -*- // g++ -std=c++17 -o sol sol.cpp // ./sol 1 < input.txt # part 1 // ./sol 2 < input.txt # part 2 #include <iostream> #include <sstream> #include <cstdio> #include <vector> #include <numeric> #include <algorithm> #include <cassert> #include <map> #include <set> #include <queue> #define ll long long us...
ALGO
0.999877
5.142393
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-01-22T08:42: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": "e5cd3f318016...
6c0b71b4-1173-4d3e-8abc-1b993006c941
JosephZ7/ACM
ACM/字符串/01字典树求异或最大值.cpp
#include <stdio.h> #include <stdlib.h> #include <cmath> #include <string.h> #include <string> #include <algorithm> #include <map> #include <queue> #include <vector> #include <iostream> #define LL long long #define INF 0x3f3f3f3f const int MAX_N = 2e5+10; const LL mod = 1e9+7; const double eps = 1e-6; using namespace st...
ALGO
0.999975
3.870551
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-08-23T08:00: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": "b1937f59f0...
820ac263-e41f-40cb-8fe4-2f2b63e02cd1
liangkyle08/competitive-programming
MyProblems/bit-showdown.cpp
#include <bits/stdc++.h> using namespace std; #define fi first #define se second const int MOD = 1e9+7; const int MAX_N = 5e5; int N, Q; int A[MAX_N+1]; long long andSums[20][MAX_N+1]; long long orSums[20][MAX_N+1]; long long xorSums[20][MAX_N+1]; long long cnt[20]; int main() { ios::sync_with_stdio(false); ...
ALGO
0.999842
5.35448
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2024-06-26T21:56:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5a2b45fb1d8...
21937d55-923e-4601-b941-9cdd94c3de22
Akash-Das2024/Semaphores_Operating_System
staff.cpp
#include <iostream> #include <pthread.h> #include <semaphore.h> #include <bits/stdc++.h> #include <time.h> #define MIN_SLEEP 4 #define MAX_SLEEP 6 #define MIN_STAY 5 #define MAX_STAY 10 using namespace std; typedef struct Room { int room_id; int guest_id; int guest_priority; int dirty; int time; ...
TOOL
0.958338
4.0724
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-03-26T09:09: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": "a4513d0fe8...
d7df657b-cb98-4c0f-9054-e01ed7c0a10b
12057976/meme
Old Stuff (Pre 2020 Dec Bronze)/USACO-3.2/Magic Squares/msquare.cpp
/* ID: ayushn.2 TASK: msquare LANG: C++11 */ #include <iostream> #include <fstream> #include <cmath> #include <vector> using namespace std; struct square { string str = ""; int val = 0; }; int A(int N) { // Reverse an Integer int rem, reverse = 0; while(N != 0) { rem = N % 10; ...
ALGO
0.999735
3.155706
{ "github_metadata": { "branch": "main", "commit_count": 90, "repo_created_at": "2025-07-13T08:35: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": "b07b560c311...
e7a28f13-620f-450f-81a9-e79b082a51bd
ranebrown/CSCI2270_HW8_Graphs
Assignment8/Assignment8.cpp
/* * Assignment8.cpp * Assignment8 * * Created by Rane on 4/7/15. * Graph.h file and Graph.cpp modified from CSCI provided file */ #include "Graph.h" #include <fstream> #include <sstream> void DisplayMenu() { std::cout << "======Main Menu=====" << std::endl; std::cout << "1. Print vertices" << std::endl; s...
ALGO
0.919986
3.370289
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2015-04-08T23:24: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": "b22c53a738...
a5f90ca4-e7c4-4e61-9719-11e8783eaacb
gyouzasushi/library
test/yukicoder/2231.test.cpp
#define PROBLEM "https://yukicoder.me/problems/no/2231" #include <iostream> #include "string/rolling_hash.hpp" #include "string/wildcard_matching.hpp" void solve() { int n, m; std::string s, t; std::cin >> n >> m >> s >> t; std::vector<bool> ok = wildcard_matching_lower(s, t); for (char &c : s) { ...
ALGO
0.9998
4.272945
{ "github_metadata": { "branch": "main", "commit_count": 167, "repo_created_at": "2022-09-01T04:41: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": "1f210d0b45...
849e676e-6f8f-4a86-ab04-8c7f364028bc
tomergranit/BattleshipGame
BattleshipGame/CompetitionManager.cpp
#include "CompetitionManager.h" #include "Logger.h" #include <string> #include <algorithm> using std::lock_guard; using std::to_string; using std::min; using std::max; namespace battleship { void CompetitionManager::prepareCompetition(shared_ptr<BattleshipGameBoardFactory> boardLoader, shared_ptr<AlgoLoa...
ALGO
0.972697
6.500035
{ "github_metadata": { "branch": "master", "commit_count": 130, "repo_created_at": "2017-04-01T14:36: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": "90c25530...
c2f9a405-e105-48d5-95c8-4dfa48676dc6
Ritika1533/Coding-Challenges
L23-2DArray/spiralPrint.cpp
class Solution { public: vector<int> spiralOrder(vector<vector<int>> &matrix) { vector<int> ans; int row = matrix.size(); int col = matrix[0].size(); int count = 0; int total = row * col; // index int startRow = 0; int endCol = col - 1; in...
ALGO
0.999996
6.388477
{ "github_metadata": { "branch": "main", "commit_count": 145, "repo_created_at": "2023-10-08T06:28: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": "7238d4c3b2...
e61e86ed-cc95-451d-9e7e-055018678cc4
loveleon/algorithm-1
leetcode/leetcode-master/algorithms/cpp/summaryRanges/SummaryRanges.cpp
// Source : https://leetcode.com/problems/summary-ranges/ // Author : <NAME> // Date : 2015-07-03 /********************************************************************************** * * Given a sorted integer array without duplicates, return the summary of its ranges. * * For example, given [0,1,2,4,5,7], ret...
ALGO
0.999842
6.172302
{ "github_metadata": { "branch": "master", "commit_count": 139, "repo_created_at": "2018-05-31T09:50: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": "3a87679b...
48fde84c-bd40-471f-8879-a50df7cfc536
nick-hu/cppsenior
fileio/opoverload.cpp
#include <iostream> #include <fstream> #include <vector> #include <cmath> #include <sstream> #include <algorithm> using namespace std; struct Vector { Vector(); Vector(vector <double>); Vector(string); vector <double> vect; }; Vector::Vector() {} Vector::Vector(vector <double> v) { vect = v; } ...
ALGO
0.997286
4.296641
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2014-09-24T15:58:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "797520087...
372fb789-9454-460a-9bfc-8cc0070a4e4e
Exactlywb/ISP_TEST_PERF
utility/source/FunctionData.cpp
#include <FuncData.hpp> std::vector<long long> graps (std::vector<std::vector<long long>> weigth); namespace HFData { node::node (const std::string &name, uint64_t size, cluster *aux) : name_ (name), size_ (size), aux_ (aux) { } cluster_edge::cluster_edge (cluster *caller, cluster *callee, uint64_t count, uint6...
ALGO
0.999418
5.116698
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2022-06-23T19:58: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": "e0fad02a8...
2584e922-7999-436f-9353-1c07f982ad15
SHIVANSH-A/DSA
Vectors/Leetcode/ThreeConsecutiveOdds.cpp
// Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false. #include <iostream> #include <vector> using namespace std; class Solution { public: bool threeConsecutiveOdds(vector<int>& arr) { int n = arr.size(); int oddCount = 0; ...
ALGO
0.999764
6.121534
{ "github_metadata": { "branch": "main", "commit_count": 233, "repo_created_at": "2024-12-07T04:52: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": "d5af68480e...
c90d6c1b-9625-4ede-8874-58b4cd41aaad
singhsaurav23/DSA
Codeforces/Contest/greedy+intuitive/C.Superultra'sFavoritePermutation.cpp
#include <bits/stdc++.h> using namespace std; #define ll int int main() { ll t; cin >> t; while (t--) { ll n, i; cin >> n; if (n < 5) { cout << -1 << endl; } else { // Print even numbers except 4 for (i = 2; i <= n; i += 2) { ...
ALGO
0.999841
4.603408
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2024-10-21T13:46: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": "4950bf720...
86aa08ee-352e-40ab-a2cc-d73df37c78d3
JunSince99/BaekJoon
C++/2025-05/23/14500.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int N, M; int ans = 0; int board[500][500]; bool visited[500][500]; int dx[4] = {0,0,-1,1}; int dy[4] = {-1,1,0,0}; void dfs(int i, int j, int depth, int sum) { if(depth == 4) { ans = max(ans, sum); return; } ...
ALGO
0.999978
4.410264
{ "github_metadata": { "branch": "main", "commit_count": 114, "repo_created_at": "2024-12-18T08:05: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": "cb3ab1122f...
293343df-ee32-4121-9976-9e2da197cbeb
joysarker39/CSE-0314-FALL-2021
Ellipse/Ellipse.cpp
#include <windows.h> #include <cmath> #define ROUND(a) ((int) (a + 0.5)) /* set window handle */ static HWND sHwnd; static COLORREF redColor=RGB(255,0,0); static COLORREF blueColor=RGB(0,0,255); static COLORREF greenColor=RGB(0,255,0); void SetWindowHandle(HWND hwnd) { sHwnd=hwnd; } /* SetPixel */ voi...
ALGO
0.939677
5.551403
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2021-10-20T04:37:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "592d8db40a9...
cb22e025-4e61-43b8-be44-49b7d735fb36
tsfdssm/leetcode
725.分隔链表.cpp
/* * @lc app=leetcode.cn id=725 lang=cpp * * [725] 分隔链表 */ // @lc code=start /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : ...
ALGO
0.999714
6.363209
{ "github_metadata": { "branch": "master", "commit_count": 73, "repo_created_at": "2021-05-04T05:37:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "374a48c44...
a1029909-c7d1-4062-9af9-a31bc4287d65
ibnulferdous/phitron-basic-data-structure
6. operation on linked list/1_insert_at_tail.cpp
#include <bits/stdc++.h> using namespace std; // Class declaration class Node { public: int val; Node *next; Node(int val) { this->val = val; this->next = NULL; } }; // Function declaration void head_insert(Node *&list, int value); void position_in...
ALGO
0.989754
4.692665
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-08-20T16:34: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": "684ed456d856...
b628bb8d-ec23-4f8d-8736-f1cad3fee004
thomasneff/advent_of_code_2020
day10/day10_02/day10_02.cpp
#include <algorithm> #include <deque> #include <fstream> #include <iostream> #include <set> #include <sstream> #include <string> #include <unordered_map> #include <vector> int main() { std::ifstream input_file("input.txt"); std::string input_line; std::vector<std::string> input_lines; std::vector<long long> in...
ALGO
0.99977
4.565045
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2020-12-01T08:51:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3947f98eb19...