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
3eb4946e-5a10-4e8a-a3e2-e06820683acf
bossxxws/cmpsci-learn-practice
nefu_work/z弃用/Leecode编程/LeetBook/c++实现/002-链表/025-2023-10-20/025-2023-10-20/旋转链表.cpp
#include <iostream> using namespace std; struct ListNode { int val; ListNode *next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(x), next(nullptr) {} ListNode(int x, ListNode *next) : val(x), next(next) {} }; class Solution { public: ListNode* rotateRight(ListNode...
ALGO
0.999865
4.879861
{ "github_metadata": { "branch": "master", "commit_count": 244, "repo_created_at": "2024-03-29T11:29: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": "76b488b2...
91dcb798-7507-48d8-b7d1-c56a0d6d5580
alexandraback/datacollection
solutions_2449486_0/C++/dnkywin/B.cpp
#include<iostream> #include<fstream> using namespace std; int main(){ int T; ifstream in("B.in");ofstream out("B.out"); in>>T; int heights[100][100]; bool rowelim[100], colelim[100]; for (int t=0;t<T;t++){ out<<"Case #"<<t+1<<": "; int N,M; in>>N>>M; for (int i=0...
ALGO
0.999957
3.537467
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b5da50acc...
0032ff86-cdfd-44ae-84ba-ff852b7e8829
andrewssobral/lrslibrary
algorithms/nmf/LNMF/KLC.cpp
// Kullback-Leibler divergence implmented in C++ // Copyright @ <NAME> #include "math.h" #include "mex.h" //--This one is required void mexFunction(int nlhs, const mxArray *plhs[], int nrhs, const mxArray *prhs[]) { //---Inside mexFunction--- //Declarations const mxArray *xData; const mxArray *yData; dou...
ALGO
0.998045
4.727434
{ "github_metadata": { "branch": "master", "commit_count": 88, "repo_created_at": "2014-11-07T20:25:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 860, "forks": 378, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "41e04...
fbcfc832-40e6-4a41-ae83-fdc593dd5648
TANGQingMiss/data_structure
c++/stackPermutation.cpp
//this file is used to check whether one stack can be permutated to another stack //in other ways, check structure 312 //for n-length array, stack permutations is (2n!)/((n+1)!n!) #include <iostream> #include <string> #include <vector> using namespace std; bool checkPermutation(vector<int> arr1, vector<int> arr2, int ...
ALGO
0.999896
4.823003
{ "github_metadata": { "branch": "master", "commit_count": 88, "repo_created_at": "2020-02-05T11:44:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fd0140447...
8c34c1d8-b572-4bda-a15f-d3ef79cae1eb
a-pinch/andrewtroyan
C++/HomeWork/BiConnectedList/BiConnectedList/main.cpp
#include "List.h" #include <string> int main() { //try { // List<int> a; // a.pushBack(6); // a.pushBack(3); // a.pushBack(5); // for (auto it = a.begin(); it != a.end(); ++it) // cout << *it << ' '; // cout << endl; // a.sort(0, a.getSize() - 1, reduce); // // for (auto it = a.begin(); it != a.end(); +...
TOOL
0.99651
4.318429
{ "github_metadata": { "branch": "master", "commit_count": 190, "repo_created_at": "2015-10-15T06:18: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": "f9525912...
e356fd11-b075-4bef-80c8-d94c6c2e77ba
rpriyadarshi/practice
QuickSort/main.cpp
/* * main.cpp * * Created on: Sep 16, 2011 * Author: rohit */ #include <iostream> #include <stdlib.h> #include <time.h> void printArray(const int *beg, const int *end) { if (beg == 0 || end == 0 || beg > end) { return; } for(const int *iter = beg; iter != end; ++iter) { std::cout << *iter << " "; ...
ALGO
0.999636
5.07492
{ "github_metadata": { "branch": "master", "commit_count": 166, "repo_created_at": "2024-06-30T06:00: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": "2781efb5...
513e264c-799c-4357-9b8d-7260949aabf0
ishandutta2007/codeforces-s
septimelon/normal/1609/D.cpp
#pragma GCC optimize("O3") #include <algorithm> #include <bitset> #include <chrono> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #inc...
ALGO
0.999224
4.060112
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:07:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6f91bf838eb4...
e4d0867b-9842-49d4-b3fb-58519f1ca3cc
dsocaciu/Books
AcceleratedCpp/Chapter11/chap117.cpp
//Accelerated C++ //Chapter 11 Defining abstract data types //Question 11-7 #include <string> #include <cctype> #include <iostream> #include "Vec116.cpp" using namespace std; Vec<string> split(const string& s) { Vec<string> ret; typedef string::size_type string_size; string_size i = 0; //invariant: we have pro...
TOOL
0.987424
5.345391
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2017-01-23T16:29: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": "7f2b30703...
acc443d8-5311-44dd-b6ba-15902c862833
ashish2125it/Coding_Project
Difficulty: Medium/Merge two BST 's/merge-two-bst-s.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; #define MAX_HEIGHT 100000 // Tree Node struct Node { int data; Node* left; Node* right; Node(int val) { data = val; left = right = NULL; } }; // Function to Build Tree Node* buildTree(string str) { // Corner ...
ALGO
0.999963
6.468636
{ "github_metadata": { "branch": "main", "commit_count": 204, "repo_created_at": "2025-01-11T17:46: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": "80bd29b0e9...
1406d744-4355-4d08-b47b-75a4fc6cf5a7
rjdahomie/RSA_Project
crackCode.cpp
#include <iostream> #include <cmath> #include<vector> #include<unordered_map> //Checks whether the given value is prime. bool IsPrime(int n) { for(int i = 2; i<= n/2; i++) { if(n % i == 0) { return false; } } return true; } //Generates the first sqrt(n) primes in a vector, which we will use to check...
ALGO
0.999951
4.597315
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-10-08T06:50: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": "040f0cff4c6a...
660a39bc-ff04-40a4-923f-02630c534077
yukunli/DataStructure_Algorithms
C_practice/LYK_LoanSys/src/ListOpr.cpp
#include "ListOpr.h" #include "api.h" #include "malloc.h" #include "stdlib.h" // 创建链表 LoanHistoryInfoNode* CreatList(void) { LoanHistoryInfoNode *pHead = NULL; pHead = (LoanHistoryInfoNode *)malloc(sizeof(LoanHistoryInfoNode)); if(NULL == pHead) { exit(0); } pHead ->pNext = NULL; return pHead; } // 删...
TOOL
0.96122
3.972662
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2016-04-01T06:52: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": "18f5ad7730...
90c2359f-c4b6-41b7-8959-397c570f4933
lballabio/QuantLib
ql/models/marketmodels/models/ctsmmcapletcalibration.hpp
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2007 <NAME> Copyright (C) 2007 <NAME> This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can r...
ALGO
0.981826
6.912152
{ "github_metadata": { "branch": "master", "commit_count": 17543, "repo_created_at": "2015-12-17T16:29:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6151, "forks": 1964, "issues": 51, "pull_requests": 11 }, "file_meta": { "content_id":...
68a8b9ca-425b-43e1-ba58-76e403f10cc7
MuhammadBahawal/DSA-Practice-in-C-
insertion-in-array.cpp
#include <iostream> using namespace std; void insertion(int &size, int arr[]) { int Element; cout << "enter the Element you want to insert at Biggining : "; cin >> Element; for (int i = size; i > 0; i--) { arr[i] = arr[i - 1]; } arr[0] = Element; size++; } void display(int siz...
ALGO
0.997813
4.143908
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2024-12-08T11:02: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": "a5c186691f2f...
ba6d01ed-1f45-49ba-8134-abe146099d7c
iboB/trie-map-bench
bench/trie_map.hpp
#include <vector> #include <array> #include <memory> #include <string_view> class trie_map { public: struct node { int32_t payload = -1; // children stored as indices in the parent map // to save space // index 0 (the root index) means that there is no child std::array<uint...
ALGO
0.992073
5.579913
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2024-02-09T03:58: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": "0673df0fa8...
710d2094-d7b9-4424-84ba-651b02119766
ajami1331/LightOJ
1311 - Unlucky Bird/1311 - Unlucky Bird.cpp
#include <bits/stdc++.h> using namespace std; int main() { #ifdef CLown1331 freopen( "in.txt", "r", stdin ); #endif // CLown1331 int t, cs; double v1, v2, v3, a1, a2, ans, time1, time2, time3, dist; scanf( "%d", &t ); for( cs=1; cs<=t; cs++ ) { scanf( "%lf %lf %lf %lf %lf", &v1,...
ALGO
0.999845
3.235848
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2017-08-05T22:20:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c8f003702...
5d3f9215-9b35-4eec-9fd2-80ea58ddc17b
ssshrihari/MissionRnd-Arrays-2
sortedArrayInsertNumber.cpp
/* OVERVIEW: Given a sorted array, insert a given number into the array at appropriate position. E.g.: Arr = [2, 4, 6], num = 5 final Arr = [2, 4, 5, 6]. 5 is inserted at 2nd index. INPUTS: Integer Array pointer, length of the array, number to be inserted. OUTPUT: Array pointer after inserting number. ERROR CASES...
ALGO
0.999971
4.293928
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-08-21T16:23:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "89f5b458f0...
b79356a7-4de7-406b-8140-dc16c7a4ef6c
sanesedu/CompetitiveProgramming
codeforces/C/1238a/main.cpp
#include <bits/stdc++.h> #define pb push_back #define all(x) (x).begin(), (x).end() #define fori(i, n) for(int i = 0; i < (int)(n); ++i) #define forid(i, n) for(int i = (int)(n) - 1; i >= 0; --i) #define forl(i, n) for(long long i = 0; i < (long long)(n); ++i) #define forld(i, n) for(long long i = (long long)(n) - 1;...
ALGO
0.999961
3.817468
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2020-06-23T16:29: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": "b8d422389...
b0d90c29-7831-49a5-9957-51b1df6f5d6c
RoozbehSanaei/ITEPS
Models/quadcopter.cpp
//Camera double payload_1 = camera_weight; //Motor double elect_powr_loss = pow(motor_rate_current,2)*Int_resist; double motor_elect_in = motor_rate_current*motor_voltage; double prop_motor_rpm_rated = motor_rpm_per_volt*motor_voltage; double prop_motor_rps_rated = prop_motor_rpm_rated/60; double prop_motor_omega_r...
ALGO
0.995486
4.340659
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-04-11T10:25: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": "ab31e18d67...
a5c03a21-efb5-478b-b228-13ae6924816c
Architgupta001/Hacktoberfest-2021
C++/firstandlast.cpp
// finding the position of the first and last number of the given element #include<bits/stdc++.h> using namespace std; vector<int> find(int a[], int n , int x ); int main() { int t; // no of testcases you gonna run cin>>t; while(t--) { int n,x; cin>>n>>x; // n is the number of element...
ALGO
0.999879
5.18576
{ "github_metadata": { "branch": "main", "commit_count": 588, "repo_created_at": "2021-10-01T09:13:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 15, "forks": 125, "issues": 86, "pull_requests": 1 }, "file_meta": { "content_id": "9ca74b...
e451c0de-8b33-4071-a0f3-1a6f49928de8
starlingcode/Via
modules/atsr/atsr_helpers.cpp
/* * calibration_helpers.cpp * * Created on: Jan 6, 2019 * Author: willmitchell */ #include <atsr.hpp> constexpr int32_t ViaAtsr::expoSlope[4097]; constexpr int32_t ViaAtsr::logSlope[4097]; constexpr int32_t ViaAtsr::linSlope[4097]; constexpr int32_t ViaAtsr::sigmoidSlope[4097]; void ViaAtsr::render(int32...
TOOL
0.964108
4.389759
{ "github_metadata": { "branch": "master", "commit_count": 104, "repo_created_at": "2019-04-05T02:16:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 6, "forks": 2, "issues": 3, "pull_requests": 1 }, "file_meta": { "content_id": "8fecf2c02...
356990ec-a509-49f6-9f18-00738f048f55
adamharmaniak/NMLA
Nestacionarne_metody/source.cpp
#include <iostream> #include <vector> #include <cmath> #include <fstream> using namespace std; typedef vector<double> Vec; typedef vector<Vec> Mat; Vec vec_add(const Vec& a, const Vec& b, double alpha = 1.0) { Vec result(a.size()); for (size_t i = 0; i < a.size(); i++) { result[i] = a[i] + alpha * b[...
ALGO
0.999889
4.460672
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2025-03-12T10:13: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": "b0c96400cdb...
4f78913c-c11a-446a-88d1-25b4b1874ff5
bstewart/stm
src/STMCfuns.cpp
// [[Rcpp::depends(RcppArmadillo)]] #include "RcppArmadillo.h" // [[Rcpp::depends(RcppArmadillo)]] // [[Rcpp::export]] double lhoodcpp(SEXP eta, SEXP beta, SEXP doc_ct, SEXP mu, SEXP siginv){ Rcpp::NumericVector etav(eta); arma::v...
ALGO
0.997659
5.978373
{ "github_metadata": { "branch": "master", "commit_count": 411, "repo_created_at": "2014-02-04T21:15:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 406, "forks": 98, "issues": 113, "pull_requests": 4 }, "file_meta": { "content_id": "c17...
1dbd5384-3a65-46e9-a4de-64f58908a36a
xienan6/leetcode
cpp/addBinary/addBinary.cpp
// Source : https://leetcode.com/problems/add-binary // Author : Nan // Date : 2018-12-29 // 294 / 294 test cases passed. // Runtime: 0 ms /* * simulate. * * Time complexity O(n+m), Space complexity O(1) */ class Solution { public: string addBinary(string a, string b) { string s = ""; int...
ALGO
0.999974
6.196849
{ "github_metadata": { "branch": "master", "commit_count": 316, "repo_created_at": "2018-12-04T13:02:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "101cbd6d...
2a0b5f48-062f-4326-ad1c-b80a564c1e2f
Albertogk/competitive_programming
google/kickstart/2018-e-tea.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <bits/stdc++.h> using namespace std; int min_complains(int n, vector<int>final_sum, int p, vector<vector<int>> forb, int m) { vector<int> min_comp, least_complains; int aux, comp_with_0, comp_with_1, complains = 0, min_impac...
ALGO
0.999734
4.532091
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2020-03-09T21:39: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": "4d9e5d54d3...
4cae446e-d21c-479d-b59a-1c5b07497b62
eashwaranRaghu/Data-Structures-and-Algorithms
2. Searching, Sorting and Order Statistics/selectionSort.cpp
// Created on 06-07-2019 18:33:24 by necronomicon #include <bits/stdc++.h> using namespace std; #define MP make_pair #define PB push_back #define ARR_MAX (int)1e5 //Max array length #define INF (int)1e9 //10^9 #define EPS 1e-9 //10^-9 #define MOD 1000000007 //10^9+7 #define PI 3.1415926535897932384626433832795 typedef...
ALGO
0.99991
4.577233
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2019-07-12T14:53:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d50daca35...
8fa724e0-89a2-42bd-a982-2e80fef8120d
garg-aryan/Data-Structures-File-Sem-III-DU
List_10.c++
#include <iostream> using namespace std; struct Node { int data; Node *prev; Node *next; }; class Prac_10_DbQueue { public: Node *front; Node *rear; int size; Prac_10_DbQueue() { front = rear = NULL; size = 0; } Node *getNode(int data) { Node *newNo...
ALGO
0.992669
4.489511
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-01-04T14:55: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": "99e17d967e73...
78374e07-1935-42c6-ac0c-d6f78ee3f82a
balazspete/NETSOC-Programming-Competition-April-2013
Problem 16/solution.cpp
#include <stdio.h> #define MAX 105 #define OST 1337 int s[MAX][7]; int f[MAX][7]; int ost[6]={1,3,2,6,4,5}; char niz[MAX]; int main() { int i,j,m,k,t,u,d,v; s[1][5]=s[1][6]=1; for(k=1;k<MAX-1;k++) for(m=0;m<7;m++) s[k+1][m]=s[k][m]^s[k][(m+3*ost[k%6])%7]^s[k][(m+4...
ALGO
0.999825
3.363572
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2013-04-19T23:47: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": "d9a4f10778...
57251013-60da-4d1e-ab34-d9c8c9ce3642
Khushi-Bagadia/Assignment-Tops
Module-3/Practicals/7.cpp
// 3. Operator Demonstration // o Write a C++ program that demonstrates arithmetic, relational, logical, and bitwise // operators. Perform operations using each type of operator and display the results. // o Objective: Reinforce understanding of different types of operators in C++ #include <iostream> using namespace ...
ALGO
0.929304
3.744023
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2024-12-23T18:00: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": "d3ca75ff57f...
a41f04c1-a922-4299-8645-9f61f260b843
alexandraback/datacollection
solutions_1480487_0/C++/Anastasia/cf.cpp
#include <iostream> #include <fstream> #include <vector> #include <set> #include <map> #include <string> #include <algorithm> #include <functional> using namespace std; int main() { ifstream cin("a.in"); FILE* pf = fopen( "out.txt", "w"); //ofstream cout("out.txt"); int t; cin >> t; for ( int i = 0; i < t; i+...
ALGO
0.998835
3.747374
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d2f378c0f...
bb47e2a3-fc75-423f-a3ab-a19de9f43a20
SamarthAroraa/cpp-codebase
COMPETITIVE_NININJAS/number theory/lcm_sum_euler_tf.cpp
#include<bits/stdc++.h> using namespace std; #define deb(x) cerr<<#x<<" "<<x<<endl; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<string, string> pss; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vii; typedef vector<ll> vl; typedef vector<vl> vv...
ALGO
0.999958
4.288781
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-05-29T08:56: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": "252c9eda52...
dbeb2dd6-a7d1-45ce-8d62-145d4454beef
pateash/cp
src/main/main_fastio.cpp
/* * Author : <NAME> * Handle: ashishpatel0720 */ /******** All Required Header Files ********/ #include<iostream> #include<cstdio> #include <cmath> #include<cstring> #include <cassert> #include<climits> #include<algorithm> #include <functional> #include <numeric> #include <utility> #include <limits> #include<vector...
ALGO
0.999358
3.698607
{ "github_metadata": { "branch": "master", "commit_count": 253, "repo_created_at": "2016-10-24T11:19:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0e3a9b95...
2c6e1c5e-e858-451c-b93e-16b811f7bdc6
Zookim/algorithm
Programers/리코쳇로봇.cpp
#include <string> #include <vector> #include <iostream> #include <list> #include <queue> using namespace std; int dr[4] = { -1,1,0,0 }; int dc[4] = { 0,0,-1,1 }; struct Point { int r; int c; }; void print(vector<vector<int>> visited) { for (auto a : visited) { for (auto b : a) { cout ...
ALGO
0.999649
4.189552
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2023-05-31T00:27: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": "c143916a9ac...
41cb0440-a196-43ef-8ff7-42cd5ceaaf2d
klb3713/aoapc-book
BeginningAlgorithmContests/exercises/ch5/UVa10106.cpp
// UVa10106 Product // <NAME> // 题意:输入两个正整数X, Y(0<=X,Y<10^250), 求X*Y #include<cstdio> #include<cstring> #include<iostream> using namespace std; const int maxn = 1000; struct bign{ int len, s[maxn]; bign() { memset(s, 0, sizeof(s)); len = 1; } bign(int num) { *this = num; } bign(const char* n...
ALGO
0.999882
4.197297
{ "github_metadata": { "branch": "master", "commit_count": 198, "repo_created_at": "2013-09-22T01:26:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 181, "forks": 56, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "a17cd...
38b02dab-cf65-4adc-bd2a-1fc6ada83247
jiuchengyixiaicoding/408DataStruct
LinkList/P38_12.cpp
#include <iostream> #include <cstdlib> using namespace std; typedef struct LNode { int data; struct LNode* next; }LNode, * LinkList; //初始化单链表 bool initLinkList12(LinkList& l) { l = (LinkList)malloc(sizeof(LinkList)); if (l == NULL) { return false; } l->next = NULL; return true; } //使递增有序单链表中没有重复元素 bool mak...
ALGO
0.999931
3.848601
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2021-06-21T14:02: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": "e8c22b75f23...
ef184812-7542-4fd8-af99-fd03368caa0b
eidelen/EidNN
lib/inc/genetic.h
/**************************************************************************** ** Copyright (c) 2017 <NAME> ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and associated documentation files (the "Software"), ** to deal in the Software without restriction, including...
ALGO
0.982685
5.828695
{ "github_metadata": { "branch": "master", "commit_count": 140, "repo_created_at": "2017-03-06T12:31:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b2b0ef21...
4264ca29-8db3-4135-a0c1-38bc55bd21e8
Alex7Li/ProgrammingContests
Codeforces/contest_406383/C_Distance.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> template<class k, class v> using hash_map = __gnu_pbds::gp_hash_table<k, v>; using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define len(x) (int)(x).size() #define dbg(x) cerr << ">>> " << #x << " = ...
ALGO
0.999962
4.040983
{ "github_metadata": { "branch": "master", "commit_count": 84, "repo_created_at": "2017-08-14T19:06:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eeed0a8df...
95de7f24-8060-46fc-a3fd-0a1029ed3a0c
harshy1718/Compression-Tool
huffman.cpp
#include <iostream> #include <fstream> #include <queue> #include <unordered_map> #include <vector> #include <string> struct Node { char ch; int freq; Node *left, *right; Node(char ch, int freq, Node* left = nullptr, Node* right = nullptr) : ch(ch), freq(freq), left(left), right(right) {} }; ...
ALGO
0.999275
5.045381
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2024-07-29T21:48:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "47503d4e3c...
ae7a031f-062a-475b-8c10-f4ed7d3f5872
Havry21/CV_LAB
Лабораторная работа 4/Задание1/CVTest/main.cpp
#include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> #include<iostream> #include <cmath> #include<complex> #include<vector> using namespace std; #define PI 3.14159265358979323846 class myDiscrFurie { const int _M; const complex<double> ci = complex<double>(std::polar(1.0...
ALGO
0.999833
4.167583
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2023-01-16T21:37: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": "6fd918b76...
a2185b38-e1d2-4b50-93c5-d4eb0a9a9e32
yxw027/navguide
src/guidance/tracker.cpp
/* * This is the code for feature tracking. This code is deprecated. */ #include "tracker.h" #define TRACKER_MAX_ANGLE 15.0 // maximum angle between two frames // of the tracker /* init tracks from the void */ navlcm_track_set_t *init_tracks () { navlcm_track_set_t *tracks = (...
ALGO
0.996779
6.125568
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2015-06-04T11:27:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f7594049cf...
129d6c9a-84ef-4b1e-addc-70e329c6a4bf
divyansh2212/Practice-Problems
6187. Minimum Money Required Before Transactions.cpp
// <--------------------<NAME>--------------------> #include <bits/stdc++.h> using namespace std; #define ll long long #define inf INT_MAX const int mod = 1e9 + 7; class Solution { bool static cmp(vector<int> &a, vector<int> &b) { int choice1 = min(-a[0], -a[0] + a[1] - b[0]), choice2 = min(-b[0], -b[...
ALGO
0.999972
5.221505
{ "github_metadata": { "branch": "master", "commit_count": 225, "repo_created_at": "2022-01-08T15:47: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": "e7529dad...
04054a0d-e1ad-4438-a302-d7ca47caaa17
xmc-aalto/dismecpp
src/io/common.h
// Copyright (c) 2021, Aalto University, developed by <NAME> // All rights reserved. // // SPDX-License-Identifier: MIT #ifndef DISMEC_COMMON_H #define DISMEC_COMMON_H #include <stdexcept> #include "matrix_types.h" #include "spdlog/fmt/fmt.h" #include "utils/throw_error.h" #include "utils/conversion.h" /*! \file * ...
TOOL
0.932444
7.523673
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2022-07-20T11:31:55.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 7, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "185334fbee...
7d54fa19-e354-455e-9b2b-10dde05edc03
chenyong2github/UnrealEngine
Engine/Plugins/Experimental/NNERuntimeORTCpu/Source/ThirdParty/onnxruntime/Onnxruntime/Private/contrib_ops/cpu/transformers/beam_search_impl_t5.h
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #include "NNEThirdPartyWarningDisabler.h" // WITH_UE NNE_THIRD_PARTY_INCLUDES_START #undef check #undef TEXT #include "core/common/span_utils.h" #include "contrib_ops/cpu/transformers/generation_shared.h" //...
TOOL
0.964679
4.341733
{ "github_metadata": { "branch": "5.3", "commit_count": 258706, "repo_created_at": "2022-07-28T06:53:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 37, "forks": 12, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "7830aa...
b080579b-196c-4d96-896d-1e2848cc3433
iamvibhavtripathi/DSA-Busted-
Geeks And The String - GFG/geeks-and-the-string.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: string removePair(string s) { // code here string ans=""; int n=s.size(); stack<char> st; //st.push(s[0]); for(int i=0; i<n; i++){ // if(...
ALGO
0.999679
5.402324
{ "github_metadata": { "branch": "main", "commit_count": 260, "repo_created_at": "2022-07-14T05:03:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "84fef0abd8...
0c046173-2e93-44ef-a208-9e778ae38771
akash4797/Programming
Lab Task/Lab/Shortest Routes II_03.cpp
#include <iostream> #include <vector> #include <climits> using namespace std; int main() { int n, m, q; cin >> n >> m >> q; vector<vector<long long>> dist(n + 1, vector<long long>(n + 1, LLONG_MAX / 2)); for (int i = 1; i <= n; ++i) { dist[i][i] = 0; } for (int i = 0; i < m; ++i) { ...
ALGO
0.999991
4.597351
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-06-12T13:56: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": "b86104568d9a...
496d7326-0c3f-4956-b954-ca0173734d70
sumitkumar97/SPOJ-Solutions
M3TILE.cpp
#include <iostream> #include <cstdio> using namespace std ; int n , dp[35][2][2][2] ; int rec ( int iter , int upper , int middle , int lower ){ int ans = 0 ; if ( iter > n ){ if ( !upper && !middle && !lower ) return 1 ; return 0 ; } if ( dp[iter][upper][middle][lower] != -1 ) return dp...
ALGO
0.999799
3.291396
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2018-01-25T13:32: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": "e97328c7b6...
903ebdbc-dfda-4129-b0c9-0e2604f992ae
brainvisa/aims-free
aimsalgo/src/aimsalgo/signalfilter/iirfilter.h
/* This software and supporting documentation are distributed by * Institut Federatif de Recherche 49 * CEA/NeuroSpin, Batiment 145, * 91191 Gif-sur-Yvette cedex * France * * This software is governed by the CeCILL-B license under * French law and abiding by the rules of distribution of free soft...
TOOL
0.904978
7.028613
{ "github_metadata": { "branch": "master", "commit_count": 4682, "repo_created_at": "2018-10-31T14:43:29.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 7, "forks": 3, "issues": 11, "pull_requests": 1 }, "file_meta": { "content_id": "7346608...
c4894742-c872-4d09-b1fd-af052decdd2f
VitinDenoyr/CompetitiveProgramming
codeforces/Subreg2024H-HarmonicsWithInterference.cpp
//https://codeforces.com/gym/105327/problem/H #include <bits/stdc++.h> using namespace std; #define ll long long int main(){ string l, s; cin >> l >> s; vector<int> indL, indS; for(int i = 0; i < l.size(); i++){ if(l[i] == '*') indL.push_back(i); } for(int i = 0; i < s.size(); i++){ if(s[i] == '*') indS.push...
ALGO
0.999955
3.621472
{ "github_metadata": { "branch": "main", "commit_count": 61, "repo_created_at": "2024-11-30T15:38:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "84a32c608c0...
efb2470a-da0f-43ac-8aa7-a66d118f55fa
michael-lehn/FLENS
flens/lapack/interface/src/gejsv.cc
#define STR(x) #x #define STRING(x) STR(x) #include <flens/lapack/interface/include/config.h> namespace flens { namespace lapack { extern "C" { //-- dgejsv -------------------------------------------------------------------- void LAPACK_DECL(dgejsv)(const char *JOBA, const char ...
ALGO
0.992149
4.986577
{ "github_metadata": { "branch": "public", "commit_count": 475, "repo_created_at": "2011-12-14T18:21:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 127, "forks": 32, "issues": 9, "pull_requests": 0 }, "file_meta": { "content_id": "16348...
bde2c573-f64c-4175-be74-88cde40ace1a
dianeshan/ucr-cs-classes
cs14datastructures/labs/lab6/main.cpp
/* * cs014_sum20AB * lab6 * main.cpp * test harness * RR */ #include <iostream> #include <ctime> #include <cstdlib> #include <map> #include <iomanip> #include "pq_zero.H" using namespace std; void test_ordered_priorities(vector<string> &v1, vector<float> &v2); void test_random_ordered_priorities(vector<string> &...
TEST
0.994217
5.411999
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-05-28T10:04: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": "560dc7bc2051...
c7c5469a-0920-4517-b6a0-7e97bc100aa6
sergei-mironov/nixtvm
src/mironov/argmax/argmax0run.cpp
#include <iostream> #include <cstdio> #include <dlpack/dlpack.h> #include <tvm/runtime/module.h> #include <tvm/runtime/registry.h> #include <tvm/runtime/packed_func.h> using namespace std; using namespace tvm; int main(void) { DLTensor* a; int ndim = 2; int dtype_code = kDLFloat; int dtype_bits = 32; int d...
ALGO
0.970539
3.661854
{ "github_metadata": { "branch": "master", "commit_count": 330, "repo_created_at": "2018-06-13T09:37:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "377d3e3...
1745a396-6dfb-47e1-83a6-6865fb45db17
adityarg/competitve-prog
Construct Binary Tree from Preorder and Inorder 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.999999
6.680795
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2019-06-22T10:48: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": "fe1207f4bc...
24f1bf60-e449-451d-bd3f-03c157ea71c9
Tosha24/data-structures
C++/Brute Force/_1283_FindTheSmallestDivisorGivenThreshold.cpp
// Problem: https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold/ #include <iostream> #include <bits/stdc++.h> #include <vector> using namespace std; class Solution { static int getSum(vector<int>& nums, int div, int threshold){ int n = nums.size(); double sum = 0; fo...
ALGO
0.999844
6.093329
{ "github_metadata": { "branch": "main", "commit_count": 70, "repo_created_at": "2023-03-03T17:01:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "558e77e6fc1...
5d5b2f52-9403-48ef-b047-732f745558c3
hazeone/ProgrammingTraining
223.cpp
//wa #include<bits/stdc++.h> using namespace std; const int N = 1e4+10; const int M =120010; const int INF = 0x3f3f3f3f; #define ll long long struct Edge { int to,next,cap,flow; }e[M]; int tot; int g[N]; void init(){ tot=1; memset(g,-1,sizeof(g)); } void add(int u,int v,int w,int rw=0) { e[++tot].to=v;e[tot].cap=w;...
ALGO
0.999758
3.788903
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-10-09T07:52:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9600d3c4d5...
caaf0ef0-8a7c-4747-9ed4-a4a0690f22b7
noydvori/KNNClassifier
KNN/distanceAndClassification.h
// <NAME> 213372063 // <NAME> 211908256 #ifndef DISTANCE_AND_CLASSIFICATION_H #define DISTANCE_AND_CLASSIFICATION_H #include <string> #include <vector> #include "../CSV/fileDatabase.h" #include <iostream> #include <sys/socket.h> #include <stdio.h> #include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h> us...
ALGO
0.991329
5.129809
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-10-01T10:11: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": "e00ea9e7bee8...
95e96aee-8290-44d5-b054-8ff9e003f467
aryan19022004/DSA_CPP
Second_largest.cpp
//PROGRAM TO FIND THE SECOND LARGEST NUMBER IN A ARRAY #include <iostream> using namespace std; int main() { int arr[9] = {5,4,6,2,7,999,99,10000,9999}; //BruteForce solution /* 1. choosing the 2nd last element after sorting an array 2. here the time complexity of sorting will be O(n2) */ ...
ALGO
0.99993
3.633367
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2025-06-22T12:24:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "63620ca949b...
ca5adcb3-5ca8-4796-8598-223f51f6bee9
chy-2003/reponame
codingame/training/easy/power-of-thor-episode-1.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; /** * Auto-generated code below aims at helping you parse * the standard input according to the problem statement. * --- * Hint: You can use the debug stream to print initialTX and initialTY, if Thor seems not follow...
ALGO
0.999932
4.398429
{ "github_metadata": { "branch": "master", "commit_count": 68, "repo_created_at": "2018-07-05T04:57: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": "33220ec45...
ba9bcd86-b47d-4e85-b204-02f2ad4a9e2b
wyleesss/overloading_operators_04
overloading_operators_04/overloading_operators_04.cpp
#include <iostream> #include <algorithm> #include <Windows.h> #include <array> using namespace std; class SpecialCharacters { char value; static const array<int, 38> special_characters_codes; public: SpecialCharacters() :value(' ') {} SpecialCharacters(char value) { this->value = value; } friend istream& oper...
ALGO
0.99168
3.795154
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-01-15T14: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": "9b5d19a60a...
be235653-562c-4215-9830-22eb8afbdd7f
aashishrana/C-Source-Code
Binary search/first and last occr of key.cpp
// first and last occurence of key in an array #include <iostream> using namespace std; int firstOccurenc(int arr[], int size, int key) { int start = 0; int end = size-1; int mid = start + (end-start)/2; int ans ; while (start <= end) { if(arr[mid] == key) { ans = mid; end = mid-1; } ...
ALGO
0.999919
5.127326
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2022-02-02T08:06: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": "1d095d0c7...
3c5f09ef-5b45-4c95-90fd-802396216748
CoolPilot83/MorenoMichael_CIS-5_SPRING2018
Project/Project 1/Help Problems/Savitch_9thEd_Chap3_PracProb3_AstrologyHoroscope/main.cpp
/* * File: main.cpp * Author: <NAME> * Created on March 18, 2018, 1:20 PM * Purpose: Savitch Practice Problem 3 * Write an astrology program. The user types in a birthday, and the program responds with the sign and horoscope for that birthday. The month may be entered as a number from 1 to 12. Then enhance you...
ALGO
0.99714
4.417889
{ "github_metadata": { "branch": "master", "commit_count": 45, "repo_created_at": "2018-03-15T18:31:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d0da83b78...
5a5d659c-b238-40c8-b1fb-3e1e21c4aa3d
alifalhasan/CP-code-vault
Codeforces/Codeforces Round/Codeforces Round 750 (Div. 2)/F1 - Korney Korneevich and XOR (easy version)/153819751.cpp
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> #include<ext/pb_ds/tree_policy.hpp> #include<ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long template<typename temp>using ordered_set = tree<temp, null_type, less<temp>, rb_tree_tag,tree_order_statistics_node_upda...
ALGO
0.999987
4.023391
{ "github_metadata": { "branch": "main", "commit_count": 5924, "repo_created_at": "2023-06-06T13:32: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": "4abb249e5...
baf2a996-b577-4cd3-8a98-fe41451db364
HanYouyang/Computer
数据结构与算法/PATCode/乙级/PAT乙级(Basic Level)/1055. 集体照 (25).cpp
/* 1055. 集体照 (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 <NAME> 拍集体照时队形很重要,这里对给定的N个人K排的队形设计排队规则如下: 每排人数为N/K(向下取整),多出来的人全部站在最后一排; 后排所有人的个子都不比前排任何人矮; 每排中最高者站中间(中间位置为m/2+1,其中m为该排人数,除法向下取整); 每排其他人以中间人为轴,按身高非增序,先右后左交替入队站在中间人的两侧(例如5人身高为190、188、186、175、170,则队形为175、188、190、186、170。这里假设你面对拍照者,所以你的左边是中间人的右边); ...
ALGO
0.999775
4.745309
{ "github_metadata": { "branch": "master", "commit_count": 133, "repo_created_at": "2017-03-19T03:43:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1a38927a...
6d33f089-df80-4259-bbd2-4a41aee4b0a1
tasogare66/atcoder
abc124_d.cpp
// #include <bits/stdc++.h> using namespace std; template<size_t SIZE, class T> inline size_t array_size(T (&arr)[SIZE]) { return SIZE; } int main() { #if 1 int n=5, k=1; string str="00010"; cin >> n >> k; cin >> str; std::vector<int64_t> tbl; tbl.reserve(str.size()); char nowc=1; //1-0...
ALGO
0.999968
4.098173
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2019-04-13T16:12: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": "eeb70e64d...
e05a65d4-8899-4e0d-8e1f-67cdfee21c06
BarbourSmith/FluidNC
FluidNC/src/Kinematics/MaslowKinematics.cpp
// Copyright (c) 2024 - Maslow CNC. All rights reserved. // Use of this source code is governed by a GPLv3 license that can be found in the LICENSE file. #include "MaslowKinematics.h" #include "../Machine/MachineConfig.h" #include "../Limits.h" #include "../Machine/Homing.h" #include "../Protocol.h" #include "../Syst...
ALGO
0.93579
6.354044
{ "github_metadata": { "branch": "Maslow-Main", "commit_count": 2643, "repo_created_at": "2022-02-16T16:37:38.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "bdring/FluidNC", "stars": 58, "forks": 14, "issues": 32, "pull_requests": 4 }, "file_meta": { "co...
7e38475d-639e-45c4-83e9-9651241e5ecc
Bubhoosra/GEEKS-FOR-GEEKS
Medium/Bipartite Graph/bipartite-graph.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { private: bool check( int start, vector<int>&vis,vector<int> adj[]){ queue<pair<int,int>>q; vis[start]=0; q.push({start,0}); while(!q.empty()){ auto res=q.front(); ...
ALGO
0.999961
5.971704
{ "github_metadata": { "branch": "main", "commit_count": 108, "repo_created_at": "2023-10-04T16:20:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "98e52637c1...
1a547db8-72df-45be-bd4e-d5880988030f
JackKelly/disaggregation_MSc_code
src/PowerStateGraph.h
/* * PowerStateGraph.h * * Created on: 3 Aug 2011 * Author: jack */ #ifndef POWERSTATEGRAPH_H_ #define POWERSTATEGRAPH_H_ #include <boost/graph/adjacency_list.hpp> #include <vector> #include <list> #include <ostream> #include <time.h> #include "Statistic.h" #include "Common.h" // for Sample_t #include "...
ALGO
0.961068
5.665704
{ "github_metadata": { "branch": "graphAndDeltas", "commit_count": 186, "repo_created_at": "2017-06-22T08:45: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": "...
263361b5-666d-4aae-ab34-4824815e90a9
Karikari1234/coding
July 2020/Week 3/Day 4/Contest/1.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, a, b) for (i = a; i < b; i++) #define REP_ITER(it, v) for (it = v.begin(); it != v.end(); it++) #define FASTIO \ ios::sync_with_stdio(false); \ cin.tie(0) #define TEST(test) \ int test; \ cin >...
ALGO
0.999944
3.853477
{ "github_metadata": { "branch": "master", "commit_count": 147, "repo_created_at": "2020-05-20T09:03:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "1fbbff8f...
b39e88f3-ad44-4d2b-8104-37c815d1d3c1
Aphrodicez/POSN
POSN17/Pre-POSN-17-Camp1/Not_Modified/SlotMachine.cpp
#include <bits/stdc++.h> using namespace std; int a[20][10]; bool cmp (vector <int> &vec){ int num = vec[0]; for(int x: vec){ if(x != num){ return false; } } return true; } int main(){ ios_base :: sync_with_stdio(0); cin.tie(0); int n; vector <int> v...
ALGO
0.999748
3.335126
{ "github_metadata": { "branch": "master", "commit_count": 270, "repo_created_at": "2020-11-21T02:11:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bc4b53aa...
91bea3eb-529c-401e-87d2-09c429f83fcf
kt-asai/AOJ
0200.cpp
#include <iostream> using namespace std; const int INF = 100000000; int main(int argc, char const *argv[]){ int n, m, k; int cost[100][100]; int time[100][100]; while (cin>>n>>m, n||m){ for (int i = 0; i < 100; i++){ for (int j = 0; j < 100; j++){ if (i == j) { ...
ALGO
0.999964
3.589812
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2016-11-24T00:41: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": "1cbc2b97b...
3f22e810-99e0-4cab-944c-300392bcba3f
ivanzjj/Leetcode
140_Word Break II.cpp
class Solution { public: vector<string> ans; vector<bool> dp; int slen; typedef pair<string,int> PP; vector<vector<int>> pos; vector<string> wordBreak(string s, unordered_set<string>& dict) { slen = s.length (); dp.resize (slen + 1); fill_n (dp.begin(), slen+1, false...
ALGO
0.999516
5.302762
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2015-05-25T14:23: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": "d122f7b6c...
7d28114c-1195-44b6-8b2d-45586756bf3b
HeRaNO/OI-ICPC-Codes
COGS/napkin.cpp
#include <queue> #include <cstdio> #include <cstring> #include <climits> #define MAXN 2010 #define MAXM 200100 using namespace std; struct edge { int from; int to; int nxt; int flow; int cost; }; edge e[MAXM]; int p[MAXN],dis[MAXN]; bool vis[MAXN]; int n,new_cost,fast_day,fast_cost; int slow_day,s...
ALGO
0.999554
3.565291
{ "github_metadata": { "branch": "master", "commit_count": 246, "repo_created_at": "2018-12-31T09:57:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 24, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4fc74d0...
4dae9682-90f2-4afb-b8c7-ae0bc6fcc0dc
cruppstahl/upscaledb
src/2simd/simd.h
/* * Copyright (C) 2005-2017 <NAME> (<EMAIL>). * * 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 applicable law ...
ALGO
0.998636
5.145976
{ "github_metadata": { "branch": "master", "commit_count": 3538, "repo_created_at": "2010-08-02T08:13:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 578, "forks": 71, "issues": 18, "pull_requests": 0 }, "file_meta": { "content_id": "f8b...
647e1a7c-af24-4456-b797-153786576098
utkarsh-009/CP-Problem-Solving
C_Save_the_Magazines.cpp
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; /* Breaking every consecutive 1's subarray into two segments such that optimal solution for that segments is obtained Test Case 1: 4 0111 5 4 5 1 ->Handling corner cases -> 1 box added at first, to calculate valu...
ALGO
0.99985
4.393191
{ "github_metadata": { "branch": "main", "commit_count": 242, "repo_created_at": "2022-07-17T15:13: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": "00d5169aa7...
f6005107-c709-4784-b0ca-846a2e707eca
Kshat111/Data-Structures-and-Algorithms
CPPBasics/sample.cpp
#include <iostream> using namespace std; bool alreadyPresent(int element, int intersection[], int size) { for (int i = 0; i < size; ++i) { if (intersection[i] == element) { return true; } } return false; } int main() { int arr1[100]; int arr2[100]; int intersection[10...
ALGO
0.99999
4.321344
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2024-06-02T11:17:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "989c59ea0c...
8faad9bf-fb03-4efb-b9d9-f2fcb65c3ceb
rym903/atcoder
shot/abc140d.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #define FOR(i,x,n) for(int i=x; i<(n); i++) #define ALL(n) begin(n),end(n) #define MOD (1000000007) #define INF (1e9) #define INFL (1e18) typedef long long ll; typedef unsigned int ui; typedef unsigned long long ull; template<class...
ALGO
0.999968
3.550525
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2020-04-28T22:38: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": "585beb893...
224806d8-7614-4229-85e9-36dc0d821b03
taufiqhusada/competitive-programming
codeforces/126B.cpp
#include<bits/stdc++.h> 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), _n = (b); i <= _n; i++ ) #define FORD(i,a,b) for ( int i = (a), _n = (b); i >= _n; i-- ) #define RESET(a,val) memset(a,val,sizeof(a)); #define pb push_back #define mp ...
ALGO
0.999983
3.18503
{ "github_metadata": { "branch": "master", "commit_count": 168, "repo_created_at": "2018-12-10T03:14:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cad32b66...
048a9fdc-c609-4aac-8174-e09acf079e12
xuzhezhaozhao/Codeforces
302/D2D.cpp
#include <algorithm> #include <functional> #include <numeric> #include <utility> #include <iostream> #include <sstream> #include <iomanip> #include <bitset> #include <string> #include <vector> #include <stack> #include <deque> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #includ...
ALGO
0.999848
3.579908
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2014-02-12T13:58: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": "e0d5125caa...
7e41cbd5-f3fd-4e83-a626-f652bc37ab51
bonizario/cp
problems/leetcode/36-valid-sudoku.cpp
class Solution { public: bool isValidSudoku(vector<vector<char>>& board) { vector<set<char>> rows(9), columns(9); for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (board[i][j] == '.') { continue; } if (r...
ALGO
0.99293
6.696184
{ "github_metadata": { "branch": "main", "commit_count": 93, "repo_created_at": "2022-10-09T15:55: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": "8046c63ad3e...
7c63e226-1ab7-41a5-bd87-f35fb7026b50
WZSLYF/oi
usaco/1.2.5/1.2.5.cpp
#include <bits/stdc++.h> using namespace std; int n, S; bool judge1(string str) { int len = str.size(); for(int i = 0; i < len / 2; ++i) if(str[i] != str[len - 1 - i]) return false; return true; } bool judge(int x) { int num = 0; for(int i = 2; i <= 10; ++i) { string str; int tmp...
ALGO
0.999512
3.163847
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2019-07-14T16:15: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": "a01d54247...
705fa72a-828f-46b6-b5eb-4acbc8d9ef59
cah835/Data-Structures
class notes.cpp
// // class notes.cpp // Hw 6 // // Created by <NAME> on 7/27/15. // Copyright (c) 2015 <NAME>. All rights reserved. // #include <stdio.h> #include <string> #include <iostream> #include <fstream> #include <vector> using namespace std; int main() { //open a file ifstream namesFiles("names.txt"); if(!n...
ALGO
0.977135
3.745084
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2016-10-27T21:28: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": "dcf9b4a0bf...
4d66e943-bef2-4626-bd62-144741841472
fcnoronha/competitive-programming
Codforces/matrixGame.cpp
//codeforces.com/contest/1365/problem/A #include "bits/stdc++.h" using namespace std; #define pb push_back #define fr(i, n) for(int i = 0; i < n; i++) #define frr(i, n) for(int i = 1; i <= n; i++) #define dbg(x) cout << #x << " = " << x << endl #define all(x) x.begin(),x.end() #define ms(x, i) memset(x, i, sizeof(x)...
ALGO
0.999951
4.298596
{ "github_metadata": { "branch": "master", "commit_count": 289, "repo_created_at": "2018-07-05T22:15:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1e2604c8...
53372d92-3fc0-42f4-b5cd-6ff8968b08fd
Ichigo27/lovebabbar-dsa-sheet
Greedy/170_Buy_Maximum_Stocks_if_i_stocks_can_be_bought_on_i_th_day.cpp
// 170 Buy Maximum Stocks if i stocks can be bought on i-th day // In a stock market, there is a product with its infinite stocks. The stock prices are given for N days, where price[i] denotes the price of the stock on the ith day. // There is a rule that a customer can buy at most i stock on the ith day. // If the cu...
ALGO
0.999973
5.195248
{ "github_metadata": { "branch": "main", "commit_count": 79, "repo_created_at": "2022-12-14T08:39: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": "96e3dbc6a29...
981e23ce-b5bb-4560-82e9-03daf74767ae
rajpatel10124/DSA
arr.cpp
// #include <iostream> // find the number of pairs of which sum equals to the target sum // using namespace std; // int main() // { // int array[]={3,4,6,7,1}; // int tagsum=99,pairs=0; // for(int i=0;i<5;i++){ // for(int j=i+1;j<5;j++){ // if(array[i]+array[j]==tagsum) // { // ...
ALGO
0.999869
3.705482
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-09-06T11:14: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": "dce6192d23cd...
415e10e1-e4d8-4de7-9a0f-01939dc13fa9
DucAnhNg2k2/SourceCode
Codeptit - CTGL & GT/DSA06039_SODAUTIENBILAP.cpp
#include <bits/stdc++.h> #define LL long long #define ULL unsigned long long #define FOR(i,a,b) for(int i=a;i<=b;++i) #define FO(i,a,b) for(int i=a;i<b;++i) #define FORD(i,a,b) for(int i=a;i>=b;--i) #define fi first #define se second #define pb push_back #define mp make_pair #define endl '\n' #define debug cout << "YE...
ALGO
0.999966
4.085886
{ "github_metadata": { "branch": "main", "commit_count": 120, "repo_created_at": "2022-03-12T17:05:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3e87048d8d...
e133aeb6-d2df-4084-829a-8de880808037
realAYAYA/UnrealEngine-ToonLit
UnrealEngine/Engine/Source/Runtime/MeshUtilitiesCommon/Private/LayoutUV.cpp
// Copyright Epic Games, Inc. All Rights Reserved. #include "LayoutUV.h" #include "Algo/IntroSort.h" #include "Async/Async.h" #include "DisjointSet.h" #include "OverlappingCorners.h" #include "HAL/PlatformTime.h" #include "Misc/App.h" #include "Misc/SecureHash.h" #include "Modules/ModuleManager.h" IMPLEMENT_MODULE(FD...
ALGO
0.995772
5.311869
{ "github_metadata": { "branch": "5.4", "commit_count": 164, "repo_created_at": "2023-03-14T06:10:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 66, "forks": 9, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "b5ead32e4c...
3ac0cec1-4e1a-4fa9-8b69-76eeac998728
RisshabSingla/Competitive-Programming
Code Forces/Contests/Round #927 (Div. 3)/B.cpp
#include <iostream> #include <vector> #include <algorithm> #include <map> #include <unordered_map> #include <cmath> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; const int mod = 1000000007; int main() { int cases; cin >> cases; while...
ALGO
0.999992
4.360086
{ "github_metadata": { "branch": "main", "commit_count": 138, "repo_created_at": "2022-10-29T12:01: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": "c6fba8e1a5...
d7ebbc9b-f308-4ff1-9867-57a38ca03ea2
Debian/pytorch
torch/csrc/jit/codegen/cuda/kernel_cache.h
#pragma once #include <torch/csrc/jit/codegen/cuda/executor.h> #include <torch/csrc/jit/codegen/cuda/fusion.h> #include <torch/csrc/jit/codegen/cuda/scheduler.h> #include <c10/util/ArrayRef.h> #include <torch/csrc/WindowsTorchApiMacro.h> #include <type_traits> #include <unordered_map> namespace torch { namespace ji...
ALGO
0.98527
5.983288
{ "github_metadata": { "branch": "master", "commit_count": 188, "repo_created_at": "2021-01-27T11:15:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5342d5312...
16d958b5-1a38-49fb-8a58-e767637d1240
google/ink
ink/geometry/internal/legacy_segment_intersection.h
// Copyright 2024 Google LLC // // 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 applicable law or agreed to in ...
ALGO
0.931103
7.102538
{ "github_metadata": { "branch": "main", "commit_count": 218, "repo_created_at": "2019-01-02T16:04:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 37, "forks": 9, "issues": 0, "pull_requests": 22 }, "file_meta": { "content_id": "fc0d6642a...
199cf45a-ac6f-4579-94a1-06c667a35087
YTGhost/Algorithm
Codeforces/1148B.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n, m, ta, tb, k; cin >> n >> m >> ta >> tb >> k; vector<int> a(n); vector<int> b(m); for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < m; i++) { cin >> b[i]; } if (k >= n || k >= m) { ...
ALGO
0.999994
3.898208
{ "github_metadata": { "branch": "master", "commit_count": 1193, "repo_created_at": "2019-11-29T04:18:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f27c45c...
6e69d03b-2baa-486d-ba60-0916631f643f
tugrulyatagan/itu_comp_eng_lectures
BIL 105E - Intr to Sci&Eng Comp (C)/Bil105 Odevler/Odev 3/resources/multip-1.cpp
#include <iostream> #include <fstream> #include <string> #include <iomanip> using namespace std; int read_file(ifstream& in_file, int &row, int &col, double *array, double **matrix) { for (int i = 0; i < row * col; i++) in_file >> array[i]; in_file.seekg (3, ios::beg); for (int i = 0; i < row; i++) { for (...
ALGO
0.989736
3.677217
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2020-09-20T11:47:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 18, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c1298df5...
7e9ed293-eafd-4c82-801f-44acf4874c9d
f4t4nt/competitive-programming
archive/Kattis/rasterizedlines.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using ch = char; using str = string; #define pb push_back #define elif else if #define sz(C) (ll) C.size() #define all(C) C.begin(), C.end() #define flip(C) reverse(all(C)) #define ssort(C) sor...
ALGO
0.999942
4.635603
{ "github_metadata": { "branch": "main", "commit_count": 83, "repo_created_at": "2021-12-06T03:40:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1a618b6196f...
24c72de6-6bc5-4c6d-a1cd-be1a7d9f67f2
wangyenjen/JAW-codebook
contest/OpenCup X Saratov/K.cpp
#include <cstdio> #include <cmath> #include <algorithm> #include <vector> using namespace std; constexpr long double pi = acos(-1); long double d[50000], t[50000]; bool check(long double r, int n, int k) { long double c = 2 * pi / k; long double r2 = r * cos(pi / k); vector<pair<long double, long double>...
ALGO
0.999842
4.520913
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2019-02-25T14:54:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 19, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b6b721ae...
c6621b4f-5cbb-4375-81c7-b9e180ea18f0
Sumit4399/Problem-Solving
105-construct-binary-tree-from-preorder-and-inorder-traversal/105-construct-binary-tree-from-preorder-and-inorder-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.999992
6.567279
{ "github_metadata": { "branch": "main", "commit_count": 2272, "repo_created_at": "2021-10-26T19:34:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f8abb1ea4...
2df3ad9e-4781-4d91-ab96-6fe2b3397978
qq734628996/ac-code
UVALive/3695/18605477_AC_6ms_0kB.cpp
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i = 0; i < n; i++) #define PER(i,n) for(int i = n-1; i >= 0; i--) #define FOR(i,l,r) for(int i = l; i <= r; i++) #define ROF(i,l,r) for(int i = r; i >= l; i--) #define DEBUG(x) cout << #x << "=" << x << endl; #define SHOW1(A,n) { REP(i,n-1) printf(...
ALGO
0.999867
3.661728
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-05-23T08:33:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "895dd40b79...
b4181108-42b7-404b-b093-b58cc7574f5e
ishandutta2007/codeforces-p
pctprobability/normal/1707/D.cpp
#include <bits/stdc++.h> using namespace std; #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; #endif using ll = long long; using ld = long double; using ull = unsigned long long; #define endl "\n" typedef pair<int, int> Pii; #define REP(i, n) for (int i = 0; i < (n); ++i) #define REP3(i...
ALGO
0.999783
4.573209
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:49: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": "cb22c2ff585c...
bc48ec2a-7dc3-46ac-bf98-9c31758747db
facebookexperimental/object-introspection
oi/OID.cpp
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * 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 appli...
TOOL
0.905493
6.432479
{ "github_metadata": { "branch": "main", "commit_count": 510, "repo_created_at": "2022-12-19T14:26:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 176, "forks": 18, "issues": 60, "pull_requests": 11 }, "file_meta": { "content_id": "529944...
f57e6ba4-bfef-462c-aeae-cea967ed45b2
chestnutprog/CODING
20161220/cfc.cpp
#include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <algorithm> #include <iostream> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <string> #define inf 1000000000 #define maxn 500 + 100 #define maxm 500 + 100 #define eps 1e-10 #define ll long lon...
ALGO
0.999989
3.750747
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2016-04-03T04:07: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": "3040e0457...
fe8991a1-2a78-4df2-b36d-cc3159a7a050
cksckckcks/Algorithm
백준/Gold/10942. 팰린드롬?/팰린드롬?.cc
#include <iostream> using namespace std; int board[2001]; bool dp[2001][2001]; int main() { ios::sync_with_stdio(false); cin.tie(0); int N, M; cin >> N; for (int i = 1; i <= N; i++) cin >> board[i]; cin >> M; for (int i = 1; i <= N; i++) { if (board[i] == boar...
ALGO
0.999993
4.539328
{ "github_metadata": { "branch": "main", "commit_count": 231, "repo_created_at": "2023-10-04T04:56:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3c9577f0ff...
87130c17-2893-4270-a2b9-42efcd4c4a6a
smbanasik/Line-of-Sight-Algorithm
line_of_sight.cpp
#include "line_of_sight.hpp" #include <vector> #include <iostream> #include <fstream> #include <string> #include "line_algorithm.hpp" // TODO: it may be useful to make some utility that handles the creation of things like this, // and add them to a personal library // Also, doesn't actually create a square. It can m...
ALGO
0.998597
4.911063
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-02T16:45:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "49ec8ec673f2...
4705f9ef-62c7-4611-ab94-015317ff6691
rosekc/acm
contest/2016/2016HenanACM/C.cpp
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const int MAXN = 10000 + 20; struct qnode { int v; double c; qnode(int _v = 0, double _c = 0): v(_v), c(_c) {} bool operator <(const qnode &r)const { return c < r.c; } }; struct Edge { int v; double cost; ...
ALGO
0.999817
3.789763
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2017-02-20T13:52: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": "7d8fca4d0...
7818259e-6013-430a-beb8-822bfc423d79
omtripathi01/Projects
CodingProblems/Graph/GraphRepresentations.cpp
// Adjacency Matrix // Adjacency List (using jagged arrays/vectors) #include<bits/stdc++.h> using namespace std; class Graph{ private: int numVertices; vector<vector<bool>> adjMat; bool isdirectedGraph = false; public: Graph(bool directedGraphStatus = false):isdi...
ALGO
0.999502
5.474644
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2021-12-07T07:45: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": "108b8bcb9...