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
f6454d3e-a392-4bae-9edc-35deb696e05b
OdiSeU/BaekJoon
Baekjoon_C++/Baekjoon_C++/5430.cpp
#include <iostream> #include <list> #include <string> using namespace std; bool isR = false; bool funcResult(list<short>* arr, string func) { for (int i = 0; i < func.size(); i++) { if(func[i] == 'R') isR = !isR; if (func[i] == 'D') { if (arr->empty()) return false; if (isR) arr->pop_back(); else arr->...
ALGO
0.999202
4.558529
{ "github_metadata": { "branch": "main", "commit_count": 530, "repo_created_at": "2020-10-03T05:56:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3a4c1f41ab...
9cc227ce-0597-4040-912d-5fbe193f7e41
Ammar1ja/CodeForces
Official/JCPC22/JCPC22_Training/SelfDescripingNumber/SelfDescripingNumber.cpp
#include <iostream> #include "./mylibrary.h" using namespace std; using namespace array; int main(void) { int t; string s; int c = 0, d = 0; cin >> t; for (int i = 0; i < t; i++) { cin >> s; int n = s.size(); int *array = new int[n]; for (int j = 0; j < n; j++) ...
ALGO
0.998597
3.714147
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2022-05-01T10:38:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6984d5fb3e0...
7588e2ff-1c52-4b30-846d-3c5b9091bc87
Mr-Yuxuan/Marvelous-Inventions
BitMapAndBloomFilter/BitMapAndBloomFilter/BitMap.hpp
#pragma once #include<iostream> #include<string> #include<vector> using namespace std; long long GetNextPrime(long long &n) { const int _PrimeSize = 28; static const unsigned long _PrimeList[_PrimeSize] = { 53ul, 97ul, 193ul, 389ul, 769ul, 1543ul, 3079ul, 6151ul, 12289ul, 24593ul, 49157ul, 98317ul, 196613ul, 3...
ALGO
0.98566
3.521061
{ "github_metadata": { "branch": "master", "commit_count": 79, "repo_created_at": "2016-04-08T05:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd4bc73ec...
098d6318-5ea1-4bb7-a6f6-596c1dce2393
NekoMio/ACMcode
BUPT/2020-8-1/HH.cpp
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int main() { long long n, k, nxt, sum = 0; cin >> n >> k; long long t = min(n, k); for (long long i = 2; i <= t; i = nxt + 1) { nxt = n / (n / i); if (nxt > t) nxt = t; (sum += ((n / i) % MOD) % MOD * ((nxt - i + 1) % MOD) % MOD)...
ALGO
0.999978
4.60906
{ "github_metadata": { "branch": "master", "commit_count": 122, "repo_created_at": "2017-07-14T23:35:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e07cc666...
361adc77-b575-408e-95e3-998f7af728d6
shiv21081999/CodingNinjas
PermutationSwaps/test.cpp
#include<bits/stdc++.h> using namespace std; #define int long long int #define ld long double #define F first #define S second #define P pair<int,int> #define pb push_back const int N = 100005, M = 11; int mod = 1000000007; int root(int *parent , int node) { if(node == parent[node]) return node; parent...
ALGO
0.999938
4.639558
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2020-04-04T00:26: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": "8250f45193...
f507acca-5fcb-43bb-b256-56a974eb9661
subodhnarayan/100DayofCoding
day206.cpp
-- -- -- -- -- -- -- -- -GFG - POTD - 25 / 11 / 2024 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - Maximum Product Subarray Difficulty: MediumAccuracy: 18.09%Submissions: 402K+Points: 4 Given an array arr[] that contains positive and negative integers (may contain 0 as well). Find the maximum product that we can get ...
ALGO
0.999978
6.320863
{ "github_metadata": { "branch": "main", "commit_count": 1744, "repo_created_at": "2024-05-01T06:51: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": "666b4bfb9...
5eacd18e-8a6a-4a59-8533-cd67b5cc57f3
Thakuraditya05/C-Notes
greedy/greedy/lecture3/480LCslidingWindoMEdian.cpp
// vector ke pass bhi apna ye erase function hota hai but order of n complexity hrr window pe ja ke uska median nikalana hai ek max heap banao ek min heap median se chote elemnt ek min heap me and median se bade elemnt max heap me such that min(size) = max(size) min(size) = max(size) + 1 1st elemtn in min he...
ALGO
0.999989
4.807479
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-06-01T15:59: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": "73f2f0a4c101...
a0b6c361-181f-4730-a17f-7db6056c9add
AhanafTahmid/CP
TLE-sheet/1500/C_Little_Girl_and_Maximum_Sum.cpp
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define int long long class FenwickTree{ private: int get_parent(int bit){ return bit - (bit & -bit); } int get_next(int bit){ return bit + (bit & -bit); } public: int getSum(const vector<int>& BITree, int index){...
ALGO
0.999952
5.314127
{ "github_metadata": { "branch": "master", "commit_count": 103, "repo_created_at": "2023-02-04T20:18: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": "19928fe8...
e0b13a3e-62a7-4ee4-9c80-bbe863311db7
porkallen/leetcode
C++/Source/Others/1835.cpp
#include "common.h" class Solution { public: int getXORSum(vector<int>& arr1, vector<int>& arr2) { int ret = 0; vector<int> bitmask(32, 0); for(auto it : arr2){ for(int i = 0; i < 32; i++){ if((it >> i) & 0x1) bitmask[i]++; ...
ALGO
0.999964
5.475141
{ "github_metadata": { "branch": "master", "commit_count": 71, "repo_created_at": "2017-11-11T01:56: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": "f8fdcdc41...
aa35a86b-0a85-4d24-a8f6-64df85fb74e5
dreyus95/AVSP_SourceQualityPrediction
CodeJamCrawler/dataset/13_18208_80.cpp
#include "stdio.h" #include "math.h" typedef unsigned typ; #define FMT_STR "%u" int nTests; typ s,e; int solve(void) { int i,j,cnt=0,fac=1; typ a,b,a2=s,mult=10; if(s > e) return 0; a = sqrt(s); if(a*a < s) a++; a2=a*a; b = sqrt(e); if(b*b > e) b--; //Calculate the range factor while(a >= mult) ...
ALGO
0.984897
4.652257
{ "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": "9eb0c81ae...
32c49a87-993c-4965-8ba5-fe5b15188a9e
OrebroUniversity/navigation_oru-release
orunav_geometry/include/orunav_geometry/b_spline.h
#pragma once #include <vector> #include <map> #include <cassert> #include <math.h> #include <iostream> #include <angles/angles.h> inline bool eval_spline_gnuplot(double &x_val, const double &t_val, const std::vector<double> &x, const std::vector<double> &t) { if (t_val < t[1] || t_val > t[2]) return false; ...
ALGO
0.99478
6.737982
{ "github_metadata": { "branch": "master", "commit_count": 511, "repo_created_at": "2017-05-10T08:18:51.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 144, "forks": 70, "issues": 5, "pull_requests": 3 }, "file_meta": { "content_id": "4fc5a4...
9b0bedb4-99f3-428a-82a4-13573e14f1ec
JohnToro-CZAF/CP
CodeForce/Problems/Tags/DFSs/D.cpp
// Header Files #include<iostream> #include<string> #include<vector> #include<cmath> #include<map> using namespace std; /* * nodeVal is an array representing the value of each node in the tree. edges is a two-dimensional array representing the the indices of the starting node and ending node of an edge of the tree. ...
ALGO
0.999797
4.58233
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2022-03-25T06:49:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "92b0e0bb042...
31394908-1454-4d36-bf4e-64a12818f6fe
chilbok/project_Chilbok
algorithmProblemSolving/boj/14891 톱니바퀴.cpp
#include <vector> #include <deque> #include <iostream> #include <utility> using namespace std; int K; vector<deque<int>> cV(6, deque<int>(8, -1)); vector<pair<int, int>> commands; void init() { for (int i = 1; i < 5; i++) { for (int j = 0; j < 8; j++) { char tmpC; cin >> tmpC; cV[i][j] = tmpC - '0'; } ...
ALGO
0.999806
4.372486
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2021-01-15T01:46:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7aee2f99d63e...
c82108b6-13c0-4743-aa93-144003bac1f1
RocmFang/DistGER
src/examples/huge_walk.cpp
#include "walk.hpp" #include "option_helper.hpp" #include <string> #include <vector> #include "dsgl.hpp" using namespace std; struct Empty { }; // ./bin/simple_walk -g ./karate.data -v 34 -w 34 -o ./out/walks.txt > perf_dist.txt int main(int argc, char **argv) { Timer timer; MPI_Instance mpi_instance(&argc, &...
ALGO
0.992044
4.262932
{ "github_metadata": { "branch": "master", "commit_count": 127, "repo_created_at": "2022-04-19T02:28:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d00b29b7...
fa5ca022-9313-4927-8756-cc0454acc8e6
junhwan26/PS
백준/3197.cpp
#include<iostream> #include<string> #include<queue> using namespace std; int x,y; int R,C; int dir[4][2] = {{0,1}, {1,0}, {0,-1}, {-1,0}}; int day = 0; queue<pair<int, int>> q1, q2, water1, water2; string map[1500]; int visit[1500][1500]; int wvisit[1500][1500]; int melt[1500][1500]; void input(){ cin>>R>>C; f...
ALGO
0.999889
3.376244
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2020-01-07T13:25:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b998deb75...
9a6e83b6-163a-4421-83d2-8252dc750faf
ranjeetxsingh/bugBeatles
DSA_Essentials_Code/13. Queue/stack_using_queue.cpp
#include<bits/stdc++.h> using namespace std; class Stack { queue<int> q1, q2; int cs = 0; int count = 1; public: void push(int x) { // will insert in the non-empty queue if (!q1.empty()) { q1.push(x); } else { q2.push(x); } } void pop() { if (q1.empty()) { // shift the elements from q2 t...
ALGO
0.999851
4.317215
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2024-02-20T17:28:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ff525333807...
4261eb52-2f6a-4b14-83fe-ff06acdddc70
Sue-Shudan-Deng/CPP-Practice
submissions/count-univalue-subtrees/Wrong Answer/9-30-2020, 1:24:55 PM/Solution.cpp
// https://leetcode.com/problems/count-univalue-subtrees /** * 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) {} * Tr...
ALGO
0.999796
6.767682
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-09-05T02:18: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": "346ed54af3...
22656c09-8091-4027-ac99-6dbb12ff5096
bigyanic/Hacktoberfest-Simple-Practice-Programmes
C++/haseebalisajid_ReverseNode.cpp
#include <iostream> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ using namespace std; class Node{ public: int data; Node *next; }; class LinkedList{ public: Node *start; Node *PLoc; Node *loc; LinkedList(){ start = NULL; PLoc=NULL; l...
ALGO
0.999814
3.710413
{ "github_metadata": { "branch": "main", "commit_count": 648, "repo_created_at": "2020-10-02T07:02:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 43, "forks": 158, "issues": 1, "pull_requests": 17 }, "file_meta": { "content_id": "db4d34...
a87549a9-8874-4d77-940f-a77ded4986c1
seoyeonkk/Algorithm
[BOJ] 16137 견우와 직녀(BFS, 난이도 상🔥).cpp
#include <iostream> #include <queue> #include <vector> #include <tuple> #include <cstring> using namespace std; int n, m; int a[10][10]; int dist[10][10][20]; // {i, j, t(도착시간)} int dx[] = {-1, 1, 0, 0}; int dy[] = {0, 0, -1, 1}; int bfs() { memset(dist, -1, sizeof(dist)); queue<tuple<int, int, int>> q; q...
ALGO
0.999981
4.302182
{ "github_metadata": { "branch": "master", "commit_count": 460, "repo_created_at": "2018-10-09T14:38: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": "ea12331e...
b7cb66b9-026f-4c35-a601-dbe689132192
Pavlov7/Vector_CPP
Vector/Vector/Main.cpp
// Vector.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "Vector.h" #include <iostream> #include <string> using namespace std; class Student { private: string m_name; int m_age; public: Student() : m_name("Unknown"), m_age(-1) { } Student(string name, int age) { ...
TOOL
0.977166
3.796463
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2016-06-07T18:54: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": "d8d47da67e...
ab71da5a-3ea9-416e-8a42-f705e802d210
mkaguilera/yesquel
src/treedirect.cpp
// // treedirect.cpp // // Functions for a client to access the distributed B-tree directly // without going through SQlite. // /* Original code: Copyright (c) 2014 Microsoft Corporation Modified code: Copyright (c) 2015-2016 VMware, Inc All rights reserved. Written by <NAME> MIT License Permission is ...
TOOL
0.97526
4.894203
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2016-01-26T03:38:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 42, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "defee051...
648ed03d-a425-47c5-a13f-f50bcfe1a534
sonali9696/Leetcode
Others/Zigzag Conversion.cpp
//my approach: //for first and last row, indices increase by 2n-2 //for each subsequent row, this increment factor reduces by 2 //and alternates with (2n-2) - increment factor class Solution { public: string convert(string s, int numRows) { if (numRows == 1) return s; string ret; int n =...
ALGO
0.999996
6.104496
{ "github_metadata": { "branch": "master", "commit_count": 307, "repo_created_at": "2020-05-25T13:20:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c98dbb4d...
c2de8f29-093e-4392-9072-80ede0a989b0
renardbebe/myPOJ
专题/搜索/bfs/3414.Pots.cpp
#include <iostream> #include <cstdlib> #include <cstring> #include <queue> #include <string> #include <cmath> #include <vector> using namespace std; #define N 110 int A, B, C; int visit[N][N]; // 记录当前状态有没有到达过 struct OP { int id; int V1, V2; int step; vector<int> path; OP() {} OP(int i, int a, int b, int s, ve...
ALGO
0.999573
3.848431
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2018-01-13T02:17: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": "446c9147f...
7d6b7ba0-5372-48b0-8ac6-c67ddb323619
deepomicslab/PALACE
seqGraph_phage/build/reads_overlap.cpp
// // Created by caronkey on 27/11/2020. // #include "reads_overlap.h" #include "cxxopts.hpp" #include <math.h> // arg1 输入bam,arg2输出jaccard float DEPTH = -1; int CUTOFF = 300; bool SELFLOOP = false; int THRESHOLD = 0; int main(int argc, char **argv) { // parse options cxxopts::Options options("Reads overla...
DATA
0.989729
4.353939
{ "github_metadata": { "branch": "main", "commit_count": 69, "repo_created_at": "2023-04-26T04:26:56.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3af59e3b6b7c...
832a2656-947e-470e-b32e-6a388ed5dd2b
AlexMercer-MA/UnrealEngine-4.27
Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PerParticleDampVelocity.cpp
// Copyright Epic Games, Inc. All Rights Reserved. #include "Chaos/PerParticleDampVelocity.h" #if INTEL_ISPC #include "PerParticleDampVelocity.ispc.generated.h" #endif #if INTEL_ISPC && !UE_BUILD_SHIPPING bool bChaos_DampVelocity_ISPC_Enabled = true; FAutoConsoleVariableRef CVarChaosDampVelocityISPCEnabled(TEXT("p.C...
TOOL
0.990214
6.475622
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2024-07-29T17:27:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2f80111da9...
196a9801-8a24-4ce2-bb97-f15de5d06874
AbhJ/some-cp-files-2
atcoderarc109_c.cpp
//Coded by <NAME> #include <iostream> #include <stdlib.h> #include <algorithm> #include <cstdio> #include <numeric> #include <cstring> #include <numeric> #include <vector> #include <iterator> #include <map> #include <set> #include <climits> #include <queue> #include <cmath> #include <stack> #include <cctype> #include ...
ALGO
0.999876
4.097604
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2021-09-03T12:51: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": "ca3836d377...
41f74d73-45f3-43ea-8498-c1e2c4507310
royastik27/competitive-programming
codeforces/Codeforces_459A-Pashmak_and_Garden.cpp
/** * Codeforces Round #261 (Div. 2) * Porblem A - Pashmak and Garden * Time: 31 ms * AUTHOR: <NAME> **/ #include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); int x1, x2, y1, y2, temp; cin >> x1 >> y1 >> x2 >> y2; if(x1 == x2) { temp = abs(y2-y1); ...
ALGO
0.99963
3.643663
{ "github_metadata": { "branch": "main", "commit_count": 666, "repo_created_at": "2020-12-21T14:22:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9478d931d9...
4acf4501-6c48-4fe2-872c-46045254477d
Mingyum-Kim/Algorithm
백준/DP/2616 소형기관차.cpp
#include <iostream> #include <vector> #include <cstring> #include <algorithm> using namespace std; vector<int> people; vector<int> sum; int dp[3][50001]; // dp[i][s] : 사용한 소형기관차 개수가 i일 때, s번째 객차를 선택할 지 고려하고 있다. 이 선택지에서 최대 손님 수를 담는다. int n; // 총 객차 수 int s; // 끌 수 있는 최대 객차 수 int solve(int index, int start) { if ...
ALGO
0.999878
3.601109
{ "github_metadata": { "branch": "main", "commit_count": 595, "repo_created_at": "2020-12-26T08:24:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "6f4d9b5991...
abbca589-0fc2-4ea0-a076-f23312529d4f
Siddeshwar002/DSA-again
Z_Contests/LeetCode/W 429/2.maximum-number-of-distinct-elements-after-operations.cpp
#include <string> #include <vector> #include <iostream> #include <map> using namespace std; class Solution { public: int maxDistinctElements(vector<int>& nums, int k) { map<int,int> mp; for(auto x : nums) mp[x]++; int ans = 0; for(auto x : mp){ if(x...
ALGO
0.999726
4.560075
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-01-25T14:42: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": "ae26090f09e...
19f515cd-c30a-43d6-9a59-581e10e4e71b
KirillTroshkin/MyProjs
tasks/unixpath2/unixpath.cpp
#include "unixpath.h" #include <cmath> std::vector<std::string_view> UnixPath::Splitted(std::string_view s) const { std::vector<std::string_view> splitted_str; if (s[0] == '/') { size_t divider = 0; while (s.find('/', divider + 1) != std::string::npos) { if (!s.substr(divider + 1, s...
TOOL
0.918507
5.754142
{ "github_metadata": { "branch": "main", "commit_count": 207, "repo_created_at": "2023-04-04T19:28: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": "534f58bd2f...
0435888d-e13b-4c60-af2d-92665055f874
bjorn-grape/bidirectional-pathtracer
pathtracer/src/datastruct/box/BoundingBox.cc
#include "BoundingBox.hh" BoundingBox::BoundingBox(const Vector3D<float> &mini, const Vector3D<float> &maxi) { readVector3DinMin(mini); readVector3DinMax(maxi); } bool BoundingBox::DoIntersect(Ray r) { float px = r.getPosition().getX(); float ox = 1.f / r.getDirection().getX(); float py = r.getPo...
TOOL
0.957027
4.277823
{ "github_metadata": { "branch": "master", "commit_count": 103, "repo_created_at": "2019-02-19T14:10:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "83e0db46...
6955343b-2755-4d88-8c1d-86a907606a2b
Lithium07z/BaekJoon
백준/Silver/14940. 쉬운 최단거리/쉬운 최단거리.cc
#include <iostream> #include <queue> using namespace std; int graph[1001][1001]; int result[1001][1001]; bool visited[1001][1001]; int dx[] = { -1, 1, 0, 0 }; int dy[] = { 0, 0, -1, 1 }; int n, m, sx, sy; void BFS() { queue<pair<int, int>> q; q.push({sx, sy}); visited[sx][sy] = true; result[sx][sy] = 0; while...
ALGO
0.999663
3.635908
{ "github_metadata": { "branch": "main", "commit_count": 718, "repo_created_at": "2022-03-27T08:28: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": "f8ae7cfd4b...
34022758-f565-4139-8c28-89cc7dca099b
killxin/das
AVL.cpp
#include <iostream> #include <assert.h> using namespace std; template <typename E> struct AVLNode { E data; int bf; AVLNode<E> *left,*right; }; template <typename E> class AVL { public: AVL(){ root=NULL; } void Insert(E d){ Insert(d,root); } void InOrder(){ InOrder(root); } void PreOrder(){ PreOrder(root); } pri...
ALGO
0.999956
4.73567
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2014-10-17T06:53: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": "7ce3c84de...
4364e234-1f83-409d-ac5d-496f8a888a10
choijunghoon-md/COS_Pro2_repository
2023_05_12/main4.cpp
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> int* solution(const char* schedule[], int schedule_len) { int count = 0; for (int i = 0; i < schedule_len; i++) { if (schedule[i] == "x") count++; } int* answer = (int*)malloc(sizeof(int) * count); for (int i = 0; i < count; i++)...
ALGO
0.999883
4.204107
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2023-02-06T00:38: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": "d639986e927...
f1d0dd64-2ebd-4390-a553-9b0f60bd942b
DAngelo-S/Training-for-Programming-Competitions
2021/Neps/Bolhas_e_Baldes.cpp
#include<bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f long long merge_sort (vector<long long> &v) { if (v.size() == 1) return 0; vector<long long> u1, u2; for(long long i = 0; i < v.size()/2; i++) u1.push_back(v[i]); for(long long i = v.size()/2; i < v.size(); i++) u2.push_back(v[i]); long...
ALGO
0.999884
4.036345
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2021-03-29T22:42:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d3aa5e0bb08...
8bdb9fd7-ead9-4ee3-baf7-2a53a8fdea21
Sankhyesh/LeetCode-problems-striver-sheet-
Linked_List/2. Add Two Numbers.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* addTwoNumb...
ALGO
0.999936
6.287369
{ "github_metadata": { "branch": "main", "commit_count": 155, "repo_created_at": "2022-01-11T09:46: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": "ffbd8b30e8...
a5e9ae00-6494-4c0c-82d8-72dd1a2015dd
boge-liu/alpha-beta-core
src/experiment.cpp
#include "experiment.h" #include "paper.h" #include "incremental_test.h" #include <ctime> #include <iostream> #include <fstream> #include <random> #include <sstream> #include "random.h" using namespace std; string OUTPUT_LOC = "../experiments/"; string INPUT_LOC = "../realGraph/"; vector<Datasets> scala_dataset = { D...
TEST
0.927508
3.344625
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2019-12-19T05:53:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 6, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "3414fb9489...
e1abda6d-f488-4cd8-a964-7baf042c92a6
syjya/Comer
SurroundedRegion/concrete/judgemr.cpp
#include <iostream> #include <vector> #include <string> #include <fstream> #include <sstream> #include <dirent.h> #include <stdlib.h> using namespace std; std::string b[2000][2000]; int rc[2000][2]; int bi[2000]; int result[500][4]; int resulti=0; int name[2000]; int allj[2000]; int kong[2000]; int change(string a) {...
ALGO
0.996777
3.256001
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2021-09-11T03:02:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d36e13969...
acc8d112-5ef1-4305-a564-74c91b01c048
toilakhiem/Code-PTIT-CTDL-v-GT
Lop CTDL/Sap_xep_va_tim_kiem/8_dem_cap.cpp
#include <bits/stdc++.h> using namespace std; // x^y > y^x; khi y>x int cnt[5]; int solve(int b[], int m, int x) { if (x == 0) return 0; if (x == 1) return cnt[0]; // vi 1^0 > 0^1 long long res = cnt[0] + cnt[1]; auto it = upper_bound(b, b + m, x); res += m - (it - b); // tat ca phan...
ALGO
0.999857
3.722118
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-03-27T03:56:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "759220f678c0...
951640c1-e6e2-483e-b20c-ed7336a08d09
reoden/tpl_ref
library/USI-ctl/string/z-algo.cpp
/** * Author: Boboge * Date: 23-02-07 * Description: Given string $s = s_0...s_{n - 1}$, compute array $z$ where $z[i]$ is the lcp of $s_0...s_{n - 1}$ and $s_{i}...s_{n - 1}$. * Use function $cal(t)$ (where $|t| = m$) to calculate the lcp of of $s_0...s_{n - 1}$ and $t_{i}...t_{m - 1}$ for each $i$. * Usage: z_f...
ALGO
0.999273
5.472933
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2024-09-21T03:08:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5130911cf1d...
994c16e3-7c20-465e-99e6-4c0fe78161d0
rajib13/ProblemSolving
problems/arranging-coins.cpp
class Solution { public: int arrangeCoins(int n) { /* a(a+1)/2 = n => a(a+1) = 2n => a^2 + a = 2n => (a + 1/2)^2 - 1/4 = 2n a = sqrt(2n + 1/4) - 1/2 */ return sqrt(2 * (long) n + 0.25) - 0.5; } }; /* Complexity analysis:...
ALGO
0.999977
6.551426
{ "github_metadata": { "branch": "master", "commit_count": 823, "repo_created_at": "2019-09-11T02:49: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": "b45a9e9b...
045f5cc8-2a9e-4fbb-9f70-a6d60e451b67
standard-ian/Math_Prac
Leuty-Ian-Prog1.cpp
/* <NAME> April_4_2024 CS162_001_Program1 <EMAIL> This program is for practicing simple math problems. These problems will be addition, subtraction, or multiplication of two numbers between zero and twenty. */ //include needed libraries for random number generation. #include <iostream> #include <cstdlib> #include <ct...
ALGO
0.993878
3.836884
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-05-17T17:15: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": "e72351c21982...
d8b774bf-7107-4362-b5ba-3d38e90038b2
Fxlipe115/CPD_Final
src/word.cpp
// Getters, setters and other methods for the Word class. #include "word.hpp" #include <cmath> using namespace std; Word::Word(string key) : sum(0.0), key(key), occurrences(0), pos(0), neg(0), reviews() {} double Word::mean(){ // Not really your average mean double temp = (this->get_sum()/this->get_occu...
TOOL
0.939916
4.593889
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2017-07-02T17:47: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": "576d1b46f...
dbe3765a-6bf1-4bba-87cc-c3c0e66c8ec0
Raemerrr/AlgorithmProblemsSolved
src/BOJ/22/03/BOJ_4659_비밀번호 발음하기_220323.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <map> using namespace std; string input; vector<char> vowels{'a', 'e', 'i', 'o', 'u'}; bool check1(const string &str) { bool result = false; for (const char vowel: vowels) { if (str.find(vowel) != string::npos) { ...
ALGO
0.998369
4.770675
{ "github_metadata": { "branch": "main", "commit_count": 174, "repo_created_at": "2021-12-03T15:00:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4ee59e46c2...
3e5c7c65-9d81-4c8c-8b60-d93afa377d1b
StruggleForCode/ACMPractice
牛客/小G数数.cpp
#include <iostream> #include <algorithm> using namespace std; typedef long long ll; const int MAX = 500 + 5; int a[MAX]; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; } ll sum = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { ...
ALGO
0.999984
3.899501
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2020-02-16T06:12: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": "13d47f8ecd...
bd43f578-cea1-40ba-87c7-385751bef1dd
kyad/atcoder
abc381/d/a.cc
#include <algorithm> #include <cassert> #include <iostream> #include <vector> using namespace std; int f(const vector<int>& A, int N) { assert(A.size() % 2 == 0); int M = A.size() / 2; vector<int> B(M); for (int j = 0; j < M; j++) { if (A.at(j * 2) == A.at(j * 2 + 1)) { B.at(j) = A.at(j * 2); } e...
ALGO
0.999971
4.138849
{ "github_metadata": { "branch": "master", "commit_count": 889, "repo_created_at": "2021-08-26T14:42: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": "cef4e268...
98a05852-69e8-4c6b-9186-990315929ffa
ssthegrt/SecurityLab
ha/Question4.cc
#include "ns3/core-module.h" #include "ns3/network-module.h" #include "ns3/internet-module.h" #include "ns3/csma-module.h" #include "ns3/point-to-point-module.h" #include "ns3/applications-module.h" #include "ns3/netanim-module.h" #include <bits/stdc++.h> using namespace ns3; using namespace std; NS_LOG_COMPONENT_DEF...
TOOL
0.994357
3.491199
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-06-08T08:30: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": "08d9cd8128...
23a817c0-e777-4a12-ba41-cb15cce43756
abhaygarud/DSA_STACK_INFIX_POSTFIX
infix_postfix.cpp
#include <iostream> #include <cstring> using namespace std; #define M 50 int size=M; char arr[M]; int top=-1; int i=0; int stacktop() { return arr[top]; } int Isfull() { if(top=size-1) { return 1; }return 0; } int Isempty() { if(top==-1) { return 1; }retu...
ALGO
0.999887
4.189096
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-05-15T11:19: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": "623753616acf...
8c53cd16-44df-4c86-9d09-9fa404c613c6
AlexHutchison-Dev/C--in-21-days
chapter-5/listing-5.4.cpp
// Listing 5.4 - demonstrates if statements usied with relational operators #include <iostream> int main() { using std::cin; using std::cout; int MetsScore, YankeesScore; cout << "Enter the score for the mets: "; cin >> MetsScore; cout << "\nEnter the score for the Yankees: "; cin >> Yank...
TOOL
0.998716
3.824073
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2021-04-22T06:19: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": "97e3d091f...
97762b77-409c-455f-8115-825f9b705a1e
zqczgl/Datastructures
DataStructures/chainlist.cpp
#include "iostream" using namespace std; template <class T> struct chainNode{ T element; chainNode<T> *next; chainNode(){} chainNode(const T& element) {this->element=element;} chainNode(T element, chainNode<T> *next) {this->element=element;this->next=next;} }; template<class T> class chain{ ...
ALGO
0.999913
4.056797
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2022-12-23T09:02:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7b90e8e632...
87e79755-79ba-40bc-bb82-b23a7bf6d67d
Altu-Bitu/Altu-Bitu_SG
0924/15650.cpp
//이 문제 조건에는 수열을 중복없이 오름차순으로 출력하라는 조건이 있는데 //오름차순이 되면 자동으로 중복은 제거가 되니까 15649번과 다르게 check 배열은 필요가 없다 #include <iostream> using namespace std; const int SIZE = 8; //수가 최대 8개까지 입력될 수 있으니까 SIZE를 상수 8로 지정 int n, m; //n개의 수 중에 m개의 수를 골라서 수열로 출력할거야 int num[SIZE]; //1부터 n까지의 수를 넣을 배열 //재귀함수로 구현한 백트래킹 void backtracking(int c...
ALGO
0.99999
4.243151
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2021-08-26T06:57:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 12 }, "file_meta": { "content_id": "7bd9301ab6c...
b5692cd9-822f-4b0a-a664-ba03905bf73a
Smlight/Programming-Contest
CCFCSP/2019/201909-3.cpp
#include <bits/stdc++.h> using namespace std; struct RGB { int R,G,B; RGB operator+(const RGB &rhs) const { return {R+rhs.R,G+rhs.G,B+rhs.B}; } RGB operator/(const int &rhs) const { return {R/rhs, G/rhs, B/rhs}; } bool operator==(const RGB &rhs) const { return R==rhs.R &...
ALGO
0.997418
3.634363
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2016-04-21T11:07:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "9cad0200c...
039cd37a-b6e2-4558-aed4-c087b8a1e426
krishnas005/CPP-Codes
A_Make_Even.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while(t--) { string n; cin >> n; if((n.back() - '0') % 2 == 0) { cout << 0 << endl; continue; } if((n[0] - '0') % 2 == 0) { cout << 1 << endl; ...
ALGO
0.998722
3.764427
{ "github_metadata": { "branch": "main", "commit_count": 133, "repo_created_at": "2024-10-20T17:34:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cc869952d3...
b4e3bad9-cfb5-4d48-b931-f79122ca4e79
gaurav7477/LeetCodeDSA
110-balanced-binary-tree/110-balanced-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999963
5.976815
{ "github_metadata": { "branch": "main", "commit_count": 450, "repo_created_at": "2022-09-13T12: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": "c8789ff180...
7d40cefd-38c6-4585-b6a1-b15f996aa072
meherajmithun/problem-solving
codeforces/A_Nastia_and_Nearly_Good_Numbers.cpp
const int mx = 1e7 + 123; bool isprime[mx]; vector<int> prime; void sieve(int n) { for (int i = 3; i <= n; i += 2) { isprime[i] = true; } for (int i = 3; i * i <= n; i += 2) { if (isprime[i]) { for (int j = i * i; j <= n; j += i) { isprime[j] = false; ...
ALGO
0.999329
4.583631
{ "github_metadata": { "branch": "main", "commit_count": 321, "repo_created_at": "2024-07-06T18:51: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": "2731fea5ed...
01982137-20e1-4ea5-a3a2-3f1a3848037e
x3-apptech/salome-modules-shaper
src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp
// Copyright (C) 2014-2021 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This ...
TOOL
0.957352
6.421972
{ "github_metadata": { "branch": "master", "commit_count": 9856, "repo_created_at": "2021-11-25T11:55:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3a5bcdf...
b658539d-6149-494b-a624-901a5fdab054
captain-rainbow/Kobra-Mod-Pack
kobra_core/442_equipment/jumppack.hpp
class 442_jumppack: B_Kitbag_rgr { author = "<NAME>"; scope = 2; picture = "\SWLB_equipment\backpacks\data\ui\icon_SWLB_clone_backpack_ca.paa"; displayname = "[K] Jumppack"; model = "442_equipment\jumppack\jumppack.p3d"; maximumload = 150; hiddenselections[] = { "camo1" }; hiddenselectionst...
TOOL
0.971345
5.399468
{ "github_metadata": { "branch": "build_9_15_2020", "commit_count": 161, "repo_created_at": "2020-11-06T18:23: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": ...
84102289-5f26-4cf9-a611-942023882906
Rajeevkavala/Holiday_Assignment
OS/9.Arrays.cpp
#include <vector> #include <queue> using namespace std; class Solution { public: bool canFinish(int numCourses, vector<vector<int>>& prerequisites) { // Step 1: Create the adjacency list and in-degree array vector<vector<int>> graph(numCourses); vector<int> inDegree(numCourses, 0); ...
ALGO
0.999927
7.103238
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-01-22T14:51: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": "5b01c8eaa646...
0d881471-b456-4690-876d-aa73062c6ba1
hayaten0415/Competitive-programming
MojaCoder/BoB005/D.cpp
#pragma region Macros // #pragma GCC target("avx2") #pragma GCC optimize("O3") #include <bits/stdc++.h> #include <atcoder/all> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, l...
ALGO
0.999844
4.512014
{ "github_metadata": { "branch": "master", "commit_count": 1321, "repo_created_at": "2019-02-17T01:01:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "0603eb8...
ee44010f-357f-493d-9603-dbf3c720bea6
jerryxu20/kattis
glossaryarrangement.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; #define pb push_back #define mp make_pair class union_find { private: vector<int>...
ALGO
0.999955
3.956466
{ "github_metadata": { "branch": "main", "commit_count": 73, "repo_created_at": "2023-01-10T02:04: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": "8e344214935...
38a1f4a2-dd45-48fa-af3a-5d5349fff6bc
borglab/gtsam
gtsam/nonlinear/DoglegOptimizerImpl.cpp
/* ---------------------------------------------------------------------------- * GTSAM Copyright 2010, Georgia Tech Research Corporation, * Atlanta, Georgia 30332-0415 * All Rights Reserved * Authors: <NAME>, et al. (see THANKS for the full author list) * See LICENSE for the license information * ------------...
ALGO
0.999792
7.102018
{ "github_metadata": { "branch": "develop", "commit_count": 19360, "repo_created_at": "2017-03-27T17:12:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3002, "forks": 845, "issues": 99, "pull_requests": 25 }, "file_meta": { "content_id": ...
a6396f36-825b-4144-88f4-d79616538713
adhyan-jain/CodeVault
C++/Day-104/03.cpp
/* Problem Statement Implement a Matrix class that represents a two-dimensional matrix of integers. Overload the unary - operator to negate all elements of the matrix and return a new matrix with the negated values. Create a class called Matrix and Matrix operator-() overloads the unary - operator to negate all ...
ALGO
0.999966
4.884072
{ "github_metadata": { "branch": "master", "commit_count": 464, "repo_created_at": "2025-02-03T16:05: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": "a16bc452...
6ee72e8a-92c8-49ed-a5fb-30130f51b9a9
aKhfagy/DS-project
Sudoku/graph.cpp
#include "graph.h" using namespace std; graph::graph(ReadFromFile read) { obj = read; V = obj.sizeOfBoard * obj.sizeOfBoard; adj.resize(V); color = new int[V]; available = new bool[V]; } void graph::addEdge(int v1, int v2) { adj[v1].push_back(v2); adj[v2].push_back(v1); } void graph::getAll() { for (int...
ALGO
0.994717
3.216996
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2019-10-21T11:27:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7b6e822bf...
acbc962c-ecf9-42b8-8160-e2b1840d93ab
viddya673/DSA-solutions-medium
LinkedLists/addTwoNums.cpp
#include <iostream> using namespace std; struct ListNode{ int val; struct ListNode* next; }; void newNode(ListNode*& head, int val){ ListNode* temp = head; while(temp->next){ temp = temp->next; } ListNode* newNode = new ListNode(); newNode->val = val; newNode->next = NULL; ...
ALGO
0.999973
5.8055
{ "github_metadata": { "branch": "main", "commit_count": 93, "repo_created_at": "2023-08-13T17:36: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": "bcd20f79db1...
d93c12c3-477c-4260-8ba0-2bae59c6de6c
namanjagtap/C-Codes
BT_Level_Order_Traversal.cpp
#include <iostream> #include <queue> using namespace std; class node{ public: int data; node* left; node* right; node(int val){ data=val; left=NULL; right=NULL; } }; void levelOrderTraversal(struct node* root, int level){ queue<node*> q; q.push(root); q.push...
ALGO
0.999981
4.636868
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-03-14T14:33: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": "f69841c9695d...
5907ff7a-cce5-4a79-9933-e8a67d8c1884
ROONEY07/DS-PHI
DS-PH/Signly Linked List Recap/Take_input_linkedList_from_user.cpp
#include <bits/stdc++.h> using namespace std; // Define node class class node { public: int val; node* next; // Constructor node(int val) { this->val = val; this->next = NULL; } }; // Insert at tail function void insert_at_tail(node*& head, node*& tail, int val) { // Create ne...
ALGO
0.999789
5.392757
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-11-18T19:40: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": "dde74b6d3bb...
999f1676-74d5-4901-a757-60d2cec8a273
Shaqundalond/AoC2020
Reinhard/AoC-08/src/MyCPU.cpp
/** * @file MyCPU.cpp * @author your name (<EMAIL>) * @brief * @version 0.1 * @date 2020-12-08 * * @copyright Copyright (c) 2020 * */ #include <iostream> #include <string> #include <vector> using namespace std; #include "AoC-Tools.h" #include "MyCPU.h" MyCPU_Instruction::MyCPU_Instruction() { m_Cod...
ALGO
0.998079
4.495065
{ "github_metadata": { "branch": "main", "commit_count": 112, "repo_created_at": "2022-04-20T17:00: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": "7ad27feef5...
a90a57e3-6bc8-4d99-bfb2-3ee214c892b6
dmingn/AOJ
ITP1/ITP1_11_D.cpp
#include <iostream> #include <array> #include <vector> using namespace std; enum dir_t {NORTH, EAST, WEST, SOUTH, CLKW, CCLKW}; enum face_t {TOP, BOTTOM, FRONT, BACK, LEFT, RIGHT}; class Dice { public: Dice() { val[TOP] = 0; val[BOTTOM] = 0; val[FRONT] = 0; val[BACK] = 0; ...
ALGO
0.999804
4.490312
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2017-05-07T11:29:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "613399ae9...
c273ed03-42c6-4513-a184-51f97092eb4a
uxncode/TFB2023-TEB1113-Algorithm-and-Data-Structure---May-2025
Lab3/22011528_ahmad_L3 (Doubly Linked List).cpp
/* ************************* Id : 22011528 Name : <NAME>'<NAME> Lab : 3 ************************* */ #include <iostream> #include <string> using namespace std; class Node { public: string name; Node* prev; Node* next; Node(string name) { this->name = name; prev = nullptr; nex...
ALGO
0.99896
5.787272
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2025-06-04T01:53: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": "9c0db99eaef...
4647bce5-7c08-4aab-989c-afb3bd428b41
gnsJhenJie/Mycpp
TNFSH_Moodle/Task 12-2/解析.cpp
// gnsJhenJie.me All rights reserved. // #include <bits/stdc++.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ using namespace std; int main(int argc, char** argv) { int pamt, samt; cin >> pamt; //pamt為全班人數 samt為科目數 samt = 4; int score[100][4];//score[?][0]:...
ALGO
0.999656
3.592551
{ "github_metadata": { "branch": "master", "commit_count": 108, "repo_created_at": "2017-12-08T13:29:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 4, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "32a80e0d...
3ef95e78-5616-4a3b-906e-84f9683e3861
kaitlynwright/Linked-List-Practice
main.cpp
#include "LLL.cpp" void LLL_rand(void) { int instr, pos, input; printf("Enter number of elements in lll:\n"); scanf("%d", &instr); printf("Enter maximum value that elements can be:\n"); scanf("%d", &input); LLL *lll = new LLL(instr, input); do { printf("\nLLL Explorer\n0)quit\n1)insert\n2)remove\n"\ "3)...
ALGO
0.999598
3.711282
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-01-18T23:59: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": "13785af765...
03a7a39a-e72b-4bc9-8f72-41c990d45eb0
ishandutta2007/codeforces-z
zesty_fox/normal/1712/F.cpp
#include <bits/stdc++.h> using namespace std; typedef long long i64; typedef double db; typedef vector<int> vi; typedef pair<int,int> pii; template<typename T> inline T read(){ T x=0,f=0;char ch=getchar(); while(!isdigit(ch)) f|=(ch=='-'),ch=getchar(); while(isdigit(ch)) x=x*10+(ch^48),ch=getchar(); r...
ALGO
0.999797
3.923478
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:43: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": "4968ba081a99...
313b8f11-e7e7-4cd7-8271-a520f96e10f5
24Shreyaskumar/Cracking-the-Coding-Interview
DP Training Series/5 DP on Strings/9_Distant_Subsequences.cpp
#include <bits/stdc++.h> #define FOR(i, m, n) for(int i = m; i < n; i++) #define FORD(i, m, n) for(int i = m; i >= n; i--) #define fe(i, ds) for(auto i : ds) #define vi vector<int> #define vb vector<bool> #define vvi vector<vector<int>> #define vvb vector<vector<bool>> #define omap map<int, int> #define umap unordered_...
ALGO
0.999996
4.8294
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2024-01-14T04:54:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c3e5a5a4afa...
5de40233-b2d6-4595-b64c-017bd6047629
RicoJia/Leetcode
dynamic_programming/0518-coin-change-2/solution.h
#include <iostream> using std::cout; using std::endl; #include <vector> using std::vector; #include <algorithm> using std::for_each; ///*Slow implementation*/ //class Solution { //private: // int num_sol_; // int dp(int amount, vector<int>& coins, int current_index, int current_sum){ // if(current_sum =...
ALGO
0.999928
5.362181
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2020-06-23T19:32: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": "809d7ec44...
108eeab9-0594-4697-a4e2-003176e25e11
ZachL1/Bilibili-plus
C++-DesignPattern/code/20_Composite/composite.cpp
#include <iostream> #include <list> #include <string> #include <algorithm> using namespace std; class Component { public: virtual void process() = 0; virtual ~Component(){} }; //树节点 class Composite : public Component{ string name; list<Component*> elements; public: Composite(const string & s...
TOOL
0.973443
5.176668
{ "github_metadata": { "branch": "master", "commit_count": 113, "repo_created_at": "2021-02-17T09:40:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4125, "forks": 1047, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "26...
5de20ac5-3f44-4ce6-8452-cb8b68e7e6aa
Haryce/23_09
53.cpp
#include <iostream> using namespace std; int main() { setlocale(LC_ALL, "Russian"); double a, b, c, d, e, f, g, h; cout << "Введите координаты точки A (a, b): "; cin >> a >> b; cout << "Введите координаты точки B (c, d): "; cin >> c >> d; cout << "Введите координаты точки E (e, f): "; ci...
ALGO
0.999903
4.470173
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-11-14T05:27: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": "4fedb727f72e...
6618c382-66aa-447e-b008-ce469695e0a5
AhmedEssamYassin/Problem-Solving
CP Sheets Solutions/ICPC Assiut Advanced - Newcomers 2023/Contest 2/G/Solution.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("Output.txt", "w", stdout); #endif /* Nour has N candies, he wants to distribute all N candies to the c...
ALGO
0.999951
4.412453
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2025-05-02T14:49:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a660d3e0d95...
4b4abe76-732d-434f-930f-ea72dfdfdfb9
SEONMl/Solutions
venv/Category/Challenge/2024SamsungAlg/Pro기출/4_신소재케이블2.cpp
#include<unordered_map> #define MAX 10005 using namespace std; unordered_map<int, int> idx; int parent[MAX],depth[MAX],distToParent[MAX]; int firstId[MAX], secondId[MAX], firstLatency[MAX], secondLatency[MAX]; int getIndex(int i){ if(idx.find(i)==idx.end()) idx.insert({i,idx.size()+1}); return idx[i]; } void init(in...
ALGO
0.995401
4.426053
{ "github_metadata": { "branch": "master", "commit_count": 279, "repo_created_at": "2022-04-29T15:32: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": "22e405fc...
d35d960c-e1a1-4429-9200-6eb594182f67
yang48699997/code
atc/abc377/E_Permute_K_times_2.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; struct DSU{ vector<int> fa, sz; DSU(int n) : fa(n), sz(n, 1) { for (int i = 0; i < n; i++) fa[i]=i; } int find(int x) { if (fa[x] == x) return x; fa[x] = find(fa[x]); return fa[x]; } bool same(i...
ALGO
0.999992
4.306119
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2024-04-12T14:28:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0949dc2c2...
6fb4dda5-389a-488f-82c0-d431211938c1
WAiiFrog/algorithm
网络流24题LOJ/6227.cpp
#include<bits/stdc++.h> using namespace std; int max(const int& a,const int& b){ return a>b?a:b; } const long long inf = 0x3f7f7f7f7f7f7f7f; const int N = 3000005; long long dis[5000],pre[5000]; bool inq[5000]; long long l[5000],z[5000],y[5000],dic[5000],tp; struct Edges{ int s,t,w,c,nxt; Edges(){} Edges(int ss,...
ALGO
0.999952
3.550182
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-03-20T07:58: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": "be2ba0c544...
521b6431-b694-4b00-b544-0c13b91d1c0c
falcaoanderson/CompetitiveProgramming
OBI/obi-2018-maximin.cpp
// 29/08/19 // 1:37 PM // #include <bits/stdc++.h> using namespace std; #define MAXN 100010 #define INF 0x3f3f3f3f int n, l, r; int v[MAXN]; int main(){ cin >> n >> l >> r; for(int i=1; i<=n; i++) cin >> v[i]; sort(v+1, v+n+1); if(l>=v[n]){ cout << r-v[n] << endl; return 0; }...
ALGO
0.999914
3.901492
{ "github_metadata": { "branch": "main", "commit_count": 337, "repo_created_at": "2023-03-08T11:51: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": "90a7ca15a9...
9ae87c27-1ba8-42fd-ae7f-5c175ffd2215
dani-tro/DAA_practicum_23_24
Exam 2/students-solutions/pmnedyalko/beetles_02_0p.cpp
#include <bits/stdc++.h> struct edge { long long first, second, w; bool operator<(const edge& other) { return w < other.w; } }; const int MAX_SIZE = 1e5 + 10; std::vector<edge> edges; std::vector<std::pair<int,int>> pairs; long long parent[MAX_SIZE], depth[MAX_SIZE]; long long n,m,a,b, count; in...
ALGO
0.999765
3.817382
{ "github_metadata": { "branch": "main", "commit_count": 63, "repo_created_at": "2024-02-16T11:05:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "08eb1101da0...
3f2a4666-ee0c-4f25-bc05-5756f94cecbd
Shovan2001/LeetCode
114-flatten-binary-tree-to-linked-list/flatten-binary-tree-to-linked-list.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.99998
5.378039
{ "github_metadata": { "branch": "main", "commit_count": 437, "repo_created_at": "2024-09-08T19:35: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": "c058f3997c...
dc6495da-79ff-4f76-b46b-87b288bca7ff
le-benjamin/competitive-programming
USACO/Training/Chapter_1/wormhole.cpp
/* ID: b.le611 PROG: wormhole LANG: C++14 */ #include <bits/stdc++.h> using namespace std; #define vt vector #define pb push_back #define eb emplace_back #define all(c) (c).begin(), (c).end() #define sz(x) (int)(x).size() void setIO(string name = "") { freopen((name+".in").c_str(), "r", stdin); freopen((name...
ALGO
0.999951
3.867754
{ "github_metadata": { "branch": "main", "commit_count": 78, "repo_created_at": "2022-02-24T04:52: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": "ae229a33821...
4736c350-9ea7-44a5-be04-97dde3299df9
vopl/sp
legacy/39.middle/hel/levmar.cpp
#include "stdafx.h" #include "hel/levmar.h" #include "hel/types.h" namespace hel { ////////////////////////////////////////////////////////////////////////// real g_levmarOptsAutoMu[LM_OPTS_SZ] = { 1E-60, //LM_INIT_MU,//mu 1E-80, //LM_STOP_THRESH, //stopping thresholds for ||J^T e||_inf, 1E-80, //LM_STOP_...
ALGO
0.978491
4.640035
{ "github_metadata": { "branch": "master", "commit_count": 127, "repo_created_at": "2016-08-09T12:33:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b2519054...
5de68eba-c3bf-4a1e-bab7-2ac9d80f639c
mityamuch/repo
FA_Kursach/FA_Kursach/lottery.h
#pragma once #include "fabrica.h" #include <vector> const int size_of_circulation = 10000; struct win_ticket_t { int win;//1-100 2-1000 3-10000 4-100000 5-1000000 std::shared_ptr<v_ticket> ticket; }; template <template <typename T> typename Container> class Lottery { public: void start_5_36(){ return start(fab...
ALGO
0.995877
3.778301
{ "github_metadata": { "branch": "main", "commit_count": 60, "repo_created_at": "2021-02-18T17:44: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": "f24d8d6b642...
b1ed7eec-dd45-4478-9a07-8ca145d066d7
alexalmeida52/functionsCpp
edb/source/buscaSequencialOrdenada.cpp
//valgrind --leak-check=full ./ex1 //g++ -o buscaSequencial -Wall -ansi -pedantic -O0 -g buscaSequencial3.cpp #include <iostream> using namespace std; int busca_ordenada(int k, int colecao[], int tamanho) { int posicao = 0; do { if (k == colecao[posicao]) return posicao; // SUCESSO else if (k < colecao[po...
ALGO
0.999524
4.06199
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2019-02-26T22:47: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": "6dcc05adca...
c643ee66-f12a-4834-9995-94baecda0463
nikhil980/gfgcoding
Difficulty: Medium/Not a subset sum/not-a-subset-sum.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: long long findSmallest(vector<int> &arr) { // Your code goes here. long long range=0; long long sum=0; ...
ALGO
0.999372
5.801843
{ "github_metadata": { "branch": "main", "commit_count": 1049, "repo_created_at": "2024-08-15T14:43: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": "5d38d7000...
04cd213d-0342-4662-9981-d1ba2b2206e0
kiraskywing/Code_Practice
Data Structure/Union find/Hard/LET_no1632_Rank Transform of a Matrix.cpp
class UnionFind { private: vector<int> parent; public: UnionFind(int n) { for (int i = 0; i < n; i++) parent.emplace_back(i); } int find(int i) { if (parent[i] != i) parent[i] = find(parent[i]); return parent[i]; } pair<int, int> uni(int...
ALGO
0.999998
6.435993
{ "github_metadata": { "branch": "main", "commit_count": 798, "repo_created_at": "2020-10-13T06:49:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7b4e6328d5...
97ec0685-e2a5-414f-a31b-d59cd6e358c2
Prashant-kr93/dsa
9_Lecture_08_Linked_List_1/Assignment/Eliminate_Duplicate_LL.cpp
#include<iostream> using namespace std; class Node{ public: int data; Node* next; Node(int data){ this->data = data; this->next = NULL; } }; Node* takeInput(){ int data; cin>>data; Node* head = NULL; Node* tail = NULL; while (data != -1) { Node *newN...
ALGO
0.999756
4.870089
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-07-30T14:38: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": "235b839a5bd6...
47f093b6-d129-477a-a737-eb1890663622
Prasanna-sippa/Coding
MAQ/Find next greater number with same set of digits.cpp
Following is the algorithm for finding the next greater number. Traverse the given number from rightmost digit, keep traversing till you find a digit which is smaller than the previously traversed digit. For example, if the input number is “534976”, we stop at 4 because 4 is smaller than next digit 9. If we do not fi...
ALGO
0.999991
6.179389
{ "github_metadata": { "branch": "main", "commit_count": 168, "repo_created_at": "2022-07-05T02:02: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": "38bc2add49...
8221dcba-bf70-4d91-b36c-1bb74ddbf67e
lwalroth/private106b
ProgrammingAssignments/PA_3/warm_up_b/MainProg.cpp
/* * MainProg.cpp * warm_up_b * * Created by athony on 1/31/14. * Copyright 2014 __MyCompanyName__. All rights reserved. * */ #include <iostream> #include "genlib.h" #include "vector.h" bool RecSum(Vector<int> &nums, int index, int sumSoFar, int target){ if(sumSoFar == target) return true; // success bas...
ALGO
0.997762
5.670577
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2014-02-02T18:19: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": "601874ee44...
9edffbb3-36ff-4ef2-808d-5e0bf8a305ed
changicho/algorithm-training
LeetCode/easy/1099. Two Sum Less Than K/answer.cpp
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; // use binary search // time : O(N * log_2(N) // space : O(N) class Solution { public: int twoSumLessThanK(vector<int>& nums, int k) { int size = nums.size(); sort(nums.begin(), nums.end()); int answer =...
ALGO
0.999984
6.292883
{ "github_metadata": { "branch": "master", "commit_count": 2455, "repo_created_at": "2019-09-02T14:53:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 44, "forks": 4, "issues": 25, "pull_requests": 0 }, "file_meta": { "content_id": "4fc24...
a2c02340-713f-428e-8dbe-8c22d0ede9ed
kappybar/competitive_programming_library
Graph/range_path.cpp
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) using namespace std; using ll = long long ; using P = pair<int,int> ; using pll = pair<long long,long long>; constexpr int INF = 1e9; constexpr long long LINF = 1e17; constexpr int MOD = 1000000007; constexpr double PI = 3.14159265358979323846; st...
ALGO
0.999967
4.266116
{ "github_metadata": { "branch": "main", "commit_count": 63, "repo_created_at": "2020-11-29T03:41:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "72865679b59...
000d6519-c26b-4c05-8e12-7eff2fe1c5a8
pravahanj/Data_Structure-and-Algorithm-CodingNinjas.com
Recursion 2/Print all Codes - String.cpp
/* Print all Codes - String Assume that the value of a = 1, b = 2, c = 3, ... , z = 26. You are given a numeric string S. Write a program to print the list of all possible codes that can be generated from the given string. Note : The order of codes are not important. Just print them in different lines. Input format ...
ALGO
0.999763
4.298437
{ "github_metadata": { "branch": "main", "commit_count": 223, "repo_created_at": "2021-10-30T09:49:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 34, "forks": 26, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "1839335e...
a98de6c8-d265-4181-9c3a-aea1883cdd98
ArtAndreev/advent
2024/day13/part2.cpp
#include <fstream> #include <iostream> #include <regex> #include <string> static std::regex number_regexp("(\\d+)"); struct Machine { std::pair<long long, long long> button_a; std::pair<long long, long long> button_b; std::pair<long long, long long> prize; }; size_t solve_machine(const Machine& machine) ...
ALGO
0.999717
4.701626
{ "github_metadata": { "branch": "main", "commit_count": 42, "repo_created_at": "2024-12-14T15:09: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": "a845659a5be...
f976e29d-347d-4aae-8a9a-5af4fa726995
romeric/Fastor
Fastor/expressions/linalg_ops/unary_lu_op.h
#ifndef UNARY_LU_OP_H #define UNARY_LU_OP_H #include "Fastor/meta/meta.h" #include "Fastor/backend/inner.h" #include "Fastor/backend/lufact.h" #include "Fastor/simd_vector/SIMDVector.h" #include "Fastor/tensor/AbstractTensor.h" #include "Fastor/tensor/Aliasing.h" #include "Fastor/tensor/Tensor.h" #include "Fastor/tens...
ALGO
0.999745
7.426832
{ "github_metadata": { "branch": "master", "commit_count": 778, "repo_created_at": "2016-05-24T01:40:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 795, "forks": 76, "issues": 31, "pull_requests": 2 }, "file_meta": { "content_id": "91f4...
143347e7-3c6d-4bc4-b981-8d33a719d59e
wassimalharaki/Codeforces
800/CardsforFriends.cpp
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define int long long #define all(v) v.begin(), v.end() #define nl << '\n' #define v vector #define vi vector<int> #define pii pair<int, int> #define mp make_pair #define pb push_back #define INF LONG_LONG...
ALGO
0.999561
4.07595
{ "github_metadata": { "branch": "main", "commit_count": 160, "repo_created_at": "2023-09-19T17:56: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": "9b7f7d687e...
b400edf6-f4c7-4104-b05c-100b9838db91
InhaWoo/Inha-Cplusplus
CountPrimeUpgrade.cpp
#include <iostream> #include <cmath> //히지 using namespace std; int sum_1toN(int n) { int sum = 0; for (int i = 1; i <= n; i++) { sum += i; } return sum; } bool IsPrime(int n) { //2부터 n-1까지 1칸마다 mod를 구해서 // 0 이 하나라도 나오면 false, // 0 이 한번도 안 나오면 true. //수정방향 //case1. n<=1 //return false. //case2. n=2 //...
ALGO
0.999652
4.45714
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-08-02T19:33: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": "0c096f3303...
dd01121e-e441-4c5d-9c58-a574a921b1b7
ani1914/Structs-C-
stak2.cpp
/* Да се напише програма, чрез която от клавиатурата се въвежда естествено число N от интервала [10.. 100]. Програмата да генерира N броя естествени числа от интервала [1.. 101]. Числата да бъдат записани в стек. При извеждането на елементите на стека числата да се разделят на четни и нечетни, запа...
ALGO
0.997776
3.918282
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-02-02T13:18: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": "2e03d891c6c6...