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 |
|---|---|---|---|---|---|---|---|
51fb0524-b171-4d20-9cb3-38d91ab327a8 | deepeshahirwar/Contest_Problems | Codeforces/B_Colourblindness.cpp |
#include <bits/stdc++.h>
#define ll long long
#define py cout<<"yes"<<'\n'
#define pn cout<<"no"<<'\n'
#define pb push_back
#define line '\n'
using namespace std;
void solve(){
ll n ;cin>>n;
string s1,s2;
char ch1;
for(int i=0; i<n; i++){
cin>>ch1;
s1.pb(c... | ALGO | 0.999782 | 3.965835 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-02-13T20:34: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": "99d38f3293c... |
35f4614a-79a2-46f3-b031-6fec6ded22ee | dlawjddn/algorithm | baekjoon/boj_1477/boj_1477.cpp | /**
* @file boj_1477.cpp
* @brief 백준 gold4 휴게소 세우기
* @version 0.1
* @date 2024-08-02
*
* @copyright Copyright (c) 2024
*
* 흠.. 더 공부하자 이분탐색..
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int exist_cnt, more_cnt, total_length, answer;
vector<int> stores;
int main(){
... | ALGO | 0.999961 | 4.116957 | {
"github_metadata": {
"branch": "main",
"commit_count": 699,
"repo_created_at": "2022-08-06T14:47: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": "90d112842f... |
bb076a66-73ca-4a91-bbb2-0e968284217a | mashfiqur05/Problem-Solving | Codeforces/2121C_Those_Who_Are_With_Us.cpp | /// *** --- ||| In the name of ALLAH ||| --- *** ///
#include<bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("inp... | ALGO | 0.999976 | 3.520062 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2023-11-26T14:48: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": "86bb5e4b... |
94af8763-5254-4205-a67c-97f6014594a2 | tlsgkdns/study | BfsAndDfs/16929_twoDots.cpp | #include <iostream>
#include <cstring>
using namespace std;
char board[51][51];
int v[51][51];
int dy[4] = { -1, 1, 0, 0 };
int dx[4] = { 0, 0, 1, -1 };
int N, M;
bool inRange(int y, int x)
{
return y >= 0 && x >= 0 && y < N && x < M;
}
bool dfs(int y, int x)
{
bool ret = false;
for (int i = 0; i < 4; i++)
{
int... | ALGO | 0.999991 | 5.936273 | {
"github_metadata": {
"branch": "master",
"commit_count": 2028,
"repo_created_at": "2021-02-18T10:49:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "148e026... |
9ba278ea-62d3-4f73-aabe-bdb6c689c489 | K-Suzuki-Jij/compnal | include/solver/classical_monte_carlo/single_spin_flip_updater.hpp | //
// Copyright 2024 <NAME>
//
// 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.999762 | 6.994168 | {
"github_metadata": {
"branch": "main",
"commit_count": 293,
"repo_created_at": "2023-04-24T12:29:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15e8f92243... |
63d65061-8abe-493b-8a15-f6510163ec21 | MoreInfoy/Digit | Poplar/include/LIPM/LIPM_MPC.h | //
// Created by nimpng on 8/14/21.
//
#ifndef POPLARDIGIT_LIPM_MPC_H
#define POPLARDIGIT_LIPM_MPC_H
#include "PoplarConfig.h"
#include "qpOASES.hpp"
#include "eiquadprog/eiquadprog-fast.hpp"
//#define USE_QPOASES
using namespace Poplar;
struct LIPM_Parameters {
Scalar mpc_dt = 0.05;
Poplar::Index mpc_hori... | ALGO | 0.998086 | 6.012718 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2021-06-14T05:17:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df11e86237... |
8db04a2f-dab9-4e8b-9d1f-a2b74ccbdcbb | hmcs10/CP-dump | B_Swaps.cpp | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define nline "\n"
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define ll long long
#define ld long double
#define sll set<ll>
#define vll vector<ll>
#define mll map<ll, ll>
#define pll pair<ll, ll>
#define gri greater<... | ALGO | 0.999987 | 3.505516 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-09-26T20: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": "632521b1ad12... |
e9be0566-7529-48e0-9e00-379f881a0b9b | DavidLuna-coder/EDNL | Grafos/Practica7/Ej7/Ej7.cpp | #include "../../MaterialesGrafos/grafoPMC.h"
#include "../../MaterialesGrafos/matriz.h"
#include "../../Dijkstra.hpp"
#include <iostream>
#include <algorithm>
//? OPCIONES
//* Bus - Cambio1 - Tren
//* Bus - Cambio2 - Tren
using vertice = typename GrafoP<double>::vertice;
using namespace std;
Lista<vertice> RutaMasCor... | ALGO | 0.998046 | 4.332493 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-02-23T17:15:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cac03c831b... |
244721b0-74d8-40b2-9573-a664b34da0c8 | GopherTeen/OJ_Code | Problems/Atcoder/ABC350-399/ABC383/D_9_Divisors.cpp | // Date: 2024-12-07 星期六
#include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#endif
using namespace std;
using ll = long long;
vector<int> isPrime;
vector<int> primes;
void sieve(int n) {
isPrime.assign(n + 1, 1);
isPrime[0] = isPrime[1] = 0;
for (int i = 2; i <= n; ++i) {
if (!isPrime[i]) ... | ALGO | 0.999795 | 4.973 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2024-11-01T07:27: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": "421183ee5... |
5801a669-860d-4d2b-9ff7-ceaceac26486 | skrewbar/PS | Baekjoon/platinum/1019.cpp | #include <bits/stdc++.h>
#define fastio() ios::sync_with_stdio(false); cin.tie(nullptr);
using namespace std;
using ll = long long;
ll cnt[10];
ll power(ll base, ll exp) {
if (exp == 0) return 1;
ll x = power(base, exp / 2);
if (exp % 2 == 1) return x * x * base;
else return x * x;
}
int main() {... | ALGO | 0.999677 | 4.285667 | {
"github_metadata": {
"branch": "main",
"commit_count": 278,
"repo_created_at": "2024-10-03T05:34: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": "cf712e167a... |
5cc9ae23-3689-4801-84d0-b2a29fedb0c8 | thalium/icebox | third_party/virtualbox/src/VBox/Runtime/common/checksum/alt-md2.cpp | /* $Id: alt-md2.cpp $ */
/** @file
* IPRT - Message-Digest Algorithm 2, Alternative Implementation.
*/
/*
* Copyright (C) 2009-2017 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute ... | ALGO | 0.999261 | 6.517664 | {
"github_metadata": {
"branch": "master",
"commit_count": 992,
"repo_created_at": "2019-06-03T14:18:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 581,
"forks": 88,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "34423c... |
2eff5764-6c4e-47bc-85b9-04c5691ae66a | argon17/SDESheet | day13 ( Stack & Queue )/StackUsingQueue.cpp | #include<bits/stdc++.h>
using namespace std;
class MyStack {
public:
/** Initialize your data structure here. */
queue<int> q;
MyStack() {
}
/** Push element x onto stack. */
// idea : after every push just left rotate the queue by (number of elements - 1)
void push(int x) {
... | ALGO | 0.999133 | 5.328278 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2021-06-06T03:37: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": "dbc2d6f96... |
7b9b604e-87ee-4c9a-972e-53477e561698 | rhmunna143/competetive-programming | Cpp/Data-Structures/smrity/assignment-1/Queries.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int value)
{
this->value = value;
this->next = NULL;
}
};
void insert_at_head(Node *&head, Node *&tail, int value)
{
Node *new_node = new Node(value);
new_node->next = head;
head = n... | ALGO | 0.999879 | 4.621857 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2024-08-28T15:58: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": "84c2f87d88... |
657ceeeb-d011-4028-a1bc-a47c05813bd2 | lvmarlowe/CPP-Shark-Daily-Planner | shark.cpp | /* <NAME>
SDEV-345: Data Structures & Algorithms
Week 1: Assignment
31 Aug. 2024
This source file implements the methods of the Shark class defined in shark.h.
It includes the constructor, as well as the overridden methods for eating, sleeping,
swimming, printing the schedule, and performing sc... | TOOL | 0.953944 | 5.917645 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-11-15T02:27: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": "6c0d344ef8... |
59a60178-34f4-4f6b-b338-97048918d703 | u-wyh/luogu-code | P2886.cpp | #include<bits/stdc++.h>
using namespace std;
int t,n,st,en;
int m;
int arr[205];
struct node{
int w,u,v;
}nums[105];
vector<vector<int>> multiply(vector<vector<int>>a,vector<vector<int>>b){
int n=a.size();
int m=b[0].size();
int k=a[0].size();
vector<vector<int>> ans(n,vector<int>(m,1e9));
for... | ALGO | 0.999865 | 4.318384 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2025-05-09T09:40:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "961e1d98311... |
423a18b2-b98b-4a93-9c26-260b9124d501 | ishandutta2007/codeforces-n | nishant403/normal/1234/B2.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>... | ALGO | 0.999989 | 4.370397 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "f9db76098dd4... |
4490eb08-f81c-4478-9f23-af499351d818 | kimkeonu/algorithm-and-data-structure | 4-boj/3-gold/1561-놀이-공원.cpp | #include <bits/stdc++.h>
using namespace std;
#define max_n 60000000004
#define MAX_M 10004
typedef long long ll;
ll n, m, a[MAX_M], lo, hi = max_n, ret, mid, temp;
bool check(ll mid)
{
temp = m;
for (int i = 0; i < m; i++)
{
temp += mid / a[i];
}
return temp >= n;
}
int main()
{
c... | ALGO | 0.999994 | 4.149314 | {
"github_metadata": {
"branch": "main",
"commit_count": 430,
"repo_created_at": "2022-07-19T09:27: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": "f93db2263b... |
1868b7fe-2532-4bdd-84f6-af54f151eeb2 | alenpanto/praticeCPP | cal.cpp | #include <iostream>
using namespace std;
double multiply(double a, double b) {
return a * b;
}
double add(double a, double b) {
return a + b;
}
double divide(double a, double b) {
if (b != 0) {
return a / b;
} else {
cout << "Error: Division by zero!";
return 0.0;
}
}
double ... | ALGO | 0.994592 | 4.62969 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-06-21T12:58: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": "333548dcaa6... |
2fe80614-3246-4db3-915d-606745c7c88e | swapniljain96/CppWorkspace | LeetCode/June Challenge 2021/28.Remove All Adjacent Duplicates In String.cpp | // You are given a string s consisting of lowercase English letters. A duplicate removal consists of choosing two adjacent and equal letters and removing them.
// We repeatedly make duplicate removals on s until we no longer can.
// Return the final string after all such duplicate removals have been made. It can be p... | ALGO | 0.999969 | 6.27585 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2020-10-31T07:06:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef0fa580a... |
53eadaea-51ed-452f-aadf-7dabc829f756 | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p03087/s058304989.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T... | ALGO | 0.998323 | 3.807906 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "f005959d11... |
8f0f525a-be80-4ea8-900d-472bfd71b280 | AmitThakur045/LLD | Book Reader System/online_book_reader.cpp | #include <bits/stdc++.h>
using namespace std;
class Book {
private:
long book_id;
string name;
string description;
long total_pages;
public:
Book(const long &_id, const string &_name, const string &_description, const long &_total_pages)
: book_id(_id), name(_name), description(_descriptio... | TOOL | 0.925687 | 5.215551 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-02-02T11:52:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc05e602112... |
1e55dd11-6946-4c5d-9ea0-94e903785995 | HandsOnOpenCL/Exercises-Solutions | Solutions/Exercise09/Cpp/pi_ocl.cpp | //------------------------------------------------------------------------------
//
// Name: pi_ocl.cpp
//
// Purpose: Numeric integration to estimate pi
//
// HISTORY: Written by <NAME>, May 2010
// Ported to the C++ Wrapper API by <NAME>, September 2011
// Updated by <NAME> and <NA... | ALGO | 0.997698 | 5.791016 | {
"github_metadata": {
"branch": "master",
"commit_count": 262,
"repo_created_at": "2013-07-23T11:20:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 521,
"forks": 187,
"issues": 6,
"pull_requests": 5
},
"file_meta": {
"content_id": "58714... |
85eec16f-b3c8-4060-b97a-aa0c90490c2d | nims11/coding | CQM/3/GGNTAG.cpp | /*
<NAME> (nims11)
*/
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<map>
#include<string>
#include<vector>
#include<queue>
#include<cstring>
#include<cstdlib>
#include<cassert>
#include<cmath>
#include<stack>
#include<set>
#include<utility>
#define in_T int t;for(scanf("%d",&t);t-... | ALGO | 0.999407 | 3.253618 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-03-14T20:16:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b910bd103... |
e22176c5-bd1f-4ec0-a0b5-87590daea0f6 | IlanCoder/Asteroids | src/Mat4.cpp | #include "Mat4.h"
Mat4::Mat4(){
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (i == j) {
mat4[i][j] = 1;
}
else {
mat4[i][j] = 0;
}
}
}
}
Mat4::Mat4(Vec4 &vec1, Vec4 &vec2, Vec4 &vec3, Vec4 &vec4){
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (i == 0)... | TOOL | 0.935021 | 4.748982 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-09-22T12: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": "30be50cae9... |
ed6807f7-8fd1-4e20-9504-31007ab4a4c2 | MattGPT-ai/tutoring_code | cs52/assignment4/problem1.cpp | //<NAME>
//Assignment #4
//Problem #1
#include <iostream>
using namespace std;
void userCheck(int& input1, int& input2, int& input3);
//validates user inputs to be positive
//formal parameter named input1, input2, input3 are the user inputs which are assumed to be integer
void largestNum(int number1, int number2... | ALGO | 0.987579 | 3.503127 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2019-03-18T00:41: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": "d27e7f16f35... |
45dd98c7-5cf1-4e6c-8cb6-2ccf873fb37b | wwqgtxx/pat-a-practise | 1035.cpp | #include<iostream>
#include<iomanip>
#include<map>
#include<string>
#include<sstream>
#include<vector>
#include<set>
#include<cstdint>
#include<cmath>
#include<deque>
#include<queue>
#include<list>
#include<algorithm>
#include<iterator>
int main(){
int n;
std::cin >> n;
std::vector<std::pair<std::string,std::string... | ALGO | 0.9937 | 3.489967 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-03-17T12:20:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "586162b0ff... |
a58d4d79-538e-4ee6-b2a1-7f89508e3494 | MrityunjayMaharana/CipherCoders_Updates | assignment_05.cpp | /*
Questions :- Given an array arr[] of n integers where arr[i] represents the number of chocolates in ith packet. Each packet can have a variable number of chocolates. There are m students, the task is to distribute chocolate packets such that:
Each student gets exactly one packet.
The difference between ... | ALGO | 0.999988 | 5.911257 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-12-04T14:55: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": "42a4d3fa4db... |
18fa0d2e-1b04-438b-bc48-9d38a9825883 | Saif-000001/Introduction-to-Algorithms-Problem-Solving-Part---III | AlgorithmGraph/Modul_9_5/bidirectional.cpp | // adjecient Matrix
#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
int maze[N][N];
vector<int> adj_list[N];
int visited[N] = {};
int nodes, edges;
void bfs(int src)
{
queue<int> q;
visited[src] = 1;
q.push(src);
while (!q.empty())
{
int head = q.front();
q.pop()... | ALGO | 0.999988 | 4.965651 | {
"github_metadata": {
"branch": "main",
"commit_count": 118,
"repo_created_at": "2023-03-07T17:46:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1dddeaf761... |
37f3010b-e0d4-4aaa-baa9-6760efa60f21 | joaobarbirato/ori-trabalhos | 2-trabalho/src/Arquivo.hpp |
/*
* TRABALHO 1: Implementação de arquivo sem ordenação
* DISCIPLINA: Organização e Recuperação da Informação
* DOCENTE: <NAME>
* DISCENTES: <NAME> RA: 726523
* <NAME> RA: 726546
*/
#ifndef ARQUIVO_HPP
#define ARQUIVO_HPP
#include <iostream>
#include <cstring>
#include <c... | TOOL | 0.946216 | 3.915802 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2017-10-23T17:17: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": "5902e8a70... |
24890846-fc84-43d5-b429-c972bb1115bc | Anguei/OI-Codes | LuoguCodes/P1516.cpp | #include <utility>
#include <string>
#include <iostream>
#include <algorithm>
using ll = long long;
int ans = 0;
ll exgcd(ll a, ll b, ll &x1, ll &y1)
{
if (b == 0)
{
x1 = 1;
y1= 0;
return a;
}
else
{
ans = exgcd(b, a % b, x1, y1);
ll oldX = x1;
x1 = y1;
y1 = oldX - a / b * y1;
}
return ans;
}
i... | ALGO | 0.999665 | 4.279567 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-02-14T14:22: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": "96aac6a5c8... |
60edc9d8-1ffc-440d-b8cc-a451fb145044 | jeanpaulHT/CS3101-Competitive-Programing | week12/rounTrip.cpp | #include<bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define ROF(i,a,b) for(int i=(a);i>=(b);i--)
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(0);cout.t... | ALGO | 0.999994 | 3.832494 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-07-22T00:08: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": "5d4d8c626676... |
2f5274bf-1ef3-4fd2-8303-1d3d4df5b5a0 | swri-robotics/marti_common | swri_image_util/src/geometry_util.cpp | // *****************************************************************************
//
// Copyright (c) 2014, Southwest Research Institute® (SwRI®)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:... | ALGO | 0.9986 | 6.976177 | {
"github_metadata": {
"branch": "ros2-devel",
"commit_count": 721,
"repo_created_at": "2014-12-04T15:29:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 55,
"forks": 70,
"issues": 9,
"pull_requests": 1
},
"file_meta": {
"content_id": "4fa... |
c578617a-fb63-4188-87bc-63d29a547370 | AryanK37/competitiveProgramming | cf/contests/Codeforces Round 998 (Div. 3)/D_Subtract_Min_Sort.cpp | #include <bits/stdc++.h>
#define int long long
#define float long double
#define pii pair<int, int>
const int INF = 1e18;
const int MOD = 1e9 + 7;
#define br cout << "\n"
#define pb push_back
#define sp cout << " "
#define all(x) (x).begin(), (x).end()
#define fast_io \
ios_base::sync_with_s... | ALGO | 0.999942 | 4.526084 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-18T20:41:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e5fc6950094... |
f7df82e2-0c0d-4241-88a3-3573eca8f33b | ishandutta2007/codeforces-z | zdolny_kaczor/normal/1081/D.cpp | //<NAME>, University of Warsaw (former XIV LO Warsaw)
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include <bits/stdc++.h>
using namespace std;
#define sim template <class c
#define mor > muu & operator<< (
#define ris return *this
#define R22(r) sim> typename enable_if<1 r sizeof(dud<c>(0)), muu&>::type operator<<... | ALGO | 0.999987 | 3.808185 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "5312732e0c4f... |
73915085-65a5-4703-958f-d5157a190019 | neilmehta31/Bentley_Ottmann_algo_CompGeo | event_queue.h | #include <bits/stdc++.h>
#include "eventnode.h"
#include "helper.h"
using namespace std;
class EventQueue
{
public:
int height(eventNode *node)
{
return (node == NULL) ? 0 : node->ht;
}
public:
eventNode *getnextEventPoint(eventNode *node)
{
int nodecorrect = helper();
whil... | ALGO | 0.999813 | 3.979219 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2022-04-09T23:20:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b2d2e09b... |
7ce1a7e1-ac1b-48fb-bd27-9554665dbe1c | Hansest/SJTU-24Fall-cpp-trivia | 12-12/myComplex.cpp | #include <iostream>
#include "myComplex.h"
using namespace std;
complexT complexT::create(double re, double im) {
complexT c;
c.re = re, c.im = im;
return c;
}
void complexT::display() {
if (im == 0) {cout << re << endl; return;}
if (re == 0) {cout << im << 'i' << endl; return;}
// printf("%l... | TOOL | 0.949986 | 4.678925 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2024-12-21T04:00: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": "a3000ddc5a... |
34c70c6b-02e4-4a9e-9ed2-b14c2ab73f87 | bbb125/aoc2024 | day9/src/main.cpp | #include "input.h"
#include "util/util.h"
#include <range/v3/all.hpp>
#include <cassert>
#include <optional>
#include <string_view>
#include <string>
#include <vector>
#include <set>
#include <list>
#include <map>
namespace aoc2024::day9
{
namespace part1
{
std::uint64_t solve(std::string_view input)
{
using na... | ALGO | 0.998763 | 6.070063 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-12-10T00:27: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": "55f2b6e5447... |
3b8d3d44-4979-48af-ba29-bcc0de436c48 | kutomei3/OTOG-Answer | Answer/1018-TOI20_Lover.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, v, w;
cin >> n >> v >> w;
vector<int> pfe(n + 1, 0);
vector<int> pfo(n + 1, 0);
for (int i = 1; i <= n; i++) {
int u;
cin >> u;
... | ALGO | 0.999981 | 3.963155 | {
"github_metadata": {
"branch": "main",
"commit_count": 230,
"repo_created_at": "2024-12-15T18:03: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": "a8e6d23322... |
092e9a02-9535-46f4-b917-f06288fbbb40 | autruonggiang/IT003-DSA-Lab | Linked List Exercises/Bai05.cpp | //CÂU 05
//Cho danh sách liên kết đơn A có thành phần dữ liệu là các số nguyên dương.
//
//Tách danh sách A thành 2 danh sách liên kết đơn B và C sao cho:
// Danh sách B có các node chứa toàn giá trị chẳn của A
// Danh sách C có các node chứa toàn giá trị lẻ của A.
//
//INPUT:
//Nhập danh sách liên kết đơn theo câu 1.
... | ALGO | 0.999712 | 4.665836 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-02-25T16:24:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6072dc4532e... |
0566fa87-0e7e-49a2-bec9-61a56aabe15b | WeikangChen/algorithm | leetcode/Course_Schedule.cpp |
#include <iostream>
#include <vector>
#include <utility>
#include <unordered_set>
#include <queue>
using namespace std;
class Solution {
public:
/*
bool canFinish(int numCourses, vector<pair<int, int>>& prerequisites) {
if(numCourses <= 0) return true;
vector<unordered_set<int> > graph(numCour... | ALGO | 0.999903 | 5.990674 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2016-05-12T03:25: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": "33cf5b720... |
d68c1846-6a54-4604-9319-cfc8ee91fa10 | ruslan-ilesik/minesweeper-Cpp | bot src/bot.hpp | #include <iostream>
#include <vector>
void move();
void move()
{
int possibilities[map_size_y][map_size_x];
//find 100% and prepare possibilities
for (int x = 0; x < map_size_x; x++)
{
for (int y = 0; y < map_size_y; y++)
{
possibilities[y][x] = 9999;
}
}
for (int x = 0; x < map_size_x; x++)
{
for ... | ALGO | 0.991408 | 3.377943 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-02-13T13:18:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dcdf8704eae... |
0b43dc50-6b2e-40fc-805c-90a4cc6d8611 | icl-utk-edu/papi | src/components/sde/tests/Simple2/Simple2_Lib++.cpp | #include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "simple2.hpp"
Simple::Simple(){
papi_sde::PapiSde sde("Simple2_CPP");
// Initialize library specific variables
comp_value = 0.0;
total_iter_cnt = 0;
low_wtrmrk = 0;
high_wtrmrk = 0;
/... | TOOL | 0.958209 | 5.825407 | {
"github_metadata": {
"branch": "master",
"commit_count": 9065,
"repo_created_at": "2023-03-27T15:47:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 163,
"forks": 65,
"issues": 36,
"pull_requests": 9
},
"file_meta": {
"content_id": "fd26... |
bd3a30fb-e786-458c-8013-0ae6bc8263aa | jungahshin/algorithm | c:c++/17144_2.cpp | //미세먼지 안녕!
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int r, c, t, input;
int a[51][51] = {0, };//미세먼지 저장
vector<pair<int, int>> v;//공기청정기 위치 저장
int dx[4] = {0,0,-1,1};
int dy[4] = {-1,1,0,0};
vector<int> temp;
queue<int> q;
int final = 0;
void spread(){//미세먼지 확산
int b[51][51] = {... | ALGO | 0.999979 | 4.376358 | {
"github_metadata": {
"branch": "master",
"commit_count": 645,
"repo_created_at": "2019-07-26T10:26:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22aeba76... |
b52aa919-c103-409e-8ec1-567a0c79deee | cusplibrary/cusplibrary | cusp/system/cuda/detail/multiply/coo_spmv_cub.h | /*
* Copyright 2008-2014 NVIDIA Corporation
*
* 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... | ALGO | 0.978057 | 5.556498 | {
"github_metadata": {
"branch": "main",
"commit_count": 1316,
"repo_created_at": "2012-08-24T01:13:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 415,
"forks": 134,
"issues": 33,
"pull_requests": 6
},
"file_meta": {
"content_id": "49c4c... |
2add4dff-3c06-4b22-86b9-28504f3fc69c | ab-atiq/Phitron-6 | C-4-Algo/Module11.5/Number_of_Enclaves.cpp | class Solution
{
public:
vector<pair<int, int>> directions = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
int n, m;
bool valid(int i, int j)
{
if (i < 0 || i >= n || j < 0 || j >= m)
return false;
return true;
}
void dfs(int si, int sj, vector<vector<int>> &grid)
{
... | ALGO | 0.999959 | 6.587838 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2025-01-26T18:49:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8f0de1bbfd... |
a28c1825-9ded-4708-99fc-1c155489b7bb | DionysiosB/CodeForces | 0400-0499/476B-DreamoonAndWiFi.cpp | #include <cstdio>
#include <iostream>
#include <string>
#include <cstdlib>
double myFact(int n){
double output = 1;
for(int p = 2; p <= n; p++){output *= p;}
return output;
}
int main(){
std::string sent; getline(std::cin, sent);
std::string received; getline(std::cin, received);
int desir... | ALGO | 0.999911 | 3.714916 | {
"github_metadata": {
"branch": "master",
"commit_count": 4487,
"repo_created_at": "2013-06-27T18:15:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 690,
"forks": 163,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "911... |
1917a233-76d4-4342-a288-979fc2e1394b | GizemTuran/Bin-packing-problem | Source.cpp | #include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <complex>
#include <fstream>
using namespace std;
/*
______________________... | ALGO | 0.999952 | 3.923707 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-06-21T15:14:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b07f9c6d9a25... |
37a3440a-0cb4-4253-b324-e80565d4fa7f | Sodynoizz/Competitive-Programming | posn/practice/graph-representation.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::valu... | ALGO | 0.999924 | 3.760267 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-03-25T18:14: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": "6820ba14658... |
5e9d7a74-9a23-4e8b-a5d2-b3184ee0b41f | skjha1/Data-Structure-Algorithm-Programs | Tree/BST/02 BST Insert,Inorder&Search.cpp | #include <iostream>
using namespace std;
class Node {
public:
Node* lchild;
int data;
Node* rchild;
};
class BST {
private:
Node* root;
public:
BST() { root = nullptr; }
Node* getRoot() { return root; }
void Insert(int key);
void Inorder(Node* p);
Node* Search(int key);
};
void B... | ALGO | 0.999955 | 5.147764 | {
"github_metadata": {
"branch": "master",
"commit_count": 682,
"repo_created_at": "2020-08-12T04:43:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 652,
"forks": 257,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "434f... |
94785f9b-04be-4a63-b58c-063326f70c20 | weizhenwei/leetcode | src/2012-03-04_Sudoku_Solver.cpp | /*
*
* Copyright (c) 2014, weizhenwei
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of condi... | ALGO | 0.99944 | 5.940823 | {
"github_metadata": {
"branch": "dev",
"commit_count": 292,
"repo_created_at": "2014-10-21T04:59:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45dcf769229... |
15cbcc52-15e2-4f7f-a1dd-f5a8059ba4d3 | dean2727/AI-Basics | Proj1/BlocksworldBFS.cpp | /********************************
* File name: BlockworldBFS.cpp
* Description: Blockworld AI problem using breadth-first search algorithm
* to generate a sequence of actions to transform an initial state of blocks
* into a goal state
* Name: <NAME>
* Class: CSCE 420 500
* Date: 02/15/2021
* *******************... | ALGO | 0.999725 | 4.507149 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2021-06-24T00:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "313fc3655... |
f6f34ba6-7e1b-486c-893d-1fcdb2356f99 | alby0701/Simulation_laboratory_exercise | Exercise_6/6/random.h | /****************************************************************
*****************************************************************
_/ _/ _/_/_/ _/ Numerical Simulation Laboratory
_/_/ _/ _/ _/ Physics Department
_/ _/_/ _/ _/ Universita' degli Studi di Milano
_/ _/ ... | TOOL | 0.948598 | 3.978963 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-09-24T11:16: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": "84ff2628b5... |
d5f2da4a-ab58-49ec-9d70-a28032e16fb4 | ChoiCube84/baekjoon-solutions | 28358/source.cpp | #include <bits/extc++.h>
using namespace __gnu_pbds;
using namespace std;
using ll = long long int;
using ull = unsigned long long int;
using pll = pair<ll, ll>;
int daysInMonth(int month);
bool numberFound(int target, int number);
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
co... | ALGO | 0.998831 | 4.654702 | {
"github_metadata": {
"branch": "main",
"commit_count": 474,
"repo_created_at": "2023-08-01T15:05: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": "b79642d4df... |
55daf398-4c13-478a-be21-fa8b9a9c902f | Iagopatrick/Geral | fechoConvexo.cpp | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | ALGO | 0.999937 | 5.02819 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-10-08T00:58: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": "7ceaab9a23... |
daa60a53-e0cf-4a38-b02f-1ab33d41fd54 | chiihuang/leetcode-cpp | snippets/heapsort.cpp | #include <vector>
#include <iostream>
using namespace std;
int parent(int i) {
return (i - 1) / 2;
}
int left(int i) {
return 2 * i + 1;
}
int right(int i) {
return 2 * i + 2;
}
void swap(int& a, int& b){
int temp = a;
a = b;
b = temp;
}
void printVec(vector<int> v){
for (auto i = v.begin(); i != v.e... | ALGO | 0.999986 | 5.421694 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2016-09-05T06:28: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": "f0290a6f... |
eb66e2f1-f713-46e0-9c28-572011740241 | xieyxpro/cpp | 双向链表ist.cpp | enum Error_code {
success, underflow, overflow
};
template <class List_entry>
struct Node {
List_entry entry;
Node<List_entry> *next;
Node<List_entry> *back;
Node() {
entry = 0;
back = next = NULL;
}
Node(List_entry _entry, Node<List_entry> *link_back = NULL,
Node<List_entry> *link_next = NULL) {
entry ... | TOOL | 0.907889 | 4.751597 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-04-21T15:15: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": "80d7f7fa52... |
591c3a84-9fb6-4459-b720-aab9b8a8fdab | jaredhoberock/stanford-cs193g-sp2010 | assignments/mp4/thrust/detail/device/cuda/block/odd_even_sort.h | /*
* Copyright 2008-2010 NVIDIA Corporation
*
* 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... | ALGO | 0.999976 | 6.919745 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2015-03-14T06:09:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 220,
"forks": 84,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1eb4... |
a12445cd-f8e0-4896-b800-5bbf480f8c36 | 2017103030/DCT | DCT/DCT.cpp | #include "DCT.h"
Dct::Dct(int blocksize = 8) : m_blocksize(blocksize) {
m_yplane = new unsigned char* [m_blocksize];
m_recovery = new unsigned char* [m_blocksize];
m_Fuv = new int * [m_blocksize];
for (int c = 0; c < m_blocksize; c++) {
m_yplane[c] = new unsigned char[m_blocksize];
m_Fuv[c] = new int[m_blocksi... | ALGO | 0.989393 | 5.11952 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-10-26T14:11:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2289cdc10... |
3e5c3e0c-31f2-4ae9-84a8-d81df34c2b22 | kazunetakahashi/atcoder | 2017/1230_ABC084/C.cpp | #include <iostream>
#include <iomanip> // << fixed << setprecision(xxx)
#include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ;
#include <vector>
#include <string> // to_string(nnn) // substr(m, n) // stoi(nnn)
#include <complex>
#include <tuple> // get<n>(xxx)
#include <queue>
#include <stack>
#include <... | ALGO | 0.999908 | 3.235176 | {
"github_metadata": {
"branch": "master",
"commit_count": 5889,
"repo_created_at": "2014-11-15T16:16:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f187f89... |
90c52b43-4c78-41de-97f5-0bb8b8d78342 | Sohamlad7/android_device_motorola_cedric | hardware-moto-sensors/stml0xx_hal/Quaternion.cpp | /*
* Copyright (C) 2008 The Android Open Source Project
*
* 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 app... | ALGO | 0.970835 | 6.942852 | {
"github_metadata": {
"branch": "lineage-17.1",
"commit_count": 1056,
"repo_created_at": "2017-05-29T16:45:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 32,
"forks": 38,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": ... |
35ed6ac4-6600-426b-bfaa-c8cd545febe8 | naveen3011/Leetcode-solved-Qestion | Top K Frequent Elements in Array - | - GFG/top-k-frequent-elements-in-array-.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
static bool compare(pair<int,int> p1, pair<int,int> p2){
if(p1.second ==p2.second){
return p1.first>p2.first;
}
return p1.second>p2.second;
}
vector<int> topK(vector... | ALGO | 0.999993 | 6.809618 | {
"github_metadata": {
"branch": "main",
"commit_count": 612,
"repo_created_at": "2022-10-02T13:00: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": "53c4bbe4d9... |
4bcba8d4-b235-440a-b4e0-2e2114e5f9b4 | xurongchen/AlgorithmProblem | GoogleKickstart/2020RoundE/Problem1/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long
int A[200005];
void solve(int Case)
{
int N;
cin >> N;
for (int i = 0; i < N; ++i)
{
cin >> A[i];
}
int Cnt = 1, d = 0, Max = 0;
for (int i = 1; i < N; ++i)
{
if(A[i] - A[i-1] == d)
Cnt +... | ALGO | 0.999667 | 3.802586 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-02-25T16:15:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aff57c209... |
fa88f4b3-bc56-413b-a5b3-9733ef04827c | Hridoy-ikramul-haque/DSA-Workshop | XPCS/Module-4 [Two Pointer and Sliding Window-1/Codeforces Round (1016 [Div. 3] + 1017 [Div. 4])/C. Brr Brrr Patapim.cpp | // https://codeforces.com/contest/2094/problem/C
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> ans(2 * n + 1);
// int grid[n + 1][n + 1];
... | ALGO | 0.999917 | 4.065441 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2025-03-02T20:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a210b2f4ea... |
f954666d-7b42-47e0-b779-091a8ac3a99d | koeppl/biclique_extraction | testtrie.cpp | #include <iostream>
#include <math.h>
#include <stdlib.h>
#include <fstream>
#include <map>
#include <vector>
#include <algorithm>
#include "Trie.h"
using namespace std;
vector<int> splitToInt(string line, string delims){
string::size_type bi, ei;
vector<int> words;
bi = line.find_first_not_of(delims);
w... | ALGO | 0.979137 | 3.968006 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-09-24T01:29: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": "7d8ea5d39f31... |
fb171f2b-1792-4beb-af09-3ba092a9a921 | Youkwangchae/Algorithms | 백준/Bronze/1259. 팰린드롬수/팰린드롬수.cc | #include <iostream>
using namespace std;
// 홀수 일 경우, 가운데 기준 좌우 한자리 씩 옮겨가며 비교.
bool binary_search(string str, int size)
{
int l, r, m;
l = 0, r = str.length() - 1;
m = (l + r) / 2;
if (size == (l + r) / 2) return true;
if (str.at(m - 1 - size) == str.at(m + 1 + size)) return binary_search(str, size + 1);
else ... | ALGO | 0.999934 | 3.945259 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2024-01-07T01:45: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": "5312575ad3... |
1375d656-2499-4f05-b60f-b31bcedc043b | tanjo3/HackerRank | Algorithms/Implementation/New Year Chaos.cpp | #include <cmath>
#include <cstdio>
#include <map>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int T, n;
cin >> T;
for (int i = 0; i < T; i++) {
cin >> n;
int temp;... | ALGO | 0.999637 | 3.768254 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2016-04-25T21:26: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": "7c679d927... |
95c90e3d-348d-4935-80ab-c8ff27d1c074 | udaykkumar/play_ground | online_play_lc/src/30_07_2019.cpp | /*
Hi, here's your problem today. This problem was recently asked by Amazon:
You are given a 2D array of characters, and a target string. Return whether or
not the word target word exists in the matrix. Unlike a standard word search,
the word must be either going left-to-right, or top-to-bottom in the matrix.
Ex... | ALGO | 0.999642 | 5.877032 | {
"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": "f65124b2e6... |
83ef57c4-b0da-4756-bfa8-b014e85b6a86 | BNS200/ads2 | Lab2/source/BinaryTree.cpp | #include "../include/BinaryTree.h"
BinaryTree::Node::Node() : key(0), left(nullptr), right(nullptr){}
BinaryTree::Node::Node(int key) : key(key), left(nullptr), right(nullptr){}
BinaryTree::Node::Node(int key, Node *left, Node *right) : key(key), left(left), right(right){}
int BinaryTree::Node::getKey() const {
... | ALGO | 0.999945 | 5.273607 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2025-02-15T10:00:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "79e9d974b86... |
8c8b70c2-5c4b-49a3-8fb8-01aa25f4272c | gbmxdev/dotfiles | functions.cpp | #include <iostream> // std lib io
#include <sstream> // munip string as stream
#include <string> // generic string
#include <array> // array lib
#include "functions.h"
using namespace std;
void modify (std::string & buffer, bool decrypt, int offset, int bytes )
{
if ( decrypt )
for ( int x = 0; (x+1) < bytes; x++ )... | ALGO | 0.990062 | 3.588011 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-01-21T19:58: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": "27ec0f22f4... |
aea09abc-fc89-4133-bd70-a52923954595 | Orion545/OI-Record | Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day2程序包/answers/GD-0137/game/game.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
#define LL long long
#define P 1000000007
using namespace std;
int n, m;
LL z = 1, f[1000007];
int ksm(int a, int b, int mod){
int s = 1;
while(b){
if(b & 1) s = z * s * a % mod;
a = z * a * a % mod;
b >>= 1;
}
retu... | ALGO | 0.99996 | 3.576482 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-26T05:47:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "566962ee6f... |
b74ba08b-bb14-4da4-a084-51085d6cc84f | 3xp10it3r/DP-WORKSHOP | GAME_DP_Substraction_prob.cpp | // There are x chips, you can take y number of chips, if y = 2^m for some m belongs to [0, INF).
// First to not able to move is loser.
#include <bits/stdc++.h>
using namespace std;
int x;
int dp[100010];
int rec(int x) {
if(x == 0)
return 0;
if(dp[x] != -1)
return dp[x];
... | ALGO | 0.999747 | 4.004971 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2025-02-25T17:51: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": "c1135d4a1eb... |
9acca661-7548-48e4-83ac-7e4102686eeb | cou929/topcoder | HappyCells_bak.cpp | #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
class HappyCells {
public:
vector <string> _grid;
bool check(int i, int j)
{
if (i >= 0 && j >= 0 && i < _grid.... | ALGO | 0.999858 | 4.500699 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2010-01-17T10:59:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 10,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c183d7... |
3f4c9b4f-3b36-4a6d-915c-3fc9ae1b87e4 | StalinEPN97/EjemplosC_Cpp | PrjEjemploCadenaString.cpp | /* Programa que cuena las vocales de una cadena dada */
#include <iostream>
using namespace std;
int main1()
{
{
int contador=0;
string cadena ="Escuela Politecnica Nacional"; //13 vocales
for(int i=0; i<28; i++)
{
cout <<cadena[i] <<endl;
if (cadena[i] == 'a'
|| cadena[i] == 'e'
|| cadena[i] == 'i'
||... | ALGO | 0.995492 | 3.532663 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-05-14T16:35: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": "9b152310a... |
b2fe506a-ef22-4f8d-a994-dfd25080b873 | minus3theta/contest | atcoder/arc/076/c.cpp | #include <cstdio>
#include <climits>
#include <cassert>
#include <cmath>
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <functional>
#include <tuple>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <vector>
#define REP(i,s,n) for(int i=(i... | ALGO | 0.999997 | 4.429665 | {
"github_metadata": {
"branch": "master",
"commit_count": 601,
"repo_created_at": "2016-10-02T12:21:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 407
},
"file_meta": {
"content_id": "4c9939... |
c3da81cd-be02-4249-b440-2d35b4270a37 | heoj10272/BOJ_commit | 백준/Silver/4963. 섬의 개수/섬의 개수.cc | #include <bits/stdc++.h>
using namespace std;
int board[52][52];
int vis[52][52];
int dy[8] = { -1, -1, -1, 0, 0, 1, 1, 1 };
int dx[8] = { -1, 0, 1, -1, 1, -1, 0, 1 };
int w, h;
int board_size;
int ans;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
while (1) {
cin >> w >> h;
if (w == 0 && h == 0) {
ret... | ALGO | 0.999607 | 3.911753 | {
"github_metadata": {
"branch": "main",
"commit_count": 140,
"repo_created_at": "2022-05-30T05:14: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": "996a85d829... |
987f088f-f097-4fda-852b-7bb07d6aa7ae | ishandutta2007/codeforces-n | nantf/normal/1648/D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int maxn=555555,mod=998244353;
const ll INF=1e18;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define FOR(i,a,b) for(int i=(a);i<=(b);i... | ALGO | 0.999973 | 3.739841 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "19cebb85c804... |
1c7dd2c9-1769-4084-965e-bcf91fdfd0a1 | DilipKumarGangwar/LeetCode | LeetCode_May_2020_Challenge_Solutions/Week5/Course_Schedule.cpp | /*
There are a total of numCourses courses you have to take, labeled from 0 to numCourses-1.
Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1]
Given the total number of courses and a list of prerequisite pairs, is it possible for you... | ALGO | 0.999944 | 6.65049 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-06-01T20:30:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "807dcddff8... |
4b53b2b8-e64a-4f15-98dd-c3c4fb1a9851 | JeongbinPark/ProblemSolving_BOJ | 18352_findCity.cpp | #include <iostream>
#include <queue>
#include <algorithm>
#include <vector>
#define INF 1000000
using namespace std;
int N, M, K, X;
int A, B;
vector<int> path[300001];
int shortest[300002];
int main() {
cin >> N >> M >> K >> X;
for (int i = 0; i < M; i++) {
cin >> A >> B;
path[A].push_back(B);
}
fill(shorte... | ALGO | 0.999969 | 4.142575 | {
"github_metadata": {
"branch": "main",
"commit_count": 143,
"repo_created_at": "2021-01-21T11:34: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": "baadda98ed... |
c7ccc4a7-af10-4f04-b34e-f704c09fb640 | troyhe/Leetcode_2021 | 0364_Nested List Weight Sum II.cpp | /**
* // This is the interface that allows for creating nested lists.
* // You should not implement it, or speculate about its implementation
* class NestedInteger {
* public:
* // Constructor initializes an empty nested list.
* NestedInteger();
*
* // Constructor initializes a single integer.
* ... | ALGO | 0.999341 | 5.596113 | {
"github_metadata": {
"branch": "main",
"commit_count": 302,
"repo_created_at": "2020-12-26T01:08: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": "6fddedd3cc... |
307e2520-13c8-49f2-9c96-421f5ed04d82 | unchunks/Dungeon | old/A.h | #include <stdio.h>
#include <memory.h>
#include <list>
#include <queue>
#include <vector>
#include <math.h>
#include "DDefine.h"
const int Infinity = 100000;
enum EraseResult
{
NotFound,
Erased,
CouldntErased
};
// Map
// struct Cell
// {
// Cell() :
// X(-1),
// Y(-1)
// {
// }
// Cell(int x, int... | ALGO | 0.994496 | 3.785906 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-06-07T11:12: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": "0babdba39f5... |
2db239f6-938c-4ec1-b524-905eaa65e81c | Raurs2/unesp-bcc-bauru | Laboratorio de Programacao/12/3357 Rico do Mate 2.cpp | /*
Nesse exercicio, como não temos valores inteiros, para calcular o resto precisamos de uma formula especial, após isso, caso o resto seja 0
significa que o anterior é o que foi o ultimo, porém há um problema, o que acontece quando o primeiro que ficou com 0? Para evitar erro
mais um if foi acrescentado pa... | ALGO | 0.999477 | 3.201747 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-10-20T17:12:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0da414858757... |
4cda5cf1-43e0-41c5-b5e1-7130ceb311e7 | skolanko222/AGH | metody_numeryczne/sem4/lab13/lab13.cpp | #include <stdio.h>
#include <math.h>
int main()
{
const double a = 1;
const double b = 1;
const double c = 1;
const double d = 1;
double K = 1;
double Z = 0.5;
double t0 = 1;
double tK = 40;
double dt = 0.1;
//Euler
double t = t0;
for(double i = t0; i < tK; i+=dt){
... | ALGO | 0.99995 | 3.950201 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2023-03-14T21:18: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": "58eb224b69... |
241be0f9-62e5-4665-9c88-cbb99526a594 | ericpzh/UIUC | CS225/exam-reports/Exam12/programming_graphs_edge_list/graph.cpp | #include "graph.h"
/**
* Constructor to create an empty graph.
* @param isWeighted - specifies whether the graph is a weighted graph or not
*/
Graph::Graph()
: graph(VertexMap()),
vertexLabels(VertexLabelMap()),
//random(47),
vertexCounter(0)
{ /* nothing */
}
/**
* Constructor to create an ... | TOOL | 0.960876 | 5.445337 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-12-08T02:08:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 33
},
"file_meta": {
"content_id": "e186fd944... |
1082ee16-3b6d-4092-8929-16dba06ca7ce | PacktPublishing/Cpp-High-Performance | ThirdParty/include/range/v3/algorithm/count.hpp | /// \file
// Range v3 library
//
// Copyright <NAME> 2014
//
// Use, modification and distribution is subject to 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)
//
// Project home: https://github.com/ericniebler/range-v3
//
#... | ALGO | 0.977549 | 7.661813 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-01-30T12:03:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 258,
"forks": 86,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2d868fc... |
5d43b7f9-8c6f-4147-9350-33b4c30aae72 | xconfigurator/test_20200428_c_cpp | 04_OJ/hdu/1102.cpp | /**
* @file 1102.cpp
* @author liuyang copy from tianqin
* @brief MST Kruskal
*
注意审题。本题的下标从1开始。
Sample Input:
3
0 990 692
990 0 179
692 179 0
1
1 2
Sample Output:
179
* @version 0.1
* @date 2021-12-07
*
* @copyright Copyright (c) 2021
*
*/
#include <iostream>
#include <algorithm>
using namespace std;
... | ALGO | 0.999867 | 4.3834 | {
"github_metadata": {
"branch": "master",
"commit_count": 278,
"repo_created_at": "2020-04-28T08:51:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e45ef680... |
30fc4eda-b96e-4ef3-bdbd-8420119109db | Willu12/AiSD | Trees/RST_add_print_lowest_level.cpp | /*
Dane jest drzewo RST, w którego węzłach znajduje się klucz 8-bitowy oraz licznik (counter).
- wstawianie liczby 8-bitowej (uaktualniania licznika, jeśli element już istnieje) do tego drzewa
- wypisywania par (key,counter) elementów znajdujących się na ostatnim istniejącym
poziomie drzewa
*/
#include <iostream>
#... | ALGO | 0.998676 | 4.188213 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2023-02-17T21:30: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": "b62a3074438... |
701d82dd-263c-4d54-8549-ec0cdc9d6877 | towhid1zaman/UVA-Problem-solve | 11889 Benefit.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair <int, int> pii;
typedef vector<pii>vip;
#define all(v) (v).begin(),(v).end()
#define sp(x,k) cout<<setprecision(k)<<fixed<<x<<endl;
#define rep(i,a,b) for(int i =(a); i <=(b); ++i)
#define mi... | ALGO | 0.999971 | 4.640052 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2019-10-27T09:40: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": "193b2d022... |
39e5e8f0-400a-4558-90c2-51dcfe83921f | gyodaesaeng/ps | baekjoon/N10531.cpp | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef complex<double> base;
void fft(vector<base> &a, bool invert)
{
int n = a.size();
for (int i = 1, j = 0; i < n; i++)
{
int bit = n >> 1;
for (; j >= bit; bit >>= 1)
j -= bit;
j += bit;
if (i < j)
swap(a[i], a[j]);
}
for (... | ALGO | 0.999969 | 3.650107 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2021-09-12T13:41:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76caf4a5... |
d1430db6-b598-4d63-9b06-ee0a79c1d9aa | rsadhu/Work | playground/cpp/main.cpp | #include <functional>
#include <vector>
#include <iostream>
#include <assert.h>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <functional>
#include <iostream>
#include <string_view>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
/*
* Complete the class 'xcalla... | ALGO | 0.999472 | 5.183188 | {
"github_metadata": {
"branch": "trunk",
"commit_count": 467,
"repo_created_at": "2012-09-11T17:11:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "807610bb0... |
bb6dc11e-e368-4756-a268-d71f37dd93d4 | kisang0365/baekjoonAlgorithm | 2146.cpp | /*
* 2146.cpp
*
* Created on: 2017. 7. 31.
* Author: chokisang
*/
#include<iostream>
#include<queue>
using namespace std;
int N;
int Board[101][101];
int Sum[101][101];
int visit[101][101];
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
struct Node{
int x;
int y;
int n;
int number;
Node(int x... | ALGO | 0.999857 | 3.91928 | {
"github_metadata": {
"branch": "master",
"commit_count": 173,
"repo_created_at": "2017-03-25T07:40: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": "0d968058... |
a6fcc27c-6510-43b1-84d2-75d0c63dcdfd | bvchnguyen/mini_Git | miniGit.cpp |
// CSCI 2270 -- Spring 21
// Final Project -- Mini_Git
// Group Members: <NAME>, <NAME> and <NAME>
#include <iostream>
#include "miniGit.hpp"
#include <filesystem>
#include <fstream>
namespace fs = std::filesystem;
miniGit::miniGit() // Constructor
{
DLLhead = nu... | TOOL | 0.922428 | 5.678863 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2021-04-17T03:22:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "85c232891... |
8a40150b-61a6-4bbe-8ab3-de6d50b8e8b9 | Elkayee/CPP | b_08.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
// ==== Bai 8: So co 3 uoc
void sieve(int max_limit, vector<bool> &is_prime) {
is_prime.assign(max_limit + 1, true);
is_prime[0] = false;
is_prime[1] = false;
for (int i = 2; i * i <= max_limit; ++i) {
if (is_prime[i]) ... | ALGO | 0.999813 | 4.839261 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-21T16:56: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": "1d6834b8342a... |
1d13ceb2-18cf-4ebf-8b0f-542967b91dbb | liangyh911/FT-cutlass | clock_profile/gemm_kernel.h | /***************************************************************************************************
* Copyright (c) 2017 - 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are p... | ALGO | 0.998819 | 7.145526 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2025-04-06T21:44: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": "0a11df843af... |
47da48c3-cb9d-4acf-9089-bc43671f1f47 | scipy/scipy | scipy/special/ellint_carlson_cpp_lite/ellint_arithmetic.hh | #ifndef ELLINT_ARITHMETIC_HH_INCLUDED
#define ELLINT_ARITHMETIC_HH_INCLUDED
/* Algorithms for accurate floating-point summation, dot-product, and
* polynomial evaluation.
*
* Ref:
*
* [1] <NAME>, <NAME>: Compensated Horner scheme in complex
* floating point arithmetic.
* 2008-07-07, Proc. 8th Conf. R... | ALGO | 0.998461 | 6.843167 | {
"github_metadata": {
"branch": "main",
"commit_count": 35672,
"repo_created_at": "2011-03-09T18:52:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13826,
"forks": 5417,
"issues": 1470,
"pull_requests": 278
},
"file_meta": {
"content_id"... |
0f9acf55-0997-44d0-b015-e0143b0ca0eb | Jorge-D-Robles/coding-practice | 211/8queens/dumbqueens.cpp | /*
@author: <NAME>
@version 1.0: 01/12/2023
@description: 8 queens problem, the dumb way using 8 for loops
reused print function from prior 8queens, minor adjustments to ok function in
order to work with 8 for loops
*/
#include <cmath>
#include <iostream>
using namespace std;
void print(int q[], int sol) {
cout << "S... | ALGO | 0.998239 | 4.861319 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2022-09-26T14:28: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": "dc96eb1b2... |
a921cb83-ee98-4e88-abc2-9ae83ea8854b | youlingman/leetcode | Binary_Tree_Maximum_Path_Sum.cpp | /* Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum.
The path may start and end at any node in the tree.
For example:
Given the below binary tree,
1
/ \
2 3
Return 6.
Solve it in simple recursive way at last!
*/
/**
* Definition for binary tree
* struct TreeN... | ALGO | 0.999984 | 6.023211 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2014-08-04T13:15: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": "6a1b8676b... |
bda3ebb7-2cf4-41db-ba81-8c5fd28d4129 | Abuessa265/Cpp_And_Python_Code | Codeforces/Code/A_Sum_ofRoundNumbers.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
vector<int> v;
int a, mod;
cin >> a;
if (a % 10 != 0)
{
v.push_back(a % 10);
}
mod = a % 10;
a = a - mod;
if (a % 100 != 0)
{
v.push_b... | ALGO | 0.999491 | 3.763577 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-02-18T14:48: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": "8186f9c66174... |
e1260665-12cb-4c40-b10a-80c6539c5726 | mongodb/mongo | src/mongo/db/matcher/expression_simplifier.h | /**
* Copyright (C) 2023-present MongoDB, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program is distributed in the hope that it will be useful,
* but W... | TOOL | 0.920773 | 6.718904 | {
"github_metadata": {
"branch": "master",
"commit_count": 90314,
"repo_created_at": "2009-01-15T16:15:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 27329,
"forks": 5655,
"issues": 0,
"pull_requests": 82
},
"file_meta": {
"content_id": ... |
6eac6d48-2ec2-495a-bd0c-622ba3045fdb | nicolaslesimple/Hybrid-MPI-OpenMP-Conjugate-Gradient-Algorithm | conj_grad_solve.cpp | #include "conj_grad_solve.hpp"
#include <omp.h>
#include <time.h>
#include <chrono>
/*****************************************************************************
Conjugate Gradient Algorithm cpp file
Implementation of the main functions for the parallel Conjugate Gradient
algorithm used in the m... | ALGO | 0.999979 | 5.045438 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-06-09T21:19:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4bac2ab314... |
6f772fe4-afc2-4e11-91e7-36acafbe1c36 | SuspectZro/toyEngine | toyEngine/src/CollisionSystem.cpp | #pragma once
#include "Types.h"
#include "CollisionSystem.h"
#include <algorithm>
using namespace data;
CollisionResult CheckCollisionX(const Collision& col1, const Position& pos1, const Collision& col2, const Position& pos2) {
CollisionResult result;
// Adjusted rectangles based on scale
real left1 = p... | ALGO | 0.987193 | 6.195297 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2022-09-30T11:21:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32a965bcc0e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.