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 |
|---|---|---|---|---|---|---|---|
c19b5cd7-8739-4bac-8f7a-29427f3b5b78 | ngthanhtrung23/ACM_Notebook_new | DataStructure/DSU/DSU_dynamic_connectivity.h | #include "DSU_rollback.h"
// Index from 0
// Tested:
// - https://codeforces.com/gym/100551/problem/A
// - https://www.spoj.com/problems/DYNACON2/
//
// Dynamic connectivity {{{
namespace DynamicConnectivity {
enum QueryType { ADD, REM, IS_CONNECTED, N_COMPONENTS };
struct Query {
QueryType typ;
... | ALGO | 0.999556 | 5.278111 | {
"github_metadata": {
"branch": "master",
"commit_count": 942,
"repo_created_at": "2015-01-11T13:46:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 442,
"forks": 128,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3246... |
6e8d4b4e-a63e-47bb-b27f-a56931d10fb0 | brianrobo/CheckAPS | Graph/08_bfs_(adj_matrix_and_self_queue).cpp | #include <iostream>
using namespace std;
struct Queue {
int data[10000];
int begin;
int end;
Queue() {
cout << "Init Queue" << endl;
begin = 0;
end = 0;
}
void push(int num) {
data[end] = num;
end++;
}
int pop() {
begin++;
return data[begin - 1];
}
int front() {
return data[begin];
}
b... | ALGO | 0.999955 | 3.715466 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2017-01-24T14:35: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": "56c80f7fb... |
518b1ed0-7712-400b-afbd-7c2b3508f8ac | AndreyYarkovBMSTU/MolecularDynamics | electrostatics/methods.cpp | #include "methods.h"
void NonIteractingDipoles::setDipoleMoment()
{
// dipolemoment = system->ksi * pow(2 * system->particles[0]->radius, 3) * system->environment->externalfield->electricfield / 8.0;
dipolemoment = system->ksi * system->environment->externalfield->electricfield;
for (int i = 0; i < system->... | ALGO | 0.995514 | 3.587161 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-10-05T14:45: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": "6141751fc... |
b9c0a10d-b1aa-4648-b0ff-a367c10f82b3 | Marcos1701/Estrutura_de_Dados_I | Atividade_04/teste_q_3_3.cpp | #include <iostream>
#include "pilha_int_vetor.h"
#include <string.h>
#include <ctype.h>
using namespace std;
int prio(char o)
{
if (o == '(')
return 0;
else if (o == '-' || o == '+')
return 1;
else if (o == '*' || o == '/')
return 2;
return 0; // operador invalido!
}
char *ger... | ALGO | 0.996089 | 4.123024 | {
"github_metadata": {
"branch": "main",
"commit_count": 214,
"repo_created_at": "2022-08-05T14:02:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b59f8c35cd... |
4d4b36db-93e8-4697-8516-bc76dad048ff | eujuu/Algorithm | 프로그래머스/2018서머코딩_숫자게임/2018서머코딩_숫자게임.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int n,cnt;
vector<int> sorting (vector<int> arr){
int tmp = 0;
for(int i=0; i < arr.size()-1; i++){
for(int j = i +1; j < arr.size(); j++){
if(arr[i] > arr[j]){
tmp = arr[i];
... | ALGO | 0.999879 | 4.492798 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2019-10-02T02:36: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": "ef60f047... |
30feebae-84ee-4dc9-88c1-074f6fe05979 | TarunSaini063/Coding | DataStructure/codeforces/start4_4.cpp | #include <bits/stdc++.h>
using namespace std;
#define ld double
#define ll long long
#define pb emplace_back
#define mk make_pair
#define mod 1000000007
#define ff first
#define ss second
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) x.begin(),x.end()
ll power(ll a, ll b) {... | ALGO | 0.999861 | 3.63066 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2020-04-04T07:52:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c45ffe0f2... |
125a88ac-c9c6-4675-8e81-f28f381da356 | brianbbsu/8BQube | codebook/5_String/exSAM.cpp | struct exSAM {
int len[N * 2], link[N * 2]; // maxlength, suflink
int next[N * 2][CNUM], tot; // [0, tot), root = 0
int lenSorted[N * 2]; // topo. order
int cnt[N * 2]; // occurence
int newnode() {
fill_n(next[tot], CNUM, 0);
len[tot] = cnt[tot] = link[tot] = 0;
return tot++;
}
void init() ... | ALGO | 0.999949 | 3.85432 | {
"github_metadata": {
"branch": "master",
"commit_count": 507,
"repo_created_at": "2019-10-11T11:37:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 18,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55853e... |
083430c5-e516-436f-bd13-cde97d35f823 | ishandutta2007/codeforces-e | emptysoulist/normal/1270/H.cpp | #include<bits/stdc++.h>
using namespace std ;
#define Next( i, x ) for( register int i = head[x]; i; i = e[i].next )
#define rep( i, s, t ) for( register int i = (s); i <= (t); ++ i )
#define drep( i, s, t ) for( register int i = (t); i >= (s); -- i )
#define re register
#define ls(x) (x << 1)
#define rs(x) (x << 1 | 1... | ALGO | 0.999832 | 4.074137 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fe80c19c431... |
a17d2eb9-c9b8-44ef-8352-e598d37d746c | YangJiaxiu/MyCode-Luogu | 1828.cpp | #include<bits/stdc++.h>
/*
奶牛数N,
牧场数(2<=P<=800),
牧场间道路数C(1<=C<=1450)
cowFarm:下标指的是:牧场的号码;cowFarm[i]指的是:牛(在牧场[i])的数量
dist数组第一维是起点,第二维是终点;
*/
const int MaxN = 800 * 2;
const int MaxP = MaxN;
const int oo = 0x3f3f3f3f;
int N, P, C, cowFarm[MaxN] = {0}, dist[MaxP][MaxP];
void floyd() {
for (int k =... | ALGO | 0.999935 | 3.804608 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2018-04-07T23:35: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": "a7f84f435... |
ecf5f3e7-acee-490c-aa94-0d1cac91d32c | pranavdharrao/Polyglot-DSA-Solutions | Binary-Search/C++/nearlySorted.cpp | #include <iostream>
#include <vector>
using namespace std;
//search for nearly sorted array
int bs(vector<int> arr, int target){
int s = 0;
int e = arr.size() - 1;
while(s <= e){
int mid = s + (e-s)/2;
if(arr[mid] == target){
return mid;
}
if(mid+1 < arr.size()... | ALGO | 0.999973 | 5.082066 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2023-08-14T16:09: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": "d55b43bb681... |
3f8f2ce7-7361-42ba-b70d-60dc277302c0 | saraadel6/Linear-Structures | singleLinkedList&&problems.cpp | //Single Linked List
#include<bits/stdc++.h>
using namespace std;
template <class T>
struct Node {
public:
T item;
Node *next;
};
template <class T>
class singleLinkedList{
Node<T> *head;
Node<T> *tail;
int length;
public:
singleLinkedList();
void insertAtHead(T element);
void insertAtT... | ALGO | 0.999693 | 4.318619 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-04-09T10:40:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23b35c7cdd5... |
ed07a69b-7534-4f35-a8a9-6354f334dd35 | v8/v8 | src/compiler/value-numbering-reducer.cc | // Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/value-numbering-reducer.h"
#include <cstring>
#include "src/compiler/node-properties.h"
#include "src/compiler/node.h"
namespa... | TOOL | 0.996904 | 7.155739 | {
"github_metadata": {
"branch": "main",
"commit_count": 95989,
"repo_created_at": "2014-09-24T15:24:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 24276,
"forks": 4126,
"issues": 0,
"pull_requests": 18
},
"file_meta": {
"content_id": "a... |
f630b987-0a18-41f9-923b-2ce677409557 | ishandutta2007/codeforces-y | yuu/normal/1485/E.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<int> g[200001];
int p[200001];
int a[200001];
bool done[200001];
vector<int> level[200001];
int64_t f[200001];
deque<pair<int, int64_t>> up;
void dfs(int u, int h = 1) {
level[h].push_back(u);
done[u] = 1;
for (auto&& v : g[u])
if (done[v])... | ALGO | 0.999856 | 3.952801 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40: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": "199af01b5b3f... |
afcc992c-c0df-40b3-a33c-1ce867488858 | rtaverna/upgraded-telegram | CS246/Exams/Exam01/Solutions/exam01cS.cpp | #include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include "Array.h"
double AverageDistance(ds::Array<int>& data)
{
//Verify the minimum constraints
if(data.Length() == 0)
{
return 0;
}
else if(data.Length() == 1)
{
return data[0];
}
//declare distance variable and initialize s... | ALGO | 0.99831 | 4.359097 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-10-07T16:20: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": "4513fbdb57... |
8b9f1013-e4d6-4a47-974e-d1d620a4489c | Varanasi-Akshay/Parallel_Computing | Victor/VictorEijkhout-imp-code-5273cb440076/code/imp/laplace_functions.cxx | /****************************************************************
****
**** This file is part of the prototype implementation of
**** the Integrative Model for Parallelism
****
**** copyright <NAME> 2014-7
****
**** laplace_functions.cxx : implementations of the laplace support functions
****
*****************... | ALGO | 0.990751 | 5.493465 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-02-11T21:53: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": "9d8501e9a... |
09f82d4e-34fd-4f80-8c41-584615a95736 | camilohuertas02/computational_physics_1 | homework5/DerivacionNumerica.cpp | //----------------------------------------
// Autor: <NAME>
// Profesor: <NAME>
// Clase: Fisica computacional
// Universidad Distrital
// Proyecto: Derivacion numerica por 3 metodos
// ---------------------------------------
// Este script recibe datos de un .dat de tiempo, posicion, y calcula velocidad y aceleracion... | ALGO | 0.999551 | 4.049993 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-01-26T03:43: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": "22283a1861c... |
76e220c8-5c83-4865-af23-cc781746009f | keywet06/code | Zhengrui/Zhengrui1254/main.cpp | #include <bits/stdc++.h>
#include "maze.h"
// int get_edge_number()
// int get_coming_edge()
// int get_label()
// void set_label(int x)
// void move(int e)
const int N = 205;
const int M = 40005;
int n = 0;
int dis[N][N];
void dfs(int x);
inline void dfs(int x) {
set_label(++n + 1);
int c = get_coming_edge();
for ... | ALGO | 0.999881 | 3.169718 | {
"github_metadata": {
"branch": "master",
"commit_count": 702,
"repo_created_at": "2019-04-21T10:13:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99d6ff34... |
47636c1e-964b-4573-987b-60fc66551d5f | wyrover/book-code | The C++ Standard Library - A Tutorial and Reference/algo/unique2.cpp | /* The following code example is taken from the book
* "The C++ Standard Library - A Tutorial and Reference"
* by <NAME>, Addison-Wesley, 1999
*
* (C) Copyright <NAME> 1999.
* Permission to copy, use, modify, sell and distribute this software
* is granted provided this copyright notice appears in all copies.
* T... | ALGO | 0.994924 | 5.87569 | {
"github_metadata": {
"branch": "master",
"commit_count": 192,
"repo_created_at": "2016-07-24T07:29:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 388,
"forks": 248,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d561... |
b4264309-4dfb-4cbc-80b3-230de262a4ec | ethereum/serpent-go | serpent/optimize.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
#include "lllparser.h"
#include "bignum.h"
// Compile-time arithmetic calculations
Node optimize(Node inp) {
if (inp.type == TOKEN) {
Node o = tryNumberize(inp);
if (decimalGt(o.val, tt256, true))
... | ALGO | 0.983165 | 5.532079 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2014-11-04T23:21:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 21,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "585846b8f... |
93c90e56-7b1a-4f5b-be1f-bd1a63aa529d | Rockstatata/CP-solves | DSA/Stack/postfix.cpp | #include <bits/stdc++.h>
#include <stack>
using namespace std;
class InfixToPostfix
{
public:
InfixToPostfix(const std::string &expression) : expression_(expression) { }
int getPrecedenceOfOperators(char);
std::string convertInfixToPostfix();
private:
std::string expression_;
};
int InfixToPost... | ALGO | 0.99978 | 5.060503 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2023-10-30T23:31:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46cd5f39e79... |
8704d31d-34e1-47fb-89a7-f54379c286eb | satse13/JuecesEnLinea | FAL/ej38.cpp | // Nombre del alumno ..... <NAME>
// Usuario del Juez ...... A64
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
using namespace std;
// función que resuelve el problema
int resolver(const vector<char>& v,int ini, int fin,char primera){ // devuelve la posición del elemento siguiente al ... | ALGO | 0.999896 | 3.871647 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-11-11T16:18: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": "fd5bca746a70... |
7a9f2cae-a265-4a25-a54e-8538044d14a0 | khushigarg1/Problem-Solving-DSA | coding_ninja/l6_8_left_indices.cpp | #include<bits/stdc++.h>
using namespace std;
int leftindex(int a[] , int size , int x , int output[])
{
if(size == 0)
{
return 0;
}
int ans = leftindex(a - 1 , size -1 , x , output);
if(a[size-1] == x)
{
output[size-1] == x;
ans++;
}
return ans;
}
void indices(int... | ALGO | 0.999961 | 4.157246 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-11-29T07:04:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6670a90258b0... |
3994216e-b9ba-47d4-832b-1d2da35016c0 | stellakang/PS | BOJ/lca/11438.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N;
int parent[100005][17];
int depth[100005];
bool visit[100005];
void dfs(vector<vector<int> >&graph, int node, int d){
depth[node] = d;
for(int i=0;i<graph[node].size();i++){
int next = graph[node][i];
if(!visi... | ALGO | 0.999996 | 5.010061 | {
"github_metadata": {
"branch": "master",
"commit_count": 186,
"repo_created_at": "2020-04-24T07:52:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3737a22... |
cdc03a67-90a0-4b24-8674-b3eee3543b79 | hojunking/breaking_algorithm_cpp | greedy/KnapsackProblem.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef struct item *link;
typedef struct item{
int id;
int weight;
int profit;
int profit_per_unit;
}item_t;
int n,W,T;
vector<item_t> items;
void bubbleSort(){
for(int i=n; i>1; i--){
for(int j=1; j<i+1; j++){
cout <<... | ALGO | 0.999988 | 4.366523 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2022-03-05T09:51:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6933284c97f... |
c191afd3-4ba6-4669-a369-8fae4cf4001a | Gratuitous-Sets-Laboratories/NASA-CHAPEA | NASA-CHAPEA-PECTA/NASA-CHAPEA-PECTA.ino | /*
* GRATUITOUS SETS LABORATORIES
* Dallas, TX, USA
*
* NASA CHAPEA PECTA (Portable Emergency Communications & Telemetry Array)
* Johnson Space Center, TX, USA
*
* MABOB I (1.0) architecture
*
* NOTES:
* This version is functionally the same as the one marked Aug 2022
* and uploaded to the PECTA,
* I've ... | TOOL | 0.943269 | 5.654167 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-08-03T22:34:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a739807ec6b... |
65c79e34-93f0-4fcb-bd37-ca4d8b7276c4 | JohnDevitt/Thesis | ACE-ilProlog-1.2.20/linux/lib/math/graphs/dense_graph.h | #ufndef DENSE_GRAPH_INC
#define DENSE_GRAPH_INC
#include "bitmatrix.h"
#include "graph_structure.h"
class DenseGraph : public Graph {
public:
const static int safe_code=1;
private:
BitMatrix m_adj;
unsigned m_edgecount;
unsigned m_nodecount;
class node_type : public freelist_vector_item {};
typedef free... | ALGO | 0.947174 | 5.522831 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2016-06-21T14:21:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b356703d... |
84f5733c-9067-467a-a55f-f80690acf318 | anshikarathi66/leetcode | Binary Modulo - GFG/binary-modulo.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
int modulo(string s,int m)
{
//code here
int num =0;
// for (int i = s.length() - 1; i ... | ALGO | 0.999816 | 5.47811 | {
"github_metadata": {
"branch": "main",
"commit_count": 422,
"repo_created_at": "2022-11-14T17:51: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": "2ebe6f9256... |
957cc938-0aad-41fb-bb62-fcc6bb4b52f3 | MiracleSNeko/ShadowVerse_simulator | project_simulator/project_simulator/main.cpp | /*
* Copyright (C), 2019, QQ group ★爱上kotomi★ (213794567), All rights reserved. (xD)
*
* a simulator of ShadowVerse draw card.
* why not use Monte Carlo instead of calculations? (xD)
* 某沙雕之诗的抽卡概率模拟程序。
* 为什么不用神奇的蒙特卡洛方法代替手算概率呢(笑)。
*
* @ file: simulator.cpp
* @ author: Мiкo
* @ version: 1.0.0
* @ date: 2019-2-... | ALGO | 0.97243 | 4.035306 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-02-18T03:22: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": "6a85aa7a88... |
dccb34e6-37ee-40b6-af95-bc468ca1049e | HLHL1/Algorithm | SumSub.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<Windows.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
//子串和
//#define maxn 1000000+10
//int a[maxn], ans[maxn];
//int max(int x, int y)
//{
// return x>y ? x : y;
//}
//int main()
//{
// int T, n, i, mark;
// scanf("%d", &T);
// while (T--)
// {
// scanf("%d... | ALGO | 0.999881 | 3.10503 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2018-06-21T04:19: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": "51937c78... |
ae5c6585-91f1-40bf-be28-d3b3d47fe6bc | goodgood619/Problem-Solving | BOJ/2156.cpp | #include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <map>
#include <iostream>
#include <string>
#include <math.h>
#include <set>
#include <list>
#include <climits>
#include <string.h>
#include <deque>
#include <functional>
#include <stack>
using namespace std;
typedef l... | ALGO | 0.999939 | 3.384808 | {
"github_metadata": {
"branch": "master",
"commit_count": 248,
"repo_created_at": "2019-09-07T16:13: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": "515f1891... |
2472512a-af3a-49c8-8c1d-3253d01c9193 | VAIBHAV-2303/Spoj-solutions | NAKANJ.cpp | #include <stdio.h>
#include<bits/stdc++.h>
using namespace std;
typedef struct Node{
int num;
int ans;
}node;
int vis[100];
int main(){
int T;
scanf("%d", &T);
while(T--){
for(int i=0;i<100;i++){
vis[i]=0;
}
int v, o, t, newnum;
c... | ALGO | 0.99921 | 3.170501 | {
"github_metadata": {
"branch": "master",
"commit_count": 255,
"repo_created_at": "2018-07-20T07:02:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 6,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "60aa7e32... |
c9dad99e-2d17-44fc-bff7-7e6523a29fe6 | suehtaMFr/UVA | 630.cpp | #include <bits/stdc++.h>
using namespace std;
//Regular show
#define sz(x) ((int)x.size())
#define fin freopen ("input.txt","r",stdin);
#define fout freopen ("output.txt","w",stdout);
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
//rapadura é doce, mas não é mole não
#define ff first
#... | ALGO | 0.998258 | 3.348888 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2022-05-27T17:23: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": "8b9785f298... |
e55976b2-10cd-43fc-b85e-c32c28117a01 | FelixMatrixx/23521215_23521704_23521494_23521821_23521208_23521327_BT05 | Bai162/Bai162.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
using namespace std;
struct dathuc
{
int n;
float a[100];
};
typedef struct dathuc DATHUC;
void Nhap(DATHUC&);
DATHUC Tich(DATHUC, DATHUC);
void Xuat(DATHUC);
int main()
{
DATHUC f;
cout << "Nhap da thuc f " << endl;
Nhap(f);
DATHUC g;
... | ALGO | 0.998892 | 3.51245 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2023-10-18T16:01: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": "aaa5baab7... |
3e7000ce-c867-464b-bd86-734f088b3ce3 | Taehyeon-Kim/SwiftAlgorithm | 백준/Gold/15684. 사다리 조작/사다리 조작.cc | #include <bits/stdc++.h>
using namespace std;
const int INF = 987654321;
int n, m, h, a, b, ret = INF, visited[34][34];
bool check(){
for(int i = 1; i <= n; i++){
int start = i;
for(int j = 1; j <= h; j++){
if(visited[j][start])start++;
else if(visited[j][start - 1])start--;
... | ALGO | 0.999931 | 3.479167 | {
"github_metadata": {
"branch": "main",
"commit_count": 376,
"repo_created_at": "2022-08-06T15:26:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9b5069d9... |
818cca93-3d98-4a9d-8b0f-4e097c6a8a7b | sasobadovinac/Nektar | library/LibUtilities/LinearAlgebra/NekLinSysIterCGLoc.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// File: NekLinSysIterCGLoc.cpp
//
// For more information, please see: http://www.nektar.info
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial... | ALGO | 0.999947 | 5.392295 | {
"github_metadata": {
"branch": "master",
"commit_count": 17085,
"repo_created_at": "2023-08-25T12:15:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "921406... |
8b21e93a-9cae-4990-8e74-e1e05cec7ab2 | kycd/LeetCode | 347-Top K Frequent Elements.cpp | class Node{
public:
int x, y;
Node(int _x, int _y): x(_x), y(_y)
{
}
};
bool fncomp (Node lhs, Node rhs)
{
if(lhs.x == rhs.x)
return lhs.y > rhs.y;
else
return lhs.x < rhs.x;
}
class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k) {
map<int, int... | ALGO | 0.999999 | 6.044927 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2015-06-16T09:08:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea404dccb... |
0b0e756d-7476-4a7e-bfb0-06b3560f7757 | overnew/CodeSaving | Graph/Network Flow(네트워크 유량, 최대 유량)/[BaekJoon]_6086_최대 유량.cpp | //https://www.acmicpc.net/problem/6086
#include<iostream>
#include<queue>
#include<string.h>
using namespace std;
const int INF = 987654321;
const int MAXN = 52;
int pipe_num;
int capacity[MAXN][MAXN], flow[MAXN][MAXN];
//source: 시작 지점, sink: 목적 지점
int MaximumFlow(int source, int sink){
memset(flow, 0, sizeof(flow)... | ALGO | 0.998568 | 3.951523 | {
"github_metadata": {
"branch": "master",
"commit_count": 409,
"repo_created_at": "2020-02-26T08:58:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab1c1946... |
fc5df8a1-100c-4ba3-9d37-df3b6dc4987f | tsorren/UTN | 2023/Algoritmos_y_estructuras_de_datos/1er_Cuatrimestre/Practica_en_clase/29-5-2023_Busquedas.cpp | #include <iostream>
using namespace std;
// esta funcion devuelve la pos o -1 si no esta
int busquedaSecuencial(int vector[], int N, int buscado)
{
int i = 0;
while (i < N && vector[i] != buscado)
{
i++;
}
if (i == N)
{
return -1;
}
return i;
}
// esta funcion devuelv... | ALGO | 0.999758 | 4.015691 | {
"github_metadata": {
"branch": "main",
"commit_count": 150,
"repo_created_at": "2023-04-06T17:10:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92c2ccee9f... |
dbd77dd5-7407-4a19-b740-151f9b0896cb | hokein/leetcode | src/combination_sum2.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
class Solution {
public:
map<int, int> num2cnt;
vector<int> subset;
vector<vector<int> > result;
vector<v... | ALGO | 0.999898 | 4.256945 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2014-01-21T14:34:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "232662f6... |
f64f4ccc-ed6f-45b4-b772-fd67484d0af0 | San0330/C-Codes | Trees and Graphs/dijikstra.cpp | #include<iostream>
#include<vector>
using namespace std;
int v;
int minKey(bool visited[],int key[]){
int min = INT_MAX, minidx = -1;
for(int i = 0; i < v; i++){
if(!visited[i] && key[i] <= min){
min = key[i];
minidx = i;
}
}
return minidx;
}
void dijkstra(vector<vector<int> > &graph){
int src = 0;
... | ALGO | 0.999994 | 4.22711 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-07-01T13:00: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": "01d6495aa... |
b09b55fb-d6ff-43ec-b375-06cec5e1d940 | showmanlee/HowCanISolveThisQuestion | BOJ/12000/12790.cpp | // Mini Fantasy War
// https://www.acmicpc.net/problem/12790
#include <iostream>
using namespace std;
int main(void) {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int hp, mp, att, def, hp_u, mp_u, att_u, def_u;
cin >> hp >> mp >> att >> def >> hp_u >> mp_u >> att_u >> def_u;
hp ... | ALGO | 0.998 | 3.684259 | {
"github_metadata": {
"branch": "master",
"commit_count": 1741,
"repo_created_at": "2020-09-16T11:55:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48235de... |
e26889f2-c553-4df1-bfb8-277f51a2f40a | AgeMagi/CP | Toki/Programan Kompetitive/Bab 2 Matematika Diskret Dasar/Faktorisasi Prima.cpp | #include <bits/stdc++.h>
using namespace std;
int BanyakMembagi(int a, int b)
{
int Banyak = 0;
while (b % a == 0) {
Banyak++;
b = b/a;
}
return Banyak;
}
bool prima(int x)
{
bool prime = true;
for (int i = 2; i <= sqrt(x); i++) {
if (x % i == 0) {
prime = false;
}
}
return prime;
}
int ... | ALGO | 0.999951 | 4.326716 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2017-10-16T01:00: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": "f2d53e53c... |
1613295c-89e3-41f6-aec8-66b1c5274395 | KolkoInformatyczneIIILOTarnow/Omowienia | gr podstawowa/kolko 4/tab.cpp | #include <iostream>
using namespace std;
const int MAX_SIZE = 1000005;
int array[MAX_SIZE];
/**
* Funkcja read_array wczytuje kolejne liczby
* ciagu podanego na wejsciu do tablicy o nazwie
* array a nastepnie zwraca rozmiar podanego ciagu.
**/
int read_array() {
int size = 0;
while (cin >> array[size]) ... | ALGO | 0.997439 | 4.687825 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-10-22T10:00:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1fe2a0d2e0... |
65a2d286-6605-4780-90c8-5c8cf2534139 | Changhe160/cplusplus2020-2021-2 | code/chapter8.3/List.h | #ifndef SINGLY_LINKED_LIST_H
#define SINGLY_LINKED_LIST_H
#include<iostream>
using namespace std;
template<typename T> class SList;
template<typename T> ostream& operator<<(ostream&, const SList<T>&);
template<typename T>
class Node{
friend class SList<T>;
T m_data;
Node *m_next = nullptr;
public:
Node(const Nod... | TOOL | 0.917465 | 4.07726 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2021-02-22T08:35:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 129,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "377743f... |
0fec38f3-06c5-4b46-b18d-1b0dc0289907 | ishandutta2007/codeforces-b | burnoutag7/normal/1598/G.cpp | #include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int CodeforcesRandSeed(){
int x = GetCurrentProcessId();
x ^= (int64_t)GetProcessHeap();
x ^= (int64_t)HeapAlloc(GetProcessHeap(), 0, 1);
auto dummy = new char;
x ^= (int64_t)dummy;
return x;
}
void Z(char *s,int *z,int n){
m... | ALGO | 0.999937 | 4.319956 | {
"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": "a8d63ea5361d... |
0b0515a1-00f5-422e-947e-c663f3c748fb | ShuklaXD/CodingPractice | vsCode/src/WinningStrategy.cc | /*Winning strategy
Send Feedback
Our college team is going to the sports fest to play a football match with our coach. There are n players in our team, numbered from 1 to n.
The coach will know the position of another team hence create a winning strategy. He creates the position of every player in a specific order so t... | ALGO | 0.999982 | 3.666538 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2020-03-23T11:38: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": "30217a7c3... |
a41be3d1-19c3-4a40-b511-4ac246d3be63 | KakeruUeda/4D-Var | src/lib/config/StrBoundarySetting.cpp | /**
* @file SetStrBoundary.cpp
* @author K.Ueda
* @date August, 2024
*/
#include "Config.h"
void Config::setBoundaryVelocityValue(std::string face, double value[3])
{
std::vector<double> vecValue(value, value + 3);
auto updateBoundary = [&](auto condition)
{
for(int k=0; k<nz+1; k++){
for(int j=0... | ALGO | 0.954619 | 5.732567 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2024-03-14T12:23: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": "deedb7ca9e9... |
f24a5db8-b60b-4983-8b59-4913ab7b73cb | dyx131313/ACM_board | string/STR.cpp | //code_board
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef double db;
typedef pair<int,int> pa;
typedef vector<int> vec;
typedef string str;
const int bias = 5;
class basic_str{
public:
class KMP{
private:
str a, b;
int len_a, len_b;
public:
void i... | ALGO | 0.999775 | 3.749768 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-09-04T13:20: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": "93fb05d0a66e... |
9b0540d1-0342-4df8-8a3f-527dd475f42e | DDor-H/leetcode_cpp | code/数据结构/leetcode_0051.cpp | // 方法二:位运算改进
class Solution {
public:
vector<vector<string>> solveNQueens(int n) {
vector<vector<string>> res;
vector<int> queens = vector<int>(n, -1);
backTrace(res, 0, 0, 0, queens, n, 0);
return res;
}
void backTrace(vector<vector<string>>& res, int col, int diags1, int di... | ALGO | 0.999944 | 5.745364 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2021-08-22T05:24: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": "5b4d577adfb... |
350e0111-4644-41b1-88ff-6ba851d1f823 | GruStEAmer/Homework | Задание 2 семестр/Matrix/1_Matrix.cpp | #include<iostream>
#include<random>
#include<vector>
const int N = 4;
void input(int a[][N]){
for(int i = 0; i < N;i++){
for(int j = 0; j < N;j++){
a[i][j] = rand() % 10;
}
}
}
void output(int a[][N]){
for(int i = 0; i < N;i++){
for(int j = 0; j < N;j++){
... | ALGO | 0.99998 | 4.455557 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-12-10T01:44: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": "9f229028c6c... |
d6ea15c5-c5fe-45ce-932c-3c39d8c5fca4 | siddharth25pandey/CPP-Programming | Trees Algorithm/Top_View_of_Tree.cpp | /*
Given a binary tree, find top view;
*/
#include<iostream>
#include<queue>
#include<vector>
#include<map>
using namespace std;
class node{
public:
int data;
node* left;
node* right;
node(int d):data(d),left(NULL),right(NULL){
}
};
class bntree{
public:
... | ALGO | 0.999966 | 4.891727 | {
"github_metadata": {
"branch": "master",
"commit_count": 1586,
"repo_created_at": "2020-09-30T19:06:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 60,
"forks": 227,
"issues": 11,
"pull_requests": 31
},
"file_meta": {
"content_id": "de... |
64d054e3-81a3-46d0-a2c0-9adc74028cf1 | Snigdha8/Bioinformatics | ques4_2sum.cpp | #include <bits/stdc++.h>
using namespace std;
void get_indices(int * arr, int n) {
vector < pair < int, int > > new_arr;
int i;
for (i = 0; i < n; i++) {
new_arr.push_back(make_pair(arr[i], i + 1));
}
sort(new_arr.begin(), new_arr.end());
/*cout << "The... | ALGO | 0.99989 | 3.666305 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-11-19T04:55:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e58c209649a... |
c722fa9a-04ae-42b3-89c1-57a1ad494dc2 | GopherTeen/OJ_Code | Problems/Luogu/数据结构/可持久化权值线段树/P_3834_模板_可持久化线段树_2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
static constexpr int MOD = 1e9 + 7;
/*
每次新插入一个元素,修改的线段树只与插入的元素有关(只有添加的值到根节点的一条链发生了变化)。
作用: 查询任意区间第 k 大/小的值。
*/
struct Node {
int l, r, cnt;
};
vector<Node> f;
int rk = 0;
auto clone(int x) {
return f[++rk] = f[x], f[rk].cnt++, rk;
... | ALGO | 0.999994 | 5.715789 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2024-11-01T07:27:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c55629e5... |
b85ad816-dcd4-447e-8925-3cae84375f98 | ishandutta2007/codeforces-r | reyna/normal/750/G.cpp | // In the name of God
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
usin... | ALGO | 0.998756 | 3.611753 | {
"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": "994fd027275c... |
39b5ade8-b330-43b9-b739-b2ffa27e849e | CGAL/cgal | Nef_3/test/Nef_3/test_nef_to_soup.cpp | #include <CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Nef_polyhedron_iostream_3.h>
#include <... | ALGO | 0.953569 | 5.121369 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
e43fd18b-000e-40a5-ba70-3f55f1c9082d | DudekulaRaheem/Csa5149cryptography | 34 ECB CBC CFB.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BLOCK_SIZE 8
void xor_blocks(uint8_t *a, uint8_t *b, uint8_t *out, int len) {
for (int i = 0; i < len; i++) {
out[i] = a[i] ^ b[i];
}
}
void block_cipher(uint8_t *input, uint8_t *output, uint8_t *key) {
for (int i = 0; i < BLOCK_SIZE... | ALGO | 0.99813 | 4.149254 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-18T06:59: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": "3476e446b39c... |
bd6791b1-6b12-4ed2-ab18-46bed5d76850 | YONG15/yongtest | algorithm/02-14/다익스트라.cpp | // #include <iostream>
// #include <vector>
// using namespace std;
// /*
// 10 13
// 0 1 1
// 0 3 4
// 0 2 5
// 1 4 3
// 1 5 6
// 2 5 8
// 2 7 10
// 2 6 9
// 7 6 11
// 6 9 2
// 6 8 13
// 7 8 12
// 5 6 7
// */
// struct Edge {
// int to; // 어디로 향하는 간선이고?
// int cost; // 가중치
// };
// int N, M; // N : 노드의 개수, ... | ALGO | 0.999815 | 5.457474 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2023-01-16T04:48: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": "d9ecbc11c... |
2b407dc6-738a-40cf-8cdb-dd8015b3f451 | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p02575/s914644695.cpp | #include <iostream>
#include <vector>
#include <set>
using namespace std;
#define rep(i,n) for(i = 0;i < n;++i)
template <typename T>
struct RUQ //calculateはminimum
{
int n;
const T ex = 1 << 30; //dat 初期値(minなので)
const T em = 1 << 30; //lazy 初期値(minなので)
vector<T> dat, lazy; //tree本体
RUQ(vector<T>... | ALGO | 0.999872 | 3.683519 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5a3bed866... |
d30c9a2a-4a65-4c09-92b5-202918156c46 | Ximoncute/TRR2 | TRR1012 1.12 DO THI.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int t, n, a[101][101];
void OpenFile() {
freopen("DT.INP", "r", stdin);
freopen("DT.OUT", "w", stdout);
}
void ReadData() {
cin >> t >> n;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
cin >> a[i][j];
... | ALGO | 0.999679 | 4.146054 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2025-06-14T02:59: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": "b09213bb1a... |
18ab4c14-fe46-4ca0-b109-854728bf4c48 | alexandraback/datacollection | solutions_5670465267826688_0/C++/nomeaning/solve.cpp | #include <iostream>
#include <boost/math/quaternion.hpp>
#include <map>
#include <tuple>
using namespace std;
using namespace boost::math;
quaternion<int> I(0,1,0,0);
quaternion<int> J(0,0,1,0);
quaternion<int> K(0,0,0,1);
string S;
typedef tuple<int,int,int,int,int,int> Memo;
map<Memo, bool> memo;
bool rec(int pos, ... | ALGO | 0.999963 | 3.754435 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c88ba1d67... |
712a8c29-7d3e-4a0d-92af-3dc0266cf2d6 | bhavyagoel/LeetCode | 4. December'21/binary-tree-tilt/binary-tree-tilt.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999989 | 6.129745 | {
"github_metadata": {
"branch": "main",
"commit_count": 2182,
"repo_created_at": "2021-09-03T19:37:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d6204992... |
fb57d442-9a25-4bfc-b5d2-c7e66ad2721e | rfrancotoso/brkgaAPI | examples/brkga-scp/brkga-scp.cpp | /**
* Main method.
*
* Command line parameters, to be entered in the order listed below:
* - seed
* - stopping rule & argument X: "0" to stop after X generations;
* "1" to stop when target fitness X is reached;
* "2" to stop when X gener... | ALGO | 0.998432 | 6.992939 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-01-24T18:32:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 13,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6924b633... |
f6d48a0e-2795-44cc-aaad-b569b82c58bd | ashallue/tabulate_car | int.cpp | // Code written by <NAME>
#include "int.h"
// testing for squares
bool issquare(int64 x)
{
int64 root = (int64) llroundl(sqrtl((long double)x));
return (root*root == x);
}
// GCD and inverse functions
int64 gcd(int64 x, int64 y)
{
if(x<0) x= -x; if(y<0) y= -y;
int64 r;
while(y!=0) { r=x%y; x=y; y=r; }
re... | ALGO | 0.999276 | 4.86691 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-08-03T20:48:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7da38e0caefd... |
947c4d5d-6ede-442a-9b32-f512daf5acc7 | singhnir/C-Plus-Plus-Robert-Lafore | Progs/Ch15/Listplus.cpp | // listplus.cpp
// demonstrates reverse(), merge(), and unique()
#include <iostream>
#include <list>
using namespace std;
int main()
{
int j;
list<int> list1, list2;
int arr1[] = { 40, 30, 20, 10 };
int arr2[] = { 15, 20, 25, 30, 35 };
for(j=0; j<4; j++)
list1.push_back( arr1[j] ); // list... | TOOL | 0.963858 | 4.838578 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2020-08-19T17:10:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 11,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "8e8e1ea... |
78f6be1a-219d-4735-8f7e-e24002df1aa5 | ag-sar/cv1617-60623 | Aula9/src/ObjTracking.cpp | #include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
#define SMIN 30
#define VMIN 10
#define VMAX 256
Mat roiFrame, roiAux;
Rect roiBox;
vector<Point> roiPts; //points defining a ROI
int cnt = 0; //mouse clicks counter
static void roiSelection(int event, int x, int y, int, ... | ALGO | 0.989599 | 5.925441 | {
"github_metadata": {
"branch": "master",
"commit_count": 208,
"repo_created_at": "2016-09-21T09: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": "2a11816b... |
9cc59e9b-292a-4f55-82b0-ab005036f9f2 | kutmanbekov-i/auca-alg-2021 | lab07/p01/main.cpp | #include <bits/stdc++.h>
using namespace std;
enum class State
{
NotDefined,
OnBorder,
InTree
};
const int kDistNotDefined = -1;
int main()
{
int nVertices; cin >> nVertices;
vector<vector<pair<int, int>>> graph(9);
char c1, c2;
int w;
map<pair<int, int>, int> weights;
while ... | ALGO | 0.999938 | 4.139866 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2021-01-11T05:09:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e412f39b39... |
12c9de87-f8d5-4f44-a1e6-d7f613d6e24b | AmrARaouf/algorithm-detection | graph-source-code/237-E/4326902.cpp | //Language: GNU C++
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <cstring>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <cctype>
#define vi vector < int >
#define mod 1000000007
#define inf 987654321
#define dinf... | ALGO | 0.999793 | 3.34286 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2015-11-10T10:51: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": "1decddb3fb... |
74158094-fb1d-435a-ae23-e6c15920f146 | 239yash/Data-Structures-And-Algos | Graphs/Remove Max Number of Edges to Keep Graph Fully Traversable.cpp | class UnionFind {
public:
std::vector<int> parent;
UnionFind(int n) {
for (int i = 0; i < n + 1; i++) {
parent.push_back(i);
}
}
int find(int u) {
if (parent[u] == u)
return u;
return parent[u] = find(parent[u]);
}
bool combine(int ... | ALGO | 0.999799 | 5.382097 | {
"github_metadata": {
"branch": "master",
"commit_count": 411,
"repo_created_at": "2020-01-24T17:52:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0dfbdf0... |
51fa3d09-f177-496c-bd2d-01c8686153a4 | NPTP/RaylTime | src/AABBTree.cpp | #include "AABBTree.h"
#include "insert_box_into_box.h"
#include <limits>
#include "random_rgb_colour.h"
#include "globals.h"
// Helper for AABB tree. Sets colour of bounding box for AABB visualization.
void set_random_aabb_colour(std::shared_ptr<Material> &vis_mat)
{
std::shared_ptr<Material> new_mat(new Material(... | ALGO | 0.993892 | 5.783689 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-04-19T21: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": "65e905686... |
d6252d15-47b7-4bb9-b317-b8ec728e7a67 | owlrana/dsa | 15_Recursion-2(ImplementationBased)/07_InversionCount.cpp | /*
-- INVERSION COUNT PROBLEM --
Suppose we have an array:
array = {1,5,2,6,3,0}
In the Inversion Count problem, we need to find pairs such that they satisfy these two conditions:
1. a[i] > a[j] (value should be larger)
2. i < j (index should be smaller... | ALGO | 0.999831 | 5.207796 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-02-06T14:13:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92392288a0a... |
59fbfb7b-053a-4c02-96bf-fc7651a12d91 | XandeGVaz/My-repository | POO/Listas/Lista4/ex3.cpp | /*Aluno(N USP)
* -<NAME> (14611432)
*/
#include <iostream>
#include <stack>
#include <queue>
#include <stdio.h>
#define DEBUG 1
int main(){
// Declaração das estruturas de dados
std::stack<int> pilha;
std::queue<int> fila;
std::priority_queue<int> filaDePrioridade;
// Declaração de variáveis ... | ALGO | 0.999631 | 4.757129 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2024-03-07T23:14:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "447c2616d03... |
d29953cd-94e7-407a-a551-b683cc7aaaf1 | anuragbnrj/competitive | codeforces/practice/142B.cpp | // Problem Link: https://codeforces.com/problemset/problem/230/B
#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926535897932384626
#define MOD 1000000007
int len = 1000003;
// spf will store the smallest prime factor of i
// if spf[i] == i, then i is a prime number
vector<int> spf(len + 1);
void ge... | ALGO | 0.999754 | 5.063702 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-01-23T07:05: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": "72f1cff6167e... |
bf72682a-9739-44e4-96f9-750e635ff209 | Naniap/CAIS230-Datastructures | Project 1/Project 1/main.cpp | /*
<NAME> CAIS 230
This program starts with taking 5 name (string) and 5 vote (integer) inputs and then calculates the result of the election and displays both to console and an output file.
The output consists of a the name of the person running, how many votes the person has, percentage of total votes, total ... | ALGO | 0.985885 | 5.103759 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-03-03T19:48:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13d0743356... |
161259cb-efea-4f46-9c73-c41bb670ddca | kuheli31/Array | allarray.cpp | #include <stdio.h>
#include <stdlib.h>
struct Array
{
int *A;
int size;
int length;
};
void swap(int *x, int *y)
{
int temp = *x;
*x = *y;
*y = temp;
}
void Display(struct Array arr)//CASE 1
{
int i;
for(i=0;i<arr.length;i++)
{
printf("%d ",arr.A[i]);
}
printf("\n"... | ALGO | 0.999494 | 3.559397 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-06-06T09:26:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21d473f90434... |
9dd274ab-c20e-444b-b04b-6a6afbf79f0a | Michaldariusznowakowski/UniversityArchive | CPP/BinaryHeap/src.cpp | #include <iostream>
#include <string>
class BinaryHeap {
private:
unsigned int capacity = 0;
unsigned int size = 0;
int** array;
void ExtendCapacity(unsigned int X = 2) {
unsigned int oldcapacity = this->capacity;
this->capacity *= X + 1;
int** NewArray = new int* [this->capacity... | ALGO | 0.999607 | 4.383381 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-11-11T16:43:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe28a7dba62d... |
567f77cd-3fb0-4580-926c-8f81eccf5812 | jay-mm-message/MP32212_Example | practiceArea/_ch06/ch06_03.cpp | #include <iostream>
using namespace std;
class Node {
public:
char l;
int no;
Node *rt; // right node
Node *lt; // left node
public:
Node(char l) : l(l), no(0), rt(nullptr), lt(nullptr) {};
Node() : l('\0'), no(0), rt(nullptr), lt(nullptr) {};
};
typ... | ALGO | 0.999943 | 5.000803 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2023-12-30T16:34: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": "ba0cedd323... |
8df333cb-ab82-43e7-92cc-335ee7b40add | ChaserZHY23/xixihaha | 20200606/20200606/test.cpp | //#define _CRT_SECURE_NO_WARNINGS 1
////#include<iostream>
////using namespace std;
////void main()
////{
//// int n[][3] = { 10,20,30,40,50,60 };
//// int(*p)[3];
//// p = n;
//// cout << p[0][0] << *p[0] + 1 << (*p)[2] << endl;
////}
////#include<stdio.h>
////int main()
////{
//// int x = 1;
//// do {
//// printf("%... | ALGO | 0.999805 | 4.358809 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2019-09-17T12:47: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": "814a2cf93... |
170cabe1-e0e6-4e72-943a-47253c49bd03 | Aditya0709-alt/ds-algo | ARRAY/RearrangeArrayAlternately/RearrangeArrayAlternately/main.cpp | #include <iostream>
using namespace std;
void rearrange (int arr[], int n) {
int temp[n];
int small = 0, large = n-1;
int check = true;
for (int i = 0; i < n; i++) {
if (check) {
temp[i] = arr[large--];
} else {
temp[i] = arr[small++];
}
chec... | ALGO | 0.999992 | 4.698051 | {
"github_metadata": {
"branch": "main",
"commit_count": 193,
"repo_created_at": "2021-09-30T17:24:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e677c3966... |
697dd712-1285-49a8-a025-141d9a7a8fa6 | Ashfak-Hossain/CSES-Problem-Solutions | Dynamic Programming/Array_Description.cpp | /**
* author: _Berlin_
* created: 21.12.2024 11:21:30 AM
**/
#include <bits/stdc++.h>
using namespace std;
#ifdef BERLIN
#include "algo/debug.h"
#else
#define debug(...) 42
#endif
const int MAX_N = 1e5 + 9;
const int MAX_M = 105;
const int mod = 1e9 + 7;
int n, m, a[MAX_N], dp[MAX_N][MAX_M];
int fun(... | ALGO | 0.999997 | 4.562001 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-06-16T11:01: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": "4dea0868299... |
0e9ac5f6-a079-4115-9364-7a9d1de2c58c | vishnupsingh523/scaling-structures | Priority Queues and Heaps/maxHeap.cpp | #include<bits/stdc++.h>
using namespace std;
class heap{
public:
int * arr;
int capacity;
int count=0;
// int heap_type;
};
heap * createHeap(int capacity)
{
heap * h = new heap();
if(h==NULL)
{
cout<<"\nCan't create Heap - MEMORY ERROR !!!";
return NULL;
}
cou... | ALGO | 0.998981 | 3.534745 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-08-22T14:15: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": "13046bf6d... |
ca9dc978-07eb-4ec1-bbca-8ed5e977560c | ayushpatel5475/CPP-GFG-CODES | 07. STL Algorithms/01. Non-Mutating STL Algorithms/07_binary_search.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
struct Point{
int x,y;
Point ( int i, int j){
x=i,y=j;
}
};
bool myCmp(Point p1, Point p2){return (p1.x<p2.x);}
int main()
{cout<<"using Vector:\n";
vector<int> v = {10, 20, 30, 30, 40, 50};
int x = 20;
if ... | ALGO | 0.998295 | 4.521779 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-12-21T12:36:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70c154f5f38... |
d72aa5fe-e5a2-412c-ada4-4da0cbdf26a6 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/10/44/10.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <bitset>
#include <deque>
#include <map>
#include <stack>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#define mp make_pair
#define pb ... | ALGO | 0.999906 | 3.902438 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-09-30T05:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "857c9997... |
1fe8b7d2-a561-429e-b2aa-c81d501b0392 | Ravikumarjj/DSA-using-cpp | how-many-X's.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int countDigit(int num, int target){
int count=0;
while(num){
int digit = num%10;
if(digit ==... | ALGO | 0.999786 | 6.073681 | {
"github_metadata": {
"branch": "master",
"commit_count": 253,
"repo_created_at": "2023-08-03T16:56:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cfb87fd... |
e0c31acc-d7fa-4cf2-99ee-b857df6e3f89 | devnowk/Algorithm-Study | Programmers 코딩테스트 연습/Lv1. 신고 결과 받기.cpp | #include <string>
#include <vector>
#include <map>
using namespace std;
map<string, vector<string> > m; // 신고 내역 저장할 map
map<string, int> singo; // 신고자가 메일을 받을 수
vector<int> solution(vector<string> id_list, vector<string> report, int k) {
vector<int> answer;
int num = id_list.size(); // 사람들 수
for(i... | ALGO | 0.999817 | 5.103433 | {
"github_metadata": {
"branch": "main",
"commit_count": 219,
"repo_created_at": "2022-01-09T16:40:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b956610a0... |
9c2dc012-ca20-4327-bec5-d4389c495d14 | harshitbisht96/competitive_programming_problems | djisktra_shortest_path/main.cpp | #include <bits/stdc++.h>
using namespace std;
class Graph{
int V;
list< pair <int,int > > * adjList;
public:
Graph(int v)
{
V=v;
adjList=new list< pair <int,int > >[V];
}
void addEdge(int u, int v,int w)
{
adjList[u].push_back(make_pair(w,v));
adjList[v]... | ALGO | 0.999962 | 4.084489 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-08-24T20:08: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": "8a16bac89f... |
0496fe1a-1e9a-477a-b6f9-412ea2c85124 | Danny-the-scientist/PLP-matching | script.cpp | resize(matched_properties,0);//creating arrays for attempting to find matches of incoming values to current
resize(matched_value,0);
resize(unmatched_properties,0);
resize(unmatched_old_value,0);
resize(unmatched_new_value,0);
for #i in 1 .. numproperties()-5 //the minus 5 removes the created properties above from the... | ALGO | 0.926407 | 3.004271 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-12-29T16:17:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "441cde60b1cd... |
e35a62cc-f6d0-426a-94c9-4214a5ee2587 | ishandutta2007/codeforces-h | heart_blue/normal/292/D.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999867 | 3.86121 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "a8ae8b751a16... |
0847043a-0c11-4966-a7b3-9d5ae300dd99 | yindaz/pbrs | mitsuba-af602c6fd98a/include/mitsuba/bidir/pathsampler.h | /*
This file is part of Mitsuba, a physically based rendering system.
Copyright (c) 2007-2014 by <NAME> and others.
Mitsuba is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
as published by the Free Software Foundation.
Mits... | ALGO | 0.990427 | 6.88752 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-04-09T03:02:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 143,
"forks": 26,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e07a59... |
35c3adfa-8477-4dcf-b617-c1254f5b7532 | akihikoy/ay_test | cpp/misc/set_ops.cpp | //-------------------------------------------------------------------------------------------
/*! \file set_ops.cpp
\brief certain c++ source file
\author <NAME>, <EMAIL> / <EMAIL>
\version 0.1
\date Oct.27, 2014
*/
//-----------------------------------------------------------------------------... | ALGO | 0.911299 | 5.406885 | {
"github_metadata": {
"branch": "master",
"commit_count": 562,
"repo_created_at": "2019-04-17T13:59:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a56d951e... |
30ff0969-a6ea-4dc4-b465-1c126663ea36 | mirinta/leet_code | prefix_suffix/prefix_sum_and_hash_map/0525_contiguous_array.cpp | #include <unordered_map>
#include <vector>
/**
* Given a binary array nums, return the maximum length of a contiguous subarray with an equal
* number of 0 and 1.
*
* ! 1 <= nums.length <= 10^5
* ! nums[i] is either 0 or 1.
*/
class Solution
{
public:
int findMaxLength(std::vector<int>& nums)
{
/... | ALGO | 0.999955 | 6.245756 | {
"github_metadata": {
"branch": "master",
"commit_count": 1725,
"repo_created_at": "2023-04-09T12:48:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f393b60... |
e5513057-7617-4cbb-8d55-64390761a9b7 | arhanbasu/snake-game | snake.cpp | #include <stdio.h>
#include <math.h>
#include <time.h>
#include <ctype.h>
#include <string.h>
#define SNAKE_ARRAY_SIZE 310
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#define UP_ARROW 'A'
#define LEFT_ARROW 'D'
#define RIGHT_ARROW 'C'
#define DOWN_ARROW 'B'
#define ENTER_KEY 10... | ALGO | 0.984303 | 3.79473 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-09-10T09:21: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": "480b45dbc54e... |
5d215c11-a71a-4669-91d1-8eaed9395018 | ishandutta2007/codeforces-i | imeimi/normal/1214/D.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
#include <string>
#include <cstring>
#include <functional>
#define fs first
#define se second
#ifdef imeimi
#define debug(...) printf(__VA_ARGS__)
#else
#define debug(...)
#endif
using namespac... | ALGO | 0.99991 | 3.588643 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bab3ff2788fb... |
4606c1ef-8f4f-4b05-826f-188b9740e638 | yipgene/leetSolution | Submission/P013.cpp | // 13.Roman to Integer (E)
#include <iostream>
#include <vector>
#include <map>
using namespace std;
class Solution {
public:
int romanToInt(string s) {
map<char, int> roman;
roman.insert(pair<char, int> ('M', 1000));
roman.insert(pair<char, int> ('D', 500));
roman.insert(pair<char... | ALGO | 0.999476 | 5.273769 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-06-22T14:42: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": "c68e600153... |
d9bc3205-0d96-47c3-871c-84f69d422ed0 | Maximrez/Mephi_Lab4_Sorts | Sorts/HeapSort.hpp | #pragma once
#include <iostream>
#include <algorithm>
#include <stdexcept>
#include <vector>
using namespace std;
template<typename T>
class HeapNode {
public:
T value;
int count;
HeapNode<T> *parent = nullptr;
HeapNode<T> *left = nullptr;
HeapNode<T> *right = nullptr;
bool (*cmp)(const T &,... | ALGO | 0.998858 | 5.361788 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-10-10T23:09: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": "c4408f6c976... |
b3ae3b27-b764-4bd3-ab3c-699c068e967c | cseshamim47/station | CPP/2020-2023/Old CPP/B_Subtract_Operation.cpp | #include <bits/stdc++.h>
using namespace std;
#define sq(x) ( (x)*(x) )
#define s(x) x.size()
#define all(x) x.begin(),x.end()
#define BOOST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define w(t) int t; cin >> t; while(t--){ solve(); }
#define int long long
#define ll unsigned... | ALGO | 0.999992 | 4.387447 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2021-02-12T19:05:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63828c7f... |
a03d93e1-a338-4baf-96a7-77ea74ae8009 | yyehl/Intro_algorithms | chapter-2/2.1-4.cpp | /*
* Filename:2.1-4.cpp
*
* 题目:
* 输入:两个n位以二进制数组形式储存的整数
* 输出:一个n+1位的以二进制数组形式储存的整数
*/
#include <vector>
#include <iostream>
using namespace std;
vector<int> foo(const vector<int>& v1, const vector<int>& v2)
{
vector<int> ret(v1.size() + 1, 0);
for (int i = v1.size() - 1; i >= 0 ; --i)
{
if (v1[i] + v2[... | ALGO | 0.999984 | 4.740031 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2017-05-15T03:22:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d6aa906f... |
db8c35bb-9c53-415d-94a4-98cb9b2b580a | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/06/0626/personal_submission/cf1009e_retyrn.cpp | int n;
void solve() {
cin >> n;
vector<int> a(n + 1);
for (int i = 1; i <= n; i ++) {
cin >> a[i];
}
// 预处理2的幂次
vector<ll> f(n + 1);
f[0] = 1ll;
for (int i = 1; i <= n; i ++) {
f[i] = f[i - 1] * 2 % mod;
}
// 贡献
ll res = 0;
for (int i = 1; i <= n; i ... | ALGO | 0.999977 | 3.820761 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "2033... |
028c7087-2d42-49e0-852c-364c9d8121ff | davidsun/SAP | MatchAlgoritms.h | /*******************************************************************************
* This file is part of SAP.
*
* SAP is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
*... | ALGO | 0.987662 | 3.266168 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2011-08-30T09:26: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": "936b9d223... |
db39eff5-b8d8-4088-8c08-36693769b5ca | raincross7/code-similarity | codes/train_code/problem334/problem334_475.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chm... | ALGO | 0.999958 | 4.115507 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "607ba7fb069c... |
43e43cd7-ee1e-436b-969e-c9dfea382413 | virginiavalcheva/state-examination | 2016_2_Task2.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct Node {
int value;
vector<Node*> children;
Node(int value) {
this->value = value;
}
void addChild(Node* child) {
children.push_back(child);
}
};
Node* buildTree(int arr[], int size, int k) {
Node* root = new Node(arr[0]);... | ALGO | 0.999833 | 5.060619 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-07-07T13:16: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": "0493b61b7f07... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.