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 |
|---|---|---|---|---|---|---|---|
cafec90b-0b3b-4109-81c0-7a0770a4a8c8 | BakasaRus/DSA | Problems 8/8B.cpp | #include <fstream>
#include <string>
#include <vector>
using namespace std;
vector<int> PrefixFunction(string &T)
{
vector<int> Res;
Res.push_back(0);
for (int i = 1; i < T.length(); ++i)
{
int k = Res[i - 1];
while (k > 0 && T[i] != T[k])
k = Res[k - 1];
if (T[i] == T[k])
++k;
Res.push_back(k);
}
... | ALGO | 0.999945 | 4.616051 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-01-03T17:10:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1631c802db... |
611308e8-8d83-4576-bb45-e37ea74a8f28 | aoaforever/C_trian | Leetcode/array/986_intervalIntersection.cpp | // #include <vector>
// #include <iostream>
// #include <algorithm>
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<int>> intervalIntersection(vector<vector<int>>& firstList, vector<vector<int>>& secondList) {
int i =0, j =0;
vector<vector<int>> res;
wh... | ALGO | 0.999991 | 5.698075 | {
"github_metadata": {
"branch": "master",
"commit_count": 253,
"repo_created_at": "2021-07-05T02:23: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": "c0967caa... |
ea09f69b-9aaa-4f44-be7c-f05399763238 | mkudruss/rbdl_derivatives | addons/differentiation/SpatialAlgebraOperatorsED.h | #ifndef RBDL_SPATIALALGEBRAOPERATORS_ED_H
#define RBDL_SPATIALALGEBRAOPERATORS_ED_H
#include <rbdl/rbdl.h>
#include <rbdl/SpatialAlgebraOperators.h>
// -----------------------------------------------------------------------------
namespace RigidBodyDynamics {
// -------------------------------------------------------... | ALGO | 0.997998 | 6.517401 | {
"github_metadata": {
"branch": "main",
"commit_count": 1264,
"repo_created_at": "2021-02-13T21:35:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7bde0b4a... |
eb28ee39-1278-4425-84fa-5487ecb28fa2 | levirs565/competitive | FINDIT/2024/Final/I_Mencari_Karakter_1.cpp | #include <algorithm>
#include <array>
#include <climits>
#include <cmath>
#include <cstring>
#include <exception>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <vector>
using namespace std;
using i64 = int64_t;
int MAX_C = 63;
i64 C[64][64];
string genPermutation(i64 zero, i64 o... | ALGO | 0.999984 | 4.341982 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2024-08-10T04:49: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": "7ac2c213c9e... |
e952d518-0133-44fe-9567-57d30fa2fd1a | prashant695/DSA_250 | Dynamic Programming/17. Unique Paths.cpp | // https://leetcode.com/problems/unique-paths/
// Method - 1
// Recursion + Memoization
class Solution
{
public:
int dp[100][100];
int fun(int x, int y)
{
if (x == 0 and y == 0)
return 1;
if (x < 0 or y < 0)
return 0;
if (dp[x][y] != -1)
return ... | ALGO | 0.999973 | 6.450336 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-09-01T06:20: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": "a7765b12ff9... |
7d46b282-7097-4074-b470-3e0749b29e73 | atharvabhide/SPPU-COMP-2019-PRACTICALS | AI/03_job_scheduling.cpp | // Program to find the maximum profit job sequence from a given array
// of jobs with deadlines and profits
#include<bits/stdc++.h>
using namespace std;
// A structure to represent a job
struct Job
{
int id; // Job Id
int dead; // Deadline of job
int profit; // Profit if job is over before or on d... | ALGO | 0.999974 | 4.660755 | {
"github_metadata": {
"branch": "main",
"commit_count": 224,
"repo_created_at": "2021-12-12T05:12:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 81,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c4b4fd0... |
a91d5257-8fd1-4300-a3ed-ac85a2b0c666 | isabel-olivero/taller-3 | punto2.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
const int NUM_CILINDROS = 5000;
const int NUM_SOLICITUDES = 1000;
vector<int> generarSolicitudes() {
vector<int> solicitudes;
for (int i = 0; i < NUM_SOLICIT... | ALGO | 0.999894 | 5.223614 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-05-12T03:25: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": "0dbbedc3b7be... |
6cb4f4d5-780d-4aff-aeb3-64ea6bf6d752 | Dylanmxh/gitskills | enum.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <set>
using namespace std;
/*
[问题描述]
小蓝有很多数字卡片,每张卡片上都是一个数字(0到9)。
小蓝准备用这些卡片来拼一些数,他想从1开始拼出正整数,每拼一个,就保存起来,卡片就不能用来拼其他数了。
小蓝想知道自己能从1拼到多少。
例如,当小蓝有30张卡片,其中0到9各3张,则小蓝可以拼出1到10,但是拼11时卡片1已经只有一张了,不够拼出 11。
现在小蓝手里有0到9的卡片各2021张,共20210张,请问小蓝可以从1拼到多少?... | ALGO | 0.99939 | 3.838955 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-03-29T12:24: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": "8f76fef8f592... |
01223886-00d0-413b-abea-4723aef91534 | plus2047/ITPC | itpc/02_Mathematics/poj1654_area.cpp | // poj1654_area.cpp
#include <cstdio>
using namespace std;
char buff[1000000 + 100];
int delta[10][2] = {
{0, 0}, // 0
{-1, -1}, // 1
{0, -1}, // 2
{1, -1}, // 3
{-1, 0}, // 4
{0, 0}, // 5
{1, 0}, // 6
{-1, 1}, // 7
{0, 1}, // 8
{1, 1} //... | ALGO | 0.997882 | 3.785334 | {
"github_metadata": {
"branch": "master",
"commit_count": 168,
"repo_created_at": "2018-01-16T14:47:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7db8047c... |
0270d571-8ca9-4184-83ec-c60ba11b762d | sauloantuness/maratona | uri/1200.cpp | #include "iostream"
#include "string"
using namespace std;
struct No{
char valor;
No* esq;
No* dir;
No(){}
No(char valor, No* esq=NULL, No* dir=NULL):
valor(valor), esq(esq), dir(dir) {}
};
No* raiz;
bool esp;
void prefixa(No* no){
if(!no)
return;
if(esp)
cout << " ";
esp = 1;
cout << no->valor;
... | ALGO | 0.999719 | 4.416722 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2014-03-06T18:46: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": "17984295... |
edcf533a-d973-42db-88b7-8a27296d4868 | fk721/cs-2124-oop | Labs/Lab 01/rec01.cpp | // <NAME>
// Fk786
// Rec 01
// The following program implements Conway's Game of Life when given an initial population
// Dashes for dead cells and asterisks for live ones
# include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
int main() {
ifstream ifs("life.txt"); // Open... | ALGO | 0.996587 | 4.178946 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2018-09-12T23:19: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": "59875756f... |
6b65d351-38a1-4c79-bbff-d60d76a50543 | ankitgulshan24/ogDp | LR_DP_FORM4/Colouring.cpp | // Genos recently installed the game Zuma on his phone. In Zuma there exists a line of n gemstones, the i-th of which has color ci. The goal of the
// game is to destroy all the gemstones in the line as quickly as possible.
// In one second, Genos is able to choose exactly one continuous substring of colored gemstone... | ALGO | 0.999974 | 4.022445 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-10-18T12:39: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": "e0a14a276c1e... |
ac0bb3ea-0266-4046-8e0b-02cffe03626b | VixenLights/Vixen | src/Vixen.Modules/Analysis/QMLibrary/QMFiles/dsp/signalconditioning/DFProcess.cpp | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
/*
QM DSP Library
Centre for Digital Music, Queen Mary, University of London.
This file 2005-2006 <NAME>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Publi... | ALGO | 0.988032 | 5.664542 | {
"github_metadata": {
"branch": "master",
"commit_count": 7439,
"repo_created_at": "2018-05-24T14:21:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 110,
"forks": 27,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "081a1... |
fe18cdf1-4e8e-4540-af6c-1bd0b39d8cb2 | Walter-Rabbit/AlgsStructs.I-IIsem | Lab 8/E/main.cpp | #include <fstream>
#include <queue>
#include <list>
std::list <int> a[30000];
int lengths[400000];
int n, m;
void bfs(int start) {
int check[400000] = {0};
std::queue<int> q;
q.push(start);
while (!q.empty()) {
int t = q.front();
q.pop();
for (auto i : a[t]) {
if ... | ALGO | 0.999936 | 4.038545 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-09-02T18:38:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50e75aac52... |
abbb432d-14b9-446f-ac48-b767a887e370 | quanyuanshang/CS | CS101/alexercise/array.cpp | // 给定一个 n 个元素有序的(升序)整型数组 nums 和一个目标值 target ,写一个函数搜索 nums 中的 target,如果目标值存在返回下标,否则返回 -1。
#include <vector>
template <typename T>
using vector = std::vector<T>;
class Solution
{
public:
int search(vector<int> &nums, int target)
{
int left = 0;
int right = nums.size() - 1;
while (left <= ... | ALGO | 0.999716 | 4.27132 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2025-06-28T19:17: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": "018cd220a4... |
8ab26c2d-02b0-4dca-b339-20043fd4529b | si9ma/YunAlgorithm | sort.cpp | //
// Created by si9ma on 9/28/18.
//
#include <algorithm>
#include <climits>
#include <cstring>
#include "util.h"
#include "sort.h"
#include "heap.h"
#include <vector>
using namespace std;
namespace si9ma{
Sort::Sort() {
}
// bubble Sort
void Sort::bubble_sort(int *arr,int len)
{
if(le... | ALGO | 0.999584 | 4.807832 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-09-29T14:03:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a105055a6... |
753a3df3-63d9-41d5-8fd4-e8a276da3a2f | sopilnyak/mipt-concurrency | task4/striped_hash_set/striped_hash_set.h | #include <iostream>
#include <vector>
#include <forward_list>
#include <shared_mutex>
#include <atomic>
#include <iostream>
#include <stdexcept>
const int DEFAULT_GROWTH_FACTOR = 2;
const float DEFAULT_LOAD_FACTOR = 1.5;
template <typename T, class H = std::hash<T>>
class striped_hash_set {
public:
explicit strip... | ALGO | 0.937611 | 7.30367 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2016-03-06T12:59: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": "bf1132f2f... |
6ed9be3b-2dee-4c5e-b1a3-735cef6650bd | rit-spex/Hab4 | HAB4 - Prototyping Software/Rolling/Rolling.cpp | /**
* Rolling.cpp
* Determines if more rcent values are lower than older ones.
* Uses rolling sums, to suppress any noise
*/
class Rolling {
public:
void addValue(int val) {
double old1 = recent[i1];
recent[i1] = val;
i1 = (i1+1) % LEN;
recentVal -= old1;
recentVal += val... | ALGO | 0.999411 | 6.263242 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2017-10-07T18:30:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6fa6479a4... |
d1de76e3-3b0d-4e29-907e-2182c0cdd48e | Alok-Khansali/Hackerrank-Demystified | 6_star_Problem_Solving/Data Structures/Queues/Down to Zero II.cpp | // The Intuitive Dynammic Programming Approach
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t, n;
cin >> t;
vector<int> done(1e6 + 1, 1e6 + 1);
done[0] = 0, done[1] = 1;
for (int i = 2; i <= 1000000; i++)
{
done[i... | ALGO | 0.999939 | 5.111156 | {
"github_metadata": {
"branch": "main",
"commit_count": 652,
"repo_created_at": "2021-04-26T16:30:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15782203f2... |
b68e0583-69e1-4c4d-b397-2671f033e330 | jsavigny/C-pp-alculator | Parser/parser.h | #include "../Collection/list.h"
#include "../Collection/stack.h"
#include "../Styling/style.h"
#include "../Styling/mode.h"
#include "../Number/number.h"
#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <assert.h>
using namespace std;
#ifndef PARSER_H
#define PARSER_H
/** Class Parser... | ALGO | 0.959275 | 4.292295 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-12-27T00:00: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": "f516f06dac... |
a51b6b85-849e-4739-beaf-3a2064b0f221 | kisscool-fr/php_botan | Botan-1.8.11/src/checksum/adler32/adler32.cpp | /*
* Adler32
* (C) 1999-2007 <NAME>
*
* Distributed under the terms of the Botan license
*/
#include <botan/adler32.h>
#include <botan/loadstor.h>
namespace Botan {
/*
* Adler32 Checksum
*/
void Adler32::hash(const byte input[], u32bit length)
{
u32bit S1x = S1, S2x = S2;
while(length >= 16)
{
S... | ALGO | 0.976791 | 6.717733 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2011-07-13T10:05:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7965af8b8... |
19c78709-ef45-4d41-bc23-9a3e989eb435 | HaikuArchives/BeGUI | BeGUIlib/layoutMatrix.cpp | //layoutMatrix.cpp
#define BUILDING_LIB 1
#include "commonHeaders.h"
#include "DnumSpecificWindows.h"
#include "uInt32Control.h"
#include "floatControl.h"
#include "stringControl.h"
#include "warning.h"
#include "colorWell.h"
#include "textItem.h"
#include "myStringDrawer.h"
#include "myPopUpMenu.h"
#include "myPopUp... | TOOL | 0.934069 | 3.115743 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2013-09-26T23:13:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "412945a33a... |
87747b4c-4c76-4066-a079-ff910fee828f | yonitoo/Finite-Automata | PDFA.h | #ifndef PDFA_H
#define PDFA_H
class DFA;
#include <set>
#include <map>
#include <utility>
#include <string>
#include "Alphabet.h"
//Автоматът е наредена петорка (Σ, Q, 𝛿, qstart, F)
class PDFA {
private:
//Σ
Alphabet alphabet;
//Q
std::set<std::pair<std::string, std::string>> ... | ALGO | 0.978476 | 5.759736 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2021-01-05T00:29:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae2a7707741... |
72c75ded-d47e-472f-a16b-21cd2d0951bc | parikshit223933/Coding-Ninjas-Competitive-Programming | Language Tools/Tell_The_Positions.cpp | /* In a class there are ‘n’ number of students. They have three different subjects: Data Structures, Algorithm Design & Analysis and Operating Systems. Marks for each subject of all the students are provided to you. You have to tell the position of each student in the class. Print the names of each student according to... | ALGO | 0.99986 | 4.345459 | {
"github_metadata": {
"branch": "master",
"commit_count": 677,
"repo_created_at": "2020-03-09T07:20:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 555,
"forks": 299,
"issues": 4,
"pull_requests": 7
},
"file_meta": {
"content_id": "3d45... |
684009f1-2bab-4c9e-9c26-757d49366f4e | ki-opt/AtCoder-ABC | ABC201-ABC300/ABC212/D/src/src.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <cmath>
#include <climits>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <math.h>
#include <float.h>
#include "atcoder/all"
using namespace std;
using namespace atcoder;
using ull=... | ALGO | 0.998996 | 4.452605 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2023-02-05T05:00:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fb3729b9... |
c01d3cc1-0265-472d-b8bd-12b950c54e35 | David-GINI/GardesCriminels | main.cpp | #include <iostream>
#include <thread>
#include <random>
#include <mutex>
#include <condition_variable>
using namespace std;
mutex mtx;
condition_variable detenusQueue;
condition_variable guardesQueue;
bool isCaptain = false;
int detenus = 0;
int guardes = 0;
int totalDetenus = 0;
int totalGuardes = 0;
int remaining =... | TOOL | 0.982817 | 4.05687 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2023-10-16T07:56: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": "2e46ed7afa... |
70cddb47-9467-481a-9b25-5f8e91c775f4 | Time1ess/MyCodes | LintCode/33-N-Queens/solution.cpp | class Solution {
public:
/*
* @param n: The number of queens
* @return: All distinct solutions
*/
vector<string> make_board(int n)
{
vector<string> ans;
for(int i = 1; i <= n; i++)
ans.push_back(string(n, '.'));
return ans;
}
bool valid(vector<strin... | ALGO | 0.999968 | 5.864122 | {
"github_metadata": {
"branch": "master",
"commit_count": 1837,
"repo_created_at": "2014-10-23T02:43:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9235db7... |
5f75b4ee-8d92-4459-99bc-c85977dfb45f | hroest/OpenMS | src/openms/include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/TraceFitter.h | // --------------------------------------------------------------------------
// OpenMS -- Open-Source Mass Spectrometry
// --------------------------------------------------------------------------
// Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
// ETH Zurich, and Freie Universit... | ALGO | 0.996865 | 7.142306 | {
"github_metadata": {
"branch": "develop",
"commit_count": 28908,
"repo_created_at": "2014-01-10T11:54:21.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "OpenMS/OpenMS",
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_i... |
a0308ba1-93a0-49b6-8cb8-f3744198b382 | zhu-he/ACM-Source | vjudge/103922/F.cpp | #include <cstdio>
#include <unordered_set>
#include <algorithm>
using namespace std;
typedef unsigned long long ull;
unordered_set<ull> vis;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
ull s, t;
ull read()
{
ull ret = 0;
for (int i = 0; i < 4; ++i)
{
int x, y;
scanf("%d %d", &x, &y);
... | ALGO | 0.999721 | 4.38111 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-04-06T06:52:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8167182be... |
39ad2ec0-582f-4f3b-b436-16d6b5f71a2d | memo735/e-olymp | 2000-2999/2911 - Maximum Sum - Максимальная сумма - Ən böyük cəm - Максимальна сума.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int i, j, n, q, x, y, a[100001];
char ch;
struct node
{
int max1, max2;
} SegTree[201501];
//Строим дерево отрезков из элементов массива а, поддерживающее первый и второй максимум.
void BuildTree(int *a, int Vertex, int Left, int Right)
{
//Для вершины... | ALGO | 0.999894 | 4.367714 | {
"github_metadata": {
"branch": "master",
"commit_count": 4186,
"repo_created_at": "2015-06-14T13:00:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 112,
"forks": 70,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "f9f0... |
38c8a70f-95fb-4492-bdd4-afa7122a48f4 | GSKW/EGE | pairs.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <fstream>
using namespace std;
typedef long long int ll;
// https://inf-ege.sdamgia.ru/problem?id=35915
int main(){
ifstream fin("/Users/IGrinyuk/Downloads/26-13.txt");
ll N; fin >> N;
vector<ll> vec;
for(ll i = 0; i ... | ALGO | 0.999911 | 3.585245 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-02-28T16:40: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": "7339a4ea43f... |
f70e0766-3ad9-4a98-b1da-d0921dd6c077 | eduellery/cses-problemset-cpp | graph/counting_rooms_bfs.cc | #include <iostream>
#include <vector>
#include <utility>
#include <deque>
#include <tuple>
using namespace std;
using ll = int64_t;
using pll = pair<ll,ll>;
// BFS starts traversal from the root node and visits nodes in a level by level manner
// BFS uses Queue to find the shortest path and is better when target is ... | ALGO | 0.999701 | 4.793863 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2020-07-04T16:38: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": "5a9be22bb... |
2138be9a-323b-4848-b09d-eaa2c028c334 | shiquan-wang/LeetCode | Sort/shell_sort.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution{
public:
vector<int> shell_sort(vector<int>& nums){
//先将整个待排序的记录序列分割成为若干子序列分别进行直接插入排序,具体算法描述:(插入排序的高级版)
//1, 将一个数组按照相同间隔h进行分组,每个小数组分别进行插入排序
//2, 将间隔缩小,并继续排序,直至间隔为1
//数学证明当 h = 3 * h + 1时, 希尔排序平均时间复杂度最优
... | ALGO | 0.999883 | 4.368508 | {
"github_metadata": {
"branch": "master",
"commit_count": 211,
"repo_created_at": "2021-05-02T11:17: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": "beb050f6... |
99e5173d-02d0-446d-ae68-843f78da3a6d | VenkyYeluri/advancedalgos | HuffmanCode.cpp | #include <iostream>
#include <queue>
#include <map>
using namespace std;
struct HuffmanNode
{
char data;
int freq;
HuffmanNode *left, *right;
HuffmanNode(char data, int freq)
{
left = right = NULL;
this->data = data;
this->freq = freq;
}
};
struct comparison
{
bool... | ALGO | 0.999996 | 4.474666 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-04-06T03:33: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": "51206f571433... |
ab80ec02-9bd5-4d13-91be-e9a4b574f7b4 | Yejin-Moon/algorithm | C++/Baekjoon/Problem1389.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int graph[101][101];
int inf = 987654321;
int main() {
int N, M;
cin >> N >> M;
fill_n(graph[0], 101 * 101, inf);
for (int i = 0; i < M; i++) {
int a, b;
cin >> a >> b;
graph[a][b] = 1;
graph[b][a] = 1;
... | ALGO | 0.999957 | 3.353418 | {
"github_metadata": {
"branch": "master",
"commit_count": 976,
"repo_created_at": "2021-12-10T15:22: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": "f7f83274... |
3e97ad89-b920-45a7-bd0d-29bae1f3da58 | tempure/algorithm-advance | category/数据结构/树状数组/acwing_243.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
typedef vector<int> vi;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
mt19937 mrand(random_device{}());
const ll mod = 1000000007;
int rnd(int x) {... | ALGO | 0.999226 | 4.143592 | {
"github_metadata": {
"branch": "master",
"commit_count": 1297,
"repo_created_at": "2020-11-16T08:58:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ef7663... |
207e1fcb-95ac-4061-b1bc-69f39a2cae1e | MooneyX/GymReservation | GymRes.h | #pragma once
#include "User.h"
#include "Court.h"
#include "TimeSeg.h"
#define ll long long
#define BASE (137)
#define MOD1 (998244353)
#define MOD2 (1000000007)
using namespace std;
class GymRes {
private:
int userNum;//用户数量
map<int, pair<ll, ll> > idToPassword;//id到密码哈希的映射
map<int, pair<ll, ll> > idTo... | TOOL | 0.959839 | 3.474175 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-12-19T06:43: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": "ed689cf5917... |
426daf88-458b-40bd-8e99-491fa314a0e7 | walkccc/LeetCode | solutions/3048. Earliest Second to Mark Indices I/3048.cpp | class Solution {
public:
int earliestSecondToMarkIndices(vector<int>& nums,
vector<int>& changeIndices) {
int l = 0;
int r = changeIndices.size() + 1;
while (l < r) {
const int m = (l + r) / 2;
if (canMark(nums, changeIndices, m))
r = m;
else
... | ALGO | 0.999978 | 6.588969 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2019-02-23T15:46:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1254,
"forks": 437,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "822ef26... |
c46f2e98-b2f5-4cca-8e0d-7f020cbf6aef | switchpiggy/Competitive_Programming | CodeForces/1400-1600/beautifulGraph.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = int(3e5) + 999;
const int MOD = 998244353;
int n, m;
vector <int> g[N];
int p2[N];
int cnt[2];
int col[N];
bool bad;
void dfs(int v, int c){
col[v] = c;
++cnt[c];
for(auto to : g[v]){
if(col[to] == -1) dfs(to, 1 - c);
if((col[v] ^ col[to]) == 0)
... | ALGO | 0.999965 | 4.608379 | {
"github_metadata": {
"branch": "master",
"commit_count": 164,
"repo_created_at": "2020-08-27T23:38:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4cb2d862... |
ac6e12b5-f198-4237-b032-975814195c57 | SHADOW13325/new-projext | ideone_GT65iZ.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define Mod 1000000007
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
void axis (string &str, int size) {
int i = 0, x = 0, y = 0;
while (i < size) {
if (str[i] == 'L' || str[i] == 'R') {
if (str[i] == 'L')
... | ALGO | 0.999946 | 3.673911 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-04-07T15: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": "3e887d121b... |
41ab7c97-57f5-40da-a6b4-823159adb5f8 | SNUCSE-CTA/DiversityComputationTool | include/graph.h | /**
* @file graph.h
*
*/
#ifndef GRAPH_H_
#define GRAPH_H_
#include "common.h"
class Graph {
public:
explicit Graph(const std::string& filename, bool is_query = false);
~Graph();
inline int32_t GetGraphID() const;
inline size_t GetNumVertices() const;
inline size_t GetNumEdges() const;
inline size_... | ALGO | 0.901576 | 6.424628 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-11-07T08:50:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7fbc1b3788fe... |
926bb5ff-b476-4a3e-8fc7-577196a4c88a | ibudiselic/contest-problem-solutions | tc 160+/PaperRacing.cpp | #include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
#include <queue>
using namespace std;
struct State {
int i, j, vi, vj;
State(int i_, int j_, int vi_, int vj_): i(i_), j(j_), vi(vi_), vj(vj_) {}
};
bool done[52][5... | ALGO | 0.999598 | 4.580722 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2011-08-14T11:43:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02520f4d1... |
8fbc0f7f-7b63-43ba-9dc6-c5ecde68ac33 | Apress/beginning-cpp20 | Exercises/Modules/Chapter 20/Soln20_05/Soln20_05.cpp | // Exercise 20-5 Create a generic average() algorithm using std::accumulate()
import <iostream>;
import <numeric>;
import <utility>; // for std::pair<> (only required for Solution 2 below)
import <optional>;
import <vector>;
// Solution 1: simply use accumulate to sum, and determine the count using std::distance()... | ALGO | 0.999843 | 7.337225 | {
"github_metadata": {
"branch": "main",
"commit_count": 240,
"repo_created_at": "2020-10-02T13:57:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 171,
"forks": 74,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "a7a54039... |
51367951-6772-4667-a9fa-a35197c89eb9 | AyanYadav24/Leetcode_Daily_Problems | 905-length-of-longest-fibonacci-subsequence/length-of-longest-fibonacci-subsequence.cpp | class Solution {
public:
int ans = 0;
int lenLongestFibSubseq(vector<int>& arr) {
int n = arr.size();
unordered_map<int, int> index;
for (int i = 0; i < n; i++) {
index[arr[i]] = i;
}
unordered_map<int, unordered_map<int, int>> dp;
int curr =... | ALGO | 0.999955 | 5.523483 | {
"github_metadata": {
"branch": "main",
"commit_count": 1162,
"repo_created_at": "2024-10-21T14:13: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": "7ee5e7e56... |
9ffe0cba-1cf3-42a9-b871-d51e73548eae | Ashwin-Dotwal/DSA-ALL-TOPIC | linkedlist/reverselinkedlist.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *prev;
Node *next;
Node()
{
this->data = 0;
this->prev = NULL;
this->next = NULL;
}
Node(int data)
{
this->data =... | ALGO | 0.999819 | 4.865239 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2025-01-23T18:35: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": "e7832d3123c... |
fd9b1a3c-6aec-4ff4-ab33-64b15116f512 | ThLentzas/leetcode | 2970/main.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
* 2970. Count the Number of Incremovable Subarrays I
*
* You are given a 0-indexed array of positive integers nums.
A subarray of nums is called incremovable if nums becomes strictly increasing on removing the subarray. For example,
the subar... | ALGO | 0.999891 | 6.021956 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-05-11T23:34:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef19402bfd... |
0a19f345-0fdc-4642-9ea2-38b169819541 | GoingMyWay/LeetCode | 1554-minimum-time-to-collect-all-apples-in-a-tree/solution.cpp | class Solution {
public:
int res = 0;
int minTime(int n, vector<vector<int>>& edges, vector<bool>& hasApple) {
vector<vector<int>> adj(n);
vector<bool> beConnected(n, false);
for (int i = 0; i < edges.size(); i ++) {
// process the case like this: {(0, 2), (0, 3), (1, 2)}
... | ALGO | 0.999907 | 5.143169 | {
"github_metadata": {
"branch": "master",
"commit_count": 490,
"repo_created_at": "2018-01-06T08:18:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d519377e... |
e53d4233-2328-4c82-bb0f-a01a04ceee4a | tzupengwang/PECaveros | contest/NEERC/Subregional/Northern/2013/l.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 101010
typedef double type;
typedef pair<int,int> PII;
typedef pair<type,type> Pt;
typedef pair<Pt,Pt> Line;
typedef pair<Pt,type> Circle;
#define X first
#define Y second
#define O first
#define R second
Pt operator+( const Pt& p1 , const Pt& p2 ){
return { p1.... | ALGO | 0.996545 | 3.747437 | {
"github_metadata": {
"branch": "master",
"commit_count": 448,
"repo_created_at": "2014-08-20T16:02:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 51,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f62fd2e... |
09a69fd8-4f32-44fb-b066-192139612c52 | forever97/ACM-Template-by-forever97 | Data-Structure/Splay(Sequence).cpp | /*
Splay维护数列
*/
namespace Splay {
int a[N]; //原数列
int val[N], mn[N], tag[N], size[N], son[N][2], f[N], tot, root;
bool rev[N];
int build(int, int, int);
void Initialize(int n) {
tot = 0;
root = build(0, n + 1, 0);
}
void rev1(int x) {
if (!x) return;
swap(son[x][0], son[x][1]);
rev[x] ^= 1;
}
v... | ALGO | 0.999944 | 3.880089 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-08-14T07:57:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4c22bfb4... |
538bcf1d-bab8-4849-bae6-5ea2898b38e7 | ayetza/algortimos-avanzados | A01709011-A01656047_Act1.1/mergesort.h | #ifndef _MERGESORT_H
#define _MERGESORT_H
#include <vector>
// Complejidad O(n)
// Funcion para fusionar dos mitades ordenadas
void merge(std::vector<double> &arr, int low, int mid, int high)
{
int n1 = mid - low + 1;
int n2 = high - mid;
std::vector<double> L(n1), R(n2);
// Copiar datos a los arregl... | ALGO | 0.9999 | 5.775146 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2025-02-19T16:42:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43ca1fc1a2b... |
75bae811-de7f-485e-a13a-6bd5b5634470 | ggslc/bisicles-uob | examples/MISMIP3D/unicycle.cpp | #include <valarray>
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#include <assert.h>
using namespace std;
//#include "ArrayTools.hh"
#define RHO 900.0
#define RHOW 1000.0
#define GRAVITY 9.8
#define EPS 1.0e-9
#define NLAYER 11
bool gm_stop;
//#define EXPLICITMETH
//#define PERTMETH... | ALGO | 0.999391 | 3.196374 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2023-08-14T11:59:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "54f4bc57... |
f906eac9-3ea8-419d-9427-7ffe65d88a9e | alexandraback/datacollection | solutions_5630113748090880_1/C++/struss/source2.cpp | #include<iostream>
#include<algorithm>
using namespace std;
typedef struct a {
int* vals;
};
int main() {
int cnt;
cin >> cnt;
for (int itr = 0; itr < cnt; itr++)
{
cout << "Case #" << itr + 1 << ": ";
int num;
cin >> num;
a* input = new a[num * 2 - 1];
int max = 0;
for (int i = 0; i < num*2-1; i++)
... | ALGO | 0.999949 | 3.656193 | {
"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": "5918a06b2... |
b8a17ac5-16d2-46b4-96f6-c1c80851e2a7 | WoodenNebula/lab_assignment | src/C++/13template.cpp | #include <iostream>
#include <vector>
#include <algorithm>
template <typename T>
void Sort(std::vector<T>& arr) {
std::sort(arr.begin(), arr.end());
}
template<typename T>
void Print(const std::vector<T>& arr) {
for (auto x : arr) {
std::cout << x << ", ";
}
std::cout << std::endl;
}
int main... | ALGO | 0.999386 | 5.570236 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2024-01-01T15:29: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": "a6682b56... |
df65c6ad-9640-4ae9-b15f-8e6ce76c0698 | tullisar/EASy68K-Mac | Sim68K/mac68kutils.cpp | /***************************** 68000 SIMULATOR ****************************
File Name: mac68kutils.cpp
Version: 1.0 (Mac OS X)
This file contains various routines used in the Mac OS X port of EASy68K
The routines are :
memDistance
Created: 2011-03-17
<NAME>
*******************************... | TOOL | 0.967368 | 6.148205 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2011-01-09T22:16:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "100da3bf... |
8e07cbb2-4ae7-4e68-813f-31a579a137ed | meruneru/leetcode_workspace | 560.subarray-sum-equals-k.cpp | /*
* @lc app=leetcode id=560 lang=cpp
*
* [560] Subarray Sum Equals K
*/
// @lc code=start
class Solution {
public:
//int subarraySum(vector<int>& nums, int k) {
// //O(n^2)
// vector<int> cursum(nums.size()+1, 0);
// for(int i=0; i<nums.size(); i++){
// cursum[i+1] = cursum[i]... | ALGO | 0.999804 | 6.544903 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-05-04T23:02: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": "64ea407a804b... |
91d89eed-3d27-4dfe-bca3-22610c297628 | CheweyZ/Vic-avc | Pics/read_edit.cpp | /*Program for tuning line detection ENGR101*/
/* <NAME>, April 2018*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#define CAMERA_WIDTH 320 //Control Resolution from Camera
#define CAMERA_HEIGHT 240 //Control Resolution from Camera
unsigned char pixels_buf[CAMERA_WIDTH*CAMERA_HEIGHT*4];
int midCameraBl... | ALGO | 0.992861 | 3.664606 | {
"github_metadata": {
"branch": "master",
"commit_count": 189,
"repo_created_at": "2018-05-03T01:25:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0badfa28... |
81a139d3-7a4f-4f3a-bf20-fdb076ffb62e | CherryGS/ACM | _cf/contest/1430/d.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
using namespace std;
#define ll long long
#define ull unsigned long long
#define cint const int&
#define Pi acos(-1)
int t, n;
string a;
int num[200010], cnt;
int main() {
ios::sync_with_stdio(false);
cin >> t;
... | ALGO | 0.99998 | 3.405506 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2021-10-29T11:11: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": "98a562621... |
4b07ffd0-d654-4706-ab34-90a926d96243 | ricardo0129/KattisSolutions | geometry/biggest.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define f first
#define s second
#define FOR(i,n) for(int i=0;i<n;i++)
bool used[360][60][60];
int c1,c2,c3;
void cut(int a, int b, in... | ALGO | 0.999625 | 3.941596 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2022-04-05T17:33:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f455b4c2ea... |
33c90e6f-e9b1-40a2-af8b-416602776d2b | arvinder-nitj/DSA | BitMasking/Incredeble Hulk.cpp | /*
The Planet Earth is under a threat from the aliens of the outer space and the Marvel Avengers team is busy fighting against them. Meanwhile, The Incredible Hulk has to defeat an enemy who is N steps above the level where he is standing (assume it as the 0th level). Hulk, because of his incredible jumping ability c... | ALGO | 0.999868 | 5.399246 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-03-15T16:56:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e98761aa6... |
cb3a7007-ecd3-4f9a-b43b-8a48abf6c3a5 | lukealpha/Trainer | 查漏补缺/LCAtemp.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
using namespace std;
const int maxn = 500010;
vector<int> e[maxn];
int f[maxn][25], dep[maxn];
void add_edge(int x, int y){
e[x].push_back(y);
e[y].push_back(x);
return ;
}
void init(int u, int fat){
dep[u] ... | ALGO | 0.999983 | 3.80822 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2021-12-18T11:36: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": "9fc8d31d4... |
77a753f9-d05b-412c-8b9a-1305a5b2037b | Kakuoo/Learn-Algorithm | leetcode/C++/leetcode_zh/11.盛最多水的容器.cpp | /*
* @lc app=leetcode.cn id=11 lang=cpp
*
* [11] 盛最多水的容器
*/
// @lc code=start
#include <vector>
#include <cassert>
using namespace std;
// runtime 16 ms 79.85%
class Solution
{
public:
int maxArea(vector<int> &height)
{
int res = 0;
int left = 0;
int right = height.size() - 1;
... | ALGO | 0.999958 | 6.894573 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-04-01T04:19: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": "a5be3a7e2d34... |
04fd9158-05b2-4941-8ad5-fd3d895fb4bf | ExCALIBUR-NEPTUNE/NESO-Particles | include/neso_particles/communication/communication_utility.hpp | #ifndef _NESO_PARTICLES_COMMUNICATION_UTILITY_HPP
#define _NESO_PARTICLES_COMMUNICATION_UTILITY_HPP
#include "communication_typedefs.hpp"
#include <vector>
namespace NESO::Particles {
/**
* MPI_Gatherv for std::vector. Collective on the communicator.
*
* @param[in] input_vector Vector to send to root rank.
* @pa... | TOOL | 0.921329 | 6.592044 | {
"github_metadata": {
"branch": "main",
"commit_count": 740,
"repo_created_at": "2022-06-13T14:16:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 4,
"pull_requests": 1
},
"file_meta": {
"content_id": "42ebe6608f5... |
01d9a22b-b7ee-446a-9ef4-88bd8907334e | KatLab-MiyazakiUniv/learn-github-2022 | muto/Directions.cpp | #include <stdio.h>
#include <cmath>
enum class Direction { N, NE, E, SE, S, SW, W, NW };
struct Coordinate {
int x;
int y;
};
Direction calcNextDirection(Coordinate& current, Coordinate& next)
{
Direction nextDir;
if(next.x - current.x > 0) {
if(next.y - current.y > 0) {
nextDir = Direction::SE;
... | ALGO | 0.999883 | 5.25526 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-05-18T11:15:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 6,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "f8c037952bc1... |
d4d22712-06a3-47a9-a27d-e54d81d16702 | ultimatepp/ultimatepp | uppsrc/ide/Core/Host.cpp | #include "Core.h"
#include <plugin/bz2/bz2.h>
#define LLOG(x)
#define METHOD_NAME "Host::" << UPP_FUNCTION_NAME << "(): "
#ifdef FLATPAK
const String Host::CMDLINE_PREFIX = "host-spawn --no-pty ";
#else
const String Host::CMDLINE_PREFIX = "";
#endif
String Host::GetEnvironment()
{
return environment;
}
void Host:... | TOOL | 0.926297 | 4.812243 | {
"github_metadata": {
"branch": "master",
"commit_count": 15736,
"repo_created_at": "2015-10-05T13:02:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 906,
"forks": 131,
"issues": 24,
"pull_requests": 12
},
"file_meta": {
"content_id": "c... |
e8d7eaf7-efc2-454c-ad90-3b1979d57127 | yugal82/DSA | Dynamic Programming/Leetcode/20-CoinChange.cpp | // You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.
// Return the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1. You may assum... | ALGO | 0.999963 | 5.294818 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2023-04-20T18:26:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbd59f4c0... |
6e9116e0-3103-48c3-a2ed-527b64a02d97 | dipal/gene_expr | gene_expr.cpp | #include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <map>
#include <set>
#include <sstream>
#include <algorithm>
#include "graphinputdata.h"
#include "attributedata.h"
#include "graphhelper.h"
#include "calculator.h"
#include "timer.h"
using namespace std;
int main(int argc, char **ar... | DATA | 0.992293 | 3.948151 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2015-01-18T16:54:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c06ae3b20... |
4aea4cff-f1d3-4ef1-b7d4-f59243bebf3a | trustanprice/Intermediate-Data-Structures | mp_puzzle/src/puzzle.cpp | /**
* @file puzzle.cpp
* Implementation of puzzle class.
*/
#include "puzzle.h"
PuzzleState::PuzzleState() {
for (int i = 0; i < 15; ++i) {
puzzle_[i] = static_cast<char>(i + 1);
}
puzzle_[15] = 0;
zeroIdx_ = 15;
}
PuzzleState::PuzzleState(const std::array<char, 16> state) : puzzle_(state)... | ALGO | 0.999426 | 6.820399 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2025-06-03T13:50: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": "5908e5aa05c... |
325e2872-2a90-43a3-817e-c96c46d6f5fb | Hiyabye/Baekjoon | 11xxx/11453.cpp | #include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
inline int calc(char c) {
return (1 << 0) * (c == 'b') +
(1 << 1) * (c == 'g') +
(1 << 2) * (c == 'r') +
(1 << 3) * (c == 'y');
}
bool solve(void) {
int m; cin >> m;
unordered_map<int, int> mp;
whil... | ALGO | 0.999534 | 4.333105 | {
"github_metadata": {
"branch": "main",
"commit_count": 5062,
"repo_created_at": "2023-12-31T18:40:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5929b43a... |
76195760-ad1f-4524-9250-da64099bb814 | AkashB005/AKASH | essay 24.cpp | #include <stdio.h>
#include <string.h>
int main() {
char str1[100], str2[100];
int freq1[26] = {0}, freq2[26] = {0};
int i, len1, len2, flag = 1;
printf("Enter the first string: ");
gets(str1);
printf("Enter the second string: ");
gets(str2);
len1 = strlen(str1);
len2 = st... | ALGO | 0.999988 | 4.607279 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-01-30T05:50:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20456e5503a... |
12929888-a798-4d32-a0da-c5bb69e365ac | tehnick/tehnick-yac | Backend-2022/Qualification-E.cpp | #include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define DEBUG_MODE 0
using namespace std;
struct FileInfo {
string absolute_file_path;
string dir;
string ext;
bool valid = true;
};
unordered_set<string> g_black_list;
vector<FileInfo> g_files;... | TOOL | 0.97392 | 4.2849 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2021-10-06T19:31: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": "fb134be734... |
f9decd33-f894-48f3-af77-489a9da4c4d0 | coiti4/leetcode-challenges | linked_lists/mergeSortedLists.cpp | /**
* @file mergeSortedLists.cpp
* @brief Merges two sorted linked lists into one sorted list.
*
* This file contains a solution to merge two sorted linked lists by
* splicing together their nodes.
*
* ## Problem Statement:
* Given the heads of two sorted linked lists, merge them into one sorted list.
* The li... | ALGO | 0.999963 | 6.842498 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-02-03T19:29:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c11069ca3c... |
20e6548c-9fec-4d29-a6fd-e1db0e195337 | ishandutta2007/codeforces-r | rickytheta/normal/591/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
#define DEBUG(x) cout<<#x<<": "<<x... | ALGO | 0.999596 | 4.177253 | {
"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": "c36c310518de... |
bee68449-b535-4e70-a709-71e1491a540a | ishandutta2007/codeforces-a | abc864197532/normal/1437/E.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
#define lli long long int
#define fop(i,m,n) for (int i=(m);i<(n);i++)
#define FOP(i,m,n) for (int i=(m)-1;i>=(n);--i)
#define test(x) cout << #x << ' ' << x << endl;
#define printv(a) {\
for ... | ALGO | 0.999863 | 3.741764 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "4a42a5cff13d... |
e889df3a-f456-4f52-85e2-d96b4328d8e6 | Pseudophoenix/DSA | Graph/CycleDetection.cpp | // Firstly consider are there any differences between cycle detection in directed VS undirected graphs??
// Approach: DFS can detect cycle in a graph but how?
// DFS of a connected graph produces a tree.
// There is a cycle in a graph only if there is a back edge present in the graph.
// A back edge is an edge that is... | ALGO | 0.999915 | 5.627745 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2025-06-28T15:32:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "099c4d889a5... |
ffab4bb5-7f03-472f-9cde-5b95e618118f | turtlerace97/problem_solving | boj/03/1700.cpp | /*
* Time :
* Subject : greedy
*
* Coded by soonyubing
*/
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
// INT_MAX INT_MIN LLONG_MAX LLONG_MIN
using namespace std;
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
void solve()
{... | ALGO | 0.999983 | 3.676615 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2023-01-04T07:02: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": "01cacd059... |
086ea73d-c7f2-4a29-b7f3-5f8a57097edb | prakharr5/ACMBMU_Hacktoberfest | quickSort.cpp | #include <iostream>
using namespace std;
int partition(int M[], int start, int end){
int pivot = M[start];
int i = start + 1;
int j = end;
while (i <= j){
if (M[i] <= pivot){
i++;
}
else if (M[j] > pivot){
j--;
}
else{
swap(M[i... | ALGO | 0.999995 | 5.935409 | {
"github_metadata": {
"branch": "main",
"commit_count": 358,
"repo_created_at": "2023-10-10T09:05:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 66,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "96b22a1a8... |
3101083f-9ed9-4892-a6b7-a7b23d7c1dd3 | siddharth12s/Cpp | Algo-Sprint/Geometry/BSHEEP.cpp | #include <bits/stdc++.h>
using namespace std;
struct Point
{
int x, y;
bool operator==(Point const &t) const
{
return x == t.x && y == t.y;
}
};
struct point_hash
{
// template<class T1, class t2>
std::size_t operator()(const struct Point &t) const
{
using std::hash;
... | ALGO | 0.999984 | 5.209536 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-20T20:06: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": "3484ab255eb8... |
22bc23d1-c781-45f3-b20c-e81949382ea0 | WhiZTiM/coliru | Archive2/9d/0166267200d0ab/main.cpp | #include <tuple>
#include <iostream>
#include <functional>
namespace helper
{
template <std::size_t... Ts>
struct index {};
template <std::size_t N, std::size_t... Ts>
struct gen_seq : gen_seq<N - 1, N - 1, Ts...> {};
template <std::size_t... Ts>
struct gen_seq<0, Ts...> : index<Ts...... | ALGO | 0.923933 | 6.13865 | {
"github_metadata": {
"branch": "master",
"commit_count": 42630,
"repo_created_at": "2016-04-21T16:34:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8883eb... |
29de5a07-f7f7-45d9-a504-bc4d187cef09 | aliakseibrown/leetcode | cpp/Medium/8_string_to_integer_atoi.cpp | class Solution {
public:
int myAtoi(string s) {
int answer = 0;
string nums;
string temp;
string max = "2147483647";
int min = 1;
int key = 0;
int size;
int valid = 0;
for(auto a:s){
if(a == 32 && temp.length()==0 ) continu... | ALGO | 0.998288 | 4.625958 | {
"github_metadata": {
"branch": "main",
"commit_count": 267,
"repo_created_at": "2022-10-22T21:10:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ec51bd30b... |
7b00276f-4cd8-4e50-a833-15b70d3b5ba1 | Neyen108/compe-coding-snippets | Greedy/kingdomDefense.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
//dimensions of board
int board_x, board_y;
cin >> board_x >> board_y;
int towers;
cin >> towers;
//positions of towers
int x[towers], y[towers];
... | ALGO | 0.999913 | 3.721846 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2020-12-30T22:29: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": "7aad9c03c74... |
779ad169-e49f-467c-b898-3a5dea15b223 | akhikolla/testpackages | fuzzedpackages/Rlinsolve/src/krylov_cgs.cpp | #define ARMA_DONT_PRINT_ERRORS
#include "RcppArmadillo.h"
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
using namespace arma;
//------------------------------------------------------------------------------
// Krylov Iterative Solver 4-1. Conjugate Gradient Squared
//--------------------------------------... | ALGO | 0.999949 | 5.598544 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-15T17:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "818962dc20... |
097dd1f7-00db-49c0-87b2-bcc83f89745c | Hicham-ATMANI/ExtrapolationStudy | Relpack/RootCoreBin/include/fastjet/contrib/DistanceMeasure.hh | #ifndef __DISTANCEMEASURE_HH__
#define __DISTANCEMEASURE_HH__
#include <float.h>
#include <algorithm>
#include "fastjet/PseudoJet.hh"
FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
namespace contrib {
namespace QCDAwarePlugin {
/**
* the DistanceMeasure abstract base class ... | ALGO | 0.993143 | 6.355147 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-06-25T14:42: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": "ca591d9a54... |
455113c5-0137-407c-b156-d3af1204f3e5 | rogsoares/twophasesim_repo | src/simulator/EBFV1_Elliptic_main.cpp | #include "EBFV1_elliptic.h"
//#include "calculate_results_Benchmark3D.h"
double cpu_time;
namespace PRS{
EBFV1_elliptic::EBFV1_elliptic(){
pMAS =0;
Perform_Assembling = true;
pDStruct = new Data_struct;
}
EBFV1_elliptic::~EBFV1_elliptic(){
}
// solves system of equation for pressure field
double EBFV1_elliptic:... | ALGO | 0.999738 | 3.563754 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-17T13:44: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": "8c060e921b... |
3a533a45-cdfa-4837-b434-7cc62ae4e8bb | duchangtuan/Basic_Algorithm | algorithm/cpp/linklist/src/main.cpp | #include<iostream>
#include<vector>
#include"../include/list.h"
using namespace std;
void test_merge(){
LinkList link1, link2;
int arr1[] = {1, 3, 5, 7, 9};
int arr2[] = {2, 4, 6, 8, 10};
vector<int> ivec1(arr1, arr1+5);
ListNode *p1 = link1.createListNode(ivec1);
vector<int> ivec2(arr2, arr... | ALGO | 0.99306 | 4.563335 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2016-06-25T09:35:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9eb840861... |
2744fc76-d45a-4081-9c2d-795bf4883abe | Bocity/ACM | 17-04-19/K.cpp |
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
long long MOD = 1000000007;
ll x, y, a[1005], b[1005], f[1005][1005], sum[1005][1005], ans;
int main() {
while (cin >> x >> y) {
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
memset(sum, 0, sizeof(sum));
... | ALGO | 0.999987 | 4.119253 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2016-12-10T13:53: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": "5f515fc4c... |
4f398c40-af9a-440e-beb0-cd02e5236fe9 | whitewolf-debugger/practice | 0029-divide-two-integers/0029-divide-two-integers.cpp | class Solution {
public:
int HALF_INT_MIN = -1073741824;
int divide(int dividend, int divisor) {
// Special case: overflow.
if (dividend == INT_MIN && divisor == -1) {
return INT_MAX;
}
/* We need to convert both numbers to negatives.
* Also, we count the ... | ALGO | 0.999969 | 6.173539 | {
"github_metadata": {
"branch": "main",
"commit_count": 2760,
"repo_created_at": "2022-03-13T06:08:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af1252e79... |
a9524c62-9e61-4875-8c50-620d1247e056 | xp-squared/CSC-1100 | Labs/Lab 8/Lab 8-2 Swap.cpp | /******************************************************************************
<NAME> Lab 8-2
Description:
Write a program to swap the 1st integer element of an array with the last.
Program takes in user input to populate array
*******************************************************************************/
#includ... | ALGO | 0.970176 | 4.586989 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-04-03T15:57: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": "c3bd9bf78061... |
1c92ae0c-4ff1-4a2a-8a33-0510d6e62529 | TanvirDeol/Competitive-Programming | Hackerrank Codeforces Codechef/CF Div 2 C Lucky Sum of Digits.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, double> pi;
int main() {
int N; cin >> N;
string a,b,c;
bool t = 0;
int A=N, B=N, C = N;
if (A % 7 == 0) {
while (A > 0) {
a += "7"; A -= 7;
}
t = 1;
}
if (B % 4 == 0) {
while (B > 0) {
b += "4"; B -= 4;
}
... | ALGO | 0.99978 | 3.559042 | {
"github_metadata": {
"branch": "master",
"commit_count": 175,
"repo_created_at": "2020-03-03T23:00: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": "b6daf986... |
16d4cb59-3be4-4b6d-aeac-8574df72dc45 | uroboroskitalinsky/laba6 | VVP_6/main.cpp | //
// main.cpp
// VVP_6
//
// Created by <NAME> on 08.12.2021.
//
#include <iostream>
#include <cmath>
using namespace std;
/*int main()
{
int a,b;
cout << "A" << " ";
cin >> a;
cout << "B" << " ";
cin >> b;
swap(a,b);
cout << "A" << " " << a << "\n" << "B" << " " << b << endl ;
re... | ALGO | 0.999808 | 3.901685 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-01-06T20:46: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": "d90183c7951e... |
b700b38d-6eb1-4576-a855-5645ea5e5e85 | MaximStanchik/Semester_5 | Subjects/Operating systems/Laboratory works/LBR_06/Solution/Old/Explanation/OS06_02.cpp | #include <iostream>
#include <thread>
#include <windows.h>
// <NAME>
using namespace std;
CRITICAL_SECTION criticalSection; // объявление переменной критической секции
DWORD WINAPI threadFunction(LPVOID lpParam) { // функция, которую будет выполнять каждый поток. функция принимает указатель на данные потока
str... | ALGO | 0.989412 | 4.378784 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-10-27T20: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": "883a0b268fc... |
6d78a9a5-7309-44c8-b053-dfed24cc2975 | singhsanket143/CppCompetitiveRepository | UnacademyCourse/AdvanceCPP/Lecture14/algorithms_demo.cpp | // Problem Link -
/* By <NAME> */
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long int
#define ld long double
#define mod 1000000007
#... | ALGO | 0.999981 | 5.131335 | {
"github_metadata": {
"branch": "master",
"commit_count": 304,
"repo_created_at": "2018-06-26T07:06:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 348,
"forks": 160,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "e4d8... |
c939cc5d-5e68-474b-80c4-9d4e7b995fd8 | adnanm20/URA23 | adnan_maleskic_zadaca3/zadatak1/main.cpp | #include <iostream>
int rekurzivno(int n) {
if(n == 0) return 2;
if(n == 1) return 4;
if(n == 2) return 12;
return 3*rekurzivno(n-3) + 2*rekurzivno(n-2) + rekurzivno(n-1);
}
int memoizacijom(int n) {
static int lookup[100] = {2, 4, 12};
if(lookup[n] == 0)
lookup[n] = 3*memoizacijom(n-3) + 2*memoizaci... | ALGO | 0.999979 | 4.446537 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-05-18T07:06:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fdded88c1ee... |
3338b5d3-d505-4277-800c-545a751b19ae | sxs-collaboration/spectre | src/NumericalAlgorithms/Interpolation/InterpolationWeights.cpp | // Distributed under the MIT License.
// See LICENSE.txt for details.
#include "NumericalAlgorithms/Interpolation/InterpolationWeights.hpp"
#include <cmath>
#include <cstddef>
#include "DataStructures/DataVector.hpp"
#include "DataStructures/Matrix.hpp"
#include "Utilities/ContainerHelpers.hpp"
#include "Utilities/G... | ALGO | 0.998675 | 6.708765 | {
"github_metadata": {
"branch": "develop",
"commit_count": 17103,
"repo_created_at": "2017-04-07T17:28:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 168,
"forks": 202,
"issues": 530,
"pull_requests": 57
},
"file_meta": {
"content_id": ... |
f37aa162-0e01-4a09-99ed-75e9be3677b2 | chinmey/practice | array/sliding window.cpp | /*1. find sum of all subarray with size k*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int arr[6]={1,2,3,4,5,6};
int k=3;
int i,j=0,sum=0;
for(i=0;i<k;i++)
{
sum=sum+arr[i];
}
cout<<sum;
for(i=k;i<6;i++)
{
sum=sum+arr[i]-arr[j];
j++;
... | ALGO | 0.99939 | 3.84515 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-07-09T14:06:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22736bd80e... |
2de05206-1970-4a69-9476-b0d35eebb3bd | FilterDonkey/Project-Euler-1-100-CPP | Problem 5/Problem 5.cpp | // 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
// What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20 ?
using namespace std;
#include <iostream>
#include <boost/cstdint.hpp>
int main()
{
bool found = false... | ALGO | 0.99973 | 5.3735 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-11-24T07:41: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": "d9563dccf6... |
d6dba6da-598a-48d0-89e5-c71b120db226 | subrainion/- | lab5/FileProcessor.cpp | #include "FileProcessor.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <cmath>
using namespace std;
void FileProcessor::fillFileWithRandomData(const string& filename, int count) {
ofstream outFile(filename, ios::binary);
if (!outFile) {
cerr <<... | DATA | 0.961083 | 4.44766 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-10-03T07:43:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc1e28a67ca... |
e8915c27-d1b2-4ab3-bae3-ef1278ccb9bd | buptjz/AlgoPrac | LeetCode/Others/RomantoInteger.cpp | //
// RomantoInteger.cpp
// Algorithms
//
// Created by WangJZ on 14-3-31.
// Copyright (c) 2014年 WangJZ. All rights reserved.
// http://oj.leetcode.com/problems/roman-to-integer/
#include "leetcode_others.h"
//I(1),V(5),X(10),L(50),C(100),D(500),M(1000)
//备注:leetcode上的这道题没有检测输入是否是正确的!
int getIntFromRoman(char ... | ALGO | 0.997005 | 3.851238 | {
"github_metadata": {
"branch": "master",
"commit_count": 335,
"repo_created_at": "2013-08-25T07:25:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "973d31ec... |
1f3549f5-bf6e-4090-b781-7358ec7efdde | ishandutta2007/codeforces-e | errichto/normal/744/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
s... | ALGO | 0.999912 | 3.128323 | {
"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": "f2411441df30... |
4c656873-1b5d-48f5-a113-c59699989787 | Andrew-Velox/ProblemSolving | codeforces/1285/C.cpp | #include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef velox
#include "debug.h"
#else
#define debug(x...)
#endif
#define ll long long
#define srt(v) sort(v.begin(),v.end())
#define grtsrt(v) sort(v.begin(),v.end(),gr... | ALGO | 0.999761 | 4.654519 | {
"github_metadata": {
"branch": "master",
"commit_count": 261,
"repo_created_at": "2024-02-18T06:16: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": "2b097769... |
fc3226c5-6df1-4716-9025-0b85cf7d0ed3 | DOCUTEE/Docute_2022_2023_Competitive_Programing | KTLT/chuong03/bai10chuong3.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
void fast(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
}
void import(int &n, vector<int> &v, int &k){
cin >> n;
v.resize(n);
for(int &x: v) cin >> x;
cin >> k;
}
int group(char a){
if (a >= 'a'... | ALGO | 0.999951 | 3.713095 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-01T17:59: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": "6a8219aff280... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.