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 |
|---|---|---|---|---|---|---|---|
72c7fef1-e29b-4551-a12a-a1153f3b7545 | sietschie/dagrabcut | src/lib/grabcut.cpp | /*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, instal... | ALGO | 0.999554 | 5.869169 | {
"github_metadata": {
"branch": "hmm",
"commit_count": 79,
"repo_created_at": "2011-03-06T14:45:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d05ff3c71b63... |
a93942db-e7ba-49f6-b787-0075cc8928ad | ishandutta2007/codeforces-t | timmyfeng/normal/1628/D1.cpp | #include <bits/stdc++.h>
using namespace std;
template <int M>
struct modint {
modint() : n(0) {}
template <class T> modint(T n) { n %= M; if (n < 0) n += M; this->n = n; }
modint & operator+=(const modint &r) { n += r.n; if (n >= M) n -= M; return *this; }
modint & operator-=(const modint &r) { n -= ... | ALGO | 0.999963 | 4.134643 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "403eec62b218... |
8f96fa9f-3e61-4e1d-b2da-1d3f5bf81bf9 | fwv/C-C-_Instance | ds/stack/stack_instance.cpp | using namespace std;
#include<iostream>
#include<stack>
#include<queue>
#include<string>
static int NUM = 1;
static int OP = 2;
static int RIGHT_BRACKET = 3;
static int LEFT_BRACKET = 4;
struct elmt{
int op;
char c;
int type;
};
stack<elmt> op_stack;
queue<elmt> prepare;
queue<elmt> postfix;
string post... | ALGO | 0.999488 | 4.264368 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2019-01-18T04:05: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": "ac3874e38... |
3ffd2d15-f595-4b0a-b5a3-799eeb142f4f | awesomebytes/hist_user_tracking | src/robot_wanderer_with_moving_goal.cpp | /*!
File: robot_wanderer_with_moving_goal.cpp
Author: <NAME> <<EMAIL>>
Date: 2012/1
______________________________________________________________________________
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public L... | TOOL | 0.981733 | 5.398323 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-04-19T10:09:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57a8ad6586... |
27d57bcd-2e8c-4f1b-aabf-fa18f5b2d6d0 | ga-ladder/vicsek_model | 04many_particles_meaning.cpp | #include <vector>
#include <random>
using namespace std;
int main(){
int L = 10;
int N = 1000;
int r = 1;
int count;
double mean_x,mean_y;
vector <double> x(N), y(N), theta(N), friends(N,0);
/* ---- データ作成 ---- */
random_device rnd; // 非決定的な乱数生成器を生成
mt19937 mt(rnd()); // メルセンヌ・ツイスタの32ビット版、引数は初期シード値
... | ALGO | 0.999457 | 4.170732 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-06-03T09:14:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a07134e6fd... |
e435f246-c8a4-4d6e-ae00-1b1c1a987320 | longvuu1/Cpp-code | yendinh1/tìm kiếm nhị phân/LQDOJ/Lời nguyền của Shizuka.cpp | /*
@author longvuuuu
*/
#include <bits/stdc++.h>
#define taskname ""
#define ll long long
#define pb push_back
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
if (fopen((string(taskname) + ".inp").c_str(), "r") != NULL) {
freopen((string(taskname) + ".in... | ALGO | 0.999947 | 5.09017 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-04-01T13:20:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e7aa4ea697... |
5f427775-efd0-4352-ae81-fde3743b1b38 | kamyu104/LeetCode-Solutions | C++/evaluate-division.cpp | // Time: O((e + q) * α(n)) ~= O(e + q), using either one of "path compression" and "union by rank" results in amortized O(logn)
// , using both results in α(n) ~= O(1)
// Space: O(n)
class Solution {
public:
vector<double> calcEquation(vector<vector<string>>& equations, vector... | ALGO | 0.999983 | 6.535288 | {
"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": ... |
e2822000-1198-41f1-97fc-adaaaddb78cd | christopherganda/Competitive-Programming | algorithm/Pertemuan 7/Dijkstra.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
using namespace std;
#define gettime printf("\nTime : %0.3lf\n",clock()*1.0/CLOCKS_PER... | ALGO | 0.999771 | 3.549849 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2017-09-18T06:29: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": "531cbf8a6... |
4cdd3630-cbfe-49a7-8112-211507adcca2 | changicho/algorithm-training | Baekjoon/2000/2751_sort/answer.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int numbers[1000001];
void swap(int *first, int *second) {
int temp = *first;
*first = *second;
*second = temp;
}
void solution() {
int N;
cin >> N;
for (int i = 0; i < N; i++) {
cin >>... | ALGO | 0.99999 | 4.944179 | {
"github_metadata": {
"branch": "master",
"commit_count": 2455,
"repo_created_at": "2019-09-02T14:53:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 44,
"forks": 4,
"issues": 25,
"pull_requests": 0
},
"file_meta": {
"content_id": "2cb2d... |
1a381cee-f3ad-45be-9259-37f95091b764 | odanado/Procon | AtCoder/ARC044/C.cpp | #include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <cl... | ALGO | 0.998466 | 3.668638 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2015-12-22T07: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": "d48e7a79... |
1844dd3a-7d9e-4b71-85c0-0ba5ba56e31b | raincross7/code-similarity | codes/train_code/problem207/problem207_465.cpp | #include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstd... | ALGO | 0.999931 | 4.188823 | {
"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": "8cce4c4f8e26... |
a4073dd6-6680-4886-b3b1-13bfd5b46667 | CitrusSin/AlgorithmProblemAnswers | Contest/Second-ART/k.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
i64 n, x, y;
cin >> n >> x >> y;
vector<i64> health(n);
for (i64 i=0; i<n; i++) {
cin >> health[i];
}
sort(health.begin... | ALGO | 0.999975 | 3.737038 | {
"github_metadata": {
"branch": "main",
"commit_count": 141,
"repo_created_at": "2023-01-08T13:54: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": "13f09002fe... |
75753439-f479-47f4-b3d5-f929e4d6f544 | zhoujf620/LeetCode-Practice | C++/516.longest-palindromic-subsequence.cpp | /*
* @lc app=leetcode id=516 lang=cpp
*
* [516] Longest Palindromic Subsequence
*
* https://leetcode.com/problems/longest-palindromic-subsequence/description/
*
* algorithms
* Medium (50.38%)
* Likes: 1413
* Dislikes: 162
* Total Accepted: 92.6K
* Total Submissions: 183.6K
* Testcase Example: '"bbba... | ALGO | 0.999977 | 6.511593 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2019-11-17T04:09: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": "caaa958c... |
84f9170c-5cb2-487c-a4d8-28d822e71425 | weiyitao1995/Lidar_Camera_calibration | my_calibration.cpp | //
// Created by yitaowei on 11/18/22.
//
#include <iostream>
#include <opencv2/opencv.hpp>
#include <sophus/se3.hpp>
#include <Eigen/Core>
#include <vector>
#include <string>
#include <g2o/core/base_unary_edge.h>
#include <g2o/core/base_binary_edge.h>
#include <g2o/core/base_vertex.h>
#include <g2o/core/block_solver.... | ALGO | 0.995637 | 4.225093 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-02-11T05:33: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": "42ae10299de1... |
1f145f3f-693c-4081-b3ed-e3648183d0f4 | deadxraver/Inf1 | main.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <vector>
// 0=0, 1=1, 2=2, 3=3, 4=-1, 5=-2, 6=-3
const std::vector<std::string> alph = { "0", "1", "2", "3", "^1", "^2", "^3" };
const std::string alphabet = "0123456789abcdefghijklmnopqrstuvwxyz";
int conv(std::string x, const int base) {
int n = 0, m... | ALGO | 0.999859 | 4.175868 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-19T20:03: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": "f8deb0ca8d7d... |
c1721461-7d76-4e1a-ab19-72a16e6d87fd | prashantkr3193/CP | CodingNinjas-CP-Eminence-Aug19/17-DP1/coin-change-problem/coin-change-problem.cpp | /* Author: <NAME> (<EMAIL>) */
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define INF LLONG_MAX/4
#define MOD 1000000007
#define DEBUG(x) cerr << #x << " is " << (x) << endl;
typedef long long ll;
typedef long double ld;
typedef std::vector<ll> vll;
typedef std::vector<int> vi;
typedef std::vector<s... | ALGO | 0.999925 | 3.904208 | {
"github_metadata": {
"branch": "master",
"commit_count": 243,
"repo_created_at": "2020-11-30T03:51: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": "26e4e56e... |
8b3e8f0d-ae5a-4858-82de-2be02b3c94ef | RakibulRanak/My-CP-HandBook | Graph/Bellman-Ford-NegativeCycleTest.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 1000000000
//INF should be modified according to needs
int main()
{
int node, edge, cost;
cin >> node >> edge;
//for storinng {from,to,cost}
vector<tuple<int, int, int>>edges;
for (int i = 0; i < edge; i++)
{
int from, to;
cin >> from >> to >> cost;
... | ALGO | 0.999999 | 4.2626 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2020-11-04T17:40:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec6f7e5d7ca... |
dc71b110-245e-45f0-9919-02854229ba65 | Crowndev/crown-core | src/mn-pos/stakevalidation.cpp | #include "stakevalidation.h"
#include "kernel.h"
#include <primitives/block.h>
#include <chain.h>
#include <pubkey.h>
#include <wallet.h>
#include <util.h>
#include <arith_uint256.h>
bool CheckBlockSignature(const CBlock& block, const CPubKey& pubkeyMasternode)
{
uint256 hashBlock = block.GetHash();
return p... | ALGO | 0.910906 | 6.233507 | {
"github_metadata": {
"branch": "master",
"commit_count": 11695,
"repo_created_at": "2016-06-09T08:32:29.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "bitcoin/bitcoin",
"stars": 27,
"forks": 18,
"issues": 32,
"pull_requests": 0
},
"file_meta": {
"conten... |
d794206f-06bf-48e7-949f-e19f4846059b | Abhishek-Maurya2/CipherSchools-Competition | Day - 3/Day3.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int value)
{
data = value;
next = nullptr;
}
};
class LinkedList
{
public:
Node *head;
LinkedList()
{
head = nullptr;
}
void insert(int value)
{
No... | ALGO | 0.999993 | 5.184793 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-09-11T13:07: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": "f954211a2bd8... |
d79225fc-cb7b-4c63-ae6f-27bca7bfce48 | mit-gfx/6.4420-CompDesignFab | hw2_alternative/external/libigl-python-bindings/attic/todo-old/copyleft/copyleft_cgal_fast_winding_number.cpp | #include <npe.h>
#include <typedefs.h>
#include <igl/fast_winding_number.h>
const char* ds_fast_winding_number = R"igl_Qu8mg5v7(
Parameters
----------
Returns
-------
See also
--------
Notes
-----
None
Examples
--------
Inputs:
P #P by 3 list of point locations
N #P by 3 list of point normals... | ALGO | 0.998618 | 6.991905 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-09-13T16:29:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5acf015791f... |
b7f3f1c9-abf4-4528-996f-f439d6cbccbc | zohaib166/DataStructure | Stack/StackArray.cpp | #include <cstdio>
#include <iostream>
using namespace std;
#define SIZE 10
typedef struct _stack {
int data[SIZE];
int top = -1;
} stack;
void push(stack *s, int n) {
s->top++;
if(s->top == SIZE-1) {
cout << "Stack is Full" << endl;
return;
}
s->data[s->top] = n;
}
int pop(st... | ALGO | 0.994203 | 3.747394 | {
"github_metadata": {
"branch": "main",
"commit_count": 114,
"repo_created_at": "2023-01-06T14:35: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": "0b80a996b3... |
779a1757-9993-4776-9b5f-bb5c7b824c76 | Arpit4288/Leetcode-Practice | 2130-maximum-twin-sum-of-a-linked-list/2130-maximum-twin-sum-of-a-linked-list.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:
int pairSum(ListNode*... | ALGO | 0.999961 | 6.338002 | {
"github_metadata": {
"branch": "main",
"commit_count": 4408,
"repo_created_at": "2022-12-02T19:52: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": "228e3535f... |
798de92f-040f-41ad-8c8e-849553286431 | ZhenyingZhu/ClassicAlgorithms | src/CPP/src/leetcode/SudokuSolver.cpp | /*
* [Source] https://leetcode.com/problems/sudoku-solver/
* [Difficulty]: Hard
* [Tag]: Backtrcking
* [Tag]: Hash Table
*/
#include <iostream>
#include <unordered_map>
#include <vector>
#include <functional>
using namespace std;
// [Solution]: Use coordinate as key, and a boolen vector as value, indicate which... | ALGO | 0.999765 | 7.162477 | {
"github_metadata": {
"branch": "master",
"commit_count": 484,
"repo_created_at": "2014-09-14T08:09:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43bc29c0... |
a528b903-f22c-47df-b196-d4624b0743bf | protarie125/BOJ_3028 | BOJ_3028/main.cpp | #include <algorithm>
#include <bit>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
using ll = lo... | ALGO | 0.99996 | 3.59713 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-11-28T11:44: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": "1e48cb6325... |
5cd21749-742a-4e4c-bef4-e93239296f40 | wiregh0st/cProjects | csci207/labs/LAB6/LAB6_3_LoopPractice.cpp | /*
<NAME>
LAB6_3_LoopPractice.cpp
*/
#include <iostream>
using namespace std;
int main()
{
int evenInt = 2;
int evenInt2 = 2;
int oddInt = 1;
int oddInt2 = 1;
int add = 2;
int evenSum = 4;
int oddSum = 2;
cout << "Even sums 2-500: \n\n\n";
while ((evenInt >= 0 && evenInt <= 500)) { //will stay i... | ALGO | 0.988837 | 4.122795 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2020-12-16T03:52: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": "b25abfba995e... |
d2f940f7-3f7c-4377-8d09-d357bfca956d | S7venFeng/LeetCode | Design/379.design-phone-directory/379.design-phone-directory.cpp | class PhoneDirectory {
public:
unordered_map<int, int> m;
vector<int> v;
/** Initialize your data structure here
@param maxNumbers - The maximum numbers that can be stored in the phone directory. */
PhoneDirectory(int maxNumbers) {
for (int i = 0; i < maxNumbers; ++i) {
m[i] ... | ALGO | 0.997048 | 5.460494 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2016-05-23T01:57:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "894ab5792... |
41983b58-f7a4-45b8-90c4-2b12f85e23f4 | AlexaFrom/routine-http | include/utils/utils.hpp | #pragma once
#include "http/types.hpp"
#include <algorithm>
#include <numeric>
#include <spdlog/spdlog.h>
#include <sstream>
#include <stdexcept>
#include <string>
#include <string_view>
#include <type_traits>
#include <unordered_map>
#include <vector>
namespace routine::utils {
template <typename StringT,
... | TOOL | 0.930517 | 6.922896 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2025-04-29T16:15: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": "f093d2009... |
d3f8100e-a502-49a0-9601-4b3bc43ad9cf | pandora-cube/2024-PCUBE-PS-Study | 5주차 - Greedy/김준우/1781.cpp | #include <iostream>
#include <queue>
#include <cmath>
#include <climits>
using namespace std;
int N;
int ans;
int day = 1;
struct quiz {
int deadline;
int noodle;
};
struct cmp {
bool operator()(quiz q1, quiz q2) {
if (q1.deadline > q2.deadline)
return true;
else if (q1.deadl... | ALGO | 0.999898 | 4.335623 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-01-24T04:19:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34c3567a2442... |
c5852904-9924-4856-8dba-4194da100e62 | hromerovelo/folkroot | folkroot/features_alignment/utils/global_approximate_alignment.cpp | /***
BSD 2-Clause License
Copyright (c) 2024, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions a... | ALGO | 0.98769 | 6.279063 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-06-27T16:58: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": "17a68c007071... |
21144be6-821f-4475-a171-30a56b0df4c1 | rratliff/random | coinstreaks-stl.cpp | // <NAME>
// coinstreaks-stl.cpp
#include <iostream>
#include <iomanip>
#include <ctime>
#include <random>
using namespace std;
const int NUMFLIPS = 100;
const int NUMTRIALS = 1000000;
mt19937 rng;
uniform_real_distribution<> dis(0,1); // Uniform distribution over [0,1)
int main(void) {
int count[NUMFLIPS+1];
... | ALGO | 0.999159 | 4.890358 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2012-04-10T15:44: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": "040059fe36... |
1fb80a4e-fcf2-4b62-a212-066dceb538a6 | twolodzko/extraDistr | src/discrete-uniform-distribution.cpp | #include <Rcpp.h>
#include "shared.h"
// [[Rcpp::interfaces(r, cpp)]]
// [[Rcpp::plugins(cpp11)]]
using std::pow;
using std::sqrt;
using std::abs;
using std::exp;
using std::log;
using std::floor;
using std::ceil;
using Rcpp::NumericVector;
/*
* Discrete uniform distribution
*
* Values:
* a <= x <= b
*
* f(x... | TEST | 0.978731 | 5.501296 | {
"github_metadata": {
"branch": "master",
"commit_count": 420,
"repo_created_at": "2016-04-03T19:51:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 53,
"forks": 11,
"issues": 7,
"pull_requests": 1
},
"file_meta": {
"content_id": "4238d9... |
04abb806-34ff-4696-a991-8e464bf089d4 | mckev/prog-challenges-misc | 20250227-cses-minimizing-coins/main.cpp | // Minimizing Coins: https://cses.fi/problemset/task/1634
#include <cassert>
#include <iostream>
#include <vector>
int solve(int target, const std::vector<int>& coins) {
std::vector<int> amounts(target + 1);
for (int coin : coins) {
if (coin > target) continue;
amounts[coin] = 1;
}
fo... | ALGO | 0.999949 | 4.638114 | {
"github_metadata": {
"branch": "main",
"commit_count": 128,
"repo_created_at": "2022-04-16T18:03: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": "965b2e8396... |
71078cc7-ebb1-40bb-9cfa-b6c874577199 | RayShark0605/On_the_fly_SfM | src/Scene/Projection.h | #pragma once
#include "../Geometry/Rigid3D.h"
#include "Camera.h"
#include <limits>
#include <vector>
#include <Eigen/Core>
#include <Eigen/Geometry>
double CalculateSquaredReprojectionError(const Eigen::Vector2d& point2D,
const Eigen::Vector3d& point3D,
const Rigid3d& cam_from_world,
const Camera& camera... | ALGO | 0.990978 | 7.194784 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-10-24T06:51:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "35eae5e1a... |
e7799602-79d7-41d4-a3c1-71faab69fa29 | zhuangbo/ds-cpp | src/ch07/floyd.cpp | ///////////////////////////////////////
/// file: floyd.cpp
/// Floyd algorithm
///////////////////////////////////////
#include <iostream>
#include <limits>
using namespace std;
///
/// 邻接矩阵
///
template <typename V, typename E, int N = 20>
struct AMGraph
{
V vexs[N]; // 图中的顶点
E arcs[N][N]; //... | ALGO | 0.999988 | 4.958338 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2017-08-22T04:24:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bede8f68... |
9c75ac3b-396c-4b9f-b267-42c79b4dd74b | danpape/jsonld-cpp-original | libjsonld-cpp/sha1.cpp | /*
sha1.cpp - source code of
============
SHA-1 in C++
============
100% Public Domain.
Original C Code
-- <NAME> <<EMAIL>>
Small changes to fit into bglibs
-- <NAME> <<EMAIL>>
Translation to simpler C++ Code
-- <NAME> <<EMAIL>>
Changed some names and added... | ALGO | 0.966081 | 7.430831 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-05-20T23:24: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": "7bc417678f... |
eaa54798-8b14-4b7c-9d72-3549876d4d7d | AceBenson/ProgrammingII | Homework 4/12721_implement.cpp | #include "12721.h"
#include <iostream>
#include <string>
#include <sstream>
using namespace oj;
using namespace std;
BST::BST() {
root = nullptr;
}
void deleteBST(Node* root){
if(root == nullptr)
return;
deleteBST(root->lc);
deleteBST(root->rc);
delete root;
}
BST::~BST() {
deleteBST... | ALGO | 0.999966 | 4.53221 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2020-04-06T17:34: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": "3c1c35310... |
65efc4f0-1d6f-45b1-889e-6ab4afa6e058 | DollarAkshay/Competitive-Coding | CodeChef/CodeChef_MasterChef.cpp | /*~~~~~~~~~~~~~~~~~~*
* *
* $<NAME>$ *
* *
*~~~~~~~~~~~~~~~~~~*/
//http://www.codechef.com/JULY15/problems/MCHEF
#include <math.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <map>
#include <set>
#i... | ALGO | 0.99987 | 3.960292 | {
"github_metadata": {
"branch": "master",
"commit_count": 570,
"repo_created_at": "2018-01-31T16:03:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5404e10b... |
8f433030-fa67-4295-b945-33089703e774 | Programer2690/pdweek6 | zodaic.cpp | #include<iostream>
using namespace std;
void zodaic(int day,string month);
main()
{
string month,result;
int day;
cout<<"enter day: ";
cin>>day;
cout<<"Enter month: ";
cin>>month;
zodaic(day,month);
}
void zodaic(int day,string month)
{
if((month=="march")&&(day>=21||day<=31))
... | ALGO | 0.998333 | 3.73965 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-01-15T16:37: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": "e84ae237b158... |
da9dc23f-ec4e-4140-baf3-50274a7a0888 | praveen4698/competitiveProgrammingWithCpp | insertiontree/snack_down_fourth.cpp | #include<bits/stdc++.h>
using namespace std;
#define PI 3.14159265
static const int INF = 0x3f3f3f3f;
static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
const int lim = 1e5+10;
long long int A[lim];
long long int cost[lim];
vector<long long int> B;
int main()
{
int t;
scanf("%d... | ALGO | 0.999642 | 3.00319 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-06-22T07:25: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": "6a5e4c5c6d... |
35d720af-176e-452c-953e-36b761c44999 | cmyang1218/Leetcode | 1774-add-two-polynomials-represented-as-linked-lists/add-two-polynomials-represented-as-linked-lists.cpp | /**
* Definition for polynomial singly-linked list.
* struct PolyNode {
* int coefficient, power;
* PolyNode *next;
* PolyNode(): coefficient(0), power(0), next(nullptr) {};
* PolyNode(int x, int y): coefficient(x), power(y), next(nullptr) {};
* PolyNode(int x, int y, PolyNode* next): coeffic... | ALGO | 0.999666 | 5.344995 | {
"github_metadata": {
"branch": "main",
"commit_count": 929,
"repo_created_at": "2024-01-17T16:58: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": "ca131793cf... |
23668975-9b05-45f4-a13a-719aec908841 | saeedutsha/Image-Processing | HighBoost+Unsharp Masking.cpp | #include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
#include <math.h>
using namespace std;
using namespace cv;
Mat hb_filter(Mat src) {
Mat des,maskImg,boostImg;
des.create(src.size(), src.type());
maskImg.create(src.size(), src.type());
boostImg.create(src.size(), ... | ALGO | 0.98991 | 4.39829 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-10-02T17:47: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": "b2dd7a4de... |
aff6ac8e-81ae-46be-8a44-8871f62fb805 | ishandutta2007/codeforces-p | poopi/normal/274/C.cpp | /* in the name of Allah */
#include <iostream>
#include <memory.h>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <map>
using namespace std;
#define int64 long long
#define P pair<int, int>
#define EPS 1e-9
#define PI ... | ALGO | 0.999704 | 3.578226 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6dd554835cf4... |
4269112a-32af-425d-8267-437e6409ae07 | er0s3c/BobinHesapla | Hesapla.cpp | #include <iostream>
#include <cmath>
#include <cstdlib> // system fonksiyonu için gerekli
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
using namespace std;
void bobinUzunluguHesapla() {
double ozkutle, kalinlik, agirlik, genislik;
double uzunluk;
// Kullanıcıdan gerekli bilgileri alma
cou... | TOOL | 0.984929 | 4.166364 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-03-21T07:50: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": "2156a2e76887... |
d4894dc9-e5b9-4ad2-9e6a-3f6f55413696 | ADI201998/Exploration | navig/src/don.cpp | #include <ros/ros.h>
#include <vector>
#include <math.h>
#include <sensor_msgs/PointCloud2.h>
#include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/filters/statistical_outlier_removal.h>
#include <pcl/filters/passthrough.h>
#include <pcl/filters/voxel_grid.h>
#include <boost/foreach.hpp>
#include ... | ALGO | 0.974273 | 5.835934 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-08-10T17:23:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9838cc5ab3... |
2a3791fe-fea2-4b39-971c-8b6f3a3d8142 | sheisalice606/Algorithm | 프로그래머스/unrated/161988. 연속 펄스 부분 수열의 합/연속 펄스 부분 수열의 합.cpp | #include <string>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
long long N;
long long DP[500000][2];
long long solution(vector<int> sequence) {
N = sequence.size();
vector<long long> V1(N, 0);
vector<long long> V2(N, 0);
long long P1 = 1;
long long P2 = -1;
... | ALGO | 0.999992 | 4.408962 | {
"github_metadata": {
"branch": "main",
"commit_count": 312,
"repo_created_at": "2023-06-16T06:34:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10aa01b602... |
7de4758a-fac9-49f3-acb5-b4e4bd385ea0 | DekataBG/FMIHomework | 1 Semester/IP-Lecture/Week06/Week06.cpp | #include <iostream>
#include <cmath>
#include <cstring>
int reduceN(int n)
{
n /= 10;
int copyOfN = n;
int digits = 0;
do
{
copyOfN /= 10;
digits++;
} while (copyOfN > 0);
n -= (n / (int)pow(10, digits - 1)) * pow(10, digits - 1);
return n;
}
bool contains(unsigned n... | ALGO | 0.996299 | 4.338692 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-10-08T16: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": "9785ef5e323... |
2fe19f98-bdd3-4b5d-90a1-0e93ab07ac12 | jossergio/LeetCode | d2021_06_26/modelo.cpp | #include <iostream> // std
#include <vector>
using namespace std;
vector<int> contarMenor (vector<int>& nums) {
vector<int> retorno;
int a, b, t = nums.size ();
for (a = 0; a < t; a++) {
retorno.push_back (0);
for (b = (a + a); b < t; b++)
retorno [a] += (nums [b] < nums [a])? 1: 0;
} // for a
... | ALGO | 0.999863 | 5.061616 | {
"github_metadata": {
"branch": "main",
"commit_count": 992,
"repo_created_at": "2021-07-17T20:20: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": "3485c96854... |
77de92e9-bb69-4daa-931e-d6c357a93b38 | ishandutta2007/codeforces-g | greymanesilverfang/normal/772/D.cpp | // #inclusion_exclusion
#include <iostream>
#define mod(x) ((((x) %= INF) += INF) %= INF)
const int N = 1e6, INF = 1e9+7;
long long s[3][N], f[N];
int read_int()
{
int res = 0, digit_cnt = 0;
while (true)
{
char c = std::cin.get();
if ('0' <= c && c <= '9')
res = res * 10 + c - '0', ++digit_cnt;
else if (... | ALGO | 0.999689 | 4.141983 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad624cf33ec6... |
70e0d419-661d-41c9-b290-b7ac660574b2 | ishandutta2007/codeforces-u | unstoppablechillmachine/normal/1487/E.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
#define F first
#define S second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
#define int ll
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
vector<... | ALGO | 0.999387 | 3.769062 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31: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": "65fa0ad02e4e... |
5d83ad58-6cc0-451d-89e7-313ac4ec0ee5 | ksg1766/Jusin_Assignment | 230223/230223/q2.cpp | #include "230223.h"
void q2()
{
// 숙제 2.
// 숫자 이동시키기
// 0~24에 해당하는 숫자 25개를 5*5형식으로 출력
// 숫자를 입력받으면 넘버패드 해당하는 숫자의 방향대로 숫자 0이 이동을 한다. (2. 아래 4. 왼 6.오 8 위)
// 이동방향 맨 끝에서는 더 이상 이동할 수 없도록 예외처리를 하라
// 0 1 2 1 0 2
// 3 4 5 6입력 3 4 5
// 6 7 8 6 7 8
//
int iSize = 5;
int iBoard[5][5] = {};
int iPos = 0;
char cInput;
... | TOOL | 0.961018 | 3.826687 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-03-23T10:35: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": "0f1b5e770a6c... |
cf933d54-2a57-42ee-a0f9-63202ab2259f | manu05X/ProgramFiles | CP/4-Recursion/Merge Sort Code.cpp | /*
Merge Sort Code
Send Feedback
Sort an array A using Merge Sort.
Change in the input array itself. So no need to return or print anything.
Input format :
Line 1 : Integer n i.e. Array size
Line 2 : Array elements (separated by space)
Output format :
Array elements in increasing order (separated by space)
Constraints ... | ALGO | 0.99997 | 5.621763 | {
"github_metadata": {
"branch": "master",
"commit_count": 178,
"repo_created_at": "2019-10-04T05:46: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": "606398d5... |
49b9b484-3497-47aa-994f-d204f67429cc | haozzzzzzzz/osgEarthX | environment/build/osgearth-2.6/src/osgEarthDrivers/engine_droam/CubeManifold.cpp | /* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2008-2010 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundat... | TOOL | 0.913716 | 6.14103 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2015-09-19T06:19:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 75,
"forks": 48,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "61af0fc... |
80bfcd33-b4a3-4d48-9dbb-da876c00e3b8 | dshawshank/Blender-android_arm64 | source/blender/blenkernel/BKE_mesh_sample.hh | /* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup bke
*/
#include "BLI_function_ref.hh"
#include "BLI_generic_virtual_array.hh"
#include "BLI_math_vector_types.hh"
#include "FN_field.hh"
#include "FN_multi_function.hh"
#include "DNA_meshdata_types.h"
#include "BKE_attribute.h"
#i... | ALGO | 0.930856 | 7.06311 | {
"github_metadata": {
"branch": "blender-v3.6-release",
"commit_count": 124905,
"repo_created_at": "2025-05-24T11:29:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"cont... |
da7300d0-8e49-4e34-bc7a-72c9c935ee39 | alexandraback/datacollection | solutions_5636311922769920_1/C++/joneschung/codejam4.cpp | #include <iostream>
using namespace std;
long long int getNum(int * arr, int length, int k){//0,1,2로 받
long long int res = 1;
long long int power = 1;
for(int i = length-1; i >= 0; i--){
res += (arr[i]*power);
power *= k;
}
return res;
}
int main(){
int t,k,c,s;
cin >> t;
for(int i = 1; i <= t; i++){... | ALGO | 0.999142 | 3.660466 | {
"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": "954548bcb... |
84cfac09-5e60-443c-8d8c-44c4a85f468b | tanvirakon/cf_submissions | C_Quests.cpp | // In the name of Allah the most beneficent the most merciful - sūrat l-naml(27:30)
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define endl '\n'
#define nn 1e7 + 5
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define f0(n) for (int i = 0; i < n; i... | ALGO | 0.999987 | 3.60215 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-05-10T05:42: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": "89f8293e26b7... |
873e141d-2154-4f89-9553-5cff14227bae | ubuntuh/github | contest/atcoder/s8pc-2/b/703699-0.cpp | // reference: submission 703699
// AC な人のアルゴリズムのコピーである。なぜこれで正しいのかわからない。
#include <cstdio>
long n;
long a[24];
int node_id_source = 0;
int dfs(int parent, int node_id, int a_index, long w)
{
printf("dfs #%d started. parent = %d, a_index = %d, w = %ld.\n", node_id, parent, a_index, w);
int result;
if (w > n) {
res... | ALGO | 0.999782 | 3.363823 | {
"github_metadata": {
"branch": "master",
"commit_count": 265,
"repo_created_at": "2015-11-17T15:24: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": "25f0a756... |
fc48d3ab-9399-426d-b719-6e0940215882 | mirkat1206/uva | 1368.cpp | // 1368 DNA Consensus String
#include <iostream>
#include <string>
#include <vector>
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
int t;
std::cin >> t;
while (t--) {
int m, n;
std::string s;
std::vector<std::string> dna;
std::cin >> m ... | ALGO | 0.99994 | 4.409074 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-05-06T07:12: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": "1be0a88844... |
6e7a11be-1a25-426d-9749-358d8f193199 | MinhTamPhan/Artificial_Intelligence_Algorithm | Souce/UCS_/UCS_/main.cpp | #include"MyGraph.h"
template<typename Comparable>
void BinaryHeap<Comparable>::insert3(const Comparable & x)
{
if (currentSize == arr.size() - 1)
arr.resize(arr.size() * 2);
//percolate up
int hole = ++currentSize;
Comparable copy = x;
size_t i;
for ( i = 1; i <= currentSize; i++)
{
if (equals(arr[i],x))b... | ALGO | 0.999113 | 3.651594 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-07-18T14:28:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9745ba2582... |
87a8bd32-41a9-4140-989a-eab34ebfce36 | 1dolcong/BOJ | solved.ac_Class2/BOJ18111.cpp | #include <iostream>
#include <vector>
using namespace std;
int N, M, B; // 가로, 세로, 인벤
vector<vector<int>> v;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> N >> M >> B;
int min = 257;
int max = -1;
v.assign(N,vector<int>(M));
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
... | ALGO | 0.999979 | 3.764642 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2023-09-05T06:02:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "affe7b54965... |
ef8aab23-c144-427f-b370-ab6222481d7e | lts96/Algorithm | BOJ/C++/2630.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
int n , white , blue;
int **arr;
void divide(int size , int x1 , int x2 , int y1, int y2)
{
int flag = arr[x1][y1];
if (size == 1)
{
if (flag == 1)
blue++;
else
white++;
return;
}
else
{
for (int i = x1; i < x2; i++)
{
for (int j ... | ALGO | 0.999753 | 4.120898 | {
"github_metadata": {
"branch": "main",
"commit_count": 263,
"repo_created_at": "2021-06-21T18:10: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": "3a56b53ad8... |
8a5ba900-a544-4b68-b686-bb5e782729e8 | gwdidonato/hpgda-spring22 | data_struct_CONTEST/include/GraphAlgorithm.h | #ifndef ORACLE_CONTEST_GRAPHALGORITHM_H
#define ORACLE_CONTEST_GRAPHALGORITHM_H
#include <cstring>
#include <fstream>
#include <iostream>
#include <ostream>
#include <queue>
#include <climits>
#include <set>
#include <string>
template<typename T>
class GraphAlgorithm {
uint64_t v, e, last;
uint64_t *dist;
... | ALGO | 0.993536 | 5.058104 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-04-29T14:37:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c988e4808e... |
8b724e9d-601e-45a7-97e5-dae1120084ee | abhinav-550/DSA | 5-dp/2D-DP/7stackCuboids.cpp | /*
Given n cuboids where the dimensions of the ith cuboid is cuboids[i] = [widthi, lengthi, heighti] (0-indexed). Choose a subset of cuboids and place them on each other.
You can place cuboid i on cuboid j if widthi <= widthj and lengthi <= lengthj and heighti <= heightj. You can rearrange any cuboid's dimensions by r... | ALGO | 0.999879 | 5.545703 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2024-06-03T15:30:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30706b2ea... |
3f9ef2c2-ffe3-4d05-a7f4-00c2e437d4cb | auddl0756/My-Algorithm | 기초로직/c++기초문법/string_find 사용법.cpp | #include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define sorta(a) sort(a.begin(),a.end());
#define rsorta(a) sort(a.rbegin(),a.rend());
#define sorta2(a,n) sort(a,a+n);
#define p(a) for(int i=0;i<a.size();i++)cout<<a[i]<<" ";cout<<"\n";
#define p2(a,n) for(int i=0;i<n;i++)cout<<a[i]<<" ";cout<<... | ALGO | 0.999661 | 3.358542 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2020-07-14T23:22:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07315b99... |
fc18c2b3-8088-4556-8661-d2881316c66a | Biditmangal/CompetitiveProgramming | CodeForces/CodeForces ProblemSet/D-1200/1328C.cpp | #include <math.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <... | ALGO | 0.999917 | 3.756791 | {
"github_metadata": {
"branch": "master",
"commit_count": 240,
"repo_created_at": "2020-01-07T08:23:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3594b40... |
f1a40e49-2576-41d5-9962-2920924d0dd9 | WhiteCom/CodingTest | 다흡/백준/Cpp/2751_2.cpp | #include <iostream>
#include <vector>
using namespace std;
void swap(int& num1, int& num2)
{
int temp = num1;
num1 = num2;
num2 = temp;
}
void Downheap(vector<int>& arr, int cur, int k)
{
int left, right, p;
while (cur < k)
{
left = cur * 2 + 1;
right = cur * 2 + 2;
if (left >= k && right >= k)
break... | ALGO | 0.999984 | 4.573293 | {
"github_metadata": {
"branch": "main",
"commit_count": 272,
"repo_created_at": "2021-03-27T11:15:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4fb138b13... |
3984ef4c-a5f3-4ac4-9360-dbbca71d71d7 | amol1211/DSAWithC-CPP | 03.SolvingLeetcodeProblems/HashMaps/RestoreTheArrayFromAdjacentPairs/main.cpp | //1743. Restore the Array From Adjacent Pairs
#include <iostream>
#include <vector>
#include <unordered_map>
#include <climits>
using namespace std;
// Class Solution providing a method to restore an array from its adjacent pairs.
class Solution {
public:
// Vector to store the result of the restored array.
... | ALGO | 0.999993 | 6.534907 | {
"github_metadata": {
"branch": "main",
"commit_count": 894,
"repo_created_at": "2023-02-25T03:36: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": "c257aea593... |
ea85372f-c906-4195-a2da-18545bb0cf15 | gitter-badger/cmath2tex | main/src/processing.cpp | /**
* @file processing.cpp
* @date 08.06.17
* @author galarius
* @copyright
*/
#include "processing.hpp"
#include "utils.hpp"
#include "glogger.hpp"
#include <sstream>
std::unordered_map<std::string, std::string> Processing::tags{
{ "_", R"!({\_})!" },
{ "/", R"!(\frac)!" },
{ "*", R"!(\cdot)!" },
... | TOOL | 0.949756 | 5.735961 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-06-10T13:48: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": "9e505a2e35... |
b6c0ba7f-dd81-4040-a8d2-94977f237efa | alps-jbnu/22ALPStudy | Algorithm/2022-2/Code/jys-jeong/MST/14621.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
char se[1005];
vector<tuple<int, int, int>> vec;
long long res = 0;
vector<int> p(1005,-1);
int find(int x) {
if (p[x]<0) return x;
return p[x] = find(p[x]);
}
bool is_diff_grp(int u, int v) {
u = find(u);
v = find(v);
if (u == v) return 0;
if (p[u] > p[v])... | ALGO | 0.999843 | 3.645366 | {
"github_metadata": {
"branch": "master",
"commit_count": 1307,
"repo_created_at": "2022-01-20T14:29:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 36,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1f96c... |
3c16af09-3eb6-4bd8-ad15-c4606f50aeb4 | spm/spm12 | src/spm_mesh_reduce.cpp | /*
* $Id: spm_mesh_reduce.cpp 7421 2018-09-20 10:58:01Z guillaume $
* <NAME>
*/
#include "mex.h"
#include "Simplify.h"
/* Gateway Function */
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
mxArray *array = NULL;
void *f = NULL, *v = NULL;
double *out = NULL;
unsigned... | ALGO | 0.970031 | 5.199164 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2017-09-11T13:19:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 148,
"forks": 57,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "065b8bb4df... |
29d13540-cdd2-4f60-b1ce-243e715adf0e | zwkcoding/data_structure | c++/leetcode/977_squares_of_a_sorted_array/main.cpp | #include "../../include/base.h"
#include <vector>
/// sequential search
/// Time Complexity: O()
/// Space Complexity: O().
class Solution
{
public:
vector<int> sortedSquares(vector<int>& nums)
{
bool start_nega;
int i, size, square, check_index, nega_size;
vector<int> res;
v... | ALGO | 0.999988 | 5.757066 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2019-04-24T14:36: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": "2eb2d77cb... |
c6642be5-67f0-48b3-87c6-7abad682ad82 | auburn0820/For_Blog | Data Structure/Singly Linked List.cpp | #include <iostream>
using namespace std;
typedef struct Node {
int value;
Node *next;
} Node;
class LinkedList {
private:
Node *head;
Node *tail;
int linked_list_size;
public:
LinkedList() {
this->head = new Node();
this->tail = new Node();
this->linked_list_size = 0;
... | ALGO | 0.995219 | 4.259594 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-08-22T08:34: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": "d9e56bdc61... |
4ea99045-6fb7-43bd-bd24-aa0704dee0ac | Ivaylo-Valentinov/FMI-UP-PR-2023-24 | 07. Низове/Solutions/task6.cpp | #include <iostream>
#include <cstring>
int longestSubstring(const char* inputString, const char* substring, int& maxCount)
{
if (inputString == nullptr || substring == nullptr)
return -1;
int lenInputString = strlen(inputString);
int lenSubstring = strlen(substring);
if (lenInputString < lenSubstring)
return -... | ALGO | 0.999703 | 4.855201 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2023-10-03T19:36:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91af225177e... |
fab8b1c1-4058-47fb-874d-fe4e909b6f85 | jbaldwin/adventofcode | 2019/day17/p1/main.cpp | #include <iostream>
#include <vector>
#include <2019/intcode/Interpreter.hpp>
using Map = std::vector<std::vector<char>>;
auto print_map(
const Map& map
) -> void
{
for(const auto& row : map)
{
for(const auto& c : row)
{
std::cout << c;
}
std::cout << '\n';
... | ALGO | 0.999804 | 5.245549 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2019-12-01T18:25: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": "e2b088c36c... |
ab505add-9169-4e3c-a1d0-394ffb179324 | ABB00717/leetcode | problems/cpp/2070.Most-Beautiful-Item-for-Each-Query.cpp | #include <algorithm>
#include <vector>
class Solution {
public:
std::vector<int> maximumBeauty(std::vector<std::vector<int>>& items, std::vector<int>& queries) {
std::sort(items.begin(), items.end(), [](const std::vector<int>& a, const std::vector<int>& b) {
if (a[0] == b[0]) return a[1] > b[1];
retu... | ALGO | 0.999921 | 6.157789 | {
"github_metadata": {
"branch": "main",
"commit_count": 325,
"repo_created_at": "2024-06-29T02:16: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": "f08175f40a... |
3851a9ea-86c6-4ae1-b62d-126d9a3bd818 | ishandutta2007/codeforces-s | satashun/normal/702/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(... | ALGO | 0.998537 | 3.177231 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ec4da165d3d... |
e1a7cd08-4654-47ee-9e44-afdb109c4401 | bdliyq/algorithm | leetcode-2/construct-binary-tree-from-inorder-and-postorder-traversal.cc | // Question: https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
pub... | ALGO | 0.999958 | 6.259572 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2015-10-20T02:14: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": "4871187f... |
e3da3ca2-277e-47a3-9d83-90161a9f0382 | mooziedog/algorithm | LAZY_PROPAGATION[10999].cpp | #include <stdio.h>
#include <vector>
#include <math.h>
using namespace std;
long long init(vector<long long> &s, vector<long long> &tree, int node, int start, int end) {
if (start == end) {
return tree[node] = s[start];
}
int mid = (start + end) / 2;
return tree[node] = init(s, tree, node * 2, start, mid) + i... | ALGO | 0.99993 | 5.374918 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-05-03T14:15: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": "7a3ac951c... |
51fa911f-6c27-480a-92b6-95aa66a2304d | lazywaterpig/BOJ_Problems | Platinum+/Ruby/10790.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int c; cin >> c;
while(c--){
ll l, v1, v2, t, s, m, cur=0, flag=0, maxv=0, piv;
cin >> l >> v1 >> v2 >> t >> s;
piv=l/v2;
while(1){
ll tmp... | ALGO | 0.999918 | 3.756196 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2021-02-20T06:00: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": "e8a1a366... |
ea81ba45-c8c9-4139-a948-ac56b093d211 | fyrsta7/LLM_on_ASAC | result_api_backup/en_md/deepseek-coder/The_Big_Bang_Theory_edition_Rock-Paper-Scissors_Game.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N, NA, NB;
cin >> N >> NA >> NB;
vector<int> A(NA), B(NB);
for (int i = 0; i < NA; ++i) cin >> A[i];
for (int i = 0; i < NB; ++i) cin >> B[i];
vector<vector<int>> result = {
{0, -1, 1, 1, -1},
{1, 0, -1... | ALGO | 0.999966 | 4.271164 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-08-11T08:13: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": "80338f425b3... |
bdfab465-eb75-4f6b-b6d2-d1751f2f1cd2 | brownspy1/XPSC | All Contest/Ethflow Round 1 (Codeforces Round 1001, Div. 1 + Div. 2)/D_Balanced_Tree.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> adj;
vector<int> l, r;
bool isPossible;
long long dfs(int node, int parent) {
long long sum = 0, maxChild = 0;
for (int neighbor : adj[node]) {
if (neighbor == parent) continue;
long long childSum = dfs(neighbor, node);
... | ALGO | 0.999877 | 5.504975 | {
"github_metadata": {
"branch": "main",
"commit_count": 157,
"repo_created_at": "2024-10-27T12:15:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94712435f6... |
9f3d1f65-96b5-426e-949b-036375ab4ed0 | v-grigore/Minesweeper | minesweeper.cpp | #include <iostream>
#include <random>
#include <chrono>
#include <thread>
#include <fstream>
#include <cmath>
using namespace std;
mt19937_64 mt(time(NULL));
int v[40][40];
void mineGenerator (int n , int m , int& mines , int& freeSpaces) {
int x = n*m;
int square_xy , mine_xy;
uniform_int_distribution<i... | TOOL | 0.975644 | 3.674093 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-11-05T21:46: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": "c43fa047bba4... |
c322c333-8a54-4655-8de7-65c00f3381eb | raincross7/code-similarity | codes/train_code/problem346/problem346_325.cpp | //競技プログラミング用のテンプレート
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <math.h>
#include <stack>
#include <limits>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repr(i, n) for(int i = n - 1; i >= 0; i--)
using namespace std;
//エイリ... | ALGO | 0.999979 | 3.806406 | {
"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": "ed2f12f06a1f... |
fdeb5e73-1610-45b1-bd9e-cdaf385c6605 | ishandutta2007/codeforces-i | i_love_tanya_romanova/normal/355/C.cpp | /*
In a time of fear and confusion,
silence charging the air
The sunlight is gone, darkness lives on
in the heart of the dragon's lair
Lost in a world of illusions
No trace of the missing ore
Stealing our souls, we're out of control,
knocking at death's door
All our beliefs fading into ashes
Heed the words that we pr... | ALGO | 0.999543 | 3.369466 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "ed21dfc9859f... |
739dd1cc-3eb2-4c78-812a-f76e69df0da2 | ishandutta2007/codeforces-j | j.t.j.l/normal/850/F.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int MM = 1e9 + 7;
const double eps = 1e-8;
const int MAXN = 2e6 + 10;
int n, m;
void prework(){
}
void read(){
}
ll inv(ll p){
p %= MM;
ll ret = 1;
for (int q = MM - 2; q; q >>= 1){
if (q & 1)
ret = ret... | ALGO | 0.999782 | 3.687681 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dfedaa1a395e... |
f0cf37b4-72ba-4e3a-a36d-2b0f301376a1 | Saif-000001/codeHelpeCpp | dataStructure/BinarySearch/binarySearch.cpp | #include <iostream>
using namespace std;
int binarySearch(int arr[], int n, int x);
int main()
{
int arr[100], n, key;
cout << "Enter the number of N : ";
cin >> n;
cout << "Printing the array : ";
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
cout << "Enter the number of Ke... | ALGO | 0.99998 | 5.261842 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2022-04-10T23:28: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": "b0a285da9... |
cfbdaa0e-4e9b-48a4-9465-f8f890547cc8 | Jestter/Competitive-Programming | Resources/Notebook/FenwickTree.cpp | class FenwickTree {
private: vi ft;
// recall that vi is: typedef vector<int> vi;
public:
FenwickTree(long n) { ft.assign(n + 1, 0); }
// init n + 1 zeroes
long LSOne(long n){return (n & (-n));}
long long rsq(long b)
{
// returns RSQ(1, b)
long long sum = 0; for (; b; b -= LSOne(b)) sum += ft[b];
return s... | ALGO | 0.999303 | 4.163846 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2016-04-30T03:49:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4714245ca... |
ffa88949-1a60-48f1-b259-6af5f8c1fd8a | kjywow94/Algorithm | algo1/algo1/2667.cpp | #include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;
typedef struct _data
{
int x, y;
}Map;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };
int n;
int map[27][27] = { 0, };
bool chk[27][27];
int Cnt[630];
bool range(int a, int b) {
if (a >= 0 && a < n && b >= 0 && b < n) {
return true... | ALGO | 0.999905 | 3.254853 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2019-07-08T10:36: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": "4ea3db2b1... |
79b1adda-31e4-4d08-9aeb-2da63e4a97d5 | KorlaMarch/competitive-programming | IPST_2016_apr/apio/merchant.cpp | #include "stdio.h"
#include "algorithm"
#define INF 200000000000LL
int n,m,k,v,w,t;
int bi[105][1005],si[105][1005];
long long maxP[105][105];
long long dis[105][105];
long long dyn[105][105][205];
bool isSub1,isSub2;
int main(){
isSub1 = true;
isSub2 = true;
scanf("%d%d%d",&n,&m,&k);
for(int i = 1; i <= n; i++... | ALGO | 0.999879 | 3.405057 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2015-05-03T08:02: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": "5085b6112... |
c45afb1a-2da8-42f2-b0f1-4a31d6adecdb | IAmShaaann/DSA-Codes | Leetcode/Medium/SortBinaryArray.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> sortBrute(vector<int> arr)
{
vector<int> ans;
int countZero = 0;
for (int i = 0; i < arr.size(); i++)
{
if (arr[i] == 0)
{
countZero++;
}
}
for (int i = 0; i < arr.size(); i++)
{
if (countZe... | ALGO | 0.99998 | 4.500551 | {
"github_metadata": {
"branch": "amazonalgoprep",
"commit_count": 84,
"repo_created_at": "2022-05-05T18:14: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": "5... |
955422df-84a8-4d86-9b74-58fc66f68e25 | ldx027/competition | cpp/sort/selectionSort.cpp | #include <iostream>
using namespace std;
void selectionSort(int* arr, int len);
void swap(int* arr, int a, int b);
int main()
{
int arr[] = {5,2,8,4,6,9,1,7,3,0};
int len = sizeof(arr) / sizeof(arr[0]);
selectionSort(arr, len);
for (int i = 0; i < len; i++)
{
cout << arr[i] << " ";
}
... | ALGO | 0.999953 | 4.841426 | {
"github_metadata": {
"branch": "main",
"commit_count": 123,
"repo_created_at": "2024-03-15T12:52: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": "90b062c334... |
1c77970f-1e87-4e95-a6b5-50d7165b964a | jeffrey-effendy/vs-uva-answers | UVA/UVA103.cpp | #include "C.h"
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
class Box
{
public:
vector<int> attrs;
int id;
int nparent;
int parent;
Box() {}
void insert(vector<int> attrs, int id)
{
this->id = id;
this->attrs = attrs;
sort(this->attrs.begin(), this->attrs.end());
np... | ALGO | 0.999923 | 3.608772 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2016-09-13T12:32:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f127b7fc... |
03394fa4-6937-465b-9ca5-ae346b670990 | b0n21en5/DS-Algo | arrays/algorithms/Sorting/SelectionSort.cpp | // c++ program of selection sort to sort an array
// Time Complexity: O(n^2)
// Space Complexity: O(1)
#include <iostream>
using namespace std;
// function to perform selection sort on the array
void selectionSort(int arr[], int n)
{
// outer loop will run from 1 to n
for (int i = 0; i < n; i++)
{
... | ALGO | 0.999981 | 5.709665 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2022-12-26T16:30:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bad0a43bc09... |
69821d84-b7e4-4942-b054-81983cf38f9a | ssafystudy/ProblemSolving | common/programmers/파괴되지않은건물/파괴되지않은건물_오종석.cpp | #include <string>
#include <vector>
using namespace std;
int chk[1001][1001];
int n,m;
int solution(vector<vector<int>> board, vector<vector<int>> skill) {
int answer = 0;
n = board.size();
m = board[0].size();
for(const auto& sk: skill){
int d = sk[5];
d = sk[0] == 1? -d:d;... | ALGO | 0.999921 | 5.64931 | {
"github_metadata": {
"branch": "master",
"commit_count": 323,
"repo_created_at": "2022-07-20T03:55:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b5eb4978... |
0ba276ba-a311-4090-8be4-0452950f41aa | herizaladk/analgo-01 | Tugas 2/4.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
int x[10];
cout << "Masukkan Jumlah Data : ";
cin >> n;
for (int i = 0; i < n; i++)
{
cout << "Masukkan Data ke - " << i+1 << " : ";
cin >> x[i];
}
cout << "Data Sebelum di Sorting : ";
for (int i = 0; i < n; i++)
cout << x[i] << " ";
cout <<... | ALGO | 0.999842 | 4.203783 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-03-05T11:52: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": "a0618fd9eb... |
11970695-9f65-47d2-a553-057545d931c4 | danielil/Data-Structures-Algorithms | Sources/Includes/sorts/merge_sort.hpp | /**
* <NAME>, http://dansil.net
* MIT License (MIT), http://opensource.org/licenses/MIT
*
* Implementation of merge sort.
*/
#pragma once
#include "sort.hpp"
namespace
{
static constexpr std::size_t MERGE_THRESHOLD = 16;
}
namespace dsa
{
struct merge
{
struct std_implementation
{
template < typename... | ALGO | 0.999956 | 7.374199 | {
"github_metadata": {
"branch": "master",
"commit_count": 160,
"repo_created_at": "2015-05-07T00:15: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": "564a16ff... |
e7b20708-0e66-4848-902b-9a36021ce73b | kilianbartz/bs_ueb2 | A1/accurate_cpu_aff.cpp | #include <iostream>
#include <thread>
#include <atomic>
#include <chrono>
#include <x86intrin.h> // For __rdtsc()
#include <pthread.h> // For setting thread affinity on Linux
#include <sched.h> // For CPU affinity macros
std::atomic_flag spinlock = ATOMIC_FLAG_INIT;
int shared_data = 0;
long start, times = 0;
i... | ALGO | 0.995518 | 6.274069 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2025-01-02T11:54: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": "7266aed0a... |
ceb437ae-aabd-4d74-8027-5dc891fa8dff | hjiang13/LLM4IR | results/Task2_IR_Decompilation/DecompiledResuts_Human_x_164_O1/Decompiled_Humaneval_x_cpp_164_O1_Codelama/CPP_153.cpp | Sure, here's the decompiled C++ code for the provided IR code:
#include <iostream>
#include <string>
using namespace std;
class basic_string {
public:
struct _Alloc_hider {
char* _M_p;
};
union {
_Alloc_hider _M_dataplus;
struct {
char* _M_p;
char* _M_end_... | ALGO | 0.949872 | 3.151641 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-05-21T20:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d048d3e089... |
3d96174c-6863-45ec-b8a4-f243bfaa5d53 | hadleyhzy34/data_structure_and_algorithm | trie/src/472-concatenated-words.cpp | #include <iostream>
#include <string.h>
#include <vector>
struct wordTree {
bool isEnd; // To mark the end of a word
wordTree *children[26];
wordTree() {
isEnd = false;
for (int i = 0; i < 26; i++) {
children[i] = nullptr;
}
}
};
class Solution {
public:
wordTree *root = new wordTree();
s... | ALGO | 0.997843 | 6.007044 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2020-09-06T13:38:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fc1fe2e... |
8a4c652b-7eed-470c-ba5c-90ef642d6078 | icl-utk-edu/magma | sparse/control/magma_zmtranspose_cpu.cpp | /*
-- MAGMA (version 2.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date
@precisions normal z -> s d c
@author <NAME>
*/
#include <cstdlib>
#include "magmasparse_internal.h"
/**
* op(from[i], to[i]);
*/
template <typena... | ALGO | 0.997199 | 5.925568 | {
"github_metadata": {
"branch": "master",
"commit_count": 8870,
"repo_created_at": "2023-04-05T15:59:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 63,
"forks": 29,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "cbf1c... |
c8ba0cb6-57d1-4ce8-bd6e-0e06cf709fd8 | TheLethalCode/Competitive-Programming | Codeforces/codes/1401/1401E.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define mod 1000000007
#define lli long long
#define fi first
#define se second
#define pb emplace_back
#define FOR(i,n) for(int i=0;i<n;i++)
#define FORR(x,v) for(auto... | ALGO | 0.99986 | 4.093562 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2020-07-27T16:10:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c51af729... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.