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 |
|---|---|---|---|---|---|---|---|
acc648dd-3841-4e4a-ae80-be0ae743fce6 | donutloop/hackerrank | tree-level-order-traversal.cpp |
/*
class Node {
public:
int data;
Node *left;
Node *right;
Node(int d) {
data = d;
left = NULL;
right = NULL;
}
};
*/
void levelOrder(Node *root) {
int h;
h = height(root);
std::cout << root->data << "... | ALGO | 0.999984 | 4.738234 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-01-01T13:39:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83073932af4d... |
3c5d8bfe-72d8-41b5-924f-e63257fc6c71 | saveliyvasilev/cecar | chebi_sample/C++/util_bypen.cpp | #include <RcppArmadillo.h>
#include <stdio.h>
using namespace Rcpp;
using namespace arma;
// [[Rcpp::depends(RcppArmadillo)]]
const float PII = 3.14159265358979323846;
// [[Rcpp::export]]
float pnorm_cpp(float x)
{
// constants
float a1 = 0.254829592;
float a2 = -0.284496736;
float a3 = 1.4214137... | ALGO | 0.999406 | 4.987961 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2019-10-05T01:00: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": "57c2c6904... |
dd50340e-bddf-4f81-afe4-4dccc41333eb | NalinDalal/Leetcode | c++/216.NodesMaxNoGrp.cpp | /* https://leetcode.com/problems/divide-nodes-into-the-maximum-number-of-groups/?envType=daily-question&envId=2025-01-30
2493. Divide Nodes Into the Maximum Number of Groups
You are given a positive integer n representing the number of nodes in an
undirected graph. The nodes are labeled from 1 to n.
You are also give... | ALGO | 0.999937 | 6.290602 | {
"github_metadata": {
"branch": "main",
"commit_count": 395,
"repo_created_at": "2024-03-19T02:48:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c44a232c2... |
88e74d76-cc76-4f69-abc3-d9275bfe6c12 | Lai-YT/zero-code | a121(prime_again)/C++/prime_again.cpp | #include <iostream>
#include <cmath>
bool is_prime(int number) {
if(number == 2 || number == 3) {
return true;
} else if(number % 6 != 1 && number % 6 != 5) {
return false;
} else {
int ceil = sqrt(number);
for(int i = 5; i <= ceil; i += 6) {
if(number % i == 0 || number % (i+2) == 0) {
... | ALGO | 0.999882 | 4.712568 | {
"github_metadata": {
"branch": "master",
"commit_count": 278,
"repo_created_at": "2020-07-09T06:55: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": "2282878f... |
b067281d-8f8e-4788-b218-8acf0aa87633 | RGAA-Software/tc_3rdparty | webrtc/include/third_party/blink/renderer/core/css/seeker.h | #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_SEEKER_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_SEEKER_H_
#include <iterator>
#include "base/memory/stack_allocated.h"
#include "third_party/blink/renderer/core/css/rule_set.h"
namespace blink {
// Sequentially scans a sorted list of RuleSet::Interval<T> and seeks
//... | ALGO | 0.95259 | 7.643542 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2025-02-21T01:53: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": "7a6863bfa... |
d4961a3b-bbe4-4bd7-a9ab-7c128c90ffdf | Aleeshakurian/Datastructure | 4doubly.cpp | #include<iostream>
using namespace std;
class doubly
{
public:
int item;
struct node
{
node *prev;
node *next;
int data;
}*p;
doubly()
{
p=new node;
p=NULL;
}
void append();
void instbeg();
void instbw();
void delt(int);
void display();
};
void doubly::append()
{
node *temp,*r;... | ALGO | 0.999721 | 4.033663 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-11-16T17:21: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": "e0bd136fb2... |
b00e3487-86a7-4582-9553-1c82e6e0ad98 | Yawn-Sean/Daily_CF_Problems | daily_problems/2025/04/0421/personal_submission/cf1277d_tsreaper.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n; cin >> n;
vector<string> s(n + 1);
vector<int> vec[2];
int flag = 0;
unordered_set<string> st;
for (int i = 1; i <= n; i++) {
cin >> s[i];
if (s[i][0] != s[i].back()) {
vec[s[i][0] - '0'].push_b... | ALGO | 0.999744 | 3.905643 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "94fe... |
5ba20cbb-ec9b-44b8-9198-6c798dd52d18 | hotaery/leetcode | cpp/array/beautiful_tower_2.cpp | // https://leetcode.cn/problems/beautiful-towers-ii
#include "array/beautiful_towers_2.h"
#include "nlohmann/json.hpp"
#include "utils/print.h"
#include <sstream>
#include <stack>
#include <string>
namespace leetcode {
using std::vector;
using std::stack;
using std::max;
namespace _2866 {
class Solution {
public:
... | ALGO | 0.99997 | 5.894467 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2021-12-09T14:52:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d581fd1a... |
b3e638d1-f532-477d-a769-d36fd8f434be | swg209/Notes | Algorithm/code/C/LongestValidParentheses.cpp | /*https://leetcode.com/problems/longest-valid-parentheses/description/*/
#include<cstdlib>
#include<cstdio>
#define N 99999
// int longestValidParentheses(char* s) {
// /* 异常判断 */
// if(*s == '\0' || s == NULL)
// return 0;
//
// int frontIdx[N] = {0};
// int endIdx[N] = {0};
// int dp[N] =... | ALGO | 0.999797 | 4.467076 | {
"github_metadata": {
"branch": "master",
"commit_count": 139,
"repo_created_at": "2019-07-31T02:21:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f82445b6... |
648dbd69-3c17-4cd9-971d-d524f070983d | nojhan/paradiseo | moeo/src/distance/moeoEuclideanDistance.h | /*
* <moeoEuclideanDistance.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
*
* <NAME>
* <NAME>
*
* This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute... | ALGO | 0.998261 | 6.858482 | {
"github_metadata": {
"branch": "master",
"commit_count": 5554,
"repo_created_at": "2013-01-11T08:47:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 108,
"forks": 36,
"issues": 45,
"pull_requests": 4
},
"file_meta": {
"content_id": "45c... |
546dd701-8e93-4a53-bef9-80404d92d990 | gKevinK/LeetCode | 0001-0500/0140_Word_Break_II.cpp | class Solution {
void f(string & s, vector<vector<int>> & vvi, vector<vector<string>> & vv, int c) {
for (int & i : vvi[c]) {
if (i == -1)
vv[c].push_back(s.substr(0, c + 1));
else {
if (vv[i].empty() && !vvi[i].empty())
f(s, vvi, v... | ALGO | 0.999964 | 5.591166 | {
"github_metadata": {
"branch": "master",
"commit_count": 901,
"repo_created_at": "2017-12-25T05:10: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": "ec2e3aea... |
871e9279-2884-4cc2-a1c7-a0480b212696 | AnikSarker/ACM-Library | Math/Number Theory/Diophantine Equation.cpp | //Tested : LightOJ 1306 - Solutions to an Equation
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
// Diophantine equation : a * x + b * y = gcd(a, b)
// egcd computes one solution (x, y) for gcd(a,b) = g
// Note: computed value g can be negative.
// Given one solution (x0, y0), other solutions... | ALGO | 0.999917 | 4.291326 | {
"github_metadata": {
"branch": "master",
"commit_count": 1015,
"repo_created_at": "2018-06-13T04:49:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 306,
"forks": 118,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a7... |
f3907a48-a970-42dc-bd0a-7bdacf53eae1 | Filikec/competitive-programming | kattis/jurassicjigsaw.cpp | #include <iostream>
#include <list>
#include <vector>
#include <algorithm>
using namespace std;
typedef struct edge{
int from, to, weight;
} Edge;
list<Edge> Graph[20000];
int E;
Edge Edges[20000000];
string Strings[1000];
vector<Edge> Heap;
bool compare(Edge e1, Edge e2){
return e1.weight > e2.weight;
}
... | ALGO | 0.999987 | 3.5341 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-31T18:30: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": "ef38bd77be50... |
e20aa332-a520-412d-ae3b-5284aa263848 | kuzmichevdima/coding | dcj17_round1/c.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <iostream>
#include <cassert>
#include <cmath>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
#include <message.h>
#include "todd_and_steven.h"
//#include "sample3.h"
using namespace std;
#define... | ALGO | 0.999973 | 3.99136 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2016-03-15T22:53: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": "6b64fdd03... |
a7dc064f-045c-4bcd-9e90-31c43aab6b55 | Suvan77blr/POTDs_DSA | Mar2025/POTD_030625_LC_Missing_n_RepeatingVals.cpp |
// 060325
/*
2965. Find Missing and Repeated Values.
Given a 0-indexed 2D integer matrix grid of size n * n with values in the range [1, n^2].
- Each integer appears exactly once except 'a' which appears twice.
- An integer 'b' which is missing.
The task is to find the repeating and missi... | ALGO | 0.999669 | 5.328984 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2025-03-02T18:18: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": "d89f6b85755... |
9f6241a5-87f6-497f-8476-d9f3840839ef | bestzedcoder/algorithm | hard/Segment_Tree_Simulation.cpp | /*
Bài toán: Segment Tree Simulation
Mô tả:
Cho một dãy số nguyên dương (a_1, a_2, \ldots, a_n). Thực hiện một loạt các hành động theo các loại sau:
update i v: gán (a_i = v)
get-max i j: trả về giá trị lớn nhất của dãy con (a_i, a_{i+1}, \ldots, a_j)
Đầu vào:
Dòng 1: chứa một số nguyên dương (n) (1 <= (n) <= 100000)... | ALGO | 0.999953 | 5.379564 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2025-02-06T16:38: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": "8616565626... |
cf71b60e-7dbd-4e5d-8022-084e0d0b7483 | DivyamGarg-code/DSA_Problems | OOPS/12.Operator_Overloading_1.cpp | #include<bits/stdc++.h>
using namespace std;
// Operator Overloading
// Creating a fraction class to add 2 fractions and giving the simplified fraction
class Fraction{
private:
int numerator;
int denominator;
public:
Fraction(){
}
Fraction(int numerator,int denominator)... | TOOL | 0.964733 | 5.879138 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-09-12T18:50: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": "7f4fcca61dbe... |
25fe83bd-eed8-4ae8-85ee-c9911ffd6666 | thomasyzy7/CodingPractice | Knapsack DP/Talent Show.cpp | #include <bits/stdc++.h>
using namespace std;
#define inputJunk ios_base::sync_with_stdio(0); cin.tie(0);
#define pb push_back
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define debug cout<<"HERE"<<endl;
#define ell "\n"
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, in... | ALGO | 0.999983 | 3.6668 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2021-06-05T14:54: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": "f7e02f6790... |
fc8d2302-97fb-4ee5-a89e-93c7a54ed84d | Lamiiine/Competitive-Programming-1 | Solutions/UVA/01347 Tour.cpp | #include<bits/stdc++.h>
#define MAX 512
#define X real()
#define Y imag()
#define dist(a, b) (hypot((a).X - (b).X, (a).Y - (b).Y))
using namespace std;
typedef complex<double> point;
// points have to be sorted by strictly increasing x-coordinate in order for this solution to work!
point arr[MAX];
int n;
double memo[MA... | ALGO | 0.999705 | 3.707711 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-09-23T14:40:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "242f0446... |
c28744d0-3809-4089-aa55-0725350060e4 | SangharshSeth/CTCI-Solutions | Linked Lists/2.1.cpp | /*
* Que:-Write Code to remove duplicates form an unsorted list.
* Approach:-Use a map to keep track of duplicate values and when encountered rewire the last unique node to next of the repeated node
* Analysis:-This algorithm modifies the list in place with a Linear runtime O(N)
*/
#include<bits/stdc++.h>
using nam... | ALGO | 0.999954 | 5.127551 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2020-01-21T06:37: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": "74e0929af... |
2bec8184-a362-4838-8a1b-7ac57e22c84a | lbv/ffa-pc | ffa7-sam-loyds-puzzle-carnival-ii/j-jam/prg/jam.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
using namespace std;
#define Memset(m,v) memset(m, v, sizeof(m))
#define Clr(m) Memset(m,0)
#define Abs(x) fabs(x)
#define MAX_ROWS 3
#define MAX_COLS 4
template <typename T>
struct Matrix {
int r, c;
T m[MAX_ROWS][MAX_COLS];
Matrix(int... | ALGO | 0.999861 | 3.945436 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2012-06-16T10:25: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": "42de99353... |
186a1982-a7d4-454e-84ed-518079d8246d | Open-Bionics/Artichoke | OpenBionics_Artichoke/GripControl.cpp | /* Open Bionics - Artichoke
* Author - <NAME>
* Date - December 2015
*
* This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
*
* Website - http://www.openbionics.com/
* GitHub - https:... | ALGO | 0.9499 | 6.403895 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2016-01-11T14:04:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 43,
"forks": 21,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11487928... |
cd5569d0-dbf7-4009-b31b-84705e27baa7 | udaykkumar/play_ground | misc_play_lc/merge_two_binary_trees/solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999994 | 6.105233 | {
"github_metadata": {
"branch": "main",
"commit_count": 336,
"repo_created_at": "2021-02-13T15:06: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": "09b0bebd2a... |
ad8a7085-2b24-40b9-ab78-f24d0903c4be | N-E-W-T-O-N/DSA | MIKEANDEXAM.cpp | #include<bits/stdc++.h>
using namespace std ;
bool check(vector<int> a ,int k)
{
int sum =0 ;
for(auto x:a) sum+= x ;
bool t=((k==sum)?true:false) ;
//cout<<sum<<endl;
return t;
}
void print(vector<int> r)
{
for(int i=0 ;i<r.size();i++)
cout<<r[i]<<" ";
cout<<endl;
}
/*
void result(int t,... | ALGO | 0.999976 | 4.036942 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-23T07:07: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": "b339bb770dd6... |
f3b74ec4-b052-4278-b140-ebcb417d881e | prunusmume99/kuuniv.bigdata2025 | stl/student_example.cpp | // 학생들의 이름과 점수를 저장한 클래스로 벡터를 이용해서 정렬하는 프로그램.
// 정렬 기준은 내림차순(높은 점수가 앞에) 점수가 같으면 이름 오름차순
// algorithm 에서는 stable_sort 변경!
// 데이터는 1000.txt 테스트.
// 참고 - sort_fstream2.cpp
// 학점 grade private -> A(<=100), B(<90), C(<80), D(<70), F(<60)
// -> print() 에 표현 될 수 있게 변경.
#include <algorithm>
#include <fstream>
#include <iostream... | ALGO | 0.990954 | 4.852421 | {
"github_metadata": {
"branch": "main",
"commit_count": 94,
"repo_created_at": "2025-03-04T02:21: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": "4bffe84d021... |
5c935514-b889-45c0-84e9-f17fb262e4a5 | victoragnez/icpc-latin-america-brazil-solutions | 2015 Latin American Regional/J.cpp | #include <stdio.h>
using ll = long long;
constexpr int maxn = 5e3 + 10;
constexpr ll mod = 1e9 + 7;
ll fat[maxn], ifat[maxn], va[maxn], vb[maxn];
ll modpow(ll b, ll e) {
ll ret = 1;
while(e > 0){
if (e & 1) ret = ret * b % mod;
b = b * b % mod;
e >>= 1;
}
return ret;
}
ll invmod(ll val) {
retur... | ALGO | 0.999959 | 4.206344 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-11-15T02:45:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a88b3c56... |
74aa49ca-872d-406d-a1f0-d72dfa4e6a6f | 2BeAsh/HPPC_assignments | Assignments/3Assignment_particle/task_farm_not_working.cpp | /*
Assignment: Make an MPI task farm. A "task" is a randomly generated integer.
To "execute" a task, the worker sleeps for the given number of milliseconds.
The result of a task should be send back from the worker to the master. It
contains the rank of the worker
*/
#include <iostream>
#include <random>
#inclu... | ALGO | 0.992021 | 5.537147 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2024-02-07T12:07:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "615ac8a2aea... |
72839c70-1be0-4c66-92e4-bc6a70580d27 | DEBMALYASEN/program | hashmap/kthsmallest.c++ | #include <bits/stdc++.h>
using namespace std;
int findPivot(int a[], int start, int end)
{
int pivot = a[end];
int k = start;
for (int i = start; i < end; i++)
{
if (a[i] <= pivot)
swap(a[i], a[k++]);
}
swap(a[k], a[end]);
return k;
}
int findRandomPivot(int arr[], ... | ALGO | 0.999921 | 4.781263 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-07-26T06:22: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": "b6102a939d... |
3ff02e72-8c7d-4d67-ac49-f3eedb979c5f | rise-worlds/algorithm | leetcode/26-remove-duplicates-from-sorted-array.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int size = nums.size();
if (size == 0) return 0;
// auto iter = nums.cbegin();
// auto iter2 = iter++;
// while (iter != nums.cend() && iter2 != nums.cend()) {
// if (*iter2 == *i... | ALGO | 0.999964 | 6.00791 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2019-06-10T08:40:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bca1d0194... |
69c4b9e1-62bf-4f8c-b676-e8ffb32b0ba1 | amirmohammad34/Contact_manager | ContactClass.cpp | //
// ContactClass.cpp
// Final
//
// Created by <NAME> on 1402/10/27.
//
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstddef>
#include "ContactClass.h"
#include "Exceptions.h"
using namespace std;
Contact::Contact(const string & argName,const vector<string>&argNumbers,co... | TOOL | 0.949249 | 4.686498 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-08T13:38:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1c808c8ebda... |
0c5946a2-f8d8-4467-ba24-4b6e8eecb2c0 | willescamilla/CS385 | Stair/stairclimber.cpp | /*******************************************************************************
* Name : stairclimber.cpp
* Author : <NAME>
* Version : 1.0
* Date : October 1, 2020
* Description : Lists the number of ways to climb n stairs
* Pledge : I pledge my honor that I have abided by the Stevens Honor System.
****... | ALGO | 0.999479 | 5.706668 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-09-04T19:02: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": "b2210f082... |
824c58a8-2a2a-471a-9870-4da6aa84c139 | Sanjeev2487/accepted | BYTES12.cpp | /*
Written by : <NAME>
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,a,n) for(int (i) = (a); (i) <= (n) ; ++(i))
#define ROF(i,a,n) for(int (i)=(a);(i) >= (n); --(i))
#define SD(x) scanf("%d",&x)
#define pb push_back
#define mp make_pair
#define F first
#define S second
//#de... | ALGO | 0.999936 | 3.70968 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2016-10-21T20:23:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "850f8412e... |
ae44a7e2-00c9-4c13-88b1-cca072401e84 | HYEEWON/3D_Motion_Capture_2018 | ComputerMain/opencv.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
#include <windows.h>
#include <math.h>
#include "opencv.h"
#include "opengl.h"
using namespace std;
using namespace cv;
//Point3d cam1, cam2;
//Mat pt3D(3, 1, CV_64FC1);
cv::Mat mtx[MAX_CLIENT], dist[MAX_CLIENT], R[MAX_CLIENT], T[MAX_CLIENT], RT[MAX_CLIENT];
Point... | ALGO | 0.976537 | 3.737467 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2020-04-10T02:41:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41cf499d4... |
2804c596-aa9e-4e26-8d44-2560c87a8625 | nao9824/MT3_02_03 | main.cpp | #include <Novice.h>
#include "cmath"
#include <assert.h>
#include "imgui.h"
#define _USE_MATH_DEFINES
#include<math.h>
const char kWindowTitle[] = "LD2B_08_ワタナベ_ナオ_タイトル";
struct Vector3 {
float x;
float y;
float z;
};
struct Matrix4x4 {
float m[4][4];
};
struct Plane {
Vector3 normal;//法線
float distance;//距離
}... | ALGO | 0.990831 | 4.194566 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-05-23T04:45: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": "878f55243c... |
e98dddd9-0456-4dc5-925e-186556fcc5a2 | mridulcr7/5-April-2022 | Create text justification module.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<unordered_map>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int l;
cin>>l;
scanf("\n");
string s;
getline(c... | ALGO | 0.99999 | 3.193919 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-04-05T11:34:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9675d22ce74a... |
220169dd-472c-441e-8258-0ddc01dbe0e9 | bbang3/BOJ | 16562 친구비.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
const int MN = 1e4 + 5;
int p[MN], money[MN];
int N, M, k;
bool isfriend[MN];
int find(int n) { return p[n] == n ? n : p[n] = find(p[n]); }
void merge(int a, int b)
{
a = find(a), b = find(b);
if (a == b) return;
if (money[a] > money[b]) p[a] = b;
e... | ALGO | 0.999982 | 3.537913 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-07-30T05:57: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": "aa690db7c... |
93ce7252-bf0e-4dbe-a5df-e40c466a886c | li924579/ACM | 图论/最短路/POJ 3169 Layout.cpp | ////////////////////////////////////////////////////////
// // //
// Created by Team 3 //
// Copyright (c) 2015Äê Team 3. All rights reserved. //
/////////////////////////////////////////////////////////
#include <iostream>
#include <cstdio... | ALGO | 0.999933 | 3.67616 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2016-07-07T06:13:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4fd9766a... |
440f5020-1439-455e-ab42-1bf534644bf3 | kingang1986/shapematching | cppcode/swBMRM/bmrm-2.1/loss/rampndcgrankloss.cpp | /* Copyright (c) 2006, National ICT Australia
* All rights reserved.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (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.mozilla.org/MPL/... | ALGO | 0.990896 | 4.653654 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2015-04-19T15:35: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": "8a8040807... |
a03389c3-ba43-4481-9c06-5dc715e82037 | peterpaul2512/bai_tap_nmlt | bai_tap/bai_tap_mang_2_chieu/ma_tran_thuong/ky_thuat_dat_linh_canh_366_391/bai_389.cpp | // Bài 389: Liệt kê các dòng có nhiều số hoàn thiện nhất
#include <iostream>
using namespace std;
void inputMatrix(int matrix[100][100], int &rows, int &cols);
void printMatrix(int matrix[100][100], int rows, int cols);
bool isPerfectNumber(int num);
void listPerfectRows(int matrix[100][100], int rows, int cols);
... | ALGO | 0.999478 | 5.33327 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2025-03-18T13:56: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": "854bc0da194... |
e5aa0645-1ac8-43e4-a017-6a195bc358e0 | dadboss/All-CodeForces-Submissions | codeforces/1401/C.cpp | #include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define deb(x) cout<<x<<"\n";
#define deB(x,y) cout<<x<<" "<<y<<"\n";
#define Deb(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n";
#defi... | ALGO | 0.999631 | 3.966021 | {
"github_metadata": {
"branch": "master",
"commit_count": 974,
"repo_created_at": "2022-01-24T11:11:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07dcf65b... |
deb2bfc4-6867-46ef-8f86-80c5d6cbfcc8 | piandpower/vmpc | moduru/src/gui/geom/QuadCurve2D.cpp | #include <gui/geom/QuadCurve2D.hpp>
#include <gui/Rectangle.hpp>
#include <gui/geom/FlatteningPathIterator.hpp>
#include <gui/geom/Line2D.hpp>
#include <gui/geom/Point2D.hpp>
#include <gui/geom/QuadIterator.hpp>
#include <gui/geom/Rectangle2D.hpp>
#include <cmath>
using namespace moduru::gui::geom;
using namespace s... | ALGO | 0.994275 | 5.348968 | {
"github_metadata": {
"branch": "master",
"commit_count": 296,
"repo_created_at": "2018-01-27T05:42:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d39516c41... |
15324406-99de-4bd4-ac71-379633cd922a | dmgerman/csc116F20labs | Lab02/solution_code/count_alliterations_ex5.cpp | #include <iostream>
int main() {
int count {0};
bool in_allit {false};
char seq_start {' '};
std::string word {};
// read input word-by-word
// the program can either be in an alliteration or not in an alliteration
// the two states a program can be in are captured in the first "if-e... | ALGO | 0.998766 | 4.43273 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2020-09-09T22:44:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67694c713... |
b715c322-a126-4293-af91-035c9a0df140 | intel/hyperscan | src/nfagraph/ng_revacc.h | /*
* Copyright (c) 2015, Intel Corporation
*
* 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 and the follow... | TOOL | 0.976384 | 6.024015 | {
"github_metadata": {
"branch": "master",
"commit_count": 1317,
"repo_created_at": "2015-09-21T21:58:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5051,
"forks": 748,
"issues": 163,
"pull_requests": 29
},
"file_meta": {
"content_id": "... |
3afecf3f-5d57-461f-bca2-4172280fdddc | MereyPolatkhan/Algorithms_and_Data_Structures | ADS_2021/w3_Searching_Sorting/lab6/basic/_merge_quick/A.cpp | // Задача №766. Сортировка слиянием
#include <bits/stdc++.h>
using namespace std;
void mergebek_sortkhanov(int a[], int left, int mid, int right) {
int left_size = mid - left + 1;
int right_size = right - mid;
int left_Array[left_size];
int right_Array[right_size];
for (int i = 0; i < left_siz... | ALGO | 0.999997 | 5.625024 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2022-08-07T17:40: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": "18b07d8a2... |
7ac85ed7-3aed-4072-a110-799deddc7077 | smitdave/MASH-Main | MASH-dev/AmitVerma/MicroMacroMalariaSim_v2/src/microsim/House.h | /*
* House.h
*
*
*/
#ifndef HOUSE_H_
#define HOUSE_H_
#include<vector>
// Itamar edited 8/10/10
#include<cmath>
//
#include "Human.h"
#include "HumanV2.h"
#include "Distance.h"
#include "GlobalParameters.h"
using std::vector;
class Patch;
class Distance;
class location;
/**
* \brief A class to hold informatio... | ALGO | 0.966048 | 3.911492 | {
"github_metadata": {
"branch": "main",
"commit_count": 1926,
"repo_created_at": "2017-08-17T23:17:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40ae6527c... |
49cc994b-4416-47c4-9278-9a214e4567d9 | vladon/pngextractor | pngextractor.cpp | // pngextractor.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
constexpr uint8_t png_header[]{ 137, 80, 78, 71, 13, 10, 26, 10 };
constexpr size_t minimum_png_size{ 20 };
constexpr auto chunk_end_type{ "IEND" };
template <typename T>
T big_endian_to_little_endian(const std::vector<... | TOOL | 0.950912 | 5.547775 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-03-04T12:04: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": "68271c5c2e... |
afb64ee3-079f-4b5e-8fe3-a5a74d81cacd | waivek/object-oriented-programming | BigInt.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <iostream>
using std::max;
int get_max_len(char *, char *);
char* complement(char* , int );
class BigInt {
private:
static const int MAX_SIZE = 100;
char *ptr;
int positive;
public:
BigInt(char * c) {
ptr = (ch... | ALGO | 0.999861 | 3.790343 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2014-08-25T12:52:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a816cb781... |
d29cf0c5-816e-4905-828b-24603100905b | google/differential-privacy | cc/algorithms/bounded-standard-deviation.h | //
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... | ALGO | 0.995998 | 7.733382 | {
"github_metadata": {
"branch": "main",
"commit_count": 231,
"repo_created_at": "2019-09-04T13:04:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3184,
"forks": 382,
"issues": 11,
"pull_requests": 7
},
"file_meta": {
"content_id": "de5c9... |
bb3b6379-ea85-4449-88d2-bedd4bfa29ff | GeezFORCE/DataStructures | Doubly Linked List/reverse_doubly_linked_list.cpp | #include <bits/stdc++.h>
using namespace std;
struct node
{
int data;
struct node *prev;
struct node *next;
};
struct node *start = NULL;
int main()
{
struct node *creation();
void ins_node();
void rev_node();
void display_node();
int choice;
while (1)
{
cout << "MENU\n"
... | ALGO | 0.999023 | 4.609393 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2020-05-04T11:40:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b3b7138a... |
1fd0db8a-0925-4ab4-acfc-2ca615d5ffe6 | chat-code/leetcode-everyday | archive/202105/20210509_648/Yescafe.cc | // Runtime: 56 ms, faster than 74.37% of C++ online submissions for Replace Words.
// Memory Usage: 48.9 MB, less than 70.54% of C++ online submissions for Replace Words.
struct Trie {
Trie* nodes[26];
bool tail;
Trie() {
for (int i = 0; i < 26; ++i) {
nodes[i] = nullptr;
}
tail = false;
}
};... | ALGO | 0.999947 | 5.451645 | {
"github_metadata": {
"branch": "master",
"commit_count": 1880,
"repo_created_at": "2019-12-12T12:17:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "737d99af... |
17378d8a-e7e1-496b-8992-2667656779db | pmmms1226/PS_MS | 4.그래프/1865번-웜홀(벨만-포드).cpp | //#include<iostream>
//#include<algorithm>
//#include<cstdio>
//#include<vector>
//using namespace std;
//
//#define INF 987654321
//vector <pair<int, int>> v[501];
//int dist[501];
//int N, M, W;
//int main() {
//#ifdef _CONSOLE
// freopen("input.txt", "r", stdin);
//#endif
// int t;
// scanf("%d", &t);
// while (t--)... | ALGO | 0.999834 | 3.836373 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-01-12T15:12: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": "9a578db68... |
e9e1485d-5e55-4044-b62e-c4809b408124 | FinixLei/leetcode_finix | src/132_hard_PalidromePartitionII.cpp | /*
Given a string s, partition s such that every substring of the partition is a palindrome
Return the minimum cuts needed for a palindrome partitioning of s.
Example 1:
Input: s = "aab"
Output: 1
Explanation: The palindrome partitioning ["aa","b"] could be produced using 1 cut.
... | ALGO | 0.99999 | 6.090756 | {
"github_metadata": {
"branch": "master",
"commit_count": 241,
"repo_created_at": "2015-10-13T15:14:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36fc649b... |
5d630b12-9526-44a6-8bfa-c599b49bf1ce | Sourav-Tanwar/Data-Structure-with-C- | Tree/totalNode.cpp | /* PROGRAM FOR INSERTION, DELETION AND DISPLAY IN DOUBLY LINKED LIST*/
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
/* STRUCTURE OF NODE */
struct BTNode {
struct BTNode *LC;
int data;
struct BTNode *RC;
};
typedef struct BTNode BTNode;
BTNode* Create_newnode(int data)
{
BTNod... | ALGO | 0.999784 | 5.059148 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2021-10-20T15:23: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": "e4b596df20c... |
b7d73725-e225-45f8-931d-6281ce53888c | adshidtadka/algorithm | ant/chapter2/section3_動的計画法/exercise5_個数制限付き部分和問題/program2.cpp | #include <iostream>
using namespace std;
int n;
int a[101], m[101];
int k;
int dp[101][100001];
void solve() {
memset(dp, -1, sizeof(dp));
dp[0][0] = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j <= k; j++) {
if (dp[i][j] >= 0) {
dp[i + 1][j] = m[i];
}... | ALGO | 0.999995 | 3.614185 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2018-05-24T05:23: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": "ff52691d... |
a303f931-359e-43fe-8b42-e26ab4cdc69f | maierta/MRPAPP | PsimagLite/drivers/range.cpp | /** How to compile and run this driver
*
* Serial version:
*
* g++ -g3 -DNDEBUG -Werror -Wall -I../src -I../src/JSON \
* -I../src/JSON/JsonParser -lm -lpthread range.cpp -o range \
* /usr/lib64/libblas.so.3 /usr/lib64/liblapack.so.3
*
* And run it with:
*
* ./range
*
* Parallel version:
*
* mp... | ALGO | 0.937888 | 4.50807 | {
"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": "5df7478... |
8cee38aa-5181-4807-ab29-041ba829b79b | TaylonCosta/algoritmotcc | include/ACO.h | #include <list>
#include <iostream>
#include <vector>
#include <random>
#include "demandas.h"
#include "grafo.h"
#ifndef ACO_H
#define ACO_H
class Colonia : public Grafo{
public:
const int max_iteracao = 50; //numero maxino de iteracoes
const double tau = 1.0; //valor inicial do feromonio
c... | ALGO | 0.997294 | 4.17408 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-01-12T06:19: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": "5d9137b6dd... |
b889f472-ef06-4c7c-82e9-b645ba1ba9c2 | DebugMind/Algorithm | Algorithm/.ipynb_checkpoints/압축.c++ | # include <iostream>
# include <string>
using namespace std;
string str;
int find_open(int s, int e) {
for (int i = s; i < e; i++) {
if (str[i] == '(') return i+1;
}
return -1;
}
int find_close(int s, int e) {
int open = 1, close = 0;
for (int i = s; i < e; i++) {
if (str[i] == '(... | ALGO | 0.996925 | 4.011885 | {
"github_metadata": {
"branch": "main",
"commit_count": 319,
"repo_created_at": "2021-12-07T03:04:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e48715e7f2... |
7b05711d-2608-421c-9350-216363a3fbd3 | iamitshaw/codechef-practice-problem | beginner/FLOW004/main.cpp | #include <bits/stdc++.h>
int32_t sum_of_first_and_last_digit(int32_t number) {
/* define first_digit & last_digit */
int32_t first_digit {number % 10}, last_digit{0};
/* evaluate last_digit */
while (number != 0) {
/* processed_digit as last_digit */
last_digit = number % 10;
... | ALGO | 0.999761 | 5.85444 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-07-05T17:25:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36163450dc... |
fac46c6e-7070-4d52-a6fa-8ceaf4ae6304 | UNC-Robotics/mpt | src/mpt/uniform_box_sampler.hpp | // Software License Agreement (BSD-3-Clause)
//
// Copyright 2018 The University of North Carolina at Chapel Hill
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain... | TOOL | 0.922104 | 6.612897 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2018-09-26T17:10:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 81,
"forks": 32,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "22b26001... |
d683e4d0-6b16-4fcf-b9f9-8da223fb2d8d | ad-freiburg/pdftotext-plus-plus | src/ReadingOrderDetection.cpp | /**
* Copyright 2023, University of Freiburg,
* Chair of Algorithms and Data Structures.
* Author: <NAME> <<EMAIL>>.
*
* Modified under the Poppler project - http://poppler.freedesktop.org
*/
#include <algorithm> // std::sort
#include <cassert> // assert
#include <functional> // std::bind
#include <limits> /... | ALGO | 0.995949 | 5.239046 | {
"github_metadata": {
"branch": "master",
"commit_count": 197,
"repo_created_at": "2023-04-19T17:20:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 17,
"forks": 0,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "53602ebb... |
c43c1ea0-61c6-4876-b387-d252a5db8469 | JeraKrs/acm | codes/HDU/hdu5033+.cpp | #include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn = 2 * 1e5 + 5;
const double pi = atan(1.0) * 4;
struct point {
int idx;
double x, h;
point (int idx = 0, double x = 0, double h = 0) {
this->idx = idx;;
this->x = x;
this->h = h;
... | ALGO | 0.999888 | 3.91671 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2016-05-23T06:40:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fbdd4e58... |
981f0a11-1409-4cf6-a2f3-8bb764e23c98 | muralidharmaddali/GFG-160 | Sum Pair closest to target.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
vector<int> sumClosest(vector<int>& arr, int target) {
// code here
sort(arr.begin(),arr.end());
vector<int> ... | ALGO | 0.99987 | 6.278636 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2024-12-20T03:58:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a3471a2ec4... |
f579f280-4938-4e5c-9fce-7bd77b37063a | angryCar80/Pong-Game | main.cpp | #include <raylib.h>
#include <iostream>
int player_score = 0;
int cpu_score = 0;
class Ball {
public:
float x, y;
int speed_x, speed_y;
int radius;
void Draw() { DrawCircle(x, y, radius, WHITE); }
void Update() {
x += speed_x;
y += speed_y;
if (y + radius >= GetScreenHeight() || y - radius <= ... | TOOL | 0.934858 | 6.42461 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-29T22:36: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": "1b9c8ab62c95... |
9fd5878a-7e59-407f-be7b-49b741912d28 | 1779296311/leetcode | JZ56.cpp | /*********************************************
* ------------------------
* ------------------------
* file name: JZ56.cpp
* author : @ JY
* date : 2020--05--19
**********************************************/
#include <iostream>
#include <vector>
#include <stdlib.h>
using namespace std;
clas... | ALGO | 0.999991 | 4.924099 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-03-28T01:13: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": "b2603e035... |
32179679-6b72-4a2a-aab9-1f57220d78f1 | cricketjanoon/babar_450 | String/88_SmallestWindowWithDistinctChar.cpp | #include "../utilities.h"
/*
Generate all possible substrings.
Time Complexity: O(n^2)
Space Complexity: O(n)
*/
string SubStringWithDistinctCharacters_BF(string str){
int n = str.length();
unordered_set<char> distict_chars;
for(int i=0; i<str.length(); i++){
distict_chars.insert(str[i]);
}
... | ALGO | 0.999986 | 6.140261 | {
"github_metadata": {
"branch": "master",
"commit_count": 536,
"repo_created_at": "2021-07-23T17:18:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3de89511... |
939889a6-4f05-4db7-8a06-4a9f74d38cbe | jerry2137/Tree_comparison | tree.cpp | #include <iostream>
#include <time.h>
#include "AVLTree.h"
#include "SplayTree.h"
using namespace std;
const int N = 1000000;
inline int randopt() {
return rand() % 6 + 1;
}
inline int randval() {
return rand() % 10000;
}
int main()
{
srand(clock());
clock_t start, end;
double time[8];
int val = randval();
... | ALGO | 0.955731 | 3.820353 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-01-31T14:54: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": "9431e9ce5ea9... |
4016a54e-39ae-4922-b59c-3243a689a69a | SelmaAhmetspahic/CSC450_PortfolioProjectPart1 | concurrencycounter.cpp | #include <iostream>
#include <thread>
#include <mutex>
#include <condition_variable>
// Global variables for synchronization
std::mutex mtx; // Mutex to ensure only one thread accesses shared data at a time
std::condition_variable cv; // Condition variable to control the flow between threads
bool finishedCountingUp = ... | ALGO | 0.999536 | 7.085333 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-08T04:35:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3adabb5518b... |
59692594-7103-4961-a113-49bb3c95d8ed | Qixyimoe/Delta | Luogu/3855/3855.cpp | #include <bits/stdc++.h>
using i64 = long long;
constexpr int N = 5e5 + 7;
std::random_device rdv;
std::mt19937 myrand(rdv());
int n, m, rt, tx, ty, tz;
int rot[N];
struct node {
i64 val;
int rd, siz, ls, rs;
};
struct Treap {
int tim;
node tr[N << 8];
#define ls(o) (tr[o].ls)
#define rs(o) (tr[o].rs)
in... | ALGO | 0.999575 | 4.139229 | {
"github_metadata": {
"branch": "master",
"commit_count": 205,
"repo_created_at": "2024-07-30T05:57: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": "921eba34... |
65117a6c-e339-4b01-b47f-6a61e988aa54 | mrakmondal6612/DSA-Practice | Ajay/Array/Sub-Arr-Sum/printMaxSumOfEverySubArr.cpp | #include<iostream>
using namespace std;
// Print maximum sum of sub-arr in the array
void printMaxSumOfSubArray(int arr[], int n){
if(n <= 0) {
cout << "Array is empty !" << endl;
return;
}
int maxSum = arr[0];
// int maxSum = INT_MIN;
cout << "All sum of subArray is : " << endl;
... | ALGO | 0.999407 | 4.850504 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2025-03-15T19:09: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": "098a9b1915d... |
10272db3-992b-4b38-b931-8bebb1aded8d | Magic0Conch/CityEngine | engine/source/runtime/resource/config_manager/ConfigManager.cpp | #include "ConfigManager.h"
#include "runtime/core/base/macro.h"
#include <algorithm>
#include <string>
namespace EasyEngine {
void ConfigManager::initialize(const std::string &config_file_path){
// read configs
std::string parentPath = BINARY_ROOT_DIR;
std::ifstream configFile(config_fil... | CONFIG | 0.900994 | 4.949012 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-04-19T05:33:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21873c82dd34... |
8d88a06c-b48e-43a7-ad46-a22faba3efc2 | 5onyy/Competitive_Programming | VNOJ/Dynamic Programing/cond.cpp | #include <bits/stdc++.h>
#define maxn 20
#define Task ""
#define vt vector
#define pb push_back
#define pii pair <int, int>
#define mp make_pair
#define F first
#define S second
#define ll long long
#define mod 1000000007
using namespace std;
int n;
ll c[maxn][maxn], f[maxn];
ll dp[maxn][maxn];
void prepare()
{
f[... | ALGO | 0.999937 | 3.969059 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-08-11T16:18: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": "233cea361dc... |
c64d8bcf-6821-450c-bce6-b830ff37c724 | ishandutta2007/codeforces-s | syury/normal/1082/G.cpp | //#pragma GCC optimize("Ofast,unroll-loops,sched-spec-load-dangerous,no-stack-protector,peel-loops")
//#pragma GCC target("avx,tune=native")
#include<bits/stdc++.h>
#include<bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_ta... | ALGO | 0.999899 | 3.785853 | {
"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": "24099cf4cf28... |
77257a35-ae59-4373-b497-3cb2f79ea21b | arrg0m/problem-solving | kickstart/2020G/combination_lock.cc | #include <iostream>
#include <vector>
using namespace std;
#define N 1000000000L
int solve(vector<int> x, int n) {
long tmp, diff;
long mn = N * N;
for(int i=1; i<=n; i++) {
tmp = 0;
for(int curr: x) {
diff = i > curr ? i - curr : curr - i;
tmp += (diff > n - diff... | ALGO | 0.999946 | 3.880745 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2020-12-26T06:07: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": "bcb74c6e979c... |
fa9c57c5-0d9f-4a23-b042-7b3f84fa686c | nikolapesic2802/Programming-Practice | Hydrocontest/main.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define ll long long
#define pb push_back
#define sz(x) (int)(x).size()
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define D(x) cerr << #x << " is " <<... | ALGO | 0.999997 | 3.590829 | {
"github_metadata": {
"branch": "master",
"commit_count": 371,
"repo_created_at": "2018-11-05T15:11:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ecd84161... |
a42b5508-485b-4ecf-8727-18d3d4bf6fca | nbShawnLu/PAT | 1059.cpp | #include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <sstream>
using namespace std;
typedef vector<pair<long int, long int>> t_rs;
int main()
{
ios:... | ALGO | 0.999948 | 3.968542 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2016-07-27T16:58:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "156a909c8... |
af6c3f4a-a834-415f-9ab2-cb6be5f4e956 | lecopivo/cpp-wrangle | houdini/cpp/wrangle/example_cpp_wrangle_7237d037b87a291a4e57c426e96ed938.cpp | #include <iostream>
#include <cppvex/cppvex.h>
#include <hougen/hougen.h>
#include <houfem/houfem.h>
#include <GU/GU_Detail.h>
#include <SOP/SOP_Node.h>
using namespace cppvex;
extern "C" void callback(const float time, SOP_Node *node, GU_Detail *geo) {
// Set up VEX context
set_up_cppvex_context(time, node, n... | ALGO | 0.984402 | 5.549392 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-05-21T15:17:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 74,
"forks": 8,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "59504dca... |
69ca386d-791f-4099-a1b8-83ffc0301e8a | Omer283/CPSubmissions | Codeforces/Codeforces Global Round 19 - (E) Best Pair.cpp | #define _CRT_SECURE_NO_WARNINGS
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define fast ios::sync_with_stdio(false); cin.tie(0);
#define foru(i, k, n) for (int i = k; i < n; i++)
#define ford(i, k, n) for (int i = k; i >= n; i--)
#define ff first
#define ss second
#include... | ALGO | 0.99996 | 4.133718 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-05-07T13:13:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4da534a879d... |
c0d40f0c-3f96-4c4e-91d0-5fbb76fea635 | bylexus/adventofcode2019 | src/day_05.cpp | #include <iostream>
#include <sstream>
#include <fstream>
#include <math.h>
#include <vector>
#include "common.h"
#include "intcode.h"
using namespace std;
/**
* Day 5 - Sunny with a Chance of Asteroids
*/
int main(int argc, char *args[])
{
if (argc < 2)
{
cerr << "Error: give input file on comman... | ALGO | 0.943849 | 4.283915 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2019-11-29T19:39: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": "30470a8a0... |
c348fac5-6624-4771-9531-a57dab0f7407 | NLESC-JCER/eigensolverElemental | src/eigenValueSolver.cpp | //
// eigenValueSolver.cpp
// eigenValueSolver
//
// Created by <NAME> on 17/09/2019.
// Copyright © 2019 <NAME>. All rights reserved.
//
#include "eigenValueSolver.hpp"
namespace eigenValueSolver {
template <typename real> void eigenSolver<real>::initialise(El::Grid &grid) {
searchSpace.SetGrid(grid);
searc... | ALGO | 0.9998 | 6.0777 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-09-25T11:05:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 6,
"pull_requests": 1
},
"file_meta": {
"content_id": "03b28627315... |
f7ae3109-d68b-489c-a027-7e50a1d5935a | braeden/Cpp-NCC | 23_4.cc | #include <iostream>
#include <vector>
#include <time.h>
#include <stdlib.h>
#include <fstream>
#include <sstream>
using namespace std;
string unfilled;
string getWord(int index) {
ifstream infile;
string word;
string line;
int row;
row = 0;
infile.open("23_textfile.txt", ios::in);
while (getline(infile, line... | TOOL | 0.968715 | 3.078639 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-07-21T15:53:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9cadc659a... |
7b77fc7c-90d6-43e5-be4a-31c3d5ec490f | nithish642k/graph | unweighted graph/21)Flood fill algorithm(implement paint fill).cpp | /*
In MS-Paint, when we take the brush to a pixel and click, the color of the region of that pixel is replaced with a new selected color.
Following is the problem statement to do this task.
Given a 2D screen, location of a pixel in the screen and a color,
replace color of the given pixel and all adjacent same colored p... | ALGO | 0.99925 | 5.396271 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-08-01T15:11: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": "abe355e0b2... |
64e0b355-e917-4d96-9faa-535d9cf9e233 | Waqar-107/Codeforces | A-set/518A. Vitaly and Strings.cpp | /***from dust i have come, dust i will be***/
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define dbg printf("in\n")
#define nl printf("\n");
#define N 550
#define inf 1e9
#define sf(n) scanf("%d", &n)
#define sff(n,m) scanf("%d%d",&n,&m)
#define sfl(n) scanf("%I64d", &n)
#... | ALGO | 0.999993 | 3.087129 | {
"github_metadata": {
"branch": "master",
"commit_count": 1441,
"repo_created_at": "2017-02-23T10:29:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 208,
"forks": 91,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "cf82... |
78997019-fc96-482f-b715-7ee09be38ff2 | minhaz1217/My-C-Journey | OJ_UVA/notcompleted/10389 - Subway.cpp | #include<bits/stdc++.h>
//#include<iostream>
using namespace std;
#define check(a) cout << a << endl;
#define cc(a) cout << a << endl;
#define msg(a,b) cout << a << " : " << b << endl;
#define msg2(a,b,c) cout << a << " : " << b << " : " << c << endl;
#define MX 220
#define INF 500.00
double mat[MX][MX];
double weight[... | ALGO | 0.999645 | 3.482893 | {
"github_metadata": {
"branch": "master",
"commit_count": 365,
"repo_created_at": "2018-12-07T07:32:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78d3db40... |
396ffbd0-8cc8-4970-9c29-b20070c31409 | hyeunkim42/algorithm | baekjoon/BaaaaaaaaaaarkingDog_Basic/09/1926.cpp | #include <bits/stdc++.h>
using namespace std;
int paper[501][501];
bool visited[501][501];
int n, m;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int area = 0;
int cnt = 0;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n >> m;
int tmp;
for (int x = 0; x < n; x++) {
for (int y = 0; y <... | ALGO | 0.999935 | 3.655973 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2024-07-10T09:52: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": "9950571e363... |
f7bee4ce-2de2-48f1-8e58-9a490035b951 | Vandan121/VS-code | Coding/GeeksforGeeks/Maximize The Array.cpp | // { Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution {
public:
vector<int> maximizeArray(int arr1[], int arr2[], int n) {
// code here
map<long,long... | ALGO | 0.999982 | 5.264049 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-05-19T10:28: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": "25930faf7deb... |
305255f9-363b-4e22-afac-c11a74366245 | triSYCL/sycl | libcxx/include/__algorithm/move.h | //===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | TOOL | 0.983213 | 7.778886 | {
"github_metadata": {
"branch": "sycl/unified/master",
"commit_count": 461633,
"repo_created_at": "2019-04-01T18:29:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 120,
"forks": 21,
"issues": 46,
"pull_requests": 6
},
"file_meta": {
"con... |
d1022f39-07b1-4689-bdde-8f34014d59c8 | shawon-iitju-48/Problem-Solving- | CP/1702D.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,unroll-loops")
#define ll long long
#define lli long long int
#define ld long double
#define ull unsigned long long
#define ulli unsigned long long int
#define PI 3.1415926535897932384626433832795
#define sp ' '
#define pb push_back
#define ppb ... | ALGO | 0.999969 | 3.91544 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2024-12-06T20: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": "32b4ce7b21... |
214f22e4-93c6-47a9-9a3a-12edc8c05920 | shinpei0208/gdev | compiler/as/ptx2sass/ocelot/transforms/implementation/IPDOMReconvergencePass.cpp | /*! \file IPDOMReconvergencePass.cpp
\date Monday May 9, 2011
\author <NAME> <<EMAIL>>
\brief The source file for the IPDOMReconvergence class.
*/
#ifndef IPDOM_RECONVERGENCE_PASS_CPP_INCLUDED
#define IPDOM_RECONVERGENCE_PASS_CPP_INCLUDED
// Ocelot Includes
#include <ocelot/transforms/interface/IPDOMReconverg... | ALGO | 0.990575 | 5.832456 | {
"github_metadata": {
"branch": "master",
"commit_count": 574,
"repo_created_at": "2011-11-09T18:29:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 373,
"forks": 76,
"issues": 16,
"pull_requests": 0
},
"file_meta": {
"content_id": "1aa9... |
280ae63b-80a5-4a29-8ae9-e0b60f5b3204 | trialley/DataStructuresLabs | 他人代码_博/E7/未命名1.cpp | #include<iostream>
using namespace std;
template<typename T>
class chainqueue{
private:
struct chainnode{
T element;
chainnode* next;
chainnode* prev;
chainnode(){}
chainnode(const T& _element){element = _element;}
chainnode(const T& _element, chainnode* _next){
element = _element;
next = _next;
}
... | ALGO | 0.999987 | 3.459044 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2019-12-07T10:19: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": "2992ed219... |
36aa9d56-4911-4ba3-a9ad-18738d29f1b8 | luciocf/CP-Problems | Codeforces/1154G.cpp | // Codeforces 1154G - Minimum Possible LCM
// <NAME>
// Solution is the same as in editorial.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e7+10;
const ll inf = 1e18+10;
int a[maxn];
pair<int, int> pos[maxn];
int main(void)
{
int n;
scanf("%d", &n);
for (int i = 1; i... | ALGO | 0.999983 | 3.780389 | {
"github_metadata": {
"branch": "master",
"commit_count": 1082,
"repo_created_at": "2019-02-04T01:05:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4acbc4... |
58cae007-bd79-4df5-8674-13d08f408892 | carlin54/Snake | Path.h | //
// Created by richard on 30/03/18.
//
#ifndef SNAKES_PATH_H
#define SNAKES_PATH_H
#include "Global.h"
#include <exception>
using namespace std;
class PathException : public exception {
public:
enum Error{
CantGetDirection
};
PathException(Error e):
mError(e)
{
}
... | ALGO | 0.968249 | 4.218977 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-05-26T11:21: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": "db7acee9fd... |
dbe863d9-595b-4576-a012-98570bcb8470 | oboukli/misc-problem-solutions | test/sorting/insertion_sort_test.cpp | // Copyright (c) <NAME>. All rights reserved.
// Distributed under an MIT-style license that can be
// found in the LICENSE file.
// SPDX-License-Identifier: MIT
#include <array>
#include <catch2/catch_test_macros.hpp>
#include "forfun/sorting/insertion_sort.hpp"
TEST_CASE("Insertion sort", "[sorting][insertion_so... | TEST | 0.907911 | 7.208357 | {
"github_metadata": {
"branch": "main",
"commit_count": 822,
"repo_created_at": "2023-05-20T23:31: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": "7ab6452ce3... |
bcd2f8e1-5169-45e4-bd10-485f3f564a4e | ehedeman/CPP_08 | ex01/Span.hpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Span.hpp :+: :+: :+: ... | ALGO | 0.9016 | 4.824104 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-01-23T11:04: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": "21eb5107d4ef... |
5eae584d-8ce1-4d98-9c69-785ba14d136f | Rakhshan90/A2Z-DSA | 08_Bit Manipulation/15_Divisors_of_a_num.c++ | /*
Problem statement: Given an integer 'N', return all the divisors of 'N' in ascending
order.
*/
/*
Solution 1: Brute-force
1. This is the basic approach. As we know the possible candidates, we iterate upon all the candidates and check whether they divide the actual number.
2. If it divides, then it is one of the di... | ALGO | 0.999655 | 6.669842 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2023-09-05T07:42:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce93b72d7... |
ee4abdf3-23e0-441e-8782-8a855e915b40 | tumbaba/C- | AS백준/11727!.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main()
{
vector<unsigned long long> Arr;
Arr.push_back(1);
Arr.push_back(1);
Arr.push_back(2);
Arr.resize(1000);
vector<unsigned long long> Arr_back;
vector<unsigned long long> Arr_temp1;
Arr_temp1.push_back(1);
Arr_temp1.... | ALGO | 0.999943 | 3.660411 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2024-06-20T13:44: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": "9cb29a1895... |
c4565101-47b5-4914-8874-cc7daff4de1d | JavierIgnacioMorales/EjerciciosEnCPPuno | Ejercicio36/ejercicio36.cpp | #include <iostream>
#include <vector>
//#include <C:\Users\javier.morales\Desktop\javier\unahur\algoritmos\ejercicios\EjerciciosEnCPPuno\carga_matrices.cpp>
#include <F:\UNAHUR - ALGORITMOS\EjerciciosEnCPPuno\carga_matrices.cpp>
using namespace std;
void sumar_elementos_matriz(vector<int> &vector, int cant, matriz ... | ALGO | 0.996877 | 4.534406 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-09-15T01:24: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": "e606b7bf68... |
ef882d70-761b-402a-987e-5d2b798b3ee0 | MianAsmaarSafdar/DSA-LAB | Lab_5/Task_2.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int val) {
data = val;
next = nullptr;
}
};
Node* head = nullptr;
void insertAtPosition(int value, int position) {
Node* newNode = new Node(value);
if (position <= 0) {
cout << "I... | ALGO | 0.999364 | 6.145856 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2025-03-14T03:42: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": "44dd5e7016c... |
d0542196-bea2-47e5-a71c-f0f5dfe56444 | arnab000/Problem-Solving | codeforces/1138/A.cpp |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define Fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fo(a,b,c) for(int i=a;i<b;i+=c)
typedef pair<ll , pair<ll, ll> > pi;
int pow(int x,int y){
int res=1;
while(y){
if(y&1) res*=x;
... | ALGO | 0.999929 | 3.57295 | {
"github_metadata": {
"branch": "master",
"commit_count": 1170,
"repo_created_at": "2021-01-10T08:17:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e55d52a... |
51b7dbd7-1284-43e2-a79c-5f986fd51a59 | JyotinderSingh/Algorithms | Sorting/counting_sort.cpp | // doesn't work with negative numbers
#include <bits/stdc++.h>
using namespace std;
#define RANGE 255
void counting_sort(vector<int> &arr)
{
vector<int> count(RANGE + 1, 0);
vector<int> output(arr.size());
// store count of each character
for (auto num : arr)
{
count[num]++;
}
/... | ALGO | 0.999803 | 5.203851 | {
"github_metadata": {
"branch": "master",
"commit_count": 224,
"repo_created_at": "2019-06-18T07:40:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8aa0682... |
7a64c033-1829-48d9-ac3b-af37ecf040e6 | kvreinzapp/DataStructures_Algorithms | DS_for_Test/2_List/02_single/02_tail_head_insert/create_nonehead.cpp | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct LNode
{
int data;
struct LNode *next;
} LNode, *LinkList;
bool ListInit(LinkList &L)
{
L = NULL;
return true;
}
void ListPrint(LinkList L)
{
LNode *p = L;
while (p != NULL)
{
printf("%d ", p->data);
p... | ALGO | 0.997166 | 3.190689 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2022-07-20T12:01:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0bfc601c11... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.