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
de3ab3aa-c6da-4d8b-8074-538edb540dce
CJSBinder-User/CJSBinder
experiment/correctness_efficiency/cjsbinder/FIND_A_TRIPLET_THAT_SUM_TO_A_GIVEN_VALUE/FIND_A_TRIPLET_THAT_SUM_TO_A_GIVEN_VALUE_GLUECODE.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <iostream> #include <fstream> #include "include/libplatform/libplatform.h" #include "include/v8.h" #include "CQuesHeader.h" using namespace v8; void Print(const FunctionCallbackInfo<Value>& args){ v8::Isolate* isolate = args.GetIsolate(); v8::Str...
TOOL
0.983264
4.142497
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2023-04-15T02:32: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": "cc112c6246c...
1bc517e4-dc69-427b-b7aa-22c6b793d3e5
catch4/Song
2020/week2/2504_bracket.cpp
/* Catch study 2주차 백준_2504 괄호의 값 https://www.acmicpc.net/problem/2504 */ /* 풀이 밑에 (1.)과 (2.)의 이유로 stack으로 구현 최대 길이는 30이므로 시간초과는 신경 쓰지 않음 틀렸던 이유 - in_bracket함수에서 비교를 == i 로 하고 있었음. - 여는 괄호로 끝나는 경우에 대한 예외처리 안함. 1. 괄호가 올바른지 판단 => 가장 최근 여는 괄호 판단 => 후입선출 2. +와 x 판단하기 위해 층으로 표시, 층은 cnt 선언해서 계산 => pair의 first = ...
ALGO
0.9999
4.959989
{ "github_metadata": { "branch": "master", "commit_count": 183, "repo_created_at": "2020-06-01T10:04:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "54288e2f4...
fd0e629b-158f-4578-9dfe-08af232e6eb7
aaafwd/Online-Judge
Volume 003 (300-399)/352.cpp
/* @JUDGE_ID: 19899RK 352 C++ "By Anadan" */ // The Seasonal War // Accepted (0.000 seconds with low memory spent) #include <stdio.h> char map[26][26]; void geteagle(int i, int j){ map[i][j] = 0; if (i){ if (map[i-1][j] == '1') geteagle(i-1, j); if (map[i-1][j+1] == '1') geteagle(i-1, j+1); if (j && map[i-1]...
ALGO
0.999671
3.781862
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2021-04-11T10:48: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": "859cff19f12...
6d87a7ef-c510-469a-b345-427987db6c13
ZhiquanW/ECS-050
ECS050-Homework/HW1/ScientificFloating/scientificFloating.cpp
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> digits; float f; cout << "Please enter a float: "; cin >> f; if(f==0){ cout << "0E0"; return 0; } unsigned int flo...
ALGO
0.999321
3.923979
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-10-04T00:36:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fbd744ccf0...
8752d22c-6af3-4193-b63b-37ec694aef77
nadimnesar/Online-Judges-Accepted-Solutions
LightOJ/1328/37513686_AC_424ms_3472kB.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define llu long long unsigned int #define endl '\n' #define in insert #define ppb pop_back #define ppf pop_front #define pb push_bac...
ALGO
0.999768
3.832794
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2023-05-30T19:43:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71ade95941...
91b93e2b-25e1-42e1-b179-bdd1ae032a6b
npu-ius-lab/DbMOT
trackers/dbmot_3dmm/src/projection.cpp
#include "projection.h" Eigen::Matrix4d to_matrix(const Eigen::Vector3d T, const Eigen::Quaterniond R_) { Eigen::Matrix3d R = R_.normalized().toRotationMatrix(); Eigen::Matrix4d matrix = Eigen::Matrix4d::Identity(); matrix.block<3,3>(0,0) = R; matrix.block<3,1>(0,3) = T; // std::cout << matrix << s...
ALGO
0.992335
5.109428
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2024-05-10T12:42:20.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "393c83de4817...
334dc8eb-024e-47bd-ad95-959fc60f5063
ashhalll/DSA-Part-1
sLL.cpp
#include <iostream> using namespace std; class Node{ public: int data; Node *next; Node() { data=0; next = nullptr; } Node(int n) { data=n; next=nullptr; } }; class SinglyLinkedlist{ public: Node *head; SinglyLinkedlist() { ...
ALGO
0.999863
5.196353
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-27T17:57: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": "41bd9eea49c4...
c584b43e-aace-41b7-baff-d1bbb255013f
KshitijShinde/competitive-programming-using-c-
expt 8 reversing a string/main.cpp
#include <bits/stdc++.h> using namespace std; // Function to reverse a portion of the string void reverse(string &s, int start, int end) { while (start < end) { swap(s[start], s[end]); start++; end--; } } // Function to reverse the order of words in the string void reverseWords(string ...
ALGO
0.999993
5.668938
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-04-22T15:01:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "117196d5322d...
a5dea3e4-1111-4c7a-8cfb-d90e0c7641a4
NahinIntesher/DSA
DSA 2 LAB/Lab 04_Greedy/Light OJ Solve/10_Mafia.cpp
#include<bits/stdc++.h> using namespace std; int root[10003], mafia[10003]; vector<int> g[10003]; int dfs(int u, int p) { int re=0; for(int v: g[u]) { re += dfs(v,u); } re += abs(mafia[u] - 1); mafia[p] += mafia[u] - 1; return re; } int main() { int T, n; cin >> T; for...
ALGO
0.99982
4.20945
{ "github_metadata": { "branch": "main", "commit_count": 82, "repo_created_at": "2023-08-23T07:55:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "60c1c02e3fa...
0bcac11b-d2e5-4abf-bb87-fea93822dfba
khaledsliti/CompetitiveProgramming
Codeforces/CF1783/A.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define endl '\n' #define D(x) cerr << #x << " = " << (x) << '\n' #define sz(x) ((int)(x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() typedef long long ll; void solve() { int n; cin >>...
ALGO
0.99992
3.98283
{ "github_metadata": { "branch": "master", "commit_count": 454, "repo_created_at": "2019-02-20T20:20:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d3f9774c...
7249171c-6cc1-43b6-bcae-4036d2d8f417
NichiporukRoman/BSU-Projects
3rd-Term/OS/Lab-6/window/Processors/User/main.cpp
#include<iostream> #include <windows.h> #include <winbase.h> #include <tlhelp32.h> #include <string> #include <vector> #include <thread> #include <chrono> #include <algorithm> void setEnvironmentVariableToKill(LPCWSTR value) { if (!SetEnvironmentVariableW(L"PROC_TO_KILL", value)) { std::cerr << GetLast...
TOOL
0.905406
4.147872
{ "github_metadata": { "branch": "main", "commit_count": 129, "repo_created_at": "2023-09-29T08:19: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": "b8ec177efa...
357e6bd0-4fc9-464a-84a5-a2acf39485ab
gabeoh/CarND-P09-PidController
src/ParamOptimizer.h
/** * ParamOptimizer.h * * Parameter optimizer using twiddle algorithm * * Created on: Nov 19th, 2018 * Author: <NAME> */ #ifndef PID_PARAMOPTIMIZER_H #define PID_PARAMOPTIMIZER_H #include <vector> #include <iostream> using namespace std; class ParamOptimizer { // Number of parameters int num_params; ...
ALGO
0.973452
6.060943
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2018-11-18T17:13: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": "8a02dc46f3...
21903471-8681-4e84-ae52-f5ef465f1299
Pallavikemburu/GeekforGeeks
Easy/Xoring and Clearing/xoring-and-clearing.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: void printArr(int n, int a[]) { // Your code for printing array here for(int i=0;i<n;i++) { cout...
ALGO
0.99887
5.550642
{ "github_metadata": { "branch": "main", "commit_count": 579, "repo_created_at": "2024-01-05T16:08: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": "610b3c477c...
d5d64093-ce66-478a-8077-8c8f12cb9720
Malak-Alaabiad/Tic-Tac-Toe-Games-with-CPP
FourInRow.cpp
// => ** FCAI-CU – CS213 - Object Oriented Programming – 2024 - Assignment ( 2 ) ** <= // => Last Modification Date: 15/12/2024 // => Under supervision of : Dr.<NAME> // => File Name : CS213_A2_20230417_20230621 // => Purpose : XO Games using C++ // => Authors : <NAME> => ...
ALGO
0.961728
5.75897
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-12-10T01:25:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1831cbb1574f...
9a5e99be-0db2-44ad-9e1d-866d2dfd5293
leostd/Competitive-Programming
WorkInProgress/Codeforces - Codeforces Round #738 (Div. 2)/B. Mocha and Red and Blue/main.cpp
#pragma GCC diagnostic ignored "-Wunused-const-variable" #ifdef MAC #include <iostream> #include <vector> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <queue> #include <bitset> #include <random> #include <chrono> #include <complex> #include <algorithm> #include <utility> #in...
ALGO
0.999995
4.221899
{ "github_metadata": { "branch": "master", "commit_count": 122, "repo_created_at": "2017-04-09T05:24:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f4aeaf72...
bee1b240-d03a-4e29-9496-d99dd934d665
Paradixes/Data_Structure_Based_on_Cpp
Weekdays&Weekends/main.cpp
#include <iostream> #include <string> #include "TNewDate.h" #include "TMyDateList.h" #include "TMyDateList.cpp" using namespace std; bool InWeekDay(TMyDateList<TNewDate> & Weekends, TNewDate &Date1, TNewDate &Date2); bool AddWeekDay(TMyDateList<TNewDate>& Weekends); bool AddWeekend(TMyDateList<TNewDate>& Weekends, TNe...
TOOL
0.985603
4.602012
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-12-06T06:30: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": "528df35da3...
249e2f06-972a-46e2-9d41-5840e82e5941
Zumi002/AdventOfCode
AdventOfCode2023/Days/Day13/Day13.cpp
#include "../../Utility/SupportFunc.h" #include "Day13.h" vector<vector<int>> PointsOfIntrest(vector<string> &pat,int skipX,int skipY) { vector<vector<int>> points(2); for (int j = 0; j < pat[0].size() - 1; j++) { if (pat[0][j] == pat[0][j + 1]&&j!=skipX)points[0].push_back(j); } for (int i = 1; i < pat.size()...
ALGO
0.999941
4.649076
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2022-12-02T17:23: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": "2ef1158c3...
15a01d9e-2c57-411d-81fb-9e8ab106b18b
Logesh-R/Competitive-Programming
Leetcode/leetcode_84.cpp
//84. Largest Rectangle in Histogram //Explaination - https://youtu.be/ZmnqCZp9bBs #include <algorithm> using namespace std; class Solution { stack<int> stackie; int maxArea, currentArea, i, k, top, n; public: Solution(){ //to speedup the runtime std::ios::sync_with_stdio(false); ...
ALGO
0.999917
6.108633
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2019-01-13T10:45: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": "bc7c2bee3...
ebf989ad-789a-4b97-a4eb-0cd9267af09d
reminisce/leetcode-solutions
c++/majority_element.cpp
/* Given an array of size n, find the majority element. The majority element is * the element that appears more than ⌊ n/2 ⌋ times. You may assume that the * array is non-empty and the majority element always exist in the array. */ #include <cstdlib> #include <vector> using namespace std; class Solution { public:...
ALGO
0.999898
6.437424
{ "github_metadata": { "branch": "master", "commit_count": 494, "repo_created_at": "2015-07-13T06:45: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": "031b401f...
8d8d83c9-3058-46d4-9a25-7dd46d3a4a33
Garker-gan/NewCode_SourceCode
numberSquence.cpp
/* 使用KMP算法做数字串匹配(含暴力匹配) Garker-gan 2020-10-19 */ #include<iostream> using namespace std; #define MAX 1000000 #define max 10000 int NextTable[max]; int Text[MAX]; int Pattern[max]; //遍历模式串获取next数组,数组从1开始存储 void getNextTable(int m) { int j = 0; NextTable[j] = -1; int i = NextTable[j]; wh...
ALGO
0.999962
4.376429
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2020-09-22T03:13:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9c340ba87...
643d9984-e665-4e84-aa4f-d05035574b07
hxy513696765/OpenCV-laser-projection-virtual-keyboard
OpenCV Test/Code.cpp
//#include "stdafx.h" #include <cv.h> #include <highgui.h> #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include <stdio.h> #include <stdlib.h> //#include<WinUser.h> #include<Windows.h> using namespace cv; using namespace std; Mat src; Mat src_gray; IplImage* bin...
TOOL
0.971529
3.636007
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2016-11-03T01:08:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 36, "forks": 10, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "318478bf...
87c689e6-e1d3-40d6-a4de-ca749e3f7802
instr3/BZOJ-solution-legacy
A1300/1300大数计算器.cpp
#include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <iomanip> using namespace std; #define each(i,n) (int i=1;i<=(n);++i) int na,nc,nb; int twc; long double res; int nprime[100000],pnp; bool ptable[1001001]; void preprime() { memset(ptable,true,...
ALGO
0.999644
3.400891
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-09-26T03:18: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": "6090d901a9...
823ae881-d531-4ce2-8003-de93ebbc20e5
rkcraushan333/competitive-programming
2023/codeforces/Div 2/#861/B_Playing_in_a_Casino.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define int long long #define v64 vector<int> #define vp64 vector<pair<int, int>> #define p64 pair<int, int> #define forn(i, a, b) for (int i = a; i < b; i++) #define p...
ALGO
0.99998
3.566807
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2023-01-31T14:46:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a8d42cbb7a5...
bb539deb-f689-4b6c-bb1b-33b518ade92b
Connorbelez/leetCodeGrind
stack/LargestRectInHist.cpp
// // Created by <NAME> on 2023-02-24. // #include <vector> #include <iostream> using namespace std;; // //Given an array of integers heights representing the //histogram's bar height where the width of each bar //is 1, return the area of the largest rectangle in the histogram. class Solution { public: int largest...
ALGO
0.999894
6.989238
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2023-02-19T18:54: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": "b11d073d119...
89496fdb-fdc8-4d03-86dd-cd12a689a15b
icaros-usc/libada
src/ada_description/AdaHandKinematicSimulationPositionCommandExecutor.cpp
#include "libada/AdaHandKinematicSimulationPositionCommandExecutor.hpp" #include <dart/collision/fcl/FCLCollisionDetector.hpp> namespace ada { constexpr std::chrono::milliseconds AdaHandKinematicSimulationPositionCommandExecutor::kWaitPeriod; constexpr int AdaHandKinematicSimulationPositionCommandExecutor::k...
TOOL
0.903192
7.385808
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2019-09-15T05:45:27.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f0110ada63...
850e887f-e38c-467c-8560-76577347f8c4
itsisha99/mnc
6_DVR_final.cpp
#include <iostream> using namespace std; struct node //node to store routing information { int via[20]; int dist[20];//via and dist, each of size 20, to store the next hop and distance information for each node. }; int main() { node n[20];//node structures to store routing information for each node i...
ALGO
0.999951
4.107563
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-11-28T21:40: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": "c3943e3db252...
60e07d3d-aadf-4755-89a5-617138b7ec65
Suraj-Kumar-132/DS_Notes_Code
nQueenproblem.cpp
#include<bits/stdc++.h> using namespace std; bool isSafe(int **arr, int x,int y, int n) { for(int row=0;row<x;row++) { // jha queen place kar denge wha pe 1 likh denge if(arr[row][y]==1) { return false; } } // diagonal check karne hai to uske liiye do iterator bnane parege int row =x; int col =y; //...
ALGO
0.999969
4.793417
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2022-08-21T09:56: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": "9e9d00fe37...
005a7d2b-5002-4c95-a423-7bb938f878f2
ishandutta2007/codeforces-m
matthew99/normal/243/C.cpp
#include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <cmath> #include <cassert> #include <ctime> #include <cctype> #include <vector> #include <iostream> #define REP(i, a, b) for (int i = (a), _end_ = (b); i != _end_; ++i) #define debug(...) fprintf(stderr, __VA_ARGS__) #define pb push_...
ALGO
0.99927
3.208767
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-06T01:03: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": "1f69d67117d4...
7c67b53b-3f39-42cb-a27a-3fd236963f5a
augustinasjucas/CompetitiveProgramming
HowManyPaths.cpp
#include <bits/stdc++.h> using namespace std; const int dydis = 4e5 + 10; int n, m; vector<int> gr[dydis]; int low[dydis]; int ind[dydis]; bool has[dydis] = {}; bool onS[dydis] = {}; int dbInd = 0; int sz[dydis] = {}; vector<int> st; bool vis[dydis] = {}; int vl[dydis] = {}; int inc[dydis] = {}; int cnt[dydis] = {}; vo...
ALGO
0.999976
4.812223
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-05-20T12:06: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": "eef9760f4562...
976e3f29-b207-4272-b993-35c4d8da0d4c
RaJuCodz/DSA
2610-closest-prime-numbers-in-range/closest-prime-numbers-in-range.cpp
class Solution { public: vector<int> sieve(int n,int left) { vector<bool> isPrime(n + 1, true); vector<int> primes; isPrime[0] = isPrime[1] = false; for (int i = 2; i * i <= n; ++i) { if (isPrime[i]) { for (int j = i * i; j <= n; j += i) { ...
ALGO
0.999993
5.216269
{ "github_metadata": { "branch": "main", "commit_count": 229, "repo_created_at": "2025-01-29T00:23: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": "11b1bc38c9...
8eb18e4d-eea7-4275-8a23-f4616eb876fa
kimhj010502/Algorithm
프로그래머스/0/120852. 소인수분해/소인수분해.cpp
#include <string> #include <vector> #include <set> #include <iostream> using namespace std; vector<int> getPrime(int n) { vector<int> prime(n + 1, 1); for (int i = 2; i * i <= n; i++) { if (prime[i] != 1) { continue; } for (int j = i * 2; j <= n; j += i) { ...
ALGO
0.999918
4.900554
{ "github_metadata": { "branch": "main", "commit_count": 90, "repo_created_at": "2024-01-07T05:48: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": "cc471c1b5aa...
7b94ec80-c2b2-476e-bcbf-456cdb8dd887
ivanchuchulski/fmi-data-structures-and-algorithms
_dsa_fast_reference/BST.h
struct Node { int data; Node* left; Node* right; }; class BST { public: Node* _root; BST() : _root(nullptr) {} bool Empty() { return _root == nullptr; } void InOrderDFS(Node* node) { if (node == nullptr) return; InOrderDFS(node->left); std::co...
ALGO
0.999976
4.616668
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2019-07-25T16:55: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": "69465b840...
ee445c73-a727-427d-a0e1-86aa1a5bd6b4
ishandutta2007/codeforces-s
strawberryc/normal/1114/C.cpp
#include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; template <class T> inline T Min(const T &a, const T &b) {return a < b ? a : b;} typedef long long ll; const ll INF = ((1ll << 62) - 1 << 1) + 1; int S; ll n, k, ans = INF; int main() { int i, tot; ll ...
ALGO
0.999887
3.83936
{ "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": "6ac6d5937435...
3938ce73-4a43-4181-a86d-4f96aa43d1fa
chi541323/PID-Controller
PID-Controller-Application.ino
/* upper right => M1, right => M2, lower right => M3 lower left => M4, left => M5, upper left => M6 */ #include <Encoder.h> #include <PID_v1.h> #define M1_H 0 // Motor1 Horizontal #define M1_V 1 // Motor1 Vertical #define M2_H 2 // Motor2 Horizontal #define M2_V 3 // Motor2 Vertical #define M3_H 4 // Motor3...
ALGO
0.996068
4.541587
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2019-11-06T06:24: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": "910b77349...
341f707f-5398-447d-9872-822be33d245d
sachuverma/DataStructures-Algorithms
Leetcode Daily Challenge/August-2021/26. Verify Preorder Serialization of a Binary Tree.cpp
/* Verify Preorder Serialization of a Binary Tree ============================================== One way to serialize a binary tree is to use preorder traversal. When we encounter a non-null node, we record the node's value. If it is a null node, we record using a sentinel value such as '#'. For example, the above bi...
ALGO
0.999872
6.552589
{ "github_metadata": { "branch": "master", "commit_count": 1430, "repo_created_at": "2020-10-07T10:08:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2049, "forks": 541, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "e6...
0ec806d0-1b10-4736-970b-cc2cbce3bb5e
is00hcw/oj
poj/search/solitaire_p1198_bfs.cc
#include <stdio.h> #include <string.h> #include <assert.h> #include <queue> #include <algorithm> using std::queue; using std::sort; //双向bfs // 这个给我的启示是, 如果超时的话,可能判Wrong Answer // 双向bfs // 我直接bfs的话, 应该是超时了,可不知为什么判了个Wrong Anaswer, 害我检查了半天... // 双向bfs果然不是盖的. // 搜索的状态数, 从n, 变成了sqrt(n), nx... // 11544624 fly2best 1198 Acc...
ALGO
0.999895
4.118409
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2014-05-14T05:57: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": "4f2947287...
e7f8440e-b541-4c1f-a1f2-9b61248b6f0b
akx2404/Data_structures_and_algorithms
7_linked_lists/18_insert_DLL.cpp
#include<stdio.h> #include<iostream> using namespace std; struct Node{ struct Node *prev; int data; struct Node *next; }*first=NULL; void create_dll(int A[], int n){ int i; struct Node *t, *last; first = new Node; first->data = A[0]; first->next = NULL; first->prev = NULL; l...
ALGO
0.999893
5.206553
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2021-11-20T07:38:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "87721d052a...
5e952a35-d6b8-490b-8833-d169246a53f8
stephane-caron/lipm_walking_controller
include/lipm_walking/NetWrenchObserver.h
/* * Copyright (c) 2018-2019, CNRS-UM LIRMM * 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 con...
TOOL
0.991249
7.019355
{ "github_metadata": { "branch": "master", "commit_count": 392, "repo_created_at": "2018-09-17T10:43:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 249, "forks": 77, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "899ed...
41ca4dad-48e7-41b6-9b67-ee2dda17cf4f
KareemAmr12/MostFrequentNumber
AlgorithmsLab5/task_2.cpp
#include <iostream> #include <fstream> using namespace std; void Swap(double* xp, double* yp) { double temp = *xp; *xp = *yp; *yp = temp; } void heapify(double* arr, int n, int i) { int largest = i; int l = 2 * i + 1; int r = 2 * i + 2; if (l < n && arr[l] > arr[largest]) largest = l; if (r < n && arr[r] >...
ALGO
0.999972
4.207191
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-01-31T20: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": "8b37b4f750...
bc06eded-7601-44bc-a35a-b5398a0f29b3
Saad-Mehmood/NumSolverToolkit
Root Finding Methods/Bisection Method/BisectionMethod.cpp
/* * --------------------------------------------------------- * Author: <NAME> * Date: September 2024 * Description: This code was developed by <NAME> as part * of the project NumSolverToolkit. * Any use or modification of this code should include proper * attribution to the original author. * ---------------...
ALGO
0.999988
5.557593
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2024-08-22T14:17: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": "38b018bf9d4...
82bcdc10-d52e-4907-b520-950b34a2debf
HekpoMaH/Olimpiads
grupa A/esenen turnir/2014/2014-11-23-tests&authors-B/2-hole/author/hole.checker.cpp
// O(n^3) #include <cstdio> const int nmax=2000; int wall[nmax+2][nmax+2]; int hl[nmax+2][nmax+2]; int vl[nmax+2][nmax+2]; int n; int asmax, csmax, ciulmax, cjulmax, cidrmax, cjdrmax; void markhl() { int hlnumber = 0; // цикли по хоризонталните линии между редовете for (int i=1; i<n; i++) { ...
ALGO
0.999162
3.224925
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-10-04T16:17:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "74470b4cd0...
3931fb9e-6ef1-4b5b-a546-ce32f6c50710
omoru/MARP
Programacion dinamica/La cuerda de la cometa/main.cpp
//<NAME> #include <iostream> #include <fstream> #include <vector> #include "Matriz.h" #include "EnterosInf.h" using namespace std; struct Cuerda { long long int longitud; long long int coste; }; /* N -> numero de cuerdas L -> longitud cuerda deseada li -> longitud de la cuerda i ci-> coste de la cuerda i ...
ALGO
0.99989
3.333448
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2021-04-20T00:21: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": "5e46297a343...
35dabf7e-3ac8-4840-a8eb-cd06bc134f44
luyocarp/Algorithmic-Contests
Codeforces/cf_699A.cpp
#include <bits/stdc++.h> using namespace std; #define all(v) (v).begin(),(v).end() #define pb push_back #define sqr(x) ((x)*(x)) #define mp make_pair #define EPS 1e-9 #define ones(x) __builtin_popcount(x) #define fast_io() ios_base::sync_with_stdio(0);cin.tie(0); #define debug(x) cerr << #x << ": " << x << endl; #defin...
ALGO
0.999977
3.506536
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-09-10T15:25: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": "fae5a0b70f...
2fbbce16-7c84-4d58-9e41-9cbb58983a0c
carnivorous-hotdog/cp
hackerearth/practice/monk-and-palindromes.cpp
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define vii vector<int, int> #define ll long long #define pb push_back #define mp make_pair #define endl '\n' #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifdef LOCAL #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__) template <type...
ALGO
0.99992
4.441467
{ "github_metadata": { "branch": "master", "commit_count": 95, "repo_created_at": "2020-02-19T22:59: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": "e1a15b1ed...
02e01769-f62b-4bc5-acfe-0f2b22f24a18
kira-1011/A2SV
winnerCircularGame.cpp
class Solution { private: struct ListNode{ int val; ListNode *next; }; public: int findTheWinner(int n, int k) { int length = n; ListNode *head = new ListNode; ListNode *current = head; ListNode *prev = current; for(int i =...
ALGO
0.999997
5.720779
{ "github_metadata": { "branch": "main", "commit_count": 419, "repo_created_at": "2022-04-21T09:44: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": "4843abb848...
fe81e04d-92ac-4539-bab7-74c66e0e4e9b
Shikhar-S/Analysis-of-Competitive-Codebase
Data/Contest1244/Standings2/28923246_62480964.cpp
#include <iostream> #include <fstream> #include <sstream> #include <algorithm> #include <utility> #include <unordered_map> #include <map> #include <unordered_set> #include <set> #include <vector> #include <string> #include <cmath> #include <queue> #include <memory> #include <initializer_list> #include <iomanip> #includ...
ALGO
0.999889
4.010079
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2019-11-22T14:40:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e7153f5de...
30382edc-b293-4691-b89d-3aadea730af0
ishandutta2007/codeforces-a
akim/normal/615/B.cpp
#include <algorithm> #include <iostream> #include <sstream> #include <utility> #include <cstdlib> #include <cstring> #include <cassert> #include <fstream> #include <cstdio> #include <string> #include <vector> #include <queue> #include <cmath> #include <ctime> #include <stack> #include <map> #include <set> using namesp...
ALGO
0.999555
3.707481
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6561bfb856c1...
9461065a-20ef-4e09-b46a-1312e5700303
jasonblog/note
ds_algo/src/leetcode_v2/algorithms/InvertBinaryTree/tree.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cstdio> #include <queue> using namespace std; struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; class Solution { public: TreeNode* invertTree...
ALGO
0.999982
5.427651
{ "github_metadata": { "branch": "master", "commit_count": 6421, "repo_created_at": "2015-05-09T02:04:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 149, "forks": 75, "issues": 0, "pull_requests": 43 }, "file_meta": { "content_id": "84d...
485c3f5e-d5d0-4ea5-9736-8afb89fea62c
gMallick33/coding
greatest_common_divisor_traversal_2709/leetcode_2709.cpp
class Solution { public: vector<int> getPrimeFactors(int x){ vector<int> primeFactors; for(int i = 2; i * i <= x; i++){ if(x % i == 0){ primeFactors.push_back(i); while(x % i == 0) x /= i; } } if(x != 1) primeFactors.push_back(x...
ALGO
0.999929
4.594072
{ "github_metadata": { "branch": "main", "commit_count": 242, "repo_created_at": "2023-04-03T17:09: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": "d176c7e096...
31fd1faf-b2b4-4d92-83df-882138ea4690
CGAL/cgal
Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/uncertain_functions_on_signs.h
// Copyright (c) 2003 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org). // // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : <NAME> <<EMAIL>> #ifndef CGAL_UNCERTAIN_FUNCTIONS_ON_SIGNS_H #define CGAL_...
TOOL
0.992144
7.024463
{ "github_metadata": { "branch": "master", "commit_count": 113659, "repo_created_at": "2014-10-01T12:22:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5443, "forks": 1475, "issues": 511, "pull_requests": 136 }, "file_meta": { "content_id...
b57311f3-e296-41b5-9ad9-fd49c2a0a295
silencelee/leetcode
algorithm/680.valid-palindrome-ii.cpp
/* * @lc app=leetcode id=680 lang=cpp * * [680] Valid Palindrome II * * https://leetcode.com/problems/valid-palindrome-ii/description/ * * algorithms * Easy (35.80%) * Likes: 1437 * Dislikes: 94 * Total Accepted: 151.5K * Total Submissions: 418.3K * Testcase Example: '"aba"' * * * Given a non-em...
ALGO
0.999798
6.433777
{ "github_metadata": { "branch": "master", "commit_count": 254, "repo_created_at": "2020-01-28T09:18: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": "84ae2b68...
a7b94b8f-b13c-4920-8d6c-b5768481c28f
sosson97/Chazelle-1986-s-Layered-Range-Tree-for-Orthogonal-Range-Search
lrt.h
//lrt.h //define Layered Range Tree class #ifndef LRT_H_ #define LRT_H_ #include <vector> #include "point.h" #include "pst.h" #include "wl.h" using std::vector; #define ALPHA 3 #define NEG_INF -200000000 #define POS_INF 200000000 //Each LRTNode contains the point at left_slab, not contain the point at right_s...
ALGO
0.99602
4.486094
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2018-12-05T17:02:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "48e0d445ab...
4fdbc758-6917-4140-9e82-e7ec88780173
sonngneee/codetree-TILs
241009/1차원 젠가/jenga-1d.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #include <cstring> using namespace std; int N; int map[101]; struct pos { int s, e; }; int sizeans; vector<pos> v; void Input() { cin >> N; for (int i = 0; i < N; i++) { cin >> map[i]; } int s, e; cin >> s >> e; v.push_back({ s-1, e-1 })...
ALGO
0.999978
3.508469
{ "github_metadata": { "branch": "main", "commit_count": 131, "repo_created_at": "2024-07-01T05:52:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "68ab588541...
4e31c2ad-6ad6-44d1-86e2-338a4377146e
tron2003/DSA
test116.cpp
#include <iostream> #include <bits/stdc++.h> #include <unordered_map> #include <vector> // #include <pair> using namespace std; struct Node { int val; Node *left; Node *right; Node(int value) : val(value), left(nullptr), right(nullptr) {} }; void sumr(Node *root, int h, unordered_map<int, vector<int>> ...
ALGO
0.999777
5.460423
{ "github_metadata": { "branch": "main", "commit_count": 152, "repo_created_at": "2024-03-10T14:17: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": "74151c0314...
34224018-e37a-42e9-b397-e1a727093533
Aryan-Satija/DSA
BINARY SEARCH/bookAllocation.cpp
// CODING NINJAS -> Allocate Books #include <bits/stdc++.h> using namespace std; bool isDistributionPossible(vector<int> &arr, int n, int m, int max_pages){ int grp = 1; long long int sum = 0; for(int i = 0; i < n; i++){ if(sum + arr[i] <= max_pages) sum += arr[i]; else sum = arr...
ALGO
0.999987
4.441803
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T13:38:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c9a7df90cac4...
062218f6-20d5-4359-ac20-c20b8da5520a
zhangzisu/source-old
2017-10-09/bzoj1304/bzoj1304/bzoj1304.cpp
#include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> #define MAXN 20000 #define INF 0x3F3F3F3F int head[MAXN], next[MAXN << 1], to[MAXN << 1], tot = 0; inline void addEdge(int u, int v) { next[tot] = head[u]; to[tot] = v; head[u] = tot++; next[tot] = head[v]; to[tot] = u; head[v] = tot++; } int co...
ALGO
0.999851
3.402318
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2017-09-04T23:49: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": "6b6864e67...
6f640e21-3b03-4231-9003-fbe6b4ed4bf4
Reva22/LeetCode
Word Break - GFG/word-break.cpp
//{ Driver Code Starts //Initial template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ // A : given string to search // B : vector of available strings class Solution { public: int solve(string k, string A, vector<string>&B, int i){ //cou...
ALGO
0.998819
4.980259
{ "github_metadata": { "branch": "main", "commit_count": 204, "repo_created_at": "2023-03-02T07:38: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": "82e9a7c4c9...
ed1c04a9-ab99-4e68-bb4e-fec125425981
dasinlsb/Algorithm-Contest-Records
PersonalTraining/gym/2018-2019 ACM-ICPC, Asia Xuzhou Regional Contest/I.cpp
#include <bits/stdc++.h> using namespace std; int mod; void add(int&x, int y) { if (x += y, x >= mod) x -= mod; } int dfs(vector<int>& perm, vector<pair<int, int> >& comp, int k) { if (k == comp.size()) return 1; int x = comp[k].first; int y = comp[k].second; if (perm[x] > perm[y]) return 0; swap(perm[x], p...
ALGO
0.999972
3.845447
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2018-08-30T16:49: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": "db395fe71...
87a3b001-f0cc-40bd-963a-9bd36f3d971f
cianjinks/Coding-Problems
interviewquestions/binarytree-easy/problem2.cpp
// https://leetcode.com/explore/interview/card/top-interview-questions-easy/94/trees/625/ #include <iostream> #include <vector> struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
ALGO
0.99998
7.144814
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2020-09-10T21:56:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9ed6ca98a...
b38c4438-9699-43dc-9e31-e429df696520
Nadeen-Badr/Matrix-calcu
main.cpp
#include <iostream> #include "matrix.h" #include "matrix.cpp" //matrixCalculator and menu class matrixCalculation{ public: void Menu(){ int row,col,num,r,c; cout << " Welcome to Matrix Calculator \n"; cout << " -------------------------------------- \n"; cout<<"1- Perform Matrix Addi...
ALGO
0.995958
3.816212
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-08-24T21:56:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "227e1476941a...
36636b0c-eb16-4794-9faf-e3bec9f4ec1b
Priyaraj17/Leetcode
437-path-sum-iii/437-path-sum-iii.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.999981
5.590593
{ "github_metadata": { "branch": "main", "commit_count": 133, "repo_created_at": "2022-01-07T07:24:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d8e0b962fd...
efbf056c-5de3-412f-83c5-76ce1b8eb0ef
koturn/AtCoder
ABC/007/03/main.cpp
#include <cstdlib> #include <algorithm> #include <array> #include <iostream> #include <limits> #include <queue> template<typename ElmType> class Array2D { public: typedef std::size_t size_type; private: size_type nRow; size_type nCol; ElmType* data; void clone(const Array2D<ElmType>& that) const { ...
ALGO
0.999928
4.824564
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2016-02-22T13:25: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": "53be6cdea...
c187bfe9-9907-4553-9df8-1373faf1c444
kamyu104/LeetCode-Solutions
C++/minimum-index-of-a-valid-split.cpp
// Time: O(n) // Space: O(1) // Boyer–Moore majority vote algorithm, linear search class Solution { public: int minimumIndex(vector<int>& nums) { const auto& boyer_moore_majority_vote = [&]() { int result = 0, cnt = 0; for (const auto& x : nums) { if (cnt == 0) { ...
ALGO
0.999985
6.229185
{ "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": ...
522a7284-ed2a-465d-8d60-7ee21c8611b1
bmaxdk/path-planning
minkowski_sum.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; // Print 2D vectors coordinate values void print2DVector(vector<vector<int> > vec) { // Sorting the vector for grading purpose sort(vec.begin(), vec.end()); for (int i = 0; i < vec.size(); ++i) { for (int j = 0; j < v...
ALGO
0.999341
5.239429
{ "github_metadata": { "branch": "main", "commit_count": 171, "repo_created_at": "2023-04-16T03:57:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c5eefdb7ca...
76101e20-632a-432a-a7d0-5359cec4f81b
JinYoung-Shin/Algorithm-Challenge-2017
hg/codeforce/contest-426-div2/A.useless_toy/src/mod.cpp
#include <cstdio> #include <iostream> using namespace std; #define UP 0 #define RIGHT 1 #define DOWN 2 #define LEFT 3 int num; int pos_first, pos_last; bool is_cw() { return (pos_first + num) % 4 == pos_last; } bool is_ccw() { int val = pos_first - num; while (val < 0) { val += 10000000; } return val % 4 == po...
ALGO
0.999948
3.32803
{ "github_metadata": { "branch": "master", "commit_count": 388, "repo_created_at": "2017-03-08T13:43:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4d73c897...
78d5f30c-f1fe-4e06-943e-7fd8de18f7a3
cgmoreda/CompetitiveProgramming
UVA/926/44547588_AC_0ms_0kB.cpp
#include<bits/stdc++.h> //cgmoreda || Mohamed_Reda using namespace std; #define vin(v) for(auto &i:(v))cin>>i #define ll long long #define all(v) v.begin(),v.end() #define vi vector<int> #define vvi vector<vector<int>> #define ii pair<int,int> int n; bool blocked[35][35][35][35]; int dx[] = {0, 0, 1, -1}; int dy[] = {...
ALGO
0.999923
5.161644
{ "github_metadata": { "branch": "main", "commit_count": 442, "repo_created_at": "2024-01-20T21:05: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": "d48d8cd685...
8bc40bb7-c217-4d02-a8bd-04009cc383c7
duckdb/duckdb
third_party/jaro_winkler/jaro_winkler.hpp
/* SPDX-License-Identifier: MIT */ /* Copyright © 2022 <NAME> */ #pragma once #include "details/common.hpp" #include "details/jaro_impl.hpp" #include <stdexcept> namespace duckdb_jaro_winkler { /** * @defgroup jaro_winkler jaro_winkler * @{ */ /** * @brief Calculates the jaro winkler similarity * * @tparam S...
ALGO
0.969153
7.191536
{ "github_metadata": { "branch": "main", "commit_count": 59407, "repo_created_at": "2018-06-26T15:04:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 31074, "forks": 2450, "issues": 412, "pull_requests": 112 }, "file_meta": { "content_id":...
209e7926-1585-4af0-aaf2-be14fee818fd
yi-hui0928/DataStructure_HW
HW2/Source.cpp
// 小組 學生資訊 (名字學號) // 作業:多項式相加 // 將A多項式與B多項式相加(A+B),放進陣列 // 並將其結果印出來 // 如係數或冪次為零無須印出 // A-B可自由選擇做 /****請註解 ****/ //檔名請加上第幾組(ex.多項式練習_第X組) #include <iostream> #include <cstdlib> using namespace std; void copy_to_c(int, int, int[][30], int); void print_p(int[][30], int, int); int main(void) { // A多項式 10x^8+6x^5-7x...
ALGO
0.999265
3.78643
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-10-05T14:18: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": "23d3d00ad9e8...
e4835533-0b42-4395-9dfa-431eaed42d6f
goropikari/CompetitiveProgramming
atcoder/abc405/b.cpp
// https://atcoder.jp/contests/abc405/tasks/abc405_b // 2025年05月10日 21時01分18秒 #include <bits/stdc++.h> // #include <atcoder/all> // using namespace atcoder; // using mint = modint998244353; // using mint = modint1000000007; #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define rep(i, n)...
ALGO
0.999994
3.744652
{ "github_metadata": { "branch": "main", "commit_count": 442, "repo_created_at": "2021-12-04T02:33:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d0621c4e52...
9eb9ff04-9388-4df7-be7c-2053032e8d6c
Anshit01/Competitive-Programming
codechef/lunchtime/may20/1.cpp
/* *>>>>>Anshit_Bhardwaj<<<<<* */ #include <bits/stdc++.h> #define ll long long #define f(i, x, n) for(int i = x; i < n; i++) #define dbg(x) cout << x << endl #define dbg2(x, y) cout << x << ' ' << y << endl #define dbg3(x, y, z) cout << x << ' ' << y << ' ' << z << endl #define mod 1000000007 using namespace std; int...
ALGO
0.999651
4.161953
{ "github_metadata": { "branch": "master", "commit_count": 106, "repo_created_at": "2020-05-23T11:21:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a93b141b...
8e357cc6-ced2-4674-833c-26b8d14fb744
AndreTMV/Cpp
Project Euler/First_100/problem3.cpp
#include <cmath> #include <iostream> int largestPrimeFactor(long number) { unsigned long largestPrimeFactor = 0, decomposer = 2; largestPrimeFactor = decomposer; while (decomposer <= number) { if (number == 1 || number == 0) { break; } else if (number % decomposer == 0) { number = number / de...
ALGO
0.999907
4.237016
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2021-09-09T14:58:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d4f89b8268ac...
726c345a-8396-4a9a-b2f8-b6c97fe4ca92
s1lviu/Facultate-FMI-Unibuc
Anul III/Criptografie/Sursa 1/criptografie/de la florian/surse/mixcol/mixcol/main.cpp
#include <cstdio> #include <cstring> using namespace std; #define res_only false struct vec { int v[8]; vec() { memset(v, 0, sizeof(v)); } }; char hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; char A[4][4][3] = {{"02", "03", "01", "01"}, {"01", "02", "03", "01"}, ...
ALGO
0.999861
3.852395
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2015-09-07T13:16:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71a31a697...
dba1fe91-4e1d-49c2-930f-4a8c67ce9320
shawntsai0312/NTUEE_COMPUTER_PROGRAMMING_21FALL_PERSONAL_PROJECT
project3/src/squarematrix.cpp
#include <iostream> #include <iomanip> #include <vector> #include <cmath> #include "matrix.h" #include "squarematrix.h" using namespace std; SquareMatrix::SquareMatrix(int size) { cout << "input the square matrix" << endl; for (int i = 0; i < size; i++) { vector<double> temp; for (int j = 0; j < size; j++) { ...
ALGO
0.993794
3.428554
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-05-11T18:30: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": "b61bf025421c...
64df2e49-9996-4664-82f2-a7659b59ce98
ishandutta2007/codeforces-n
noam527/normal/986/B.cpp
#include <bits/stdc++.h> #define CHECK cout << "ok" << endl #define finish(x) return cout << x << endl, 0 typedef long long ll; typedef long double ldb; const int md = 998244353, inf = 1e9 + 7; using namespace std; void debug(string names) { cout << '\n'; } template<typename A1, typename... A2> void debug(string name...
ALGO
0.999911
4.184381
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:35: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": "a37d39df8628...
5c8f5741-5216-461e-8709-23587655e7ac
amanraj-creator/GfG-Weekly-Coding-Contest
Find n-th term.cpp
class Solution { public: #define MOD 1000000007 // Define the modulo value to avoid large numbers int nthTerm(int n) { // Handle base cases directly if (n == 1 || n == 2) { return 1; // First two terms are 1 } // Initialize variables for the first two terms long long prev2 = 1; ...
ALGO
0.999976
5.712544
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2024-10-13T19:34:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "29bd7c86db5...
3fd8833b-dad4-4e2e-931a-9d3a5bdc193d
openPupil/Open-PupilEXT
3rdparty/spii/examples/fit_gaussian.cpp
// <NAME> 2012--2013. #include <functional> #include <iostream> #include <random> #include <spii/auto_diff_term.h> #include <spii/interval_term.h> #include <spii/solver.h> #include <spii/transformations.h> using namespace spii; // One term in the negative log-likelihood function for // a one-dimensional Gaussian di...
ALGO
0.999833
6.533982
{ "github_metadata": { "branch": "main", "commit_count": 126, "repo_created_at": "2020-11-11T14:44:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 126, "forks": 30, "issues": 8, "pull_requests": 0 }, "file_meta": { "content_id": "fcafc183...
e123d84f-5bca-4c28-9673-c90b0290779f
preetinder-01/placement-prep
493-reverse-pairs/493-reverse-pairs.cpp
class Solution { public: int merge(vector<int>&nums,int low,int mid,int high) { int res = 0; int j = mid+1; for(int i=low;i<=mid;i++){ while(j<=high && nums[i] > 2LL * nums[j]){ j++; } res += (j-(mid+1)); } vector...
ALGO
0.99996
5.503781
{ "github_metadata": { "branch": "master", "commit_count": 1008, "repo_created_at": "2022-01-19T05:44:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "edef25b...
346d54d2-7b2f-4679-8e79-235d3f470bef
Donlin23/BasicSort
BubbleSort.h
// // Created by tanglabhdl on 2018/7/1. // #ifndef SELECTIONSORT_BUBBLESORT_H #define SELECTIONSORT_BUBBLESORT_H #include <iostream> using namespace std; // 冒泡排序 template <typename T> void bubbleSort(T arr[], int n){ // 常规写法 // for (int i = 0; i < n - 1; i++) { // for (int j = 0; j < n - 1 - i; j++)...
ALGO
0.999594
5.025888
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-07-01T07:35: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": "98174e9cda...
3fef1368-35bf-483e-920b-5f1b27720685
Labhesh2406/Codeforces
contest/Round938C.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; void solve() { ll n, k; cin >> n >> k; deque<ll> dq; for (int i = 0, x; i < n; i++) { cin >> x; dq.push_back(x); } int first = 1, ans = 0; while (k > 0 && dq.size()) { if (dq.size() == 1) { if (dq.front() <= k) { ans++; } bre...
ALGO
0.999965
4.49573
{ "github_metadata": { "branch": "main", "commit_count": 234, "repo_created_at": "2024-04-01T17:53: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": "10dfedba60...
2e96d464-77a1-4b8e-ae16-91b003de59c6
Arghya-Banerjee/DSA-GFG
Difficulty: Medium/Flattening a Linked List/flattening-a-linked-list.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node* next; struct Node* bottom; Node(int x) { data = x; next = NULL; bottom = NULL; } }; void printList(Node* head) { while (head != NULL) { printf("%d ", head-...
ALGO
0.999437
6.413359
{ "github_metadata": { "branch": "main", "commit_count": 59, "repo_created_at": "2024-12-12T07:25: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": "edd2768ebba...
2eab73d9-7715-4b3f-90ed-721dcda61c23
craffael/lehrfempp
examples/lecturedemos/convergencestudies/prefinement.cc
/** * @file prefinement.cc * @brief Creates convergence plots for experiment 3.2.3.11 * @author <NAME> * @date April 2020 * @copyright MIT License */ #include <lf/fe/fe.h> #include <lf/io/io.h> #include <lf/mesh/hybrid2d/hybrid2d.h> #include <lf/mesh/mesh.h> #include <lf/mesh/utils/utils.h> #include <lf/refineme...
ALGO
0.987346
5.893333
{ "github_metadata": { "branch": "master", "commit_count": 1610, "repo_created_at": "2018-04-06T14:21:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 32, "forks": 19, "issues": 9, "pull_requests": 2 }, "file_meta": { "content_id": "98187...
204ef917-a758-427f-ae57-5c5ab3441d6b
SofiaB1144/taskManager
taskManager/Source.cpp
#include <iostream> #include <vector> #include <fstream> #include <sstream> #include <cctype> using namespace std; struct Task { string title; string description; int priority; }; class TaskManager { private: vector<Task> tasks; string priorityToString(int p) const { if (p == 1) return...
TOOL
0.977989
6.585877
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2025-04-14T00:43: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": "72fbdfaf33...
1877fe79-d384-4e37-8d90-4f84726fa669
dahyelucy/SWEA
5653/5653.cpp
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> int map[350][350]; int N, M, K; int dx[4] = {-1,0,1,0}; int dy[4] = {0,1,0,-1}; typedef struct Node{ int status; int cellPower; int hp; }Node; Node MAP[2][350][350]; void init() { } void solve() { for (int k = 0; k < K; k++) { for (in...
ALGO
0.999337
3.074364
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-10-23T11:29: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": "88d8b7d42d...
ad70a121-9c71-45e7-ae01-f3f482b48870
lcy960729/Algorithm_Solution_Collection
Baekjoon/UNIST2/20311.cpp
#include <iostream> #include <algorithm> #include <cstring> #include <vector> #include <cmath> #include <queue> #define pii pair<int, int> #define ll long long #define Int_MAX 1e9 #define LL_MAX 3e18 using namespace std; int main() { #ifdef LOCAL freopen("input.txt", "r", stdin); #endif ios::sync_with_stdio...
ALGO
0.999959
3.549808
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2020-10-19T13:03: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": "6a123673d43...
0e82a0a7-1fd1-454d-b954-06afdb0ad644
offercantrefuse/Problem_Solving
SWEA/Maze_recursion.cpp
#include <iostream> using namespace std; int testcase; int w, h; int maze[100][100] = { 0, }; int dy[] = { -1,0,0,1 }; int dx[] = { 0,-1,1,0 }; int good; void dfs(int m, int n) { maze[m][n] = 1; for (int i = 0; i < 4; i++) { if (maze[m + dy[i]][n + dx[i]] == 0) { dfs(m + dy[i], n + dx[i]); } else if ...
ALGO
0.998371
3.684004
{ "github_metadata": { "branch": "master", "commit_count": 113, "repo_created_at": "2018-06-27T05:44:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "af12d4e1...
b9ab3fba-87a5-4a60-8f8a-e4c9faac59d5
bergolho1337/Design-Patterns
Observer/src/utils/utils.cpp
#include "utils.h" void usage (const char pname[]) { printf("-----------------------------------------------------------------------------------------\n"); printf("Usage:> %s\n",pname); printf("-----------------------------------------------------------------------------------------\n"); printf("Exampl...
TOOL
0.972943
5.044806
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2021-08-11T23:54:09.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "46d543f47e4...
6e16b23a-f937-4566-956e-62daad225507
ishandutta2007/codeforces-b
box/normal/933/D.cpp
// writer: w33z8kqrqk8zzzx33 #include <bits/stdc++.h> using namespace std; #define iter(i, a, b) for(int i=(a); i<(b); i++) #define rep(i, a) iter(i, 0, a) #define rep1(i, a) iter(i, 1, (a)+1) #define fi first #define se second #define pb push_back #define ll long long #define pii pair<int, int> //#define int ll con...
ALGO
0.999896
3.9087
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-11T01:05: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": "8002da3b0234...
455b4ea2-9db6-4eea-b18f-b56fdb77f362
myself-Fahim/Competitive_Programming
Divan and a New Project.cpp
/* In the name of Allah, Most Gracious, Most Merciful*/ #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define cint cin >> t #define whl while (t--) #define vi vector<int> #define vll vector<ll> #define mi map<int, int> #define Y "YES" #define N "NO" #define ascii(n) static_...
ALGO
0.9999
3.468179
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2025-02-21T16:18: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": "6e5fd5088...
bd37b61e-040f-40ff-8051-781deed91c0e
maepreville/assignments
program_4/cipher.cpp
// Author: <NAME> // Assignment: Program_04 // Date: 26 November 2019 // Title: Program 4 - Caeser Cipher Class // Semester: Fall 2019 // Course: Data Structures - Dr. Griffin // // Files: cipher.cpp, // encrypted.txt, // decr...
TOOL
0.949367
3.740576
{ "github_metadata": { "branch": "master", "commit_count": 61, "repo_created_at": "2019-12-12T22: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": "da65d4dd5...
014a579a-16c5-4cc0-8858-c0b33cb10ba2
genti337/lander
models/eom/EoM.h
#ifndef EOM_H #define EOM_H // C++ Includes #include <iosfwd> #include <string> #include <deque> // Model Includes #include "MathUtils.h" #include "../dyn_body/DynBody.h" class EoM : MathUtils { friend class DynBody; public: // Default Constructor EoM(void); // Default Destructor ~EoM(void); // ...
ALGO
0.986391
5.711772
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2021-12-22T16:42: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": "19de0433c7...
a889cfe4-320c-4c76-8f0b-92c89322548d
deepak2431/ds-algo
dp/LCS/printlcSub.cpp
//Longest common substring #include<iostream> #include<vector> #include<string> #include<algorithm> using namespace std; string ans; void maxSubstr(string s1, string s2, int n, int m) { int dp[n+1][m+1]; int result, start, end; for(int i = 0; i < n+1; i++) { for(int j = 0; j < m+1; j++) { ...
ALGO
0.99981
3.475864
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2020-09-26T18:41:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cb13f0f7a...
b23612a0-8af4-4bca-bd19-5ae0a120bfac
mahmoodalisha/My-LeetCode-Journey
AddNumbersofLinkedList.c++
class Solution { private: // Function to reverse a linked list ListNode* reverseLinkedList(ListNode* head) { ListNode* prev = NULL; ListNode* current = head; ListNode* forward = NULL; while (current != NULL) { forward = current->next; current-...
ALGO
0.999993
6.833528
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-08-17T12:34: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": "50c3be910cd...
673b43a3-bcbf-4f85-95b2-55c703c90c17
sourabhxyz/Competitive-Programming
CF/Probability/C. Journey.cpp
#include <bits/stdc++.h> using namespace std; int n; vector<vector<int> > glist; double dp(int at, int parent) { int sz = glist[at].size(); if (sz == 1 and at != 1) { return 0; } double p = at == 1 ? (double) 1.0 / (double) sz : (double) 1.0 / (double) (sz - 1); double ret = 0; for (auto to : glist[at]) { ...
ALGO
0.999559
3.953498
{ "github_metadata": { "branch": "master", "commit_count": 337, "repo_created_at": "2017-07-02T11:41: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": "1ba2137f...
37aa7551-f9bb-453e-a017-677b7f447bfe
zihaochen/USACO
clocks.cpp
/* ID: zihaoch1 PROG: clocks LANG: C++ */ #include<iostream> #include<fstream> #include<algorithm> #include<numeric> using namespace std; void Try(int); int a[10], b[10], answer[10]; int x[9][10] = {{4,1,2,4,5,0,0,0,0,0}, {3,1,2,3,0,0,0,0,0,0}, {4,2,3,5,6,0,0,0,0,0}, {3,1,4,7,0,0,0,0,0,0}...
ALGO
0.999873
3.446191
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-08-17T06:35:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "17b65b0c02...
b2cd2c88-6747-4e22-a52a-0046057a15cf
jaromilfrossard/permuco
src/clusterdepth.cpp
#include <Rcpp.h> using namespace Rcpp; //[[Rcpp::export]] IntegerVector get_cluster_matrix(NumericMatrix distribution, double threshold, String side){ // initialize an accumulator variable double acc = 0; // initialize the result matrix IntegerMatrix res(distribution.nrow(),distribution.ncol()); ...
ALGO
0.998343
5.381514
{ "github_metadata": { "branch": "master", "commit_count": 158, "repo_created_at": "2017-09-15T08:36:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 2, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "e716364...
1db3c754-9142-436a-915b-275c9af33b1a
DS-Meena/Core-problems
Stack and Queue/Check Balanced Parentheses (Stack).cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define endl "\n" const int N = 100; const int mod = 1e9 + 7; int n, m, k; bool isValid(string exp) { stack <char> stk; for (int i = 0; i < n; i++) //also works fine in the simple way { if (exp[i] == '[' || exp[i] == '(' ...
ALGO
0.998324
4.555969
{ "github_metadata": { "branch": "master", "commit_count": 290, "repo_created_at": "2020-07-07T16:24:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f2a07f57...
326ca1e8-4415-45ec-be57-3fad858f24fd
Nemurino-kai/Atcoder_source
atcoder.jp/tdpc/tdpc_tournament/Main.cpp
//TDC C トーナメント #include "bits/stdc++.h" #define REP(i,n) for(int i=0;i< (n);i++) #define REPR(i, n) for(int i = (n);i >= 0;i--) #define FOR(i, m, n) for(int i = (m);i < (n);i++) #define FORR(i, m, n) for(int i = (m);i >= (n);i--) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define ll lo...
ALGO
0.999817
3.904763
{ "github_metadata": { "branch": "master", "commit_count": 89, "repo_created_at": "2020-03-24T14:15: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": "b3252f140...
240d1aa9-4f51-4868-a0ca-38623ad88738
liangtaohy/cplusplus
leetcode_981.cpp
/** * @url https://leetcode.com/problems/time-based-key-value-store/ * @note Create a timebased key-value store class TimeMap, that supports two operations. 1. set(string key, string value, int timestamp) Stores the key and value, along with the given timestamp. 2. get(string key, int timestamp) Returns a value su...
ALGO
0.981773
6.738039
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2019-03-11T02:21: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": "1b1293dc1...
900a48f8-61c9-4107-aac1-15a72548e88e
nothene/UVa-Solutions
11946.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; #define INF 1000000000 #define forn(i, n) for(int (i) = 0; (i) < (n); (i)++) #define for1(i, n) for(int (i) = 1; (i) <= (n); (i)++) #define BUG(x) cout<<x<<endl; #define mp ma...
ALGO
0.983584
3.577878
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2019-09-14T06:53: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": "17ac7e03ca...
bedc7621-4618-4c90-a955-1224da446474
Ralor/acm-conventions
online-judges/uva/833-water_falls.cpp
#include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <algorithm> #include <bitset> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <iostream>...
ALGO
0.999978
3.871753
{ "github_metadata": { "branch": "master", "commit_count": 66, "repo_created_at": "2014-04-13T12:04:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f2c0c081...