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 |
|---|---|---|---|---|---|---|---|
59728155-8553-4782-b6c6-a929f9d2fcc5 | IceTea233/NYCU_Hibana | codebook/Tree/HLD.cpp | int sze[MAX], mxchd[MAX], pa[MAX], dth[MAX], id[MAX], top[MAX];
int cnt;
void DFS(int u) {
sze[u] = 1, mxchd[u] = -1;
for (int v : G[u]) {
if (v == pa[u]) continue;
pa[v] = u;
dth[v] = dth[u] + 1;
DFS(v, u);
sze[u] += sze[v];
if (mxchd[u] == -1 || sze[mxchd] < sze[v])
mxchd[u] = v;
... | ALGO | 0.999764 | 4.438601 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2022-09-24T05:40:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fd8f9f76... |
2f1d678f-e9f6-4d1d-ae1d-88768a378fcc | GQH123/Renatus-ACM-Codes | FudanXCPC-Summer-C/G.cpp | #include <bits/stdc++.h>
#define rep(i, l, r) for (register int i = l; i <= r; i++)
#define per(i, r, l) for (register int i = r; i >= l; i--)
#define srep(i, l, r) for (register int i = l; i < r; i++)
#define sper(i, r, l) for (register int i = r; i > l; i--)
#define maxn 2000020
#define maxm
#define pii pair<int, in... | ALGO | 0.999889 | 3.442448 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-08-17T06:57: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": "063650abb7... |
f125165c-3a78-47b2-b2ff-be332ab62dba | Terpodia/Competitive-Programming | Problems Solved/CSES/Mathematics/Exponentiation II.cpp | /*
*************************************************************
"Si puedes imaginarlo, puedes programarlo" <NAME>.
*************************************************************
*/
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include ... | ALGO | 0.999809 | 4.983603 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2021-12-10T22:43: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": "ebf34ec2e7... |
16a1d64c-d289-4b8f-9972-17e6dbc21444 | BUGProtectionAssociation/blender-test | source/blender/io/ply/exporter/ply_export_load_plydata.cc | /* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup ply
*/
#include "BLI_array.hh"
#include "BLI_math.h"
#include "BKE_attribute.hh"
#include "BKE_lib_id.h"
#include "BKE_mesh.hh"
#include "BKE_mesh_mapping.h"
#include "BKE_object.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#in... | TOOL | 0.95732 | 3.376971 | {
"github_metadata": {
"branch": "main",
"commit_count": 122506,
"repo_created_at": "2023-02-23T13:40: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": "9a76f57... |
852933af-9bdf-428f-b309-84648873284d | mwierzbicki/competitive-programming-projects-polish | random/Leśne Okręgi/main.cpp | //
// main.cpp
// Leśne Okręgi
//
// Created by <NAME> on 02.02.2016.
// Copyright © 2016 <NAME>. All rights reserved.
//
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstdlib>
const int MAX_N=(1e3)*2;
const double EPS=(1e-9);
using namespace std;
int n,a,b;
int xy[4][MAX_N+1];
double cxy[4]... | ALGO | 0.99992 | 3.961854 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-09-24T17:43: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": "0023dce0e6... |
c1f52bc5-5fb4-4dc4-839f-62fb6b9e5e52 | fuyaozhao1018/CPP-data-structures | Huffman Tree/HCTree.cpp | /*
* Name: <NAME>
* Email: <EMAIL>
*
* This file provides a implemented skeleton
* for a huffman tree.
*/
#include "HCTree.hpp"
#include <iostream>
#include <vector>
#include <queue>
#include <string>
using namespace std;
//the edge number of vectors
int EDGETREE = 256;
/**
* Destructor of a Huffman coding tr... | ALGO | 0.999926 | 4.965937 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-07-08T02:23: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": "d5540e692239... |
e86459fd-01d2-4cd0-a241-f445958f9c30 | MTDoven/Program-Learning | AIIntroduction/Calculator/main.cpp | #include "define.h"
#include "stack.h"
#include "Helper.h"
#include "Search.h"
#include "Compute.h"
int main() {
std::cout << "\033c";
std::cout << "\033[1;33m------------------------------- Calculator -------------------------------\033[0m\n";
std::cout << "\033[1;33m-------------------- Version: 1.0, Made by <... | ALGO | 0.999215 | 3.920495 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-05-17T10:55:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac5927fd6fd... |
3143150e-e78d-445d-86b8-51ebee88158d | domingosneto03/RoutePlanning | menu.cpp | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <limits>
#include <fstream>
#include <filesystem>
#include "menu.h"
#include "reader.h"
#include "cmake-build-debug/batch/batch.h"
#include "RestrictedRoute.h"
#include "BestRoute.h"
#include "data_structures/Graph.... | TOOL | 0.930184 | 3.530296 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2025-07-11T10:18: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": "b40804e8b... |
18db15e0-1b28-49ff-a352-504a22d687ee | ishandutta2007/codeforces-b | brovko/normal/370/D.cpp | #include <bits/stdc++.h>
//#define int long long
#define ld long double
#define x first
#define y second
#define pb push_back
using namespace std;
int n, m;
char a[2005][2005];
bool f(int A, int B, int C, int D, int i, int j)
{
return ((i == A || i == C) && j >= B && j <= D || (j == B || j == D) && i >= A && i <... | ALGO | 0.999804 | 3.648015 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0e38e5c90c1... |
1f5b6448-f379-4df5-afbb-0706c0a84961 | amantibrewal310/Data-Structure-and-Algorithms | Stack/test.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> kadane(vector<int> &nums) {
int n = nums.size();
int curr = 0;
int mx = INT_MIN;
int start = 0;
int end = -1;
vector<int> res = {-1, -1};
for (int i = 0; i < n; i++) {
curr += nums[i];
if (curr > mx) {
end = i;
mx = curr;
... | ALGO | 0.999987 | 4.362236 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2020-04-12T17:59: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": "9a5a35782... |
7990f12f-2219-457f-898c-9b27064a2028 | kumudaPriya98/DSAlgo | Recursion/MergeSort.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
* Top Down Approach :
*for len = 2; len < n; len *= 2;
* while start + len < n
* Merge [start, start + len - 1], [start + len, min(n - 1, start + 2 * len - 1)]
* start = start + 2*len
*/
void mergeSortIterative(vector<int>& nums) {
int n = nums... | ALGO | 0.999988 | 5.580944 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-09-04T16:20: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": "8e177362d5... |
8821f66e-a5e7-4a07-ae6d-c0a46b58d862 | Nikith-S/coding | leetcodeAndGFG/stack/celebrityProblem.cpp | class Solution
{
private:
bool knows(vector<vector<int>> &mat, int a, int b)
{
return mat[a][b] == 1;
}
public:
int celebrity(vector<vector<int>> &mat)
{
int n = mat.size();
stack<int> s;
// Push all persons into the stack
for (int i = 0; i < n; i++)
... | ALGO | 0.999738 | 5.765352 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2024-08-10T10:43: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": "1aa86750343... |
c294b842-b13f-41c6-b54d-6ab619f15b36 | xftxyz2001/se-theoretical-training | 数据结构相关代码/Contest1007/i1.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <utility>
#include <set>
using namespace std;
set<pair<int, int>> myset;
int a[5], b[5];
int n, m;
int res = 0;
void dfs(int x, int y, int cur)
{
if (myset.count(make_pair(x, y)) > 0)
return;
if (cur == n)
{
res = (re... | ALGO | 0.999958 | 4.411499 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-05-08T16:16:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6bce529e57... |
2bba93e0-8815-4c09-b650-7d76af53905b | ashn01/algorithm | SelfDividingNumbers.cpp | /* https://leetcode.com/problems/self-dividing-numbers/description/
* A self-dividing number is a number that is divisible by every digit it contains.
*
* For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.
*
* Also, a self-dividing number is not allowed to contain the ... | ALGO | 0.999408 | 5.681098 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2018-01-25T08:34:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f921dbd... |
4de78d47-8c16-401f-af48-13b214df79d4 | MuhammadAmitHasan/Data-Structure | M24_Final_Exam/Give_Current_Max.cpp | #include <bits/stdc++.h>
using namespace std;
class Student
{
public:
string name;
int roll;
int marks;
Student(string name, int roll, int marks)
{
this->name = name;
this->roll = roll;
this->marks = marks;
}
};
class compareClass
{
public:
bool operator()(Student a... | ALGO | 0.999487 | 4.210529 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-06-14T14:39: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": "19f62628c0f7... |
f45dd4f7-e594-494a-8d26-1ee2cf30f97e | aquatiko/Leetcode-tracker | Till June 9th/3sum.cpp | static const int fastio = []() {
#define endl '\n'
std::ios::sync_with_stdio(false);
std::cin.tie(NULL);
std::cout.tie(NULL);
return 0;
}();
class Solution {
public:
vector<vector<int>> ans;
vector<vector<int>> threeSum(vector<int>& nums) {
sort(nums.begin(), nums.end());
for(int i=0;i<num... | ALGO | 0.999905 | 5.959871 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2020-04-16T16:02:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d4ac9e44... |
c76511ce-6d58-4ae7-8173-9745bb2a0b18 | progyadeep/brainfuck_cli_interpreter | src/bf.cpp | #include <iostream>
#include <cstdlib>
#include <cstdio>
using namespace std;
union Cell{
signed char c;
};
union Cell *ptr;
union Cell *start;
void process (string);
string getInput (void);
int main (){
ptr = (union Cell *) calloc (30000, sizeof (union Cell));
start = ptr;
string inpMain = getInput... | ALGO | 0.999032 | 3.866678 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2019-02-07T17:55:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8811fa69... |
4d0721e4-dfed-4178-8947-a088b37e6799 | Jackhyellee/git | New folder/1/Bai3_T2_Tro.cpp | #include<iostream>
using namespace std;
class TS{
private:
string ht;
float dT, dV;
public:
TS(string ht=" ", float dT=0, float dV=0){
this->ht = ht;
this->dT = dT;
this->dV = dV;
}
~TS(){ }
void Nhap(){
cin.ignore();
cout<<"Nhap ho ten: "; getline(cin, ht);
cout<<"Nhap diem thi toa... | TOOL | 0.99803 | 3.434777 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-07-20T15:26:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4974a6dc5c... |
308f051f-3b09-41c8-a4d3-e1ee881eaeec | bibimoni/codeStuff | cp/cses/1739.cpp | /**
* Author: distiled
*/
#include<bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include </Users/distiled/codeStuff/templates/debug.h>
#else
#define dbg(x...)
#endif
#define int int64_t
template <class T>
class Fenwick {
vector<T> a;
int n;
public:
Fenwick() {}
Fenwick(int n_) : n(n_) {
// che... | ALGO | 0.999302 | 4.653954 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-08-23T09:31:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa374509962... |
da687566-7e04-4507-8263-c3a76f2211ef | youngalx2/C_M_M | Capitulo06/Exercicios/QuadradoDeAsterisco6_22.cpp | /*
6.22 Escreva uma função que exibe na margem esquerda da tela um quadrado
sólido de asteriscos cujo lado é especificado no parâmetro do tipo inteiro side.
Por exemplo, se side for 4, a função exibirá o seguinte:
<NAME>; <NAME>. C++ Como Programar (p. 243). Edição do Kindle.
Autor: <NAME>, 15/09/2... | ALGO | 0.966036 | 5.14133 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2021-09-09T07:06:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d921ee72b8... |
c2ffcce2-64dd-453e-9a8b-671be18845b9 | fabbrito/AdventOfCode | AOC_2023/src/D2_Cube_Conundrum/Solution2.cpp | #include "pch.h"
#include "Solution2.h"
namespace AoC2023_D2 {
using namespace std;
// --------------------------- Types ----------------------------------
struct game_t {
int id = 0;
std::unordered_map<std::string, int> tokenMap;
int rounds = 0;
};
// -------------------------- Functions ---------------... | ALGO | 0.995417 | 6.026269 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2023-12-11T20: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": "6ef046a0b... |
d24ee743-eccc-48f7-92f1-00a22fee2dd2 | skmonir/Algorithms | Graph/Max Bipartite Maching [Kuhn's Algo].cpp | struct KuhnImplementation {
vector <int> g[N];
int n, k, t, used[N], pairA[N], pairB[N];
void init(int nn, int kk) {
n = nn, k = kk;
for (int i = 0; i < N; ++i) {
g[i].clear();
pairA[i] = pairB[i] = -1;
}
}
bool Kuhn(int u) {
if (used[u] == t... | ALGO | 0.99979 | 4.309251 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2016-10-03T19:26:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2999f5450... |
ecaa1c88-7b9c-46bb-939f-9f02e7c096aa | nhy1210/MyProject | Cpp/countTriplet.cpp | #include<iostream>
#include<map>
using namespace std;
/* You are given an array and you need to find number of triplets that sasticfied geometric progression for a given common ratio r and i< j< k
For ex) Arr[] ={1,4,16,64] and r = 4
Result [1,4,16] and [4,16,64]
*/
/* //Below method has O(n^2 * logn) complexity ti... | ALGO | 0.999072 | 4.330495 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-09-02T04:49: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": "e8f52d7e37... |
84d77ccf-125f-4330-93ed-d99f0c086a9d | Miguellamacarrasco/teoproblems | ej2.cpp | #include <iostream>
#include <conio.h>
#include <vector>
using namespace std;
const int NO_OF_STATES = 10;
int n1;
class states
{
public:
char status;
int sno;
int gp;
int* ts;
states()
{
sno=gp=0;
ts=NULL;
}
states(int state_no)
{
gp=0;
sno=state_no;
... | ALGO | 0.99835 | 3.760867 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2020-11-01T21:19: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": "3914dfee87e... |
1cc2d93a-653c-454f-ae69-15a0d5d71be5 | M2TH/CHP_Project | Projet_2A_2204/main.cpp | // Code principale du projet de C++
//compilation :
// cf makefile
// #include <mpi.h>
#include <stdio.h> //pour le printf
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <cmath>
#include "fonction.h"
#include "gradConj.h"
#include <string>
int main(int argc, char ** argv){
... | ALGO | 0.993673 | 4.012941 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-04-04T15:47: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": "98efa826429... |
e7f7efa8-e0eb-4076-b444-6535dfaa4e97 | NishantRaj/program_files | hackerrank/a.cpp | /*
===================================================
Name :- <NAME>
Email :- <EMAIL>
College :- Indian School of Mines
Branch :- Computer Science and Engineering
Time :- 15 July 2015 (Wednesday) 21:27
===================================================*/
//question 312E codeforces
#include <bits/stdc++.h>
using names... | ALGO | 0.999967 | 3.93027 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2015-07-19T20:22:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82acb3a0c... |
10713df4-30be-40b4-863f-a6af364b7106 | alenayqa/Combinatorials | Data_structures/PriorityQueue/include/PriorityQueue.h | #pragma once
#include <iostream>
#include <algorithm>
#include <memory>
#include <stdexcept>
#include "Vertex.h"
// https://dementiy.gitbooks.io/algo/content/heaps.html
template<typename T>
class PriorityQueue
{
private:
int m_volume;
int m_size;
std::unique_ptr<Vertex<T>[]> m_arr;
void swap(int ind1... | ALGO | 0.999053 | 5.126262 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2022-07-18T13:49: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": "35586f3fece... |
f52ba91f-a841-47f6-8642-24c47b5db79c | camil0palacios/Competitive-programming | solutions/vjudge/Beginners Training/Even But Not Even/solution.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
int t;
cin >> t;
while(t--) {
int n; string s;
cin >> n >> s;
int x = -1, y = -1;
for(int i = 0; i < n; i++) {
if((s[i] - '0') & 1) {... | ALGO | 0.999958 | 4.18592 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-10-30T16:26: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": "cc7f28f38... |
c033e4f8-6f52-4341-8823-c3ce5a4cb487 | MogaRiana/NewCode | Kattis/C++/Working_at_the_Restaurant/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long i64;
typedef int i32;
typedef short i16;
typedef vector<i64> vi64;
typedef vector<vi64> vv;
typedef string str;
typedef pair<i64, i64> p64;
typedef vector<p64> vp64;
typedef vector<str> vstr;
int main() {
ios::sync_with_stdio(false);... | ALGO | 0.999738 | 4.374324 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2023-02-17T14:08:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78277f12... |
f834a858-2082-4edc-a2a1-1b65141d986d | chalmersplasmatheory/DREAM | src/Equations/Kinetic/ComptonSource.cpp | /**
* Implementation of the kinetic Compton scattering
* source term, which takes the quadratic form
* T = S(p) * n_e(r,t)
* where S is only a function of phase-space coordinates.
*/
#include "DREAM/Equations/Kinetic/ComptonSource.hpp"
#include "DREAM/Constants.hpp"
using namespace DREAM;
/**
* Constructor... | ALGO | 0.993198 | 6.597424 | {
"github_metadata": {
"branch": "master",
"commit_count": 3092,
"repo_created_at": "2020-04-23T06:40:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 29,
"forks": 7,
"issues": 20,
"pull_requests": 11
},
"file_meta": {
"content_id": "48503... |
db0c06a3-8f62-4e1b-92d2-076ec27e8c69 | haru02w/ComputerScienceFiles | primeiro-semestre/atp-1/aulas/aula-3/Exercicios_Resolvidos/Ex_12_Lista03.cpp | //Diretivas de Pré-processamento (Obrigatórias)
#include <stdio.h>
//#include <stdlib.h>
//Obrigatório. Função principal: indica o início da execução do programa
int main ()
{
//Declaração de Variáveis Locais.
int num_1, num_2, num_3, num_4, num_5;
//Obrigatório. Comandos para resolução do problema
//Possíveis m... | ALGO | 0.999864 | 3.229367 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2022-04-28T13:02:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "446654b16... |
50d13978-d1af-401d-a42c-f384835b939b | ironfelix1729/Cryptography | Polynomial to Arithmetic circuit.cpp | #include <iostream>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <cassert>
/**
* Represents an operation node in our arithmetic circuit.
* Each node corresponds to either an input variable, a field constant,
* or a binary operation (addition/multiplication over the field).
*/
struct... | ALGO | 0.992127 | 6.819031 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-05-28T13:42: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": "2bb483f53f2... |
a4437005-d3ed-4ae0-9d52-fe418bf68119 | hek-git/problem_solving | boj/20230713_1461.cpp | #include <algorithm>
#include <deque>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M, num, ans = 0, m = 0;
deque<int> total, left, right;
cin >> N >> M;
for (int i = 0; i < N; i++) {
cin >> num;
if (abs(num) > abs(m)) m = num;
total.push_bac... | ALGO | 0.999997 | 4.567603 | {
"github_metadata": {
"branch": "main",
"commit_count": 205,
"repo_created_at": "2023-06-23T11:27: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": "3978ce4c0d... |
7882abdc-8319-402b-b526-7c591ed044ef | cluster777/tugas_akhir | kode/Achessv1.cpp | #include<bits/stdc++.h>
#define mp make_pair
#define INF 1000000000
using namespace std;
bool possible(char type, int col,int row,int colt,int rowt){
//pawn only move on 1 collumn
if(type=='P'){
if(row==rowt)return true;
else return false;
}
//bishop only move on 1 color (diagonal cannot
else if(type=='B')... | ALGO | 0.998913 | 3.377966 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-07-23T09:56: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": "d50eb36e0... |
db98ce31-d536-46e3-92e2-7a6168abaa9d | google/skia | src/pathops/SkPathOpsLine.cpp | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "src/pathops/SkPathOpsLine.h"
#include "src/pathops/SkPathOpsTypes.h"
#include <cmath>
#include <algorithm>
SkDPoint SkDLine::ptAtT(double t) const {
if (0 == t... | ALGO | 0.994522 | 5.997029 | {
"github_metadata": {
"branch": "main",
"commit_count": 75918,
"repo_created_at": "2014-01-09T17:09:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9958,
"forks": 1593,
"issues": 0,
"pull_requests": 39
},
"file_meta": {
"content_id": "ea... |
583baaaa-6d64-4612-887b-ceaf38cbe5fc | zVaz/2DCS | BO/Quadtree.h | #pragma once
#include <optional>
#include <SFML\Graphics.hpp>
#include <list>
#include <experimental\vector>
#include <iostream>
//A tree the split the world into quarters
template <typename T>
class Quadtree {
public:
Quadtree(int pLevel, sf::IntRect pBounds);
//Cleacr
void clear();
//Split
void split();
... | ALGO | 0.988129 | 4.902234 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2018-05-28T10:24:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c51c4df... |
8d33901f-cf3c-4676-9186-4423e179567c | JJuanJr/Notebook-ICPC | Dynamic Programming/Knuth's Optimization.cpp | // https://cses.fi/problemset/task/2088/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
#define pb push_back
#define ff first
#define ss second
#define sz(x) int(x.size())
#define all(x) x.begin(), x.end()
#define forn(i, n) for (int i = 0; i < n; ++i)
#define rforn(i, n... | ALGO | 0.999903 | 3.659656 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2022-08-12T12:24:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c06f03c931... |
d8382fac-b5b2-4c48-a19b-83bc772c83b3 | Subio-yng/my-projects | acmp/task-0205/code.cpp | #include <stdio.h>
#include <algorithm>
// Time complexity: O(1)
// Space complexity: O(1)
int main() {
int hours, minutes, seconds;
scanf("%d:%d:%d", &hours, &minutes, &seconds);
int val1, val2 = -1, val3 = -1;
int days = 0;
scanf("%d:%d:%d", &val1, &val2, &val3);
if (val2 == -1) {
va... | ALGO | 0.995255 | 4.401555 | {
"github_metadata": {
"branch": "master",
"commit_count": 1354,
"repo_created_at": "2021-06-05T16:59:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "7005a39... |
057dcd09-b3ba-4352-abd6-b2d57916e5d4 | OI-wiki/OI-wiki | docs/ds/code/avl-tree/AvlTreeMap.hpp | /**
* @brief An AVLTree-based map implementation
* @details The map is sorted according to the natural ordering of its
* keys or by a {@code Compare} function provided; This implementation
* provides guaranteed log(n) time cost for the contains, get, insert
* and remove operations.
*/
#ifndef AVLTREE_MAP_HPP
... | ALGO | 0.980808 | 7.356279 | {
"github_metadata": {
"branch": "master",
"commit_count": 12101,
"repo_created_at": "2018-07-11T03:28:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23612,
"forks": 4310,
"issues": 112,
"pull_requests": 9
},
"file_meta": {
"content_id":... |
c2eb042a-eecc-4fc1-966e-bfc2a5e78527 | developerHet/CAndCppPrograms | Apna College Cpp/heap.cpp | #include <iostream>
#include <vector>
using namespace std;
void swap(vector<int> &arr,int i,int j) {
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
void maxHeapify(vector<int> &arr,int idx) {
int left = 2*idx + 1;
int right = 2*idx + 2;
int largest = idx;
if(left <= arr.size() && a... | ALGO | 0.999848 | 4.161927 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2022-01-21T10:31: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": "efb2dfc30... |
d4ea8c3e-cd69-431d-a81b-63ada28f7821 | mfrigerio17/iit_rbd | iit/rbd/compact_transform.h | #ifndef IIT_RBD_COMPACT_TRANSFORM_H_
#define IIT_RBD_COMPACT_TRANSFORM_H_
#include <iit/rbd/rbd.h>
#include <iit/rbd/StateDependentBase.h>
#include <iit/rbd/internals.h>
//#include <iostream>
namespace iit {
namespace rbd {
// // Just a dummy type to investigate what happens with temporary vectors with
// // the co... | ALGO | 0.947985 | 6.806361 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2023-09-26T11:53:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80eb7ce6e... |
337066fa-1542-4b2c-a1b5-c98392b78a31 | Openhologram/OpenHologram | OpenHolo_WRP/openwrp_console_ver 1.0/openwrp/WRP.cpp | #ifdef _OPENMP
#include<omp.h>
#endif
#include "WRP.h"
int OPHWRP::readxyz(string filename) //read point cloud
{
int dimen = 3;
ifstream infilee(filename);
string temp, temp2mat;
vector <string> temsplit;
if (!infilee)
{
cerr << "can not read the file";
return -1;
}
while (getline(infilee, temp))
{... | ALGO | 0.920613 | 4.847901 | {
"github_metadata": {
"branch": "master",
"commit_count": 162,
"repo_created_at": "2017-06-07T08:37:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 47,
"forks": 40,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "27d1f4... |
2fc7fa03-ec17-4042-8129-83f30567c42d | LArSoft/larreco | larreco/ClusterFinder/TrackShowerSplitter/Segmentation2D/Segmentation2D.cxx | /**
* @file Segmentation2D.cxx
*
* @author D.Stefan and R.Sulej
*
* @brief Split into linear clusters.
*/
#include "Segmentation2D.h"
#include "fhiclcpp/ParameterSet.h"
#include "larreco/RecoAlg/PMAlg/Utilities.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
void tss::Segmentation2D::reconfig... | ALGO | 0.996281 | 6.02092 | {
"github_metadata": {
"branch": "develop",
"commit_count": 7491,
"repo_created_at": "2020-01-21T15:48:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 50,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "c0cf28... |
9c43fef5-f544-4eea-b711-ef26578eac71 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1244/all/28933108_62463702.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define x first
#define y second
#define ndl '\n'
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define up_b upper_bound
#define low_b lower_bound
#define sz(x) (int)x.size()
#define bit __builtin_popcount
#define all(x) x.begin(), x.e... | ALGO | 0.999653 | 3.668056 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40: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": "8f3a347a3... |
da3ff51e-ef9b-4c46-8915-89ef7f17451c | sfvsfv/ComputerStudent | C语言数据结构/通讯录1.cpp | #include <stdio.h>
#include <malloc.h> //得到指向大小为Size的内存区域的首字节的指针//
#include <string.h>
#include <stdlib.h> //标准库函数//
#define NULL 0
#define LEN sizeof(struct address_list) //计算字节//
int n;
struct address_list
{
char name[30]; //名字
char work[30]; //职业
char handset[30]; //手机
char email[30]; //电子邮件
char address[30]; //通讯地址... | TOOL | 0.999211 | 3.732886 | {
"github_metadata": {
"branch": "main",
"commit_count": 122,
"repo_created_at": "2022-04-02T17:59:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 130,
"forks": 44,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb7b295... |
ff48d32a-19d8-42dd-8c59-ddaad3021134 | Inazuma110/atcoder | cpp/AOJ/extgcd/main.cpp | #include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// #include <atcoder/all>
// using boost::multiprecision::cpp_int;
using namespace std;
// using namespace atcoder;
#if __has_include("print.hpp")
#include "print.hpp"
#endif
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define ALL(x) (x)... | ALGO | 0.999969 | 5.43686 | {
"github_metadata": {
"branch": "master",
"commit_count": 179,
"repo_created_at": "2018-02-09T15:11: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": "7f3fa88e... |
f64fd6bf-4aa5-4de8-90b6-7fbd6dfac0e1 | ARM-software/ComputeLibrary | src/core/NEON/kernels/arm_conv/pooling/pooling_u8.cpp | /*
* Copyright (c) 2021-2022 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* ri... | TOOL | 0.972336 | 3.426151 | {
"github_metadata": {
"branch": "main",
"commit_count": 4770,
"repo_created_at": "2017-03-10T14:51:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3008,
"forks": 795,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "23f82... |
6ee58368-b8ee-43d5-bb46-a50470ca9962 | billw2012/BGalaxy1 | MyLibs/Math/ridgedmultifractal.inl | namespace math {;
template < class FTy_, class NPTy_ >
RidgedMultifractalProvider<FTy_, NPTy_>::RidgedMultifractalProvider(
value_type offset, value_type gain)
: _offset(offset), _gain(gain)
{
}
template < class FTy_, class NPTy_ >
typename RidgedMultifractalProvider<FTy_, NPTy_>::value_type
RidgedMultifractalProv... | ALGO | 0.993047 | 6.948997 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2012-03-28T20:25:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bb873a11... |
9edb2635-ca56-4b1a-a3a6-92d1fe76d163 | gulinghao1847/github | leetcode/unknown/gray_code/answer.cpp | /*
Gray Code Total Accepted: 6399 Total Submissions: 20435 My Submissions
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of gray code. A gray code sequence must begin with ... | ALGO | 0.999928 | 5.591876 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2013-10-16T04:54:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 26,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6cd52d0... |
3dffaf56-bb45-4041-9790-7dc986ee16fb | endixk/c-playground | boj/alg/fast-fourier-transform.cpp | // Complex vector multiplication in O(NlogN) using FFT
// Supported by GitHub Copilot
#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
void fft(vector<complex<double>> &v, complex<double> w){
int n = (int)v.size();
if(n == 1) return;
vector<complex<double>> e(n/2), o(n/2);
fo... | ALGO | 0.999905 | 5.639803 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2022-06-13T05:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ecb48c8eb8e... |
8375518a-7d73-4d70-9829-990000703404 | aksamota/geeksforgeeks_practice | dp/0_1_knapsack.cpp | #include <bits/stdc++.h>
using namespace std;
int values[1005]{0};
int weights[1005]{0};
int dp[1005][1005] = {0};
// Top-Down Approach
int knapsack(int n, int w) {
// Check in dp grid
if (dp[n][w] != -1) {
return dp[n][w];
}
// Base Case
if (w == 0 || n == 0) {
return dp[n][w] = ... | ALGO | 0.999998 | 4.160526 | {
"github_metadata": {
"branch": "master",
"commit_count": 183,
"repo_created_at": "2020-04-12T05:45: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": "c3e79579... |
1471acfd-fdeb-447b-9e14-627ec87d5fff | arrebole/Leisure | src/OJ/1165【素数,循环嵌套】/main.cc | #include <stdio.h>
#include <math.h>
using namespace std;
int *sieve(int n)
{
int *intList = new int[n + 1];
for (int i = 0; i <= n; i++)
{
intList[i] = i;
}
// 筛选倍数关系
for (int p = 2; p <= (int)sqrt(n); p++)
{
// 跳过重复筛选
if (intList[p] != 0)
{
int... | ALGO | 0.999807 | 3.614361 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2018-08-13T13:19: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": "564ac3ad0... |
76185d38-4209-48f9-8535-b9e75678d6a1 | nicolazilio0/MAPF | path_planning/include/DijkstraSearch.hpp | #ifndef DIJKSTRA_SEARCH_HPP
#define DIJKSTRA_SEARCH_HPP
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <random>
#include <limits>
#include <algorithm>
#include "tsl/ordered_map.h"
namespace dijkstra
{
class Node
{
public:
double x;
double y;
double cost;
i... | ALGO | 0.999889 | 3.90668 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2023-12-04T17:35: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": "426c84e5a9f... |
61b1d44a-54c7-4599-b865-ba1cd63a15ae | nkuik/accelerated-cs-fundamentals | unordered_data_structures/week_2/challenge.cpp | #include <iostream>
#include <vector> // for std::vector
class DisjointSets {
public:
int s[256];
int roots[256];
DisjointSets() { for (int i = 0; i < 256; i++) s[i] = -1; }
int find(int i);
private:
std::vector<int> to_update_;
};
/* Modify the find() method below
* to implement path compression
* so that ... | ALGO | 0.999775 | 4.946566 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2019-08-07T18:10: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": "93a96c0f6... |
1001a4c1-eb14-4b78-b546-1c87da28ff0c | CISC2200-Fall-24-Fordham/Lab-6 | BSTMap.h | #ifndef __BSTMAP_H__
#define __BSTMAP_H__
#include <ostream>
#include <sstream>
#include <string>
#include <cmath>
#include <cstddef>
#include <ostream>
#include <vector>
using namespace std;
class BSTMapNode {
public:
int key;
string value;
BSTMapNode *left;
BSTMapNode *right;
BSTMapNode(const int &k, ... | TOOL | 0.984569 | 4.839642 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-11-13T15:50:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3f3f6ed443e... |
84c6e764-acb9-431d-ab1c-0d832b503be0 | Hikari9/UVa | 6044 - Unique Path.cpp | /**
ACM 6044 - Unique Path
by <NAME>
Submitted: December 6, 2013
Accepted 0.143s C++
O(|V|+E) time
*/
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
using namespace std;
int t, n, m, tc;
vector<int> adj[10001];
int e1[100001], e2[100001];
bool bridge[100001];
namespace Tarjan {
voi... | ALGO | 0.999958 | 4.757923 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2016-01-03T04:44:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58570a88... |
f42c25d7-7285-4957-9f69-c770a86dcc83 | quentin-dev/gba-jam-2022 | include/gj_movement.h | #ifndef GJ_MOVEMENT_H
#define GJ_MOVEMENT_H
#include "bn_fixed.h"
#include "bn_log.h"
#include "bn_point.h"
#include "gj_constants.h"
// ATTN: Most code in this file assumes movement cannot(!!!) wrap around edges
namespace gj::movement {
bn::point get_next_player_position(bn::point *position,
... | ALGO | 0.925301 | 7.323162 | {
"github_metadata": {
"branch": "acceptance",
"commit_count": 35,
"repo_created_at": "2022-08-05T14:24:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84754... |
1cd267f1-c6d7-4abf-b015-a65b85e23996 | classner/fertilized-forests | include/fertilized/util/argsort.h | /* Author: <NAME> */
#pragma once
#ifndef FERTILIZED_UTIL_ARGSORT_H_
#define FERTILIZED_UTIL_ARGSORT_H_
#include <vector>
#include <random>
#include <type_traits>
#include <algorithm>
#include "../global.h"
namespace fertilized {
/**
* \brief Highly efficient argsort realized with few STL commands.
*
* In... | ALGO | 0.99987 | 7.04587 | {
"github_metadata": {
"branch": "master",
"commit_count": 425,
"repo_created_at": "2014-11-21T14:38:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e07534... |
b04f6aff-5501-4321-a848-0fcbe78267b6 | Laanith/DSA | 2DArrays/Medium/CountServersThatCommunicate_LC.cpp | #include<bits/stdc++.h>
#include<algorithm>
#define ll long long
#define PYES cout<<"YES"<<endl
#define PNO cout<<"NO"<<endl
#define PMINUS cout<<-1<<endl
#define vi vector<int>
#define vll vector<long long>
#define vpi vector<pair<int,int>>
#define vs vector<string>
#define qi queue<int>
#define si stack<int>
#define ... | ALGO | 0.999955 | 5.305897 | {
"github_metadata": {
"branch": "main",
"commit_count": 350,
"repo_created_at": "2023-08-08T04:08: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": "60a77d50ba... |
c9c074e6-8634-4737-81f2-6aaa6d3b5b47 | jose-dom/bitcoin_forecasting | env/lib/python3.9/site-packages/pystan/stan/lib/stan_math/stan/math/prim/mat/fun/matrix_exp_pade.hpp | #ifndef STAN_MATH_PRIM_MAT_FUN_MATRIX_EXP_PADE_HPP
#define STAN_MATH_PRIM_MAT_FUN_MATRIX_EXP_PADE_HPP
#include <stan/math/prim/mat/fun/MatrixExponential.h>
namespace stan {
namespace math {
/**
* Computes the matrix exponential, using a Pade
* approximation, coupled with scaling and
* squaring.
*
* @tparam Matr... | ALGO | 0.999713 | 6.597449 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-01-04T01:45:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 12,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "793a7e16... |
b60ed986-8368-4838-b0c3-bba17da08ea0 | TrinhManhHung/SAMSUNG_ALGORITHMS_2024 | S03 - LỰA CHỌN THAM LAM.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define faster() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define mod (ll)(1e9 + 7)
#define endl "\n"
void findMin(int n, int s){
int mi[n+1] = {0};
mi[1] = 1;
s--;
int idx = n;
while(s >0){
if(s > 9){
... | ALGO | 0.999024 | 3.443347 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2024-07-14T07:31:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5cb7bf91d13... |
fae0a7ed-846c-456a-85bb-9c1a9774a93e | mooleetzi/lab | dataStructure/静态查找.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
#define MAXSIZE 101
#define OK 1;
typedef struct {
int key;//关键字域
}ElemType;
typedef struct {
ElemType *R;
int length;
}SSTable;
struct block{
int r[MAXSIZE];
int minx;
int operator<(const bloc... | ALGO | 0.999752 | 3.250521 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-06-24T05:22:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3e1893022... |
7b4040d1-f39f-4c6a-aa6f-e947e8275567 | ONGOING-Z/Learn-Algorithm-and-DataStructure | OJ/LeetCode/leetcode/problems/897.cpp | #include <stdio.h>
#include <vector>
using namespace std;
/* Leetcode */
/* 题目信息 */
/*
* 897. Increasing Order Search Tree
Given a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only 1 right child.
Example 1:
... | ALGO | 0.999995 | 5.840733 | {
"github_metadata": {
"branch": "dev",
"commit_count": 713,
"repo_created_at": "2019-06-03T06:46:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e349a65746... |
3b008684-814a-4640-b42d-b0b4305cae68 | Golangltd/codeclass | interface{}/src/opencv-master/opencv110/cxcore/src/cxlut.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | TOOL | 0.919227 | 3.725379 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2018-08-14T03:58:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 615,
"forks": 195,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "dd600... |
e9ca4c68-098d-4d06-b5d9-c763388746d8 | TakuroNegishi/MatchingTest | MatchingTest/main.cpp | #include <opencv2/opencv.hpp>
#include <exception>
#include <Windows.h>
#include "DirectionEstimator.h"
#include <fstream>
using namespace cv;
using namespace std;
// 指定フォルダのファイルを取得する
vector<string> getFiles(const string& dir_path, const string& filter) {
WIN32_FIND_DATAA fd;
string ss = dir_path + filter;
HANDLE ... | DATA | 0.907575 | 4.348228 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-08-05T20:08:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0077937b7d... |
b6a142d8-705b-4f81-80b9-9a6e3a237c57 | projectchrono/chrono | src/chrono/collision/bullet/BulletCollision/Gimpact/cbtGImpactBvh.cpp | /*! \file gim_box_set.h
\author <NAME>
*/
/*
This source file is part of GIMPACT Library.
For the latest info, see http://gimpact.sourceforge.net/
Copyright (c) 2007 <NAME>. C.C. 80087371.
email: <EMAIL>
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held... | ALGO | 0.998694 | 5.579777 | {
"github_metadata": {
"branch": "main",
"commit_count": 18253,
"repo_created_at": "2013-09-03T15:34:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2460,
"forks": 515,
"issues": 101,
"pull_requests": 4
},
"file_meta": {
"content_id": "a1... |
05f2196d-2593-4b6b-91aa-e8f643fe454d | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/13_15479_40.cpp | #include <iostream>
using namespace std;
bool diagonal(char ch, char input_2D_array[4][4])
{
int nTemp = 0;
for(int nCount = 0; nCount < 4; nCount++)
{
if(input_2D_array[nCount][nCount] == ch || input_2D_array[nCount][nCount] == 'T')
{
nTemp++;
}
}
if(nTemp == 4)
{
return true;
}
else
{
nTemp ... | ALGO | 0.999532 | 4.45075 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00: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": "0bfbc12e5... |
77ffb112-1220-47e5-96fe-5cb2555a3518 | nysd01/ARDUINO_PRO | joystick/joystick.ino | int motorPin = 9;
int switch_1 = 4;
int switch_2 = 5;
int switch_3 = 6;
int switch_4 =7;
int btnBreak = 8;
int led = 10;
const int joyLpin = A0; // left joystick
const int potPin = A2;
int joyL; // left joystick reading (0-1023 from ADC)
const int deadzone = 20;
int joyLneutral; // l... | ALGO | 0.926629 | 4.878695 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-07-27T10:53:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "335514c1738f... |
f921efa2-cd4c-4745-bee1-cf26489c1a81 | mingweng/jiedui | 结对编程.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <unordered_map>
#include <algorithm>
#include <cctype> // 确保包含 cctype 头文件,用于 ::tolower
struct AnalysisResult {
int wordCount;
int lineCount;
int charCount;
std::unordered_map<std::string, int> wordFrequency;
};
Analy... | TOOL | 0.974636 | 5.258605 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-22T08:44: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": "97a0cf6596de... |
0ac6d715-a8e2-4d9c-ac16-d752854f8a9f | magsilva/dtm-old | gslwrap/include/gslwrap/matrix_double.h | // matrix.h
// This matrix class is a C++ wrapper for the GNU Scientific Library
// Copyright (C) 2001 <NAME>
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the Li... | TOOL | 0.966348 | 6.296949 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2013-05-13T02:28:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 20,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7911a88... |
78891e44-8a6c-4d9e-b9b6-8581facc72dc | mzl13/Lithium | Src/LinearSolvers/hypre/include/fei_LinearSystemCore.hpp | #ifndef _fei_LinearSystemCore_hpp_
#define _fei_LinearSystemCore_hpp_
class Data;
class Lookup;
#include <fei_defs.h>
/**
This is the original internal FEI interface to solver-libraries --
the destination for the data being assembled into a linear system by the FEI
implementation.
When creating a specifi... | TOOL | 0.942488 | 4.060011 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2020-01-21T10:19:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a03c3200... |
b466d110-5478-4aa4-af73-fc88f2f46588 | jose-dom/bitcoin_forecasting | env/lib/python3.9/site-packages/pystan/stan/lib/stan_math/stan/math/prim/mat/prob/multi_normal_cholesky_rng.hpp | #ifndef STAN_MATH_PRIM_MAT_PROB_MULTI_NORMAL_CHOLESKY_RNG_HPP
#define STAN_MATH_PRIM_MAT_PROB_MULTI_NORMAL_CHOLESKY_RNG_HPP
#include <stan/math/prim/scal/err/check_size_match.hpp>
#include <stan/math/prim/scal/err/check_finite.hpp>
#include <stan/math/prim/mat/meta/vector_seq_view.hpp>
#include <stan/math/prim/scal/me... | TEST | 0.994296 | 6.651462 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-01-04T01:45:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 12,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2e130af5... |
b3e2aad7-e619-4951-874f-1896e1aa37ac | ziglang/zig | lib/libcxx/include/__algorithm/ranges_transform.h | //===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | ALGO | 0.996581 | 7.450708 | {
"github_metadata": {
"branch": "master",
"commit_count": 34092,
"repo_created_at": "2015-08-06T00:51:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 40012,
"forks": 2915,
"issues": 3389,
"pull_requests": 267
},
"file_meta": {
"content_i... |
1c57b976-d78f-40d9-b9ac-c66dc472f275 | GoncaloPinto03/DA-proj2-FEUP | data_structures/VertexEdge.cpp | #include "Graph.h"
using namespace std;
Vertex::Vertex() {
this->id = 0;
this->dist = 0;
this->visited = false;
this->path = nullptr;
}
Vertex::Vertex(int id) {
this->id = id;
this->visited = false;
this->path = nullptr;
}
Vertex::Vertex(int id, double longitude, double latitude) {
this... | ALGO | 0.998791 | 3.963876 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-05-22T16:19: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": "9aa8b57743a... |
74163362-0b07-43ba-9447-117736c04ef9 | manh610/CTDL-GT | Contest4/bai34.cpp | #include<bits/stdc++.h>
#define IOS() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long int ll;
int m,n;
vector< pair<int,int> > p,q;
vector< vector<pair<int,int>> > res;
void Input() {
res.clear();
cin >> m >> n;
p.resize(m); q... | ALGO | 0.999962 | 4.132906 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-05-21T02:58:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f82c97c41e... |
f9aeca1f-17ff-49ab-9805-0933e27958fb | shogunbanik18/DS-ALGO | Striver's SDE Sheet/Day 18/8 . Boundary Traversal of binary tree.cpp | /* A binary tree Node
struct Node
{
int data;
Node* left, * right;
}; */
// using traversal + preorder traversal
class Solution {
public:
void addleft(Node*root,vector<int>&v)
{
Node* curr=root->left;
while(curr!=NULL)
{
if(!isleaf(curr))
{
... | ALGO | 0.999992 | 5.612864 | {
"github_metadata": {
"branch": "main",
"commit_count": 1199,
"repo_created_at": "2021-10-19T16:16:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3a2ade25... |
528b42a9-35e3-409e-b944-87be49d7abcf | rubengb18/Estructuras-de-datos | ED/Problema27/Problema27/1.NumeroCasos.cpp |
// <NAME> Apellidos
// Comentario general sobre la solución,
// explicando cómo se resuelve el problema
#include <iostream>
#include <fstream>
#include <sstream>
#include "bintree_eda.h"
using namespace std; // propios o los de las estructuras de datos de clase
// función que resuelve el problema
// comentario sob... | ALGO | 0.999966 | 4.901819 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-06-01T13:51:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c2e67fb30be7... |
e36e9cfa-75fe-4f8a-b096-40239eae705e | softarts/myoj | ojcpp/leetcode/1000/1071_e_greatecommondivisorstring.cpp | //
// Created by rui.zhou on 9/30/2019.
//
/*
* For strings S and T, we say "T divides S" if and only if S = T + ... + T (T concatenated with itself 1 or more times)
Return the largest string X such that X divides str1 and X divides str2.
Example 1:
Input: str1 = "ABCABC", str2 = "ABC"
Output: "ABC"
Example 2:
... | ALGO | 0.999134 | 6.251536 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2022-09-26T01:29:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8aed5e2bf... |
86dca21f-e7df-4711-a2a1-cf68ec2b177b | joaquingx/Competitive-Algorithms | Graphs/Dijkstra.cc | #include <bits/stdc++.h>
using namespace std;
/*
SSP Algorithm.
NiceDijkstra(Grafo,source) : Adjacency list Grafo, vertex source, in dist
we save the dist(source,v) for all v that is in V.
Vars:
List: Adjacency List.
now: Priority Queue
*/
#define INF 2*1e12
typedef long long ENTERO;
struct edge{ENTERO to... | ALGO | 0.999879 | 3.960454 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2015-06-13T20:43: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": "278751483... |
9c6522fe-9912-4216-8d00-0dedd400da1a | KawaiiNoodle20/ClassWork | negativeNumsHL.cpp | /*
Program written by <NAME>
Professor Shave
Chapter2Hw3
====================================
This program takes the input of 4 numbers (should be negative), and adds the total of all the negative numbers.
If a positive number is input it will print out a ERROR message, and that number will no be calculated in the tot... | ALGO | 0.999005 | 3.874411 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-09-24T17:06: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": "3dce492ee2... |
041d6724-da7d-4201-b53d-ce6c8a8b208d | cdries/rTrawl | src/acov.cpp | #include "RcppArmadillo.h"
#include "observe_process.h"
#include "cum.h"
#include "acf_ccf_helper.h"
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
// [[Rcpp::export()]]
List acov(double h, arma::vec x_grid, arma::vec p_grid,
double T0, double TT, int lag_max) {
// computes sample autoco... | ALGO | 0.987602 | 6.795387 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2018-03-13T10:17:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "add307d2... |
0afee2c7-2996-4291-a042-74f6a8cbce62 | Gabrielomn/Sokoban---Sob-a-mira | Sokoban SOB A MIRA/main.cpp | #include "sokoban.h"
#include "metodos.h"
#include "jogo.h"
#include <allegro.h>
volatile bool exit_program=FALSE;
void fecha_programa();
void fase(sokoban &p, BITMAP*C, BITMAP*P, BITMAP*F, BITMAP*PE0, BITMAP*PE1, BITMAP*PE2, BITMAP*PE3, BITMAP*D, BITMAP*G, MIDI*,BITMAP*, BITMAP*);
int main()
{
int teste = 0;
sok... | TOOL | 0.980633 | 3.755597 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-07-21T22:33:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43afd56b43... |
d0ef383c-55b0-4527-b324-eedb5d6e1423 | ravichaudhary8434/CodeForces_A2OJ_ladder | LevelA/488A-GigaTower.cpp | #include<bits/stdc++.h>
using namespace std;
bool isEight(int n) {
if(n<0) {
n *= -1;
}
n = n/10;
while(n) {
if(n%10 == 8) {
return true;
}
n = n/10;
}
return false;
}
int minFloor(int n) {
int place = 0, ans=0;
if(n==0) return 8;
if(isE... | ALGO | 0.999537 | 3.938084 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-07-21T18:33: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": "8a534a74fc... |
dfe932c1-6839-44d3-8228-35aa962d25b1 | morishita8256/Codeforces | CR/CR598/A. Payment Without Change.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#defi... | ALGO | 0.999803 | 3.506676 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2020-02-20T14:41:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae40f1de0... |
2fd3933e-a17b-4aa6-9daa-fb2850451a90 | jonatasazevedo/Solutions-To-Competitive-Programming-Problems | IX Maratona Mineira de Programação/A.cpp | #include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
using namespace std;
typedef long long ll;
#define fi first
#define sec second
#define MAX_NM 1005
#define QT_DIR 4
int dirI[QT_DIR]={-1,0,1,0}, dirJ[QT_DIR]={0, 1, 0, -1};
char a[MAX_NM][MAX_NM];
int n, m, t,... | ALGO | 0.999969 | 3.667893 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2023-08-12T00:59:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7dcbb32b8... |
231c9058-4c73-4dfb-b276-32c0c8d830c7 | mullerpoint/CS-303-Semester-Project | Diffie-Hellman Project/key_party.cpp | //
//key_pary Class Implementation
//
//Header files - Standard libraries and classes
#ifndef CORE_DEPENDENCIES_H_
#define CORE_DEPENDENCIES_H_
//standard library includes
#include <iostream> //default include for functionality
#include <string> //get extended string functionality
#include <array> //array for array o... | ALGO | 0.98113 | 3.408215 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2016-03-18T19:35: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": "ab5a50d49... |
16c935c4-fede-4eb7-93be-8945804df26c | Lan-ce-lot/overflow | acwing/lanqiao/后翼弃兵/数学与简单DP/1212. 地宫取宝.cpp | /*************************************************************************
> FileName:
> Author: Lance
> Mail: <EMAIL>
> Date: 9102.1.8
> Description:
************************************************************************/
//#include <bits/stdc++.h>
//#pragma comment(linker, "/STACK:102400000... | ALGO | 0.999964 | 3.219297 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2020-07-12T14:35: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": "0e0867638... |
3cc91e01-ae62-4de9-ba02-9d389b9c4803 | JayhawkZombie/Projects | Sorting/Timed Sorting/SortInfo.h | /**
* @file SortInfo.h Sorts Lab07
* @author <NAME>
* @date November 14th, 2014
* @due Novemer 14th, 2014
*
*/
#ifndef SORT_INFO_H
#define SORT_INFO_H
#include <functional>
template<typename T>
class SortInfo
{
public:
/**
* @function function pointer to a Sorts class sorting method
* @return none
... | ALGO | 0.96843 | 5.653842 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2014-10-11T22:27: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": "6f5e60d6a... |
3a49081d-fa0b-4b0a-b064-d3c48ec3acab | devlipe/INF310 | pratica3/pratica3.cpp | /*******************************************************************************
* Problema da vacinação em duas etapas utilizando semáforo.
* Em um esquema de vacinação em duas doses, onde 3 vacinas diferentes estão
* disponíveis, uma pessoa pode tomar qualquer uma das 3 vacinas na primeira
* dose. Na segunda dose... | ALGO | 0.999177 | 4.937183 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-10-18T18:44:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e9dd0a9b58c... |
ad6ead09-cdbd-4f62-8984-8ea0546b442b | Apress/ray-tracing-gems | Ch_16_Sample_Transformations_Zoo/SampleMipMap.cpp | int2 SampleMipMap(Texture& T, float u[2], float *pdf)
{
// Iterate over mipmaps of size 2x2 ... NxN.
// load(x,y,mip) loads a texel (mip 0 is the largest power of two)
int x = 0, y = 0;
for (int mip = T.maxMip()-1; mip >= 0; --mip) {
x <<= 1; y <<= 1;
float left = T.load(x, y, mip) + T.l... | ALGO | 0.998904 | 4.614274 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2019-03-12T18:24:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1012,
"forks": 114,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "04cf8... |
07e7d4d4-58b1-4036-9da0-8bf7da9d8db6 | virtual-labs-archive/image-processing-iiith | src/lab/codes/im_path4c.cpp | #include<iostream>
#include<queue>
#include<stdio.h>
#include <string.h>
#include<opencv/cv.h>
#include<cmath>
#include<opencv/highgui.h>
using namespace std;
IplImage* imPATH(IplImage *img,int xs,int ys,int xd,int yd)
{
int c = cvGetSize(img).width;
int r = cvGetSize(img).height;
IplImage* final_img=cvCreateIma... | ALGO | 0.991672 | 3.614204 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2014-11-04T10:34:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 57,
"issues": 206,
"pull_requests": 46
},
"file_meta": {
"content_id": "4d3cc... |
d7352871-7b76-4829-be86-fb99f741c07c | nikolapesic2802/Programming-Practice | Gap/main.cpp | /*
-For subtask 1 just repeatedly find the next biggest and smallest number.
-For subtask 2, find the biggest and the smallest number (cost will be N+1);
-Now notice that the solution will be at least (r-l+1-n)/(n-1) rounded up.
-We can split the search space into parts of that size and query for the bi... | ALGO | 0.999753 | 3.712106 | {
"github_metadata": {
"branch": "master",
"commit_count": 371,
"repo_created_at": "2018-11-05T15:11:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adfa8afc... |
530c9e63-895f-4586-b203-7d267c931ab9 | kosirobwada/AtCoder | ABC312/b.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
int N,M;cin >> N >> M;
vector<vector<char>> S(N,vector<char>(M));
for(int i=0; i<N; i++){
for(int j=0; j<M; j++){
cin >> S[i][j];
}
}
vector<pair<int,int>> p;
... | ALGO | 0.99994 | 3.200486 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2023-04-15T10:20:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b8e0908650... |
f9f31257-cec4-45f5-a3fe-80803a9ee149 | SquirtlesAlgorithmStudy/SquirtlesAlgorithmStudy-Hard | 현중/백준 14891 톱니바퀴.cpp | // 백준 14891 톱니바퀴
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<string> gears(4); // 1: {1010101} 2: {1010101} 3: {1010101} 4: {1010101}
vector<int> directions(4); // {1 -1 1 -1}
// 1. 톱니바퀴 시계(1), 반시계(-1)회전하는 알고리즘
void rotate_gear(int idx, int dir)
{ // (1: 1) (2: -1) (3: 1) (4... | ALGO | 0.999917 | 5.008079 | {
"github_metadata": {
"branch": "main",
"commit_count": 270,
"repo_created_at": "2024-03-25T15:52:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 15,
"pull_requests": 0
},
"file_meta": {
"content_id": "13b71d8baf... |
5a8d58d8-e6cb-443a-ba5c-cb79af94c11a | RosettaCommons/rosetta | source/src/core/conformation/symmetry/SymmetryInfo.hh | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the co... | TOOL | 0.953823 | 6.64977 | {
"github_metadata": {
"branch": "main",
"commit_count": 11737,
"repo_created_at": "2023-11-17T16:42:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 296,
"forks": 100,
"issues": 27,
"pull_requests": 9
},
"file_meta": {
"content_id": "3fec... |
0ad7c1df-55c0-4278-bd68-3c15f5d58b7d | pmehnert/distributed-string-sorting | src/sorter/distributed/prefix_doubling.hpp | // (c) 2019 <NAME>
// (c) 2023 <NAME>
// This code is licensed under BSD 2-Clause License (see LICENSE for details)
#pragma once
#include <algorithm>
#include <iterator>
#include <numeric>
#include <random>
#include <type_traits>
#include <kamping/collectives/allreduce.hpp>
#include <kamping/collectives/alltoall.hpp... | ALGO | 0.998389 | 7.829899 | {
"github_metadata": {
"branch": "master",
"commit_count": 357,
"repo_created_at": "2023-06-15T07:21:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89a4c40b... |
441727e2-2f0d-43f6-8a90-62ab708ab8f3 | checkoutb/LeetCodeCCpp | daily_challenge/2021/LT_2021-07-27_Convert_Sorted_Array_to_Binary_Search_Tree.cpp |
#include "../../header/myheader.h"
class LT
{
public:
// D D
//int mid = (low + high) >>> 1
// void recursiveFunc( vector<int>& nums, TreeNode* node, int &low, int &mid, int &high )
// {
// if ( mid > low )
// {
// int lmid = low + ( ( mid - low ) / 2 );
// TreeNode *tempN... | ALGO | 0.999994 | 5.447013 | {
"github_metadata": {
"branch": "master",
"commit_count": 285,
"repo_created_at": "2019-04-22T09:20:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd6dd5fa... |
919692e6-3a68-4d47-937d-cb36c8d72bee | Abhinandan-2/LeetCode-And-GFG | Delete N nodes after M nodes of a linked list - GFG/delete-n-nodes-after-m-nodes-of-a-linked-list.cpp | // { Driver Code Starts
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
/* A linked list node */
struct Node
{
int data;
struct Node *next;
Node(int x){
data = x;
next = NULL;
}
};
struct Node *start = NULL;
/* Function to print nodes in a given... | ALGO | 0.99975 | 4.390145 | {
"github_metadata": {
"branch": "main",
"commit_count": 2776,
"repo_created_at": "2022-05-20T09:30:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb7ae137d... |
0a93abfa-bccc-4a62-9af6-3ebc45912ada | kassonlab/gmxapi | src/gromacs/linearalgebra/gmx_lapack/dorml2.cpp | #include <cctype>
#include "../gmx_lapack.h"
#include "gromacs/utility/real.h"
void
F77_FUNC(dorml2,DORML2)(const char *side,
const char *trans,
int *m,
int *n,
int *k,
double *a,
int *lda,
double *tau,
double *c,
int *ldc,
double *work,
int gmx_unused *info)
{
const char xside=std::toupper(*side);
c... | ALGO | 0.991325 | 4.84952 | {
"github_metadata": {
"branch": "master",
"commit_count": 19315,
"repo_created_at": "2017-05-25T14:05:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 53,
"forks": 13,
"issues": 93,
"pull_requests": 2
},
"file_meta": {
"content_id": "463f... |
18c17dd7-7f37-45fa-8c58-e97c13815468 | peacewang017/leetcode_cpp | linked_list/lc25.cc | #include "../type/linked_list.h"
class Solution {
public:
ListNode* reverseAll(ListNode* head) {
if (!head || !head->next) {
return head;
}
ListNode* next = head->next;
ListNode* new_head = reverseAll(next);
next->next = head;
head->next = nullptr;
... | ALGO | 0.999935 | 5.996174 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-12-23T13:28:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f1fdf0cf9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.