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 |
|---|---|---|---|---|---|---|---|
2602c507-4238-4157-82d2-67a4daab9df7 | yuk7/mitaka | Mitaka/mtk_elliptical_galaxy.cpp | /**************************************************************************************************
Copyright (c) 2007 <NAME> and 4D2U Project, National Astronomical Observatory of Japan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation file... | ALGO | 0.971847 | 4.312245 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-07-31T20:42:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a286de822... |
ec8ef172-d4c1-4f4d-a6df-271b5e733e06 | Acrsahil/100_Days_DSA | Array_question/stringarr.cpp | #include <iostream>
using namespace std;
int main()
{
char alph[26];
char start = 'a';
for (int i = 0; i < 26; i++) {
alph[i] = start;
start++;
}
string str[9]; // Reduce the size to match the required output
int i = 0;
int j = 2; // Move the 'j' variable outside of the loop... | ALGO | 0.999432 | 3.243468 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2023-03-29T15:27: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": "cad87e923... |
ee28d1b3-0ef3-4e0b-a875-daf2a611a41b | izumo27/competitive-programming | Codeforces/Codeforces-Global-Round/2019/2/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for... | ALGO | 0.999979 | 3.64643 | {
"github_metadata": {
"branch": "master",
"commit_count": 401,
"repo_created_at": "2018-03-03T08:47: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": "a29fabd4... |
294b07ae-389f-4343-8654-8e79e3f52b27 | happy4xinyuan/CCF | 171203.cpp | #include<iostream>
#include<vector>
#include<string.h>
#include<stdlib.h>
using namespace std;
struct timeinfo {
int year;
int month;
int day;
int hour;
int min;
int date;
void ass(int y, int m, int d, int h, int M,int dat)
{
year = y;
month = m;
day = d;
hour = h;
min = M;
date = dat;
}
void ou... | ALGO | 0.994595 | 3.16427 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-03-16T07:09: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": "7f38b273ca... |
25c4f21d-65b5-46fa-b833-bbb054cc10a8 | prateeksahu10/data-structure | lab/BST_exp11/main.cpp | #include <iostream>
using namespace std;
struct BST
{
int info;
BST *left;
BST *right;
};
BST *root;
class binary
{
BST *check,*ptr;
int num;
public:
binary()
{
root = NULL;
}
void add()
{
cout<<"\nEnter the number until -1 is entered\n";
cin>>num;
... | ALGO | 0.999897 | 3.707635 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-10-18T04:05:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5758ce6d6b... |
1876d7df-ae04-4788-8a11-296ac6be5607 | diatomic/diy | examples/reduce/sample-sort.cpp | #include <cmath>
#include <vector>
#include <cstdlib>
#include <limits>
#include <diy/master.hpp>
#include <diy/link.hpp>
#include <diy/assigner.hpp>
#include <diy/algorithms.hpp>
#include <diy/mpi/io.hpp>
#include <diy/io/bov.hpp>
#include "../opts.h"
#include "sort.h"
typedef diy::Link Link;... | ALGO | 0.989231 | 5.376626 | {
"github_metadata": {
"branch": "master",
"commit_count": 893,
"repo_created_at": "2015-05-22T18:49:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 50,
"forks": 22,
"issues": 16,
"pull_requests": 2
},
"file_meta": {
"content_id": "135722... |
214a1f43-e615-45f0-9b9c-7dca9b29fd92 | Flymi61/StudyNotes | leetcode/62. 不同路径/62.cpp | /*class Solution {
public:
int Paths(int m, int n, int x, int y)
{
if(x == m - 1 && y == n - 1)
return 1;
if(y == n - 1)
return Paths(m, n, x + 1, y);
if(x == m - 1)
return Paths(m, n, x, y + 1);
return Paths(m, n, x + 1, y) + Paths(m, n, x,... | ALGO | 0.999975 | 5.339387 | {
"github_metadata": {
"branch": "master",
"commit_count": 493,
"repo_created_at": "2022-09-13T08:59: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": "a855a060... |
d00ed10a-4ce7-4268-b667-f1936a15781f | yongsoonko/solved-problems-2 | 187-16234.cpp | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
using ll = long long;
struct Pos {
int i;
int j;
int k;
};
int N, L, R;
int A[51][51];
Pos root[51][51];
int find(int x) {
int ci = x / 51, cj = x % 51;
if (r... | ALGO | 0.999568 | 3.829052 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-04-07T03:43: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": "3adc33a22... |
a510e4c1-e721-464b-8edb-b24c44543977 | ishandutta2007/codeforces-k | kostka/normal/557/E.cpp | #include "bits/stdc++.h"
using namespace std;
const int MAXN = 5007;
long long pref[MAXN], revpref[MAXN];
long long pott[MAXN];
const int pri = 17;
const int mod = 1234567891; //aka liczba Hazego
string s;
void hashe(int st)
{
long long a = 1;
long long w = 0;
for(int i=st; i<(int)s.size(); i+=2)
{
w +=... | ALGO | 0.99983 | 3.465456 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "aa05680e6a18... |
dd6f1b92-62f7-4a41-b0db-02a1ac88c802 | ishandutta2007/codeforces-e | emptysoulist/normal/833/B.cpp | #include<bits/stdc++.h>
using namespace std ;
#define rep( i, s, t ) for( register int i = s; i <= t; ++ i )
#define re register
#define ls(x) x * 2
#define rs(x) x * 2 + 1
int gi() {
int cn = 0, flus = 1 ; char cc = getchar() ;
while( cc > '9' || cc < '0' ) cc = getchar() ;
while( cc >= '0' && cc <= '9' ) ... | ALGO | 0.99993 | 3.446486 | {
"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": "d541c41eec05... |
25ec3556-36d7-48dd-a601-6d31ff35c7f5 | okcd00/CDKeeper | Solutions/cpp/president_tree.cpp | #include <bits/stdc++.h>
using namespace std;
/*
https://www.bilibili.com/video/BV1PT411L7XQ
主席树板子: 可持久化权值线段树
主席树功能:给定序列,对于指定闭区间 [l, r] 内的第 k 小/大 值
【对比】
普通线段树:给定序列,以下标区间作节点区间,节点维护区间最值、区间和等
权值线段树:给定序列,以序列值域作节点区间,节点维护值域内数的出现次数
*/
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>... | ALGO | 0.999997 | 4.83204 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2017-10-18T01:21:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d09d0222... |
c72b082a-3db2-4392-b416-46a2609e5181 | oatflake/adventofcode | aoc2016/day6/puzzle12.cpp | #include <iostream>
#include <string>
#include <vector>
#include "../helper.h"
std::string readInput() {
std::vector<std::vector<int>> charCount;
auto lambda = [&](void* handler, const std::string& line) {
while (line.size() > charCount.size()) {
charCount.push_back(std::vector<int>(26, 0))... | ALGO | 0.999933 | 3.993654 | {
"github_metadata": {
"branch": "master",
"commit_count": 182,
"repo_created_at": "2019-12-01T00:39: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": "f95abed7... |
329e2cb7-e42c-4132-b83d-cc66e6b5d7fe | Md-Imam-Hasan/codeforces | Round 954 (Div. 3)/C_Update_Queries.cpp | #include <bits/stdc++.h>
#define ll long long
#define fast_io \
ios_base::sync_with_stdio(0); \
cin.tie(0);
const double pi = 2.0 * acos(0.0);
// ok
using namespace std;
/// Code starts from here
int main()
{
fast_io;
int t, kase = 1;
cin >> t;
while (t--)
{
int n, m, i, x;
cin >> ... | ALGO | 0.999993 | 3.821815 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-08-12T03:15: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": "ae37534b011a... |
17e16007-1aaf-4368-b90a-1ed3e041805b | sgrade/cpptest | leetcode/find-the-longest-substring-containing-vowels-in-even-counts.cpp | // 1371. Find the Longest Substring Containing Vowels in Even Counts
// https://leetcode.com/problems/find-the-longest-substring-containing-vowels-in-even-counts/
#include <bits/stdc++.h>
using namespace std;
// Based on Editorial's Approach: Bitmasking
class Solution {
public:
int findTheLongestSubstring(strin... | ALGO | 0.99983 | 5.542969 | {
"github_metadata": {
"branch": "master",
"commit_count": 2401,
"repo_created_at": "2020-08-01T16:38: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": "14f7e5e... |
1bbba8fd-abac-4580-b6ef-9cce5ae06ed1 | fwessels/simdjson-c2goasm | cpp/find_odd_backslash_sequences.cpp | #include <immintrin.h>
static inline bool add_overflow(uint64_t value1, uint64_t value2, uint64_t *result) {
return __builtin_uaddll_overflow(value1, value2, (unsigned long long*)result);
}
// a straightforward comparison of a mask against input. 5 uops; would be
// cheaper in AVX512.
inline uint64_t cmp_mask_agai... | ALGO | 0.994974 | 5.480529 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-12-09T21:10:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a82530d0c... |
be59da39-c63a-487d-9a71-5458f15b1ccb | jiaz/algorithms | sorting/linked_merge_sort.cpp | #include "../helper.hpp"
struct ListNode {
int value;
ListNode *next;
ListNode(int v) {
this->value = v;
this->next = NULL;
}
~ListNode () {
if (this->next != NULL) {
delete this->next;
}
}
};
int getLen(ListNode *head) {
if (head == NULL) return 0;
int count = 0;
while(head->next != NULL) {
c... | ALGO | 0.999981 | 4.878096 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2013-03-19T13:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4aa611035... |
09bc6682-e533-429f-8778-7ea673bdd0c2 | jeevankhetwani/Coding-Practice | LeetCode3.cpp | ////
//// Created by jeevan on 6/7/17.
////
//
//#include <iostream>
//#include <unordered_map>
//#include <unordered_set>
//#include <vector>
//#include <queue>
//#include <stack>
//#include <string>
//#include <cstring>
//#include <algorithm>
//#include <sstream>
//
//using namespace std;
//
//struct ListNode {
// ... | ALGO | 0.999272 | 3.200197 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-07-28T13:26: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": "18b716617f... |
9753500e-0968-476a-9833-8a416e5a76df | MSL-devel/mslib | src/SpringConstraintInteraction.h | /*
----------------------------------------------------------------------------
This file is part of MSL (Molecular Software Libraries)
Copyright (C) 2008-2012 The MSL Developer Group (see README.TXT)
MSL Libraries: http://msl-libraries.org
If used in a scientific publication, please cite:
<NAME>, <NAME>, <NAME>,... | ALGO | 0.944742 | 5.473569 | {
"github_metadata": {
"branch": "master",
"commit_count": 1381,
"repo_created_at": "2015-01-31T21:15:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f795d50d... |
3b36916a-ec6a-4676-b5aa-e107411b8bea | GopinathBalaji/Leetcode | fizz-buzz/fizz-buzz.cpp | class Solution {
public:
vector<string> fizzBuzz(int n) {
// Method 1: Naive Approach
vector<string> v1;
int a = 1;
while(a<=n){
if(a%3==0 && a%5==0){
v1.push_back("FizzBuzz");
}else if(a%3==0){
v1.push_back("Fizz");
... | ALGO | 0.999873 | 7.074917 | {
"github_metadata": {
"branch": "main",
"commit_count": 1179,
"repo_created_at": "2021-06-10T16:28: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": "7c555257c... |
c9ba328a-6c1b-4644-b3d0-133334da6ed3 | TGC-Admin/TGC000 | Espresso/generator-killer-double.cpp | /*
* @uni_kakurenbo
* https://github.com/uni-kakurenbo/competitive-programming-workspace
*
* CC0 1.0 http://creativecommons.org/publicdomain/zero/1.0/deed.ja
*/
/* #language C++ GCC */
#ifdef LOCAL_JUDGE
#include<debug>
#define debug(...) Debug::debug(Debug::split(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)... | ALGO | 0.998743 | 3.090549 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-11-21T10:52:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d67f5997f7bb... |
545fa3ad-b5bf-45aa-99e5-9fd17428821d | cctbx/cctbx_project | boost_adaptbx/graph/min_cut_max_flow_ext.cpp | #include <boost_adaptbx/graph/graph_type.hpp>
#include <boost_adaptbx/graph/graph_export_adaptor.hpp>
#include <boost_adaptbx/graph/vertex_map.hpp>
#include <boost_adaptbx/exporting.hpp>
#include <boost/python/module.hpp>
#include <boost/python/list.hpp>
#include <boost/python/tuple.hpp>
#include <boost/python/dict.h... | ALGO | 0.948905 | 5.734428 | {
"github_metadata": {
"branch": "master",
"commit_count": 38660,
"repo_created_at": "2015-07-22T13:36:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 256,
"forks": 121,
"issues": 120,
"pull_requests": 31
},
"file_meta": {
"content_id": "... |
b5deb789-56f1-41c3-9f1f-ecb3f3d6e3de | OmRajput17/DSA | Arrays/Hard/Reverse-Pairs.cpp | class Solution {
public:
int cnt = 0;
void merge(vector<int>& arr, int low,int mid, int high){
vector<int> temp;
int left = low;
int right = mid+1;
while((left<=mid) && (right<=high)){
if(arr[left]<=arr[right]){
temp.push_back(arr[left]);
... | ALGO | 0.999998 | 6.157837 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2025-05-25T17:52: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": "ac947bdd7d2... |
b50024bf-4879-4b47-8fd0-4b1fcf4ac555 | alfonsar/cs-homework | hw5/cave.cpp | #include <iostream>
#include <stack>
int main()
{
//variable to read in string
std::string s;
//bool to check for rolled
bool rolled=false;
//stack used to check for circle scenario
std::stack<char>input;
//prompt user for string
std::cout<<"Enter a string"<<std::endl;
//std::cin>>s;... | ALGO | 0.999901 | 4.982927 | {
"github_metadata": {
"branch": "master",
"commit_count": 185,
"repo_created_at": "2019-01-15T17:18: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": "d0334a0a... |
7f07dd0c-5d5f-4294-9f72-6c42db0a9aeb | pamelavillar/DBII_proyecto | estructura/Buscador.cpp | #include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <limits>
#include "AVL_ID.cpp"
#include "AVL_Busqueda.cpp"
using namespace std;
enum Operador {
AND,
OR
};
enum Orden {
NO,
ASC,
DES
};
class Buscador {
private:
AVL_Busqueda arbol_busqueda;
AVL_ID arbol... | TOOL | 0.995226 | 4.563853 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2025-06-07T21:06: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": "1d5cee7525c... |
3b9fbc0b-c9b3-4b1b-b451-a1317aeee6c0 | hellocomrade/happycoding | CountNonDivisible.cpp | #include <cassert>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <iostream>
using namespace std;
/*
https://codility.com/demo/results/trainingRV29KN-9Q5/
Why I got timeout?
I was thinking the inner loop binary search will take
sqrt(2)*log2, sqrt(3)*log3 ... sqrt(N)*logN, and the outter l... | ALGO | 0.999533 | 4.570527 | {
"github_metadata": {
"branch": "master",
"commit_count": 1008,
"repo_created_at": "2015-11-28T18:57:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "503fb02... |
f99c1517-a6e0-4bce-be4c-b6c0cdb386e8 | mangoqwq/competitive-programming | CSES/cses3414.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef _DEBUG
#include "utils/debug.h"
#else
#define debug(...) 0
#endif
int main() {
cin.tie(0)->sync_with_stdio(0);
int N, K; cin >> N >> K;
vector<vector<int>> a(N, vector<int>(N));
for (int i = 0; i < N; ++i) {
string s; cin >> s;
... | ALGO | 0.999873 | 4.363558 | {
"github_metadata": {
"branch": "master",
"commit_count": 540,
"repo_created_at": "2020-08-28T16:37:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59a5043e... |
f4a826a7-ccbe-4f8e-a7ce-6baaf756020b | shashank0107/CompetitiveProgramming | Codeforces/CF1269-D2-E.cpp | /*
Author : manu_sy
Idea : To find the answer for k :
- bring all of them (1,2,..k) together in min swaps and count inversions
- Just write brute force and them optimize
- Inspiration from https://youtu.be/RrzIwj5k6cY
*/
#include "bits/stdc++.h"
using namespace std;
/** Template ... | ALGO | 0.999915 | 3.899752 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2019-08-13T06:18:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7039ba2... |
0b3edf94-42ca-4cb0-a506-246ef9696206 | xiaojun-wu/LeetcodeDailyChallengeGroup | leetcode694_Number_of_Distinct_Islands.cpp | class Solution {
public:
/**
* @param grid: a list of lists of integers
* @return: return an integer, denote the number of distinct islands
*/
int numberofDistinctIslands(vector<vector<int>> &grid) {
// write your code here
if(grid.size() == 0 || grid[0].size() == 0)
r... | ALGO | 0.999948 | 6.037397 | {
"github_metadata": {
"branch": "master",
"commit_count": 600,
"repo_created_at": "2021-04-15T22:18: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": "d33dd533... |
65ed9d45-72f6-4811-92d3-bfee535e210f | mahmoud-monem/CountingInversions | includes/order_statistic_set.hpp | #include <algorithm>
using namespace std;
struct node;
extern node *empty;
struct node {
int sum;
node *lf, *rt;
node() : sum(0), lf(this), rt(this) {}
node(int val) : sum(val), lf(empty), rt(empty) {}
};
node *empty = new node();
void add(int ind, int val, node *&nd, int ns = -1e9, int ne = 1e9) {... | ALGO | 0.999768 | 4.395171 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-04-29T19:01: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": "cd998f2d48... |
e46c6154-7f6f-414a-a524-40dc94e83864 | nayakashutosh9/CSES-Problemset-Editorial | Graph Algorithms/Cycle_Finding.cpp | /**
* author: <NAME> (@nayakashutosh9)
* created: [2020-10-23 13:10]
* "Compete against yourself"
**/
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
using namespace __gnu_pbds;
using namespace std;
#define int long long int
#define e... | ALGO | 0.999985 | 3.902304 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-09-14T11:40: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": "be1d939cb... |
e09e222c-217c-4f0f-89be-d695bfaa6c67 | naxocist/POSN-IPST | cses/Graph_algorithms/round_tripII.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 3;
vector<int> adj[N];
int path[N], color[N];
int dfs(int u) {
if(color[u] == 2) return 0;
if(color[u] == 1) return u;
color[u] = 1;
for(int v : adj[u]) {
if(color[v] == 2) continue ;
path[v] = u;
int d = dfs(v);
if(d) return d;
}
c... | ALGO | 0.999969 | 4.209146 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2023-10-26T03:06:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "081a81fa798... |
ba3b1868-6bf2-4ab5-b03d-2df10d6a0161 | pauljxtan/nbody | src/nbody.cpp | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <valarray>
#include "nbody.hpp"
void NBody::print_state() {
std::cout << t << " ";
for (unsigned i = 0; i < X.size() - 1; i++)
std::cout << X[i] << " ";
std::cout << X[X.size() - 1] << "\n";
}
void NBody::write_stat... | ALGO | 0.988403 | 4.413472 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2014-10-13T21:59: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": "a3006c8b9... |
d57fd313-872c-4ddb-b64d-4e171f0cf24f | yubinbai/leetcode | src/evaluate_division/main.cpp | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
class Solution {
public:
vector<double> calcEquation(vector<vector... | ALGO | 0.999902 | 5.600643 | {
"github_metadata": {
"branch": "master",
"commit_count": 686,
"repo_created_at": "2013-05-08T18:43:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 130,
"forks": 73,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a852... |
cc2a738e-71ce-4e63-be59-390136408617 | Pozwcc/School-Work | 4.22.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int workers = 2, count;
string gender, name,male,female;
int years_worked;
int apousies =0;
int apousies_male_10 = 0;
int apousies_male = 0, apousies_female = 0;
for(count=1; count<=workers; count++){
... | TOOL | 0.944152 | 3.725055 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-02-12T09:25: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": "f85c19614d5... |
7070baaf-8818-497f-97af-b8215c9f0f1e | SabbirIrfan/ML | baloon_burst.cpp | #include <iostream>
#include<vector>
using namespace std;
int n;
// recursive function to generate scores
int dp[100][100];
int maxCoins(vector<int>& nums) {
int n = nums.size();
nums.insert(nums.begin(), 1);
nums.push_back(1);
vector<vector<int>> dp(nums.size(), vector<int>(nums.size(... | ALGO | 0.999964 | 4.271115 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-03-18T15:24: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": "029a99f40ab6... |
76f37647-32c9-46ea-803b-2720a05b1097 | LittleYang0531/CQ-CSP-S-2021 | CQ-00112/airport/airport.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
int b, e, s;
};
int n, m1, m2, ansa[100007], ansb[100007], o, ansak, ansbk, ab, bb, ma[100007], mb[100007];
Node a[400007], b[400007];
bool cmp(Node x, Node y) {
return x.b < y.b;
}
int main () {
freopen("airport.in", "r", stdin);
freopen("airpo... | ALGO | 0.999376 | 3.30887 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-10-23T14:42:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e2ac3fe3378... |
281560a5-cd10-4708-9f54-b1151ebc6e71 | crawl/crawl | crawl-ref/source/stepdown.cc | /**
* @file
* @brief Stepdown functions.
**/
#include "AppHdr.h"
#include "stepdown.h"
#include <cmath>
#include "random.h"
double stepdown(double value, double step)
{
return step * log2(1 + value / step);
}
int stepdown(int value, int step, rounding_type rounding, int max)
{
double ret = stepdown((dou... | ALGO | 0.999576 | 5.584294 | {
"github_metadata": {
"branch": "master",
"commit_count": 72070,
"repo_created_at": "2014-08-17T10:39:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2591,
"forks": 1461,
"issues": 428,
"pull_requests": 88
},
"file_meta": {
"content_id":... |
1c9df2f9-58c8-4dc6-ad4c-298a3f90b450 | starpolar/openProject | Study/Algorithms/TIL_C/TIL_Coding/before/7월/31.cpp | //10818 최소, 최대
//배열
#include <iostream>
using namespace std;
#include <vector>
int main() {
int n = 0;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
}
int tmp, min = 0, max = 0;
//cin >> tmp;
//if (tmp < 500000) {
// min = tmp;
//}
//else {
// max = tmp;
//}
for (int i = 0;... | ALGO | 0.999942 | 4.165296 | {
"github_metadata": {
"branch": "main",
"commit_count": 180,
"repo_created_at": "2023-08-24T08:39: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": "81411c9213... |
465d5ceb-0b26-487a-b088-47fe4b43a2d3 | antori82/FANTASIA | FANTASIA/ThirdParty/aGrUM/Includes/agrum/BN/inference/tools/estimator.h | /**
*
* Copyright (c) 2005-2023 by <NAME>(_at_LIP6) & <NAME>(_at_AMU)
* info_at_agrum_dot_org
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the Lice... | ALGO | 0.99921 | 4.98927 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2021-03-01T21:03:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9ab92185... |
79f14336-39e3-47b5-a617-d88d217e4a2f | pglen/wavfrag | wflib/WavLet.cpp |
/* =====[ WavLet.cpp ]==========================================================
Description: The wflib project, implementation of the WavLet.cpp
... | ALGO | 0.968263 | 3.880935 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-09-02T21:36: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": "18e4451de4... |
c921c335-291c-485f-90a7-d8799bc0df78 | kaustubh-tripathi-1/dsa-with-cpp | Leetcode Qs/LinkedLists/160-intersection-of-2-linked-lists/160.cpp | #include<bits/stdc++.h>
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 *getIntersectionNode(ListNode *headA, ListNod... | ALGO | 0.99963 | 5.682365 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2025-05-11T04:22: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": "ec75fe387fe... |
78624f34-3886-49c3-b9b5-42d2a0bbafed | ElijahInamarga/monopoly_board | monopoly_board.cpp | #include <iostream>
#include <string>
using namespace std;
// Data class to store a string and an integer
class MonopolyBoard {
public:
string propertyName;
string propertyColor;
int value;
int rent;
MonopolyBoard() {}
MonopolyBoard(string propertyName,string propertyColor,int value, int rent... | TOOL | 0.902664 | 6.323336 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2024-09-30T05:04: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": "cda1e40da3... |
2842a28b-cb04-4436-884f-f5e4d9867550 | zaehuun/Python-Algorithm | 프로그래머스/2020 카카오 인턴십/키패드 누르기.cpp | //https://programmers.co.kr/learn/courses/30/lessons/67256
//맨 첨엔 거리 구할 때 dfs로 구해야 되나 했는데 너무 비효율적이고..
//좌표로 구할까 했는데 하나 하나 다 맵핑 시키는 것이 귀찮았다..
//다른 코드는 금방 작성했는데 31,32번 줄 코드 구하는 데에만 거의 30분 쓴 거 같다
//다시 풀어보기
#include <string>
#include <vector>
#include <cmath>
using namespace std;
string solution(vector<int> numbers, str... | ALGO | 0.999996 | 5.166119 | {
"github_metadata": {
"branch": "master",
"commit_count": 344,
"repo_created_at": "2020-06-27T20:22:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e89b19e7... |
630ebe85-7e64-4791-8a51-eaff736dcd26 | alxsoares/OI | poj/p2828.cpp | /*
* My First Treap
*/
#include <cstdio>
#include <cstdlib>
#include <ctime>
#define MAXN 200010
struct Node
{
int val, priority, size;
Node *ch[2];
} tree[MAXN], *queue[MAXN*2], *stack[MAXN], *root, *Null;
int top1 = 0, top2 = 0;
int seq[MAXN], seqNum;
Node *New_Node(int val)
{
Node *x;
if(top2)
x = stack[t... | ALGO | 0.999991 | 3.991127 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-06-29T20:25:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb1572c9fb... |
47c76811-cb39-41d4-9456-9cb6e696651a | partho-das/CompetitiveProgrmming | CP_CODE/Light OJ/1437.cpp | #include <bits/stdc++.h>
using namespace std;
//____________________________________________________________________________________________________________________________________
#define PI 2*acos(0.0)
#define pf printf
#define sc scanf
#define ff first
#define ss second
#define pb push_back
typedef long long... | ALGO | 0.9999 | 3.62812 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-03-30T08:21: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": "d2751ea54920... |
3253a8f5-468a-4d3a-acb5-5010298c9099 | Fouad-AJ/BLE-Encryption-prototype | ecdh.cpp | #include <stdio.h>
#include <openssl/ecdh.h>
#include "util.cpp"
#define CURVE_NAME NID_X9_62_prime256v1
void print_public_key(const EC_KEY *key) {
const EC_POINT *key_public = EC_KEY_get0_public_key(key);
/* Extract X and Y coordinates for public key */
BIGNUM *key_x = BN_new();
BIGNUM *key_y = BN_n... | ALGO | 0.988837 | 5.492159 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-26T23:34: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": "369926629fd2... |
2ea8acab-d2a3-4a9a-a099-a4e28921c599 | Kdot011/Blackjack-Die | DieMain.cpp | //<NAME>
//CS236
//Fall 2024
#include <iostream>
#include "Die.h"
using namespace std;
int main(){
Die userDie,computerDie;
char choice;
int userTotal=0,computerTotal=0;
cout<< "Let's play a game of 21!"<<endl;
cout<<"The winner is the player with the higher total but not over 21."<<endl;
do... | ALGO | 0.999015 | 4.502888 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-17T05:24: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": "a61ec0c0edf8... |
0ce39cdb-6262-42bf-b523-5c3ebc66e960 | nachiketkanore/CP-Trash | Learning/sol.cpp | /**
* Author: <NAME>
* Created: Thursday 29 July 2021 04:55:25 PM IST
**/
// For heavy recursions
// #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math,inline")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,lzcnt,mmx,abm,avx,avx2")
#include <algo... | ALGO | 0.999992 | 4.508652 | {
"github_metadata": {
"branch": "main",
"commit_count": 370,
"repo_created_at": "2021-08-04T18:15:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86e98f7f6b... |
0b85ef8f-12e5-41ea-a88b-8124993f7e81 | aleksbelov/MIPT-programming | Computational-Mathematics/gauss/gauss.cpp | #include <Eigen/Dense>
#include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(){
// Input
int D;
double eps = 0;
cin >> D >> eps;
MatrixXd m(D,D);
VectorXd f(D), x(D);
for (int i = 0; i < D; i++)
for (int j = 0; j < D; j++)
cin >> m(i,j);
for (int i = 0; i < D; ... | ALGO | 0.999946 | 4.04697 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2015-10-27T15:05: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": "d141d710c... |
05626817-6b5d-4f9f-bc53-637dae0f81b5 | ergawy/usaco-solutions | 05 Milk2/Main2.cpp | /*
ID: kareem_2
PROG: milk2
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
struct Milking {
int start;
int end;
};
int milkingCompare(Milking m1, Milking m2) {
return m1.start < m2.start;
}
int __main() {
ifstream fin("milk2.in");
ofstream fout("milk2.out");
... | ALGO | 0.999839 | 3.679791 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2014-09-26T10:49: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": "fe5b7b363... |
18049594-b5b6-4f10-a9bd-6af8d765da90 | abigail-z/8042Asn1 | COMP8042A1Test.cpp | #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <string>
#include "Rectangle.h"
#include "Matrix.h"
#include "Josephus.h"
#include "LinkedList.h"
using namespace std;
ostream &operator << (ostream& s, Rectangle r)
{
s << "Rectangle: " << r.GetLength() << "x" << r.GetWidth();
retur... | ALGO | 0.992594 | 4.035181 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-01-18T00:46: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": "e29d5dfdf... |
06cbdbaa-9e53-44ef-ba62-726b27421bd1 | crimson000000/OIcode | SPOJ/SP703.cpp | #define LOCAL
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
inline int read()
{
int x = 0, f = 1;
char ch = getchar();
while(ch < '0' || ch > '9')
{
if(ch == '-') f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9')
{
... | ALGO | 0.999987 | 3.91999 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-07-06T06:03:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a3e23aa09d... |
f065861d-c15e-402d-9529-7b176703908d | nur-alam/Data-Structure-Algorithm | withCpp/LinkedList/singlylinkedlist.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
struct Node{
int data;
struct Node* next;
};
Node* create_node(int data,Node* next){
Node *newnode = (Node* )malloc(sizeof(Node));
if(newnode==NULL){
printf("Error! Could Not Create A New Node\n");
exit(1)... | ALGO | 0.999905 | 4.207009 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2016-11-21T18:16:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "f8183f692... |
af9b7f8b-00f6-4cc2-a808-94d2d6ccb202 | aneesh2312/CompetitiveProgramming | Topcoder/SRM396-D1-500.cpp | /*
Do a flood fill algorithm to identify connected components. Fill gaps in vertical and horizontal lines (the # belonging to same component
shouldnt have any gaps). Recursively call same function to take care of merged blocks.
*/
#include <iostream>
#include <vector>
using namespace std;
class FixImage
{
vector< v... | ALGO | 0.999884 | 4.309197 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-05-10T07:12: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": "16a814e318... |
9b3407a3-a2db-43bf-9010-0b2147dd6137 | axelu/leetcode | cpp/00000-00499/androidunlockpatterns.cpp |
// 351. Android Unlock Patterns
// https://leetcode.com/problems/android-unlock-patterns/
class Solution {
private:
int rec(string& pattern, int& used, int rem) {
// cout << "rec pattern " << pattern << endl;
if( rem == 0 )
return 1;
// last dot
int src = pattern.back... | ALGO | 0.999692 | 5.263244 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2021-04-08T21:22: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": "254a3058323... |
08db0b96-76ad-49cd-b130-0bfe4853a29b | Antidote21/Algorithm | Baekjoon/3109.cpp | #include <iostream>
using namespace std;
int dy[3] = {1, 1, 1};
int dx[3] = {-1, 0, 1};
int map[10000][500];
int dp[10000][500];
int R, C, cnt;
bool dfs(int x, int y){
if(y == C-1){
cnt++;
return true;
}
map[x][y] = 1;
for(int i = 0; i < 3; i++){
int xx = x + dx[i]... | ALGO | 0.999665 | 4.634901 | {
"github_metadata": {
"branch": "main",
"commit_count": 627,
"repo_created_at": "2022-08-02T14:05: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": "1df8aed34c... |
30e4592c-d1ff-44f0-a0c1-433f9bb2becf | zzalscv2/FFEA | include/CheckTetrahedraOverlap.h | //
// This file is part of the FFEA simulation package
//
// Copyright (c) by the Theory and Development FFEA teams,
// as they appear in the README.md file.
//
// FFEA 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 ... | TOOL | 0.928995 | 5.294252 | {
"github_metadata": {
"branch": "master",
"commit_count": 2443,
"repo_created_at": "2021-04-08T11:52:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "ba10e8a... |
c4ea58dc-e5ec-4cfa-b425-b1874841446d | LnwZaZaToon/Algorithm | nerest.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int findClosestIndex(const vector<int> &arr, int target) {
int closestIndex = 0;
for (int i = 1; i < arr.size(); i++) {
if (abs(arr[i] - target) < abs(arr[closestIndex] - target)) {
closestIndex... | ALGO | 0.999997 | 6.262035 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-04-26T15:06: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": "8b749332b7e5... |
9677c74b-a558-49f4-b5d9-831f4c223866 | tianlu1677/leetcode | SimplifyPath/Solution.cpp | class Solution {
private:
void pathToDirectories(stack<string> &directories, string &path) {
string name;
name.clear();
path += '/';
for (int i = 0; i < path.size(); i++) {
if (path[i] == '/') {
if (!name.empty()) {
if (name[0] == '.' &... | ALGO | 0.999946 | 5.600431 | {
"github_metadata": {
"branch": "master",
"commit_count": 1229,
"repo_created_at": "2016-11-22T06:12:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "569bcad... |
26cea7c1-8e8c-4b04-aed0-4ab1b183ddbc | Filimovich/oaip_ex3_l3.v11 | ex3.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
double func_sum(double x);
double func_yx(double x);
double factorial(double arg);
double digit_input();
int check_delta(double y, double sum);
int doubleOverflow_error(double digit);
int stepSize_check(double step, double startNum, double e... | ALGO | 0.999573 | 4.155822 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-11-15T19:30: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": "744d76bd4103... |
f87323c8-a08d-4294-ac62-2bbfce90fc95 | sanyamjain1408/DSA | code/insertion_sort.cpp | #include <iostream>
using namespace std;
void insertion_sort(int n , int arr[]){
for (int i = 0; i < n; i++)
{
int j = i;
while (j > 0 && arr[j]< arr[j-1] )
{
int temp = arr[j];
arr[j] = arr[j-1];
arr[j-1] = temp;
j--;
}
}
cout << " Array o... | ALGO | 0.999698 | 5.030124 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-04-01T16:40: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": "065976f8f55... |
c9c64a5c-7306-467c-a51b-8259cb6ed3ba | 51Sirius/algo-first-sem | Lab 3/A.cpp | #include <iostream>
typedef struct node{
int key;
struct node *next;
} node;
typedef struct qu {
node *head;
node *tail;
int count;
} qu;
void create(qu *queue){
queue->head= new node;
queue->head->next= nullptr;
queue->tail=queue->head;
queue->count = 0;
}
void push(qu *queue, i... | ALGO | 0.999971 | 4.386456 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-03-05T13:44: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": "3685d108d2... |
4d78c25d-3cb9-4ee8-a4cc-db0d5165e47f | vickvey/Codeshef | STARTERS105/p3.cpp | /**
* <NAME>
* Author: <NAME>
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
void solve() {
// code here
ll n = 0;
cin >> n;
vector<ll> arr(n);
for(ll i = 0; i < n; i++) {
cin >> arr[i];
} // all input taken
// logic
ll sum ... | ALGO | 0.999868 | 4.749155 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-09-13T14:45: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": "eec4c87a9a5... |
f1f2f6b0-0220-425a-a507-c02c693d2372 | GOKU-Sudo/DSA | DSA/questions/FindtheHighestAltitude.cpp | // 1732. Find the Highest Altitude
// There is a biker going on a road trip. The road trip consists of n + 1 points at different altitudes. The biker starts his trip on point 0 with altitude equal 0.
// You are given an integer array gain of length n where gain[i] is the net gain in altitude between points i an... | ALGO | 0.999272 | 6.264827 | {
"github_metadata": {
"branch": "main",
"commit_count": 112,
"repo_created_at": "2023-06-08T16:25:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "3713ee8440... |
5a312eed-bafc-4aa5-9afa-cb129216917e | herywang/algorithm | leetcode_alg/solution91.cpp | /**
* @file solution91.cpp
* @author your name (<EMAIL>)
* @brief 解码方法
* @version 0.1
* @date 2022-08-31
* 动态规划
* @copyright Copyright (c) 2022
*
*/
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
int numDecodings(string s) {
int N = s.length(... | ALGO | 0.999928 | 5.094125 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2022-07-24T14:25:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01b8357b9... |
65ee5b06-5cd9-4d6d-9218-747ef1c22894 | cyp0922/SWEA | [모의 SW 역량테스트] 홈 방범 서비스_2117번.cpp | #include<iostream>
#include<queue>
#include<algorithm>
#include<cstring>
#include<vector>
#include<stdio.h>
using namespace std;
int N, M;
int arr[21][21];
bool visited[21][21];
struct is {
int y;
int x;
int k;
};
int dy[] = { -1,0,1,0 };
int dx[] = { 0,1,0,-1 };
int MAX = 0;
void bfs(int cy, int cx) {
... | ALGO | 0.999865 | 4.270713 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-04-18T09:35: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": "f3c6fb58d038... |
a334efe4-75dd-4516-ae24-bc47cd24d31c | Carnoustie/Cortado | Matrix.hpp | #include "Vector.hpp"
using namespace std;
class Matrix{
public:
Matrix(int numRows, int numColumns); //Constructor
int rows;
int columns;
Matrix operator+(Matrix const otherMatrix); // Addition
Matrix operator-(Matrix const otherMatrix); // Subtraction
Matrix operator*(Matrix const otherMatrix); //M... | ALGO | 0.928249 | 4.334208 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-07-25T18:46:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f6eb0384f5... |
44ddce9e-23b2-443e-a41e-3c16a25f7d8d | NullPointer-coder/cs_learning_lectures | Kafi_CS181/Lecture/Chapter Lecture/Chapter 18/Chapter 18_Linked list, list operations_/list operation.cpp | // Demonstrating various functions of the list doubly linked list class
// @author: <NAME>
#include <iostream>
#include <list>
using namespace std;
// display all the contents from the list
void showTheContent(std::list<int> listVar)
{
list<int>::iterator it; // using iterator to display values
for (it = list... | TOOL | 0.913686 | 5.390726 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-09-26T15:37: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": "5ddc648785a... |
c5e4a77e-a1a9-4e11-9ea7-88bd553dc86e | vasiloglou/PaperBoat | karnagio/0.6.6/include/fastlib/dense/linear_algebra.h | /*
Copyright © 2010, <NAME>
All rights reserved
http://www.ismion.com
Redistribution and use in source and binary forms, with or withou
modification IS NOT permitted without specific prior writte
permission. Further, neither the name of the company, Analytics130
Inc, nor the names of its employees may be used to endor... | TOOL | 0.986041 | 3.946694 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2012-01-09T05:14:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e376581... |
6fc9f6d7-9a49-4ba1-bfa9-dd4e8677b46b | itselaineZ/Disk-c-back | config/config.cpp | #include "config.h"
const int conf_num = 10;
const char* conf_item[][2] = {
{ "port", "80" },
{ "LOGWrite", "0" },
{ "sql_num", "8" },
{ "close_log", "0" },
{ "user", "root" },
{ "passwd", "<PASSWORD>@" },
{ "databasename", "disk" },
{ "actormodel", "0" },
{ "threadnum", "8" },
... | CONFIG | 0.924566 | 3.004545 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-06-25T18:38: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": "5ff1143cec... |
168decf2-2ac4-40cf-ad23-272996981a73 | algoshipda/trivial | problem_solving/BOJ/BOJ_1963.cpp | #include <bits/stdc++.h>
using namespace std;
int tt[4] = {1, 10, 100, 1000};
int prime[10000];
int dist[10000];
int main()
{
for(int i = 3; i < 10000; ++i){
prime[i] = true;
for(int j = 2; j * j <= i ; ++j){
if(i % j == 0){
prime[i] = false;
break;
}
}
}
int t;
cin >> t;
while(t--){
int a, ... | ALGO | 0.999724 | 4.084536 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2015-09-12T19:11:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b95b9655... |
86acb69e-dc59-42a8-95da-f2c41150b535 | spacegaori/aoc2023 | 3/part1.cpp | #include <cassert>
#include <cstddef> // std::size_t
#include <cmath> // std::floor
#include <fstream> // file i/o
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
bool isSymbol(const std::vector<int>& v, std::size_t row, std::size_t col, std::size_t stride) {
return (v[row + (col * ... | ALGO | 0.967957 | 4.592868 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-12-02T05:10: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": "8820c8e4050f... |
69c460ac-cb11-4b11-80e5-85c9d6ce9dd8 | Mehedi-16/Data_Structures_Seymour-algorithm--code- | Core Man/Insertion_sorting.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cout << "Enter number of elements: ";
cin >> n;
int arr[n];
cout << "Enter " << n << " integers: ";
for (int i = 0; i < n; i++)
cin >> arr[i];
// Insertion Sort
for (int i = 1; i < n; i++) { // i=======1 থেকে শুর... | ALGO | 0.999958 | 5.298565 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-04T15:26: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": "029acc86ea27... |
b85b727c-cb55-4380-b7c4-033174e33628 | Kewth/OJStudy | at_agc015_d.cpp | #if 0
2019.12.15
假设 l, r 的最高位 (k) 相同,那么 [l, r] 内的数的或的第 k 位一定为 1 。
那么第 k 位无需考虑,也就是说 l, r 可以去掉一些位直到 r 的最高位为 1 且 l 最高位为 0 。
设此时的位数为 k ,有 l < 2^k <= r 。
1) [l, 2^k) 内的数的或的集合恰好也是 [l, 2^k) ,因为两个数的或不会小于其中任意一个数。
2) [2^k, r] 内的数的或的集合是 [2^k, 2^k + 2^d) ,其中 d 是 r 去掉第 k 位后的最小的前导零。
3) 考虑 [l, 2^k) 和 [2^k, r] 之间的或,
也就是 [l, 2^k) 和... | ALGO | 0.999975 | 4.390611 | {
"github_metadata": {
"branch": "master",
"commit_count": 779,
"repo_created_at": "2019-02-26T09:28:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a5e5b73... |
13e96fe1-d125-402a-bcc4-cdb31042072d | superchessengine/sce | src/StaticEvaluatorNN.h | //
// Created by khushitshah on 2/28/22.
//
#ifdef USE_NN
#ifndef SCE_STATICEVALUATORNN_H
#define SCE_STATICEVALUATORNN_H
#include "cppflow.h"
#include <iostream>
#include "position.hpp"
#include "constants.h"
#include "utils.h"
#include <math.h>
#include "SETT.h"
namespace sce {
class StaticEvaluatorNN {
static c... | ALGO | 0.998878 | 5.658181 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2022-02-02T02:24:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47eb4160ac9d... |
675cfdef-d96c-4c74-be60-467bb6b2b6c2 | gitzx/Data-Structure-Algorithm | LeetCode/Array/Merge_Sorted_Array.cpp | /*Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B.
The number of elements initialized in A and B are m and n respectively.
*/
#include <iostream>
using namespace std;
... | ALGO | 0.999955 | 5.147663 | {
"github_metadata": {
"branch": "master",
"commit_count": 252,
"repo_created_at": "2013-11-16T07:22: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": "235e1b3e... |
a847318f-397c-4512-932a-5c35c48d0abf | mnasser02/cp-notebook | CSES Problem Set/dynamic-programming/increasing-subsequence.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef tuple<int, int, int> iii;
typedef pair<ll, ll> pll;
typedef ... | ALGO | 0.999726 | 4.71659 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-03-18T13:46: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": "39f97bfe252... |
30c8570d-4db0-44e9-9545-cdd79a7861b0 | shihyu/C_and_CPP | CPP/data/深度學習C++/src/2nd_edition/ch15/string_op.cc | #include <iostream>
#include <string>
using namespace std ;
// 字串重複 n 次
string operator* ( const string& foo , unsigned int n ) {
string tmp = foo ;
for ( int i = 1 ; i < n ; ++i ) tmp += foo ;
return tmp ;
}
// 字串重複 n 次
string& operator*= ( string& foo , unsigned int n ) {
return foo = foo * n ... | TOOL | 0.997089 | 3.970048 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2013-12-04T07:26:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac53559b... |
eda268b2-10a8-4006-bcef-f43554413092 | rlj1202/problemsolving | baekjoon/2294/main.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int arr[102];
int dp[102][10004];
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
int N, K;
cin >> N >> K;
for (int n = 1; n <= N; n++) {
cin >> arr[n];
}
memset(dp, INF, size... | ALGO | 0.999985 | 4.153101 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2019-05-12T13:03: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": "8fceb66efa0... |
0cd4187b-b146-49be-b313-bf5e98c04d7a | u-sho/kyopro | atcoder/abc/1/81/e.cpp | #include <bits/stdc++.h>
using namespace std;
using lli = long long;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
size_t N, M;
cin >> N >> M;
vector<lli> H(N);
for (lli &Hi : H) cin >> Hi;
vector<lli> W(M);
for (lli &Wi : W) cin >> Wi;
sort(H.begin(), H.end());
... | ALGO | 0.999974 | 3.437301 | {
"github_metadata": {
"branch": "main",
"commit_count": 142,
"repo_created_at": "2022-02-05T20:01: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": "baa9e4d109... |
35f464b3-be55-4036-90a9-82571720a6c4 | saurabh98s/100-days-of-code | day15_linked_list/kthNodeFromEnd.cpp | #include <iostream>
#include <string>
#include <map>
using namespace std;
struct Node
{
int data;
Node *next;
};
struct LinkedList
{
string name;
Node *head;
};
struct Node *head;
void InsertatHead(Node **head, int x)
{
Node *temp = new Node();
temp->data = x;
temp->next = NULL;
if (... | ALGO | 0.999778 | 3.764752 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2019-08-20T13:55:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30e075e29... |
6e34392e-61fc-43cd-9d02-42516034eb74 | ayushranjan002/DSA-Questions | Binary Search/painter partition problem(code 360).cpp |
bool isPossible(const vector<int>& boards, int k, int mid) {
int noOfPainters = 1;
int totalTime = 0;
int n = boards.size();
for (int i = 0; i < n; i++) {
if (totalTime + boards[i] <= mid) {
totalTime += boards[i];
} else {
noOfPainters++;
if (no... | ALGO | 0.99995 | 5.725935 | {
"github_metadata": {
"branch": "main",
"commit_count": 172,
"repo_created_at": "2024-06-18T19:41: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": "7524c59f13... |
e2e525d1-7b96-4247-8a33-0b036eaaac16 | kaayush71/Ds-Algo-Hacktoberfest | cpp/sparseMatrix.cpp | #include <iostream>
using namespace std;
int main()
{
int rows, i, j, columns, size = 0;
cout << "Enter the size of matrix" << endl;
cout << "Enter the number of rows :" << endl;
cin >> rows;
cout << "Enter the number of columns :" << endl;
cin >> columns;
int A[rows][columns];
cout <... | ALGO | 0.999501 | 3.411736 | {
"github_metadata": {
"branch": "master",
"commit_count": 230,
"repo_created_at": "2020-06-18T18:44:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 66,
"issues": 2,
"pull_requests": 30
},
"file_meta": {
"content_id": "3ef69... |
a3ae6ef0-1215-4a44-950b-7136589a3911 | moinak878/SegTree | test.cpp | // #include<bits/stdc++.h>
// using namespace std;
// int add(int a,int b){
// cout << "I am here in a,b = " << a << "," << b << endl;
// return a + b;
// }
// int main(){
// int a, b;
// add(5, 7);
// cout<<"The sum is : "<<add(1, 2);
// }
//testing if i can implement segment tree sleepily
#inclu... | ALGO | 0.99991 | 4.826202 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-07-06T07:13: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": "272a4c62100f... |
366bb619-dcf2-42d5-9102-7a793322ef34 | ishandutta2007/codeforces-h | hydroshiba/normal/1706/D1.cpp | #include "bits/stdc++.h"
using namespace std;
using lol = long long;
using ii = pair<int, int>;
using ll = pair<lol, lol>;
int inequality1(int a, int b){
int ans = (1 << 12) - 1;
for(int i = 11; i > -1; --i){
if(ans == 1) break;
if(b / (ans - (1 << i)) <= a) ans -= (1 << i);
}
return... | ALGO | 0.999674 | 4.244135 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d80188eb728... |
cc54a62a-2eb1-4a56-af57-f53766455ba5 | gargVader/CPP-Data-Structures-Algorithms-Launchpad | Challenges/Aggresive Cows.cpp | #include <bits/stdc++.h>
#define int long long
#define pb push_back
using namespace std;
// Returns whether a configuration is possible
// where the minimum distance between the cows is
// mid
bool isPoss(int a[], int n, int c, int mid) {
int last = 0;
int placed = 1;
for (int i = 1; i < n; i++) {
if (a[i] - a... | ALGO | 0.999986 | 4.253649 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-08-23T05:54:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 54,
"forks": 31,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cbede5... |
3e28d8a0-ea92-4b5c-9412-e9338d79ac94 | Segnite/DSA-Problems | graphs/fau/zabytki.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
using namespace std;
const int maxn = 2e6 + 5;
int rep[maxn];
vector<pair<int,int>> a;
int FIND(int a){
if(rep[a] == a)
return rep[a];
rep[a] = FIND(rep[a]);
return rep[a];
}
void UNION(int a,int b){
rep[FIND(rep[a]... | ALGO | 0.999992 | 3.902573 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-10-13T17:09: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": "93956fe09d38... |
53142151-9ee5-46fe-b301-b7d46a1cce2d | RaresC21/Algorithms | Graphs/SCC/scc.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define MAX 100
int energy[MAX];
int dfs_counter = 0, cur = 0;
int dfs_num[MAX], dfs_low[MAX];
bool visited[MAX];
vector<int> S;
vector<int> scc[MAX], path[MAX];
void tarjan(int u) {
dfs_low[u] = dfs_num[u] = dfs_counter++;
S.push_back(u... | ALGO | 0.999887 | 3.548631 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2016-09-21T03:26: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": "d5d0612af... |
52bd4218-787d-4afe-a6f3-4fba39a34c1f | ksercs/school_olympiads | 2017/Всесибирская/Закл/E/E.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
using namespace std;
FILE* file;
const int MAX_SIZE = 2000+15;
int n, m, answer, ax, ay, us, fl;
char tabl[MAX_SIZE][MAX_SIZE];
int ans[MAX_SIZE][MAX_SIZE], used[MAX_SIZE][MAX_SIZE],
dx[] = {-1, 1, ... | ALGO | 0.999887 | 3.208616 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-07-25T13:25: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": "343a9af63a... |
da528580-1e74-4bb0-b6ca-47aa30e88700 | LucasZhangPrivate/LeetCode | Ruan/981H_Time_Based_Key-Value_Store.h | /*Create a timebased key-value store class TimeMap, that supports two operations.
1. set(string key, string value, int timestamp)
Stores the key and value, along with the given timestamp.
2. get(string key, int timestamp)
Returns a value such that set(key, value, timestamp_prev) was called previously, with timestamp... | ALGO | 0.999533 | 6.546931 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2019-03-20T01:05:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe089349e... |
79813718-b6fb-4381-afb4-b42917047100 | mauriciopoppe/blog | site/static/code/math/babyStepGiantStep.cpp | /**
* Let `a`, `b` and `n` be **integers**, where `a` and `n` are coprime,
* the following is an implementation of Shank's baby step giant step
* algorithm which attempts to find a solution for the congruence
*
* a^x ≡ b (mod n)
*
* `x` can be represented as `im + j` then
*
* a^j ≡ b(a^{-m})^i (mod n)
*
... | ALGO | 0.999986 | 5.119638 | {
"github_metadata": {
"branch": "main",
"commit_count": 560,
"repo_created_at": "2015-08-26T03:25:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 6,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f6bdf5d6... |
36b33b27-a469-4f7c-b0fb-bcdddebb1d1f | GWmodel-Lab/libgwmodel | include/gwmodelpp/SpatialAlgorithm.h | #ifndef SPATIALALGORITHM_H
#define SPATIALALGORITHM_H
#include "Algorithm.h"
#include "armadillo_config.h"
namespace gwm
{
/**
* \~english
* @brief Abstract spatial algorithm class.
* This class cannot been constructed.
* It defines some interface commonly used in spatial algorithms.
*
* \~chinese
* @brief ... | ALGO | 0.969199 | 6.656284 | {
"github_metadata": {
"branch": "master",
"commit_count": 502,
"repo_created_at": "2020-10-10T07:48:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 1,
"issues": 6,
"pull_requests": 3
},
"file_meta": {
"content_id": "034b2e7a... |
e59b378a-4762-40a9-ad25-011aa40cb7a0 | jMetal/jMetalCpp | src/metaheuristics/smsemoa/FastSMSEMOA.h | // FastSMSEMOA.h
//
// Author:
// <NAME> <<EMAIL>>
//
// Copyright (c) 2014 <NAME>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
//... | ALGO | 0.999949 | 6.418677 | {
"github_metadata": {
"branch": "master",
"commit_count": 331,
"repo_created_at": "2014-09-26T11:44:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 67,
"forks": 34,
"issues": 11,
"pull_requests": 1
},
"file_meta": {
"content_id": "9334dd... |
1a47bcd9-c811-46be-a9ac-fe17375d5f60 | OgonxCode/CodingJourney | C++/2024 c++/2024-10-21_seminar3/seminar3/lab7.cpp | #include <iostream>
class NumDays {
private:
double hours;
public:
//construct
NumDays(double h = 0) : hours(h) {}
void setHours(double h) {
hours = h;
}
double getHours() const {
return hours;
}
double getDays() const {
return hours / 8.0;
}
/... | TOOL | 0.978914 | 4.673757 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-19T07:21: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": "f6270d72e83f... |
bdd726f1-903e-42c3-903c-4060b5f26cc2 | wangfanstar/dsa | src/vector/Vector_search_binary_A.h | /******************************************************************************************
* Data Structures in C++
* ISBN: 7-302-33064-6 & 7-302-33065-3 & 7-302-29652-2 & 7-302-26883-3
* <NAME>, <EMAIL>
* Computer Science & Technology, Tsinghua University
* Copyright (c) 2003-2019. All rights reserved.
********... | ALGO | 0.999963 | 4.838738 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-03-08T05:23:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fe26bb520... |
7a7e93e5-417a-47f5-925f-7649b9388d64 | rainbow-auto/rainbow-codes | Comp/24-09-21 CF974/2014D.cpp | #include <bits/stdc++.h>
// #pragma GCC optimize(2)
using i64 = long long;
using f64 = long double;
#define fastread std::ios::sync_with_stdio (false); std::cin.tie(nullptr);
#define rep(QWQ, qwq, qaq) for (i64 QWQ = (qwq); (QWQ) <= (qaq); QWQ++)
#define per(QWQ, qwq, qaq) for (i64 QWQ = (qwq); (QWQ) >= (qaq); QWQ--... | ALGO | 0.999958 | 4.068104 | {
"github_metadata": {
"branch": "master",
"commit_count": 749,
"repo_created_at": "2024-09-07T02:10: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": "392fa2f5... |
47ffba8f-0925-4847-9322-5dcec4a49d1d | bibhu107/cp | arraysub.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
ll n;
cin >> n;
vector<int> v;
int a;
for(int i = 0 ; i < n ; i++){
cin >> a;
v.push_back(a);
}
ll k,max;
cin >> k;
int j = k-1;
max = 0;
int mxind = -1;
for(int i = 0 ; i <= j ; i++){
if(max < v[i])
{
max = v[i]... | ALGO | 0.999997 | 3.279141 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-02-25T18:47: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": "e935a01cdb... |
a921afaf-2db0-40ca-a4d4-7a0aa33fdfce | Saifur-Rahman03/Codes | Codes/2-2/CSE 2202/10C/Dijkstra shortest path.cpp | #include <bits/stdc++.h>
#define V 6
using namespace std;
int minD(int d[], bool sp[]);
int printS(int d[]);
void dijsktra(int graph[V][V], int s);
int main()
{
ifstream fin;
int graph[V][V];
fin.open("input.txt");
// fin >> V;
for(int i = 0; i < V; i++)
for(int j = 0; j < V; j++)
fin >> graph[i][j];
dijskt... | ALGO | 0.999874 | 4.207357 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2022-06-16T15:34: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": "91de82e40... |
68d30826-001d-4f21-8274-d84bdaf5ca44 | dorachoii/Algorhythm | Algorithm/BOJ/WEEK04/A_19942_3.cpp | #include <bits/stdc++.h>
using namespace std;
int n, mnNutri[4], a[16][5], nutri[4], price, mnPrice = 1000;
vector<int> selectedF;
vector<vector<int>> Fcombi;
vector<vector<int>> stsfFcombi;
int main() {
// 음식 개수
cin >> n;
// 최소 영양소
for (int i = 0; i < 4; i++) {
cin >> mnNutri[i];
}
... | ALGO | 0.999982 | 4.403932 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2024-01-08T07:26: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": "1cc3a5f45d9... |
b1118e72-8378-40d7-81c3-e78f77f2e883 | Prince-1501/Hello_world-Competiitve-Programming | Leetcode/Graph/Find Eventual Safe States.cpp | // https://leetcode.com/problems/find-eventual-safe-states/
class Solution {
public:
bool DFSRec(int s, vector<bool>&visited, vector<bool>&dfsVisited, vector<vector<int>>& graph, vector<bool> &present_cycle){
visited[s] = true;
dfsVisited[s] = true;
vector<int>data = graph[s];... | ALGO | 0.999947 | 6.492297 | {
"github_metadata": {
"branch": "master",
"commit_count": 441,
"repo_created_at": "2019-03-14T18:08:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 177,
"forks": 63,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8bf4d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.