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
a6cc0d28-f0e6-4a35-a1a5-d3bb96858fab
dhc667/HexAI
src/monte_carlo_dsu/tree_search.hpp
#pragma once #include "../models/board.hpp" #include "dsu_board.hpp" #include "tree.hpp" #include <algorithm> #include <chrono> #include <exception> #include <set> #include <string> #include <vector> // #define DEBUG 1 #ifdef DEBUG #include <iostream> #endif // DEBUG class MCTSearch_Tree { private: DSUBoard board...
ALGO
0.998856
4.917016
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2025-04-12T03:46:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a290bb005404...
d37b952c-ca44-46cd-a9d8-9a9c64f9cf52
daocrossover/Leetcode-Cpp
525. Contiguous Array/Solution1.cpp
// Description: // Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. // Example 1: // Input: [0,1] // Output: 2 // Explanation: [0, 1] is the longest contiguous subarray with equal number of 0 and 1. // Example 2: // Input: [0,1,0] // Output: 2 // Explanation: [0, 1]...
ALGO
0.999997
6.156301
{ "github_metadata": { "branch": "master", "commit_count": 249, "repo_created_at": "2018-09-10T19:58:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "59018142...
3298bdb4-10f6-4062-b467-c6007bbe7fe0
jezuina/reinforcement_learning
controllers/obstacle_avoidance_path_finding/obstacle_avoidance_path_finding.h
/* * AUTHOR: <NAME> <<EMAIL>> * * An example diffusion controller for the foot-bot. * * This controller makes the robots behave as gas particles. The robots * go straight until they get close enough to another robot, in which * case they turn, loosely simulating an elastic collision. The net effect * is that ov...
ALGO
0.999012
5.522228
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2018-12-05T20:35:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "608a2a9f5...
cba08218-4f17-49c7-8539-df8181914ad5
Pjha72/Placement-Series-DSA-Question
Greedy Algorithm/Q46 Fractional Knapsack Problem/Brute Force.C++
#include <bits/stdc++.h> using namespace std; struct Item { int value, weight; }; bool comp(Item a, Item b) { double r1 = (double)(a.value) / (a.weight); double r2 = (double)(b.value) / (b.weight); return r1 > r2; } // T.C : O(nlogn) + O(n) S.C : O(1) double FractopnalKnapsack(int n, int W, Item arr[...
ALGO
0.999898
4.765128
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2024-01-12T10:58: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": "354853d2d90...
6953b847-61e0-4beb-9416-2bcd13023698
RakibulRanak/Solved-ACM-problems
Codeforces/Filling the Grid cf 1228B.cpp
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int r, c; cin >> r >> c; int ara[r][c]; memset(ara, -1, sizeof(ara[0][0]) * r * c); int R; for (int i = 0; i < r; i++) { cin >> R; int j; for ( j = 0; j < R; j++) ara[i][j] = 1; if (j < c)...
ALGO
0.999977
3.617411
{ "github_metadata": { "branch": "master", "commit_count": 63, "repo_created_at": "2019-02-03T18:14:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b50511e31...
59e56b96-6870-485c-9735-9bbddc8ba91d
avcopan/electronic-structure-with-eigen-tensor
4rhf/rhf.cpp
#include "rhf.hpp" namespace rhf { RHF::RHF(Shared<psi::Wavefunction> wfn, psi::Options& options) : options_(options), integrals_(new integrals::Integrals(wfn, options)) { Shared<psi::Molecule> mol = wfn->molecule(); int nelec = - mol->molecular_charge(); // calculate the number of electrons a...
ALGO
0.977745
5.005466
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2016-05-17T18:23: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": "ef575d11e0...
089a460a-666c-4359-95fc-d1b8cbe22b5c
AndyC27/AndyC
main.cpp
#include <iostream> #include <string> using namespace std; class VigenereCipher { private: string key; public: VigenereCipher(const string& keyword) : key(keyword) {} string encrypt(const string& plaintext) { string ciphertext = ""; int keyLength = key.length(); for (int i = 0; ...
ALGO
0.999758
6.325605
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-12-08T21:59: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": "8f5816cc4ec3...
1ab6976b-9a74-482c-ba87-5f750d34212f
udit043/little_bit_competitive
chef/CHEFHPAL.cpp
// incomplete #include <bits/stdc++.h> using namespace std; #define mx 1000007 #define ll long long #define inf 99999999 #define sll(x) scanf("%lld", &x) #define sd(x) scanf("%d", &x) int main() { ll t; sll(t); while(t--) { ll n=0, al=0, i=0, num=0; sll(n); sll(al); // if(n == 1) // { // printf("1 a"); /...
ALGO
0.999431
3.02542
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2017-03-25T20:51: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": "5435fd3b0...
6f1349d6-0455-4979-a0dc-e49e7fb01857
honood/leetcode
solutions/1696-jump-game-vi.cpp
// HoNooD <<EMAIL>> // 2024.07.28 19:55 // 1696. Jump Game VI // https://leetcode.com/problems/jump-game-vi/description/ auto __unsync_ios_stdio = ios::sync_with_stdio(false); auto __untie_cin = cin.tie(nullptr); class Solution { public: int maxResult(vector<int>& nums, int k) { return max_result_v4(nums, k); ...
ALGO
0.999939
6.378371
{ "github_metadata": { "branch": "main", "commit_count": 320, "repo_created_at": "2022-06-04T09:04: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": "95b145d6e6...
98bd5b61-7fbb-4421-a9a6-f4d7812e4211
jjdevic/EDA
Cuatrimestre 1/Recursion/15.cpp
//Ejercicio 15 //<NAME> - EDA 2ºE 2018/2019 //E01 #include <iostream> #include <vector> #include <fstream> struct sol { unsigned long long int num; unsigned int pot; }; unsigned long long int resuelveComplementario(const unsigned long long int &n) { if (n <= 9) return 9 - n; return (9 - (n % 10)) +...
ALGO
0.997497
4.427783
{ "github_metadata": { "branch": "master", "commit_count": 172, "repo_created_at": "2020-10-27T16:02: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": "d8b8ed98...
f3d80fcb-c66f-48ab-8ac7-64e0c3ec8593
Vikrant0-7/DataStructures
include/BinaryTree/avl_node.h
// // Created by vicky on 12-11-2023. // #ifndef LAB_AVL_NODE_H #define LAB_AVL_NODE_H #include <iostream> template <typename T> class AVLNode{ private: T data; AVLNode<T>* leftChild; AVLNode<T>* rightChild; AVLNode<T>* parent; int balanceFactor; public: AVLNode(T data, AVLNode<T>* _parent); ...
ALGO
0.994774
5.264961
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2023-12-01T16:24: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": "66fbe1d62...
cddc64c0-35f3-4827-8500-b361829f8c4a
copasi/COPASI
copasi/elementaryFluxModes/CSSAMethod.h
// Copyright (C) 2019 - 2022 by <NAME>, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. // Copyright (C) 2017 - 2018 by <NAME>, Virginia Tech Intellectual // Properties, Inc., University of Heidelberg, and Univ...
ALGO
0.999651
6.455221
{ "github_metadata": { "branch": "develop", "commit_count": 17372, "repo_created_at": "2012-06-27T16:35:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 112, "forks": 33, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c64...
848a2ff9-e950-46a4-a15f-762f20102c03
KaziRifatAlMuin/Online-Judges
Codeforces/Greedy - B. pspspsps.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; void solve() { bool ok = true; string s; int n; cin >> n; cin >> s; bool pp = false, ss = false; for(int i = 1; i < n - 1; i++){ if(s[i] == 's') ss = true; if(s[i] == 'p') pp = true; } if(ss && pp) ok = ...
ALGO
0.99988
4.792098
{ "github_metadata": { "branch": "main", "commit_count": 119, "repo_created_at": "2023-04-27T10:28:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "da419858c8...
10cb118f-321e-4b53-b563-f0f5c048fc0c
gabeah/CS-code
CS221_code/C++/helping_yy/Archive/huffman.hh
/* * Huffman: a class to encode and decode symbols based on adaptive Huffman coding * https://en.wikipedia.org/wiki/Huffman_coding */ #pragma once #include <climits> #include <vector> #include <unordered_map> #include <list> #include "htree.hh" #include "hforest.hh" class Huffman { public: // Maximum numbe...
ALGO
0.999561
6.268591
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2022-01-28T23:08: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": "f6eb6c38db3...
2f646fbb-fe79-4af7-8505-ac161e11c332
mkawak/CS-142
Programming I/A. Ski/main.cpp
// // main.cpp // <NAME> // // Created by <NAME> on 02/06/22. // #include <iostream> #include <vector> #include <algorithm> using namespace std; int compute_Path(vector<vector<int>>& matrix, vector<vector<int>>& matrix_To_Solve, int row, int col, int& m, int& n) { // Hold our longest path from point to i...
ALGO
0.999987
4.724607
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-06-05T18:57: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": "0f985ddbc553...
17a08a9b-9d09-4f4b-89fc-e21620512316
cda-tum/fiction
experiments/random_sidb_layout_generation/sidb_location_and_ground_state_simulation.cpp
// // Created by <NAME> on 04.05.23. // #include "fiction/algorithms/simulation/sidb/quickexact.hpp" #include "fiction/algorithms/simulation/sidb/sidb_simulation_parameters.hpp" #include "fiction/io/read_sqd_layout.hpp" #include "fiction/io/write_location_and_ground_state.hpp" #include "fiction/technology/sidb_lattice...
TOOL
0.910554
6.151574
{ "github_metadata": { "branch": "main", "commit_count": 766, "repo_created_at": "2018-10-29T17:51:02.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 75, "forks": 28, "issues": 2, "pull_requests": 14 }, "file_meta": { "content_id": "7ee44a8b...
aa15266c-efbd-4689-80bc-c0e1c0aad62c
Chomtana/cptraining
whiteboard/liststl1.cpp
#include <bits/stdc++.h> #define for1(a,b,c) for(int (a)=(b);(a)<(c);(a)++) #define for2(i,a,b) for(int (i)=(a);((a)<=(b)?(i)<=(b):(i)>=(b));(i)+=((a)<=(b)?1:-1)) #define all(x) x.begin(),x.end() #define until(x) while(!(x)) using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi...
ALGO
0.998673
3.182793
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2016-04-15T03:46:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "36db3e193...
6124c9de-78af-436e-ac09-173b6851c3fc
mancini-ma-tech/C-
Es6.cpp
/*Scrivere un programma per la rappresentazione del triangolo di Floyd.Il triangolo di floyd è un triangolo che contiene numeri naturali, definito riempiendo le righe del triangolo con numeri consecutivi e partendo da 1 nell'angolo in alto a sinistra. Il programma riceve da tastiera un numero N. Il programma visualizza...
ALGO
0.998976
3.505798
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-09-28T16:19: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": "d11c845090a5...
7e16858e-c0d8-4eb3-b397-90467f202d04
linhnvhdev/Doi_tuyen_quoc_gia
ICPC/BoringBits.cpp
#include<bits/stdc++.h> #define For(i,a,b) for(int i = a;i <= b;i++) #define Forr(i,a,b) for(int i = a;i >= b;i--) #define ll long long using namespace std; const int mod = 666777; const int mod1 = 3; const int mod2 = 37; const int mod3 = 6007; ll ans = 0; ll fact[1000005]; int M1 = mod/mod1,M2 = mod/mod2,M3 = mod/mod...
ALGO
0.999962
3.736422
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-08-05T13:39:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5f6c1ea8f79a...
df9450de-3fbf-4d59-b95c-0d40716f59ff
hallamlab/LAST-Plus
src/Alignment.cc
// Copyright 2008, 2009, 2011, 2012, 2013, 2014 <NAME> #include "Alignment.hh" #include "Alphabet.hh" #include "Centroid.hh" #include "GappedXdropAligner.hh" #include "GeneticCode.hh" #include "GeneralizedAffineGapCosts.hh" #include "TwoQualityScoreMatrix.hh" #include <cassert> // make C++ tolerable: #define IT(type)...
ALGO
0.994291
5.945047
{ "github_metadata": { "branch": "master", "commit_count": 157, "repo_created_at": "2015-06-25T01:01:15.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 19, "forks": 3, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "1b1c355a...
96f37b79-72c3-40da-8314-b7309a7f38c5
xuhaoddd/course-gl
3-4.cpp
#include <stdio.h> #include <math.h> #include <GL/glut.H> //格子の細かさ #define CELLN 50 //セルのデータ int cell[CELLN][CELLN][CELLN]; //簡略化前のメッシュのデータ int ver0N; float (*ver0)[3]; int tri0N; int (*tri0)[3]; float cell_verN[CELLN][CELLN][CELLN]; float cell_ver_sum[CELLN][CELLN][CELLN][3]; //簡略化後のメッシュのデータ int verN; float (*v...
TOOL
0.933078
3.863235
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2019-11-10T08:17:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d3511dd89...
5ba653ae-d081-4025-b136-93a8c1435fbe
ishandutta2007/codeforces-i
ivan100sic/normal/1305/B.cpp
// I've decided to retire from ALL contests // It's been a nice ride... but I need to move on #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; bool moze(string s) { int n = s.size(); for (int i=0; i<n; i++) { if (s[i] == '(') { for (int...
ALGO
0.996615
3.780321
{ "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": "866174d6704e...
80d452e7-cbe0-45fa-baf9-1a1e753f4bc3
Gedanke/CppHmCourse
stage5/codes/part1/1_1/1_6.cpp
#include <iostream> using namespace std; class Person { public: string name; int age; public: Person(string name, int age) { this->name = name; this->age = age; } }; // 普通函数模板 template <class T> bool myCompare(T &a, T &b) { return (a == b); } // 具体化,显示具体化的原型和定意思以 template<> ...
TOOL
0.972498
5.469815
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2022-06-27T07:41:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dd39b3ecc...
e3aebdb9-900e-4260-9bff-cf4c21b0d36e
shareone2/LuoGuOj
1605迷宫.cpp
/************************************************************************* > File Name: 1605迷宫.cpp > Author: > Mail: > Created Time: 2019年04月30日 星期二 18时11分56秒 ************************************************************************/ #include <iostream> using namespace std; void dfs(int x, int y); bool flog[6][7...
ALGO
0.999876
4.069839
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-09-07T14:50:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "435021a3b5...
96f413e7-d6c8-4ead-8ca6-47d1637a0ef3
haruhamy/Data_Structures_and_Algorithm_PKA
Sort/Quick_sort.cpp
#include <bits/stdc++.h> using namespace std; // Hàm phân hoạch theo Lomuto int partition(int a[], int l, int r) { int pivot = a[r]; // Chọn phần tử cuối làm pivot int i = l - 1; // Chỉ số i bắt đầu từ vị trí l - 1 for (int j = l; j < r; j++) { if (a[j] <= pivot) { ...
ALGO
0.999909
5.929153
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2024-07-28T20:14: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": "bc5c3210d3...
c4cd746e-c53c-4c2b-b8bf-43b3234958bc
RK-41/Cpp
STACK/Stock_Span_Problem.cpp
/* 06.09.23 PORBLEM: Stock Span Problem (GFG: Medium) APPROACH: Using stack to keep track of previous greater price. Stack stores the indices of the previous greater price which are used to calculate the span for the current price. */ #include<bits/stdc++.h> using namespace std; cl...
ALGO
0.999928
6.156834
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2023-09-08T18:33:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4414e1fc66a...
32b4cbc7-33e5-4591-b2cd-d4843d1dfe82
baris-topal/Stack
Stack.cpp
#include <iostream> using namespace std; class st { public: int boyut; int top; int* d; int pop(st* s); void push(int x, st* s); void yazdir(st* s); st* tanimla(); st* stack1; st* stack2; }; st* st::tanimla() { st* s = new st; s->boyut = 2; s->top = -1; s->d = NULL; return s; } int st::pop(st* s) { i...
ALGO
0.999138
4.106828
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-03-25T18:40:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "35560b334cb1...
71009f4f-078f-4b94-96bf-3a29240c838f
Xushi8/Code
2023/2023_September/div3 1883/e.cpp
// 2023/10/22 20:21:30 #include <iostream> #include <algorithm> #include <cstring> #include <cstdint> #include <vector> #include <string> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <queue> #include <functional> #include <iomanip> #include <cmath> #include <stack> #include <...
ALGO
0.999922
4.777796
{ "github_metadata": { "branch": "main", "commit_count": 690, "repo_created_at": "2022-12-29T08:34:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c0c65f26db...
7dd3c434-623e-4baa-a46d-22de70725fd0
Geek-prince7/DSA
BST/PairSumInBST.cpp
#include<iostream> #include"BinaryTree.h" #include<stack> using namespace std; void printNodesSumToS(BinaryTreeNode<int> *root, int s) { // Write your code here stack<BinaryTreeNode<int>*> in,rev_in; BinaryTreeNode<int>* current=root; while(current) { in.push(current); //cout<<curre...
ALGO
0.999984
4.10047
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2022-04-08T12:48:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4c523ebbb8...
c786f92d-991c-4d83-ac77-6a5b2bd0044c
AhmadHRai/LeetCode
1501→2000/1937. Maximum Number of Points with Cost/solution1.cpp
class Solution { public: // Function to compute the maximum points achievable with specific constraints long long maxPoints(vector<vector<int>>& points) { // Initialize a 2D dp vector to store maximum points up to each cell, with -1 as initial value vector<vector<long long>> dp(points.size(), ve...
ALGO
0.999997
6.703311
{ "github_metadata": { "branch": "main", "commit_count": 950, "repo_created_at": "2023-08-24T18:24:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2a210ff9dc...
7402591b-fbb3-472c-a678-2d4c0c459a87
C-B-U/algorithm_challenge
시즌8/중/noodlechoi/0220_6_noodlechoi.cpp
#include <iostream> #include <algorithm> // 행운의 문자열 /* * 첫째 줄에 문자열 S가 주어진다. S의 길이는 최대 10이고, 알파벳 소문자로만 이루어져 있다. * 첫째 줄에 위치를 재배치해서 얻은 서로 다른 행운의 문자열의 개수를 출력한다. */ using namespace std; int alphabet[27]; int result; void solution(int idx, string tmp, const string& str) { if (idx == str.size()) { result++; return; ...
ALGO
0.999837
4.439093
{ "github_metadata": { "branch": "main", "commit_count": 2333, "repo_created_at": "2022-04-27T14:04:13.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 14, "forks": 68, "issues": 6, "pull_requests": 8 }, "file_meta": { "content_id": "97efea6e...
0fb9a609-127f-4b81-9ff8-78296c8f033e
danthinnee/matrix-multi-practice
program4.cpp
#include <iostream> #include <fstream> #include <string> #include <cstdlib> using namespace std; struct Car { string make; string model; string year; string color; Car *next; }; struct List { // First car in the list. A value equal to NULL indicates that the // list is empty. Car *head; // Current car in the...
ALGO
0.987773
4.741222
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2016-10-30T06:26: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": "6f086197f...
8fd2b7b9-3a11-44d3-8bfb-7c470b2365c2
Ryota819/atcoder_cpp
abc265/a/main.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; const int INF = 1e9; const ll LINF = 1e18; #define dump(x) cout << #x << " = " << (x) << endl; #define YES(n) cout << ((n) ? "YES" : "NO") << endl; #define Yes(n) cout << ((n) ? "Yes" : "No") << endl; #define FOR(i, a, b) for (int i = (a); i < (b); +...
ALGO
0.999967
4.164107
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2022-09-01T13:29: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": "c10655d57bc...
17cb6dab-3bc7-413f-85e9-3a694a6bb731
joramwessels/INFOMAGR
Plane.cpp
#include "precomp.h" #include "Plane.h" Plane::Plane(vec3 N, float d, Material material) { this->N = N.normalized(); this->d = d; this->material = material; //Rotate the normal 90 degrees along the Y axis to get the X-axis local to the plane. Used for textures Xaxis.x = N.x * cosf(90 * PI / (180)) + N.z * sinf(9...
ALGO
0.920565
6.019794
{ "github_metadata": { "branch": "master", "commit_count": 151, "repo_created_at": "2019-07-23T09:50: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": "ec1a5abc...
1dfea13e-afe1-40de-aede-0f8393e20cf1
matias-lg/taller-prog-comp
tarea1/playlist.cpp
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int n, k; cin >> n; cin >> k; multiset<pair<long long, long long>> s; // leer input y ordenar pares (belleza, tiempo) for (int i = 0; i < n; i++) { long long t; cin >> t; long long b; cin >> b; s.insert(pair...
ALGO
0.999889
4.005569
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-04-09T19:53: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": "a1a141d49fbf...
c6e4ca7c-c201-48d1-8cb9-505ebd7172b6
liangheming/FASTLIO2_ROS2
fastlio2/src/map_builder/commons.h
#pragma once #include <Eigen/Eigen> #include <pcl/point_types.h> #include <pcl/point_cloud.h> using PointType = pcl::PointXYZINormal; using CloudType = pcl::PointCloud<PointType>; using PointVec = std::vector<PointType, Eigen::aligned_allocator<PointType>>; using M3D = Eigen::Matrix3d; using V3D = Eigen::Vector3d; us...
TOOL
0.963615
5.30733
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2024-06-03T06:50:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 314, "forks": 37, "issues": 9, "pull_requests": 1 }, "file_meta": { "content_id": "d3390ed6...
2d1a1d13-d63b-4dbf-a075-0cb81dd68f8a
alomerry/algorithm
code/pat/a/1102/main.cpp
#include <string> #include <iostream> #include <vector> #include <queue> #define max_size 11 using namespace std; bool isRoot[max_size]; int n, index; struct node { int v, left, right; node() { v = -1; left = -1; right = -1; } }; node tree[max_size]; void postOrder(node &root) { ...
ALGO
0.999987
3.504189
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2020-07-22T10:51: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": "d3bb088ad...
2b93ae34-be07-4750-be87-eda1073161f6
dotnet/machinelearning
src/Native/LdaNative/light_doc_sampler.hpp
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once #include "type_common.h" #include "lda_document.h" #include "rand_int_rng.h" #include <string> #includ...
TOOL
0.90084
6.845904
{ "github_metadata": { "branch": "main", "commit_count": 2999, "repo_created_at": "2018-05-03T16:20:42.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 9223, "forks": 1926, "issues": 979, "pull_requests": 9 }, "file_meta": { "content_id": "29...
f0f12b15-cf89-4eac-a692-9581272bfe33
Chirag2204/LeetCode-Problems
105-construct-binary-tree-from-preorder-and-inorder-traversal/105-construct-binary-tree-from-preorder-and-inorder-traversal.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.999997
6.305978
{ "github_metadata": { "branch": "main", "commit_count": 2200, "repo_created_at": "2022-04-01T01:15:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c6a6929de...
f093c9c7-feca-409a-8e09-964fac9fcd30
Seann0425/LeetCode
finished/3033. Modify the Matrix.cpp
#include <bits/stdc++.h> using namespace std; 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) { } }; struct TreeNode { int val; TreeNode *left; ...
ALGO
0.99996
5.017731
{ "github_metadata": { "branch": "main", "commit_count": 659, "repo_created_at": "2024-05-02T09:26: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": "b2bf811cd8...
6b4e34bc-a636-4959-891c-cea74f73502e
dannyboy-projects/three-legged_table_monte_carlo_sim
helpers.cpp
#include <cmath> float gen_rand_no(float lb, float ub){ return lb + (float) rand() / ( (float) (RAND_MAX/(ub - lb)) ); } float cart2bary_lamda1(float a_x, float a_y, float b_x,float b_y, float c_x, float c_y, float p_x, float p_y){ return ((b_y - c_y)*(p_x-c_x) + (c_x - b_x)*(p_y - c_y))/((b_y - c_y)*(a_x - c_x...
ALGO
0.999266
3.890137
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2024-08-27T22:24: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": "ba66964b69...
76c32e1a-57ce-4bd7-8504-383e6644167e
CyFI-Lab-Public/RetroScope
external/openfst/src/include/fst/script/topsort.h
// Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed...
ALGO
0.999233
7.05083
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2016-05-15T23:49:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 120, "forks": 43, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "b75553...
14a00949-c44b-48d7-a81b-321e74a9c02b
Geant4/geant4
source/processes/hadronic/util/include/G4WilsonRadius.hh
// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration...
CONFIG
0.941636
5.601548
{ "github_metadata": { "branch": "master", "commit_count": 83, "repo_created_at": "2016-06-21T08:25:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 705, "forks": 340, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "a88992...
5f4cbeaa-579b-4608-be80-778ba4e55a41
Shikhar-S/Analysis-of-Competitive-Codebase
Data/Contest1245/all/29594919_64015689.cpp
#include<bits/stdc++.h> using namespace std; #define endl '\n' typedef pair<int, int> pii; typedef long long ll; struct DS{ vector<int> par; vector<int> size; int n; void init(int _n){ n = _n; par.resize(n + 1); size.resize(n + 1, 1); for(int i = 0; i <= n; i++){ par[i] = i; } } int get_id(i...
ALGO
0.999954
3.766597
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2019-11-22T14:40: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": "7fb03586b...
f5155358-22cf-4764-a52f-edb083de1e11
its-Saurabh23/DSA
Strivers A2Z DSA Course/3_sum.cpp
// Apply 2 sum problem logic.. // 1 sort them // fixed the first elemnt in the loop // then apply 2 sum logic to the other one loop (which is optimal for that problem) // solution // sort them sort(nums.begin(),nums.end()); // taking set for unique input set<vector<int>>st; ...
ALGO
0.999788
6.25583
{ "github_metadata": { "branch": "master", "commit_count": 443, "repo_created_at": "2023-05-24T12:55:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "57b491ce...
53f2937c-6b1d-4b22-9bfa-fd58a0c2bbbd
YunshiuanOAO/CP
Codeforce/Codeforces Round #806 (Div. 4)/D.cpp
// Problem: D. Double Strings // Contest: Codeforces - Codeforces Round #806 (Div. 4) // URL: https://codeforces.com/contest/1703/problem/D // Memory Limit: 256 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org) #include<iostream> #include<iomanip> #include<math.h> #include<vector> #include<a...
ALGO
0.999922
3.924699
{ "github_metadata": { "branch": "main", "commit_count": 86, "repo_created_at": "2021-12-19T09:33: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": "a293bea2e8b...
ecd60961-46f5-419c-9b08-9271231ebfe1
cbraeuning/raytracer
src/BoundingBox.cpp
#include "gssmraytracer/geometry/BoundingBox.h" #include <gssmraytracer/geometry/Point.h> #include <gssmraytracer/utils/Ray.h> #include <limits> using namespace gssmraytracer::geometry; class BoundingBox::Impl { public: geometry::Point min; geometry::Point max; }; BoundingBox::BoundingBox() : mImpl(new Impl) { ...
ALGO
0.926949
6.80524
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2014-11-14T00:08: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": "0f84a6dbb6...
5ca0caf7-980a-4ebe-82ca-796ff55fa133
kuhaku-space/atcoder-submissions
code/agc/agc047/agc047_a.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; using Pld = pair<ld, ld>; using Vec = vector<ll>; using VecP = vector<P>; using VecB = vector<bool>; using VecC = vector<char>; using VecD = vector<ld>; using VecS = vector<string>; template <class T> usi...
ALGO
0.999867
4.601498
{ "github_metadata": { "branch": "main", "commit_count": 446, "repo_created_at": "2022-05-21T07:48: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": "e00e6b5008...
46b47778-408b-45d7-9967-d97e3abbc5bb
wernerzwan/Code-of-Life-Objects
TakkenBijHerman/TakkenBijHerman.ino
#include <math.h> float x; int o3, o5, o6, i, loopnum; const int Reset = 4; int i2 = 0; //const int potPin1 = A0; //const int potPin2 = A1; //const int potPin3 = A2; //const int potPin4 = A3; //const int potPin5 = A4; const int motorPin1 = 3; const int motorPin2 = 5; const int motorPin3 = 6; //int scene; long previou...
TOOL
0.908678
4.351527
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-04-06T21:09: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": "55109325c4b2...
b65c2f89-66ae-4ad6-ba1d-67f70904e6b5
yishuinanfeng/DataStructSample
app/src/main/cpp/native-lib.cpp
#include <jni.h> #include <string> #include "ArrayList/ArrayList.hpp" #include "LinkedList/LinkedList.hpp" #include "BubbleSort/BubbleSort.h" #include "SelectSort/SelectSort.h" #include "InsertSort/InsertSort.h" #include "ShellSort/ShellSort.h" #include "MergeSort/MergeSort.h" #include "FastSort/FastSort.h" #include "A...
ALGO
0.990203
4.765428
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2020-01-11T03:10:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "20ca55a3d...
9f494fcb-1207-4bc6-aca5-1b27e97bfac3
Qixyimoe/Solved
Luogu/P2678/P2678.cpp
#include <bits/stdc++.h> void solve() { int l, n, m; std::cin >> l >> n >> m; std::vector<int> a((n + 1) << 1), d((n + 1) << 1); for (int i = 1; i <= n; i++) { std::cin >> a[i]; d[i] = a[i] - a[i - 1]; } d[n + 1] = l - a[n]; int lt = 1, rt = l; while (lt < rt) { int sum = 0; for (int i = 1...
ALGO
0.99999
3.810831
{ "github_metadata": { "branch": "master", "commit_count": 209, "repo_created_at": "2023-07-08T23: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": "dbbb5a9b...
c9ebc021-ed93-40a1-b7a4-d5a46c0caf81
namansaini1463/Leetcode-Solved
2807-insert-greatest-common-divisors-in-linked-list/2807-insert-greatest-common-divisors-in-linked-list.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 { private: int getGCD(int num1,...
ALGO
0.999967
6.037119
{ "github_metadata": { "branch": "main", "commit_count": 508, "repo_created_at": "2024-03-25T16:46: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": "45b3668ddd...
b3b1369d-3c08-448e-a3be-727ed4f4058d
FlashyGT/University
Software engineering/Homework/islands.cpp
/* Task: Islands Task description: http://olimps.lio.lv/uzdevumi.php?show=109 Special requirements: */ #include <iostream> #include <fstream> #include <limits.h> using namespace std; #define SIZE 50 class Graph { struct Island { int index; int timeToNextIsland; Island *next; Island(int index) { t...
ALGO
0.999804
4.221721
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2020-11-13T21:34: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": "905a9bb4a...
4b7f0a41-50ff-4ee0-a852-6d39bd57a904
Redcrafter/Animal-Well-editor
src/aes.cpp
#include "aes.hpp" #include <array> #include <random> #include <immintrin.h> // see https://www.intel.com/content/dam/doc/white-paper/advanced-encryption-standard-new-instructions-set-paper.pdf __m128i AES_128_ASSIST(__m128i temp1, __m128i temp2) { __m128i temp3; temp2 = _mm_shuffle_epi32(temp2, 0xff); ...
ALGO
0.998619
7.1412
{ "github_metadata": { "branch": "main", "commit_count": 115, "repo_created_at": "2024-05-18T21:27:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 36, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e418327bb...
e74a8f88-042e-4d28-a46d-6366554e0ea7
jlmucb/class_notes
Code/newmath/BinaryExterndedGCD.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> // Binary extended GCD (HAC) #ifndef byte typedef unsigned char byte; typedef long unsigned u64; typedef long int i64; #endif // --------------------------------------------------------------------- bool BinaryExtendedGCD(i64 x, i64 y, i64* pa, i64* p...
ALGO
0.999988
4.920082
{ "github_metadata": { "branch": "main", "commit_count": 903, "repo_created_at": "2020-11-04T18:20:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8121f62d5c...
1fdd2dfa-bf00-4da6-a52f-22ac00100f65
Unf00rgiven/SPPuRV1
V4/primeri/primer 4/primer4/sequential/main.cpp
#include <iostream> #include <omp.h> using namespace std; long long compute(int i) { return i; // return a value computed from i } int main() { long long n = 100000000; long long total = 0; double startTime = omp_get_wtime(); // Compute the sum of integers 1..n for (int i = 1; i <= n; ++i) { long long...
ALGO
0.99979
3.958875
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-01-25T16:34:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3224ba4829e6...
f7113074-0e38-46e1-af4c-fd0879678992
kabbagepatch/AdventOfCode2018
day07/part1/instructions.cpp
// basic file operations #include <iostream> #include <fstream> #include <string> #include <vector> #include <regex> #include <algorithm> using namespace std; const int MAX_STEPS = 26; int main () { ifstream myfile; myfile.open ("../input"); vector<string> instructionLines; if (myfile.is_open()) { string ...
ALGO
0.999844
3.405322
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2021-08-06T03:47: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": "7b7d4500c45...
8f0b1d6d-2f99-449d-a34f-7c028bf1d895
Andupk/Geometry_Dash
lab2/main.cpp
#include "Framework/DrawingWindow.h" #include "Framework/Visual2D.h" #include "Framework/Transform2D.h" #include "Framework/Transform3D.h" #include "Framework/Line2D.h" #include "Framework/Rectangle2D.h" #include "Framework/Circle2D.h" #include "Framework/Polygon2D.h" #include <iostream> #include <windows.h> #include <...
TOOL
0.976672
3.78117
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-10-20T15:43:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9c59a96a17...
d86531b2-9b5e-47f2-b602-1218c899c318
LokeshMelkani07/DSA-Placement
Striver Sheet/Linkedlist/5.cpp
#include <iostream> #include <algorithm> #include <unordered_map> #include <vector> #include <algorithm> using namespace std; /* Delete given node in a Linked List : O(1) approach Problem Statement: Write a function to delete a node in a singly-linked list. You will not be given access to the head of the list instead...
ALGO
0.99923
5.83876
{ "github_metadata": { "branch": "master", "commit_count": 113, "repo_created_at": "2023-03-31T16:09: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": "277012fe...
84f7a8c0-bff2-4271-9752-b84d9119473d
nachiketkanore/CP-Trash
edu/A.cpp
/** * Author: <NAME> * Created: Tuesday 22 March 2022 08:03:26 PM IST **/ #include <bits/stdc++.h> #define int int64_t #define sz(x) (int)(x.size()) #define ALL(x) (x).begin(), (x).end() #define F0R(i, R) for (int i = (0); i < (R); ++i) #define FOR(i, L, R) for (int i = (L); i <= (R); ++i) using namespace st...
ALGO
0.999957
4.701822
{ "github_metadata": { "branch": "main", "commit_count": 370, "repo_created_at": "2021-08-04T18:15:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "17f271476c...
becc36b5-7061-483b-be15-92a702594589
MissouriMRDT/BMS_Software
BMS_Software.ino
// Battery Managment System (BMS) Software System // The BMS System is created for the Missouri S&T 2022 Competition Rover. // Created for 2022 by: <NAME> and <NAME> #include "BMS_Software.h" // this is a main header file for the BMS. void setup() { Serial.begin(9600); delay(100); setInputPins(); setO...
TOOL
0.949148
4.424221
{ "github_metadata": { "branch": "master", "commit_count": 161, "repo_created_at": "2016-01-06T23:13:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4a412b151...
875d4bb8-1fae-46a9-b9a9-5df3a018d9ef
Flagro/cmc6_prac
task3/operations_safe.hpp
#pragma once #include "vector.hpp" #include "matrix.hpp" template<typename result_T, typename T1, typename T2> result_T dot_product_sequential(const DenseVector<T1> &first_vector, const DenseVector<T2> &second_vector) { if (first_vector.size() != second_vector.size()) { throw "different vector sizes for do...
ALGO
0.996645
5.977822
{ "github_metadata": { "branch": "main", "commit_count": 59, "repo_created_at": "2022-04-16T21:57: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": "ec1a22fb2e9...
ae09ee5f-0a92-4d80-bee3-82f5cf38ce3e
arimnrg16/CP
My Problems/Malam Keakraban/solution.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; int n; int arr[N]; vector<int> indices[N]; void read() { scanf("%d", &n); for(int i = 1 ; i <= n ; i++) { scanf("%d", arr + i); } } void solve() { for(int i = 1 ; i <= n ; i++) { indices[arr[i]].push_back(i); } ...
ALGO
0.999995
3.868528
{ "github_metadata": { "branch": "master", "commit_count": 120, "repo_created_at": "2019-03-13T13:45:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aa30f845...
fa302fa1-ad4f-4283-966f-3225c01ffc2a
emrainey/hobbies
projects/geometry/source/vector.cpp
#include "geometry/vector.hpp" #include "geometry/types.hpp" namespace geometry { using namespace operators; namespace R3 { vector cross(vector const& a, vector const& b) noexcept(false) { precision x, y, z; x = (a[1] * b[2]) - (a[2] * b[1]); y = (a[2] * b[0]) - (a[0] * b[2]); z = (a[0] * b[1]) - ...
ALGO
0.93989
7.514143
{ "github_metadata": { "branch": "main", "commit_count": 230, "repo_created_at": "2022-01-29T04:50:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 23, "pull_requests": 0 }, "file_meta": { "content_id": "ec27ad435...
9317c64d-82a1-4000-bf53-b0906e1fd913
Yash-chauhan-yc/C-Programming
Backtracking/ratInMaze.cpp
#include <iostream> using namespace std; bool ratInMaze(char maze[10][10], int sol[][10], int i, int j, int m, int n) { if (i == m && j == n) { sol[i][j] = 1; // Print for (int i = 0; i <= n; i++) { for (int j = 0; j <= n; j++) { cout << s...
ALGO
0.999895
4.442725
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2022-10-28T13:17: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": "7bcded2f80a1...
1f7b05c1-9b09-4648-b651-3c769edcfe7d
TanTien-Engine/tantien
thirdparty/ogdf/include/ogdf/geometric/CrossingMinimalPosition.h
/** \file * \brief Computes a position that induces a minimal number of crossings for a given vertex and straight-line drawing. * * Based on the implementation and techniques of the following papers: * * <NAME>, <NAME>, <NAME>, and <NAME>. * Geometric Heuristics for Rectilinear Crossing Minimization. * Journal o...
ALGO
0.999873
5.910808
{ "github_metadata": { "branch": "B-littleworld", "commit_count": 1743, "repo_created_at": "2021-01-13T00:44:52.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 55, "forks": 12, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": ...
23783e9f-9784-47e3-ac89-54299f05e3a1
S0weeT/-Project
vector.cpp
#include"stdio.h" #include"vector.h" #include"iostream" Vector::Vector(const Vector &other) { reserve(other.capacity); memcpy(data, other.data, size * sizeof(int)); size = other.size; } Vector::Vector(const int *array, size_t n) { reserve(n); memcpy(data, array, n * sizeof(int)); size = n; }...
TOOL
0.9751
4.233204
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-08-03T02:30: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": "0b60d9d986e7...
0da32406-9b25-480d-8c3e-8966d5ea41d5
IgorT1/OpenSSL
Ubuntu 22.04/my_exemple/AES/AES.cpp
#include <iostream> #include <fstream> #include <string> #include <openssl/aes.h> using namespace std; // Function to encrypt a file using AES void encryptFile(const string& inputFile, const string& outputFile, const string& key) { ifstream ifs(inputFile, ios::binary); if (!ifs) { cerr << "Failed to o...
ALGO
0.9957
6.430249
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-11-05T19:25:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e35b115d30c4...
47c28bdc-0671-4ef9-92bf-fb90d2b0f36b
nastya1204/Bioinformatics
2.1 Protein Translation Problem/2.1 Protein Translation Problem/Protein_Translation_Problem.cpp
#include <iostream> #include <string> #include <cstdlib> using namespace std; int main() { string rna, amino, res; cout << "RNA string:"; cin >> rna; cout << endl; int sizerna = rna.length(); for (int i = 0; i < sizerna; i += 3) { if (rna.substr(i, 3) == "AAA") amino = "K"; else if (rna.substr(i...
ALGO
0.997661
3.96806
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2018-10-20T09:58: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": "063ed20e06...
d912a3c9-dbee-4784-ba6e-d5bcfe2c8209
tomoino/algorithms
src/05_ALDS1_2_C_StableSort.cpp
#include <iostream> using namespace std; static const int N_MAX = 36; typedef struct { // char suit, value; int suit, value; } Card; void bubbleSort(Card a[], int n) { int flag = 1, cnt = 0; while (flag) { flag = 0; for (int i = n - 1; i > 0; i--) { if (a[i].value ...
ALGO
0.999892
4.519303
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2020-07-01T14:21: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": "0d3707a66...
1c8b9331-d343-4ca2-97bf-e275b86b4056
Anirban-Gorain/Data-Structure-And-Algorithm
8. BinarySearch/18.MinimumDaysToMakeMBouquets.cpp
#include<bits/stdc++.h> using namespace std; // Brute-Force, TC:- O(n^2) AS:- O(1) // Optimal, TC:- O(n*log(n)) AS:- O(1) bool validate(vector<int> arr, int k, int m, int day) { int n=arr.size(); int con=0; int noOfB=0; for(int i=0; i<n; i++) { if(arr[i]<=day) { c...
ALGO
0.999968
4.593192
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2023-09-29T13:17: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": "97bba5b7f...
2eb161d4-47e6-43a6-8695-df64ee628d1e
GYHPCG/algorithm
LanQiao/ACWing_base/4405.cpp
#include <bits/stdc++.h> using namespace std; const int N = 510; int s[N][N]; int n, m , k; using LL = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); //auto l = 1; cin >> n >> m >> k; for (int i = 1; i <= n; ++i) for (int j = 1; j <= m; ++j) { cin >> s[i][j]; s[i][j] += s[i - 1]...
ALGO
0.999961
3.234633
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-09-21T14:04: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": "c0313648435...
33eb5d94-d0be-4056-9080-31717d36079a
dikshantkanela/DS-Algo
BINARY SEARCH/floorAndCeil.cpp
// CEIL : THE SMALLEST NUMBER SUCH THAT IT IS >= THE TARGET VALUE (x) (LOWER BOUND KI VALUE) // FLOOR : THE LARGEST NUMBER SUCH THAT IT IS <= THE TARGET VALUE (x) #include <bits/stdc++.h> using namespace std; // Function to find the floor of x in the sorted array int getFloor(vector<int>& a, int n, int x) { int s...
ALGO
0.999995
5.78602
{ "github_metadata": { "branch": "main", "commit_count": 152, "repo_created_at": "2025-01-27T16:28: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": "7097a6f73e...
fe7403bd-f6b7-4328-b98a-0699246498a2
hsheric0210/Algorithm-Coding
cpp/AJIT-new/ICT-2/3135-비밀편지.cpp
// ICT-2 : 비밀편지 // 구현: Data-decode with Error-tolerance #include<iostream> #include<cmath> #include<algorithm> #include<bitset> #include<vector> using namespace std; int i, j, k, l, p, q, r, x, y, z, m, n; int LOOKUP[8] = { 0b000000,//A 0b001111,//B 0b010011,//C 0b011100,//D 0b100110,//E 0b101001,//F 0b110101,/...
ALGO
0.999705
3.411703
{ "github_metadata": { "branch": "main", "commit_count": 123, "repo_created_at": "2022-08-21T16:23: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": "530f024ce9...
1daf6c04-8dcc-4fa7-a5f6-5f2895174d4b
LightEverything/template
wanxin/math/sg 函数.cpp
#include <iostream> #include <algorithm> #include <cstring> #include <cmath> #include <cstdio> #include <vector> #include <set> using namespace std; const int maxn = 1E5 + 7; int sg[maxn]; int a[maxn]; int maxnum = 0; int getSg(int num) { if (sg[num] != - 1) return sg[num]; // vector<int> v; set<int> st;...
ALGO
0.999947
4.051068
{ "github_metadata": { "branch": "main", "commit_count": 60, "repo_created_at": "2022-07-09T01:51: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": "82922f9abbf...
276d853b-96d2-4c79-88c3-b264a67167b9
NelsonGomesNeto/Competitive-Programming
Competitions/RotaUFMG/Roteiro 5 (Graphs- BFS, DFS, TopSort, Grids)/Pedagio.cpp
#include <bits/stdc++.h> using namespace std; void bfs(vector<int> graph[], int start, int visited[], int p) { deque<pair<int, int> > queue; queue.push_back({start, p}); while (!queue.empty()) { int u = queue.front().first, np = queue.front().second; queue.pop_front(); if (visited[u] || np == -1) conti...
ALGO
0.999407
3.534454
{ "github_metadata": { "branch": "master", "commit_count": 333, "repo_created_at": "2019-08-07T17:50:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "37f389c...
78ed6dcd-2b46-4315-a47d-b30a58f360ae
NaskoIT/SDA_2022-2023
06_BST/binary-search-tree.cpp
#include <iostream> #include <vector> using namespace std; void *print(int value) { cout << value << " "; } struct Node { int value; Node *left; Node *right; Node(int value) { this->value = value; this->left = nullptr; this->right = nullptr; } }; class BinarySearchTr...
ALGO
0.999946
5.821391
{ "github_metadata": { "branch": "main", "commit_count": 47, "repo_created_at": "2022-10-02T19:47:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aceb14aef19...
214892a7-b6d0-43d7-9e41-7e73273f7a71
akazad13/competitive-programming
Online Judges/LightOJ/1060 - nth Permutation.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; #define rep(i,p,n) for( i = p; i<n;i++) #define ll long long int #define Clear(a,b) memset(a,b,sizeof(a)) //istringstream is() template<class T>inline bool read(T &x) { int c=getchar(); int sgn=1; while(~c&&c<'0'||c>'9') { if(c=='-')...
ALGO
0.999923
3.573707
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2021-04-06T17:28: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": "2090e1b6bcb...
a24f5b5d-f2a3-4b66-9007-88ab3d026d71
trilinos/Trilinos
packages/zoltan2/core/src/problems/Zoltan2_MatrixPartitioningSolution.hpp
// @HEADER // ***************************************************************************** // Zoltan2: A package of combinatorial algorithms for scientific computing // // Copyright 2012 NTESS and the Zoltan2 contributors. // SPDX-License-Identifier: BSD-3-Clause // **************************************************...
ALGO
0.997547
6.440364
{ "github_metadata": { "branch": "master", "commit_count": 104031, "repo_created_at": "2015-11-16T19:39:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1299, "forks": 593, "issues": 263, "pull_requests": 61 }, "file_meta": { "content_id":...
a6bb1ecb-ab0d-4985-8e35-97232aa31914
bluewhalesystems/sold
common/compress.cc
// This file implements a multi-threaded zlib and zstd compression // routine. // // zlib-compressed data can be merged just by concatenation as long as // each piece of data is flushed with Z_SYNC_FLUSH. In this file, we // split input data into multiple shards, compress them individually // and concatenate them. We t...
TOOL
0.982328
7.331877
{ "github_metadata": { "branch": "main", "commit_count": 6188, "repo_created_at": "2022-11-18T03:18:11.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 528, "forks": 33, "issues": 19, "pull_requests": 5 }, "file_meta": { "content_id": "3aeb83...
1862bd28-2355-4113-9020-354add880c60
ishandutta2007/codeforces-r
radewoosh/normal/739/C.cpp
#include <bits/stdc++.h> using namespace std; int n; int n1; long long wys[1100007]; int drzewo[1100007]; int najp1[1100007]; int najp2[1100007]; int najp21[1100007]; int najl1[1100007]; int najl2[1100007]; int najl12[1100007]; int q; int potenga(int v) { for (int i=1; 1; i<<=1) if (i>=v) return i; } voi...
ALGO
0.999868
3.978506
{ "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": "0adf4c41b1de...
c0e624a2-c7c5-44ea-bd7c-5f407d4b7134
Wprofessor/My_notes
算法/字典树.cpp
#include<bits/stdc++.h> #define MAXSIZE 50 using namespace std; //字典树 typedef struct tire_node { int count; //记录该节点代表的单词个数 char word[MAXSIZE]; bool isStr; //标记该节点是否构成完整单词 struct tire_node *children[MAXSIZE]; //各个子节点 } tire; //相当于建立带头节点的树 tire *initTire() { //初始化 tire *root; root = (tire *)malloc(sizeof(tire)...
ALGO
0.999769
3.529519
{ "github_metadata": { "branch": "master", "commit_count": 144, "repo_created_at": "2018-11-03T14:00: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": "0faff60a...
63829dd7-d91f-4b9d-a87f-a9c25ce92cba
martonka/aoc_2024
d6_p2.cpp
#include <iostream> #include <algorithm> #include <cstdio> #include <string> #include <vector> #include <map> #include <memory> #include <queue> #include <tuple> #include <numeric> #include <unordered_set> #include <set> #include <array> using namespace std; using ll = long long; static int mx = 0, my = 0; class Vec...
ALGO
0.999815
4.399381
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2024-12-06T08:33: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": "45410c617...
6dcb5fc3-fd2c-42b8-933a-cd8e74556778
xconfigurator/test_20200428_c_cpp
04_OJ/leetcode_70/LC203.cpp
/** * @file LC203.cpp * @author liuyang * @brief 链表练习 * https://leetcode-cn.com/problems/remove-linked-list-elements/ * 在LeetCode上调试。 * * 参考: * 1. 看浙大何钦铭老师讲解 2.1.5 链式存储的插入和删除 04:23开始。 * 2. 饲养员讲的这个dummy节点的方法解本题很好。https://www.bilibili.com/read/cv8585621?spm_id_from=333.999.0.0 * * @version 0.1 * @date 2021-...
ALGO
0.999775
5.271018
{ "github_metadata": { "branch": "master", "commit_count": 278, "repo_created_at": "2020-04-28T08:51:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2ddcd1d8...
60d32f02-6e6d-4803-88de-4a684f983dfa
hlenovo/ai
astar+dfs.cpp
#include <iostream> #include <vector> #include <stack> #include <cmath> #include <unordered_map> using namespace std; struct Node { int x, y; double g, h; Node* parent; Node(int x, int y, double g = 0, double h = 0, Node* parent = nullptr) : x(x), y(y), g(g), h(h), parent(parent) {} doub...
ALGO
0.99999
6.037539
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-12-21T04:42: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": "b768804b61aa...
d5617f5e-f56d-457a-920c-465bdfec84ba
xsun89/MenTou
0507/LeetCode95_dfs.cpp
// // Created by <NAME> on 2021-05-11. // /** * 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, T...
ALGO
0.999964
6.498022
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2021-03-07T20:05: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": "66bebc999...
0007af0c-7a83-47ba-b1fb-14088dc7ab2e
kilian-hu/hackerrank-solutions
certificates/problem-solving-intermediate/hotel-construction/stub.cc
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); /* * Complete the 'numberOfWays' function below. * * The function is expected to return an INTEGER. * The function accepts 2D_INTEGER_ARRAY roads as parameter. */ in...
ALGO
0.999758
5.650328
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2021-09-15T12:09:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 420, "forks": 178, "issues": 5, "pull_requests": 4 }, "file_meta": { "content_id": "cb969a...
f5efa923-ebb0-442a-aa33-280b540e11e2
GiannisKotsalos/Merge-Sort-with-Even-Number-Swap-Counter-in-C-
MergeSort-EvenNumSwapCounter.cpp
#include <iostream> #include <fstream> #include <vector> using namespace std; class Answer { public: static const int MAX = 150; int array[MAX]; int numbersRead = 0; int totalEvenSwapped = 0; void ReadInputFile() { ifstream inputFile("input.txt"); if (inputFile.is_open()) { ...
ALGO
0.999813
5.209066
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-02-04T19:20:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3cbd03043002...
cf24eddf-2b9e-47e1-b7d8-e37bf87f573c
ActiWait/CADEX_Project
main_program.cpp
#include <iostream> #include <vector> #include <memory> #include <algorithm> #include <random> #include <ctime> #define PI 3.1415926535 #include "Curve.h" int main() { std::vector<std::shared_ptr<ICurve>> curves, circles; double sum_circle_radius = 0; std::mt19937 rand(std::time(nullptr)); std::unifo...
ALGO
0.999455
5.345752
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-01-17T08:47: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": "62fde12c04ee...
e39457d6-eae5-4199-8047-bb94a1d781d6
caarrott/BaekJoon
2382. 미생물 격리/2382. 미생물 격리/main.cpp
// // main.cpp // 2382. 미생물 격리 // // Created by carrot on 27/08/2019. // Copyright © 2019 carrot. All rights reserved. // #include <iostream> #include <queue> using namespace std; int T, N, M, K, map[2][100][100][3]; int dir_r[] = {0,-1,1,0,0}; int dir_c[] = {0,0,0,-1,1}; struct Info{ int r,c,amt,dir; }; int ...
ALGO
0.999943
4.099212
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2018-01-21T16:51:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d80b05791...
b6d14727-e5d9-4e6d-b599-33b8a25b0bbf
buniatyann/Hackerrank
One Month Preparation/Week4/JesseAndCookies.cpp
#include <vector> #include <algorithm> #include <queue> /* Time O(n * log(n)) Space O(n) veranayel */ int cookies(int k, std::vector<int> A) { // Create a min-heap (priority queue) std::priority_queue<int, std::vector<int>, std::greater<int>> pq; // Push all elements of A into the priority...
ALGO
0.999899
5.442926
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2025-02-27T15:42:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6a711785dd4...
242c9c32-f525-47f0-8dcf-7d18762ddc58
luisfilipels/Estudos-Maratona
CodeForces/MergingArrays.cpp
// // Created by <NAME> on 6/23/2021. // #include <bits/stdc++.h> using namespace std; #define fs first #define sc second #define pb push_back #define mp(a, b) make_pair(a, b) #define Fast cin.tie(0), cout.tie(0), ios::sync_with_stdio(0) typedef long long ll; const int MAX_N = 100000; int vecA[MAX_N]; int vecB[MAX_N...
ALGO
0.999987
4.170672
{ "github_metadata": { "branch": "master", "commit_count": 52, "repo_created_at": "2020-05-21T18:58:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9af17c0da...
7ef575b6-15e8-4258-9643-f77c22e65165
dorukb/CENG213_-Data-Structures-and-Algorithms
HW2/tpbst.hpp
#ifndef TWOPHASEBST_H #define TWOPHASEBST_H #include <iostream> #include <string> #include <stack> #include <list> // do not add any other library. // modify parts as directed by assignment text and comments here. template <class T> class TwoPhaseBST { private: //do not change struct SecondaryNode { std::...
ALGO
0.976267
4.474127
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2019-03-04T20:53: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": "957ed609e...
523289b6-ec11-4f83-b210-a0e5833fde4d
Nilay-rawal1/PAT-Training
Medio_cine.cpp
#include <iostream> #include <vector> using namespace std; int main() { int N, L; cout<<"Enter the number of patients: "; cin >> N; cout<<"Enter the ages of the patients: "; vector<int> ages(N); for (int i = 0; i < N; ++i) { cin >> ages[i]; } cout<<"Enter the number of nano-caps...
ALGO
0.999535
4.403108
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2024-06-24T10:36: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": "c6e95a63d...
28dc3e9e-8f9a-4745-8ba3-6de1edc6232d
emanuel2700/TyJorgeTyAudante
Training_camp_2024/TC Arg 2024 - Competencia 6 -- Avanzado/L_King_Escape.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vl = vector<ll>; #define pb push_back #define pf push_front #define debug(x) cout << #x << " = " << x << endl int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; ci...
ALGO
0.999938
3.341081
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2024-07-12T14:46: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": "c67595fbf8d...
f0d7dc12-1569-4d57-9e80-067a3fbbe303
ftiasch/acm-icpc
codeforces/224-codeforces-round-138/B.cpp
// Codeforces Round #138 // Problem B -- Array #include <cstdio> #include <cstring> #include <map> using namespace std; const int N = 100000; int n, m, a[N]; int main() { scanf("%d%d", &n, &m); for (int i = 0; i < n; ++ i) { scanf("%d", a + i); } map <int, int> hash; for (int i = 0; i < n...
ALGO
0.999996
3.937059
{ "github_metadata": { "branch": "master", "commit_count": 934, "repo_created_at": "2012-04-22T02:50:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 113, "forks": 35, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b1bb0...
0084cce5-6057-4c6b-b8f8-cc4ae0c84d29
mint6421/kyopro
yukicoder/4/430.cpp
#include<bits/stdc++.h> using namespace std; #define inf 1000000000 #define INF 1000000000000000 #define ll long long #define ull unsigned long long #define M (int)(1e9+7) #define P pair<int,int> #define PLL pair<ll,ll> #define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++) #define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i-...
ALGO
0.999966
3.801717
{ "github_metadata": { "branch": "master", "commit_count": 451, "repo_created_at": "2019-04-18T13:02: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": "25704e25...
b4a55225-94dc-4ecd-a916-d1306d3c1c11
maZymaZe/maze-Python-learning-luogu-cpp-py-
LeetCode/l834.cpp
struct edge { int u, v, nx; }; class Solution { public: int h[10002] = {0}, sz[10002] = {0}, n; edge e[20002]; vector<int> ans; int pdfs(int root, int dep, int fa) { if (!root) return 0; ans[0] += dep; int ts = 1; for (int i = h[root]; i; i = e[i].nx) {...
ALGO
0.999966
4.606527
{ "github_metadata": { "branch": "master", "commit_count": 2987, "repo_created_at": "2020-02-16T02:06:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9c0c0bc...
2dbbf64e-cef4-4080-90fc-79f60bf1a60e
stellaMY/Algorithm_study_by_me
백준/Gold/2866. 문자열 잘라내기/문자열 잘라내기.cc
#include <iostream> #include <unordered_map> using namespace std; int r, c; char map[1001][1001]; int main() { cin >> r >> c; for (int i = 0; i < r; i++) { string str; cin >> str; for (int j = 0; j < c; j++) { map[i][j] = str[j]; } } int k = 0; int final...
ALGO
0.999844
3.763198
{ "github_metadata": { "branch": "main", "commit_count": 223, "repo_created_at": "2023-01-12T13:30:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bbca3a9b51...
4c9dde9f-9b0b-42dc-b329-92f21be0f059
0shelter0/leetcode
Tree/constructBT.cpp
/** * 给一个 leetcode 标准数组,利用这个数组构建二叉树的结构。 * ref: https://blog.csdn.net/chenzhanqi/article/details/126634332 * date: 9.27 */ #include<bits/stdc++.h> #include "traversal.h" using namespace std; #define DEBUG // 例:二叉树 [1,2,2,3,3,null,null,4,4] // vector<string> nodes = { "1","2","2","3","3","null","null","4","4" }; /...
ALGO
0.999826
3.969257
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-06-08T14:03: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": "8f935c677e1c...