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 |
|---|---|---|---|---|---|---|---|
4a46268c-ab3a-4b97-86fb-70af06270647 | FLOWERCLOUD/cppGameFrame | my-simple-code/src/mysdk/config/Config.cc | /*
* Config.cc
*
* Created on: 2011-10-24
*
*/
#include <mysdk/config/Config.h>
#include <mysdk/base/Logging.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
using namespace mysdk;
Config::Config()
{
}
Config::~Config()
{
}
std::string Config::get(const std::string& key, std::string defaul... | CONFIG | 0.92035 | 4.311785 | {
"github_metadata": {
"branch": "master",
"commit_count": 192,
"repo_created_at": "2015-07-05T06:48:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "968f3ec... |
13befd3d-c472-46bf-80cb-f281f6d3cae1 | patjed41/ASD | small-tasks/inw.cpp | // <NAME>
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <algorithm>
using namespace std;
template<class T> using V = vector<T>;
struct Frag {
int l, r, maximum;
Frag(int l, int r, int maximum) : l(l), r(r), maximum(maximum) {}
};
int main() {
ios_base::sync_w... | ALGO | 0.999874 | 4.229761 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-10-01T11:01: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": "5681695bf6... |
91353fb8-cc43-4254-97ef-15795878e0b1 | drlongle/interviewbit | problem_0061/solution.cpp | /*
Inorder Traversal of Cartesian Tree
Given an inorder traversal of a cartesian tree, construct the tree.
Cartesian tree : is a heap ordered binary tree, where the root is greater than all the elements in the subtree.
Note: You may assume that duplicates do not exist in the tree.
Example :
Input : [1 2 ... | ALGO | 0.999998 | 5.73704 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2017-02-08T13:57: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": "2bfb9a248... |
58dc91d5-a5d4-4538-b80a-b44401c2cdc1 | daydramas/competitive-programming | USACO Training/Chapter 6/6.3 fence8.cpp | /*
ID: dongliu3
TASK: fence8
LANG: C++
*/
#include <bits/stdc++.h>
using namespace std;
/* Defines */
#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n) for (int i = (in... | ALGO | 0.999989 | 3.720562 | {
"github_metadata": {
"branch": "master",
"commit_count": 534,
"repo_created_at": "2021-04-11T20:23: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": "37061708... |
193e8cdb-e1ae-463f-a3e5-1fec75dc7745 | RishithaPatel1816/Insta-Influencer-Fest | code.cpp | #include <bits/stdc++.h>
using namespace std;
class Graph{
private:
//mp is adjacency list
map<int,set<int>> mp;
vector<int> hype; ///stores hype value
vector<int> indeg;
int n; //int number of g->n
public:
//constructor with parameters
... | ALGO | 0.999948 | 4.471624 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-05-15T14:43: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": "a9481007698b... |
a6b21a60-0ebf-49a0-8d23-1a38f4ad1449 | Khetesh-Deore/DSA | Questions/04_Binary_Search/02_BS_on_Answers/10_SplitArrayLargestSum.cpp |
#include <bits/stdc++.h>
using namespace std;
int countSubarrays(vector<int>& nums, int maxSum) {
int subarrays = 1;
long long currentSum = 0;
for (int i = 0; i < nums.size(); i++) {
if (currentSum + nums[i] <= maxSum) {
currentSum += nums[i];
} else {
subarrays++;
... | ALGO | 0.999938 | 4.683032 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2025-01-11T15:37: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": "9db09a77e08... |
83c1d3b9-188e-4210-81e5-82814ed7d219 | gwanhyeon/algorithm_study | beakjoon_algorithm/beakjoon_algorithm/CodingTestExam/2579(계단오르기).cpp | /*
계단 오르기 게임은 계단 아래 시작점부터 계단 꼭대기에 위치한 도착점까지 가는 게임이다. <그림 1>과 같이 각각의 계단에는 일정한 점수가 쓰여 있는데 계단을 밟으면 그 계단에 쓰여 있는 점수를 얻게 된다.
예를 들어 <그림 2>와 같이 시작점에서부터 첫 번째, 두 번째, 네 번째, 여섯 번째, 계단을 밟아 도착점에 도달하면 총 점수는 10 + 20 + 25 + 20 = 75점이 된다.
계단 오르는 데는 다음과 같은 규칙이 있다.
계단은 한 번에 한 계단씩 또는 두 계단씩 오를 수 있다. 즉, 한 계단을 밟으면서 이어서 다음 계단... | ALGO | 0.999982 | 4.586452 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2018-12-19T17:50:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44020d1e... |
5f4b5647-60ea-454e-92c1-14a80eaa5520 | codgician/competitive-programming | HDUOJ/1398/generating_function.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <iomanip>
#include <climits>
#define SIZE 999
using namespace std;
int c1[SIZE], c2[SIZE];
int main()
{
ios::sync_with_stdio(false);
int n;
while (cin >> n)
{
if (n == 0)
... | ALGO | 0.999975 | 4.024067 | {
"github_metadata": {
"branch": "master",
"commit_count": 1251,
"repo_created_at": "2017-09-19T02:44:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4dd4cc7... |
dfb6e268-2810-4491-96ab-558d2d8436bd | harshm413/dsa-line-by-line | Graphs/Cycle Detection/dfs_cycle_undirected_list.cpp | #include <iostream>
#include <vector>
using namespace std;
// Function to perform DFS and check for cycles in an undirected graph
bool dfsUndirected(int node, int parent, const vector<vector<int>>& adjList, vector<bool>& visited) {
// Mark the current node as visited
visited[node] = true;
// Traverse all... | ALGO | 0.999976 | 6.85243 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-01-13T21:37: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": "f5fc5d15dedb... |
951090fc-7a28-4246-afc0-1ebb8fa738e4 | SorahISA/competitive_programming | Codeforces/Gym/102920/C.cpp | #include <bits/stdc++.h>
using namespace std;
// #define int long long
#define double long double
using pii = pair<int, int>;
template<typename T>
using Prior = std::priority_queue<T>;
template<typename T>
using prior = std::priority_queue<T, vector<T>, greater<T>>;
#define X first
#define Y second
#define pb push_ba... | ALGO | 0.999967 | 4.333573 | {
"github_metadata": {
"branch": "master",
"commit_count": 677,
"repo_created_at": "2020-05-23T13:25:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0b95559... |
25d1c65e-0c03-4db3-9bc4-63ea784ecd88 | msk4862/DS-Algo | CourseWork/week3_greedy_algorithms/2_maximum_value_of_the_loot/fractional_knapsack.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Item
{
int value, weight;
};
bool compare(struct Item a, struct Item b)
{
double r1 = (double)a.value / a.weight;
double r2 = (double)b.value / b.weight;
//Decreasing order
return r1 > r2;
}
doubl... | ALGO | 0.999734 | 4.800105 | {
"github_metadata": {
"branch": "master",
"commit_count": 446,
"repo_created_at": "2019-07-30T16:56:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67d73844... |
b17a55af-3cff-410f-ba5a-df19c7216482 | tesion99/LeetCode | cpp/922_sortArrayByParityII.cpp | /*
给定一个非负整数数组 A, A 中一半整数是奇数,一半整数是偶数。
对数组进行排序,以便当 A[i] 为奇数时,i 也是奇数;当 A[i] 为偶数时, i 也是偶数。
你可以返回任何满足上述条件的数组作为答案。
示例:
输入:[4,2,5,7]
输出:[4,5,2,7]
解释:[4,7,2,5],[2,5,4,7],[2,7,4,5] 也会被接受。
提示:
2 <= A.length <= 20000
A.length % 2 == 0
0 <= A[i] <= 1000
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/sort-array-by-... | ALGO | 0.999972 | 5.450968 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2019-02-21T02:39: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": "10976361b... |
e0df7073-9bc6-487b-8e5b-6b8f8e52d5f7 | msaadi3/DSA | trees/binaryTree/leftViewOfBinaryTree.c++ | #include <bits/stdc++.h>
using namespace std;
// Left view of binary tree
// A binary tree node
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int x)
{
data = x;
left = right = NULL;
}
};
// Function to return a list containing elements of left view of t... | ALGO | 0.999978 | 4.86132 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-05-07T03:57: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": "b620df2aa1a3... |
36df8123-a2db-4892-b29a-1cae1b6d26da | liangsheng/ACM | template3/CodeM2018_pre_F_dijkstra费用流.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#define eps 1e-8
#define zero(x) (((x)>0?(x):-(x))<eps)
#define pause cout << " press ansy key to continue...", cin >> chh
#define file_r(x) ... | ALGO | 0.999992 | 3.611178 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2013-04-10T03:54: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": "d991e4665... |
2a34e1a3-0c54-4bc1-a2ca-136b101774ab | aaafwd/Online-Judge | Volume 004 (400-499)/416.cpp | /* @JUDGE_ID: 19899RK 416 C++ "By Anadan" */
// LED Test
// Accepted (0.008 seconds with low memory spent)
#include <stdio.h>
#include <string.h>
int N;
char led[10][8];
const char lednums[10][8] = {
"YYYYYYN", "NYYNNNN", "YYNYYNY", "YYYYNNY", "NYYNNYY",
"YNYYNYY", "YNYYYYY", "YYYNNNN", "YYYYYYY", "YYYYNYY"
};
in... | ALGO | 0.999779 | 3.605082 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-04-11T10:48:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "238a142681b... |
f57d0c6c-b9dd-4f82-ac9a-6dd04d5fc993 | Eilhie/dasci | SEMESTER_1/D_SOCS/H-Searching/jojoandMMORPG.cpp | #include<stdio.h>
#include<stdlib.h>
void merge(long long int arr[], long long int l, long long int m, long long int r)
{
long long int i, j, k;
long long int n1 = m - l + 1;
long long int n2 = r - m;
long long int L[n1], R[n2];
for (i = 0; i < n1; i++)
L[i] = arr[l + i];
for (j = 0; j... | ALGO | 0.999998 | 3.525495 | {
"github_metadata": {
"branch": "master",
"commit_count": 192,
"repo_created_at": "2022-12-02T16:47:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a8c0783... |
e6b565c5-a509-405a-8b74-313612ecf316 | ishandutta2007/codeforces-l | lucina/normal/1707/B.cpp | #include<bits/stdc++.h>
using namespace std;
const int nax = 5e5 + 10;
int n;
int a[nax];
void solve() {
cin >> n;
for (int i = 1 ; i <= n; ++ i) {
cin >> a[i];
}
/**
the summation of segment is a[n] - a[1]
with (n - 1) segments
, there are at most O(sqrt(distinct)) va... | ALGO | 0.999778 | 3.576416 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7c109c0d519... |
555f2f44-8998-4fda-8675-e59b6cb1dd15 | ishandutta2007/codeforces-a | anz/normal/1368/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll gcd(ll a, ll b) { for (; b; a %= b, swap(a, b)); return a; }
int n;
int tmp[1001];
int ocp[1001];
int main()
{
cin >> n;
if (n < 4)
{
cout << 0 << endl;
return 0;
}
int sz = 0;
int... | ALGO | 0.999823 | 3.243237 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5c5f694c1cc... |
d2a02c44-f917-4018-97fa-90bb9bf48590 | Landvibe-DataStructure-2022/ESTJ-Youngjun | W9/W4_P4.cpp | #include <iostream>
#include<vector>
using namespace std;
struct compare{
bool operator()(const int&e1,const int&e2)const {
//e1이 계속 바뀌는 값들
//e2이 우선순위 높은 minVal
if(e1%2!=0){
//e1 홀수
if(e2%2==0){
//e2 짝수
return false;
}
... | ALGO | 0.999846 | 4.108145 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-03-10T15:28:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b281c7fe536c... |
b304f76b-1ec9-48c1-8007-26f7f31b2b8e | LuckyN510/CODE_PTIT | TRR-2/TRR2009_2.9 LIEN THONG.cpp | #include <bits/stdc++.h>
using namespace std;
bool visited[1001];
vector<int> adj[1001];
int a[1001][1001];
int parent[1001];
set<int> path;
void DFS(int u){
path.insert(u);
visited[u] = true;
for (int x : adj[u]) {
if (!visited[x]) {
parent[x] = u;
DFS(x);
}
}
... | ALGO | 0.999641 | 4.081419 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-02-06T14:18: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": "27d62d63dbb... |
c8fc22be-5e48-4981-aaec-7c912259f55c | codethakur/DSA | Stack/Max rectangle.cpp | /*You are required to complete this method*/
class Solution{
public:
int getMaxArea(int arr[], int n) {
stack<int> st;
vector<int> leftsmall(n), rightsmall(n);
for (int i = 0; i < n; i++) {
while (!st.empty() && arr[st.top()] >= arr[i]) {
st.pop();
... | ALGO | 0.999939 | 5.459181 | {
"github_metadata": {
"branch": "main",
"commit_count": 428,
"repo_created_at": "2023-07-23T10:04:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "1d5fce5f3e... |
5a594cc5-cb88-4aea-8b36-eeb0ad57e12c | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p03037/s676018090.cpp | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int NIL = -1;
const int INF = (1<<21);
const l... | ALGO | 0.999946 | 4.125421 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "31ac202a45... |
af82a0c0-1e8b-44f5-900a-cc7995c19228 | parthlathiya12/Codechef-Submissions | 17_9_SEPT17/WEASELTX.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define re(i,b) for(ll i=0;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define ll long long
#define ld long double
#define llu long long unsigned
#define pll std::pair<ll, ll>
#defin... | ALGO | 0.999933 | 4.005582 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-03-24T17:55: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": "54d8320e1... |
2e4350b1-9d9d-4d0e-bb80-6af0302e3b0b | firmread/natureOFcode | chp10-nn-02-perceptron-steering/src/Perceptron.cpp | #include "Perceptron.h"
#include <iostream>
Perceptron::Perceptron(int n, float _learnConst)
{
weights.clear();
std::cout << "weight count: " << n << std::endl;
learnConst = _learnConst;
for (int i = 0; i < n; i++)
{
weights.push_back(ofRandom(-1,1));
}
std::cout << "weight count ad... | ALGO | 0.943418 | 4.374844 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2013-02-21T21:56:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 149,
"forks": 38,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "223274... |
4a72152e-20e8-4dbd-8ac8-2eab2954a03c | rjt007/Striver-SDE-Sheet | Tree/Binary Tree/lca.cpp | //Lowest Common Ancestor of a Binary Tree
//https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/
#include <bits/stdc++.h>
using namespace std;
struct node
{
int val;
node *left, *right;
node(int data)
{
val = data;
left = NULL;
right = NULL;
}
};
node *bfs... | ALGO | 0.999999 | 5.127555 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2021-10-03T13:14: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": "8602c14c0... |
377dd336-04fe-4e69-a9a8-6a087f60399a | EliasEspana/Proyecto_2 | Arabigos a Romanos.cpp | #include <iostream>
using namespace std;
string convertirARomano(int numero) {
const string unidades[] = {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"};
const string decenas[] = {"", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"};
const string centenas[] = {"", "C", "CC", "CCC", "CD"... | ALGO | 0.961625 | 4.174219 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-04-01T00:13:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3edd696b9f... |
b03831e8-dc7e-47e8-9ed3-2737e868c941 | ishandutta2007/codeforces-f | fastmath/normal/1190/D.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define ls order_of_key
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
const int N = 2e5... | ALGO | 0.9997 | 4.199233 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "400a56584455... |
62e82994-cf49-4282-92b8-8dead863fc4c | girving/pentago | pentago/high/board.cc | // High level interface to board
#include "board.h"
#include "../base/superscore.h"
#include "../base/symmetry.h"
#include "../mid/halfsuper.h"
#ifndef __wasm__
#include "../utility/random.h"
#endif // !__wasm__
NAMESPACE_PENTAGO
using std::make_tuple;
using std::max;
// We don't use this very often, so implement i... | ALGO | 0.983921 | 6.262958 | {
"github_metadata": {
"branch": "main",
"commit_count": 719,
"repo_created_at": "2012-02-06T00:37:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 52,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09f230443... |
b9d058c4-aa87-4c68-adec-8dc9bc462a71 | nitishp25/problem-solving | queue/queue.cpp | #include <iostream>
using namespace std;
class Queue {
public:
int arr[10], size, front, rear;
Queue() {
size = 0;
front = 0;
rear = -1;
}
void push(int val) {
if(size == 10) {
cout<<"Queue Overflow"<<endl;
return;
}
rear = (... | ALGO | 0.991773 | 4.181676 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2020-06-14T16:36: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": "4e4a2f595... |
628d0f2b-a4dd-419f-b58f-127640e8275a | Tunghohin/Competitive_Coding | Nowcoder/21791_C.cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using PLI = pair<long long, int>;
using PLL = pair<long long, long long>;
int a[100010];
LL C[100010][5];
void solve()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++) cin >> a[i];
sor... | ALGO | 0.999928 | 4.137055 | {
"github_metadata": {
"branch": "master",
"commit_count": 367,
"repo_created_at": "2021-08-05T14:13:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26376471... |
6948feab-d25a-4857-8394-a22ca00b7891 | SAGAR-RAJ1/DSA-CODES1 | TREES/VIDEO 108 (const BT by orders)/pracpreIN1.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
class node {
public:
int data;
node * left;
node * right;
node(int x){
data=x;
left = right= NULL;
}
};
int find(int * in , int target , int instart , int inend){
for (int i = instart; i <= i... | ALGO | 0.999998 | 5.113472 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2024-10-23T15:55: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": "30fa226a242... |
52142237-6b23-4c33-912b-7fa5b4a803dc | AmpleCoder/Leetcode-Solving | Biweekly Contest 67/2101. Detonate the Maximum Bombs.cpp | /*
good problem
how i solved first i figured out all the circles for a given circle whose centre's lies on this circle
and then formed a directed graph with edge going from bigger circle to circles who's centre lies in this circle
after that i applied dfs(trick is using bitset(to boost up processing) and returning t... | ALGO | 0.999885 | 5.176909 | {
"github_metadata": {
"branch": "master",
"commit_count": 245,
"repo_created_at": "2021-12-11T13:10: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": "e0cbc24b... |
770ba817-ed81-4eff-829c-54e75d39981e | minhvvan/CodingTest_CPP | 프로그래머스/3/42892. 길 찾기 게임/길 찾기 게임.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
struct Node
{
int num;
pair<int,int> coord;
Node* left;
Node* right;
Node(): num(0)
{
left = nullptr;
right = nullptr;
coord = {0,0};
}
void insert(Node* ... | ALGO | 0.999978 | 4.712455 | {
"github_metadata": {
"branch": "main",
"commit_count": 800,
"repo_created_at": "2023-09-18T05:34:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34571735df... |
35cf6f0e-4112-46d6-8ff9-a1c70abe170c | LutzGross/esys-escript.github.io | trilinos_source15/packages/nox/src-loca/src-epetra/LOCA_Epetra_TransposeLinearSystem_AbstractStrategy.H | // $Id$
// $Source$
//@HEADER
// ************************************************************************
//
// LOCA: Library of Continuation Algorithms Package
// Copyright (2005) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use... | TOOL | 0.95801 | 7.300084 | {
"github_metadata": {
"branch": "master",
"commit_count": 5724,
"repo_created_at": "2020-08-10T02:31:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 15,
"issues": 63,
"pull_requests": 0
},
"file_meta": {
"content_id": "28d3... |
a30ee064-c4ac-43db-bb58-450dd48461f1 | FannyChung/acmOJ | nyist/动态规划/skiing_10/skiing_10/源.cpp | #include<iostream>
using namespace std;
int **place;
int **result;
int getMaxLen(int r,int c){
int maxLen = 0;
int move[4][2] = { { -1, 0 }, { 0, 1 }, { 1, 0 }, { 0, -1 } };
for (int i = 0; i < r; i++)
{
for (int j = 0; j < c; j++)
{
result[i][j] = 0;//indicate that we have met (i,j)
int maxNext = 0;
... | ALGO | 0.999902 | 3.536905 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2014-07-25T07:57: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": "cc4f50b94f... |
02fd9bde-d02c-4c79-9e19-48ae2185bfba | sonyy789/algospot | @@NUMBERGAME.cc | #include <iostream>
#include <limits>
#include <cstring>
#define MIN -1000
using namespace std;
int mem[51][51];
int nbrgame(int set[], int idx, int len)
{
if(mem[idx][len]) return mem[idx][len];
if(len == 1) return set[idx];
if(len == 0 ) return 0;
int result = numeric_limits<int>::min();
result =... | ALGO | 0.999721 | 3.41455 | {
"github_metadata": {
"branch": "master",
"commit_count": 489,
"repo_created_at": "2015-12-15T06:25: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": "7db92cae... |
402d4ae8-4f7e-427d-9db0-dfff873421ca | KyrillosAwad/CompetitiveProgramming | Solutions/UVA/10730.cpp | //udebug test is wrong xD
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define mk make_pair
#define pb push_back
#define REP(i, a, b) for (int i = int(a); i < int(b); ++i)
#define rREP(i, a, b) ... | ALGO | 0.999226 | 3.573037 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-03-17T16:56: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": "f6e1b437a... |
5fb7edd3-6052-4d87-8c59-ea0c2edad255 | PointCloudLibrary/pcl | filters/include/pcl/filters/impl/frustum_culling.hpp | /*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2012-, Open Perception, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following condition... | ALGO | 0.970415 | 6.752982 | {
"github_metadata": {
"branch": "master",
"commit_count": 14566,
"repo_created_at": "2013-02-12T16:40:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10495,
"forks": 4656,
"issues": 432,
"pull_requests": 147
},
"file_meta": {
"content_id... |
d8ba21d1-3932-4cef-a0bf-d72671687c18 | hakobyanart/tasks | task2.cpp | #include <iostream>
#include <time.h>
#include <vector>
#include <random>
void printer (std::vector<std::vector<int> >& arr) {
for (int i = 0; i < arr.size(); i++) {
for (int j = 0; j < arr.size(); j++){
std::cout << arr[i][j] << ' ';
}
std::cout << std::endl;
}
std::cou... | ALGO | 0.999014 | 4.49817 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-02-11T10:03: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": "cb39e482405... |
2346ad05-4fc6-4226-b3be-a9b830f60cce | mjansche/cnstx | src/include/cnstx/bits/cmath_log.h | // -*- C++ -*-
// Copyright 2020, 2021 the cnstx authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ap... | ALGO | 0.995587 | 6.855186 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-01-06T17:45: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": "48a54a71da54... |
302b85a1-fdf1-41b0-bbde-17e58386b8ce | amar1323/fromC-toJsAndPy | problems/hard/25.ReverseNodesink-Group/cpp/main.cpp | #include <iostream>
#include <list>
#include <numeric>
#include <random>
#include <stack>
/*
Problem statement
Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list.
k is a positive integer and is less than or equal to the length of the linked list. If the ... | ALGO | 0.999912 | 5.868598 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2023-01-01T16:57:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "638131af6f3... |
68558492-61dc-4dd4-b454-e99db97ef246 | raincross7/code-similarity | codes/train_code/problem031/problem031_291.cpp | //
// author : Abhishek
//
#include <bits/stdc++.h>
#define ll long long
#define db double
#define deb(x) cout<<#x<<": "<<x<<"\n"
#define all(x) x.begin(),x.end()
#define fo(i, n) for(i=0 ; i<n ; i++)
#define Fo(i, k, n) for(i=k ; i<n ; i++)
using namespace std;
const ll mod = 1000000007;
const ll N = 200005; // a... | ALGO | 0.999173 | 3.180284 | {
"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": "b7da45e259dd... |
bdbde736-3d06-4aa0-915f-ae0595c081c6 | Vikas-code-master/CppProjects | CPPprojects/Sorting algorithm/quick_sort_gfg.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fl(i,a,b) for(ll i=a;i<b;i++)
#define vc vector<int>
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define time srand(chrono::high_resolution_c... | ALGO | 0.999979 | 5.627946 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-02-14T05:24: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": "48b23cabd412... |
33fdf02b-f60f-4d8e-80e3-813320e88c67 | Hasson827/Data_Structure | Sort/Codes/Insertion_Sort.cpp | #include <iostream>
using namespace std;
template <class Type>
void straightInsertSort(Type R[], int size){
int pos, j; // pos为待插入位置记录
Type temp;
for(pos = 1, pos < size; pos++){
temp = R[pos]; // 记录待插入的元素
for(j = pos - 1; j >= 0 && R[j] > temp; j--) // 从后往前查找插入位置
R[j + 1] = R[j... | ALGO | 0.999912 | 4.098039 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2025-05-26T06:18: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": "81cd601ff62... |
a201e582-03c6-4542-8939-63d010550915 | littlefish-Max/Data-Structure | chapter2/2_2_8.cpp | //找公共结点
#include<iostream>
using namespace std;
typedef struct lnode{
int data;
struct lnode *next;
}lnode,*linklist;
int a[5]={2,4,3,7,8};
int b[4]={1,3,7,8};
int n1=5,n2=4;
void buildlist(linklist &L,int aa[],int n)
{
L=(linklist)malloc(sizeof(lnode));
lnode *s,*r=L;
for(int i=0;i<n;i++)
{
... | ALGO | 0.999913 | 3.145319 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-08-25T12:37:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 251,
"forks": 61,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4cf5d5a9... |
b55bdef5-4036-4a6d-9fb9-b64989ed4b6d | Chenchunxuan/rattle-iros-2022 | casadi_nmpc/casadi-matlab/old/nominal-mpc-direct-tran/codegen/mex/mpc_direct_tran/linearForm_.cpp | //
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// linearForm_.cpp
//
// Code generation for function 'linearForm_'
//
// Include files
#include "linearFor... | ALGO | 0.997389 | 4.650556 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-06-07T03:29:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "672685233122... |
40ef2bea-8b0c-45d1-96f2-dcb5a277cd0a | monksmojo/c-plus-plus-dojo | as2_bubblesort.cpp | #include<iostream>
using namespace std;
void insertion(int arr[],int n);
void sort(int arr[],int n);
void output(int arr[],int n);
int main()
{
int array[100], n;
cout<<"Enter number of elements\n";
cin>>n;
insertion(array,n);
sort(array,n);
output(array,n);
return 0;
}
void insertion(int arr[],int n)
... | ALGO | 0.999217 | 4.194547 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-03-06T21: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": "0864a4504092... |
84c6faa2-dba3-4cef-9137-a2b171577b68 | abelkm99/competitive_programming | 0992-subarrays-with-k-different-integers/0992-subarrays-with-k-different-integers.cpp | class Solution {
public:
int subarraysWithKDistinct(vector<int>& nums, int k) {
/*
so given an array
a sub array s is called good if it has exactly k number of different numbers
//
------------
| |... | ALGO | 0.999893 | 6.316766 | {
"github_metadata": {
"branch": "main",
"commit_count": 701,
"repo_created_at": "2021-12-10T14:57:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e8e252931... |
50516a29-edec-4dd6-aa7c-050027c1bcdf | RichardTimothy1307/DSA_in_CPP | Linked_List/stack_Linked_List.cpp | #include<bits/stdc++.h>
using namespace std;
//TODO:Implement stack using linked list
//*Declaring node which will act as datatype for stack
class Node{
public:
int data;
Node* next;
};
//*Implement it as pushing a value at front
void push(Node** head,int value){
Node* new_node=new Node();
new_no... | ALGO | 0.999852 | 4.437768 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2020-10-05T16:45:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a68042e2... |
83b6a021-f509-43a0-8974-ee3bb5cae19e | KeitoKubo/SolutionCodes | AtCoder/Solutions/ABC151-200/ABC189/c.cpp | #include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
typedef unsigned usi;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<string> vs;
typedef pair<int, int>... | ALGO | 0.999973 | 3.581254 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2023-01-16T02:43:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f00c67b273b... |
3e0c8979-9b3d-4b59-b2c0-36b02d943ed9 | kirankuyate2157/cpp_programs | .vscode/cppTasks/day_36/singleTreadCPU.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<int> getOrder(vector<vector<int>> &tasks)
{
using pp = pair<int, pair<int, int>>;
for (int i = 0; i < tasks.size(); i++)
{
tasks[i].push_back(i);
}
sort(tasks.begin(), tasks.end())... | ALGO | 0.999988 | 5.486095 | {
"github_metadata": {
"branch": "main",
"commit_count": 171,
"repo_created_at": "2022-01-03T14:01:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fb4e691a2... |
edc98760-5db4-472b-90eb-c49e7178dada | danyfang/SourceCode | cpp/leetcode/DistinctSubsequences.cpp | //Leetcode Problem No 115 Distinct Subsequences
//Solution written by <NAME> on 5 June, 2018
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
using namespace std;
class Solution{
public:
int numDistinct... | ALGO | 0.999973 | 6.017293 | {
"github_metadata": {
"branch": "master",
"commit_count": 249,
"repo_created_at": "2018-02-05T13:48:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c10d118... |
ab04ae64-11ef-4683-b1a0-24ff72659190 | VedashreeD/Data-structures-and-algorithms | Programs/max_score_removing_substrings.cpp | #include<iostream>
#include<string>
#include<stack>
#include<algorithm>
int maximumGain(std::string s, int x, int y)
{
std::stack<char> st;
int ans = 0, a1 = 0, b1 = 0;
//first get the max points possible, by checking max points available
if (x > y)
{
//for each character in the string, c... | ALGO | 0.998523 | 4.57304 | {
"github_metadata": {
"branch": "main",
"commit_count": 159,
"repo_created_at": "2024-04-08T14:04: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": "f7fbde19a6... |
0791b8b7-612f-4c99-9780-43c9944b2f05 | AnanyaDas162/Code-Collection-Hacktoberfest2022 | LeetCode/C++/dfsTraversal.cpp | // C++ program to print DFS
// traversal for a given
// graph
#include <bits/stdc++.h>
using namespace std;
class Graph {
// A function used by DFS
void DFSUtil(int v);
public:
map<int, bool> visited;
map<int, list<int> > adj;
// function to add an edge to graph
void addEdge(int v, int w);
// prints DFS trav... | ALGO | 0.99999 | 5.682508 | {
"github_metadata": {
"branch": "main",
"commit_count": 828,
"repo_created_at": "2022-10-07T06:34:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 39,
"forks": 159,
"issues": 5,
"pull_requests": 19
},
"file_meta": {
"content_id": "209f71... |
a55a8818-e286-4dae-8044-26a3f2b5565b | kewook55/PS-BOJ | Implementation/17406-배열돌리기4(Simulation, BackTracking).cpp | /*
연산을 하지 않았을때 ans의 값을 지정해주면 안된다. 초기 배열의 값으로 최소값을 찾아주면 안된다.
*/
#include<iostream>
using namespace std;
struct Pair {
int r, c, s;
};
int n, m, k;
int test[55][55], ans, path[7];
Pair op[7];
bool check[7];
void sol() {
int ar[55][55];
for (int i = 1; i <= n; i++)for (int j = 1; j <= m; j++)ar[i][j] = test[i][j];... | ALGO | 0.999946 | 4.399478 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2020-05-28T06:31: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": "d1559e01... |
72e70c51-2336-4cd1-90f4-38d36cea8483 | lengfeng-bot/leetcode_review | leetcode/04_tree_basic.cpp | #include <iostream>
#include <vector>
#include <functional>
#include <deque>
#include <queue>
using namespace std;
// 定义二叉树节点结构
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};
/// <summary>
/// 释放二叉树
/// </summary>
void freeTre... | ALGO | 0.99985 | 3.767891 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-04-23T09:29:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53f9d4b7ca0... |
d00efef4-bd25-4a76-afc2-4cd10d723944 | klhui97/CS3391 | problems/week9 - maxflow/362 Winger Trial (UVa 11757) - Dinic.cpp | /*** System Library ***/
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib> // random
#include <ctime>
#include <climits> // all useful constants
#include <functional> // for hash
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <regex>
#include <string.h>
#include <stdio.h>
#i... | ALGO | 0.999692 | 3.80398 | {
"github_metadata": {
"branch": "master",
"commit_count": 132,
"repo_created_at": "2019-01-18T17:19:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03a65b6c... |
f1d8e3c8-eac2-44a2-a0e6-3db6494da3b7 | andrsd/godzilla | include/godzilla/TimeStepAdapt.h | // SPDX-FileCopyrightText: 2024 <NAME> <<EMAIL>>
// SPDX-License-Identifier: MIT
#pragma once
#include "godzilla/Types.h"
#include "godzilla/Vector.h"
#include "petscts.h"
namespace godzilla {
class TimeStepAdapt {
public:
enum Type { NONE, BASIC, DSP, CFL, GLEE, HISTORY };
struct Candidate {
Int o... | TOOL | 0.941601 | 7.001174 | {
"github_metadata": {
"branch": "main",
"commit_count": 2672,
"repo_created_at": "2018-03-01T15:27:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "82c163b04... |
573ac3b6-918b-44ac-afd8-9e5f09051157 | SunsetTeq/algoTinkoff2024 | Contest11/D.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
int main() {
int l, n;
cin >> l >> n;
vector<int> cuts(n + 2);
for (int i = 1; i <= n; ++i) {
cin >> cuts[i];
}
cuts[0] = 0;
cuts[n + 1] = l;
sort(cuts.begin(), cuts.end());
... | ALGO | 0.999931 | 4.353272 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-05-31T11:09:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "937fe1f93c... |
24ab748c-a9f9-4b51-acef-c8392d0467e8 | ishandutta2007/codeforces-f | frodakcin/normal/1034/A.cpp | #include <iostream>
#include <cstdio>
#include <ctime>
#include <bitset>
#include <cassert>
#include <vector>
using namespace std;
const int MAXN = 3e5 + 1000;
const int MAXV = 15e6 + 1500;
const int MAXV6 = MAXV/6;
const int PIV = 1e6;
typedef vector<int> vi;
int p[PIV], ps, loc[MAXV];
bitset<MAXV6 + 1> m1, m5;
... | ALGO | 0.999946 | 3.649684 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ed5faa625a3... |
a78d054e-1b61-49ee-a299-a2ad736f205a | Tausif121/Keep_Coding | Winner of an election - GFG/winner-of-an-election.cpp | // { Driver Code Starts
#include <iostream>
#include <map>
#include <algorithm>
#include <cstdlib>
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
//Function to return the name of candidate that received maximum votes.
vector<string> winner(string arr[],int n)... | ALGO | 0.999916 | 5.357937 | {
"github_metadata": {
"branch": "main",
"commit_count": 750,
"repo_created_at": "2022-01-17T13: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": "ab5ebb72f9... |
2129e696-0970-402e-a68d-d7ac0eca8a00 | AndyLi23/usaco | probs/gold/december_2017/hayfeast.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
using namespace std;
#define FOR(i, n) for(int (i) = 0 ; (i) < (n); ++(i))
#define FOR2(i, a, b) for(int (i) = (a); (i) < (b); ++(i))
#define FOR2R(i, b, a) for(int (i) = (b); (i) >= (a); --(i))
//RUNNING:
//g++ -O task.cpp
l... | ALGO | 0.999938 | 3.531944 | {
"github_metadata": {
"branch": "master",
"commit_count": 152,
"repo_created_at": "2020-09-27T17:44: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": "af171e31... |
bbbde988-3186-4699-bf6c-71b4f5a406d9 | lucadesabato/Discover2.0 | discover/scripts/duk/kmerhash.cpp | #include <assert.h>
#include <iostream>
#include <cstdlib>
#include <time.h>
#include "kmerhash.h"
using namespace std;
template<class ValueClass>
CKmerhash<ValueClass>::CKmerhash( int kmer): mersize(kmer), tablesize(0), numkeys(0) {
// mersize = 14;
nbits = 2*mersize;
tablesize = 1 << nbits;
loadingLimit = ... | ALGO | 0.963259 | 3.941669 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2022-09-28T18:51:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "912595bd7b6... |
b53a2bd5-8a52-4d92-990a-6e9f19239de6 | efrengaribaldi/Competitive-Programming | problems/prog-club/dijkstra.cpp | #include <iostream>
#include <unordered_map>
#include <list>
#include <queue>
using namespace std;
template<typename T>
class Graph {
private:
unordered_map<int, list<int, int>> m;
public:
void addEdge(int v, int u, int w) {
m[v].insert(make_pair(u, w));
m[u].insert(make_pair(v, w));
}
... | ALGO | 0.999286 | 3.707558 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-01-14T21:03: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": "6165c110f... |
9eeb6069-3e07-4783-8b8d-43c07da2fbc5 | teetangh/competitive-programming-and-dsa | GeeksForGeeks/Data Structures/Arrays/UinonOfTwoArrays.cpp | // { Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template in C++
class Solution
{
public:
//Function to return the count of number of elements in union of two arrays.
int doUnion(int a[], int m, int b[], int n)
{
... | ALGO | 0.999968 | 4.548009 | {
"github_metadata": {
"branch": "main",
"commit_count": 597,
"repo_created_at": "2020-01-11T16:55:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8b88f76bb... |
dd004f63-725e-45d4-9d99-0d83b053f9a8 | Githubiswhat/LeetCode | C++/src/Solution1001_1100/Solution1012.cpp | //
// Created by windows on 2023/3/10.
//
#include "Solution1012.h"
#include <functional>
#include <iostream>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <string>
using namespace std;
#include <bits/stdc++.h>
//int Solution::numDupDigitsAtMostN(int n) {
// int i = init(n);
// re... | ALGO | 0.999886 | 5.972986 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2021-02-02T12:56: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": "cfaadc55382... |
963d96d5-fc67-4aa0-8ab6-e756702faa06 | ssanjeev2424/CPP_PracticeCodes | codeforces/cf1.cpp | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define M 1000000007
#define MAXI 1000000000000001
lli dp[100001][2]; // idx, previous string reversed or not
lli cost[100001], n;
string str[100001];
lli solve(int,int);
int main() //CodeForces
{
cin>>n;
for(int i=0;i<n;i++) cin>>cost[i];
for... | ALGO | 0.99998 | 3.688851 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-11-15T12:40:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba102e5561... |
1cf1da6a-9c1e-40dc-8e24-943694daf9b5 | jiws829/omok | board.cpp | #include<stdio.h>
#include<Windows.h>
extern int first;
extern int primary; //시작을 컴퓨터가 하는지 표시하는 함수
void go(int x, int y) {
COORD pos;
pos.X = x;
pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
void print_board(int omok[][21]) {
int i, j;
printf(" ");
for (i = 1; i <= 19; i++) p... | ALGO | 0.998431 | 3.313282 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-04-09T14:25: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": "5ddcde9838... |
4f407f6e-91a5-422d-a144-4e6f56a47199 | arpit-batra/CompyPractice | InvertBinaryTree/InvertBinaryTree/main.cpp | //
// main.cpp
// InvertBinaryTree
//
// Created by <NAME> on 05/08/23.
//
#include <iostream>
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
struct TreeNode{
int val;
TreeNode *left;
TreeNode *right;
TreeNode():val(0),left(nullptr),right(nullptr){}
TreeNode(int x):val(x),le... | ALGO | 0.999985 | 5.825573 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2023-05-29T07:43: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": "e6845eaa9... |
a8c912fe-9114-41b7-93b2-fec823d63a47 | thrill/thrill | examples/tutorial/k-means_step4.cpp | /*******************************************************************************
* examples/tutorial/k-means_step4.cpp
*
* Part of Project Thrill - http://project-thrill.org
*
* Copyright (C) 2016 <NAME> <<EMAIL>>
*
* All rights reserved. Published under the BSD-2 license in the LICENSE file.
******************... | ALGO | 0.999631 | 6.255804 | {
"github_metadata": {
"branch": "master",
"commit_count": 4931,
"repo_created_at": "2015-04-24T14:05:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 580,
"forks": 82,
"issues": 44,
"pull_requests": 5
},
"file_meta": {
"content_id": "752d... |
5de6f3c2-daae-491c-a045-d695039245de | mejibyte/competitive_programming | UVa/10000 - Longest Paths/10000.3.cpp | /*
Accepted
*/
#include <queue>
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n;
int C = 1;
while (cin >> n && n){
int start;
cin >> start, --start;
vector<int> g[n];
int p, q;
while (cin >> p >> q && (p+q)){
--p, --q;
g[p].push_back(q);
}
... | ALGO | 0.997601 | 3.787794 | {
"github_metadata": {
"branch": "master",
"commit_count": 355,
"repo_created_at": "2011-10-27T01:25:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 196,
"forks": 66,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "db7ae... |
b11f2cc3-9a70-42d6-8780-587028862e07 | danilocb21/beecrowd | 2 - Ad-hoc/1547.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<ll> v64;
typedef vector<int> v32;
#define INF INT_MAX
#define LLINF LLONG_M... | ALGO | 0.99997 | 5.024076 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2022-07-16T19:06:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56a62d1ab9... |
48c80bdd-df20-4b95-a34c-075f84577023 | dsknaka/misc | atcoder/abc/116/d/main.cc | #include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<algorithm>
using namespace std;
int main()
{
int n, k;
cin >> n >> k;
vector<pair<int, int> > dt(n);
for (int i = 0; i < n; i++) {
int ti,... | ALGO | 0.999903 | 3.545031 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-11-22T14:17: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": "73e37b27e... |
bd44179b-03f0-45e2-abc1-3bbc836a0b3c | PashaKlybik/prog_953506 | Dubrovskiy-Konstantin/lab6/lab-6 var 11.cpp | #pragma hdrstop
#pragma argsused
#ifdef _WIN32
#include <tchar.h>
#else
typedef char _TCHAR;
#define _tmain main
#endif
#include <stdio.h>
#include <Windows.h>
#include <conio.h>
#include "Unit1.h"
int _tmain()
{
int arr[] = {10, 12, 8, 9, 7, 3, 4};
Node *root = Create(arr, 7);
printf("\n------ 1 tree ---... | ALGO | 0.988938 | 3.734741 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2020-03-25T15:38:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 18,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "3f1ff113... |
c138d54b-1052-46a5-9e88-07cb5d673360 | oikz/AVC_Project | robot.cpp | #include "robot.hpp"
int defaultLeft = 0;
int defaultRight = 0;
//Functions for returning if each of the sides has red pixels in a select location
bool leftChallenge(){
int leftPix = get_pixel(cameraView, 99, 2, 0);
if (leftPix > 220) {//Check if pixel is red and change leftRed to true if it is
return t... | TOOL | 0.994134 | 4.476433 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2020-06-01T11:24:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2298f05fe... |
fd81588c-81fb-4b88-ae95-1d610f8061fa | srd11/LeetCode_Solutions | 0023-merge-k-sorted-lists/0023-merge-k-sorted-lists.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 cmp{
public:
bool operator() (ListN... | ALGO | 0.999844 | 6.117256 | {
"github_metadata": {
"branch": "main",
"commit_count": 1243,
"repo_created_at": "2022-09-30T13:17:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19d6755ff... |
b5e84542-c8ca-4362-a7ba-31bd56152d59 | changhun/PS | 백준/그래프/01. DFS와 BFS(2160).cpp | //#include <stdio.h>
//#include <algorithm>
//#include <vector>
//
//using namespace std;
//
//const int MAX_N = 1000;
//const int MAX_M = (int)1e4;
//
//vector<vector<int> >adj;
//int start;
//int n, m;
//
//// 여기선 굳이 구조체 사용할 필요 없음.
//#if 0
//struct Queue {
// int node;
//}que[MAX_N + 2];
//int rp, wp;
//
//void push(... | ALGO | 0.999986 | 3.627673 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-05-24T22:13: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": "e3aa0f96ab8... |
fc7d0fa7-6362-4976-acae-e22767cd6027 | Nitishrai1/Data-Structures-Algorithms-BootCamp-Supreme-3.0 | LinkedList/DoublyLinkedList.cpp | // create a doubly linked list
#include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* prev;
Node* next;
Node(int data){
this->data=data;
this->next=NULL;
this->prev=NULL;
}
~Node(){
}
};
void createDLL(Node* &head,int data){
if... | ALGO | 0.999909 | 4.776898 | {
"github_metadata": {
"branch": "main",
"commit_count": 220,
"repo_created_at": "2024-06-01T13:59:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c1314ec75... |
ca4f5a9f-4cd4-4d2b-9eb6-d1f13327913d | RepoFIBtori/RepoFIBtori | Obligatories/Q1/PRO1/P10/P56635/prog1.cc | #include <iostream>
using namespace std;
struct Rectangle {
int x_esq, x_dre, y_baix, y_dalt;
};
void llegeix (Rectangle& r) {
cin >> r.x_esq >> r.x_dre >> r.y_baix >> r.y_dalt;
}
int relacio (const Rectangle& r1, const Rectangle& r2) {
if (r1.x_esq == r2.x_esq and r1.x_dre == r2.x_dre and r1.y_baix == r2.y_bai... | ALGO | 0.999632 | 3.581023 | {
"github_metadata": {
"branch": "master",
"commit_count": 675,
"repo_created_at": "2019-01-16T11:01:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 139,
"forks": 56,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1cfbf... |
8560b537-c968-4ba0-a117-a7c9be332a62 | EshitaJoshi/strings_extension | pair_coul_string.cpp | /* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
<NAME>, <EMAIL>
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with San... | ALGO | 0.983376 | 5.90717 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-11-16T15:03: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": "064b586a191... |
5e4c47b8-d1c8-4efe-a07a-82c2876413d7 | xqgao23/algorithm | 21_greedy_step/3_surf.cpp | /**
* Description:
* 小伟报名参加中央电视台的智力大冲浪节目。本次挑战赛吸引了众多参赛者,主持人为了表彰大家的勇气,先奖励每个参赛者m元。先不要太高兴!因为这些钱还不一定都是你的?!接下来主持人宣布了比赛规则:
* 首先,比赛时间分为n个时段,它又给出了很多小游戏,每个小游戏都必须在规定期限ti前完成(1<=ti≤n)。如果一个游戏没能在规定期限前完成,则要从奖励费m元中扣去一部分钱 wi,
* wi为自然数,不同的游戏扣去的钱是不一样的。当然,每个游戏本身都很简单,保证每个参赛者都能在一个时段内完成,而且都必须从整时段开始。
* 主持人只是想考考每个参赛者如何安排组织自己做游戏的顺序。作为参赛者,... | ALGO | 0.999963 | 3.10234 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2024-03-03T16:48:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56a2ab5f506... |
336d9f7a-3a70-4cdf-a9c8-85ca18bf1500 | go-row/myCppLab | LeetCode/LeetCodeJuneChallenge/Day-03(Two City Scheduling).cpp | //Approach-1
// Time: O(nlogn)
// Space: O(1)
//Priority queues can also be used to keep diff of a & b with idx - Space O(n) ~ {a[0]-a[1], idx};
class Solution {
public:
static bool comp(vector < int > &a, vector < int > &b){
return a[0] - a[1] < b[0] - b[1];
}
int twoCitySchedCost(vector<vector<i... | ALGO | 0.999994 | 6.259513 | {
"github_metadata": {
"branch": "master",
"commit_count": 130,
"repo_created_at": "2019-08-01T07:20:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "965cfdf5... |
23edb12c-9c2f-446e-8f0c-46a97776aaa7 | chmnchiang/bcw_codebook | Contest/MPF2016JapanOISelection/H.cpp | //a34021501 {{{
#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#define SZ(x) ((int)((x).size()))
#define ALL(x) begin(x),end(x)
#define REP(i,x) for (int i=0; i<(x); i++)
#de... | ALGO | 0.999942 | 3.810017 | {
"github_metadata": {
"branch": "master",
"commit_count": 361,
"repo_created_at": "2014-06-03T11:38:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 111,
"forks": 22,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac0c1... |
50b5f106-f354-41f7-b7d1-337f9b245bb0 | anubansal17/Coding-Career-Journey | RoadMap/50_MaxProductSubArray.cpp | /*
Approach 1: Generate all subarrays and then calculate its product, T.C - O(n^3)
Approach 2: By storing the maxProduct and minProduct so far, T.C - O(n), S.C- O(1)
- At every iteration, we will be having 3 choices out of which we gonna decide maxProd so far and min prod so far
- initialise ans, choice1 and choice2 as... | ALGO | 0.999992 | 6.153693 | {
"github_metadata": {
"branch": "master",
"commit_count": 901,
"repo_created_at": "2020-02-09T14:11:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7393760b... |
d63618c6-0701-4e5f-81af-abe7b635a3ab | hikimory/yandex_coderun | yandex_backend/43. Форматирование календаря/solution.cpp | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <unordered_map>
using namespace std;
void formatCalendar(int nDays, const string& weekday) {
unordered_map<string, int> weekdays = {
{"Monday", 0},
{"Tuesday", 1},
{"Wednesday", 2},
{"Thursday", 3},... | ALGO | 0.999723 | 5.144671 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2025-02-25T11:18:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bff09d69ae... |
c8e62b57-29ea-4f0f-8b42-3d22e454c0ba | GregWagner/UVa-Solutions | Competitive_Programming_4/Chapter_01_Introduction/01_Getting_Started_The_Easy_Problems/07_Easy/12554-A_Special_Happy_Birthday/main.cpp | /*
* 12554 A Speccial Happy Birthday
*/
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::vector<std::string> song = {
"Happy", "birthday" , "to", "you",
"Happy", "birthday" , "to", "you",
"Hap... | ALGO | 0.999318 | 4.56944 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2018-08-13T15:00: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": "88858ea3f... |
d91772ae-d3d6-4e7e-9c45-21dc9d67dcdb | RishabhRD/leetcode_problems | bi102/3.cc | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
... | ALGO | 0.999984 | 6.092104 | {
"github_metadata": {
"branch": "master",
"commit_count": 212,
"repo_created_at": "2021-07-09T10:41: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": "a5a804d2... |
d760cf15-bc8e-4fa8-bc55-2145d0620b4b | NYCUChengEn/NYCU-2021-Parallel-Programming | HW4/part1/pi_nonblock_linear.cc | #include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/types.h>
#include <unistd.h>
long long int Monte_Carlo(long long int each_toss, unsigned int seed){
long long int cnt = 0;
double x, y;
for(long long int i = 0; i < each_toss; ++i){
x = (double)rand_r(&seed) /... | ALGO | 0.999739 | 4.65702 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-01-29T15:48: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": "9c9a15c1a31e... |
ff1f9ce5-e2e9-41f0-a3a9-6ef2d2f98e32 | Anushka-bot/Codechef-Practice | SUBARRAYLEN.cpp | #include<bits/stdc++.h>
using namespace std;
typedef vector <int> vi;
typedef pair< int ,int > pii;
#define endl "\n"
#define inp(val) cin >> val
#define oup(val) cout << val << endl
#define all(v) v.begin(),v.end()
#define PB push_back
#define MP make_pair
#define FF first
#define SS second
#define ll long long
#defi... | ALGO | 0.999881 | 4.149696 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-01-12T16: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": "60e3f519491d... |
83272a1d-f57a-4e67-9f42-a1549f32a29c | mateog4712/Iterative-Spark | src/cmdline.cc | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef FIX_UNUSED
#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
#endif
#include <getopt.h>
#include "cmdline.hh"
std::string input_structure;
std::string parameter_file;
int dangle_model;
static char *package_name = 0;
const cha... | TOOL | 0.942868 | 5.038085 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-02-12T04:06: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": "cc6ae6c25fd... |
ac40811c-0676-4f98-81dd-b847fa598c82 | wlsh44/algorithm | boj/10828.cpp | #include <iostream>
using namespace std;
const int MAX = 10005;
int stack[MAX];
int pos;
void push(int num) {
stack[pos] = num;
pos++;
}
int pop() {
int res;
if (pos != 0) {
res = stack[pos - 1];
stack[pos - 1] = 0;
pos--;
} else {
res = -1;
}
return res;... | ALGO | 0.999089 | 4.63988 | {
"github_metadata": {
"branch": "master",
"commit_count": 378,
"repo_created_at": "2020-09-15T08:34: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": "0aede1a9... |
1310525d-7cbf-4cc7-a7be-7eb1443245d0 | Nikerersd/Laba3 | 2TaskNew.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <ctime>
#include <random>
using namespace std;
int Random(int min, int max) {
return rand() % (max - min + 1) + min;
}
int pow_mod(int a, int x, int p) {
int result = 1;
a = a % p;
while (x > 0) {
if (x % 2 == 1) {
res... | TEST | 0.987382 | 3.821237 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-04-09T12:56:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67aa93e3c303... |
6006002e-6708-4116-9955-1595e567a877 | maierta/MRPAPP | PartialPsimag/Symmetry/SymmetryElements2D.h | //-*-C++-*-
#ifndef PSIMAG_SymmetryElements2D_H
#define PSIMAG_SymmetryElements2D_H
/** \ingroup symmetryConcepts */
/*@{*/
/** \file SymmetryElements2D.h
*
* Contains 2D symmetry operations that are used to classify 2D space groups.
*
*/
#include <cstddef>
#include <limits>
#include <list>
#include <vecto... | ALGO | 0.985566 | 3.957776 | {
"github_metadata": {
"branch": "master",
"commit_count": 171,
"repo_created_at": "2015-04-15T15:37:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 7,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "c17e00e... |
e8447e55-ec9e-4976-811a-30a7a9aac833 | YathishGP003/Educational | cses/Introductory Problems/Tower of Hanoi.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
inline int nxt() {
int x;
cin >> x;
return x;
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n = nxt();
vector<pair<int, int>> ans;
function<v... | ALGO | 0.999236 | 3.527166 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-02-01T12:03:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31cf616448b... |
d55ceefc-aa82-4821-9c63-412faef4c553 | andryha-otec/Labs-PRO | Source.cpp | #include <mpi.h>
#include <iostream>
#include <string.h>
using namespace std;
int main(int argc, char* argv[])
{
int message;
int rank;
int size;
MPI_Status status;
int TAG = 0;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
if (si... | ALGO | 0.999624 | 3.783016 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-03-31T10: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": "fb123d7abd... |
830e38dc-fba3-4721-add8-90c287ebf95c | yushugg/OJ | leetcode/search-insert-position.cc | #include <cstdio>
class Solution {
public:
int searchInsert(int A[], int n, int target) {
int low = 0;
int high = n - 1;
int mid;
while (low <= high)
{
mid = (low + high) / 2;
if (target < A[mid])
high = mid - 1;
else if (target > A[mid])
low = mid + 1;
el... | ALGO | 0.999715 | 5.348706 | {
"github_metadata": {
"branch": "master",
"commit_count": 301,
"repo_created_at": "2013-03-11T11:39: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": "cc248c6f... |
1c83643c-3e0d-4258-852b-9b6b34c8fcd5 | votchallenge/trax | support/opencv/camshift.cpp | /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- */
/*
* This example is based on the camshiftdemo code from the OpenCV repository
* The main function of this example is to show the developers how to integrate trax
* support into their own programs.
*/
//#include <opencv2/tracking.hpp>
... | ALGO | 0.928475 | 6.035151 | {
"github_metadata": {
"branch": "master",
"commit_count": 547,
"repo_created_at": "2011-11-24T14:28:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 78,
"forks": 46,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "c974e7b... |
c7edbbdb-67c6-4497-9080-39cf8ec1d912 | moletop/leetcode_record | code/1.array/double_pointer/15.3_Sum.cpp |
#include<bits/stdc++.h>
using namespace std;
//三数之和 典型的双指针
class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int>> res;
int n = nums.size();
sort(nums.begin(), nums.end());
for(int i = 0; i < n; i++){
//if(nums[i] > 0 || n < 3) r... | ALGO | 0.9998 | 5.282713 | {
"github_metadata": {
"branch": "master",
"commit_count": 196,
"repo_created_at": "2021-04-28T09:14:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 59,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bff7b1b... |
67019fb3-3644-409a-a5d5-65d5ecbc6732 | WTU2/Projects | contactmanagementsystem.cpp | /*this program creates contacts and allows the option to display them through the use of a menu.*/
// side project/practice for C++
// 11/15/22
// program created by <NAME>
#include <iostream>
#include <vector>
#include <string>
#include <stdlib.h> /*allows the use of the exit(0) parameter*/
using namespace std;
/*al... | TOOL | 0.976872 | 3.444967 | {
"github_metadata": {
"branch": "Main",
"commit_count": 21,
"repo_created_at": "2022-11-16T08:10: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": "832142da93f... |
c7cacff8-ee36-49ca-aa47-9b994a3bd52d | Syed-Yousha/Fast-Nuces-Semster-3 | DS/Practice/Lab Mid/linked_list.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int val)
{
data = val;
next = NULL;
}
};
class Singly
{
public:
Node *head;
Node *tail;
Singly():head(NULL), tail(NULL){}
void insert_at_tail(int val)
{
... | ALGO | 0.998937 | 4.347758 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-30T17:49: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": "11ecacc89127... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.