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 |
|---|---|---|---|---|---|---|---|
af54f8ec-8f6b-451f-b19e-716251dd313c | maximaximal/booleguru | src/transform/src/prenex_quantifiers_optimal.cpp | #include <booleguru/expression/op.hpp>
#include <booleguru/expression/op_manager.hpp>
#include <booleguru/expression/quanttree.hpp>
#include <booleguru/expression/var_manager.hpp>
#include <booleguru/transform/prenex_quantifiers_optimal.hpp>
#include <booleguru/util/reverse.hpp>
#include <booleguru/util/unsupported.hpp... | ALGO | 0.999709 | 6.136043 | {
"github_metadata": {
"branch": "main",
"commit_count": 612,
"repo_created_at": "2023-03-15T13:28:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5eb5ac0379... |
37dfe23c-ad24-41a5-917c-e404423e7688 | OgLocGreen/irobot_ros | catkin_ws/src/irobot_fcpp_pckg/src/trapdecomposition.cpp | #include "trapdecomposition.h"
double TrapDecomposition::f_manhattan_dist(Point_2 p1, Point_2 p2)
{
return f_manhattan_dist(CGAL::to_double(p1.x()), CGAL::to_double(p1.y()), CGAL::to_double(p2.x()), CGAL::to_double(p2.y()));
}
double TrapDecomposition::f_manhattan_dist(double p1_x, double p1_y, double p2_x, doubl... | ALGO | 0.999918 | 3.647794 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-04-17T15:33: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": "0c709540ce... |
be7eb1fe-8c88-468c-a0e1-dca6904e9935 | llynv/CP-files | 1776L.cpp | /*
Code by: linvg
Created: 19.02.2025 00:41:35
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
string to_upper(string a) { for (int i = 0;i < (int)a.size();++i) if (a[i] >= 'a' && a[i] <= 'z') a[i] -= 'a' - 'A'; return a;... | ALGO | 0.999512 | 4.842085 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-05-26T04:12:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "daa8b31b74b... |
f8af0c5b-0f70-42fc-8596-0b06215a5100 | Ankesh2004/CSES-SOLVED | DP/Rectangle_Cutting.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define lld long double
#define pb push_back
#define ff first
#define ss second
#define fri(n) for (int i = 0; i < n; i++)
#define sortv(v) sort((v).begin(), (v).end())
#define printv(v, start_idx) \
for (int i = start_idx; i <... | ALGO | 0.999923 | 3.851453 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2024-12-02T10:36:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "576944d1ba9... |
fe7bcb7e-75cb-4d0f-93bc-98b308d0c7ff | noahfrench/CS2150-Labs | lab9/threexinput.cpp | /*
* <NAME> (njf5cu)
* Lab 9
* 11/14/17
* Filename: threexinput.cpp
* File Description: main method to read in numbers for threexplusone routine
*/
#include <iostream>
#include "timer.h"
using namespace std;
extern "C" long threexplusone(long);
int main() {
long x;
long n;
long steps;
double avgTime;... | ALGO | 0.993846 | 4.589648 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-06-12T13:51: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": "518637b6cc... |
64ec8211-2f4b-4a26-ae36-5be34d2c0405 | SgtApone117/leetcode_daily | 208-implement-trie-prefix-tree/implement-trie-prefix-tree.cpp | struct TrieNode
{
TrieNode* data[26];
bool isEnd;
TrieNode() :isEnd(false){
for(int i = 0; i < 26; i++)
data[i] = nullptr;
}
};
class Trie {
private:
TrieNode* root;
public:
Trie(){
root = new TrieNode();
}
void insert(string word) {
TrieNod... | ALGO | 0.99987 | 5.605136 | {
"github_metadata": {
"branch": "main",
"commit_count": 1440,
"repo_created_at": "2023-10-11T16:39:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "182a8f519... |
bba0a82f-4d98-4d7c-be31-fb3036f15e0e | WUST-mengqinyu/Template | 04_String/02_Trie/02_Persistence Trie.cpp | const int maxn = 1e5 + 10;
int a[maxn], rt[maxn], n;
struct Trie
{
int tot;
int child[maxn * 32][2], sum[maxn *32];
int insert(int x, int val)
{
int tmp, y;
tmp = y= ++tot;
for(int i = 30; i >= 0; --i)
{
child[y][0] = child[x][0];
child[y][1] = child[x][1];
sum[y] = sum[x] + 1;
int t = val >> ... | ALGO | 0.999655 | 3.449656 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-04-17T13:37:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "620b46e2c... |
09c040a4-be40-4c23-ba63-c631d69e37c6 | PharaHoG/DailyAlgo | 240904_37_sudoku-solver/37_sudoku-solver.cpp | // 方法一
class Solution {
public:
void findBlank(const vector<vector<char>>& board, int* row, int* col) {
// 从给定 row col 开始查找下一个 blank 坐标
for (int i = *row; i < 9; i++) {
for (int j = *col; j < 9; j++) {
if (board[i][j] == '.') {
*row = i;
... | ALGO | 0.999681 | 5.761601 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-03-20T17:46:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09ef72c6268... |
96be7fe2-26cc-4d02-9c98-3ab36a260a58 | kamyu104/LeetCode-Solutions | C++/distribute-elements-into-two-arrays-ii.cpp | // Time: O(nlogn)
// Space: O(n)
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
// ordered set
class Solution {
public:
vector<int> resultArray(vector<int>& nums) {
using ordered_set = tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree... | ALGO | 1 | 5.909138 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
4fed3a4e-7c0d-4ab4-811a-9c97f134e9c1 | wonda-tea-coffee/atcoder | agc/040/c.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sort(a) ... | ALGO | 0.999763 | 3.481971 | {
"github_metadata": {
"branch": "master",
"commit_count": 700,
"repo_created_at": "2020-01-26T23:31:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b07356c5... |
76c597eb-d4d0-4810-a37c-1ec36147c33d | SayanBanerjee-007/All_DSA_Learning | 3-DSA-CPP-Apna-College/6_MaximumCircularSubarray.cpp | #include <iostream>
using namespace std;
int kaden(int arr[], int size)
{
int cur_sum = 0, ans = INT_MIN;
for (int i = 0; i < size; i++)
{
cur_sum += arr[i];
if (ans < cur_sum)
ans = cur_sum;
if (cur_sum < 0)
cur_sum = 0;
}
return ans;
}
int main()
{... | ALGO | 0.999989 | 4.632524 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-03-19T07:30: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": "a3cc205f0f34... |
ef3b91f1-0fc3-421c-8275-b930a2cd89c6 | kamyu104/LeetCode-Solutions | C++/sliding-puzzle.cpp | // Time: O((m * n) * (m * n)!)
// Space: O((m * n) * (m * n)!)
// A* Search Algorithm
class Solution {
public:
int slidingPuzzle(vector<vector<int>>& board) {
const auto& R = board.size(), &C = board[0].size();
vector<int> begin, end;
unordered_map<int, pair<int, int>> expected;
in... | ALGO | 0.999892 | 6.165352 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
d76acb5f-5113-4e84-9966-594cb5186dea | LeeJungHwi/Algorithm | 프로그래머스/2/169199. 리코쳇 로봇/리코쳇 로봇.cpp | #include <string>
#include <queue>
#include <iostream>
#include <vector>
using namespace std;
int solution(vector<string> board)
{
int answer = 0;
// 시작위치에서 목표위치까지 최단횟수 말하는 게임 도달할수없으면 -1 출력
// 말은 상하좌우로 장애물이나 경계를 만날때까지 이동을 한번이동으로 간주함
// board : .(빈공간) R(로봇 처음위치) D(장애물 위치) G(목표 위치)
// 그래프 ... | ALGO | 0.999637 | 4.440694 | {
"github_metadata": {
"branch": "master",
"commit_count": 1326,
"repo_created_at": "2024-01-24T18:58:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6257b3... |
304cefc1-2390-4d45-b88b-a67041232595 | C5Hwang/Online-Judge-Solutions | UOJ/UOJ34_Iteration.cpp | #include <math.h>
#include <complex>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#define pi acos(-1)
typedef std::complex<double> CN ;
const int MAX_N = 4e5 + 10 ;
CN a[MAX_N] , b[MAX_N] ;
int n , m , L , rex[MAX_N] ;
void fft(CN *a , int ty) {
for (int i = 0 ; i < n ; ++i) if (i < rex[i]) std::swa... | ALGO | 0.999958 | 3.144799 | {
"github_metadata": {
"branch": "master",
"commit_count": 189,
"repo_created_at": "2018-09-23T16:39:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0dbb8849... |
035d1adc-4266-4d4d-9650-2ef8f2c9c009 | virajchandra51/LeetCode | Solved_Question_Set_1/Maximum Profit - GFG/maximum-profit.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
vector<vector<vector<int>>> dp;
int helper(int k, bool bought, int i, int n, int A[])
{
if(k==0 || i>=n)
retu... | ALGO | 0.999845 | 5.136514 | {
"github_metadata": {
"branch": "main",
"commit_count": 3056,
"repo_created_at": "2022-08-21T17:14:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7178877ff... |
6d2d0927-370b-4938-91bd-6ba973cc1698 | AppleYoujatea/FirstApplePie | week1/김도은/일요일/BOJ_12014.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
vector<int> cache;
int main() {
int n, m, testcase = 1;
cin >> m;
while (cin >> n) {
cache.clear();
cin >> m;
for (int i = 1; i <= n; i++) {
... | ALGO | 0.999949 | 3.357303 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-03-06T10:54:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb88c6b178e8... |
f806e9f6-92a8-4c9c-aabf-3c599cbe647b | ZDoom/Raze | tools/re2c/src/ir/adfa/adfa.cc | #include <assert.h>
#include <queue>
#include <set>
#include <vector>
#include <utility>
#include "src/codegen/go.h"
#include "src/ir/adfa/adfa.h"
#include "src/ir/dfa/dfa.h"
#include "src/ir/skeleton/skeleton.h"
#include "src/util/allocate.h"
namespace re2c
{
DFA::DFA
( const dfa_t &dfa
, const std::vector<size_t... | ALGO | 0.965262 | 6.586306 | {
"github_metadata": {
"branch": "master",
"commit_count": 21445,
"repo_created_at": "2019-12-27T11:29:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 784,
"forks": 65,
"issues": 112,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7... |
65a589d4-de54-46d0-8066-3e33c885e1ea | JWHennessey/how2sketch | igl/outer_facet.h | #ifndef IGL_OUTER_FACET_H
#define IGL_OUTER_FACET_H
#include "igl_inline.h"
#include <Eigen/Core>
namespace igl
{
// Compute a single facet which is guaranteed to be part of the "outer hull of
// a mesh (V,F). This implementation follows Section 3.6 of "Direct repair of
// self-intersecting meshes" [Attene 2014].... | ALGO | 0.996759 | 6.27738 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-03-14T16:24:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 38,
"forks": 10,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "03fa4146... |
6ecd50ae-a977-469f-9775-9ebfaa530698 | opencv/opencv_contrib | modules/tracking/src/legacy/trackerKCF.legacy.hpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, i... | TOOL | 0.907 | 6.704368 | {
"github_metadata": {
"branch": "4.x",
"commit_count": 4557,
"repo_created_at": "2013-09-11T13:28:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9757,
"forks": 5828,
"issues": 553,
"pull_requests": 88
},
"file_meta": {
"content_id": "bf... |
e4a9b970-388c-4384-a0ec-ba93c5ff51e4 | HPC-Fortran2CPP/Fortran2Cpp | data/readable_format/cpp/file2225.cpp | #include <iostream>
double cvmgp(double x1, double x2, int x3) {
if (x3 < 0) {
return x2;
} else {
return x1;
}
}
double cvmgz(double x1, double x2, int x3) {
if (x3 < 0) {
return x2;
} else {
return x1;
}
}
double cvmgn(double x1, double x2, int x3) {
if (... | ALGO | 0.972386 | 5.641057 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2024-04-05T20:02:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13,
"forks": 5,
"issues": 55,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b57a950d0... |
3573b866-8e36-455f-b96c-b1678f301d27 | Sanketkatkade/DSA | 06].Matrix/002_find_target.cpp | #include <iostream>
using namespace std;
int ispresent(int arr[][4], int target, int m, int n)
{
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
if (arr[i][j] == target)
{
return 1;
}
}
}
return 0;
}
int main()
{
... | ALGO | 0.997134 | 4.654112 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2023-04-06T19:29:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "691da5d7b55... |
d595323e-941c-4d5b-8fa7-c854b6f7607b | niazlv/universityKPFU1courseC-- | laba12/src/labwork12_3.cpp | #include <iostream>
using namespace std;
int numsCount(int number, int counter = 0)
{
if (number == 0)
{
return counter;
}
return numsCount(number / 10, counter += 1);
}
int numsSumm(int number, int summ = 0)
{
if (number == 0)
{
return summ;
}
return numsSumm(number / ... | ALGO | 0.996381 | 4.015718 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-05T09:01: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": "c7769110500a... |
9046b5ad-2ec6-4ef7-9fa6-c92f57297c6e | weshoke/ofxOpenVDB | libs/OpenVDB/openvdb/tools/LevelSetTracker.h | ///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2012-2013 DreamWorks Animation LLC
//
// All rights reserved. This software is distributed under the
// Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
//
// Redistributions of source code must retain the abov... | ALGO | 0.999407 | 4.061746 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-06-03T04:47:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c09fa0de9... |
2771cbef-e41c-4562-8380-05b2bdbce9a6 | rohan8789/Data-Structures-and-Algorithms | GeeksForGeeksPractice/05_Searching/05_CountOccurance.cpp | #include<bits/stdc++.h>
using namespace std;
int CountOccurance(int *arr, int n, int x)
{
int c=0;
for(int i=0; i<n; i++)
{
if(arr[i]==x)
c++;
}
return c;
}
int first(int *arr, int n, int x)
{
int l=0, h=n-1;
while(l<=h)
{
int mid=(l+h)/2;
if(arr[mid... | ALGO | 0.999942 | 5.03623 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-04-26T09:32: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": "2e1626a649a... |
71760608-d1d2-49f0-8f0e-688c88573765 | olethrosdc/beliefbox | src/algorithms/tests/aristedes.cc | #include <iostream>
#include <bitset>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <sstream>
#include <fstream>
#include <cmath>
#include "PolicyEvaluation.h"
#include "PolicyIteration.h"
#include "ValueIteration.h"
#include "RandomMDP.h"
#include "... | ALGO | 0.999528 | 5.999256 | {
"github_metadata": {
"branch": "master",
"commit_count": 1611,
"repo_created_at": "2015-03-20T15:15:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "56f9bab... |
81b087c6-1b67-4bf3-9dcb-4d9da28a4a83 | aminjonshermatov/competitive_programming | atcoder/abc/302/C.cpp | #include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#define _GLIBCXX_DEBUG
#else
#define dbg(...) 42
#endif
using namespace std;
void solve() {
int n, m; cin >> n >> m;
vector<string> ws(n);
for (auto &w : ws) cin >> w;
vector<int> id(n);
std::iota(id.begin(), id.end(), 0);
do {
bool ok = true;... | ALGO | 0.999994 | 5.308978 | {
"github_metadata": {
"branch": "master",
"commit_count": 1009,
"repo_created_at": "2022-06-30T12:19: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": "bdddacb... |
1216bce4-276a-47b2-9b3f-dfb9a1b949f6 | PoPo-789/OOP-LAB | BTTH3/Bai01/TamGiac.cpp | #include "TamGiac.h"
cTamGiac::cTamGiac() {
A = cDiem(0, 0);
B = cDiem(0, 0);
C = cDiem(0, 0);
}
cTamGiac::cTamGiac(cDiem a, cDiem b, cDiem c) {
A = a;
B = b;
C = c;
}
cTamGiac::cTamGiac(cTamGiac &tg) {
A = tg.A;
B = tg.B;
C = tg.C;
}
cTamGiac::~cTamGiac() {
//
}
void cTamGi... | ALGO | 0.996252 | 3.730222 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-04-03T03:29: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": "6f9d4a2cd5a... |
4e6dd215-314d-425f-bb15-52670b54c7b0 | knausb/vcfR | src/masplit.cpp | #include <Rcpp.h>
#include "vcfRCommon.h"
// Helper for std::sort.
struct greater
{
template<class T>
bool operator()(T const &a, T const &b) const { return a > b; }
};
struct lesser
{
template<class T>
bool operator()(T const &a, T const &b) const { return a < b; }
};
// Convert vectors of strings ... | DATA | 0.977747 | 6.046774 | {
"github_metadata": {
"branch": "master",
"commit_count": 1471,
"repo_created_at": "2013-10-28T17:09:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 260,
"forks": 53,
"issues": 40,
"pull_requests": 1
},
"file_meta": {
"content_id": "96f... |
d54027d6-fdd4-4616-8a9c-6b2c9ab05b8f | jinhwanlazy/problem-solving | boj_7579/solution.cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
using LD = long double;
int main() {
int N, M;
scanf("%d %d", &N, &M);
vector<int> ms(N);
for (int i = 0; i < N; ++i) {
scanf("%d", &ms[i]);
}
vector<int> cs(N);
for (int i = 0; i < N; ++i) {
scanf("%d", &cs[i]);
}
/*
... | ALGO | 0.999988 | 3.676201 | {
"github_metadata": {
"branch": "main",
"commit_count": 160,
"repo_created_at": "2022-05-13T18:28:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "091beffa2b... |
ceb416fe-138e-4322-b5a5-4296e5aaeb72 | KISHANsingh0001/Supream_2.0_DSA_by_CODE_help | 24_Dynamic Programming-Level-1/03_Dynamic Programming Class-3/02_01 Knapsack Problem(Algorithm)/solution.cpp |
#include <iostream>
#include<vector>
using namespace std;
int solveUsingRecursion(int capacity, int wt[], int profit[], int index, int n)
{
// base case
if (index >= n)
{
return 0;
}
// inc / exc
int include = 0;
if (wt[index] <= capacity)
{
include = profit[index] + so... | ALGO | 0.999997 | 5.465044 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2023-09-28T19:14:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4c0e7d6... |
fb64dbfb-7ab2-41e1-a7ff-8f0af84936c2 | JeraKrs/acm | codes/UVA/10001-19999/uva10006.cpp | #include <stdio.h>
#include <string.h>
const int N = 65005;
int n, prime[N];
void init() {
memset(prime, 0, sizeof(prime));
prime[0] = prime[1] = 1;
for (int i = 2; i < N; i++)
for (int j = i * 2; j < N; j += i)
prime[j] = 1;
}
long long count(int a, int c) {
if (c == 1) return a;
long long p = count(a, c... | ALGO | 0.999741 | 3.812763 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2016-05-23T06:40:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea16d888... |
2ecf0e10-bc4f-4d37-8b3b-cbd511046f32 | KhoiBui16/28Tech_Code_Online | C++/Source Code C++ Contest/SapXepTimKiem/B11_TronHaiDay.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
int main()
{
int n , m ; cin >> n >> m;
int b[n] , c[m];
for(int i = 0 ; i < n ; i++)
{
cin >> b[i];
}
for(int i = 0 ; i < m ; i++)
{
cin >> c[i];
}
int i = 0 , j = 0 ;
whi... | ALGO | 0.999987 | 3.110304 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2024-01-13T13:33:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2aab3d3065... |
29384742-901a-4ed7-b0ab-4dd62aab146d | fluetanol/CodingPractice | C++/백준코테/백준_G4_거짓말.cpp | // 문제번호 : 1043번
// 거짓말
// 푼 시간 : 40분
// 알고리즘 분류 : BFS (내가 푼 방식), Union Find(권장 방식), 그래프 탐색
// 권장하는 백준 알고리즘 분류 :그래프 탐색, 분리 집합
#include <iostream>
#include <vector>
using namespace std;
void BFS(vector<vector<int>> &party, vector<int> truth, vector<int> partyq)
{
while (!partyq.empty())
{
int truepers... | ALGO | 0.999777 | 4.052045 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2024-02-15T10:43: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": "d7d7bb43bd3... |
9f21a31c-b689-481f-8607-a74d0357fa4d | Loks-/competitions | common/data_structures/segment_tree/info/max_count.h | #pragma once
#include "common/data_structures/segment_tree/info/max.h"
#include "common/data_structures/segment_tree/info/none.h"
namespace ds {
namespace st {
namespace info {
template <class TMaxValue, class TInfo = None>
class MaxCount : public Max<TMaxValue, TInfo> {
public:
using TBase = Max<TMaxValue, TInfo>... | ALGO | 0.991277 | 6.845026 | {
"github_metadata": {
"branch": "master",
"commit_count": 3122,
"repo_created_at": "2018-06-04T04:19:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8465b47... |
36b0405e-4980-4e2c-ad13-b701fd4619e7 | davisking/dlib | dlib/entropy_encoder_model/entropy_encoder_model_kernel_4.h | // Copyright (C) 2005 <NAME> (<EMAIL>)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ENTROPY_ENCODER_MODEL_KERNEl_4_
#define DLIB_ENTROPY_ENCODER_MODEL_KERNEl_4_
#include "../algs.h"
#include "entropy_encoder_model_kernel_abstract.h"
#include "../assert.h"
namespace dlib
{... | ALGO | 0.998661 | 6.28918 | {
"github_metadata": {
"branch": "master",
"commit_count": 8325,
"repo_created_at": "2014-01-29T00:45:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14068,
"forks": 3436,
"issues": 41,
"pull_requests": 5
},
"file_meta": {
"content_id": ... |
9d1dc21b-95e2-4021-aaed-668a6a393c75 | rahulgrover99/Competitive | Atcoder-grand-046/a.cpp | #include <bits/stdc++.h>
#define FOR0(i, n) for (int i = 0; i < n; i++)
#define FOR1(i, n) for (int i = 1; i <= n; i++)
#define FORl(i, l, n) for (int i = l; i < n; i++)
using namespace std;
#define pi pair<ll, ll>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#defi... | ALGO | 0.999939 | 3.583513 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2019-10-07T03:42: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": "16d39bdc4... |
4302b8b3-c350-414d-a25b-48617b71f154 | derenlei/Trie | main.cpp | #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <sstream>
#include <algorithm>
#include <iterator>
#include <cstdlib>
#include "Trie.h"
using namespace std;
vector<string> strToVec(string sentence){
vector<string> vec;
string element = "";
for(int i=0; i < sentence.length(); i++)... | ALGO | 0.99928 | 3.863995 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-10-22T06:30:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12c4c0d52... |
47735a2f-8b58-4b56-8a5a-7fa5d876c410 | hmazhar/physbam_public | PhysBAM_Tools/Adaptive_Arithmetic/ADAPTIVE_QUOTIENT.h | //#####################################################################
// Copyright 2008, <NAME>.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
#ifndef __ADA... | ALGO | 0.992558 | 5.709192 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2014-04-02T21:48:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 13,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "866dbcb... |
3684904c-850f-4912-a079-52219f3aed53 | danielhO9/PS | BOJ/1086.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL N, K, cache[100][32768], mod[15], etime[750];
string temp[15];
void getEtime() {
etime[0] = 1 % K;
for (int i = 1; i < 750; ++i) etime[i] = ((etime[i - 1] * 10) % K);
}
void getMod(int idx) {
for (int i = 0; i < temp[idx].size(); ++i) ... | ALGO | 0.99968 | 4.654665 | {
"github_metadata": {
"branch": "main",
"commit_count": 336,
"repo_created_at": "2024-02-08T11:38:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d26526d0a9... |
62bf7165-830b-4ac2-a69e-50ae97cd2db7 | hyunseung-asong/MoonLandingSimulation | Octree.cpp |
//--------------------------------------------------------------
//
// <NAME>
//
// Simple Octree Implementation 11/10/2020
//
// Copyright (c) by <NAME>
// Copying or use without permission is prohibited by law.
//
#include "Octree.h"
//draw a box from a "Box" class
//
void Octree::drawBox(const Box& box... | ALGO | 0.995228 | 4.999913 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-09-24T09:15:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2967e04e9003... |
55345052-f9a4-461b-8a7a-049417970915 | nryadav18/LeetCode | 859-design-circular-deque/design-circular-deque.cpp | class MyCircularDeque {
public:
int List[1001];
int prev = 500, next = 500, maxSize = -1, listSize = 0;
MyCircularDeque(int k) {
for (int i=0;i<1001;i++){
List[i] = -1;
}
maxSize = k;
}
bool insertFront(int value) {
if (listSize == maxSize){
... | ALGO | 0.998764 | 5.758093 | {
"github_metadata": {
"branch": "main",
"commit_count": 635,
"repo_created_at": "2024-01-27T18:02:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee9bb5e25f... |
46855514-af22-4813-9b66-6082e7b8c29e | openpbs/openpbs | src/scheduler/site_code.cpp | /*
* Copyright (C) 1994-2021 Altair Engineering, Inc.
* For more information, contact Altair at www.altair.com.
*
* This file is part of both the OpenPBS software ("OpenPBS")
* and the PBS Professional ("PBS Pro") software.
*
* Open Source License Information:
*
* OpenPBS is free software. You can redistribute... | ALGO | 0.959326 | 3.096982 | {
"github_metadata": {
"branch": "master",
"commit_count": 2222,
"repo_created_at": "2016-05-18T04:31:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 750,
"forks": 343,
"issues": 105,
"pull_requests": 3
},
"file_meta": {
"content_id": "a6... |
40b180b0-2950-4c60-b2f5-930dbec25964 | QuickSorting/CompetitiveProgramming | Olympiad/IOI/IOI 19-vision.cpp | #include "vision.h"
#include <bits/stdc++.h>
using namespace std;
int add_not(int N);
int add_and(vector<int> Ns);
int add_or(vector<int> Ns);
int add_xor(vector<int> Ns);
vector<int> mv(int a, int b = -1, int c = -1){
vector<int> v;
v.push_back(a);
if(b != -1){
v.push_back(b);
}
if(c != -1){
v.push_back(c... | ALGO | 0.999434 | 3.675799 | {
"github_metadata": {
"branch": "master",
"commit_count": 107,
"repo_created_at": "2019-08-13T13:48: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": "d06bafef... |
1427f05f-1ca0-40dd-b4fd-7c3a9186e50e | Hwkz0/CustomROTEncryptor | main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <chrono>
#include <thread>
using namespace std;
//Function used to append a certain amount of seconds to the program
void wait(int seconds){
this_thread::sleep_for(chrono::seconds(seconds));
}
//Function used to terminate the program after a ce... | TOOL | 0.99881 | 4.866783 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-31T08:41: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": "5281d2458546... |
307ef1c1-8b2b-4f79-9350-c3b239e11575 | cvc5/cvc5 | src/theory/quantifiers/sygus/enum_stream_substitution.h | /******************************************************************************
* Top contributors (to current version):
* <NAME>, <NAME>, <NAME>
*
* This file is part of the cvc5 project.
*
* Copyright (c) 2009-2025 by the authors listed in the file AUTHORS
* in the top-level source directory and their instit... | ALGO | 0.901741 | 6.891691 | {
"github_metadata": {
"branch": "main",
"commit_count": 13437,
"repo_created_at": "2012-12-06T18:45:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1150,
"forks": 259,
"issues": 116,
"pull_requests": 56
},
"file_meta": {
"content_id": "e... |
0aad386d-5e35-4df4-bee4-016ec9557aa2 | 1750252467/CppLearning | LeetCode/Day33/134.加油站.cpp | /*
* @lc app=leetcode.cn id=134 lang=cpp
* @lcpr version=21906
*
* [134] 加油站
*/
using namespace std;
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#include <tuple>
#include <uno... | ALGO | 0.999995 | 5.993701 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2023-03-13T09:10:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "49480659b63... |
7812725b-05b3-435a-8cc5-fcdbcbf547c7 | ryuci/algorithm | Algorithm/runtime/multiply.cpp | //
// multiplication.cpp
// Algorithm
//
// Created by <NAME> on 01/02/2019.
// Copyright © 2019 codetolearn.kr. All rights reserved.
//
#include "helper.hpp"
#include "runtime.hpp"
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
using namespace boost::numeric::ublas;
// Big intege... | ALGO | 0.999565 | 5.085903 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-01-31T16:18:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d97ac7d0e... |
7bc54b07-36a2-4d17-9f8e-c34bc0619ed1 | Coccccode/project | DFS/maze_EE.h | #ifndef maze_EE_h
#define maze_EE_h
#include <iostream>
#include <stack>
using namespace std;
class node {
public:
int x, y;
int dir;
node(int i, int j)
{
x = i;
y = j;
// Initially direction
// set to 0
dir = 0;
}
};
class RatInMaze {
private: int fx, fy; // Food coordinates
bool** visi... | ALGO | 0.999796 | 3.756387 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-05-21T09:13:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94ecd5b701... |
46854e01-2dcf-4d47-b047-0ccce431f52b | vector94/Competitive-programming-library | Dynamic Programming/LightOJ DP/1157 - LCS Revisited.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define fi first
#define se second
#define pb push_back
#define pbb pop_back
#define mp make_pair
#define pii ... | ALGO | 0.999997 | 4.865028 | {
"github_metadata": {
"branch": "master",
"commit_count": 367,
"repo_created_at": "2021-09-30T14:41: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": "80b5556c... |
3976a552-07d3-4677-bb93-de7b170bcbd0 | rainbow-auto/rainbow-codes | ACWing/849.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
using namespace std;
namespace Reader{
int read ()
{
char c = getchar ();
int x = ... | ALGO | 0.999943 | 3.793688 | {
"github_metadata": {
"branch": "master",
"commit_count": 749,
"repo_created_at": "2024-09-07T02:10:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ffc5447... |
bbe89547-4079-47a0-b918-2058bfad4193 | vi5hnuu/love-babbar-dssa-sheet-sol | graph/contest.cpp | #include<bits/stdc++.h>
using namespace std;
// int solve(vector<int> &nums){
// int sum=0;
// bool found=false;
// bool negative=nums[0]<0;
// for(int i=1;i<nums.size();i++){
// if(nums[i]==nums[i-1] && nums[i]==-1){
// nums[i]=nums[i-1]=1;
// found=true;
// break;
// }
// if(nu... | ALGO | 0.999754 | 4.791413 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2022-08-02T00:45: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": "258147915... |
02fb110b-7362-4ede-a5b3-7454e3c5f899 | brownfox2k6/UET_code_submissions | INT2210 - Cấu trúc dữ liệu và giải thuật/template_from_scratch/template_BST_AVL.cpp | // BST and AVL Implementation Template
// Instructions: Implement the missing function definitions for each class.
// Each function has comments indicating what it should do.
#include <iostream>
#include <queue>
// Binary Search Tree Node
class Node {
public:
int data;
Node* left;
Node* right;
int hei... | ALGO | 0.998796 | 7.276381 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2024-12-17T14:38: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": "09b9bb0e3eb... |
fce1a1dd-4ca3-4288-8137-a428da0624aa | Raining00/XunFei-Planning-SmartCar | laser_detection/src/laser_tracking.cpp | #include "laser_detection/laser_tracking.h"
int LaserTracking::GetArea(Point point, std::vector<std::vector<Point>> polygons) {
int N = polygons.size();
for (int M = 0; M < N; ++M) {
int n = polygons[M].size();
int i, j, c = 0;
for (i = 0, j = n - 1; i < n; j = i++) {
if (((polygons[M][i].y > poi... | TOOL | 0.964253 | 5.255379 | {
"github_metadata": {
"branch": "ver5.3",
"commit_count": 3,
"repo_created_at": "2021-07-04T09:31: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": "4e48f14f6a... |
de12a41a-872d-4d4a-8362-5a47de6a7284 | scary-mist/STL-cpp- | Sequence container: Vector/Sequence container: Vector/main.cpp | //
// main.cpp
// Sequence container: Vector
//
// Created by <NAME> on 24/08/22.
//
#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Person{
friend ostream &operator<<(ostream &os,const Person &p);
string name;
int age;
public:
Person() = default;
Person(str... | TOOL | 0.931478 | 4.424601 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-08-22T13:06: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": "270c1d4a7ff5... |
c263d905-5cf8-4829-9e04-59451725b0ed | Tariqul-huda/CP-problem | Codeforces/B_250_Thousand_Tons_of_TNT.cpp | #include "bits/stdc++.h"
using namespace std;
#define max(a, b) (a < b ? b : a)
#define min(a, b) ((a > b) ? b : a)
#define mod 1e9 + 7
#define FOR(a, c) for (int(a) = 0; (a) < (c); (a)++)
#define FORL(a, b, c) for (int(a) = (b); (a) <= (c); (a)++)
#define FORR(a, b, c) for (int(a) = (b); (a) >= (c); (a)--)
#define INF... | ALGO | 0.999722 | 3.710403 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-02-15T21:19: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": "44748035b69... |
54cc4c16-f760-4f50-bc69-b788b94a4b31 | AutumnKite/Codes | Luogu/4145 花神游历各国/并查集,树状数组/std.cpp | #include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <cmath>
long long read(){
register long long x = 0;
register char f = 1, ch = getchar();
for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = 0;
for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ '0');
return f... | ALGO | 0.999844 | 4.01817 | {
"github_metadata": {
"branch": "master",
"commit_count": 683,
"repo_created_at": "2019-08-18T00:53:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17903740... |
d220aa87-3f75-4d0a-b39c-d841d77ffa9c | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/07/0705/personal_submission/cf103d_kamtuo.cpp | /*----------------------------------*/
/* Author : KaMtuo */
/* Email : <EMAIL> */
/* Creation_time : 2024-07-05 17:31 */
/* Software : Visual Studio Code */
/*----------------------------------*/
const int N = 312345, M = 612;
LL dp[M][M];
int pos[N];
LL a[N];
int n;
LL ans[N];
vector<... | ALGO | 0.999694 | 4.137046 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "32f4... |
916e5467-d12f-473d-a65a-b46190528b04 | gokulraktate/DAA | B/B1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int maxShop(vector<int>& S, vector<int>& E, int K)
{
int N = S.size();
vector<pair<int, int>> shops;
for (int i = 0; i < N; i++)
{
shops.push_back({E[i], S[i]});
}
sort(shops.begin(), shops.end());
... | ALGO | 0.999912 | 5.897158 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-08-21T16:59:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40404bd8bf3a... |
05c39575-a215-42ad-8e46-d8661db392b8 | ihoromi4/opencv3x-examples | CompareTrackers/main.cpp | #include <iostream>
#include <opencv2/highgui.hpp>
#include <opencv2/tracking.hpp> // need contrib
using namespace std;
using namespace cv;
Scalar COLOR_RED = Scalar(0, 0, 255); // BGR
Scalar COLOR_GREEN = Scalar(0, 255 ,0);
void drawText(Mat &frame)
{
int dx = 10;
int iy = 2;
int sy = 15;
putText(f... | TOOL | 0.934948 | 4.87729 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-01-21T20:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58af3e2c7... |
c0d5258c-106c-4d8c-ba38-08e4459f474e | hirakuuuu/kyopro | ABC/284/g.cpp | #include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define rrep(i, a, n) for(int i = a; i >= n; i--)
#define inr(l, x, r) (l <= x && x < r)
#define ll long long
#define ld long double
// using mint = modint1000000007;
// u... | ALGO | 0.999997 | 4.885491 | {
"github_metadata": {
"branch": "master",
"commit_count": 452,
"repo_created_at": "2022-02-25T05:22:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ab35ed7... |
c3904740-1f73-4fe0-b359-0a85f0859b4d | famus2310/CP | SPOJ/NPC2015D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<int, pair<int, int> > piii;
#define pb push_back
#define debug(x) cout << x << endl
#define fastio ios_base::sync_with_stdio(0), cin.tie(0)
#define PI acos(-1)
#define all(c) c.begin(), c.end()
#define SET(x, y)... | ALGO | 0.999979 | 3.645519 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-08-12T00:10: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": "eb7feb5d9... |
77677674-2d82-4323-9db2-763d00de7fd1 | ASSERT-KTH/Supersonic | predictions/submissions-aizu-coop-gpt4/Codenet/p00227/286820744/response_3.cpp | #include <algorithm>
#include <iostream>
#include <vector>
int main() {
std::ios_base::sync_with_stdio(false); // Speedup I/O
std::cin >> std::noskipws; // Skip whitespaces
int num, cap, price;
while (std::cin >> num >> cap) {
if (num == 0 && cap == 0) {
break;
}
s... | ALGO | 0.99978 | 5.138486 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-02-03T10:33:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed4f15fdd4c84... |
ebc0d86c-ac4a-451c-ad69-260bfc1fb121 | reobchichorro/INF112 | TP0/TP0/tp0a.cpp | #include <iostream>
#include <cmath>
using namespace std;
struct produto {
int peso;
int valor;
};
void subtrair_binarios(bool *comb, bool *subtraendo, const int n, int i) // Subtrai dois numeros binarios, representados como arranjos de inteiros
{
for( ; i>=0; i--)
{
if((int)comb[i]==1 || (... | ALGO | 0.999168 | 4.037889 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-04-16T23:40: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": "196eefd327... |
8db340fc-f80c-459d-915a-b1f9da206a34 | rewantsoni/trees | main.cpp | #include "iostream"
#include "stack"
#include "queue"
#include <map>
using namespace std;
//Node class
class Node {
public:
int data;
Node *left;
Node *right;
explicit Node(int d) {
data = d;
left = nullptr;
right = nullptr;
}
};
//Structure for Diameter and Height
class... | ALGO | 0.99999 | 4.040046 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-04-05T06: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": "0de35fb36d... |
9abcb5e8-5060-48c2-b91e-5fea7b8ff0a1 | Elpis-ES/neungji | prob/17090.cpp | #include <bits/stdc++.h>
using namespace std;
pair<char, int> map_arr[500][500];
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int main(){
int n, m;
int cnt = 0;
scanf(" %d %d", &n, &m);
queue<pair<int, int> > q;
for(int y = 0; y < n; y++){
for(int x = 0; x < m; x++){
... | ALGO | 0.999933 | 3.579313 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2022-01-10T16:29:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dda6c062653... |
afc01e9e-ceca-4080-bd4e-76f360af4c21 | jokercold/gluttony | Point dividing of trees/bzoj2599[IOI2011]Race.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int num,K,ans;
#define N 200005
int hash[1005000];
int to[N+N],hed[N],Next[N+N],val[N+N];
int deep[N],edge[N],size[N];
bool flag[N];
void add(int u,int v,int z){
++num;
to[num]=v;
val[num]=z;
Next[num]=hed[u];
hed[u]=num;
}
void gets... | ALGO | 0.999537 | 3.632094 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-09-07T06:13: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": "6ef32e070... |
b38105f4-3d24-4e85-a023-076dbf6da0fd | reverg/PS | boj/2240.cpp | #include <iostream>
using namespace std;
int main()
{
int T, W;
cin >> T >> W;
int drop[1001];
for (int i = 1; i <= T; i++)
cin >> drop[i];
int dp[1001][32][3];
dp[1][0][1] = (drop[1] == 1);
dp[1][1][2] = (drop[1] == 2);
for (int i = 2; i <= T; i++)
{
for (int j =... | ALGO | 0.999974 | 3.780102 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2021-06-24T14:39:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45070df8ed8... |
de634918-5d18-4ac7-b0f3-7cce740cdd23 | PaddlePaddle/Paddle-Lite | lite/kernels/host/roi_align_compute.cc | // Copyright (c) 2020 PaddlePaddle 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required... | DATA | 0.970909 | 6.860121 | {
"github_metadata": {
"branch": "develop",
"commit_count": 7526,
"repo_created_at": "2017-09-20T11:41:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7124,
"forks": 1620,
"issues": 68,
"pull_requests": 17
},
"file_meta": {
"content_id": ... |
c0337ca2-6ac1-4de8-8d58-dc3f05a74b9b | nmatkheev/Parallel_OpenMP | main.cpp | /* --------------------------------------------------------------- */
// You do not need to touch this
/* --------------------------------------------------------------- */
#include "logic.hpp"
int main(int argc, char** argv) {
if( argc < 3 ) {
std::cout << "Usage: " << argv[0] << " <retr... | ALGO | 0.978634 | 5.335518 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-11-25T17:31: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": "dd9f1c79d9... |
9f5c1ca9-2aee-43c6-aa2d-97e116c8064c | iamtuhinchakma/DSA-Assignment-Solution | DSA Assignment Solved/LinkedList/5.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node* next;
};
Node* createNode(int info){
Node* newNode = (Node*) malloc(sizeof(Node));
newNode->data = info;
newNode->next = NULL;
return newNode;
}
void printList(Node* start){
Node* ptr = start;
while(ptr != NULL)... | ALGO | 0.999986 | 5.341866 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2025-05-17T07:22:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc95e7dcfe3... |
a1a9792c-6083-495f-b9ac-5ee0aa53d8df | FoggyAndromeda/competitive_programming | codeforces/C/1720c.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n, m;
cin >> n >> m;
vector<vector<int>> a(n + 2, vector<int>(m + 2, 20));
int sum = 0;
for (int i = 1; i <= n; ++i)
{
string s;
cin >> s;
for (int j = 1; j <= m; ++j)
{
a[i][j] = s[j -... | ALGO | 0.999936 | 3.988791 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2022-12-23T18:57: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": "ffeb88fcc... |
48f46bd9-94c6-4302-9b8f-c68af4f7c1a7 | rahulsinghal1904/-Linker-Kernel-Process-Scheduler | ProcessSched/Algorithms.cpp | #include "Algorithms.hpp"
#include "ProcessCreation.cpp"
#include <iostream>
#include <iomanip>
using namespace std;
Process *FinalSched::FindLiveProcess() {
return LiveProcess;
}
void FinalSched::UpdateLiveProcess(Process *X) {
LiveProcess = X;
}
void FinalSched::add_process_with_decremented_priority(Process*... | ALGO | 0.997682 | 4.275929 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-03-30T23:15: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": "1701c043ca76... |
c33785b2-e7b2-43c4-a1e7-db95d092cc25 | abhishektyagiaktcode/Placement-Preparation-Module | DAY 16 TWO SUM .CPP | // TWO SUM.CPP LEETCODE SOLUTION
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
/* int left=0, right=int(nums.size())-1,tempsum;
while(left<right)
{
tempsum=nums[left]+nums[right];
if(tempsum==target)
return {left+1, right+... | ALGO | 0.99998 | 5.804813 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2022-07-04T17:09: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": "a29c0f408e3... |
f6bedbbf-c018-4788-929b-a8798851730e | PatelManav/Codeforces_Backup | 1165D.cpp | /*May The Force Be With Me*/
#include <bits/stdc++.h>
#include <stdio.h>
#include <ctype.h>
#pragma GCC optimize ("Ofast")
#define ll long long
#define MOD 1000000007
#define endl "\n"
#define vll vector<long long>
#define mll map<long long,long long>
#define pll pair<long long, long long>
#define all(c) c.begin(),c.en... | ALGO | 0.999695 | 3.757155 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2020-10-01T14:54:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd9970523... |
d571f1be-dc04-4e29-93fe-7c149121012f | jefby/Algorithm_Test | source/maxprofit.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
/*
题目描述:
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete as many transactions
as you like (ie, buy one and sell one share of th... | ALGO | 0.999408 | 4.542708 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2013-06-17T07:20: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": "aee69f729... |
8604d221-43d2-4f6f-aa87-dc8fc82f5479 | adle0na/Daily_Algorithm_Study | 백준/Silver/2485. 가로수/가로수.cc | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int gcd(int a, int b)
{
while (b != 0)
{
int tmp = a % b;
a = b;
b = tmp;
}
return a;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int N;
cin >> N;
vector<int> t... | ALGO | 0.999936 | 4.542637 | {
"github_metadata": {
"branch": "main",
"commit_count": 254,
"repo_created_at": "2022-10-22T14:37:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d5c59c869... |
82013acc-df72-4bc3-8166-09e88ed8d075 | xaemonn/Codeforces_solutions | C_Differential_Sorting.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define gc getchar_unlocked
#define fo(i, n) for (i = 0; i < n; i++)
#define Fo(i, k, n) for (i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define ss(s) scanf("%s", s)
#define pi(... | ALGO | 0.999436 | 3.554058 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-05-30T21:25: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": "7e8fc3625530... |
c3c9701e-b182-4287-beff-78d3782f377d | sxs-collaboration/spectre | src/DataStructures/Tensor/EagerMath/Norms.hpp | // Distributed under the MIT License.
// See LICENSE.txt for details.
#pragma once
#include <string>
#include "DataStructures/DataBox/Tag.hpp"
#include "DataStructures/DataBox/TagName.hpp"
#include "DataStructures/DataVector.hpp"
#include "DataStructures/Tensor/Tensor.hpp"
#include "Utilities/Functional.hpp"
#includ... | TOOL | 0.99353 | 7.319972 | {
"github_metadata": {
"branch": "develop",
"commit_count": 17103,
"repo_created_at": "2017-04-07T17:28:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 168,
"forks": 202,
"issues": 530,
"pull_requests": 57
},
"file_meta": {
"content_id": ... |
87f898f1-fa69-4e56-8818-e6fcc065c57b | Shubhams-2002/SdeSheet | DP_MCM_Partition/DP50_Minimum-Cost-to-Cut-the-Stick.cpp | #include<bits/stdc++.h>
//f(i,j) represents minimum cost to complete cuts from i to j including i and j
//cuts are 1,3,4 & c=3
//modify it to '0',1,3,4,'5'
//now call f(1,c) i.e. from 1 to 4
//cost to make the cut will be cuts[i-1]-cuts[j+1] i.e. '5'-'0'
//memoization
int f(int i, int j, vector<int> &cuts, vector<vec... | ALGO | 0.999761 | 4.229315 | {
"github_metadata": {
"branch": "main",
"commit_count": 155,
"repo_created_at": "2022-06-05T06:56:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1266063aa8... |
37162d2e-687d-48a6-ba23-ad642c61ac37 | maryamfahm99/Rasterization | src/matrix4.cpp | //
// matrix4.cpp
// Assignment3
//
// Created by memo2 on 10/27/23.
//
#include <stdio.h>
#include "matrix4.h"
matrix matrix::translate( float tx, float ty, float tz){
vec u = vec(1,0,0,tx);
vec v = vec(0,1,0,ty);
vec w = vec(0,0,1,tz);
vec t = vec(0,0,0,1);
matrix m = matrix(u,v,w,t);
re... | ALGO | 0.963044 | 4.94203 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-04-26T10:47: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": "2cbb7f501132... |
47dcd05f-4f7a-40ac-9832-0de81a02dad6 | gvrs9/Problem-Solving | 733-flood-fill/733-flood-fill.cpp | class Solution {
private:
bool isSafe(vector<vector<int> >& image, int val, int row, int col, int m, int n) {
return (row < 0 || row >= m || col < 0 || col >= n || val != image[row][col]) ? false : true;
}
void dfs(vector<vector<int> >& image, int val, int sr, int sc, int newColor, int m, int n) {
... | ALGO | 0.999634 | 6.225561 | {
"github_metadata": {
"branch": "main",
"commit_count": 1209,
"repo_created_at": "2022-05-06T08:45: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": "b16dd4f9a... |
d85211d3-f5ed-475e-9888-6d869007184b | aadityabhetuwal/CSE-1002-Problems | merge_sort.cpp | #include <iostream>
#include <vector>
#include <cmath>
#define ll long long
#define ull unsigned long long
#define FO(i, s, e, it) for(i = s; i < e; i += it)
#define RFO(i, s, e, it) for(i = e - 1; i >= s; i -= it)
using namespace std;
// vector<int> res;
void print_arr(vector<int> arr, int n){
for(int i = 0; ... | ALGO | 0.999989 | 5.515381 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-06-17T15:02:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e8efaa89ad... |
199c21d8-a42c-4654-85a9-86b13d85284b | wxzh/CP | examples/scans.cp | --> <List>
max (x : Int) (y : Int) = if x > y then x else y;
-----------------------------------------
-- Object algebra interface of circuits
-----------------------------------------
-- BEGIN_CIRCUIT_SIG
type CircuitSig<Circuit> = {
Identity : Int -> Circuit;
Fan : Int -> Circuit;
Above : Circuit -> ... | ALGO | 0.921757 | 4.2582 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2020-10-11T06:22:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ccbba0548e8... |
ddc93eb7-484a-4c6a-8d33-ab8c9f725978 | UET-2425HK2-INT2210-01/24020619-CTDLGT | 24020619_Lect12_Assignments/1.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <fstream>
using namespace std;
// DFS và lưu kết quả từ dưới lên
void topology(vector<vector<int>> &adj, vector<bool> &isVisited, int node, stack<int> &res) {
isVisited[node] = true; // Đánh dấu node đã được duyệt
// Duyệt tất cả các đỉnh kề với... | ALGO | 0.999994 | 5.058463 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2025-02-22T00:28:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fa7eea5df29... |
74ba3e68-43c1-4aff-93c1-5969e7f5036c | Divyansh-Mehta/Coding-ninja-dsa | Data-Structures-in-C++/Lecture-2-Dynamic-Allocation/Code/dynamic-2-d-array.cpp | #include <iostream>
using namespace std;
int main(){
// Taking rows (m) and column (n)
int n, m;
cin >> m >> n;
// Dynamically allocating 2-D array
int **arr = new int *[m];
for (int i = 0; i < m; i++){
*(arr + i) = new int [n]; // we could also use arr[i] in place of *(arr +... | ALGO | 0.918235 | 3.940397 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2021-09-07T13:45:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 19,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "00d9853... |
998254f1-99f0-449e-a5d1-e28be9d8a673 | huzch/C-STL | unordered_set_map/unordered_set_map/HashTable.h | #pragma once
#include<iostream>
#include<string>
#include<vector>
using namespace std;
namespace my
{
template<class K>
struct HashFunc
{
size_t operator()(const K& key)
{
return key;
}
};
template<>
struct HashFunc<string>
{
size_t operator()(const string& s)
{
size_t hash = 0;
for (auto& c... | ALGO | 0.972441 | 4.444855 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2024-05-21T06:31: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": "0c5f20348b4... |
9df1d38a-fbbf-4714-8c22-e894d98da0ee | khenm/cp_dsa | data_structure/array/peak_element.cpp | #include <bits/stdc++.h>
using namespace std;
// given an array, find all the local maximum
int find_peak(int arr[], int size) {
if (size == 1)
cout << arr[size - 1];
if (arr[0] > arr[1])
cout << arr[0] << " ";
if (arr[size - 1] > arr[size - 2])
cout << arr[size - 1] << " ";
fo... | ALGO | 0.99998 | 4.449401 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2024-06-18T08:59: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": "ba2c0bf00c... |
1bfcd0e1-d674-47b6-b7c8-593b299a2098 | satyabrata-mishra/450-dsa-sheet | Stack and Queue/C++/2.cpp | #include <iostream>
using namespace std;
class twoStacks
{
int arr[200];
int stack1 = 100, stack2 = 99;
public:
twoStacks() {}
// Function to push an integer into the stack1.
void push1(int x)
{
arr[stack1++] = x;
}
// Function to push an integer into the stack2.
void pus... | ALGO | 0.998349 | 4.864808 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2025-07-09T18:07: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": "b5e08628c0... |
f361d1b4-599a-4a57-848f-25d82f87909a | ishandutta2007/codeforces-h | heart_blue/normal/1515/D.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999641 | 4.108898 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "25b0befd744c... |
480d8b87-bf95-47be-a825-c06a9f86f755 | nawngs/CompetitiveProgramming | cses/Counting_Towers.cpp | #pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pll pair < ll, ll >
#define pii pair < int, int >
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const string NAME = "";
const string NAME2 =... | ALGO | 0.999835 | 4.216666 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-06-19T07:51:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e6b70d8cd8... |
c0a72fd0-f3c7-4ca0-8732-e9c61f897bd3 | erolm-a/competitive-programming | OII/caduta/caduta.cpp | #include <bits/stdc++.h>
typedef enum {
OK,
RISOLTO,
IMPOSSIBILE
} stato_t;
typedef struct {
int domino1;
int domino2;
} coppia_t;
// approccio N^3
static int* altezze, N;
bool cadono()
{
int l = 0;
int i = 0;
for(i = 0; i <= l; i++)
l = std::min(N-1, std::max(l, i + altezze... | ALGO | 0.999833 | 4.226247 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2017-06-02T10:10: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": "71473f9e2... |
f40d88ce-67e5-45ed-a27d-58fb325521c5 | suraj-iitb/algorithm-identification | BERT/Data_Dump/Merge/C++/Code/merge2353147.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 500000;
int cnt;
int A[MAXN], L[MAXN/2+5], R[MAXN/2+5];
void merge(int left, int mid, int right){
int n1 = mid - left, n2 = right - mid;
... | ALGO | 0.999919 | 3.626467 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2020-05-24T06:21:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 10
},
"file_meta": {
"content_id": "27bc353ae... |
70806105-8a16-4d5d-ae5b-5569d5e2a70c | XyeHyin/vscode | 校队集训/牛客/周赛/C.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int n = s.size();
vector<int> a(n + 1, 0), b(n + 1, 0);
for (int i = 0; i < n; i++){
a[i + 1] = a[i] + (islower(s[i]) ? 1 : 0);
}
for (int i = n - 1; i >= 0; i--){
b[n - i] = b[n - i - 1] + (isuppe... | ALGO | 0.999903 | 4.068419 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-07-02T00:53: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": "7f0f9b36cd75... |
532f0490-6187-48d7-a15a-02febcae0cb0 | Mocknbrd/Codeforces_solutions | Code/1514C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ios \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define YY cout<<"YES"<<endl
#define NN cout<<"NO"<<endl
#define yy cout<<"Yes"<<endl
#define nn cout<<"No"<<endl
#define endl "\n"
#define typecast ... | ALGO | 0.999921 | 3.785277 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2023-06-08T13:49: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": "077bb9e3e... |
9dba1582-c911-425d-9fa3-0e4f55c95e88 | wanggp3/CodeIn2014 | mytemplate/treap.cpp | #include<iostream>
#include<cstring>
#include<set>
#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<algorithm>
#include<stdio.h>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;++i)
#define fab(i,a,b) for(int i=a;i<=b;++i)
#define fba(i,b,a) for(int i=b;i>=a;--i)... | ALGO | 0.999976 | 3.54542 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2015-03-06T16:35: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": "ccac067af3... |
9ae04d85-3c57-4ce5-8e7c-41d40cade702 | ACM-TOMS/CALGO | 0910/Original-Submission/functions/bessel/airy_a.cpp |
#include <functions/bessel/airy.h>
#include <functions/bessel/airy_util.h>
#include <functions/hypergeometric/hypergeometric.h>
#include <functions/bessel/bessel.h>
#include <functions/gamma/gamma.h>
#include <functions/gamma/gamma_util.h>
namespace AiryAi_Series
{
static e_float AtZero (const e_float& x... | ALGO | 0.998356 | 6.292251 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-11-17T18:24:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 1,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "535655c25d1... |
5d8f7e9b-b5fd-4610-a4e4-0f68579bbabb | praneeth2212/Coding | Graphs/Number of Islands.cpp | // https://leetcode.com/problems/number-of-islands/
class Solution
{
public:
void bfs(map<pair<int, int>, bool> &visited, int row, int col, vector<vector<char>> &grid)
{
queue<pair<int, int>> q;
q.push({row, col});
visited[{row, col}] = true;
while (!q.empty())
{
... | ALGO | 0.999932 | 6.419072 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2023-05-25T09:30: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": "fac5abfe... |
360bcf42-d9cf-4bf5-a50b-9e119ed33e4d | UNSEEN1st-AlgorithmStudy/PS | JHJ/2667.cpp | #include <iostream>
#include <queue>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
const int moveY[] = { 0, 0, 1, -1 };
const int moveX[] = { 1, -1, 0, 0 };
const int MAX = 26;
int map[MAX][MAX];
bool visit[MAX][MAX];
int mapSize;
bool IsOut(int y, int x){
return (x < 0 || y < 0 ||... | ALGO | 0.999971 | 3.65797 | {
"github_metadata": {
"branch": "main",
"commit_count": 281,
"repo_created_at": "2023-03-26T02:27:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0893c35df8d... |
24c0eb4f-ca70-4dbf-a7e3-13c6605beb07 | OpenXRay/xray | SDK/boost_1_30_0/libs/graph/test/bellman-test.cpp | // From <NAME> <<EMAIL>>
/*Expected Output:-
A: 0 A
B: 11 A
Actual Output:-
A: 0 A
B: 2147483647 B
*/
#include <iostream>
#include <iomanip>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/bellman_ford_shortest_paths.hpp>
#include <boost/cstdlib.hpp>
int main()
{
using namespace boost;
enum... | ALGO | 0.999701 | 4.582278 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-03-21T12:57:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 104,
"forks": 25,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "8087e0de... |
c42fd8fc-ef75-43a6-b345-7af76be8f178 | borglab/gtsam | gtsam/3rdparty/GeographicLib/src/Math.cpp | /**
* \file Math.cpp
* \brief Implementation for GeographicLib::Math class
*
* Copyright (c) <NAME> (2015) <<EMAIL>> and licensed
* under the MIT/X11 License. For more information, see
* https://geographiclib.sourceforge.io/
**********************************************************************/
#include <Geog... | TOOL | 0.992762 | 6.557401 | {
"github_metadata": {
"branch": "develop",
"commit_count": 19360,
"repo_created_at": "2017-03-27T17:12:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3002,
"forks": 845,
"issues": 99,
"pull_requests": 25
},
"file_meta": {
"content_id": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.