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
408738c2-5514-46b7-be8b-c9a1c2d8bb29
FinalTheory/ACM_Code
HDU/HDU_1501.cpp
/** * @file HDU_1501.cpp * @brief 求前两个字符串能否组成第三个字符串,要求是前两个字符串中的字符按照顺序出现 * @hint 记忆化搜索,但是需要记录扩展过的状态:这里使用i、j、k记录三个指针的指向; * 但是需要注意的是,由于i + j = k,所以其实i、j已经能够表示所有的状态, * 所以开个二维dp数组做记忆化搜索就可以了。一直尝试搜索到结果串终点。 * @feeling 算是初步认识一下记忆化搜索吧,以前一直是把这个当作剪枝的。 * @author FinalTheory * @version 1.0 * @date 2014-03-18 *...
ALGO
0.999934
4.025783
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2013-04-16T10:51:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "15c0c3227...
efdb8f7e-9538-4c90-9fb1-e807a46f4788
Dani-Bustos/Algo3-TecnicasA
P2: Div&Conquer/PotenciaLogaritmica.cpp
#include<bits/stdc++.h> #define fore(i,a,b) for(int i = a; i<b;i++) typedef long long ll; using namespace std; const long long INDEF = -1; //Idea: Vamos a explotar que : a^b = (a^(b/2))^2 si el b es impar usamos que a*a^(b-1) = a^b //dado que a es fijo, tomamos que solo importa el b //complejidad : T(b) = Θ(1) + T(b/...
ALGO
0.999967
4.67571
{ "github_metadata": { "branch": "main", "commit_count": 129, "repo_created_at": "2024-03-22T02:18:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5040cae820...
7146d301-f7a9-488d-b15e-a311a81f4875
tan45Nadim/Data-Structures-Algorithms
Graph-Theory/grid_implementation_01.cpp
#include <iostream> #include <queue> using namespace std; int grid[8][8]; bool visited[8][8]; int level[8][8]; void Initialize() { for(int i=0; i<8; i++) { for(int j=0; j<8; j++) { level[i][j] = {0}; visited[i][j] = {false}; } } } struct node{ int x; int y; }; ...
ALGO
0.999927
4.467161
{ "github_metadata": { "branch": "main", "commit_count": 95, "repo_created_at": "2022-09-26T11:16:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9846a89801e...
90ecee78-260d-44ef-9d9c-5f78636e1416
hugoduar/CP
Reference/Structures/sparsetable.cpp
#include <bits/stdc++.h> using namespace std; #define MAX 100010 #define K_MAX 17 int table[MAX][K_MAX]; int A[MAX]; int N; int K; void build(){ memset(table, -1, sizeof table); for (int i = 0; i < N; ++i) table[i][0] = A[i]; for (int j = 1; j <= K ; j++){ for (int i = 0; i <= N - (1 << j); ++i){ table[i][...
ALGO
0.999969
4.142229
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-04-28T08:24:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c9f935d1a8...
434d0f6e-fb1e-4fff-a267-84669f725607
tiqwab/atcoder
agc043/a/main.cpp
#include <algorithm> #include <cassert> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #include <limits.h> using namespace std; typedef long long ll; template<class T> inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } ...
ALGO
0.99989
4.487275
{ "github_metadata": { "branch": "master", "commit_count": 236, "repo_created_at": "2019-10-21T04:57: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": "130584fa...
ffedbcb1-8ce2-472d-95c2-e775baf33863
Andwerpz/Competitive-Programming-Practice
- cpp -/maximaland.cpp
#include <bits/stdc++.h> typedef long long ll; using namespace std; //Codeforces 1669H //just greedily make the max bit 1. int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while(t-- > 0){ int n, k; cin >> n >> k; vector<int> a(n); ...
ALGO
0.999924
4.384238
{ "github_metadata": { "branch": "main", "commit_count": 339, "repo_created_at": "2021-02-26T19:38:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e0b9301ad5...
7251cd31-afd5-4d2a-9167-34d646175b73
hep-mirrors/POWHEG-BOX-V2-User-Processes
trijet/fastjet-addon.cc
// Jet algorithm with special features: // #include <iostream> #include <sstream> // needed for internal io #include <iomanip> #include "fastjet/ClusterSequence.hh" #include "fastjet/Selector.hh" #include "fastjet/tools/Filter.hh" #include "splitandfilt.hh" using namespace fastjet; using namespace std; //----------...
ALGO
0.985543
5.57193
{ "github_metadata": { "branch": "master", "commit_count": 980, "repo_created_at": "2021-06-15T19:32:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd8692fef...
a5b64b79-d1f2-4678-8d89-92a01d1cff82
attila-gpu/attila-sim
src/trace/utils/Parsers/ConstExtractor.h
/************************************************************************** * * Copyright (c) 2002 - 2011 by Computer Architecture Department, * Universitat Politecnica de Catalunya. * All rights reserved. * * The contents of this file may not be disclosed to third parties, * copied or duplicated in any form, in...
TOOL
0.902885
4.266399
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2015-03-15T20:32:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 36, "forks": 14, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "40544c64b...
2a6cc46e-e2fc-4ede-ad65-91083c4d67d0
stevenroach7/3DScanr
ThreeDScanner-iOS/Libraries/PCL/include/pcl-1.8/pcl/sample_consensus/impl/ransac.hpp
/* * Software License Agreement (BSD License) * * Point Cloud Library (PCL) - www.pointclouds.org * Copyright (c) 2009, <NAME>, Inc. * Copyright (c) 2012-, Open Perception, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted ...
ALGO
0.996942
7.477923
{ "github_metadata": { "branch": "master", "commit_count": 172, "repo_created_at": "2017-11-28T05:50:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 158, "forks": 36, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "8ec30...
0378ca5d-8acc-47fa-ab52-638f47b5a4ef
tbeckley/TEBsCode
CPlusPlus/Lab06/Lab0604.cpp
//********************************************* // Student Name: <NAME> // Student Number: 20703455 // // SYDE121 Lab: 06 Assignment: 04 // // Filename: Lab0604.cpp // Date submitted: 2017 - 10 - 19 // // I hereby declare that this code, submitted // for credit for the course SYDE121, is a product // of my...
ALGO
0.998047
4.796886
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2016-03-08T04:36: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": "1963bf7ad...
8afd0365-707e-4b69-ba73-8fd09ec4c274
11-pog/Tarefas_LPR
Trimestre_1/Aula_5/Exercicio_1/main.cpp
#include <iostream> using namespace std; int InputNum(const string Error_Log, bool Unsigned = false, bool AllowZero = true); int main() { cout << "Por favor entre com a quantidade de números que serão digitados: "; int NumberAmount = InputNum("Número inválido, tente novamente: " , true, false); cout << ...
ALGO
0.983086
4.300632
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2025-03-14T12:35: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": "154f8ab05...
34f8e1bd-41a9-47f5-86f0-9f2bc43d3c46
KiselevIvan/kidLibrary
examples/SignalProcessor/SignalProcessor.ino
/* SignalProcessor - Пример обработки сигналов с микрофона через RC-цепочки Автор: [<NAME>] Версия: 1.0.0 Дата: [23.01.2025] Описание схемы: ================= 1. Микрофон подключен к двум RC-цепочкам: - ФВЧ (Высокочастотный фильтр): Два конденсатора по 10 нФ последовательно-> A0 -> Резистор 1...
TOOL
0.9831
5.997199
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2025-01-22T21:59:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3a5929bfe9...
75bfc3ca-a476-4cc5-9b37-148d5202b519
minhnguyen1406/Discrete-RRT
src/scenario2.cpp
#include <iostream> #include <cmath> #include "CollisionChecking.h" #include "DRRT.h" #include <ompl/base/SpaceInformation.h> #include <ompl/base/spaces/RealVectorStateSpace.h> #include <ompl/base/SpaceInformation.h> #include <ompl/base/spaces/RealVectorStateSpace.h> #include <ompl/geometric/planners/prm/PRM.h> #incl...
ALGO
0.998351
5.403554
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2023-11-07T22:19:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1625dcffc39...
3b7d8bc2-bc7f-48e1-8b31-a98adca5a080
ishandutta2007/codeforces-s
sohsoh/normal/1382/C2.cpp
/* <NAME> I will change this text here when i've got "Candidate Master":) */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; #define all(x) (x).begin(),(x).end() #define X first #define Y ...
ALGO
0.999983
4.208955
{ "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": "637410434a47...
8358bb65-d2e1-4f53-b466-4d9132df6273
heyuhhh/ACM
contests/2019多校联合训练/杭电多校/第五场/hdu2019contest5/1010/AC.cpp
#include<cstdio> #include<cstdlib> #include<algorithm> #include<vector> #include<set> #include<assert.h> using namespace std; const int MAX_N = 50000; int n, b[MAX_N+1]; int stk_upper[MAX_N], stk_lower[MAX_N]; int sn_upper,sn_lower; vector<pair<int, int>> d[MAX_N * 2 + 1]; int used[MAX_N * 2 + 1]; bool check(vector<int...
ALGO
0.999818
3.560321
{ "github_metadata": { "branch": "master", "commit_count": 693, "repo_created_at": "2019-11-25T06:31:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "55bfb11b...
578941a4-a549-4c09-86f1-3df3dc796fb2
cheerconi/online-judge
codeforces/Codeforces Round #646/A. Odd Selection/main.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <ctime> #include <deque> #include <iostream> #include <list> #include <map> #include <memory.h> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <vector> #include <unordere...
ALGO
0.999975
3.70701
{ "github_metadata": { "branch": "master", "commit_count": 407, "repo_created_at": "2017-07-19T16:20:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b27e681e...
953df707-08c0-4521-9d89-61af95d8d6e5
farrel35/sdat
Cipher/hillcipher.cpp
#include<iostream> #include<iomanip> #include<math.h> using namespace std; float encrypt[3][1], decrypt[3][1], a[3][3], b[3][3], mes[3][1], c[3][3]; char msg[3]; void enkripsi(); void dekripsi(); void getMatriks(); void inverse(); int main() { getMatriks(); cout << "========================Enkripsi==============...
ALGO
0.9999
3.735657
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-12-26T15:46:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "11460e5313...
9d1bf2bd-ed54-476e-bc2a-82130cd318e3
evankersey/chaosEC3
main.cpp
// https://github.com/evankersey/chaosEC3 // Chaos_Game // 4/26/19 // <NAME> // // description: the chaos game creates pictures of text by jumping partway between a given set of points randomly // OUTPUT goes to output.txt // // example output is in the outputFiles folder // // Special Features. // classes, ...
ALGO
0.99058
4.250599
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2019-04-26T07:55:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8ebb2cd55...
57405260-5afb-46ad-a596-e7f60ffb0984
anandatul144/CG-18
core/interpolate-impl.h
#include "interpolate.h" #include "assert.h" namespace rt { template <typename T> T lerp(const T& px0, const T& px1, float xPoint) { return (px0*xPoint + (1-xPoint)*px1); } template <typename T> T lerpbar(const T& a, const T& b, const T& c, float aWeight, float bWeight) { ...
ALGO
0.972555
6.678386
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-11-10T18:30:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "100310784a...
7453cf8b-17b1-4d85-bca1-c5e6c5a78d6e
sdiluise/TShine
TShine/src/TSMinimizer.cc
/* * TSMinimizer.cc * * Created on: Aug 12, 2014 * Author: <NAME> * <EMAIL> * */ #include <TObject.h> #include <TObjArray.h> #include <TString.h> #include <TMath.h> #include <TGraph.h> #include <TMultiGraph.h> #include "MessageMgr.h" #include "TSParameter.h" #include "TSMinimizer.h" TSMinimizer...
ALGO
0.98006
3.942708
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2015-01-06T18:26:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "be360fe728...
7d7c3523-dcab-49d5-9fb5-c4b80357d1fa
KatsuyaKikuchi/ProgrammingContestCpp
AtCoder/ABC/245/E.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long int; using pll = pair<ll, ll>; #define FOR(i, n, m) for(ll i = (m);(i)<(n);++(i)) #define REP(i, n) FOR(i,n,0) #define OF64 std::setprecision(40) const ll MOD = 1000000007; const ll INF = (ll) 1e15; const long double PI = 3.14159265358979323846264338...
ALGO
0.999997
4.284739
{ "github_metadata": { "branch": "master", "commit_count": 101, "repo_created_at": "2021-08-31T02:11: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": "2f184e90...
a9483fef-c29b-4407-a585-3be491dcda57
TurtleShip/ProgrammingContests
Solutions/TopCoder/SRM_DIV2/SRM524_DIV2/Try2/ShippingCubes.cpp
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <c...
ALGO
0.999994
5.063544
{ "github_metadata": { "branch": "master", "commit_count": 106, "repo_created_at": "2014-04-19T08:12:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "4f32c089...
9f1109c8-649e-456c-864f-8bc2a7dbb630
winder/DSAnts
source/Creature.cpp
#include "Creature.h" // Include this here to avoid circular dependencies #include "GameWorld.h" Creature::Creature() { init(); } Creature::Creature(Patch* pat, int loc) { init(); location = loc; // what if pat already has 2 ants? ant pile on pat until they move outta the way I guess. p=pat; } void Creatu...
ALGO
0.978348
4.729657
{ "github_metadata": { "branch": "master", "commit_count": 135, "repo_created_at": "2009-09-10T20:40:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "08ed6218...
7763671b-de7a-4c14-85fb-7108984bef03
rahulbalaji13/PLACEMENT
DSA/CURICULLAM_CODING/Queue/cqueue.cpp
#include <iostream> #define MAX 100 // Define the queue limit using namespace std; class CQueue { private: int size; int front; int rear; int arr[MAX]; // Create array holds maximum memory of queue initially public: CQueue(int n) { front = -1; ...
ALGO
0.999259
5.528359
{ "github_metadata": { "branch": "main", "commit_count": 160, "repo_created_at": "2024-09-21T08:33: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": "b13a4c410e...
9584f8e5-6098-4a33-8a6c-c48b8ae182b0
kchanqvq/FTPResearchCV
FTPResearchCV/QTFFT.cpp
// // QTFFT.cpp // FTPResearchCV // // Created by HongQiantan on 2017/10/12. // Copyright © 2017年 ArcReactiveTech. All rights reserved. // #include "QTFFT.hpp" #include "pffft.h" #include <pthread.h> using namespace cv; typedef struct _fft_args{ PFFFT_Setup *setup; const float *ptri; float *ptro; i...
ALGO
0.975436
4.977786
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2017-11-04T16:12: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": "dca9bc169...
41cf7766-280e-447d-9f67-63d4ccb82359
ishandutta2007/codeforces-s
sumitacchan/normal/1696/F.cpp
#include <bits/stdc++.h> using namespace std; //using namespace atcoder; struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; #define FOR(i, begin, end) for(int i=(begin);i<(end);i++) #define REP(i, n) FOR(i,0,n) #define IFOR(i, begin, end) for(int i=...
ALGO
0.999967
5.459902
{ "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": "d122168d3a10...
094645c8-8660-4378-843c-d766dea54275
its-yashkumar-jain/DSA_LAB_E71
bus_deque.cpp
#include<iostream> using namespace std; struct Dequeue { //max size is 30 int capacity; int front; int rear; char * dptr; }; void createdequeue(struct Dequeue *); int getfront(struct Dequeue *); int getrear(struct Dequeue *); int isoverflow(struct Dequeue *); int isunderflow(struct Dequeue *); void enqu...
ALGO
0.98701
3.433309
{ "github_metadata": { "branch": "master", "commit_count": 133, "repo_created_at": "2021-12-03T03:47:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eb8ca47f...
40de3f3a-d443-4824-9df3-d1eeb4836f9c
AbdullahRFA/3-1_All_Resources
Computer Graphics Lab/Graphics Lab 3/360/translate_line_on_x_axisby_75_.cpp
#include <iostream> #include <graphics.h> void translateLine(int x1, int y1, int x2, int y2, float translateX) { int newX1 = x1 + translateX; int newY1 = y1; int newX2 = x2 + translateX; int newY2 = y2; line(newX1, newY1, newX2, newY2); } int main() { int gd = DETECT, gm; initgraph(&gd, ...
ALGO
0.920381
4.2774
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2024-11-27T15:06: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": "a5b6d5f8ad8...
a061ae71-e536-471d-8cca-89e960661916
tkukurin/Lab.InteractiveComputerGraphics
lab04/sierpinski.cpp
#include <stdio.h> #include <GL/glut.h> #include <vector> #include <map> #include <algorithm> #include "parsing.cpp" #include "common.cpp" GLuint g_width, g_height; bool g_color_type = false; glm::vec3 g_eye(5, 5, 5); glm::vec3 g_lightSource(2,2,2); glm::vec3 g_up(0, 1, 0); glm::vec3 g_view(0, 0, 0); vector<glm::ma...
TOOL
0.953252
4.817524
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2018-02-21T13:37: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": "ce94d1fef5...
576921b8-0792-4389-95d2-db11cb640902
younger-1/leetcode-younger
tree-medium/1011.在-d-天内送达包裹的能力.cpp
/* * @lc app=leetcode.cn id=1011 lang=cpp * * [1011] 在 D 天内送达包裹的能力 */ #include <vector> using namespace std; // @lc code=start // 84/84 cases passed (52 ms) // Your runtime beats 85.16 % of cpp submissions // Your memory usage beats 85.28 % of cpp submissions (25.4 MB) class Solution { public: int shipWi...
ALGO
0.99997
6.26405
{ "github_metadata": { "branch": "master", "commit_count": 324, "repo_created_at": "2021-01-30T15:09: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": "ab653336...
7c86002d-cb46-4b84-aea2-9791221609b0
fancycheung/ondrej-test-project-1
mert/mert.cpp
/** \description The is the main for the new version of the mert algorithm developed during the 2nd MT marathon */ #include <limits> #include <unistd.h> #include <cstdlib> #include <iostream> #include <fstream> #include <cmath> #include <ctime> #include <getopt.h> #include "Data.h" #include "Point.h" #include "Score...
ALGO
0.999571
5.455006
{ "github_metadata": { "branch": "master", "commit_count": 2420, "repo_created_at": "2016-04-06T06:09:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aa6befc...
cfc73ee1-d5e6-4e89-8799-07cda9344ea8
zm2417/luogu-cpp
1894_二分图.cpp
#include <iostream> using namespace std; int n, m; int d[250][250]; int cow[250]; // 牛栏中的牛编号 int vis[250]; int ans; // x: 牛的编号 bool dfs(int x) { // 遍历牛栏 for (int i = 1; i <= m; i++) { if (d[x][i] && !vis[i]) { vis[i] = 1; if (cow[i] == 0 || dfs(cow[i])) // 牛栏没有牛 或者 ...
ALGO
0.999917
3.400152
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2020-01-26T06:59:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fc476450a...
78535153-861f-4da4-af67-6a8f74decfdd
Devansh-Sonigra/Larson-code
Larson-3/Larson-3a/projection.cc
#include <deal.II/grid/tria.h> #include <deal.II/grid/grid_generator.h> #include <deal.II/grid/grid_out.h> #include <deal.II/dofs/dof_handler.h> #include <deal.II/dofs/dof_tools.h> #include <deal.II/fe/fe_simplex_p.h> #include <deal.II/fe/mapping_fe.h> #include <deal.II/numerics/vector_tools.h> #include <deal.II/numeri...
ALGO
0.995403
5.737952
{ "github_metadata": { "branch": "main", "commit_count": 46, "repo_created_at": "2025-05-31T06:19: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": "64d6be96635...
45ee400f-38fe-4d8b-87e4-2d1a7de386f0
openvinotoolkit/openvino
src/core/reference/src/op/convert_x86_intrinsics.cpp
// Copyright (C) 2018-2025 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // #include "openvino/reference/convert.hpp" #if defined(OV_CORE_USE_INTRINSICS) # include "openvino/reference/utils/convert_x86_intrinsics.hpp" namespace ov { namespace reference { # if defined(HAVE_AVX2) template <> __m128i N...
ALGO
0.943244
6.961312
{ "github_metadata": { "branch": "master", "commit_count": 19551, "repo_created_at": "2018-10-15T10:54:40.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8597, "forks": 2656, "issues": 303, "pull_requests": 258 }, "file_meta": { "content_id"...
db18b447-c813-451e-b740-b9fc26dcf4c0
zick97/NumAlgo
Week5/froot.cpp
#include <iostream> #include <math.h> #include <ctime> #include <iomanip> #include <stdlib.h> using namespace std; double func(double x); double dvfunc(double x); int Bracket(double (*F)(double), int a, int b, int N, double xL[], double xR[], int maxSize); int Bisection(double (*F)(double), double a, double b, doub...
ALGO
0.99981
4.281458
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-06-30T09:34: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": "716f5c1c5a85...
a11338f5-15b4-443c-9688-0a9ae88374fc
idefix-code/idefix
src/fluid/RiemannSolver/HDsolvers/tvdlfHD.hpp
// *********************************************************************************** // Idefix MHD astrophysical code // Copyright(C) <NAME> <<EMAIL>> // and other code contributors // Licensed under CeCILL 2.1 License, see COPYING for more information // **************************************************************...
ALGO
0.998737
6.29608
{ "github_metadata": { "branch": "master", "commit_count": 1733, "repo_created_at": "2023-01-22T08:31:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 31, "forks": 21, "issues": 4, "pull_requests": 6 }, "file_meta": { "content_id": "9f7d17...
bf947471-e228-496a-be46-41f558bff25d
google-ai-edge/mediapipe
mediapipe/calculators/core/clip_vector_size_calculator.h
// Copyright 2019 The MediaPipe Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or a...
TOOL
0.960971
7.619668
{ "github_metadata": { "branch": "master", "commit_count": 4767, "repo_created_at": "2019-06-13T19:16:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 30689, "forks": 5453, "issues": 443, "pull_requests": 149 }, "file_meta": { "content_id"...
a73158b5-3fa0-4cf6-8239-b7f32f3f7d6f
TZYLT/OICodes
Luogu_P_3287.cpp
#include<bits/stdc++.h> using namespace std; #define rep(x,l,r) for(int x=(l);x<=(r);x++) #define per(x,l,r) for(int x=(r);x>=(l);x--) #define ckmax(x,y) x=(x>(y)?x:(y)) #define ckmin(x,y) x=(x<(y)?x:(y)) #define frein(x) freopen(x,"r",stdin) #define freout(x) freopen(x,"w",stdout) #define ms(x,y) memset(x,y,sizeof(x))...
ALGO
0.99976
3.298692
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2024-03-22T13:10:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b62c04e4a34...
e8e56a92-5e67-4f67-8ea5-804ba6866f3e
IgorSulimov/New-repository
+Bell+Game+Exersise/Exersise.cpp
#include <iostream> #include <fstream> using namespace std; enum SymbolicTokenClass { Zero,One, Error, EndOfFile }; enum States { A1, B1, C1, D1,E1,F1, Stop }; struct SymbolicToken { SymbolicTokenClass token_class; }; SymbolicToken transliterator(int ch) { SymbolicToken s; if (ch == '1') { s...
ALGO
0.999606
3.746476
{ "github_metadata": { "branch": "main", "commit_count": 146, "repo_created_at": "2024-09-02T19:57: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": "001ebdea44...
e72432e6-04c0-4006-a092-28be106f3cc0
gaurav1Nn/leetcode-question
2704-maximum-difference-by-remapping-a-digit/2704-maximum-difference-by-remapping-a-digit.cpp
class Solution { public: int minMaxDifference(int num) { string s = to_string(num); // ----- MAXIMUM: replace first digit (not 9) with 9 ----- string maxStr = s; for (char d : s) { if (d != '9') { char toReplace = d; for (char &c :...
ALGO
0.998944
5.697306
{ "github_metadata": { "branch": "main", "commit_count": 2409, "repo_created_at": "2024-09-30T07:08:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b344efbad...
6ff362db-c24e-426d-a2d1-96509931574a
dinaxhtml/cpp-problems-solving
ageInDays.cpp
/* Assiut University Training - Newcomers codeforces: R. Age in Days time limit per test 1 second memory limit per test 256 megabytes Given a Number N corresponding to a person's age (in days). Print his age in years, months and days, followed by its respective message "years", "months", "days". Note: consider the wh...
ALGO
0.998384
3.765796
{ "github_metadata": { "branch": "main", "commit_count": 139, "repo_created_at": "2023-09-04T19:54:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c94c1768f9...
fa91a6d2-9bac-49a9-bda7-0c9bffb81866
h4wwk3ye/code
Hackerearth/DP/playing_with_digits.cpp
/* C++ encoding: UTF-8 Modified: <06/Oct/2019 12:04:40 PM> ✪ H4WK3yE乡 <NAME> Indian Institute Of Information Technology (IIIT), Gwalior */ #include <bits/stdc++.h> #ifdef LOCAL_PROJECT # include <prettypr.hpp> #endif using namespace std; // clang-format off #define int ...
ALGO
0.999628
4.649266
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2022-03-12T15:34: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": "dfa7aeb957...
bb7191d8-d0f2-4b3c-a7ad-50271a58152f
NeilKleistGao/NginD
kernel/crypto/aes.cc
/** MIT License * Copyright (c) 2020 NeilKleistGao * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, me...
ALGO
0.948538
6.974697
{ "github_metadata": { "branch": "master", "commit_count": 214, "repo_created_at": "2020-08-02T07:57:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "afe068e...
995072a0-3087-45ce-aa04-d9864d092508
dorian-gabIer/Klasa_1AG
fib.cpp
#include <iostream> #include <vector> #include <string> #include <cstring> using namespace std; int count(string &temp1, string &temp2) { int size1 = temp1.length(); int size2 = temp2.length(); int result = 0, a; for (int i = 0; i <= size2 - size1; i++) { for (a = 0; a < size1; a++) ...
ALGO
0.999976
3.577962
{ "github_metadata": { "branch": "master", "commit_count": 122, "repo_created_at": "2020-02-29T20:49:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fb13e7ef...
7737e4ab-52d6-4098-8022-b06668781b6f
1o0p3r/CS3201-Project
Code09/SPA/Back End/QueryOptimizer.h
#pragma once #include "QueryElement.h" #include <vector> #include <unordered_map> #include <queue> #include "QaConstants.h" #include "PKB.h" #include <functional> using namespace std; struct relRanker { string relation; int relationTableSize; bool operator < (const relRanker& compareTo) const { return relationT...
ALGO
0.998337
4.628065
{ "github_metadata": { "branch": "master", "commit_count": 714, "repo_created_at": "2019-03-19T09:03: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": "414a3eea...
5bdc4357-6cbe-4af9-9f3e-837c62b26f89
SymbianSource/oss.FCL.sf.mw.uiresources
locales/loce32/collation/src/collation_match_da.cpp
/* * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.h...
TOOL
0.902171
3.776287
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2016-11-02T21:05:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f87a615f05...
08c57cad-0b9f-4356-9632-eecc0ccc9144
srijan0412/DSA-implementation
Array/Longest_consecutive_subsequence.cpp
// LeetCode : Longest consecutive Subsequence // Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. //You must write an algorithm that runs in O(n) time. // # Approaches to solve this problem // Bruteforce - Bruteforce. O(N^2) O(1) // Better - sort and iterate. O...
ALGO
0.999956
5.789237
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2023-03-05T05:37:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f4e822ff72e...
645eb419-febd-4bd6-b9e4-b3f22c77399f
himanshug233/-Coding-Ninjas-Competitive-Programming
Assignment - Backtracking , Binary Search And Merge Sort Problems/Sudoku Solver.cpp
/* Sudoku Solver Given a 9*9 sudoku board, in which some entries are filled and others are 0 (0 indicates that the cell is empty), you need to find out whether the Sudoku puzzle can be solved or not i.e. return true or false. Input Format : 9 Lines where ith line contains ith row elements separated by space Output For...
ALGO
0.999886
5.713371
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-08-05T06:16: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": "a0a3781da1...
80cc8f1e-c2d4-424e-803c-5cbde5465787
96mohitm/Competitive-Programming
spoj/SHPATH.cpp
#include <bits/stdc++.h> using namespace std; #define watch(x) cout << (#x) << " is " << (x) << endl void fast(){ ios_base::sync_with_stdio(false); cin.tie(NULL); } typedef pair<int, int> pii; typedef vector<vector<pii>> Graph; typedef long long int ll; void edge(Graph &g, int u, int v, int w){ g[u].push...
ALGO
0.999967
4.361094
{ "github_metadata": { "branch": "master", "commit_count": 145, "repo_created_at": "2016-12-22T18:08:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f3e33e84...
f58db3e3-2e19-4081-96a6-440a1a52c376
RiceReallyGood/nowcoder
tiba/22_travel1.h
#include <vector> #include <queue> using namespace std; struct Point { int x; int y; }; class Solution { public: int Travel(int N, int V, int* A, int ALen, vector<Point>& list) { vector<int> prerequestscount(N); vector<vector<int>> lattertargets(N); for(int i = 0; i < list.size(); i++){...
ALGO
0.999991
4.709719
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2020-03-16T08: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": "9ba0da4af4...
14e42c22-a51b-456f-b5c2-0cec3046cb70
eonil/MediaEngine2
Mathematics/Sources/Eonil/MediaEngine/Mathematics/Geometry/Matrix.h
// // Matrix.h // Mathematics // // Created by <NAME> on 6/11/13. // // #pragma once #include "../Common.h" #include "Vector.h" #include "Quaternion.h" #include "AxisAngle.h" EONIL_MEDIA_ENGINE_MATHEMATICS_GEOMETRY_NAMESPACE_BEGIN // namespace // Matrix // { // template<typename M> auto identity() -> M const; ...
ALGO
0.951092
6.154812
{ "github_metadata": { "branch": "dev", "commit_count": 109, "repo_created_at": "2014-08-21T14:16:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "30bd66b485b...
f8604351-644c-4f9e-9f28-06f51ec94ccc
wencfy/nyu-os
lab3/src/Pager.cpp
#include "utils.cpp" extern unsigned int num_frames; extern Utils *util; extern unsigned long inst_count; FIFOPager::FIFOPager(): hand(0) {} unsigned int FIFOPager::select_victim_frame() { hand %= num_frames; return hand++; } RandomPager::RandomPager() {} unsigned int RandomPager::select_victim_frame() {...
ALGO
0.956025
4.979226
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2023-09-19T06:16: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": "bb478de52...
99422c22-6fbf-435d-beb5-a26b56c53a27
seriskale0720/Cpp_stuffs
Week 4 Problem 4/src/Week 4 Problem 4.cpp
//============================================================================ // Name : Week.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <ios...
ALGO
0.998772
4.808867
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-01-03T00:28:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4586f16b6b...
6a835cb2-3933-4826-bb09-671f3903003c
Lucas-Morais-Freire/STR
Concorrência/trens3.cpp
// // thread07.cpp // // // Created by Affonso // // // Programa que sincroniza threads utilizando-se mutexes // Para compilá-lo utilise: g++ -o thread07 thread07.cpp -lpthread #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <pthread.h> #include <semaphore.h> #include <string.h> void *thre...
ALGO
0.980006
5.015906
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2024-10-02T18:53:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "b595a7d4c...
dccdd14b-39ca-417d-b3f6-8c3f29285186
asifcsai/Competitive-Programming-Problem-Solution
CodeForces/odd_quries.cpp
#include<bits/stdc++.h> using namespace std; #define optimize() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl '\n' const int N = 1e5 + 10; long long int arr[N]; int main(void) { optimize(); int t ; cin >> t; while(t--) { int n, q; cin >> n >> q; ...
ALGO
0.999927
4.571568
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-03-25T05:39: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": "9f62374a40f6...
cae5fffb-d2f9-4146-8cba-bc4a2b7ef485
callmewenhao/CodingDiary
codes/图/course-schedule-iiDFS.cpp
// https://leetcode-cn.com/problems/course-schedule-ii/ class Solution { private: vector<int> res; bool haveCycle = false; vector<bool> visited; vector<bool> onPath; // 建图 vector<vector<int>> buildGraph(int numCourses, vector<vector<int>>& prerequisites) { vector<vector<int>> graph(numCo...
ALGO
0.999988
6.187406
{ "github_metadata": { "branch": "main", "commit_count": 122, "repo_created_at": "2022-02-05T06:00: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": "688441813e...
be899cb9-de0c-4d31-ad94-2ce26f1e672a
sleepyjun/PS
BOJ/1562/1562.cpp
// https://www.acmicpc.net/problem/1562 #include <iostream> #include <algorithm> #include <limits> #include <vector> #include <string> using std::cin; using std::cout; typedef unsigned long long ull; typedef std::pair<int, int> pii; const int INF = std::numeric_limits<int>::max(); const int MOD = 1000000000; int dp[1...
ALGO
0.99967
4.045608
{ "github_metadata": { "branch": "master", "commit_count": 68, "repo_created_at": "2019-09-16T02:41:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "69c52a854...
ce8cada5-380f-4fae-b32d-03c32017338c
arshkhatwani/leetcode-problems
maximum_score_of_spliced_array.cpp
#include <bits/stdc++.h> using namespace std; /* For maximising sum of array1 : sum1 = sum1 - sum of nums1 subarray + sum of nums2 subarray For maximising sum of array1 : sum2 = sum2 - sum of nums2 subarray + sum of nums1 subarray 2 arrays can be formed: 1 => every ith element = nums1[i] - nums2[i] ...
ALGO
0.999984
5.928569
{ "github_metadata": { "branch": "main", "commit_count": 182, "repo_created_at": "2022-06-17T04:51: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": "67f56ffd96...
0a361b1a-7d85-44c3-a179-9532b8f79167
asc0ltato/FirstCourse
SecondSemester/OAiP/Готовые лабы/лаба 9/lab9/dop3/dop4.cpp
// По заданному числу n определить символ, который стоит на n - ом месте последовательности, получившейся после шага c номером 26. #include <iostream> #include <windows.h> using namespace std; //Функция вычисляет значение, результата увеличивая его на заданный shag, пока count не станет = введенному n int recursion(in...
ALGO
0.999947
3.60313
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-05-29T00:07: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": "c9d05bb5f231...
9d73ffe3-d29b-4512-8342-c28ff4396cce
snowpanther6/cpp-codes
Bipartite.cpp
#include<bits/stdc++.h> using namespace std; #define ff first #define ss second #define int long long int #define pb push_back #define mp12 make_pair #define pii pair<int,int> #define vi vector<int> #define mii map<int,i...
ALGO
0.999953
4.941443
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2020-10-22T08:25:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4d49005a1d9...
6dd74309-7159-48cf-8dff-16d79990673e
ameliajochna/competitive-programming-amelia-jochna
homework/2022/blokada-lancuchowa.cpp
#include <bits/stdc++.h> using namespace std; using lf = long double; using ll = long long; using cll = const ll; using cint = const int; using pll = pair<ll, ll>; using pii = pair<int, int>; #define int long long int const maxN = (int)3e5 + 10, MOD = 1e9 + 7; int n, a[maxN], q; struct matrix { ll a, b, c, d; mat...
ALGO
0.999977
4.479509
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-08-12T15:03:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0b33589e3fa4...
7e187d0c-5ad3-4710-a630-09b541dcd8e0
nathanfleet/CSLABS
CS3/Design Patterns/Chain-of-Responsibility/Chain.cpp
// Chain of Responsibility Demonstration #include <iostream> using std::cout; using std::endl; // abstract class that sets up individual links in the // chain of responsibility (Abstract Handler) class Soldier { public: Soldier(Soldier* successor) : successor_(successor) {} virtual void handleRequest(int amt...
ALGO
0.984052
6.689604
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-12-26T20:25:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6b377ae6fb62...
ff236d11-5196-463e-b90a-69168a20fb78
Thakur-Sahab-4-5-2000/DSA
Searching And Sorting Questions/FindMaximumElementInBitonicArray.cpp
#include "bits/stdc++.h" using namespace std; int findPeak(vector<int> nums) { int low = 0, high = nums.size() - 1; while (low <= high) { int mid = low + (high - low) / 2; if (mid > 0 and mid < nums.size() - 1) { if (nums[mid] > nums[mid - 1] and nums[mid] > nums[mid +...
ALGO
0.999959
4.849776
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-01-23T18:54:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c4107ca12b71...
0cbe9149-68da-4ad0-b259-14f003ef1419
ssk4988/Coding
UCFPT/230915/k.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pi = pair<int, int>; using pl = pair<ll, ll>; using pd = pair<ld, ld>; using vi = vector<int>; using vl = vector<ll>; using vd = vector<ld>; using vpi = vector<pi>; using vpl = vector<pl>; using vpd = vector<pd>; using vv...
ALGO
0.999982
4.164364
{ "github_metadata": { "branch": "main", "commit_count": 189, "repo_created_at": "2021-11-02T23:44: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": "81ef8a351f...
895ca773-e45a-4d76-8c55-f06cc7e77c92
okamumu/BernsteinCopula
src/sinkhorn.cpp
#include <RcppArmadillo.h> using namespace Rcpp; // [[Rcpp::depends(RcppArmadillo)]] // [[Rcpp::export]] arma::mat sinkhorn_scaling(const arma::mat& W, int maxiter = 1000, double tol = 1e-10) { int m = W.n_rows; int n = W.n_cols; arma::vec target_row(m, arma::fill::ones); arma::vec target_col(n, arma::fill::...
ALGO
0.999962
6.589168
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2025-05-10T23:52: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": "f0074ef8300...
e3e3732d-12ef-4179-a176-4866954ce919
TsotsosLab/SMILER
models/matlab/QSS/qdct_impl/qdct_saliency_48_64_nofilter.cpp
/** * Copyright 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: * * 1. Redistributions of source code must retain the above copyright * notice, this list of cond...
ALGO
0.997331
5.864842
{ "github_metadata": { "branch": "master", "commit_count": 142, "repo_created_at": "2018-12-20T18:32:31.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 46, "forks": 16, "issues": 16, "pull_requests": 7 }, "file_meta": { "content_id": "e5e556...
dfde73b8-92a6-4179-b01d-2599adf69722
olesenm/openfoam
src/OpenFOAM/meshes/primitiveShapes/line/line.H
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
TOOL
0.94184
6.917305
{ "github_metadata": { "branch": "master", "commit_count": 27318, "repo_created_at": "2019-01-05T15:15:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b8b35...
23beacb9-60df-48f4-8724-7552d1afd445
Olukemi/Real-time-SDR-for-mono-stereo-FM-and-RDS
3dy4-project-group12-prj-wednesday-main/src/project.cpp
/* Comp Eng 3DY4 (Computer Systems Integration Project) Copyright by <NAME> Department of Electrical and Computer Engineering McMaster University Ontario, Canada */ #include "dy4.h" #include "filter.h" #include "fourier.h" #include "genfunc.h" #include "iofunc.h" #include "logfunc.h" #include "fmSupport.h" #include "...
ALGO
0.951409
4.274027
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-05-07T16:59: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": "eec1c9ff0771...
bde77029-37ce-4c21-94f5-c15798c38d58
BafDyce/adventofcode
2016/c++/day13/Day13.cpp
#include "Day13.hpp" #include <sstream> #include <vector> #include <queue> Day13::Day13(vector<string> input) : designers_number(0), graph{} { stringstream stream(input[0]); stream >> this->designers_number; this->build_graph(); } Day13::~Day13(){ } bool Day13::is_open_space(const int x, const int y){ ...
ALGO
0.999412
4.493701
{ "github_metadata": { "branch": "master", "commit_count": 355, "repo_created_at": "2019-12-06T13:48:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef826ecd...
672bcf53-16ae-4b14-8175-d9ffa1ea60e6
telegramdesktop/tdesktop
Telegram/SourceFiles/statistics/segment_tree.cpp
/* This file is part of Telegram Desktop, the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "statistics/segment_tree.h" namespace Statistic { namespace { constex...
ALGO
0.999046
7.576451
{ "github_metadata": { "branch": "dev", "commit_count": 20212, "repo_created_at": "2014-05-02T12:36:31.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 28045, "forks": 5682, "issues": 877, "pull_requests": 29 }, "file_meta": { "content_id": "...
3a8a709f-a36e-4f6e-9c7a-cce0a2803709
hku-systems/bidl
SBFT/threshsign/src/bls/relic/LagrangeInterpolation.h
// Concord // // Copyright (c) 2018 VMware, Inc. All Rights Reserved. // // This product is licensed to you under the Apache 2.0 license (the "License"). // You may not use this product except in compliance with the Apache 2.0 License. // // This product may include a number of subcomponents with separate copyright // ...
TOOL
0.999459
7.39416
{ "github_metadata": { "branch": "main", "commit_count": 233, "repo_created_at": "2021-08-20T10:47:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 38, "forks": 9, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "a271fc35d5...
099155d0-4ddb-4f03-8ff6-a27aeb38c469
josePedroAguiar/MEI-MEI-Assigments
code/Dinic.cpp
#include <algorithm> #include <chrono> #include <fstream> #include <iostream> #include <limits> #include <queue> #include <set> #include <utility> #include <vector> class Timer { public: Timer(double timelimit) : m_timelimit(timelimit), m_start(std::chrono::high_resolution_clock::now()) {} double elapse...
ALGO
0.999553
4.487159
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-10-22T13:47:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ee5bfef1e730...
04f6902a-aa25-4c85-96f4-5e5eb975227d
tac-kit/LeetCodeCpp
145-Binary-Tree-Postorder-Traversal.cpp
#include<iostream> #include<vector> #include<algorithm> #include<stack> using namespace std; // 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(nullpt...
ALGO
0.99999
6.012211
{ "github_metadata": { "branch": "main", "commit_count": 64, "repo_created_at": "2021-09-03T05:47:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "612fdccc585...
af297b7a-76dd-4723-9f3c-0be00b049c7d
chtisgit/adventofcode
2018/cpp/8.cpp
#include <cstdio> #include <memory> #include <numeric> #include <set> #include <vector> struct Tree { struct Node { Tree &tree; std::vector<int> children; std::vector<int> metadata; Node(Tree &tree) : tree(tree) { } int sum() const { int sum = std::accumulate(metadata.begin(), ...
ALGO
0.999486
3.907974
{ "github_metadata": { "branch": "master", "commit_count": 87, "repo_created_at": "2018-12-08T00:49:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6464d10e3...
1c20c1e0-1b7c-483c-b55d-ef193ae553a8
dragonpilot-community/dragonpilot
rednose_repo/rednose/helpers/ekf_sym.cc
#include "ekf_sym.h" #include "logger/logger.h" using namespace EKFS; using namespace Eigen; EKFSym::EKFSym(std::string name, Map<MatrixXdr> Q, Map<VectorXd> x_initial, Map<MatrixXdr> P_initial, int dim_main, int dim_main_err, int N, int dim_augment, int dim_augment_err, std::vector<int> maha_test_kinds, std:...
ALGO
0.978042
3.866647
{ "github_metadata": { "branch": "pre-build", "commit_count": 122, "repo_created_at": "2019-06-26T22:18:25.000Z", "is_fork": true, "is_org_owned": true, "forked_from": "commaai/openpilot", "stars": 514, "forks": 296, "issues": 0, "pull_requests": 0 }, "file_meta": { "co...
2e291333-bea4-4de9-99e7-1df50551c5c3
SaurabhKumar171/data_structure_and_algorithms
Stacks/Medium/5_SumofSubarrayRanges.cpp
#include <iostream> #include <vector> #include <string> #include <unordered_map> using namespace std; // Brute Force Approach : O(n^2) time complexity, O(1) space complexity class Solution { public: long long subArrayRanges(vector<int>& nums) { int n = nums.size(); long...
ALGO
0.999974
6.050226
{ "github_metadata": { "branch": "main", "commit_count": 527, "repo_created_at": "2024-05-08T04:48:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a9295cc91...
9b3ca8dc-e4a2-4a22-a5ba-af17125a7c65
AkashSingh3031/The-Complete-FAANG-Preparation
1]. DSA + CP/2]. Competitive Programming/08]. Work@Tech/2]. Data Structures & Algorithms/1]. Topics/01]. Arrays/2[. Medium/20]. Inversion Count.cpp
/* Example Array: 8, 4, 1, 2 Inversion Count: 5. ==> (8, 4), (8, 1), (8, 2), (4, 1), (4, 2) */ int merge (vector<int> &arr, int low, int mid, int high) { int subArr1Size = mid - low + 1, subArr2Size = high - mid; vector<int> subArr1, subArr2; for (int i = 0; i < subArr1Size; i++) { subAr...
ALGO
0.999977
5.31036
{ "github_metadata": { "branch": "master", "commit_count": 1827, "repo_created_at": "2021-05-29T04:41:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11343, "forks": 2526, "issues": 3, "pull_requests": 2 }, "file_meta": { "content_id": "...
e1906384-44e6-48d9-9e60-db0cd7e0f12f
szekizoli/GoogleCodeJamPractice
2017/Round_1C/b.cpp
// 2017 Round 1C Problem B #include<algorithm> #include<cmath> #include<iostream> #include<limits> #include<utility> #include<vector> using namespace std; // I/O typedef pair<int, int> activity; struct input { int Ac, Aj; vector<activity> vc; vector<activity> vj; }; template<typename T0, typename T1> istrea...
ALGO
0.999809
3.91509
{ "github_metadata": { "branch": "main", "commit_count": 88, "repo_created_at": "2015-02-08T18:33:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b67848e5ceb...
2affc35c-89a9-4b27-bf93-9dafb5c4953f
ROBOTICSENGINEER/NAO_H25_V4
TSK_potential_field/state.h
#include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc_c.h" #include "mymath.h" #include "colors.h" #include <iostream> using namespace cv; #ifndef STATE_H #define STATE_H void stcount(Mat &pic,int i1,int i2,int j1,int j2,float &na,float &ng, float &nr , float &nb) { int b,g,r,i,j,n,m; in...
ALGO
0.930938
3.036606
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2017-12-09T17:39:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "206961823...
9c6a5ba1-f79e-4353-aa02-1406254e88b9
OpenSpeedShop/openspeedshop
test/executables/sequential/Eon/myrand.cc
static long int seedi = 1; void my_srand(int i){ seedi = i; } long int my_rand() /* See "Random Number Generators: Good Ones Are Hard To Find", */ /* Park & Miller, CACM 31#10 October 1988 pages 1192-1201. */ /***********************************************************/ /* THIS IMPLEMENTATION REQUIRES AT LEAST ...
ALGO
0.998126
3.530723
{ "github_metadata": { "branch": "master", "commit_count": 7199, "repo_created_at": "2016-04-03T19:57:55.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 24, "forks": 10, "issues": 7, "pull_requests": 0 }, "file_meta": { "content_id": "32967b...
0db496ec-4872-44d7-b22b-84e6f4dbb654
SinghRajan41/code
MY_CPP/Queue/Queue_with_Stack.cpp
#include <iostream> #include <stack> using namespace std; class queue { stack<int> s1, s2; public: void nq(int value); void dq(); int peekfront(); inline bool isEmpty(); }; inline bool queue::isEmpty() { return (s1.empty()) ? true : false; } int queue::peekfront() { if (s1.empty()) { retu...
ALGO
0.997986
3.579735
{ "github_metadata": { "branch": "main", "commit_count": 61, "repo_created_at": "2022-08-14T06:03: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": "6cafad4a928...
ca53efcb-a94a-4c94-a8aa-87c3a37ec0c1
Animish07/DAA-assign
01knapsackusingdynamicprogramming.cpp
#include <iostream> #include <vector> using namespace std; int knapsack(int W, vector<int>& wt, vector<int>& val, int n) { vector<vector<int>> dp(n + 1, vector<int>(W + 1, 0)); for (int i = 1; i <= n; i++) { for (int w = 1; w <= W; w++) { if (wt[i - 1] <= w) { dp[i][w] = m...
ALGO
0.999984
5.302892
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-05-14T16:01: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": "6c84ab327895...
f6042529-99c2-4441-8d7f-1ca0356920ca
2uring/DS_Algo
validate-binary-search-tree/validate-binary-search-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.999979
6.088006
{ "github_metadata": { "branch": "main", "commit_count": 85, "repo_created_at": "2021-09-12T16:54:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c8e6c613341...
b294770a-3a4a-46be-b9db-e10ac37ea1cc
euchangxian/CodeForces
Round1006/B.cpp
#include <algorithm> #include <array> #include <bitset> #include <climits> #include <cmath> #include <cstddef> #include <cstdint> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <ios> #include <iostream> #include <istream> #include <iterator> #include <map> #inclu...
ALGO
0.999812
4.686348
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2024-12-02T03:17:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fdaedb0c43c...
348eb7f9-6b0e-4f35-8053-af2b0ccd3496
Slackoth/Algoritmos
Guide_01/10-12/ex_10-12.cpp
#include <cstdlib> #include <iostream> using namespace std; struct Node { int n; Node* next; }; typedef struct Node* SimpleNode; void insertInFront(SimpleNode&, int); SimpleNode orderAsc(SimpleNode&); void printSimpleLinkedList(SimpleNode&); int deleteBeforeLast(SimpleNode&); int main(void) { srand(tim...
ALGO
0.999666
4.115694
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2020-08-27T19:57: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": "73f2e7d6d...
48c76407-4fbd-4617-90a5-1d3d29b58020
CommonRoad/commonroad-clcs
cpp/include/geometry/segment.h
#ifndef SEGMENT_H #define SEGMENT_H #include <algorithm> #include <utility> #include <vector> #include <Eigen/Dense> #include "geometry/util.h" #include "geometry/clcs_types.h" namespace geometry { class CurvilinearCoordinateSystem; // forward declaration class ProjectionDomain; // forward declaration...
TOOL
0.994508
6.399645
{ "github_metadata": { "branch": "main", "commit_count": 167, "repo_created_at": "2025-02-13T16:52:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "679a78f1b00...
914e1a7a-4903-4ed3-936c-a140c53f0ea3
miaowh/ICPC
BZOJ/2120.cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 1e4 + 4; const int S = 150; struct Query { int l, r, t, c; bool operator<(const Query &rhs) const { if (l / S == rhs.l / S) { if (r / S == rhs.r / S) return t < rhs.t; else r < rhs.r; } return l < rhs.l; } } q[m...
ALGO
0.999923
3.338751
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2021-06-02T06:06:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d7daf322db0...
240d656a-7a89-43fc-af32-0132047e3c31
AndersonKao/CP_Problems
CSES/Range_Queries/Distinct_Values_Queries.cpp
// AC // USE BIT and lPos, need review // WA // idiot, read the problem and check int I/O again! #include <bits/stdc++.h> using namespace std; #define F first #define S second #define REP(i,n) for(int i = 0; i < n; i++) #define eb emplace_back #define al(a) a.begin(), a.end() using ll = long long; using pii = pair<int,...
ALGO
0.99997
4.181844
{ "github_metadata": { "branch": "master", "commit_count": 244, "repo_created_at": "2022-01-23T04:16:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "add49e20...
a3a083e6-5ff1-4a62-a8e2-9590469ccf77
GGapa/vscode
program/old program/B3633/B3633.cpp
//B3633 集合运算 2 #include <iostream> #include <cstring> #include <cmath> #include <cstdio> using namespace std; int main() { int lena,lenb,a[64],b[64],bucket[64]; scanf("%d",&lena); if(lena!=0)for(int i = 1;i<=lena;i++)scanf("%d",&a[i]); scanf("%d",&lenb); if(lenb!=0)for(int i = 1;i<=lenb;i++)scanf...
ALGO
0.999676
3.046293
{ "github_metadata": { "branch": "main", "commit_count": 191, "repo_created_at": "2023-11-17T05:37: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": "0e0df3f6c8...
10484647-b764-41f7-93b2-da786b1942e4
kamyu104/LeetCode-Solutions
C++/convert-sorted-array-to-binary-search-tree.cpp
// Time: O(n) // Space: O(logn) /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* sortedArrayToBST(vector<int>& nums) { retur...
ALGO
0.999995
6.907178
{ "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": ...
1aef553e-fc46-4472-9c45-1fc310b9bc25
DanIsraelMalta/Numerics
Glsl_triangle.h
//------------------------------------------------------------------------------- // // Copyright (c) 2024, <NAME> <<EMAIL>> // All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // i...
ALGO
0.992987
5.585431
{ "github_metadata": { "branch": "main", "commit_count": 633, "repo_created_at": "2024-05-16T18:54:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "b0b5d14f06...
a68382a2-a4af-4186-89e5-cf61dbf85296
wongomao/cpp-renew
book_learningCpp/ch13/main11.cpp
/* Use Dynamic Programming and Knapsack Problem to solve the playlist from library. The random shuffle was used in main10.cpp, and we will use the same library. We use a table dp of size (library.size() + 1) x (run_duration + 1) to store the maximum duration of songs that can be played in the run. Each cell dp[i][j] r...
ALGO
0.998667
5.561887
{ "github_metadata": { "branch": "main", "commit_count": 64, "repo_created_at": "2023-10-22T12:15: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": "652517ee3dd...
3c2fe15a-116e-4503-916a-9fc3b4ecd4dc
v-spath/diamond-blastn
src/data/seed_histogram.h
/**** DIAMOND protein aligner Copyright (C) 2013-2021 Max Planck Society for the Advancement of Science e.V. <NAME> Eberhard Karls Universitaet Tuebingen Code developed by <NAME> <<EMAIL>> This program is free software: you can redistribute it and/or modify it und...
TOOL
0.9466
5.448884
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-03-03T21:32:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "32bfcb2d72bc...
55676657-7a28-4df3-8f73-ad5dbf32ca50
cmdpig/code
P_1503.cpp
#include<bits/stdc++.h> using namespace std; const int MAXN=5e4+7; struct Splay{ int rt,fa[MAXN],ch[MAXN][2],size[MAXN],tot,cnt[MAXN],val[MAXN]; /* ch[i][0]:左子树 ch[i][1]:右子树 cnt[i]:去重后序号i的数的出现次数 size[i]:以i为根的子树的大小 tot:去重后的节点总数 */ void update(int x){size[x]=size[ch[x][0]]+size[ch[x][1...
ALGO
0.999935
3.679595
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-08-09T14:21: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": "3dc9fc3ea3c7...
dc1186a9-2398-4b0e-be2d-e82f61792542
gumeniukcom/aptu-os
labs/504/aleksandrov.yuriy/06_sieve/sieve_multith.cpp
#include <iostream> #include <fstream> #include <thread> #include <atomic> #include <cinttypes> #include <vector> #include <cmath> #include "get_params.hpp" #include "texceptions.hpp" using std::cout; using std::cerr; using std::endl; using std::ofstream; using std::vector; using std::thread; typedef vector<bool> Te...
ALGO
0.99116
3.850982
{ "github_metadata": { "branch": "master", "commit_count": 1455, "repo_created_at": "2015-03-13T05:30:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "2442258...
b5ecbda2-2d10-47c8-b3e7-ff6b1e1eaa14
GeekyJatin418/parallel_assignment
assignment2 _q1.cpp
// Estimate the value of Pi using the Monte Carlo method and demonstrate basic MPI functions. #include <mpi.h> #include <stdio.h> #include <stdlib.h> #include <time.h> int main(int argc, char* argv[]) { int rank, size, i; long long int num_points = 1000000; long long int local_num_points, local_count = 0, ...
ALGO
0.999872
5.854404
{ "github_metadata": { "branch": "main", "commit_count": 57, "repo_created_at": "2025-03-17T18:41:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b617292d6a9...
8676dfcc-ee16-41e1-a0bf-da6eaa35b2bf
kangzhiheng/GuideOfProgram
剑指offer/剑指offer/09_02_用两个队列实现栈.cpp
//----------------------------------------------------------------------------- // 文 件 名: 09_02_用两个队列实现栈.cpp // 作 者:adoredee // 创建时间:2019.04.20 // 描 述:用两个队列实现栈 // 版 本: //----------------------------------------------------------------------------- // Copyright (C) 2019 Shanghai Jiao Tong University //---------...
ALGO
0.997359
5.459342
{ "github_metadata": { "branch": "master", "commit_count": 168, "repo_created_at": "2019-04-26T08:37:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "469031c3...
57fdf8c9-dfa5-440c-b57f-faa71b0ef788
wuyuhang05/My-OI-Code
CF/848C.cpp
#include <algorithm> #include <iostream> #include <cstring> #include <climits> #include <cstdlib> #include <cstdio> #include <bitset> #include <vector> #include <cmath> #include <ctime> #include <queue> #include <stack> #include <map> #include <set> #define fi first #define se second #define U unsigned #define P std::...
ALGO
0.999976
4.133264
{ "github_metadata": { "branch": "master", "commit_count": 113, "repo_created_at": "2018-06-03T12:18:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2e2a5c03...
5a3f1822-13bb-428a-af14-5de6567a8ec1
iitkcpslab/MobileRobotRecharging
approx-algos-charging-stn-placement/findd_domset_approx/src/readinputs.cpp
#include <iostream> #include <fstream> #include <sstream> #include <string> #include <algorithm> #include <set> #include <math.h> #include <stdlib.h> #include "primitive.h" #include "readinputs.h" using namespace std; set<int> getVelocityDistinct (prim_vec_t prims) { set<int> velset; for(unsigned int i=0; i<prim...
ALGO
0.988565
3.225646
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2021-11-25T15:26: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": "2115d2f1515...
f0424aa6-f5c7-436d-a4c0-19ca1346ba1e
Moo-k/Algorithms-and-Data-Structures-Analysis-2021
Practicals/Practical 9 - Stacks, Queues and Trees/w (1).cpp
// discussed with friend, own code missed hidden case 5 and i cant find any differences in output so i followed his format #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; int main() { vector<string> strvec; string input; // read input as string and split into st...
ALGO
0.999922
4.147345
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-12-31T18:37: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": "c6ab98a37613...