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 |
|---|---|---|---|---|---|---|---|
4c1268ad-f6ff-4663-b819-b439e37b7082 | umanaandrew-cv/Graph-Components | Project3/digraphMatrix.h | #ifndef __DIGRAPH_MATRIX_H
#define __DIGRAPH_MATRIX_H
#include <string>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <stack>
using namespace std;
enum mark_t { UNDISCOVERED, DISCOVERED, EXPLORED };
struct edge;
typedef struct vertex
{
int vertexID;
int componentID;
unordered_set<... | ALGO | 0.997476 | 4.088657 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-04-29T02:50:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2086d1cf955... |
e9c5039e-523e-4379-b670-e4cd94ab020f | sysu18364114/LeetCode-Exercise | explore_lesson/F.cpp |
#include <iostream>
#include <cstdlib>
int F1(int N = 0)
{
if(N == 0)
{
return 1;
}
else
{
return N * F1(N - 1);
}
}
int F2(int N = 0)
{
if(N == 0)
{
return 0;
}
else
{
return N + F2(N - 1);
}
}
int F3(int N = 0)
{
if(N == 0)
{
... | ALGO | 0.999124 | 4.891617 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-04-19T11:37: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": "ac3e366b8e... |
8ae602e7-7dca-49b9-9980-5201324ea285 | vikasjha2003/Daily-Practice | C++/Vectors/sortcolors.cpp | #include<iostream>
#include<vector>
using namespace std;
int main () {
int l;
cout<<"Enter the length of array: ";
cin>>l;
cout<<"Enter the array: "<<endl;
vector<int> nums(l);
for(int i=0; i<l; i++) {
cin>>nums[i];
}
for(int i = 0; i<l; i++) {
cout<<nums[i]<<" ";
} c... | ALGO | 0.999943 | 3.681161 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2025-02-12T18:24: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": "510c364f49a... |
461740ba-ad11-4324-a1b6-909cbffae167 | whoenig/libMultiRobotPlanning | example/sipp.cpp | #include <fstream>
#include <iostream>
#include <boost/functional/hash.hpp>
#include <boost/program_options.hpp>
#include <yaml-cpp/yaml.h>
#include <libMultiRobotPlanning/sipp.hpp>
using libMultiRobotPlanning::SIPP;
using libMultiRobotPlanning::Neighbor;
using libMultiRobotPlanning::PlanResult;
struct State {
S... | TOOL | 0.998514 | 6.072916 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2017-11-06T20:16:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 932,
"forks": 232,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "c62f1a... |
3b2706a9-4f0c-41cc-8b5d-5f62e0f6b277 | batchenRothenberg/AllRepair | src/solvers/cvc/cvc_prop.h | /*******************************************************************\
Module:
Author: <NAME>, <EMAIL>
\*******************************************************************/
#ifndef CPROVER_PROP_CVC_PROP_H
#define CPROVER_PROP_CVC_PROP_H
#include <iosfwd>
#include <util/threeval.h>
#include <solvers/prop/prop.h>
... | ALGO | 0.976819 | 6.764839 | {
"github_metadata": {
"branch": "master",
"commit_count": 237,
"repo_created_at": "2018-05-08T11:21:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "87ce2cc... |
0fe3fe2d-58e8-468a-a690-95a65f47f93c | gnzlbg/blaze-lib | blaze/math/expressions/DMatTDMatMultExpr.h | //=================================================================================================
/*!
// \file blaze/math/expressions/DMatTDMatMultExpr.h
// \brief Header file for the dense matrix/transpose dense matrix multiplication expression
//
// Copyright (C) 2013 <NAME> - All Rights Reserved
//
// This fil... | ALGO | 0.963837 | 6.721326 | {
"github_metadata": {
"branch": "master",
"commit_count": 3217,
"repo_created_at": "2015-06-15T18:59: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": "8e36b3e... |
657a6e48-3627-4337-bfe6-e32d4388896a | kartikeyagup/CourseWork | COL106/Saksham/Graph.cpp | #include "Graph.h"
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <stack>
#include "FacebookVertex.h"
#define INT_MAX 32767
using namespace std;
struct node
{
int distance;
Vertex* ver;
int aindex;
};
class priorityqueue
{
private:
int index;
int capacity;
node* myarray;... | ALGO | 0.999696 | 3.407957 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2015-01-31T16:24:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d41feba29... |
d51ee2d9-f45e-494e-b3f3-bea403fe4ddf | jun130/DataStructure | LinkedList/LinkedList_Merge.cpp | #include <iostream>
using namespace std;
class chain; // chain_node에서 chain을 참조할수있도록 프로토 타입 선언
int merger(chain &x, chain &y, chain &z); // 체인합병함수 프로토타입 선언
class chain_node
{
private:
int data;
chain_node *next;
public:
chain_node() { data = 0, next = NULL; }
chain_node *insert(int curr_data, chain_node *tail)... | ALGO | 0.999926 | 4.926974 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2020-07-03T13:58:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b356243c4... |
4ddeaf50-252f-4a88-9078-2d45b0a203e3 | tonyyanga/fletcher32-simd | avx2.cpp | #include <string.h>
#include "avx2.h"
typedef struct flecther_avx2 {
uint32_t v[8] __attribute__((aligned(32)));
} fletcher_avx2;
/* AVX2 based implementation of Fletcher32 */
uint32_t fletcher32_avx2 (uint16_t* data, size_t len, uint32_t& a, uint32_t& b) {
// Create ctx to store registers
fletcher_avx2 ... | ALGO | 0.987888 | 5.643576 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-10-02T21:20: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": "eadf80c3b... |
3e578a69-11d7-4c5f-a78c-cd2d340fd589 | open-airlab/VTNMPC-Autonomous-Wind-Turbine-Inspection | WTI_catkin/NMPC_code_generator/ros_acado_bridge/ACADOtoolkit/examples/ocp/lsq_term.cpp | /*
* This file is part of ACADO Toolkit.
*
* ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
* Copyright (C) 2008-2014 by <NAME>, <NAME>,
* <NAME>, <NAME>, <NAME>.
* Developed within the Optimization in Engineering Center (OPTEC)
* under supervision of <NAME>. All rig... | ALGO | 0.999164 | 5.458403 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2022-05-10T08:14:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3070f7fc33d... |
9d3ef0ed-1504-4bca-9474-7b5c3d502c59 | aushakov95/computer-science-330 | lab01/lab_01.cpp | /*******************************************************************************
* <NAME>
* lab_01.cpp
* 01/17/16
* This program converts an infix expression into a prefix to postfix expression.
* Time complexity: O(n³)
********************************************************************************/
#include <iostream... | ALGO | 0.999649 | 4.257972 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2016-02-01T00:47:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd3ceb530... |
fe98fcc1-4042-462b-91ae-1139e404a59e | blockchaincavs/LeetCode | ValidAnagram_242/validanagram.cpp | #include "validanagram.h"
ValidAnagram::ValidAnagram()
{
}
/*!
* \brief ValidAnagram::isAnagram
* \param s
* \param t
* \return
*
* Uses a HashMap to keep count of characters in each string
* Time/Space Complexity: O(n + m)
*/
bool ValidAnagram::isAnagram(std::string s, std::string t)
{
// Anagram must ... | ALGO | 0.985238 | 5.184353 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-07-01T20:13:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18245594066... |
e3fe9bf8-86f6-4192-8e7e-3e24ab790ffb | Deanamic/Competitive-Programming | Gym/101806/W.cc | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const ll oo = 0x3f3f3f3f3f3f3f3fLL;
#define FOR(i, a, b) for(int i = (a); i < int(b); i++)
#define FORD(i, a, b) for(int i = (b)-1; i >= int(a); i--)
#define has(c, e) ((c).find(e) != (c).end())
#d... | ALGO | 0.999998 | 3.589854 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-12-22T23:05: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": "720d59ff1b... |
34ad0344-23eb-47a8-8fbf-79df8ded246e | dhnesh12/codechef-solutions | 04-CodeChef-Hard/413--Pizza Delivery.cpp | /*
Author: Racer5x
*************************************** UNAUTHORISED COPYING OF CODE PROHIBITED **********************************
*/
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
... | ALGO | 0.999937 | 4.673588 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-04-06T05: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": "1120a5d12b... |
5f0a41cf-485c-48fe-923c-b32516ec38b7 | WhuBooks/PointCloudMap | src/LineSupportRegion.h | //
// Created by whubooks on 18-4-18.
//
#ifndef POINTCLOUDMAP_LINESUPPORTREGION_H
#define POINTCLOUDMAP_LINESUPPORTREGION_H
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <Eigen/Core>
#include <Eigen/Dense>
#include <opencv2/opencv.hpp>
#include <CloudUtil.h>
namespace PCM ... | ALGO | 0.96209 | 5.439012 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-02-25T00:40:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "473d45cdbb... |
3c865ee9-7b60-43a7-86a1-96e08a61f628 | gigablast/open-source-search-engine | IndexTable2.h | // <NAME>, copyright Aug 2001
// . calls for intersecting a bunch of IndexLists to generate docIds
// . IndexLists are data-less lists (keys only)
// . each key in an IndexList is a termId/score/adultBit/docId tuple
// . we try to use as small a sublist of each IndexList as possible to avoid
// wasting network bandw... | ALGO | 0.937013 | 5.117473 | {
"github_metadata": {
"branch": "master",
"commit_count": 3838,
"repo_created_at": "2013-08-02T20:07:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1575,
"forks": 448,
"issues": 94,
"pull_requests": 1
},
"file_meta": {
"content_id": "b... |
d87588f1-e987-471b-b1d4-66932bf74f9a | menna1261/IEEE-CS-25 | Rookies/Task4/A - Minimum Knight moves.cpp | #include <iostream>
#include <utility>
#include <vector>
#include <queue>
using namespace std;
vector<pair<int, int>> validMoves = {
{2, 1}, {2, -1}, {-2, 1}, {-2, -1},
{1, 2}, {1, -2}, {-1, 2}, {-1, -2}
};
bool is_within_bounds(pair<int, int> position) {
return position.first >= 0 && position.first < 8 ... | ALGO | 0.999798 | 5.709805 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-12-02T18:12: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": "15a7e66b884... |
72fe5018-5264-4920-9a19-84d87bf7bab0 | miiitomi/atcoder | mayocon/20240806/2.cpp | // https://atcoder.jp/contests/abc304/tasks/abc304_c
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint998244353;
const ll INF = 2e+18;
const ll MOD = 998244353;
struct UnionFind {
vector<int> par, siz;
UnionFind(int n) : par... | ALGO | 0.999988 | 5.685315 | {
"github_metadata": {
"branch": "main",
"commit_count": 765,
"repo_created_at": "2021-03-02T13:45: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": "3d3de678b2... |
aadddd7d-9f5b-4ea4-9caf-f3c1c070d1e1 | octopus0110/Products | Mazelib.cpp | #include "Time.cpp"
#include "Shuffle.cpp"
#include <iostream>
#include <vector>
#include <random>
#include <fstream>
#include <queue>
#include <stack>
#include <chrono>
#include <thread>
using namespace std;
#define DEBUG false // trueにすると呼ばれた関数をコンソールに出力
#define ZENKAKU true // trueにすると全角文字で表示
/* 迷路生成アルゴリズムを選択 */
... | ALGO | 0.999629 | 3.559251 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-03-11T17:40: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": "4fab073cd8... |
0c2818d4-7798-46e8-b9a0-317eb6f675c7 | rohan-goyal-1/CP | USACO/Silver/HighCardWins.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
#define fo(i, n) for (int i = 0; i < n; i++)
#define endl '\n'
using ll = long long;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
#define f first
#define s second
#define mp make_pair
using v... | ALGO | 0.999953 | 3.814816 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-05-23T04:55: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": "37d58ae08ad... |
2c76366e-fd0a-43d9-b09c-3aaf8e2a77cc | alps-jbnu/23ALPStudy | 2023-1/Basic/highcastle01/Deque/BOJ_10866.cpp | #include<bits/stdc++.h>
using namespace std;
int MAX = 10001;
int dat[20003];
int head = MAX, tail = MAX;
void push_front(int x)
{
dat[--head] = x;
}
void push_back(int x)
{
dat[tail++] = x;
}
int pop_front()
{
return dat[head++];
}
int pop_back()
{
return dat[--tail];
}
int empty()
{
if(head == tail)
{
... | ALGO | 0.998877 | 4.045097 | {
"github_metadata": {
"branch": "main",
"commit_count": 2930,
"repo_created_at": "2023-02-03T06:11:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 59,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d9e2db2... |
547e8634-9371-4e29-9b37-602d492fe4b3 | github-of-NMI/datastructures-in-Cpp | Queue.cpp | #include <iostream>
struct Node{
int64_t data;
Node* next;
};
Node* head = nullptr;
Node* tail = nullptr;
bool is_empty(){
if(tail==nullptr)
return true;
else
return false;
}
void enqueue(int64_t data){
struct Node* node = (struct Node*)malloc(sizeof(struct Node));
node->da... | ALGO | 0.979054 | 4.19345 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-04-05T18:32: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": "fcb715507a17... |
c94a6483-0a08-4b40-b662-426d2ef64b29 | fyhtea/Algo | leetcode/jingdong_4_9/problem2.cpp | /*************************************************************************
> File Name: problem2.cpp
> Author:
> Mail:
> Created Time: 2018年04月09日 星期一 21时51分11秒
************************************************************************/
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long ... | ALGO | 0.999975 | 3.910636 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2017-11-01T13:08: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": "a176b419d... |
581bd53a-cfb4-4e26-b091-55049e4c01c0 | matthewsamuel95/ACM-ICPC-Algorithms | Data Structures/Segment Tree/Persistent_Segment_Tree.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mk make_pair
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> ii;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
const int N = 1e5 + 5, M = 3e7 + 7;
int n, a[N];
int root[N], nodes, L[M], R[M], s... | ALGO | 0.999835 | 3.557662 | {
"github_metadata": {
"branch": "master",
"commit_count": 1421,
"repo_created_at": "2017-10-21T21:46:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2203,
"forks": 1277,
"issues": 4,
"pull_requests": 48
},
"file_meta": {
"content_id": "... |
cd3f971a-59bf-452b-9d03-bea9c67addba | 113bommy/PathRepair | variable_trace/cpp/cpp_code/cpp_correct/cpp_correct_test_45_0.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 110;
int n;
int a[N];
void solve() {
scanf("%d", &n);
int now = 1;
for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
if (n == 1) {
if (a[1] == 1)
printf("2\n");
else
printf("1\n");
return;
}
if (a[1] == 1) now++;
for (int i... | ALGO | 0.999964 | 4.047293 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-11-11T15:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd4ec14615b... |
8e81defc-073c-4517-b252-612856045b56 | lionel-git/TestCses | TestCses/pb_subarray_sum1.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <chrono>
#include <cassert>
#include <stack>
#include <cstdlib>
#include <random>
#include <functional>
#define MY_TEST "c:\\tmp\\my_test.txt"
#define MY_OUT "c:\\tm... | ALGO | 0.999683 | 4.402747 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2020-06-28T13:01:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00d938f67... |
3c0defc2-3d51-4123-915c-474613bcf256 | adityasinghhh/coding | codeforces/practice/107C.cpp |
#include<algorithm>
#include<assert.h>
#include<bitset>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<deque>
#include<iostream>
#include<map>
#include<memory.h>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<string>
#include<utility>
#include<... | ALGO | 0.99991 | 3.402856 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2013-05-26T14:49:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77e682f602... |
95915abd-e5cd-46e8-9bfc-2403a0973979 | uukuguy/everdata | src/datagraph/ldac/ldac_gibbs.cc | /*
* Copyright (C) 2007 by
*
* <NAME>
* <EMAIL> or <EMAIL>
* Graduate School of Information Sciences
* Tohoku University
*
* GibbsLDA++ is a free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either ve... | ALGO | 0.998354 | 5.847031 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2015-02-17T12: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": "15539f0f9... |
56df412d-0c06-4c7e-8bfd-b5eaa44e1715 | catid/halide-test | benchmark.cpp | #include <iostream>
#include <vector>
#include <chrono>
#include <cstdint>
#include <algorithm>
using namespace std;
#include "imgproc.hpp"
//------------------------------------------------------------------------
// Benchmark
void Benchmark()
{
std::vector<int> micros;
const int seed = 1234;
std::mt1... | TEST | 0.91324 | 6.325133 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-06-09T20:32:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c37ad944e6b... |
05848d60-11b8-4457-b57c-d4b199ba403a | huicongfu/MinimalDataStructure | set/description.cpp | // 15-以集合描述算法
#include <iostream>
#include <set>
#include <vector>
#include <string>
using namespace std;
int main()
{
//差集
set<int> A = {3, 2, 1, 4, 7, 9, 11};
set<int> B = {6, 2, 9};
vector<int> C;
//为了时间效率,初始内存大小
C.reserve(A.size());
for (auto iter = A.begin(); iter != A.end(); ++iter) {
if (B.find(*it... | ALGO | 0.995691 | 4.068893 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-04-08T13:40: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": "d6abdaa84... |
4e494529-4d93-458b-8389-caea2f33d23f | Siddhant103/LeetCode | 2-add-two-numbers/2-add-two-numbers.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbe... | ALGO | 0.999964 | 6.180056 | {
"github_metadata": {
"branch": "main",
"commit_count": 3087,
"repo_created_at": "2021-05-04T08:05:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0fb2cedc... |
1abdb613-bcf6-4bc9-aedc-2691db663d8b | MrLakshay/Coding-blocks | Pracitce/circulargreater.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int stk[n];
int ans[n];
int stkptr = -1;
for (int i = 0; i < n; i++)
{
ans[i] = -1;
}
for (int i = 0; i < 2 * n; i++)
... | ALGO | 0.999999 | 3.878319 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2022-08-22T16:35: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": "0dd020eb2... |
bca2846c-e475-4841-b666-9ddc542d157c | altdavid18357/codeforces | 2117D-Retaliation.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
/*
essentially, the main idea here is that
#1 - the array has to be an arithmetic seqeunce, which is what the first part is doing. this is kind of like pruning in a way.
#2 - basically we want all elements of the array to be divisible by (n+... | ALGO | 0.999863 | 4.826519 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2025-07-06T22:41: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": "b90bec0a2e9... |
d25d3c9f-26ad-49bc-8cbf-bc6eac4c8f01 | rdtsc/codeeval-solutions | src/hard/flight-370/solutions/c++/solution.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <fstream>
#include <iostream>
#include <limits>
#include <locale>
#include <map>
#include <vector>
struct Marker
{
unsigned id;
const char* name;
unsigned weight;
double x, y, timestamp;
};
struct Target
{
Target() : radius(), x(), y() {}
... | TOOL | 0.988963 | 6.012877 | {
"github_metadata": {
"branch": "master",
"commit_count": 1287,
"repo_created_at": "2020-03-07T01:37:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1ea7ad... |
2f9856a5-b8a4-49b0-824d-e642f0054ae9 | arpansahu/Graph | Implement_Graph_Data_Structure_in_C++_Weighted _Un_Directed_Graph_Using_STL.cpp | #include "iostream"
#include "vector"
using namespace std;
struct Edge {
int source,destination,weight;
};
class Graph{
public:
vector<vector<pair<int,int>>> adjList;
Graph(vector<Edge> edges,int N){
adjList.resize(N);
for(auto i : edges){
pair<int,int> pair1(i.destination,i.we... | ALGO | 0.999759 | 4.997791 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2020-04-18T06:29:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3603147bc... |
ec84004a-a178-48bb-8125-bfbd4cac6141 | liuperic/Programming-Principles-and-Practice--Using-Cpp | ch_4/ch_4_drill_6.cpp | // ch 4 drill #6
// C++
#include "../std_lib_facilities.h"
// Enter a number and spits it back out. If number is the largest
// or smallest enterred so far (after 1st iteration) it will indicate as such.
int main()
{
double x = 0;
double smallest = 0;
double largest = 0;
// prompts user fo... | ALGO | 0.996588 | 4.241393 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2020-03-27T17:37: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": "bb78c8d9c... |
5a4fd862-98d7-4421-bf83-fe80d34248b0 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/09/0903/personal_submission/cf1031d_tsreaper.cpp | #include <bits/stdc++.h>
#define MAXN 2000
#define INF ((int) 1e9)
using namespace std;
int n, K;
char MAP[MAXN + 5][MAXN + 5], ans[MAXN * 2 + 5];
int f[MAXN + 5][MAXN + 5];
bool vis[MAXN + 5][MAXN + 5];
int main() {
scanf("%d%d", &n, &K);
for (int i = 0; i < n; i++) scanf("%s", MAP[i]);
f[0][0] = (MAP[... | ALGO | 0.999919 | 3.276988 | {
"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": "80a7... |
7843a13a-5af7-40ab-b283-5f8a8fd25d0f | Mulab11/cntt2016-hw1 | TC-SRM-549-div1-250/zsyzzsoft.cpp | #include <algorithm>
using namespace std;
class PointyWizardHats
{
public:
int n, m;
int getNumHats(vector<int> ah, vector<int> ar, vector<int> bh, vector<int> br)
{
n = ah.size(), m = bh.size();
bool used[100] = {0};
int ans = 0;
for(int i = 0; i < n; i++) //将上方帽子按半径排序,贪心匹配
{
for(int j = n - 1; j > i;... | ALGO | 0.999902 | 4.310317 | {
"github_metadata": {
"branch": "master",
"commit_count": 4450,
"repo_created_at": "2016-09-28T13:04:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 28,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "b441b... |
ac8a6138-23f1-4dac-bde8-a9ec8c5dfed5 | yutarchery/GitCoder | ABC/301-350/abc338/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;
typedef vector<vector<ll>> Mat;
#define fi first
#define se second
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
c... | ALGO | 0.99992 | 4.641533 | {
"github_metadata": {
"branch": "main",
"commit_count": 1429,
"repo_created_at": "2021-04-20T14:39:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "032f7ceac... |
1cb1f13c-48c0-4da2-a97b-147dddb4334a | luctivud/Coding-Trash | cf-266A.cpp | /* ## ## ####### # # ######
## ## ## ## ### ##
## ## ## # # # ##
######### ####### # # ## */
#include <bits/stdc++.h>
using namespace std;
const long long int MODPRIME {1000000007};
const long long int BABYMOD {998244353};
const long int MAXN = (long int) 1e6;
typedef lon... | ALGO | 0.997314 | 3.351664 | {
"github_metadata": {
"branch": "master",
"commit_count": 172,
"repo_created_at": "2020-02-17T02:05: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": "29d9face... |
4f7e3150-c448-48eb-ab2c-921db8d33ae4 | agral/CompetitiveProgramming | LeetCode/3394/cpp/lc3394.cpp | #include <algorithm>
#include <iostream>
#include <vector>
// Runtime complexity: O(sort) == O(nlogn)
// Auxiliary space complexity: O(n) for holding the sorted coords.
class Solution {
public:
bool checkValidCuts(int n, std::vector<std::vector<int>>& rectangles) {
std::vector<std::pair<int, int>> xCoords;... | ALGO | 0.999882 | 6.291638 | {
"github_metadata": {
"branch": "master",
"commit_count": 768,
"repo_created_at": "2017-12-01T07:24: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": "950c5c7e... |
37ad358c-6013-42a8-a030-163efc8418db | AryanTapre/dsa-journey-by-aryan | problems/arrays/17-missing-elements.cpp | /** Find missing elements from array with duplicates */
#include <iostream>
#include <vector>
using namespace std;
vector<int> findMissingElements(vector<int> v) {
if (v.empty()) {
vector<int> em;
return em;
}
vector<int> missingElements;
for (size_t i = 0; i < v.size(); ++i) {
... | ALGO | 0.999703 | 5.04585 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2025-06-11T14:09: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": "d93ca5f5887... |
b2011b1e-c5f2-4cf8-b706-c68da8b65756 | UdayVaghela26/DSA | 7_vector.cpp | // Question 7: Working with Vectors in C++
// Problem: Write a program to demonstrate the use of vectors. Perform the following operations: Add
// elements, access elements, modify elements, and delete an element from the vector.
// Input Example:
// Add: [10, 20, 30, 40], Remove: 30
// Output Example:
// Updated Vecto... | ALGO | 0.970401 | 4.687385 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-12-29T09:49: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": "d857c7132ebd... |
26a4819b-ebb9-4206-a653-4eb73a59bc9e | alexandraback/datacollection | solutions_5669245564223488_0/C++/alex20030190/B.cpp | #include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<list>
#include<queue>
#include<map>
#include<cmath>
#include<string>
#include<cstdlib>
#include<ctime>
#include<vector>
#include<deque>
#include<stack>
using namespace std;
#define LL long long
#define ULL unsigned long long
#define UI u... | ALGO | 0.999974 | 3.778661 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb0a06067... |
14d2ead1-0522-440f-a0c7-b2f148b8e88d | RitishShah/6Companies30days | Amazon/question13.cpp | class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
int n = grid.size(), m = grid[0].size();
int totalOranges=0;
queue<pair<int,int>> rotten;
int countRotten=0;
int minutes = 0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
... | ALGO | 0.999979 | 6.534699 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-01-06T10:40: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": "7c67b41731d7... |
741e7ef7-aa9a-4e69-9357-c3b93d1f5fc3 | alisw/AliPhysics | PWGPP/EVCHAR/AliCentralityByFunction.cxx | /**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
* Contributors ... | ALGO | 0.907161 | 5.372151 | {
"github_metadata": {
"branch": "master",
"commit_count": 89208,
"repo_created_at": "2016-06-21T19:31:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 104,
"forks": 792,
"issues": 0,
"pull_requests": 9
},
"file_meta": {
"content_id": "daf... |
bb0ba3fd-f811-4d8b-97f8-56b9b0c23ae6 | FangGet/BundleFusion_Ubuntu_Pangolin | include/FreeImage/include/CGAL/Regular_triangulation_euclidean_traits_3.h | // Copyright (c) 1999,2004 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// You can redistribute it and/or modify it under the terms of the GNU
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, or (at ... | ALGO | 0.998543 | 7.489058 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-06-29T03:53:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 34,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "526b075... |
9a18854e-a83d-4517-9aea-00dbc978de61 | samyak2405/MY-LeetCoding | Maximum of all subarrays of size k - GFG/maximum-of-all-subarrays-of-size-k.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:
//Function to find maximum of each subarray of size k.
vector <int> max_of_subarrays(int *arr, int n, int k)
{
vecto... | ALGO | 0.999829 | 5.994324 | {
"github_metadata": {
"branch": "main",
"commit_count": 3156,
"repo_created_at": "2021-12-31T05:57: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": "4bc355067... |
d5133bd8-ae0b-4df0-9b4f-bfa4100dbc6e | yangggzhang/Convergent-SST | c_sst_in_cpp/include/systems/gripper_2D_OP.hpp | /**
* @file climb_hill.hpp
*
*
*/
#ifndef SPARSE_GRIPPER_2D_OP_HPP
#define SPARSE_GRIPPER_2D_OP_HPP
#include "systems/system.hpp"
class gripper_2D_OP_t : public system_t
{
public:
gripper_2D_OP_t()
{
state_dimension = 2;
control_dimension = 2;
temp_state = new double[state_dimension];
number_of_parti... | ALGO | 0.985365 | 5.231755 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2018-05-31T00:44:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "11e02e279... |
c6d5d09c-e27a-4bfa-9e06-e4beb614daa3 | takano536/atcoder | abc/abc267/d.cpp | #include <iostream>
#include <limits>
#include <vector>
int main() {
constexpr long long INF = std::numeric_limits<long long>::max();
int n, m;
std::cin >> n >> m;
std::vector<long long> a(n);
for (auto &ai : a) std::cin >> ai;
std::vector dp(n + 1, std::vector<long long>(m + 1, -INF));
... | ALGO | 0.999979 | 4.604515 | {
"github_metadata": {
"branch": "master",
"commit_count": 1167,
"repo_created_at": "2021-06-13T11:06:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08b6072... |
5113a615-2815-4ed3-91ef-f76356321206 | ameer-bauer/higan-097 | higan/sfc/alt/ppu-balanced/render/line.cpp | inline auto PPU::get_palette(uint8 index) -> uint16 {
const uint addr = index << 1;
return cgram[addr] + (cgram[addr + 1] << 8);
}
//p = 00000bgr <palette data>
//t = BBGGGRRR <tilemap data>
//r = 0BBb00GGGg0RRRr0 <return data>
inline auto PPU::get_direct_color(uint8 p, uint8 t) -> uint16 {
return ((t & 7) << 2)... | TOOL | 0.9387 | 5.772928 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2016-03-14T01:09:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dea766f87... |
9c2dd45b-77de-4853-b415-b93a15e19993 | russellboyd/acc_cpp | ex2-4.cpp | /*
<<<<<<< dev
Q - The framing program writes the mostly blank lines that separates the borders from the greeting one character at a time. Change the program so that it writes all the psaces needed in a single output expression.
A -
=======
Q - The framing program writes the mostly blank lines that separates the bord... | TOOL | 0.973159 | 4.944483 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-04-30T18:12: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": "90addea6f... |
a140788c-3ca4-4609-a7a6-2b4bc408d892 | AnonCSR/PathFinder | pathfinder/src/query/executor/binding_iter/paths/all_shortest_trails/bfs_enum.h | #pragma once
#include <memory>
#include <queue>
#include "query/executor/binding_iter.h"
#include "query/executor/binding_iter/paths/all_shortest_trails/search_state.h"
#include "query/parser/paths/automaton/rpq_automaton.h"
#include "misc/arena.h"
#include "third_party/robin_hood/robin_hood.h"
namespace Paths { nam... | ALGO | 0.999574 | 6.102478 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-10-13T06:22:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55564ffd2ea7... |
25db9d02-8feb-4b32-8559-98d078ca85d7 | autowarefoundation/autoware_universe | planning/autoware_freespace_planning_algorithms/include/autoware/freespace_planning_algorithms/astar_search.hpp | // Copyright 2015-2019 Autoware Foundation. 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... | ALGO | 0.999633 | 6.707249 | {
"github_metadata": {
"branch": "main",
"commit_count": 8531,
"repo_created_at": "2021-11-19T02:59:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1208,
"forks": 763,
"issues": 216,
"pull_requests": 161
},
"file_meta": {
"content_id": "6... |
188105f4-9b41-4baf-ba9f-6e51b6cc5c08 | caetanosauer/zero | src/cmd/kits/sort.cpp | /* -*- mode:C++; c-basic-offset:4 -*-
Shore-kits -- Benchmark implementations for Shore-MT
Copyright (c) 2007-2009
Data Intensive Applications and Systems Labaratory (DIAS)
Ecole Polytechnique Federale de Lausanne
All Rights Reserved.
Permi... | TOOL | 0.973598 | 5.610442 | {
"github_metadata": {
"branch": "master",
"commit_count": 2373,
"repo_created_at": "2015-03-16T18:42:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 10,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "ada24... |
fb186f8e-6af2-4c1b-9209-4a87aee63565 | rikuTanide/atcoder_endeavor | arc081/arc081_b.cpp | #include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
using namespace std;
const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
... | ALGO | 0.999998 | 4.01769 | {
"github_metadata": {
"branch": "master",
"commit_count": 4423,
"repo_created_at": "2020-12-05T04:36:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b08642... |
8505895d-26da-4707-8a94-96f1428dfc7f | Ganbusier/final_thesis | src/analysis.cpp | #include <algorithm>
#include <cmath>
#include <limits>
#include <numeric>
#include <set>
#include "analysis.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
namespace myAnalysis {
void Analysis::analyze() {
matchEdges();
distanceAnalysis();
angleAnalysis();
calculateStatistics();
}
void Analysis:... | ALGO | 0.996575 | 5.71235 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2025-05-19T11:00:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a14b139c40d... |
9cb55ea6-bfb6-4d11-b6ae-bb87a78bebff | minseo300/Algorithms | 백준/구현/14889.cpp | #include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <unordered_map>
#include <stack>
#include<cstring>
using namespace std;
int n;
int map[21][21];
int start[21];
vector<int> link;
int used[21];
int ans=21e8;
int cal_start(){
int sum=0;
for(in... | ALGO | 0.999978 | 3.983676 | {
"github_metadata": {
"branch": "main",
"commit_count": 203,
"repo_created_at": "2022-05-07T04:11:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "898cf764a3... |
f82da570-d740-49ac-bcab-bafa7d29ca22 | li924579/ACM | 2015暑假集训/DAY-45-多校训练6/I.cpp | //
// Created by CQU_CST_WuErli
// Copyright (c) 2015 CQU_CST_WuErli. All rights reserved.
//
// #include<bits/stdc++.h>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#... | ALGO | 0.999962 | 3.02778 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2016-07-07T06:13: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": "b739e046a... |
0734513c-4e62-4358-a427-d3822edae4c2 | leonardoAnjos16/Competitive-Programming | CSES/download_speed.cpp | #include <bits/stdc++.h>
using namespace std;
#define long long long int
struct MaxFlow {
private:
int n;
vector<vector<int>> g;
vector<vector<long>> c;
public:
MaxFlow(int n, vector<vector<int>> &g, vector<vector<long>> &c) {
this->n = n;
this->g = g;
this->c = c;
}
... | ALGO | 0.999914 | 4.719322 | {
"github_metadata": {
"branch": "master",
"commit_count": 539,
"repo_created_at": "2019-12-27T05:52:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3df6980d... |
273e9346-2de0-42c8-8ba4-5f8e72200d23 | Taein2/Algorithm | (C++)SamungSDS대학생알고리즘특강/동적계획법1/PLATINUM_14003_가장긴증가하는부분수열.cpp | #include <iostream>
#include <stack>
#include <vector>
#define MAX 1000000
using namespace std;
int n;
int arr[MAX+1];
int dp[MAX+1]; // 만들 수 있는 x의 길이의 LIS 성분
vector<int> st;
int cnt = 0;
vector<int> result;
stack<int> print;
int lis(){
result.push_back(arr[1]);
for(int i=2; i<=n; i++){
if(result[... | ALGO | 0.999999 | 4.067997 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2021-07-03T15:44: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": "54119d276... |
0add5fa3-eee5-4564-b4d7-264725505cd1 | bothemrun/CAP-Complete-Algorithmic-Programming | Leetcode_All_Solved/57.cpp | //m0
//m1: binary search
#include<algorithm>
#include<limits.h>
class Solution {
public:
vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newInterval) {
//NOTE: edge case
if(intervals.size() == 0){
return vector<vector<int>>({ vector<int>({newInterval}) });
... | ALGO | 0.999996 | 6.050688 | {
"github_metadata": {
"branch": "main",
"commit_count": 1606,
"repo_created_at": "2022-02-13T12:44:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "781537770... |
33269bf3-58d6-4cf0-9f34-f6008a7e24b0 | SiddhantDesale/Projects | Generalized_DS_Library/Library.h | #include<iostream>
using namespace std;
///////////////////////////////////////////////////////////////////////////////////////////
// Structure for singly linear and singly circular
///////////////////////////////////////////////////////////////////////////////////////////
template <class T>
struct NodeS
{
T d... | ALGO | 0.998932 | 3.628839 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-08-10T10:16: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": "0e1eadfc7cab... |
b2981516-2cce-4e45-99d1-902ab929cda4 | PRINCERAHUL1/6Companies30Days | Company 3 - Walmart/368. Largest Divisible Subset.cpp | class Solution {
public:
vector<int> largestDivisibleSubset(vector<int>& nums) {
int n = nums.size();
vector<int> res;
if(n == 0)
return res;
if(n == 1)
return nums;
sort(nums.begin(), nums.end());
int maxi = 0;
... | ALGO | 0.999993 | 5.567156 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2025-01-01T06:50:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f96eabcbf... |
fe8d532f-8e1f-4ebb-b063-d594c922db24 | dhyanesh/randomdev | topcoder/algorithm/TheArray.cc | // BEGIN CUT HERE
// PROBLEM STATEMENT
// John has an array of n integers.
// Each pair of neighboring elements differs by at most d.
// The first and the last elements of the array are equal to
// first and last, respectively.
//
//
// Brus does not know John's array.
// He only knows n, d, first and last.
// He wa... | ALGO | 0.999792 | 3.44976 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2016-02-20T06:57: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": "ded78a980... |
6a484f97-a1db-4c05-92ff-9719479961fe | raushanranjan103/Leetcode-GFG-Practice | 7. Reverse array in groups - GFG/7.-reverse-array-in-groups.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:
//Function to reverse every sub-array group of size k.
void reverseInGroups(vector<long long>& arr, int n, int k){
int... | ALGO | 0.999836 | 5.728422 | {
"github_metadata": {
"branch": "main",
"commit_count": 825,
"repo_created_at": "2022-04-02T17:33:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36c5b012d0... |
98223d3e-a47b-485f-96a9-f84e1f592cc5 | soczil/JNP1-projekt4 | fibin.h | #ifndef __FIBIN_H__
#define __FIBIN_H__
#include <iostream>
#include <type_traits>
#include <typeinfo>
using namespace std;
const int max_id_len = 6;
const int hash_const = 37;
struct True {};
struct False {};
template<int N>
struct Fib {};
template<typename T>
struct Lit {};
template<typename ... Args>
struct ... | TOOL | 0.916342 | 4.499202 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-02-28T17:12:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "509e4d27ee... |
da14b08e-d2d3-42dc-a5b1-fa2a11884545 | sangmin7b/algorithm | data_structure/KMP/11585.cpp | #include<bits/stdc++.h>
#include <sstream>
using namespace std;
// pi[j-1]: j에서 틀렸을 때 다음으로 살펴볼 j
vector<int> get_pi(string s){
vector<int> pi(s.size(),0);
for(int i=1;i<s.size();i++){
int j = pi[i-1];
while(j > 0 && s[i] != s[j])
j = pi[j-1];
if(s[i] == s[j])
pi... | ALGO | 0.999925 | 4.33681 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-04-27T13:12: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": "0e4f8d347ab... |
b60a0e7a-1e66-4de7-bf4c-3d90459a9097 | kamyu104/LeetCode-Solutions | C++/continuous-subarrays.cpp | // Time: O(n)
// Space: O(1)
// two pointers
class Solution {
public:
long long continuousSubarrays(vector<int>& nums) {
int64_t result = 0;
int mn = numeric_limits<int>::max();
int mx = numeric_limits<int>::min();
for (int right = 0, left = 0; right < size(nums); ++right) {
... | ALGO | 0.999883 | 6.192452 | {
"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": ... |
21605b3d-a4ac-4a38-b5ba-4d042706caaa | raincross7/code-similarity | codes/train_code/problem428/problem428_75.cpp | #define TEMPLATE_USED
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
const ll INF=1001001001;
const ll LINF=1001001001001001001;
const ll D4[]={0,1,0,-1,0};
const ll D8[]={0,1,1,0,-1,-1,1,-1,0};
#define _o... | ALGO | 0.999979 | 3.507184 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c483a90fc73... |
6a02e4da-7f71-4350-9f0b-cf30710c49b4 | Francisco-GV/maze-generator | src/algorithms/IterativeBacktracker.cpp | #include <stack>
#include "algorithms/IterativeBacktracker.h"
void IterativeBacktracker::start(std::function<void()> callback)
{
random.setSeed(seed);
int first = random.getInRange(0, maze.getWidth() - 1);
calculate(0, first, callback);
}
void IterativeBacktracker::calculate(int y, int x, std::function<... | ALGO | 0.999845 | 5.223064 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2024-01-21T13: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": "43c66c626... |
d96267e3-0cd1-4464-842c-0e504ab75b92 | leggedrobotics/ocs2 | ocs2_ddp/include/ocs2_ddp/unsupported/implementation/SLQ_Hamiltonian.h | /******************************************************************************
Copyright (c) 2017, <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 t... | ALGO | 0.99972 | 6.147898 | {
"github_metadata": {
"branch": "main",
"commit_count": 7465,
"repo_created_at": "2021-07-08T07:09:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1106,
"forks": 258,
"issues": 50,
"pull_requests": 3
},
"file_meta": {
"content_id": "11e8... |
d6e72de6-96b3-4c64-8fc5-22c7943bcf63 | magicmoo/codeforces | LATOKEN ROUND 1/A.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
using namespace std;
#define CAS int CASE; \
cin>>CASE; \... | ALGO | 0.999915 | 3.121703 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2021-09-06T08:07: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": "e11fb2da0... |
ba3baff5-123b-41aa-a3c2-c0ca4ffe6b7f | DostonMavlanov/Codewars_solutions- | k-Primes.cpp | #include <math.h>
#include <vector>
class KPrimes
{
public:
static std::vector<long long> countKprimes(int k, long long start, long long end);
static int puzzle(int s);
private:
static int countPrimeFactors(long long n);
};
int KPrimes::countPrimeFactors(long long n)
{
if (n == 0)
return 0;
... | ALGO | 0.99876 | 4.093068 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2024-08-06T05:07:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b6c1b62a... |
8a2b9853-d95e-467e-a5e9-956ae6fc6480 | brabeem/DSA-NM | radixSort.cpp | #include<iostream>
using namespace std;
int* countingSort(int * Arr , int num){
int storeCount[10] = {0,0,0,0,0,0,0,00,0,0};
static int a = 1;
int j = 0;
int b = 0;
int rem = 0;
for(int i = 0; i < num ; i++){
b = Arr[i];
j =0;
while(j < a){
rem = b % 10;
b = b - rem;
b = b/10;
j++;
}
stor... | ALGO | 0.999923 | 4.489227 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-06-05T13:04:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ebdd1bced... |
869d0a6a-6003-4cbe-9e46-4c585a6c101c | maniacric/Gameinc | ratmaze.cpp | #include <bits/stdc++.h>
using namespace std;
void print (int ** arr, int size){
for(int i=0;i<size;i++){
for(int j=0;j<size;j++){
cout << arr[i][j] <<" ";
}
//cout << endl;
}
cout << endl;
}
inline bool check(int arr[][20], int ** output, int row, int column,int n... | ALGO | 0.999937 | 4.525084 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-04-10T21:16: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": "e556a9b623... |
e6500673-12a8-4745-9ba9-c309686ba017 | LightPotatoDev/baekjoon | datastructure/segtree/lazy/companyCulture5.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> graph;
vector<int> visited;
vector<int> finished;
vector<long long> lazy;
vector<long long> tree;
int visit_ord = 0;
int n = 0;
ostream& operator << (ostream& out, const vector<long long>& v){
for (int i : v){
out << i << ' ';
... | ALGO | 0.999947 | 4.747443 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-07-20T16:59: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": "9ca72e1697... |
1b8515ad-0f89-406d-9c6b-9b8279ab710f | pafin10/CompetitiveProgrammingExercises | year_1_contests/contests/codeforces9/2Reconstruction.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <map>
#include <cmath>
using namespace std;
#define ll long long
#define endl "\n"
#define it(i, n) for (int i = 0; i < n; ++i)
int main() {
// monsters and health cant be separated, must be considered together as we sort one
... | ALGO | 0.999927 | 3.704774 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-09-09T12:04:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65bf34c1d10... |
5499af66-d746-4c24-95b6-47551234a126 | TH-takahirohara/atcoder_solve | abc260-269/abc268/d_unique_username__after_contest.cpp | #include <bits/stdc++.h>
// #include <atcoder/segtree>
using namespace std;
// using namespace atcoder;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define fore(i,a) for(auto &i:a)
// 桁数指定: cout << fixed << setprecision(10)
int N, M;
vector<string> vec;
vector<string> ... | ALGO | 0.999818 | 3.933251 | {
"github_metadata": {
"branch": "main",
"commit_count": 671,
"repo_created_at": "2022-02-26T13:48: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": "2863a57dee... |
26dd084d-d3e0-4c1c-b93f-391288297cc6 | ishandutta2007/codeforces-k | keko37/normal/1416/A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long llint;
typedef pair <int, int> pi;
const int MAXN = 300005;
int t, n;
int a[MAXN], sol[MAXN];
vector <int> v[MAXN], r;
vector <pi> e;
void upd (int val) {
int mx = max(v[val][0] + 1, n - v[val].back());
for (int i = 1; i < v[val].size(); i++) {... | ALGO | 0.99959 | 3.7525 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "98656a0e8ccc... |
c8a8df71-9904-4def-805b-b100613d83c0 | alexandraback/datacollection | solutions_2751486_1/C++/Goodhope/r3_A_2013.cpp | // gj.cpp
//
#include <assert.h>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <algorithm>
#include <utility>
using namespace std;
typedef unsigned char uchar;
typedef unsigned int uint;
typedef unsigned __int64 uint64;
#define EPS... | ALGO | 0.999714 | 3.861307 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4357310d3... |
1c87c584-8def-4a3f-9b84-b9da9991cf84 | XuQiao/codestudy | C/Virtu/fib.cpp | //1. fine the cloest fibonacci number
#include <vector>
#include <iostream>
typedef std::vector<std::vector<int> > matrix;
typedef std::vector<int> vec;
class fib{
public:
fib(){};
int getclosestfib(int a);
private:
matrix matrixmat(matrix a, matrix b);
vec vectormat(vec v, matrix m);
void test(int a);
};
int fib... | ALGO | 0.999981 | 4.030456 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-03-21T21:34:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "289e9736fe... |
f80683df-0207-4894-bff4-dd7b9f788614 | nabobery/PROJECT-MADS | LeetCode/2901 - 3000/2918.cpp | // 2918. Minimum Equal Sum of Two Arrays After Replacing Zeros
// Solution 1 using Greedy Appproach
// Time Complexity: O(n) where n is the number of elements in the array
// Space Complexity: O(1)
class Solution
{
public:
long long minSum(const vector<int> &nums1, const vector<int> &nums2)
{
long long... | ALGO | 0.999971 | 5.84078 | {
"github_metadata": {
"branch": "main",
"commit_count": 182,
"repo_created_at": "2022-03-04T16:30:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4090a7e190... |
90f85458-24e6-44c8-8786-577f521f9f2c | devilking1606196/Gfg-practice | gfg/pattern.cpp | // #include<bits/stdc++.h>
// using namespace std;
// void print(int x)
// {
// int n=2*x-1;
// for(int i=0;i<n;i++)
// {
// int p=x;
// int c=0;
// for(int j=0;j<n;j++)
// {
// cout<<p<<" ";
// if(c<i)
// p--;
// if(c>=n-i-1)
/... | ALGO | 0.99997 | 5.126796 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-09-01T05:29:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3c6f01925b... |
af8814ca-5c0d-4a13-93d7-ee59dcfa1abf | AftabIB/DSA_Codes | 1559-cherry-pickup-ii/cherry-pickup-ii.cpp | //Recursion
// class Solution {
// public:
// int solve(int i,int j1,int j2,int r,int c, vector<vector<int>>& grid)
// {
// //Out of bound base case
// if(j1 < 0 || j1 >= c || j2 < 0 || j2 >= c)
// return -1e9;
// //reached to destination base case
// if(i == r-1)
// ... | ALGO | 0.999989 | 6.028758 | {
"github_metadata": {
"branch": "main",
"commit_count": 1153,
"repo_created_at": "2023-08-10T15:03:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5416413a0... |
9c65f8e6-84c0-450a-92fb-a64231003950 | rwambangho/Data-Structure-and-Algorithm-Lecture | Algorithm study/RRT.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
// Define a Node structure to represent points in the tree
struct Node {
double x, y;
Node* parent;
Node(double x, double y) : x(x), y(y), parent(nullptr) {}
};
// Function to calculate the Euc... | ALGO | 0.999992 | 6.72474 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2024-12-30T02:46: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": "d6c1499c8... |
0c7a6caa-ceae-48f5-b1fa-c08cb8749c43 | storedspace/ALifeGame | Goat.cc | #include"Goat.h"
/*
* construct a goat
*/
Goat::Goat(World &w, char t, int x, int y):Creature(w, t, x, y){
//set location
setPosition(x, y);
foodPoints= 20;
setDone(false);
}
/*
* simulate a goat's life cycle:
* age>=70 or food points =0 -> die
* 50<= age <=55 -> born baby goat
* the rest time... | ALGO | 0.974603 | 4.130316 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-17T08:08:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9466509abd0f... |
a119e111-b70c-48d1-9421-fb80ff7af72e | arangodb/arangodb | 3rdParty/boost/1.78.0/boost/hana/fwd/is_subset.hpp | /*!
@file
Forward declares `boost::hana::is_subset`.
@copyright <NAME> 2013-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_HANA_FWD_IS_SUBSET_HPP
#define BOOST_HANA_FWD_IS_SUBSET_HPP
#include <boost/hana... | ALGO | 0.929731 | 7.259629 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
6677c739-6a99-4aa9-88d0-b3b5239b38be | luckyKumar37/24k_0936-opp-lab | lab 5/task_7.cpp | #include<iostream>
#include<algorithm>
using namespace std;
class Product{
private:
int Id;
string name;
int quantity;
public:
Product(){}
Product(int id,string n,int q):
Id(id),name(n),quantity(q){}
void display() const{
cout<<"Product Id:"<<Id<<endl;
cout<<"Product name:... | TOOL | 0.996104 | 4.587437 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-02-01T19:19: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": "c92e2d7fa1a... |
5769bdae-0b29-4cdc-8653-c875c786a240 | seo-bo/ProblemSolving | 백준/Gold/2513. 통학버스/통학버스.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double lb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const char* yes = "Yes";
const char* no = "No";
int main(void)
{
cin.tie(0)->ios::sync_with_stdio(0);
ll n = 0, k = 0, s = 0, ans = 0;
cin >> n >> k >> s;
deque<pll>left... | ALGO | 0.999815 | 3.475695 | {
"github_metadata": {
"branch": "main",
"commit_count": 2731,
"repo_created_at": "2025-01-09T04:45:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e20fb1ab... |
5ec50319-a2b2-4bd4-bcb8-dffc78bba6a9 | liuyubobobo/Play-with-Algorithms | 02-Sorting-Basic/Course Code (C++)/Optional-01-Optimized-Selection-Sort/main.cpp | #include <iostream>
#include <algorithm>
#include "SortTestHelper.h"
#include "SelectionSort.h"
#include "InsertionSort.h"
using namespace std;
// 感谢github @zhengquan45 提出, 可以对选择排序进行优化
// 在每一轮中, 可以同时找到当前未处理元素的最大值和最小值
template<typename T>
void selectionSort(T arr[], int n){
int left = 0, right = n - 1;
while(... | TEST | 0.968493 | 5.426514 | {
"github_metadata": {
"branch": "master",
"commit_count": 311,
"repo_created_at": "2016-07-05T18:16:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3700,
"forks": 1461,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e... |
e0308ddd-2aee-4c87-b8e3-3f3a2cb2a105 | antoniocarrillo69/DVS | Version-1.0.1/Methods/PLM1.cpp | // Grupo de Modelacion Matematica y Computacional
// Instituto de Goefisica
// Universidad Nacional Autonoma de Mexico
// Mexico D.F.
//
// Autores:
// <NAME>
// <NAME>
// <NAME>
//
// Codigo liberado bajo la licencia GPL ver. 2.0
#include "Definiciones.hpp"
#include "PLM1.hpp"
// DVS-FETI-DP
ldouble PLM1::dot(ldo... | ALGO | 0.999421 | 3.990656 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-05-09T14:57:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fb3118e0d... |
4704b19f-b9e0-45f5-9eec-b9c92f00c5ef | NTJQKA/Luogu-problems-solution-code | 【算法1-5】贪心/greedy 刘乐道.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct bundle {
int student_amount;
int need;
};
bool cmp(bundle x, bundle y) {
return x.need < y.need;
}
int main() {
int t, n, k, m;//数据组数,数组长,比例,需要安排选手数
cin>>t;
while (t--) {
cin>>n>>k;
vector<bund... | ALGO | 0.999951 | 3.065699 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-04-12T15:27: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": "aacab6f03bc6... |
5e0170f9-547d-485c-b5ee-935543b6b97f | madangopal16072000/Data-Structure-and-Algorithm | Graph/64_shortest_cycle_in_greaph.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int ans;
void dfs(int node, int parent, vector<bool> &vis, vector<int> dist, vector<vector<int>> &adj)
{
vis[node] = true;
for (int nbr : adj[node])
{
if (!vis[nbr])
{
dist[... | ALGO | 0.999942 | 4.531637 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2022-07-29T05:41:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bffaf834d... |
02ec7352-73e1-4b9e-bc71-3f35057d7437 | Lokesh-Bisht/DSA | Two pointer/allQuadrupletsWithSum.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
/**
* Problem: Given an array of size 'n' and an integer 'x'. Find all
* unique quadruplets that sums upto 'x'.
*
* TC: O(n3 + nlogn)
* SC: O(n)
* AC: O(n2)
*/
vector<vector<int>> findAllUniqueQuadruplets(vector<int>& nums, int... | ALGO | 0.999919 | 5.473145 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2022-04-13T06:02:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c600271c76d... |
15cc12c6-d410-4cac-9fab-2b8a9f2550a2 | gabrielpessoa1/Competitive-Programming | Stanford Local Contest 2011/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
const int ms = 1e4+5;
vector<pair<int, int>> g[ms];
vector<pair<int, int>> ig[ms];
double dp[ms];
double idp[ms];
bool mark[ms];
bool imark[ms];
double sum[ms];
double sumK[ms];
double solve(int x) {
if(mark[x]) ret... | ALGO | 0.999955 | 4.123005 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2019-04-16T00:08:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7046a0d27... |
9ba95ee3-f8d4-4f7f-8ce0-4d5864002ebd | Mulab11/cntt2016-hw1 | TC-SRM-572-div1-500/qj.cpp | #include <bits/stdc++.h>
using namespace std;
class EllysBulls {
static const int N = 500000 + 10, M = 10;
int n, m, tot, next[N][10], cnt[N], mem[N];
std::vector<std::string> a;
std::vector<int> adj[M][M];
std::string cur;
void insert(int v) {
// trie
int p = 1;
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999837 | 3.893187 | {
"github_metadata": {
"branch": "master",
"commit_count": 4450,
"repo_created_at": "2016-09-28T13:04:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 28,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "81124... |
19ed9113-4508-4e33-8e0b-4c9e38179dd2 | RyanPioneer/Leetcode | 1001~1500/1477. Find Two Non-overlapping Sub-arrays Each With Target Sum/main.cpp | /**
* Source: https://rb.gy/be63d
* Date: 2023/8/30
* Skill:
* Runtime: 439 ms, faster than 30.63% of C++ online submissions
* Memory Usage: 140.03 MB, less than 28.61% of C++ online submissions
* Time complexity: O(n)
* Space complexity: O(n)
* Constraints:
*
*/
#include <vector>
#include <iostream>
#includ... | ALGO | 0.999984 | 5.626667 | {
"github_metadata": {
"branch": "main",
"commit_count": 504,
"repo_created_at": "2021-05-09T23:57:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68d579a4a4... |
937afb2e-ac90-4ab6-b4d1-12b694986543 | Smorodov/Multitarget-tracker | src/Tracker/graph/mincut.cpp | // $Id: mincut.cpp,v 1.1.1.1 2003/11/05 15:19:13 rdmp1c Exp $
#include "mincut.h"
#include <cstdlib>
#include <cassert>
#include <iostream>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <set>
#include <limits>
#include <algorithm>
#include "fheap.h"
mincut::mincut () : GTL::algorithm ()
... | ALGO | 0.999729 | 5.407364 | {
"github_metadata": {
"branch": "master",
"commit_count": 1129,
"repo_created_at": "2013-08-01T05:09:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2293,
"forks": 662,
"issues": 81,
"pull_requests": 0
},
"file_meta": {
"content_id": "0... |
d4011724-ee65-435c-a2c1-5c91a41c32bf | dennisjosesilva/max_dist_diff | external/gft/include/gft_heap32fiif_lex.h | #ifndef _GFT_HEAP32FIIF_LEX_H_
#define _GFT_HEAP32FIIF_LEX_H_
#include "gft_common.h"
#include "gft_heap.h"
#include "gft_gpqueue_by_Falcao.h"
namespace gft{
namespace Heap32fiif_lex{
struct sHeap32fiif_lex {
float *cost1;
int *cost2;
int *cost3;
float *cost4;
char *color;
... | ALGO | 0.936782 | 4.515484 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2023-09-18T18:12: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": "c0c32baf4ee... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.