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 |
|---|---|---|---|---|---|---|---|
79a9036d-7cb1-4eb7-b101-374c593defbd | hanshantong/robot_gait | src/motion_ctrl/zmp_ctrl_3s_bug.cpp | #include <P1MC.h>
//===================================
//=========Utility functions=========
//===================================
// Sign returns the sign of x (-1, 1 or 0).
int sign(double x){return (x > 0) - (x < 0);}
// Takes a 3xn vector and extracts the first row into a 1xn vector
void extract_pos_of_vector(... | TOOL | 0.951247 | 4.014392 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2017-11-15T07:52:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02ea162d8... |
eb66f1fd-9981-4e28-983f-bf7b92418063 | abhinavgpt1/DSA-cpp | DSA-self/Coding Platforms (Leetcode, GFG)/Remove All Adjacent Duplicates In String(gfg) same as 0.cpp | /*
1047. Remove All Adjacent Duplicates In String
Easy
826
63
Add to List
Share
Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them.
We repeatedly make duplicate removals on S until we no longer can.
Return the final string after all su... | ALGO | 0.999922 | 6.098907 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2023-03-11T17:03: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": "f08746bc4... |
f4217f56-ef59-4b2e-b005-d33b622b329d | rajpmore/SOS | Solar_Orienting_System.ino | #include <Servo.h>
// declaration of objects for servo motors
// horizontal servo
Servo horizontalServo;
int horizontalAngle = 90;
int horizontalLimitHigh = 180;
int horizontalLimitLow = 0;
// vertical servo
Servo verticalServo;
int verticalAngle = 120;
int verticalLimitHigh = 180;
int verticalLimitLow = 60;
// LDR ... | TOOL | 0.981142 | 6.520146 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2023-06-13T19:05:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8c3443ea36... |
cc4d70ae-f337-45e3-9b6a-82227c4b8a11 | izhang05/Competitive-Programming | ICPC/NWERC/2023/i/i.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, from, to) for (int(i) = from; (i) < (to); ++(i))
#define all(x) x.begin(), (x).end()
#define sz(x) (int) (x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template<class T>
int sgn(T x) { return (x > 0) - (x < 0); }
tem... | ALGO | 0.999732 | 4.305054 | {
"github_metadata": {
"branch": "master",
"commit_count": 691,
"repo_created_at": "2021-01-21T17:58:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5fef363... |
1c24a99c-e816-4e7b-996f-ae0ad22d1204 | phytter/mybox | Algoritmos_busca_bfs.cpp | /*Developed by <NAME> */
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
queue<int>fila;
class Grafo{
public:
int cor;
int **mat;
int v;
Grafo(int v);
void add_aresta(int x,int y);
void imprimir()... | ALGO | 0.999195 | 4.014631 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-06-30T18:08: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": "73311ca4a5... |
f0cf4816-fd84-4601-8ed9-9cb1b5dfde5d | littleDing/LDRSFramework | main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <map>
using namespace std;
template <class K,class V>
ostream& operator << (ostream& out,const map<K,V>& m){
//out<<"{"<<endl;
for(typename map<K,V>::const_iterator it=m.begin();it!=m.end();++it){
out<<" "<<it->first<<":"<<it->second<<" ";
}
//out<... | ALGO | 0.997817 | 3.690776 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2012-05-16T12:20:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6dd6697863... |
72c5e86b-0745-45b7-9d77-0e9ef204e9b8 | MingNQ/PracticesLeetCode | 1921.EliminateMaximumMonster.cpp | #include <bits/stdc++.h>
#define imy main()
#define ll long long
using namespace std;
class Solution {
public:
int eliminateMaximum(vector<int>& dist, vector<int>& speed) {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int n = dist.size();
vector<float> arrival;
int res = 0... | ALGO | 0.999948 | 4.533865 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2024-04-02T08:17: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": "49f6a3e9b... |
3462686d-ceab-4c34-a4b1-4322ef5b17f9 | yousuf-cse-bd/RandomCodes | DynamicArrayChallenge.cpp | /**
* @file DynamicArrayChallenge.cpp
* @author <NAME> (<EMAIL>)
* @brief Dynamic array challenge using ponter return from function
* @version 0.1
* @date 2022-12-17
* @since SaturDay; 05:45 PM
* @copyright Copyright (c) 2022
* Dept. of CSE, Varendra University, Rajshahi, Bangladesh
*/
#include <iostream>
usin... | ALGO | 0.998694 | 4.868244 | {
"github_metadata": {
"branch": "master",
"commit_count": 356,
"repo_created_at": "2022-06-19T05:11: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": "3fd0ec78... |
adb7b19a-4a26-4d3f-9d34-d18fc835756b | Alexamakans/advent-of-code-cpp | 2024/src/3.cpp | #include <expected>
#include <format>
#include <iostream>
#include <regex>
#include <sstream>
#include "util.hpp"
using std::cout, std::println;
using std::string;
using std::unexpected, std::expected;
typedef int AnswerType;
auto part_one(const string &input) -> expected<AnswerType, string> {
AnswerType result =... | ALGO | 0.945577 | 5.722937 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-12-05T21:30: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": "48562131e93... |
7bd9791d-a8ba-4320-a2a7-bab2e06776af | CMU-SAFARI/MIMDRAM | llvm-pim-pass/src/PIMVectorizationPass.cpp | #include <array>
#include <list>
#include "llvm/Pass.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/Transf... | TOOL | 0.95517 | 7.550032 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-03-22T09:29:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 24,
"forks": 7,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae8b78727ae3... |
012a148d-d35f-4ee0-8155-8795bb5c211f | useyourfeelings/POJ | 1828/1262785_AC_280MS_636K.cc | #include<iostream>
#include<vector>
#include<algorithm>
#include<limits>
using namespace std;
struct point
{
point(int xx, int yy):x(xx),y(yy){}
int x;
int y;
};
struct xless
{
bool operator ()(const point &a, const point &b)
{
return a.x < b.x;
}
};
int main()
{
int n, x, y, i, c... | ALGO | 0.999766 | 4.046687 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-05-06T02:40: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": "87865b443d... |
7e7951d3-c3bd-4b96-a89c-b340cd4aaac5 | istrandjev/advent-of-code-2019 | 11.cpp | #define _CRT_SECURE_NO_DEPRECATE
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <math.h>
#include <stack>
#include <deque>
#include <numeric>
#include <cstring>
#include <cstdio>
#include <cstdli... | ALGO | 0.999888 | 4.29509 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2023-03-12T05:56: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": "7f6db75a1... |
e4f13c31-bfd9-407c-8270-36da83d45257 | viren-sureja/Love-Babbar-450 | 11_heap/03_maximum_of_all_subarray_of_size_K.cpp | /*
link: https://www.geeksforgeeks.org/sliding-window-maximum-maximum-of-all-subarrays-of-size-k/
note: there are 4 method given in the link
1. naive (using loop for sliding window): TC: O(N * K), SC: O(1)
2. self-balancing BST: TC: O(N * logN), SC: O(K)
3. Deque: TC: O(N), SC: O(K)
4. modifie... | ALGO | 0.999705 | 5.772098 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2021-03-21T14:17:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 356,
"forks": 169,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "5b716... |
fcb15689-8d70-4595-aa45-094da487cb99 | noel-vargas/PracticeDummyCode | AlgorithmsSTL/Equal.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <array>
using namespace std;
bool newPredicate(int m, int n)
{
return m == n;
}
int main()
{
// int newints[] = {20, 40, 60, 80, 100};
// vector<int> newvector(newints, newints... | TEST | 0.991209 | 4.533754 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2020-10-16T01:54:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9358e6f456... |
6c8df18c-3774-4e2f-b5bc-839b32271681 | Potatomastr27/StepTrackingPCB | lib/StepAnalysis/stepAnalysis.cpp | #include "stepAnalysis.h"
#define BUFFER_SIZE 8
int movingAvgBuffer[BUFFER_SIZE];
const int32_t stepAmplitudeThresholdLow = 140;
const int32_t stepAmplitudeThresholdHigh = 320;
const double stepFrequencyWalk = 0.25;
const double stepFrequencyRun = 0.65;
int avg;
double freq;
enum state {
Normal,
StepCandida... | ALGO | 0.99774 | 5.262162 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2024-04-23T14:14:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4eb743d1e73... |
fe111702-ebde-4fa1-b1fa-eeade58fdb32 | YanaiAU/C-Assignment3 | Board.cpp | #include "board.hpp"
#include <iostream>
Board::Board() {
resourceTiles[2] = ResourceType::Wheat;
resourceTiles[3] = ResourceType::Wool;
resourceTiles[4] = ResourceType::Brick;
resourceTiles[5] = ResourceType::Wood;
resourceTiles[6] = ResourceType::Ore;
resourceTiles[8] = ResourceType::Wheat;
... | TOOL | 0.936354 | 5.389545 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-06-17T14:00:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11bf2e1086... |
e20953eb-0dfc-4050-b746-9a7aef04adac | shubhamfuloria/DSA-Master | BinarySearch/26_minimum_absolute_difference_in_a_sorted_array_II.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Things to keep in mind:
1. If we search an element in a sorted array which is not present in the array, then after the while loop
high will be pointing to floor value of target , and low will be pointing to ceil value of target.
2. If we search an element in a sort... | ALGO | 0.999929 | 5.402164 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-10-03T12:55: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": "bbd7256f44d... |
edba8175-105d-4ef7-b8de-37775fe56f5a | comeetie/greed | src/DiagGmm.cpp | // [[Rcpp::depends(RcppArmadillo)]]
#include "gicl_tools.h"
#include "MergeMat.h"
#include "IclModelEmission.h"
#include "DiagGmm.h"
using namespace Rcpp;
DiagGmm::DiagGmm(const arma::mat & Xi,S4 modeli,bool verb){
if(Rcpp::traits::is_nan<REALSXP>(modeli.slot("beta"))|| as<arma::rowvec>(modeli.slot("mu")).has_... | ALGO | 0.903114 | 6.857509 | {
"github_metadata": {
"branch": "master",
"commit_count": 350,
"repo_created_at": "2019-02-27T10:44:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 3,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "6393fa1... |
f16e1b27-8033-422e-9486-be20016ba33d | Arvinth-s/dataStructures | assignment/HeterogenousStack.cpp | //OM <NAME>
#include<bits/stdc++.h>
#define maxSize 10
using namespace std;
char reff[]={"hi"};
struct node{
protected:
char *val;
public:
node* next;
node(char *val){this->val=val;}
virtual void print()
{
cout<<val<<endl;
}
};
struct inode:node{
private:
int val;
... | ALGO | 0.965741 | 3.373075 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-01-19T05:02:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ddd5b01a2... |
68c9d5ad-5579-43d0-9f33-e5b27d0f50a7 | IanOliveira718/Problemas-de-maratonas | Dinâmica/Ginastica.cpp | #include <iostream>
//link do problema https://judge.beecrowd.com/pt/runs/code/40277172
using namespace std;
int n = 1000000007;
int t, T, M, N;
int mat[100002][52];
int SM(int a, int b){
long long int la, lb;
la = a; lb = b;
return (la+lb)%n;
}
long long int bike(void){
int i,j;
long long int r... | ALGO | 0.99999 | 4.058403 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-10-29T00:22: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": "277793934ad... |
454b1208-6312-48bf-ae24-7342c9a2f683 | satyasaibhushan/Advent-of-Code-2024-Cpp-Solutions | 02/sol.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <utility>
#include <map>
#include <sstream>
using namespace std;
int solve(vector<int> A)
{
int n = A.size();
int inc = 1;
if (n == 1 || n == 0)
return 1;
if (A[0] > A[1])
inc = -1;
if (A[0] == A[1])
return ... | ALGO | 0.99983 | 3.895197 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2025-05-08T06:54: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": "a44e497c4a9... |
1ffe7d0e-44ec-4fcd-9c3d-de54f4a71949 | siddharth94/competitive | Spoj/broken_corr.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <math.h>
#include <vector>
#include <string>
#include <stdio.h>
#include <time.h>
#include <sstream>
#include <cstdlib>
#include <string.h>
#include <limits.h>
#include <iostream>
#include <algorithm>
#include <func... | ALGO | 0.999952 | 3.200268 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-09-29T04:19: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": "0838b66c29... |
d2d535ff-9d27-4f30-a141-ec0da15692e3 | byeolbit/Return-to-basic | Algorithm/Algospot/PICNIC/main.cpp | #include <cstdio>
#include <string.h>
using namespace std;
int P[10][10] = {0,};
int n, p;
int matching(int m[10]) {
int a = -1;
int r = 0;
for (int i=0; i<n; i++) {
if(!m[i]) {
a = i;
break;
}
}
if (a == -1) return 1;
for (int i=a+1; i<n; i++) {
... | ALGO | 0.999898 | 3.946759 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2017-12-05T13:08:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d130dc043... |
28a72bcf-3f50-4843-b931-2d8c649701aa | Zhang-Each/pat-and-leetcode | pat/1139.cpp | // 这题测试样例全过了,交上去只有20分,不知道为什么了
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
#define MAX 301
int g[MAX][MAX] = {0};
int node[10000] = {0};
int n, m, k, number = 1;
map<int, int> gender, label;
struct Node {
int x, y;
Node (int a, int b) {
x = a;
y... | ALGO | 0.999987 | 3.835555 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2021-03-14T02:10:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "831068764... |
130a31ec-af24-4779-ad5e-45207d77ae50 | codgician/competitive-programming | ZOJ/3999/math.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <cstring>
#include <iomanip>
#include <climits>
#include <set>
#include <vector>
#include <queue>
#define EQU_SIZE 10
#define NUMERATOR 0
#define DENOMINATOR 1
using namespace std;
long long int equ[2][EQU_SIZE];
lo... | ALGO | 0.999775 | 4.634045 | {
"github_metadata": {
"branch": "master",
"commit_count": 1251,
"repo_created_at": "2017-09-19T02:44:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1de059... |
286e7cab-d9e5-492a-bf54-9cd3c772c5c7 | vocasle/principles_and_practice_using_cpp | part_3_data_and_algorithms/ch_17/problem_14.cpp | // Singly linked list uses less memory, because the node stores only a pointer to the next node, but requires to traverse the list from the beginning if we need to find node in question
// Doubly linked list uses more memory, because the node stores two pointers - to the next node and to previous. Searching is more eff... | ALGO | 0.991499 | 5.858135 | {
"github_metadata": {
"branch": "master",
"commit_count": 241,
"repo_created_at": "2020-03-16T05:54:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "61e14290... |
ad673608-94e7-42f5-9154-e5123c4f1203 | Fr0sen/Code-Resourse | 最小生成树问题-Kruscal.cpp | //#define _CRT_SECURE_NO_WARNINGS 1
//
//#include <iostream>
//#include <cstdio>
//#include <queue>
//
//using namespace std;
//
//const int MAXN = 1000 + 10;
//
//struct Edge {
// int from;
// int to;
// int length;
// bool operator <(const Edge& e) const { //重载小于号,这样才可以排序
// return length < e.length;
// }
//};
//
/... | ALGO | 0.999965 | 3.93376 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-03-18T01:05: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": "842f7b43a0bb... |
cec71d6f-eda8-4480-8f4a-56b70421b0f3 | KingJoySaiy/Makaveli | Data Structure/Sort/CountingSort.h | #ifndef INC_233_COUNTINGSORT_H
#define INC_233_COUNTINGSORT_H
#include <climits>
#include <algorithm>
namespace Counting {
/******** initial definition ********/
const int bucketNum = 10, baseNum = 10; //define buckets & base
template<class T>
struct data { // List realization (keep sorted)
T x;
data *next... | ALGO | 0.999707 | 5.3176 | {
"github_metadata": {
"branch": "master",
"commit_count": 286,
"repo_created_at": "2017-08-08T08:17:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7cefcffc... |
b53a1f29-b2e8-4efa-b6e0-849523c9f8d6 | blackdeman/masters-algorithms-course | 03_cache_miss/main_analyzed.cpp | #include <iostream>
#include <random>
#include <ctime>
#include "Cache.h"
//__declspec(align(16))
// __restrict
namespace {
/*
void MultSimple(const float* __restrict a, const float* __restrict b, float* __restrict c, int n)
{
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
c[i * n + j] = 0.f;... | TOOL | 0.967576 | 4.565977 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2016-09-20T19: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": "9a353734b... |
a2502574-346f-4aef-a1d3-7391ad9f7ee3 | manas2297/interview | dp/knapsack.cpp | /*
You are given weights and values of N items, put these items in a knapsack of capacity W to get the maximum total value in the knapsack.
Note that we have only one quantity of each item.
In other words, given two integer arrays val[0..N-1] and wt[0..N-1] which represent values and weights associated with... | ALGO | 0.999998 | 5.127685 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-07-21T11:07: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": "90c8400da8c7... |
3dde29a1-753c-4573-bb13-bf43f503d168 | gtbeazley/CDDS-Simon | aieBootstrap-master/ContainerDemo/HashTable.h | #pragma once
#include "vector"
#include "DoubleLinkedList.h"
#include "DynamicArray.h"
#include "HashFunction.h"
#include <iostream>
#include <istream>
#include <fstream>
#include <string>
#include "Node.h"
using namespace std;
namespace Hash {
class HashTable
{
public:
//Default Constructor
HashTable();
//D... | ALGO | 0.973154 | 4.598048 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2019-05-06T07:02: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": "be9ba612d... |
99424654-3b3a-47ed-a166-4da31c5572d5 | pedrozone/Compettive-Programmer | makeMaximumPalindrome.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
#define endl '\n'
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> index_set;
using vi = vector<int>;
#define pb push_back
#define rsz resize
#... | ALGO | 0.99994 | 4.15272 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-08-02T19:11: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": "784530079e... |
d39da41b-4d17-4c89-ae3f-a5174bd34c4e | Abunyawa/contests | 647/b.cpp | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define F first
#define S second
#define vi vector<int>
#define vl vector<long long>
#define pii pair<int, int>
#define pll pair<long long, long long>
#de... | ALGO | 0.999943 | 4.520796 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2020-03-29T11:27:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee6f05823... |
1efe2958-912b-466e-a519-2adf3b2ac8da | BoleynSu/CompetitiveProgramming | archives/problemset/train.usaco.org/zerosum.cpp | /*
ID: sujiao1
PROG: zerosum
LANG: C++
*/
#include <iostream>
#include <string>
#include <fstream>
using std::endl;
using std::string;
/*
std::istream& cin(std::cin);
std::ostream& cout(std::cot);
*/
std::ifstream cin("zerosum.in");
std::ofstream cout("zerosum.out");
struct Program
{
static const int MAXN=9;//3... | ALGO | 0.999867 | 3.493989 | {
"github_metadata": {
"branch": "main",
"commit_count": 354,
"repo_created_at": "2012-12-22T04:55:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 6,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "21062dc0d6... |
673cec26-80d0-4ca8-a299-edf88f3fdffb | sarvanideekshitula/Sequence_Alignment | Sequence_alignment.c++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <typeinfo>
// #include "boost\multi_array.hpp"
#include "./stdc++.h"
using namespace std;
std::vector<std::pair<unsigned int, unsigned int> > * sequenceAlignment(std::string x, std::string y, unsigned int delta, unsigned int(*costFun... | ALGO | 0.999672 | 5.08661 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2021-11-25T01: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": "dd99306394d... |
78f0b33a-1e85-4906-9340-50a16f7e097f | Rajugit07/DSA | Day-12/classNote/bubbleSort.cpp | #include <iostream>
using namespace std;
void print(int arr[], int n)
{
for (int i = 0; i < n; i++)
{
cout << arr[i] << ",";
}
}
void bubbleSort(int arr[], int n)
{
bool isSwap = false;
for (int i = 0; i < n - 1; i++)
{
for (int j = 0; j < n - i - 1; j++)
{
... | ALGO | 0.999905 | 5.252303 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-01-22T19:18: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": "ec0d78e189a... |
b743dd37-535f-47a4-95c6-bf05051d62b8 | Vittor-Javidan/Training | C++/Courses/Beginner_to_Advanced_Daniel_Gakwaya/8_Operations_on_Data/4_Weird_Integral_Types/main.cpp | #include <iostream>
int main()
{
short int var1 {10};
short int var2 {20};
char var3 {40};
char var4 {50};
std::cout << "size of var1 : " << sizeof(var1) << " value : " << var1 << std::endl;
std::cout << "size of var2 : " << sizeof(var2) << " value : " << var2 << std::endl;
std::cout <... | TOOL | 0.912564 | 3.550677 | {
"github_metadata": {
"branch": "master",
"commit_count": 313,
"repo_created_at": "2022-02-08T15:48: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": "e5774653... |
e2303df4-34af-4760-9fb4-3210cca46bcf | geographiclib/geographiclib | develop/HarmTest.cpp | #include <fstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <ctime>
#include <GeographicLib/MagneticModel.hpp>
#include <GeographicLib/SphericalHarmonic.hpp>
#include <GeographicLib/CircularEngine.hpp>
#include <GeographicLib/MagneticCircle.hpp>
#include <GeographicLib/NormalGravity.hpp>
#inclu... | TOOL | 0.96333 | 3.967696 | {
"github_metadata": {
"branch": "main",
"commit_count": 2460,
"repo_created_at": "2021-07-01T13:15:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 387,
"forks": 94,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "274924f... |
35b757d2-c8f5-4d19-b691-33e9c74141eb | Reinpolina/C-Project | C++Project/myCproject/main.cpp | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debu... | ALGO | 0.997894 | 4.735403 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2024-06-27T19:15:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c78abc9dc1... |
888ab5df-9d1c-4c8c-b7fd-d947f27f9c1f | chandrakant100/DSA | BinaryTREE/TreeFromPreOandPostO.cpp | #include <iostream>
#include <queue>
using namespace std;
template <typename T>
class BinaryTreeNode {
public:
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data) {
this->data = data;
left = NULL;
right = NULL;
}
};
BinaryTreeNode<int> *take... | ALGO | 0.999995 | 5.313869 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2021-10-23T04:21: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": "da2ee3104... |
1854154e-2214-4785-8642-8fe546f39712 | bu1th4nh/Internal-Offline-Judge | Training/2018_L12/General Training/2018_11_19/PARTY/PARTY.cpp | /*==========================================================================================*\
** _ _ _ _ _ _ _ **
** | |__ _ _/ | |_| |__ | || | _ __ | |__ **
** | '_ \| | ... | ALGO | 0.999764 | 3.689715 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-01-08T13:48:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "791702c1e9... |
8a991bf4-ec69-42b9-8f1d-b831303913c8 | hanhansoul/ACM | codeforces/377C.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999856 | 3.653192 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2016-08-15T03:03: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": "0c133cf40... |
3839cea1-d5dd-401c-9ca4-76f84d49418d | dpvasani/30-Days-Of-DSA | Day 6/54. Spiral Matrix LeetCode.cpp | #include <iostream>
#include <vector>
using namespace std;
void spiralPrint(vector<vector<int>> v) {
int m = v.size(); // Rows
int n = v[0].size(); // Cols
int totalElements = m * n; // Total elements in the matrix
int startingRow = 0; // Starting Row
int endingCol = n - 1; // Ending Col
... | ALGO | 0.999942 | 5.538291 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2024-05-10T10:59:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b017b80a6... |
bd929468-c750-4a65-85f4-4b19296a05cb | lostleaf/mcpc15 | e.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string>
#include <iostream>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <deque>
using namespace std;
const int maxn = 6;
#define power powe
unordered_map<int, int> ret;
unordered_set<int... | ALGO | 0.999942 | 3.487198 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-11-08T02:54:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b54decb8a... |
4a21bec0-914a-4a70-9be5-414fc04e7f21 | arpansahu/Sorting | Merge_Sort_Recusrive.cpp | #include<iostream>
using namespace std;
void Merge(int arr[],int aux[],int low,int mid ,int high){
int k = low,i = low,j = mid + 1;
while(i <= mid && j <= high){
if(arr[i] <= arr[j]) aux[k++] = arr[i++];
else aux[k++] = arr[j++];
}
while(i <= mid) aux[k++] = arr[i++];
for (int l = ... | ALGO | 0.99999 | 5.131226 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2020-05-08T14:00:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06c02bb33... |
82b1f4c2-9893-4a1e-a341-a15f61d6fe5e | priyanshub18/CPP | GRAPHs/coloring_the_borders.cpp | #include<iostream>
#include<vector>
//LC 1034 https://leetcode.com/problems/coloring-a-border/
using namespace std;
class Solution {
public:
vector<pair<int , int > > result;
void dfs(vector<vector<int>>& grid, int r, int c, int color, int originalcolor){
if(r < 0 || c < 0 || r >= grid.size() || c >=... | ALGO | 0.999702 | 5.720262 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2024-04-04T06:34: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": "ab4688b78fc... |
dcd509fe-b2a1-407c-8166-72da11ccde27 | EulerDanseur/MyWorks | Experiment of programming/week4/stringMulti.cpp | #include <bits\stdc++.h>
using namespace std;
string multiply(string num1, string num2)
{
if(num1 == "0" || num2 == "0") return "0";
string a;
int l = num2.length(), m = num1.length();
int base = 0, cur = 0;
int pro = 0;
for (int i = l; i >= 1; i--)
{
base = l - i;
pro... | ALGO | 0.999966 | 4.607305 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2023-09-23T17:29: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": "c2f2e87acfe... |
cf7c66c4-0ea3-4d78-9b63-92d99700cad2 | versenyi98/programming-contests | UVa Online Judge/11835 - Formula 1/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int G, P;
while (cin >> G >> P, G || P) {
int results[G][P];
for (int i = 0; i < G; i++) {
for (int j = 0; j < P; j++) {
cin >> results[i][j];
}
}
int S;
cin >> S;
... | ALGO | 0.999828 | 3.58401 | {
"github_metadata": {
"branch": "master",
"commit_count": 972,
"repo_created_at": "2019-04-25T16:11:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28de0757... |
51ee05cf-e34c-4820-9f5a-c1e9e31b0e08 | ltf1320/programdesign | ojs/poj/nuaaoj2/main.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
const int maxn=100000+10;
const int inf=0x3f3f3f3f;
int h[maxn];
int sumh[maxn];
int abs(int a)
{
return a>0?a:-a;
}
int chu(int a,int b)
{
float c=1.0*a/b;
int cc=floor(c);
if(c-cc>=0.5) return cc+1;
else return cc;
}
... | ALGO | 0.999988 | 3.349901 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2014-04-14T05:45:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "252da3ae2... |
1976437d-877b-41d2-9875-01fb5e3cf93d | Longnewbie/DSA | 6.QHD/bt5_Staircase/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
inline ll gcd(ll a,ll b) {ll r; while(b){r = a%b; a=b; b=r;}return a;}
inline ll lcm(ll a,ll b) {return a/gcd(a,b)*b;}
#define pb push_back
int mod = 1e9+7;
/*
- Một chiếc cầu thang có N bậc. Mỗi bước, bạn được phép bước lên trên tối đa K bước. Hỏi c... | ALGO | 0.999968 | 4.968462 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-09T10:31: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": "1295b094ca4f... |
9c9ecaa6-43f6-4ae6-954e-abbaf9756feb | ishandutta2007/codeforces-w | weakesttopology/normal/1543/D2.cpp | #include <bits/stdc++.h>
struct G {
inline static int K;
int x;
G(int x = 0) : x(x) {}
friend G operator+(G lhs, G rhs) {
G res;
for (int a = lhs.x, b = rhs.x, pow = 1; a || b; pow *= K, a /= K, b /= K) {
res.x += pow * ((a % K + b % K) % K);
}
return res;
}
G operator-() const {
... | ALGO | 0.989509 | 3.829874 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:34:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b8de521da86... |
444150fe-266f-447a-9987-0931fa547b79 | Segun228/algorithms-and-data-structures | data structures/trees/AVL tree/AVL.cpp | #include <iostream>
#include <vector>
using namespace std;
class AVL{
private:
struct Node{
Node* left = nullptr;
Node* right = nullptr;
Node* parent = nullptr;
int height = 1;
int val;
};
Node* root = nullptr;
Node* right... | ALGO | 0.999923 | 4.678805 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2025-04-23T17:30:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f72ccef65... |
7d4d2954-1153-427a-bbe6-5d854d532d81 | Leonelli/C-plus-plus-works | preparezione/2015/febbraio/es1.cc | #include <iostream>
#include <iomanip>
using namespace std;
double valoreAssoluto(double valore);
double pot(double x, int n);
double calcola(double x, int n, double epsilon);
int main () {
double epsilon, x;
int n;
cout << "Inserisci il numero di termini dell’approssimazione: ";
cin >> n... | ALGO | 0.999875 | 4.205662 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2018-09-24T19:45:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e9f52bdf... |
3eaf6074-9965-4b21-91cb-5cde79a5f49c | yukeyi/LeetCode | 764 Largest Plus Sign/Largest Plus Sign.cpp | class Solution {
public:
int orderOfLargestPlusSign(int N, vector<vector<int>>& mines) {
vector<int> temp(N,1);
vector<vector<int>> pad(N, temp);
for(auto item : mines) {
pad[item[0]][item[1]] = 0;
}
vector<vector<int>> line(pad);
for(int i = 0;i<N;i++) {... | ALGO | 0.999846 | 5.504722 | {
"github_metadata": {
"branch": "master",
"commit_count": 589,
"repo_created_at": "2018-03-27T04:50:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e973066e... |
f9f54bd3-3134-4226-a012-6d648eed3bfc | joowon-byun/baekjoon | 02775differenceSequence.cpp | #include <iostream>
using namespace std;
int main() {
int caseNum;
int apartment[15][15];
int floor, room;
// initiate
for (int i = 0; i < 15; i++) {
apartment[0][i] = i;
apartment[i][0] = 0;
}
// fill in
for (int i = 1; i < 15; i++) {
for (int j = 1; j < 15; j++) {
apartment[i][j]... | ALGO | 0.999282 | 4.334821 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2016-12-29T15:49: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": "2e4c3adc... |
455ebdd4-2b5c-40c4-b1c8-cafc15ddb931 | bartandrews/DiagHam_Stability | trunk/src/MathTools/RandomNumber/NumRecRandomGenerator.cc | #include "NumRecRandomGenerator.h"
#include <cmath>
#include <cstdio>
// defines valid for the whole file:
#define EPS 1.2e-14
#define RNMX (1.0-EPS)
// defines for GetRealRandomNumber()
#define IA 16807
#define IM 2147483647
#define AM (1.0/IM)
#define IQ 127773
#define IR 2836
#define NDIV (1+(IM-1)/NTAB)
usin... | TOOL | 0.975188 | 3.824649 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-07-12T10:41:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d82f003994... |
7c92678a-6053-45f2-b308-a9a561902790 | shasuri/AlgorithmStudy | cxrt/bootcamp/adding.cpp | #include <iostream>
using namespace std;
#define MAXN (20)
int N, K; // 자연수 개수, 만들수
int A[MAXN + 10]; // 자연수 값
string msg[] = {"NO", "YES"};
void InputData()
{
cin >> N >> K;
for (int i = 0; i < N; i++)
{
cin >> A[i];
}
}
int dfs(int sum, int starter)
{
if (sum == K)
{
... | ALGO | 0.999904 | 4.962449 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2021-03-14T04:30:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1976aa6b73e... |
84dd6144-9795-4808-b256-e0b136d5f993 | mohankarthik/leetcode | problems/1XXX/15XX/158X/1584_min_cost_points.cc | #include "../../../../common/Includes.h"
struct Point {
int index;
int x;
int y;
Point(int x, int y, int index): x(x), y(y), index(index) {}
};
struct Edge {
Point *p1;
Point *p2;
int dist;
Edge(Point *p1, Point *p2): p1(p1), p2(p2) {
dist = abs(p1->x - p2->x) + abs(p1->y - p2-... | ALGO | 0.999972 | 5.771915 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2020-12-22T15:34: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": "05345923e... |
4258c8ad-8b89-4730-8f91-bebcffca09e3 | otavioon/COLA-2022-Tools | datasets/src/algo/codenet/1/s862712120.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin (),(x).end()
#define sqrt(x) sqrt(abs(x))
#define re return
#define sz(x) ((int)(x).size ())
#define prev PREV
#define next NEXT
using ll = long long;
using ii = pair<in... | ALGO | 0.999921 | 3.449351 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2022-06-08T12:17:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a2b908e1... |
d25521d5-2292-446c-8a39-4232a9e8c863 | KCL-Planning/ROSPlan | rosplan_knowledge_base/src/VALfiles/oldCausalGraph.cpp | /************************************************************************
* Copyright 2008, Strathclyde Planning Group,
* Department of Computer and Information Sciences,
* University of Strathclyde, Glasgow, UK
* http://planning.cis.strath.ac.uk/
*
* <NAME>, <NAME> and <NAME> - VAL
* <NAME> - PDDL Parser
*
* ... | ALGO | 0.978754 | 5.620774 | {
"github_metadata": {
"branch": "master",
"commit_count": 1115,
"repo_created_at": "2014-07-02T11:04:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 378,
"forks": 159,
"issues": 52,
"pull_requests": 9
},
"file_meta": {
"content_id": "8b6... |
bcc54837-4f88-4899-9152-261a9aff24da | anzhe-yang/Leetcode | 40_Combination_Sum_Ⅱ.cpp | /** 问题描述:
* 给定一个没有重复数字的集合和一个目标值,从集合中找到所有和为目标值的不同的候选集合。
* 集合中每个数字只能使用1次,而不是每种。
* 假设数字都是正数,结果不包含完全重复的集合。
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void combinationSum2(vector<int>& candidates, int target, vector<int>& temp, int start, vector<vector<int>>& res)
{
if (... | ALGO | 0.999964 | 5.317564 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2018-11-28T06:16: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": "173eb1f58... |
1233804b-9351-48c6-bd86-82295f44bbd2 | emyHorrana/CppAlgorithms | Control-flow/3n+1.cpp | #include <iostream>
using namespace std;
int main(){
int n, i, j, maior = 0;
int ciclo, inicio, fim;
cin >> i >> j;
n = i;
if (i < j) {
inicio = i;
fim = j;
} else {
inicio = j;
fim = i;
}
for(int k = inicio; k <= fim; k++){
ci... | ALGO | 0.999995 | 3.893055 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2025-04-29T14:07:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc270d30a58... |
f0c9f200-f339-495c-9da7-0a475177c59e | SouthGreenPlatform/galaxy-wrappers | Galaxy_SouthGreen/gff2fna/cpp/pssm_algorithms.hpp | // pssm_algorithms - collection of algorithms for finding PSSM matches from sequences
// Copyright (C) 2007-2009 <NAME>, <NAME>, <NAME>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, eith... | ALGO | 0.998706 | 5.707438 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2015-10-15T14:20:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "e819d5955... |
25722c83-f766-40e1-aaf0-25d3d5f345aa | toufu-24/AtCoder | ABC/ABC339/D.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define all(v) v.begin(), v.end()
#define SORT(v) sort(v.begin(), v.end())
#define RSORT(v) sort(v.rbegin(), v.rend())
#define REVERSE(v) reverse(v.begin(), v.end())
#define ll int64_t
#define ld long double
int N;
int fix(i... | ALGO | 0.999907 | 4.109352 | {
"github_metadata": {
"branch": "main",
"commit_count": 303,
"repo_created_at": "2023-04-15T10:40:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d912f7738... |
abd8f226-cdb0-4a31-a68e-10711bbd40f8 | paetricc/AVS-project2 | parallel_builder/tree_mesh_builder.cpp | /**
* @file tree_mesh_builder.cpp
*
* @author <NAME> <<EMAIL>>
*
* @brief Parallel Marching Cubes implementation using OpenMP tasks + octree early elimination
*
* @date 12-12-2023
**/
#include <iostream>
#include <cmath>
#include <limits>
#include "tree_mesh_builder.h"
TreeMeshBuilder::TreeMeshBuild... | ALGO | 0.992373 | 6.096539 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-11-13T16:24: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": "b42992e0e8f... |
31d79e03-66af-4037-be21-3e8db4ebae07 | zhhehao/TZCXSJ2 | Ch2/ALDS1_2_D.cpp | #include <cstdio>
static const int maxn = 1000000 + 10;
int n, a[maxn], m, G[maxn];
void get_step(){
if (n <= 3) {
m = 1;
G[0] = 1;
return;
}
G[0] = n / 2;
for (m = 1; m < n; m++) {
G[m] = G[m-1] / 2;
if (G[m] == 1)
break;
}
m++;
}
void _out... | ALGO | 0.999889 | 3.332561 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2018-01-05T07:59: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": "7705f5cef... |
1afc31b1-bee4-4090-8bc9-8f6fb856d9ae | MateyApostolov/Olimpiici_D | decoding.cpp | #include <bits/stdc++.h>
using namespace std;
int main () {
string st;
getline(cin, st);
vector <char> num;
int hi = 0, d = 0, s = 0, beg = 0, step;
for(int i = 0; i < st.size(); i++) num.push_back(st[i]);
for(int i = 0; isdigit(num[i]); i++) d = d * 10 + (9 - (num[i] - '0'));
for(int i = n... | ALGO | 0.999937 | 4.062889 | {
"github_metadata": {
"branch": "main",
"commit_count": 168,
"repo_created_at": "2024-09-18T18:24: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": "57e9a6a2d4... |
4aafe7c4-016e-496f-9c66-c908a6eda7ac | mjbori96/Algorithm_Solve | 백준/Gold/1520. 내리막 길/내리막 길.cc | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
using namespace std;
int M, N;
// 단순 dfs or bfs로 하면 무조건 시간 초과
int map[500][500];
// dp로 위치마다 경로 갯수 메모제이션
// dp[y][x] >> y,x로 가는 경로 갯수
int dp[500][500];
struct Point
{
int y;
int x;
}... | ALGO | 0.999951 | 3.873989 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-10-09T01:20: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": "7bac452a531... |
80e47a36-dcf9-42ab-9dc2-90a204d7bfcb | james94/P8-PID-Controller-CarND | src/PID.cpp | #include "PID.h"
#include <iostream>
using std::cout;
using std::endl;
PID::PID() {}
/**
* Sets name of device being controlled by PID Controller:
*
* Device names: steering, throttle
*/
PID::PID(std::string control_name_)
{
control_name = control_name_;
}
PID::~PID() {}
/**
* Init() function
*
* Initia... | ALGO | 0.956629 | 5.852776 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2019-12-10T21:34: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": "b245ea9fd... |
52810c80-f108-45d2-8fea-c506ae3e9e39 | dan-nha/dgtd | src/dgtd_solver.h | #ifndef DGTD_SOLVER_H
#define DGTD_SOLVER_H
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
#include "tools/input.h"
#include "spatial_solver/mesh/process_mesh_data.h"
#include "spatial_solver/geometric_operations.h"
#include "spatial_solver/elementwise_operations.h"
#include <armadillo>
#include <string>
#include <map>
name... | ALGO | 0.997629 | 6.265932 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2021-07-13T10:17:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "da36fc035... |
e7cb63db-a134-4131-a744-c8d48d974b3f | OI-wiki/OI-wiki | docs/math/code/basis/prefix_basis.cpp | #include <algorithm>
#include <array>
#include <iostream>
#include <numeric>
#include <vector>
class LinearBasis {
static constexpr int K = 20;
std::array<int, K> a, t;
public:
LinearBasis() : a{}, t{} {}
// Insert vector x at time i.
void insert(int x, int i) {
for (int k = K - 1; ~k && x; --k) {
... | ALGO | 0.999995 | 5.603794 | {
"github_metadata": {
"branch": "master",
"commit_count": 12101,
"repo_created_at": "2018-07-11T03:28:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23612,
"forks": 4310,
"issues": 112,
"pull_requests": 9
},
"file_meta": {
"content_id":... |
0b8663e1-090d-4852-9952-7273914ce575 | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/13_22861_30.cpp | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include<sstream>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include<queue>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define rep(i,n) for(i... | ALGO | 0.999835 | 3.954367 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70ab23b78... |
4daba3a4-9172-4d63-af8d-e254802673fc | phuocVND/cpp | baitap/stack.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
template <typename T>
class Stack{
private:
T *ptr;
int capacity;
public:
Stack();
~Stack();
T top();
void push(T value);
void pop();
bool empty();
};
template <typename T>
Stack<T>::Stack(){
this->capa... | ALGO | 0.966367 | 4.221072 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2025-04-05T07:06: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": "17aa69a7a7d... |
b75204ef-d888-4a47-b833-e3e85046143c | abhipray-cpu/cpp | Strig Algorithms/storage/BinarySearchTree.cpp | //using a bst and Rabin karp hash as value to decide the node in which the string should go
#include<bits/stdc++.h>
using namespace std;
typedef long long L;
struct Node
{
string text;
L hashValue;
Node *left;
Node *right;
};
class BSTAndStore
{
public:
Node *root=NULL; //this is the root node that wil... | ALGO | 0.999956 | 4.853009 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-06-16T14:51: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": "bd396b816b4... |
6c58051c-65fd-4e08-acd2-30e1a35f4156 | koth/elements-of-programming-interviews | Painting_recursive.cpp | // Copyright (c) 2013 Elements of Programming Interviews. All rights reserved.
#include <array>
#include <deque>
#include <iostream>
#include <queue>
#include <random>
#include <string>
#include <vector>
using std::array;
using std::cout;
using std::default_random_engine;
using std::deque;
using std::endl;
using std:... | ALGO | 0.995284 | 5.529757 | {
"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": "b7e0514... |
6b406d64-3d28-4155-a319-72551af3e6e5 | sbite0138/ac-committer | submissions/abc180/abc180_d/AC_17452492.cpp | #include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = m... | ALGO | 0.999512 | 3.455216 | {
"github_metadata": {
"branch": "master",
"commit_count": 3134,
"repo_created_at": "2020-05-30T09:45: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": "e421c3f... |
eb928901-eca7-4420-8825-b64b14aa328b | adityarathore063/cpp-ds-and-algo | Linked list/2.cpp | #include <bits/stdc++.h>
using namespace std;
class node
{
public:
int data;
node *next;
node(int x)
{
data = x;
next = NULL;
}
};
void insertatTail(node *&head, int x)
{
node *temp = new node(x);
if (head == NULL)
{
head = temp;
return;
}
node ... | ALGO | 0.999949 | 4.733189 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2024-05-25T17:50: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": "55b034aafb... |
bf6923e5-ac40-442c-98ff-1ddabdf1621f | ishandutta2007/codeforces-a | anadi/normal/793/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
typedef double D;
#define st first
#define nd second
#define pb push_back
#define PLL pair <LL, LL>
#define PII pair <int, int>
const int N = 1e5 + 7;
const int inf = 1e9 + 7;
int n;
pair <PII, PII> start;
int main(){
scanf("%d", &n);
scanf... | ALGO | 0.999703 | 3.188431 | {
"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": "adf689fe77a8... |
3eb7d6b5-d673-4d19-8330-7fa82b481065 | Angelotso/LABORATORIOS | LAB17_GRUPO_C_EJECUTABLE_20180685_ANGEL_APAZA/ejercicio2.cpp | #include<iostream>
#include<conio.h>
#include<stdlib.h>
using namespace std;
template <class T> class ABB;
template<class T>
class Nodo
{
public:
Nodo(const T dat, Nodo<T> *izq=NULL, Nodo<T> *der=NULL) :
dato(dat), izquierdo(izq), derecho(der) {}
T dato;
Nodo<T> *izquierdo;
Nodo<T> *derecho;... | ALGO | 0.999939 | 4.311174 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2022-04-22T20:00: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": "55061d43336... |
5b9a16b1-2535-4bc3-8449-2caa66473ca3 | biblion84/CProgrammingLanguage | exercices/programmingPearl/FindAnagramsOk.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MB (1024 * 1024)
#define MAX_WORDS 400000
int len(char *s){
int i;
for (i = 0; s[i] != '\0'; ++i);
return i;
}
struct canonicalString {
char *original;
char *canonical;
};
// bubble sort (fast enough) average O(n²) but the arrays are always sma... | ALGO | 0.99948 | 3.518756 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2021-11-07T20:58:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0ec58fc5... |
063bb3cb-6cf1-4a53-a4f5-b1c88b32ef5e | xinkuifeng/aoc | 2023/day06/part2.cc | #include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include "AocUtils.h"
using namespace std;
using namespace fxk;
int main(int argc, char ** argv)
{
if (argc != 2) {
cout << "usage: ./a.out FILE_NAME" << endl;
return -1;
}
ifstream file(argv[1]);
if (!file) {... | ALGO | 0.999718 | 4.149353 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-12-18T19:52: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": "6ee635ef14a... |
7a80103a-7b72-40ce-858a-7065412cfa2b | pratikkumar399/Data-Structures-And-Algorithm | codechef/MAXXDIFF.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
int diff;
while (t--)
{
int n, k;
cin >> n >> k;
int w[n];
if (k > n / 2)
{
k = n - k;
}
for (int i = 0; i < n; i++)
{
cin >> w[i];
... | ALGO | 0.99999 | 4.339892 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2021-12-14T11:43:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43ff598dd... |
b44d58b7-82ab-4d6b-853e-bb525f0a6c7d | FaCsaba/Prog1 | day11/calculator_(ech).cpp | /**
* Extra Credit Homework
* A simple command line calculator
* by <NAME>
* 2023 04 26
*/
#include <cstdint>
#include <cstring>
#include <string>
#include <sstream>
#include <cctype>
#include <iostream>
#include <cassert>
#include <map>
#include <funct... | ALGO | 0.92031 | 5.391253 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2023-02-15T13:53: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": "ea9266c2e... |
c9843e62-8e90-41ee-9434-59611beb935a | businessdohyeon/BaekJoon | #13549.cpp | /*
<NAME>
#13549
*/
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
const int COEFFICIENT[] = {1, 1, 2};
const int BIAS[] = {-1, 1, 0};
const int COST[] = {1, 1... | ALGO | 0.99987 | 3.421155 | {
"github_metadata": {
"branch": "master",
"commit_count": 398,
"repo_created_at": "2024-01-12T01:29: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": "e8b1e6d3... |
65735db0-831b-4083-a2d8-8986fff8b5ed | ishandutta2007/codeforces-m | mangooste/normal/1622/F.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define all(a) begin(a), end(a)
#define len(a) ((int)((a).size()))
int main() {
ios::sync_with_stdio(false), cin.tie(nullptr);
int n;
cin >> n;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().c... | ALGO | 0.999718 | 4.311919 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "9d88e7aa3759... |
252d3a67-bab7-4d73-87a7-f3c6826b7963 | ahbarif/Online-Judge-Solutions | LightOJ/1364 - Expected cards.cpp | #include<bits/stdc++.h>
using namespace std;
int req[5];
double dp[14][14][14][14][5][5];
bool vis[14][14][14][14][5][5];
bool done(int s, int h, int c, int d){
return (s >= req[0] && h >= req[1] && c >= req[2] && d>=req[3]);
}
int cnt;
double fun(int s, int h, int c, int d, int j1, int j2){
int cs = 13 - s... | ALGO | 0.997226 | 3.499296 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2018-08-11T17:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51fb7b3ad... |
5ab6d05f-de34-44aa-8f68-af3c1e36f659 | LassiViitakoski/Cplusplus-Course | challenges/challenge-5_section-9/main.cpp | #include <iostream>
#include <vector>
#include <cctype>
#include <string>
#include <iomanip>
using namespace std;
string show_menu()
{
return (
string("P - Print numbers\n") +
string("A - Add a number\n") +
string("M - Display mean of the numbers\n") +
string("S - Display the smallest number... | TOOL | 0.978722 | 5.229101 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-07-20T15:11: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": "4ed78d0a8675... |
45c1eb33-a0d6-4e44-831c-56bb4b8403d3 | hmahajan99/InterviewBit-Solutions | Strings/String simulation/Longest Common Prefix.cpp | // Given the array of strings A,
// you need to find the longest string S which is the prefix of ALL the strings in the array.
// Longest common prefix for a pair of strings S1 and S2 is the longest string S which is the prefix of both S1
// and S2.
// For Example, longest common prefix of "abcdefgh" and "abcefgh" is... | ALGO | 0.999914 | 5.309161 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2020-01-09T16:18:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb7d3dba2... |
a6fbe529-6273-4332-b286-d0269bb777a3 | ryukans/repos | C++/Exercises/Exercise 19_20_21-4.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void flush(void);
int main()
{
vector<string> names;
vector<int> scores;
string n;
int s;
bool repeated = false;
while (!repeated && cin >> n >> s && n != "NoName") {
for (int i = 0; i < names.size(); ++i... | ALGO | 0.993348 | 3.721519 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2021-05-30T09:53: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": "60ae445ad6... |
d19e8cdc-589c-46b2-a3b0-6f33de5739e7 | JFschmiechen/Code-Dome | Roster Manager.cpp | /*
Author: <NAME>
Group members: <NAME>; Sherlock, Alec; <NAME>, Aaron;
Assignment: Programming Assignment Two
Course: COMP B12
Instructor: <NAME>
Date submitted: 2016/12/10
*/
#include <iostream>
#include <vector>
#include <sstream> // Allows cin to read strings
#include <limits> // Allows cin to catch non int inp... | TOOL | 0.940044 | 4.496237 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2016-10-05T23:20:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "2edd66440... |
29b5a187-a055-42b1-a587-e0b2717a73f0 | kirakira/deep-blur | src/hash.cc | #include "hash.h"
#include <cstring>
HashSet::HashSet(int depth)
{
table = new Entry[1 << depth];
memset(table, 0, sizeof(Entry) * (1 << depth));
mask = (1 << depth) - 1;
}
HashSet::~HashSet()
{
delete[] table;
}
int HashSet::hash(uint64_t key)
{
return (int) key & mask;
}
void HashSet::clear()
... | ALGO | 0.98404 | 5.042078 | {
"github_metadata": {
"branch": "master",
"commit_count": 204,
"repo_created_at": "2013-02-12T02:37: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": "be8daa23... |
19963679-050a-404b-b9a2-10a0efc36a74 | chang860605/Leetcode_Exercise | 0019_Remove Nth Node From End of List/Remove_Nth_Node_From_End_of_List_O2n.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) {}
* };
*/
class Solution {
public:
ListNode* removeNthFr... | ALGO | 0.999971 | 5.80104 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2021-09-22T10:47: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": "d36aa1c502f... |
3fd54f0f-cfba-4208-b678-687bcdf569b5 | Daniel-Xu/algorithm | exec/recursion_palindromes.cc | #include <iostream>
#include <string>
using namespace std;
//basestatement is: length is 0 or 1
//statement change: from the middle to outside
bool palindrome(string s)
{
if(s.size() == 0)
return true;
else if(s.size() == 1)
return true;
else if(s.size() == 2)
return s[0] == s[... | ALGO | 0.999511 | 4.094279 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2013-10-10T04:42:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "807cf38e... |
62328afb-7585-4944-86a2-613e5bcb6b8a | Nick-Asp/University-Projects | Algorithm Design and Data structures/assignment9/PolishNotation.cpp | #include "PolishNotation.h"
#include <string>
using namespace std;
PolishNotation::PolishNotation(){
operands = new Stack();
}
PolishNotation::~PolishNotation(){
delete operands;
}
int PolishNotation::performOperation(string input){
//This alogrithim starts from the back of the input and loads the operands as ... | ALGO | 0.990425 | 3.910924 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-05-28T13:32: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": "fe51e98aa2... |
04f92de4-2a1f-443b-8123-8a3f0bb556c2 | sunny-lan/cpp-contest | bfs17p3.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <math.h>
using namespace std;
#define memeset memset
template<typename T>
inline T INF(T a) { r... | ALGO | 0.999879 | 4.079632 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-07-02T19:05:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "836ee4de4a... |
57b87071-2694-4c05-bc54-b92dc4379955 | kanisht09/Data-Structures-and-Algorithms | C++/Algorithms/Standard Algorithms/Running_Mean_Median_Mode.cpp | #include <bits/stdc++.h>
#define mod 1000000007
#define ull unsigned ll
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pi acos(-1)
#define nui 100
#define INF 100000000000
#define F(i,a,n) for(ll i=a;i<n;i++)
#d... | ALGO | 0.999366 | 4.158242 | {
"github_metadata": {
"branch": "main",
"commit_count": 442,
"repo_created_at": "2020-10-05T20:19:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 27,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1f626f63... |
aeebadb1-4196-4ae1-a911-dcb86e4bfc9a | knightryder098/Leetcode | 885.spiral-matrix-iii.cpp | /*
* @lc app=leetcode id=885 lang=cpp
*
* [885] Spiral Matrix III
*
* https://leetcode.com/problems/spiral-matrix-iii/description/
*
* algorithms
* Medium (73.65%)
* Likes: 790
* Dislikes: 770
* Total Accepted: 42.7K
* Total Submissions: 58K
* Testcase Example: '1\n4\n0\n0'
*
* You start at the ce... | ALGO | 0.999891 | 6.745128 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2023-05-10T13:02: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": "200e5557e5e... |
4d7ae198-30da-4bba-9223-6e4da45f49fc | PiruthiviP/CS23201--Object-Oriented-Programming | Lab_Programs/Lab_12/pro2.cpp | //Write a program that illustrates the application of multiple catch statements.
#include <iostream>
#include <stdexcept>
using namespace std;
int main() {
int a = 5;
int b = 0;
int choice;
cout << "1: Division\n2: Array Access\nChoose an operation: ";
cin >> choice;
try {
if (choice ... | TOOL | 0.933987 | 5.260004 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2024-09-19T17:25: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": "5fb509968cb... |
7f356f15-061f-43d5-8f55-9b83dad5a5c6 | Shikhar03Stark/Code-Dump | Codechef/stupmach.cpp | #include <bits/stdtr1c++.h>
typedef unsigned int ui;
using namespace std;
ui maxTokens(vector<ui> &cups){
ui minIndex = 0;
for(int i = 0; i<cups.size(); i++){
if(cups[minIndex] > cups[i]){
minIndex = i;
}
}
ui tokens = 0;
tokens += cups.size()*cups[minIndex];
for... | ALGO | 0.999966 | 4.258449 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2022-01-08T13:20: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": "eeddabff5... |
21bed329-59e2-4e38-9ef5-0b01ce5ec2e5 | Aneth-2/12_registros | registros2.cpp | #include <iostream>
#include <string>
#include <iomanip>
using namespace std;
struct Persona {
string nombres;
string dni;
int edad;
};
int main() {
int n;
cout << "Ingrese la cantidad de personas: ";
cin >> n;
cin.ignore();
Persona personas[n];
for (int i = 0; i < n; ++i... | TOOL | 0.91231 | 4.192103 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-07-15T00:55:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "062149ec825... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.