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
0dde29d8-ef8c-4cae-9010-b1f28dbd343f
jcole67/Event_Sorter
Event_Sorter.cpp
//CS_117_20895SP21V //Assignment 5 //<NAME> #include <iostream> #include <string.h> using namespace std; struct Date //Stucture definitions { int month; int day; int year; }; struct Time { int hour; int minute; }; struct Event { char desc[80]; Date date; Time time; }; int readEvents(Ev...
TOOL
0.958494
4.250323
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-05-28T07:43: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": "006ccc226e4c...
66d5e758-e075-420c-bd5d-805c89103412
Azurealistic/Bridge
8/ma6422_hw8_q4.cpp
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; // Creates a random mapping for the integers in an array. void scramble(int arr[], int arrSize) { for(int i = 0; i < arrSize; i++) { arr[i] = (rand() % 3) + 1; // Random number from 1 to 3. } } bool auth(int arr[], int arrSize, const in...
ALGO
0.995405
4.464105
{ "github_metadata": { "branch": "core", "commit_count": 29, "repo_created_at": "2021-05-08T23:10:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a0e697732f...
c27ae6f1-d05b-4b4a-b924-29924c7d4c19
misaelmateus/problem-solving
Hackerrank/Booking-Codesprint-CouplingPassions.cpp
#include<bits/stdc++.h> #define ld long double #define pi 3.14159265359 using namespace std; struct point{ ld lat, lon; } ; ld degree2radians(ld A){ while(A < 0) A += 360.; while(A >= 360.0000000000000) A -= 360.; return (A*pi)/180.; } ld dist(point point1, point point2) { ld EARTH_R...
ALGO
0.999927
4.256244
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2017-04-27T20:59: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": "3c8088eb0...
d16f426c-8692-4389-8732-81e40a73a049
NGUYENGIATRONG/SPOTDOG
utils/spot_kinematic_c_plus_plus.cpp
/* INVERSE KINEMATIC SPOT V4.0 - NNQ */ #include <iostream> #include<cmath> using namespace std; float inverse_kinematic_branch1(float x, float y) { float a = 2 * 0.25 * x; float b = 2 * 0.25 * y; float c = pow(0.11, 2) - pow(0.25, 2) - pow(x, 2) - pow(y, 2); float q1_temp = atan2(y, x) + acos(-c...
ALGO
0.998894
3.503887
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2024-09-04T03:57: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": "9ca45adac...
d94592d9-3e8a-49c6-a5c5-0b9c00a8a0b8
IntraGreen/Intra_OS_CODES
sjf.cpp
#include<iostream> using namespace std; int main() { int n,bt[20],at[20],wt[20],tat[20],ct[20],avwt=0,avtat=0,i,j,pos,temp,p[20]; cout<<"Enter total number of processes(maximum 20):"; cin>>n; //enter the burst process time cout<<"\nEnter Process Burst Time\n"; for(i=0;i<n;i++) { co...
ALGO
0.999931
3.470926
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2017-06-28T21:45:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef294c2a3...
f98fa07c-95f6-4fcc-8545-c64d9ce1477e
Park18/Algorithm
boj/silver/1697.cpp
/** * @date 20.06.01 * @ BOJ 1697 * @url https://www.acmicpc.net/problem/1697 */ #include <iostream> #include <queue> #define MAX_SIZE 1000001 using namespace std; class record { public: int index; int time; record(int index, int time) :index(index), time(time) {} }; int main() { // 입력 int N; // 수빈 int ...
ALGO
0.999967
3.850973
{ "github_metadata": { "branch": "master", "commit_count": 150, "repo_created_at": "2020-05-06T14:40: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": "c180e9c1...
cd43eeec-afbd-4beb-9d8e-775733dbbb2c
zpliang/neo-src
src/troprf2c.cpp
//c----------version 0.7.28-------------------------------------------------------------------- #include <math.h> double troprf_c( int laser, int iobs, double fld, double p, double t, double w, double sel, double hsta, double slat ) { //c...purpose: compute the tropospheric refraction correction for //c obse...
ALGO
0.999845
5.151631
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2013-07-01T03:08:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71bc41ddd9...
76c9ee3f-29c5-49ec-ba49-f8278bda3c41
ElerGard/parallel_mag
lab_2/main.cpp
#include <algorithm> #include <chrono> #include <iostream> #include <vector> #include <immintrin.h> #include <iomanip> #define cols 4096 #define rows 4096 void add_matrix(double* A, const double* B, const double* C, size_t total_elements) { for (size_t i = 0; i < total_elements; i++) { A[i] = B[i] + C...
ALGO
0.998591
5.58328
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-01-20T18:47: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": "78a2659d3461...
3a4ea642-1a38-465b-ab2c-2cc5ecf1cffc
TeddyTiome/QL_stock_quantitative_internship
yhSimFolder/mysim_yuhao/yuhao_t1.version.2_0.cpp
#include "include/qlSim.h" namespace { class t1: public AlphaBase { public: explicit t1(XMLCONFIG::Element *cfg): AlphaBase(cfg), vol(dr.getData<QL_MATRIX<QL_FLOAT>>("volume")), close(dr.getData<QL_MATRIX<QL_FLOAT>>("adj_close")), low(dr.getData<QL_MATRIX<QL_FLOAT>>("adj_low")),...
ALGO
0.929452
5.076638
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-08-25T05:36:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "af832b7b5c...
58be5921-7790-441f-a78c-3edeb3bfd625
sriharsha9992/istar
idock/src/monte_carlo_task.cpp
#include "monte_carlo_task.hpp" void monte_carlo_task(ptr_vector<result>& results, const ligand& lig, const size_t seed, const array<fl, num_alphas>& alphas, const scoring_function& sf, const box& b, const vector<array3d<fl>>& grid_maps) { // Define constants. const size_t num_mc_iterations = 100 * lig.num_heavy_ato...
ALGO
0.999479
6.825941
{ "github_metadata": { "branch": "master", "commit_count": 1229, "repo_created_at": "2014-02-12T09:23:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 22, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0b23fb...
9320996b-5f5b-4bd2-880f-8dcb86a43697
57459N/B_1st_sem
B_1/1.4.cpp
#include <iostream> #include <cmath> using namespace std; int main4() { cout << "Enter the position of Queen (x y): "; int Qx, Qy = 0; cin >> Qx >> Qy; cout << "Enter the position of Pawn (x y): "; int Px, Py = 0; cin >> Px >> Py; cout << "\n"; if (1 > Qx && Qx < 9 || 1 > Qy && Qy < 9 || 1 > Px && P...
ALGO
0.999755
3.624229
{ "github_metadata": { "branch": "master", "commit_count": 72, "repo_created_at": "2021-09-12T18:37:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2f20fc013...
506ae59a-345b-4f2c-904b-f18a8f592de9
zlarosav/competitive-programming
Problem Sets/Blitzcoding/59. Palabra en el papel.cpp
#include <bits/stdc++.h> using namespace std; int main() { // Obtenemos el número de casos de la 1era línea de entrada int casos; cin >> casos; while (casos--) { // Creamos un vector de caracteres "ans" (answer -> respuesta) vector<char> ans; // Iteramos 8x8 veces for (int i = 0; i < 8; i++)...
ALGO
0.998006
4.345621
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-04-25T23:07: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": "633f9e78e0e8...
b1ffb612-e39b-4dc4-a8da-c07d4a9eec8d
gih0108/my-practice
my-practice/swap.cpp
#include<stdio.h> #include<iostream> void swap(int * ptr1, int * ptr2); void swap(char * ptr1, char * ptr2);//미리 선언 오버라이딩 void swap(double * ptr1, double * ptr2); //this line is very important because of call by reference, pointer int main(void){ int num1 = 20, num2 = 30; swap(&num1,&num2); std::cout <...
ALGO
0.998425
4.350358
{ "github_metadata": { "branch": "master", "commit_count": 243, "repo_created_at": "2017-11-05T06:35: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": "a80c4d74...
6ae14d44-457e-473a-9317-221693148b30
BambiTheLama/RaylibProject
RogueLike/Src/Core/Floor/PathFinder.cpp
#include "PathFinder.h" #include <algorithm> #include <cstdint> #include <iomanip> #include <iostream> #include <list> #include "raymath.h" #include "../../GameObjects/Game.h" #include "../../GameObjects/Collider/Collider.h" static PathFinder* pathFinder; PathFinder::PathFinder(Vector2 mapSize, Vector2 resolution) { ...
ALGO
0.999488
4.603542
{ "github_metadata": { "branch": "main", "commit_count": 241, "repo_created_at": "2024-05-13T19:32: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": "3a88f994fb...
47d74fed-872e-4334-8141-d368f230e3db
NguyenHoangHaiD21PTIT/INT1306_CAU_TRUC_DU_LIEU_VA_GIAI_THUAT_HK20222
CODE ICPC 2024/TUAN 1/1F. KHA NANG TUONG THICH.cpp
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int main() { int n; cin >> n; int a[n][5]; for (int i = 0; i < n; ++i) { for (int j = 0; j < 5; ++j) cin >> a[i][j]; } map<long long, int> cnt[6]; for (int i = 0; i < n; ++i) { for (int mask = 0; mas...
ALGO
0.999988
4.66344
{ "github_metadata": { "branch": "main", "commit_count": 971, "repo_created_at": "2024-03-09T15:33:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "552082fc53...
627c7eca-2aaf-4b25-ae79-7217c80e52f9
Nidhogg-Mzy/21-22spring
COMP2012/example/stl-program/stack-queue/balanced-paren.cpp
#include <iostream> /* File: balanced-paren.cpp */ #include <stack> using namespace std; const char L_PAREN = '('; const char R_PAREN = ')'; const char L_BRACE = '{'; const char R_BRACE = '}'; const char L_BRACKET = '['; const char R_BRACKET = ']'; bool balanced_paren(const char* expr); int main() ...
ALGO
0.997983
6.410577
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-02-04T04:17: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": "47a24f1cafa...
d9d9a588-0099-433e-92e5-b72b64e2d016
keambar/ACM-ICPC
SGU/101.Domino.cpp
#include <cstdio> #include <vector> #include <cmath> using namespace std; const int INF = 211; //Edge记录点对间边的编号 vector<int> Edge[7][7]; int eSum[7], Path[INF], pd[INF]; int n, x, y; int Find (int x, int cur) { if (cur == n) return 1; for (int i = 0; i <= 6; i++){ for (int j = 0; j < Edge[x][i].size(); j++) { int...
ALGO
0.999996
3.401531
{ "github_metadata": { "branch": "code", "commit_count": 280, "repo_created_at": "2015-03-15T12:40:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bb8a7bdeb5...
e7125b24-7e96-4c1d-9c2d-2929369c2eb4
lheckemann/namic-sandbox
QuadEdgeMeshProcessing/Testing/itkQuadEdgeMeshToSphereFilterTest1.cxx
#include "itkQuadEdgeMesh.h" #include "itkVTKPolyDataReader.h" #include "itkVTKPolyDataWriter.h" #include "VNLIterativeSparseSolverTraits.h" #include "itkQuadEdgeMeshParamMatrixCoefficients.h" #include "itkQuadEdgeMeshToSphereFilter.h" int main( int argc, char** argv ) { if( argc != 3 ) { std::cout <<"It ...
ALGO
0.909916
4.488657
{ "github_metadata": { "branch": "master", "commit_count": 7250, "repo_created_at": "2017-12-09T21:14:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b0c33e0...
44a5f4e1-0ab1-4896-8a01-df0fa862c83d
xjxjwan/Fluid_Structure_Interaction
Rigid_Body/DataReconstruct.cpp
// Reconstruction.cpp #include "DataReconstruct.h" #include "AuxiliaryFunctions.h" #include <cmath> double getLimiter(const double& r) { // Minbee if (r <= 0) {return 0.0;} if (r > 0 && r <= 1) {return r;} if (r > 1) {return std::min(1.0, 2.0 / (1 + r));} // // Superbee // if (r <= 0.0) {ret...
ALGO
0.999858
3.269649
{ "github_metadata": { "branch": "main", "commit_count": 37, "repo_created_at": "2025-01-24T00:49:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5456aba44c1...
ff2cb915-37eb-4b89-8d4e-61fc7238b492
NastyBoget/msu_computer_graphics_spring_2020
Ray tracing/main.cpp
#define TINYOBJLOADER_IMPLEMENTATION #define STB_IMAGE_IMPLEMENTATION #define RAYS_PER_PIXEL 4 #define MAX 10000 #include <chrono> #include <thread> #include <functional> #include <algorithm> #include <fstream> #include <vector> #include <cmath> #include "geometry.h" #include "stb_image.h" #include "tiny_obj_loader.h"...
TOOL
0.91768
3.113694
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2020-03-17T08: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": "fae94ad33...
1f252ee1-29ff-4db1-acec-8295d9ede4d2
patelanandec54132/iot
7segment.ino
/* // Define the segment pins const int segmentPins[] = {2, 3, 4, 5, 6, 7, 8}; // Connect to segments a, b, c, d, e, f, g const int numSegments = 7; // Define the digit patterns for 0-9 const byte digitPatterns[10] = { 0b00111111, // 0 0b00000110, // 1 0b01011011, // 2 0b01001111, // 3 0b01100110, // 4 0b0...
TOOL
0.978769
7.028314
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-08-26T17:45: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": "341b83218800...
276ee892-b210-4c3e-aee5-7ecbc98699af
Vassu05/CSES
subarray_sum_queries.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: long long left, right, mx, total; Node() { left = 0, right = 0; total = -1e17; mx = -1e17; } Node(int x) { left = right = mx = total = x; } }; template<typename T> class Seg { #define _l 2 * i + 1 ...
ALGO
0.999953
4.756171
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2024-09-24T19:30:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "caff95348...
93d44857-8b98-4f6c-87c2-c9ae04c32173
garyparrot/Playground
NCTU/2/problemG.cpp
#include <bits/stdc++.h> using namespace std; int main(void){ int t; cin >> t; while(t--){ int n; cin >> n; vector<int> num(2*n); for(int i = 0;i < n;i++) cin >> num[i]; for(int i = 0;i < n-1;i++) num[i+n] = num[i]; const int INF = -6666666; int l = 0, r = 0,...
ALGO
0.999838
3.744182
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2019-06-24T04:19: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": "4dbb78191...
c419d875-32a2-4089-98f5-26c86d8dac43
abojha/Data-Structure
All_Data_Structure/7_Sorting/6_Count_Sort.cpp
#include<iostream> #define size 5 using namespace std; void print_an_array(int *a, int n) { for(int i = 0; i < n; i++) { cout<<a[i]<<" "; } cout<<endl; } int max(int *a, int n) { int max = a[0]; for(int i = 0; i < n; i++) { if(max < a[i]) { max = a[i]; ...
ALGO
0.999854
4.629674
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2022-02-25T08:31: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": "6ae8750a0...
bc669526-1853-4817-99ec-943f55afef63
AdaCompNUS/despot
src/util/gamma.cpp
#include <despot/util/gamma.h> namespace despot { Gamma::Gamma(double k, double theta) { k_ = k; theta_ = theta; } double Gamma::Next() { return Next(k_, theta_); } double Gamma::Next(double k, double theta) { if (k < 1) { double c = 1 / k; double d = (1 - k) * pow(k, k / (1 - k)); double z, e, x; while...
ALGO
0.986772
5.634517
{ "github_metadata": { "branch": "API_redesign", "commit_count": 241, "repo_created_at": "2015-06-26T05:56:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 257, "forks": 105, "issues": 6, "pull_requests": 2 }, "file_meta": { "content_id": ...
6352bd4c-e091-4414-abe4-7d415a982a42
dreyus95/AVSP_SourceQualityPrediction
CodeJamCrawler/dataset/08_18165_25.cpp
#include "my_header.h" class solver { public: vector<int_v> decks; int_v solve(int n, int_v idxs) { decks.resize(n); for (int next = n ; next >= 1 ; next--) get_deck(next, n); int_v deck = decks[0]; int_v res(idxs.size()); repeat(i, idxs.size()) res[i] = deck[idxs[i]-1]; return res; } vo...
ALGO
0.999955
4.251313
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2017-06-08T21:00: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": "79593f1b0...
4aca7bc4-e97f-4024-b0ba-d1157dca3f6a
littlesam95/AlgorithmPractice
백준/Gold/1368. 물대기/물대기.cc
#include <iostream> #include <string> #include <cmath> #include <set> #include <map> #include <stack> #include <queue> #include <vector> #include <algorithm> #include <climits> #define FASTIO cin.tie(NULL); cout.tie(NULL); ios::sync_with_stdio(false); #define MAX 301 #define LL long long #define INF 1e9 using namespac...
ALGO
0.999846
3.8362
{ "github_metadata": { "branch": "main", "commit_count": 933, "repo_created_at": "2024-08-28T00:09:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "937572730f...
26721920-9379-405c-8080-49a5ae2fc803
NSchmidt48067/ic210
lab07/p4.cpp
/********************************************* Filename: p4.cpp Author: MIDN <NAME> (265646) Geographical *********************************************/ #include <iostream> #include <fstream> #include <string> using namespace std; int* read(int N); bool isInOrder(int* A, int N); void print(int* A, int N, int max); in...
ALGO
0.999705
3.612087
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2023-08-18T00:44:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e511f7d84529...
1594b93c-0b7c-4a89-ace8-54ad1889c99e
wolverinezgit/cpsolutions
A_Soroban.cpp
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define mp make_pair #define pb push_back #define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL...
ALGO
0.999565
3.883172
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2021-01-26T17:20:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8fcd5b9bb82...
a2580c5c-8c60-4c83-91d1-87065e0f2d22
miqnni/opus-magnum-cpp
ch08_arrays/array_as_argument.cpp
#include <iostream> #include <cstdlib> #include <ctime> constexpr int ARRAY_SIZE{9100}; // `randomLowerBound` inclusive, `randomUpperBound` non-inclusive void assignRandomValues(long array[], int arraySize, long randomLowerBound, long randomUpperBound); void multiplyAllElements(long array[], int arraySize, int multi...
ALGO
0.997968
4.703053
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2024-07-01T08:25: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": "5a1f469d343...
f9ef4d78-8bcb-47ae-9aae-258d471c1248
da0ran9e/Kryptos-Logos
BlockCipher/CBC-CipherBlockChaining/C++/asm/CBC.cpp
#include <bits/stdc++.h> using namespace std; // IP table const int initialPermutationTable[64] = { 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53...
ALGO
0.999586
5.088027
{ "github_metadata": { "branch": "main", "commit_count": 400, "repo_created_at": "2023-10-18T13:27: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": "0fc175e337...
51ed820c-f397-43dd-9072-30f9e4dfcae0
cran/geocmeans
src/jaccard_idx.cpp
#include "shared_functions.h" #include <cmath> using namespace Rcpp; //' @title Jaccard similarity coefficient //' @name calc_jaccard_idx //' @description Calculate the Jaccard similarity coefficient //' @param x A vector of positive reals //' @param y A vector of positive reals //' @return A double: the Jaccard sim...
ALGO
0.99692
5.752045
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2021-04-21T18:01:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "72ba05bfaaa...
df56457f-4452-4943-a1a9-b4ffd88e70d3
southwestCat/cpg-pulse
optimizer/PSO-CPG-Corr/Src/Correlation.cpp
#include "Correlation.h" #include <cmath> #include <iostream> #include <mutex> using namespace std; recursive_mutex _mtx; #define SYNC lock_guard<recursive_mutex> _lock(_mtx) Correlation::Correlation(float dt) : _dt(dt) { samples = fftw_alloc_real(N); memset(samples, 0, sizeof(double) * N); correlation = fftw_...
ALGO
0.992568
5.262074
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-01-17T23:31:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0c0b6e59a7...
4cf14e76-240b-4a89-93b7-45736439420b
dew0209/Algor
codeforces/八月/01/tempCodeRunnerFile.cpp
#include <iostream> #include <cstring> #include <vector> #include <algorithm> #include <map> #include <set> #define fi first #define se second using namespace std; const int N = 200010,MOD = 1e9 + 7; int q[N]; int main(){ int n;cin >> n; int preOdd = 0; int preEven = 0; int ans = 0; int sumOdd ...
ALGO
0.999934
3.546149
{ "github_metadata": { "branch": "master", "commit_count": 423, "repo_created_at": "2021-09-20T11:43: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": "bdc86ff4...
145c12c0-c5a7-4b4c-82e9-bf0b1f587a09
FrancescoLeone17/Programmi_Jupyter
1/1_3/1_3.cpp
#include <iostream> #include <iomanip> #include <fstream> #include <cmath> #include "random.h" using namespace std; //Random numbers int seed[4]; Random rnd; //Input int Nthr,Nblk, Lblk; double d,L; //Main double teta,y_c; //Averages double blk_av,blk_norm,err; double glob_av,glob_av2,stima; double Nh; //Number of h...
ALGO
0.992853
3.693879
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-09-02T21:46:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "58ac79b7c1...
2babc411-7632-4407-8686-2820da7d6d64
ArghyaB118/Guide2ICPC
Interview/Meta/Scientist-FT/unionIntervals.cpp
// QUESTION // Consider the concept of a 'sorted, non-overlapping interval list' // - which is an array of intervals that don't overlap with each other and are sorted by interval start. // Given two of these interval lists, return a 3rd interval list that is the union of the input interval lists. // For example: //...
ALGO
0.999679
5.647344
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2019-07-24T05:16: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": "6eec2d497...
dd056daf-f15e-401f-aa7b-141a1b29986c
smfaisal/leetcode_problems
restore_ip_addresses.cc
#include <iostream> #include <vector> #include <string> #include <sstream> using namespace std; class Solution { public: void dfs(string s, int st, int dots_left, string cur, vector<string>& res){ if (st >= s.size()) { return; } else if (dots_left == 0) { int n = stoi(s.substr(st)); if (n...
ALGO
0.998996
4.694095
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2015-04-15T23:10: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": "3303ea8154...
948bb259-4879-4b7d-a903-7a1fa8b233a5
UWARG/efs-zeropilot-3.0
AttitudeManager/ControlAlgorithms/Src/AM_FixedControl.cpp
#include "AM_FixedControl.hpp" #include "PID.hpp" #include "CommonDataTypes.hpp" #include "LOS_Link.hpp" #include "LOS_Actuators.hpp" namespace AM { std::vector<ActuatorOutput> FixedControl::runControlsAlgorithm( const AttitudeManagerInput &instructions) { // Current attitude from SF LOS::LosSFData curre...
TOOL
0.967324
6.82893
{ "github_metadata": { "branch": "main", "commit_count": 76, "repo_created_at": "2022-10-10T00:30:17.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 4, "issues": 4, "pull_requests": 7 }, "file_meta": { "content_id": "6b29004b19e8...
fa9ce9fa-69f8-4902-9f72-139c11cdac98
zaedulislam/Online-Judge-Problems-Solution
Codeforces/Codeforces 285C - Building Permutation.cpp
// Codeforces 285C - Building Permutation.cpp ///************************************************************/// #include <iostream> #include <cstdio> #include <string> #include <cstring> #include <sstream> #include <vector> #include <stack> #include <queue> #include <deque> #include <list> #include <map> #include <s...
ALGO
0.999898
3.99278
{ "github_metadata": { "branch": "master", "commit_count": 515, "repo_created_at": "2017-01-18T20:29: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": "432acdff...
87da37ea-3dbb-4740-b01d-173afe2304b3
ezhilselvan1109/CPlusPlus
Task_9/String.cpp
/* Implement a class called String and has two data member str and length and perform the following operations? Note: without using string handling built-in functions Find the length of the string. Concatenate two string objects using operator overloading. Compare two strings. Write an operator function. Find the ...
TOOL
0.962396
4.885356
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-06-13T20:43: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": "2818be418a46...
54b7e509-a331-470c-b30a-67983d8b19d0
RedPalkia06/Vex_Worlds
src/drivetrain.cpp
#include "vex.h" #include "drivetrain.h" #include <iostream> #include "constants.h" #include "math_utils.h" using namespace vex; double Drivetrain::getRotationDegrees() { return 360 - Inertial.heading(degrees); } double Drivetrain::getRotationRadians() { return getRotationDegrees() * Constants::TO_RADIANS; }...
ALGO
0.984698
5.242789
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2024-04-01T15:49: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": "3373aecab42...
d0204bbf-0879-4c60-9ef7-dcebb9f29ecf
Stichting-MINIX-Research-Foundation/minix
external/bsd/libc++/dist/libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------...
TEST
0.956806
7.045227
{ "github_metadata": { "branch": "master", "commit_count": 7153, "repo_created_at": "2014-10-03T08:10:29.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3236, "forks": 1099, "issues": 93, "pull_requests": 25 }, "file_meta": { "content_id": "...
26163160-1bd8-436d-914c-edd42cd5fa12
ethz-adrl/control-toolbox
ct_models/include/ct/models/DoubleInvertedPendulum/generated/jacobians.h
#ifndef CT_DOUBLEINVERTEDPENDULUM_JACOBIANS_H_ #define CT_DOUBLEINVERTEDPENDULUM_JACOBIANS_H_ #include <iit/rbd/rbd.h> #include <iit/rbd/TransformsBase.h> #include <iit/rbd/traits/DoubleTrait.h> #include "declarations.h" #include "kinematics_parameters.h" namespace iit { namespace ct_DoubleInvertedPendulum { templ...
ALGO
0.982607
6.895681
{ "github_metadata": { "branch": "v3.0.2", "commit_count": 1871, "repo_created_at": "2019-04-25T21:55:23.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1596, "forks": 332, "issues": 59, "pull_requests": 4 }, "file_meta": { "content_id": "93...
c6ce4b21-d584-48b7-b1b8-e413b6a00230
rikuTanide/atcoder_endeavor
keyence2019/keyence2019_c.cpp
#include <bits/stdc++.h> #include <cmath> //using namespace boost::multiprecision; using namespace std; typedef long long ll; //typedef unsigned long long ll; const double EPS = 1e-9; #define rep(i, n) for (int i = 0; i < (n); ++i) //#define rep(i, n) for (ll i = 0; i < (n); ++i) //#define sz(x) ll(x.size()) typedef p...
ALGO
0.99999
3.418666
{ "github_metadata": { "branch": "master", "commit_count": 4423, "repo_created_at": "2020-12-05T04:36:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b29d5ef...
3f003fb9-90ed-4ec0-8883-f3dfa248b09b
bayertom/adk_2022_23
cv9/EMS/algorithms.cpp
#include "algorithms.h" #include <cmath> Algorithms::Algorithms() { } double Algorithms::getEuclDistance(double x1,double y1,double x2,double y2) { // Euclidean distance double dx = x1-x2; double dy = y1-y2; return sqrt(dx*dx + dy*dy); } std::tuple<double, double, double> Algorithms::getPointLi...
ALGO
0.999909
4.870475
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2022-09-20T13:07:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2fa32fb42fb...
443e7c18-ca50-44ac-a5a7-4b938d1c1d92
SeekingMini/Coding-Interview
code_cpp_v2/36.cpp
/* * 题目:二叉搜索树与双向链表 * 链接:https://leetcode-cn.com/problems/er-cha-sou-suo-shu-yu-shuang-xiang-lian-biao-lcof/ */ #include <iostream> using namespace std; class Node { public: int val; Node *left; Node *right; explicit Node(int _val) { val = _val; left = nullptr; right = nullptr; } Node(int _val, Node ...
ALGO
0.999992
5.786069
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-09-11T07:53: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": "301894b7fb...
d22ec6d3-db82-48bb-95cd-9d4739c2e755
NgTienHungg/PTIT-Source
TRR 2/6_6_ShortestPathUsingFloydAlgorithm.cpp
#include <bits/stdc++.h> #define inf 1e9 #define null -1 using namespace std; int n; int a[100][100], d[100][100], nex[100][100]; void Init() { cin >> n; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= n; ++j) { cin >> a[i][j]; if (i != j && a[i][j] == 0) a[...
ALGO
0.999745
3.897605
{ "github_metadata": { "branch": "main", "commit_count": 106, "repo_created_at": "2021-07-04T02:14:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 130, "forks": 36, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b39db94...
8738ff49-3ec1-4796-a424-156a369c99a2
sharif-islam/Programming-Contest-Templete
Dijkstra.cpp
#include<bits/stdc++.h> #define pf printf #define sc scanf #define PI 2*acos(0.0) #define fast ios_base::sync_with_stdio(false);cin.tie(0); cout.tie(0) #define mem(a,b) memset(a, b, sizeof(a) ) #define gcd(a,b) __gcd(a,b) #de...
ALGO
0.999994
3.741459
{ "github_metadata": { "branch": "master", "commit_count": 67, "repo_created_at": "2020-05-11T07:13: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": "3275e8746...
71758c53-518d-45bb-9d54-93ce8df02778
Willberg/invoker
cpp/datastructure/list/skiplist/skiplist.h
// // Created by john on 2022/10/8. // // 1206. 设计跳表 https://leetcode.cn/problems/design-skiplist/ #ifndef CPP_SKIPLIST_H #define CPP_SKIPLIST_H #include <iostream> #include <random> #include <vector> using namespace std; constexpr int MAX_LEVEL = 32; constexpr double P = 0.25; struct Node { int val; vecto...
ALGO
0.999358
3.903247
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2021-11-28T14:56:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1f8c33800...
7c67271f-d4ef-48f7-b2ea-1be402eae9f8
md1894/c-ds
dynamicProgramming/DP1/noOfBalancedBT.cpp
/* Code : No. of balanced BTs Send Feedback Given an integer h, find the possible number of balanced binary trees of height h. You just need to return the count of possible binary trees which are balanced. This number can be huge, so return output modulus 10^9 + 7. Write a simple recursive solution. Input Format : Int...
ALGO
0.999984
5.050848
{ "github_metadata": { "branch": "master", "commit_count": 141, "repo_created_at": "2019-10-31T17:31: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": "91dcedc6...
12c6e8f5-0338-4900-9c75-cbcac08b9a0b
raghav-7288/Coding
CSES/Graph/DownloadSpeed.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double ll mod = 1e9 + 7; ll bfs(ll source, ll sink, vector<ll> &parent, vector<ll> adj[], vector<vector<ll>> &cap) { fill(parent.begin(), parent.end(), -1); parent[source] = -2; queue<pair<ll, ll>> q; q.push({source, 1e18...
ALGO
0.999965
4.772527
{ "github_metadata": { "branch": "master", "commit_count": 173, "repo_created_at": "2024-08-09T17:32:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "02cfd56b...
a2fc285c-69c3-46a8-9bcd-aec9ab7f351f
arslaan07/Leetcode
2370-longest-ideal-subsequence/2370-longest-ideal-subsequence.cpp
class Solution { public: // int solve(string& s,int index,int prev,int k, int n, vector<vector<int>>& dp){ // if(index == n) return dp[index][prev] = 0; // if(dp[index][prev]!=-1) return dp[index][prev]; // int inc=0,notinc=0; // if(prev==0 || abs(s[index]-prev)<=k)...
ALGO
0.999842
5.467946
{ "github_metadata": { "branch": "main", "commit_count": 1456, "repo_created_at": "2023-09-30T08:09:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "342810ace...
a3189e49-f177-430f-9378-d61f32a9ad0c
VatsalS31/STRIVER-SDE-SHEET
Stacks/minstack.cpp
class MinStack { public: stack<pair<int,int>>st; MinStack() { } void push(int val) { if(st.empty())st.push({val,val}); else st.push({val,min(val,st.top().second)}); } void pop() { st.pop(); } int top() { r...
ALGO
0.999976
6.04601
{ "github_metadata": { "branch": "main", "commit_count": 91, "repo_created_at": "2024-12-22T06:55: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": "c0fa97c7248...
8ffbc53d-b695-4b8e-be9d-d310019c869b
luoshunchong/Cplusplus-Leetcode
exam/2022.8.20kedaxunfei.cpp
#include <iostream> #include <vector> #include <cmath> using namespace std; float P = 3.1415927; float hanwin(int num, int N) { float res = 0.5 * (1 - cos(2 * P * num / N)); return res; } void check(vector<int>& nums, int N) { for (int i = 0; i < nums.size(); ++i) { float res = (float)nums[i] * ha...
ALGO
0.999576
3.708487
{ "github_metadata": { "branch": "main", "commit_count": 152, "repo_created_at": "2021-06-17T02:48: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": "1852b19bca...
28dfddc4-ec96-4992-806a-94eacc30d08b
banboooo044/AtCoder
ABC022/C.cpp
#include <bits/stdc++.h> #define REP(i,n) for (long i=0;i<(n);i++) #define FOR(i,a,b) for (long i=(a);i<(b);i++) #define RREP(i,n) for(long i=n;i>=0;i--) #define RFOR(i,a,b) for(long i=(a);i>(b);i--) #define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i]) << endl; #define du...
ALGO
0.999928
3.957952
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-01-02T09:05:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4d86b157af...
a3d423a2-2167-404f-ab42-9cceb4836470
UtkarshSinghChouhan/Data-Structures
Program_02_Singly_Linked_list_Operations.cpp
#include<iostream> using namespace std; //A class to create a node of the Linked-list. class Node { public: int data; //represents the 'data' of a node. Node* next; //reprents the 'link' that a node Node(int data) //Constructor to initialize the data-members of the node. { ...
ALGO
0.999708
5.332603
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2022-04-14T03:10: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": "f01a3d8e3...
90ab0b6c-c9a9-455b-9d4d-faff38e275f1
allenxun/NOI
code/ch0107/30.cpp
/* * @Author: allen * @Date: 2023-08-11 * * 30:字符环 * * 总时间限制: 1000ms 内存限制: 65536kB * * 描述 * 有两个由字符构成的环。请写一个程序,计算这两个字符环上最长连续公共字符串的长度。 * 例如,字符串“ABCEFAGADEGKABUVKLM”的首尾连在一起,构成一个环; * 字符串“MADJKLUVKL”的首尾连在一起,构成一个另一个环; * “UVKLMA”是这两个环的一个连续公共字符串。 * * 输入 * 一行,包含两个字符串,分别对应一个字符环。这两个字符串之间用单个空格...
ALGO
0.999917
4.53213
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2023-08-18T23:46: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": "4933d4ba9d...
2624c5e1-376c-48aa-a351-b02a881a7474
mridulgupsss/Problem-Solving-Practice
273-integer-to-english-words/273-integer-to-english-words.cpp
class Solution { public: string intToString(int n){ string ones[20] = {"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"}; string tens[10] = {"Twenty", "Thirty",...
ALGO
0.994821
5.406014
{ "github_metadata": { "branch": "main", "commit_count": 1145, "repo_created_at": "2021-11-25T21:31: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": "5f5ac1c43...
ce9ddd4c-84e5-4db7-afe7-d1af46214d43
inicula/sda-rbt
main.cpp
#include "rbt.h" #include <random> #include <algorithm> #include <ctime> #include <random> #include <chrono> #include <set> #include <climits> void delete_duplicates(auto& vec) { std::sort(vec.begin(), vec.end()); const auto it = std::unique(vec.begin(), vec.end()); vec.erase(it, vec.end()); ...
TEST
0.982618
5.037856
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2021-05-15T16:26:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b98c57dfc87b...
1cc89e41-2e67-4812-830a-892e3a834a94
IsolationKernel/Codes
IK/IK_Implementations/iForest/kernels/Random_Forests/cartree/mx_files/GBCC.cpp
#include <cmath> #include "quickie.h" void GBCC(int M, int N, double* Labels, double* Data, int minleaf, int num_labels, double* bcvar, double* bcval){ double *saved_logs, *sorted_data; double bh, ch; int i, j, cl, nl, mj; int *diff_labels_l, *diff_labels_r, *diff_labels, *sorted_labels; ...
ALGO
0.999983
3.487804
{ "github_metadata": { "branch": "main", "commit_count": 264, "repo_created_at": "2020-12-15T01:41:34.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 51, "forks": 17, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "acd6008ca...
758f3c93-1b24-4752-b708-54baec6c8bad
SmriteePoudel/LeetCode75
LeetCode24.cpp
//String to Integer(atoi) class Solution { public: int myAtoi(string s) { int i = 0; int n = s.length(); // Skip whitespace while (i < n && s[i] == ' ') { i++; } // Handle empty string or only ...
ALGO
0.999794
5.15063
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2025-02-07T15:23:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef6f974e393...
2c2293c9-9e33-45e0-9689-3617801b89d8
supernalu/CP-solutions-and-templates
treningi-konkursy/tr-21-01/wzor.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; constexpr int MAXN = 1e6 + 10; int n; vector<int> adj[MAXN]; ll siz[MAXN]; ll dp[MAXN]; bool vis[MAXN]; void countSize(int v) { siz[v] = 1; for (auto u : adj[v]) { if (siz[u] == 0) countSize(u); siz[v] += siz[u...
ALGO
0.999476
4.021833
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2024-01-05T14:51:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e5178938e1...
e4477b52-a290-4971-883c-77aea97b1db6
Joey-Liu/online-judge-old-version
Liurujia_uva/v2binary_trees/uva 297/uva 297/main.cpp
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string> #include <string.h> #include <math.h> using namespace std; typedef struct Tnode { int color;//0 for white, 1 for black, -1 for parent. -2 for not sure Tnode* sons[4]; }Node; const int maxn = 1024 * 2 + 1000; char treeStrfi[maxn], treeStrs...
ALGO
0.999401
4.02416
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2018-05-07T08:07:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c79352a59d...
e6875e5e-93c0-4506-ba6d-c7d91f3eadce
OgnjenArsenijevic/LeetCode-62-Unique-Paths-solution
Improved Solution.cpp
class Solution { public: int uniquePaths(int n, int m) { //Base case (if we have only 1 row or 1 column than //there is only 1 unique path from start to finish) if(n==1 || m==1) return 1; if(n<=m) { int DP[n][2]; //Filling the values f...
ALGO
0.999953
5.967473
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-10-11T13:30: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": "0da2195ebb...
64a0aa9c-f92a-4306-8772-3b338c5b833b
acm-clan/algorithm-stone
user/leetcode/148. 排序链表.cpp
/* * @lc app=leetcode.cn id=148 lang=cpp * * [148] 排序链表 */ // @lc code=start /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : ...
ALGO
0.999967
6.039912
{ "github_metadata": { "branch": "main", "commit_count": 574, "repo_created_at": "2021-02-18T15:25:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2066, "forks": 620, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3baac...
c0d5ad8b-2036-49cb-a932-eb54268bc6f2
AbhishekSaini1322/LINK_LIST_DSA_CPP
Middle_Of_LinkList.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* middleNode(...
ALGO
0.999489
6.199456
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2024-03-21T06:03: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": "76a55baaa20b...
7a42b8ca-e657-41f3-b224-3774d370860d
Pandey-SaurabhP/CP
Codechef/127/tmp.cpp
#include <bits/stdc++.h> using namespace std; vector<int> primeFactors(int n) { vector<int> factors; while (n % 2 == 0) { factors.push_back(2); n = n / 2; } for (int i = 3; i <= sqrt(n); i = i + 2) { while (n % i == 0) { factors.push_back(i); n = n / i; ...
ALGO
0.999923
5.158615
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2023-04-13T08:49:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "10cfcebf0d...
ea1789e1-f66d-4aba-8b99-2a83b72c059a
dofo-eat/Code_Learned
1.代码/2.数据结构/11.heap_sort.cpp
/************************************************************************* > File Name: 11.heap_sort.cpp > Author: dofo-eat > Mail:<EMAIL> > Created Time: 2020年02月18日 星期二 19时24分33秒 ************************************************************************/ #include<stdio.h> #include<stdlib.h> #include<time.h> #def...
ALGO
0.999863
4.545595
{ "github_metadata": { "branch": "master", "commit_count": 150, "repo_created_at": "2019-11-26T12:54:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "600f287d...
969f8a8d-8c3e-4ea7-9639-cf5a3f65c19d
laiyoufafa/developtools_hiperf
include/virtual_thread.h
/* * Copyright (c) 2022 Huawei Device Co., Ltd. * 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 ...
TOOL
0.90293
6.821925
{ "github_metadata": { "branch": "OpenHarmony_filemanager_develop_20220505", "commit_count": 102, "repo_created_at": "2023-04-11T09:16:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_me...
00b33e8e-b937-4847-b4ec-1bf889d3df72
pierobot/mangapp-server
src/mangaupdates.cpp
#include "mangaupdates.hpp" #include "http_utility.hpp" #include <algorithm> #include <iostream> #include <utf8/utf8.h> namespace { enum junk_type { NAME_SEARCH = 0, ARTIST_AUTHOR, }; static std::string & find_remove_junk(std::string & str, junk_type type) { static std::p...
TOOL
0.951332
5.706155
{ "github_metadata": { "branch": "master", "commit_count": 202, "repo_created_at": "2016-01-07T19:41:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 11, "pull_requests": 0 }, "file_meta": { "content_id": "6a7accc...
e1447219-6a42-4cb5-8a2a-5f780d2998d4
star-bnl/star-sw
StRoot/StarRoot/TRSymMatrix.h
#ifndef ROOT_TRSymMatrix #define ROOT_TRSymMatrix #include "TRArray.h" #include <assert.h> class TRMatrix; class TRVector; class TDiagMatrix; class TRSymMatrix : public TRArray { public: TRSymMatrix(Int_t nrows=0) : TRArray(nrows*(nrows+1)/2), fNrows(nrows) {} TRSymMatrix(Int_t nrows,const Double_t *Array); TRSy...
ALGO
0.979641
5.374921
{ "github_metadata": { "branch": "main", "commit_count": 38269, "repo_created_at": "2020-11-12T22:30:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 29, "forks": 66, "issues": 9, "pull_requests": 29 }, "file_meta": { "content_id": "63fd51...
53a87d17-89db-40b5-b54c-ca8b2e00e9ba
Kitware/ParaView
VTKExtensions/FiltersGeneral/vtkSliceAlongPolyPlane.cxx
// SPDX-FileCopyrightText: Copyright (c) Kitware Inc. // SPDX-FileCopyrightText: Copyright (c) <NAME>, <NAME>, <NAME> // SPDX-License-Identifier: BSD-3-Clause #include "vtkSliceAlongPolyPlane.h" #include "vtkAppendArcLength.h" #include "vtkCellArray.h" #include "vtkCleanPolyData.h" #include "vtkCompositeDataIterator....
ALGO
0.909841
6.885249
{ "github_metadata": { "branch": "master", "commit_count": 84523, "repo_created_at": "2010-04-30T14:15:24.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1465, "forks": 444, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "22...
11729d62-a2d8-41c4-9f57-f48080f4c717
thiago9864/grafos2019_1
membros/gabriele/grafo/Grafos/grafo.cpp
#include <iostream> #include "grafo.h" #include"no.h" #include"aresta.h" using namespace std; Grafo::Grafo() { this->direcional = false; this->ponderadoAresta = false; this->ponderadoNo = false; this->listaNos = nullptr; } Grafo::Grafo(string entrada, string saida) { this->direcional = false; ...
ALGO
0.986876
4.547757
{ "github_metadata": { "branch": "master", "commit_count": 149, "repo_created_at": "2019-03-22T21:13: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": "79a0a2e3...
9310a854-d6cd-48c7-840a-f792007a8b68
bartandrews/DiagHam_Stability
trunk/FQHE/src/Hamiltonian/AbstractQHEOnCylinderHamiltonian.cc
//////////////////////////////////////////////////////////////////////////////// // // // // // DiagHam version 0.01 ...
ALGO
0.957176
3.94194
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2022-07-12T10:41:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "051700ef9c2...
dfd2a8f8-8663-423e-b09c-70023b854612
PedroRonzani18/Programacao_Competitiva
LibNova/Codigo/Grafos/kuhn.cpp
// Emparelhamento Max Grafo Bipartido (Kuhn) // // Computa matching maximo em grafo bipartido // 'n' e 'm' sao quantos vertices tem em cada particao // chamar add(i, j) para add aresta entre o cara i // da particao A, e o cara j da particao B // (entao i < n, j < m) // Para recuperar o matching, basta olhar 'ma' e 'mb'...
ALGO
0.999908
4.643538
{ "github_metadata": { "branch": "main", "commit_count": 177, "repo_created_at": "2023-03-05T13:29:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e13925be37...
cc678eef-51c2-47f0-b8a5-e22224d2fb15
pippoox/progetto2024-pippo-pelaz
boids.hpp
#ifndef B_BOIDS_HPP #define B_BOIDS_HPP #include <cmath> #include <vector> namespace b { struct vettore { double x; double y; vettore(double x_ = 0, double y_ = 0) : x(x_), y(y_) {} vettore operator+(vettore const& v) const; vettore operator-(vettore const& v) const; vettore operator*(double a) const; d...
ALGO
0.997022
5.457389
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-05-06T14:23: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": "b6d234445e13...
a7ffb139-b60d-4fe8-b0db-b131e75399cc
Imran4424/LeetCode-Solutions
Graph/TopologicalSort/207.CourseSchedule.cpp
/* There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course bi first if you want to take course ai. For example, the pair [0, 1], indicates that to take course 0 you h...
ALGO
0.99953
6.332187
{ "github_metadata": { "branch": "master", "commit_count": 1499, "repo_created_at": "2020-01-02T20:24:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2e09782...
bef48ac0-d495-4866-a38b-f4fff2045cd7
coodig/CPP_DSA
numSys.cpp
#include <iostream> using namespace std; int main() { // // dec to bin num converstion // int ans = 0; // int decNum; // cin >> decNum; // int pow = 1; int rem; // while (decNum > 0) // { // rem = decNum % 2; // cout << "remainder" << rem << endl; // decNum = dec...
ALGO
0.999882
4.385226
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-05-26T17:49:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2d1a2bb7266d...
04db3be8-3647-4481-9875-3f0bda582eef
akms-limon/Contest_Problem_Solving
Onsite/ICPC 2024/Preli/e.cpp
/** * author: <NAME> * created: 09-November-2024 17:52:10 **/ #include <bits/stdc++.h> #define ll long long using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t; cin >> t; int cs = 1; while (t--) { ll n, k; cin >> n >> k; ...
ALGO
0.999691
5.013624
{ "github_metadata": { "branch": "main", "commit_count": 59, "repo_created_at": "2023-06-13T20:46: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": "ca08dd0fce7...
0ee927af-546f-4fd0-85cd-92a6993cc85f
clairos/uffs-cc
grafos/moodle/tarefa01/Grafo.cpp
// Tarefa 01 - Grafo - Listas de Adjacencia // GEN254 - Grafos - 2024/1 // Nome: <NAME> // Matricula: 2121101054 #include "Grafo.h" #include <iostream> using namespace std; Grafo::Grafo(int num_vertices) { if (num_vertices <= 0) { throw invalid_argument("Número de vértices deve ser maior que zero.")...
ALGO
0.993962
6.081358
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2024-03-18T12:09: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": "01cca3a32...
22775a5d-2123-4e7e-b3d6-7a28035a090e
krishnashah122/DSA-Practice
12. Binary Tree/2. Binary Tree - II/Same-Tree.cpp
// Same Tree (Leetcode) // Leetcode Link : https://leetcode.com/problems/same-tree/description/ // Time Complexity : O(n) // Space Complexity : O(1) /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), ...
ALGO
0.999958
7.309042
{ "github_metadata": { "branch": "main", "commit_count": 64, "repo_created_at": "2023-06-10T12:33: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": "309207f2842...
63700e92-7dd8-407c-be13-4fb44e17bd3b
aunDominic/Codeforces
Binary Search And Sorting/MaxMedian.cpp
#include "bits/stdc++.h" #include <iostream> using namespace std; typedef long long ll; pair<ll,ll> operator+(const pair<ll,ll> &f, const pair<ll,ll> &s){ return {f.first + s.first, f.second + s.second}; } pair<ll,ll> operator*(const pair<ll,ll> &f, const ll &s){ return {f.first * s, f.second * s}; } int mai...
ALGO
0.99996
4.001285
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-07-07T10:19: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": "b3958a6a9521...
e6513b82-f796-4798-89ec-4099fa62eb5b
ShakilRahman768/XPSC-Solve
Week 6/Day 5/The Playboy Chimp.cpp
#include <bits/stdc++.h> using namespace std; int tallest(int arr[], int n, int x) { int l = 0, r = n - 1, mid, ans = -1; while (l <= r) { mid = (l + r) / 2; if (x < arr[mid]) { ans = arr[mid]; r = mid - 1; } else { l = mid ...
ALGO
0.999989
4.671836
{ "github_metadata": { "branch": "main", "commit_count": 169, "repo_created_at": "2024-03-16T14:23: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": "0d3b7844a0...
a6e0b20a-ee22-4496-8deb-f68cb60793e9
dayat81/opengl-sphere
sphere/SphereHandler.h
#pragma once #include <vector> #include <random> #include <glm/glm.hpp> #include "Sphere.h" #include "SphereMesh.h" #include "SphereSpawner.h" /** * @brief Central manager for sphere simulation and rendering * * This class coordinates all sphere-related functionality: * - Physics simulation for multiple spheres ...
ALGO
0.930372
7.795036
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-05-05T06:38: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": "8f23e694c083...
1ecbb538-f3ef-4091-b402-1aa2dd7088cc
dufferzafar/interview
C++ STL/next_permutation.cpp
/** * Using the next_permutation function from <algorithm> * * https://www.geeksforgeeks.org/stdnext_permutation-prev_permutation-c/ * * --- * * Can be used to solve questions that demand the next lexicographic permutation: * * Like: https://www.geeksforgeeks.org/find-next-greater-number-set-digits/ * */ #i...
ALGO
0.999796
4.757935
{ "github_metadata": { "branch": "master", "commit_count": 226, "repo_created_at": "2015-08-26T17:41:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 30, "forks": 13, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c593cd...
a9aac222-8ebc-4e8a-a59f-4c6662a7d00d
Igorjan94/CF
trains/neerc/neerc.ifmo.ru.train.2015.10.20/G.cpp
#include <iostream> #include <cstdio> #include <bits/stdc++.h>   using namespace std;   int main() {     int n, m, k = 10001;     scanf("%d", &n);       vector<pair<int,int>> g;       for (int i = 0; i < n; i++)     {         int x, y;         scanf("%d%d", &x, &y);         g.push_back({x, y});     }         vector<vec...
ALGO
0.999964
3.952568
{ "github_metadata": { "branch": "master", "commit_count": 748, "repo_created_at": "2014-04-24T20:52: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": "29e2cc26...
8e414a09-bf76-43c7-8cdb-657037d5c534
stonewinter/LeetcodeEx
cpp_LeetCode_algo_124.cpp
///* //找出树中node之和最大的path, 并返回且只返回此最大值,无需标注path nodes //每个node不能访问两次 //*/ // ///* //解法: //弄一个函数f(node), 作用为返回此节点处能找到的最大值 //然后用总根节点层层递归即可,辅以memorization //*/ // //#include <iostream> //#include <stdlib.h> //#include <unordered_map> //#include <list> //#include <vector> //#include <cmath> // //using namespace std; // //st...
ALGO
0.999981
4.911008
{ "github_metadata": { "branch": "master", "commit_count": 78, "repo_created_at": "2017-11-26T08:47:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8cd2e9308...
23294607-146c-43fb-aa95-26d9bbb301a0
Yu0727Harada/pro_con
ABC/ABC129/b.cpp
// // Created on 2020/05/09. // #include <iostream> // cout, endl, cin #include <string> // string, to_string, stoi #include <vector> // vector #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple, make_tuple #include <cstdint>...
ALGO
0.99993
3.85075
{ "github_metadata": { "branch": "master", "commit_count": 142, "repo_created_at": "2020-08-09T08:23: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": "cb57d9df...
a8609423-fa7f-4922-bc54-94d26e7adb80
satyampandey9811/competitive-programming
2. Leetcode/medium level/365. ways to split array into three subarrays.cpp
// link to question - https://leetcode.com/problems/ways-to-split-array-into-three-subarrays/ class Solution { public: int go(int s, int e, vector<int>& a, vector<int>& b) { int mid, ind = e + 1, l = s; while(s <= e) { mid = (s + e) / 2; if(b[mid+1] - b[l] >= b[l]) { ...
ALGO
0.999968
4.993123
{ "github_metadata": { "branch": "master", "commit_count": 1478, "repo_created_at": "2019-08-20T10:43: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": "2d6157d...
38186864-c9fa-447c-ab00-1c924ec90b55
AnthonyNeu/LeetCode
C++/3Sum Smaller.h
/* Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + nums[j] + nums[k] < target. For example, given nums = [-2, 0, 1, 3], and target = 2. Return 2. Because there are two triplets which sums are less than 2: [-2, 0, 1...
ALGO
0.999998
6.258575
{ "github_metadata": { "branch": "master", "commit_count": 258, "repo_created_at": "2015-01-19T06:36:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ad369e93...
dad2e252-009a-442f-a9fc-f2175edbda3b
ElementSnow10/AoC_24
Solutions (C++)/aoc5a.cpp
#include <bits/stdc++.h> using namespace std; // Function to parse a line of comma-separated integers into a vector<int> vector<int> parseUpdate(const string &line) { vector<int> result; stringstream ss(line); string token; while (getline(ss, token, ',')) { result.push_back(stoi(token)); } ...
ALGO
0.999991
6.019096
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-12-20T04:53: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": "52b56066531...
764695f8-8e89-477b-aa95-cb815c916877
moozunch/huppy-cpp
Dasar 23 - Latihan Deret Fibonacci/Dasar23.cpp
#include <iostream> using namespace std; // Deret Fibonacci // f_n = f_n1 + f_n2 int main () { system ("cls"); int a, fn1, fn2, fn; cout << "Masukkan batas bilangan: "; cin >> a; //inisialisasi nilai awal cout << "Masukkan deret pertama: "; cin >> fn1; cout << "Masukkan deret kedua: ";...
ALGO
0.999038
3.855585
{ "github_metadata": { "branch": "main", "commit_count": 158, "repo_created_at": "2023-12-27T14:59: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": "a6d266ca18...
51c3ac5d-4fe7-4336-b197-27c796066022
simbody/simbody
examples/UserGuide.cpp
/* -------------------------------------------------------------------------- * * Simbody(tm): SimTKmath * * -------------------------------------------------------------------------- * * This is part of the SimTK biosimulation toolkit originating from * ...
ALGO
0.999933
5.641403
{ "github_metadata": { "branch": "master", "commit_count": 5026, "repo_created_at": "2013-08-16T00:21:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2427, "forks": 483, "issues": 136, "pull_requests": 21 }, "file_meta": { "content_id": "...
9ba4bd5f-23db-434d-ad68-18a15a87d7ed
Asif-EWU/UVA
12071.cpp
#include<bits/stdc++.h> #define fl(n) for(int i=0; i<n; i++) #define pb push_back #define ll long long int #define inf 1/0.0 #define sf scanf #define pf printf #define nl printf("\n") #define fin freopen("input.txt", "r",...
ALGO
0.999226
3.268683
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-07-16T13:31:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "463b7af744...
49193469-c272-4089-912f-5622dabb1b9f
Netzhangheng/leetcode
牛客网-计算机考研复试/整数拆分/main.cpp
/** 记f(n)为n的划分数,我们有递推公式: f(2m + 1) = f(2m), f(2m) = f(2m - 1) + f(m), 初始条件:f(1) = 1。 证明: 证明的要点是考虑划分中是否有1。 记: A(n) = n的所有划分组成的集合, B(n) = n的所有含有1的划分组成的集合, C(n) = n的所有不含1的划分组成的集合, 则有: A(n) = B(n)∪C(n)。 又记: f(n) = A(n)中元素的个数, g(n) = B(n)中元素的个数, h(n) = C(n)中元素的个数, 易知: f(n) = g(n) + h(n)。 以上记号的具...
ALGO
0.999956
3.823518
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2018-03-19T12:10: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": "18c7bb673...
4d82b625-eb29-4725-8d37-b054019f4f43
OlegRS/ERGMs
AKS_model/main_sim/tau1_scanning.cpp
#include "../../GraphOS/src/matrices/A_matrix.hpp" #include "../../GraphOS/src/aux_math.hpp" #include "../../GraphOS/src/matrices/col_vector.tpp" #include "../../GraphOS/src/matrices/matrix.tpp" #include "../../GraphOS/src/matrices/symm_matrix.tpp" #define N_NODES 200 #define N_ITERS_INIT (N_NODES*(N_NODES-1)/2*10) #d...
ALGO
0.946137
4.715959
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2021-04-23T16:39: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": "dc6066254350...
2e151fb6-8307-4055-9ece-5fc220e3811e
luluwu516/DataStructures
Hash/ChainingDemo.cpp
#include "Chaining.cpp" // function prototype void printMenu(); int main() { // declaration Chaining chaining(5); int choice, key; std::string value, res; bool isRunning = true; while (isRunning) { printMenu(); cout << "Enter your choice: "; cin >> choice; switch (choice) { case 1:...
ALGO
0.995399
3.138632
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2024-08-27T04:20:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ec58e0d9fa4...
e8e789af-c051-4877-93a4-a64261ff2a0b
gptjddldi/Algorithm
Algorithm/21.04/MergeTwoSortedList.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ // Merge Sort 그대로 쓰면 됨 ㄹㅇㅋㅋ class Solution { publi...
ALGO
0.999974
6.208837
{ "github_metadata": { "branch": "main", "commit_count": 69, "repo_created_at": "2021-01-14T06:46:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "72a5a0f5d12...
a9c645a0-ee30-4afb-9096-b15fd73e15c0
SanskarSinghRajput/DSA-For-Placements
Lecture105 Dynamic Programming/MaxSumofNonAdjacentElements.cpp
#include <bits/stdc++.h> int solveRec(vector<int> &nums,int n){ //base case if(n<0) return 0; if(n==0) return nums[0]; int incl = solveRec(nums,n-2) + nums[n]; int excl = solveRec(nums,n-1) + 0; return max(incl,excl); } int solveMem(vector<int> &nums,int n,vector<int> &dp){ //...
ALGO
0.999973
5.011375
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2024-01-22T14:51: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": "80127e809fcb...
0823f86f-6fc2-4097-87ca-d0ca481bf759
ruslancheb/juliakernel
juliakernel/sandbox/keylogger/src/logkeys.cc
/* Copyleft (ɔ) 2009 Kernc This program is free software. It comes with absolutely no warranty whatsoever. See COPYING for further information. Project homepage: http://code.google.com/p/logkeys/ */ #include <cstdio> #include <cerrno> #include <cwchar> #include <cstring> #include <fstream> #include <sstream...
TOOL
0.942028
4.902152
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2014-03-21T15:27:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "25443a467...