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
ea9bf966-a2a5-4a9d-b0bc-9283b74dfcbf
bzr0014/computer-vision
computer-vision/src/main_video.cpp
// Program to crop images using GUI mouse callbacks // Author: <NAME>, University of Pennsylvania #include <iostream> #include <math.h> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include "../include/categorizer.h" #include "../include/shape_feature_extractor.h" #include "../include/...
TOOL
0.996666
5.85788
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2016-06-19T15:18: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": "290417e9ed...
b3d554e0-692f-4b77-8bb6-4836d0b1b0ac
TLeonardUK/ZombieGrinder
Source/XScript/VirtualMachine/Runtime/CRuntime_Vector4.cpp
/* ***************************************************************** CRuntime_Vectors.cpp Copyright (C) 2012 <NAME> - All Rights Reserved ***************************************************************** */ #include "XScript/VirtualMachine/CVMBindingHelper.h" #include "XScript/VirtualMachine/CVirtualMachine.h"...
TOOL
0.960886
5.00318
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2017-01-12T20:10:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 7, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "4b3c92e77...
486a2b0e-18d0-49b5-be33-9368901b5c1a
tecshogo/contest
ABC/110/B/answer.cpp
#define rep(i, n) for (int i = 0; i < (n); i++) #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const int MOD = 1000000007; // MAX int 2,147,483,647 // MAX O(n) 10^18 int main() { int N, M, X, Y; cin >> N >> M >> X >> Y; vector<int> x(N), y(M); rep(i, N) ci...
ALGO
0.999998
3.671257
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2020-06-20T07:16: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": "0686139f2...
638bc6f2-8b58-4fe3-b564-6327b1187d1d
Muhammadatifkhan99/DSandAlgo
ArrayBasicProblems/code.cpp
#include<bits/stdc++.h> using namespace std; ///left rotate an array by one place void leftRotatArray(vector<int> &arr){ int n = arr.size(); int first = arr[0]; for(int i=1;i<n;i++){ arr[i-1] = arr[i]; } arr[n-1] = first; } //rotate an array by d places void rotateDplaces(vector<int> &...
ALGO
0.999903
4.973114
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2025-07-07T12:57: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": "f78865054...
9f602759-ea79-4966-84f4-24103f40c843
raincross7/code-similarity
codes/train_code/problem327/problem327_200.cpp
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define REPLL(i, n) for (ll i = 0; i < (ll)(n); i++) using namespace std; template<class T>inline bool chmax(T &a, const T &b){if(a < b){a = b; return 1;}return 0;} template<class T>inline bool chmin(T &a, const T &b){if(a > b){a = b; return ...
ALGO
0.990802
3.658242
{ "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": "d329115a78ad...
97b0600e-8bda-4215-b504-e870b0962750
hoangnqh/UIT-ALGO-BOOTCAMP
Codeforces/Educational Codeforces Round 110 (Rated for Div. 2)/D.cpp
#include<bits/stdc++.h> using namespace std; //#define int long long #define fi first #define se second #define pb push_back #define mp make_pair typedef pair<int, int> II; typedef pair<int, II> III; const int INF = 1e9; const int MOD = 1e9 + 7; const int N = 262143 + 5; int k; int n; char s[N]; int it[4 * N]; II ...
ALGO
0.999986
3.981302
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2021-09-19T11:52:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7edcb436919...
b260ff39-4977-48ce-bdcf-3f10b3c68ff4
iiolwaysanksii/Data-Structures-and-Algorithms
Array/SortCompAnalysis.cpp
//Calculating comparisons of different sorting algorithms #include <iostream> #include <stdlib.h> //for rand and srand #include <time.h> //for time(0) #include <fstream> //for file using namespace std; void swap(int *xp, int *yp) { int temp = *xp; *xp = *yp; *yp = temp; } int bubbleSort(int arr[],...
ALGO
0.999703
5.445808
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2020-09-02T07:37: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": "e0ebea6af3...
8dab92b3-9995-4319-b441-0f695e94e8df
Nishedi/Praca-Inzynierska
testC/testC/Mutations.h
#pragma once #include <iostream> #include <vector> #include <random> using namespace std; class Mutations { public: void swapMutate(std::vector<int>& tour, int numCities, double MUTATION_RATE) { std::random_device rd; std::mt19937 generator(rd()); std::uniform_int_distribution<int> distribu...
ALGO
0.997209
3.963902
{ "github_metadata": { "branch": "master", "commit_count": 73, "repo_created_at": "2024-10-21T15:21:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f66dec192...
5800a44b-d815-4645-bc65-a4aa0bd6bbcc
qflex-project/quantum-fuzzy
parser.cpp
#include <iostream> #include <string> #include <vector> using namespace std; void replaceAll(string &s, string sub1, string sub2){ size_t f = 0; while (true){ f = s.find(sub1, f); if (f == string::npos) break; s.replace(f, sub1.size(), sub2); f++; } } int main(){ char line[300]; string s, s2; ...
ALGO
0.989361
3.400111
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-05-03T11:54: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": "5a3382e53491...
3b0f4c62-9496-4d69-ac00-26881ca82539
rfloyd01/Project_Euler
Questions/Q301-Q350/q303.h
#pragma once #include <Header_Files/pch.h> long long ten_pows[18] = { 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17 }; struct Node { Node(Node* n, int i, long long v) { nextNode = n; index = i; value = v; } Node* nextNode; int index; long long value; };...
ALGO
0.998643
3.685425
{ "github_metadata": { "branch": "main", "commit_count": 125, "repo_created_at": "2022-01-04T18:38: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": "436a227c71...
da9a0114-457d-457a-b242-b970a3051fff
treque/real-time-water
Projet_1846776_1924839/Code/SurfaceNode.cpp
// The code here is initially from: // https://bitbucket.org/victorbush/ufl.cap5705.terrain/src/master/ #include <stdio.h> #include <cstring> #include <cstdlib> #include <GL/glew.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/gtc/matrix_inverse.hpp> #include <glm/gtc/matrix_transform.hpp> #include "...
ALGO
0.984136
3.227686
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-02-19T06:23:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4ace923840...
088d2965-6877-4c45-8134-612943d9039b
Yuvraj02/Data-Structures-and-Algorithms
Bits Manipulation/find_2_non_repeating_elements.cpp
#include <iostream> #include <vector> using namespace std; int main(){ vector<int> arr = {1, 2, 3, 2, 1, 4}; int a = 0; int b = 0; int xor_sum = 0; //First get xor_sum for(int i = 0; i<arr.size();i++) xor_sum^=arr[i]; //Now the xor_sum would be 3^4 //Get the right most set bit o...
ALGO
0.999987
3.658216
{ "github_metadata": { "branch": "master", "commit_count": 674, "repo_created_at": "2022-11-13T09:53:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c63f1499...
d6f7bffa-a543-4daf-9ad2-2eeb7766caba
Qivon7/oi-code
分配问题.cpp
#include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <iostream> #include <cmath> #include <ctime> #include <vector> #include <queue> #include <map> #include <set> using namespace std; const int inf = 2147483640; typedef long long ll; ll geti(){ char ch=getchar();while((ch<'0' || ch>...
ALGO
0.999746
3.338277
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2017-10-20T12:07: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": "29f0cafd3...
a7061e30-1ad6-4b82-a0bd-69a254c8ef16
knuu/competitive-programming
codeforces/cdf345_1b.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> P; typedef pair<ll, ll> Pll; typedef vector<int> Vi; //typedef tuple<int, int, int> T; #define FOR(i,s,x) for(int i=s;i<(int)(x);i++) #define REP(i,x) FOR(i,0,x) #define ALL(c) c.begin(), c.end() #define DUMP( x ) cerr << #x...
ALGO
0.999894
3.865889
{ "github_metadata": { "branch": "master", "commit_count": 86, "repo_created_at": "2014-12-11T18:59:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0e57a8774...
13c46653-91cc-4adb-b2ff-fbc215155317
FOXCSP/Code-of-competitive_programming
training/nowcoder/2023河南萌新联赛第(八)场:南阳理工学院/b.cpp
#include <bits/stdc++.h> #define int long long #define se second #define fi first #define pb push_back #define SZ(T) (int)(T.size()) #define all(T) T.begin(), T.end() using namespace std; typedef long long ll; const int N = 500010; const ll mod = 1000000007; int n; int c[N]; void modify(int x, int y) { for (x; x <= ...
ALGO
0.999892
4.686581
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-01-24T06:38: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": "38b3171b4c...
26e74f09-58f1-41ca-8e32-0560bac6b7ee
CGAL/cgal
Envelope_3/include/CGAL/Envelope_3/set_dividors.h
// Copyright (c) 2005 Tel-Aviv University (Israel). // All rights reserved. // // This file is part of CGAL (www.cgal.org). // // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : <NAME> <<EMAIL>> // <NAME> <<EMAIL>> #ifndef CGAL_EN...
ALGO
0.918773
5.752927
{ "github_metadata": { "branch": "master", "commit_count": 113659, "repo_created_at": "2014-10-01T12:22:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5443, "forks": 1475, "issues": 511, "pull_requests": 136 }, "file_meta": { "content_id...
0efe673c-885c-4357-9d3c-716928870936
PauloRobertoPC/Library
Contests/Codeforces/Gym/2013-2014 CT S01E01: Extended 2000 ACM-ICPC East Central North America Regional Contest (ECNA 2000)/E.cpp
#include <bits/stdc++.h> using namespace std; #define RED 0 #define WHITE 1 #define INF int(1e9) vector<int> read_walk(){ vector<int> walk; char ch; string s; int t; cin >> s; stringstream sin(s); int cnt = count(s.begin(), s.end(), '-'); while(cnt != -1){ sin >> t; walk.emplace_back(t); ...
ALGO
0.999908
3.999365
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2022-02-26T21:07: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": "912cfdee3...
f25d28ee-3fd5-4e70-951e-bb34bb78c259
michalSali/pv021-project
src/network.hpp
#ifndef PV021_FASHIONMNIST_PROJECT_NETWORK_HPP #define PV021_FASHIONMNIST_PROJECT_NETWORK_HPP #include "matrix.hpp" #include <vector> enum activations {_reLU, _leakyReLu, _softmax, _sigmoid}; enum initialization {glorot, he, lecun}; initialization getInitializationByActivation(activations activationFunction); matrix...
ALGO
0.959503
6.864081
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-05-29T17:10: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": "24c2eba09b2f...
097bb5f8-91be-4476-b60e-9b3e1178cd88
ThomasSedlmeyr/PSEMolDyn_GroupG
src/BoundaryConditions/BoundaryCondition.h
// // Created by thomas on 30.11.21. // #ifndef PSEMOLDYN_GROUPG_BOUNDARYCONDITION_H #define PSEMOLDYN_GROUPG_BOUNDARYCONDITION_H #include <vector> #include "SimulationLogic/Cell.h" class BoundaryCondition { protected: /** * @brief The type of the condition */ int conditionType; /** * @...
ALGO
0.967752
5.203612
{ "github_metadata": { "branch": "main", "commit_count": 355, "repo_created_at": "2021-10-23T11:47:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1523d8963a...
c87d872d-3aa2-428b-a6eb-40b946942f8b
Ram-the-coder/interview-prep
stack and queue/implementation.cpp
#include<bits/stdc++.h> using namespace std; /**************************************** Stack ****************************************/ /******************** Using Array ********************/ class Stack_Using_Array { int a[1000]; int max_stack_size, top; public: Stack_Using_Array(int size) : max_stack_si...
ALGO
0.999192
4.656938
{ "github_metadata": { "branch": "master", "commit_count": 111, "repo_created_at": "2020-06-23T17:42:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b85322e8...
0ad974a6-2d6b-443b-9a7e-e393f2e15c8c
leonacwa/code
hdupass/hdu4350_Card.cpp
/* Card * */ #include <cstdio> #include <cstring> int m[1000000][52]; int main() { int runs; scanf("%d", &runs); for (int run = 1; run <= runs; ++run) { for (int i = 0; i < 52; ++i) scanf("%d", &m[0][i]); int n, l, r; scanf("%d%d%d", &n, &l, &r); --l, --r; int c = 0; while (1) { int j = 0; for (...
ALGO
0.999592
3.325796
{ "github_metadata": { "branch": "master", "commit_count": 78, "repo_created_at": "2012-05-12T13:00:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 3, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "9d11421e4...
8441b6bf-9c89-41c2-b4df-d64ac425f9ee
mgalushka/cpp-start
hardway/hash/Hash.cpp
#include <fenv.h> #include <iostream> #include <cmath> #include <ctime> #include <iomanip> #include <time.h> #include <sys/time.h> #include <unordered_map> #include <algorithm> #include <vector> #include <map> #include <tuple> #include <thread> #include <chrono> #include <mutex> #include <functional> inline std::size_...
ALGO
0.905856
4.866454
{ "github_metadata": { "branch": "master", "commit_count": 134, "repo_created_at": "2015-09-26T09:15: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": "bfe8d0eb...
1a55e4e5-6add-4ac6-adcf-3834738b42bd
amatveiakin/polykit
cpp/lib/loops.cpp
#include "loops.h" #include <sstream> #include "algebra.h" #include "itertools.h" #include "set_util.h" #include "zip.h" LoopKinds loop_kinds; static const auto compare_length_first_asc = cmp::projected([](const auto& v) { return std::tuple{cmp::asc_val(v.size()), cmp::asc_ref(v)}; }); static const auto compar...
ALGO
0.985924
5.451117
{ "github_metadata": { "branch": "main", "commit_count": 712, "repo_created_at": "2021-02-17T17:36:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fe1ca16b92...
a18c05a1-e42e-4e58-82c3-7a973e94303f
NeSE-Team/XNUCA2020Qualifier
Pwn/vm/vm.cpp
#include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <iostream> #include <string.h> #include <sys/prctl.h> #include <linux/seccomp.h> #include <linux/filter.h> #include <sys/mman.h> using namespace std; int global_size = 0x800; class Vm{ private: void init_stack(unsigned int t,unsigned char* ret,unsi...
TOOL
0.937289
3.227295
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2020-11-01T05:31:21.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 70, "forks": 3, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "ad0b499a2a9...
1470687a-e02d-4bdb-abd6-8a58dc208a6b
Rotzen823/Problemas-de-Programacion-Competitiva
ICPC/2023 ICPC/ 2023 ICPC Gran Premio de Mexico 2da Fecha/B - Bogo Sort Probability.cpp
#include <bits/stdc++.h> #define MOD 1000000007 using namespace std; typedef long long ll; typedef vector<int> vi; ll mcdExt(ll a, ll b){ ll r,y=0,x1=0,y1=1,tx,ty; ll x=1; while(b>0){ r=a%b; tx=x1, ty=y1; x1=x-(a/b)*x1; x=tx; //Continuación en la siguiente página ...
ALGO
0.999952
4.294313
{ "github_metadata": { "branch": "main", "commit_count": 327, "repo_created_at": "2023-04-08T18:41:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "56bb09ce20...
bc791338-c5f8-4159-98c9-823c117b7b1f
CompaSat/CompaSat
Código/Arduino/ZZZ PRUEBAS/COMPASAT25_PRUEBA_STEPPER/COMPASAT25_PRUEBA_STEPPER.ino
int idPaquete = 1; // Contador de paquetes // Configuración del motor paso a paso const int motorPin1 = 3; const int motorPin2 = 4; const int motorPin3 = 6; const int motorPin4 = 7; int motorSpeed = 1000; int stepCounter = 0; int stepsPerRev = 4076; int stepsPer90 = stepsPerRev / 4; const int numSteps = 8; const int st...
TOOL
0.998484
5.169735
{ "github_metadata": { "branch": "main", "commit_count": 80, "repo_created_at": "2024-11-22T11:39:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "df5b7471c3f...
274c4ff2-ef23-4a21-8035-47974a269ad9
wyattm124/array-programming-tests
src/fft_bench.cpp
#include "fft.hpp" #include <fftw3.h> #include <benchmark/benchmark.h> // Define another benchmark static void BM_Basic_Powerof2FFT(benchmark::State& state) { std::array<std::complex<float>, 8192> time_domain1 = {0}; std::array<std::complex<float>, 8192> freq_domain1 = {0}; for (std::size_t i = 0; i < 8192...
TEST
0.90554
6.428491
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2025-06-20T22:31: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": "82a32b26fbe...
80c3227f-1558-48ea-b6ea-9e937fc400eb
hoonystory98/ACMICPC
2667.cpp
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; #define MAXSIZE 27 char map[MAXSIZE][MAXSIZE]; int Y[] = { -1, 0, 0, 1 }; int X[] = { 0, -1, 1, 0 }; queue<pair<int, int>> q; vector<int> ans; int main() { int n, i, j, k, x, y; cin >> n; for (i = 1; i <= n; i++) {...
ALGO
0.999976
3.76971
{ "github_metadata": { "branch": "main", "commit_count": 282, "repo_created_at": "2022-01-10T14:14:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5c1cd91412...
749687b8-1514-4666-bc04-ed03b3fac732
MrScottOliver/canned-engine
Maths/Matrix.cpp
#include "Maths/Matrix.h" #include <stdexcept> using std::invalid_argument; Matrix::Matrix( const unsigned int r, const unsigned int c ) : rows( r ), columns( c ) { if( ( rows > 0 ) && ( columns > 0 ) ) { elements.resize( rows ); for( unsigned int i = 0; i < rows; i++ ) { ...
TOOL
0.907729
6.707255
{ "github_metadata": { "branch": "master", "commit_count": 124, "repo_created_at": "2013-07-03T21:19: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": "e7b6156f...
5ea786bd-f3be-462f-a773-efa83ce062c1
rijuyuezhu/XCPC-code
OI-time_Problems/图论与树/最小斯坦纳树/code.cpp
//https://www.luogu.com.cn/problem/P6192 #include<cstdio> #include<cstring> #include<algorithm> #include<queue> using namespace std; typedef long long ll; char In[1 << 20], *ss = In, *tt = In; #define getchar() (ss == tt && (tt = (ss = In) + fread(In, 1, 1 << 20, stdin), ss == tt) ? EOF : *ss++) ll read() { ll x = 0, ...
ALGO
0.999928
4.308668
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2023-03-05T03:20: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": "3ad15401f...
a9089f3b-4c76-4bf7-bec2-26370b2b3b27
singhsanket143/CppCompetitiveRepository
CompetitiveProgramming/DynamicProgramming/AlyonaAndStrings.cpp
// Problem Link - https://codeforces.com/problemset/problem/682/D /* By <NAME> */ #include<bits/stdc++.h> //#include<ext/pb_ds/assoc_container.hpp> //#include<ext/pb_ds/tree_policy.hpp> //#include <ext/pb_ds/trie_policy.hpp> //using namespace __gnu_pbds; using namespace std; #define ll long long int #define ld l...
ALGO
0.999997
3.926612
{ "github_metadata": { "branch": "master", "commit_count": 304, "repo_created_at": "2018-06-26T07:06:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 348, "forks": 160, "issues": 1, "pull_requests": 4 }, "file_meta": { "content_id": "1605...
0a6898fb-7d6f-4865-9cab-c169fa8c953f
sanchit-sinha/CP
Contests/Codechef/Snackdown2021-1B/Largest_Laddu.cpp
#include "bits/stdc++.h" using namespace std; #define f first #define s second #define pb push_back #define ll long long #define ld long double #define lb lower_bound #define ub upper_bound #define mp make_pair #define mt make_tuple #define pll pair<ll, ll> #define vll vector<ll> #define vvll vector<vll> #define vpll v...
ALGO
0.999504
3.987254
{ "github_metadata": { "branch": "master", "commit_count": 383, "repo_created_at": "2020-07-18T07:42: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": "93d3fc59...
91dd0b9d-8377-4e66-b268-ebf8d82138a1
EassonY/repo1
Acwing/20201013模拟堆.cpp
#include <iostream> #include <algorithm> #include <string.h> using namespace std; const int N = 100010; int h[N], ph[N], hp[N], sz; //需要进行特殊的交换,不仅数值需要交换, //而且还要知道交换的点,是第几个插进来的 //当前两个节点的下标分别是a和b //hp存的是a和b位置上的元素,是第几个插进来的 //ph存的是第几个插进来的元素,下标位置是多少 void heap_swap(int a, int b) { //交换顺序不能变,先外面,后里面 swap(ph[hp[a]], ...
ALGO
0.999736
3.78097
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2020-11-10T11:33:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef419fa15...
fe46ed1b-6103-420e-88cb-3217461d5eef
NavneelSinghal/cses
additional/2179_1.cpp
#ifndef LOCAL #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx,avx2,sse,sse2,sse3,sse4,popcnt,bmi,bmi2,lzcnt") #endif #include "bits/stdc++.h" #ifdef DEBUG #include "includes/debug/debug.hpp" #else #define debug(...) 0 #endif using namespace std; using ll = int64_t; using ld = lon...
ALGO
0.999984
4.363021
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2021-01-07T16:07:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "18c03f1b09...
e33ce522-d00c-4a11-a73e-ccd35e3e5532
liuhenry/chaotic-dynamics
src/cpp/integrator/euler.cc
#include "euler.hh" #include <vector> using std::vector; vector<double> forwardEulerStep(DynFun dynFun, double t, double dt, const vector<double> &params, const vector<double> &z) { vector<double> zRet(z.size()); // z_{n+1} = z_n + dt * f(t, z_n) ...
ALGO
0.999864
6.288105
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2018-05-09T05:41:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 22 }, "file_meta": { "content_id": "c990d914...
782ec4b1-572f-45b3-a62a-d98080293d53
Tmiller649/Solitaire_CProject
Solitare_Code/Card.cpp
/* * Final Project: * - Solitare * Description: * This program plays a functioning game of solitare and * allows the user to restart the game or exit whenever * Developers: * - <NAME> - <EMAIL> * - <NAME> - <EMAIL> * * Help Received: * * Special Instructions: // optional * * Developer comments: // Not opt...
ALGO
0.987637
4.596457
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-03-27T20:56: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": "f0f0d7d59401...
173a4fe1-6f0e-4264-a1b1-ee12458e6487
130s/astar-ros-pkg
tilting_servo/src/servo_action_client.cpp
/* * Software License Agreement (BSD License) * * Copyright (c) 2011, <NAME>. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain th...
TOOL
0.96119
6.151174
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2015-08-29T06:54:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "372d7804e4...
39ba9b5f-8031-4cbe-a8f4-cc67f021f40d
twilightmagic/RuQ_light
neopixel_ruQ_light.ino
/* * Rubics Cube simulation with NeoPixel LED chain */ #include <avr/pgmspace.h> #define DO_MASK 0x10 //port mask bit 4 (Arduino Micro: portB.4 = D8, Arduino Uno/Nano: portB.4 = D12) #define DO_PDIR DDRB //Direction register Port B #define DO_PSTATE PORTB //Output state Register Port B #define CHANNELS 3 //Number of...
ALGO
0.987959
5.647067
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-03-30T00:48: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": "2fe49b64ca...
94e69c4f-f601-49ec-b1c1-5b849fdf26f5
mahabubr/xpsc
week-01/day-01/B_Number_of_Smaller.cpp
#include<bits/stdc++.h> #define ll long long int #define dl double #define pi pair<int, int> #define B_INF LLONG_MAX #define S_INF LLONG_MIN #define vi vector<int> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; vector<i...
ALGO
0.999976
3.554249
{ "github_metadata": { "branch": "main", "commit_count": 108, "repo_created_at": "2024-03-15T14:30: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": "98d9b60c9a...
05c0e06b-9442-4f21-b984-b3a83f984441
ajxu2/competitive-programming
CSES/math/counting-grids.cpp
// created: 10-21-2023 Sat 12:06 AM #include <bits/stdc++.h> using namespace std; using ll = long long; template<class T> using V = vector<T>; template<class T> int sz(const T& a) { return (int)size(a); } struct Mint { ll v; static const int MOD = 1'000'000'007; Mint() { v = 0; } Mint(ll _v) { _v %= ...
ALGO
0.99998
4.762194
{ "github_metadata": { "branch": "main", "commit_count": 458, "repo_created_at": "2020-10-29T19:25:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dd7c2f5a0c...
4a410dec-91d3-432d-87e5-27dd28c47003
2hanhan/algorithm
算法学习/12.GraphAlgorithm/bfs/surrounded-regions.cpp
/** * @file surrounded-regions.cpp * @author your name (<EMAIL>) * @brief * @version 0.1 * @date 2023-07-19 * 130.被围绕的区域 * https://leetcode.cn/problems/surrounded-regions/ * @copyright Copyright (c) 2023 * */ #include <vector> #include <queue> using namespace std; class Solution { public: int direction[...
ALGO
0.999358
6.044972
{ "github_metadata": { "branch": "master", "commit_count": 94, "repo_created_at": "2022-12-05T00:58:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f593045...
cb3770c4-c700-484c-b63a-2216c74d1dae
kyj93790/Advanced_Algorithm
2022_W/SCC, 2-SAT/2150.cpp
#include <iostream> #include <vector> #include <stack> #include <algorithm> using namespace std; #define max(a, b) (a>=b?a:b) #define min(a, b) (a<=b?a:b) #define p(a, b) make_pair(a, b) typedef long long ll; void swap(ll *a, ll *b) { ll temp; temp = *a; *a = *b; *b = temp; } int dfsn[10101]; /...
ALGO
0.999991
4.616
{ "github_metadata": { "branch": "master", "commit_count": 118, "repo_created_at": "2022-01-04T03:05:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fbf69803...
f10671de-9b4f-4053-844e-68e60be354f3
jonathan-liu-0204/LeetCode
304. Range Sum Query 2D - Immutable/Solution-304.cpp
class NumMatrix { vector<vector<int>> dp; public: NumMatrix(vector<vector<int>>& M) { int ylen = M.size() + 1; int xlen = M[0].size() + 1; dp = vector<vector<int>>(ylen, vector<int>(xlen, 0)); for (int i = 1; i < ylen; i++){ for (int j...
ALGO
0.999879
6.656281
{ "github_metadata": { "branch": "main", "commit_count": 119, "repo_created_at": "2022-04-23T17:06: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": "3775c52616...
43fb70a6-8cb4-47e7-b57f-92d61e5d655b
EmChamberlain/EECS492-Computer-Vision
Assignment_1/diagram_shape.cpp
#include <iostream> #include <sstream> #include <algorithm> #include "diagram_shape.h" //used to compare doubles bool doubleEqual(double a, double b) { return fabs(a - b) < DBL_EPSILON; } //finds distance between two points double euclideanDistance(cv::Point pt1, cv::Point pt2) { cv::Point diff = pt1 - pt2; ...
ALGO
0.975791
4.715323
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2017-09-24T20:58: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": "85aed7628...
59a4af1e-5b4e-493f-b288-207aa5f4c26b
unicore/core
core/src/voting.cpp
using namespace eosio; void clear_old_votes_action (eosio::name voter, eosio::name host){ votes_index votes(_me, voter.value); goals_index goals (_me, host.value); auto idx = votes.begin(); std::vector<uint64_t> list_for_delete; while (idx !=votes.end()){ auto goal = goals.find(idx->goal_id); if (go...
TOOL
0.966237
5.206902
{ "github_metadata": { "branch": "master", "commit_count": 180, "repo_created_at": "2022-09-10T10:27:22.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "dbedb8b13...
a2650aaa-8634-4d8c-a842-aad7af6405e5
hly999666/ExerciseOnDSA
2020_New/ConsoleApplication1/ConsoleApplication1/Increasing_Subsequences.cpp
//491. Increasing Subsequences #include "mainHeader.h" #include <set> #include <bitset> using namespace std; class treeNode { public: int val; int nextLen; treeNode* next[20]; treeNode(int v = INT_MAX) :val(v) { nextLen = 0; for (auto& ptr : next)ptr = nullptr; }; ~treeNode() { for (auto& ptr : next)delet...
ALGO
0.999996
5.578513
{ "github_metadata": { "branch": "master", "commit_count": 561, "repo_created_at": "2018-01-02T08:39:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "15b899c1...
2ea7461f-0d4e-420a-91aa-d12112a9bff0
mystic-01/LeetCode
0043-multiply-strings/0043-multiply-strings.cpp
class Solution { public: string addTwoStrings(string &num1, string &num2) { int n1 = num1.size(), n2 = num2.size(), i = n1 - 1, j = n2 - 1, carry = 0; string curr = ""; while (i >= 0 && j >= 0) { int int1 = num1[i] - '0', int2 = num2[j] - '0', total = int1 + int2 + c...
ALGO
0.999916
5.778985
{ "github_metadata": { "branch": "main", "commit_count": 7515, "repo_created_at": "2021-06-19T02:44:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "37061305a...
2be09557-035c-48e4-9d1e-5497040d765d
Hoshi03/Algorithm
백준/Gold/13023. ABCDE/ABCDE.cc
#include <iostream> #include <bits/stdc++.h> using namespace std; int n, m; vector<vector<int>> arr(2001); vector<bool> visited(2001); bool able = false; void dfs(int node, int depth){ // 깊이가 n-1로 생각했는데 실패, 답지보니 깊이가 4인걸 찾는 문제 if (depth == 4){ able = true; return; } visited[node] = tru...
ALGO
0.999945
3.889372
{ "github_metadata": { "branch": "main", "commit_count": 328, "repo_created_at": "2023-10-11T08:03: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": "04c1b4ab98...
948d1275-cc1d-4e87-bab4-fb4cf49c1122
ttyang/sandbox
sandbox-tags/Boost_formal_review/boost/interval/compare.hpp
/* Boost interval/compare.hpp template implementation file * * Copyright <NAME> 2000 * Copyright <NAME>, <NAME>, <NAME> 2002 * Permission to use, copy, modify, sell, and distribute this software * is hereby granted without fee provided that the above copyright notice * appears in all copies and that both that cop...
TOOL
0.902414
7.083725
{ "github_metadata": { "branch": "trunk", "commit_count": 20907, "repo_created_at": "2013-10-11T03:08:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "81456a3...
fecb666d-2cd6-4027-9e70-6bc20e1e53ec
chengui/1337c0d3
16-3sum-closest/solution.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; class Solution { public: int threeSumClosest(vector<int> &num, int target) { int n = num.size(); int sum = 0; int tmp = 0; sort(num.begin(), num.end()); sum = num[0] + num[1] + num[2]; ...
ALGO
0.999995
6.037882
{ "github_metadata": { "branch": "master", "commit_count": 217, "repo_created_at": "2014-07-21T07:14:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c991143b...
f2e42060-4040-4d75-8bbe-486f61190d89
rightlick/Courses
Yandex.Practicum/C++/Topic02/task19.cpp
/* Тема 02: Условия и циклы Урок 4: Логические операции: сравнение Задание 19 Перед Зои три дома разного цвета. Ей известно, рядом с домом какого цвета видели последний раз её Пушистика. Дома имеют номера: 1, 2 и 3. Определите номер дома, с владельцем которого ей надо поговорить насчёт своего питомца. */ #include <io...
ALGO
0.999449
3.84708
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2022-06-14T08:03:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd51cb0d54a...
e3e5a781-444b-4685-88a1-e5b2c8c7a493
2013612/CP-algorithm
AOJ/1166.cpp
#include<iostream> #include<vector> #include<queue> using namespace std; int H, W; bool visited[200][200]; int f(int a, int b) { return 100 * a + b; } bool check(int a, int b) { return a > 0 && b > 0 && a < 110 && b < 110; } int main() { while (true) { scanf("%d %d", &W, &H); if (H == 0 ...
ALGO
0.99973
3.28425
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2025-04-09T18:47:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4a64f69155e...
aba14bf4-22cf-4135-a51f-280cf8238d4c
emdagh/wee
include/hokusai/topology.hpp
#pragma once #include <array> #include <wee/core/ndview.hpp> #include <wee/core/range.hpp> #include <wee/core/static_for.hpp> template <size_t N> struct topology { static const int kNumNeighbors = N << 1; static const int kNumDirections = N * (N << 1); static const int kNumCorners = 2 << N; stat...
ALGO
0.988225
6.239033
{ "github_metadata": { "branch": "master", "commit_count": 507, "repo_created_at": "2018-08-12T21:09:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f4e5ca16...
605d10dd-025c-4f27-9be3-5450c3df2eec
Algorithm-Study-SSAFY/Algorithm_CPP
moon/20240312/백준 1253 좋다.cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; /* binary seach 총 3개의 숫자 연산이 필요하기 때문에 2개의 숫자의 합을 미리 구하고 나머지 값을 이진탐색으로 찾는다. */ // 39032KB, 248ms struct node { int s; int x; int y; }; bool cmp(node left, node right) { return left.s < right.s; } vector<int> v; vector<node> sum; in...
ALGO
0.999993
4.639618
{ "github_metadata": { "branch": "main", "commit_count": 915, "repo_created_at": "2024-01-17T10:05:46.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3202e3d9ad...
16ae2a64-1617-4480-97ee-0f10078f0fe8
skyler-ruiter/nmf_playground
base_nmf/reg_nmf.cpp
#include <Eigen/Dense> #include <iostream> #include <vector> #include <omp.h> #include <cmath> #include "helpers.cpp" #include "sim_nmf.cpp" #define TINY_NUM 1e-15 struct NMFResult { Eigen::MatrixXd w; Eigen::VectorXd d; Eigen::MatrixXd h; }; NMFResult c_nmf(const Eigen::MatrixXd& A, const Eigen::MatrixXd& At,...
ALGO
0.999469
4.983379
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2024-02-04T18:30: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": "6a43fc90cb4...
4dbdcabd-e74b-4117-9361-8582858131a7
Ritax2003/DSA
Stacks-&-Queues/Assignment-minimum-bracket-reversal.cpp
/* Minimum bracket Reversal Send Feedback For a given expression in the form of a string, find the minimum number of brackets that can be reversed in order to make the expression balanced. The expression will only contain curly brackets. If the expression can't be balanced, return -1. Example: Expression: {{{{ If we r...
ALGO
0.999632
4.951092
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2022-09-30T12:13:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "783f7ad2daf...
acdfad0a-c709-4e8b-9780-f93bc007b0f0
lihzxs/LouGuOJCode
cpp/P2947.cpp
///////////////////////////////////////////// // // FileName : First.cpp // Creator : Fm // Date : 2019-11-11 00:38 // Comment : OJ(P2947) // /////////////////////////////////////////// //#include "pch.h" #include <iostream> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <math.h> #include <st...
ALGO
0.999987
3.685943
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-09-10T11:40: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": "d3a533b1c6...
4407c782-5e8d-4e31-9a75-888621523846
koosaga/olympiad
Croatia/coi19_tenis.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 100005; const int MAXT = 270000; using lint = long long; struct seg{ int tree[MAXT], lazy[MAXT]; void lazydown(int p){ lazy[2*p] += lazy[p]; lazy[2*p+1] += lazy[p]; tree[2*p] += lazy[p]; tree[2*p+1] += lazy[p]; lazy[p] = 0; } void add(int s, ...
ALGO
0.999922
4.739259
{ "github_metadata": { "branch": "master", "commit_count": 361, "repo_created_at": "2015-11-06T16:01:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 285, "forks": 31, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a0640...
4f266db9-7e38-476b-9ef3-4dfb3d4cfb9c
anujrawatcode/StriverDsa
01_DSA_Sheet/11_13July_Graph/1_KosaRaju/SCC.cpp
#include <bits/stdc++.h> using namespace std; // https://drive.google.com/drive/folders/1GYR-eUoFCOf0RPepVaVGcjT9QKCP9nxp?usp=sharing void addEdge(vector<int> graph[], int u, int v) { graph[u].push_back(v); } void printGraph(vector<int> graph[], int V) { for (int i = 0; i < V; i++) { cout << i <...
ALGO
0.999902
5.30558
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2021-01-16T16:27: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": "6583bc77be2...
e24239e9-3be7-4da4-9f14-a0648789109f
uoise/Algos
백준/Gold/1918. 후위 표기식/후위 표기식.cc
#include <iostream> #include <stack> using namespace std; string s; string sol() { string r = ""; stack<char> sk; for (const auto& c : s) { if (c == ')') { while (!sk.empty() && sk.top() != '(') { r += sk.top(); sk.pop(); } sk.pop(); } else if (c == '(') sk.push(c...
ALGO
0.999924
4.656869
{ "github_metadata": { "branch": "master", "commit_count": 1040, "repo_created_at": "2022-11-14T13:50: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": "fe3ab7a...
e58e40a0-20c3-47da-938d-8f97286e39b4
NileshsGithub/DSA
Lecture 61/findFirstNegativeNumberFromKSizedWindow.cpp
#include<iostream> #include <vector> #include <deque> using namespace std; vector<long long> printFirstNegativeInteger(long long int A[], long long int N, long long int K){ deque<long long>dq; vector<long long>ans; //Process first window k size for(int i=0;i<K;i++){ if(A[i]<0){ dq...
ALGO
0.999941
5.459852
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-12-13T10:55: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": "321972136f82...
6a1069a6-46fc-4f0d-aafb-68f50f510fda
ukl2808/vectordrobey
vectordrobej.cpp
/*Создать вектор дробных числе и все числа которые больше 5 увеличить на 1.2*/ #include <iostream> #include <vector> #include <cstdlib> #include <ctime> using namespace std; int main() { srand(time(NULL)); vector<double> numbers(10); for (int i = 0; i < 10; ++i) { numbers[i] = static_cast<double>(...
ALGO
0.998889
4.023956
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-03-26T07:07: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": "6d174571c542...
ebde4bb1-f6a7-4a89-8871-3b7c6ff7fab1
surajkoraon/LeetCode-Solutions
May LeetCoding Challenge/Week 5 May 29th–May 31st/K Closest Points to Origin.cpp
/* We have a list of points on the plane. Find the K closest points to the origin (0, 0). (Here, the distance between two points on a plane is the Euclidean distance.) You may return the answer in any order. The answer is guaranteed to be unique (except for the order that it is in.) Example 1: Input: points = ...
ALGO
1
6.278125
{ "github_metadata": { "branch": "master", "commit_count": 336, "repo_created_at": "2020-05-03T15:33: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": "df8c0de0...
94dfb737-b06e-4ab5-95bc-1520a5a39241
ehnryx/acm
brazil-subregional-2022-cf103960/h.cpp
#include <bits/stdc++.h> using namespace std; //%:include "utility/fast_input.h" //%:include "utility/output.h" %:include "graph/strongly_connected.h" using ll = long long; using ld = long double; constexpr char nl = '\n'; constexpr int MOD = 998244353; constexpr ld EPS = 1e-9L; random_device _rd; mt19937 rng(_rd()...
ALGO
0.999802
4.514369
{ "github_metadata": { "branch": "master", "commit_count": 79, "repo_created_at": "2018-05-03T04:18:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f386ad3d4...
30297187-5f44-4c4b-a629-09277bb5f8c9
doho-ho/Coding-test-practice
Programmers/pro_60062.cpp
/* [프로] 외벽 점검 문제 출처 : https://programmers.co.kr/learn/courses/30/lessons/60062 비고 : 2020 KAKAO BLIND RECRUITMENT */ #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; pair<bool,int> isRepair(const vector<int>& weak, const vector<int>& dist, const int weakSize, cons...
ALGO
0.999918
4.320723
{ "github_metadata": { "branch": "master", "commit_count": 331, "repo_created_at": "2020-03-27T13:26:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "4d1389b2...
2b38693f-ac41-4342-b786-f2606b009f90
EthanChou1/Search-Engine
searchQuery.cpp
// // Created by Ethan on 4/5/2022. // /* The SearchQuery.cpp file contains the implementations for the methods defined in SearchQuery.h. */ #include "searchQuery.h" /** * Main menu of search engine, allows the user to do all of the searching options, statistics, etc. * @param nameDirectory the file directory tha...
TOOL
0.960102
4.908551
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-05-03T17:33:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "45a1bf63a02...
d60414e0-ca62-4a26-ba4e-4e714011c024
MalayKedia/Sem_3
CS293/LabSolutions/lab06-sol/trie/trie.h
/* In this part of the lab, you will be implementing the prefix trie as discussed in class We will also be using trie to implement an autocomplete feature. Autocomplete is used to complete the prefix of a word into a complete word. For instance, suppose our prefix is `ca'. One possible autocomplete is `cat'. There can...
ALGO
0.919524
3.941983
{ "github_metadata": { "branch": "main", "commit_count": 357, "repo_created_at": "2024-07-29T07:59:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 29, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dfaa8ad2f...
b912d674-9d02-4136-910f-77c43fd3b9de
msaadi3/DSA
MultiDimensionalArrays/printSpiralMatrix.c++
#include <bits/stdc++.h> using namespace std; vector<int> spiralOrder(vector<vector<int>> &matrix) { int row = matrix.size(); int col = matrix[0].size(); int count = 0; int total = row * col; vector<int> ans; int firstRow = 0; int lastRow = row - 1; int firstCol = 0; int lastCol ...
ALGO
0.999984
5.500729
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-05-07T03:57:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3572c789e1f1...
7fb08d24-a8ab-419c-8905-d87fb32837a1
hahahahaski/OnlineJudge_Exercises
HOJ/1058.cpp
#include <iostream> #include <vector> int main() { for (int R = 0; std::cin >> R; ) { std::vector<std::vector<int> > triangle; std::vector<std::vector<int> > dp; for (int i = 1; i <= R; ++i) { std::vector<int> ivec; std::vector<int> dpTemp; fo...
ALGO
0.999853
4.066366
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2018-09-11T13:16:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d4719a7ff...
eed2cb9e-6d30-4014-9816-b3d7f7b9ebc8
GoatGirl98/Walkthrough-of-ACCoding-in-BUAA
2016级-软件学院-C++程序设计/C12-2016级C++期末上机模拟赛/BUAAOJ655.cpp
#include<cstdio> #define Max(a,b) (((a)>(b))?(a):(b)) #define Min(a,b) (((a)<(b))?(a):(b)) #define maxn 105 typedef unsigned long long ull; inline ull solve(ull x) { ull lo = 0, hi = 1073741824, mi; x <<= 1; hi <<= 1; while (lo < hi) { mi = (lo + hi) >> 1; if (mi * mi + mi < x) { if (mi ...
ALGO
0.999781
3.938527
{ "github_metadata": { "branch": "master", "commit_count": 49, "repo_created_at": "2020-06-21T03:02:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 313, "forks": 27, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "91a413...
e8d29b38-6213-4e9a-8bf8-540e2792b998
chronaxis/CCC-Senior-Solutions
2002/Senior3.cpp
// works and passes CCC test cases, but DMOJ test cases TLE it :( // most switches and if statments ever lol #include <stdio.h> #include <iostream> #include <vector> #include <string> using namespace std; char changeDir(char dir, char change) { if (change == 'R') { switch(dir) { case 'N': ...
ALGO
0.999696
3.868054
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2022-05-30T22:59:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9173e848eb7f...
c74d0e29-ce59-46d5-a86f-4869fbcfc4dd
pokaa3a/leetcoding
problems/1196. How Many Apples Can You Put into the Basket.cc
#include <iostream> #include <vector> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <string> #include <queue> #include <stack> #include <sstream> #include <cmath> using namespace std; struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), le...
ALGO
0.999731
4.795951
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2020-03-15T08:11:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fbbe2d5b0...
d1a9ca14-a806-404d-b4fe-12d8207d800b
aoaforever/C_trian
Leetcode/Dynamic_Programming/416_canPartition.cpp
#include <iostream> #include <vector> #include <map> using namespace std; class Solution { public: map<pair<int,int>,bool> memo; bool canPartition(vector<int>& nums) { int sum=0; for(auto& n:nums){ sum += n; } if(sum%2==1){return false;} sum ...
ALGO
0.999955
4.749077
{ "github_metadata": { "branch": "master", "commit_count": 253, "repo_created_at": "2021-07-05T02:23: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": "7025bfa8...
b59b98ae-6c1f-40c4-9bd2-4c0194e4f81f
haecheonlee/personal-studies
PS/BaekJoon/수열과 쿼리 37.cpp
#include <iostream> #include <vector> #include <cmath> using namespace std; int tree_size(int n) { int h=(int)ceil(log2(n)); int tree_size=(1<<(h+1)); return tree_size; } int init(vector<int> &tree, vector<int> &a, int node, int start, int end) { if(start==end) return tree[node]=a[start]; else { return tree...
ALGO
0.999865
4.688532
{ "github_metadata": { "branch": "master", "commit_count": 2258, "repo_created_at": "2019-12-05T02:53:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f6176e7...
e1d27a4d-ff56-4d1f-9545-540b5d207e68
Akdeniz/adventofcode2023
day09/main.cpp
#include <iostream> #include <fstream> #include <vector> #include <algorithm> #include <numeric> #include <sstream> #include <regex> #include <optional> #include <functional> #include <set> #include <unordered_map> #include <map> std::vector<int64_t> find_integers(const std::string &str) { static std::regex base_...
ALGO
0.999595
4.900714
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2023-11-30T23:20:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "33c68cde7d4...
4db86cdf-a98c-42cb-8740-d168d94bb8a1
danhnguyen0811/ProjectEuler
78.cpp
#include<bits/stdc++.h> //https://en.wikipedia.org/wiki/Pentagonal_number_theorem using namespace std; #define nl '\n' #define fi first #define se second typedef long long ll; //m*(3*m - 1)/2, m = 0, +-1, +-2, +-3, .... const int N = 1e5; const int MOD = 1e7; void Solve(){ vector<ll> f; f.push_back(0); for(ll i...
ALGO
0.999846
3.878442
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-10-09T18:01: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": "aa460a1b2a2c...
e215966f-6ba4-44f0-9732-745e3faa3003
VuThiMinhThu2004/DSA
test14_11/tempCodeRunnerFile.cpp
#include "bits/stdc++.h" using namespace std; int fa[256], fb[256]; int fA[256]; int main() { int t; cin >> t; while(t--) { string a,b; cin >> a >> b; for (int i = 0; i < (int)a.size(); i++) { if (a[i] >= 'a' && a[i] <= 'z') { a[i] = a[i] - 'a' + 'A'; } e...
ALGO
0.999983
4.816511
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-09-06T08:36: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": "78989ef2ba1...
f23b69a2-b6d6-41ab-9ea9-f4a52f1ca976
ishandutta2007/codeforces-s
sankear/normal/229/A.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <ctime> #include <algorithm> #include <cstring> #include <vector> #include <set> #include <map> #include <bitset> #include <queue> #include <complex> #include <cassert> using namespace std; #define pb push_back #define mp make_pair #de...
ALGO
0.999948
3.058454
{ "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": "6b0484c3e4b4...
6da72edd-0a1d-4596-8888-07dc3172786b
aleksandraswj/pp1-lista2
Prog1_3_8/main.cpp
#include <iostream> #include <math.h> #include <Kwadrat.h> #include <Trojkat.h> #include <Prostokat.h> using namespace std; //1.3.8 (r) Napisz program, który w zależności od wyboru użytkownika wczytuje //ze standardowego wejścia wymiary: kwadratu, prostokąta lub trójkąta i wypisuje na standardowym wyjściu pole figury...
ALGO
0.920155
3.37362
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-10-23T19:07: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": "7b0de5bedc4a...
6f13c8ab-8594-41fa-a65c-ae4cffbbfdb9
toqeeryasir/dsa-in-cpp
linear_and_nonlinear_datastructures/stack_linked_list_based.cpp
#include <iostream> #include <string> #include <cmath> using namespace std; struct node { int data; node *next = NULL; }; class Stack { public: node *head, *curr; public: Stack() { head = NULL; curr = NULL; } void push(int data){ node *newnode = new node; ne...
ALGO
0.998993
4.282418
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2024-06-20T08:43: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": "998ccffb428...
12690826-fcee-4a36-9976-917bb47f5863
ksaveljev/UVa-online-judge
11624.cpp
#include <iostream> #include <queue> using namespace std; struct position { char id; int r, c; int count; }; bool joe_visited[1000][1000]; bool fire_visited[1000][1000]; int bfs(char field[][1000], int r, int c, pair<int,int> &joe, const vector< pair<int,int> > &fire) { position tmp; queue<position> q; i...
ALGO
0.999781
4.6831
{ "github_metadata": { "branch": "master", "commit_count": 788, "repo_created_at": "2011-04-04T11:43:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 106, "forks": 69, "issues": 0, "pull_requests": 4 }, "file_meta": { "content_id": "f1316...
edd47c12-d49d-4083-aded-0f5ca4b1614c
rohanrao619/Data_Structures_and_Algorithms
Array/Max_Occured_Integer_in_Ranges.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // L and R are input array // maxx : maximum in R[] // n: size of array // arr[] : declared globally with size equal to maximum in L[] and R[] int maxOccured(int L[], int R[], int n, int maxx){ // Your code here in...
ALGO
0.999951
5.706045
{ "github_metadata": { "branch": "master", "commit_count": 63, "repo_created_at": "2020-03-08T17:20:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "51c0609c0...
53017bef-20ed-46c5-8be4-cbc3643b6a0e
sakshieng/DSA-Sheet
Trees/binaryTreetoCDLL.cpp
// https://www.geeksforgeeks.org/problems/binary-tree-to-cdll/1 // left pointer as prev in LL and right pointer as next in LL #include <bits/stdc++.h> // amazon interview que using namespace std; struct Node { int data; struct Node *left; struct Node *right; Node(int x) { data = x; ...
ALGO
0.999964
5.623754
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-07-25T05:38: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": "19814e4a1d62...
e92f814a-ea02-4aae-a231-7a2f80078a1e
mlsys-seo/sage
tools/sample_graph_gen.cpp
#include <random> #include <iostream> #include <sys/time.h> #include "graph.hpp" #include "timer.hpp" #include <algorithm> std::random_device rd; std::default_random_engine random_engine(0); std::uniform_real_distribution<float> uniform_dist(0.0, 1.0); float sampling_time = 0; bool directed = 0; void make_random(Grap...
ALGO
0.995756
4.562411
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2022-09-18T11:54:52.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cabbed5ab00f5...
af2e77a0-38c1-4001-acbc-c078ca95eb5c
qiongyu/CosmoCodes
lss/reconstruction_periodic_box.cpp
#include <cstdlib> #include <iostream> #include <fstream> #include <sstream> #include <string> #include <math.h> #include <assert.h> #include <algorithm> #include <fftw3.h> #include <complex> #include <omp.h> using namespace std; int Ngrid = 512; int Ngrid3 = Ngrid*Ngrid*Ngrid; double Lbox = 1500; double sigma = 15.;...
ALGO
0.996136
3.081795
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2013-06-22T20:31:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a1cc93afa5...
2cb0e893-2779-470a-9812-4b99fcc7ccbe
vNaonLu/leetcode-daily
src/q_101_150/q0140.cc
// Copyright 2023 <NAME> // // This file describes the solution of // Word Break II // // https://leetcode.com/problems/word-break-ii/ // // Question ID: 140 // Difficult : Hard // Solve Date : 2022/05/16 17:56 #include <array> #include <iosfwd> #include <memory> #include <string> #include <vector> // -- This header...
ALGO
0.999448
6.730768
{ "github_metadata": { "branch": "main", "commit_count": 2477, "repo_created_at": "2021-09-06T15:30:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "65ea717ae...
d608a93f-d608-44dd-9038-8945ade7b0f9
keerthinamballa/Placement_Prep
Matrix/WordSearch.cpp
// Given an m x n grid of characters board and a string word, return true if word exists in the grid. // The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once. bool dfs(vector<vector...
ALGO
0.999852
6.167146
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2023-03-04T16:32: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": "94b6e4ce44b...
fb8ae1d7-5d83-4e53-93c6-c5370b336366
amzn/pecos
examples/ann-hnsw-pq4bits/example.cpp
#include <iostream> #include <string> #include <unordered_set> #include "utils/matrix.hpp" #include "utils/scipy_loader.hpp" #include "ann/hnsw.hpp" class StopW { std::chrono::steady_clock::time_point time_begin; public: StopW() { time_begin = std::chrono::steady_clock::now(); } float getEla...
DATA
0.996528
5.742034
{ "github_metadata": { "branch": "mainline", "commit_count": 219, "repo_created_at": "2020-08-12T00:25:51.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 534, "forks": 108, "issues": 24, "pull_requests": 1 }, "file_meta": { "content_id": "e2...
925df6df-ca1e-43a0-833d-5d459ac04024
ImtiazAhmedAkash/Problem-Solving
cses/dynamic_programming/1636.cpp
/* In the Name of ALLAH, the most gracious, the most merciful */ // Coin Combinations II #include <bits/stdc++.h> using namespace std; #define ll long long #define nl '\n' #define deb(x) cerr << #x << " = " << x << nl const int inf = 1e9; const ll INF = 1e18; const int mod = 1e9 + 7; const int N = 2e5 + 5; void ...
ALGO
0.999938
4.734823
{ "github_metadata": { "branch": "main", "commit_count": 475, "repo_created_at": "2022-11-19T14:05: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": "b0405cce10...
13095798-60c8-4c27-b33e-edde0995c6ba
ishandutta2007/codeforces-a
aryanc403/normal/258/C.cpp
/* Warn - Don't change next line else you will get WA verdict. Online Judge is configured to give WA if next line is not present. "An ideal problem has no test data." Author - <NAME> (@aryanc403) */ #pragma warning(disable:4996) #pragma comment(linker, "/stack:200000000") #pragma GCC optimize ("Ofast") #pragma G...
ALGO
0.999951
3.883632
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00: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": "c2df678cb5bf...
98076754-6f57-47a0-802b-1fc51cddae5f
huanglei214/data_struct
some/各种类型/BestCode/模拟1/HDU5438(AC)/Ponds.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <queue> using namespace std; const int maxn = 10010; typedef long long LL; LL val[maxn]; int vis[maxn]; LL in[maxn]; vector <LL> G[maxn]; //G[i][j]存的是起点的i,终点是G[i][j] int n,m; void topsort() { queue<LL> que; while(!que.empty())que.pop(); ...
ALGO
0.99996
3.625331
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-07-15T14:08: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": "c9d9e4086e...
e2adb854-7121-447a-aacb-ca6b57c2db2c
nikhilbits98/Trees
tree.cpp
#include"tree.h" Tree insert(Tree root, int key) { if (root == NULL) { return newNode(key); } else if (key > root->value) { root->right = insert(root->right, key); } else if (key < root->value) { root->left = insert(root->left, key); } root->ht = 1 + max(getHt(root->left), getHt(root->right)); return ...
ALGO
0.999927
3.630681
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2018-06-07T07:22:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "b96222d68...
31d012c9-113c-49a6-aa42-6ee5e52c5f17
Deeps-01/openMp
ssspTopologyDriven.cpp
/* use this command for compiling g++ -Xpreprocessor -fopenmp /opt/homebrew/Cellar/libomp/14.0.5/lib/libomp.a */ //single src shortest path #include <iostream> #include <string.h> #include </opt/homebrew/Cellar/libomp/14.0.5/include/omp.h> #include <sstream> #include <fstream> #include <climits> #include <vector> #in...
ALGO
0.999884
4.106236
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-05-29T15:49: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": "40807fd6db7...
1bf98c51-927b-48c4-a970-b45b85a721dd
DineshMeegada/Striver_A2Z_Sheet
5. Strings [Basic & Medium]/5.1 Basic & Easy String Problems/2_ReverseWordsInString.cpp
#include <bits/stdc++.h> using namespace std; string reverse_words_in_string(string s){ int n = s.size(); string res = "", temp = ""; int i=n-1; while (i>=0 && s[i]==' ') i--; while (i>=0) { while (i>=0 && s[i]!=' ') temp += s[i--]; while (i>=0 && s[i]==' ') i--; reverse(...
ALGO
0.999932
4.489413
{ "github_metadata": { "branch": "main", "commit_count": 327, "repo_created_at": "2023-07-23T07:53:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b76dd02b5a...
35889767-a0b3-4923-be10-0d2472eb19a1
rubenvereecken/challenges
Glassdoor/cpp/textSearch.cpp
/*! * \file * \brief textSearch.cpp * * \date Sep 12, 2013 * \author <NAME> */ #include "GlassDoor.h" using namespace std; // "length of longest prefix of string that is suffix of string[i...j]" vector<int> failureFunction(string a) { if (a.empty()) return vector<int>(); vector<int> failure(a.size());...
ALGO
0.993596
3.56585
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2016-01-15T20:48:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "90df3155e...
e80eb929-5b43-4d00-a8a3-79fcbff6e8e3
erokhinav/bigint
big_integer.cpp
// // Created by <NAME> on 30.04.17. // #include <iostream> #include <string> #include <cassert> #include <math.h> #include <algorithm> #include "big_integer.h" unsigned int *create_pointer(int capacity, unsigned int cnt) { unsigned int *new_pointer = new unsigned int[capacity + 1]; new_pointer[0] = cnt; ...
ALGO
0.993378
4.033533
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-06-10T18:14: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": "8369578e97...
89d99c28-90e8-4644-9779-a491a70a9753
algorithm005-class02/algorithm005-class02
Week_03/G20190343020181/leetcode_33_0181.cpp
class Solution { public: int search(vector<int>& nums, int target) { if (nums.empty()) return -1; int left = 0; int right = nums.size() - 1; while (left <= right) { int mid = left + ((right - left)>>1); if (nums[mid] == target) { return mid; ...
ALGO
0.999995
5.897234
{ "github_metadata": { "branch": "master", "commit_count": 1936, "repo_created_at": "2019-12-01T14:47:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 35, "forks": 116, "issues": 615, "pull_requests": 0 }, "file_meta": { "content_id": "b02...
a3d900bd-cbcd-432d-bb2a-fefdc1309dc1
shantorohmat/all-code
Algorithm/Number Theory/Bootcamp'21/Backtraking/permute.cpp
#include <bits/stdc++.h> using namespace std; int check(int cur,int spt_pos,string s) { for(int i = cur;i < spt_pos;i++) { if(s[i] == s[spt_pos]) return 0; } return 1; } void permute(int pos,string s) { if(pos == s.size() - 1) { cout << s << endl; return; } for(i...
ALGO
0.999726
3.705525
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-04-07T19:38: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": "1f83e50073bc...
fea6721c-9427-491f-ae76-1c43032b5c5e
shurik111333/spbu
olympic/classwork/23.03.16_enets_on_line/B/main.cpp
#include <iostream> #include <fstream> #include <set> #include <stack> using namespace std; struct Event { int x; int type; int index; }; struct _less { bool operator ()(const Event &e1, const Event &e2) { return e1.x < e2.x || (e1.x == e2.x && e1.type < e2.type); } }; int l[55000]; int r[55000]; int main(...
ALGO
0.999993
3.616915
{ "github_metadata": { "branch": "master", "commit_count": 131, "repo_created_at": "2015-10-01T20:55: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": "3b089f48...
67824c76-3a45-4432-b94a-23c360b54029
alexpizarroj/competitive-programming
src/codeforces/round-240-div-2/D-noOpt.h
#include <cassert> #include <cstring> #include <cstdlib> #include <cstdio> #include <cmath> #include <iostream> #include <vector> #include <set> #include <map> #include <stack> #include <queue> #include <algorithm> #include <string> #define PB push_back #define MP make_pair #define ALL(a) (a).begin(), (a).end() #define...
ALGO
0.999867
4.643517
{ "github_metadata": { "branch": "master", "commit_count": 107, "repo_created_at": "2014-09-11T05:20:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6b5f3180...