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 |
|---|---|---|---|---|---|---|---|
b6df2825-57cc-4d2b-940c-8a9075da58ff | gemy26/LeetCode | 3629-total-characters-in-string-after-transformations-i/3629-total-characters-in-string-after-transformations-i.cpp | class Solution {
public:
int lengthAfterTransformations(string s, int t) {
int MOD = 1e9 + 7;
vector <int> frq(27, 0), temp(27, 0);
for(auto i : s) frq[i - 'a'] ++;
for(int i = 0; i < t; i ++){
for(int j = 0; j < 26; j ++){
if(frq[j]){
... | ALGO | 0.999992 | 5.807387 | {
"github_metadata": {
"branch": "main",
"commit_count": 931,
"repo_created_at": "2024-01-11T12:15:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9acc10af5... |
a568fdeb-b644-4da7-97df-153d9099e954 | udy11/basic | mathematics/fourier_transform/discrete_cosine-sine-transforms_using_FFTW/dcstufftw.nd.64.cpp | /*
Last updated: 24-Nov-2014
<NAME> (<EMAIL>, telegram: https://t.me/udy11)
Source: https://github.com/udy11, https://gitlab.com/udy11
Template program (64-bit) to calculate Discrete Cosine and
Sine Transform of n-dimensional real array using FFTW libraries
This template program is for quick reference to calculate FFT... | ALGO | 0.999823 | 5.541455 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2022-05-16T09:51:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8ec769ebbf... |
0606fde6-7fc4-47cd-9a61-d98a15e39671 | MaksSt33/lab10.1.b | lab10.1b.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include <Windows.h>
using namespace std;
// Перелік спеціальностей
enum Specialnist { KN, INF, ME, FI, TN };
string specialnistStr[] = { "Комп'ютерні науки", "Інформатика", "Математика та економіка", "Фізика та інформатика", "Трудове навчання" };
// Структура ... | TOOL | 0.977172 | 5.864487 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-13T21:33:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f74138fa235... |
457eca04-2e61-46fe-828a-b20f54fe9355 | gky360/contests | atcoder/arc075/f/f.cpp | // AtCoder Regular Contest 075
// F - Mirrored
#include <cstdio>
#include <cmath>
using namespace std;
typedef long long int ll;
const int MAX_K = 9;
ll D;
ll pow_dec[2 * MAX_K + 1];
ll ans;
ll count_n(int l, int r, ll d) {
if (l - r < 0) {
return (d == 0) ? 1 : 0;
}
ll cnt = 0;
int k;
... | ALGO | 0.999423 | 3.696162 | {
"github_metadata": {
"branch": "master",
"commit_count": 1196,
"repo_created_at": "2017-12-10T10:00:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b53a29... |
56775a12-6a40-4d53-af00-47d50037c184 | Raj-Thombare/dsa | sorting/insertionSort.cpp | #include <iostream>
using namespace std;
void printArray(int arr[], int n) {
for (int i = 0; i < n; i++) {
cout << arr[i] << " ";
}
}
int main() {
int arr[7] = {10, 1, 7, 4, 8, 2, 11};
int n = 7;
for (int i = 1; i < n - 1; i++) {
int temp = arr[i]; // 4
// [1 7 10] 4 8 2 11
// [1 7 4] 10 8... | ALGO | 0.999977 | 5.095808 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-22T15:20: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": "4d007ffce345... |
b07379f1-bfb0-472f-b68f-3127c37dab43 | allwellll/cf_code_jiangly | cuiaoxiang/1370F/1370F1-F1-TheHiddenPair(EasyVersion).cpp | // url:https://codeforces.com/contest/1370/problem/F1
// time:2021-11-15 15:01:58
// name:F1-TheHiddenPair(EasyVersion)
#define LOCAL
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <... | ALGO | 0.999623 | 4.138978 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2022-10-17T23:31:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 97,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "184a9da514... |
bcc71099-c9f5-4993-83fa-a0cf4e83b804 | kazuma8128/procon-lib | Others/imos.cpp |
// one dimension
template <typename T>
class imos {
int n;
vector<T> v;
public:
imos(int n) : n(n), v(n + 1) {}
T& val(int i) { assert(0 <= i && i < n); return v[i + 1]; }
void add(int l, int r, T x) { assert(0 <= l && l <= r && r <= n); val(l) += x; if (r < n) val(r) -= x; }
void build() { for (int i = 1; i <= ... | ALGO | 0.999656 | 4.836977 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2017-12-06T03:18:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76e6d107f... |
acd5f209-7d43-45af-b3fa-ae564ca03374 | theNded/Open3D | src/Open3D/Visualization/Utility/SelectionPolygon.h | // ----------------------------------------------------------------------------
// - Open3D: www.open3d.org -
// ----------------------------------------------------------------------------
// The MIT License (MIT)
//
// Copyright (c) 2018 www.open3d.org
//
// Permissio... | TOOL | 0.944036 | 7.491201 | {
"github_metadata": {
"branch": "cuda",
"commit_count": 2859,
"repo_created_at": "2018-02-11T05:18:04.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "isl-org/Open3D",
"stars": 129,
"forks": 20,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_i... |
427bc7e5-26fa-4c24-a891-c5da932c272d | amandalauen00/gitlab-imported | CSC 215 Spring 2020/csc215s20work-master/p2002/p2002.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
#include <limits>
using namespace std;
int main()
{
long long int num;
//long long int curr_num;
long long int min;
long long int count = 0;
long long int max;
long long int sum = 0;
double average = 0.0;
cout << fixed << set... | ALGO | 0.986049 | 3.308812 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-03-28T18:00:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c752c99ef875... |
22a51492-a9ce-4791-8ac5-6e4e897841f8 | hwanzar/Code | Comp-programing/CP2-LV2/5-Generation/02.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 16;
int n;
int a[MAXN];
int bin[MAXN];
int res = 0;
int chk = 0;
int cnt = 0;
// generating binary
// if 1 clockwise
// if 0 counter
void check()
{
int tmp = 0;
for (int i = 1; i <= n; i++)
{
if (bin[i] == 1)
{
tmp... | ALGO | 0.999985 | 3.592008 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2021-10-30T04:37:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9c0fce0343... |
b82662a9-c126-485c-bbf8-4853e64363f2 | AmanSoni28/DSA-Everyday | 16.Majority Element.cpp | // topic link :https://leetcode.com/problems/majority-element/description/
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int majorityElement(vector<int>& nums) {
//1. brute force approach T(c)=>O(n^2)
int n=nums.size();
// for(int i: nums){
// int frequency=0;
... | ALGO | 0.999986 | 5.158468 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2025-03-29T14:48:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cef57167727... |
7dddbb78-41e4-4124-8155-a929b3d2b6bf | ishandutta2007/codeforces-g | gisp_zjz/normal/1662/G.cpp | #include<bits/stdc++.h>
#define pb push_back
using namespace std;
typedef long long ll;
const int maxn=1000005;
typedef bitset<maxn> bs;
bs A;
ll ans;
int n,sz[maxn],cnt[maxn];
vector<int> G[maxn];
void dfs(int u,int fa){
sz[u]=1;
for (auto v:G[u]){
if (v==fa) continue;
dfs(v,u);
sz[u]+=... | ALGO | 0.999095 | 3.619081 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55: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": "590998341a6d... |
1935170c-6e8a-4a9e-b496-2f4cd12e9f17 | Dolfinstein/Algorithm | Script/57. Insert intervals.cpp | // 57. Insert intervals 可以再嘗試寫其他寫法,這個寫法是單純把56的答案拿來用,試試看不用56的答案
#include <iostream>
#include <vector>
using namespace std;
// Function to partition the array into two sub-arrays based on the pivot element
int partition(vector<vector<int>>& arr, int low, int high) {
int pivot = arr[high][0]; // Choose the pivot as th... | ALGO | 0.999988 | 5.669464 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-02-21T01:30: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": "ce6d6e4bc332... |
85168504-2ea2-42ec-9424-f00fc68913e9 | filippoArcariUNI/Programmazione1 | esercitazioniLaboratorio/esercizi11-07/es1.cc | // Scrivere un programma che, dati a linea di comando tre valori,
// due numeri e un operatore, ritorni a video il risultato
// dell’operazione matematica definita dall’operatore.
#include <iostream>
using namespace std;
int main(int nArg, char * arg[]){
if (nArg!=4)
{
cout << "Erorre, numero Argomenti... | ALGO | 0.933696 | 3.761207 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2023-10-05T09:01:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b2af48116... |
8d9c05a3-860a-412a-ac08-b81fec45d602 | LeonardoFassini/Competitive-Programming | URI/2853-TIMMY.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXV = 1123;
int v[MAXV][MAXV], aux[MAXV][MAXV];
int movi[] = { 0, 1, -1, 0};
int movj[] = { 1, 0, 0, -1};
int n, m;
int valido(int i, int j){
return (i >= 0 && j >= 0 && i < n && j < n);
}
int solve(int step){
memset(aux, 0, sizeof(aux));
for(int i = 0... | ALGO | 0.999981 | 3.904792 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2018-11-12T18:47: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": "e5d29d034... |
4152ac06-6ee1-47d2-a2a8-6a27061ba58f | lipan6461188/icSHAPE-pipe | PsBL/RNA_Structure_Class/src/probknot.cpp |
#include "probknot.h"
//Assemble the ProbKnot structure from base pair probabilities.
int ProbKnotAssemble(DynProgArray<PFPRECISION> *v, PFPRECISION *w5, structure *ct, pfdatatable *data, bool *lfce, bool *mod, PFPRECISION scaling, forceclass *fce, int iterations, int MinHelixLength) {
PFPRECISION **probs,*rowprob... | ALGO | 0.999349 | 4.427715 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-07-13T07:22:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 7,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "31813a560... |
ce60e00f-7ca3-419d-98fb-17fd3c7636fc | mahbubur3/DSA | chapter_7_LL_recap.cpp | #include <iostream>
using namespace std;
// Create linked list
/* class Node {
public:
int num;
Node* next;
Node(int num) {
this->num = num;
this->next = NULL;
}
};
void printList(Node* head) {
Node* temp = head;
while (temp != NULL) {
cout << temp->num << " ";
temp = temp->next;
}
}
int main() {
N... | ALGO | 0.99969 | 5.095801 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2024-06-09T10:31:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c08bdba610... |
795f9eab-8bba-4c0d-9b5c-12bef925c8c8 | Bhaikko/data-structures | Graphs/DFS.cpp | #include <iostream>
void dfs(int** graph, int vertices, int currentVertex, bool* isVisited)
{
std::cout << currentVertex << " ";
isVisited[currentVertex] = true;
for (int i = 0; i < vertices; i++) {
if (graph[currentVertex][i] && !isVisited[i]) {
isVisited[i] = true;
dfs(gr... | ALGO | 0.999957 | 5.070755 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2019-11-22T08:51:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc67f73c6... |
852cfee3-0128-4006-9fb4-bbb5d881e4d4 | SpencerWie/CPP | Longest_Inc_Sub/LIS.cpp | #include <iostream>
#include <fstream>
#include <math.h>
#include <vector>
#include <string>
using namespace std;
void readFile();
void findSeq();
vector<int> X; // Dynamic vector to use as array. Starting seq
int main()
{
readFile();
findSeq();
}
// Get the input file, per line and place into array A. Place... | ALGO | 0.999901 | 4.059167 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2013-09-15T03:03:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c99140b9... |
f8e82836-58d7-4580-a7eb-43ca6d9383f6 | cran/DPWeibull | src/reggilks.cpp | #include <iostream>
#include <vector>
#include <Rmath.h>
#include <R.h>
#include <algorithm>
#include <math.h>
#include <Rcpp.h>
using namespace Rcpp;
#include "arms.h"
#include "commonfunc.h"
#include "auxfuns.h"
#include "noreg.h"
struct reg_loglambda_parm{
double alpha, alpha0, lambda0;
double *tl;
double *tr;
... | ALGO | 0.993628 | 4.778769 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-06-13T20:24:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcdf01613da... |
faa73e17-5f17-4636-b38c-640bbbbb8dc7 | fahimfarhan/FarCryCoding | Codes/SlidingWindow/sample-problems/failed-tle-leetCode-219-contains-duplicate-ii.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
return false;
}
bool failedTleContainsNearbyDuplicateV2(vector<int>& nums, int k) {
int N = nums.size();
if(N < 2) {
return false;
}
int j ... | ALGO | 0.99961 | 5.670548 | {
"github_metadata": {
"branch": "develop",
"commit_count": 180,
"repo_created_at": "2022-01-28T13:47:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a118c2... |
b45ee8b1-93ab-4f87-bf0c-b1b81eb224f8 | apschni/ITMO-alg-1sem | 3/lab3.3/main.cpp | #include <iostream>
#include <string>
using namespace std;
pair<long, long> pars[100000];
long n;
void siftDown(long i) {
long left = 2 * i + 1;
long right = 2 * i + 2;
long j;
if (right < n && pars[right].first < pars[i].first) {
j = right;
} else {
j = i;
}
if (left <... | ALGO | 0.999908 | 4.051337 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-11-26T09:58:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e795a97f0d... |
627134d7-a98e-491d-8d82-4db2c250262c | Moinak-Majumdar/ds-cpp | heap_sort.cpp | #include<conio.h>
#include<iostream>
using namespace std;
void heapify(int arr[],int n,int i)
{
int largest = i;
int l = 2*i+1;
int r = 2*i+2;
// If left child is larger than root
if (l < n && arr[l] > arr[largest])
largest = l;
// If right child is larger than largest so far
if (r<n&&arr[r]>arr[largest]... | ALGO | 0.999933 | 4.134512 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-10-20T08:16: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": "77e98e690afc... |
eeeeb66d-7385-42e1-ac70-3040f8539033 | Rahul0Singh0/DSA | 18. DP/4/15_Best_Time_to_Buy_and_sell_with_cooldown.cpp | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
class Solution {
public:
int dp[5005][2][2];
int f(vector<int>& p, int i, bool on, bool cool) {
if(i == p.size()) return 0;
if(dp[i][on][cool] != -1) return dp[i][on][cool];
int ans = 0;
ans = f(p, i+... | ALGO | 0.999857 | 4.721915 | {
"github_metadata": {
"branch": "main",
"commit_count": 199,
"repo_created_at": "2024-08-06T08:14:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "994da6293f... |
6454935a-95b6-483d-ade0-efe83f3ded40 | ton-blockchain/ton | tdfec/td/fec/raptorq/Solver.cpp | /*
This file is part of TON Blockchain Library.
TON Blockchain Library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later ver... | ALGO | 0.999877 | 6.715352 | {
"github_metadata": {
"branch": "master",
"commit_count": 1052,
"repo_created_at": "2019-09-07T09:33:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3643,
"forks": 1279,
"issues": 134,
"pull_requests": 67
},
"file_meta": {
"content_id": ... |
f4ea3cf1-35e3-4488-a5b9-2d7aef01d05c | devaharish2004/Neetcode-150 | Arrays/Two Sum/Code.cpp | //APPROACH 1 : BRUTE FORCE
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
int n = nums.size();
for (int i = 0; i < n - 1; i++) {
for (int j = i + 1; j < n; j++) {
if (nums[i] + nums[j] == target) {
return {i, j};
... | ALGO | 0.99998 | 6.284737 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-03-19T05:07: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": "b4d10e119dec... |
94189348-a202-4340-8f11-69fc910d75ac | ishandutta2007/codeforces-j | jcvb/normal/627/C.cpp | #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<bitset>
#include<utility>
#include<functional>
#include<iomanip>
#include<sstream>
#include<ctime>
#include<cassert>
using namespace std;
#def... | ALGO | 0.999822 | 3.54107 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccd962b6e95e... |
eb7297b9-e4da-4c3c-b1fc-ab36ae08c81e | FrancescoCastagna1998/LSN_Esercitazioni_2020 | Lab10/Es10.2/Travelling_Salesman_Problem_TSP.cpp |
#include "Travelling_Salesman_Problem_TSP.h"
#include "funzioni.h"
using namespace std;
int main (int argc, char *argv[]){
// parallelize in the Single Program Multiple Data (SPMD)
MPI_Init(&argc,&argv); //MPI initialization
MPI_Comm_size(MPI_COMM_WORLD, &size); //to know how many process(node)
MPI_Comm_r... | ALGO | 0.999962 | 4.340589 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-06-24T19:26: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": "eee2492af0... |
4e19b2fc-b11f-4e43-9c0c-a9d89b22a227 | acmeism/RosettaCodeData | Task/Hofstadter-Conway-$10-000-sequence/C++/hofstadter-conway-$10-000-sequence.cpp | #include <deque>
#include <iostream>
int hcseq(int n)
{
static std::deque<int> seq(2, 1);
while (seq.size() < n)
{
int x = seq.back();
seq.push_back(seq[x-1] + seq[seq.size()-x]);
}
return seq[n-1];
}
int main()
{
int pow2 = 1;
for (int i = 0; i < 20; ++i)
{
int pow2next = 2*pow2;
doub... | ALGO | 0.998613 | 4.045527 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2013-04-08T20:08:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 518,
"forks": 177,
"issues": 12,
"pull_requests": 3
},
"file_meta": {
"content_id": "0656445... |
800e87a4-2c46-4b72-9842-6d4365143724 | hbprosper/limits | src/MultiPoissonGammaModel.cc | //--------------------------------------------------------------
//
// Author: <NAME> (<EMAIL>)
// <NAME> (<EMAIL>)
// <NAME> (<EMAIL>)
//
//
// File: MultiPoissonGammaModel.cc
// Description: Implement the Poisson-Gamma model
// marginalized over the nuisance parameters.
//... | ALGO | 0.976204 | 6.633815 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2015-06-17T20:00:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd302c66f... |
85a25026-7ca0-471d-9245-cdb672adc265 | cmbrandt/std-algorithms | include/numeric.hxx | #ifndef NUMERIC_HXX
#define NUMERIC_HXX
#include <iterator>
#include <limits>
#include <functional.hxx>
#include <utility.hxx>
namespace cmb {
//
// Declarations
template <class I, class T>
constexpr T
accumulate(I first, I last, T init);
template <class I, class T, class B>
constexpr T
accumulate... | ALGO | 0.992961 | 6.927764 | {
"github_metadata": {
"branch": "master",
"commit_count": 165,
"repo_created_at": "2020-04-10T20:25:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1128c931... |
982fbcad-a4dc-40cc-bcab-8b93fa1ec65c | zukun/rcc | vxl/vxl-1.13.0/contrib/rpl/rgrl/rgrl_trans_similarity.h | #ifndef rgrl_trans_similarity_h_
#define rgrl_trans_similarity_h_
//:
// \file
// \author <NAME>
// \date Feb 2003
#include "rgrl_transformation.h"
#include <vcl_iosfwd.h>
//: Represents a similarity transformation.
//
// A similarity transform is q = k R p + t, where k is the scale, R
// is an n-dimensional rota... | ALGO | 0.989541 | 6.591017 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2013-02-21T15:10:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6a699a... |
840b12c3-09a9-4c75-8d23-49d2d5db3640 | joy-mollick/Trie-Data-Structure | Toph-MaxXOR.cpp | #include <bits/stdc++.h>
using namespace std;
int idd;
bool check(int n,int pos)
{
return ((bool)(n & (1<<pos)));
}
// trie node
struct TrieNode
{
struct TrieNode *children[2];/// one for one and another for zero
int indx;
};
struct TrieNode *getNode(... | ALGO | 0.998977 | 4.499101 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-02-16T15:58:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d90dc5c6... |
a05c18db-1398-4198-9523-274d765ac1c3 | hex539/tcr | code/snippets/geometry/intersection.cc | #include <bits/stdc++.h>
typedef long double ll; using namespace std;
struct vec2{
ld x,y;
vec2 operator-(vec2 const &a)const{return {x-a.x,y-a.y};}
vec2 operator+(vec2 const &a)const{return {x+a.x,y+a.y};}
vec2 operator*(ld const a)const{return {x*a,y*a};}
vec2 operator/(ld const a)const{return {x/a,y/a}... | ALGO | 0.99683 | 3.744972 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2013-11-17T23:56:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a1cc86ed3... |
201ebfbc-0382-496c-9bb3-385cd6037cfd | rakib181/CP-STAFF | Others/Sorting Practice.cpp | #include<bits/stdc++.h>
using namespace std;
const int MX=100+2;
int cnt[MX];
void Bubblesort(vector<int>& v,int n){
for(int i=0;i<n;i++){
for(int j=0;j<n-i-1;j++){
if(v[j]>v[j+1]){
swap(v[j],v[j+1]);
}
}
}
for(int i=0;i<n;i++){
cout<< v[i] << ' ';
}
cout... | ALGO | 0.999994 | 5.690585 | {
"github_metadata": {
"branch": "main",
"commit_count": 1320,
"repo_created_at": "2022-05-19T19:29:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3e7088ac... |
76b69575-da5c-4909-b35e-62b8e939f8e9 | saimon-cse/CSE2105-data-structures-and-algorithms-I | BST/BST_common.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int key;
Node *left, *right, *parent;
Node(int x){
key = x;
left = right = parent = nullptr;
}
};
class BST{
private:
int length;
public:
Node*root;
BST(){
... | ALGO | 0.999944 | 4.26019 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-11-05T06:34: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": "feb39c5afff... |
0480818e-6ecb-4d38-88d5-850ef96670d4 | jayjmj/algorithm | 9084.cpp |
/*
#include <cstdio>
#include <cstring>
int D[10001];
int coin[20];
int main(){
int T;
scanf("%d",&T);
for(int t = 1 ; t <= T ; t++){
memset(D,0,sizeof(D));
memset(coin,0,sizeof(coin));
int N;
scanf("%d",&N);
for(int i = 0 ; i < N ; i++) scanf("%d",&coin[i]);
int aim;
scanf("%d",&aim);
for(i... | ALGO | 0.999566 | 3.596545 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-06-07T05:03: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": "51dfffe486... |
7958725c-3a71-4b49-b341-20d2d88e244e | pratik8696/LeetCode-Solutions | 1203-sort-items-by-groups-respecting-dependencies/1203-sort-items-by-groups-respecting-dependencies.cpp | vector<int> bfs(int n,unordered_map<int,int> &in,unordered_map<int,vector<int>> &adj)
{
queue<int> q;
for(int i=0;i<n;i++)
{
if(in[i]==0)
{
q.push(i);
}
}
vector<int> ans;
while(q.size())
{
int curr=q.front();
ans.push_back(curr);
q... | ALGO | 0.999995 | 5.027498 | {
"github_metadata": {
"branch": "main",
"commit_count": 1333,
"repo_created_at": "2023-01-04T10:16: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": "bbd857ab5... |
bb772a74-b771-4c02-9fa1-cf97bb5de071 | pacha2880/los-anticuchos | data structures/merge sort tree.cpp | // Mergesort Tree - Time <O(nlogn), O(log^2n)> - Memory O(nlogn)
// Mergesort Tree is a segment tree that stores the sorted subarray
// on each node.
vi t[4*tam];
int ar[tam];
void build(int node, int b, int e) {
if (b == e) { t[node].pb(ar[b]); return; }
build(2*node, b, (b+e)/2);
build(2*node+1, (b+e)/2+1, e);
... | ALGO | 0.999964 | 5.308729 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-03-15T20:18:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e5866667fa... |
b1dc99df-b876-46da-8842-80cc2fc2ab54 | vip7265/ProgrammingStudy | Chapter09_DPTechnique/Genius/ksh_genius.cpp | #include<stdio.h>
#define MOD 2
int N;
int K; // after K-m 30-s
int M;
int length[50];
int likes[10];
double T[50][50];
double memo[2][50][4]; // time, music, length
// like부터 찾아가는데, 쭉쭉가서 0번일 확률 전체 다 더해주면 되는데,
// 메모해야할 것 : 0번째에서 내 위치로 올 확률
// 공간이 부족하네.. 이터레이티브로 쭉 값을 그냥 오면서 계산하는...
// 음.. 전에 현재, 1분, 2분 3분 4분 이렇게만 기억하는... | ALGO | 0.999186 | 3.111672 | {
"github_metadata": {
"branch": "master",
"commit_count": 748,
"repo_created_at": "2018-03-16T07:39:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4272e2fa... |
e44552d4-1511-445d-a8b5-39f94ca684fe | gabriel88766/C-CPP-AlgorithmsAndContests | CSES/RangeQueries/PolynomialQueries.cpp | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
const ll INF_LL = 0x3f3f3f3f3f3f3f3f, MOD = 1e9+7;
const int INF_INT = 0x3f3f3f3f;
const long double PI = acosl(-1.), EPS = 1e-9;
using namespace std;
//tested https://cses.fi/problemset/task/1651 with lazy
// O(log n) query and up... | ALGO | 0.999953 | 5.472343 | {
"github_metadata": {
"branch": "master",
"commit_count": 436,
"repo_created_at": "2020-08-21T00:21:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4893258... |
873b8379-4809-4764-91c8-139183365e17 | peacepiece7/cpp-playground | algorithm/2178_미로탐색(bfs)/main.cpp | /* 전형적인 bfs 기초
https://www.acmicpc.net/submit/2178/46570168
문제
N×M크기의 배열로 표현되는 미로가 있다.
1 0 1 1 1 1
1 0 1 0 1 0
1 0 1 0 1 1
1 1 1 0 1 1
미로에서 1은 이동할 수 있는 칸을 나타내고, 0은 이동할 수 없는 칸을 나타낸다. 이러한 미로가 주어졌을 때, (1, 1)에서 출발하여 (N, M)의 위치로 이동할 때 지나야 하는 최소의 칸 수를 구하는 프로그램을 작성하시오. 한 칸에서 다른 칸으로 이동할 때, 서로 인접한 칸으로만 이동할 수 있다.
위의 예에서는 15칸을 ... | ALGO | 0.999974 | 4.955312 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2022-06-20T13: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": "11f807a3b33... |
34b06b8f-ee0d-4d43-b0a4-8ab22e74c3b6 | xinhaohao/highSpeedRailway | geoLib/geolib.cpp | #include "geolib.h"
#include "map"
#include "math.h"
#include "algorithm"
using std::map;
using std::transform;
static inline double pow2(double d)
{
return pow(d, 2);
}
map<string, vector<double>> elopsoids =
{
{"CLK66", {6378206.4, 294.9786982}},
{"GRS67", {6378160.0, 298.247167427}},
... | ALGO | 0.999124 | 5.607666 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-10-05T08:19:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c12daedf85... |
ed285c4f-388d-4748-98f1-c6b15ed6d0de | Debmalya24/learningCpp | .vscode/1D-ARRAY.cpp/meregeTwoSortedArrays.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector<int>merge(vector<int>&v1,vector<int>&v2){
int n=v1.size();
int m=v2.size();
vector<int>res(m+n);
int i=0;
int j=0;
int k=0;
while(i<=n-1 && j<=m-1){
if(v1[i... | ALGO | 0.99996 | 4.696762 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-07-12T08:55: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": "49388c191f6... |
6eb70b76-d7e5-411f-9d4e-62ab9b823ebc | ghozt777/cp | leetcode/c++/arrays/first-and-last-position-of-element-in-sorted-array/main.cpp | // link : https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/
class Solution {
int binarySearch(vector<int> & arr , int start , int end , int target){
if(start > end) return -1 ;
int mid = start + (end - start) / 2 ;
if(arr[mid] == target) return mid ;
... | ALGO | 0.999963 | 6.34979 | {
"github_metadata": {
"branch": "main",
"commit_count": 132,
"repo_created_at": "2021-10-12T10:42:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c7f6f5eca... |
ba58bd98-51df-4b3a-af58-1990bd0902d7 | ibudiselic/contest-problem-solutions | tc 160+/SequenceOfNumbers.cpp | #include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
using namespace std;
int toInt(const string &s) {
int x;
sscanf(s.c_str(), "%d", &x);
return x;
}
string toStr(int x) {
ostringstream os;
os << x;
return os.str... | ALGO | 0.999844 | 5.165742 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2011-08-14T11:43:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ade612031... |
2ffc8ac3-a929-497f-a472-6812f5e5bf3b | s4mul/baekjoon | Disjoint_Set_1043.cpp | #include <iostream>
using namespace std;
typedef struct person{
int ID;
person* next;
}person;
person* find(person* attendant);
void margeGroup(person* attendantMaster, person* attendantSlave, int priorityID);
int main()
{
person people[100];
for(int i = 0; i < 51; i++){
people[i].next = &pe... | ALGO | 0.999523 | 3.624825 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2022-12-25T05:11: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": "f8e2a9f287a... |
10317f47-9fd7-48c7-b5c5-5d56564d6c5c | ygx2011/AR_course | AR_for_Win/FinalPlaneSLAM_ygx/orbslam_depthar/include/boost/geometry/strategies/cartesian/cart_intersect.hpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 <NAME>, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to 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)
#ifndef BOOST... | ALGO | 0.999512 | 6.458821 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-12-14T14:06:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 155,
"forks": 45,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "7116b92a... |
6a27206c-f5c5-41dd-a91b-1b024265d155 | m2nja201/Baekjoon | 백준/Bronze/4796. 캠핑/캠핑.cc | #include <iostream>
using namespace std;
#define endl "\n"
// title : 캠핑\
// level : bronze 1
// content : 캠핑장의 경고문 -> 캠핑장은 연속하는 20일 중 10일 동안만 사용할 수 있다.
// 강산이는 이제 막 28일 휴가를 시작했다. 이번 휴가 기간 동안 강산이는 캠핑장을 며칠동안 사용할 수 있을까?
// 캠핑장은 연속하는 P일 중, L일 동안만 사용할 수 있다. 강산이는 이제 막 V일 짜리 휴가를 시작했다.
// 강산이가 캠핑장을 최대 며칠동안 사용할 수 있을까? (1 < L ... | ALGO | 0.999676 | 4.627076 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2022-05-07T14:10: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": "4597108a472... |
a9b7a505-2757-48d1-b48f-cb575745e2db | The1337Dude/AdventOfCode2023 | AoC2023/Source/Solutions/AoCSolution2.cpp | #include "AoCSolution2.h"
#include <stdlib.h>
using namespace std;
void AoCSolution2::Initialize(const vector<string>& FileLines)
{
InputData = FileLines;
}
string AoCSolution2::GetResult(const int Part)
{
int Result = 0;
const map<ECubeColor, int> BagData = {{ECubeColor::Red, 12}, {ECubeColor::Gr... | ALGO | 0.995741 | 5.482657 | {
"github_metadata": {
"branch": "develop",
"commit_count": 8,
"repo_created_at": "2023-12-19T10:34: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": "f4972a45e... |
e1d3c9c9-ef85-4a7f-a5cd-e8791d6ec4bd | sathish1000/ProgrammingExercise | different_summands.cpp | /*
Problem: Maximizing the Number of Prize Places in a Competition
Problem Introduction
You are organizing a funny competition for children. As a prize fund you have 𝐍
candies. You would like to use these candies for top 𝐠places in a competition
with a natural restriction that a higher place gets a larger number of c... | ALGO | 0.999974 | 4.86258 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-06-15T12:33: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": "76506cd50... |
b1fa947c-d7b4-4082-befd-85237d203b5b | ishandutta2007/codeforces-b | bmerry/normal/1051/F.cpp | //#pragma GCC optimize("O3")
//#pragma GCC optimize("-fcx-limited-range")
#pragma GCC target("avx,avx2")
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
# include <sys/time.h>
# include <sys/resource.h>
#endif
/*** TEMPLATE CODE STARTS HERE ***/
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795028841971693993... | ALGO | 0.99998 | 5.098133 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea8bc902458d... |
09481414-91d2-4bd0-badd-0dfe7a656243 | Prince-Hervoet/CppCups | src/RbTree/rb_tree.hpp | #ifndef _RADIX_TREE_H_
#define _RADIX_TREE_H_
#include <cstddef>
#include <utility>
const char kRed = 1;
const char kBlack = 2;
template <typename K, typename V>
class RbTreeNode {
using RbTreeNodePtr = RbTreeNode*;
public:
RbTreeNode() {}
RbTreeNode(K& key, V& value) : key(key), value(value) {}
RbTreeNode(... | ALGO | 0.987563 | 5.213059 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2023-05-22T10:35:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "802c10ddda3... |
14bc3b4a-bb94-46a9-be5c-22108acbfce0 | tnvuhai/FreshmanCode | CAU TRUC DU LIEU VA THUAT TOAN/Hoc List node/Nguyen Vu Hai node list.cpp | /*<NAME> - CNTT K18 CLC - ICTU*/
#include<iostream>
#include <unistd.h>
using namespace std;
typedef int item;
struct Node{
item data;
Node *next;
};
typedef struct Node *List;
//Tao node
Node *make_Node(Node *P, item x){
P = new Node;
P -> next = NULL;
P -> data = x;
return P;
}
int len(List L){
Node *p = ... | ALGO | 0.998885 | 3.546575 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-21T04:16:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c7771ff0e0c... |
c408c785-c539-4137-a75a-edb6e68a53d0 | Botanist-W/Silva | src/Simulation/Dispersal.cpp |
#include "Dispersal.h"
#include "pch.h"
// DISPERSAL
inline point dispersal::dispersalKernal(value& parent) {
// remember that "a" (parent.dispersal) is not the raw mean dispersal distance but insead a transformed value...
// This is the fancy part <-- iverse of a 2dt kernel
float dispDis = parent.se... | ALGO | 0.999897 | 5.519437 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2024-07-24T09:12:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "cc441360a... |
c0008d2c-4815-43bd-b38a-e969148272ee | StevenDunn/CodeEval | SplitTheNumber/cpp/stn.cpp | // Split the Number C++ soln for Code Eval by <NAME>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using std::cout;
using std::endl;
using std::ifstream;
using std::istringstream;
using std::string;
using std::vector;
void split_the_number(string);
v... | ALGO | 0.98396 | 4.900233 | {
"github_metadata": {
"branch": "master",
"commit_count": 731,
"repo_created_at": "2013-07-20T16:17:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "854826f9... |
9fcc4dce-4dca-49b1-9e91-4031fbe81088 | itohdak/Codeforces | Div3/prev/582/F.cpp | #include <bits/stdc++.h>
#include <print.hpp>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()... | ALGO | 0.999997 | 3.565442 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2018-05-21T14:37:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b192ec4c... |
5c588ccd-e1ba-4094-a194-d7dff9a57476 | vaibhavchaubey/Striver-s-A2Z-DSA-Sheet | Recursion/Print_all_Permutations_of_a_String_Array.cpp | /* Leetcode Submission (46. Permutations) */
/* Problem Statement: Given an array nums of distinct integers, return all the possible permutations.
You can return the answer in any order. */
/* Solution 1: */
// Time Complexity: O(N! * N)
// Space Complexity: O(N) + O(N)
// class Solution {
// public:
// v... | ALGO | 0.999955 | 6.866324 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2023-06-26T04:11:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcb10f3e5de... |
9fd04fc7-5f25-4d48-b1f6-d1ffc73cf18e | ishandutta2007/codeforces-j | jjang36524/normal/1437/E.cpp | #include <iostream>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue>
#define int long long
using namespace std;
int arr[500100];
vector<int>pos;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N, K;
cin >> N >> K;
int i;
arr[0] = -(1 << 30);
for (i = 0; i < N; i++)... | ALGO | 0.999961 | 3.695807 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d44b5190191... |
c5206115-3bb2-4afe-be2a-332dab66bddb | lorenzo-ferrari/cses | src/Sorting and Searching/1619-Restaurant Customers.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O3")
using namespace std;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<int> a(n), b(n), c(2 * n);
for (int i = 0; i < n; ++i) {
cin >> a[i] >> b[i];
c[i << 1 ] = a[i];
c[i << 1 | ... | ALGO | 0.999897 | 3.803748 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-12-22T21:25:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7b0f2d1af1... |
4719b3a2-46b2-4eed-945d-34ed135911f0 | hathai25/KTLT | TH3/bt10.cpp | #include<bits/stdc++.h>
using namespace std;
const int MAX = 20;
int N, H;
int x[MAX];
int S[MAX]; // Xau mac dinh de so sanh
//input du lieu
void data(){
cin >> N >> H;
for(int i=0; i<N; i++)
S[i] = 0;
for(int i=0; i<N; i++)
x[i] = 0;
}
//kiem tra 2 co khoang cach Hamming la bnh
int rangeH... | ALGO | 0.999632 | 3.136717 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-04-05T04:23: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": "53566fcf314... |
754744c9-28c0-48fd-9fba-a7dda1a28fa5 | StarRocks/starrocks | be/src/exec/chunks_sorter_topn.cpp | // Copyright 2021-present StarRocks, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required ... | ALGO | 0.999166 | 7.45078 | {
"github_metadata": {
"branch": "main",
"commit_count": 21361,
"repo_created_at": "2021-09-04T02:29:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10338,
"forks": 2050,
"issues": 499,
"pull_requests": 376
},
"file_meta": {
"content_id":... |
c79a5622-04b2-4f18-afc4-e4dc4b2ac8b5 | honey0632/Leetcode-2024-Daily | 05-31-2024.cpp | // 260. Single Number III
// https://leetcode.com/problems/single-number-iii/
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
# define ll long long
vector<int> singleNumber(vector<int>& nums)
{
// Pass 1 :
// Get the XOR of the two numbers we need to find
l... | ALGO | 0.999773 | 5.168227 | {
"github_metadata": {
"branch": "main",
"commit_count": 377,
"repo_created_at": "2023-12-31T19:16: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": "5580feda24... |
8d391df2-7efb-455d-b867-6d673ebdc61a | ahmedshablakh/C_Pluse_Pluse_Project | AlgorithmsProblemSolvingLevel_3/CheckMatrixEquality/CheckMatrixEquality/CheckMatrixEquality.cpp | #include<iostream>
using namespace std;
int RandomNumber(int From, int To)
{
int Number = rand() % (To - From + 1) + From;
return Number;
}
void FillMatrix(int Matrix[3][3], short Rows, short Columun)
{
for (int i = 0;i < Rows;i++)
{
for (int j = 0;j < Columun;j++)
{
Matrix[i][j] = RandomNumber(1, 100);
... | ALGO | 0.999082 | 4.114506 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-10T13:13:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b1728dd3c81... |
eedc572a-2ce4-4bc1-b035-440dd6905ae6 | ishandutta2007/codeforces-t | tokusakurai/normal/1368/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define each(e, v) for(auto &e: v)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x)... | ALGO | 0.999965 | 4.16821 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f96310d831b... |
7c1b2722-32f0-4b01-af3a-4cbc599cf52c | thirofoo/atcoder-archives | dp/dp_i_48434724_WA.cpp | /*
* Author: through
* Submission URL: https://atcoder.jp/contests/dp/submissions/48434724
* Submitted at: 2023-12-12 01:27:23
* Problem URL: https://atcoder.jp/contests/dp/tasks/dp_i
* Result: WA
* Execution Time: 2210 ms
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long do... | ALGO | 0.999936 | 4.871777 | {
"github_metadata": {
"branch": "main",
"commit_count": 5513,
"repo_created_at": "2022-12-17T09:45:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "ff69cf579... |
29891366-7ef1-473b-9cd3-88fd1d0d8c1f | STRIDES-Codes/MicrobeTaxaSARS2 | src/metaspades/src/common/assembly_graph/paths/bidirectional_path_io/io_support.cpp | //***************************************************************************
//* Copyright (c) 2020 Saint Petersburg State University
//* All Rights Reserved
//* See file LICENSE for details.
//***************************************************************************
#include "io_support.hpp"
#include "modules/path... | ALGO | 0.950082 | 5.199306 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2021-05-28T16:52:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5c1111fd142... |
4cae8aa9-b522-46c0-9c83-5a71c5a156e9 | kolmoblocks/imageexpander | bitUtil/bitUtil.cpp | #include "bitUtil.h"
using namespace std;
unsigned int gcd(unsigned int u, unsigned int v)
{
// simple cases (termination)
if (u == v)
return u;
if (u == 0)
return v;
if (v == 0)
return u;
// look for factors of 2
if (~u & 1) // u is even
{
if (v & 1) // v... | TOOL | 0.996297 | 4.347026 | {
"github_metadata": {
"branch": "master",
"commit_count": 174,
"repo_created_at": "2019-02-01T19:42:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5e1de6d4... |
2e2bcfb2-baff-49c0-adfe-4314a0078317 | adityahongal/DSA-CPP | mathsAndPointers/fastExponentiation.cpp | #include <iostream>
using namespace std;
// Modulo Arithmatic Basics
// consider (a % m) -> answer lies in the range [0,1,2....,m-1]
// Then generally to avoid overflow while storing in INT variable
// we do modulo with a large number
// we can derive basic formulas as below and use
// (a+b) % m = a % m + b % m
// (... | ALGO | 0.999912 | 5.462101 | {
"github_metadata": {
"branch": "main",
"commit_count": 251,
"repo_created_at": "2024-05-13T08:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7594a55c2... |
c7d2454d-5acc-43ff-869f-c887661cc7c1 | Ph0en1xGSeek/ACM | Others/Colliders.cpp | #include <iostream>
#include <string.h>
#include <stdio.h>
#include <vector>
#define MAXN 100010
using namespace std;
int arrp[MAXN];///质因数被谁占用
bool vis[MAXN];//标记
bool on[MAXN];
vector<int> ps[MAXN];///质因子打表
void get_prime()
{
memset(vis, false, sizeof(vis));
for(int i = 2; i < MAXN; i++)
{
if(!vis[i])
{
... | ALGO | 0.999862 | 3.667745 | {
"github_metadata": {
"branch": "master",
"commit_count": 558,
"repo_created_at": "2016-07-22T08:18:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "864ea087... |
c24eaa8e-0b4d-4139-a223-02eba7fe0015 | vxl/vxl | core/vgl/vgl_frustum_3d.hxx | #ifndef vgl_frustum_3d_hxx_
#define vgl_frustum_3d_hxx_
#include <iostream>
#include <cmath>
#include "vgl_frustum_3d.h"
#include "vgl_ray_3d.h"
#include "vgl_plane_3d.h"
#include "vgl_tolerance.h"
#include "vgl_intersection.h"
#ifdef _MSC_VER
# include <vcl_msvc_warnings.h>
#endif
//:
template <class Type>
vgl_frust... | ALGO | 0.985709 | 7.076893 | {
"github_metadata": {
"branch": "master",
"commit_count": 42154,
"repo_created_at": "2013-05-02T18:32:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 250,
"forks": 157,
"issues": 49,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c... |
f586633f-fdc2-4d90-8925-623c37aad981 | shaowei-cai-group/z3pp | src/math/lp/permutation_matrix.h | /*++
Copyright (c) 2017 Microsoft Corporation
Module Name:
<name>
Abstract:
<abstract>
Author:
<NAME> (levnach)
Revision History:
--*/
#pragma once
#include "util/vector.h"
#include <algorithm>
#include "util/debug.h"
#include <string>
#include "math/lp/sparse_vector.h"
#include "math/lp/indexed_ve... | ALGO | 0.988886 | 5.25998 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-09-03T11:40:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 48,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ed61b2672... |
823a5b55-9c8b-4fd2-84ec-ee781b41b7a5 | mintdexdev/codeforces | B/lessThan2000/1359B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int _; cin >>_;
while(_--) {
int n, m, x, y; cin>> n >> m >> x >> y;
char arr[n][m];
for (auto &row: arr) {
for (auto &column : row) cin >> column;
}
int one_sq =0, two_sq= 0;
for (in... | ALGO | 0.999645 | 4.034548 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2024-12-25T08:32: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": "409d43f785c... |
1b0f2bb6-904b-4f7b-b4ab-baed6b310ab6 | KresnaB/SDA2 | linked5164.cpp | //nama : <NAME> (181511051)
//nama file : linked51.cpp
//tgl:17-3-2019
//deskripsi : module linked list
#include "linked5164.h"
boolean isEmpty(address p)
//Tujuan : memeriksa apakah linked masih kosong
//Linked list kosong , jika Head == NULL
{
if (p == NULL) {
return true;
}else{
return false;
}
}
v... | ALGO | 0.993463 | 3.752256 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-03-31T08:02: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": "0d9593318a... |
7829480c-9821-4694-a52a-825cfbf5c245 | Real-Man-Club/Baekjoon | devappmin/7562.나이트의 이동.cpp | /**
* @file 7562.나이트의 이동.cpp
* @author @devappmin
* @brief 나이트의 이동(실버2)
* @version 0.1
* @date 2022-01-12
*
* @copyright Copyright (c) 2022 @devappmin
*
*/
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int li[2][8] = {{-2, -1, 1, 2, -2, -1, 1, 2}, {1, 2, 2, 1, -1, -2, -2, -1}};
void so... | ALGO | 0.999763 | 5.723083 | {
"github_metadata": {
"branch": "main",
"commit_count": 1287,
"repo_created_at": "2021-12-23T18:24:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63c5350156... |
335ffe4a-b05d-4e13-a5f0-93e7eb628349 | ABHINAB-CHHETRI/DataStructure-Cpp | LISTS/SINGLE LINKEDLISTS/deletefromEnd.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
class Node
{
public:
int value;
Node *Next;
Node(int value)
{
this->value = value;
this->Next = nullptr;
}
};
class LinkedLists
{
public:
Node *head;
LinkedLists()
{
head = nullptr;
}
void add(int... | ALGO | 0.999714 | 3.793878 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-07-14T14:08:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3570a4481ccd... |
334f1a27-d459-4bf6-b92f-34253b4f2156 | raincross7/code-similarity | codes/train_code/problem233/problem233_121.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(int argc, const char *argv[]) {
ll n, k;
cin >> n >> k;
vector<ll> va(n);
for (int i = 0; i < n; ++i) {
cin >> va[i];
}
vector<ll> psum{0};
partial_sum(va.begin(), va.end(), back_inserter(psum));
transform(psum.begin(), ... | ALGO | 0.999951 | 4.444716 | {
"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": "ac1e59da3d17... |
97375b78-325e-4006-b6a2-5faf8bb91b9d | jieshicheng/OI_practive | 112_AddTwoNumber/main.cpp | #include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
using namespace std;
class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
int step = 0;
ListNode *ans = nullptr;
ListNode *ite... | ALGO | 0.999813 | 5.76144 | {
"github_metadata": {
"branch": "master",
"commit_count": 221,
"repo_created_at": "2017-01-20T03:15:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea4307ba... |
dd6d22a4-3e9b-4c81-9178-44bb31d49193 | kgoel9899/CF_Solutions | codeforces/1945/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define mod 998244353
#define int long long
#define setpres cout << fixed << setprecision(10)
#define all(x) (x).begin(), (x).end()
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
const int INF = 1e18;
#ifdef DEBUG
#de... | ALGO | 0.999992 | 4.214005 | {
"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": "e44c264... |
62fa7ddc-86a3-4fbf-961d-23c018802d59 | dr0pdb/competitive | spoj/dict.cpp | #include<bits/stdc++.h>
#define FOR(i,a,b) for(long long i = (long long)(a); i < (long long)(b); i++)
#define RFOR(i,a,b) for(long long i = (long long)(a); i >= (long long)(b); i--)
#define MIN3(a,b,c) (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c))
#define MAX(a,b) (a)>(b)?(a):(b)
#define MIN2(a,b) (a)<(b)?(a):(b)
using n... | ALGO | 0.999975 | 3.749764 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2017-02-15T19:13: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": "c07130f04... |
b5a013f4-29d7-4e58-a7bc-d3852893f02a | Muralikrishnan5971/c-workspace | cpp/dsalogs/recursion/basicrecursion.cpp | #include <iostream>
using namespace std;
void printName(int n, string name) {
// using recursion we are moving from
// N to 0
if (n == 0 ) return;
cout << name << endl;
n--;
printName(n, name);
}
void printNameRec(int i, int n) {
// in this example we are moving from
// 1 to N
if ( ... | ALGO | 0.999854 | 4.295955 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-07-24T09:45: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": "c4b7ee46054... |
0f52e05a-d4b0-4b98-a4ac-308d82e3e9d1 | caoahn/CodePTIT-DSA | huwefn.cpp | #include<bits/stdc++.h>
using namespace std ;
struct cv {
int s, p ;
float w ;
};
bool cmp(cv x, cv y) {
if(x.w < y.w) return true ;
else if(x.w == y.w && x.s < y.s) return true ;
return false;
}
int main() {
int n ;
cin >> n ;
struct cv a[101] ;
for(int i=0; i < n ; i++) {
... | ALGO | 0.999879 | 4.118614 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-23T13:43:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9309195259b... |
3555b10f-1897-4c32-82cc-9f19ab7f0679 | sheikh-arman/Disjoint-Set-Union-dsu- | Codeforces_1213G_Path Queries_Solution_Disjoint_set_union(dsu)_Accepted_in_c++Latest.cpp | /*
<NAME>
University of Barisal
Problem name :
Algorithm :
*/
#include<bits/stdc++.h>
#define nl printf("\n");
#define N 200001
#define PR pair<ll,ll>
#define sf1(n) scanf("%lld", &n)
#define sf2(n, m) scanf("%lld %lld",&n,&m)
#define sf3(n, m,k ) scanf("%lld %lld %lld",&n,&m,&k)
#define pfn(n) printf... | ALGO | 0.999989 | 3.188118 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-09-05T10:05: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": "3fb18a068... |
279bb495-539a-40f9-82b2-c8b3fcda7fea | ablondal/comp-prog | Real_Contests/NADC_2021/b.cpp | #include <bits/stdc++.h>
using namespace std;
// done
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int MAXN = 2e5+7;
struct SuffixArray {
vi sa, lcp;
SuffixArray(string& ... | ALGO | 0.999894 | 4.035178 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2020-02-27T21:30:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae2a0d9d5... |
212ff453-2a56-423c-b872-804cbf3b6564 | tiankonguse/leetcode-solutions | other/lcp/29/29.cpp | #include <bits/stdc++.h>
#include "base.h"
using namespace std;
typedef __int128_t int128;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<pll> vpll;... | ALGO | 0.99992 | 4.275006 | {
"github_metadata": {
"branch": "master",
"commit_count": 1037,
"repo_created_at": "2015-04-11T09:31:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 81,
"forks": 26,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f589... |
7824e112-849e-40d8-8873-7faa3ee83a9d | earmer/Luogu_answers | HistoryCompetition/10.4/t4.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <bitset>
using namespace std;
const int N = 3 * 1e4 + 10;
int wid;
//bool map[N][N];
//bool vis[N][N];
bitset<N>map[N];
bitset<N>vis[N];
//queue<string> q;
int toint(string s) {
int n = 0, pin = 0;
while (pin < s.length()) {
n ... | ALGO | 0.999806 | 3.255327 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2022-04-17T11:57:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 134,
"forks": 29,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed276e... |
b778c345-2366-48c3-93d5-8d2131326672 | byeongmin-kwak/Baekjoon-Programmers | 백준/Gold/7983. 내일 할거야/내일 할거야.cc | #include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> v;
bool compare(pair<int, int> a, pair<int, int> b) {
if (a.second == b.second) {
return a.first > b.first;
}
else {
return a.second > b.second;
}
}
int main() {
int n;
cin >> n;
for (int i = 0... | ALGO | 0.999921 | 3.518167 | {
"github_metadata": {
"branch": "main",
"commit_count": 459,
"repo_created_at": "2022-07-07T06:21: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": "d94dbda1c5... |
bc00716d-0bd7-46f6-9040-621aaf639804 | koth/elements-of-programming-interviews | populating-next-right-pointers-any-binary-tree.cc | // Copyright (c) 2013 Elements of Programming Interviews. All rights reserved.
#include <cassert>
#include <iostream>
#include <memory>
#include <queue>
#include <vector>
using std::cout;
using std::endl;
using std::queue;
using std::unique_ptr;
using std::vector;
template <typename T>
struct BinaryTreeNode {
T da... | ALGO | 0.99751 | 5.700002 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2016-03-30T01:43:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 14,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd88da0... |
08fa08e6-d30d-49c6-962c-0ddceb14b83f | CandiceD17/Leetcode-Everyday | 0-99/12. Integer to Roman.cpp | class Solution {
public:
string intToRoman(int num) {
int times = 0;
string result = "";
while(num>0){
if(num/1000>0){
times=num/1000;
for(int i=0; i<times; i++)
result += "M";
num -= times*1000;
}
... | ALGO | 0.999816 | 5.934248 | {
"github_metadata": {
"branch": "master",
"commit_count": 277,
"repo_created_at": "2019-07-08T09:40: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": "20faa8c1... |
12ea1352-5198-4004-a13d-500e038d3e59 | sqmedeiros/rouxinol | 1671-Shortest_Routes_I/training-01/1290299.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cout.tie(0);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<long long> dist(n + 1, LONG_LONG_MAX);
dist[1] = 0LL;
vector<pair<long long, long long>> adj[n + 1];
for (int i = 0; i < m; i++) {
... | ALGO | 0.999984 | 3.993687 | {
"github_metadata": {
"branch": "main",
"commit_count": 238,
"repo_created_at": "2024-01-31T15:39:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52bdba3bfd... |
14d2a06e-6345-4e06-b2b1-b16b6a5c07d0 | ElinaMukhamedova/ElinaFjell | Celestial Mechanics/src/celestial_mechanics/integration/Integrator.hpp | #pragma once
#include <vector>
template<typename Tableau, typename RHS>
std::vector<typename RHS::StateAndArg> integrate (
typename RHS::State const& initialState,
typename RHS::ArgType const& beginTime,
typename RHS::ArgType const& endTime,
double const step,
RHS const& rhs) {
std::vect... | ALGO | 0.999847 | 5.721243 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2025-01-08T07:36:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aedb2200c... |
6fda6dee-f0f4-4513-8018-1b3f5d050257 | syarale/LeetCode101 | chapter 11/225 用队列实现栈.cpp |
// 225. Implement Stack using Queues
class MyStack {
private:
queue<int> stk, tmp;
public:
/** Initialize your data structure here. */
MyStack() {
}
/** Push element x onto stack. */
void push(int x) {
while (!stk.empty()) {
tmp.push(stk.front());
st... | ALGO | 0.999473 | 5.88085 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2021-02-07T02:20:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69a846d... |
609d7a08-58ec-4e52-a3b8-9a90dce72e8f | google/or-tools | ortools/set_cover/set_cover_lagrangian.cc | // Copyright 2010-2025 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.999777 | 4.227135 | {
"github_metadata": {
"branch": "stable",
"commit_count": 15256,
"repo_created_at": "2015-02-21T01:25:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12243,
"forks": 2248,
"issues": 60,
"pull_requests": 12
},
"file_meta": {
"content_id":... |
371cc760-94b4-4b3b-8314-edea9ec28276 | emercoin/emercoin | src/miner.cpp | // Copyright (c) 2009-2010 <NAME>
// Copyright (c) 2009-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <miner.h>
#include <amount.h>
#include <chain.h>
#include <chainparams.h>
#includ... | ALGO | 0.937896 | 6.51761 | {
"github_metadata": {
"branch": "master",
"commit_count": 24020,
"repo_created_at": "2016-02-20T20:14:54.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "peercoin/peercoin",
"stars": 126,
"forks": 43,
"issues": 15,
"pull_requests": 0
},
"file_meta": {
"con... |
fc694563-1161-4130-a820-9824604c7148 | Vankeep/lessoncpp | lesson/pushBaskArray.cpp | #include <iostream>
using namespace std;
void fillArray(int* arr, const int size) {
for (int i = 0; i < size; i++) {
*(arr + i) = rand() % 11;
}
}
void showArray(const int* const arr, const int size) {
cout << "\nshowArray()\n&arr = " << &arr << "\t\tarr = " << arr << "\t\t*arr = " << *arr <<... | ALGO | 0.98489 | 4.441657 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-03-24T00:04:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76bbf6f352b... |
fc1d7dce-6802-4aa6-aa02-2d350b19fa13 | bomel-official/git_edu | 4sem_laba5/task3.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm> // Для использования std::find_if
// Структура для представления записи о книге
struct Book {
std::string id;
std::string author;
std::string title;
int pages;
// Вывод информации о к... | TOOL | 0.963856 | 6.016158 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-03-07T17:22: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": "69170752be9... |
3f475859-f95c-4118-9447-5b474d5fd818 | bossbobster/USACO-Training | Agri-Net.cpp | #include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <set>
#include <bitset>
using namespace std;
typedef pair<int, int> pii;
vector<pii> adj[110];
bitset<110> finalized;
int minDist[110];
int queries[110][110];
int map[10010];
int main()
{
int n, d, curD, curN = 0, ans = 0;
cin... | ALGO | 0.999882 | 3.598926 | {
"github_metadata": {
"branch": "master",
"commit_count": 560,
"repo_created_at": "2019-08-27T05:07:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e977fb3f... |
8d212a0b-3399-42bf-9c96-d5e430e03a3b | pawan-nirpal-031/Algorithms-And-ProblemSolving | Active/Training/Training1000-1400/Game_of_Pooks.cpp | // Problem Link :
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
#define Mod 1000000007
#define Infinity (ll)1e18
#define Append(a) push_back(a)
#define Pair(a,b) make_pair(a,b)
#define Clear(a) for(ll &x : a){x=0;}
#define Point(x) s... | ALGO | 0.999944 | 4.932097 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2021-03-16T14:30:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36562a58... |
495c417c-f104-47dd-abe2-8cefb3ecde5a | SeanCampbell/WordAnalysis | vxl_src/contrib/brl/bseg/bvpl/bvpl_octree/bvpl_discover_pca_kernels.h | // This is brl/bseg/bvpl/bvpl_octree/bvpl_discover_pca_kernels.h
#ifndef bvpl_discover_pca_kernels_h
#define bvpl_discover_pca_kernels_h
//:
// \file
// \brief A class to discover those features that represent the data the best in a least square sense using PCA
// \author <NAME> <EMAIL>
// \date 8-Nov-2010.
//
// \ver... | ALGO | 0.958021 | 4.231506 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2016-02-16T04:49:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3224c9d21... |
c0d57e8b-a919-4342-bc64-fe67adb80f1e | sachin-bi/DSA-450 | find_sqRoot.cpp | #include <iostream>
#include <vector>
using namespace std;
int find_sqroot(int target)
{
int s = 0;
int e = target;
int mid = s + (e - s) / 2;
int ans = -1;
while (s <= e)
{
if (mid * mid > target)
{
e = mid - 1;
}
else if (mid * mid < target)
... | ALGO | 0.99995 | 3.746919 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-12-21T08:30: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": "dbc12020ac7... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.