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
996516a8-524f-4ac3-a619-9ba0b2b7924e
Laizl95/Algorithm
Codeforces Round/Codeforces Round #631 (Div. 2)/B.cpp
#include<bits/stdc++.h> #define rep(i,x,y) for(int i=x;i<y;++i) #define per(i,x,y) for(int i=y-1;i>=x;--i) #define ms(x,y) memset(x,y,sizeof(x)) #define pb(x) push_back(x) #define mp(x,y) make_pair(x,y) #define pii pair<int,int> #define fi first #define se second using namespace std; const int N=2e5+5,inf=1e9+5; typede...
ALGO
0.999944
3.306075
{ "github_metadata": { "branch": "master", "commit_count": 81, "repo_created_at": "2019-03-18T10:59:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e959176b9...
28ccc163-d689-4b16-8e0b-6956bafc8fd6
nmd1406/DSA
DSA10017.cpp
#include<bits/stdc++.h> using namespace std; int main() { int test{}; cin >> test; while(test--) { int n{}; int m{}; cin >> n >> m; vector<tuple<int, int, int>> edges{}; for(int i{1}; i <= m; ++i) { int fv{}; int sv{}; ...
ALGO
0.999962
4.292737
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-10-28T19:04: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": "ef39c96a0c33...
85673106-7bad-4a34-a96a-0169c2836899
ishandutta2007/codeforces-g
gmusya/normal/842/C.cpp
#include <iostream> #include <vector> #include <algorithm> #include <set> using namespace std; typedef vector <int> vi; typedef vector <vi> vvi; vi a; vi ans; vvi g; vector <set <int>> dp0, dp1; void dfs(int v, int p = -1) { if (p == -1) { dp0[v].insert(a[v]); dp1[v].insert(0); } else { dp1[v] = dp0...
ALGO
0.999794
3.93211
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01: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": "3baaf33fea38...
438e5cde-4836-464f-894b-308f0b0ec961
poby123/studyAlgorithm
백준/3190.cpp
/** * 문제 'Dummy' 라는 도스게임이 있다. 이 게임에는 뱀이 나와서 기어다니는데, 사과를 먹으면 뱀 길이가 늘어난다. 뱀이 이리저리 기어다니다가 벽 또는 자기자신의 몸과 부딪히면 게임이 끝난다. 게임은 NxN 정사각 보드위에서 진행되고, 몇몇 칸에는 사과가 놓여져 있다. 보드의 상하좌우 끝에 벽이 있다. 게임이 시작할때 뱀은 맨위 맨좌측에 위치하고 뱀의 길이는 1 이다. 뱀은 처음에 오른쪽을 향한다. 뱀은 매 초마다 이동을 하는데 다음과 같은 규칙을 따른다. 먼저 뱀은 몸길이를 늘려 머리를 다음칸에 위치시킨다. 만약 이동한 칸에 사과가 있다면, 그...
ALGO
0.999907
4.697209
{ "github_metadata": { "branch": "master", "commit_count": 205, "repo_created_at": "2020-11-19T09:19: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": "8fffc526...
f4736960-b386-489e-9c16-b1e5391ff402
anmol-jandyal/DSA
NUMERICAL METHODS/solution of algebra and transectional equation/regula falsi method]/code.cpp
#include <iostream> #include <math.h> #include <iomanip> using std::cin; using std::cout; #define f(x) (pow(x, 3) - 2 * x - 5) //based on the function we change it void compute(double a, double b, double y1, double y2, int decimal) //we take y1 +ve and y2 -ve { double x = 0, y = 0; double check; //is taken fo...
ALGO
0.99989
4.377649
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2022-01-12T08:54: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": "e2665db3c7f...
465f3f15-c15b-4d16-811e-b00925c52282
jccaleroe/Maratones
Thunder/Lothric/FordFulkerson.cpp
#include <iostream> #include <limits.h> #include <string.h> #include <queue> using namespace std; // Number of vertices in given graph #define V 6 /* Returns true if there is a path from source 's' to sink 't' in residual graph. Also fills parent[] to store the path */ bool bfs(int rGraph[V][V], int s, int t, int par...
ALGO
0.999508
4.986617
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2016-12-26T16:46:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "327297269...
536955db-0c29-4575-ba6f-4c24d46b5525
Dunay-Led/quantum_test
SOSCF.cpp
#ifndef SOSCF #define SOSCF #include <libint2.hpp> #include "header.h" #include <math.h> #define Mat_init Matrix<std::complex<double>, Dynamic, Dynamic> using namespace Eigen; using namespace std; using libint2::Shell; using libint2::BasisSet; using libint2::Operator; using namespace libint2; using namespace std::chron...
ALGO
0.999861
4.032323
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-11-22T22:49:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b851846b5553...
8baaaf55-fce6-46c5-a802-8372bed9074c
jecrespo/Coderetreat-2016
Juego_De_La_Vida/Juego_De_La_Vida.ino
//Coderetreat-2016 //Juego de la vida: https://es.wikipedia.org/wiki/Juego_de_la_vida #include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> #endif // Which pin on the Arduino is connected to the NeoPixels? // On a Trinket or Gemma we suggest changing this to 1 #define PIN 8 // How many NeoPixels are a...
ALGO
0.998641
5.303534
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2016-10-21T20:19: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": "344c915aea...
cd5d4ee0-d303-48c7-8338-ea19b9127b31
qtcyy/LeetCode-Record-3.17
数据结构/chapter2/2.1/No3224/3224.使差值相等的最少数组改动次数.cpp
/* * @lc app=leetcode.cn id=3224 lang=cpp * * [3224] 使差值相等的最少数组改动次数 */ #include <cmath> #include <iostream> #include <unordered_map> #include <vector> using namespace std; // @lc code=start class Solution { public: int minChanges(vector<int> &nums, int k) { int n = nums.size(); vector<int> cnt(k + 1), cnt...
ALGO
0.999957
5.610332
{ "github_metadata": { "branch": "main", "commit_count": 832, "repo_created_at": "2025-03-21T08:48: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": "c91ebd9564...
a59bd2b7-d2a2-4bcd-8478-1e20b1f6aab4
trilinos/Trilinos
packages/stk/stk_middle_mesh/stk_middle_mesh/geometry_improver_edge_vertex_surface_patch.hpp
#ifndef GEOMETRY_IMPROVER_EDGE_VERTEX_TAYLOR_PATCH #define GEOMETRY_IMPROVER_EDGE_VERTEX_TAYLOR_PATCH #include "adjacency_search_closest_points.hpp" #include "change_of_basis.hpp" #include "geometry_improver.hpp" #include "stk_util/util/ReportHandler.hpp" #include "surface_patch.hpp" #include "utils.hpp" #include <que...
ALGO
0.947417
6.288127
{ "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":...
42ee2208-c6f5-486f-b114-3cc55ebc8839
doluong-opt/CodeContest
LightOJ/1254 - Prison Break.cpp
/*********************************************** * Author - <NAME> * * 1254 - Prison Break ->AC * Algorithm dijkstra + priotity * Time Limit 0.053s * *********************************************/ #include <iostream> #include <stdio.h> #include <queue> #include <stack> #include <vector> #include ...
ALGO
0.999939
4.037546
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-07-02T12:10: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": "0b99316954...
6972a34e-679e-433c-8e58-94cac16d6e03
zqy1018/my_leetcode
code/854.cpp
#include <bits/stdc++.h> #define INF 2000000000 using namespace std; typedef long long ll; int read(){ int f = 1, x = 0; char c = getchar(); while(c < '0' || c > '9'){if(c == '-') f = -f; c = getchar();} while(c >= '0' && c <= '9')x = x * 10 + c - '0', c = getchar(); return f * x; } class Solution { public: i...
ALGO
0.999983
4.163175
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2020-01-08T04:35:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 24, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1680b9ee...
148ec41e-c053-4580-ab1a-9d7cd6b7316e
zhushh/leetcode
fourSum.cpp
// https://leetcode.com/problems/4sum/ #include <iostream> #include <vector> #include <map> #include <set> #include <algorithm> using namespace std; class Solution { public: vector< vector<int> > fourSum(vector<int> &num, int target) { int size = num.size(); map<int, vector<pair<int, int> > >cache...
ALGO
0.999834
5.536802
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2015-09-08T14:45: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": "6574eb572...
31f3991e-473e-44ca-aac6-d414e22288fe
AkiLotus/AkikazeCP
Vault/ACMandOI/Challenges by liv1n9 - Sep 12/4-Graph63.cpp
/********************************************************** * Code written by Akikaze * * <NAME>, #Team4T's Chief Executor * * #Team4T Tertiary Flagship - Oblivion * * * * Written by a rando...
ALGO
0.99992
4.780604
{ "github_metadata": { "branch": "master", "commit_count": 92, "repo_created_at": "2018-07-18T04:56:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ab53d4243...
e4bcf882-5987-41f3-b135-c25c2a7f472e
nytemairqt/unspeakable
DspNetworks/CodeLibrary/snex_shaper/snex_shaper.h
template <int NumVoices> struct snex_shaper { SNEX_NODE(snex_shaper); int MODE = 0; double sr = 0.0; // A - Simple Pi Clipper float typeA(float input) { float x = input; float pi = 3.14159266f; if (x > pi) x = pi; return x; } // B - Tape Drive float typeB(float input) { ...
ALGO
0.913216
5.51366
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2025-04-06T14:21: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": "e4fecb5ded0...
1521f203-9f26-49d8-bb25-afc8f5ae90f5
listnt/numerical-methods
lab6/Source.cpp
#include<math.h> #include<iostream> using namespace std; typedef double (*func)(double x) ; double f1(double x) { return 1; } double f2(double x) { return x; } double f3(double x) { return x*x;//tan(x); } double determ(double** Arr, int size) { int i, j; double det = 0; double** matr; if (size == 1) { det...
ALGO
0.999786
3.340619
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-11-17T17:54: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": "9038d1720b...
10d8e99f-8ae1-434a-aca4-8c599c40b931
sheviv/mirrors
cpp/while_for_and_array.cpp
#include <iostream> #include <stdio.h> #include <cmath> #include <iomanip> #include <limits> #include <vector> using namespace std; int main() { int n, c, ln; float inf = std::numeric_limits<float>::infinity(); c = 0; cin >> n; vector <int> a(n); vector <int> v; vector <int> v2(n); fo...
ALGO
0.999996
3.58749
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2021-09-03T18:47: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": "21d06e17587...
6b5dcbbb-2852-472c-b9b3-9033f1fd881b
krishukr/cpp-code
src/LG/lg-P8346.cpp
#include <cstdio> #include <iostream> #include <memory> #include <queue> constexpr int MAX_N = 2000050; class Solution { struct { int v; int nxt; } node[MAX_N << 1]; int head[MAX_N]; int cnt; void create(int u, int v); bool vis[MAX_N]; int deg[MAX_N]; bool check(); ...
ALGO
0.99997
4.000452
{ "github_metadata": { "branch": "master", "commit_count": 193, "repo_created_at": "2021-01-19T08:15:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "59cffb89...
097e21be-205e-470a-86ae-0a8802dcc02e
Cue/skia
experimental/Intersection/QuadraticImplicit.cpp
// Another approach is to start with the implicit form of one curve and solve // (seek implicit coefficients in QuadraticParameter.cpp // by substituting in the parametric form of the other. // The downside of this approach is that early rejects are difficult to come by. // http://planetmath.org/encyclopedia/GaloisTheo...
ALGO
0.999893
5.087011
{ "github_metadata": { "branch": "master", "commit_count": 6087, "repo_created_at": "2013-01-28T21:06:58.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c804baaa...
f6c7681a-d60f-4023-a530-207a71471e4b
prch-s/01204214_Problem_Solving_Laboratory
Week03/Buyinpair/Buyinpair.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; vector<long long int> bip; int n; int a; int b; void showvector(vector<long long int> under) { for (auto itr = under.begin() ; itr != under.end() ; itr++) { cout << *itr << " "; } cout << "\n"; } int binsearch(int l...
ALGO
0.999831
3.665269
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-12-09T05:48: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": "983fc11bc9...
0af575e5-4f87-416e-8602-d6b37870e714
wizardap/CP-Notebook
Graph/Flows/Dinic_2.h
/* * Source: <NAME> (Benq) * Modified by WizardAP * Verification : - https://oj.vnoi.info/problem/nkflow - Minmum Cut : https://cses.fi/problemset/task/1695 * Description how minimum cut work(Source : from a comment on stackoverflow ) : - Run any max flow algorithm on residual graph (Ford-Fulkerso...
ALGO
0.998902
4.075778
{ "github_metadata": { "branch": "main", "commit_count": 82, "repo_created_at": "2021-05-25T12:45: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": "5d057850e19...
74aad85d-d6b0-4015-834e-f17df8c3c621
arch-ana/nyu-tandon-bridge-2024
week4/Homework/ab12864_hw4_q2.cpp
#include <iostream> using namespace std; int main() { int userInput, numberOfM, numberOfD, numberOfC, numberOfL, numberOfX; int numberOfV, numberOfI; cout<<"Please enter a positive integer: "<<endl; cin>>userInput; numberOfM = userInput / 1000; userInput -= numberOfM*1000; number...
ALGO
0.999303
3.791301
{ "github_metadata": { "branch": "main", "commit_count": 68, "repo_created_at": "2024-09-27T16:36: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": "4eabf6a9b96...
c733843b-f8ab-413b-8a51-70d0f15f216b
tuanbieber/leetcode
python_solutions/687.longest-univalue-path.cpp
/* * @lc app=leetcode id=687 lang=cpp * * [687] Longest Univalue Path * * https://leetcode.com/problems/longest-univalue-path/description/ * * algorithms * Easy (33.65%) * Total Accepted: 57.8K * Total Submissions: 171.7K * Testcase Example: '[5,4,5,1,1,5]' * * Given a binary tree, find the length of t...
ALGO
0.9999
6.551096
{ "github_metadata": { "branch": "master", "commit_count": 860, "repo_created_at": "2020-06-01T01:16:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8d5aea36...
d97025aa-0e21-4fec-867e-2bbfd65bda3e
ishandutta2007/codeforces-h
heno239/normal/1184/E3.cpp
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<iomanip> #include<math.h> #include<complex> #include<queue> #include<deque> #include<stack> #include<map> #include<set> #include<bitset> #include<functional> #include<assert.h> #include<numeric> using namespace std; #define REP(i,m,n) for...
ALGO
0.999989
4.383824
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T02:01: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": "bd60efee59f5...
9c03b9b7-bde2-4f8d-862d-5b5ce2950ffd
52North/IlwisCore
core/geos/src/operation/overlay/MaximalEdgeRing.cpp
/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2005-2006 Refractions Research Inc. * Copyright (C) 2001-2002 Vivid Solutions Inc. * * This is free software; you can redistribute and/or modify it under * th...
ALGO
0.987012
7.152431
{ "github_metadata": { "branch": "master", "commit_count": 6882, "repo_created_at": "2013-05-15T13:19:18.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 36, "forks": 13, "issues": 26, "pull_requests": 0 }, "file_meta": { "content_id": "6c2b3...
6d631ba1-77c4-4c60-a040-987a99c2e8f6
Amtilan/cpp
ADS/lab 6/g.cpp
#include <bits/stdc++.h> using namespace std; bool comp(pair<string, string> &p1, pair<string, string> &p2) { return p1.first < p2.first; } int partition(vector<pair<string, string>> &ar, int left, int right) { pair<string, string> pivot = ar[right]; int index = left; for (int i = left; i < right; i+...
ALGO
0.999876
4.343676
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2024-02-18T13:38:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "271c62a7f90...
13798030-b8af-4363-9e9b-0e877b54d4c7
shashwata2003/DSA
2.FamousQues/Ques/MergeTwoBST.cpp
#include <iostream> #include <bits/stdc++.h> #include <array> using namespace std; /* Merge two BST 's: Given two BSTs, return elements of merged BSTs in sorted form. Sol: Apporach 1: We can convert both the list to Double linked list and then merge both the linked list and print that apporach 2: will be using DFS :...
ALGO
0.999998
5.817951
{ "github_metadata": { "branch": "main", "commit_count": 58, "repo_created_at": "2024-07-15T03:10: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": "e1161cb45de...
d6328e56-186b-446d-9ae4-a85f4810190c
DuriChoi/repo
book/picc/Lesson_8/4/4.cpp
#include <iostream> using namespace std; int main(){ int a = 5; int b = 10; int *pA; pA = &a; cout << "변수 a의 값은 " << a << "입니다." << endl; cout << "포인터 pA의 값은 " << pA << "입니다." << endl; cout << "pA의 값은 " << *pA << "입니다." << endl; cout<<endl; pA = &b; cout << "변수 b의 값은 " << b << "입니다." << endl; cout << "...
TOOL
0.914002
3.954763
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2021-09-02T09:08: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": "b322a766f...
8b032141-a581-42b8-ad20-f863abc3be81
akgmage/data-structures-and-algorithms
Math/Number_of_Substrings_With_Only_1s.cpp
/* Given a binary string s, return the number of substrings with all characters 1's. Since the answer may be too large, return it modulo 109 + 7. Example 1: Input: s = "0110111" Output: 9 Explanation: There are 9 substring in total with only 1's characters. "1" -> 5 times. "11" -> 3 times. "111" -> 1 time. Example...
ALGO
0.999998
5.400663
{ "github_metadata": { "branch": "main", "commit_count": 3839, "repo_created_at": "2021-02-21T17:38:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 150, "forks": 216, "issues": 17, "pull_requests": 0 }, "file_meta": { "content_id": "dbec...
97791e11-2f23-43fe-a251-cc8b7b48c677
apollopower/interview-prep
cpp/practice_questions/second_largest_bst.cpp
#include <iostream> #include <memory> using namespace std; class BinaryTreeNode { public: int value_; BinaryTreeNode* left_; BinaryTreeNode* right_; BinaryTreeNode(int value) : value_(value), left_(nullptr), right_(nullptr) { } ~BinaryTreeNode() { dele...
ALGO
0.999954
5.930799
{ "github_metadata": { "branch": "master", "commit_count": 138, "repo_created_at": "2018-08-27T02:13:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3ebc3ddb...
0d6c0f56-e924-4f42-958d-e721b478a780
Santosh276124/LeetCode-Solutions
0938-range-sum-of-bst/0938-range-sum-of-bst.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.999996
6.380423
{ "github_metadata": { "branch": "main", "commit_count": 2331, "repo_created_at": "2022-10-09T15:46:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6dd5e5a7f...
03e63b3a-dd3b-4fa0-b001-9377e7ca2cd1
RobotLocomotion/drake
geometry/proximity/contact_surface_utility.cc
#include "drake/geometry/proximity/contact_surface_utility.h" #include <algorithm> #include <fmt/format.h> #include "drake/common/default_scalars.h" #include "drake/common/fmt_eigen.h" #include "drake/math/autodiff.h" namespace drake { namespace geometry { namespace internal { namespace { template <typename T> voi...
ALGO
0.996731
6.297974
{ "github_metadata": { "branch": "master", "commit_count": 33726, "repo_created_at": "2014-01-26T16:11:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3630, "forks": 1305, "issues": 690, "pull_requests": 46 }, "file_meta": { "content_id":...
a42839eb-f13a-423c-bc66-5e2e9c735d0f
gabeoh/CarND-P08-KidnappedVehicle
src/particle_filter.cpp
/** * particle_filter.cpp * * Created on: Nov 4th, 2018 * Author: <NAME> */ #include <random> #include <algorithm> #include <iostream> #include <numeric> #include <cmath> #include <iostream> #include <sstream> #include <string> #include <iterator> #include <cfloat> #include <cassert> #include "particle_filter.h"...
ALGO
0.988517
6.197436
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2018-11-04T20:27: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": "ef84abac0...
003dd6e5-99ff-4a34-ad4b-23b88dd07fd4
Shikhar-S/Analysis-of-Competitive-Codebase
Data/Contest1236/all/29088977_62787050.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define int long long #define ll long long #define pii pair<int,int> #define pb push_back #define all(a) a.begin(),a.end() #define endl '\n'...
ALGO
0.999893
4.847479
{ "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": "4634c785d...
16e97c41-e15b-4a3a-951a-57fa15ed6dbb
cat-mood/mai-da-labs
lab04/main.cpp
#include <iostream> #include "parser.h" #include "kmp.h" std::vector<TWord> copy(std::vector<TWord>& dest, int index) { std::vector<TWord> src; for (int i = index; i < dest.size(); i++) { src.emplace_back(dest[i]); } return src; } int main() { TString pattern; TString text; TWord ...
ALGO
0.998973
3.935378
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2024-02-27T20:56:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "164b09a7ed8...
0f8994ec-e438-4643-93d7-2264019695bd
ionutdd/FMI-Unibuc
FMI-Unibuc/Year 2 /Semester 1/AF/Tema3/Ghizi.cpp
#include <fstream> #include <vector> #include <queue> #include <cstring> #include <algorithm> using namespace std; ifstream f("ghizi.in"); ofstream g("ghizi.out"); const int N_MAX = 101; queue<int> q; vector<int> G[N_MAX][N_MAX], solutie; int n, m, k, maxi, flux[N_MAX][N_MAX], capacitate[N_MAX][N_MAX], previous[N_M...
ALGO
0.99999
4.320983
{ "github_metadata": { "branch": "main", "commit_count": 325, "repo_created_at": "2023-02-07T12:01: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": "410b6c9f1d...
8bea22ce-029e-4eb3-91ec-de79675d3917
Vipin-28/CP-Concepts
Graphs and Trees/11LCA-tree.cpp
#include<bits/stdc++.h> using namespace std; const int N = 1e5+10; vector<int> g[N]; int par[N]; //it will store the parent of all the nodes // parent array se we can find the lca void dfs(int vertex, int p=-1){ par[vertex] = p; for(int child : g[vertex]){ if(child == p)continue; dfs(child, ...
ALGO
0.999983
4.318587
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-07-12T05:14:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "310734473d73...
6a2e65bc-1151-474f-9338-62a0592b9c1d
gzshawnliang/competitive-programming
myCpps_2020/USACO_FencedIn_2016FebGold_Prob3/fencedin2.cpp
#include <algorithm> #include <iostream> #include <vector> using namespace std; int A, B, N, M; int nd(int r, int c) { return r * M + c; } int P[2010 * 2010]; int find(int x) { return x == P[x] ? x : P[x] = find(P[x]); } bool merge(int x, int y) { int X = find(x); int Y = find(y); if (X == Y) ...
ALGO
0.999995
3.32026
{ "github_metadata": { "branch": "master", "commit_count": 1963, "repo_created_at": "2019-01-17T06:33: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": "88ed47c...
446eb0a0-3ef6-42f0-b913-335d144e23ce
GilgameshxZero/rain
include/rain/algorithm/miller-rabin.hpp
#pragma once #include "../random.hpp" #include "bit-manipulators.hpp" #include "modulus-field.hpp" namespace Rain::Algorithm { // Miller-Rabin helper. template <typename Integer> inline bool isMaybePrimeMillerRabinInner( Integer const &N, Integer const &A, std::size_t const lsb, Integer const &truncated) {...
ALGO
0.997727
7.349452
{ "github_metadata": { "branch": "master", "commit_count": 184, "repo_created_at": "2020-02-07T18:50:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "783fc62e...
58679539-5c9d-466a-ae43-c0a4da173dd5
KaiDD27/IOI2024
cses/Dynamic Programming/Coin Combinations IIS3.cpp
// 空间优化 #include <array> #include <iostream> #include <vector> using namespace std; using ll = long long; #define endl '\n' const ll MOD = 1e9 + 7; vector<vector<int>> dp; vector<int> coin; int main() { ios::sync_with_stdio(false); // Fast I/O cin.tie(nullptr); // Not safe to use cin/cout & scanf/printf together ...
ALGO
0.999988
4.67391
{ "github_metadata": { "branch": "main", "commit_count": 319, "repo_created_at": "2024-01-18T01:14:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ea6168a583...
5475eeb5-de92-4232-ad6a-1f0182be4547
maahirai/atcoder_solver
abc166/c.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; using vll=vector<ll>; using vvll=vector<vll>; using vi=vector<int>; using vvi=vector<vector<int>>; using vb=vector<bool>; using pii=pair<int,int>; using vpii=vector<pair<int,int>>; template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;retu...
ALGO
0.999978
3.248883
{ "github_metadata": { "branch": "master", "commit_count": 290, "repo_created_at": "2019-11-01T14:01: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": "47c581cb...
5d32379b-1944-4031-855a-40d69d1e924b
gatsjy/algorithm
Bakjoon/1261(알고스팟).cpp
#include<bits/stdc++.h> using namespace std; namespace _1261 { int dx[4] = { -1,0,1,0 }; int dy[4] = { 0,1,0,-1 }; int board[101][101]; int ch[101][101]; int n, m; int main() { cin >> n >> m; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { int n; scanf_s("%1d", &n); board[i][j...
ALGO
0.999962
3.377257
{ "github_metadata": { "branch": "master", "commit_count": 444, "repo_created_at": "2020-09-12T02:55: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": "e6ec7820...
71e19062-8f32-4218-a681-1f0ffd6a7f38
Ihtml/PAT
2024/DFS/demo2.cpp
// Q:给定n个整数(可能有负数),从中选择k个数,使得这k个数之和恰好等于一个给定的整数X // 如果有多种方案,选择平方和最大的方案 #include <iostream> #include <vector> using namespace std; const int maxn = 30; // 序列A的n个数中选k个数使得和为x,最大平方和为maxSumSqu int n, k, x, maxSumSqu = -1, A[maxn]; vector<int> temp, ans; // temp存临时方案,ans存最终方案 void DFS(int index, int nowK, int sum, int sumSqu...
ALGO
0.999875
4.087599
{ "github_metadata": { "branch": "master", "commit_count": 671, "repo_created_at": "2020-01-16T12:38:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 8 }, "file_meta": { "content_id": "d33dbbb4...
3f733b10-b701-4b20-b7af-dacfcf999fe1
jsh6269/arduino-processing
arduino/24_RCcar/RCcar.ino
#include <Servo.h> int A_1A = 6, A_1B = 11, B_1A = 3, B_1B = 5; //PWM -> Analog출력을 위해서 int trig = 8, echo = 9; int servoPin = 10; Servo servo; int motorASpeed = 150, motorBSpeed = 150; //모터 속도를 (같게...?)조절하기 위해서, 0~255 void setup() { Serial.begin(9600); pinMode(A_1A, OUTPUT); pinMode(A_1B, OUTPUT); pinMode(B_1A, ...
TOOL
0.992886
4.577945
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-04-11T14:11:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f7e6f2d12299...
d234222d-6e8e-470a-a899-d990c302bd7e
yapkm01/cpp-primer
chapter12/12_27.cc
#include "include/12_27.h" #include <sstream> #include <algorithm> using namespace std; TextQuery::TextQuery(ifstream& ifs) : input(new vector<string>) { LineNo lineNo{0}; for (string line; getline(ifs, line); ++lineNo) { input->push_back(line); istringstream line_stream(line); for (str...
TOOL
0.948187
4.273947
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2023-06-02T23:14: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": "4ff597728...
da695342-d655-412c-a58d-34e806e471be
qnano/photonpy
cpp/SMLMLib/Zernike.h
// Zernike coefficients // // photonpy - Single molecule localization microscopy library // © <NAME> 2018-2021 #pragma once #include "DLLMacros.h" #include "palala.h" #include "MathUtils.h" #include "CudaUtils.h" template<typename T> PLL_DEVHOST T ZernikeRadial(T rho, int n, int m) { if ((n - m) % 2 != 0) return 0...
ALGO
0.985434
5.918681
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2021-03-30T19:02:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "29faf3ca66...
c2a7f37a-614a-4d98-a450-9b310abc1494
toufu-24/AtCoder
MCC/2023_09_04/6.cpp
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define all(v) v.begin(), v.end() #define sort(v) sort(v.begin(), v.end()) #define reverse(v) reverse(v.begin(), v.end()) #define ll int64_t #define ld long double int main() { int N, K, L; cin >> N >> K >> L; ve...
ALGO
0.999966
4.576202
{ "github_metadata": { "branch": "main", "commit_count": 303, "repo_created_at": "2023-04-15T10:40: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": "69e9205747...
919802e8-cdfa-4f9e-bb67-ba8489c98fdd
2261819266/code_old
NOIP2022/answers/FJ-155/barrack/barrack.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long const int MAX=1e6+10,mod=1e9+7; int n,m,ans,res,flag; int head[MAX],tot,to[MAX<<1],nxt[MAX<<1]; struct node{ int x,y; }e[MAX]; int cnt[10][10],bing[MAX],vis1[MAX],vis2[MAX]; int ok[MAX]; int fa[MAX],sum,sum2; inline int read(){ int x=0,f=1; char ch=get...
ALGO
0.999968
3.854457
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2023-01-29T12:39: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": "4f10a38b90...
3f424bc2-5610-4ae4-b66e-5e866b7f88bf
nhhoang14/CodePTIT_Source
CodePTIT - CPP/CPP0526.cpp
//https://code.ptit.edu.vn/student/question/CPP0526 //TRẺ NHẤT – GIÀ NHẤT #include <bits/stdc++.h> using namespace std; typedef long long ll; struct Nguoi{ string name; string date; }; void nhap(Nguoi &x){ cin >> ws; cin >> x.name >> x.date; } bool cmp(Nguoi a, Nguoi b){ int d1, m1, y1, d2, m2, ...
ALGO
0.999525
3.160887
{ "github_metadata": { "branch": "main", "commit_count": 646, "repo_created_at": "2024-04-19T11:42:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "427d2652bd...
f6692ed4-2a3f-485f-858c-ab486ed2fac9
Ivan2001otp/DSA
Div1-Practice/B_array_reordering.cxx
#include <bits/stdc++.h> using namespace std; typedef long long ll; void solve() { ll N; cin >> N; vector<ll> v(N); for (int i = 0; i < N; i++) { cin >> v[i]; } sort(v.begin(), v.end(), [](const ll &a, const ll &b) { return a % 2 < b % 2; }); ll c = 0; for (ll i ...
ALGO
0.999754
4.165311
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2025-05-23T16:30:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "faf0060ba75...
831d6620-4b8e-48cc-92b7-8a066e979718
youetsux/blb_Shadow_manager
Terrain.cpp
#include "Terrain.h" #include <random> #include "Engine/direct3d.h" #include "Engine/Texture.h" #include <d3d11.h> #include <DirectXTex.h> #include "Engine/Camera.h" using namespace DirectX; void Terrain::Update() { } void Terrain::MakeHalfPipeTerrain() { vertices_.clear(); indices_.clear(); const int...
TOOL
0.90035
4.644371
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2025-07-15T09:30:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "808c6a76fd...
6b268848-85b6-4eeb-8856-440a3e5f8263
Squareless-XD/2023Spring-UCAS-DS-Group-Work
hw/10/10-39.cpp
// 10.39 有序序列归并 // Description // 已知两个有序序列 (a_1, a_2, ... , a_m) 和 (a_{m+1}, a_{m+2}, ... , a_n),并且其中一个序列的记录个数少于s, s=\ceil{\sqrt{n}}。试写一个算法,用 O(n) 时间和 O(1) 附加空间完成这两个有序序列的合并。 // 提示:有大样例,请严格按照时间复杂度来。 // Input // 输入为两行,每行为一个有序序列,序列内的数字用空格隔开。 // Output // 排序后的序列,序列内的数字用空格隔开 // Sample Input 1 // 1 3 5 // 2 4 // Sample Ou...
ALGO
0.999955
5.183412
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2023-06-02T10:38:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "726e9b32ace...
1c6a3dcc-c53c-4ed0-95f1-db1e78291aca
abhiXsliet/Solved-DSA-Problems
Leetcode Daily Challenge/016-October-2024/005-permutation-in-string.cpp
// https://leetcode.com/problems/permutation-in-string/ #include <bits/stdc++.h> using namespace std; class Solution { public: // TC : O(M + N) Where M = length of s1 & N = length of s2 // SC : O(26) bool checkInclusion(string s1, string s2) { int m = s1.length(); int n = s2.length(); ...
ALGO
0.999968
6.330215
{ "github_metadata": { "branch": "main", "commit_count": 2156, "repo_created_at": "2023-07-29T13:17:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f6b624de...
67ff51bf-0335-42aa-a7e6-6fec4c70413e
Vinayak02/OS
Disk_Scheduling/sstf.cpp
#include<iostream> #include<vector> #include<map> #include<algorithm> using namespace std; int main() { cout<<"Enter the number of tracks in request queue : "; int n, i, j; cin>>n; vector<int> t(n); cout<<"Enter the track numbers : "; for(i = 0; i < n; i++) cin>>t[i]; cout<<"Enter the source track : "; int sr...
ALGO
0.999851
3.63019
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-02-20T11:51: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": "280d556eee...
fc7c6e75-219f-4109-954e-4daca51781eb
mzy8329/gazebo_crp450
PX4-Autopilot/src/modules/ekf2/EKF/airspeed_fusion.cpp
/**************************************************************************** * * Copyright (c) 2015 Estimation and Control Library (ECL). All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: ...
ALGO
0.996059
7.247759
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-12-18T13:58:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "0771b29e4b...
5ab07eaf-9c4d-424d-9a7a-0a613aa4b64d
sseoheo/seoheo-s-boj
백준/Bronze/2609. 최대공약수와 최소공배수/최대공약수와 최소공배수.cc
#include <iostream> using namespace std; /* int main() { cin.tie(0); ios_base::sync_with_stdio(false); int nbr_1, nbr_2, GCF, LCM; // 최대공약수 : Great Comomon Factor, 최소공배수 : Least Common Multiple; cin >> nbr_1 >> nbr_2; if (nbr_1 >= nbr_2) { GCF = nbr_2; LCM = nbr_1; } ...
ALGO
0.999988
5.066197
{ "github_metadata": { "branch": "main", "commit_count": 233, "repo_created_at": "2023-07-07T08:34: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": "7cbb0b6f5b...
110bb97f-bec8-41e5-8cb7-3c745d4c1e73
basilebru/ft_containers
list/main_list.cpp
#include "list.hpp" #include <iostream> #include <list> #include <cmath> // fabs #ifndef STD # define NAMESPACE ft #else # define NAMESPACE std #endif using namespace NAMESPACE; void displaylst(list<int> lst) { list<int>::iterator it = lst.begin(); while (it != lst.end()) { std::cout << *it << st...
TEST
0.956793
5.709749
{ "github_metadata": { "branch": "master", "commit_count": 133, "repo_created_at": "2021-01-04T08: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": "b35e49eb...
fc57e8c0-5eed-430c-886b-d6f7982fc679
jesand/lloe
include/ogt/embed/dist.hpp
/// @file dist.hpp /// @brief Declarations for embedding methods using pairwise distances #pragma once #ifndef OGT_EMBED_DIST_HPP #define OGT_EMBED_DIST_HPP #include <ogt/config.hpp> #include <Eigen/Dense> namespace OGT_NAMESPACE { namespace embed { /// Produce an embedding of the specified dimensionality from the...
ALGO
0.994982
7.157873
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-05-13T18:34:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "93aa69a28d...
4fab35a9-5b80-44cf-a5b4-669cf09acfdb
yash0530/Competitive-Programming
02 CONTESTS/Codeforces/ED74/B.cpp
#include <bits/stdc++.h> typedef long long int ll; #define deb(x) cout << #x << " => " << x << endl using namespace std; int main() { ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll q; cin >> q; while (q--) { ll n, r; cin >> n >> r; set<ll> s; for...
ALGO
0.999819
4.868379
{ "github_metadata": { "branch": "master", "commit_count": 89, "repo_created_at": "2019-12-15T06:50:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 20, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "72fbb18c...
09c3cd03-ebd0-4ca1-ba10-9b71884a1355
skaersoe/TrackingPositrons
Simulation/src/Simulator.cc
#include <iostream> #include <thread> #include <cassert> #include "Simulation/Simulator.hh" #include "Simulation/PropagateGPU.cuh" #include "Geometry/Library.hh" #include "Simulation/GetTime.hh" namespace na63 { Simulator::Simulator(void) : Simulator::Simulator(nullptr) { geometry = new Geometry(); external_...
TOOL
0.907507
5.701558
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2013-02-16T19:52:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 26, "pull_requests": 0 }, "file_meta": { "content_id": "b20e7a77...
3735adc2-9ef3-48d6-8519-f39b6fb2dfef
spudfkc/school-projects
EECS1580-01/EECS1580_assign_01.cpp
#include "stdafx.h" #include <iostream> #include <fstream> #include <sstream> #include <string> #include <iostream> #include <algorithm> #include "SymbolTable.h" #include "LinkedList.h" using namespace std; //SymbolTable *root = NULL; LinkedList mylist; void parse(string line) { int value; string svalue; ...
ALGO
0.985165
3.639419
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2013-08-26T03:31: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": "47cb7940d7...
aa82d9e6-9a95-4658-b33d-95502609509d
prashant-th18/Coding-Begins
EDU-122/C.cpp
#ifdef LOCAL #define _GLIBCXX_DEBUG #endif // #pragma GCC optimize("O3") // #pragma GCC target("popcnt") #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; using namespace std; #define MOD 1000000007 typedef long long ll; typed...
ALGO
0.999874
3.324849
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2021-11-20T20:28:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4b2c59ad0...
b4c72f68-95eb-4c7a-9088-855295d55a64
Vtuzhilkin/Algorithms
Algorithms/6.F.B Railways.cpp
//https://contest.yandex.ru/contest/25070/run-report/114517555/ // Принцип работы // Принцип работы данного алгоритма основан на поиске циклов в графе при помощи алгоритма обхода графа в глубину. // Можно заметить что если из города с номер N можно проложить черные и красные дороги в город M (так что N < M) и заменить...
ALGO
0.999965
5.237853
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-06-09T09:30: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": "3220a736e3f3...
e4af11da-6fe1-4793-9f74-06ec1ee7857b
y761823/ACM-code
HDOJ/p4064.cpp
////////////////////System Comment//////////////////// ////Welcome to Hangzhou Dianzi University Online Judge ////http://acm.hdu.edu.cn ////////////////////////////////////////////////////// ////Username: y761823 ////Nickname: Oyk ////Run ID: ////Submit time: 2014-08-30 21:54:57 ////Compiler: GUN C++ /////////////////...
ALGO
0.999921
3.944247
{ "github_metadata": { "branch": "master", "commit_count": 598, "repo_created_at": "2015-05-11T15:21: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": "0229d202...
565145c9-07c5-4453-9231-40e28fd96492
rethinkdb/rethinkdb
src/btree/get_distribution.cc
// Copyright 2010-2014 RethinkDB, all rights reserved. #include "btree/get_distribution.hpp" #include "btree/internal_node.hpp" #include "btree/node.hpp" #include "btree/leaf_node.hpp" #include "btree/parallel_traversal.hpp" #include "buffer_cache/alt.hpp" #include "utils.hpp" class get_distribution_traversal_helper_...
ALGO
0.997256
5.811674
{ "github_metadata": { "branch": "main", "commit_count": 33533, "repo_created_at": "2012-10-30T05:37:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 26905, "forks": 1851, "issues": 1346, "pull_requests": 8 }, "file_meta": { "content_id": ...
d8d99dd2-d483-4ddf-8e6f-0c46dec0b10a
Ldj-git/elice4-CodingTest7
이동준/3주차 이분탐색/[PGS] 43238.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; // [PGS] 43238. 입국심사 / 레벨 3 / 1시간 bool possible(long long t, long long n, vector<int>times){ //t분 이 가능한 시간인지 판별, 모든 심사관은 쉬지 않고 일해야됨 for(int i=0;i<times.size();i++) n-=t/times[i]; //t랑 n을 같은 longlong으로 안하면 int에대가 long을 빼는 경우...
ALGO
0.999787
4.771704
{ "github_metadata": { "branch": "main", "commit_count": 106, "repo_created_at": "2022-04-02T14:48:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b4140671ba...
01ab4714-a0eb-43d1-a5f4-36c581aa4d96
af1956831/GomezAngela_CSC5_40108
Homework/Assignment_3/Gaddis_8thEd_Chap4_Prob1_Minimum/main.cpp
/* File: main.cpp Author: <NAME> Created on January 15, 2017, 6:35 PM Purpose: Minimum/Maximum */ //System Libraries #include <iostream> using namespace std; //User Libraries //Global Constants //Such as PI, Vc, -> Math/Science values //as well as conversions from system of units to //another ...
ALGO
0.997706
3.966693
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2017-01-09T04:59: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": "67d6294593...
9894a34e-ba54-43b1-b263-49345af845dd
Aminul264/Codeforces_Problem_Sollutions
A. Nineteen.cpp
/* 0 0 1 0 STAY 0 1 2 3 2 1 0 HOME 0 1 2 3 4 5 4 3 2 1 0 0 1 2 3 4 5 6 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0 ...
ALGO
0.999907
3.582571
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-07-24T18:57: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": "2ff32c2e91...
79e246f1-d948-431f-9a9a-4d3c270b7f5f
ZulfahmiCP/Competitive-Programming-Recources
CodeForces/Div_3/Set_600/Round_629/E_Tree_Queries.cpp
#include <iostream> #include <functional> #include <unordered_set> #include <unordered_map> #include <algorithm> #include <assert.h> #include <climits> #include <cstring> #include <numeric> #include <iomanip> #include <vector> #include <string> #include <bitset> #include <array> #include <cmath> #include <queue> #inclu...
ALGO
0.999805
4.937285
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2023-12-22T06:44: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": "e753b98288a...
05bfa3fb-2d06-4dfd-a205-d0a3e114eae9
patellakshmi/CppCourse
leetcode/hard/MaxSumRect.h
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Created by <NAME> on 25/06/21. Copyright (c) 2021, Fight For Education Pvt. Ltd. All rights reserved. Please visit us: www.fight4edu.com or www.fight4edu.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ ...
ALGO
0.999944
6.107904
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2021-01-13T06:04: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": "17b68aa3680...
515df8f2-3cb0-465e-9b36-bc4ff08c43a8
sapirp/systemPrograming-task3B
solver.hpp
#include <iostream> #include <complex> namespace solver{ class RealVariable{ private: double a,b,c; bool power; public: RealVariable(){ a=0; b=1; c=0; power=false; } double solveEquation(RealVariable&); RealVariable& copy(RealVariable&...
ALGO
0.977245
3.268189
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-05-07T09:37: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": "b406ff4d66...
1f271e58-105e-4234-942f-6534ec4b365e
n-inja/kyoupro
src/other/div1h.cpp
#include <algorithm> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <set> #include <stdio.h> #include <string> #include <vector> using namespace std; struct Edge { int a, b; int cost; }; struct Node { int now, time; int walk; }; bool operator<(const Node ...
ALGO
0.999807
3.162335
{ "github_metadata": { "branch": "master", "commit_count": 468, "repo_created_at": "2017-07-18T01:13: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": "a50857e4...
111110f8-2590-4bd4-92b0-a891ae8c91c2
snowdrop4/Roguelike
src/StringUtils.cpp
#include "StringUtils.hpp" #include <algorithm> #include <sstream> #include <iomanip> std::string move_up_dir(const std::string &filePath) { std::string path = filePath; do { path.erase(path.end() - 1); } while (path.back() != '/'); return path; } // -------------------------------------------------------...
TOOL
0.928345
6.352991
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2022-07-17T22:26: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": "07de8117d5...
e04203d2-b095-41af-9815-814a712b0bb1
PoojaB01/CSES-Solutions
SortingandSearching/MovieFestival.cpp
// https://cses.fi/problemset/task/1629 #include <bits/stdc++.h> using namespace std; #define lli long long void solve() { int n; cin >> n; vector<pair<int, int>> v; int a, b; for (int i = 0; i < n; i++) { cin >> a >> b; v.push_back({a, b}); } sort(v.begin(), v.end())...
ALGO
0.999971
4.436041
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2020-12-19T19:41: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": "15ab5d64165...
ff78df12-e9c3-4f5f-a181-0b4c1f20b040
bcmapp/bcm-server
src/limiters/distributed_limiter.h
#pragma once #include <boost/thread/shared_mutex.hpp> #include "configuration_manager.h" #include "limiter.h" #ifdef UNIT_TEST #define private public #endif namespace bcm { class DistributedLimiter : public ILimiter, public Observer<LimiterConfigUpdateEvent> { public: DistributedLimiter(...
TOOL
0.90399
6.352533
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-03-05T08:28:58.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8, "forks": 13, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f9a3a6c576...
bafde434-b1da-4f1f-8f5a-6e68cde8cc96
bjbjkidrock/LeetCode-1
Algorithms/expressive-words.cpp
809. Expressive Words https://leetcode.com/problems/expressive-words/ Sometimes people repeat letters to represent extra feeling, such as "hello" -> "heeellooo", "hi" -> "hiiii". Here, we have groups, of adjacent letters that are all the same character, and adjacent characters to the group are different. A group is ...
ALGO
0.999635
5.35651
{ "github_metadata": { "branch": "master", "commit_count": 2420, "repo_created_at": "2019-04-03T19:49:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "56d09fe...
71663e66-914a-4999-b329-7014fac3edbf
sgc109/algorithm_practice
codejam20092A.cpp
// #include <bits/stdc++.h> #include <set> #include <map> #include <cmath> #include <stack> #include <queue> #include <cstdio> #include <vector> #include <cstring> #include <utility> #include <iostream> #include <algorithm> #define pb push_back #define sz(v) ((int)(v).size()) #define all(v) (v).begin(), (v).end() using...
ALGO
0.999544
3.72612
{ "github_metadata": { "branch": "master", "commit_count": 61, "repo_created_at": "2018-05-18T14:57: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": "764c1212c...
4c31241f-ef9a-4768-9334-85089f0ab49c
OI-wiki/OI-wiki
docs/string/code/trie/trie_3.cpp
#include <iostream> using namespace std; constexpr int _ = 5e5 + 10; namespace trie { constexpr int _n = _ * 25; int rt[_]; int ch[_n][2]; int w[_n]; //`w[o]` 指节点 `o` 到其父亲节点这条边上数值的数量(权值)。 int xorv[_n]; int tot = 0; void maintain(int o) { // 维护w数组和xorv(权值的异或)数组 w[o] = xorv[o] = 0; if (ch[o][0]) { w[o] += w[c...
ALGO
0.999945
4.635146
{ "github_metadata": { "branch": "master", "commit_count": 12101, "repo_created_at": "2018-07-11T03:28:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 23612, "forks": 4310, "issues": 112, "pull_requests": 9 }, "file_meta": { "content_id":...
8303d50a-70c7-4d87-b63e-97a2adb2c1a7
leeqviz/some-encryption-algorithms
Geffe.cpp
#include <iostream> #include <bitset> #include "Geffe.hpp" using namespace std; string LFSR1key, LFSR2key, LFSR3key, Geffe_key; string LFSR1encryption(string buf) { bitset<23> initBits(buf.substr(0, 23)); for (size_t i = 0; i < buf.length(); i++) { if (initBits[22] == 1) LFSR1key += "1"; else LFSR1key += "0"; ...
ALGO
0.9999
3.70038
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-11-03T18:40: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": "73d078ad928...
c9fa2080-fa39-4755-a770-d95e24d410e7
virtuosoo/leetcode
leetcode/2003.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: vector<int> smallestMissingValueSubtree(vector<int>& parents, vector<int>& nums) { unordered_set<int> vis; int n = parents.size(); vector<int> ans(n, 1); vector<int> g[n]; auto it = find(nums.begin(), nu...
ALGO
0.999938
5.43782
{ "github_metadata": { "branch": "main", "commit_count": 186, "repo_created_at": "2021-09-10T03:44: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": "857f499fc9...
f15be969-54f7-4c8d-aead-3ab0ff297630
mxr612/OI-log
ybtoj/2020.09.19B/C/sequence.cpp
/** * ybtoj2020.09.19B * C sequence 波动序列 */ #define MXN (100020) #include <stdio.h> #include <map> int n, t; int A[MXN], B[MXN], C[MXN]; std::map<int, int> map; int tot; class preSZS { int arr[MXN * 3]; public: void insert(register int x, register int w) { while (x <= tot && arr[x] < w) arr...
ALGO
0.999973
4.07828
{ "github_metadata": { "branch": "master", "commit_count": 390, "repo_created_at": "2019-10-31T10:28:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0dc1c8f6...
78053233-ecd3-4765-8ff9-bd8218b08a50
kamyu104/LeetCode-Solutions
C++/surrounded-regions.cpp
// Time: O(m * n) // Space: O(m + n) class Solution { public: void solve(vector<vector<char>>& board) { if (board.empty()) { return; } queue<pair<int, int>> q; for (int i = 0; i < board.size(); ++i) { if (board[i][0] == 'O') { board[i][0] = ...
ALGO
0.999785
6.854276
{ "github_metadata": { "branch": "master", "commit_count": 19395, "repo_created_at": "2018-10-11T17:38:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4939, "forks": 1616, "issues": 1, "pull_requests": 55 }, "file_meta": { "content_id": ...
ceaa38b2-bf31-46ad-ba97-11d6c610d7bc
jingtao2/parallel-minesweeper
csp_ver2.cpp
#include <stdio.h> #include <stdlib.h> #include <string> #include <time.h> #include <deque> #include <tuple> #include <vector> #include <iostream> #include <fstream> #include <algorithm> #include <iterator> #include <map> #include <random> #include <math.h> #include <bitset> #include <omp.h> using namespace std; int ...
ALGO
0.999759
3.534097
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2022-03-31T19:44: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": "4d5a4727c1e...
04c7256f-6bbe-40f8-a973-e3db7e75ef0f
Saieiei/Leetcode
0104-maximum-depth-of-binary-tree/0104-maximum-depth-of-binary-tree.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.999799
5.355968
{ "github_metadata": { "branch": "main", "commit_count": 2040, "repo_created_at": "2023-12-12T16:36:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b33f31005...
d371492e-5c82-4a82-99b9-71937cf0e669
Shibabrat/Tutorials
30-days-code/class-instance.cpp
#include <iostream> using namespace std; class Person{ public: int age; Person(int initialAge); void amIOld(); void yearPasses(); }; Person::Person(int initialAge){ // Add some more code to run some checks on initialAge if ( initialAge >= 0 ) age = initialAge; else if ( initialAge...
ALGO
0.999286
4.822951
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2017-09-26T16:53: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": "434181fb15...
322b82ac-02f5-491c-89dd-1aba0ac6964e
bcgsc/abyss
Common/SuffixArray.h
#ifndef SUFFIXARRAY_H #define SUFFIXARRAY_H 1 #include "ConstString.h" #include "ContigNode.h" #include <algorithm> #include <cassert> #include <utility> #include <vector> /** A suffix array augmented with a mapped value type. */ class SuffixArray { public: typedef cstring key_type; typedef ContigNode mapped_type...
ALGO
0.937524
6.028178
{ "github_metadata": { "branch": "master", "commit_count": 5566, "repo_created_at": "2012-03-19T23:13:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 322, "forks": 110, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "01c2...
9638b25b-f9e4-4391-becd-88c782e6cb0c
shin0park/Algorithm-Problems
algorithm/c++/candy.cpp
//실행시 g++ 파일이름 ./a// #include <iostream> #include <stdio.h> #include <string.h> #include <string> #include <stack> #include <vector> #include <queue> #include <algorithm> using namespace std; char place[50][50] ={0}; int n = 0; vector<int> candy; int maxCandy(); void brute (int x,int y); int main (){ cin >> n; ...
ALGO
0.999952
3.695491
{ "github_metadata": { "branch": "master", "commit_count": 176, "repo_created_at": "2020-08-17T06:18: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": "dae99e1a...
392b5990-2bd1-48e5-9970-0679421ca08c
firewood/topcoder
atcoder/agc_033/b.cpp
#ifdef __GNUC__ #pragma GCC diagnostic ignored "-Wunused-result" #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #endif #include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <sstream> #include <numeric> #include <map> #include <set> #include <q...
ALGO
0.999856
4.233801
{ "github_metadata": { "branch": "master", "commit_count": 4451, "repo_created_at": "2011-04-18T02:33:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 20, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7996e7...
bfc210ee-9e74-486f-832f-00406f2fdcc1
ishandutta2007/codeforces-k
karuna/normal/1530/D.cpp
#include <bits/stdc++.h> #define va first #define vb second using namespace std; typedef long long lint; typedef pair<int, int> pint; const int M = 2e5 + 10; int n, A[M], Chk[M], B[M], C[M]; void solve() { cin >> n; for (int i = 1; i <= n; i++) cin >> A[i]; for (int i = 1; i <= n; i++) { Chk[i] = ...
ALGO
0.99998
3.806927
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a00f8e7c7436...
fe5645db-909e-4c3a-ac97-9742c6673619
J3SUNG/Algorithm
BOJ/1000~9999/2941_크로아티아_알파벳/2941_크로아티아_알파벳.cpp
#include <iostream> #include <cstring> #include <algorithm> #include <string> using namespace std; int main(int argc, char *argv[]) { int count = 0; int chk[110]; string arr[8] = {"c=", "c-", "d-", "lj", "nj", "s=", "z=", "dz="}; string s; memset(chk, 0, sizeof(chk)); cin >> s; for (int i = 0; i < s.l...
ALGO
0.99962
3.381395
{ "github_metadata": { "branch": "master", "commit_count": 777, "repo_created_at": "2021-01-01T05:08:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "af10d18d...
fbb46d16-9499-4d13-b07d-320e52917003
yanhuanwang/interview
leetcode-master/WordLadder/WordLadder.cpp
//============================================================================ // Word Ladder // Given two words (start and end), and a dictionary, find the length of // shortest transformation sequence from start to end, such that: // // Only one letter can be changed at a time // Each intermediate word must exist in...
ALGO
0.998914
5.771863
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2015-07-22T15:10:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e4c30bf8a2...
e98990e4-17df-48c9-87b3-8bedc89a8d88
nuhdev125/DSA-115
linklist.cpp
#include "linkedlist.h" #include <iostream> using namespace std; node* createList(int num) { node* head = new node; head->val = 1; head->next = NULL; node* currNode = head; for (int i = 1; i < num; ++i) { node* newNode = new node; newNode->val = i + 1; newNode->next = NULL...
ALGO
0.99874
5.761672
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-27T01:40: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": "cdb88a76e7af...
3298a327-4959-4c96-b82b-63306505b96d
ananda741/Leetcode
medianof_stream.cpp
#include<iostream> #include<vector> using namespace std; vector<int> stream; int find_pos(vector<int> &arr,int start,int end,int target){ int mid; while(start <= end){ mid = (start+end)/2; if(arr[mid] == target) return mid; else if(a...
ALGO
0.999973
4.931548
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-04-17T09:00: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": "caa21cff21...
ae955042-3ac1-42d3-a817-20688997c2fa
daviscoder/Leetcode_2016_Pass1
85. Maximal Rectangle.cpp
class Solution { public: int largestRectangleArea(vector<int>& heights) { if (heights.size() == 0) return 0; stack <int> S; int res = 0; for (int i = 0; i < heights.size(); i++) { if (S.empty() || heights[S.top()] <= heights[i]) S.push (i); els...
ALGO
0.999623
6.091032
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2016-08-20T06:41:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "77f62b57d6...
a1100c63-a1cf-4c67-b24a-28afff5187a1
pranaymarella/Data-Structures-And-Algorithms
check_brackets_in_code/check_brackets.cpp
#include <iostream> #include <stack> #include <string> #include <fstream> using std::cin; using std::cout; struct Bracket { Bracket(char type, int position): type(type), position(position) {} bool Matchc(char c) { if (type == '[' && c == ']') return true; if (t...
ALGO
0.99931
4.442563
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-08-01T19:27: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": "c6ace0f3ed...
5d1fe478-1ed5-4e20-82a0-f08dd75697c3
wilkinsonbr/INFO450Pig
ConsoleApplication8/ConsoleApplication8.cpp
//The point of this program is to take words (or random letters) and translate // them into pig latin. Following a set of predefined rules. //It does this by gathering the word in the main() function // checking to see if the word fits the criteria given to us // Then it sends the word to another function and that fuct...
TOOL
0.900036
3.480961
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2017-10-10T20:21: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": "07fe9c7aed...
61d8ae1d-3e8e-4550-9bbf-8bcf96ad62fd
harpolea/LSMLIB
src/parallel/BoundaryConditionModule.h
/* * File: BoundaryConditionModule.h * Copyrights: (c) 2005 The Trustees of Princeton University and Board of * Regents of the University of Texas. All rights reserved. * (c) 2009 <NAME>. All rights reserved. * Revision: $Revision$ * Modified: $Date$ * Description: H...
ALGO
0.989267
4.898732
{ "github_metadata": { "branch": "master", "commit_count": 218, "repo_created_at": "2015-04-17T13:44:51.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "velexi-research/LSMLIB", "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "con...
3d0cdde5-cf4f-46d3-914b-1383aadc1353
yqtaowhu/DataStructureAndAlgorithm
programming/string/151.翻转字符串里的单词.cpp
/* * @lc app=leetcode.cn id=151 lang=cpp * * [151] 翻转字符串里的单词 */ // @lc code=start // 简单的O(N)空间复杂度算法 class Solution { public: string reverseWords(string s) { // 换一种思路,从右到左倒叙, 空间复杂度O(N) int i = s.size() - 1; string res = ""; while(i >=0) { while(i >= 0 && s[i] == ' ')...
ALGO
0.99995
6.245571
{ "github_metadata": { "branch": "master", "commit_count": 217, "repo_created_at": "2016-07-22T11:31:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 21, "forks": 26, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b8a7f9...
f7797d1a-156d-48cd-9dec-f87b431c551a
GloserPunas/Triangle
main.cpp
#include <iostream> using namespace std; void checkTriangle (double a, double b, double c){ if (a <= 0 || a > 100 || b <= 0 || b > 100 || c <= 0 || c > 100) { cout << "input khong hop le" << endl; } else { if (a + b > c && a + c > b && b + c > a) { cout << "Day la 3 canh cua mot tam...
ALGO
0.981812
3.641249
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-01T03:14: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": "f7634f5c1d17...
a03b8491-3783-457c-8ecb-3508461f99a0
ishandutta2007/codeforces-s
sergeyrogulenko/normal/140/F.cpp
#pragma comment(linker, "/STACK:60000000") #define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <string> #include <set> #include <map> #include <ctime> #include <cstring> #include <cassert> #include <sstream> #include <iomanip> #include ...
ALGO
0.999763
3.185964
{ "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": "906d6d808652...