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
002b9784-2984-453a-8ed5-320913a4a8b0
yzygitzh/oj_solutions
leetcode/src/426.cpp
/* // Definition for a Node. class Node { public: int val; Node* left; Node* right; Node() {} Node(int _val, Node* _left, Node* _right) { val = _val; left = _left; right = _right; } }; */ class Solution { public: Node* treeToDoublyList(Node* root) { if (root...
ALGO
0.999874
6.145275
{ "github_metadata": { "branch": "master", "commit_count": 219, "repo_created_at": "2017-01-28T15:31:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2f8aa82b...
f66bb838-b53b-40ef-a3d3-6d2461c49e66
Yash-Singh1/competitive-programming
codeforces/607B/main.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<int> c(n); for (int i{0}; i < n; ++i) cin >> c[i]; vector<vector<int>> dp(n + 1, vector<int>(n + 1, INT_MAX)); for (int i{0}; i <= n; ++i) { for (int j{0}; j <=...
ALGO
0.99992
4.216268
{ "github_metadata": { "branch": "main", "commit_count": 555, "repo_created_at": "2021-04-23T22:47:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1e618f707f...
13395365-15e7-40c1-afe9-902736a0d71f
DuyDanga/Ma_Tran
matrix/Bai_081/Source.cpp
#include <iostream> #include <iomanip> using namespace std; void Nhap(float[][500], int &, int &); float AmDau(float[][500], int, int); float AmLonNhat(float[][500], int, int); int main() { int m, n; float a[500][500]; Nhap(a, m, n); AmDau(a, m, n); cout << AmLonNhat(a, m, n); return 0; } void Nhap(float a[][5...
ALGO
0.99986
3.032887
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-11-09T15:32: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": "1e325d48417b...
85f4258d-8a60-4b83-8e8a-f2c51c15593f
showmanlee/HowCanISolveThisQuestion
BOJ/19000/19532.cpp
// 수학은 비대면강의입니다 // https://www.acmicpc.net/problem/19532 #include <iostream> using namespace std; int main(void) { cin.tie(NULL); ios_base::sync_with_stdio(false); int a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; int x = 1000, y = 1000; for (int i = -999; i <= 999; i++) { for (int j = -999; j <= 999;...
ALGO
0.999943
4.321084
{ "github_metadata": { "branch": "master", "commit_count": 1741, "repo_created_at": "2020-09-16T11:55:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "97b3609...
ebc630f3-2fdb-49df-b836-c0d4b79d5e44
prateeksharma21/Competitive-Programming
Library/Segment_Tree_Lazy.cpp
template <typename T, class F = function<T(const T&, const T&)>> class SegTree{ private: int _n, sz, lg; vector<T> t, lz; T BASE; F op; T e() {return BASE;} void apply(int k) { t[k] = op(t[2 * k], t[2 * k + 1]); } void add(int k, int val) { t[k] += val; if (k < sz) lz[k] += val...
ALGO
0.999895
5.963826
{ "github_metadata": { "branch": "main", "commit_count": 102, "repo_created_at": "2019-09-30T19:06:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bfde539b1...
c76627c3-e23a-4d5e-96a9-9a444dec29a9
Cegax123/Competitive-Programming
online judges/codeforces/1898 Div2 #910/c.cpp
#include <bits/stdc++.h> using namespace std; #define all(c) (c).begin(), (c).end() #define rall(A) A.rbegin(),A.rend() #define pb push_back #define dbg(x) do {cerr << #x <<" = " << (x) << endl; } while (false) typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; //cout << s...
ALGO
0.999751
3.178678
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-09-15T13:50: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": "6e192c4cb68...
7d4f9ba6-b42d-4c05-b52e-eb90bc280283
Lapikova09/24-10
2410.cpp
#include <iostream> using namespace std; int main() { /* 6 Дано целое число N и набор из N положительных вещественных чисел.Вывести в том же порядке дробные части всех чисел из данного набора(как вещественные числа с нулевой целой частью), а также произведение всех дробных частей. double p = 1; double x; int n; ...
ALGO
0.998958
3.046317
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-10-24T15:16: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": "b1d43faab281...
bfa6ded8-09f0-4579-882a-98737519f236
suyash-03/DSA
Interesting Questions/UniquePaths.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; //Recursive class Solution { public: int count = 0; void countWays(int i,int j,int m,int n){ if(i == m-1 && j == n-1){ count++; return; } if(i > m-1 || j > n-1){ return; } ...
ALGO
0.999961
5.710088
{ "github_metadata": { "branch": "master", "commit_count": 173, "repo_created_at": "2021-08-02T13:16:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f08aac7c...
c17df493-ae9c-47a9-aac4-98fa1dedc293
hs05june/CP
cp_practice/contests/1793C.cpp
#include<bits/stdc++.h> #define rp(i,a,n) for(int i=a;i<n;i++) #define rep(i,a,n) for(int i=a;i>=n;i--) #define ll long long #define int long long #define deq vector<ll> #define mii map<ll,ll> #define pii pair<ll,ll> #define pb push_back #define f first #define s second #define sz(a) (int)a.size() #define all(x) (x).be...
ALGO
0.999842
3.790178
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2022-07-20T13:09: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": "a0cbdf6dad5...
a55671db-07df-4c38-8ebd-de9032ddec4d
ib13/Coding-Practice
Companies/stock-buy-sell-variation.cpp
#include <bits/stdc++.h> using namespace std; vector<int> maxProfit(int *arr, int n) { int s1 = -1, e1 = -1; int i = 0, j = 0; int profit = 0; while (i < n && j < n - 1) { while (j < n - 1 && arr[j] < arr[j + 1]) { j++; } if (i != j) { ...
ALGO
0.999957
4.182262
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2019-04-12T11:38:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f6bf2d0a...
0dbd5c74-e15c-4a64-836a-feb1c07dbda3
woong98/Datastructure-Algorithm
problems/1874.cpp
#include<iostream> #include<string> #include<stack> using namespace std; //수열을 준다면, 그 수열이 스택을 통해서 만들 수 있는 수열인지 판단 //다음 수가 크다 => push가 필요 //다음 수가 작다 => pop이 필요 int main() { bool flg = 0; stack<int> stk; int n; cin >> n; int temp = 1; string str = ""; for(int i = 0; i < n; i++) { ...
ALGO
0.999951
4.511709
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2022-01-23T16:41: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": "807a74cfd81...
b6859237-0092-4728-9708-3884053afc83
Yuki-Nagato/homeworks
部分背包.cpp
#include <cstdio> #include <vector> #include <algorithm> struct Item { double w, v; int id; bool operator< (const Item& b) const { return v / w > b.v / b.w; } }; int main() { puts("输入背包大小"); double c; scanf("%lf", &c); puts("输入物品个数"); int n; scanf("%d", &n); std::ve...
ALGO
0.999991
3.75866
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2018-03-19T06:12: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": "1f07e7928...
bad30590-64a1-46ec-8412-51f95aebbef5
MCKG-L/codes
练习/04 luogu/数学/P2822.cc
#include <bits/stdc++.h> #define int long long #define endl '\n' #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) using namespace std; typedef pair<int,int> PII; const int N = 1e5 + 10,INF = 1e9; void solve(){ int n,k; cin >> n >> k; int N = 2010; vector<vector<int>> f(N,vector<int>(N)),s(...
ALGO
0.99979
4.548542
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2024-07-25T07:49:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4bdd79458477...
aa2c690e-9ce8-46a5-9263-dd4b9d3c5159
AiKay96/MACS
Advanced Algorithms I/11D.cpp
// https://codeforces.com/contest/11/problem/D // https://codeforces.com/problemset/problem/11/D #include "bits/stdc++.h" using namespace std; bool arr[20][20]; long long dp[1<<20][20]; int main(){ int n, m, a; long long ans = 0; cin >> n >> m; for(int i = 0; i < m; i++){ int x, y; c...
ALGO
0.999969
3.686755
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2024-11-08T20:48: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": "734580f99d1...
9679bbf6-60cf-465a-ab43-14b1633e0819
ishandutta2007/codeforces-d
danya.smelskiy/normal/132/C.cpp
#include <bits/stdc++.h> using namespace std; string s; int n; int dp[150][150][2]; int dp2[150][150][2]; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>s>>n; int m=s.size(); for (int i=0;i<=m;++i) for (int j=0;j<=n;++j) { dp[i][j][0]=dp[i][j][1]=-1e9; ...
ALGO
0.99964
3.900067
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:31: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": "6595fba2eeb8...
0051000b-bfcf-4598-8252-deddadf99623
1465114862/-
source/spline.cpp
#include "spline.h" #include <fstream> #include <stdexcept> #include <iostream> void Spline::GetSourceData(const int & SourceDataLength,const double *SourceDataX,const double *SourceDataY) { history=0; x=new double[SourceDataLength]; h=new double[SourceDataLength-1]; M=new double[SourceDataLength]; ...
TOOL
0.974894
4.392136
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2018-11-23T13:24:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "002b9dcf...
9148f6c3-17cd-40cc-854a-3ee234e58293
dhrubajyotinath6/Preparation
LEETCODE-QUESTIONS-main/0958-check-completeness-of-a-binary-tree/0958-check-completeness-of-a-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.999741
6.796329
{ "github_metadata": { "branch": "master", "commit_count": 465, "repo_created_at": "2022-01-24T17:01:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7e994177...
18242fcf-014c-4fd6-a028-6f5fbedfd7a3
itmm/4k-rekursion
rekursion.cpp
#line 20 "README.md" #include <iostream> void print_rec(unsigned val, std::ostream& out) { char dig = (val % 10) + '0'; if (val /= 10) { print_rec(val, out); } out.put(dig); } #line 34 void print_str(unsigned val, std::ostream& out) { std::string res; do { char dig = (val % 10) + '0'; res.insert(res.begin(), ...
TEST
0.948722
6.032825
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-08-25T20:17: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": "9f1bd1259eea...
4d9bec82-bd47-46cf-886d-f8adbfd0d6d6
JJH07/PS
old20_3/14226/14226.cpp
#include <iostream> #include <cstring> #define INF 1e9 int S, dp[2005][2005]; int solve(int length, int copy) { if(length == S) { return 0; } int &ret = dp[length][copy]; if(ret != -1) { return ret; } ret = INF; if(length > S) { ret = std::min(ret, 1 + sol...
ALGO
0.999831
3.128709
{ "github_metadata": { "branch": "master", "commit_count": 146, "repo_created_at": "2022-12-04T05:40:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cc4b0920...
e4c54b8c-3a9a-47c4-b85d-8e43a8e95267
HungMingWu/blockchain-demo
Blockchain/consensus/merkle.h
// Copyright (c) 2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_MERKLE #define BITCOIN_MERKLE #include <stdint.h> #include <vector> #include <tuple> #include "../primitives/tra...
ALGO
0.981574
7.286628
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2018-06-29T10:06: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": "a4c0e649a...
3c4ec806-46ca-45b6-98da-1e4aebeab129
MartinEBravo/Prog-Comp-A
Tareas/Tarea 1/D.cpp
#include <bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); vector<int> vector_a; multiset<int> vector_b; vector<int> vector_c; int n; cin >> n; vector_a.resize(n); vector_c.resize(n); for (int i = 0; i < n; i++){ int num1; cin...
ALGO
0.999993
4.174183
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-08-25T00:49: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": "09634c516821...
44b87c64-d909-4617-bf1e-a4ffa5665684
sarthakkapoor44/CP
B_Bessie_and_MEX.cpp
///////////////////////////////////////////////////// DYNATOS //////////////////////////////////////////////////// #include<bits/stdc++.h> using namespace std; //#include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; typedef long long ll; #define fi first #define se second #define INF 10000000000000000...
ALGO
0.99988
4.169815
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-01-12T13:33: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": "0b6626378d9d...
4669cadc-96ba-401b-ae98-5862afc4fe65
ruipimentelfigueiredo/shape-fitting
include/cylinder_fitting_hough.h
/* Copyright 2018 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, ...
ALGO
0.999083
5.874415
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2017-06-13T14:44:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 6, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "f211fa277...
5f69f311-a40d-499f-af7e-1b382dc480b1
cran/clustAnalytics
src/ssmatrix.cpp
#include <Rcpp.h> #include <unordered_map> #include <vector> #include <cmath> #include "ssmatrix.h" void SSMatrix::empty_SSMatrix_initialization(Rcpp::IntegerMatrix M){ n = M.nrow(); m = M.ncol(); B = std::vector<std::vector<bool> > (n, std::vector<bool>(m, 0)); sampling_vector = SVector<std::pair<int...
ALGO
0.98887
3.437924
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2022-02-19T03:31:50.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6eb79dafb5a...
f806bf04-04bc-4645-99bb-99e3bb978316
sheviv/mirrors
cpp/dict_set.cpp
#include <iostream> #include <set> #include <iterator> #include <vector> using namespace std; int main() { set <int> s; set <int> ss; int n; int nn; cin >> n; for (int i = 0; i < n; ++i) { int x; cin >> x; s.insert(x); } cin >> nn; for (int i = 0; i <...
ALGO
0.999729
3.6656
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2021-09-03T18:47:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "92eaea0d66d...
a646e141-4477-4243-9c85-8deb7eed804b
manlaig/leetcode
palindrome_partitioning.cpp
#include <unordered_map> #include <vector> #include <string> using namespace std; void palindrome_odd(unordered_map<int, vector<int>>& dp, string s, int i) { dp[i].push_back(i+1); int left = i-1; int right = i+1; while(left >= 0 && right < s.size() && s[left] == s[right]) { dp[left].push_ba...
ALGO
0.999915
5.133469
{ "github_metadata": { "branch": "master", "commit_count": 361, "repo_created_at": "2020-05-23T01:29:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6a658965...
dbecd50c-2d67-44b1-86d4-03b174e1daae
danhouldsworth/helloBareMetal2
8.3 MPU6050/MWC21nanoSetupChromeAppGUI_0991/MWC21NanoV_0991/Output.ino
/* OneShot PWM by <NAME> (<EMAIL>) 3D MixTable By <NAME> (<EMAIL>) */ static uint8_t cycleCounter = 0; /**************************************************************************************/ /***** Writes the Motors and Servos values to the Timer PWM compare registers ******/ /*********************************...
TOOL
0.969625
4.660468
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2016-11-14T13:59: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": "b122c4272...
e413b1c1-f0cb-4192-8ee6-eb879a34bf9d
hsarasan/hs-code
algorithms/dynamic-programming/coin.cpp
/* Given an integer that represents an amount of money and a list of possible coins, find the minimum number of coins to make that amount. Return -1 if it's possible to make the amount with the given coins. Example: input: amount = 15 possible_coins = [2, 3, 7] output: 4 explanation: We can make the amount 15 by taking...
ALGO
0.999885
5.541433
{ "github_metadata": { "branch": "main", "commit_count": 490, "repo_created_at": "2023-11-22T16:04: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": "bdc22e834e...
12f74a8e-d9fc-490c-87aa-e0d5654c64fc
milkru/vulkanizer
src/geometry.cpp
#include "core/device.h" #include "core/buffer.h" #include "shaders/shader_constants.h" #include "geometry.h" #include <fast_obj.h> #include <meshoptimizer.h> struct RawVertex { f32 position[3]; f32 normal[3]; f32 texCoord[2]; }; // TODO-MILKRU: Implement a more conservative way of calculating bounding sphere? s...
TOOL
0.974415
3.463329
{ "github_metadata": { "branch": "main", "commit_count": 65, "repo_created_at": "2022-03-31T17:25:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 613, "forks": 27, "issues": 2, "pull_requests": 1 }, "file_meta": { "content_id": "9dd82b50...
53c11c85-0b15-4188-b3b3-6a5354b281f3
65Thu/d
treesearch.cpp
#include <stdio.h> #include <stdlib.h> // Define the structure for a node in the binary search tree (BST) struct Node { int data; struct Node* left; struct Node* right; }; // Function to create a new node with a given data value struct Node* createNode(int data) { struct Node* newNode = (struct Node*)...
ALGO
0.999996
5.919037
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-11-29T21:43: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": "d725780d2f8a...
acf6b9cb-a7a4-4169-b11d-8278eebf9a82
Drink7/LeetCode
0547-number-of-provinces/0547-number-of-provinces.cpp
class Solution { public: int findCircleNum(vector<vector<int>>& isConnected) { // union find // TC: O(m * n), m nodes with n edges // SC: O(m) int m = isConnected.size(); int n = isConnected[0].size(); int result = m; parent.resize(m, 0); rank.resize(m...
ALGO
0.999961
6.485423
{ "github_metadata": { "branch": "main", "commit_count": 1227, "repo_created_at": "2023-07-09T07: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": "9e04c303a...
babdb21e-4492-440e-a88e-f85eae3172e1
yamatonao/comp_prog
ABC_divera2019/c.cpp
#include <stdio.h> #include <iostream> #include <string> #include <vector> using namespace std; std::vector<int> find_all(const std::string str, const std::string subStr) { std::vector<int> result; int subStrSize = subStr.size(); int pos = str.find(subStr); while (pos != std::string::npos) { result....
ALGO
0.999899
3.641791
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2020-04-29T11:34:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "87278feda...
beccb936-3e6d-49ed-9f14-5e82e24642c8
nits2010/DataStructureAlgo
src/main/java/DataStructureAlgo/cpp/Kadans Algorithm.cpp
// for 1D and 2D array //Finding Maximum Sum in Array'MinStepsInfiniteGrid #include <iostream> #include <cstdlib> using namespace std ; class Kadans_Algorithms { int *One_D ; int size ; int **Two_D ; public: Kadans_Algorithms ( ) { One...
ALGO
0.999847
4.200086
{ "github_metadata": { "branch": "master", "commit_count": 1120, "repo_created_at": "2018-12-10T05:27:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 15, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "64c2cc...
0f95ca12-96b4-4bc0-a7e7-0e359d1c13ee
zhang-xun/cqu_map
mainwindow.cpp
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); //for floyd 算法 // MGraph m; // m.Init(); // m.Floyd(); // m.PrintShortestDistance(); //for dijkstra 算法 //vector<int> s ...
ALGO
0.964601
3.512397
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-12-08T03:27: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": "7f914c47c1...
dcec3e37-5b7a-4742-b644-067b3da1d5c9
Riwaaaaj/programs_4th_sem
DSA/lab_4 SLL/1_singly_linked_list.cpp
#include <iostream> #include <cstdlib> using namespace std; class Node { public: int data; Node* next; }; class LinkedList { Node *head; public: LinkedList() : head(nullptr){} void insertionBeginning(int item) { Node *newNode = new Node; newNode->data = item; newNode->next = head; head = new...
ALGO
0.999459
4.218894
{ "github_metadata": { "branch": "main", "commit_count": 49, "repo_created_at": "2024-11-14T11:45:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "af39c056673...
ca65012f-e802-4041-b649-a30404d7020f
ira-renzo/referenCe
content/functions.cpp
#include <stdio.h> int add(int x, int y) { int tempAns = x + y; return tempAns; } int subtract(int x, int y) { int tempAns = x - y; return tempAns; } int multiply(int x, int y) { int tempAns = x * y; return tempAns; } int divide(int x, int y) { int tempAns = x / y; return tempAns; } void printMenu() { pri...
TOOL
0.926156
3.524392
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-06-09T10:52: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": "776cf53f2a58...
bb96c0d5-5d8b-4fe1-a7d1-937e9829f138
AnshRiteshSavadatti/-DSA-with-cpp
DynamicProgramming/KnapsnakVariations/subset-sumproblem/MemoizedSolution.cpp
// https://www.geeksforgeeks.org/problems/subset-sum-problem-1611555638/1 // ACCEPTED #include<bits/stdc++.h> using namespace std; class Solution { private: bool solve(vector<int>& arr, int sum, int temp, int index, int n, vector<vector<int>>& t) { if (sum == temp) return true; if (index == n ...
ALGO
0.999994
5.604893
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2023-08-12T13:10: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": "2e742c3c3...
f9fee923-6646-4744-a816-4703d7960103
GzuPark/CarND-Kidnapped-Vehicle-Project
src/particle_filter.cpp
/* * particle_filter.cpp * * Created on: Dec 12, 2016 * Author: <NAME> */ #include <random> #include <algorithm> #include <iostream> #include <numeric> #include <math.h> #include <iostream> #include <sstream> #include <string> #include <iterator> #include "particle_filter.h" using namespace std; default_...
ALGO
0.978658
5.960922
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-01-06T17:57: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": "a27ae10746...
8a95ca4c-cb5d-4235-a340-3f7a08026135
Dexterzhao/C-IntroExp
Exp_1/main.cpp
#include <stdio.h> #include <malloc.h> #include <stdlib.h> struct STACK { int *elems;//申请内存用于存放栈的元素 int max; //栈能存放的最大元素个数 int pos; //栈实际已有元素个数,栈空时pos=0; }; void initSTACK( STACK *const p, int m)//初始化p指向的栈:最多m个元素 { p->elems=(int *)malloc(m*sizeof(int)); if(!p->elems) return; p->pos=0; p...
ALGO
0.997054
3.818405
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-02-27T09:32: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": "eff6c77e53...
b1a13ed6-d665-4f56-8b8a-4bff2e38b6d6
OctavioAquilino/TrabajoProgramacion_Aquilino-Rojo-Vietto
main.cpp
#ifndef U05_ARBOL_ARBOL_ARBOLBINARIO_H_ #include <vector> #include <iostream> #include <fstream> #include <sstream> #include <string.h> #include "ArbolBinarioAVL.h" //Libreria utilizada en casos_cui #include "ArbolBinarioAVLEdad.h" //libreria utilizada en casos_edad #include <ctime> #define U05_ARBOL_ARBOL_ARBOLBIN...
ALGO
0.99593
3.035388
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2021-10-25T14:43:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8fbbbcc0628...
381847fa-24a7-41a0-97cc-73243261ee69
alherit/kd-switch-cpp
kds/kds.hpp
#ifndef __KDS_HPP__ #define __KDS_HPP__ /****************************** Author: <NAME> Date: 2019 ******************************/ using namespace std; #include <cstddef> #include <cstdlib> #include <random> #include <vector> #include <list> #include <iostream> #include <sstream> #include <fstream> #include "L...
ALGO
0.998743
4.359639
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2019-12-04T15:29: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": "d126053f9...
18163140-8eb6-4747-beff-80172442481d
kolekikuta/TicTacToe
tictactoe.cpp
#include <iostream> #include <vector> #include <string> using namespace std; //create hashtable to store indeces and values, search and insert in O(n) //search, insert functions //score, play again, cpu vector<string> gameboard{" 1 | 2 | 3 ", "---|---|---", " 4...
ALGO
0.99292
4.894883
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-09-06T22:51: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": "5ba1aca662d5...
9f86f2e4-dcc8-4936-afed-da226d41dcea
ChromiumWebApps/chromium
cc/resources/picture_pile.cc
// Copyright 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "cc/resources/picture_pile.h" #include <algorithm> #include <limits> #include <vector> #include "cc/base/region.h" #include "cc/debug/rendering...
ALGO
0.902201
7.456167
{ "github_metadata": { "branch": "master", "commit_count": 260366, "repo_created_at": "2014-02-21T14:19:48.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 231, "forks": 307, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "04...
7994bbf8-3e8e-4481-bc0e-c13c714a90ef
peter0749/OnlineJudge
LeetCode/LeetCode 5. Longest Palindromic Substring (hash).cpp
#include <bits/stdc++.h> using namespace std; #define PB push_back #define F first #define S second typedef long long int UT; typedef pair< UT, UT > PII; const PII p(29,31), q(10000103, 10000121); const int MAXN(1010); PII h[MAXN], rh[MAXN], cache[MAXN]; class Solution { public: string longestPalindrome(s...
ALGO
0.999985
4.471754
{ "github_metadata": { "branch": "master", "commit_count": 238, "repo_created_at": "2017-02-06T05:05: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": "a028f321...
6f11eb3a-f9cb-45ad-8b18-838f9fef1e38
aranjan1002/code4life
Progs/CA/MIPSim.cpp
#include <iostream> #include <fstream> #include <string> #include <cstring> #include <map> #include <vector> #include <cmath> #include <cstdlib> #include "Pipeline.h" #define CAT1INSTCNT 9 #define CAT2INSTCNT 8 #define CAT3INSTCNT 5 using namespace std; int instructioncount; string getsubstring(string temp, int x, ...
TOOL
0.925709
3.361411
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2015-08-07T21:36:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "153e6f68f...
ac798ac3-25cb-4426-9175-d85f8f975099
ajchili/coursework
cs_230/Assignment 4/Assignment 4/BoundSortedType.h
#ifndef BoundSortedType_h #define BoundSortedType_h #include <iostream> #include <string> using namespace std; struct RandomItem { string name; int size; public: RandomItem(string name, int size) { this->name = name; this->size = size; }; bool isEqual(RandomItem item) { ...
TOOL
0.912351
4.480681
{ "github_metadata": { "branch": "master", "commit_count": 292, "repo_created_at": "2017-04-05T15:09:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d2ae6cad...
b2f31837-9a93-4f66-94ae-d45c506cf8b9
qq734628996/ac-code
UVA/11346/16101918_AC_0ms_0kB.cpp
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i = 0; i < n; i++) #define PER(i,n) for(int i = n-1; i >= 0; i--) #define FOR(i,l,r) for(int i = l; i <= r; i++) #define ROF(i,l,r) for(int i = r; i >= l; i--) #define TR(e,x) for(auto e = x.begin(); e != x.end(); e++) #define DEBUG(x) cout << #x <...
ALGO
0.994228
3.7916
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-05-23T08:33: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": "4c514f1bd1...
4eee3a08-b6f4-4043-b791-33028291153c
sswetha08/RoboCon-2018-Phase-1
TestCodes/Motors/ThreeWheelMotorBase/ThreeWheelMotorBase.ino
class ThreeWheelBotMotors { /* Important functions : * * attachPWM_DIRPins(PWMs[], DIRs[]) * * moveAtWithAngle(int PWM, int ANGLE_DEGREES) * * increasePWMs(value (s)) * * attachDebuggerSerial(&Serial) * * enableDebugger() * * disableDebugger() */ int MOTOR_MAG[3]; in...
TOOL
0.909218
6.116253
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2018-02-20T19:26: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": "be5a0ed77...
3b8d0722-09b3-46e7-a6d0-95b593e18918
hixo356/vrptw-solver
vrptw/main.cpp
#include <algorithm> #include <cfloat> #include <iostream> #include <fstream> #include <format> #include <vector> #include "include/instance.h" #include "include/genetic_algorithm.h" void saveGAResultsToCSV(const ga_results_t& results, const std::string& filename) { std::ofstream file(filename); if (!file.is_...
ALGO
0.99051
6.279614
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2025-05-15T20:27: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": "4ff1223ba678...
3147fd41-e1b9-466e-8167-29585876cd1c
luchenqun/leet-code
problems/050-powx-n.cpp
/* * [50] Pow(x, n) * * https://leetcode-cn.com/problems/powx-n/description/ * https://leetcode.com/problems/powx-n/discuss/ * * algorithms * Medium (24.67%) * Total Accepted: 1.2K * Total Submissions: 4.9K * Testcase Example: '2.00000\n10' * * 实现 pow(x, n) ,即计算 x 的 n 次幂函数。 * 示例 1: * 输入: 2.00000, 10 ...
ALGO
0.999873
5.730083
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2017-09-01T16:07:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fc48de2c1...
1ee523cd-9030-4882-9a24-42031b28f6a8
HarryCha777/USACO-Solutions
2 - Silver/rblock.cpp
#include <iostream> #include <fstream> #include <algorithm> #include <vector> #include <queue> using namespace std; #define INF 1000000000 typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; int V; vector<vii> adjList; int bfs() { int s = 0; vi dist(V, INF); dist[s] = 0; queue<int> q; q.pus...
ALGO
0.999902
4.023656
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-03-26T19:39: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": "68754c54c9eb...
27dabaa4-aa43-4622-8f5a-756509885ef9
yunzae/zogorithm
TimeBomb/timebomb/timebomb/main.cpp
#include "timebomb.h" #include <iostream> #include <list> int main() { int result; int N; int a; int b; int a_index; int b_index; int max; int second= -1; int second_index=0; box_ready(); N = box_size(); std::list<int> q; std::list<int> q_index; std::list<int> l...
ALGO
0.999974
3.547305
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2022-03-03T18:12: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": "94e38afbe6e...
8cc2028c-adb4-4f9b-9e0d-20685f46a827
maguilo11/locus
src/DOTk_Gradient/DOTk_ParallelForwardDiffGrad.cpp
/* * DOTk_ParallelForwardDiffGrad.cpp * * Created on: Feb 3, 2015 * Author: <NAME> */ #include "vector.hpp" #include "DOTk_OptimizationDataMng.hpp" #include "DOTk_ParallelForwardDiffGrad.hpp" #include "DOTk_AssemblyManager.hpp" namespace dotk { DOTk_ParallelForwardDiffGrad::DOTk_ParallelForwardDiffGrad(co...
ALGO
0.953143
6.18755
{ "github_metadata": { "branch": "master", "commit_count": 160, "repo_created_at": "2016-10-31T20:31:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a4ca51b...
524fcba1-8061-4f4a-bb3d-70dfbf0df99a
phitronio/XPSC_Batch_04
Starters_132/Optimal Flip.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while (t--) { int n; cin >> n; vector<int> a(n); for (int i = 0;i < n;i++) { cin >> a[i]; } long long ans = ((1LL * n...
ALGO
0.999974
4.81004
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2024-03-15T11:34:23.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3cae1993c7c...
e0db9851-0ceb-4154-9acc-b7be84bb75d8
BiaoMaUS/DecimalConvertedToBinary-Octal-Hexadecimal_usingC_plusPlus
main.cpp
#include <iostream> #include <sstream> #include <iostream> #include<cstring> #include<cstdlib> #include<cmath> using namespace std; int main(int argc, char** argv) { int u, n; long double m,f; cout<<"enter a value:"<<endl; cin>>m; cout<<"choose a base,Hexadecimal is 16, o is 8, B is 2"<<endl; cin>>u; n= int(m); if ...
ALGO
0.999923
3.267171
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-12-31T03:49: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": "d4531ebd16...
192bc1c1-15d8-428e-8f36-f4cce8280412
blender/blender
source/blender/editors/armature/meshlaplacian.cc
/* SPDX-FileCopyrightText: 2023 Blender Authors * * SPDX-License-Identifier: GPL-2.0-or-later */ /** \file * \ingroup edarmature * Algorithms using the mesh laplacian. */ #include "MEM_guardedalloc.h" #include "DNA_mesh_types.h" #include "DNA_object_types.h" #include "BLI_map.hh" #include "BLI_math_geom.h" #in...
ALGO
0.999822
5.439068
{ "github_metadata": { "branch": "main", "commit_count": 152123, "repo_created_at": "2019-10-09T12:47:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 15670, "forks": 2395, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f...
5be97f60-a288-49f9-a110-fb5f387c6078
markopos/kuka-lwr-ros
src/passive-ds-control/src/passive_ds_controller.cpp
#include "passive_ds_controller.h" #include <iostream> void orthonormalize(Mat & basis){ assert(basis.rows() == basis.cols()); uint dim = basis.rows(); basis.col(0).normalize(); for(uint i=1;i<dim;i++){ for(uint j=0;j<i;j++) basis.col(i) -= basis.col(j).dot(basis.col(i))*basis.co...
ALGO
0.99283
4.338982
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2018-11-29T09:56:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "843e2198c...
72ef98a3-6159-4b19-840d-7e702e40ff1a
pumfit/PracticeForCodingTest
CodingTestExProject/CodingTestExProject/백준/3048.cpp
/* 3048 개미 insert 어떻게 썼더라..? 했던 문제 insert(idx,char) 형식으로 썼다가 찾아보고 고쳤다. 직접 써가면서 풀어보았는데 B를 고정적으로 두고 A만 움직이는 방식으로 인덱스를 적어가며 풀었다. A의 첫 글자는 T만큼 움직인다. 그 이후로는 1씩 적어지면서 움직이고 해당값이 인덱스 범위를 넘어가지 않도록 처리해준다. + 생각보다 짧게 풀었다했는데 숏코딩 10위권 내라서 신기했던 문제 짧은게 모두 좋은 풀이인 것은 아니지만 생각했던 다른풀이보다 빠르게 풀었을 것은 확실한 문제 */ #include <iostream> using names...
ALGO
0.999846
3.648545
{ "github_metadata": { "branch": "master", "commit_count": 450, "repo_created_at": "2021-06-30T02:44: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": "9a36d3a4...
972a8314-eb60-4116-a8f1-63d4a785416e
Felipefams/competitiveProgramming
cses_pset/staticRangeSumQueries.cpp
// https://cses.fi/problemset/result/4474377/ #include <bits/stdc++.h> using namespace std; //vrum vrum #define fast_io ios_base::sync_with_stdio(0); cin.tie(0); //types typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef pair<int,int> pii; //constants #define endl "\n" #define PI 3.1415926535...
ALGO
0.999884
3.96009
{ "github_metadata": { "branch": "main", "commit_count": 313, "repo_created_at": "2022-05-06T14:35:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "770a01b339...
d6ad4258-0a34-4496-b081-4b7b1580b582
rakati/competitive-programming
CSES/graph/labyrinth.cpp
/* **************************************************** */ /* Author : rakati */ /* **************************************************** */ #include <bits/stdc++.h> using namespace std; #define RP(i,a,b) for(int i = (a); i < (int)(b); i++) #define RV(i,a,b) for(int i = (a); i > (...
ALGO
0.999994
3.77689
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2019-06-17T23:57: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": "39d599583a...
11fc08c7-6c98-4f9f-bd39-e7cad25776de
matejzavrsnik/recreational
aoc24/day7.h
#pragma once #include "everything_bagel.h" namespace aoc24::d7 { template<typename It> int solve_ce(ll final_result, ll partial_result, It begin, It end) { if (final_result<partial_result) return 0; // not a way int ways = 0; auto next = *begin; if (begin+1 == end) { // last case if (partial_resu...
ALGO
0.989339
4.425022
{ "github_metadata": { "branch": "main", "commit_count": 92, "repo_created_at": "2022-12-01T08:31: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": "50233422743...
017f2845-a3f8-4603-8b1e-381c3a2efc8e
pohldaniel/Widelands
libwidelands/src/logic/mapfringeregion.h
/* * Copyright (C) 2007-2022 by the Widelands Development Team * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. ...
ALGO
0.932347
7.597123
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2023-01-05T14:51: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": "e3d40a6de...
82a0d445-6e50-4771-8f6f-96baa2619056
soartech/soar
SoarSuite/Core/SoarKernel/src/explain.cpp
#include <portability.h> /************************************************************************* * PLEASE SEE THE FILE "license.txt" (INCLUDED WITH THIS SOFTWARE PACKAGE) * FOR LICENSE AND COPYRIGHT INFORMATION. *************************************************************************/ /***********************...
ALGO
0.978743
3.623218
{ "github_metadata": { "branch": "master", "commit_count": 6345, "repo_created_at": "2013-04-02T03:50:42.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 11, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ac164ee...
07433377-3317-4eff-ac33-3e146d33cd34
serzaxlucifer/Leetcode
arrays/advanced/229. Majority Element II.cpp
vector<int> majorityElement(vector<int>& nums) { int candidate1 = -1; int count1 = 0; // you can allot any random value to candidate1 and 2 int candidate2 = -1; int count2 = 0; int size = nums.size(); for(int i = 0; i < size; i++) // Voting Phase {...
ALGO
0.999986
5.422504
{ "github_metadata": { "branch": "main", "commit_count": 379, "repo_created_at": "2023-01-09T20:01:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f984e246d3...
54dbe82c-9694-42f3-bb68-74a023e6bee3
ningfei/u3d
RTL/Component/CLODAuthor/Primitives.cpp
//*************************************************************************** // // Copyright (c) 1999 - 2006 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // ...
ALGO
0.996163
5.165491
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2015-11-18T12:07:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 49, "forks": 15, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "3617dc9...
921c1f13-b395-479f-b8c8-7ad69eb443bb
mariaaktermukti/Leetcode
binary_search_tree_iteration.cpp
#include <iostream> #include <stack> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; class BSTIterator { private: stack<TreeNode*> st; void pushLeft(TreeNode* node) { while (node) { ...
ALGO
0.999977
6.021857
{ "github_metadata": { "branch": "main", "commit_count": 147, "repo_created_at": "2025-02-24T17:00: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": "7c27ad4611...
eb08461c-bdb4-40e2-90f7-b75f8d62de65
simsong/be20_api
word_and_context_list.h
#ifndef WORD_AND_CONTEXT_LIST_H #define WORD_AND_CONTEXT_LIST_H /** * \addtogroup internal_interfaces * @{ * \file * word_and_context_list: * * A re-implementation of the basic stop list, regular expression * stop_list, and context-sensitive stop list. * * Method: * Each entry in the stop list can be represe...
TOOL
0.941443
7.061671
{ "github_metadata": { "branch": "main", "commit_count": 922, "repo_created_at": "2012-11-30T13:16:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 9, "issues": 6, "pull_requests": 0 }, "file_meta": { "content_id": "ca57c437c...
9b8f6fd3-c45c-410b-b1a4-a7ed14ae5675
noko206/AtCoder
e869120-selection/27.cpp
// clang-format off #include <bits/stdc++.h> using namespace std; #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; #endif #define _overload3(_1,_2,_3,name,...) name #define _REP(i,n) REPI(i,0,n) #define REPI(i,a,b) for(int i=int(a);i<int(b);++i) #define REP(...) _overload3(__VA_ARGS__,R...
ALGO
0.999977
4.471063
{ "github_metadata": { "branch": "main", "commit_count": 244, "repo_created_at": "2023-05-21T12:02: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": "e796ca8843...
77f85314-2584-4cf5-97e8-63f703675114
mingcent/MyFirstProject
_23_EntryNodeInListLoop/_23_EntryNodeInListLoop.cpp
// _23_EntryNodeInListLoop.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <cstdio> #include "../Utilities/list.h" ListNode* MeetingNode(ListNode* pHead) { if (pHead == nullptr) { return nullptr; } ListNode* pFirst = pHead; ListNode* pSecond = pHead; int count = 0; while (pFirst->m_pNext!= nullptr) { ...
ALGO
0.991969
6.023837
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2019-03-21T06:26: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": "89a79d34c...
9b36cba6-81f8-4ef9-84d3-bf712ea588de
chetangadhiya5062/Cracking-The-Coding-Interview-Que
Code/Q10_3_1_searchInRotatedMatrix.cpp
#include <iostream> #include <vector> #include <algorithm>// for swap using namespace std; void printArray(int arr[][5], int row, int col){ for (int i = 0 ; i < row ; i++){ for (int j = 0; j < col ; j++){ cout << arr[i][j] << " "; } cout << endl; } } void transpose(int arr[...
ALGO
0.999887
5.353564
{ "github_metadata": { "branch": "main", "commit_count": 37, "repo_created_at": "2025-05-23T13:20: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": "3aad5948d24...
68a3b798-df56-4ab9-92fe-479cfab5e0b4
shahriar77aust/Uva-Solves
10070(Leap Year or Not).cpp
#include <bits/stdc++.h> #include <string.h> using namespace std; int main () { long flag, m4, m100, m400, m15, m55, i, l, leap; char a[1000000]; int print = 0; while (cin >> a){ if ( print != 0 ){ printf("\n"); } print = 1; leap = flag = m4 = m100 = m400 = m...
ALGO
0.999454
3.301052
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-10-28T08:35: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": "73aaa5bb4f...
7052db53-aa54-4a3f-8838-be8f24a571d6
Kooreis/ProblemBloomFilterFastSetMembershipChecking
solution.cpp
```cpp #include <bitset> #include <vector> #include <functional> #include <iostream> class BloomFilter { size_t filter_len; std::bitset<32> bitset; public: BloomFilter(size_t f_len) : filter_len(f_len) {} void hash1(char* str1) { for (int i = 0; i < strlen(str1); i++) { int code =...
ALGO
0.997808
6.393358
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-04-26T20:55: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": "6caae689f068...
25f5af57-180b-4e2b-bc4f-284295ea4477
ishandutta2007/codeforces-e
eddy1021/normal/793/C.cpp
// eddy1021 #pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef double D; typedef long double LD; typedef long long LL; //typedef pair<int,int> PII; typedef pair<LL,LL> PLL; #define mod9 1000000009LL #define mod7 1000000007LL #define INF 1023456789LL #define INF16 10000000000000000LL #defi...
ALGO
0.999652
3.925416
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:34: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": "e6ea3656939f...
a67b9413-50a6-4088-a5e4-1b7827021511
VivianZ123/hw5
wordle.cpp
#ifndef RECCHECK // For debugging #include <iostream> // For std::remove #include <algorithm> #include <map> #include <set> #include <functional> #endif #include "wordle.h" #include "dict-eng.h" using namespace std; set<string> generatePermutations(string in, const string& floating, size_t pos); set<string> wordle(...
ALGO
0.918582
5.147151
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-16T08:31: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": "6b0a76a22943...
5d8bb8b9-de76-4562-a78f-710c8f50ff81
elzaguillot/inference_selection
src/rmain.cpp
// Moran.cpp // adapt Eyre-Walker DFE to use moran matrix instead // hopefully go faster // by eguillot //#include</home/eguillot/softwarre/CBLAS/include/cblas.h> // *** NOTES *** // banded matrix of ublas perfect for moran //#include <boost/numeric/ublas/matrix.hpp> //#include <boost/numeric/ublas/io.hpp> //bande...
ALGO
0.999308
5.978714
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-01-24T09:52: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": "58dc8b3603...
94001e5f-0bf8-4a2f-82b5-56f4fa574dbe
crosscap/cpp-learning
essential/ch06/t6-2.h
#include <iostream> using namespace std; template <typename elemType> class Matrix { friend Matrix operator+(const Matrix<elemType> &, const Matrix<elemType> &); friend Matrix operator*(const Matrix<elemType> &, const Matrix<elemType> &); public: Matrix(int, int); Matrix(const elemType *array, int row,...
ALGO
0.946804
4.831829
{ "github_metadata": { "branch": "master", "commit_count": 159, "repo_created_at": "2023-10-10T15:21:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e3fe6580...
01cf3cf7-eb76-4725-b674-65ce35e41322
sanket9673/CP
LC_2390/main.cpp
#include <iostream> #include <stack> #include <algorithm> using namespace std ; class Solution { public: string removeStars(string s) { // stack<char> x ; // string res = "" ; // for (int i = 0; i < s.length(); i++) { // if (x.empty() && s[i] != '*') { // x.push(...
ALGO
0.999953
5.062613
{ "github_metadata": { "branch": "main", "commit_count": 1065, "repo_created_at": "2024-06-26T10:21: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": "07759d0d8...
a7587cb2-f77b-4380-9c84-79dd068c570b
Kamru-l-islam/Algorithm-Design-Analysis
DFS_using_Lnked_list.cpp
#include<bits/stdc++.h> using namespace std; string color[10000] = "white"; int Time = 0; int d[10000],f[10000]; class Node { public: int target; int weight; Node *next; }; class datatyp { public: Node *head = NULL; }; void addEdge(datatyp arr[],int src,int dest) { Node *...
ALGO
0.999915
3.748801
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2019-12-07T09:21: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": "6035c0ac94...
21ebf52f-b35f-479b-b4f5-0de2387a1d53
moonjinhwan/Algorithm-Code-Up
back_Joon/simulation/3568 iSharp (문자열 장난).cpp
#include<iostream> #include<vector> using namespace std; string type; vector<pair<string, string>> v; void init() { cin >> type; bool turnOff = true; while (turnOff) { string name="", cmd=""; string temp; cin >> temp; for (int i = 0; i < temp.size(); i++) { if ((temp[i] >= 'a' && temp[i] <= 'z') || (t...
TOOL
0.981671
3.165504
{ "github_metadata": { "branch": "master", "commit_count": 169, "repo_created_at": "2020-04-14T07:50: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": "f2d88f8a...
1be9020c-f128-443b-9187-9b2a3c9688a3
emilyju0314/gpt_code_plagiarism
dataset/code_content_classifier/allpro_train/1_5663_92.cpp
#include <bits/stdc++.h> using namespace std; int vis[305]; int main() { int n, k, m; while (~scanf("%d%d%d", &n, &m, &k)) { int i, t, j; memset(vis, 0, sizeof(vis)); for (i = 0; i < k; i++) { scanf("%d", &t); vis[t] = 1; } int Max = n - k + (n - 1) * (n - 2) / 2; if (k == n || m...
ALGO
0.999981
3.111218
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2024-04-28T03:59:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5880e520e2f...
ad155c95-1b0e-4d36-b084-5cd17b7ad2a7
ChrisMaxheart/Competitive-Programming
Kattis/flowerytrails.cpp
#include <bits/stdc++.h> using namespace std; // to minimize // defines const double PI = acos(-1); #define INF 1E9 #define endl '\n' #define Tloop int T; cin >> T; for(int count_ = 1; count_ < T+1; count_++) #define Nloop int N; cin >> N; for(int count__ = 0; count__ < N; ...
ALGO
0.999968
5.015026
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2019-04-04T17: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": "794f96909...
73b6fd33-5bb5-456e-841d-08d8ddbedbd8
SurajPadalkar17/CSES_problem-Solution
Sum_of_two_values.cpp
#include <bits/stdc++.h> using namespace std; vector<int> sumofvalues(vector<pair<int, int>> &nums, int target) { int left = 0, right = nums.size() - 1; while (left < right) { int sum = nums[left].first + nums[right].first; if (sum == target) { return {nums[left].secon...
ALGO
0.999993
5.366663
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-01-31T16:04: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": "b0e23950b9d3...
d4d17c6c-ea98-463b-a6ea-6642f2f01bee
sparky4287/workspace
Calculator/Calculator.cpp
#include <iostream> #include <string> #include <istream> #include <iomanip> #include <math.h> using namespace std; /* Initial User Calculation Input (returns full string of input) */ string inputString(){ string phrase; cout << "Please enter a string for calculation. Include two numbers and a mathematical operator: ...
TOOL
0.977484
4.470913
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2014-12-13T17:11:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "1c82fe2eb...
04414fd9-a83a-4dd3-b7bd-534f45e5c871
resibots/chatzilygeroudis_2018_rte
rte_hexa/hexapod_simu/hexapod_dart/include/hexapod_dart/hexapod_dart_simu.hpp
#ifndef HEXAPOD_DART_SIMU_HPP #define HEXAPOD_DART_SIMU_HPP #include <boost/parameter.hpp> #include <boost/fusion/include/vector.hpp> #include <boost/fusion/include/accumulate.hpp> #include <boost/fusion/include/for_each.hpp> #include <boost/fusion/include/find.hpp> #include <dart/dart.hpp> #include <dart/collision/d...
TOOL
0.955563
6.09119
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2017-12-06T13:57:37.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 10, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f088821ffc...
9d6b6e92-31ae-40c8-ab9b-e0b40e59337d
liuyubobobo/Play-Leetcode
2501-3000/2524-Maximum-Frequency-Score-of-a-Subarray/cpp-2524/main.cpp
/// Source : https://leetcode.com/problems/maximum-frequency-score-of-a-subarray/description/ /// Author : liuyubobobo /// Time : 2022-01-06 #include <iostream> #include <vector> using namespace std; /// Sliding Window /// Time Complexity: O(maxv + nlog(maxv)) /// Space Compelxity: O(maxv) class Solution { priva...
ALGO
0.999951
6.354962
{ "github_metadata": { "branch": "master", "commit_count": 2592, "repo_created_at": "2016-12-01T17:08:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2732, "forks": 718, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "04...
f79cac2b-6caf-4c57-bf6f-e22d67bc8afe
krishna0303/Competetive-Programming-Codes
lbcs/stack/maximum_area_of_histogram_rectangle.cpp
#include <bits/stdc++.h> using namespace std; /* Given an array of integers A . A represents a histogram i.e A[i] denotes height of the ith histogram's bar. Width of each bar is 1. Find the area of the largest rectangle formed by the histogram. Problem Constraints 1 <= |A| <= 100000 1 <= A[i] <= 1000000000 for...
ALGO
0.999726
5.89876
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2020-03-22T20: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": "5d1c72547...
4dd3b86f-edb9-4308-92eb-9da072b8b276
Mabami98/max-flow-algorithm-cpp
reducetoflow.cpp
/** * Example input/output handler for the max flow lab in the ADK course. * * Converts a bipartite graph into a flow network, * sends it to a max flow solver, and interprets the result * as a maximum bipartite matching. * * Author: <NAME> (minor edits/comments added) */ #include <bits/stdc++.h> #include <iost...
ALGO
0.999823
4.774054
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-06-18T09:25: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": "9d5de382406a...
6de9769b-5063-4cfb-afb5-f1f76d13e63e
ChrisChV/UNSA-CS
Semestre4.2/TC/YuberEJe/Ejercicio1/main.cpp
#include <iostream> #include "cctype" #include "fstream" using namespace std; bool isSimbol(string::iterator &iter){ if(*iter == '+' or *iter == '-' or *iter == '*' or *iter == '/')return true; return false; } bool isSimbol(const char iter){ if(iter == '+' or iter == '-' or iter == '*' or iter == '/')ret...
ALGO
0.998651
3.424352
{ "github_metadata": { "branch": "master", "commit_count": 127, "repo_created_at": "2016-04-08T22:33:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 5, "issues": 0, "pull_requests": 27 }, "file_meta": { "content_id": "ed5d04...
1d4e5a3a-8751-4090-a063-7be696aba9dd
0x00ahmad/algoexpert
dsa/medium/13. Min Height BST/min_height_bst.cpp
#include <vector> class BST { public: int value; BST *left; BST *right; BST(int value) { this->value = value; left = nullptr; right = nullptr; } void insert(int value) { if (value < this->value) { if (left == nullptr) { left = new BST(value); } else { left->ins...
ALGO
0.999889
5.501483
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2022-04-05T15:50: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": "736b4dd59fb...
346a3ee0-5312-4a94-b152-22f9b0dcc522
jaimemin/programmers
위클리 챌린지/입실 퇴실.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #include <set> using namespace std; vector<int> solution(vector<int> enter, vector<int> leave) { vector<int> answer(enter.size()); int enterIdx = 0; int leaveIdx = 0; set<int> meetingRoom; map<pair<int, int>, bool> visit...
ALGO
0.999965
4.917992
{ "github_metadata": { "branch": "main", "commit_count": 506, "repo_created_at": "2021-09-03T13:45:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b6906b5aab...
93ef6c4f-9706-45f0-8184-f6c50131f0dd
37keke/ACM-ICPC
图论/生成树/最小生成树/kruskal算法.cpp
#include<bits/stdc++.h> using namespace std ; int inf = 0x3f ; const int maxn = 1e5 +10 ; int pre[maxn] ; struct node{ int a , b, c ; }st[maxn]; int find(int x) { int r=x; while(pre[r]!=r) r=pre[r];//找到他的前导结点 int i=x,j; while(i!=r)//路径压缩算法 { j=pre[i];//记录x的前导结点 pre[i]=r;//将i的前导结...
ALGO
0.999994
4.228998
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-04-05T03:43: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": "172db08908...
fb886bf0-5b8c-4c82-a651-6833974ce85e
AGuarita/RepoEjerciciosClase
ejercicioComp.cpp
#include <iostream> #include <cmath> using namespace std; int main(){ double n1, plus, minus, product, power; double division; cout<<"Type an INTEGER, PLEASE"<< endl; // to clarify xd cin>>n1; plus=n1+10; minus=n1-5; product=n1*2; division=n1/4.0; power= pow(n1,1500); cout<< "If you add 10 to the number t...
ALGO
0.942815
3.093727
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-05-15T16:39: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": "9c522d078b7f...
d3d54d7b-0fc3-4277-a638-eb57cdad7b00
saikrishna17394/Code
team_contests/nwerc2012/NWERC_2012_ProblemSet_TestCases_Solutions/J/Joint-Venture-2.cc
////////////////////// // Joint-Venture.cc // ////////////////////// // @EXPECTED_RESULTS@: CORRECT #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { ios::sync_with_stdio(false); for (unsigned x, n; cin >> x >> n; ) { x *= 10000000; // cm to nm ...
ALGO
0.999785
3.419744
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2014-09-25T23:16: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": "115db59ca9...
2839f217-73f3-40b0-a515-0174aa47ba97
1092772959/My-ACM-code
专题/莫队/E-离线树状数组.cpp
#include<iostream> #include<stdio.h> #include<algorithm> #include<cstring> #include<cmath> #include<map> #include<vector> using namespace std; const int maxn=1e5+5; typedef long long LL; int N,M; int a[maxn]; int ans[maxn]; struct Query{ int L,R,id; bool operator < (const Query &q) const {return R<q.R;} }Q[maxn...
ALGO
0.999969
3.676763
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-10-04T14:43: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": "ce97134a63...
03acf9c3-74db-4c2a-a1a2-5b0afe9432c7
Jaycelation/CPP-PTIT
Structural application/CPP0512.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; struct PhanSo { ll tu; ll mau; }; PhanSo tong(PhanSo p, PhanSo q) { PhanSo ans; ans.tu = p.tu*q.mau + p.mau*q.tu; ans.mau = p.mau*q.mau; return ans; } PhanSo rutgon(PhanSo& a) { PhanSo ans; ll x = __gcd(a.tu, a.mau); ans.tu = a.tu /= x; ...
ALGO
0.999825
5.625606
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2023-11-16T14:44: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": "e9feff6858...
7bd2def3-eccd-4414-9244-1fb3b5704b4c
Deepsavani/Post-Quantum-Crypto---NTRU
Reference_Implementation/crypto_kem/ntru-hps2048509/ntru09/Keypair/syn/systemc/crypto_sort.h
// ============================================================== // RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2018.3 // Copyright (C) 1986-2018 Xilinx, Inc. All Rights Reserved. // // =========================================================== #ifndef _crypto_sort_HH_...
ALGO
0.994969
5.099417
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-03-16T15:58:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "56d8322771...
80be983e-aaea-412d-b2ef-609ccb14c65f
ishandutta2007/codeforces-s
sirrembocodina/normal/497/A.cpp
#include <algorithm> #include <cstdio> #include <iostream> #include <cstring> #include <cmath> #include <vector> #include <string> #include <map> #include <deque> #include <queue> #include <stack> #include <cassert> using namespace std; #define forn(i,n) for (int i = 0; i < int(n); ++i) #define ford(i,n) for (int i =...
ALGO
0.999962
3.319965
{ "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": "0867c78e863d...
3711fb7b-b229-45dd-8aec-d21c0d3c9ffd
KonduitAI/deeplearning4j
libnd4j/include/ops/declarable/helpers/cpu/compare_elem.cpp
/******************************************************************************* * Copyright (c) 2015-2018 Skymind, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at * https://www.apache.org/licenses/LICENSE-2.0. * *...
ALGO
0.99153
6.252048
{ "github_metadata": { "branch": "master", "commit_count": 1046, "repo_created_at": "2019-10-14T06:42:12.000Z", "is_fork": true, "is_org_owned": true, "forked_from": "deeplearning4j/deeplearning4j", "stars": 11, "forks": 7, "issues": 7, "pull_requests": 24 }, "file_meta": {...
1e968dca-4e2a-4a46-8760-5185ae25b793
StevenMunich/CPPCollection
LinkedListProj.cpp
#include <iostream> using namespace std; class circle { public: circle(double r) { radius = r; } circle() { radius = 0; }; //count++; idNum = count; double getRadius() { return radius; } void setRadius(double r) { radius = r; } double getArea() { return radius * radius * 3.14; } private: double ra...
ALGO
0.999373
5.033102
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-09-19T21:52: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": "328b6f5a31c1...
22bade6c-745b-4a8c-93e8-08e5d30f7007
arihantJ24/DSA-with-Arih
Medium/Longest Increasing Subsequence/longest-increasing-subsequence.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends #include <bits/stdc++.h> class Solution { public: int f(int idx, int prev_idx ,int n, int nums[],vector<vector<int>>&dp){ if(idx == n)return 0; if(dp[idx][prev_idx+1] !=-1) return dp[idx][prev_idx+1]...
ALGO
0.999948
6.232777
{ "github_metadata": { "branch": "main", "commit_count": 492, "repo_created_at": "2024-04-02T00:30:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ad93dfbc90...