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 |
|---|---|---|---|---|---|---|---|
82479876-a4df-43e3-8023-22103e3a7b56 | Lab41/PySEAL | SEAL/legacy/keygenerator.cpp | #include <algorithm>
#include <random>
#include "keygenerator.h"
#include "util/uintcore.h"
#include "util/uintarith.h"
#include "util/uintarithmod.h"
#include "util/polyarith.h"
#include "util/polyarithmod.h"
#include "util/polyfftmultmod.h"
#include "util/randomtostd.h"
#include "util/clipnormal.h"
#include "util/pol... | ALGO | 0.999745 | 6.855678 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2017-10-19T18:53:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 230,
"forks": 84,
"issues": 12,
"pull_requests": 0
},
"file_meta": {
"content_id": "495740... |
06c6f727-4413-4161-a70f-a97acc7444f4 | pijuma/Lib | C++/ED/SegTree/seg_com_lazy.cpp |
struct SEG{
void flush(int no, int i, int j){
if(!lazy[no]) return ;
tree[no] += (j-i+1)*lazy[no] ;
if(i!=j){
lazy[esq] += lazy[no] ;
lazy[dir] += lazy[no] ;
}
lazy[no] = 0 ;
}
void build(int no, int i, int j){
if(i == j){
lazy[no] = 0... | ALGO | 0.999857 | 4.011871 | {
"github_metadata": {
"branch": "main",
"commit_count": 302,
"repo_created_at": "2023-08-16T17:31:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "0a62fb3663... |
7a24f2f7-3981-4e9a-9fd4-4071affa4172 | alaneos777/club | mog/9640.cpp | #include <bits/stdc++.h>
using namespace std;
int f(char c){
if(c == 'G') return 1;
return 0;
}
int main(){
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int m, n;
cin >> m >> n;
int cnt_g = 0;
vector<vector<char>> grid(m, vector<char>(n));
vector<vector<int>> mat(m, vector<int>(n-1)), acum(m, vector... | ALGO | 0.999206 | 3.440638 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-08-06T04:13:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bda8ebe3... |
31ed3f25-6f82-48ca-8a03-0f62c64d8bf1 | Souravrao-31/Data-Structure-and-Algorithms | Number Theory/prateek_loves_Candy.cpp | #include <iostream>
#include <vector>
/*
Prateek recently graduated from college. To celebrate, he went to a candy shop and bought all the candies. The total cost was a number upto which there are n prime numbers (starting from 2). Since Prateek wants to minimize his cost, he calls you to help him find the minimum amo... | ALGO | 0.999848 | 4.812943 | {
"github_metadata": {
"branch": "master",
"commit_count": 166,
"repo_created_at": "2020-05-27T12:26:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 35,
"issues": 0,
"pull_requests": 11
},
"file_meta": {
"content_id": "95153... |
0c0c9d3b-faa8-484c-88f0-4dd8e207e67b | WelsTheory/PIC16F877A---TUTORIAL- | Display_7seg.X/Retardos.inc | CBLOCK 0x20
CUENTA
CUENTA_2
ENDC
Retardo_400ms
CALL Retardo_20ms
CALL Retardo_20ms
CALL Retardo_20ms
CALL Retardo_20ms
CALL Retardo_20ms
CALL Retardo_20ms
CALL Retardo_20ms
CALL Retardo_20ms
CALL Retardo_20ms
CALL Retardo_20ms
CALL Ret... | TOOL | 0.9541 | 4.058526 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-11-26T12:50:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 18,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d745fe... |
b32dd14f-665f-482c-99a9-4acc28e5f82c | daviskimCS/CombatChaosRPG | source/combat.cpp | #include "../header/combat.h"
#include "../header/character.h"
#include "../header/player.h"
#include "../header/enemy.h"
#include <iostream>
using namespace std;
//compares both character's speeds to determine who attacks first
bool Combat::compareSpeed() {
if (player->getSpeed() > enemy->getSpeed()) {
... | ALGO | 0.995833 | 4.566795 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-03-25T00:12: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": "dfff6ccaf45f... |
754d7de7-a110-4e6d-9b03-0e7f7ca2fb1c | xiguazi1979/c_learning | NOIP/Challenge_programming/2_2_2.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
const int MAX_N = 5;
const int N = 5;
const int S[MAX_N] = {1, 2, 4, 6, 8}; // task start time
const int t[MAX_N] = {3, 5, 7, 9, 10}; // task end time
pair<int, int> itv[MAX_N];
void solve()
{
int answer = 0, time = 0;
for (int i = 0; i < N; i... | ALGO | 0.999826 | 3.720329 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-12-29T07:37: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": "22b8b876b0d... |
84fd1ea6-30ae-45e6-a8b2-e7eaf8dd6b62 | Lyechen/-Python-C- | C++/nlogN/nlogN/SortHelper.h | #ifndef NLOGNSORT_SORTHELPER_H
#define NLOGNSORT_SORTHELPER_H
#include <iostream>
#include <algorithm>
#include <ctime>
#include <string>
#include <cassert>
using namespace std;
namespace SortHelper{
template<typename T>
bool isSort(T arr[], int n){
/*判断是否是一个升序排列完毕的数组*/
for (int i = 0; i < n - 1; i++)
if (ar... | ALGO | 0.990941 | 5.232391 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-12-26T06:43: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": "4af0702c3e... |
02610cc8-4680-4ebe-ae5d-1f1a29192b8e | lbwei1016/Competitive-Programming | ICPC/20-21-Petrozavodsk/aaaa.cpp | #include <bits/stdc++.h>
#define io cin.tie(NULL), ios_base::sync_with_stdio(false)
using namespace std;
using ll = long long;
const int N = 1005, M = 15;
int G[M][N];
struct P {
int cnt;
vector<pair<int, int>> at;
P (): cnt(0) { at.clear(); }
};
bool ok[M];
bool check(int m) {
for (int i=0; i<m; ++... | ALGO | 0.999973 | 3.275116 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2022-03-25T06: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": "999878e17d6... |
1bf1211b-4e37-4237-a36d-82e9ab3e030e | juneh2633/Algorithm | 백준/Gold III/1238. 파티/파티.cc | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
int INF = 1e9;
const int MAX_N = 222222;
int n, m, x;
int dist[MAX_N];
vector<int> solution(int start, vector<pii> *graph) {
fill(dist, dist + MAX_N, INF);
priorit... | ALGO | 0.999984 | 4.448746 | {
"github_metadata": {
"branch": "main",
"commit_count": 213,
"repo_created_at": "2023-12-03T15:14: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": "c2dd3a9962... |
855a0ee2-a553-4f6c-b401-98a34c14051c | kristi141/control-tests | third test.cpp | /*RU
В магазине существует n касс, но как всегда работают из них всего 2.
Известно, что в магазин планируют прийти k клиентов, для каждого из клиентов
известно два значения m - время его прихода в магазин, t - время, за которое
его обслужат на кассе. (По счастливой случайности благодаря большим данным
клиенты еще ... | ALGO | 0.999968 | 4.360992 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-07-07T07:51:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9aa7dd03cde8... |
60aa2ef5-f5e5-441b-9568-7adc8dff226d | IstiaqueShubho/Competitive-Programming | Template/Longest Increasing Subsequence Nlogn.cpp | //<NAME>
//Lightoj 1421
#include<bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define debug(x) cout << #x << ": " << x << "\n";
using namespace std;
const int maxn = 1e5+5;
int n;
int arr[maxn];
int decdp[maxn],incdp[maxn];
void solvedec()
{
int tmp[n+5];
int len = 0;
for(int i ... | ALGO | 0.999762 | 3.999359 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2019-02-05T15:27: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": "5e9a55991... |
5fe6a137-9fa2-442e-ac6d-74f88a73f0a9 | hynseok/algorithm | legacy/boj/1753.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 1e9
priority_queue <pair<int,int>> label;
vector <pair<int,int>> Graph[20001];
int dist[20001];
int v, e, k;
void dijkstra(int start){
dist[start] = 0;
label.push({0, start});
while(!label.empty()){
int cost = -label.top().first;
... | ALGO | 0.999993 | 4.310533 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-06-20T06:21: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": "96d98aa3b9f... |
8b49fd9e-ef33-4b17-a84d-79688fd0c6b8 | ruscot/snark-protocol-experiment | libsnark-experiment/src/r1cs_update_keys.tcc | /**
* @file r1cs_update_keys.tcc
* @author <NAME>
* @brief Contained the defintion of the function to check the update of the key
* @version 0.1
* @date 2022-07-29
*
* @copyright Copyright (c) 2022
*
*/
#ifndef R1CS_UPDATE_KEYS_TCC_
#define R1CS_UPDATE_KEYS_TCC_
#include "r1cs_update_keys.tcc"
template <ty... | TOOL | 0.997448 | 4.524851 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2022-02-25T10:48: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": "c61941689b... |
1ced96b7-5dc5-469f-9599-02ea99e94433 | anikolaienko/Algorithms | data_structs/hash_table.cc | #include <cstring>
struct Item {
int key, val;
Item* next = nullptr;
Item(int key_, int val_) : key{key_}, val{val_} {}
};
class MyHashMap {
Item **map_;
int size_ = 9973, max_depth = 1;
public:
/** Initialize your data structure here. */
MyHashMap() {
map_ = new Item*[size_];... | ALGO | 0.998493 | 5.717587 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2020-02-11T11:52:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aebad1d84... |
c0a1cf58-e187-4dde-9c20-b0f352ae7f37 | badri7489/Code_snippets | Linked List/09_reverse_linked_list_in_groups_of_k.cpp | /**
* We have to reverse the linked list on groups of k and if the last group is less than k then we must leave it as it is.
* We take a dummy node and point it to the head of the linked list.
* Then for the first k elements we have to reverse the links of k - 1 elements.
* Then this process will continue until... | ALGO | 0.999998 | 5.827833 | {
"github_metadata": {
"branch": "main",
"commit_count": 359,
"repo_created_at": "2021-07-30T12:07: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": "785494a707... |
f0600d62-928c-4b02-92c3-0f3ac5674c83 | cauimsouza/uva-solutions | adhoc/10813.cpp | #include <bits/stdc++.h>
using namespace std;
#define rec(i, a, b) for(int i = (a); i <= (b); i++)
int main(int argc, char const *argv[])
{
int diagonalp, diagonals;
int p_linhas[10], p_colunas[10];
int games, x, rodada, numeros;
bool bingo; // ja deu deu bingo?
map<int, pair<int,int> > cartao; // numero x, na l... | ALGO | 0.998453 | 3.749183 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2015-12-20T01:42:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94f4225a0... |
06dbdfcc-bf5e-49ee-9fc1-d5a9a358da49 | Alienworm/work | 2/2.2.CPP | #include <iostream>
#include <string>
#include <windows.h>
#include <conio.h>
using namespace std;
typedef int Element;
typedef struct node {
Element data;
struct node *next;
}ListNode;
class List {
public:
void InitList(); // 初始化链表
bool DestoryList(); ... | ALGO | 0.997802 | 4.022501 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2018-10-25T05:02:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcfebb317... |
275a755d-39ab-47f1-b1c5-741bb5400b17 | vatican1/-Numerical-Methods | 4.cpp | #include <iostream>
#include <time.h>
float sum_accum(float* x, int n)
{
float sum = 0;
for(int i = 0; i < n; ++i) sum += x[i];
return sum;
}
float pairwise_sum_simd(float* x, int n)
{
int k = 2;
while (k <= 2 * n)
{
#pragma omp simd
for(int i = 0; i < n; i += k)
{
... | ALGO | 0.999779 | 5.270227 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-03-02T19:15: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": "2fe11acd32... |
b9490c64-323c-4ede-9f97-bcd92fd14a9f | luisenp/mdp-lib | src/domains/ctp/CTPState.cpp | #include "../../../include/domains/ctp/CTPState.h"
#include "../../../include/domains/ctp/CTPProblem.h"
#include "../../../include/util/general.h"
CTPState::CTPState(CTPProblem* problem)
{
problem_ = problem;
location_ = 0;
initAllUnkown();
badWeather_ = ctp::UNKNOWN;
}
CTPState::CTPState(CTPProblem*... | ALGO | 0.996538 | 5.563475 | {
"github_metadata": {
"branch": "master",
"commit_count": 628,
"repo_created_at": "2014-05-09T15:14:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 4,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "cace72c... |
35d2c6b4-4cfa-49c7-ac3a-39c65c5803ca | Smorodov/Multitarget-tracker | src/Tracker/graph/gml2nestedsql.cpp | // $Id: gml2nestedsql.cpp,v 1.2 2006/03/24 15:06:57 rdmp1c Exp $
#include <iostream>
#include <fstream>
#include <GTL/GTL.h>
#include <GTL/dfs.h>
#include "mygraph.h"
#include "mytree.h"
#include <time.h>
void Tokenise (std::string s, std::string delimiters, std::vector<std::string> &tokens);
void Tokenise (std... | DATA | 0.902156 | 3.255722 | {
"github_metadata": {
"branch": "master",
"commit_count": 1129,
"repo_created_at": "2013-08-01T05:09:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2293,
"forks": 662,
"issues": 81,
"pull_requests": 0
},
"file_meta": {
"content_id": "e... |
e76ff41d-503e-49ac-a5d5-8a89bd02f8e7 | Tagore22/algorithmSolve | algorithmSolve/백준/1325.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
//풀이
//A가 B를 신뢰한다는건 B를 해킹했을때 A로 넘어갈수 있다는것을 뜻한다. 그럼으로 2차원 벡터를 생성하여 A가 B를 신뢰할때
//board[B]에 A를 넣어 그 다음으로 도달할수 있다는걸 기록해둔다. 그 이후 1~N번 컴퓨터에서 시작하여 도달할수 있는 최대값을
//계산하여 가장 많이 도달할수 있는 컴퓨터의 번호를 출력한다.
vector<vecto... | ALGO | 0.999998 | 4.160804 | {
"github_metadata": {
"branch": "master",
"commit_count": 1452,
"repo_created_at": "2022-04-27T10:40: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": "5920d58... |
9b7ef7f8-4bac-4c18-9105-2de7fa0e3d77 | jmackey-astro/PION | source/boundaries/NG_MPI_fine_to_coarse_boundaries.h | /// \file NG_MPI_fine_to_coarse_boundaries.h
/// \brief Class declaration for NG_fine_to_coarse boundaries
/// \author <NAME>
///
/// Modifications :\n
/// - 2018.08.24 JM: writing parallel algorithms
#ifndef NG_MPI_FINE_TO_COARSE_BOUNDARIES_H
#define NG_MPI_FINE_TO_COARSE_BOUNDARIES_H
#include "defines/functionalit... | ALGO | 0.964247 | 6.197317 | {
"github_metadata": {
"branch": "master",
"commit_count": 1415,
"repo_created_at": "2020-08-20T10:44:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15f9fd2... |
89a6e530-5be3-4d8c-8fe5-0025395ea8e5 | hsj4436/Algorithm | 프로그래머스/2/17687. [3차] n진수 게임/[3차] n진수 게임.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
string solution(int n, int t, int m, int p) {
string answer = "";
int number = 0;
int person = 0;
if (person + 1 == p) {
answer.push_back('0');
}
number = 1;
person = 1;
while (answer.size() != t... | ALGO | 0.999837 | 5.427093 | {
"github_metadata": {
"branch": "master",
"commit_count": 623,
"repo_created_at": "2023-12-12T13:04:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73f515c7... |
fab4313a-3a22-4640-8650-ae6f27177c82 | mohit0-0rai/Data-Structures-and-Algorithms | Competitive_Programming/spoj/cpcrc1c.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define MOD 1000000007
ll dp[20][2][180];
int calcDigits(ll num, vi& dig) {
while(num) {
dig.push_back(num % 10);
num /= 10;
}
return dig.size();
}
ll calcDigSum(int idx, bool edge, ll sum, v... | ALGO | 0.999583 | 4.37039 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-09-29T09:06: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": "acfec2687... |
6c9c0f36-e2e4-4720-89ab-956f3018c556 | izumo27/competitive-programming | AtCoder/AGC/031-040/037/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for... | ALGO | 0.999816 | 4.13559 | {
"github_metadata": {
"branch": "master",
"commit_count": 401,
"repo_created_at": "2018-03-03T08:47: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": "29f01402... |
317abb12-9944-421e-b457-93acf9a36466 | Ayushluthra2001/LeetCodePOTD | Naming a Company(TLE).cpp | class Solution {
public:
long long distinctNames(vector<string>& ideas) {
unordered_map<string ,int>mapping;
unordered_map<char ,vector<string>>mapping2;
for(auto i : ideas){
mapping[i]++;
mapping2[i[0]].push_back(i);
}
int count=0;
// for(auto... | ALGO | 0.999962 | 4.705388 | {
"github_metadata": {
"branch": "main",
"commit_count": 693,
"repo_created_at": "2022-09-23T06:55: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": "d988203959... |
f000b5f8-7a71-4754-9076-4e9c061a0599 | Harshitrai01/DSA-GFG-Solutions | Basic/Number of occurrence/number-of-occurrence.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
//User function template for C++
class Solution{
public:
int first(int arr[], int n, int x){
int low=0,high=n-1;
while(low<=high){
int mid=low+(high-l... | ALGO | 0.999852 | 5.751378 | {
"github_metadata": {
"branch": "main",
"commit_count": 462,
"repo_created_at": "2023-02-05T08:21:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "446705f388... |
050ceb65-3f08-42c6-a505-95e24c5fa4a6 | buiquoccuongk8lk/2024 | 17.08.2024/emseecay.cpp | #include <bits/stdc++.h>
using namespace std ;
#define int long long
typedef long long ll ;
typedef pair<int, int> ii ;
typedef vector<int> vi ;
typedef vector<ii> vii ;
#define fi first
#define se second
#define pb push_back
#define endl '\n'
#define all(a) a.begin(),a.end()
#define FOR(i,a,b) for(int i(a) ; i <=... | ALGO | 0.9954 | 3.871278 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2024-08-05T03:06:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf6224bcaad... |
ccfcc082-c036-4244-b685-db40dfe2fcf3 | lamweicheng/FoothillCollege-CS2C | A18.1.cpp | // CS 02C Assignment #7 - Analyzing Shellsort's Gaps
// Client code
#include <iostream>
#include "shellSortX.h"
#include <time.h>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int arraySize;
vector<int> gapBasic = getBasicSequence();
vector<int> gapSedgewick = getSedgewickSeque... | ALGO | 0.997987 | 4.266394 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-10-31T23:34: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": "ce2e55e027f0... |
deb96552-63d1-4a9a-a5e7-e7d64148f84e | limyeonsoo/Algorithm | samsung/17143_낚시왕.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
struct King {
int r;
int c;
int getShark;
};
struct Shark {
int speed;
int direct;
int size;
};
int dx[5] = { 0, 0, 0, 1, -1 };
int dy[5] = { 0, -1, 1, 0, 0 };
int R, C, M, r, c, s, d, z;
King king = { 0,0,0 };
vec... | ALGO | 0.9998 | 4.060835 | {
"github_metadata": {
"branch": "master",
"commit_count": 152,
"repo_created_at": "2020-03-16T15:10: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": "a0a6846f... |
26eda059-2740-47e1-9d02-b1609c104d73 | Manvityagi/Codechef-Codeforces-spoj | CODEFORCES/DIVISON 3/661/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define LL long long
#define int LL
#define ULL unsigned long long
#define LB lower_bound
#define MOD1 1000000007
#define MOD2 1000000009
#define loop(i, a, b) for (int i = a; i < b; i++)
LL n, m;... | ALGO | 0.99997 | 4.342192 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2019-08-10T02:15:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c992ae6e7... |
5730d099-41b2-4b3e-86ba-35de3f8ce9c4 | cms-sw/cmssw | RecoMET/METAlgorithms/src/SignCaloSpecificAlgo.cc | // -*- C++ -*-
//
// Package: METAlgorithms
// Class: SigInputObj
//
// Original Author: <NAME>, <NAME> (Cornell University)
// Created: Fri Apr 18 11:58:33 CEST 2008
//
//
//____________________________________________________________________________||
#include "RecoMET/METAlgorithms/interface/SignC... | ALGO | 0.975273 | 6.186694 | {
"github_metadata": {
"branch": "master",
"commit_count": 251237,
"repo_created_at": "2013-06-26T14:09:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1144,
"forks": 4480,
"issues": 947,
"pull_requests": 108
},
"file_meta": {
"content_id... |
a5d3f9bc-89ea-4286-9678-912e40b49a4d | vijayphoenix/IITH-BTECH-Courses | 2nd-Sem/CS1353 Introduction to Data Structures/CS17BTECH11040_Q1.cpp | #include <stdio.h>
int top=0;
int size;
int stack[100]={0};
int isEmpty()
{
return top==0?1:0;
}
int isFull()
{
return top==size?1:0;
}
void display()
{
int i=0;
if(isEmpty()==0){
printf("Elements - ");
for(i=0;i<top;++i){
printf("%d , ",stack[i]);
}
printf("\n");
}
else printf("St... | ALGO | 0.995269 | 3.674845 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-02-11T21:03:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f2c7a9c3... |
23283132-d77b-4f05-9426-8bd913dd0eeb | dsc-sookmyung/2023-02-Algorithm-Study | 03-Recursion-Backtracking/06_ll/B-17829.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#define MAX_SIZE 1025
using namespace std;
int N, re_N;
int falling[MAX_SIZE][MAX_SIZE];
queue<int> q;
bool compare(int a, int b) {
if (a > b) return true;
else return false;
}
void submatrix(int x, int y) {
vector<int> v;
f... | ALGO | 0.999974 | 3.596506 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2023-10-31T18:23:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eefd97650e4... |
ebd5414d-e704-49d3-9ca9-536ff092e302 | falconlee236/Algorithm_Practice | BaekJoon/17144.cpp | /*17144*/
/*Got it!*/
#include <iostream>
#include <queue>
#include <tuple>
using namespace std;
int air[55][55];
int main(){
int r, c, t; cin >> r >> c >> t;
int cond = 0;
for(int i = 0; i < r; i++) for(int j = 0; j < c; j++) cin >> air[i][j];
for(int i = 0; i < r; i++){
if(air[i][0] == -1){
... | ALGO | 0.999974 | 3.981315 | {
"github_metadata": {
"branch": "main",
"commit_count": 828,
"repo_created_at": "2021-07-30T10:24:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0dd3e4093f... |
0f8bad04-21e4-4741-bc54-b2cfdde94e4d | ishandutta2007/codeforces-u | usedtobe/normal/853/C.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int M = 6666666, N = 222222;
ll C(int x) {return 1ll * x * (x - 1) / 2;}
int tot, lc[M], rc[M], sum[M];
int a[N];
void add(int &cur, int pre, int l, int r, int p) {
cur = ++tot;
lc[cur] = lc[pre];
rc[cur] = rc[pre];
sum[cur] = sum[pre] + 1;
i... | ALGO | 0.999713 | 4.810314 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0387e3de5cad... |
686d6827-f294-4c62-97d2-f9cf98c358db | cgogn/CGoGN | CGoGN/include/Algo/Geometry/convexity.hpp | /*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg ... | ALGO | 0.996204 | 6.414248 | {
"github_metadata": {
"branch": "master",
"commit_count": 3008,
"repo_created_at": "2012-03-09T11:43:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 48,
"forks": 20,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "338658... |
54d72c23-787c-4696-a42b-2b6949acc57a | joaopaulocastilho/aBNT-Codes | URI/1103-TIMMY.cpp | /* \ */
#include <stdio.h>
#include <stdlib.h>
int main(void){
int h1, m1, h2, m2, a;
scanf("%d %d %d %d", &h1, &m1, &h2, &m2);
while(h1 != 0 || h2 != 0 || m1 != 0 || m2 != 0){
if(h2 <= h1 && m2 < m1){
a = (h2 + 24 - h1)*60 + (m2-m1);
}
else if(h2 == 0){
h2 = 24;
a = (h2 - h1)*60 + ... | ALGO | 0.999835 | 3.403443 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2017-09-19T17:43:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e41e19fa... |
6b501c61-2ac4-48e6-a425-a98a4176274f | Marsgoat/leetcode-practice | Linked_List/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List/1171.cpp | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(NULL) {}
ListNode(int x, ListNode* next) : val(x), next(next) {}
};
class Solution {
public:
// prefix sum
ListNode* removeZeroSumSublists(ListNode* ... | ALGO | 0.999829 | 5.557702 | {
"github_metadata": {
"branch": "main",
"commit_count": 127,
"repo_created_at": "2023-12-25T06:14: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": "827b4caf50... |
926dbf08-6e07-425f-9bdc-81891c765d0b | Rad11k/laba4 | array.cpp | #include <iostream>
#include "array.h"
using namespace std;
Array::Array(int size, int step) {
if (size <= 0) size = 10;
if (step <= 0) step = 5;
this->initialSize = size;
this->step = step;
this->data = new int[size];
this->currentIndex = 0;
}
Array::Array(const Array& other) {
initialSi... | TOOL | 0.913781 | 4.64592 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-06-03T08:25: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": "f4c91e093f11... |
5eb9bef1-c7bd-4b65-8e6c-26ba6fb097e5 | ibaned/omega_h2 | src/swap2d_qualities.cpp | #include "swap2d.hpp"
#include "access.hpp"
#include "loop.hpp"
#include "quality.hpp"
#include "simplices.hpp"
namespace Omega_h {
template <typename Measure, Int dim>
static Reals swap2d_qualities_tmpl(Mesh* mesh, LOs cands2edges) {
auto ev2v = mesh->ask_verts_of(EDGE);
auto tv2v = mesh->ask_verts_of(TRI);
a... | ALGO | 0.995893 | 6.306445 | {
"github_metadata": {
"branch": "master",
"commit_count": 1756,
"repo_created_at": "2016-11-12T21:00: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": "8a65fe7... |
9404a493-56aa-4ab8-9d90-7e69561f6cd9 | Juless03/Caso2-AA | InsertionSort.cpp | /* ITCR. Ing.Computación.
Análisis de algoritmos. GR 1
Caso #2. Insertion Sort lineal y cuadrático
Autora: <NAME>.
*/
#include <iostream>
#include <vector>
#include <ctime>
using namespace std;
#define test1 //arrays con diferentes numeros de elementos para pruebas
int arr1[1000];
int arr2[2000];
... | ALGO | 0.988406 | 5.047703 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-03-16T05:28: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": "a82a1ee98a12... |
34a31209-2086-450a-a298-6fd3c75eb4b2 | ishandutta2007/codeforces-r | rubikun/normal/878/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define ... | ALGO | 0.999932 | 3.809588 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "190c661b5637... |
81a74f43-213a-4df3-910a-f1cecaba928f | Nonbangkok/Competitive_Programming | Contest/CodeCube/027_Bulb.cpp | #include <bits/stdc++.h>
#define coutf(n, m) cout << fixed << setprecision(n) << m
#define forr(i, a, n) for (int i = a; i < n; i++)
#define forl(i, a, n) for (int i = a; i > n; i--)
#define macos ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endll "\n"
#define sp " "
typedef long long ll;
using namespace std;... | ALGO | 0.999954 | 3.801531 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2024-11-23T11:55: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": "cfa196dd41a... |
e4332ddb-7525-432e-93be-37344492bd85 | zerocy18/algorithms | programmers/2458.cpp | #include <stdio.h>
int n, m;
int graph[501][501];
void input()
{
scanf("%d %d", &n, &m);
while (m--)
{
int a, b;
scanf("%d %d", &a, &b);
graph[a][b] = 1;
}
}
void floyd()
{
for (int k = 1; k <= n; k++)
{
for (int i = 1; i <= n; i++)
{
for (in... | ALGO | 0.99997 | 3.48622 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2020-04-28T12:28: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": "b74c439a... |
7c3f6740-0d51-49a9-9aac-dc37e052e1ed | JohnPapad/Distributed-File-Management-Tool | helping_funs.h |
#ifndef HELPING_FUNS_H
#define HELPING_FUNS_H
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <dirent.h>
#include <ctype.h>
#includ... | TOOL | 0.914642 | 3.431284 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-07-05T03:26:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5cb2d8589... |
9b30cfd7-0bac-4eca-9d73-24c6c4dc1d12 | marijaluksic/object-oriented-programming | Vjezbe6-Matrica,kopirni konstruktor, operator pridruzivanja/Source.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <vector>
#include <cstring>
using namespace std;
class Matrica {
public:
vector<int*> redak;
vector<int> stupac;
void dodaj(int brStupaca, int* _redak);
Matrica() {}
Matrica(const Matrica& m); //kopirni konstruktor (ima const i 1 refe... | TOOL | 0.961569 | 4.525122 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-04-04T19:02: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": "0872fdff54d6... |
32852f3d-14b7-4440-b9b0-b47d60c574bf | shankar55/CPP_programs | Linked_List/DetectandRemoveLoop/main.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
struct node{
int data;
struct node *next;
node(int data){
this->data=data;
next=NULL;
}
};
struct node *head=NULL;
void create_LL()
{
int num;
cin>>num;
struct node *new_node,*ptr;
new_node=new node(num);
... | ALGO | 0.999984 | 4.434438 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-09-26T17:27:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f97f6c08fd8e... |
500b2d34-23b1-488c-9152-6de730113422 | adrianalbert/EnergyAnalytics | HMM/Rcpp/baumWelch.cpp | /*
* baumWelch.cpp
*
* Last modified: March 12th, 2014
* Author: <NAME>
*
* HMM estimation via EM/Baum-Welch and Rcpp integration.
*
* Compile with:
* g++ -O3 HMMarma.cpp -o HMMarma -larmadillo
*
*/
// disable run-time bound checks
#define ARMA_NO_DEBUG
#include <armadillo>
#include <limits>
#inclu... | ALGO | 0.999862 | 6.354142 | {
"github_metadata": {
"branch": "master",
"commit_count": 270,
"repo_created_at": "2012-12-08T00:06:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2cc9ca8f... |
647d1296-1347-44d5-bc9b-6fb7cc8f7a94 | Olivyezhyk/Lab_12 | Lab_12_02_iter/Lab_12_02_iter.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* next;
};
int* generateArray(int& size) {
static int fixedArr[8] = { 3, 5, 3, 0, 5, 10, 2, 1 };
size = 8;
return fixedArr;
}
Node* createList(const int* arr, int size) {
if (size == 0) return nullptr;
Node* head = new ... | ALGO | 0.999947 | 5.4835 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-04-27T15:14: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": "c2f089f8f0... |
39516410-2efa-4c82-8fe9-d9228e2847d4 | arthursl12/PROG_COMP | Lista1/1642/1642.cpp | #include <iostream>
#include <stdlib.h>
#include <iomanip>
#include <set>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <unordered_set>
#include <cstring>
#define INF 0x3f3f3f
using namespace std;
void find_best_to_remove(string& substring, set<char>& chars_in_subbstring,
... | ALGO | 0.998835 | 4.128019 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2022-04-17T10:38: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": "2da96f6a7ec... |
41bbe833-2d24-4794-9b68-988519de3bcb | theharshest/leetcode_solutions | symmetric-tree.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
bool check_palindrome(vector<string>& p)
{
for(int i=0, j=int(p.size())-1; i<j; i++, j--)
... | ALGO | 0.999881 | 5.868197 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2014-11-18T10: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": "ed81cd06... |
d3223177-fed3-46b5-88f8-ad6db4577262 | kimkj38/cpp | 3장/3_7.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
class Random{
int n;
public:
Random(int num);
int next();
int nextInRange(int a, int b);
};
Random::Random(int num){
int n = num;
srand((unsigned)time(0));
}
int Random::next(){
int x = rand();
if (n % 2 == 0... | TOOL | 0.989448 | 3.890108 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2021-05-20T16:59:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9706a1bf... |
ad7480d0-fdd8-483a-8de3-7dd79f60967e | grahfoster/PPPUCPP | Exercises/Ch_11/Ex_13/Ex_13/Ex_13.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#include <algorithm>
void set_streams(std::ifstream&, std::ofstream&);
void reverse_file(std::ifstream&, std::ofstream&);
int main()
try {
std::ifstream ifs;
std::ofstream ofs;
set_streams(ifs, ofs);
reverse_file(ifs, ofs);
}
catch (std:... | ALGO | 0.994037 | 5.467991 | {
"github_metadata": {
"branch": "master",
"commit_count": 353,
"repo_created_at": "2020-06-26T18:56: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": "c43a538c... |
ddbdeced-dac6-4ffb-a777-fd717fdb6bf3 | poetries/Data-Structure | Haobin_Data-Structure/otherVersion/11-13/Arr.cpp | # include <stdio.h>
# include <malloc.h> //包含了malloc函数
# include <stdlib.h> //包含了exit函数
//定义了一个数据类型,该数据类型的名字叫做struct Arr, 该数据类型含有三个成员,分别是pBase, len, cnt
struct Arr
{
int * pBase; //存储的是数组第一个元素的地址
int len; //数组所能容纳的最大元素的个数
int cnt; //当前数组有效元素的个数
};
void init_arr(struct Arr * pArr, int length); //分号不能省
bool appen... | ALGO | 0.996864 | 3.5981 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2016-03-20T06:22:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 100,
"forks": 65,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fc070... |
b8a0876e-cfcc-491c-9ede-a96a8d78fd6e | burakcoskun/programming_contests | codeforces/educational_65/C/soln.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
int m... | ALGO | 0.999985 | 3.47687 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2018-05-18T09:14: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": "4c7e686a1... |
1d356ed1-59bf-4dec-b667-2ab0a2206594 | ujunhwan/algorithms_cpp | BAEKJOON/Graph/Djikstra/17833.cpp | // https://www.acmicpc.net/problem/17833
// 17833번 홍익대학교 지하캠퍼스
#include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
#define precision(x) cout << fixed; cout.precision(x)
#define pii pair<int, int>
using namespace std;
static const int INF = 0x7fffffff;
int N, R, D, M;
vector<int> dist;
vector<pii>... | ALGO | 0.999961 | 4.189689 | {
"github_metadata": {
"branch": "master",
"commit_count": 374,
"repo_created_at": "2020-02-26T12:18: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": "79d9d576... |
91dfed6f-96f3-4396-b7ff-05d435b3e68c | Geeky-Utkarsh/LeetCode_Questions | 179-largest-number/largest-number.cpp | class Solution {
public:
string largestNumber(vector<int>& nums) {
// if (nums[0] == 0) return "0";
bool allZero = true;
for (int num : nums) { // Handling edge cases when all elements in nums are zero
if (num != 0) {
allZero = false;
break;
... | ALGO | 0.999981 | 6.143244 | {
"github_metadata": {
"branch": "main",
"commit_count": 1328,
"repo_created_at": "2023-09-27T02:25:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fbe9b81e... |
8089bd0b-4d4f-446e-95bf-c43b22ca4572 | igormp/Genetic-8Queens-Embedded | desktop_test.cpp | #include <iostream>
#include <ctime>
#include "genetic.cpp"
#include <chrono>
int main(int argc, char const *argv[])
{
std::srand(std::time(nullptr));
uint32_t x = atoi(argv[1]);
uint32_t y = atoi(argv[1]);
auto start = std::chrono::steady_clock::now();
population pop(x);
int epochs = 0;
... | ALGO | 0.993321 | 5.360833 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2020-05-09T14:52: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": "24c5489f2... |
6443a680-8c8a-4aa1-b25e-6c3db3cb298b | kuang-ge/NurbsStudio | Models/QtGuiApplication1/PolyIGA.h | #pragma once
#include <algorithm>
#include "SplineSurface.h"
#include "SplineVolume.h"
#include "FittingBSpline.h"
#include "varray.h"
#include "definition.h"
#include "XIOStream.h"
#include "CNurbs.h"
using namespace std;
using namespace base;
using namespace bsl;
namespace base{
class CurveEdge
{
public:
in... | TOOL | 0.992489 | 3.29917 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-01-11T12:41:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "785c16798d5b... |
e230cac4-b8f0-4959-80ed-d34fce781058 | nox-410/tvm.tl | src/relay/backend/contrib/cmsisnn/compute_luts.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | ALGO | 0.995971 | 6.851428 | {
"github_metadata": {
"branch": "tl",
"commit_count": 11031,
"repo_created_at": "2023-12-14T02:37:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 50,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee54fdd83... |
ff999893-3e2c-4c81-be6d-bd8d5f8a8482 | nsj6646/PS | BOJ/14000/14696.cpp | #include <iostream>
#include <cstring>
using namespace std;
//별, 동그라미, 네모, 세모를 각각 숫자 4, 3, 2, 1로 표현한다
int a[5];
int b[5];
char ans[1001];
int main()
{
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int n;
cin >> n;
for (int tc = 1; tc <= n; tc++) {
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
int m... | ALGO | 0.999922 | 3.390799 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2019-03-12T08:03: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": "2649f37f6... |
fc16bbe7-771a-42d7-84f0-90095b45e1ce | rishup132/Codeforces-Solutions | 500/round520/C.cpp | #include <bits/stdc++.h>
#define int long long
#define endl "\n"
using namespace std;
int mod = 1e9+7;
int a[200010],b[200010];
int power(int x, int y, int p)
{
int res = 1;
x = x % p;
while (y > 0)
{
if (y & 1)
res = (res*x) % p;
y = y>>1;
x = (x*x... | ALGO | 0.999954 | 4.476105 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-12-18T14:13: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": "3a528a23a... |
476d0eae-e5fd-4829-bfa0-a81ad8e4e2da | EmonHira135923/XPSC-Club-05---Probleam-Solving | XPSC - 05 Probleam Solving Club/Week 11/Day 71/Day 73/F_String_Game.cpp | #include<bits/stdc++.h>
#define endl '\n'
#define ll long long
#include<string.h>
#include<string>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
string A,B;
cin >> A >> B;
int N = A.size();
int M = B.size();
vector<int> value(N);
for(int i=0;i<N;i++... | ALGO | 0.99998 | 3.852719 | {
"github_metadata": {
"branch": "main",
"commit_count": 135,
"repo_created_at": "2024-11-07T15:43: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": "b8e0d285cd... |
d8c03037-1b47-4102-bb69-e88baae371dc | Shubham05178/leetcode | 289-game-of-life/289-game-of-life.cpp | /**
* Leetcode Problem - https://leetcode.com/problems/game-of-life/
* Author - <NAME>
* Date - 12th April 2022
Game of Life
**/
class Solution {
public:
int dx[8] = {0,0,1,-1,1,-1,1,-1}, dy[8] = {1,-1,0,0,1,1,-1,-1};
int countLive(vector<vector<int>> &Board, int i, int j, int n , int m){
int cnt = ... | ALGO | 0.999943 | 6.316332 | {
"github_metadata": {
"branch": "main",
"commit_count": 957,
"repo_created_at": "2021-09-07T09:11: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": "7495b23482... |
900f112d-31fa-485b-9a8d-7397c74f6a03 | Kundan8889/DSA--Supereme-2.0 | .vscode/Array_2.0/zeroonecountandreplace.cpp | #include <iostream>
using namespace std;
void sortZeroOnecount(int arr[], int n)
{
int zerocount = 0;
int onecount = 0;
for (int i = 0; i < n; i++)
{
if (arr[i] == 0)
{
zerocount++;
}
if (arr[i] == 1)
{
onecount++;
}
}
cout<... | ALGO | 0.999877 | 4.019102 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-18T16: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": "59e47b0e1ecd... |
22d9afaf-4b1b-43f9-ae61-ef96c2714e13 | miyunluo/SJTU-OnlineJudge | source/1231.cpp | //
// main.cpp
// 1231最近共同祖先
//
// Created on 15/12/11.
#include <iostream>
#include <cstdio>
using namespace std;
int n,x,y;
struct node{
int NO = 0;
node *father = NULL,*left = NULL,*right = NULL;
};
node* tree[100000];
void init()
{
int i;
for(i=0;i<100000;++i) tree[i] = new node;
scanf("%d%... | ALGO | 0.999971 | 3.641749 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-09-28T02:47:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0a0f23ec... |
2740bf58-c681-45bd-88ac-148ea01fe7ee | JairZhu/Backup-of-undergraduate-study-materials | 算法设计与应用基础/算法设计课件/code/树/AvlTree.h | #ifndef AVL_TREE_H
#define AVL_TREE_H
#include "dsexceptions.h"
#include <iostream> // For NULL
using namespace std;
// AvlTree class
//
// CONSTRUCTION: with ITEM_NOT_FOUND object used to signal failed finds
//
// ******************PUBLIC OPERATIONS*********************
// void insert( x ) --> Insert x
// v... | ALGO | 0.978613 | 6.552722 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-06-11T13:18:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44e9aff7... |
53058197-1879-4291-ac0f-e957a1ad9663 | YuyuchenW/LeetCodeRecord | 15.三数之和.cpp | /*
* @lc app=leetcode.cn id=15 lang=cpp
*
* [15] 三数之和
*/
#include <vector>
#include <algorithm>
using namespace std;
// @lc code=start
class Solution
{
public:
vector<vector<int>> threeSum(vector<int> &nums)
{
vector<vector<int>> res;
sort(nums.begin(), nums.end());
int size = nums... | ALGO | 0.999959 | 6.619614 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2023-03-17T08: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": "805d338e6... |
3872c1c8-20d1-4e36-82dd-c82a07d70288 | Lucifer3224/PHM211_ASU_DiscreteMaths | Task_2/Task2_10.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <stack>
#include <vector>
using namespace std;
/*The evaluateExpression function parses and evaluates a logical expression containing T, F, AND, OR, NOT, and parentheses.
It uses two stacks, one for boolean values (T/F) and another for operators, to pro... | ALGO | 0.999269 | 5.256155 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-12-15T11:01: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": "6f61fd1e9fa... |
03a22932-2028-4121-83ac-d6070eca31a9 | mohitvdx/Programs | codeforces/cpp_stl/L_Diverse_Team.cpp | // submitted by <NAME> "mohitvdx"
// problem:
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = 1e9 + 7;
const int INF = LLONG_MAX >> 1;
signed main()
{
ios::sync_with_stdio(false);
cin.tie(NULL); // fast IO
// int t;
// cin>>t;
// while(t--){
int n, k;
... | ALGO | 0.999999 | 4.004083 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2024-10-17T13:40:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8b6f876410... |
b6847f3b-fcf9-4b02-bec7-3edb6ed35c91 | yuri-pechatnov/MiptProgramming | MaxFlow/graph.hpp | #ifndef GRAPH_HPP_INCLUDED
#define GRAPH_HPP_INCLUDED
#include <vector>
#include <queue>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
using std::vector;
using std::pair;
template <typename VertexProperty, typename EdgeProperty>
class Graph;
namespace GraphSupportClasses {
template <typename T>
... | ALGO | 0.957716 | 5.428646 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2015-10-19T12:46: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": "5f0a9e6b6... |
af77f802-9c00-4efc-a84e-90b4ceda7a1b | ali-pakdel/Data-Structures | Graph/Q4-DFS.cpp | #include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
struct Point
{
int x, y;
};
struct Element
{
int x, y, d;
};
typedef vector<vector<bool> > Table;
class Farm
{
public:
Farm(int n, int m);
void fill_table(int i, int j);
void find_source(int i, int j);
void bfs();
//b... | ALGO | 0.999945 | 3.757235 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-09-30T06:29: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": "f6110a7504... |
31e11f39-525b-4272-ab0a-147bb730fca6 | sujalkumarshrivastava/cpp--DSA- | rotating_by_two_place.cpp | #include <iostream>
#include <string>
using namespace std;
// Clockwise rotation
void rotateClockwise(string &s) {
char lastChar = s[s.size() - 1];
int index = s.size() - 2;
while (index >= 0) {
s[index + 1] = s[index];
index--;
}
s[0] = lastChar;
}
// Anticlockwise rotation
... | ALGO | 0.999992 | 4.252306 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-07-11T05:45: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": "733b2e105513... |
2bc55a9b-ae6d-4aac-a593-90cfdbdc2a48 | kmac3063/acid-3-course | List/1/utils.h | #pragma once
#include <vector>
#include <set>
#include "consistent_linked_list.h"
template<typename T>
std::vector<T> get_vec(const std::initializer_list<T> &list) {
return std::vector<T>(list);
}
template<typename T>
void fill_range(consistent_linked_list<T> &list, const T &left, const T &right) {
for (int... | TOOL | 0.956155 | 5.325676 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-07-09T04:46: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": "a3c262e01711... |
97b7a002-044a-44c5-a94c-b4dd56c04b70 | v-spath/diamond-blastn | src/align/global_ranking/global_ranking.h | /****
DIAMOND protein aligner
Copyright (C) 2020 Max Planck Society for the Advancement of Science e.V.
Code developed by <NAME> <<EMAIL>>
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 vers... | TOOL | 0.971488 | 6.056285 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-03-03T21: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": "ff4f1baf4740... |
73ee734c-411e-43de-bf1e-7a7f00f21578 | runei/Compiladores | Outros/maquina_pilha.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <stack>
#include <vector>
#include <algorithm>
enum EToken {
TKFim,
TKErro,
TKId,
TKConst,
TKValorL,
TKValorR,
TKPush,
TKPop,
TKSoma,
TKSubtracao,
TKMult,
TKDiv,
TKAtrib,
TKRotulo,
TKDoisPontos,
TKGoto,
TKGoFalse,
TKGoTrue,
TKMenor,
... | ALGO | 0.984662 | 3.722539 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-04-29T19:55: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": "e830c376e4... |
51538752-c0ce-47ae-a616-2f471ee86a97 | liu-delong/HNUCloudComputingLabs | Lab1/src/Sudoku/main.cc | #include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include "sudoku.h"
int64_t now() { // 返回时间
struct timeval tv;
gettimeofday(&tv, NULL);
return tv.tv_sec * 1000000 + tv.tv_usec;
}
int main(int argc, char *argv[]) {
init_neighbors(); // 记录邻点位置neighbors[81][2... | ALGO | 0.996353 | 4.252384 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2022-03-25T14:35:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "801d1cd80... |
efa7bf2f-816f-4544-8a70-4a71fd9ed635 | Jayallstars/Structure-Programing | c++/function/Lab5_1Homework.cpp | #include <iostream>
using namespace std;
int main() {
char Ch;
string Message;
cout << "Enter character : ";
cin >> Ch;
cout << endl;
if ((Ch >= 48 && Ch <= 57) || (Ch >= 65 && Ch <= 90) || (Ch >= 97 && Ch <= 122)) { // เช็คว่าเป็นตัวเลขหรือตัวอักษร T != 0, F = 0
if ((Ch >= 65 && Ch <= 90) || (Ch >= 97 ... | ALGO | 0.941067 | 3.855135 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-10-05T07:23:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3b3b874f636... |
1188f93f-41d8-42b7-9c15-6ac7548c4140 | RulerOfCakes/BOJ | DP/2342.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[101010][5][5];
vector<int> v;
int dist[5][5] = {
{0, 2, 2, 2, 2},
{0, 1, 3, 4, 3},
{0, 3, 1, 3, 4},
{0, 4, 3, 1, 3},
{0, 3, 4, 3, 1}};
int sol(int x, int y, int cnt)
{
if (cnt >= v.size())
return 0;
int &ret = dp[cnt][x][y];
if... | ALGO | 0.99996 | 3.381362 | {
"github_metadata": {
"branch": "main",
"commit_count": 561,
"repo_created_at": "2021-02-02T06:04:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2550408edc... |
5c5f3715-1c7d-4f1b-92d1-f4fc14db2149 | LeeJaeJun1/Data-Struct | 4week/1.cpp | #include<iostream>
using namespace std;
class node{
private:
int data;
node* next;
public:
node(int x) {
data = x;
next = NULL;
}
friend class linkedArray;
};
class linkedArray {
private:
node* front;
node* rear;
int size;
public:
linkedArray() {
front = rea... | ALGO | 0.99724 | 4.403652 | {
"github_metadata": {
"branch": "main",
"commit_count": 112,
"repo_created_at": "2025-01-09T06:30:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c238d99967... |
9e6b62d5-ca74-4384-a517-dd9d91a29bc8 | kpagacz/comp-programming | leetcode/minimize-xor/solution.cpp | // link to the problem: https://leetcode.com/problems/minimize-xor/
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <iostream>
#include <iterator>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <string>
#include <u... | ALGO | 0.999887 | 5.84774 | {
"github_metadata": {
"branch": "main",
"commit_count": 1290,
"repo_created_at": "2020-05-10T16:25: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": "9e92e29f7... |
1cc7116d-8106-4371-a623-c99f7cc1c73b | Jthan117/Intro_a_Progra | practica_funciones/practico_fun_loops/ejer5_fun_loops.cpp | #include <iostream>
using namespace std;
// Function prototypes Here
int numeros (int numero1 = 0, int numero2 = 0);
/**
* @brief una funcion que imprima dos números ingresados por el usuario desde el
primero hasta el segundo inclusive
* @Input -dos numeros enteros
* @Output - desde el primer hasta el segundo ... | TOOL | 0.980426 | 3.881542 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2023-03-06T13:30: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": "cbb3731294d... |
74d4fc8b-d251-4bdb-8c4c-a6e8e77665e8 | Devvarshney11/Leetcode | Stack/SimplifyPath.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
string simplifyPath(string path)
{
if (path.length() == 1)
{
return "/";
}
int i = path.length() - 1;
int back = 0;
string ans = "";
while (i >= 0)
{
string temp = "";
... | ALGO | 0.99908 | 4.760324 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-07-22T08:58:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9eee1b01280... |
296bd380-de65-4f4f-9174-ed6dce158a96 | rusucosmin/cplusplus | Campion_-_Trmv/main.cpp | #include <fstream>
#include <vector>
#include <bitset>
#include <stdio.h>
#include <queue>
using namespace std;
const char infile[] = "trmv.in";
const char outfile[] = "trmv.out";
const int MAXN = 1000005;
const int oo = 0x3f3f3f3f;
typedef vector< pair<int, int> > Graph[MAXN];
typedef vector< pair<int, int> > :: i... | ALGO | 0.999858 | 3.933051 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2014-02-06T08:06:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2795208c2... |
a0114537-ce49-4d04-bca6-685c08c5914e | AlexisMunoz/adventure | driver.cpp |
// Labwork - Team Designing
//includes
#include<iostream>
#include<cassert>
using namespace std;
//prototypes
//char menu();
double climbing(int people);
double scuba(int people);
//double skyDive();
double discount(int people);
int numberOfPeople();
//double spelunk();
int main ()
{
return 0;
}
//function... | TOOL | 0.950864 | 3.440577 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-10-09T17:54: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": "0194278bfc... |
fa4851c2-ec88-4cd2-afa3-ccc7e339e60e | ishaofeng/LeetCode | LongestSubstringWithoutRepeatingCharacters/LongestSubstringWithoutRepeatingCharacters.cpp | #include <iostream>
#include <vector>
#include <set>
#include <cctype>
#include <map>
#include <unordered_map>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <limits>
#include <algorithm>
#include <list>
#include <utility>
using namespace std;
class Solution
{
public:
int lengthOfLongestSubstring(st... | ALGO | 0.999943 | 4.742079 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2014-10-07T07:17: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": "18f99a6a6... |
49d24a1a-dd59-4ee3-bf30-dd6029d95fff | malmerri42/M-TRE-PAN-Release | source/Tree_Node.cpp | #include "Tree_Node.h"
#include <memory>
#include <mlpack/core.hpp>
#include <mlpack/methods/linear_svm/linear_svm.hpp>
#include "MyStats.h"
#define MAX_LINESEARCH_ITER 100
Tree_Node::Tree_Node(Data_List inputData, unsigned int currentDepth, Tree_Node* const parentPtr, int label):
Base_Tree_Node(inputData, curren... | ALGO | 0.989324 | 5.511416 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-04-15T13:15: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": "a958d7a63f... |
b4e63b23-2639-4d1f-b8c6-cc7eef53017b | abel-fdz/EDA-Q1-24-25 | equal_sums1.cc | #include <iostream>
#include <vector>
using namespace std;
void escriure_sol(const vector<bool>& v_aux, const vector<int>& x){
int cont = 0;
for (int i = 0; i < v_aux.size(); ++i) if (v_aux[i] == true) ++cont;
--cont;
cout << "{";
for (int i = 0; i < x.size(); ++i){
if (v_aux[i] == true && ... | ALGO | 0.999749 | 4.149612 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-05T14:06: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": "1d491bcd59d3... |
16cf6ab3-92a8-4668-b92c-73c9ddf2173d | NAU-ACM/ICPC-Question-Solving | BedirT/Chapter 4/UVa - 10004.cpp | #include <iostream>
#include <cstring>
#include <vector>
using namespace std;
vector<vector<int> > ways;
int colored[201];
int n, m, a, b;
bool paint(int x, int c, int parent){
if(colored[x] == -1){
colored[x] = (c+1) % 2;
}
if(ways[x].size() > 0){
int myColor = colored[x];
for (... | ALGO | 0.999424 | 4.088796 | {
"github_metadata": {
"branch": "master",
"commit_count": 155,
"repo_created_at": "2017-04-28T16:54:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 28,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c125224... |
f33eb6f7-e0d0-46ca-b157-d5ba54926a95 | bobbyshashin/Exciting-Robotics | code/Linux/lib/cgal/BGL/examples/BGL_triangulation_2/dijkstra.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_2.h>
#include <CGAL/boost/graph/graph_traits_Triangulation_2.h>
#include <CGAL/boost/graph/dijkstra_shortest_paths.h>
#include <boost/graph/filtered_graph.hpp>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constru... | ALGO | 0.999868 | 5.361817 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2016-08-17T04:44:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "373921d26... |
73db8f44-8214-495b-9a29-79d38c8d1a13 | nguyenhoang4875/CompetitiveProgramming | aglo_libs/graph/dijkstra.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
/**
* Problem: Shortest Path
* Solution: Using dijkstra algorithm
* use for edge positive weight
*
* TC: O((V + E) * log E)
* MC: O(V + E)
*/
#define pb push_back
#define all(x) x.begin(), x.end()
#define sz(a) (int)(a).size()
#define el '\n'... | ALGO | 0.99999 | 4.74018 | {
"github_metadata": {
"branch": "main",
"commit_count": 328,
"repo_created_at": "2023-02-28T01:38:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4d383bd28... |
fae9ddf8-283a-4dfc-9842-c84189e00bb1 | DushyantBhardwaj07/CodeForces-DSA | B_Luke_is_a_Foodie.cpp | #include<bits/stdc++.h>
using namespace std;
#define yes "YES"
#define no "NO"
#define ll long long
#define mod 1000000007
void display(vector<ll>v){ for(ll i=0;i<v.size();i++) cout<<v[i]<<' ';cout<<endl;}
void display2d(vector<vector<ll>> v){for(ll i=0;i<v.size();i++){for(ll j=0;j<v[i].size();j++){cout<<v[i][j]<<' ';}... | ALGO | 0.999889 | 4.414517 | {
"github_metadata": {
"branch": "master",
"commit_count": 413,
"repo_created_at": "2024-07-10T19:42: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": "35d04366... |
7e24c560-b97c-4bd3-aa63-8629ad187dee | ishandutta2007/codeforces-g | gepardo/normal/1017/F.cpp | // Code written by gepardo
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <iomanip>
#include ... | ALGO | 0.999334 | 4.340331 | {
"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": "79c024ed06a7... |
aa60c467-a78e-4deb-91f6-0b3bb493c6e9 | minhnguyent546/icpc-training | 2020-icpc-vietnam-national-contest/K/K.cpp | /**
* author minhnguyent546
* created_at Sat, 2023-11-11 09:23:54
**/
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "cp/debug.h"
#else
#define debug(...)
#endif
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MOD = (int) 1e9 + 7;
co... | ALGO | 0.999923 | 5.394557 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2023-09-21T13:38:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfd343492... |
8f30bce1-50f5-4b15-a317-33352c8afdc6 | Sapphii/Cybersecurity | lfsr_period.cpp |
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main(void)
{
cout << "Enter in the seed in binary" << endl;
string seedBinary;
std::cin >> seedBinary;
cout << "Enter in the taps in binary" << endl;
string tapsBinary;
std::cin >> tapsBinary;
// int index... | ALGO | 0.998591 | 4.116266 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-04-01T17:07: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": "6cacdffe312c... |
312e8a7e-f508-4451-818b-325281fc8f64 | EvanWen036/Competitive-Programming-Evn | C++ Workspace/USACO Problems/dream.cpp | #include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
struct State{
int r;
int c;
int dir;
bool smell;
int steps;
bool operator<(const State other){
return steps < other.s... | ALGO | 0.999957 | 4.100792 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2021-02-09T03:46: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": "d1d2f605d16... |
0eeb5e38-0955-4a9d-8882-4a242c3f6853 | zhz0817/new_coder | new_coder/11-20/BM20-数组中的逆序对/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR_INC(i, start, end) for (int i = start; i < end; ++i)
#define FOR_DEC(i, start, end) for (int i = start; i > end; --i)
#define FOR_INC_EQUAL(i, start, end) for (int i = start; i <= end; ++i)
#define FOR_DEC_EQUAL(i, start, end) for (int i = start; i >= end; --i)... | ALGO | 0.999999 | 4.822598 | {
"github_metadata": {
"branch": "main",
"commit_count": 257,
"repo_created_at": "2024-10-12T02:24:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2c90f6b6f... |
7a4a7fb5-ea32-445e-95ca-247a70411181 | FangLiu68/LC2016 | LC2016/Border View of Binary Tree.cpp | //
// Border View of Binary Tree.cpp
// LC2016
//
// Created by <NAME> on 5/4/16.
// Copyright © 2016 <NAME>. All rights reserved.
//
#include "BinaryTree.h"
#include <vector>
#include <iostream>
using namespace std;
void borderView(BinaryTreeNode* root, int flag1, int flag2){
if(root == NULL){
return... | ALGO | 0.999124 | 5.169509 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2016-09-16T00:57: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": "4c43dc97f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.