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 |
|---|---|---|---|---|---|---|---|
827417d2-d466-4aed-8f60-15d5b9d63cf9 | KunjShah95/DSA-COLLEGE-CODE | q4/main.cpp | #include <iostream.h>
#include <conio.h>
// Turbo C++ doesn't fully support namespaces
#define MAX_SIZE 100 // Defining a maximum size for the stack
// Implementing a simple stack using an array
struct Stack
{
char data[MAX_SIZE];
int top;
};
void initialize(Stack *s)
{
s->top = -1;
}
int isEmpty(Stack... | ALGO | 0.999648 | 4.984141 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-01-04T02:38:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3947d9a949e... |
e1356b93-5616-48bf-a793-790563795ebe | skyellen/robwork-mirror | RobWork/ext/boostbindings/boost/numeric/bindings/lapack/posv.hpp | /*
*
* Copyright (c) <NAME> & <NAME> 2003
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* KF acknowledges the support of the Faculty of Civil Engineering,
* University of Zagreb, Croatia.
*
*/
#ifn... | ALGO | 0.997849 | 5.082421 | {
"github_metadata": {
"branch": "master",
"commit_count": 5380,
"repo_created_at": "2019-01-12T02:01:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c89d794... |
c8770637-7ecc-4c40-be35-5a513a2ede35 | GaussGreen/old-code | arm/Credit/ICMKernel/cair/credit_manager_lhp.cpp | #include "ARMKernel\glob\firsttoinc.h"
/* -----------------------------------------------------------------
-----------------------------------------------------------------
FILE: CREDIT_MANAGER_LHP.CPP
PROJECT: CAIR
#include "ARMKernel\glob\firsttoinc.h"
DESCRIPTION: implementation based on Large Homogeneous... | ALGO | 0.997448 | 5.444848 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-02-17T09:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d2156cf5b1a... |
d8576d2b-d732-4bf5-8ce0-1e72cf150494 | mit-gfx/6.4420-CompDesignFab | hw2_alternative/external/libigl-python-bindings/src/forward_kinematics.cpp | #include <common.h>
#include <npe.h>
#include <typedefs.h>
#include <igl/forward_kinematics.h>
const char *ds_forward_kinematics = R"igl_Qu8mg5v7(
Given a skeleton and a set of relative bone rotations compute absolute rigid transformations for each bone.
Parameters
----------
C #C by dim list of joint positions
B... | ALGO | 0.94804 | 6.698289 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-09-13T16:29:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3404053d394e... |
13639f21-5046-4f67-84bd-e59f3431e7bb | leoncwu/cpp_basics | lecture5_conditionals/ex1.cc | #include <iostream>
using std::cout;
using std::endl;
using std::cin;
// Assignment of <NAME> (cw34973)
int main(){
int input;
int residual1, residual2;
cout << "Please input the number for calculation:" << endl ;
cin >> input;
// cout << "Processing ..." << endl ;
residual1 = input%3;
residual2 = input%... | ALGO | 0.99883 | 3.771748 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-12-06T18: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": "bdb56f3d8b... |
a41d812a-f87d-492d-9e8f-e44e241ad28c | michaelarakel/acmp-solutions | Labyrinth (Prince of Persia) (0099).cpp | #include <fstream>
#include <vector>
#include <deque>
using namespace std;
struct node
{
int matrNum;
int x;
int y;
};
bool operator != (const node& a, const node& b)
{
return (a.matrNum != b.matrNum) || (a.x != b.x) || (a.y != b.y);
}
bool check (int a, int b, int c, int n, int m, int p)
{
return (a >= 0 && a... | ALGO | 0.999772 | 3.665123 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-10-08T18:21:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fcfd277aac... |
2f0309f1-72a1-440b-89f8-e3d5cc65798d | liuchaorun/cpp-homework | chapter two homework/6.cpp | //#include <iostream>
//using namespace std;
//
//class link_node{
//private:
// int num;
// link_node* next;
//public:
// link_node(int n=0,link_node* nt=0);
// int get_num();
// void set_num(int n);
// link_node* get_next();
// void set_next(link_node* ne);
//};
//
//link_node::link_node(int n,li... | ALGO | 0.999944 | 4.136153 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2017-10-07T06:40: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": "f986e1f78... |
7e0d5424-13a7-455a-b4a9-6c3c44d287c0 | nyankiti/algorithm_job | atCoderEnv/problems/tessoku-book/a70/a70.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
/* alias */
using ull = unsigned long long;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>; // 二次元vector
using vs = vector<string>;
using pii = pair<int, int>;
/* macro */
#define rep(i, a, n) for (int i... | ALGO | 0.999703 | 3.935942 | {
"github_metadata": {
"branch": "master",
"commit_count": 260,
"repo_created_at": "2021-02-01T09:33: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": "9973acdf... |
242c94c1-9c5a-469d-b5cc-a7f911b6411d | kartikp36/introduction-to-CS | data-structures/double_linkedList.cpp | // Double Linked list implementation in C++
#include <iostream>
using namespace std;
struct Node {
public:
int data, length = 0;
Node *previous, *next;
};
bool isEmpty(Node *head_ref) {
return (head_ref == NULL);
}
void insertAtBeginning(Node **head_ref, int value) {
Node *new_node = (Node *)malloc(sizeof(No... | ALGO | 0.999649 | 5.998786 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2020-08-08T15:46:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0aad26dff... |
4d55bad5-fcd2-4762-a508-bb4d6f07241c | byteZorvin/Competitive-Programming | 1. Activity Selection - GFG/1.-activity-selection.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the maximum number of activities that can
//be performed by a single person.
int activitySelection(vector<int> start, vector<int> end, int n)
{
// Your co... | ALGO | 0.999987 | 5.587379 | {
"github_metadata": {
"branch": "main",
"commit_count": 1248,
"repo_created_at": "2021-12-30T15:18:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ca0a6f7c... |
8bbe2784-f62a-4cdf-b358-fed835a244a2 | rueey/Solutions | gfssoc1s5.cpp | #include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
int INFINITE = 0x3f3f3f3f;
int R, C, S, B, K, M, T, V, c, r;
pair<int, int> snowflakes[55][55];
int dp[55][55][55][55];
int solve(int t, int col, int temp, int leftover){
if(t == R+1 || leftover == 0)
... | ALGO | 0.999727 | 3.784015 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-05-03T13:56:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68c01e922... |
adf02a07-b67c-4673-bd9a-e69a9e0568d5 | alexandraback/datacollection | solutions_2463486_0/C++/jdm/main.cpp | #include <cassert>
#include <string>
using std::string;
// Boost libraries available from www.boost.org
#include <boost/lexical_cast.hpp>
using boost::lexical_cast;
#include <iostream>
using std::cin;
using std::cerr;
using std::cout;
using std::endl;
#include <cstdlib>
using std::abs;
#include <cmath>
using std:... | ALGO | 0.999747 | 4.756725 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f336c2ed6... |
34e7cd4f-1b3b-488b-a7a9-306e28c6915e | azbyn/fundamentele | clatita-vs/clatita-vs/Source.cpp | /*
Laborator 1. 16
*/
#include "profanity.h"
#include "rect.h"
#include "point.h"
using namespace azbyn::profanity;
using azbyn::Rect;
using azbyn::Point;
#include "curses.h"
#include <iostream>
constexpr bool explicitMode = true;
struct Graphics {
static constexpr int pancakeBlockLen = 2;
enum Pairs {
PAIR_... | ALGO | 0.974835 | 5.452796 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2018-10-06T15:51: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": "044602bca... |
08ea15a6-b0fc-4cb5-8c1f-403ecd6cf62c | ishandutta2007/codeforces-k | kude/normal/1548/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < int(n); ++i)
#define rrep(i,n) for(int i = int(n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
template<class T> void chmax(T& a, const T& b) {a = max(a, b);}
template<class T> void chmin(T... | ALGO | 0.999517 | 3.959676 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "edc7f69f9c65... |
7e4f4663-9ac8-4195-98ed-fc3196c1cfb2 | sparsh2002/Placement-Course-cpp | Other-Courses/Aditya-Verma-Courses/DynamicProgramming/1_01_Knapsack_Recursion.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
int maxProfit = 0;
//Function to return max value that can be put in knapsack of capacity W.
void solve(int W , int wt[] , int val[] , int i , int profit , int n){
if(W<=0 or i... | ALGO | 0.999998 | 5.19033 | {
"github_metadata": {
"branch": "master",
"commit_count": 345,
"repo_created_at": "2021-09-08T12:52:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a14f4f8... |
c5e697cb-279f-4378-86b1-113dc264e570 | 7oSkaaa/LeetCode_DailyChallenge_2023 | 03- March/04- Count Subarrays With Fixed Bounds/04- Count Subarrays With Fixed Bounds (Ahmed Hossam).cpp | // Author: <NAME>
class Solution {
public:
long long countSubarrays(vector<int>& nums, int minK, int maxK) {
int n = nums.size(), minPos = -1, maxPos = -1, leftBound = -1;
long long res = 0;
for (int i = 0; i < n; ++i) {
// the index of the last invalid bound
... | ALGO | 0.999922 | 5.835125 | {
"github_metadata": {
"branch": "main",
"commit_count": 6874,
"repo_created_at": "2023-01-02T11:28:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 104,
"forks": 86,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "8c6486... |
6b04d0ac-f9b7-436a-824a-b336f47690e3 | alexeyden/whack | src/level/pathfinder.cpp | #include "pathfinder.h"
#include <cmath>
#include <unordered_set>
#include <set>
#include <unordered_map>
#include "level.h"
PathFinder::PathFinder(const Level* level)
: _level(level)
{
}
PathFinder::~PathFinder()
{
}
float PathFinder::heuristic(const point2i& from, const point2i& dst) const
{
return (dst - fr... | ALGO | 0.999666 | 4.588132 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-02-01T07:46: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": "5f409eaf6bb6... |
850063dd-c985-47f0-b03f-dc4ea1783598 | Griffan/FASTQuick | misc/bam/SamFilter.cpp | /*
* Copyright (C) 2010 Regents of the University of Michigan
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later v... | TOOL | 0.99807 | 7.109716 | {
"github_metadata": {
"branch": "master",
"commit_count": 610,
"repo_created_at": "2014-10-21T05:49:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "51917b0... |
3b87975d-1e1c-49a0-84ef-ea1b6a5f4247 | chimdiAnude-cca54/mechatronics_project | basic nav.ino | /*
Milestone 2: Basic Navigation
Team 27
Team Members: <NAME>, <NAME>, <NAME>
Last Edit (Author/Date): Ethan 04/12
HARDWARE CONNECTIONS:
PIN 3 & 4 -> Left H-Bridge Motor
PIN 5 & 6 -> Right H-Bridge Motor
WIRE COLOR CODE FOR BOARD:
Black - Vcc (6V Battery)
Yellow - Ground
Blue - Backward Signal
Green - Forward Sig... | ALGO | 0.963797 | 3.700388 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-04-10T00:48:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "877f14f93641... |
c3c017f2-924a-48a1-8139-b1a6fd71ff71 | codingwill/competitive-programming | _tes_TBA_Game.cpp | #include <bits/stdc++.h>
using namespace std;
struct Cpu
{
int angkatJari;
int sisaTangan = 2;
int tebakan;
};
int main()
{
srand(time(NULL));
int player;
Cpu cpu[3];
int sumJariAngkat = 0;
int sisaTangan = 2;
int tebakan, angkatJari;
int turn = 3;
int sumTangan;
int c... | ALGO | 0.953216 | 3.476521 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2019-10-06T03:28: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": "2d90bcf21... |
a07a5445-1841-43b6-bd9b-87f27cb74438 | chamale-rac/cpp-rasterizer | src/draw/polygon.cxx | #include "polygon.h"
#include "line.h"
#include <limits>
#include <algorithm>
#include <cmath>
namespace draw
{
namespace details
{
void polygon(gl::Framebuffer &fb, std::vector<gl::Pixel> &vertices)
{
for (std::size_t i = 0; i < vertices.size(); ++i)
{
... | ALGO | 0.967105 | 6.318594 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2023-07-08T01:08: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": "a5cd1eb8a06... |
fa7bbffd-bbd5-4404-be7d-ca3b58ce1715 | Hackur45/LeetCode | 112-path-sum/path-sum.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.999971 | 5.577296 | {
"github_metadata": {
"branch": "main",
"commit_count": 337,
"repo_created_at": "2025-02-04T09:30: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": "1c59f4b045... |
bf7d88e2-fd4d-4530-ae1d-9f30b980eb66 | hsson0822/Online_Judge | 백준/Silver/1051. 숫자 정사각형/숫자 정사각형.cc | #include <iostream>
using namespace std;
int N, M;
int square[51][51];
int bigger;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> N >> M;
for (int i = 0; i < N; ++i)
{
for (int j = 0; j < M; ++j)
{
char k;
cin >> k;
square[i][j] = k-'0';
}
}
for (int i... | ALGO | 0.999882 | 3.334125 | {
"github_metadata": {
"branch": "main",
"commit_count": 673,
"repo_created_at": "2023-10-17T13:25: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": "5798ff4703... |
2f0570ad-19dd-4f11-96de-7732684efea7 | actium/codeforces | 1200/60/1265a.cpp | #include <iostream>
#include <string>
void no_answer()
{
std::cout << -1 << '\n';
}
void answer(const std::string& v)
{
std::cout << v << '\n';
}
void solve(std::string& s)
{
const size_t n = s.length();
for (size_t i = 0; i < n; ++i) {
if (s[i] == '?') {
const unsigned u = (i > ... | ALGO | 0.999965 | 3.870222 | {
"github_metadata": {
"branch": "master",
"commit_count": 4876,
"repo_created_at": "2020-06-17T16:27:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26d9703... |
92278b23-247b-41d1-860c-73abe85f9409 | robinrb7/Parallel_Distribution | ParallelCPU/Parallel-AES-Algorithm-using-CUDA-master/AES.cpp |
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <cstring>
#include <chrono>
#define BYTE unsigned char
using namespace std;
class aes_block
{
public:
BYTE block[16];
};
void printBytes(BYTE b[], int len) {
int i;
for (i=0; i<len; i++)
printf("%x ", b[i]);
... | ALGO | 0.969134 | 3.148919 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2025-03-18T23:03: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": "19abbaf69b3... |
f1b49460-2e57-4505-bfa2-5aa9684e7876 | jimlinntu/gym | leetcode/114/main-postorder.cc | /**
* 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.999978 | 5.834156 | {
"github_metadata": {
"branch": "master",
"commit_count": 591,
"repo_created_at": "2019-10-09T14:58:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "ce6afbb4... |
a0a247f7-8719-42b9-b19d-eae50a6e9369 | raanki/CPP9 | ex02/PmergeMe.cpp | #include "PmergeMe.hpp"
#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <iterator>
// la suite de Jacobsthal jusqu'à n
std::vector<int> generateJacobsthalSequence(int n) {
std::vector<int> jacobsthal;
jacobsthal.push_back(0); // J_0 = 0
jacobsthal.push_back(1); // J_1 =... | ALGO | 0.999967 | 5.763251 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-08-28T11:08: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": "305646f697... |
e7babf2c-bff6-41e7-a6cb-da7da2f7b7c6 | Ginakira/Code-Archive | Leetcode/LeetCode654.cpp | // LeetCode 654 最大二叉树
#include <algorithm>
#include <numeric>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr),... | ALGO | 0.999991 | 6.715247 | {
"github_metadata": {
"branch": "master",
"commit_count": 2104,
"repo_created_at": "2019-11-10T06:03:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bdbebe6... |
b489306b-f784-4420-a35d-17101e72b43e | PaulLandaeta/balu-algorithms | Estructura-Datos/BIT/bit.cpp | // BIT 1D
int n;
int t[1000000], v[1000000];
int sum(int x) {
int result = 0;
for(int i = x; i >= 0; i = (i & (i+1)) - 1)
result += t[i];
return result;
}
void inc(int x, int delta) {
v[x] += delta;
for(int i = x; i < n; i = (i | (i+1)))
t[i] += delta;
}
// BIT 2D
/*int n, m;
int t[1024][1024], v[1024][... | ALGO | 0.999226 | 3.919724 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2015-12-29T15:17:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "113a8c7d9... |
9de84d92-35c1-46ee-b805-8a96fc258c9c | aman33459/ProgrammingContest | hackerearth/MayCircuit/7.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
#define error(args...) { string _s = #arg... | ALGO | 0.999848 | 3.781054 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2020-05-05T13:05: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": "4e3efbce6... |
6762ed21-837f-4a37-bdd1-3f1280b919c5 | Atrix256/MetropolisMCMC | main.cpp | #include <stdio.h>
#include <math.h>
#include <random>
#include <vector>
#include <array>
#include <conio.h>
static const float c_pi = 3.14159265359f;
template <size_t N>
using TSample = std::array<float, N>;
inline float Lerp(float a, float b, float t)
{
return a * (1.0f - t) + b * t;
}
template<typename T>
in... | ALGO | 0.999144 | 5.574184 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-05-13T03:16:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee1fe5a08... |
c899c40d-3cc6-413a-999d-627dd95966e8 | aayushi196/2DBiped | arduino_code/trajectory_generator.ino | void trajectory_generator_im(double theta1_init[3], double theta1_middle[3], double theta2_init[3], double theta2_middle[3], double tf){
a1_im[0] = theta1_init[0];
a1_im[1] = theta1_init[1];
a1_im[2] = theta1_init[2]/2;
a1_im[3] = (20*(theta1_middle[0] -theta1_init[0]) -(8*theta1_middle[1] + 12*theta1_init[1])*tf -(3*t... | ALGO | 0.999286 | 4.143678 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2021-03-22T07:22:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e44137ca43... |
9527dcf2-aeb3-435c-a16f-4f55ed415894 | Lucas-Henrique-Lopes-Costa/estrutura-de-dados | Estudos/Semana 4 - Heap/4-Pratica/6.cpp | /*
Questão 6: Torneio - Torneio alternado
Um torneio é uma árvore estritamente binária na qual cada nó não folha contém uma cópia do maior elemento entre seus dois filhos. O conteúdo das folhas de um torneio determina o conteúdo de todos os seus nós. Um torneio com n folhas representa um conjunto de n elementos.
Implem... | ALGO | 0.999982 | 4.843503 | {
"github_metadata": {
"branch": "main",
"commit_count": 123,
"repo_created_at": "2024-03-04T22:58:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a2a11e6f2... |
e75232e4-8522-4d69-9e06-d35211087aa5 | Shrey0601/CS202-Logic | Assignment 2/SAT_Solver.cpp | #include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define int long long
#define float double
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define vi vector<int>... | ALGO | 0.999795 | 4.037849 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-01-26T06:23: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": "97198cad61f... |
5ee719ec-932b-4c42-9596-9b2fc55be1d2 | DimGj/Approximate-Nearest-Neighbor-Search-with-GNNS-MRNG-LSH-Hypercube | LSH/misc.cpp | #include "misc.hpp"
/*Basic Pnorm for LSH algorithm*/
double PNorm(vector<byte>* A,vector<byte>* B,int p)
{
double sum = 0.0,diff = 0.0;
/*Both vectors must be of the same size*/
if(A->size() != B->size())
{
cout<<"Vector sizes do not match!"<<endl;
return -1.0;
}
/*iterate ov... | ALGO | 0.998158 | 3.247757 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-11-21T08:45: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": "8b7ecbf2d6c... |
2139671f-323c-4b29-b025-44c72f786550 | expertsleepersltd/distingNT_API | airwindows/src/ToneSlant.cpp | #include <math.h>
#include <new>
#include <distingnt/api.h>
#define AIRWINDOWS_NAME "ToneSlant"
#define AIRWINDOWS_DESCRIPTION "A super-transparent ‘tilt EQ’ with very low Q."
#define AIRWINDOWS_GUID NT_MULTICHAR( 'A','T','o','n' )
#define AIRWINDOWS_TAGS kNT_tagFilterEQ
#define AIRWINDOWS_KERNELS
enum {
kParam_One =... | ALGO | 0.909646 | 5.544326 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2025-02-07T08:46:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59d48459427... |
653d5e15-b972-4528-bede-9d91077dd25b | harinisangaran/E-Portfolio-TIS-02_2023 | SECJ1013 Programming Technique I/Lab Exercise 2/Set 3.cpp | //Set 3
#include <iostream>
using namespace std;
int main ()
{
string number;
int a, i = 0, sum = 0, multiply = 1;
cout <<"Enter an integer number: ";
cin >> number;
a = number.size();
while (a-1>=i) {
a--;
sum = 0 + (number[a] - '0');
multiply = multiply * sum;
}
a = number.size();
while (a-1>i)... | ALGO | 0.999302 | 3.285417 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2023-12-27T07:23:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "799a6ded1d... |
e84ea2b2-3dda-4107-b968-9317355addde | yassin64b/competitive-programming | CodeForces/techno1/C.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <set>
#include <map>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
int n;
cin >> n;
vector<int> a(n+1, 0);
int a12, a23, a13;
cout << "? 1 2" << endl;
fflush(stdout);
ci... | ALGO | 0.999867 | 3.027082 | {
"github_metadata": {
"branch": "master",
"commit_count": 786,
"repo_created_at": "2016-03-07T18:10: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": "77f52d71... |
f2fac0d3-fc34-4262-8bbd-77d7e77a8407 | vitillo/vectorization_benchmark | include/gemm.h | #ifndef GEMM_H
#define GEMM_H
#include "common.h"
void gemm(const scalar_t *A, const scalar_t *B, scalar_t *C, int M, int N, int K, int nmat);
template <int M, int N, int K>
void gemm_fast(const scalar_t *A, const scalar_t *B, scalar_t *C, int nmat, int base, int block_size){
for(int i = 0; i < M; i++){
for(in... | ALGO | 0.989112 | 5.740974 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2013-08-19T17:11:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41b45044a8... |
ddd928e2-8121-48a9-b018-33414a6b6d82 | ishandutta2007/codeforces-g | gtrhetr/normal/1149/D.cpp | #include<bits/stdc++.h>
using namespace std;
#define inf 1061109567
#define pii pair<int,int>
struct node { int t,v,next; }a[100010];
struct hhhh { int s,t,v; }h[210];
priority_queue<pii,vector<pii>,greater<pii> > q;
int dis[10000010];
int head[110],from[110],fa[110],size[110],id[110],n,m,A,B,tt,tot;
inline int rd(... | ALGO | 0.999436 | 3.456115 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cfdcacf156ea... |
67d85047-0ab6-45ea-b09a-33cff16b7c40 | Inuyashaaaaa/IntroductionToAlgorithmicContests | codeforce/Round #604/C.cpp | #include<bits/stdc++.h>
#define LL long long
#define ms(s) memset(s, 0, sizeof(s))
#define REP(i, a, b) for(int i = (a); i < (b); i++)
#define INF 0X7fffffff
using namespace std;
const int maxn = 4e5 + 10;
int num[maxn];
int cnt[maxn];
int main() {
// freopen("in.txt", "r", stdin);
// freopen("out.txt", "w",... | ALGO | 0.999863 | 3.334245 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2019-07-15T04:53: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": "59c0a941d... |
3318578d-ebb5-4970-b8ec-c3438e6d9a3f | Amylo-jh/baekjoon | 2000s/2021.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n, l;
cin >> n >> l;
vector <vector <int>> stations(n+1);
vector <bool> visited(n+1);
vector <vector <int>> line(l);
vector... | ALGO | 0.999992 | 4.016447 | {
"github_metadata": {
"branch": "master",
"commit_count": 1548,
"repo_created_at": "2021-11-02T12:40:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf438d7... |
a288a7f8-eafe-411e-bab6-590211086025 | noumanalisyed/OOP-Fall-2024 | prj-matrices/main.cpp | #include <iostream>
using namespace std;
class Matrix {
public:
Matrix(){
row = col = 0;
mat = NULL;
}
Matrix(int row,int col){
Matrix::row = row;
Matrix::col = col;
mat = NULL;
init();
}
void input(int **x... | ALGO | 0.998231 | 4.130268 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-10-25T05:59:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "742d4c7b2e5... |
c81e4019-693a-40e4-b67f-002b6e0f54bf | RobertMihail15/Passwords-Policies | main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <iomanip>
using namespace std;
class Policy{
protected:
bool isChecked;
public:
virtual void check(const string & parola)=0;
bool getCheck()const{
return isChecked;
}
};
class LengthPo... | ALGO | 0.99699 | 4.031806 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-18T23:05: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": "62c998b69367... |
b0c57191-ef88-4881-952d-405de1de234b | vitorguidi/Competitive-Programming | judges/uri/2323 - Mobile.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAXN 1000000000
vector< vector<int> > nodes;
vector<int> flag;
vector<int> peso;
string ans = "bem";
int dfs(int v){ //atualiza peso dos nodes pra levar em conta ele e tudo abaixo dele
int tam = nodes[v].size();
if (tam==0) return peso[v]=1; //se nao tem f... | ALGO | 0.999952 | 3.465824 | {
"github_metadata": {
"branch": "master",
"commit_count": 253,
"repo_created_at": "2018-05-13T17:40:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a03e065... |
c0de22fd-b630-4d54-8b30-1d43c2f79b7b | green901612/datadocs | cpp/perspective/src/cpp/dense_tree.cpp | /******************************************************************************
*
* Copyright (c) 2017, the Perspective Authors.
*
* This file is part of the Perspective library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
#include <perspecti... | ALGO | 0.910644 | 6.4113 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-12-21T08:40:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e6eb3cdb424... |
3ea1e24d-dd7a-4d2f-99fc-6193eac9790c | Linfanty/Code-in-Freshman | 线段树/线段树poj3468.cpp | //单点替换、单点增减、区间求和、区间最值
#include <cstdio>
#include <algorithm>
using namespace std;
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
const int maxn = 222222;
int MAX[maxn<<2];
int MIN[maxn<<2];
int SUM[maxn<<2];
int lazy[maxn<<2];
int max(int a,int b){if(a>b)return a;else return b;}
int min(int a,int b... | ALGO | 0.999613 | 3.811517 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-02-27T14:54: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": "785f41e96... |
f6b65212-bd75-4738-aaba-23a704f71da7 | fantasydreams/usually-coding | 冒泡法演示代码.cpp | /*
冒泡排序的基本演示
powered by Carol (luoshengwen)
2014-12-02
此代码适用于vs2010及其以上的编译器编译使用,在vc6.0需将提示错误的函数的_s去掉即可
*/
//头文件区
#include <stdio.h>
#include <stdlib.h>
//函数声明区:
void ReadData(int *p, int num);
void Print(int *p, int num);
void SortByBubbleMethods(int *p, int num);
int main()
{
int *p = NULL, n; //定义指针用来指向向操作系统申... | ALGO | 0.999782 | 3.732731 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2015-03-25T04:32: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": "64ce9d6d7... |
aafa5be8-58a0-4340-b710-37c328de37ed | dibyanshujaiswal1607/dsa-sheet | Recursion/09. M-color Problem.cpp | bool isValid(int node, int color, vector<int> &colors, bool graph[101][101], int n) {
for(int neighbour = 0; neighbour < n; neighbour++) {
if(graph[node][neighbour] and colors[neighbour] == color) {
return false;
}
}
return true;
}
bool solve(vector<int> &colors, bool graph[101][... | ALGO | 0.999904 | 4.924502 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-04-02T06:08:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec638c8ad6b... |
ad7ec0a5-26b7-4ee9-96dd-c44977aeae61 | tatyam-prime/kyopro_library | UnionFindMonoid.cpp | template<class S, auto op, auto e>
class UnionFindMonoid {
static_assert(std::is_convertible_v<decltype(op), std::function<S(S, S)>>,
"op must work as S(S, S)");
static_assert(std::is_convertible_v<decltype(e), std::function<S()>>,
"e must work as S()");
int _n;
std::... | ALGO | 0.9968 | 7.033382 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2019-03-30T15:23:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e33c34... |
efeed0c9-deb6-46a1-a579-c2651f5f8c1a | ShonPozner/Ex4---Searching-Algorithms-Server | BreadthFirstSearch.h | //
// Created by shon on 18.1.2020.
//
#ifndef EX4_SEARCH_ALGORITHMS_BREADTHFIRSTSEARCH_H_
#define EX4_SEARCH_ALGORITHMS_BREADTHFIRSTSEARCH_H_
#include "AbstractSearcher.h"
/**
* BreadthFirstSearch class.
* sort a Breadth First Search white a set and priority Queue
* new node that checking add one to the cost
*/
... | ALGO | 0.999827 | 4.429693 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2020-01-20T15:39: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": "997ad81ad... |
d4818f1a-265c-450f-a2fe-2e3a35001c78 | jeremynewlin/Accel | Accel/KDTreeStructs.cpp | #include "KDTreeStructs.h"
#include <iostream>
////////////////////////////////////////////////////
// KDTreeNode.
////////////////////////////////////////////////////
KDTreeNode::KDTreeNode()
{
left = NULL;
right = NULL;
is_leaf_node = false;
for ( int i = 0; i < 6; ++i ) {
ropes[i] = NULL;
}
id = -99;
}
K... | ALGO | 0.92177 | 5.630271 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2014-11-20T03:00:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 75,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19e614... |
4cae6e75-ec4a-4a75-afb5-edcd0fb61e2d | maverickreal/leetcode-solutions | 1186-maximum-subarray-sum-with-one-deletion/1186-maximum-subarray-sum-with-one-deletion.cpp | class Solution {
typedef long long ll;
typedef pair<ll, ll> pi;
#define vi(x) vector<x>
#define pb push_back
const ll mod = 1e9 + 7;
const char nl = '\n';
public:
ll sz, res;
unordered_map<ll, ll>ump, umpskip;
ll func(const vi(int)& v, ll in, bool skip) {
if (in == sz) {
... | ALGO | 0.999945 | 4.617813 | {
"github_metadata": {
"branch": "main",
"commit_count": 2587,
"repo_created_at": "2021-04-04T13:55:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "312983135... |
ddc2c7d7-2bc1-4166-b568-5c731342967b | ZYCSwing/CodeForces | Round #38/D.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <bitset>
#include <sstream>
#include <cstdlib>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <climits>
#i... | ALGO | 0.999826 | 3.880565 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2017-06-08T10:00:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60278798b... |
4ade30b3-7ee9-4968-80a6-a73f9acebac4 | ishandutta2007/codeforces-s | siganai/normal/7/D.cpp | #line 1 "test.cpp"
//#pragma GCC target("avx")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#ifdef LOCAL
#include <debug.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
using namespace std;... | ALGO | 0.999905 | 4.136147 | {
"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": "88bd01e0b962... |
f3f8c737-d0d2-4acd-8927-f22aa252c384 | Algebraic-Programming/OneStopParallel | src/scheduler/HDagg/HDagg_simple.cpp | /*
Copyright 2024 Huawei Technologies Co., Ltd.
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 in wri... | ALGO | 0.99975 | 5.79949 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2024-04-23T03:21:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "636cb78b40... |
2bc71343-fd34-4e38-9645-af537bba7323 | oeddyo/algorithm | tc/srm416_div2/1000.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | ALGO | 0.999874 | 4.98944 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2012-12-17T00:36:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 587,
"forks": 247,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "50fd3... |
6cbdafaa-73a0-461d-ab2e-768eebefe785 | madMAx43v3r/chia-plotter | test/chia_ref/calculate_bucket.hpp | // Copyright 2018 Chia Network Inc
// 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 in wr... | ALGO | 0.964622 | 5.175137 | {
"github_metadata": {
"branch": "master",
"commit_count": 532,
"repo_created_at": "2021-05-22T16:10:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2262,
"forks": 646,
"issues": 365,
"pull_requests": 7
},
"file_meta": {
"content_id": "4... |
bd9d227b-d201-4a71-b9be-57e17c2eb5ac | anand873/CP_Codes | Codechef/DOOFST.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<int> f(int s,int k,map<int,vector<int>> G,vector<int> K)
{
int i;
for(i=s;i<=min((k+s)/2,n);i++)
{
int j;
for(j=0;j<G[i].size();j++) K[G[i][j]]=1-K[G[i][j]];
}
return K;
}
int main()
{
int m;
scanf("%d%d",&n,&m);
... | ALGO | 0.999987 | 3.576548 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2019-08-26T13:11:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea895bb19... |
5b1b2e4e-1984-4992-86a2-d330e9c88a11 | ovibarac/SDA-MDO | MDO.h | #pragma once
#include <vector>
#include <iostream>
typedef int TCheie;
typedef int TValoare;
#include <utility>
typedef std::pair<TCheie, TValoare> TElem;
using namespace std;
class IteratorMDO;
typedef bool(*Relatie)(TCheie, TCheie);
#define MAX 400
class MDO {
friend class IteratorMDO;
private:
//... | TOOL | 0.973964 | 3.007076 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-05-08T09:26:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "969bef4080... |
83925c63-a029-4ce9-b649-b23a955bc80f | tarunsilam07/GREEKS-FOR-GREEKS | Difficulty: Easy/Find the element that appears once in sorted array/find-the-element-that-appears-once-in-sorted-array.cpp | //{ Driver Code Starts
// Driver code
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
int findOnce(int arr[], int n)
{
int low=0;
int high=n-1;
int ans=-1;
while(low<=high)
{
int mid=(low+high)/2;
if... | ALGO | 0.999361 | 5.414817 | {
"github_metadata": {
"branch": "main",
"commit_count": 610,
"repo_created_at": "2024-05-31T12:08: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": "1bcba4b778... |
2a3de69e-e1af-4662-a5c3-67bc33f7922d | Siddharthm10/Competitive-Coding-Repo | GFG/LinkedList/removeDuplicatesUnsorted.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
void print(Node *root)
{
Node *temp = root;
while(temp!=NULL)
{
cout<<temp->data<<" ";
temp=temp->next;
}
}
// } Driver Code Ends
/*
The structu... | ALGO | 0.999849 | 5.714266 | {
"github_metadata": {
"branch": "master",
"commit_count": 232,
"repo_created_at": "2020-06-30T12:33:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dbde9fad... |
6233f124-78d4-40c6-ba48-83b90a9d8ba9 | sakjdas/Intro2Ros_Quadruped_Project | src/controller_pkg/src/controller_node.cpp | #include <ros/ros.h>
#include <ros/console.h>
#include <tf/transform_datatypes.h>
#include <tf_conversions/tf_eigen.h>
#include <eigen_conversions/eigen_msg.h>
#include <mav_msgs/Actuators.h>
#include <nav_msgs/Odometry.h>
#include <trajectory_msgs/MultiDOFJointTrajectoryPoint.h>
#include <math.h>
#include <std_msgs/... | ALGO | 0.970044 | 5.043107 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2023-06-18T16:33:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3719a26b989... |
bffd3051-1d0b-4432-999e-5ac4569a8036 | vishu9897/Leetcode | Alien Dictionary - GFG/alien-dictionary.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:
string findOrder(string dict[], int N, int K) {
unordered_map<int,vector<int>> adj;
vector<int> indegree(K+1,0);
... | ALGO | 0.999979 | 5.257543 | {
"github_metadata": {
"branch": "main",
"commit_count": 1518,
"repo_created_at": "2022-08-22T03:55:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "269097e8b... |
23720c36-5831-404a-8980-61fbdf678c40 | Leonardo16AM/ICPC-WF-2023-UH-Top | Extended team reference/dynamic_programming/convex_hull_trick.cpp | /*
Dynamic hull for max dot queries
Recall this structure stores the upper hull of inserted points,
and not the whole convex hull, so be carefull with queries which
answers should be in the lower hull
Complexity:
- Add: O(log n)
- Query: O(log^2 n) but very fast in practice
Tested: http://codeforces.... | ALGO | 0.99941 | 5.071233 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-07-24T13:30:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13f18fc8a32... |
e2e3de7e-56e6-4d7f-ba2c-131ad7c98d57 | thetkidd/2120linked | List.h | /*
* Name: <NAME>
* Date Submitted: 2/1/19
* Lab Section: 001
* Assignment Name: Lab 2 Linked List
*/
#pragma once
#include <iostream>
#include <string>
#include "Node.h"
using namespace std;
//This class represents a linked list of node objects
//Do not modify anything in the class interface
template <class T>... | ALGO | 0.98951 | 5.139213 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-08-06T01:12: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": "ab0a5cec6909... |
0ad12e94-9a11-48c9-aa4c-7a83545962ba | raincross7/code-similarity | codes/train_code/problem479/problem479_489.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
#define N 200005
int dp[1001][1001];
void c_p_c()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
int ways(int r, int c) {
... | ALGO | 0.999954 | 4.632696 | {
"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": "67969cb4c344... |
35fe4b83-0cae-42ec-b9b3-093f9c8ac44d | ICS3U-Programming-JaydenS/Unit-3-04-CPP | integer.cpp | // Copyright (c) 2025 <NAME> All rights reserved.
// Created by: <NAME>
// Date: March 19, 2025
// This program tells the user if a number is positive or negative
#include <iostream>
int main() {
// First I define my variables
int userNum;
// Then I get the number
std::cout
<< "What is your nu... | ALGO | 0.968874 | 3.521098 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-25T17:42:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "983fa5422b4ce... |
2b27fdbc-d02e-46c0-99c4-b54b365fe711 | Ga-byeol/Coding-Test | 백준/Silver/4963. 섬의 개수/섬의 개수.cc | #include <iostream>
#include <string>
#include <sstream>
using namespace std;
int dx[8] = {0,0,1,-1,1,-1,1,-1};
int dy[8] = {1,-1,0,0,-1,1,1,-1};
int mx;
int my;
int land;
bool visited[51][51];
int map[51][51];
void dfs(int x,int y)
{
visited[x][y] = true;
for(int i=0;i<8;i++)
{
int nx = x +... | ALGO | 0.999357 | 4.233196 | {
"github_metadata": {
"branch": "main",
"commit_count": 725,
"repo_created_at": "2022-10-24T01:51: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": "ce03165874... |
9c3cf364-71b8-4e3c-a33d-1b3809de8fac | diegogasparcruz/matematica-computacional | Trabalho02/dual/Dual.cpp | #include <ilcplex/ilocplex.h>
ILOSTLBEGIN
int main(int argc, char* argv[]) {
if(argc < 2){
cout << "é necessário passar o caminho para um arquivo" << endl;
return 1;
}
IloEnv env;
try {
IloModel modelo(env);
IloInt qtdOrigens, qtdDestinos, ultimaLinha;
... | ALGO | 0.999648 | 4.638367 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-06-25T17:19: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": "9ced59723a... |
4ef2b7db-3cc3-4bbd-8fe8-cd4148f50a4c | niranjan-2024/Leetcode | 2402-meeting-rooms-iii/2402-meeting-rooms-iii.cpp | class Solution {
public:
int mostBooked(int n, vector<vector<int>>& meetings) {
sort(begin(meetings), end(meetings));
vector<int> meetsCount(n, 0);
priority_queue<pair<long long, int>, vector<pair<long long, int>>, greater<pair<long long, int>>> occupied;
priority_q... | ALGO | 0.999997 | 5.930234 | {
"github_metadata": {
"branch": "main",
"commit_count": 2037,
"repo_created_at": "2023-02-09T17:05:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b09d82f57... |
d58afd93-fc4f-47b4-b613-94245cfefa0a | ishandutta2007/codeforces-c | cxy07/normal/1406/E.cpp | //Code By CXY07
#include<bits/stdc++.h>
using namespace std;
//#define FILE
//#define int long long
//#define ull unsigned long long
#define LL long long
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define fst first
#define scd second
#define inv(x) qpow((x),mod - 2)
#define lowbit(x) ((x) & (-... | ALGO | 0.999832 | 3.105885 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "351e21b32052... |
823b1319-055d-4378-882b-198a960c4dd6 | Athulpai12/Generic-Segment-tree | test_case.cpp | #include<iostream>
#include <set>
#include "segment_tree.hpp"
int main()
{
std::function<int(int,int)> adder = [](int a, int b)->int
{
return a+b;
};
std::function<int(int,int)> sub = [](int a, int b)->int
{
return a-b;
};
std::function<double(double,double)> multiplier = [](double a, double b)->double
{
r... | ALGO | 0.943941 | 4.845759 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-03-11T18:10:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "921e373dce... |
72b62c46-0727-426b-8f14-15a075a988ba | tonywang663/interview | validparenthesis.cpp | #include <iostream>
#include <cassert>
#include <string>
#include <vector>
#include <stack>
using namespace std;
bool isValid(string s) {
int len = s.length();
vector<char> vec(len);
int j = 0;
for(int i = 0; i <= len - 1; i++){
if(s[i] != '{' && s[i] != '}' && s[i] != '(' && s[i] != ')' && s[i] != '[' && s[i]... | ALGO | 0.99935 | 4.945695 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-08-15T21:46:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8fe1adbb6a... |
1ee3e21c-2b3a-4394-aa96-1766b18f055c | Jiongyu/code_exercise | 1_duplicate.cpp | /**
* @file demo.cpp
* @author your name (<EMAIL>)
* @brief 在一个长度为n的数组里的所有数字都在0到n-1的范围内。
* 数组中某些数字是重复的,但不知道有几个数字是重复的。也不知道每个数字重复几次。
* 请找出数组中任意一个重复的数字。
* 例如,如果输入长度为7的数组{2,3,1,0,2,5,3},那么对应的输出是第一个重复的数字2
* @version 0.1
* @date 2020-04-02
*
* @copyright Copyright (c) 2020
*
*/
#... | ALGO | 0.998946 | 4.534709 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2020-04-03T02:58:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba73993b6... |
97cf8c9b-cb30-4c6f-b722-407a336ca5fc | DarshanGhorpade/GFG-POTD | 2024/July/09_07_2024_ClosestThreeSum.cpp | /*
Problem Link ---> https://www.geeksforgeeks.org/problems/three-sum-closest/1
Difficulty ---> Medium
Given an array, arr of integers, and another number target, find three integers in the array such that their sum is closest to the target. Return the sum of the three integers.
Note: If there are multiple solution... | ALGO | 0.999984 | 6.28042 | {
"github_metadata": {
"branch": "main",
"commit_count": 247,
"repo_created_at": "2024-04-13T12:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "edc8924ef6... |
0e7a8c54-d6c1-4e16-a29a-e7d8d91c61ee | DelaraJ/Codes_Coursera | Algorithmic Toolbox/7_maximum_salary/largest_number.cpp | #include <algorithm>
#include <sstream>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
bool compare(int a, int b)
{
return a<b;
}
string largest_number(vector<int> a) {
vector<int> one;
vector<int> two;
vector<int> three;
int thousand_count=0, flag=0;
for (int i=0; i<a.size... | ALGO | 0.999732 | 4.817901 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-06-27T19:32:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b97e06531... |
184d0415-6fec-41e6-b7ca-5aad80c00afe | Shell-Wataru/AtCoder | kakomon/dwacon5th_prelims_c.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <climits>
using namespace std;
using ll = long long;
int solve()
{
ll n,q;
string S;
cin >> n >> S >> ... | ALGO | 0.999533 | 3.559722 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2017-04-23T13:44: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": "eb7a2c4c9... |
1db348a2-5674-4f1f-9429-1589f237073e | lidaiqing/UVA | 10801.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <queue>
#include <sstream>
#include <string>
#include <utility>
#include <set>
using namespace std;
struct node{
int f,e;
};
class comp{
public:
bool operator() (const pair<int,node> &lhs, const pai... | ALGO | 0.999803 | 3.856553 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-01-14T04:37: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": "e53ccc6b88... |
49e426e2-7595-4555-9b0d-5f79b1757a1b | oss5824/practice | 정렬/11067.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int T, N, M;
pair<int, int>res[100001];
vector<int>v[100001];
int main()
{
cin.tie(NULL); cout.tie(NULL); ios::sync_with_stdio(false);
cin >> T;
while (T--) {
cin >> N;
int bef = 0, n = 1;
for (int i = ... | ALGO | 0.999938 | 3.852625 | {
"github_metadata": {
"branch": "master",
"commit_count": 800,
"repo_created_at": "2020-12-16T12:26: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": "e8bbb689... |
f238fc6f-368e-4a7c-810c-6d13c8c12668 | Rysul119/Cryptography_RSA | misc/randGen.cpp | #include <iostream>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;
cpp_int power(cpp_int x, cpp_int n);
cpp_int randomGen(int range);
int main()
{
int bitsize;
cpp_int randomNumber;
srand(time(... | ALGO | 0.999184 | 4.302007 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-10-08T21:55:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac086f8f8... |
d1456281-fd84-4573-86ab-b6e7a41176e0 | bitbouncer/bb-monitor | programs/client-proxies/bb-monitor-dd-log-proxy/main.cpp | #include <cstdlib>
#include <iostream>
#include <chrono>
#include <boost/bind.hpp>
#include <boost/asio.hpp>
#include <boost/program_options.hpp>
#include <openssl/md5.h>
#include <kspp/sources/mem_stream_source.h>
#include <kspp/utils/env.h>
#include <kspp/topology_builder.h>
#include <kspp/utils/env.h>
#include <bb_m... | WEB | 0.912373 | 6.108188 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-08-06T09:47:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6f9c59169b... |
415e3f9d-8fc5-457c-a31b-4ec3f94c74cf | le-incroyable1-dev/competitiveProgramming | leetcode/1020.cpp | #include <bits/stdc++.h>
using namespace std;
static auto _______ = [](){
// turn off sync
std::ios::sync_with_stdio(false);
// untie in/out streams
std::cin.tie(nullptr);
return 0;
}();
class Solution {
public:
void dfs(vector<vector<int>> &g, int i, int j){
int n = g.size();
... | ALGO | 0.999961 | 5.829004 | {
"github_metadata": {
"branch": "main",
"commit_count": 463,
"repo_created_at": "2021-04-19T05:06:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea889e57b3... |
46d0fc2a-d9cc-4301-b3af-5216730a222a | PhanNgocTrieu/Problem_Solving | _leet_code/weekly/contest-402/3185_CountPairsThatFormACompleteDayII.cpp | /*
Given an integer array hours representing times in hours,
return an integer denoting the number of pairs i, j where i < j and hours[i] + hours[j] forms a complete day.
A complete day is defined as a time duration that is an "exact multiple" of 24 hours.
For example, 1 day is 24 hours, 2 days is 48 ho... | ALGO | 0.99948 | 5.680373 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2024-04-30T05:28: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": "68e6b7ec2... |
722d6a2f-1fcb-4e17-a293-e830070b9fba | Animesh-roy100/Leetcode-Solutions | 0421-maximum-xor-of-two-numbers-in-an-array/0421-maximum-xor-of-two-numbers-in-an-array.cpp | class TrieNode {
public:
TrieNode* child[2];
TrieNode() {
child[0] = nullptr;
child[1] = nullptr;
}
};
class Trie {
public:
TrieNode* root;
Trie() {
root = new TrieNode();
}
void insert(int num) {
TrieNode* temp = root;
for(int i=31; i>=0; i--) {
... | ALGO | 0.999967 | 5.813961 | {
"github_metadata": {
"branch": "main",
"commit_count": 1652,
"repo_created_at": "2024-06-01T11:34: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": "9657ef789... |
d9a58b2d-ce59-4877-a7b4-47a90fbb7552 | gokulmaran/SDE | DSA/03) Strings/Basics/IsomorphicStrings.cpp | #include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
//Link: https://leetcode.com/problems/isomorphic-strings/description/
class Solution {
public:
bool isIsomorphic(string s, string t) {
unordered_map<char, int> m1, m2;
int s1 = s.length();
int s2 = t.length(... | ALGO | 0.999861 | 6.070766 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-08-05T16:30:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f7b50b9d356... |
267afd8e-298e-46df-a780-c51db92ee131 | bfraboni/aoc2024 | day12/main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <cmath>
#include <bitset>
#include <unordered_map>
#include "../common/timer.h"
// AoC Day 12: https://adventofcode.com/2024/day/12
// Part 1: Walls and equivalence class.. Union Find; compute fences cost as area * perimeter and sum f... | ALGO | 0.999129 | 4.998542 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-12-05T17:46: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": "34d5b947385... |
86490a3f-f794-4396-b84e-5e108caa1a6f | JIDoctor-alt/vsc | 代码集合/2020训练/2/zhidaohuanlong.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<string>
#include<queue>
using namespace std;
using pii = pair<int,int>;
struct edge
{
int to,le;
};
int N,K,S,D;
map<string,int> id;
map<int,string> nm;
vector<vector<edge> > g;
vector<int> Rc,pre;
vector<int> totalPeo;
vector<int> num,d... | ALGO | 0.999886 | 4.261049 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2021-01-08T08:19: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": "ec129e938... |
5a87c89c-3627-43d1-ad2d-2c9a39845f25 | dlp-wanghaoyuan/Code | Algorithm/4-DP/bag/322_coinChange1.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
vector<int> dp(amount + 1, amount + 1);
dp[0] = 0;
for (int w = 1; w <= amount; w++) {
for (int coin : coins) {
if (w - ... | ALGO | 0.999967 | 4.905897 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-07-14T15:04: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": "4403cafa9181... |
14adca81-9a4c-4002-acc8-5c55c536a21a | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/03/0329/personal_submission/cf743e_tsreaper.cpp | #include <bits/stdc++.h>
#define MAXN 1000
#define MAXA 8
#define INF ((int) 1e9)
using namespace std;
int n, ans, A[MAXN + 5];
int f[1 << MAXA], g[MAXN + 5][MAXN / MAXA + 5][MAXA + 1];
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) scanf("%d", &A[i]);
for (int j = 1; j <= n / MAXA + 1; j++)... | ALGO | 0.999912 | 3.49385 | {
"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": "694d... |
8f4da7fd-3f3e-4eaa-a6bb-f884b22977ca | feliposz/hackerrank-solutions | data-structures/disjoint-set/components-in-graph.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'componentsInGraph' function below.
*
* The function is expected to return an INTEGER_ARRAY.
* The function accepts 2D_INTEGER_ARRAY gb as parameter.
... | ALGO | 0.999557 | 4.827805 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2022-03-10T08:32: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": "d333a1af2... |
216624fd-88e0-4ea1-9d6f-d2696f2a29cb | JairMendoza/Cplusplus | Practicas/Registrar Libros.cpp | /*DESCRIPCOION: EL ALGORITMO CONSISTE EN UN PROGRAMA IMPLEMENTADO PARA UNA BIBLIOTECA, CUYA FUNCIONALIDAD ES PERMITIR TENER UNA BASE
DE DATOS DE LOS LIBROS QUE SE TIENEN, DENTRO DE LAS PRESTACIONES QUE TIENE EL PROGRAMA ES DAR DE ALTA LOS TITULOS, LES PERMITE
VISUALIZAR LOS TITULOS QUE SE TIENEN, PERMITE LA BUSQUEDA PO... | TOOL | 0.996172 | 4.079571 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-01-20T02:02: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": "77cafa616a5f... |
ed3626c3-6748-403e-893e-f33990ca4828 | Tiramisu-Compiler/tiramisu | benchmarks/tensors/mttkrp/mttkrp_generator.cpp | #include <tiramisu/tiramisu.h>
#include <string.h>
#include "mttkrp_wrapper.h"
using namespace tiramisu;
/*
* The goal is to generate code that implements the reference
* mttkrp_ref.cpp
*/
void generate_function(std::string name, int size)
{
tiramisu::init(name);
constant N("N", size);
var iB("iB",... | ALGO | 0.992785 | 4.725255 | {
"github_metadata": {
"branch": "master",
"commit_count": 3856,
"repo_created_at": "2016-05-09T13:33:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 944,
"forks": 136,
"issues": 38,
"pull_requests": 7
},
"file_meta": {
"content_id": "6b8... |
15e8cb4b-ff95-4038-bf8e-8f762dbd0c86 | tmuttaqueen/MyCodes | Online Judge Code/codeforces/Codeforces Round #460 (Div. 2)/919C.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;
const double pi = 3.141592653589793;
#define xx first
#define yy second
#define mp make_pair
#define intl long long
#define f... | ALGO | 0.999947 | 3.680778 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-01-27T09:25: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": "c6f21a207f... |
e60fc5c0-2997-4fdc-9424-d60c505e5179 | shahidul2k9/problem-solution | uva online judge/11636 - Hello World!.cpp |
#include <string.h>
#include <cstdio>
#include <climits>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <sstream>
using name... | ALGO | 0.999132 | 3.635885 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2014-05-04T17:13:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 51,
"forks": 57,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c66a93b... |
a648e2df-a65e-49ab-b91c-fc9915fa5799 | Asmit-Mohan/Data-Structure-Algorithms | Binary Search Tree/Largest BST.cpp | /* Approach 1 Brute Force Time :- O(N^2) Space :- Auxiliary Stack */
class Solution
{
public:
bool solve(Node* root,long minRange,long maxRange)
{
if(root==NULL)
{
return true;
}
if(root->data>=maxRange||root->data<=minRange)
{
r... | ALGO | 0.99999 | 6.233537 | {
"github_metadata": {
"branch": "main",
"commit_count": 1249,
"repo_created_at": "2022-01-07T11:51:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a9a804ff... |
c5af96f3-0804-4d46-adfe-1f63717ef104 | Dayrker/LeetCode | Exercise/3222.求出硬币游戏的赢家.cpp | /*
* @lc app=leetcode.cn id=3222 lang=cpp
*
* [3222] 求出硬币游戏的赢家
*/
#include<string>
using namespace std;
// @lc code=start
class Solution {
public:
string losingPlayer(int x, int y) {
// 75: x个, 10: y个
// 0 <= coinX <= x, 0 <= coinY <= y
// total: 115 = coinX * 75 + coinY * 10
//... | ALGO | 0.999955 | 4.848647 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-05T14:17: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": "ea175c4e02b5... |
fa9ac47d-199a-437e-97e4-508965464bb1 | cygnus2/dynQLMU1 | CODES2/u1link_Tevol.cpp | #include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include "define.h"
#include<iostream>
#include<algorithm>
#include<vector>
#include<iterator>
/* according to the rules of cpp, the variables are declared here
* and also in the header file as extern such that they are avl to
* the other functions.
*/
int *next... | ALGO | 0.999738 | 3.188244 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2018-06-03T10:36:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "74e0b403... |
6774c9d1-588d-4fc4-9921-80e2a859a44e | adityasuman10/CUDA-SOUL | Core Parallel Algorithms/Radix_Sort.cpp | #include <iostream>
#include <cuda_runtime.h>
#include <thrust/scan.h>
const int BITS = 4;
const int BINS = 1 << BITS;
__global__ void computeHistogram(int *input, int *histogram, int n, int bit) {
extern __shared__ int sHist[];
int idx = blockIdx.x * blockDim.x + threadIdx.x;
// Initialize shared memory... | ALGO | 0.999986 | 6.126649 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2025-04-30T19:32:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a41122b028a... |
4e082fd6-e85e-4974-9039-5b4beeade9cd | amanullahtariq/ParkingSpaceDetection | pcl_project/Build/ParkingSpaceDetection.h | #pragma region Libraries
#include "stdafx.h"
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "MyLines.h"
#include "LineRelationsAngle.h"
#include "LinesByLength.h"
#include "MidPointRelations.h"
#include "ParkingSpots.h"
#includ... | ALGO | 0.987127 | 3.011406 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2015-12-29T22:17:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a0ea43a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.