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
a9256667-197b-4605-a861-2338412e3105
tko919/library
Graph/opttoposort.hpp
#pragma once #include "DataStructure/unionfind.hpp" // root:0, minimize sum_{i<j} w1[q_i]*w0[q_j] pair<ll, vector<int>> OptimalToposort(int n, vector<int> &p, vector<ll> &w0, vector<ll> &w1) { struct Node { ll zero, one, inv; Node(ll z = 0, ll o = 0, ll i = 0) ...
ALGO
0.999949
5.123061
{ "github_metadata": { "branch": "main", "commit_count": 280, "repo_created_at": "2021-12-28T08:23: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": "ba0fab192b...
e4d9105a-ed20-4a13-a06a-672183a29040
xUhEngwAng/oj-problems
nowcoder/NC128 接雨水问题.cpp
#define MIN(X, Y) ((X) < (Y)? (X): (Y)) #define MAX(X, Y) ((X) > (Y)? (X): (Y)) class Solution { public: /** * max water * @param arr int整型vector the array * @return long长整型 */ long long maxWater(vector<int>& arr) { // write code here vector<int> left_height, right_height; ...
ALGO
0.999992
5.830566
{ "github_metadata": { "branch": "master", "commit_count": 134, "repo_created_at": "2019-01-14T08:03:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c18d5150...
88d1ea09-662e-42b6-abcc-ae5bfda4139a
EternalBlue1998/my_cp_template
template/Math/Matrix.cpp
#include <bits/stdc++.h> using namespace std; constexpr static int mod = 1e9 + 7; //矩阵快速幂 struct Matrix { int n, m;//row, col std::vector<vector<long long>> A; Matrix(int n, int m) : n(n), m(m) { A.resize(n, std::vector<long long>(m)); } }; Matrix operator*(const Matrix &a, const Matrix &b) ...
ALGO
0.999796
3.949136
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-10-19T16:00:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "edb158935652...
50da49a8-41e7-4847-a3c6-a30d2f83109e
hexu1985/book_code_discard
cpp.primer.3e/algorithm/inplace_merge/inplace_merge_demo.cpp
#include <algorithm> #include <vector> #include <iostream> using namespace std; template <class Type> void print_elements( Type elem ) { cout << elem << " "; } /* * 结果: ia sorted into two subarrays: 12 15 17 20 23 26 29 35 40 51 10 16 21 41 44 54 62 65 71 74 ia inplace_merge: 10 12 15 16 17 20 21 23 26 29 35 40...
ALGO
0.999714
5.260478
{ "github_metadata": { "branch": "master", "commit_count": 83, "repo_created_at": "2017-07-25T07:22:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ba11265f9...
8eb679a3-6791-4db3-b9d8-f0415478b9b9
16BitNarwhal/Competitive-Programming
codeforces/1461D.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MM = 1e5+2; int n, q, ar[MM], S[MM]; ll pre[MM]; unordered_map<ll, bool> mp; void dac(int L, int R) { mp[pre[R] - pre[L-1]] = 1; int l=L, r=R, mid=-1; int x = (ar[l] + ar[r]) / 2; while (l <= r) { int m = (l+r)/2; if (ar[m...
ALGO
0.999975
4.418441
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2023-12-22T00:17: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": "dc234cd7a...
43d58f43-d906-4969-b010-2fe36646b2ae
endyjams/COMP0493-EndyMelo
algorithms/divide_and_conquer/count_inversions.cpp
#include <vector> using namespace std; int countInversions(vector<int> &v) { int numberOfInversions = 0; vector<int> v1, v2; int n = v.size(); if (n == 1) return 0; for (int i = 0; i < n/2; i++) v1.push_back(v[i]); for (int i = n/2; i < n; i++) v2.push_back(v[i]); n...
ALGO
0.999966
4.97085
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2024-12-07T00:47:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1a68c9f0213...
f72169b4-c70a-45da-95a5-651e961dd064
TiffanyTrinh12/2022_Summer_CSC_CIS_5
Hmwk/Assignment4/Savitch_9thEd_Chap4_Prob02_FuelEff/main.cpp
/* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/cppFiles/main.cc to edit this template */ /* * File: main.cpp * Author: <NAME> * Created on July 14, 2022, 4:25 PM * Purpose: Fuel Efficiency */ //System ...
TOOL
0.913507
4.710175
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2022-07-19T04:35:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "317706f37cb...
72f37e14-bf64-43bb-b87a-c92b2ff02b4d
utkarsh2338/LEETCODE
0587-erect-the-fence/0587-erect-the-fence.cpp
class Solution { public: int findEquationVal(pair<int,int>&P1,pair<int,int>&P2,pair<int,int>P3){ int x1 = P1.first; int x2 = P2.first; int x3 = P3.first; int y1 = P1.second; int y2 = P2.second; int y3 = P3.second; return (y3-y2)*(x2-x1) - (y2-y1)*(x3-x2); ...
ALGO
0.999998
5.911745
{ "github_metadata": { "branch": "main", "commit_count": 1523, "repo_created_at": "2024-12-19T01:13: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": "7faff6df9...
e5a439c2-b2da-4600-b0d7-af0b57b6871c
Tomusss/AISD_3SEM
lista1/kody/DoubleInsertionSort.cpp
#include <iostream> #include <random> using namespace std; int porownania = 0; int przypisania = 0; void double_insertionSort(float A[], int n) { for (int i=1;i<n; i+=2) { float key1, key2; if (A[i] < A[i-1]) { porownania++; key1 = A[i]; key2 = A[i-1]; ...
ALGO
0.999877
5.042087
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2024-10-17T09:37:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8a0b6d46d8b...
ae16d5d2-99bf-4e5c-bcb6-a736666d6da1
ttzztztz/lgAlgorithms
模板/P3834 【模板】可持久化线段树 1(主席树).cpp
#include <iostream> #include <algorithm> using namespace std; class TreeNode { public: int leftNode, rightNode, sum; TreeNode() : leftNode(0), rightNode(0), sum(0) {}; }; const int MAX = 200005; int number[MAX], uniqueNumber[MAX], root[MAX << 5]; TreeNode treeNode[MAX << 5]; int nodeCount = 0; int build(i...
ALGO
1
5.103956
{ "github_metadata": { "branch": "master", "commit_count": 52, "repo_created_at": "2019-05-26T13:38:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "97a78cd0a...
f5b3962e-9116-40ab-b645-1da572d01f03
Sumon670/DSA-Basic
Tries/trieintro.cpp
//Writen by CodemanSumon #include<bits/stdc++.h> using namespace std; class TrieNode{ public: char data; TrieNode* children[26]; bool isTerminal; TrieNode(char ch){ data = ch; for (int i=0; i<26; i++){ children[i]=NULL; } ...
ALGO
0.999834
4.246898
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2023-01-21T17:37:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0b11eb23c2c...
8bd507b5-e6c9-4bd8-b106-ea234942d633
king7282/algorithm
boj/DP/2124.cpp
#include <stdio.h> #include <algorithm> #include <cstring> #include <vector> #include <map> #define MOD 1000000000000000000LL; struct info { int x, y, up, bitmask; info(int x = 0, int y = 0, int up = 0, int bitmask = 0) : x(x), y(y), up(up), bitmask(bitmask) {} }; bool operator<(const info &a, const info &b) { if ...
ALGO
0.999954
3.774891
{ "github_metadata": { "branch": "master", "commit_count": 462, "repo_created_at": "2020-09-07T05:09:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "95c46cdd...
883a4bca-5562-4a52-a6ac-84d832beeddd
yamate11/compprog
arc/arc023/b/cans.cc
#include <bits/stdc++.h> #include <cassert> typedef long long int ll; using namespace std; // @@ !! LIM() int main(int argc, char *argv[]) { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout << setprecision(20); ll R, C, D; cin >> R >> C >> D; vector<vector<ll>> A(R, vector<ll>(C)); for (ll i = 0;...
ALGO
0.999731
4.147471
{ "github_metadata": { "branch": "main", "commit_count": 219, "repo_created_at": "2021-03-11T06:12:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b57cd99be0...
fa155d85-87e1-460c-bcd1-a1341c8e3e32
DyThen-Kumo/Convert_MIPS_Assembly_to_Computer_Code
DoAn.cpp
#include "Class.cpp" // Chứa lệnh I, J, R string nhap_ten(string s){ string name = ""; if(s.size()==0) return name; for(int i=0; i<s.size() && s[i]!=' ' && s[i]!=':'; ++i) name += s[i]; return name; } bool check_finish(string s){ string finish = "j $ra"; if(s.find(finish) != ...
ALGO
0.995222
3.201549
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2023-06-03T15:55:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "86f48ede62de...
e8376012-aa46-44df-87ab-1deefc9602ab
Mobilizes/CProgramming
TOKI/4. Brute Force/B. gruppialadunia.cpp
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define Mob ios_base::sync_with_stdio(false) #define lcm(a, b) (a*b / __gcd(a, b)) #define tcs() int testcase; cin >> testcase; while(testcase--) #define INTMAX (int)(1e9) #define LLMAX (ll)(1e18) #define mod int(1e9+7) #define pymod(a,b) ((b + (a%b...
ALGO
0.999843
3.617234
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2023-08-20T05:13: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": "7c648a8c56e...
f742c7c6-ec7e-4b25-8f85-60c744d1f485
ivan100sic/competelib-snippets
number-theory/sieve.11.cpp
// Sieve of Eratosthenes #include <vector> #include <utility> using namespace std; using ll = long long; /*snippet-begin*/ struct sieve { const int maxn; vector<int> f, primes; sieve(int maxn) : maxn(maxn), f(maxn) { for (int i=2; i<maxn; i++) { if (f[i] == 0) { f[i] ...
ALGO
0.999413
4.496486
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2021-10-17T13:30:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 3, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "40798d6c486...
ca8e8bad-1d88-4496-9a84-83ae43b94f0b
meenyweeny/Algorithm
BOJ/11438.cpp
// // Created by 이경민 on 2023/01/18. // #include<iostream> #include<vector> #include<queue> using namespace std; //MAX_K는 MAX_SIZE < 2^k가 될 수 있는 적당한 k값을 넣으면 된다 #define MAX_K 17 #define MAX_SIZE 100001 int n,m; vector<vector<int>> graph; int depth[MAX_SIZE]; int parent[MAX_K + 1][MAX_SIZE]; //dp를 위한 조상의 값 const int inf...
ALGO
0.999993
5.271189
{ "github_metadata": { "branch": "main", "commit_count": 577, "repo_created_at": "2022-02-02T15:50: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": "5405505969...
741b7a92-5fd1-4fb3-bba4-5eca16ee1adb
Wankupi/cpp
数据结构/笛卡尔树/LuoguP4755 Beautiful Pair.cpp
#include <algorithm> #include <cstdio> using namespace std; int const maxn = 100003; int n = 0; int a[maxn], A[maxn], cA = 0; struct Node { int sum; int lc, rc; }; Node tr[maxn * 20]; int cntStr = 0; void Create(int &p, int L, int R) { p = ++cntStr; if (L == R) return; int mid = (L + R) >> 1; Create(tr[p].lc, L, ...
ALGO
0.9999
3.734812
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2019-12-21T12:37:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "713996ee6...
21a0ba2f-76ae-447e-8369-e25a73ef3f41
imxinlei/leetcode
283_Move_Zeroes.cpp
/* * https://leetcode.com/problems/move-zeroes/#/description * * Given an array nums, write a function to move all 0's to the end of it while * maintaining the relative order of the non-zero elements. * * For example, given nums = [0, 1, 0, 3, 12], after calling your function, * nums should be [1, 3, 12, 0, 0]. ...
ALGO
0.999952
7.157309
{ "github_metadata": { "branch": "master", "commit_count": 261, "repo_created_at": "2017-04-04T05:59:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f6b88b5b...
14f0a92a-d9ef-4321-9a5c-6dfc41e05ce4
ModeBeater/Algorithms-and-Data-Structures
lab 8/H.cpp
#include <iostream> #include <vector> #define ll long long using namespace std; string check(string s, string t){ int l = -1; int r = 0; ll hs = 0; ll m = 1e9; int a[100000] = {0}; int cnt = 0; for(int i = 0; i < t.size(); i++){ ll ht = 0; hs = (t[i] - 'a' + 1) % m; ...
ALGO
0.999967
4.019911
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-01-05T06:05: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": "d32de50e4eff...
6975a40e-666e-43c5-9da8-83ed2cb11a1c
UserUnauthorized/OI-Codes
HZ-contests/265/B.cpp
//HZ - 265.2 #include<bits/stdc++.h> using namespace std; const int maxn = 10000007; int n, A, B, ans = INT_MAX, source[maxn], dpA[maxn], dpB[maxn], white[maxn]; deque<int> que; void init(); void dp(); int main() { init(); dp(); partial_sum(white, white + n + 1, white); for (int i = 1; i <= n; ++...
ALGO
0.999951
3.465313
{ "github_metadata": { "branch": "main", "commit_count": 673, "repo_created_at": "2022-08-30T03:06:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e314ad55d4...
6adbe893-7b16-44ef-a53c-866afbf8c444
iamhyunsoo/quiz
include/DominoandTrominoTiling.h
#define BOTTOMUP class Solution790 { public: int numTilings(int n) { #ifdef BOTTOMUP if (n <= 2) { return n; } std::vector<long> fulls(n, 0); std::vector<long> partials(n, 0); fulls[0] = 1; fulls[1] = 2; partials[1] = 1; ...
ALGO
0.999956
5.078518
{ "github_metadata": { "branch": "main", "commit_count": 428, "repo_created_at": "2021-02-24T14:15: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": "bc5ce67197...
612bd090-1e16-44c6-8499-53b9fc2ec8c2
arin2002/leetcode
0641-design-circular-deque/0641-design-circular-deque.cpp
class MyCircularDeque { public: vector<int> dq; int sz; int front; int rear; int current; MyCircularDeque(int k) { sz = k; dq.resize(k); front = 0; rear = k - 1; current = 0; } bool insertFront(int value) { if (isFull()) ...
ALGO
0.999138
5.967784
{ "github_metadata": { "branch": "main", "commit_count": 4845, "repo_created_at": "2022-05-19T14:50: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": "edf7bcce4...
13cd2ad8-4db8-4a24-8569-dda5ee291e04
mdadul/Problemsolving
OOP/OperatorOverload.cpp
#include <iostream> using namespace std; class Box { int height,width; public: Box() { height = 0; width = 0; } Box(int height, int width) { this->height = height; this->width = width; } void setvalue(int height, int width){ this->height=height; this->width = width; } void show() { cout<<"heig...
ALGO
0.988313
4.096064
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2021-02-06T04:52:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c59175ed8e4...
8f36fd18-8817-43b4-bccb-2b3eb661bd8b
fyquah/Informatics-stuff
ioi/2012/scrivener/scrivener.cpp
#include <string> #include <stack> #include <vector> #include <cstring> #include <iostream> using namespace std; struct Node{ char character; int depth; int edges[26]; int parent; Node(char c , int h , int p){ character = c; depth = h; parent = p; for(int i = 0 ; i < 26 ; i++) edges[i] = -1; } }; vec...
ALGO
0.999909
3.957872
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2014-08-04T10:00: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": "77d06e1fba...
044d898a-921d-417f-a502-dd4e909e56cb
noyo/Algorithm
Algorithm/ch3/p3-9.cpp
#include<stdio.h> #include<string.h> #define N 81 char t[N]; char s[N]; int main() { while(true) { scanf("%s%s", t, s); int t_l = strlen(t); int s_l = strlen(s); int curIndex = 0; for(int i = 0; i < t_l && curIndex < s_l; i++) { if(t[i] == s[curIndex]) { curIndex++; } } bool ans = curInde...
ALGO
0.999948
3.062762
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-10-15T04:46:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "94a85c105b...
d6084f3b-6191-4246-849f-5328dccbcf95
fricai/competitive-programming
codeforces/1559/D1.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, a, b) for (auto i = (a); i < (b); ++i) #define per(i, a, b) for (auto i = (b); i-- > (a); ) #define all(x) begin(x), end(x) #define rall(x) (x).rbegin(), (x).rend() #define sz(x) int((x).size()) template<class ...
ALGO
0.999981
4.430091
{ "github_metadata": { "branch": "master", "commit_count": 2301, "repo_created_at": "2021-09-29T18:57:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "331d5b2...
40aa1813-9161-4411-a7da-519ea3e7a5c0
YX-SHEN/Cuda3
CUDA3/LLM_cuda_3/main.cpp
#include <iostream> #include <vector> #include <iomanip> #include <cmath> #include <sys/time.h> #include <getopt.h> #include <cstdio> #include <cstdlib> #include <cstring> // 声明 GPU 接口 void expint_cuda(int n, int m, double a, double b, int maxIterations, std::vector<std::vector<float>> &gpuFloat, std:...
ALGO
0.997651
4.862688
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2025-05-16T04:48: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": "e41824c4b3...
f65cd045-cc22-4718-83ec-639c3978d6bc
monman53/online_judge
CodeForces/363_2/B.cpp
// includes, macros {{{ #include <iostream> #include <sstream> #include <string> #include <vector> #include <stack> #include <queue> #include <set> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <cctype> #include <cmath> #include <climits> #include <cassert> #include <functional> ...
ALGO
0.999936
3.198315
{ "github_metadata": { "branch": "master", "commit_count": 125, "repo_created_at": "2014-10-24T08:33:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "a44d9f7a...
ca5146e5-4b2b-4b0f-a441-728e1ed4c013
SameetKeshav/COS214-Project
GoogleTesting/Code/src/Siege.cpp
#include "Siege.h" Siege::Siege(int stealth,Kingdom* myKingdom,Kingdom* enemyKingdom,Bannerman* myBannerman, Bannerman* enemyBannerman,string name,int min,int minFavour, Historian* h, HistoryBook* hb):Strategy(myKingdom,enemyKingdom,myBannerman,enemyBannerman,"Siege",min,minFavour, h, hb){ this->stealth=stealth; }...
ALGO
0.981533
3.758931
{ "github_metadata": { "branch": "main", "commit_count": 321, "repo_created_at": "2022-09-30T11:29: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": "3ac80fefc7...
46e284f7-2563-49c2-a0ca-5b2aed671ae7
mfem/mfem
examples/ex40p.cpp
// MFEM Example 40 - Parallel Version // // Compile with: make ex40p // // Sample runs: mpirun -np 4 ex40p -step 10.0 -gr 2.0 // mpirun -np 4 ex40p -step 10.0 -gr 2.0 -o 3 -r 1 // mpirun -np 4 ex40p -step 10.0 -gr 2.0 -r 4 -m ../data/l-shape.mesh // mpirun -n...
ALGO
0.999842
4.38638
{ "github_metadata": { "branch": "master", "commit_count": 24273, "repo_created_at": "2015-06-11T21:42:21.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1934, "forks": 544, "issues": 96, "pull_requests": 189 }, "file_meta": { "content_id": ...
66918d78-dbeb-4fb2-a1a3-e8773d94a8f1
YiPrograms/Gamebaby
Exercise Codes/Arduino_Calculator_Complicated/Arduino_Calculator_Complicated.ino
#include <Arduino.h> #include <Adafruit_GFX.h> // Core graphics library #include <Adafruit_ILI9341.h> // Hardware-specific library #include <XPT2046_Touchscreen.h> #include <SPI.h> #include <Wire.h> #include <vector> using std::vector; #define TOUCH_CS_PIN D3 #define TOUCH_IRQ_PIN D2 #define TS_MINX 330 #define ...
TOOL
0.919603
4.328878
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2019-07-10T14:49: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": "fab87dba7...
345c26d1-27b6-4cfd-b5d1-f708b410662a
yongduek/usaco
friday.cpp
/* ID: yongdue2 PROG: friday LANG: C++11 */ // // friday.cpp // UVa-XCode // // Created by <NAME> on 2016. 3. 1.. // Copyright © 2016년 <NAME>. All rights reserved. // #include <stdio.h> #include <iostream> #include <sstream> #include <fstream> #include <string> #include <map> #include <vector> using namespac...
ALGO
0.999944
3.515657
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2016-03-01T13:02: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": "8272b96230...
627509a2-bb25-4077-a4a0-8fe9193f6ae3
Seongil-Shin/Algorithm
백준/solutions/14502 Samsung sw test/14502 Samsung sw test.cpp
#include <iostream> #include <list> #include <cstring> #define MAX_WIDTH 8 using namespace std; typedef struct Cell { int row; int col; } Cell; int map[MAX_WIDTH][MAX_WIDTH]; int tempMap[MAX_WIDTH][MAX_WIDTH]; int width, height; int getMaxSafeArea(); int main() { cin >> height >> width; for (int i = 0; i < hei...
ALGO
0.999939
4.253905
{ "github_metadata": { "branch": "main", "commit_count": 112, "repo_created_at": "2020-12-05T13:01: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": "310982e5b1...
a85c08d4-9130-4286-92d7-e506c2a39ae5
Nvann07/CircularQueuesArray_0069
circularqueues.cpp
/** * @mainpage Documentation Circular Queues * * @section Introduction * Project ini merupakan project struktur data * menggunakan struktur data queues dengan pendekatan circular array.alignas * @section Operations * Project ini memmiliki beberapa operasi antara lain:alignas * 1. Insert * 2. Delete * 3. Dis...
ALGO
0.986786
5.016972
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2025-06-12T10:32: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": "7deec9dffae...
da8d6b9c-956b-42fd-902e-693fb66ac623
abhijitmanna912001/DSA-Problem-Solving
Recursion/PrintOccurence.cpp
#include <iostream> using namespace std; void printIndices(int arr[], int target, int index, int size) { // Base case: if the index is out of bounds, stop recursing if (index >= size) { return; } // If the current element matches the target, print its index if (arr[index] == target) ...
ALGO
0.999512
6.419929
{ "github_metadata": { "branch": "main", "commit_count": 379, "repo_created_at": "2024-07-20T11:13: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": "364b2b3025...
42f8fe92-d331-4f33-b87e-be0f015dade4
Mansterteddy/Cracking-the-Coding-Interview
language/c++/data structure/Tree/B_Tree/b-tree.cpp
#ifndef B_TREE_H_ #define B_TREE_H_ #include <sstream> #include <string> #include <algorithm> /** An implementation of the B-tree. A B-tree is a search tree * in which each node other than the root contains * CAP/2-1 .. CAP-1 items and CAP/2 .. CAP children. The tree * is always balanced in that all leaves a...
ALGO
0.99695
3.32848
{ "github_metadata": { "branch": "master", "commit_count": 335, "repo_created_at": "2016-08-08T08:35:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4a888eaf...
bc9540fb-c12c-4bd1-9c7b-95bb77c0843e
asvikr/SPOJ_SOL
MATCHING/16083113.cpp
#include<bits/stdc++.h> using namespace std; typedef long long int LL; #define pb push_back #define mp make_pair #define f first #define sc second #define pii pair<int,int> #define M 1000000007 #define inf (int)(2e+9) #define all(o) (o).begin(), (o).end() #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_...
ALGO
0.999944
3.782317
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-03-08T06:05:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e6c638f0e2...
d41d10ea-3eb3-4ac1-8454-58bf4e2fb5cc
zylzjucn/Leetcode
300~399/314. Binary Tree Vertical Order Traversal.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999979
6.408296
{ "github_metadata": { "branch": "master", "commit_count": 538, "repo_created_at": "2018-03-19T07:18: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": "27ac5935...
1ffad2d4-2de3-4b30-9327-e747cfef365f
Leonardosu/algorithm
Geometry/polygon.cpp
struct Polygon { int n; vector<pt> pol; Polygon(vector<pt> poly = {}) : pol(poly) { n = pol.size(); } bool inside(pt p, bool strict = true) { //O(log(n)) convex int a = 1, b = n - 1, r = !strict; if (n < 3) return r && onSegment(pol[0], pol.back(), p); if (sgn(pol[0]...
ALGO
0.999729
5.48643
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2019-08-26T21:33: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": "a3fcf6dc3...
a9ea4186-ae37-4e5b-bdc9-a453f9e95f32
darthsuogles/phissenschaft
algo/leetcode_p43.cpp
/** * LeetCode Problem 42 * * Multiply two strings */ #include <iostream> #include <string> using namespace std; class Solution { public: string multiply(string num1, string num2) { if ( num1 == "0" || num2 == "0" ) return "0"; string res((num1.size() + num2.size() + 1), '0'); // initialize to all ze...
ALGO
0.999925
5.841938
{ "github_metadata": { "branch": "develop", "commit_count": 190, "repo_created_at": "2017-03-12T05:28:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5850955...
943b5ddb-7293-4226-a495-560cc2e90c05
SergoChilo/Cpp
Level 1/Practic_1/main.cpp
//Составить программу, которая будет считывать введённое пятизначное число. // После чего, каждую цифру этого числа необходимо вывести в новой строке. //Введите пятизначное число: 10819 //1 цифра равна 1 //2 цифра равна 0 //3 цифра равна 8 //4 цифра равна 1 //5 цифра равна 9 #include <iostream> using namespace std;...
ALGO
0.998726
3.503964
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-02-23T13:41:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8bd6a32180fe...
b712cce4-5ad1-453c-86e2-bca433b6e810
ishikaraj13/6Companies30Days
Day 9 Amazon/Q10_Nuts_and_Bolts_Problem.cpp
#include <bits/stdc++.h> using namespace std; class Solution{ public: void matchPairs(char nuts[], char bolts[], int n) { map<char,int> m; m['!']=0; m['#']=0; m['$']=0; m['%']=0; m['&']=0; m['*']=0; m['@']=0; m['^']=0; m['~']=0; ...
ALGO
0.999961
3.989084
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2022-01-01T06:37: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": "69f7cd988a6...
0e30363b-7b2e-4b4f-8b1b-fd268f69b1fb
annie31123/pd2-2048
game.cpp
#include "game.h" #include <iostream> #include <cstdlib> #include <ctime> #include <iostream> #include <QTime> using namespace std; Game::Game(){ restart(); } void Game::restart(){ score=0; for(int i=0;i<4;i++) for(int j=0;j<4;j++){ boardarray[i][j]=0; regretarray[i][j]=0;} qsrand(time...
ALGO
0.980972
3.613742
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2015-05-12T20:03: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": "4453099033...
95ca68b6-0a0c-46b0-9bce-f4ffec78f1b5
Carter-Beatty/AHMRFT
Transformation_rev1.cpp
#include <Eigen/Dense> #include <Eigen/Geometry> #include <iostream> #include <iomanip> #include <vector> //print function void myPrint(const Eigen::MatrixXd& translation, const Eigen::MatrixXd& force_local) { for (int i = 0; i < 3; ++i) { std::cout << "\nPartition Point: " << i + 1 << std::endl; ...
ALGO
0.99943
5.985049
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-06-18T22:14:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "753691c4e6c6...
b764308f-0bf8-4fb3-afe3-ec81fbb197ff
wangchuan3533/leetcode
algorithms/649.cc
#include <iostream> #include <string> #include <list> #include <utility> #include <iterator> class Solution { public: std::string predictPartyVictory(std::string senate) { std::list<char> senateList(senate.begin(), senate.end()); char winner; auto it = senateList.begin(); while...
ALGO
0.999964
5.482565
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2016-04-18T14:16:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cd9aa3cb6...
c986606a-1e13-4fe5-8286-4c7ef509c506
PrajwalHD58/competative_coding
Codechef/Long Challanges/May2021/Valid_Paths.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i,a,b) for(long long i=a;i<b;i++) #define RREP(i,a,b) for(long long i=a;i>b;i--) #define pb push_back #define popb pop_back typedef vector<int> vi; typedef pair<int, int> pii; typedef pair<int , pii> piii ; typedef unsigned long long ull ;...
ALGO
0.999888
3.920378
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2021-08-17T18:25: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": "f99a425485...
883b2fb3-d6a7-4731-b0dd-fce14b01b419
nutan-sangani/CP-Practice
Initial practice 1500-1600/E_Counting_Rectangles.cpp
#include <iostream> #include<bits/stdc++.h> #define ll long long #define forLoop for(int i=0;i<n;i++) #define pii pair<int,int> #define pb push_back #define pll pair<ll,ll> #define mp make_pair #define um unordered_map #define us unordered_set #define umll unordered_map<ll,ll> #define omll map<ll,ll> #define vecll vect...
ALGO
0.999853
3.685734
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2024-12-03T11:56: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": "7520782cce6...
3a64cf31-b6d1-41f8-82c7-cfd0bc6efa14
veksku/R210_Algorithm_Construction_and_Analysis
8_cas/3.cpp
#include <iostream> #include <vector> #include <algorithm> // Struktura kojom se predstavlja graf struct Graph { // Lista susedstva. Imamo vector vector-a, sto znaci za svaki od cvorova [0,V) imamo po jednu listu koja cuva susede odgovarajuceg cvora std::vector<std::vector<int>> adjacency_list; // Broj cvorova g...
ALGO
0.998344
5.38761
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2020-03-09T20:12: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": "1f0403a67...
a2db67f7-712c-4eea-b585-dab5ee6725f7
inbdni/Baekjoon
17143_낚시왕.cpp
#include <iostream> #include <vector> #include <cstring> #define UP 1 #define DOWN 2 #define RIGHT 3 #define LEFT 4 using namespace std; typedef struct s_shark { int r; int c; int s; int d; int z; int alive; } t_shark; int R; int C; int M; vector<t_shark> shark; int area[101][101]; int dy[] = {0, -1, 1, 0, 0...
ALGO
0.999866
4.022334
{ "github_metadata": { "branch": "master", "commit_count": 128, "repo_created_at": "2021-01-06T12:03: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": "ddecb143...
de6547a0-4e2d-4841-9915-d4b6712ef971
bhuvaneshSankar/competitiveProgramming
leetcode/augustChallenge/powerOfFour.cpp
#include <bits/stdc++.h> #include <math.h> using namespace std; /** * check whether a given number is power of four * approach : * condition 1: there must be only one set bit in the number * how to : find the set bit position and then 1<<(pos-1) must yield the same number * condition 2: position of the set bit mu...
ALGO
0.996097
5.007774
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2020-08-16T15:51:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fe5a767e10...
0857e82a-8fe3-41fc-96a9-6b59ea2d8dfd
peacock08/CPP-Program
LCMGCD7.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; main() { int t; cin >> t; while (t--) { long long x, y, z, n; cin >> x >> y >> z >> n; long long bcnn = (x * y) / __gcd(x, y); bcnn = (bcnn * z) / __gcd(bcnn, z); long long temp = pow(10...
ALGO
0.999766
3.530243
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-11-14T14:23:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f8279f1f386...
a7be3ba4-7088-4585-b947-0138ea060c61
bl-downey/JPEG_Codec
code/utils/codec_parallel.h
#ifndef CUDACC #define CUDACC #endif #include "cuda_runtime.h" #include "device_launch_parameters.h" #include <cuda.h> #include <cuda_runtime_api.h> #include <math.h> #include <stdio.h> #include <list> #define pi_math 3.142857 #define BLOCK_WIDTH 8 #define BLOCK_SIZE BLOCK_WIDTH*BLOCK_WIDTH /* DCT Kernel input ...
ALGO
0.997636
3.442503
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2023-01-27T02:44:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0ad342539712...
ada4884b-085d-499e-b566-ef2273c77639
parulchaddha/leetcode-solved-ques
152-maximum-product-subarray/152-maximum-product-subarray.cpp
class Solution { public: int maxProduct(vector<int>& nums) { int n = nums.size(); // initialize max_product with max. of nums int max_product = *max_element(nums.begin(), nums.end()); // curr_max will store the maximum product of subarray till (i - 1)th ind...
ALGO
0.999961
6.183661
{ "github_metadata": { "branch": "main", "commit_count": 817, "repo_created_at": "2022-07-19T16:10: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": "e1b78ce005...
1297a214-a9b9-43f1-866d-b7509e75ad25
bkorecic/competitive-programming-solutions
codeforces/1345B - Card Constructions.cpp
#include <bits/stdc++.h> #define f first #define s second #define mp make_pair #define pb push_back using namespace std; typedef long long ll; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while(t--){ ll n; cin >> n; int ans = 0; while(n > 1){ ...
ALGO
0.999938
3.725437
{ "github_metadata": { "branch": "master", "commit_count": 67, "repo_created_at": "2019-09-28T02:00:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7a3180847...
66dce8fe-b3d8-44a3-a3db-1362bc545268
ApolloAuto/apollo
modules/perception/common/inference/migraphx/mi_common.cc
/****************************************************************************** * Copyright 2022 The Apollo Authors. All Rights Reserved. * * 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 ...
TOOL
0.915357
6.349403
{ "github_metadata": { "branch": "master", "commit_count": 19341, "repo_created_at": "2017-07-04T19:03:31.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 25847, "forks": 9793, "issues": 895, "pull_requests": 104 }, "file_meta": { "content_id...
dd91d45f-c950-4e86-8d11-e70f1d86cf16
mmswflow-upb/DSA-Big-HW1
Exercise 1/ex1.cpp
#include <iostream> #include <fstream> #include <stack> #include <string> #include <vector> using namespace std; vector<string> split(string x, int size) { vector<string> res; res.resize(size); size_t k = 0; int i = 0; while (x.length() != 0) { k = x.find(",", 0); if (k == string::npos) { res[i] = x...
ALGO
0.999686
3.817656
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-08-17T19:57:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "138565295d1d...
50258922-3ddc-458c-ba35-76275233ebed
Aashishyadav122/DSA_450
Linked_List/find_intersection_point_of_two_linked_list.cpp
//{ Driver Code Starts #include <iostream> #include <bits/stdc++.h> using namespace std; /* Link list Node */ struct Node { int data; struct Node *next; Node(int x) { data = x; next = NULL; } }; int intersectPoint(struct Node *head1, struct Node *head2); vector<int> take(int n) {...
ALGO
0.999805
5.785478
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-06-19T13:57: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": "eacbcfc6054...
99afd597-2b88-4446-bfea-824555c4b2fb
rgbdemo/nestk
ntk/stats/hypothesis_testing.cpp
/** * Copyright (C) 2013 ManCTL SARL <<EMAIL>> * * This program 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 3 of the License, or * (at your option) any later version. * * This...
ALGO
0.998377
5.880997
{ "github_metadata": { "branch": "master", "commit_count": 729, "repo_created_at": "2011-01-27T15:28:50.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 78, "forks": 45, "issues": 7, "pull_requests": 2 }, "file_meta": { "content_id": "714b204...
5682e543-65e4-4562-a043-a2fa38502302
JosephTLyons/Contact-Application
Contact Book V2/readAndWriteFunctions.cpp
#include <ctype.h> //for toupper function #include <iostream> //for input/output stream #include <fstream> //for reading from and saving to files #include "readAndWriteFunctions.hpp" #include "encryptDecryptFunctions.hpp" using namespace std; void printVectorToFile(const vector<char> &contactVect, ofstream ...
TOOL
0.98661
3.511615
{ "github_metadata": { "branch": "master", "commit_count": 122, "repo_created_at": "2016-07-04T04:09: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": "adc89316...
2612b59e-7938-448f-8b56-1c4203919058
Tsumugivolle77/nlaProject
main.cpp
#pragma gcc optimize("-O3") #include <utils.hpp> // examples of running the code #include "examples.hpp" // To enable printing additional information: // #define DEBUG // or // `add_compile_option(-DDEBUG)` in CMakeLists.txt /*** | Main features: ** -------------------------------- ** | 1. Transformation of a...
ALGO
0.998044
4.64155
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2025-01-08T19:44: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": "2075505e485...
5ffba198-2a38-43d3-bd1c-bb4f0e890cbf
Divyalok123/LeetCode_Practice
(Sept)30_Days_Challenge/SumofRootToLeafBinaryNumbers.cpp
/* https://leetcode.com/explore/featured/card/september-leetcoding-challenge/555/week-2-september-8th-september-14th/3453/ */ #include <iostream> #include <algorithm> #include <vector> #include <string> using namespace std; //Definition for a binary tree node. struct TreeNode { int val; TreeNode *left; Tr...
ALGO
0.999997
5.699024
{ "github_metadata": { "branch": "master", "commit_count": 313, "repo_created_at": "2020-04-18T22:23: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": "c52093b4...
d1389d75-b828-496e-8a80-8e6b3beff804
MaxPi-Dude/Arduino-Buzzer-Music-collections
Despacito_V2.ino
/************************************************* * Public Constants *************************************************/ #define NOTE_B0 31 #define NOTE_C1 33 #define NOTE_CS1 35 #define NOTE_D1 37 #define NOTE_DS1 39 #define NOTE_E1 41 #define NOTE_F1 44 #define NOTE_FS1 46 #define NOTE_G1 49 #define NOTE_GS...
CONFIG
0.97978
4.244717
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2025-06-17T14:21: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": "1996807821b...
23d3962a-9efa-4e65-9e9a-5096820a7381
littlepsyduck/PROPTIT-Algorithm
CONTEST PROPTIT/E. [ProPTIT-Practice-Algorithm] Ken re.cpp
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 #define endl '\n' #define pb push_back #define pop pop_back #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define test \ int t; \ cin >> t; \ w...
ALGO
0.999947
4.15749
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2024-07-04T11:28: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": "b29b87fdad6...
675d51fd-9375-4bb6-90e9-9107d54735c7
deeplearning4j/deeplearning4j
libnd4j/include/helpers/impl/hhSequence.cpp
/* ****************************************************************************** * * * 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. * * See the NOTICE file distributed wit...
ALGO
0.97289
4.835089
{ "github_metadata": { "branch": "master", "commit_count": 2834, "repo_created_at": "2013-11-27T02:03:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 14049, "forks": 3855, "issues": 636, "pull_requests": 0 }, "file_meta": { "content_id": ...
53a20a3d-50f2-4f87-9c19-ce5136034fb7
jk-jung/problem-solving
codeforces/Codeforces Round 61x/R617_div3_E1.cpp
#include <string.h> #include <stdio.h> #include <math.h> #include <cassert> #include <set> #include <map> #include <array> #include <stack> #include <queue> #include <vector> #include <numeric> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; typedef pair<int, int> pi; typedef vecto...
ALGO
0.999998
3.085049
{ "github_metadata": { "branch": "main", "commit_count": 1582, "repo_created_at": "2021-06-24T13:40:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "456e979d4...
511ab578-b073-4e1b-80e2-70136964678c
ENAMINE1/CP-JOURNEY
QUESTIONS/LEETCODE/DP/1262. Greatest Sum Divisible by Three.cpp
// Date: 10-07-2024 // Start Time: 17:15:15 // End Time : 18:15:15 // Time Taken: 60 minutes // Author: <NAME> // QUESTION LINK: https://leetcode.com/problems/greatest-sum-divisible-by-three/ // Rating: Medium // Description: Find the largest sum with the elements of the array whose sum is divisible by 3 // Solved: No...
ALGO
0.999148
5.427666
{ "github_metadata": { "branch": "main", "commit_count": 161, "repo_created_at": "2024-05-27T11:19: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": "0d1eae404d...
1838853b-7385-4bee-afb1-403d7963e2eb
rajaditya-m/fantastic-dragon-telegram
Cloth_Vorticity/constitutive_models.h
#pragma once #include <Eigen\Dense> #include <Eigen\SVD> inline Eigen::Matrix2f corotational_elasticity(Eigen::Matrix2f &m,float lame_param_lambda, float lame_param_mu) { //Compute polar decomposition of the matrix Eigen::JacobiSVD<Eigen::Matrix2f> svd(m); Eigen::Matrix2f u = svd.matrixU(); Eigen::Matrix2f v = s...
ALGO
0.997064
6.065986
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2016-01-20T19:11:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "faa34aad6...
684c833f-cc87-4a90-a54e-4cfdcdbd52fa
mdolab/dafoam
src/adjoint/DAResidual/DAResidualRhoSimpleFoam.H
/*---------------------------------------------------------------------------*\ DAFoam : Discrete Adjoint with OpenFOAM Version : v4 Description: Child class for DARhoSimpleFoam \*---------------------------------------------------------------------------*/ #ifndef DAResidualRhoSimpleFoam_H #de...
ALGO
0.932861
5.542902
{ "github_metadata": { "branch": "main", "commit_count": 504, "repo_created_at": "2019-05-11T03:44:21.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 269, "forks": 96, "issues": 7, "pull_requests": 1 }, "file_meta": { "content_id": "4f49e443...
e6002130-f5c7-4a48-ac57-74ded0d53ac6
anishaney/My-Experiments
atoi/atoi/Google/GoogleIntrvw.cpp
#include <iostream> #include <string> using namespace std; class GoogleIntrvw { private: float average; //string rotStr; public: GoogleIntrvw (int a){ average = a; } float runningAverage (unsigned int n, unsigned int curr_counter); int mystrncmp (const char *s1, const char *s2, int n); string rotat...
ALGO
0.998898
4.832757
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2013-10-03T20:51: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": "3c7714fb2...
90ccf2d5-60d9-4efe-82e4-97d5ebebb661
akshay-patade/competitive-programming
Uva-Online-Judge/Time to Start the Journey/Super Easy/10550 - Combination Lock/Solution.cpp
#define _USE_MATH_DEFINES #include<iostream> #include<climits> #include<algorithm> #include<set> #include<unordered_map> #include<queue> #include<cmath> #include<map> #include<array> #include<regex> #include<string> using namespace std; int main() { //one single rotation covers 9 degrees #ifndef ONLINE_JUDGE ...
ALGO
0.999859
4.188904
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-06-16T23:10: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": "0eea60c88e60...
16006ce7-99d0-4e25-9d41-951248db199e
sivasaiyeswanth/coding_practice_az
week8 & week9/centeroid.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define endl "\n" typedef vector<int> vi; typedef vector<vector<int>> vvi; vector<vector<int>> out; void printvec(vector<int> a){ for(int i=0;i<a.size();i++){ cout<<a[i]<<" "; } cout<<endl; } int n; vector<ve...
ALGO
0.999462
4.421844
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-06-04T06:14:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "53b5f4233668...
5b061aca-8567-4fdd-88e0-25ec17341c63
plilja/puzzlesg
cpp/dominant/dominant.cpp
#include <iostream> #include <string> #include <cstring> #include <vector> #include <algorithm> #include <map> #define ALPHABETSIZE 26 using namespace std; vector<string> dominant(vector<string> input) { // Sort input by length map<pair<int, int>, string> m; for (int i = 0; i < input.size(); i++) { ...
ALGO
0.999959
4.390729
{ "github_metadata": { "branch": "master", "commit_count": 473, "repo_created_at": "2015-06-26T17:09:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9cad31f8...
887942d7-87aa-472e-bc30-60bf281e23b6
VetalosUA-KR/Data-Structure-
колоквиум/ZestawC-25/lista_laczona.cpp
#include <iostream> #include "lista_laczona.h" using namespace std; void lista_laczona::addElement(int d) { Node * newEle = new Node(d); if(head == nullptr) { head = newEle; } else { Node * tmp = head; while(tmp->next != nullptr) { tmp = tmp->next; ...
ALGO
0.986537
3.053948
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-11-25T19:30: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": "c24f15718d...
b3c742f5-a7d7-45de-9453-926617d8a615
anthonylorelli/problems
uva/11225/11225.cpp
// Tarot scores // Problem definition: https://uva.onlinejudge.org/external/112/11225.pdf // Accepted 2019-06-11 #define CATCH_CONFIG_RUNNER #include "../catch/catch.hpp" #include <iostream> #include <string> #include <cmath> class TarotHand { public: TarotHand(std::istream& i, const int n) : m_threshold{0}, m_s...
ALGO
0.998337
4.281469
{ "github_metadata": { "branch": "main", "commit_count": 2335, "repo_created_at": "2018-10-07T00:32:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c6d7e317e...
155ef9b6-79fd-4682-8a5d-081c1af75078
Wilson1996/LeetCode-exercise
每日一题/259-threeSumSmaller.cpp
/* * @Author: wilson_t * @Date: 2021-03-28 12:21:56 * @Last Modified by: wilson_t * @Last Modified time: 2021-03-28 12:22:33 */ /* * 题目[中等]: 给定一个长度为 n 的整数数组和一个目标值 target,寻找能够使条件 nums[i] + nums[j] + nums[k] < target  成立的三元组  i, j, k 个数(0 <= i < j < k < n)。 示例: 输入: nums = [-2,0,1,3], target = 2 输出: 2 解释: 因为一共有两个三元组满...
ALGO
0.999992
6.148562
{ "github_metadata": { "branch": "master", "commit_count": 176, "repo_created_at": "2020-03-06T02:51:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a0156da3...
43a8a7e4-1c71-4bd6-be74-976144c592ed
Bfolefack/CPlusPlus
SFML/NeatActors/NeatActors/Node.cpp
#include "Node.h" #include <iostream> #include <ostream> #include "NeatConfig.h" std::array<int, 9> NeatConfig::activation_weights = {1, 1, 1, 1, 1, 1, 1, 1, 1}; float NeatConfig::compatibility_threshold = 1.f; Node::Node(int innovation, int x, int activation) { innovation_number = innovation; xPos = x; ...
ALGO
0.992922
5.124781
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2022-02-14T17:50: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": "d63955a0498...
29c7fb58-3a79-461e-a6ab-bd9f943614c0
cyp0633/homework
CSP-Training/1/20-energy.cpp
//能源消耗 #include <cstdio> #include <iostream> using namespace std; int getConsumption(const int &p1, const int &p2, const int &p3, const int &t1, const int &t2, int duration); int main() { int n, p1, p2, p3, t1, t2, startTime, endTime = 0; long long sum = 0; scanf("%d %d %d %d %d %d", &n, &p1, &p2, &p3, &t1,...
ALGO
0.999838
3.747265
{ "github_metadata": { "branch": "master", "commit_count": 190, "repo_created_at": "2020-12-09T11:10:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e7e5aab0...
cd0eb3ac-3c0c-4100-92f0-46269ca1f770
deepjyoti-dj7/DSA
10. Dynamic Programming/09. Best time to buy and sell stock with transaction fee/main.cpp
#include <iostream> #include <vector> using namespace std; // 1. Brute Force (Recursive) - Exponential Time Complexity (O(2^N)) int bruteForce(vector<int>& prices, int i, bool holding, int fee) { if (i >= prices.size()) return 0; if (holding) { return max(prices[i] - fee + bruteForce(prices, i + 1, fa...
ALGO
0.999999
6.574501
{ "github_metadata": { "branch": "main", "commit_count": 177, "repo_created_at": "2025-01-09T16:59: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": "dbc53c08a0...
86a0665d-6e30-4c0c-ac44-92dc3840d9b9
sdiazmor/rubot_mecanum_ws-sergio
Documentation/files/Arduino_node/pid.hpp
#ifndef _PID_HPP_ #define _PID_HPP_ class MPID{ public: Encoder *enc; float kP,kI,kD; int error; int currentError; int lastError; unsigned long lastTime; unsigned long currentTime; long lastEnc; long currentEnc; bool reverse; long deltaEnc; float deltaT; MPID(Encoder *Enc,float kp,float k...
TOOL
0.902258
5.157628
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2021-10-21T15:37:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7d812426a65...
cb018721-4e79-4053-8406-2f8d620c5787
Shaku-Med/CSC_326_Group
LB3/Test.cpp
#include "SortedList.h" #include <iostream> using namespace std; int main() { // Creating 6 objects of class SortedList SortedList<int> intList1, intList2, intList3; SortedList<double> doubleList1, doubleList2, doubleList3; SortedList<char> charList1, charList2, charList3; // Inserting elements i...
ALGO
0.945349
5.794989
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-02-03T21:27:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a527c1691b5...
0727138f-83f8-4a66-9e4e-96a2315321cd
OpenEAW/OpenGlyph
include/openglyph/parser/parsers.hpp
#pragma once #include "exceptions.hpp" #include <khepri/math/color_srgb.hpp> #include <khepri/math/matrix.hpp> #include <khepri/math/vector2.hpp> #include <khepri/math/vector3.hpp> #include <khepri/math/vector4.hpp> #include <khepri/utility/string.hpp> #include <charconv> #include <cstdint> #include <optional> #incl...
TOOL
0.947112
7.59786
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2021-04-27T13:50:02.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "85c186f7a035...
58a09a8a-1718-4f0f-ba60-fd128b08ce84
zyeternity/MyStudyCode
牛客/2022牛客OI赛前集训营-普及组(第二场)/My/安平-049/product/product.cpp
#include <bits/stdc++.h> using namespace std; long long m, n, k; long long add[5000000 + 10]; long long sum[5000000 + 10]; vector<int> find_k[100 + 10]; /* bool checkandout(long long x) { int add = 0; long long sum = 1; while (x) { sum *= x % 10; add += x % 10; x /= 10; } ...
ALGO
0.999936
4.092164
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2022-10-13T09:18: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": "6840150e63b...
d783e8d1-3dd2-47e4-a2ff-318526a4808b
Jitender-52/Leetcode
2275-largest-combination-with-bitwise-and-greater-than-zero/2275-largest-combination-with-bitwise-and-greater-than-zero.cpp
class Solution { public: int largestCombination(vector<int>& candidates) { int ans = 0; for(int i = 0; i < 30; i++) { int count = 0; for(auto j : candidates) { if(j & (1 << i)) count++; } ans...
ALGO
0.999816
5.827963
{ "github_metadata": { "branch": "main", "commit_count": 3177, "repo_created_at": "2023-01-06T06:22:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a0bc7004c...
fe9ef21f-13fa-4810-b569-ddc66a95f051
Ubiedo/facultad-programacion-2
tarea3/src/jugadoresABB.cpp
#include "../include/jugadoresABB.h" #include "../include/colaJugadoresABB.h" #include "../include/pilaJugador.h" struct rep_jugadoresABB { TJugador jugador; TJugadoresABB izquierda; TJugadoresABB derecha; }; TJugadoresABB crearTJugadoresABB() { return NULL; } bool esVacioTJugadoresABB(TJugadoresABB jugadore...
ALGO
0.998922
3.878672
{ "github_metadata": { "branch": "main", "commit_count": 53, "repo_created_at": "2023-08-21T14:28: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": "3872a38202f...
0be00aa8-b6db-4c48-bbf4-5600eab6f464
Rearcher/OJcodes
acm_challenge/poj3254.cpp
#include <iostream> using namespace std; int n, m, a[13]; int dp[13][(1 << 12) + 10]; const int MOD = 1e8; int main() { int x; cin >> m >> n; for (int i = 1; i <= m; ++i) { for (int j = 1; j <= n; ++j) { cin >> x; a[i] = (a[i] << 1) + x; } } dp[0][0] = 1; ...
ALGO
0.999992
4.239203
{ "github_metadata": { "branch": "master", "commit_count": 944, "repo_created_at": "2015-06-04T12:43:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f0922a67...
fdb47090-c95f-48e7-8660-6abc7c93528b
abhilasha007/Dynamic-Programming
Trees/MaxPathSumAnyToAny.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.999989
5.874594
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2021-02-22T19:55: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": "747d92d4cfdb...
47af227b-cd7c-4693-ae80-f2d20ee31aec
pcw109550/problem-solving
Baekjoon/2156.cpp
#include <bits/stdc++.h> using namespace std; int main(void) { int n; cin >> n; int input[n] = {}; for (int i = 0; i < n; i++) { cin >> input[i]; } if (n == 1) { cout << input[0]; return 0; } int D[n][3] = {}; D[0][0] = D[0][1] = D[0][2] = input[0]; D[1][0] = input[0] + input[1]; D[1][1] = D[1]...
ALGO
0.999979
3.857837
{ "github_metadata": { "branch": "master", "commit_count": 304, "repo_created_at": "2020-01-30T10:05:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "efcf738...
dd0a7c33-a96e-4ff8-80ff-8890ba587133
GovindKumar04/Leetcode
DSA/LinkedList/palindrome.cpp
#include <iostream> using namespace std; class Node{ public: int data; Node* next; Node* prev; Node(int data){ this->data=data; this->next=nullptr; this->prev=nullptr; } }; void insertAtHead(Node *&head, int data) { Node *newNode = new Node(data); newNode->next ...
ALGO
0.999762
4.517563
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2024-02-11T07:30: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": "cf8592016bd8...
7702bcff-f95c-48af-98ba-0c53ac6f20bd
perchuts/CompetitiveProgramming
AtCoder/abc273/f.cpp
#include <bits/stdc++.h> #define all(x) x.begin(), x.end() #define sz(x) (int) x.size() #define endl '\n' #define pb push_back #define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define int ll using namespace std; using ll = long long; using ull = unsigned long long; using ii = pair<int,int>; us...
ALGO
0.999929
4.587235
{ "github_metadata": { "branch": "master", "commit_count": 93, "repo_created_at": "2021-12-19T23:57: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": "169ea10a3...
4c69cb66-aa71-48bf-bc7d-0712f82780f7
HanynDmytro/Lab10.2B
10.2B/10.2B/Source.cpp
#include <iostream> #include <string> #include <Windows.h> #include <iomanip> using namespace std; enum Spec { CS, IT, ME, PhIT, TR }; // Перелічувальний тип для спеціальностей студентів // Масив рядків для відображення назв спеціальностей string strSpec[] = { "Комп'ютернi науки", "Iнформатика", "Математика та еконо...
TOOL
0.998071
5.367591
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-11-19T18:54: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": "149aa10dc77d...
bb75b0c3-c292-466d-8609-de0d48373ad1
carolinajimenez26/Competitive-programming
CodeForces/contests/1359/A.cpp
#include <iostream> using namespace std; int Ceil(int a, int b) { int ans = a / b; ans += (a % b == 0 ? 0 : 1); return ans; } int main(void) { int tc; cin >> tc; while (tc--) { int cards, jokers, players; cin >> cards >> jokers >> players; int ans = 0; if (jokers != 0) { int cards_pe...
ALGO
0.999601
3.914482
{ "github_metadata": { "branch": "master", "commit_count": 299, "repo_created_at": "2019-07-28T18:33:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7e34c38a...
92fa2353-8bbf-4433-ae13-d12c7fce3837
AnasImloul/Leetcode-Solutions
scripts/algorithms/R/Remove Max Number of Edges to Keep Graph Fully Traversable/Remove Max Number of Edges to Keep Graph Fully Traversable.cpp
// Runtime: 1580 ms (Top 6.50%) | Memory: 171.4 MB (Top 19.88%) class Solution { public: vector < int > Ar , Ap , Br , Bp; // alice and bob parent and rank arrays static bool cmp(vector < int > & a , vector < int > & b){ return a[0] > b[0]; } // lets create the alice graph first // find funct...
ALGO
0.999919
4.917243
{ "github_metadata": { "branch": "main", "commit_count": 5405, "repo_created_at": "2022-08-07T11:14:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 382, "forks": 120, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "91b4e...
7bb7fde7-c669-4aa1-9860-69d5a725e1f2
thyagostall/competitive
programming_challenges/chapter2_data_structures/uva110205.cpp
#include <iostream> #include <string> #include <sstream> #define DECK_SIZE 52 using namespace std; string *get_extended_card(int i) { string *result = new string; int value; char suit; if (i < 13) suit = 'C'; else if (i < 26) suit = 'D'; else if (i < 39) suit = '...
TEST
0.979686
4.390923
{ "github_metadata": { "branch": "master", "commit_count": 182, "repo_created_at": "2017-02-13T04:14: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": "d2dab7d7...
63c97a2c-e551-41b4-9411-7082b505004e
alex2835/course_work
image_processing/image_processing/gen_alg.cpp
std::vector<int> image_windows; std::wstring gen_log; // code unsigned int grayencode(unsigned int g) { return g ^ (g >> 1); } unsigned int graydecode(unsigned int gray) { unsigned int bin; for (bin = 0; gray; gray >>= 1) { bin ^= gray; } return bin; } template <typename Image_type> struct image_bread { ...
ALGO
0.999535
4.165231
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2020-01-21T14:42: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": "019bb9f72...
0bcec268-a4cd-4721-8418-aecf1d1307ec
raincross7/code-similarity
codes/train_code/problem312/problem312_118.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long ll mod = 1e9+7; int main(){ int N, M; cin >> N >> M; vector<ll> S(N+1, 0), T(M+1, 0); for (int i = 1; i <= N; i++) cin >> S[i]; for (int i = 1; i <= M; i++) cin >> T[i]; vector<vector<ll>> dp(N+1, vector<ll>(M+1, 0)); for (...
ALGO
0.999998
4.844501
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07: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": "e0a28ae25bd7...
c11ba054-7f20-46f3-b9d0-5d27b72555b6
Striletchi-Vlad/pregatire-bac-alex
probleme_scrise_alex/t17_s3_e2.cpp
/* Într-un text cu cel mult 10^2 caractere cuvintele sunt formate din litere mici ale alfabetului englez și sunt separate prin câte un spațiu. Scrieți un program C/C++ care citește de la tastatură un text de tipul menționat, pe care îl modifică în memorie, duplicând fiecare cuvânt format numai din vocale. Cuvântul dupl...
ALGO
0.9963
3.323679
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2024-04-04T16:10: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": "555c69fd5a...
374d5532-7afd-4510-81ba-4e3267d2c952
savish28/CP
contests/home 1/cf div3/6.cpp
#include<bits/stdc++.h> #define ll long long int using namespace std; #define mod 1000000007 #define pb push_back #define ff first #define ss second #define mp make_pair #define f(p,n) for(ll i=p;i<n;i++) ll exp(ll a,ll b,ll m); map< ll , vector< pair<ll,ll> > > sb; int main() { ios::sync_with_stdio(false); cin.tie(0...
ALGO
0.999973
3.038102
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-05-14T11:49: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": "de9ca8864c...
d52b527f-74e7-4225-9d2d-8b8a0833091c
WhiZTiM/coliru
Archive2/29/3c30ce6dd2a732/main.cpp
#include <iostream> #include <string> #include <sstream> #include <iterator> #include <algorithm> std::vector<int> ints_in_reverse( const std::string& str ) { std::istringstream stm(str) ; // input stringstream to read from the line // create a vector containing inters in the line (left to right) using it...
ALGO
0.99786
4.975239
{ "github_metadata": { "branch": "master", "commit_count": 42630, "repo_created_at": "2016-04-21T16:34:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d69394...
cf9d151c-d69b-4563-bf1e-732b9f66f2ad
OE-Heart/AlgoCode
剑指Offer-II/剑指Offer-II-001-整数除法.cpp
#include <iostream> #include <cassert> using namespace std; class Solution { public: int divide(int a, int b) { if (a == -2147483648 && b == -1) { return 2147483647; } int tag = 0; if (a >= 0) { a = -a; tag++; } if (b >= ...
ALGO
0.99955
4.899255
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2022-01-11T09:51: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": "c3fc85586...