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
edca9a9d-83fa-43f4-b72f-4f39f7ffe560
gw3691/leetcode_cpp
leetcode/1025. Divisor Game.cpp
class Solution { public: bool divisorGame(int N) { return N % 2 == 0; } }; /* Mathematical Induction Prove (Bottom-up) N = 1, lose directly N = 2, will win choosing x = 1. N = 3, must lose choosing x = 1. N = 4, will win choosing x = 1. .... For N <= n, we have find that: If N is even, can win. If N i...
ALGO
0.999969
4.743534
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2020-06-07T08:18:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a89659a131...
33bfc02e-2d42-4047-b774-2b76ae9b7a7f
LazySeaSeal/Problems
DS/segmentTree.cpp
#include <bits/stdc++.h> using namespace std; int merge(int a, int b) { return max(a, b); } void build(vector<int> &v, vector<int> &tree, int n) { for (int i = 0; i < n; i++) tree[i + n] = v[i]; for (int i = n - 1; i > 0; i--) tree[i] = merge(tree[i * 2], tree[i * 2 + 1]); } void update(vec...
ALGO
0.999919
4.837594
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-07-22T12:34: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": "ad7bc610bd95...
ad6f90fd-76eb-461c-9abf-1fe76bc89832
mosaicresearch/Click-AODV
elements/aodv/aodv_lookuproute.cc
/* * AODVLookUpRoute.{cc,hh} -- determine wether we know a route * <NAME> * */ // ALWAYS INCLUDE <click/config.h> FIRST #include <click/config.h> #include <click/confparse.hh> #include <click/error.hh> #include <click/packet_anno.hh> #include <clicknet/ip.h> #include "aodv_lookuproute.hh" CLICK_DECLS AODVLookUpR...
TOOL
0.938755
5.992012
{ "github_metadata": { "branch": "master", "commit_count": 9050, "repo_created_at": "2009-11-26T15:08:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 3, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "e29b1dea...
0ecf5194-28b6-4966-b7c0-aea8387df6dc
Ionizing/pintia
PAT Basic Level/1035.cpp
#include <iostream> //#include <fstream> using namespace std; int main() { // ifstream in("in.txt"); // cin.rdbuf( in.rdbuf() ); int N; cin >> N; int *Orig = new int[N]; for(int i=0; i!=N; ++i){ cin >> Orig[i]; } int *tmp = new int[N]; for(int i=0; i!=N; ++i){ cin >> ...
ALGO
0.999997
3.884202
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2017-03-30T08:25: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": "b17559d59...
351d0e11-f5d1-49f0-bb10-f3b51ca119fc
lee-jeong-geun/ps
codeforce/global_round_4/D.cpp
#include <bits/stdc++.h> using namespace std; vector<pair<int, int>> vec; int n, prime[2005]; /* 우선 주어진 노드들을 둥글게 연결 시킨다. (1, n), (1, 2), (2, 3), .... (n-1, n)이랑 연결을 한다. 연결한 간선이 소수가 아니라면 (1, n-1), (2, n-2), ... 이러한 연산을 소수가 될 때까지 계속 하면 된다. */ int main() { //에라토스 테네스 체 for(int i = 2; i < 2005; i++) { ...
ALGO
0.999426
3.81903
{ "github_metadata": { "branch": "master", "commit_count": 693, "repo_created_at": "2017-10-14T13:45:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71706992...
7132018a-19ed-4464-b109-7c762bc6bb05
VitorRolim/Faculdade
pacote-download/Exercicios(C)/Estrutura de Dados exercicios(C)/Binario_pilha.cpp
#include <stdio.h> #include <stdlib.h> #define TAM_VET 32 //32 bits #define VERD 1 #define FALSO 0 #define ERRO -1 void inic_Pilha(int &Topo){ Topo=-1; } int pilha_vazia(int Topo){ if(Topo==-1)return (VERD);return (FALSO); } int pilha_cheia(int Topo){ if(Topo==TAM_VET-1)return (VERD);return(FALSO); } int empilhar_Pi...
ALGO
0.998694
3.150123
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-05-23T03:27:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "516d6939d18f...
598d6eee-be3b-47c4-905f-248d472f65e0
NamYunje2002/algorithm
Boj_C++/2660.cpp
#include <bits/stdc++.h> using namespace std; int vis[55]; vector<int> adj[55]; bool cmp(pair<int, int> &v1, pair<int, int> &v2) { if (v1.first == v2.first) return v1.second < v2.second; return v1.first < v2.first; } int main() { int n; cin >> n; while (1) { int a, b; cin >> a >> b; i...
ALGO
0.999932
3.697548
{ "github_metadata": { "branch": "main", "commit_count": 195, "repo_created_at": "2024-03-08T07:03:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3dada4f5d2...
729a2a48-f605-40b6-8fc0-e3c950d7f05b
Kaivalya4/my-cpp-data
Learning/LUV/PreComputation/2_Unoptimised.cpp
/* Ginen array a of N integers. Given Q queries, and in each query given a number x , print count of that number in array. Constraints : 1<=N<=10^5 1<=a[i]<=10^7 1<=Q<=10^5 Testcase:ip 6 op : 1 3 5 5 7 7 8 2 5 2 3 1 7...
ALGO
0.999876
4.399937
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-08-29T04:07: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": "24a69b801856...
a868a011-47f0-48cd-90a3-e145b56eca31
Y-Sindo/graphics-maze
generateMaze.cpp
# include <algorithm> # include <iostream> # include <utility> # include <vector> # include "generateMaze.h" # include <time.h> using namespace std; const int neigh[4][2] = { { 0,1 },{ 0,-1 },{ 1,0 },{ -1,0 } }; void pushNeighbors(int u, int v, int H, int W, vector<vector<int>>& seen, vector<pair<int, int>>& edges)...
ALGO
0.998476
4.114216
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2016-01-02T04:36:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "083836b36...
dacc3123-b50d-48b8-aeb1-7e5c8e69b8d9
en30/online-judge
atcoder/arc101_a.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, N) for (int i = 0; i < (int)N; i++) int main () { int N, K; cin >> N >> K; vector<int> x(N); rep(i,N) cin >> x[i]; int ans = 1e9; for(int i = 0; i + K - 1 < N; i++) { int l = x[i]; int r = x[i+K-1]; if(r <= 0) ...
ALGO
0.999969
4.244488
{ "github_metadata": { "branch": "master", "commit_count": 330, "repo_created_at": "2019-06-07T02:18: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": "83d7ed79...
0c2d98cd-f122-417d-9fcb-d7ee7fbfc5cc
dante329/Cpp_develop
背包问题练习/P1064 金明的预算方案 草稿.cpp
//草稿 //#include<iostream> //#include<vector> // //using namespace std; // //const int N = 70, M = 4e4 + 10; // //int n,m; // //int f[N][M]; // //int cnt; //统计有多少个主件 //int a[N]; //主件的价格 //int ap[N]; //主件重要度 ////vector<PII> b[N]; //附件的<价格,重要度> // //int b[N]; //主件附件合并后的价格 //int bp[N]; //int pos; // //bool st[N]; //标记哪...
ALGO
0.999923
3.76303
{ "github_metadata": { "branch": "main", "commit_count": 122, "repo_created_at": "2024-12-17T08:02: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": "a74d455ebf...
699843e4-e0a8-481f-b3e9-2d8ed79157b6
saiyedalitaha/SE_Assignment_2
module 3/armstrong_using_loop.cpp
//12.Program of Armstrong Number in C Using For Loop & While Loop #include <stdio.h> #include <math.h> int main() { int number, originalNumber, remainder, result = 0, digits = 0; // Input a number from the user printf("Enter an integer: "); scanf("%d", &number); originalNumber = number; // C...
ALGO
0.999922
3.841109
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-10-22T06:54: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": "9e01a0111708...
1abea6c5-67f6-4788-9dbf-66425c03227b
eloch216/oscillator-based-circadian-clock-analysis
biocro/src/system_solver_library/homemade_euler.h
#ifndef HOMEMADE_EULER_H #define HOMEMADE_EULER_H #include "../system_solver.h" // A class representing our homemade euler solver template <class state_type> class homemade_euler_solver : public system_solver { public: homemade_euler_solver( double step_size, double rel_error_tolerance, ...
ALGO
0.993077
6.983513
{ "github_metadata": { "branch": "main", "commit_count": 71, "repo_created_at": "2021-03-04T18:28:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fcd1d982b31...
581d1a4d-355a-4991-8e4c-f310ec453903
Nhatthang27/CompetitiveProgramming
Practice/GraphFest01-FPTUHCM-250111/B3_TheTagGame.cpp
#include <bits/stdc++.h> #define int long long using namespace std; void solve() { int n, x; cin >> n >> x; x--; vector<vector<int>> adj(n); for (int i = 0; i < n - 1; i++) { int u, v; cin >> u >> v; u--, v--; adj[u].push_back(v); adj[v].push_back(u); ...
ALGO
0.999702
4.300204
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-08-27T03:40: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": "ea887a60d1c9...
7850dc5e-cd84-44ac-a14e-be2cd18865f7
NaNAGISaSA/leetcode
src/0324_wiggle_sort_two/solution.cc
#include "0324_wiggle_sort_two.h" #include <algorithm> namespace leetcode::wiggle_sort_two { /* * 算法思路:首先找到数组中的中位数(使用quick select可以做到平均O(N)的时间复杂度), * 随后对数组中的数进行重新调整,其基本规则可如下所示: * 1)大于中位数的数从左向右依次放置,从第一个奇数index开始; * 2)小于中位数的数从右向左依次放置,从最后一个偶数index开始。 * * TODO:本题可以in-place做到空间复杂度O(1)。 */ void Solution::wiggle_s...
ALGO
0.999999
5.945131
{ "github_metadata": { "branch": "master", "commit_count": 440, "repo_created_at": "2020-07-29T08:14:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5415b211...
6cdf226e-9165-4aff-9946-00f7ab073c5d
AndersonKao/CP_Problems
APCS/1061028/1061028APCSproblem4.cpp
#include <iostream> using namespace std; struct minpowertex { int power; int tex; }; int main() { int budgetnum; cin >> budgetnum; int bweight[budgetnum]; int bttimes[budgetnum]; int allweight = 0; for(int i = 0; i < budgetnum; i++) { cin >> bweight[i]; allweight+=bw...
ALGO
0.999973
3.111484
{ "github_metadata": { "branch": "master", "commit_count": 244, "repo_created_at": "2022-01-23T04:16:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "642962c1...
d5b2d3d3-608b-4abe-8718-5dc197ac94e2
sanils2002/Leetcode-DSA
2409-count-days-spent-together/2409-count-days-spent-together.cpp
class Solution { public: int countDaysTogether(string arriveAlice, string leaveAlice, string arriveBob, string leaveBob) { vector<int> months = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; string st = max(arriveAlice, arriveBob), en = min(leaveAlice, leaveBob); int startmn, ...
ALGO
0.999978
4.990712
{ "github_metadata": { "branch": "main", "commit_count": 3127, "repo_created_at": "2022-07-12T14:34: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": "8bbe8b9e6...
5d8639c0-b9cf-40ba-ab5e-5ac3b489a3e8
VeriumReserve/verium
src/crypto/scrypt.cpp
/* * Copyright 2009 <NAME>, 2011 ArtForz, 2011-2014 pooler * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice...
ALGO
0.998767
6.088019
{ "github_metadata": { "branch": "master", "commit_count": 21839, "repo_created_at": "2018-02-06T22:26:52.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "bitcoin/bitcoin", "stars": 19, "forks": 11, "issues": 6, "pull_requests": 1 }, "file_meta": { "conten...
47e18b85-30cb-4ec6-a68c-4fce8b77ea8c
akhikolla/testpackages
fuzzedpackages/HTLR/src/utils.cpp
#include "utils.h" double log_sum_exp(const arma::vec &a) { double m = a.max(); return log(accu(arma::exp(a - m))) + m; } // [[Rcpp::export]] arma::vec log_sum_exp(const arma::mat &A) { arma::colvec m = arma::max(A, 1); return arma::log( row_sum( arma::exp( A.each_col() - m ...
ALGO
0.99742
5.458332
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2021-01-15T17:42:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6332200ef8...
cfdf0e8d-dc54-4416-aef7-574f8f20a42e
juho-creator/CS-Courses
Notes/Algorithm_Code/binary_coefficient.cpp
#include <iostream> #include <vector> using namespace std; // Computes C(n, k): number of ways to choose k items from n // Binary Coefficient using divide & conquer (top bottom) - O(2^n) int bin_coeff_div(int n, int k){ if (k == 0 || k == n){ return 1; } else { return bin_coeff_div(n-1, k) ...
ALGO
0.999792
5.325425
{ "github_metadata": { "branch": "main", "commit_count": 111, "repo_created_at": "2024-01-20T04:02: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": "a75a291fc4...
2334c6c6-ee83-4618-bded-9f1dbc8b3345
chiragxarora/Data-Structures-and-Algorithms
Advanced/Recursion/findInArray.cpp
#include <iostream> #include <algorithm> using namespace std; // Given an array find a number's first occurence, last occurence, all occurences int firstOccurence(int arr[], int idx, int n, int key){ if(idx == n){ return -1; } if(arr[idx] == key){ return idx; } int ans = firstOccu...
ALGO
0.999611
4.138934
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-08-07T21:14:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71ea83ca6d...
a47258df-6059-4444-9c9f-64756b2e4542
donbasta/competitive-programming
submissions/online-judges/spoj/MEANARR.cpp
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using ll = long long; using ld = long double; using oset = tree<pair<ll, int>, null_type, less<pair<ll, int>>, rb_tree_tag, tree_order_statistics_node_update>; const...
ALGO
0.999443
4.298675
{ "github_metadata": { "branch": "master", "commit_count": 175, "repo_created_at": "2018-10-17T04:26:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9e9cc2e2...
b240ac1b-6ff4-4f85-88e0-72adcae5a46d
shahincsejnu/competitive-programming-solutions
Codeforces Solutions/1385A.cpp
#include <bits/stdc++.h> #define lli long long int using namespace std; int main() { int t; cin >> t; while(t--){ int x, y, z; cin >> x >> y >> z; int arr[] = {x, y, z}, flag = 0; sort(arr, arr+3); for(int i = 0; i < 3; i++){ for(int j = 0; j < 3; j++...
ALGO
0.999938
4.495317
{ "github_metadata": { "branch": "master", "commit_count": 158, "repo_created_at": "2020-07-21T07:33:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "41d0dfb8...
bb11e10a-a2e8-44ea-8080-2c98dc85231c
tsvdh/AcceleratedVolRenderer
src/pbrt/graph/free/free_lighting_calculator.cpp
#include "free_lighting_calculator.h" #include "pbrt/lights.h" #include "pbrt/options.h" #include "pbrt/util/progressreporter.h" namespace graph { FreeLightingCalculator::FreeLightingCalculator(Graph& graph, const util::MediumData& mediumData, Vector3f inDirection, Sampler sampler, const LightingCalculatorCo...
ALGO
0.990438
5.992291
{ "github_metadata": { "branch": "master", "commit_count": 1467, "repo_created_at": "2024-04-29T07:58:44.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "mmp/pbrt-v4", "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": ...
6ef23d22-3830-4873-bcb4-e8c85bbe92ed
1xingao/1xingao
cpp/sudoku.cpp
#include<vector> #include<iostream> using namespace std; class Solution { public: bool isValid(int row,int col,char c,vector<vector<char>> board) { for(int i=0;i<9;i++){ if(c == board[row][i]){ return false; } } for(int i=0;i<9;i++){ ...
ALGO
0.99972
5.880864
{ "github_metadata": { "branch": "main", "commit_count": 192, "repo_created_at": "2021-05-27T08:42: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": "acbf7e6f97...
673df83b-55a0-4127-a823-ddd28ce95d93
sandalisingh/AES-Encryption-Algorithm
AES.cpp
#include "AES.h" AES::AES(AESKeyLength keyLength) { this->NoOfCols = 4; switch (keyLength) { case AESKeyLength::AES_128: this->NoOfWordsInKey = 4; this->NoOfRounds = 10; break; case AESKeyLength::AES_192: this->NoOfWordsInKey = 6; this->NoOfRounds = 12; break; case A...
ALGO
0.988101
5.290691
{ "github_metadata": { "branch": "HOME.html", "commit_count": 1, "repo_created_at": "2023-05-07T04:42: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": "8bc4e62...
660ec46d-bb11-47de-b2ef-e05eff76719a
holmeszheng2008/Programming-Knacks
Data Structure and Algorithm/linkedlist operations.cpp
#include<iostream> #include <stdlib.h> using namespace std; class LinkedList { private: struct node //listnode { int data; node*next; }*head; public: LinkedList() //constructor { head=NULL; } void createList(); void i...
ALGO
0.999799
3.893637
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2017-01-15T12:01: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": "97327ff349...
3f7e7e6d-74e8-4f83-8bc4-ef9937fc61f4
DeanZr/depth_rendering
src/MinimumDistanceVisualisation.cpp
#include "MinimumDistanceVisualisation.h" // Draws minimum distance vector on given frame void drawMinimumDistVector(Mat& frame, const vector<Point>& tooltip_coords, const double& dist) { // Check there is at least one tooltip and target in frame if (tooltip_coords.size() != 2) { return; } Po...
ALGO
0.942589
5.846458
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-11-08T13:27:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a6514c601309...
417c7b4f-dc83-4db2-82cc-cfb9a53731a5
hsetlik/ReverbMachine
plugin/source/SpaceMod.cpp
#include "ReverbMachine/Audio/SpaceMod.h" #include "ReverbMachine/Audio/IIR.h" #include "ReverbMachine/Identifiers.h" SpaceMod::SpaceMod() {} void SpaceMod::init(double sampleRate) { // init the preDelay line preDelay.init((uint16_t)(sampleRate / 10.0)); // set the input low-pass filter auto lpParams = *input...
ALGO
0.961233
6.586583
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2025-03-01T20:09: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": "75687681047...
405dafd3-1cb2-4d98-aeea-e3ddbb4ec168
kgoel9899/CF_Solutions
codeforces/1451/A.cpp
#include<bits/stdc++.h> using namespace std; #define MOD 1000000007 #define mod 998244353 #define int long long // #define ll long long #define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" const int INF = 1e18; // const int N = 1e7 + 5; // vector<int> sieve(N, 1), fact(N); // vector<int> a(N...
ALGO
0.999899
3.79341
{ "github_metadata": { "branch": "master", "commit_count": 1962, "repo_created_at": "2020-12-21T08:58: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": "4f74e9d...
f71b5ed5-aefa-425d-a2e6-c17d56c5b145
MostafaOmar98/competitive-programming
UVA/662-UVA-Fast Food-DP-WA.cpp
#include<bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> // Common file //#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update using namespace std; //using namespace __gnu_pbds; //typedef tree< // pair<int, int>, // change type // null_type, // less<pair<in...
ALGO
0.999902
3.536181
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2019-03-12T02:04: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": "faf35c38e...
8cf65aa6-19f4-43ae-8006-89ed17aca934
tranhuy105/hocdot
array/product_except_self.cpp
#include <iostream> #include <vector> #include <unordered_map> using namespace std; // my bad solution lmao vector<int> productExceptSelfa(vector<int>& nums) { int n = nums.size(); vector<int> prefix(n), suffix(n); prefix[0] = nums[0]; suffix[n - 1] = nums[n - 1]; for (int i = 1; i < n; i++) { ...
ALGO
0.999971
5.296747
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2024-09-18T09:11: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": "6f267b6e17f8...
3a4c2ecd-65e6-4caf-b255-b60e59000379
AgileTrossDev/codesignals
c_plus_plus/external_challenges/countingValleys/build_lib_or_road/build_lib_or_road/build_lib_or_road/main.cpp
// // main.cpp // build_lib_or_road // // Created by <NAME> on 1/6/19. // Copyright © 2019 <NAME>. All rights reserved. // #include <iostream> #include <vector> #include <stack> #include <set> using std::vector; using std::stack; using std::cout; using std::set; using std::endl; typedef vector<vector<int>> inpu...
ALGO
0.99975
4.700791
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2018-12-14T21:24: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": "a1ca9fcb9...
6af00dae-91a8-4170-b1b7-3f7f3dd1f509
MagaDaur/University
3-ий курс/СППР/3.cpp
#include <vector> #include <iostream> double f(double, double); struct Vector2D { double x{}; double y{}; double calc() { return f(x, y); } void operator=(const Vector2D& other) { x = other.x; y = other.y; } friend std::ostream& operator<<(std::ostream& to, const Vector2...
ALGO
0.999876
5.103292
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2023-09-06T20:00: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": "026cf39be...
fe4e833f-380d-4f0c-a913-92c11fbf40e1
Scanel-sys/STree-reading-vars
Source.cpp
#include <iostream> #include <cstdio> #include <cstdlib> using namespace std; struct node { char id[256]; int count; node *lch; node *rch; }; class SplayTree { public: node *Root; void initST() { Root = NULL; } node *RR_ROTATE(node * Node1) { node *Node2 = ...
ALGO
0.999161
3.117463
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2022-07-28T22:31: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": "4d90b7b2b8b...
c17f7e6b-b146-4a22-ae30-01af3daa0a89
suraj-iitb/algorithm-identification
BERT/Data_Dump/Insertion/C++/Code/insertion4148167.cpp
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 100; int main() { int A[MAX], N; int key; cin >> N; for ( int i = 0; i < N; ++i ) cin >> A[i]; for ( int i = 0; i < N; ++i ) { key = A[i]; int j = i - 1; while ( j >= 0 && A[j] > key ) { ...
ALGO
0.999985
4.363411
{ "github_metadata": { "branch": "main", "commit_count": 229, "repo_created_at": "2020-05-24T06:21:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 2, "pull_requests": 10 }, "file_meta": { "content_id": "a30b347e5...
73bee808-e5a6-429e-8291-712335ec5c61
raincross7/code-similarity
codes/train_code/problem024/problem024_103.cpp
// includes #include <bits/stdc++.h> // macros #define ll long long int #define pb emplace_back #define mk make_pair #define pq priority_queue #define FOR(i, a, b) for(int i=(a);i<(b);++i) #define rep(i, n) FOR(i, 0, n) #define rrep(i, n) for(int i=((int)(n)-1);i>=0;i--) #define irep(itr, st) for(auto itr = (st).begin...
ALGO
0.999992
3.153802
{ "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": "f8875d023cf9...
cb7c66d1-4488-41e3-aed8-04e6e7a0c72c
idiap/particle_person_tracker
3rdparty/vfoa/src/vfoa_target.cc
/** * @file src/vfoa_target.cc * @date 07 March 2013 * @author <NAME> <<EMAIL>> * @author <NAME> <<EMAIL>> * * @brief Class to describe a target of visual focus of attention * * Copyright (C) 2011-2012 Idiap Research Institute, Martigny, Switzerland * * See COPYING file for the complete license text. * */ ...
TOOL
0.921398
5.852935
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2020-10-12T07:35:03.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "81d4f8107e1b5...
6ad7b79f-dbfb-4495-9f55-76df732141f6
LTDigor/Sparse-matrix
SparseMatrix/main.cpp
#include <iostream> #include <cmath> #include "sparse_matrix.h" int main() { spr_mrx::row* matrix = nullptr; spr_mrx::row* matrix_sorted = nullptr; int row_quantity, column_quantity; std::cout << "Enter the number of rows in the matrix: "; std::cin >> row_quantity; std::cout << "Enter the num...
TOOL
0.991738
3.948283
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-11-12T06:12: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": "591dd70b8adc...
0f663c22-c065-4b1b-aa58-7f21932b495e
medvedevgroup/vargeno
src/Count.cc
#include "Count.h" #include "Kmers.h" #include "BF.h" #include <jellyfish/mer_dna_bloom_counter.hpp> #include <jellyfish/file_header.hpp> #include <sdsl/bit_vectors.hpp> #include <jellyfish/mer_dna.hpp> #include <jellyfish/thread_exec.hpp> #include <jellyfish/hash_counter.hpp> #include <jellyfish/stream_manager.hpp> #...
ALGO
0.967685
5.862393
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2017-12-23T05:46:36.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 21, "forks": 4, "issues": 5, "pull_requests": 1 }, "file_meta": { "content_id": "7583c034d...
5e69ae77-8ca9-4719-9d3f-5c59118b331e
Kevin-Rau/algorithms
C++/Sorting.cpp
/** * @mainpage Sorting.cpp * @authors <NAME> * With Modifier <NAME> * @date 11/17/2014 * @section intro Introduction * Homework for Doxygen to generate documentation * Sorting.pp C++ file for sorting intergers * * @section body Homework Questions * 1. used Single Row Comments for the top for Na...
ALGO
0.999946
5.058776
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-12-11T03:04: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": "e6aa618358...
4b543c41-436b-4e2c-bb45-30f113b68bb8
samirakhtar/CRYPTO-LAB
crypto/substitution mono cipher.cpp
#include <iostream> #include <string> #include <map> std::string encrypt(std::string message, const std::map<char, char>& key) { std::string encrypted; for (char c : message) { // If the character is in the key, replace it with the corresponding cipher character std::map<char, char>::const_iter...
ALGO
0.999952
5.33726
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-05-03T17:27:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "93d7e0df642b...
d88f485b-93fe-484d-a458-d5c5640915d3
poon-zx/codeforces
Round 1013 (Div. 3)/A.cpp
#include <algorithm> #include <array> #include <bitset> #include <climits> #include <cmath> #include <cstddef> #include <cstdint> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <ios> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <map> #inclu...
ALGO
0.999963
4.864763
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2025-02-08T13:36: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": "c71578b25d3...
1b3dfb23-6d91-46a7-a54e-18dddfb068de
shanice-l/gdrnpp_bop2022
core/csrc/flow/src/flow_cpu.cpp
#include <torch/extension.h> #include <vector> template <typename scalar_t> void flow_kernel(const int nthreads, const scalar_t *depth_src, const scalar_t *depth_tgt, int height, int width, const scalar_t* KT, const scalar_t* Kinv, scalar_t* flow, sca...
DATA
0.927127
5.961763
{ "github_metadata": { "branch": "main", "commit_count": 70, "repo_created_at": "2022-10-15T08:40:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 277, "forks": 57, "issues": 24, "pull_requests": 1 }, "file_meta": { "content_id": "d401a7c...
f88c6380-7f88-496f-8956-97a8c852d3d6
Jyotika25/DSA-SDE
Day 3 Arrays-Maths/Majority Element II.cpp
// brute approach //tc : O(NlogN) //sc : O(N) class Solution { public: vector<int> majorityElement(vector<int>& nums) { unordered_map<int,int> m; for(int i=0;i<nums.size();i++){ m[nums[i]]++; } vector<int> result; for(auto it : m){ i...
ALGO
0.999994
5.62986
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2020-08-18T07:03: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": "03228f122...
c2b652a1-a23d-4e50-a36b-767122c842f7
austinmccoy6251/CS-171
hw0/Part3/main.cpp
#include <iostream> #include <cstdio> #include <fstream> #include <string> #include <sstream> #include <cstdlib> #include <vector> #include <Eigen/Dense> #include <cmath> using namespace std; /* Important structs */ struct Vertex { float x, y, z; }; struct Face { int v1, v2, v3; }; struct Object { vecto...
TOOL
0.949177
4.661635
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2021-11-22T12:38:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4274c8c47...
9bc5e329-4b1f-4b93-9fd6-8e6bc9796c60
cthornsb/OtterEngine
source/vector3.cpp
#include <iostream> #include <cmath> #include "vector3.hpp" const vector3 zeroVector(0, 0, 0); const vector3 unitVectorX(1, 0, 0); const vector3 unitVectorY(0, 1, 0); const vector3 unitVectorZ(0, 0, 1); vector3& vector3::operator = (const vector3 &rhs){ x = rhs.x; y = rhs.y; z = rhs.z; return (*this); } vector3...
TOOL
0.951522
5.535627
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2019-09-04T19:17: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": "ea4cf79af...
60416715-46bc-40b2-8bbc-c58b87e7ed67
jarrodmillman/scipy
scipy/optimize/_highs/src/simplex/HDual.cpp
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* This file is part of the HiGHS linear optimization suite */ /* */ /* Written an...
ALGO
0.998052
5.714408
{ "github_metadata": { "branch": "main", "commit_count": 26552, "repo_created_at": "2011-03-15T01:52:39.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "scipy/scipy", "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "...
f2e06a1b-9a3b-4269-8517-d082a008344e
lightjameslyy/lt-cpp
leetcode-clion/tree/bfs/107.binary-tree-level-order-traversal-ii.cpp
/* * @lc app=leetcode id=107 lang=cpp * * [107] Binary Tree Level Order Traversal II * * https://leetcode.com/problems/binary-tree-level-order-traversal-ii/description/ * * algorithms * Easy (48.74%) * Total Accepted: 256.8K * Total Submissions: 527K * Testcase Example: '[3,9,20,null,null,15,7]' * * Gi...
ALGO
0.999994
6.473219
{ "github_metadata": { "branch": "master", "commit_count": 405, "repo_created_at": "2018-04-10T09:21: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": "29afb068...
833fbf8c-a6ef-473a-ae39-bdbe9a6ba6aa
libretro/mame2016-libretro
src/lib/netlist/solver/nld_matrix_solver.h
// license:GPL-2.0+ // copyright-holders:Couriersud /* * nld_matrix_solver.h * */ #ifndef NLD_MATRIX_SOLVER_H_ #define NLD_MATRIX_SOLVER_H_ #include "solver/nld_solver.h" #include "plib/pstream.h" #include <type_traits> NETLIB_NAMESPACE_DEVICES_START() class terms_t { P_PREVENT_COPYING(terms_t) public: ATTR_...
ALGO
0.994463
5.733643
{ "github_metadata": { "branch": "master", "commit_count": 44430, "repo_created_at": "2017-01-20T23:15:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 36, "forks": 40, "issues": 29, "pull_requests": 3 }, "file_meta": { "content_id": "1532...
77a4d19e-1dd2-443f-a26e-f4c16c43be4d
ngongocthinh159/cp-practice
codeforces/D-set/D_Water_Tree.cpp
/** * Author: <NAME> * Solution for: https://codeforces.com/problemset/problem/343/D */ #include<bits/stdc++.h> using namespace std; #define nline '\n' #define ll long long #define MOD 1000000007 #define MOD1 998244353 #define LINF ((long long)1e18) #define IINF ((int)1e9) #define fastio() ios_base::sync_with_stdi...
ALGO
0.999864
5.072005
{ "github_metadata": { "branch": "main", "commit_count": 255, "repo_created_at": "2023-06-26T04:12:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a6b0804508...
24366b93-e32b-4689-927d-e5768153a541
Priyo002/DSA
TLE-CP-Sheet/1200/1433D-Districts_Connection.cpp
#include<bits/stdc++.h> using namespace std; #define int long long #define pb emplace_back #define setbits(x) __builtin_popcountll(x) #define zerobits(x) __builtin_ctzll(x) #define endl '\n' #define sort(X) sort(X.begin(),X.end()) const int mod = 1e9 + 7; const long long INF = 1e18; void init() { ios::sync_with_stdi...
ALGO
0.99998
4.157356
{ "github_metadata": { "branch": "master", "commit_count": 238, "repo_created_at": "2023-06-21T09:23:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "66b8ee03...
93752082-7ee3-41e2-a291-50b10916a8ac
trbabb/kalman
src/test.cpp
#include <iostream> #include <algorithm> #include <cmath> #include <random> #include <time.h> #include <geomc/function/Dual.h> #define SID_ACC 1 #define SID_VEL 2 #define SID_GYR 3 #define SID_MAG 4 #include "KalmanFilter.h" #include "Solver.h" #define OMEGA_PROCESS_VARIANCE 0.25 #define ACCEL_PROCESS_VARIAN...
ALGO
0.954174
5.735534
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-04-19T08:13:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e8156f896...
9339e774-dcff-4b39-9882-84adeb914711
ShinsuSenju/Practice-Questions
my-folder/2871-double-a-number-represented-as-a-linked-list/solution.cpp
class Solution { public: ListNode* reverseLink(ListNode* head) { ListNode* curr = head; ListNode* prev = nullptr; while (curr != nullptr) { ListNode* temp = curr->next; curr->next = prev; prev = curr; curr = temp; } return prev;...
ALGO
0.999946
6.092993
{ "github_metadata": { "branch": "main", "commit_count": 645, "repo_created_at": "2023-09-10T01:58: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": "5748f8ba8f...
44ce476e-d51b-4b36-b58d-039d06dafe65
kantv-ai/kantv
core/ncnn/ncnn-src/src/layer/riscv/convolution_pack1ton.h
// Tencent is pleased to support the open source community by making ncnn available. // // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. // // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy ...
ALGO
0.962004
4.755164
{ "github_metadata": { "branch": "master", "commit_count": 3087, "repo_created_at": "2021-05-27T11:02:56.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 168, "forks": 22, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6e4d9...
7736c01b-e702-46ed-8ba1-9c43d205ad3f
i-Zaak/tvb-pdde
src/mpi_history.cc
#include "mpi_history.h" distributed_global_history::distributed_global_history( std::vector< history_buffers* > history, std::size_t n_vars, neighbor_map_type recv_ids, neighbor_map_type send_ids): global_history(history), recv_ids(recv_ids), send_ids(send_ids) { this->step_id = 0; this->n_vars = n...
ALGO
0.939333
5.430212
{ "github_metadata": { "branch": "master", "commit_count": 166, "repo_created_at": "2015-12-06T16:15:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 7, "pull_requests": 0 }, "file_meta": { "content_id": "53991e78...
2ba22d36-ca4c-4106-82ee-43893ce9bf75
naamakashani/ex4
MinkowskiDistance.cpp
#include "MinkowskiDistance.h" // // Created by kashann on 16/11/2022. // #include<math.h> float MinkowskiDistance::computeDistance(vector<float> vector1, vector<float> vector2) { float sum = 0, x; int i; for (i = 0; i < std::min(vector1.size(), vector2.size()); i++) { x = abs(vector1[i] - vecto...
ALGO
0.999432
4.972997
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-01-09T13:24:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f09eb1ed18...
a7920308-3241-4779-ac3a-9052294a5923
sufykhan/Codeforces
quadeer2.cpp
#include <bits/stdc++.h> using namespace std; typedef long long intl; typedef vector<intl> vi; typedef pair<intl, intl> pi; #define F first #define S second #define pb push_back #define mp make_pair #define rep(i, a, n) for (intl i = a; i < n; i++) void FASTIO() { ios_base::sync_with_stdio(false); cin.tie(NUL...
ALGO
0.999949
4.130188
{ "github_metadata": { "branch": "master", "commit_count": 1977, "repo_created_at": "2021-03-14T14:29:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b3e7ae4...
bb790ed5-eec7-4074-9a34-48d775d519ff
Aashish-Raghav/MyCodes
DSA/Stack/deleteMiddle.cpp
#include <iostream> #include <stack> #include <vector> using namespace std; template <typename T> void printStack(stack<T> s) { cout << "Your Stack : "; while (!s.empty()) { cout << s.top() << " "; s.pop(); } cout << endl; } //approach 1; template <typename T> stack<T> deleteMid1(s...
ALGO
0.999629
5.353291
{ "github_metadata": { "branch": "main", "commit_count": 41, "repo_created_at": "2023-03-30T16:33:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "439f5113668...
397a8f86-5391-4b8b-b4e5-8c7ff1c201a8
lluc-palou/ap3-jutge
Exhaustive search/P33748.cc
/* =============================================================================== Description: This program reads a natural number m and n different words, and prints all the subsets of m elements that can be made up with the words. Input: Two natural numbers m and n, followed by n different words. Assume...
ALGO
0.999889
5.173148
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2023-10-03T15:31: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": "f2ecab70ed1...
720b9555-1a0b-4973-ab9c-7b4b7a32ba6a
jdehorty1/brainfish
movepick.cpp
/* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 <NAME> (Glaurung author) Copyright (C) 2008-2015 <NAME>, <NAME>, <NAME> Copyright (C) 2015-2017 <NAME>, <NAME>, <NAME>, <NAME> Stockfish is free software: you can redistribute it and/or modify it under the terms of t...
ALGO
0.991183
7.520993
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-09-13T08:36: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": "8f98f384a6...
88d1605b-8deb-44fc-8e27-14b16c949233
NitishShandilya/PracticeExercises
MergeSort.cpp
// // Created by <NAME> on 7/2/20. // // [3, 4, 4, 5, 1, 0, 7, 9, 10] #include "stdlib.h" #include "vector" #include "string" template <typename T> void merge(vector<T>& input, int begin, int mid, int end, vector<T>& helper) { for (int i = begin; i <= end; i++) helper[i] = input[i]; int helperLeft = ...
ALGO
0.999823
6.245634
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2020-07-12T22:01: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": "c5dacaa19...
fe8016b0-1620-4340-8d73-9ee071e3c8d9
AntonBerShag/Dz22
Dz22/Dz22.cpp
#include <iostream> using namespace std; template <typename T> void showArray(T arr[], int length); template <typename T> void swapNum(T arr[], int length); void degree(int *var, int num); int main() { setlocale(LC_ALL, "Russian"); //Задача 1 cout << "Задача 1\n"; int arr1[10] = { 1,2,3,4,5,6,7,8,9,10 }; cout ...
ALGO
0.997934
4.38271
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2022-03-11T09:11: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": "4ec7908a5c...
b913f538-9da3-44dc-a319-7ef38abc448f
TieWay59/tmplz
chunk2/字符串/PAM-回文串后缀-1.cpp
/** * @Source:myself * @Author: Tieway59 * @Complexity: $O(N)$ * @Description: * 输入长度为n的串S,求S的最长双回文子串T,即可将T分为两部分X,Y, * ∣X∣,∣Y∣≥1|X|,|Y|≥1∣X∣,∣Y∣≥1 且X和Y都是回文串。 * * 转化成枚举后缀拼接就很好做了。 * 思路是用PAM处理每个位置i的最长回文后缀,lb[i] (反向是rb[i]) * $ans = max(lb[i] + rb[i + 1])$ * * @Example: * baac...
ALGO
0.999943
4.16186
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2019-07-04T06:02:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 50, "forks": 4, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "ef36661e...
d8cbd943-1735-4c0f-8dae-0edaed8d3dd6
MarvinZZJ/WangDaoAlgorithmNotes
第6章:数学问题/6.6:矩阵与矩阵快速幂/test6-11递推数列.cpp
/* 习题6.11 递推数列(清华大学复试上机题) http://t.cn/AipbZ2sS */ #include <iostream> #include <cstdio> using namespace std; const int MAXN = 10; struct Matrix{ int row, col; int matrix[MAXN][MAXN]; Matrix(){} Matrix(int r, int c): row(r), col(c){} }; Matrix Multiply(Matrix x, Matrix y, int mod){ Matrix answe...
ALGO
0.999785
4.155731
{ "github_metadata": { "branch": "main", "commit_count": 200, "repo_created_at": "2021-01-08T04:14:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b955644424...
8aa6aad5-1f32-4dfa-b343-449cdf128714
copperspice/copperspice
src/xmlpatterns/expr/qnodesort.cpp
/*********************************************************************** * * Copyright (c) 2012-2025 <NAME> * Copyright (c) 2012-2025 <NAME> * * Copyright (c) 2015 The Qt Company Ltd. * Copyright (c) 2012-2016 Digia Plc and/or its subsidiary(-ies). * Copyright (c) 2008-2012 Nokia Corporation and/or its subsidiary(-ies)...
ALGO
0.975451
7.465351
{ "github_metadata": { "branch": "master", "commit_count": 3175, "repo_created_at": "2015-04-11T01:41:25.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1211, "forks": 122, "issues": 32, "pull_requests": 3 }, "file_meta": { "content_id": "c4...
2b52bf64-61f0-41c4-b58f-83c6c4467ff8
Hi1t0n/CodeWars
C++/Descending Order/Descending Order.cpp
/* * Your task is to make a function that can take any non-negative integer as an argument and return it with its digits in descending order. Essentially, rearrange the digits to create the highest possible number. Examples: Input: 42145 Output: 54421 Input: 145263 Output: 654321 Input: 123456789 Output: 987654321 ...
ALGO
0.999786
5.780946
{ "github_metadata": { "branch": "main", "commit_count": 77, "repo_created_at": "2023-09-24T19:59: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": "93892bd36b6...
b137fc83-565e-45fd-818a-933071428032
Israrkhan371/DSA_1
DSA_1/Question_2/main.cpp
#include <iostream> using namespace std; class Node { public: int data; Node* next; Node(int val) { data = val; next = NULL; } }; class LinkedList { private: Node* head; public: LinkedList() { head = NULL; } void insert(int data) { Node* newNode =...
ALGO
0.999727
6.301446
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-09-22T04:14: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": "e9d553b83892...
8a5266fa-191d-4073-92ab-c26649890fb6
brainstudio-team/NeMo
src/nemo/StdpProcess.hpp
#ifndef NEMO_STDP_PROCESS_HPP #define NEMO_STDP_PROCESS_HPP /* Copyright 2010 Imperial College London * * This file is part of NeMo. * * This software is licenced for non-commercial academic use under the GNU * General Public Licence (GPL). You should have received a copy of this * licence along with nemo. If no...
ALGO
0.978735
6.377293
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2016-04-01T14:48:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 9, "forks": 4, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "00b5ab3bfe...
258b548f-5f01-4ab9-8c1e-3fdfb9bdfdbe
AndroidBBQ/android10
frameworks/native/libs/math/include/math/mat2.h
/* * Copyright 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
TOOL
0.958101
6.337181
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2021-06-01T12:36:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 204, "forks": 69, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "e3d6caf70...
aff81e5f-3783-47bd-9d90-49604bba2a26
anirudhgupta03/Codechef
Graph/FIRESC.cpp
#include<bits/stdc++.h> using namespace std; #define mod 1000000007 #define ll long long void dfs(int node, vector<int> &vis, vector<int> al[], int &count){ vis[node] = 1; count++; for(int i = 0; i < al[node].size(); i++){ int child = al[node][i]; if(vis[child] ...
ALGO
0.999945
4.411008
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2020-12-25T10:09:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9041e47f43e...
ef80c074-1449-461a-a766-68252687801e
jaejunha/Baekjoon
2436.cpp
#include <stdio.h> #include <vector> #include <algorithm> #include <math.h> using namespace std; vector<pair<long long, pair<long long, long long>>> v; long long g, l; long long gcd(long long i, long long j) { long long r; long long a = max(i, j); long long b = min(i, j); while (b) { r = a % b; a = b; b =...
ALGO
0.999945
4.357455
{ "github_metadata": { "branch": "master", "commit_count": 174, "repo_created_at": "2018-01-09T02:29:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5bcbd664...
ca0ab0e2-7d4a-49be-93de-cd5b458ee2a3
enh6/leetcode
97.interleaving-string.cpp
class Solution { public: bool isInterleave(string s1, string s2, string s3) { int m = s1.length(); int n = s2.length(); if (m + n != s3.length()) { return false; } vector<vector<bool>> dp(m + 1, vector<bool>(n + 1, false)); dp[0][0] = true; for (in...
ALGO
0.999548
6.063394
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2018-06-29T05:51:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4bf088172...
c8cc55e4-6bfc-4c80-adf1-c933bd59d82e
raincross7/code-similarity
codes/train_code/problem047/problem047_76.cpp
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(N) for (int i = 0; i < N; i++) int main(){ int N; cin >> N; int arrival_time; int leave_time; vector<int> C(N-1); vector<int> S(N-1); vector<int> F(N-1); for (int i = 0; i < N - 1; i++){ cin >> C[i]...
ALGO
0.999902
3.60267
{ "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": "3348c96eb082...
b4a7eef6-61aa-45c2-aada-2bdf132fe6d1
hjwdzh/Manifold
3rd/igl/lim/lim.cpp
// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2014 <NAME> <<EMAIL>> // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. ...
ALGO
0.997971
5.860203
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2018-04-27T17:31:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 658, "forks": 77, "issues": 8, "pull_requests": 0 }, "file_meta": { "content_id": "7a0f00...
5aaaf1d3-e812-469d-8344-115c084ea1ee
scylladb/scylladb
column_computation.hh
/* * Copyright (C) 2019-present ScyllaDB */ /* * SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0 */ #pragma once #include "bytes.hh" #include <memory> class schema; class partition_key; struct atomic_cell_view; struct tombstone; namespace db::view { struct clustering_or_static_row; struct vie...
TOOL
0.934409
7.676994
{ "github_metadata": { "branch": "master", "commit_count": 48526, "repo_created_at": "2014-12-24T13:16:33.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 14677, "forks": 1388, "issues": 3257, "pull_requests": 335 }, "file_meta": { "content_i...
1e5633f0-cbb4-4d99-bf3b-e744f6f0a3d4
Yawn-Sean/Daily_CF_Problems
daily_problems/2025/02/0206/personal_submission/cf627b_WanderOvO.cpp
/* 参考洛谷的翻译 修复之前,每天只能生产 b,修复之后恢复到生产 a 的水平 单点增加,区间取 min 后求和 维护两棵线段树,一棵是对 b 取 min,一棵对 a 取 min 单点修改到底,至多加到临界值 查询时,只要在第一颗线段树中查前缀,第二颗线段树中查后缀即可 */ SegmentTree pre, suf; LL n, k, a, b, q; void meibao() { cin >> n >> k >> a >> b >> q; pre.init(n, b); suf.init(n, a); while (q--) { LL op; cin >> ...
ALGO
0.999648
4.418867
{ "github_metadata": { "branch": "main", "commit_count": 20410, "repo_created_at": "2024-02-26T01:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 478, "forks": 302, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "aaa5...
2e236c2e-9f51-4075-8d66-a1db4efc9441
methos-fisto/heuristic-impl1
src/Tour.cpp
#include "Tour.h" int myrandom(int i){ return std::rand()%i; } Tour::Tour(int taille, int seed) { // TODO Auto-generated constructor stub taille_ = taille; permutation_ = new int[taille]; permutation_[0] = 0; std::vector<int> shuffler; for(int i = 1 ; i < taille; i++) { shuffler.push_back(i); } std::srand...
ALGO
0.997357
3.745091
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2013-04-07T17:13: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": "c4d4b5e156...
304c8bb5-0ad9-4143-b573-d858a88ff4e6
RenanTashiro/URI
code/Estruturas e Bibliotecas/p-level-5/1696.cpp
/* Nome: <NAME> ID: 1696 Resposta: Accepted Linguagem: C++ (g++ 4.8.5, -std=c++11 -O2 -lm) [+0s] Tempo: 0.652s Tamanho: 1,85 KB Submissao: 23/01/18 10:51:46 */ #include <bits/stdc++.h> using namespace std; int main() { int T; cin >> T; for(int t = 0; t < T; t++) { int n, q; cin >> n ...
ALGO
0.999615
3.256718
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2017-03-17T01:41:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3ed04ab38...
4cc27cb4-63fe-46bd-8a25-fc79c43a892b
Bambia/Algorithm
algorithm_study/2019.06.30/DujkstraAndMST/1504_conditionalShortestPath.cpp
#include <iostream> #include <vector> #include <utility> #include <queue> using namespace std; const long long MAX_SIZE = 1e3,INF = 1e9+5; int a,b,c,C1,C2,N,E; long long dist[MAX_SIZE],path1,path2; vector <pair <int,int> > adj[MAX_SIZE]; void init(){ for(int i =0; i<=N; i++) dist[i] = INF; } int dijkstra(vecto...
ALGO
0.999986
3.948812
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2019-03-30T18:04: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": "5623450e4...
aee3c372-2775-4da2-94d3-14f0a58f1fff
OlegZuev/C--
HomeWorkTask6r/HomeWorkTask6r/Source.cpp
#include <iostream> #include <windows.h> #include <string> using namespace std; void bruteForce(string s, int n, int indexOfSign, bool& flag); int calculate(string s); int takeOperand(string s); bool isNumber(char c); void main() { SetConsoleCP(1251); SetConsoleOutputCP(1251); string bill; int n; ...
ALGO
0.999702
3.60618
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2018-10-18T10:37: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": "e746d2278...
15f6f202-bb2a-4cb9-8619-2a4de579fe20
alanlyyy/C-Sedgewick-Data-Structures
ch5_recursion/ex_5_98.cpp
#include <iostream> #include "C:\Users\Alan\source\repos\Cpp_sedgewick\ch4_ADT\Stack_linked_list.h" struct adj_node { int val; adj_node* next; adj_node(int v = 0, adj_node* n = 0) { val = v; next = n; } }; void stack_depth_first_search(adj_node** adj_list, int k) { //performs depth first search with ignore...
ALGO
0.999481
4.721295
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2020-11-15T23:02: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": "88db4a47f109...
f19cab7f-1d93-4004-ab69-0358344a2bf9
roastduck/team_homework
gcj2009f/lights.cpp
#include<cmath> #include<cstdio> #include<cstring> #include<vector> #include<algorithm> using namespace std; const int maxn=55; const double pi=acos(-1), eps=1e-8, inf=1.0/0; #define pb(x) push_back(x) #define sqr(x) ((x)*(x)) struct DOT { double x, y; DOT(){} DOT(double _x, double _y) : x(_x), y(_y) {}}; struct CYL...
ALGO
0.999307
3.625446
{ "github_metadata": { "branch": "master", "commit_count": 77, "repo_created_at": "2014-10-31T03:20:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "550a835c2...
82ea2009-952b-4713-8a9e-06f494fe7cad
Mohamed-hesham-21/Board_Games_With_Ai_Players
Board_Games_With_AI_Player/XO_5x5_board.cpp
// // Created by mohamed on 12/10/2023. // #include <bits/stdc++.h> #include "XO_5x5_board.h" using namespace std; bool XO_5x5_board::game_is_over() { return !n_moves; } XO_5x5_board::XO_5x5_board() { n_rows=n_cols=5; n_moves=24; board =new char*[n_rows]; for(int i=0; i<n_rows; i++){ boa...
ALGO
0.999259
5.305341
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2023-12-04T17:42: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": "14d614bacdf...
1b769d2a-4e44-476d-83f1-3dcd7f071674
sexyseunghwan/study
algorithm/c++/RobotVacuumCleaner14503/RobotVacuumCleaner14503Bfs.cpp
#include <iostream> #include <queue> using namespace std; int N,M,c,r,v; int cleanCnt; int map[51][51]; int dr[4] = {-1,0,1,0}; int dc[4] = {0,1,0,-1}; struct Elem { int r,c,v,p; }; int backTurn(int v) { int backV = (v + 2) % 4; return backV; } int leftTurn(int v) { int leftV = (v + 3) % 4; ret...
ALGO
0.999954
5.019629
{ "github_metadata": { "branch": "main", "commit_count": 82, "repo_created_at": "2024-05-19T06:52:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "4bffa94c731...
add888b1-019f-45d9-a6ad-8d1c4825e514
arangodb/arangodb
3rdParty/boost/1.78.0/boost/compute/algorithm/sort_by_key.hpp
//---------------------------------------------------------------------------// // Copyright (c) 2013 <NAME> <<EMAIL>> // // Distributed under the Boost Software License, Version 1.0 // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // // See http://boostorg.github.com/compute ...
ALGO
0.999992
7.100161
{ "github_metadata": { "branch": "devel", "commit_count": 51986, "repo_created_at": "2011-10-26T06:42:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13878, "forks": 857, "issues": 743, "pull_requests": 38 }, "file_meta": { "content_id": ...
7edd8886-e28a-443c-9307-10bb2a8478d1
pty4437/Algorithm-Study
2022-ICPC-초급반/bj4485.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <cstring> using namespace std; typedef long long ll; int N, INF = 9999; int map[15625], dist[15625], visited[15625]; int dijkstra(int start, int goal) { fill(dist, dist + 15625, INF); fill(visited,...
ALGO
0.999767
4.345738
{ "github_metadata": { "branch": "main", "commit_count": 58, "repo_created_at": "2022-01-08T11:01: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": "2d909c2643c...
6514ef7e-6aee-403a-b4cd-231b0b441038
chris-womack/dataStructures
notes/Tuesday-0615/DoubleLinkedList/MyLinkedListNotes.cpp
#include <iostream> #include "LinkedListNotes.h" //#include "LinkedListNotes.cpp" using namespace std; struct node{ int x; node *next; // this will be an address }; int main() { /* int a[4]; for(int i = 0; i < 4; i++) cout << "address of a " << &a[i] << endl; // dynamic memory allocation int *iArray; i...
TOOL
0.946627
3.524338
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2014-09-11T16:25: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": "b64aab9761...
f8f0addf-d154-4722-9088-3ed0a8f244a7
rahmatsyifana12/cp
codeforces/Divide and Conquer.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define sza(x) ((int)x.size()) #define sortv(a) sort(a.begin(), a.end()) #define dbarr(x, m, n) for(int i=m; i<n; i++) cout << x[i] << ' '; cout << '\n'; const int MAX_N = (int)1e5 + 5; const ll MOD = 1e9 + ...
ALGO
0.999934
4.021192
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-12-03T07:09: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": "11ab21293a79...
b39ce121-ab6a-45f5-a8be-50f854628e25
dreyus95/AVSP_SourceQualityPrediction
CodeJamCrawler/dataset/09_4077_99.cpp
#include <string> #include <vector> #include <sstream> #include <fstream> using namespace std; #define rep(i,n) for(int i=0,_n=(n);i<_n;++i) #define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i) int main() { ifstream cin("A-small-attempt0.in"); ofstream cout("A-small.out"); int l, d, n; cin >> l >> d >> n; vec...
ALGO
0.99948
3.566298
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2017-06-08T21:00:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bdc175896...
dc004693-a39d-4619-82a1-1f997a5dc425
YtaloWill/learning-c
arrays/Repeat.cpp
#include <stdio.h> #include <stdlib.h> #include <time.h> void populateArray(int array[], int length); void buscaRepetidos(int v[], int valor, int tam); int main(){ srand(time(NULL)); int length = rand() % 30 + 1; int array[length]; populateArray(array, length); printf("Array Length: %d\n", l...
ALGO
0.994441
3.907504
{ "github_metadata": { "branch": "InitialRelease", "commit_count": 14, "repo_created_at": "2019-11-16T20:22: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": "3...
c41cf34c-ef9d-4a54-97e2-7c4b78cf9c03
patelaaniket/csce221
pa4/SortedMPQ.h
#ifndef SORTEDMPQ_H #define SORTEDMPQ_H #include <iostream> #include <stdexcept> #include <list> #include "MPQ.h" using namespace std; /* * Minimum Priority Queue based on a linked list */ template <typename T> class SortedMPQ: MPQ<T> { public: T remove_min() { if (!elements.empty()) { T min...
ALGO
0.981288
6.053786
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2020-12-28T03:04:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "61e09f0e0545...
762ffdda-6f47-4753-92b0-ff09c327b1f1
haoran-mc/algorithm-template
03-搜索/01-深度优先搜索(DFS)/02-n-皇后问题(2).cpp
/*---------------------------------------------------------------- * * 文件名称:n-皇后问题(2).cpp * 创建日期:2021年08月15日 星期日 13时18分42秒 * 题 目:AcWing 0843 n-皇后问题 * 算 法:深度优先搜索 * 描 述:这一种更加的暴力 * ----------------------------------------------------------------*/ #include <cstdio> const int maxn = 10; #define ...
ALGO
0.999931
4.388525
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2020-10-30T15:18:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4357caa9478...
bbb74993-3919-4997-8bb2-de1254e02d8e
reyzeer/pwr-gk-cw-3
egg.cpp
/// Laboratorium: Grafika Komputerowa /// Prowadzący: Dr inż. <NAME> /// Zadanie 3 /// <NAME> 209909 #include "common.h" void Egg::prepareMatrix() { matrix = new float ** [n]; for (int i = 0; i < n; i++) { matrix[i] = new float * [n]; for (int j = 0; j < n; j++) { matrix[i][j] = new float[3]; } } } fl...
ALGO
0.977791
4.019396
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-11-24T20:14: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": "d36820711c...
41963db8-7c7c-40d1-9ff1-251073c6246d
Donggeun-Lim3/ISC3U-Unit2-04-CPP
cost_of_pizza.cpp
// Copyright (C) 2002 <NAME> All rights reserved // // Created by <NAME> // Created on November 2020 // This program calculates cost of Pizza #include <iostream> #include <iomanip> int main() { // this function calculates the cost of pizza const float LABOR = 0.75; const float RENT = 1.00; const float...
ALGO
0.973964
4.613008
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2020-11-25T17:47: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": "30f892a8f234...
e2105e5e-4a1a-402d-9b8a-d14a5f1386d7
palilo815/ps
baekjoon/4000/4483.cpp
#include<bits/stdc++.h> using namespace std; #define loop(i,n) for(int i=0;i<n;++i) string name[25]; bool pres[25]; void check(const string& s, int N) { loop(i, N) if (name[i] == s) { pres[i] = true; return; } } int main() { cin.tie(NULL), cout.tie(NULL); ios::sync_w...
ALGO
0.997562
4.167434
{ "github_metadata": { "branch": "master", "commit_count": 6725, "repo_created_at": "2020-01-12T04:58:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9b5054f...
106495ce-ecee-4d3c-8590-224519bfc387
twoload/myAlgo
DP5/DP5_p1_13246_sum_matrix_square.cpp
#if 0 # Ive attended the code.plus class (https://code.plus/) # And I've referred it's codes # And core parts can be come fully from the class. #endif // <- sum of square of matrix fast!!! // s = a^1+a^2+a^3+...a^b // a^(2q) = (a^q)^2 // a^(2q+1) = a^2q * a // a^1+a^2+...+a^2q = (E+a^q)*(a^1+a^2+...+a^q) // a^1+a^2+.....
ALGO
0.999889
4.492031
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2022-08-15T00:08:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "320af5794...
b2821523-99cc-4c45-9c7a-b1e49ecb16fc
XYXBlAcG/cppcode_backup
2324.cpp
#include <cstdio> //结合 int n; const int N = 1e6 + 3; struct Node { int nxt; int pre; int con; }list[N]; int main(){ scanf("%d",&n); for (int i = 1; i <= n ;i++){ scanf("%d",&list[i].con); list[i].nxt = i + 1; list[i].pre = i - 1; int a1 = 0, a2 = 0; for (int ...
ALGO
0.999823
3.373539
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2023-07-22T12:36: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": "19b155d5103...
c6a4301a-1437-4af9-a0eb-d6eb56bcd162
xjcoding/leetcode
cpp/93. Restore IP Addresses.cpp
class Solution { public: vector<string> restoreIpAddresses(string s) { vector<string> res; dfs(0, 0, "", s, res); return res; } void dfs(int index, int step, string path, string &s, vector<string> &res) { if (s.size() - index < 4 - step || s.size() - index > 3 * (4 -...
ALGO
0.999865
5.276943
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2016-07-11T06:34: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": "75c4797d8...
03eaf2be-e215-4fd6-91c0-a1d168699806
thuanthichlaptrinh/C
Mang 1 Chieu/BaiTapThayKhang.cpp
#include <bits/stdc++.h> //============================ KỸ THUẬT NHẬP XUẤT MẢNG ============================ void NhapSoDuong(int &n); void NhapMang(int *&a, int &n); void TaoMang(int *&a, int &n); void XuatMang(int *a, int n); //============================ KỸ THUẬT TÌM KIẾM ============================ //===========...
ALGO
0.987204
3.473397
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-26T08:56: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": "046ca56f9ba5...