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 |
|---|---|---|---|---|---|---|---|
284d1abd-a846-4d7e-a36e-42634d312757 | ishandutta2007/codeforces-a | alexxela12345/normal/825/E.cpp | //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,abm,mmx,avx,avx2,popcnt,tune=native")
//#pragma GCC optimize("fast-math")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
#define all(x) (x).begin(), (x).end()
//#define int ll
//#d... | ALGO | 0.999997 | 4.332646 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "9d3a6eb57ca4... |
473e493e-2cf5-4a47-a7ec-20c7a0294d14 | limon2009/ACM-UVA-Online-Judge-solution | 10891.cpp | #include<stdio.h>
#define maxn 103
typedef long long bg;
bg Table[maxn][maxn];
bg Seq[maxn];
bool Flag[maxn][maxn];
bg N;
bg Sum(int l, int r) {
int i, sum = 0;
for(i = l; i<= r; i++)
sum += Seq[i];
return sum;
}
bg Recur(int L, int R) {
bg max, i, d, k;
if(L == R) return Seq[L];
if(Flag[L][R]) return Tabl... | ALGO | 0.999913 | 3.158017 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-11-13T05:46:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "528f1c0b1e... |
1a06aa91-bb4f-436a-87da-d55960f53c0f | BorisVassilev1/utk_2025 | src/code.hpp | #pragma once
#include <stdexcept>
#include "error.hpp"
#include "gauss.hpp"
#include "golay.hpp"
#include "ndarray.hpp"
class LinearCode {
mutable bool d_computed = false;
mutable int d;
mutable bool r_computed = false;
mutable int r = 0;
public:
NDArray<int, int, int> generator;
NDArray<int, int, int> c... | ALGO | 0.95953 | 5.726796 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2025-05-05T13:46: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": "9effa5ba16... |
c6cb4295-5e86-434c-bfb2-42d8d4414fb1 | NaskoIT/Introduction-To-Programming | 11_Structs/01_structs_advanced_pointers.cpp | #include<iostream>
#include <string>
using namespace std;
struct Company {
string name;
};
struct Employee {
string name;
double salary;
Employee* boss;
Company company;
};
void setName(Employee& employee) {
employee.name = "some_name";
}
int main() {
Employee* boss = new Employee();
... | TOOL | 0.954477 | 3.565815 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2021-10-07T09:48:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba5941806a3... |
833c2704-5831-42e5-9df6-d7a090c75a32 | BinaryDSAStore/LeetCodeQuestions | 1 to 50/45. Jump Game II.cpp | #include <bits/stdc++.h>
using namespace std;
// recursive
// int jumprec(vector<int> &nums, int idx)
// {
// int n = nums.size();
// if (idx >= n)
// return 1e8;
// if (idx == n - 1)
// return 0;
// int ans = INT_MAX;
// int j = nums[idx];
// for (int i{1}; i <= min(j, n - id... | ALGO | 0.999987 | 5.181085 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2023-01-15T18:58: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": "a4570a24243... |
20b4dfe1-d1ce-4436-ab0c-587dc03ba3fb | DionysiosB/CodeForces | 0300-0399/371C-Hamburgers.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
int main(){
std::string burger(""); getline(std::cin, burger);
long long numB(0), numS(0), numC(0);
for(int k = 0; k < burger.size(); k++){
if(burger[k] == 'B'){++numB;}
else if(burger[k] == 'S'){++numS;}
else if(burg... | ALGO | 0.998979 | 3.739501 | {
"github_metadata": {
"branch": "master",
"commit_count": 4487,
"repo_created_at": "2013-06-27T18:15:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 690,
"forks": 163,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b2... |
5747a4c7-db34-4a6b-938a-7e29fb4871ca | michalmaj/cpp_algorithms | 07_bit_manipulation/04_clear_ith_bit/Source.cpp | #include <iostream>
#include <bitset> // To represent numbers in bits
#include <iomanip>
/**
* \brief Function to change bit at given index to 0.
* \param n Number where we want to turn off bit a given index.
* \param i Index of bit that we want to turn off.
*/
void clearIthBit(int& n, int i)
{
// Set bit to 1 at... | ALGO | 0.995689 | 5.569164 | {
"github_metadata": {
"branch": "main",
"commit_count": 233,
"repo_created_at": "2022-08-30T14: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": "61f5afbac0... |
89a760ab-e28f-4b89-a135-0bf26b94e2bb | uneap/algorithm | 2020/20102905.cpp | //백준 이모티콘
#include <iostream>
#include <queue>
using namespace std;
int weight[1001][1001];
bool visited[1001][1001];
int answer = 0;
void initWeight(){
for(int i = 0; i <= 1000; i++){
for(int j = 0; j <= 1000; j++){
weight[i][j] = 0;
}
}
}
void initVisited(){
for(int i = 0; i <... | ALGO | 0.999913 | 3.061169 | {
"github_metadata": {
"branch": "master",
"commit_count": 986,
"repo_created_at": "2018-08-09T00: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": "194c7833... |
2a3750e9-550d-4ef6-892d-c6f715db4602 | Pratiksh28/DS-Assignment-WITH-C- | stack_using Linked List Class.cpp | // C++ program to implement a stack using singly linked list
#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
// Class representing a node in the linked list
class Node {
public:
int data;
Node* next;
Node(int new_data) {
this->data = new_data;
this->next = nullptr;
}
};... | ALGO | 0.99907 | 6.061174 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-07T11:15: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": "3b2fad336ce6... |
ee4841de-976d-4ca3-adbd-af9f15f1e7a5 | H-Shen/My_Code_Collection | Kattis/ordinaryordinals.cpp | // https://open.kattis.com/problems/ordinaryordinals
//
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
// (5*2^(n-1)-1)%m
// (5*2^(n-1)+(m-1))%m
// (5*2^(n-1)%m + (m-1)%m) % m
// 5*2^(n-1)%m = (5%m)*(2^(n-1)%m)%m
ull multmod(ull a, ull b, ull m) {
a = (a % m +... | ALGO | 0.999996 | 4.864091 | {
"github_metadata": {
"branch": "master",
"commit_count": 1586,
"repo_created_at": "2019-04-11T06:48:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b07d14e... |
c6dc1022-ccf8-49ec-b93d-10506f488476 | JustDarkAmigo/educational-practice | Отчет2/4_Задание.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
string decrypt(const string& encrypted, const vector<int>& permutation, int k) {
int n = encrypted.size();
string original = encrypted;
vector<int> inversePermutation(n);
for (int i = 0; i < n; ++i) {
inversePermutatio... | ALGO | 0.999996 | 5.13602 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2025-06-17T14:42: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": "73058ad23c0... |
a31f115c-7861-431e-86e3-58ab1be176c2 | Sushant-Bansode/Data-Structures-And-Algorithms | 15.Trees/Q14-LowestCommonAncestorinaBinaryTree.cpp | /*
Lowest Common Ancestor in a Binary Tree
What is Lowest Common Ancestor in Binary Tree?
The lowest common ancestor is the lowest node in the tree that has
both n1 and n2 as descendants, where n1 and n2 are the nodes for
which we wish to find the LCA. Hence, the LCA of a binary tree
with nodes n1 and n2 is the share... | ALGO | 0.999997 | 6.860449 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-07-23T14:29: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": "e42e4e812659... |
5e988270-21b7-4223-b07e-5d559dec504e | lmalano/informaticaC | eval.cpp | #include<iostream>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int const N=10;
int const M=10;
void cargarMatriz ( int D[N][M],int f ,int c);
void mostrarMatriz ( int D[N][M],int f,int c);
int determinarMayor ( int D[N][M],int f, int c );
int determinarMenor ( int D[N][M],int f, int... | ALGO | 0.99913 | 3.564931 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-06-05T20:12:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd8de1d831... |
205f68e3-7380-4bfd-80fe-9e599fe9ab55 | sosohu/lintcode | continuous-subarray-sum-ii.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
class Solution {
public:
/**
* @param A an integer array
* @return A list of integers includes the index of
* the first number and the index of the last number
*/
vector<int> continuousSubarraySumII(ve... | ALGO | 0.999963 | 5.319357 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-08-02T02:04: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": "34bce5a50a... |
fc981379-dd80-4337-bdd8-76671a9ad14e | ehnryx/acm | atcoder/arc124/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
//#define FILENAME sadcactus
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
template <typename T>
using ordered_set = __gnu_pbds::tree<T,
__gnu_pbds::null_type,
less<T>,
__gnu_pbds::rb_tree_tag,
... | ALGO | 0.999998 | 4.104048 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2018-05-03T04:18:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "838187c4e... |
d339ee39-1a36-4f15-92db-c047db3a01ff | tiny-dnn/tiny-dnn | tiny_dnn/core/kernels/conv2d_op_nnpack.h | /*
Copyright (c) 2013, <NAME> and the respective contributors
All rights reserved.
Use of this source code is governed by a BSD-style license that can be found
in the LICENSE file.
*/
#pragma once
#include "tiny_dnn/core/backend.h"
#include "tiny_dnn/core/params/conv_params.h"
namespace tiny_dnn {
na... | ALGO | 0.977685 | 6.904826 | {
"github_metadata": {
"branch": "master",
"commit_count": 1012,
"repo_created_at": "2012-12-17T14:08:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5953,
"forks": 1385,
"issues": 273,
"pull_requests": 23
},
"file_meta": {
"content_id": ... |
6bea7d15-28f7-4cd6-a7f6-a9ffff6735f5 | SalvaColl/Competitive-Programming | CSES/Graphs/RoundTripII.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using str = string;
using pii = pair<int, int>;
using vi = vector<int>;
#define dbg(v) cout << "Line(" << __LINE__ << ") -> " << #v << " = " << (v) << endl;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define size(a) (int)a.size()
#define len(a) ... | ALGO | 0.999987 | 4.432019 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2025-03-13T07:38:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff7f9ed18c9... |
bbbd6f19-78ca-4d12-a297-cbc2e34f162e | YoonJihwan39/Algorithms-BOJ | Dynamic programming/11722 가장 긴 감소하는 부분 수열.cpp | #include<iostream>
using namespace std;
int N;
int A[1000];
int cache[1000];
int DP(int pos){
if(pos == N-1){
return 1;
}
if(cache[pos] != -1){
return cache[pos];
}
int max = 0;
for(int i = pos + 1; i < N; i++){
if(A[i] >= A[pos]) continue;
if(DP(i) > max){
... | ALGO | 0.999992 | 4.101148 | {
"github_metadata": {
"branch": "master",
"commit_count": 171,
"repo_created_at": "2019-03-31T10:38: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": "62199d8a... |
0236aeea-02f9-425a-9c10-facf549c2462 | AdarshAddee/Hacktoberfest2022_for_Beginers | C++/Heap sort by suraj.cpp | #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 largest
if (r < n && arr[r] > arr[largest])
... | ALGO | 0.99997 | 5.165854 | {
"github_metadata": {
"branch": "main",
"commit_count": 275,
"repo_created_at": "2022-09-27T13:22:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 226,
"forks": 996,
"issues": 0,
"pull_requests": 662
},
"file_meta": {
"content_id": "6d30... |
e4145f49-60ce-4bb0-b7b0-28a2e76780ad | hashimhayat/verus_delayprofile | verus_delayprofile/DelayProfile/DelayProfile.cpp | #include "DelayProfile.hpp"
#include "PerlinNoise.h"
using namespace std;
/* Global Variable Declarations */
double prevAvg = -1;
double xsum = 0, x2sum = 0, ysum = 0, xysum = 0;
double coef, power;
bool delayProfile = false;
std::vector< double > lny;
std::vector< double > SmoothArr;
std::vector< double > ExpoArr;
s... | ALGO | 0.97998 | 4.252453 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-10-20T05:49:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a6200254... |
726ac62e-79c8-4b0d-ab2f-bafcf91c1fb3 | F-TD5X/ACM_codes | unordered/summer1/multiCollages/10/1011.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cmath>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
int T;
int n;
char s[10];
int len[100];
int l2[10];
char buf[2];
int main()
{
#ifndef ONLINE_JUDGE
//freopen("1011.in","r",stdin... | ALGO | 0.999039 | 3.438205 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-08-20T04:49: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": "321c9af82... |
47008624-758e-479c-9a1f-24d2883b44f8 | shivamgohri/ds_codes | Companies/aria.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define MAX(int)1e7+5
#define mod 100000007
int solve(vector<int>& happy, int indx, vector<int>& vis, vector<vector<int> >& dp){
if(indx==happy.size()-1){
for(int i=0;... | ALGO | 0.999936 | 4.275794 | {
"github_metadata": {
"branch": "master",
"commit_count": 150,
"repo_created_at": "2020-04-08T19:59: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": "17992c39... |
10967665-05b6-486e-9dd4-4a424eec8fa1 | YoungCoderboy/CP_question | clock.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <string.h>
using namespace std;
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template <typename T_container, typename T = typename enable_if<!is_same<T_container... | ALGO | 0.999451 | 4.18218 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-06-22T05:30: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": "5c415201c29b... |
89c9542a-8e90-410c-a95b-8294426481ea | lrscy/ACM-ICPC | Team Training/2016-09-09 15-16 NEERC15/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<double, double> PDD;
typedef pair<bool, PDD> PBP;
const int MAXN = 1e3 + 10;
double dis[MAXN][MAXN];
double x[MAXN], y[MAXN];
double w;
int fa[MAXN];
int n;
int mfind( int x ) { return x == fa[x] ? x : fa[x] = mfind( fa[x] ); }
PBP gao(... | ALGO | 0.999994 | 4.160146 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2016-05-13T16:34: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": "b15a10e4... |
787da25f-bba1-4226-a098-dc7cd2e84de0 | kaichenhong/Coding_Practice | LeetCode/0121_Best_Time_to_Buy_and_Sell_Stock_Easy/0121_Best_Time_to_Buy_and_Sell_Stock_Easy_02.cpp | /**
* LeetCode: 121. Best Time to Buy and Sell Stock (Easy)
*
* Say you have an array for which the ith element is the price of a given stock on day i.
*
* If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock), design an algorithm to find the maxi... | ALGO | 0.999879 | 6.047962 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2019-08-25T14: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": "52942870... |
b5e335bb-215e-4c16-a755-bd1cddfcaa67 | codespecs/daikon | tests/kvasir-tests/povray/source/source/matrices.cpp | /****************************************************************************
* matrices.cpp
*
* This module contains code to manipulate 4x4 matrices.
*
* from Persistence of Vision(tm) Ray Tracer version 3.6.
* Copyright 1991-2003 Persistence of Vision Team
* Copyright 2003-2004 Persistence of Vis... | ALGO | 0.998633 | 3.138062 | {
"github_metadata": {
"branch": "master",
"commit_count": 11821,
"repo_created_at": "2015-06-14T18:40:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 229,
"forks": 57,
"issues": 24,
"pull_requests": 7
},
"file_meta": {
"content_id": "379... |
be98d2aa-b325-4c66-b333-4517a6af5df8 | rlatjwls7882/Baekjoon | 32xxx/32198. 사건은 다가와 (Easy)/사건은 다가와 (Easy).cc | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int N; cin >> N;
vector<tuple<int, int, int>> input;
for(int i=0;i<N;i++) {
int T, A, B; cin >> T >> A >> B;
input.push_back({T, A, B});
}
sort(input.begin(), input.end(... | ALGO | 0.999957 | 3.926996 | {
"github_metadata": {
"branch": "main",
"commit_count": 1418,
"repo_created_at": "2024-09-15T04:27: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": "583d3f22b... |
02415b03-ea31-4ec6-b2b8-9436a5aef9e6 | joshuacroix/221_Data_structures_practice | vector_mpq.h | #ifndef VECTOR_MPQ_H
#define VECTOR_MPQ_H
#include <iostream>
#include <vector>
using namespace std;
template <typename T>
struct vector_object {
int key;
T value;
};
template <typename T>
struct MPQ {
vector< vector_object<T> > MPQ_vector;
T remove_min() {
T ret_value = this->MPQ_vector[0].... | TOOL | 0.96356 | 3.93347 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-07-13T15:05: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": "94be98b68d... |
54556f33-1ff7-4fb4-94ff-88ec34a12957 | Sumanth-NR/CompetitiveProgramming | Platforms/USACO/Silver/PrefixSums_Intro_to_Prefix_Sums/D_Irreducible_Anagrams.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
string s;
cin >> s;
int n = int(s.size());
int nQ;
cin >> nQ;
vector<array<int, 26>> pref(n + 1);
for (int i = 1; i <= n; ++i) {
pref[... | ALGO | 0.999973 | 4.871089 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2022-04-18T13:29: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": "6d057847... |
ef61c521-b31e-4ca3-9f09-578789320e0c | ishandutta2007/codeforces-a | anadi/normal/883/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1000002;
char s[N];
int ok[N];
int dp[N];
int n;
vector<int> p;
bool check(int x)
{
int k = p.size();
dp[0] = ok[0];
for(int i = 1; i <= k; i++)
{
int t = p[i-1];
if(t - x - 1 > dp[i-1])
return false;
if(dp[i-1] >= t) dp[i] = ok[min(n, t+x)];
... | ALGO | 0.999687 | 3.468083 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "9a9329186259... |
d863548f-3728-4aa0-8b2a-1644040274ab | Ashwin-2000/Data-Structures-And-Algorithms | Algorithms/Sorting/insertionSort.cpp | #include<iostream>
using namespace std;
void insertionSort(int arr[] ,int N){
int j;//To avoid swapping
//We consider first element @ 0th index is sorted
for (int i = 1; i < N;i++){
//We need to insert this element
int key = arr[i];
//Initailzation : To insert in left part so we... | ALGO | 0.999976 | 4.972684 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2021-07-01T06: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": "a389560b6... |
19581ed0-00a1-46ea-b9eb-a6ff36d833f0 | DeepLink-org/deeplink.framework | dicp/dicp/vendor/TopsGraph/codegen/src/maxpool2d_grad.cpp | #include "maxpool2d_grad.h"
builder::Op enflame::MaxPool2D(std::shared_ptr<builder::Builder> tmp_builder,
builder::Op input, std::vector<long> ksize,
std::vector<long> strides,
std::vector<long> padding,
... | DATA | 0.922555 | 6.402271 | {
"github_metadata": {
"branch": "main",
"commit_count": 3145,
"repo_created_at": "2023-01-30T03:24:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 67,
"forks": 30,
"issues": 19,
"pull_requests": 57
},
"file_meta": {
"content_id": "554778... |
52517fae-601b-4bc2-8a85-c27c108c055c | ishandutta2007/codeforces-q | qwertypi/normal/1162/B.cpp | #include <iostream>
#include <string>
#include <string.h>
#include <algorithm>
#include <map>
#include <iomanip>
#define inf (1 << 30)
typedef long long ll;
using namespace std;
int A[51][51];
int B[51][51];
int main(){
for(int i=0;i<51;i++){
A[0][i] = A[i][0] = B[i][0] = B[0][i] = -inf;
}
int r, c... | ALGO | 0.999931 | 3.941791 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:56:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3be15fa4f82... |
65a306e5-523d-41c2-b7d9-f37ff01f3504 | Pranjalmishra30/RMTaskphase | Main codes/NWCH_bot_move_classes/NWCH_bot_move_classes.ino | class LSA_bot
{
int *reverseDIRs;
int *PWM_pins; // List of PWM pins
int *DIR_pins; // List of DIR pins
float pseudo_matrix[4][3]=
{-0.3536,-0.3536,0.2500,
-0.3536,0.3536,0.2500,
0.3536,-0.3536,0.2500,
0.3536,0.3536,0.2500 };
float v[4];
public:
void velocity(float[][1]);
void mov... | TOOL | 0.987976 | 4.503519 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2019-09-22T11:53:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "90afbfa93... |
1c1e1e26-19bd-4b8b-b863-21804b3e1ebf | Byleon2361/bsp-tree | test.cpp | #include <iostream>
#include <cstdlib>
#include <fstream>
#include <vector>
#include <sstream>
#include <sys/time.h>
using namespace std;
class bsp_tree
{
public:
struct vec3
{
float x;
float y;
float z;
};
struct vec4
{
float x;
float y;
float z;
... | ALGO | 0.974401 | 3.054443 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-10-01T17:09:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1890137ef18... |
3a4474ee-e0cf-4152-bde6-673e81188e5a | brandoncossin/apriori | apriori.cpp | // apriori algorithm
// <NAME>
// 9/26/2021
// reads input from stream and outputs results
// needs minimum support %
#include <fstream>
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <algorithm>
using std::vector;
using std::cout; using std::endl;
using std::map; usi... | ALGO | 0.983834 | 4.728392 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-09-29T02:39: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": "49e48c37e4df... |
5a283cef-7f53-48f1-b75f-a2e1aa547490 | xieyuheng/cppannotations | yo/classtemplates/examples/boundfriends.cc | #include <map>
#include <algorithm>
#include <functional>
#include <iterator>
/*
// SF:
// template <typename Key, typename Value>
// class Dictionary;
//
// template <typename Key, typename Value>
// Dictionary<Key, Value>
// subset(Key const &key, Dictionary<Key, Value> con... | TOOL | 0.920602 | 4.230993 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-07-04T11:43:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3596c90db1... |
fc0ea9b4-379a-4fd1-b4a1-4b15d869368b | MSKim0215/Algorithm | 프로그래머스/1/64061. 크레인 인형뽑기 게임/크레인 인형뽑기 게임.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
int solution(vector<vector<int>> board, vector<int> moves)
{
vector<int> buckets;
for(int i = 0; i < moves.size(); i++)
{
int targetLine = moves[i] - 1; // 집을 위치
for(int j = 0; j < board.size(); j++... | ALGO | 0.999771 | 5.055727 | {
"github_metadata": {
"branch": "main",
"commit_count": 456,
"repo_created_at": "2023-03-10T07:29: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": "a91b50a644... |
d638fcc5-4ead-4783-809b-b8278ef1a85e | imajeet5/intoCPP | pointers/returningPointer.cpp | #include <iostream>
using namespace std;
int *largest_number(int *num1_ptr, int *num2_ptr);
int main(int argc, char const *argv[])
{
int x{ 100 }, y{ 200 };
int *largest_ptr{ nullptr };
cout << "Address of x " << &x << endl;
cout << "Address of y " << &y << endl;
largest_ptr = largest_number(&x, ... | ALGO | 0.998939 | 4.321744 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-08-04T16:38: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": "2658ed79f... |
456a6d30-6718-47a0-b1e7-c22be6612b53 | SachsA/Nanotekspice | Gates/Or.cpp | //
// EPITECH PROJECT, 2018
// <NAME>
// File description:
// Or cpp
//
#include "ErrorsPin.hpp"
#include "ErrorsLink.hpp"
#include "Or.hpp"
Or::Or()
{
_links[0].component = nullptr;
_links[1].component = nullptr;
_links[2].component = nullptr;
_links[0].pin = 0;
_links[1].pin = 0;
_links[2].pin = 0;
}
Or::~Or... | ALGO | 0.937905 | 5.59123 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-05-06T11:33:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f87686c1f6... |
cc95bb4d-6322-4b50-b046-eaaf1409da77 | eddie0329/COMP_0000_Algorithm_Practice | Exercises/note.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
void breath_search(char tree[5][7], char element_to_search) {
for(int col = 1; col < 6; col++) {
for(int row = 1; row < 8; row++) {
if(col == 1 && row == 4) {
tree[col][row] = '0';
if(tree[col][row] == element_t... | ALGO | 0.999519 | 3.480519 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2018-07-09T14:06: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": "da1b0c911... |
b5efe9c6-9455-4c34-b9f6-6a7a26902cfb | ekarth/DSA | arrays/3_duplicates_in_array.cpp | // Problem Link: https://practice.geeksforgeeks.org/problems/find-duplicates-in-an-array/1/
// Time Compexity: O(n)
// Space Compexity: O(n)
#include<bits/stdc++.h>
using namespace std;
vector<int> duplicates(int arr[], int n) {
// code here
vector<int> freq(n, 0);
for(int i = 0; i < n; i++)
{
... | ALGO | 0.999227 | 5.321989 | {
"github_metadata": {
"branch": "main",
"commit_count": 127,
"repo_created_at": "2022-06-13T11:37: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": "56e245f90a... |
ad9db960-1633-4ec9-9f14-ad4486ffe33e | frankleitelemoscosta/Multcore-SO-work | src/cpu/CONTROL_UNIT.cpp | #include "CONTROL_UNIT.h"
#include "../PCB.h"
#include <bitset>
#include <memory>
#include <string>
#include <vector>
void* Core(MainMemory &ram, PCB &process, vector<unique_ptr<ioRequest>>* ioRequests, bool &printLock){
// load register and state from PCB
auto ®isters = process.regBank;
Control_U... | ALGO | 0.914561 | 4.230756 | {
"github_metadata": {
"branch": "main",
"commit_count": 153,
"repo_created_at": "2024-11-13T19:28: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": "1b2dcfd550... |
2dbc68eb-38f7-4af7-ab1b-c95d10772b1b | clatisus/coding-competition | GoogleCodingCompetitions/RoundE2021KickStart2021/BirthdayCake/solution.cpp | #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <vector>
int R, C, K;
int r1, c1, r2, c2;
long long cnt(lo... | ALGO | 0.999739 | 3.509146 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2022-02-07T03:22: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": "f01861066... |
67788c23-12bd-4db2-9264-e74f81d9306e | ToonTownInfiniteRepo/ToontownInfinite | Panda3D-1.9.0/include/lru.h | // Filename: lru.h
// Created by: aignacio (12Dec05)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have r... | TOOL | 0.990173 | 3.959641 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2014-08-08T10:00:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "862e65d777... |
fd923868-bd9c-40db-94c1-ea2c3c00a0e2 | Domain3xpansion/LeetCode-Solutions | 0160-intersection-of-two-linked-lists/0160-intersection-of-two-linked-lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:/*
ListNode *Intersecthelper(ListNode* small, ListNode* large, int diff){
while(diff){ // making the poin... | ALGO | 0.999962 | 5.283256 | {
"github_metadata": {
"branch": "main",
"commit_count": 278,
"repo_created_at": "2024-12-30T10:11:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8daebd4fa... |
1ab4be48-47e0-4073-85d1-9b021f7fd6a9 | lienjenns/Thesis_Matrix_Part | GMP/GMP/output.cpp |
#include<vector>
#include"./matrix.h"
#include <iostream>
#include "./Util.h"
#include"./Global.h"
#include"Possible_States.h"
#include <tuple>
#include<fstream>
#include <string>
//Function used in the sort function to sort a vector of pairs based on the second element
//instead of sorting it based on the first el... | ALGO | 0.999847 | 4.3403 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2021-03-15T10:48: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": "1ae13295636... |
c06f756b-5492-48e0-95aa-80a5422f82d2 | keisuke-kanao/my-UVa-solutions | Contest Volumes/Volume 125 (12500-12599)/UVa_12504_Updating_a_Dictionary.cpp |
/*
UVa 12504 - Updating a Dictionary
To build using Visual Studio 2012:
cl -EHsc -O2 UVa_12504_Updating_a_Dictionary.cpp
*/
#include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
void get_dictionary(const string& s, map<string, string>& dic)
{
const char* p = s.c_str();
p+... | ALGO | 0.99944 | 3.969987 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2018-01-06T01:59:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df1d9d35... |
f60240a5-29c0-4c96-9a7e-715d4b1453f0 | arnav-mehra/my-chess | V3/search/search.hpp | #pragma once
#include "../board/impl/index.hpp"
#include "../move/impl/index.hpp"
#include "evaluate.hpp"
#include "../board/TranspositionTable.hpp"
#include <algorithm>
#include <unordered_set>
#include <atomic>
#define INFINITY INT16_MAX
namespace Search {
// constants
constexpr U16 NULL_DEPTH_REDUCTION ... | ALGO | 0.997914 | 5.457543 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-03-27T23:17: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": "8caf67cb52e... |
c82239d5-6b01-4f24-8a4e-543a72d19361 | adi5233/DSA-CPP | array/secondLargest.cpp | #include <iostream>
using namespace std;
int largest(int arr[], int n)
{
int largest= arr[0];
for(int i=1; i<n; i++) {
if(arr[i] > largest) {
largest = arr[i];
}
}
return largest;
}
void secondLargest(int arr[], int n)
{
int x = largest(arr, n);
int secondLargest ... | ALGO | 0.999856 | 4.079826 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2022-04-19T17:41: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": "d3232d9e7... |
308cba94-11ac-4abc-acf7-a50904621ea0 | yawnyoung/exploration_baxter | src/NBVStrategy.cpp | #include "exploration_baxter/NBVStrategy.h"
NBVStrategy::NBVStrategy(ros::NodeHandle nh):
m_nh(nh),
lower_limit(0.5), // Set default value to be 0.5 meter
m_WorldFrame("/base"), // Set default world frame to be base frame
plan_eef("/right_hand_camera"), /... | ALGO | 0.999902 | 5.690567 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2015-02-11T01:34: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": "71e224586... |
9ca293f3-7c7e-4bc4-a00a-42c083def36f | DaaEun/Practicing-Co-Te | Programmers/고득점Kit/동적계획법(DP)/정수사각형.cpp | /*
문제 설명
위와 같은 삼각형의 꼭대기에서 바닥까지 이어지는 경로 중, 거쳐간 숫자의 합이 가장 큰 경우를 찾아보려고 합니다.
아래 칸으로 이동할 때는 대각선 방향으로 한 칸 오른쪽 또는 왼쪽으로만 이동 가능합니다.
예를 들어 3에서는 그 아래칸의 8 또는 1로만 이동이 가능합니다.
삼각형의 정보가 담긴 배열 triangle이 매개변수로 주어질 때, 거쳐간 숫자의 최댓값을 return 하도록 solution 함수를 완성하세요.
제한사항
- 삼각형의 높이는 1 이상 500 이하입니다.
- 삼각형을 이루고 있는 숫자는 0 이상 9,999 이하의 ... | ALGO | 0.999968 | 5.631223 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2021-03-07T06:25:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c201e30310... |
b18c5ccf-c40b-44dd-9e8a-3e45e71bad6d | exopeng/Competitive-Programming | CSES/lis.cpp | #include <bits/stdc++.h>
using namespace std;
//store test cases here
/*
*/
const long long INF = 10000000000;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<long long> a;
vector<long long> d;
for (int i = 0; i < n; i++) {
int b;
cin >> b;
a.p... | ALGO | 0.999976 | 4.233085 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-08-15T17: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": "2ce164261b2e... |
d408f867-c2b4-4fd9-867e-45491c410dc2 | mohamedelhaouil/ProblemsSolutions | Codeforces/B. Count the Number of Pairs.cpp | /*
* by: MEL05
*/
#include<bits/stdc++.h>
/*#include<unordered_map>
#include<unordered_set>*/
using namespace std;
void ios_b() {
ios_base :: sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
}
void f() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
#... | ALGO | 0.99997 | 4.032907 | {
"github_metadata": {
"branch": "main",
"commit_count": 173,
"repo_created_at": "2022-10-14T15:22: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": "2447dd1940... |
f5fb01e3-4b62-43e2-bad7-df713f3b74d3 | Eperix/Toon-UE | Engine/Plugins/PCG/Source/PCG/Private/SpatialAlgo/PCGMarchingSquares.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "SpatialAlgo/PCGMarchingSquares.h"
#include "Containers/Map.h"
#include "Math/Vector.h"
#include "Math/Vector2D.h"
#include "Misc/EnumClassFlags.h"
#include "Templates/Tuple.h"
namespace PCGSpatialAlgo
{
namespace MarchingSquaresAlgo
{
/**
* Edge Ids
* *... | ALGO | 0.999698 | 3.207728 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2025-02-12T17:17:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "506c6813338... |
21d6837f-c752-4555-bac8-280842b2c109 | Fortitude42/CompetitiveProgrammingArchive | Camps/MW_2020_Fall/Day3/B/a.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
//#define int long long
//#pragma GCC optimize("Ofast")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC targe... | ALGO | 0.999961 | 3.655993 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-08T16:52:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6810322d3f3f... |
7a5aafd4-d339-4a97-8af3-e48bce40a6f5 | mogproject/modular-decomposition | src/main/cpp/util/Random.hpp | #pragma once
#include <algorithm>
#include <random>
namespace util {
/**
* @brief Helper class for handling pseudo random numbers.
*/
class Random {
public:
/**
* @brief Constructs a new Random object.
*
* @param seed seed for the pseudo random number generator
*/
Random(uint32_t seed) : gen_(seed)... | ALGO | 0.984837 | 6.907346 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2023-01-31T09:53:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ad28a18dbb... |
9ac655bd-51da-4f32-b324-85fddb59cc32 | AvinashKumarPithani/DSA-Problem-Solving | Number Theory/3. Euler's Totient Func/phi(n)3.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define FORk(i,a,b,k) for(int i=(a); i<b; i+=k)
#define rFOR(i,a,b) for(int i=(a); i>=(b); i--)
#define rFORk(i,a,b,k) for(int i=(a); i>=(b); i-=k)
#define pb push_back
typedef vector<int> vi;
typedef vector<str... | ALGO | 0.997649 | 4.509381 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2024-08-10T03:58: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": "70224795... |
f4766218-c18b-4922-a7a6-b8f7a6588c74 | iamr-kumar/codeforces | 2000C.cpp | #include "bits/stdc++.h"
using namespace std;
#define MOD 1e9 + 7
#define INF 1e18
#define nline '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define F first
#define S second
#define FOR(i, a, b) for(int i = a; i < b; i++)
t... | ALGO | 0.99994 | 4.164603 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-09-23T00:09: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": "21ba0c89621b... |
b2f8c164-cd15-453a-8d67-36dc2ba2f21e | florianRacine/code | cpp/winner.dir/winner.cpp | /**
* author: evoPrg
* created: 05.04.2023 19:35:43
**/
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
map<string, int> mp;
vector<pair<string, int>> v;
vector<string> nm;
for (int i = 0; i < n; i++) {
string name;
int score;
cin >>... | ALGO | 0.999981 | 4.173297 | {
"github_metadata": {
"branch": "main",
"commit_count": 217,
"repo_created_at": "2022-04-11T13:27: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": "07789a7aaf... |
af87fbb1-a0d4-4678-98f1-fd43a37fa1bb | nvcc1701/dsa | dsa_a_loc/contest7_set_map/bai14_suffix_and_query.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll LINF = 1e18 + 5;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int MAX = 1e6 + 5;
int main()
{
#ifndef ONLINE_JUDGE
freopen("../input.txt ", "r", stdin);
freopen("../output.txt ", "w", stdout);
#endif
ios::sync_with_stdio(f... | ALGO | 0.999941 | 4.57833 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2020-10-06T05:07:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c76f551e... |
93b1fa54-e09d-4acc-a1da-977c21b2ef0d | busebd12/InterviewPreparation | LeetCode/C++/General/Medium/CarFleet/solution.cpp | #include <algorithm>
#include <utility>
#include <vector>
using namespace std;
/*
Time complexity: O(n + (n * log(n)) + n) [where n is the length of position and speed]
Space complexity: O(n)
*/
class Solution
{
public:
int carFleet(int target, vector<int> & position, vector<int> & speed)
{
... | ALGO | 0.99933 | 6.135165 | {
"github_metadata": {
"branch": "master",
"commit_count": 218,
"repo_created_at": "2015-12-15T14:19: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": "7c5aac28... |
54f31ac6-da80-417a-8cf4-ff82c31ff503 | LenaWil/tom7 | portmantout/makejoin.cc | #include <unordered_map>
#include <unordered_set>
#include "makejoin.h"
#include "base/logging.h"
namespace {
struct Word;
using smap = unordered_map<string, vector<Word *>>;
using sset = unordered_set<string>;
struct Word {
explicit Word(const string &s) : w(s) {}
const string w;
sset prefixes;
sset suffixe... | ALGO | 0.985049 | 4.888716 | {
"github_metadata": {
"branch": "master",
"commit_count": 2738,
"repo_created_at": "2016-04-03T09:28:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a712b0... |
790e0f62-7ba7-41b5-8569-4a305e36bb41 | gashe-soo/Algorithm | Baekjoon/1939_중량제한.cpp | #include <iostream>
#include <queue>
#include <algorithm>
#include <cstring>
// 백준 1939 중량제한.
using namespace std;
// 1. 길은 특정 중량 w보다 커야 한다.
// 1-1. bfs을 돌면서 만약 w보다 작으면 패스, 클 경우에만 확인
// 1-2. 도착지점에 도착했으면 w 가능 / 아니면 불가능
// 2. 이분탐색으로 가장 큰 w찾기.
vector<pair<int,int>> map[10001];
int n, m, depart, arrive;
bool v[10001];
... | ALGO | 0.999892 | 3.964065 | {
"github_metadata": {
"branch": "master",
"commit_count": 263,
"repo_created_at": "2020-05-12T06:23:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c4bebd8... |
f02f16c3-5175-4931-82b7-c27742fe4718 | ApolloAuto/apollo | modules/perception/lidar_detection/detector/cnn_segmentation/disjoint_set.h | /******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
... | ALGO | 0.978055 | 5.691797 | {
"github_metadata": {
"branch": "master",
"commit_count": 19341,
"repo_created_at": "2017-07-04T19:03:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25847,
"forks": 9793,
"issues": 895,
"pull_requests": 104
},
"file_meta": {
"content_id... |
ba663328-5582-4703-90d8-2f1cf3ec7012 | KevinOchs/hexapod_ros | hexapod_controller/src/ik.cpp |
// ROS Hexapod Controller Node
// Copyright (c) 2016, <NAME>
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice,... | TOOL | 0.918318 | 4.043572 | {
"github_metadata": {
"branch": "master",
"commit_count": 210,
"repo_created_at": "2014-12-23T09:05:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 127,
"forks": 50,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "e094e... |
1ef25c4e-825b-4b35-8443-658e4945d8cd | ikr/algo-practice | google/2021/Code_Jam_Qual/Reversort/solution.cpp | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
template <typename T> constexpr int inof(const T x) {
return static_cast<int>(x);
}
int solve(vi xs) {
int ans = 0;
assert(!xs.empty());
for (auto it = begin(xs); it != prev(end(xs)); ++it) {
const auto jt = min_element(it... | ALGO | 0.999828 | 5.17568 | {
"github_metadata": {
"branch": "master",
"commit_count": 5422,
"repo_created_at": "2016-06-23T07:28:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4b6ebc... |
72af026c-272c-4445-8c17-9eed985306b8 | xxmen/ACMTraining | 2014-08-04/hdu3530(单调队列).cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
int a[100010];
struct node{
int id,x;
}Qmin[100010],Qmax[100010];
int main()
{
int n,m,k;
while (~scanf("%d%d%d", &n, &m, &k))
{
for (int i = 1; i <= n; i++)
scanf("%d"... | ALGO | 0.999989 | 3.702181 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2014-08-02T15:57: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": "2576010f2... |
36b5562a-7580-4787-8884-d0243e571ef0 | NadChern/Leetcode | 1_TwoSum/main.cpp | // Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
//
//You may assume that each input would have exactly one solution, and you may not use the same element twice.
//
//You can return the answer in any order.
//
//Example 1:
//
//Input: nums = [2... | ALGO | 0.999883 | 6.313727 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-10-15T21:32:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6bc119160d... |
ceef54a3-0c38-43c7-8e3a-f96ef0ac48ee | AlgoAbrar/Second-Year-First-Semester-Lab | DSA Lab/Lab 6/problem.cpp | #include <iostream>
using namespace std;
//bismillah
class Node {
public:
int data;
Node* next;
};
Node* top = NULL;
void push(int value) {
Node* newNode = new Node();
newNode->data = value;
newNode->next = top;
top = newNode;
cout << value << " value pushed." << endl;
}
void pop() {
... | ALGO | 0.978391 | 4.472067 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-02-08T14:53:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6189134d525... |
adf8af40-f354-4043-a66b-347e5f6428dd | thang44hdai/Algorithms_SamSung | Source/1196.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define ll long long
int v, e;
vector<int> ke[1005];
int ok[1005];
int par[1005];
int dfs(int u)
{
ok[u] = 1;
for (auto i : ke[u])
if (!ok[i])
{
par[i] = u;
dfs(i);
}
else if (i !=... | ALGO | 0.999974 | 5.020738 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-11-01T13:21:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ed07b3dbd7... |
3ab53cce-b189-4941-9715-2ae39039f982 | nataliekmoes/LRU-IPV_CacheReplacementPolicy | lru_ipv.cc |
#include "mem/cache/replacement_policies/lru_ipv.hh"
#include <cassert>
#include <memory>
#include "sim/core.hh"
#include "params/LRUIPVRP.hh"
#include "debug/LRUIPVDebug.hh"
#include "base/logging.hh"
#include "base/trace.hh"
#include <string>
const uint8_t ipv[] = {0, 0, 1, 0, 3, 0, 1, 2, 1, 0, 5, 1, 0, 0, 1, 11, 1... | TOOL | 0.908075 | 5.951093 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-06-22T21: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": "1de760e6a239... |
a3f4b15f-a93a-40fe-9cf2-3ea7ed9a0a93 | trilinos/Trilinos | packages/stokhos/example/experimental/linear2d_diffusion.cpp | // @HEADER
// *****************************************************************************
// Stokhos Package
//
// Copyright 2009 NTESS and the Stokhos contributors.
// SPDX-License-Identifier: BSD-3-Clause
// *****************************************************************************
// @... | ALGO | 0.999201 | 6.021968 | {
"github_metadata": {
"branch": "master",
"commit_count": 104031,
"repo_created_at": "2015-11-16T19:39:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1299,
"forks": 593,
"issues": 263,
"pull_requests": 61
},
"file_meta": {
"content_id":... |
be8ba90b-0aae-4775-b01c-f660ae5e5304 | sword-jin/HackerRank-Solution | DataStructure/LinkedLists/8-compare-two-linked-lists.cpp | int CompareLists(Node *headA, Node* headB)
{
int result = 1;
while (headA != NULL && headB != NULL) {
if (headA->data != headB->data) {
result = 0;
break;
}
headA = headA->next;
headB = headB->next;
}
if ((headA != NULL && headB == NULL) || (head... | ALGO | 0.999877 | 4.889747 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2016-02-21T10:20:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 52,
"forks": 56,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "efbee9e... |
383beac0-6a06-495c-b5fe-7952408410cb | TusharKumar15/algo-games-puzzles | sudoku_solver.cpp | #include <bits/stdc++.h>
using namespace std;
// function to check if 'num' is allowed at position (r, c)
bool allowed(int sudoku[9][9], int r, int c, int num){
for (int i = 0; i < 9; i++){
if(sudoku[r][i] == num) return false;
}
for (int i = 0; i < 9; i++){
if(sudoku[i][c] == num) re... | ALGO | 0.999793 | 5.298666 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-06-29T14:44: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": "4e27f0a3f61c... |
7e959885-de8c-4fdd-bc12-010272ebb037 | golden-fish-nthu/XOX | HW6-ironman.cpp | #include <algorithm>
#include <iostream>
#include <queue>
#include <utility>
#include <vector>
#define MAX 1000
#define INF 1e9
#define Point pair<int, int>
#define x first
#define y second
char grid[MAX][MAX];
int dist[MAX][MAX];
int dx[] = {0, 0, 1, -1}; // 四個方向 (右, 左, 下, 上)
int dy[] = {1, -1, 0, 0};
using namespace... | ALGO | 0.999957 | 3.996785 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2024-07-25T11:36:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "25290026ebc... |
4a307000-9ad5-4e44-befb-cd459fb2ae3d | anonymouslei/cpp_shenlan | homework2/Project2/sudoku.cpp | #include "sudoku.hpp"
Sudoku::Sudoku() { numOfSolutions_ = 0; }
void Sudoku::readSudokuFromFile(const std::string &file_name) {
std::ifstream fin;
fin.open(file_name);
if (!fin.is_open()) {
throw std::invalid_argument("the input is invalid!\n");
}
std::string line;
int size{0};
wh... | ALGO | 0.997183 | 4.143832 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2021-06-20T13:29:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2a74a28a... |
99186a40-71b1-42f7-ab87-9a9eb6822441 | taitruong256/Competitive-programming | CSES/introductory/introductory_Creating_Strings.cpp | /*=====================================================================================
Nothing is impossible, only you think it is impossible
Try, try, try again until you succeed
Pratice, practice, and practice
I hated every minu... | ALGO | 0.999929 | 4.343364 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-04-14T06:59: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": "c87fe99d3052... |
ac5c6ff9-6360-4330-a8f3-87d2d2fe61ae | anand-raval-git/Cpp | Linked_list/09_reverse_linked-list_using_recursion.cpp | #include<iostream>
using namespace std;
class Node
{
public:
int data;
Node* next;
Node()
{
this->data = 0;
this-> next =0;
}
Node(int data)
{
this->data = data;
this->next = 0;
}
};
void print(Node* &head)
{
Node *temp = head;
while(temp != N... | ALGO | 0.999906 | 4.512421 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2023-06-04T05:46:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3194dd9aa77... |
a13cb052-2768-40d5-91e7-c0f1ad4c6bd3 | porterlin/LeetCode | binary-tree/889.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.999963 | 6.367701 | {
"github_metadata": {
"branch": "main",
"commit_count": 197,
"repo_created_at": "2025-02-10T12:15: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": "8264c9a330... |
37de4185-34a3-431c-91aa-aad00e657970 | abacus-ustc/abacus-GPU | ABACUS/source/src_external/src_pdiag/MRRR/dlanst.cpp | #include"mrrr.h"
static int c__1 = 1;
double pdlanst(char *norm, int *n, double *d__, double *e) {
/* System generated locals */
int i__1;
double ret_val, d__1, d__2, d__3, d__4, d__5;
/* Local variables */
int i__;
double sum, scale;
double anorm;
/* -- LAPACK auxiliary routine (version 3.2) -- */
/* ... | ALGO | 0.999173 | 4.916264 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-03-10T03:37:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f743c01ec... |
4719cfd9-dd82-4007-8bb7-81048c3a0637 | Strel04ka/Lab7.2 | Lab7.2_IRETATION/Lab7.2_IRETATION/Lab7.2_IRETATION.cpp | #include <iostream>
#include <iomanip>
#include <time.h>
using namespace std;
void Create(int** &a, const int n, const int k, int low, int hight)
{
for (int i = 0; i < n; i++)
for (int j = 0; j < k; j++)
a[i][j] = low + rand() % (hight - low + 1);
}
void Print(int** &a, const int n, const int k)
{
for (int ... | ALGO | 0.998266 | 3.640364 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-05-19T19:46: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": "e1463a3a1b6d... |
f3ed420b-b567-43ad-83e4-a5cf86186a58 | ishandutta2007/codeforces-m | maksim1744/normal/985/E.cpp | /*
21.05.2018 19:12:51
*/
#include <bits/stdc++.h>
using namespace std;
const bool debug = false;
int main(int argc, char const *argv[])
{
if (debug) {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
}
int test_count = 3;
if (!debug) {
test_count = 1... | ALGO | 0.999827 | 3.8979 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "cc06032797dc... |
a9b20cf9-1a19-4e56-9d52-8747efa3d250 | StrikerSumit39/CodeForces | codeforces/1408/A.cpp | #include<bits/stdc++.h>
using namespace std;
//===================================tempelet=======================================
// set is array that maintain assending order
//unordered map is faster then ordered map
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl "\n"
#define int long ... | ALGO | 0.999977 | 3.799503 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2021-06-28T16:07: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": "c3141a60... |
14ccb599-9170-4c03-b2ea-c206fc8b6f58 | bioprogram1316/Cpp-School-Code | cd2588_hw4_q3.cpp | #include <iostream>
using namespace std;
int printMonthCalender(int numOfDays, int startingDay);
bool isLeapYear(int year);
void printYearCalender(int year, int startingDay);
int main() {
int year, yearStartingDay;
cout << "Please enter a year and the starting day of the week (separated by a space).\n"
... | TOOL | 0.9993 | 3.935534 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2017-09-20T19:14:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b52250e54... |
5114933c-9489-47ed-9748-c697ef21ba84 | pm306/procon | 典型90問/069.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<long long, long long>;
constexpr char ln = '\n';
constexpr long long MOD = 1000000007;
constexpr long long INF = 1000000000 + 100;
constexpr long long LINF = 1000000000000000000 + 100;
constexpr double EPS = 1e-9;
#define all(v) v.beg... | ALGO | 0.99999 | 4.762828 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-02-28T10:20: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": "77a15b23c2... |
9221a3e0-20d2-4bff-a866-5160c22bd68b | MeRiddle06/GPLAN_OPTIMIZATION | opti_code_01.cpp | #include<bits/stdc++.h>
using namespace std;
int rooms; // the total number of rooms
int num_sx,num_tx,num_sy,num_ty;
vector<int>sx_adj;
vector<int>sy_adj;
int adjacent_pairs;
vector<vector<int>>adj; // contains the adjacency of all the rooms
map<pair<int,int>,int>adj_type;
vector<vector<double>> edgesX;
vector<ve... | ALGO | 0.999492 | 3.377129 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-11-03T14:56: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": "8df1ca7371bf... |
bdabb132-0cb2-4297-b57d-1f3f59f24a2f | mutluer96/Euler-Approximation-with-cpp | eulerApproximation2.cpp | #include<iostream>
#include<cmath>
using namespace std;
double eulerApproximation(double t_initial, double y_initial, double stepsize, double t_goal)
{
double buffery, bufferResult, buffert;
if (t_goal == t_initial)
{
return y_initial;
}
else if (t_goal > t_initial)
{
buffery = y_initial;
buffert = t_in... | ALGO | 0.999973 | 4.654954 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-12-03T11:33:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5e7d9ec898b... |
71a574d7-48e1-4a59-9382-45a70288dd4f | ArundhotiKar/XPSC | Week15/Day7/B_Arranging_Cats.cpp | #include<bits/stdc++.h>
#define ll long long
#define in cin>>
#define srt(a) sort(a.begin(), a.end());
#define vtr vector<long long>
#define unset unordered_set<long long>
#define pr cout<<
#define nl <<endl;
using namespace std;
const ll MOD=1e9+7;
ll power(ll x, ll y)
{
ll ans=1%MOD;
while(y)
{
if(y&1)
{... | ALGO | 0.999991 | 4.279706 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2024-10-26T18:26: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": "ea6782d0dc... |
bbc31054-4bf0-4dce-9203-21b1db45d1b9 | Yiruma96/MLARandom-repo | src/gold/dirsearch.cc | // dirsearch.cc -- directory searching for gold
// Copyright (C) 2006-2021 Free Software Foundation, Inc.
// Written by <NAME> <<EMAIL>>.
// This file is part of gold.
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// th... | TOOL | 0.928957 | 6.557466 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2023-11-24T13:08:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 156,
"forks": 98,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f82b99... |
868414e7-a8c5-413c-89ee-2fd264833f09 | jun-pac/PS | 230429/10set/B.cpp | //
//./B<test
#include <bits/stdc++.h>
#define endl '\n'
#define cediv(a,b) ((a)%(b)==0?((a)/(b)):((a)/(b))+1)
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
template<typename T>
inline T umax(T &u, T v){re... | ALGO | 0.999808 | 3.6314 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-02-19T18:00:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf3f658a1c7... |
e07f129e-2229-4879-b49f-5224b790e9d5 | usnistgov/OOF3D | SRC/engine/icpre.C | // -*- C++ -*-
/* This software was produced by NIST, an agency of the U.S. government,
* and by statute is not subject to copyright in the United States.
* Recipients of this software assume all responsibilities associated
* with its operation, modification and maintenance. However, to
* facilitate maintenance we... | ALGO | 0.999516 | 6.136883 | {
"github_metadata": {
"branch": "master",
"commit_count": 747,
"repo_created_at": "2015-01-21T19:04:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 37,
"forks": 8,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "17276094... |
d566004c-4373-42ef-82c1-acbf16389871 | muhammadhasan01/cp | Online Judge/Codeforces/Gym/2017-2018 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2017)/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 5e5 + 5;
int n;
ll L, A, B, T, R;
ll pos[N];
ll dp[N];
int opt[N], go[N];
struct SegtreeLazy {
vector<pair<ll, int>> t;
vector<ll> lazy;
SegtreeLazy() {
t.resize(4 * N);
lazy.assign(4 * N, 0);
}
p... | ALGO | 0.999992 | 3.900014 | {
"github_metadata": {
"branch": "master",
"commit_count": 1187,
"repo_created_at": "2019-07-13T15:49:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "888a9c0... |
5602ba1b-fb03-466f-83d1-1a4d829415c7 | yliu7366/VesselSeg | itkMedialVesselFilter.txx | #include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include "itkMedialVesselFilter.h"
#include "itkImageRegionIterator.h"
#include "itkConstNeighborhoodIterator.h"
#include "itkLinearInterpolateImageFunction.h"
#include "itkSphereSpatialFunction.h"
//foo
#include "itkLineTransform3DFunctio... | ALGO | 0.987695 | 4.103165 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-06-13T22:19: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": "9fc46c8e1796... |
cc55b531-b190-4585-86cb-1a37e0049c59 | levidasilvalima/aed2 | pp2/src/lib/Task.h | # include "ReadBrain.h"
# include "ReadBlocks.h"
# include "DoubleLinkedList.h"
# include "Vertex.h"
# include "Adapter.h"
# include "Block.h"
# include "Kruskal.h"
# include "Dijkstra.h"
# ifndef TASK
# define TASK
class Task {
private:
ReadBrain readsBrain;
ReadBlocks readsBlocks;
DoubleLinkedList<int> ... | ALGO | 0.98761 | 4.084318 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2017-09-27T20:51: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": "dbd62a8a... |
db92d05d-e71d-4145-88da-fa13dc1f53b1 | microsoft/DCVC | DCVC-family/DCVC/src/cpp/rans/rans_interface.cpp | /* Copyright 2020 InterDigital Communications, Inc.
*
* 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... | TOOL | 0.911338 | 7.643964 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-03-22T01:31:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 567,
"forks": 88,
"issues": 44,
"pull_requests": 0
},
"file_meta": {
"content_id": "e714c1c9... |
026b03c0-a93e-44c8-92f7-55cb9c2f0d1f | RonakAsnani/Data_Structures | Linked list 2/evenAfterOddLL.cpp | /*Problem Statement: Even after Odd LinkedList
Problem Level: MEDIUM
Problem Description:
For a given singly linked list of integers, arrange the elements such that all the even numbers are placed after the odd numbers. The relative order of the odd and even terms should remain unchanged.
Note :
No need to print the li... | ALGO | 0.999712 | 5.318505 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2020-12-12T17:33:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e9880d7... |
e2cc9562-5d1f-4b47-a4ed-333c3b321ad3 | ishandutta2007/codeforces-y | ynsm/normal/1515/C.cpp | #include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
const int N = (int)2e5 + 123, inf = 1e9, mod = 1e9 + 7;
const ll INF = 1e18;
void solve()
{
int n, m... | ALGO | 0.999905 | 3.624446 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40: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": "b45c2d5a41df... |
69bdb1ca-7252-43e8-b822-1980c8859489 | likitd/-6Companies30days | Microsoft week-1/City with Smallest Number of Threshhold Distance.cpp | class Solution {
public:
int findTheCity(int n, vector<vector<int>>& edges, int distanceThreshold) {
vector<vector<int>>dist(n,vector<int>(n,INT_MAX));
for(int i=0;i<n;i++) dist[i][i]=0;
for(vector<int> v : edges){ // edges are bidirect
dist[v[0]][v[1]] =v[2]; //edges[i] = [fro... | ALGO | 0.999987 | 5.903833 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2025-01-01T17:11: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": "5b2ba0958ac... |
b8f435a8-e014-4192-8412-f0a9f66d8549 | SH-anonta/Competitive-Programming-Solutions | Code Forces/Code forces 1005A - Tanya and Stairways.cpp | // Author: <NAME> #Problm:
#include <iostream>
#include <sstream>
#include <cstdio>
#include <climits>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <queue>
#include <algorithm>
#include <utility>
#include <string>
#include <cstring>
using namespace std;
namespace {
typedef long long LL;
... | ALGO | 0.999947 | 3.364277 | {
"github_metadata": {
"branch": "master",
"commit_count": 286,
"repo_created_at": "2016-04-01T13:24:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 22,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4dfd3... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.