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 |
|---|---|---|---|---|---|---|---|
5bd1c2ff-d7b0-4c9c-b3e9-0b0a066b3cf1 | RGTechno/DSA | Binary Tree/binaryTree.cpp | #include <iostream>
using namespace std;
// Input 1 2 4 -1 -1 5 7 -1 -1 -1 3 -1 6 -1 -1
class Node
{
public:
int data;
Node *left;
Node *right;
Node(int d)
{
data = d;
left = right = NULL;
}
};
Node *buildTree()
{
int d;
cin >> d;
if (d == -1)
{
retur... | ALGO | 0.999982 | 4.410773 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2021-08-27T09:09:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58286576... |
ea41d907-56a0-4d25-89ae-e2bf04b80e36 | diego-gabriel/CompetitiveProgramming | LiveArchive/6680.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
using namespace std;
struct Msg
{
string message;
int id;
Msg(){};
Msg(string m, int i){
message = m;
id = i;
}
};
map <string, vector<Msg> > list;
string getUser(string &message){
string res = "";
int i = 0;
whil... | ALGO | 0.936064 | 3.400798 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-06-14T23:45: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": "26190b2213... |
7194602b-cd13-4487-b593-4eb76fc47ec4 | kosekitau/90 | 3.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <vector>
#include <queue>
#include <functional>
#include <set>
#include <tuple>
#include <map>
using namespace std;
using ll = long long;
using Graph = vector<vector<int> >;
using P = pair<int, int>;
#define INF 20... | ALGO | 0.990477 | 3.897682 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-10-22T13:11: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": "151c72ef45f... |
369ae279-ec08-4f00-8555-5bfa07ad3a01 | danalex97/abrcc | quic/chromium/src/net/abrcc/dash_config.h | #ifndef ABRCC_DASH_CONFIG_H_
#define ABRCC_DASH_CONFIG_H_
#include "base/json/json_value_converter.h"
namespace quic {
struct PlayerConfig {
std::string index;
std::string manifest;
std::string player;
PlayerConfig();
PlayerConfig(const PlayerConfig&) = delete;
PlayerConfig& operator=(const PlayerConfig... | CONFIG | 0.936759 | 7.250128 | {
"github_metadata": {
"branch": "master",
"commit_count": 300,
"repo_created_at": "2020-05-04T07:06:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 6,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f79af8... |
b1d470ad-b4cf-4c73-b054-38555f9ca790 | google-parfait/tensorflow-federated | tensorflow_federated/cc/core/impl/aggregation/core/composite_key_combiner.cc | /*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | ALGO | 0.993759 | 3.674519 | {
"github_metadata": {
"branch": "main",
"commit_count": 5639,
"repo_created_at": "2018-12-12T23:15:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2386,
"forks": 597,
"issues": 0,
"pull_requests": 183
},
"file_meta": {
"content_id": "47e... |
8a36e9bd-4579-405d-9b75-58f0f7c6fa3a | damarizz/campNacionalInformatica2024 | 02_standard_template_library/balanced_brackets.cpp | /*
* author: <NAME>, Damaris
*/
#include<bits/stdc++.h>
using namespace std;
#define fastio ios::sync_with_stdio(false);cin.tie(0)
#define fori(i,n) for(int i=0;i<n;i++)
#define fora(a,b,c) for(int i=a;i<b;i+=c)
#define sila cout<<"YES"<<'\n'
#define nola cout<<"NO"<<'\n'
#define endl '\n'
bool isBalanced(string bra... | ALGO | 0.999726 | 4.71946 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-02-13T00:23:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7500ff916cd... |
7cfeb23f-3465-412b-8dee-5b38f918d25d | ZethanSimmons/PhageModels | Test1/PhageModel55_0_evolve_lysis_lysogenization_phage_stability_check_only_phage_invaders_vloss0/source/automaton.cpp | #include <vector>
#include "automaton.hpp"
#include <random>
#include <cmath>
double Automaton::delta_t = 1.0;
Automaton::Automaton () {
state = 0;
bacterial_growth_rate = 0.0;
plasmid_conjugation_rate = 0.0;
plasmid_loss_rate = 0.0;
bacterial_resistance = 0.0;
plasmid_resistance = 0.0;
/... | ALGO | 0.99126 | 3.66509 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-02-18T01:54: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": "fd85b4be3555... |
cb5fecaf-812a-4268-ad78-b60ca697e2aa | lydrainbowcat/tedukuri | 配套光盘/习题/0x08 基本算法 总结与练习/Task/HDOJ4864 Task.cpp | //Author:XuHt
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#define ll long long
using namespace std;
const int N = 100006, M = 106;
struct P {
int x, y;
bool operator < (const P w) const {
return x > w.x || (x == w.x && y > w.y);
}
} p[N];
vector<int> t[M];
int n, m;
bool cmp(int x... | ALGO | 0.999684 | 3.733529 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2018-03-18T01:24:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2487,
"forks": 607,
"issues": 15,
"pull_requests": 0
},
"file_meta": {
"content_id": "94... |
a6b21e75-1a78-4378-aaf4-22f67a369f40 | Kostya2408/visualizer_open | voxelcloudfilter.h | #ifndef VOXELCLOUDFILTER_H
#define VOXELCLOUDFILTER_H
#include "pointcloud.h"
#include <iostream>
#include <time.h>
class VoxelCloudFilter
{
public:
VoxelCloudFilter();
void setCellSize(float cell);
void filterCloud(PointCloud<PointXYZ> &source,
PointCloud<PointXYZ> &dst);
void fi... | ALGO | 0.9585 | 4.514278 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-04-06T14:38: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": "8a1b1acc952... |
0ba32b6d-dddc-4559-9c5a-c23129cf68a2 | Uk2607/EC24 | 16/q16.cpp | #include<iostream>
#include<fstream>
#include<sstream>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<cassert>
using namespace std;
#define ll long long
#define ull unsigned long long
pair<vector<int>, vector<vector<string>>> read_data(string filePath) {
ifstream file(filePath);
vecto... | ALGO | 0.998743 | 4.187518 | {
"github_metadata": {
"branch": "main",
"commit_count": 126,
"repo_created_at": "2024-12-01T06:39: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": "1453f5cd20... |
15a3aa7b-31f2-465e-ab56-381324b67100 | siddharth-kumar182002/DSA | C_No_Prime_Differences.cpp | #include <bits/stdc++.h>
using namespace std;
bool isPrime(int n)
{
if (n <= 1)
return false;
for (int i = 2; i < n; i++)
if (n % i == 0)
return false;
return true;
}
int main() {
int t;
cin>>t;
while(t--){
int n,m;
cin>>n>>m;
if(isPrime(m)){
vector<long long > arr[n];
long lon... | ALGO | 0.999697 | 3.385311 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-18T14:11: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": "d6140717799f... |
59a4e50e-aa5e-42e1-a43d-f753714e541b | roshan07273/Leetcode-Questions-Solution | 1631. Path With Minimum Effort.cpp | class Solution {
private:
int efforts[105][105];
int dx[4] = { 0 , +1 , -1 , 0 };
int dy[4] = {+1 , 0 , 0 , -1 };
public:
int dijkstra(vector<vector<int>>& heights){
int r = heights.size();
int c = heights[0].size();
priority_queue<pair<int , pair<int , int >>> pq;
... | ALGO | 0.999996 | 5.736494 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2023-02-16T11:26:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae146f6b90... |
50de4b55-25da-4c3a-a474-1a9517c81a40 | RaghavendraGKulkarni/Loads-of-Codes | Arrays/Rotate-Matrix-by-90-degrees/Solution.cpp | // Include the required header files
#include<iostream>
#include<fstream>
#include<vector>
using namespace std;
/*
Name : rotate()
Description : Rotates the matrix clockwise or anti-clockwise by 90 degrees
Arguments : A 2D vector denoting the matrix and an integer dir denoting the direction of rotation
Return... | ALGO | 0.999913 | 5.776882 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-12-13T05:44: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": "a00741112c5... |
4dcded68-aa79-49b4-ba51-456b43f88b81 | iveney/algorithm | leetcode/lca-parent-pointer.cpp | // lca in tree with parent pointer
// http://leetcode.com/2011/07/lowest-common-ancestor-of-a-binary-tree-part-ii.html
// basic idea is to locate both nodes and their height h1, h2, say h1-h2 = d
// we can then find the parent when (h1-d) , h2 meets
#include "leetcode.h"
class Solution {
public:
int hp, hq;
void... | ALGO | 0.999833 | 5.863222 | {
"github_metadata": {
"branch": "master",
"commit_count": 230,
"repo_created_at": "2009-02-03T04:30:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 7,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4f7a937... |
15b2b3c1-e796-4fe1-9519-ae884ebfce93 | Kyloman/movie-theatre | bintree.cpp | // ----------------------- bintree.cpp ----------------------------------------
// <NAME>, CSS 343 C
// Jan 26, 2019
// Date of Last Modification 3/20/19
// --------------------------------------------------------------------------
// Purpose - to create a binary search tree. That can be made into an array
// and vise ... | ALGO | 0.999579 | 4.06567 | {
"github_metadata": {
"branch": "master",
"commit_count": 297,
"repo_created_at": "2019-02-25T00:38: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": "6471feba... |
8485cdf4-0789-4b14-b2f3-e8020bb7c0c3 | danimodesti/USPrograms | 5oSemestre/lab_alg_avancados_I/1_stl/stl3/12543544.cpp | #include <iostream>
#include <unordered_map> // Alunos se ligam a projeto
#include <vector> // Para ordenar elementos do map por int e depois por string
#include <algorithm> // sort
#define INPUT_END "0"
#define TEST_END "1"
#define BLACKLISTED "-1" // Alunos ja removidos e que nao podem aparecer
... | ALGO | 0.996018 | 4.355511 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-10-19T21:34:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92dfd7ced7c... |
799c4d33-5e7c-4c19-9dca-d443f9304509 | joaovitor73/Algoritmos | Lista 7/situacaoAlunoQ8.cpp | #include <iostream>
using std::cin;
using std::cout;
/*Escreva uma função que determine a média e a situação de um aluno em uma
disciplina. A função recebe como parâmetros as três notas de um aluno (p1, p2, e p3),
seu número de faltas (faltas), o número total de aulas da disciplina (aulas) e o ponteiro
para uma vari... | ALGO | 0.98624 | 4.359348 | {
"github_metadata": {
"branch": "Master",
"commit_count": 171,
"repo_created_at": "2023-03-31T10:22:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9e41b51... |
42304f83-cf47-4a66-b2a6-c0ef5ce99789 | Jonathan-Uy/CSES-Solutions | Additional Problems/Bit Inversions.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxN = 2e5+5;
const int SIZE = 4*maxN;
int N, M, mp[maxN], lo[SIZE], hi[SIZE], dp[3][SIZE];
char S[maxN];
int len(int i){
return hi[i]-lo[i]+1;
}
int combine(int a, int b){
return ((a<0)^(b<0)) ? a : a+b;
}
bool allsame(int i){
return abs(dp[2][i]... | ALGO | 0.999986 | 3.804566 | {
"github_metadata": {
"branch": "main",
"commit_count": 238,
"repo_created_at": "2020-11-21T19:50:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 615,
"forks": 200,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "31adc1... |
671244ba-b28a-4c9f-b8f2-d1330d158962 | krnbatra/Algorithm-Library | Mo/mo's_algo.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007LL
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);
const int N = 2e5+1;
const int M = 1e6+5;
const int SQN = sqrt(N)+1;
int n, q;
int arr[N];
ll prin... | ALGO | 0.999914 | 4.320306 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2016-06-26T18:29:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58881b551... |
af68b1cb-4886-416d-8b01-d0ed204aeaec | dealii/dealii | bundled/boost-1.84.0/include/boost/gil/extension/image_processing/hough_parameter.hpp | // Boost.GIL (Generic Image Library) - tests
//
// Copyright 2020 <NAME> <<EMAIL>>
//
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_GIL_EXTENSION_IMAGE_PROCESSIN... | TOOL | 0.954819 | 7.069731 | {
"github_metadata": {
"branch": "master",
"commit_count": 65304,
"repo_created_at": "2014-07-17T14:00:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1530,
"forks": 789,
"issues": 533,
"pull_requests": 92
},
"file_meta": {
"content_id": ... |
566491d4-078b-4e19-9db4-23af51a1b8be | gafeol/MAC422 | EP3/memory.cpp | /*** Equipe ********************************************
Nome: <NAME> NUSP: 9762873
Nome: <NAME> NUSP: 9345370
*******************************************************/
#include <bits/stdc++.h>
using namespace std;
#define debug(args...) fprintf(stderr, args);
#include "memory.h"
#include "global.h"
#include "... | ALGO | 0.997775 | 3.72278 | {
"github_metadata": {
"branch": "master",
"commit_count": 257,
"repo_created_at": "2017-08-19T20:29: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": "d5be56d7... |
1113c098-7188-45be-9b73-59502df35607 | markpal/NPDP_Bench | input/mea.cpp | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <omp.h>
#include <math.h>
#define min(a,b) (((a)<(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#define floord(n,d) floor(((double)(n))/((double)(d)))
#define ceild(n,d) ce... | ALGO | 0.999915 | 3.491374 | {
"github_metadata": {
"branch": "main",
"commit_count": 118,
"repo_created_at": "2021-06-21T20:05:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66e5878a1e... |
fc1a2076-b0bf-4d3e-8eb8-1b5195efef40 | forgoat/learning-unix-linux-coding | mfind.cpp | #include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<errno.h>
#include<dirent.h>
#include<regex.h>
#include<string.h>
#include<time.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<sys/wait.h>
/* 定义全局变量 */
#define TRUE 1
#define FALSE 0
#defi... | TOOL | 0.957215 | 3.620621 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-03-28T04:03:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e84f2345... |
6584a86a-ff46-417e-ae77-dc67ea3206d3 | aamirglb/TechNotes | src/cpp/leet/48.rotate-image.m.cpp | // cout << boolalpha << isSymmetric(root) << endl;
#include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
void displayMatrix(vector<vector<int>> &matrix);
void rotate(vector<vector<int>>& matrix) {
// rotate by 1
auto left = 0;
auto right = matrix.size() - 1;
displayMatrix(ma... | ALGO | 0.999911 | 5.562193 | {
"github_metadata": {
"branch": "main",
"commit_count": 745,
"repo_created_at": "2021-02-07T15:26:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 4,
"issues": 0,
"pull_requests": 20
},
"file_meta": {
"content_id": "135d06ec2... |
5f49a36e-28b8-4386-8106-9aa786c4d7a1 | Shimly-2/smartcar | dll3/imgproc.cpp | #include "imgproc.h"
#include "common.h"
#include <assert.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>
#define AT AT_IMAGE
#define AT_CLIP(img, x, y) AT_IMAGE((img), clip((x), 0, (img)->width-1), clip((y), 0, (img)->height-1));
extern int clip(int x, int low, int up);
void clon... | ALGO | 0.928985 | 3.921766 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2023-03-05T03:07:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "61f8ad4e8... |
10e153f9-52a8-4cc0-a10f-f64c0ad13c6e | ten986/procon | abc131/5.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
typedef long long int ll;
typedef pair<long long int, long long int> pii;
typedef pair<double, double> pdd;
#define SORT(c) sort((c).begin(),(c).end())
#define BACKSORT(c) sort((c).begin(),(c).end(),std::greater<LL>())
#define FOR(i,a,b) for(LL i... | ALGO | 0.999904 | 4.118733 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-12-16T15:57: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": "b7f4fbad88... |
22f521d9-0c88-4c06-8920-63d9ca551a5b | gnsJhenJie/Mycpp | TNFSH_Moodle/For Loop Complement1-2/main.cpp | //
// main.cpp
// For Loop Complement1-2
//
// Created by student on 2017/12/27.
// Copyright © 2017年 TNFSH104. All rights reserved.
//
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
int x; cin >>x; int num=1; bool coutblank=false;
int height=(x-1)/2;
//cout << " ";
... | ALGO | 0.99996 | 3.896607 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2017-12-08T13:29:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "91096ed5... |
7d2a48d2-e7d6-4fd0-9811-50adebed3077 | hoang1007/CodeSpace | CC++/LuyenCode.net/BFS.cpp | #include <cstdio>
#include <queue>
#include <vector>
using namespace std;
void BFS(vector<vector<bool>>& adjacency, int vertexes) {
queue<int> q;
bool visited[vertexes + 1];
for (int i = 1; i <= vertexes; i++) {
if (!visited[i]) {
visited[i] = true;
q.push(i);
... | ALGO | 0.999991 | 4.64415 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2021-04-02T08:11:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4be474584... |
c90d57ca-afc5-4c31-a5b9-cfade82cb3ee | mazinsw/mz-robo | main.cpp | // Colisão com os cantos da tela
#include <stdio.h>
#include <stdlib.h>
#include <allegro.h>
#include <time.h>
#include <fmod/fmod.h>
#define BLOCO 0
#define ESPACO 1
#define ROBO 2
#define ALVO 3
#define MONSTRO 4
#define QUANTIDADE 20
#define PASSO 10
typedef struct
{
char **matriz;
int lagura;
int altur... | ALGO | 0.971974 | 3.960728 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-09-12T06:37: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": "ae9f7af461... |
c2c50a67-29cb-41c9-9ff4-efd78e5c7f2f | egoritak/Data-Structure-Tasks | max_supported_stack/cpp/max_supported_stack.cpp | #include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <cstring>
#include <cassert>
template <typename T>
class Stack
{
public:
Stack() : data_{ nullptr }, size_{ 0 }, capacity_{ 0 }
{
}
Stack(const Stack& other)
{
size_ = other.size();
capacity_ = othe... | ALGO | 0.999537 | 5.273187 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-06-08T16:03: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": "0bcc5999ca16... |
b1e70742-5212-4b83-b34d-9ad81389b50f | ashnove/cp-submissions | atcoder/agc011/B.cpp | /*@author : ashnove*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define lld long double
#define F first
#define S second
#define endl "\n"
#define nl cout<<endl;
#define pb push_back
#define f(i,a,b) for(ll i=a;i<b;i++)
#define Knucklehead ios_base::sync_with_stdio(false);cin.tie(NULL);
//#... | ALGO | 0.999759 | 3.284559 | {
"github_metadata": {
"branch": "master",
"commit_count": 569,
"repo_created_at": "2022-06-02T17:22: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": "9ec3cd8b... |
e4c63d63-02b4-4d7d-b0f1-d8dc0a8816d4 | cauamarcos/ufla | ed/04-listas/q10-divisao-de-lista.cpp | #include <iostream>
using namespace std;
class Noh {
friend class lista;
private:
int mDado;
Noh* mPtProx;
public:
Noh (int d);
};
Noh::Noh (int num) {
mDado = num;
mPtProx = NULL;
}
class lista {
private:
Noh* mInicio;
Noh* mFim;
int mTamanho;
... | ALGO | 0.999615 | 3.601223 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2022-07-28T00:32: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": "3fb058df29d... |
c763a1b8-d98b-48fb-b0af-af889425514b | davechurchill/ualbertabot | SparCraft/source/Player_NOKDPS.cpp | #include "Player_NOKDPS.h"
using namespace SparCraft;
Player_NOKDPS::Player_NOKDPS (const size_t & playerID)
{
_playerID = playerID;
}
void Player_NOKDPS::getMoves(GameState & state, const MoveArray & moves, std::vector<Action> & moveVec)
{
moveVec.clear();
size_t enemy(state.getEnemy(_playerID));
Array<int... | ALGO | 0.917406 | 5.042196 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2014-09-11T17:18:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 527,
"forks": 177,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "93e0... |
14a402c9-98f5-465e-b71e-774787f2b37b | jfarizano/Nachos | code/lib/bitmap.hh | /// A data structure defining a bitmap -- an array of bits each of which can
/// be either on or off. It is also known as a bit array, bit set or bit
/// vector.
///
/// The bitmap is represented as an array of unsigned integers, on which we
/// do modulo arithmetic to find the bit we are interested in.
///
/// The da... | TOOL | 0.939363 | 6.188312 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2021-03-30T20:21:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98e97315f48... |
3c9e5030-f1bd-4887-bbdd-98e5b3d277ab | Zistered/BOJ | 백준/Gold/2473. 세 용액/세 용액.cc | #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include <limits.h>
using namespace std;
long long n, 용액[100009], dif=4000000004;
long long dab[3];
void solve(long long k){
if(k>=2){
... | ALGO | 0.999997 | 4.019259 | {
"github_metadata": {
"branch": "main",
"commit_count": 180,
"repo_created_at": "2024-11-06T14:53: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": "890d81617e... |
85ab8345-7e11-4e80-86db-6f780eb084a4 | tirta333/FINAL-PROJECT | enkripsi_text.cpp |
#include <iostream>
using namespace std;
int main()
{
int i=0, x;
char t[100];
cout << "Masukkan text:\t";
cin >> t;
cout << "1 = Encrypt text.\n";
cout << "2 = Decrypt text.\n";
cout << "\nPilih opsi:\n";
cin >> x;
//menggunakan switch case statements
switch(x)
{
//encryptin... | ALGO | 0.997373 | 3.533988 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-06-17T14:02:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a050db09... |
660c946c-70a2-4cf5-9c94-f2b9800a4546 | NikhilTiwari9368/Data_Structure_and_algorithm | LEETCODE/circularlinkedlistBB.cpp | #include<iostream>
using namespace std ;
class node{
public:
int data;
node* next ;
node(int d)
{
this -> data = d;
this -> next = NULL;
}
~node()
{
int value = this->data;
if(this->next != NULL)
{
delete next;
next = NULL... | ALGO | 0.999642 | 4.554287 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-03-29T15:37: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": "9a457eb1bb6b... |
ed8d56f1-c31e-406e-986c-28deb97d3e98 | sotanishy/cp-library-cpp | test/yosupo/static_range_inversions_query.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/static_range_inversions_query"
#include <bits/stdc++.h>
#include "../../data-structure/fenwick_tree.hpp"
#include "../../misc/compress.hpp"
#include "../../misc/mo.hpp"
using namespace std;
using ll = long long;
struct AddMonoid {
using T = int;
static T id() ... | ALGO | 0.999916 | 5.438535 | {
"github_metadata": {
"branch": "main",
"commit_count": 857,
"repo_created_at": "2020-08-31T00:54:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "eac7cb7d8... |
4e6f29da-39e1-4c42-be20-0974c5117d3a | shuvokhan3/DSA | Link List/deleteNodeInLinklist.cpp | #include<bits/stdc++.h>
using namespace std;
///Customize datatype
class ListNode{
public:
int data;
ListNode* next;
public:
ListNode(int data){
this->data = data;
this->next = nullptr;
}
ListNode(){
data = 0;
}
};
void deleteNode(ListNode* node) {
if(node =... | ALGO | 0.999921 | 5.046305 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2025-02-21T18:40: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": "a78115fde8b... |
59e7b083-bd45-460b-b141-d3a4ba60ebbb | hookflash/obsolete.op | hookflash-core/webRTC/webRTC_ios/src/modules/video_coding/main/source/codec_timer.h | /*
* Copyright (c) 2011 The WebRTC 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 in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | ALGO | 0.965512 | 7.540951 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2012-11-07T20:22:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 55,
"forks": 17,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b2152c... |
ecda38b3-99dd-4200-9659-fd6ba7443308 | cnting/OpenCVStudy | 8.霍夫直线检测.cpp | #include "opencv2/opencv.hpp"
#include "iostream"
using namespace std;
using namespace cv;
/**
* https://www.bilibili.com/video/BV1Ay4y117HV/?p=242&spm_id_from=pageDriver&vd_source=cfa545ca14ba2d7782dd4c30ae22638e
* https://blog.csdn.net/shuiyixin/article/details/104541495
*/
void test1() {
Mat src = imread("r... | ALGO | 0.964543 | 4.236217 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-08-22T03:08: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": "914ba9d119... |
b0f9a98f-3c75-494f-9ed0-dbe1206bb492 | QuanNM-PTIT/C_plus_plus_PTIT | CPP0527 - SẮP XẾP THỜI GIAN.cpp | // Created by <NAME>
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz size()
#define ll long long
#define FOR(i, a, b) for(int i = a; i <= b; ++i)
#define FORD(i, a, b) for(int i = a; i >= b; --i)
#define F(i, a, b) for(int i = a; i ... | ALGO | 0.998989 | 3.964532 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-10-01T05:15:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46682e14dc5... |
33e3ecd7-cf87-4702-bdf3-91dc63044629 | akashkumargolden/assignment2 | assignment2.cpp | #include <iostream>
using namespace std;
int main() {
int size;
cout << "Enter the size of the square 2D array: ";
cin >> size;
int arr[size][size];
cout << "Enter the elements of the " << size << "x" << size << " array:" << endl;
for (int i = 0; i < size; ++i) {
for (int j = 0; ... | ALGO | 0.998433 | 5.199861 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-22T13:22: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": "9e3ffcfe3c99... |
1881bdc8-59a0-4d7c-9dd9-9a5734a5bf64 | caveofprogramming/Cpp-Multithreading | 110 Promises and Exceptions.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
#include <thread>
#include <future>
#include <exception>
using namespace std;
double calculate_pi(int terms)
{
double sum = 0.0;
if (terms < 1)
{
throw runtime_error("Terms cannot be less than 1");
}
for (int i = 0; i < terms; i++)
... | ALGO | 0.999721 | 6.259304 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2020-07-28T08:47:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 80,
"forks": 53,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f78d35... |
56a471fd-7684-46c8-8bac-066d22d50ef8 | whodivyanshu/DSA_ | problem2.cpp | #include<iostream>
using namespace std;
void print(int n){
if(n==1){
cout<<"One";
}
else if(n==2){
cout<<"two";
}
else if(n==3){
cout<<"three";
}
else if(n==4){
cout<<"four";
}
else if(n==5){
cout<<"five";
}
else if(n==6){
cout<... | ALGO | 0.996517 | 3.579436 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2022-05-24T16:45: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": "8c9f2e2098b... |
a1bbc42a-e911-4949-bb15-b4ef884e6a53 | tyzesc/UVa | 872/main.cpp | // uva 872
// algorithm: backtracking, DFS
// author: Yen-Cheng, Zhang (Tyze, tyzesc)
// date: 2019.02.28
/*
地雷紀錄:
1. 最後輸出要照字典排序,補個 sort 解決
2. 從一開始 array 無法 pass by value,到改用 vector,到嘗試 visit 完回來把該點 visited 改回 false。
3. 使用 backtracking 有個重點是,要保證加進來的元素符合規範。所以在 note 3: 位置,要先避免之後出現比當前優先度更前的。
*... | ALGO | 0.999985 | 4.619376 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2020-02-23T05:32: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": "d1c23d075... |
c274da32-2357-4dba-aff8-bf9ae75431ff | fa1c0n1/funny_learning | data_structure/c/bintree/link2btree/test_binTree.cpp | #include <iostream>
#include <stack>
#include <stdio.h>
#include <string.h>
using namespace std;
typedef struct _BitNode {
int data;
struct _BitNode *lchild, *rchild;
}BitNode, *BitTree;
//一直向左走,找到中序遍历的起点
BitNode *goLeft(BitNode *root, stack<BitNode *> &s)
{
if (root == NULL) {
return NULL;
}... | ALGO | 0.999982 | 3.703418 | {
"github_metadata": {
"branch": "master",
"commit_count": 275,
"repo_created_at": "2016-03-13T03:13:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e722f81... |
3cec8287-d45c-4745-b3ff-cf3cbc166c55 | schwarzwaldlulu/Leetcode-94.Binary-Tree-Inorder-Traversal | Leetcode94-treeTraversalIterative.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.999997 | 6.093515 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-09-13T14:35: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": "f5968a43e686... |
5f2a73d6-cbe4-4457-8d70-cb435b031a65 | HeZephyr/Awesome-Algorithm-Resources | Codeforces Round/#728div2/A_Pretty_Permutations.cpp | /**
*@filename:A_Pretty_Permutations
*@author: pursuit
*@csdn:unique_pursuit
*@email: <EMAIL>
*@created: 2021-06-25 23:36
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 100000 + 5;
const int P = 1e9+7;
int t,n;
void solve(){
if(n & 1){
for(int i = 1; i < n... | ALGO | 0.999938 | 4.432853 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-02-10T04:59:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cb59bcedf6c... |
119c37a3-18e3-4ccf-8812-1726a00b6124 | YooJaeJun/PS-Algorithm- | 백준/Gold/5972. 택배 배송/택배 배송.cc | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
vector<vector<pii>> nodes; // 노드 - 거리, 연결노드
vi dist;
void dijk()
{
priority_queue<pii, vector<pii>, greater<pii>> pq;
pq.push({ 0, 1 }); // 거리,... | ALGO | 0.999936 | 4.366611 | {
"github_metadata": {
"branch": "main",
"commit_count": 1235,
"repo_created_at": "2022-03-15T14:18: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": "2001235ad... |
1429c4cc-4383-4d80-8908-abf2b10c052d | ieeeiusb/Programming-with-Cplusplus-Bootcamp-2021 | Linear_Search.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, ara[30], num, i;
cout << "How many elements would you like to enter: ";
cin >> n;
for(i = 0; i < n; i++)
{
cout << "\nEnter the elements number (" << i << "): ";
cin >> ara[i];
}
cout << "\nEnter the number t... | ALGO | 0.998667 | 4.300849 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2021-05-08T09:06: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": "b5198434143... |
f3b0c729-8eb7-4e3f-b65d-93666664a06f | lichenyang-maker/Link-Person | 通讯录管理.cpp | #include <iostream>
#include <string>
#define Max_Size 1000
using namespace std;
// 结构体
struct Person
{
string m_name;
int m_Sex;
int m_Age;
string m_Phone;
string m_Addr;
};
// 通讯录结构体
struct AddressBooks
{
struct Person personArray[Max_Size];
int m_Size;
};
/*
函数名: showMenu
功能:显示菜单
*... | TOOL | 0.953284 | 3.51911 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-19T04:46: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": "260977fa58fe... |
b0d4a5ad-8bf7-45c1-8253-51c18e512859 | ivanallen/dsa | dsa/unsorted/skiplist.h | #pragma once
#include <memory>
#include <vector>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <optional>
constexpr int SKIPLIST_MAXLEVEL = 32;
template <typename K, typename V>
class SkipList {
public:
struct Node {
struct Level {
Node* forward;
int span = 0;
... | ALGO | 0.989846 | 4.850863 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2019-02-13T02:45:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 12,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "2978c8... |
05e2291a-ca00-47b3-bfa8-9c90d1b9e266 | alexandraback/datacollection | solutions_1482494_1/C++/dwahler/B.cpp | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <sstream>
#include <deque>
#include <queue>
#include <set>
#include <tr1/unordered_set>
#include <tr1/unordered_map>
#define D(x)
using namespace std;
using namespace std::tr1;
int main() {
int T;
cin >> T;
... | ALGO | 0.999728 | 4.024093 | {
"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": "5c9c96ea6... |
21e7cb32-841a-4cc6-b5b8-fd882cba7eb2 | PRINCE-DHAMECHA/DSA_Interview_Questions | Striver's SDE Sheet/09_Recursion.cpp/03_Combination_Sum.cpp | //& Given array of distinct integers find unique combinations of numbers such that sum of it will be target.
//-----------------------//
//----PRINCE-DHAMECHA----//
//-----------------------//
#include <bits/stdc++.h>
using namespace std;
#define __DONT_RAISE_YOUR_VOICE__IMPROVE_YOUR_ARGUMENT__$ \
ios::sync_with_... | ALGO | 0.999988 | 5.605554 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2023-05-07T07:12:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f80e5f31c1... |
7e5f8ad2-d7c5-47fe-bee2-60bdc5697f04 | joonas-yoon/PS | BOJ/15685.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio() std::cin.tie(NULL);std::ios::sync_with_stdio(false)
#define all(v) (v).begin(),(v).end()
#define REP(i,a,b) for(int i=a;i<=b;++i)
#define FOR(i,n) for(int i=0;i<n;++i)
using lld = long long;
using ii = pair<int, int>;
using ll = pair<lld, lld>;
const int... | ALGO | 0.999047 | 4.31129 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2017-07-03T12:24:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "cd5722f5... |
95a715f9-daef-4fff-a1d9-ec457b1e2b6a | diffblue/cbmc | src/goto-symex/postcondition.cpp | /*******************************************************************\
Module: Symbolic Execution
Author: <NAME>, <EMAIL>
\*******************************************************************/
/// \file
/// Symbolic Execution
#include "postcondition.h"
#include <util/find_symbols.h>
#include <util/pointer_expr.h>
#... | ALGO | 0.972555 | 7.01149 | {
"github_metadata": {
"branch": "develop",
"commit_count": 28406,
"repo_created_at": "2016-02-16T23:03:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 932,
"forks": 277,
"issues": 432,
"pull_requests": 141
},
"file_meta": {
"content_id":... |
1c1b0a78-0fbd-4bde-869e-d5b5beca14c2 | awesome98/Cplusplus_programing | Cpp_chapter11/11장-3.BASIC3.CPP | // 11장-3.BASIC3.CPP 11.3 예외 처리와 교정
#include <iostream>
using namespace std;
class ZeroDivision { };
class Negative{
public:
int* pValue;
Negative (int* pn) :
pValue (pn){ }
};
int divide (int& num1, int& num2){
if (num2 == 0)
throw ZeroDivision ();
if (num1 < 0)
throw Negative (&n... | ALGO | 0.945515 | 4.389532 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-02-06T12:40: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": "ffd7df7b5707... |
dbebdfc1-2578-4dbe-841b-c144a70f2147 | newpeople123/osgGISPlugins | include/3dtiles/hlod/KDTreeBuilder.h | #ifndef OSG_GIS_PLUGINS_KDTREE_BUILDER_H
#define OSG_GIS_PLUGINS_KDTREE_BUILDER_H
#include "3dtiles/hlod/TreeBuilder.h"
using namespace osgGISPlugins;
namespace osgGISPlugins
{
/*
* SAH代价函数的基本形式
* Cost = Ct + Ci * (P(left) * N(left) + P(right) * N(right))
* 其中:
* Ct = 遍历成本(访问节点的开销)
* Ci = 相交测试成本... | ALGO | 0.997197 | 5.71211 | {
"github_metadata": {
"branch": "master",
"commit_count": 208,
"repo_created_at": "2023-10-11T11:04:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 61,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf884de... |
75033ee9-6262-4fe1-944d-dcdd18e02c52 | Tashdidtrdb/Competitive-Programming | Code Library/factoradic permutation trick.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll, ll>
#define ff first
#define ss second
#define pb push_back
#define fastio ios::sync_with_stdio(false); cin.tie(NULL);
#define PI 2*acos(0.0)
#define eps 1e-11
#define DEBUG(x... | ALGO | 0.999902 | 3.114321 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2020-05-28T21:21: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": "d683e608b... |
edc1c8ee-e41f-4416-9019-65a6c1925b09 | Niik4466/Tarea-Info198 | programs/Cache/cache.cpp | #include <iostream>
#include <cstdlib>
#include <cstring>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <unistd.h>
#include <thread>
#include <mutex>
#include <string>
#include <unordered_map>
#include <queue>
#define IP "127.0.0.1" // Localhost
#define PORT_SEARCH_ENGINE 2021 // Puerto en el que es... | WEB | 0.967962 | 4.342627 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2024-10-03T18:32: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": "80003596ca6... |
16c30b9e-5b75-4cda-b0a8-48d8043f6450 | lalalashenle/MyLeetCodeWithCpp | 0204_count-primes/main2.cpp | /// Source : https://leetcode-cn.com/problems/count-primes/
/// Author : lalalashenle
/// Time : 2020-02-25
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
using namespace std;
// 筛选法。
// 好厉害,膜拜。
class Solution {
public:
int countPrimes(int n) {
if (n <= 2)
... | ALGO | 0.999944 | 5.36064 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2020-02-24T01:24:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2796356dd... |
4dafdd29-cc25-4607-a965-238e06b3155e | SnehAl2o7/Daily-DSA | Array-Basic/TwoSum.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
// BRUTE-FORCE APPROACH
vector<int> twoSumloop(vector<int>& nums, int target) {
int n = nums.size(); // getting size of array
for(int i = 0;i<n;i++){
for(int j = i+1;j < n;j++){ // using 2 loop... | ALGO | 0.999875 | 5.638169 | {
"github_metadata": {
"branch": "main",
"commit_count": 196,
"repo_created_at": "2025-03-09T07:32:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9622ce503... |
42c87cbe-ba37-4108-89ae-77dd4f6541fd | ArtistwtUwU/TEB1113_TFB2023_DSA | L6/22011425_Mohd_L6_QueueArray.cpp | /** Name: <NAME> bin <NAME>
Student ID: 22011425 **/
#include <iostream>
#include <string>
using namespace std;
class Queue {
static const int MAX_SIZE = 100;
string arr[MAX_SIZE];
int front, rear;
public:
Queue() {
front = 0;
rear = 0;
}
void enqueue(string name){
i... | ALGO | 0.931743 | 4.66498 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-06-05T08:38: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": "e1dbe716acd... |
212c1d77-a4b9-4f3c-a9b3-a648ed5c05f0 | agarwaltanmay/codeforces | code/1B.cpp | #include <bits/stdc++.h>
using namespace std;
void type1(char * inp)
{
char out[20];
int col = 0;
int i, j, cind;
for(i = 0; inp[i] != '\0'; i++)
{
if (inp[i] == 'C')
{
cind = i;
break;
}
}
for(j = i + 1; inp[j] != '\0'; j++)
{
col = (col * 10) + (int)(inp[j] - 48);
}
int rem;
char temp[10... | ALGO | 0.999009 | 3.730862 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-10-07T09:27: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": "83f7c4eaf1... |
4f0d401f-f1c9-4f07-8a80-a0e66060c80f | douglascraigschmidt/CPlusPlus | STL/S-09/9.2/9.2b/main.cpp | #pragma clang diagnostic push
#pragma ide diagnostic ignored "modernize-use-transparent-functors"
#include <iostream>
#include <functional>
#include <iterator>
#include <vector>
#include <algorithm>
#include <array>
using namespace std;
/**
* This example applies bind2nd(), bind(), and a C++ lambda function
* with v... | ALGO | 0.998248 | 6.891968 | {
"github_metadata": {
"branch": "master",
"commit_count": 197,
"repo_created_at": "2020-03-31T19:16:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 139,
"forks": 65,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "ecaf9... |
0e5e7bc7-39eb-44c2-a658-759f8ee84997 | watchmen-r/aoj | ALDS1_9_C_PriorityQueue.cpp | // 優先度付きキュー
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
const int MAX = 2000000;
int allNodeNum = 0;
int treeArray[MAX + 1];
// 左の子を計算する
int leftChild(int key) { return key * 2; }
// 右の子を計算する
int rightChild(int key) { return key * 2 + 1; }
// keyからの部分期のrootが子より小さ... | ALGO | 0.999938 | 4.312319 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2020-12-26T06:49: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": "d899026c5... |
99ede6d4-a2e6-4eb5-b0c4-a79035097a07 | Shucharjer/OffsetReader | Memory.h | #pragma once
#include <Windows.h>
#include <TlHelp32.h>
#include "Byte.h"
namespace Memory
{
class Process
{
public:
pAddr id = NULL;
HANDLE handle = NULL;
// is is a avalible Process?
bool avalible() { return id && handle && handle != INVALID_HANDLE_VALUE; }
~Process();
};
// Reader via snapshot
cla... | TOOL | 0.907112 | 4.765308 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2023-09-15T16:24: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": "86c68efc61... |
1023df9a-72c6-4a29-b1a6-1e2813a3f4dd | JohanF26/WBTraining | Week1/Simple String Manipulation/detect_capital.cpp | class Solution {
public:
bool detectCapitalUse(string word) {
// A = 65
// Z = 90
int i = 0;
if(word[i] > 96){
//if first char is lowercase then the rest must also be lowercase
i++;
while(i < word.size()){
if(word[i] < 91){
... | ALGO | 0.998952 | 5.272768 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-06-23T02:40: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": "ea97c5ba9... |
f990c356-d462-4223-b7a0-87eb1231ab52 | Kunal-2417/Leetcode_POTD | 283.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
class Solution
{
public:
void rvereseArray(int arr[], int start, int end)
{
while (start < end)
{
int temp = arr[start];
arr[start] = arr[end];
arr[end] = temp;
start++;
... | ALGO | 0.999978 | 4.985741 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2024-03-16T12:58: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": "22667f6887... |
8d9da52b-78d6-4fae-b51d-23397530398d | saychakra/Linux_Files | coc/extensions/coc-java-data/jdt_ws_5f1a2574568f9593b1dbe69ad2c5bb79/atcoder_6b3aad7f/bin/154/154_A.cpp | /*
Author: <NAME>
*/
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i = a; i < b; ++i)
#define ROF(i,a,b) for (int i = a; i > b; --i)
#define ll int64_t
#define vi vector<int>
#define vll vector<long long>
#define vs vector<string>
#define vd vector<double>
#define deb(x) cout << #x << "... | ALGO | 0.999933 | 4.170971 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2020-08-11T06:44: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": "2a3ef6c91... |
e0a44eed-cdbb-4b28-8976-78ca4ec1e943 | Brunex0/SolarSystem_TeamSOL | Sistema_Solar/Sistema_Solar/common/controls.cpp | // Include GLFW
#include <GLFW/glfw3.h>
extern GLFWwindow* window; // The "extern" keyword here is to access the variable "window" declared in tutorialXXX.cpp. This is a hack to keep the tutorials simple. Please avoid this.
// Include GLM
#include <glm.hpp>
#include <gtc/matrix_transform.hpp>
using namespace glm;
#in... | TOOL | 0.941189 | 4.344586 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-01-10T17:20: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": "640791e677af... |
c3a45c7c-aeb8-49b5-83f9-65436d473106 | guzmaneandrew/GuzmanAndrew_CSC_CIS_17a | Lab/Lab3-FloatFormat_2DtoVectors/Dynamic_1D_2D_Arrays_to_Vectors/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on October 10, 2022, 11:30 PM
* Purpose: Compare 1 and 2 Dimensional vectors.
*/
//System Libraries Here
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <vector>
using namespace std;
//User Libraries Here
//Global Constants O... | ALGO | 0.998279 | 5.013007 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2022-11-04T09:04: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": "22ac182e7fb... |
782bd5bc-42f4-4772-8db5-f41daee39dbc | jwk000/learnShader | src/ofApp.cpp | #include "ofApp.h"
void calcTangents(ofMesh& mesh)
{
using namespace glm;
std::vector<vec4> tangents;
tangents.resize(mesh.getNumVertices());
uint indexCount = mesh.getNumIndices();
const vec3* vertices = mesh.getVerticesPointer();
const vec2* uvs = mesh.getTexCoordsPointer();
const uint* indices = mesh.get... | TOOL | 0.956507 | 4.367321 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-12-26T12:03: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": "a162c3ecac... |
3ca33b52-1c79-44d2-876c-7935e7b4a6a6 | nhu220840/C-plus-Tutorial | Cau truc du lieu giai thuat/Thuat toan sinh/BieuThucLonNhat.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int num[5], a[100], final = 0;
void initialize(){
for(int i = 1; i <= 4; i++){
a[i] = 0;
}
}
void nextGen(){
int i = 4;
while(i >= 1 && a[i] == 1){
a[i] = 0;
i--;
}
if(i == 0)
final = 1;
e... | ALGO | 0.999951 | 4.095888 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2023-04-27T07:34:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ef1421f0d3... |
04f3b3c9-e77b-4bef-bb08-8af7c1ea065b | Briancbn/trashy-splashy | firmware/lib/CPG/Joint.h | /*
* Joint.h
*
* Created on: 17 Mar 2018
* Author: <NAME>
*
*/
#ifndef JOINT_H_
#define JOINT_H_
#include "Arduino.h"
namespace CPG {
class Joint {
public:
Joint(float _frequency, float _alpha, float _beta, float _update_interval, float initial_amplitude, float initial_neutral_position, float initial... | ALGO | 0.975593 | 6.044238 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2018-03-18T18:48:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "115ab9d0b... |
7144b087-a145-4083-a70a-3a8ecccd8b90 | xwiskas/Homework-and-Lab-Assignments-Sebastian-Martinez-Cruz | CodeE Assignment_2/Savitch_9thEd_Chap2_Prob2_Pay/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on July 5, 2022
* Purpose: Pay increase
*/
//System Libraries
#include <iostream>
#include <cmath>//Input/Output Library
#include <iomanip>
using namespace std;
//User Libraries
//Global Constants, no Global Variables are allowed
//Math/Physics/Conversions/Hig... | ALGO | 0.998145 | 3.610926 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-07-17T23:22:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "623f859347... |
4255c238-157d-4a14-857d-5bf588ce8a88 | raincross7/code-similarity | codes/train_code/problem157/problem157_230.cpp | #include <bits/stdc++.h>
#define int long long
#define FOR( i, m, n ) for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n ) FOR( i, 0, n )
#define REPR( i, m ) for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n ) FOR( i, 1, n + 1 )
#define ALL( a ) (a).begin(), (a).end()
#defin... | ALGO | 0.999964 | 3.461272 | {
"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": "2c778c65de2f... |
446864a1-c61b-4a0d-85da-9388ef6d1b7c | sammochen/cp-submissions | uva/11955.cpp | #define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define REP(x,l,u) for(ll x = l; x < u; x++)
#define RREP(x,l,u) for(ll x = l; x >= u; x--)
string to_string(string s) {return s;}
string to_string(char c) {string s = string(1, c);return s;}
template <typename A, typename B> string to_str... | ALGO | 0.999909 | 4.363557 | {
"github_metadata": {
"branch": "master",
"commit_count": 1396,
"repo_created_at": "2019-07-26T21:44: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": "2addbe2... |
0a2e51a8-a7d7-42e5-84e4-f4008ecc2ab2 | haoyus/LetsPractice | leetcode/sort/bubbleSort.cpp | #include <iostream>
#include "../common.h"
// void BubbleSort(Object (&objs)[SIZE])
void BubbleSort(Object objs[],int size)
{
if(size<=1) return;
int end = size-1;//end of unsorted area
while(end>0){
bool flag = false;
for(int i=0; i<end; ++i){
if(objs[i].x > objs[i+1].x){... | ALGO | 0.996959 | 5.159369 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2019-10-06T17:56: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": "25d41dcd3... |
5c1023d4-e5ef-4493-a238-8a72048cc907 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/08/0814/personal_submission/cf578a_yawn_sean.cpp | #include <bits/stdc++.h>
// #pragma GCC optimize("O3,Ofast,unroll-loops")
// #include <bits/extc++.h>
// using namespace __gnu_cxx;
// using namespace __gnu_pbds;
using namespace std;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int x, y;
cin >> x >> y;
if (x < y)... | ALGO | 0.998793 | 3.534627 | {
"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": "820c... |
c6175093-1a60-41d0-97dd-7b70d818e204 | overIsAC/contest | bluebook/0x05/Ultra-QuickSort.cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int N = 3 + 5e5;
int n, a[N], b[N];
LL ans;
void sort(int l, int r) {
if (l >= r) {
return;
}
int mid = l + r >> 1;
sort(l, mid);
sort(mid + 1, r);
int u = l, v = mid + 1, w = l;
while (u <= mid && v <= r) {... | ALGO | 0.999931 | 4.209865 | {
"github_metadata": {
"branch": "main",
"commit_count": 131,
"repo_created_at": "2022-10-30T18:24: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": "15680fa702... |
d05bb17c-2b5e-46d9-9b0d-daab80ed4891 | higgs1022/baekjoon | 1644-2.cpp | #include<iostream>
#include<vector>
#include<cmath>
using namespace std;
vector<int> primeVector;
bool primeArray[4000001];
int main()
{
int input;
cin >> input;
for (int i = 2; i <= input; i++)
{
primeArray[i] = true;
}
for (int i = 4; i <= input; i += 2)
{
primeArray[i] = false;
}
primeVector.push_ba... | ALGO | 0.999888 | 3.833699 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2017-08-10T16:20:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0221620dc... |
cdebe6a6-b6fb-40a0-af6a-57c508b963b2 | alexandraback/datacollection | solutions_5669245564223488_0/C++/darrenhp/B-small.cpp | //Clibrary:
#include<cassert>
#include<cctype>
#include<cerrno>
//#include<cfenv>
#include<cfloat>
//#include<cinttypes>
#include<ciso646>
#include<climits>
#include<clocale>
#include<cmath>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
//#include<cstdbool>
#include<cstddef>
//#include<cstdint>
#include<cstdio>... | ALGO | 0.999967 | 4.120357 | {
"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": "1671b0bb1... |
bdd1736b-0654-4aea-8428-5f9269f845b5 | yuvrajdalia/cg | ellipse.cpp | //#include <windows.h>
#include <iostream>
#include <math.h>
#include <GL/glut.h>
using namespace std;
int a,b,xc,yc;
float r,g,bl;
void init()
{
glClearColor(1.0,1.0,1.0,0.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(-320,320,-240,240);
}
void plot (GLint x, GLint y, GLfloat r, GLfloat g, GLfloat b)
{
... | ALGO | 0.927895 | 4.726806 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-04-08T16:58: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": "026282234... |
2e300bc7-f7a2-40e6-871b-3c3f685731c4 | vedhkreddy/CompetitiveProgramming | USACO competitions/calico/d.cpp |
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
ll q;
cin >> q;
while (q--) {
ll n, c;
cin >> n >> c;
vector<ll> a(n);
vector<ll> s(n);
for (int i = 0; i < n; i++) cin >> a[i];
s[0] = a[0];
for (int i = 1; i < n; i... | ALGO | 0.999977 | 4.36201 | {
"github_metadata": {
"branch": "main",
"commit_count": 183,
"repo_created_at": "2021-06-28T20:30: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": "fe71809424... |
f2670e82-198a-48e0-81c2-3fdb12eb74bf | fsjhhh/acm_title | cpp/atcoder/abc345/A.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <iomanip> // std::fixed std::setprecision(x) 保留x位小数
#include <array>
#include <bitse... | ALGO | 0.99998 | 3.174962 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-10-30T10:57: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": "a4e4b987685... |
653fceab-7808-4406-a8c4-ac839606fde3 | yeonee911/WIL-Log | C++17/백준/Platinum/13512. 트리와 쿼리 3/트리와 쿼리 3.cc | #include <iostream>
#include <vector>
#include <algorithm>
const int INF = 1 << 30;
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n; cin >> n;
vector<vector<int>> g(n + 1);
for (int i = 1;i < n;i++) {
int u, v;
cin >> u >> v;
g[u].push_back(v);
g[... | ALGO | 0.999957 | 4.790062 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2025-01-31T12:49: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": "872a4ae83b... |
e88a9eec-da86-40da-a85b-d846262d12b2 | fabioagpp/GraphProject | src/case_study.cpp | #include <iostream>
#include <vector>
#include <ctime>
#include <random>
#include <algorithm>
#include <map>
#include "graph.h"
using namespace std;
ofstream output;
void log_print(string s){
cout << s << endl;
output << s << endl;
}
int main(){
clock_t begin_time, end_time;
double elapsed_tim... | ALGO | 0.991918 | 3.416327 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2016-11-03T10:33: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": "9056fe331... |
326e71d5-e0c0-49ac-b2bb-08252e4218fb | miracl/MIRACL | source/curve/pairing/zzn12a.cpp |
/***************************************************************************
*
Copyright 2013 CertiVox UK Ltd. *
*
This file is... | ALGO | 0.998203 | 5.131912 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2012-11-06T01:20:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 683,
"forks": 243,
"issues": 67,
"pull_requests": 12
},
"file_meta": {
"content_id": "7dd2... |
7d861e9d-47db-4b5b-bfe0-c0d6d575f6e2 | Sumendra2906/DS-ALGO | 31-40/36 Heaps Challenges/top_k_most_frequent.cpp | #include <iostream>
#include <queue>
#include <unordered_map>
#include <vector>
using namespace std;
typedef pair<int, int> num;
class Comp
{
public:
bool operator()(num a, num b)
{
//first will store the number and second will store the frequency
if (a.second == b.second)
{
... | ALGO | 0.999991 | 4.829586 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-08-23T07:23: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": "4c02f2b3cb... |
a75627c7-efd2-4526-b1c2-caced444b10e | davepandit/Data-Structures-And-Algo | Graphs/TopoSort/DFS_Approach.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void dfs(int node, vector<vector<int>>& adj, stack<int>& st, vector<int>& visited){
visited[node] = 1;
for(auto it : adj[node]){
if(visited[it] == 0){
... | ALGO | 0.999246 | 6.72967 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2024-12-04T08:08:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f61d24fa3... |
4c9cdec9-7500-46e2-ad83-7700868c0cbe | ermig1979/Simd | src/Simd/SimdAvx512bwSynetConvolution32fNhwcDirect2f.cpp | /*
* Simd Library (http://ermig1979.github.io/Simd).
*
* Copyright (c) 2011-2024 <NAME>.
*
* 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 th... | ALGO | 0.984697 | 4.238639 | {
"github_metadata": {
"branch": "master",
"commit_count": 4063,
"repo_created_at": "2015-03-25T15:24:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2179,
"forks": 437,
"issues": 30,
"pull_requests": 1
},
"file_meta": {
"content_id": "2... |
e8f35bf4-1e61-4431-94b8-ce1c43d8ce15 | Colly001/Alternativa3D-CPP | alternativa/physics/collision/colliders/boxspherecollider.cpp | #include "boxspherecollider.h"
#include "alternativa/physics/collision/primitives/collisionsphere.h"
#include "alternativa/physics/collision/primitives/collisionbox.h"
#include "alternativa/physics/contact.h"
#include "alternativa/physics/contactpoint.h"
#include "mymath.h"
#include <QDebug>
BoxSphereCollider::~BoxSph... | TOOL | 0.934297 | 3.720467 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-25T11:06: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": "619f54a5fc15... |
e84e22ef-854f-4d83-9f72-502f90050cfe | ealang/genetic-go-ai | src/main.cpp | #include <cstring>
#include <iostream>
#include "evolution_algs.h"
#include "generate_ai.h"
#include "gpnodes_experimental.h"
#include "gptree.h"
#include "scoring_algs.h"
#include "ui.h"
using namespace std;
void logTrainingData(const TrainingData& data) {
cout << "training_data " <<
"{" <<
... | ALGO | 0.97186 | 6.119695 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2016-06-05T22:46: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": "1b7fce6e0... |
637e23c1-4f3e-4dbf-ad37-f5bd8326974a | InitGo/acwing | Leetcode/List/143重排链表.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
//细节:midi就是反转链表的prev
class Solution {
public:
... | ALGO | 0.999994 | 6.018256 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2022-10-02T02:38: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": "74cc433df... |
224459bd-1653-4ed2-bd16-70399389848a | Luckily777/Game | Search_Engine/searcher/searcher.cc | #include "searcher.h"
#include <boost/algorithm/string/case_conv.hpp>
#include <fstream>
#include <jsoncpp/json/value.h>
#include <jsoncpp/json/writer.h>
#include <string>
#include <algorithm>
#include <jsoncpp/json/json.h>
#include "../common/util.hpp"
namespace searcher {
/////////////////////////////////////////... | TOOL | 0.988373 | 4.451087 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-11-27T14:24:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4567a3944... |
22c0daf4-33c7-4b37-a596-6a15bd76f186 | koth/elements-of-programming-interviews | Lowest_common_ancestor_no_parent.cpp | // Copyright (c) 2013 Elements of Programming Interviews. All rights reserved.
#include <cassert>
#include <iostream>
#include <memory>
#include "./Binary_tree_prototype.h"
using std::cout;
using std::endl;
using std::unique_ptr;
// @include
BinaryTreeNode<int>* LCA(const unique_ptr<BinaryTreeNode<int>>& T,
... | ALGO | 0.99978 | 6.442004 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2016-03-30T01:43:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 14,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2560db... |
29fad737-e05d-438f-a192-c4ae3caf3503 | Jmartin042/Cpp_Projects | pro_5/skel_p5.h | ///////////////////////////////////////////////////////////////
// I UNDERSTAND THAT COPYING PROGRAMS FROM OTHERS WILL BE DEALT
// WITH DISCIPLINARY RULES OF CCNY.
// STUDENT NAME:
// LOGIN_NAME:
// EE259 SECTION (DAY/EVE):
///////////////////////////////////////////////////////////////
#include <iomanip>
#include <ios... | ALGO | 0.94685 | 3.341687 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2020-02-22T01:22: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": "bc5703213... |
b25812b8-3754-4d22-877a-6ffb576ede72 | DanChoys1/Dan2.4 | Dan4/encode_string.cpp | #include <iostream>
#include <string>
#include <cctype>
using namespace std;
enum TransformingChoice {
CODING_CHOICE = 1,
DECODING_CHOICE
};
int GetInt(void);
void CodingOrDecodingMenu(void);
string CodingString(string input_string, int number_of_characters) {
int last_change_position = 0;
for (int i = 0; i < ... | TOOL | 0.992903 | 3.510243 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2021-04-19T15:28:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "187acf98f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.