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 |
|---|---|---|---|---|---|---|---|
69967ddb-619e-4343-908d-cb4b2bf94e68 | powerLEO101/Work | Code/LG/LG3384/code.cpp | /**************************
* Writer : Leo101
* Problem : Luogu P3384 【模板】树链剖分
* Tags : 树链剖分
**************************/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#define File(s) freopen(#s".in", "r", stdin); freopen(#s".out", "w", stdout)
#define gi get_int()
const int Max_N =... | ALGO | 0.999981 | 3.924682 | {
"github_metadata": {
"branch": "master",
"commit_count": 658,
"repo_created_at": "2019-03-09T07: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": "8ec93417... |
7eefb8ec-e40f-474f-8dde-5e11b5957807 | ashfaqfardin/cpp-ds-sol | Insertion Sort - ANDF4yGw.cpp | #include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;
void insertion_sort(int a[], int size);
int main()
{
srand(time(NULL));
int size = 5;
int* arr = new int[5];
for(int i = 0; i < size; i++){
arr[i] = rand() % 100;
}
cout << "Unsorted List\n";
f... | ALGO | 0.999424 | 4.938298 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2022-04-24T19:18: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": "657fc4114da... |
0f50b2c7-d199-4d65-8ce6-f5d95f0168ac | ishandutta2007/codeforces-s | sw2000/normal/1404/C.cpp | #include <bits/stdc++.h>
#define x first
#define y second
#define mid (l+r>>1)
#define lo (o<<1)
#define ro (o<<1|1)
using namespace std;
typedef long long ll;
typedef vector<int>vi;
typedef pair<double,double> pii;
const int inf=0x3f3f3f3f;
const ll linf=0x3f3f3f3f3f3f3f3f;
const int maxn=3e5+10;
const ll mod=1e9+7;
c... | ALGO | 0.999995 | 3.544042 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "943c0f7471a8... |
1b619380-3e1d-4bb2-959e-7e35b030c69c | a1075665109/P0 | tree.cpp | //<NAME>
//CS4280 P0
#include <fstream>
#include <iostream>
#include <string>
#include <cstdlib>
#include "node.h"
#include "tree.h"
using namespace std;
//Different traversal functions and a build tree function
//seperated by space.
void inorder(Node *ptr, int depth,ofstream &fp){
if(ptr){
inorder(ptr->left,dep... | ALGO | 0.991893 | 3.942264 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-03-31T18:31: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": "80f903f074... |
5c8c0e29-c971-4117-9a74-ef4b13909a72 | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/1_1079_105.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool uax(T &x, T y) {
return (y > x) ? x = y, true : false;
}
template <typename T>
inline bool uin(T &x, T y) {
return (y < x) ? x = y, true : false;
}
void err(istream_iterator<string>) {}
template <typename T1, typename T2>
ostream &opera... | ALGO | 0.999968 | 3.581299 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59: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": "c2d929401ec... |
45608221-e366-405d-97e7-92c2f5001800 | mrashidz/CXX_Course_Demo | Day2/Assignment/ll.cpp | #include "ll.h"
element *genLL(const int &val) {
element *head = new element;
head->Next = nullptr;
head->Value = val;
return head;
}
void deleteLL(element *head) {
element *temp = head,*temp2;
while (temp != nullptr) {
temp2 = temp->Next;
delete temp;
temp = temp2;
... | ALGO | 0.996637 | 3.506224 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-10-02T09:44:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7254131e... |
6bf425ed-7de5-4de7-a77e-7bd52dd720f6 | ee99233/DataStruct | DateSturct/Project1/DataSturct.cpp | #include "DataSturct.h"
#include <iostream>
int Tree::Calc::result(Node * node)
{
if (node == nullptr)
return 0;
int n1=result(node->Left);
int n2=result(node->Right);
switch (node->type)
{
case Add: {return n1 + n2; }break;
case Sub: {return n1 - n2; }break;
case Multi: {return n1 * n2; }break;
case... | ALGO | 0.993604 | 3.494109 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-11-20T15:04: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": "788f576f0e... |
de3c44b7-ecab-4063-ac8a-8f479b71da70 | Forhad700/House-of-Cpp | Operator/operator_increment_decrement.cpp | #include<iostream>
using namespace std;
int main()
{
int a = 5;
int b = ++a; // ++a prefix increments x by one before it is used
cout<<"b = "<<b<<endl; // Now b = 6
cout<<"a = "<<a<<endl; // now a = 6
int c = a++; ... | ALGO | 0.994923 | 3.47691 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-08T20:40: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": "007d5cc601b7... |
76582766-ef2f-4738-8538-0b0e5c5cd5f2 | ishandutta2007/codeforces-i | intercept/normal/1620/F.cpp | #include<bits/stdc++.h>
#define ll long long
#define eb emplace_back
#define fi first
#define se second
#define pii pair<int,int>
using namespace std;
const int mod=998244353;
int kpow(int x,int y,int rex=0){
for(;y;y>>=1,x=1ll*x*x%mod)if(y&1)rex=1ll*x*rex%mod;
return rex;
}
int exgcd(int a,int b,int &x,int &y)... | ALGO | 0.999875 | 3.563048 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f522ec3f4315... |
29b82fd9-ac07-41bd-afdb-6323c5275e13 | MogaRiana/NewCode | Kattis/C++/Undead_or_Alive/main.cpp | #include <bits/stdc++.h>
#include <cstddef>
using namespace std;
#define endl '\n'
typedef long long i64;
typedef int i32;
typedef short i16;
typedef vector<i64> vi64;
typedef vector<vi64> vv;
typedef string str;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
str s;
getline(cin, ... | ALGO | 0.999735 | 3.204731 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2023-02-17T14:08:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4915174... |
46b56dea-5dc0-4e90-9bc2-e626c35f641c | vfolunin/archives-solutions | LeetCode/188.cpp | class Solution {
public:
int maxProfit(int opLimit, vector<int> &prices) {
int res = 0;
if (opLimit >= prices.size() / 2) {
for (int i = 1; i < prices.size(); i++)
if (prices[i] > prices[i - 1])
res += prices[i] - prices[i - 1];
} else... | ALGO | 0.999269 | 5.757922 | {
"github_metadata": {
"branch": "master",
"commit_count": 2367,
"repo_created_at": "2017-11-27T10:19:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "b90d966... |
93d33524-a282-4e8b-8d5f-33c25c3b2b2a | nnnlog/baekjoon | 2020.08.13/4803.cpp | #include <bits/stdc++.h>
using namespace std;
int UF[501];
void init(int size) {
for (int i = 1; i <= size; i++) UF[i] = i;
}
int find(int x) {
return UF[x] = UF[x] == x ? x : find(UF[x]);
}
bool merge(int a, int b) {
if (find(a) == find(b)) return false;
UF[find(a)] = find(b);
return true;
}
int main() {
/... | ALGO | 0.999929 | 4.414864 | {
"github_metadata": {
"branch": "master",
"commit_count": 632,
"repo_created_at": "2020-05-16T13:23:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "032078ea... |
d71ac1ef-b150-4e44-8365-bd9c6c75a33f | zeyf/cpp-competitive-programming | Courses/Graph Theory Algorithms for Competitive Programming/BFS/WordLadder.cpp |
int ladderLength(string beginWord, string endWord, vector<string>& wordList) {
map<string, vector<string>> graph;
int len = beginWord.size();
wordList.push_back(beginWord);
bool foundEndWord = false;
for (int x = 0; x < wordList.size(); x++) {
string wordX = wor... | ALGO | 0.999769 | 4.694491 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2022-03-20T15:40: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": "4da98a85c... |
ff737301-350c-4828-b711-28d56f322f67 | zhengry22/basics_of_programming | repos/明明的随机数/明明的随机数/明明的随机数.cpp | #include<iostream>
using namespace std;
int n;
int* number;
void order(int* a, int* b)
{
int temp;
temp = *b;
*b = *a;
*a = temp;
}
int main()
{
cin >> n;
number = new(int[n]);
for (int i = 0; i < n; i++)
{
cin >> number[i];
}
//先对number数组里的数据进行冒泡排序,小的在前,大的在后
for (int i = 0; i < n-1; i++)
{
int flag ... | ALGO | 0.999988 | 3.617902 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-02-19T03: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": "066cfb17957e... |
d251a043-6868-4772-90a8-fc602df3daa0 | Acephoeni-X/Data-Structures-And-Algorithms | Linked Lists/Circular Linked List/delete_head.cpp | #include<iostream>
using namespace std;
struct Node{
int data;
Node* next;
Node(int x){
data = x;
next = NULL;
}
};
Node* delHead(Node* head){
if(head == NULL) return NULL;
if(head->next == head){
delete head;
return NULL;
}
Node* p = head;
do{
p = p->next;
}while(p->next!=head);
Node* temp = hea... | ALGO | 0.999701 | 4.009768 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2022-10-01T09:09:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6949058c02a... |
940e1859-4e52-439b-8fd7-5938011bcd4f | NGSolve/mylittlengsolve | 2_Advanced/mpi/dd_precond.cpp | // ngscxx -shared dd_precond.cpp -lngcomp -o mydd.so
/*
parallel preconditioners:
Version 1:
diagonal
Version 2:
block-diagonal (inner, coupling)
Version 3:
sub-structuring
*/
#include <comp.hpp>
using namespace ngcomp;
namespace ngcomp
{
class MyDDPreconditioner : public Preconditioner
{
shared... | ALGO | 0.975231 | 5.119545 | {
"github_metadata": {
"branch": "master",
"commit_count": 301,
"repo_created_at": "2017-07-20T10:05:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b44a1a8... |
d7852fe1-bdcc-4733-9533-f9b18ba95e5a | Satori31022809947/CS205Project | Matrix.cpp | /*
* @Author: Satori <EMAIL>
* @Date: 2022-05-27 23:01:36
* @LastEditors: Satori <EMAIL>
* @LastEditTime: 2022-06-03 09:57:41
* @FilePath: \CS205Project\matrix.cpp
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
#include "in... | ALGO | 0.987995 | 5.025404 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2022-05-16T09:06: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": "fa2786e5b27... |
9988aa01-a82a-41eb-8129-bfebdf7461cb | keroro520/ACM | hust/ORZkuangbin->2/H.cpp | #include <stdio.h>
#include <algorithm>
#include <string.h>
using namespace std;
#define MAXM 50005
#define MAXN 1005
struct Edge {
int u, v, next, w;
} edge[MAXM * 2];
int head[MAXN], dis[MAXN], S[MAXN], hello[MAXN];
bool vis[MAXN];
int edge_num, n, inf, del, del2, ans;
void init()
{
edge_num = 0;
del = del2 = ... | ALGO | 0.999872 | 3.780028 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2014-04-15T10:11:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52539b081c... |
68e23749-fcf2-4027-8c83-7cc6902680d2 | changelonger/lanqiao | c++/过河卒/过河卒/源.cpp | #include<iostream>
using namespace std;
int dp[20][20];
int Next[8][2] = { {-2,-1},{-2,1},{-1,2},{-1,-2},{2,1},{2,-1},{1,-2},{1,2} };
int a, b;
int m, n;
int check(int x, int y) {
for (int i = 0; i < 8; i++) {
int xx = a + Next[i][0];
int yy = b + Next[i][1];
if (x == xx && y == yy)
return 0;
}
return 1;
}
... | ALGO | 0.99988 | 3.513723 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-03-01T12:56: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": "4a366e5596b... |
02a6fbf8-3f68-44d4-a42f-e399ff7dc38e | MenCodermin/ComputerSimualtion | Public/ComputerSimulationAssignment.h |
#pragma
#include <iostream>
#include <vector>
#include <math.h>
#include <random>
using namespace std;
#define SIM_TIME 1.0e6 // Simulation time
#define ARR_TIME 1.25 // Mean time between arrivals
#define SERV_TIME 1.00 // Mean service time
class Distribution
{
private:
double uniform();
public:
double... | ALGO | 0.999015 | 4.943872 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-01-14T01:54:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6236ef082ce9... |
6a8926a5-7570-4821-9998-a17061588a3e | SHL0915/BOJ_Problem_Solving | 백준/Gold/3108. 로고/로고.cc | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int N, cnt;
int map[2001][2001];
void rec(int a, int b, int c, int d);
void DFS(int x, int y);
int main(void) {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> N;
for (int i = 0; i < N; i++) {
int a, b, c, d;
cin >> a >> b >> c >... | ALGO | 0.999819 | 3.849048 | {
"github_metadata": {
"branch": "main",
"commit_count": 2813,
"repo_created_at": "2022-08-29T05:15: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": "f330da30c... |
848c3d68-1fe9-432e-9716-4fd6f2a7f861 | ishandutta2007/codeforces-i | igor_kudryashov/normal/220/E.cpp | #include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <climits>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>... | ALGO | 0.99969 | 3.886822 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b71da073ee9... |
52f91302-0653-430b-be22-628250c32c3f | oneandzeroteam/Algorithm_Review | Daehan/RATIO2.cpp | #include<iostream>
using namespace std;
long long game, win, ratio;
long long ret;
const long long MAX_ITER_NUM = 2000000000;
int calc(const long long& game, const long long& win) {
int lo = -1;
int hi = MAX_ITER_NUM+1;
while (lo + 1 < hi) {
int mid = (lo + hi) / 2;
if (ratio + 1 <= (win + mid) * 100 / (g... | ALGO | 0.999679 | 3.778813 | {
"github_metadata": {
"branch": "master",
"commit_count": 237,
"repo_created_at": "2016-09-14T09:15:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d77ef09e0... |
7a51ecbc-3a71-4687-a455-ae5b882264b0 | felipethome/coding-interview-solutions | src/cpp/list-to-binary-tree/list.cpp | /**
* Given a singly linked list where elements are sorted in ascending order,
* convert it to a height balanced BST.
*
* A height balanced BST: a height-balanced binary tree is defined as a binary
* tree in which the depth of the two subtrees of every node never differ by
* more than 1.
*
* Example:
*
* G... | ALGO | 0.999987 | 6.525984 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-06-09T17:50:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb8cbfa1f... |
a6f86d4d-7aba-4a74-a205-56fc84a84930 | sballari/MemocoEx | tsp-h/l04.heur.ls.tsp/1.LS/TSPSolverLS.cpp | /**
* @file TSPSolver.cpp
* @brief TSP solver (neighborhood search)
*
*/
#include "TSPSolver.h"
#include <iostream>
bool TSPSolver::solve ( const TSP& tsp , const TSPSolution& initSol , TSPSolution& bestSol )
{
try
{
bool stop = false;
int iter = 0;
TSPSolution currSol(initSol);
double bestV... | ALGO | 0.999954 | 5.354567 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2019-10-11T09:26: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": "cbf98e207... |
3c7917d3-44a5-4114-8ffe-54e74399ff07 | arnav-snowleo/myLeetcodeRepo | 130-surrounded-regions/130-surrounded-regions.cpp |
// starting from boundary elements which are marked as 'O' , do a DFS, mark it is '#'
// those 'O's connected with boundary 'O's cannot be conquered. so marked them as '#'
// rest 'O's which are not marked, will be conquered
class Solution {
private:
void dfs(int i,int j, int row, int col,vector<vector<char>>& ... | ALGO | 0.999916 | 5.882851 | {
"github_metadata": {
"branch": "main",
"commit_count": 852,
"repo_created_at": "2022-02-14T17:04: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": "f19abb61d6... |
423b4b24-93dd-490b-ae16-a02da73d92a9 | TanTien-Engine/tantien | thirdparty/ogdf/include/ogdf/layered/LayerByLayerSweep.h | /** \file
* \brief Declaration of interface for two-layer crossing
* minimization algorithms.
*
* \author <NAME>
*
* \par License:
* This file is part of the Open Graph Drawing Framework (OGDF).
*
* \par
* Copyright (C)<br>
* See README.md in the OGDF root directory for details.
*
* \par
* This pro... | ALGO | 0.970983 | 5.390388 | {
"github_metadata": {
"branch": "B-littleworld",
"commit_count": 1743,
"repo_created_at": "2021-01-13T00:44:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 55,
"forks": 12,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": ... |
0f93f27b-dcd0-47cb-8c3f-59607964dc17 | littlelid/OJ | poj/1157.cpp | #include<cstdio>
#include<iostream>
#include<string.h>
using namespace std;
int F, V;
int dp[105][105];
int v[105][105];
int dfs(int i, int j);
int main(void)
{
while(cin >> F >> V)
{
//cout << sizeof(dp) << endl;
for(int i = 1; i <= F; i++)
for(int j = 1; j <= V; j++)
... | ALGO | 0.999945 | 3.402889 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-02-13T14: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": "d499e200d... |
b136a7d4-d2a8-4a93-b59f-98c3af9ee3fc | manwar/perlweeklychallenge-club | challenge-069/ulrich-rieke/cpp/ch-2.cpp | #include <string>
#include <iostream>
#include <algorithm>
#include <iterator>
std::string mySwitch( const std::string & num ) {
std::string switched ;
std::string letter ;
for ( int i = 0 ; i < num.length( ) ; i++ ) {
if ( num.substr( i , 1 ) == "0" )
letter = "1" ;
else
letter = "0" ;
... | ALGO | 0.99909 | 3.468038 | {
"github_metadata": {
"branch": "master",
"commit_count": 44412,
"repo_created_at": "2019-03-30T01:15:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 194,
"forks": 332,
"issues": 5,
"pull_requests": 4
},
"file_meta": {
"content_id": "19... |
ec0109bc-9dff-47ce-84b0-846b362d1245 | kjinxin/NJUC- | work33.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int m,n,map[300][300],f[300][300],cf[300][300],a[100000],l,r,hash[300],fa[300];
int main()
{
scanf("%d%d",&n,&m);
int c,s,e;
memset(map,0,sizeof(map));
memset(f,0,sizeof(f));
for (int i=0; i<n; i++)
{
cin>>s>>e>>... | ALGO | 0.999955 | 3.508115 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-11-05T06:30: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": "4add6ad38f... |
ca658aec-c464-4b93-9e3f-0de7ea1e0316 | gorecrds/cpp | a8_1/a8_1.cpp | /*
* Name: <NAME>
* Class CIS 278 (CS1) Programming Methods: C++
* Date: 10/04/2019
* Prof. <NAME>
* File: a8_1.cpp
* Descrip.:Program that reads five (or more) names and score in a struct and sorts it in a
* descending order. The takes program will start by asking the input of 5 names and scores which will be s... | ALGO | 0.982798 | 3.699811 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-11-12T01:11: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": "e335aaead1... |
8e04eba6-6fa8-4944-97e6-02a5f70354e8 | IMHaoyan/GAMES101 | pa7/global.hpp | #pragma once
#include <iostream>
#include <cmath>
#include <random>
using namespace std;
#undef M_PI
#define M_PI 3.141592653589793f
extern const float EPSILON;
const float kInfinity = numeric_limits<float>::max();
inline float clamp(const float &lo, const float &hi, const float &v)
{ return max(lo, min(hi, v)); }
... | ALGO | 0.972062 | 3.69855 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2022-03-08T09:05:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4a64ace07... |
a66a23ea-dccc-4847-983c-9777cb23eb6f | Romu-ua/Atcoder | ABC/232/C_review.cpp | #include <bits/stdc++.h>
using namespace std;
/*
グラフの同型性の確認
N <= 8なので全探索ができる。
形だけ判定したいとき、グラフの頂点の番号の振り方は自由。
なので、番号を振り直すことを全探索することで一致しているのかを確かめる。
これが何通りあるのかというと N! これが書ければ合格。
next_permutationを使う。
*/
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> ga(n);
vector<vector<int>> gb(n);
for (i... | ALGO | 0.999988 | 4.533174 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-04-27T06:39: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": "eaffb1178dc... |
604c5d79-9e89-458f-b918-0931da11b0f8 | sagar98cyber/DSA_TUTORIAL | RECURSION/medCountTheSubsequencesWithSumK.cpp | #include <bits/stdc++.h>
using namespace std;
void printDS(vector<int> &a)
{
cout << "New Ans: " << endl;
for (auto i : a)
{
cout << i << endl;
}
}
void solve(int limit, vector<int> &a, int sum, int i, int &count)
{
if(sum>limit)
{
return;
}
if (i == a.size())
{
... | ALGO | 0.999844 | 4.656695 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2023-10-15T18:56: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": "28e6f5945a7... |
ef6c50fa-852e-49e9-91c0-709d35a8aae7 | YashPandey1405/Computational-Method-Codes | CM06_Lagrange_InterpolationMethod.cpp | // C++ program for Implementation of Lagrange's Interpolation......
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
// Class To represent a data point corresponding to 'x' and y = f(x)......
class Data{
public:
int x, y;
};
// Function to Interpolate the given data points using Lagr... | ALGO | 0.999874 | 5.689032 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-11-02T06:38:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68c32449caef... |
90f3343d-b1ba-4def-99fa-1f778bd8a38c | luffingluffy/cp | algobank/others/sieve.cpp | vector<int> primes;
void sieve(int n) {
// Create a boolean vector to represent prime candidates up to n
vector<bool> is_prime(n + 1, true);
is_prime[0] = false;
is_prime[1] = false;
// Iterate over the numbers from 2 to n
for (int i = 2; i <= n; i++) {
// If the current number is mark... | ALGO | 0.999897 | 5.019923 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2022-08-21T08:33: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": "19c367513b4... |
ba9f70fb-4c09-4a5f-bc86-81f7b3df56f4 | thuang86714/leetCodeCpp3rd | BinTreeGen_117_R_Populating_Next_Right_Pointers_In_Each_Node2.cpp | /*
Given a binary tree
struct Node {
int val;
Node *left;
Node *right;
Node *next;
}
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.
Initially, all next pointers are set to NULL.
Example 1:
Input: root = [1,2,3,4,5,null,7]... | ALGO | 0.999944 | 6.016813 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-08-03T14:37:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "418025f92c81... |
389a3b51-54da-406d-b6d8-f2a0905dd154 | MrGunnery/Helha | Bloc2/Projet/Bateau_Arduino.ino | #define captFin 7
#define captDebut 9
#define pinAimant 11
#define captHauteur 12
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include <NewPing.h>
int cptPas;
bool onOff = false;
// Creation de l'objet motorSheild
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Connexion des moteur pas a pas.
Adafruit... | TOOL | 0.930905 | 4.986073 | {
"github_metadata": {
"branch": "master",
"commit_count": 273,
"repo_created_at": "2018-02-07T09:49: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": "a0b03bc6... |
bea2e76f-3d61-4ce0-9725-cf59d59a1af3 | king-yyf/cpcode | other/cses/1652.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<typename T>
struct FenwickTree2D{
vector<vector<T>> tr;
int n, m;
FenwickTree2D(int N, int M) : n(N), m(M), tr(N, vector<T>(M, 0)){}
void add(int x, int y, int val){ // 0 <= x < n, 0 <= y < m
for(int i = x + 1; i <= ... | ALGO | 0.999762 | 4.478924 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-11-26T03:35: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": "2ec60f61864c... |
2ae3f578-2a25-4913-9ee6-db606f5a7e21 | doanphuc210/Tonghopbaitapchuong1denchuong13 | pj8/pj8_ex2.cpp | #include <iostream>
#include <algorithm>
using namespace std;
const int SIZE = 20;
int binarySearch(const int[], int, int);
int main() {
// Array with employee IDs sorted in ascending order.
int idNums[SIZE] = {101, 142, 147, 189, 199, 207, 222,
234, 289, 296, 310, 319, 388, 394,
... | ALGO | 0.99921 | 6.294086 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-10-18T16:30: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": "80de44b21091... |
f2eee75b-76ff-4837-a424-31a73b9fdd31 | MarkPromislow/Trading | IntrusiveLinkedList.h | #pragma once
#include <cstddef>
namespace Intrusive
{
class LinkedListObject
{
protected:
LinkedListObject *_prev;
LinkedListObject *_next;
friend class LinkedList;
template <typename BaseType, typename Type>
friend class ObjectPool;
public:
LinkedListObject() : _prev(this), _next(this) {}
bool isLinked() { ... | TOOL | 0.915017 | 6.648219 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2017-05-15T00:54: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": "e05c0d1e2... |
8633ed0d-f41c-4fe2-8083-5f9ba4d3d4c3 | gpoo/ccfinderx | common/unportable.cpp | #include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sys/types.h>
#include <sys/stat.h>
#include <boost/format.hpp>
#include <boost/optional.hpp>
#if defined _MSC_VER
#include <windows.h>
#define WIN32_LE... | TOOL | 0.971465 | 3.21083 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2012-11-14T09:31:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 57,
"forks": 27,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "8820da8... |
c6cd54c0-395f-47c1-ade5-0abdbc768b6b | hugogonzalezperez/Sort-Algorithms | include/SortAlgorithm/radixSort.h | #ifndef RADIX_SORT_H
#define RADIX_SORT_H
#include "../utils.h"
class RadixSort : public SortAlgorithm {
public:
void sort(std::vector<int>& data) override {
int max = *std::max_element(data.begin(), data.end());
for (int exp = 1; max / exp > 0; exp *= 10) {
countSort(data, exp);
}
}
private:... | ALGO | 0.999872 | 6.117687 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-16T00:35: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": "d44814cd19d3... |
8b739c3c-9c83-4220-b574-7be0c543217b | Sushant-1999/Striver_A2Z_Course | Sushant_Agawane/Step_13/13.3/ConstructTreePostOrder.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999985 | 6.30664 | {
"github_metadata": {
"branch": "main",
"commit_count": 142,
"repo_created_at": "2022-09-06T12:42:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c9ce8a2b40... |
42f0c5d1-d7df-4e75-b51f-17ca3207997e | mindspore-ai/mindspore | mindspore/ccsrc/plugin/device/cpu/kernel/fftbase_cpu_kernel.cc | /**
* Copyright 2024 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... | ALGO | 0.990616 | 7.109571 | {
"github_metadata": {
"branch": "master",
"commit_count": 83896,
"repo_created_at": "2020-02-11T08:43:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4559,
"forks": 740,
"issues": 181,
"pull_requests": 20
},
"file_meta": {
"content_id": ... |
244da9cd-f20c-4ac2-b4ff-c1d6cefb067b | metens/data-structures | linear-linked-list/main.cpp | // This is the main program that interacts with the user...
#include "lll.h"
#include "iostream"
int main() {
lll list; // Create an object of the lll class called "list"
// Make the list by adding at the end
std::cout << "Make the list:\n";
list.add_at_end(5);
list.add_at_end(3);
list.add_at_end(7);
list.add... | TOOL | 0.995275 | 5.709145 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2024-03-02T06:30: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": "5b9d77cd862... |
573b93c9-7ec4-463a-abce-9cf3e586271b | StarRocks/starrocks | be/src/exprs/agg_in_runtime_filter.h | // Copyright 2021-present StarRocks, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required ... | TOOL | 0.951622 | 7.664326 | {
"github_metadata": {
"branch": "main",
"commit_count": 21361,
"repo_created_at": "2021-09-04T02:29:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10338,
"forks": 2050,
"issues": 499,
"pull_requests": 376
},
"file_meta": {
"content_id":... |
2944e9ae-7d07-4bca-b4ce-4d78e5a622e7 | MatthiasKillat/concurrency_primitives | main.cpp | #include <iostream>
#include <thread>
#include <chrono>
#include "semaphore.hpp"
#include "mutex.hpp"
//#include "condition_variable.hpp"
#include "timeout_condition_variable.hpp"
using ConditionVariable = TimeoutConditionVariable;
Lock lock;
ConditionVariable cv;
Mutex mutex;
bool doSomething = false;
bool isSom... | TOOL | 0.938909 | 5.759173 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2020-05-25T06:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c890a545... |
e7406207-4a0e-4a75-b128-80950d7e5c69 | KrzynKrzyn/lightfield-compression-mgr | src/block_matchers/bm_perimiter_search_with_cutoff.hpp | #ifndef BM_PERIMITER_SEARCH_WITH_CUTOFF_HPP
#define BM_PERIMITER_SEARCH_WITH_CUTOFF_HPP
#include "block_matcher_heuristic.hpp"
namespace lfc
{
class BMPerimiterSearchWithCutoff : public BlockMatcherHeuristic
{
private:
const int perimiterRadius;
const double cutoffThreshold;
const... | ALGO | 0.996302 | 6.389597 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-12T14:11: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": "fbbee52a7f31... |
0ab691a4-13ef-4e0c-84f8-9988a7ad3cf8 | mayanke7/Codeforces | B_Milena_and_Admirer.cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long
#define DEB(x) cout << #x << "=" << x << endl
#define DEB2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define PB push_back
#define F first
#define S second
#define ALL(x) x.begin(), x.end()
typedef pair<int, int> PII;
typedef pair<... | ALGO | 0.999805 | 3.638316 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-03-30T16:45: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": "1d79ceb7b4c... |
b7e21246-7eb5-4790-8d9f-757abe01ace9 | pafin10/CompetitiveProgrammingExercises | year_2_contests/codeforces_995/1.cpp | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
#include <bitset>
#include <numeric>
#include <set>
#include <queue>
#include <unordered_map>
#include <cassert>
#include <array>
#include <deque>
using... | ALGO | 0.999972 | 3.745297 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-09-09T12:04:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e4caa69c6d... |
e0124582-1f09-43a6-b184-f3ffd56c58bc | daniilkananenka/bsu-famcs-inf-programming | first-semester/lab-5-old/task-2/task-2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
void InputVector(std::vector<int>&);
void PrintVector(std::vector<int>&);
void UniqueElementsOnly(std::vector<int>&, std::vector<int>&);
void ConcatVectors(std::vector<int>&, std::vector<int>&, std::vector<int>&);
void SortVector(std::vector<int>&);
int main(... | ALGO | 0.999942 | 3.694943 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2023-09-04T10:26:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "996eda30377... |
b043a51c-7d76-4dc6-926d-9913da8ed4a5 | noobie7/CodeBank | Codeforces/1467/D.cpp | /*
"An anomaly, I'm <NAME>
Cause I know one day I'm gonna be the"
- Greatest, Eminem
*/
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#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 l... | ALGO | 0.999807 | 3.968802 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2021-09-12T05:11:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c931845bd1... |
a39bf47f-7725-4057-a722-0aab65d2265b | n0IQ/Competitive-Programming | codeforces/762/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ff first
#define ss second
#define rep(i, a, b) for(int i = a; i < b; i++)
#define repR(i, a, b) for (int i = a; i >= b; --i)
#define all(x) (x).begin(), (x).end()
#define rall... | ALGO | 0.999938 | 4.039896 | {
"github_metadata": {
"branch": "main",
"commit_count": 1677,
"repo_created_at": "2022-06-02T21:26: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": "6ce87130b... |
44efdd90-2a15-40b7-94f5-b07b3770c745 | varun7882/Programs_C-CPP | vscode/codes/kirlab.cpp | #include<iostream>
#include<limits.h>
using namespace std;
typedef long long int dty;
dty a[100001],dp[100001],n;
// cp[100001];
dty gcd(dty a,dty b)
{
if(a%b==0)
{
return b;
}
else
{
return gcd(b,a%b);
}
}
dty notcoprime(dty a,dty b)
{
dty x=1;
if(a%2==0 && b%2==0)
{... | ALGO | 0.999911 | 3.505379 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-10-05T14:53: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": "bc1d576f84... |
323cf094-eef8-41d7-a932-f3f648d68758 | mini-jongrok/PS | saseo/programmers/level1/신규 아이디 추천.cpp | #include <string>
#include <vector>
#include <cctype>
using namespace std;
string solution(string new_id) {
string answer = new_id;
// 1 && 2
for (int i = 0; i < answer.size(); ++i)
{
answer[i] = tolower(answer[i]);
if (!isalpha(answer[i]) && !isdigit(answer[i]) && \
a... | ALGO | 0.999493 | 5.28301 | {
"github_metadata": {
"branch": "master",
"commit_count": 280,
"repo_created_at": "2023-07-05T14:53:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "282bf7c5f... |
f15f19a6-48c2-44e9-b555-aaad4fa70578 | phrocker/sharkbite | include/writer/impl/WriterHeuristic.h | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
1 * Unless required by applicable law or agreed to in writing, software
* distrib... | ALGO | 0.930355 | 7.042144 | {
"github_metadata": {
"branch": "main",
"commit_count": 291,
"repo_created_at": "2017-01-23T02:32:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 4,
"issues": 11,
"pull_requests": 7
},
"file_meta": {
"content_id": "ba181702... |
888cd3c0-9486-4034-aec5-9eb4ecb4375c | kanikapoor-dot/learn-DSA | sorting algorthms/quick_sort.cpp | #include<iostream>
using namespace std;
void display(int a[]){
for(int i = 0;i <= 4;i++){
cout << a[i] << " ";
}
}
int partition(int a[],int s,int e) {
int pivot = a[e];
int pIndex = s;
for(int i = s;i < e;i++){
if(a[i] < pivot){
int temp = a[i];
a[i] = a[pI... | ALGO | 0.999985 | 5.227442 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-07-10T07:06: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": "5a2b9ae2825... |
36dbd4ff-f976-4345-ae5d-04fc804deeb8 | soumyodipto/CTQMC | ctqmc_1d.cpp | #include <iostream>
#include <random>
#include <cmath>
#include <string>
#include <tuple>
#include <stdlib.h>
#include <algorithm>
#include <armadillo>
#include <ctime>
using namespace std;
using namespace arma;
const double pi = 3.14159;
// Define global variables
double mass = 1.0;
double hbar = 1.0;
double k_b =... | ALGO | 0.994411 | 4.048059 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-03-14T19:17: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": "1bc50a8ee... |
f48702c0-5328-46cb-be05-99efa2282d3d | Kodsport/swedish-olympiad-2020 | skolkval/planetbacke/submissions/wrong_answer/fe_wa1.cpp | /*
Bruteforcar allt på samma höjd h,
går sedan till den ruta r (på höjd h)
som har störsts
(längd på väg till r)+(högsta höjd lägren än h som anränsar r)
*/
#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
using namespace std;
#define rep(i, a, b) for(ll i = a; i ... | ALGO | 0.999905 | 3.281064 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2020-01-19T12:25:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "878e1ac1b0... |
c8fb32d1-6250-4b3d-be3c-ab05d2adabe8 | sachakantor/optim | CVRP/main.cpp | #include<cassert>
#include<iostream>
#include<fstream>
#include<problem.hpp>
#include<ilcplex/cplexx.h>
int main(int argc, char* argv[])
{
if(argc < 2)
{
std::cerr << "El formato de ejecucion debe recibir al menos 1 parámetro:" << std::endl;
std::cerr << argv[0] << " input1.in [ input2.in input3.in ... ]" << ... | ALGO | 0.978325 | 4.142018 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2018-09-01T00:27: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": "e3492f7d9... |
4ec7216f-148f-4d20-abe6-65ef960d7319 | vansjyo/Fair-Division | OLD/V2.1-Chores/main.cpp | #include <bits/stdc++.h>
#include <pcg_random.hpp>
#include "output.h"
#include "fileLogger.h"
#define EPS 0.0001f
using namespace std;
int main()
{
// Define Inputs
bool DEBUG = true; // DEBUG Mode ON - true / OFF - false
int samples = 10, iteration = 0; // number of samples to run... | ALGO | 0.999208 | 4.120443 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2022-07-15T04:28:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e47b5a256e... |
eda75425-eeaf-463e-b119-2f6fc16e811c | GreatenAnoymous/wc-set | cpp/unlabeled/tswap.hpp | /*
* TSWAP, used in the experiment
*/
#pragma once
#include "goal_allocator.hpp"
#include "../mapf/solver.hpp"
class TSWAP : public Solver
{
public:
static const std::string SOLVER_NAME;
private:
struct Agent
{
int id; // id
Node *v_now; // current location
Node *v_next; ... | ALGO | 0.985585 | 5.852373 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2023-05-28T17:39:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b97a24aef8... |
ed3edb18-7e7a-4265-8a86-5ddb6f3fbbc2 | GuillermoArriaga/Algoritmos-Aplicados | T25 Prog Dinamica/T25_ProgDinamica.cpp | /* =========================================================================
== ==
== <NAME> 23/05/11 ==
== ==
== TAREA 25 ... | ALGO | 0.999915 | 4.183434 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-04-04T17:15: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": "44d7572879... |
c3f5bffc-19cf-4c4a-9915-601e933203a8 | zzwblog/AlgorithmCode | PAT/A1100 Mars Numbers.cpp | ////#include <iostream>
////#include <string>
////#include <unordered_map>
////using namespace std;
////int main() {
//// string low[13] = {//数字到火星文低位的映射
//// "tret","jan","feb","mar", "apr", "may", "jun", "jly", "aug", "sep", "oct", "nov", "dec" };
//// string high[13] = {//数字到火星文高位的映射
//// "tret","tam", "hel", "m... | ALGO | 0.999297 | 3.889762 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-09-03T10:47: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": "bf120e96f1... |
4be72d30-2193-43b2-b969-84935b285034 | SorcierMaheP/3rd-Sem-Codes | CPP/OOPS_Labs/assgn3_5.cpp | #include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
class telephone
{
char name[20];
int phone;
public:
char *ret_name()
{
return name;
}
int ret_phone()
{
return phone;
}
void getname(char *str)
{
strcpy(name, str);
}
v... | TOOL | 0.985783 | 3.577562 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-12-30T14:22: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": "04b940d03ca... |
5cdb5b3f-b7ef-4947-9be8-bea655af4fc2 | sarsjits/Programming-Puzzles | array/006.cpp | /*
Search an element in sorted and pivoted array-
assuming no duplicates are allowed.
URL:
*/
#include <iostream>
#include <vector>
using namespace std;
/*
Method 1: Uses three pass binary search
Time Complexity: O(logn)
Space Complexity: O(1)
*/
// returns index of pivot, if no pivot returns -1
int findPivot... | ALGO | 0.999995 | 5.979562 | {
"github_metadata": {
"branch": "master",
"commit_count": 292,
"repo_created_at": "2016-05-02T14:28: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": "f6bb5f31... |
2f536f00-1496-4af4-b9b0-1b28ef07ffa4 | Sean0628/competitive_programming | atcoder/abc/abc269/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;
int main() {
vector<string> s(10);
rep(i, 10) cin >> s[i];
int a = 0, b = 0, c = 0, d = 0;
rep(i, 10) rep(j, 10) {
if (s[i][j] == '.') continue;
else {
if... | ALGO | 0.999458 | 3.003843 | {
"github_metadata": {
"branch": "main",
"commit_count": 750,
"repo_created_at": "2022-04-20T07:34: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": "c19ef8bad9... |
889cfcea-e1b0-45b3-8327-1a930c833356 | sagarrajak245/DSA_practise | doubleenedeq.cpp | #include <iostream>
#include <algorithm>
using namespace std;
class dqueue
{
public:
int front;
int rear;
int *arr;
int size;
// constructor
dqueue(int size)
{
this->size = size;
arr = new int[size];
this->front = -1;
this->rear = size - 1;
}
void p... | ALGO | 0.999375 | 4.630192 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2023-03-02T15:59: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": "a38939d66... |
24c0f1be-dc84-4a56-9e8a-3a52cb42f59f | deepam20050/competitive-programming | solutions/CF698B.cpp | #include "bits/stdc++.h"
using namespace std;
#define sz(x) int((x).size())
#define all(x) begin(x), end(x)
#define eb emplace_back
#define em emplace
#define mp make_pair
#define F first
#define S second
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
using lli = long long;
using pii = pair < int, int >;
const... | ALGO | 0.999962 | 3.837895 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-01-05T12:59: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": "8b4cb286ad0... |
47de0ca2-dbbd-4fbc-a23e-571a5bffc131 | xintong-ai/OH3D | deform/Lens.cpp | #include "Lens.h"
#include "TransformFunc.h"
#include <iostream>
#include <algorithm>
#include <iostream>
float Lens::GetClipDepth(float* mv, float* pj)
{
return Object2Clip(GetCenter(), mv, pj).z;
}
float2 Lens::GetCenterScreenPos(float* mv, float* pj, int winW, int winH)
{
return Object2Screen(GetCenter(), mv, pj... | TOOL | 0.977451 | 3.895211 | {
"github_metadata": {
"branch": "master",
"commit_count": 416,
"repo_created_at": "2016-01-03T20:08:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67f1dd75... |
7a39334b-e2ac-43f5-9979-ca9333065124 | hannespetur/free.simd | include/boost/simd/arch/common/simd/function/clamp.hpp | //==================================================================================================
/*!
@file
@copyright 2017 NumScale SAS
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
//===========================... | ALGO | 0.985375 | 6.783861 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-03-13T23:02:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2373005fcb... |
7b00d903-f11f-47e5-950d-dc417aed8cbf | tanmoy215/problem-on-sorting | problem_on_sorting_2.cpp | // C++ implementation of above approach
#include <bits/stdc++.h>
using namespace std;
// Function for calculating
// minimum opeartions
int minimum_operations(vector<int>& arr, int n)
{
// Declare map for storing the index
// of each element.
map<int, vector<int> > mpp;
for (int i = 0; i < arr.size(); i++) {
mp... | ALGO | 0.999986 | 5.642573 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-12-05T20:05:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80d53f03cb6f... |
b757db87-3a18-49ba-8bd0-77625cff8eb4 | wilselby/ROS_quadrotor_simulator | quad_control/src/library/quad_controller.cpp | /*
* Copyright 2015 <NAME>, ASL, ETH Zurich, Switzerland
* Copyright 2015 <NAME>, ASL, ETH Zurich, Switzerland
* Copyright 2015 <NAME>, ASL, ETH Zurich, Switzerland
* Copyright 2015 <NAME>, ASL, ETH Zurich, Switzerland
* Copyright 2015 <NAME>, ASL, ETH Zurich, Switzerland
*
* Licensed under the Apache License, V... | ALGO | 0.997751 | 5.198105 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2016-02-18T01:40:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 290,
"forks": 126,
"issues": 25,
"pull_requests": 2
},
"file_meta": {
"content_id": "bc0a... |
6b0318d6-c30f-4787-9ddf-6e3e33aa06f0 | ttzztztz/leetcodeAlgorithms | Lintcode/1002. Bus Routes.cpp | class Solution {
public:
/**
* @param routes: a list of bus routes
* @param S: start
* @param T: destination
* @return: the least number of buses we must take to reach destination
*/
int numBusesToDestination(vector<vector<int>> &routes, int S, int T) {
unordered_map<int, vecto... | ALGO | 0.999823 | 5.461643 | {
"github_metadata": {
"branch": "master",
"commit_count": 872,
"repo_created_at": "2019-09-03T06:57:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76402d3... |
e4580afb-e85e-48e5-a071-5495bd33ac9c | wzhings/LeetCode-V1 | 15-3Sum.cpp | // No. 15 - 3Sum.cpp
class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
sort(nums.begin(), nums.end()); // sort the nums array
vector<vector<int>> res; // initial an array as list of list
for(int i = 0; i < nums.size(); i++)
{
if ((i > 0) && (nums[i] == nums[i-1]... | ALGO | 0.99994 | 5.786281 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-03-09T00:59:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16d0cab12f... |
21cdb4d4-48ca-4381-a56a-51e9f3c0fac2 | IshanMinhas/MyCodingJourney | udemy prateeknarang/dp1d/rodcutting.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int cuttingLog(int prices[] , int n){
// base c
if(n <= 0){ return 0;}
// rec c
int max_profit = INT_MIN;
for( int i = 0 ; i<n ; i++){
int cutlen = i+1;
int profit = prices[i] + cuttingLog( prices , n- cutlen);
... | ALGO | 0.99958 | 4.236974 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2022-07-10T12:32:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10173f18c... |
4a1a75b1-b949-474c-b592-34d3d0f89331 | panic-coursework/cpp | src/1091.cpp | #include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
auto nextInt () -> int;
auto readN (int *array, int n) -> void;
template <typename T>
auto print (const T &) -> void;
template <typename T>
auto println (const T &) -> void;
template <typename T>
auto printsp (const T &) -> void;
const int kMax... | ALGO | 0.999991 | 3.53149 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2021-09-16T06:10:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb36ed5a9f... |
2b18eb8e-fd05-4ce2-bd9f-e7a147428289 | ketlynsena/LogiKids | LogiKids/LogiKids/traveling_salesman.cpp | #include "traveling_salesman.h"
#include "game.h"
TravelingSalesman::TravelingSalesman()
{
background = new GameTexture("assets/traveling_salesman/mineiro_viajante.png", 0, 0, false, false);
help = new GameTexture("assets/buttons/help", 740, 540, true, false);
reset = new GameTexture("assets/buttons/reset", 15, 540... | ALGO | 0.992029 | 3.44116 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2020-12-07T18:09: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": "b3b0454bb93... |
9fdf7171-96a0-4287-9093-f8eb71cdba88 | SoumyadipMandal1/AlgorithmsCpp | DataStructures/AVLTree.cpp | #include "AVLTree.hpp"
#include "../algorithm.hpp"
#include <string>
#include <vector>
int height(AVLTreeNode *node)
{
if (node == nullptr)
return 0;
else
return node->height;
}
int balanceFactor(AVLTreeNode *node)
{
if (node == nullptr)
return 0;
else
return height(nod... | ALGO | 0.99963 | 4.6 | {
"github_metadata": {
"branch": "main",
"commit_count": 105,
"repo_created_at": "2024-10-25T03:51: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": "98e0e816de... |
593196a3-d25d-4ae3-85ea-55d38bcacb97 | IIIT-OS-PG/shell | trie.cpp | //os assign
#include <iostream>
#include <bits/stdc++.h>
#include <string.h>
// #include <unordered_m>
using namespace std;
struct trie
{
// true when node is a leaf node
bool ln;
// each node stores a m to its child nodes
map<char, trie*> m;
};
bool have_chd(trie*curr)
{
trie*temp;
temp=curr;
map<char, ... | ALGO | 0.99935 | 3.118652 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-09-09T10:50:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3411052261d... |
fad30d93-bba2-48b5-a808-619df245cbeb | TrungKuro/Car_Detector_Line | Test_Driver/Test_Driver.ino | /* ------------------------------------------------------------------------- */
/* DEFINE */
/* ------------------------------------------------------------------------- */
/**
* Pin kết nối Driver L298
*
* Phần cấp nguồn cho Driver
* +12V - ... có... | TOOL | 0.907192 | 5.668234 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-09-11T04:45: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": "73d9ee2c7a4... |
1e6619d3-a11a-4b13-9d44-168194de5966 | deepcoder007/spoj | MCHAOS.cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<set>
#include<vector>
#include<algorithm>
#include<functional>
#include<map>
#include<string>
#include<cstring>
#include<utility>
#include<climits>
#include<queue>
#include<deque>
#define mp make_pair
#define pb push_back
#define dbg() cout<<"DEBUG"<<endl
#... | ALGO | 0.99997 | 3.233701 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2014-05-03T11:46:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9eb74ff3... |
3592b035-4f18-4b30-8b95-a44fe23a7fab | drlongle/leetcode | algorithms/problem_0361/solution.cpp | /*
361. Bomb Enemy
Medium
Given an m x n matrix grid where each cell is either a wall 'W', an enemy 'E' or empty '0', return
the maximum enemies you can kill using one bomb. You can only place the bomb in an empty cell.
The bomb kills all the enemies in the same row and column from the planted point until it
hits the... | ALGO | 0.999987 | 5.788988 | {
"github_metadata": {
"branch": "master",
"commit_count": 1430,
"repo_created_at": "2017-02-08T14:00: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": "d9e073c... |
db5a346e-4567-4e14-ba69-b161f14d712d | prashjha/PeriDEM | src/nsearch/nflannSetup.h | /*
* -------------------------------------------
* Copyright (c) 2021 - 2024 <NAME>
* -------------------------------------------
* PeriDEM https://github.com/prashjha/PeriDEM
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE)
*/
#ifndef NSEARCH_NFLANNSETUP_H
#defi... | ALGO | 0.994314 | 6.440873 | {
"github_metadata": {
"branch": "main",
"commit_count": 207,
"repo_created_at": "2021-01-30T21:34:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 67,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbcb06a8... |
4d4f4a21-71f8-42dd-8e27-6025a1a12d44 | NguyenHoangHaiD21PTIT/INT1306_CAU_TRUC_DU_LIEU_VA_GIAI_THUAT_HK20222 | CODE TOÁN RỜI RẠC 2/FLOYD ALGORITHM.cpp | #include<bits/stdc++.h>
using namespace std;
int ketiep[15][15], a[15][15], d[15][15];
void timduong(int u, int v){
if(u==v) cout<<"K/c "<<u<<" --> "<<v<<" = 0; "<<u<<endl; //Duong di den chinh no
else{
if(ketiep[u][v]==-1) cout<<"K/c "<<u<<" --> "<<v<<" = INF; "<<endl; //Khong co duong di
else{
cout<<"K/c "... | ALGO | 0.999968 | 3.970151 | {
"github_metadata": {
"branch": "main",
"commit_count": 971,
"repo_created_at": "2024-03-09T15:33:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f17c5acbca... |
45d18be1-b54a-4b78-9256-f265b91c6db6 | latrung124/LeetcodeDailyExecutor | 2025/March/27-03-No-2780.cpp | #include <bits/stdc++.h>
class Solution {
public:
int minimumIndex(std::vector<int> &nums) {
std::unordered_map<int, int> freq;
int size = nums.size();
// Step 1: Find the dominant element
for (int num : nums) {
freq[num]++;
}
int dominant = -1;
... | ALGO | 0.999996 | 6.070467 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2025-02-21T12:08: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": "c4f4eb9615d... |
3fea736d-97f5-4bcb-9255-ef0c15a9842b | kakyouin2/212121 | дзшка.cpp | #include<iostream>
using namespace std;
int main() {
//1. Вывести символ # столько раз, сколько указал пользователь.
/*int a;
cin >> a;
int i = 0;
while (i <= a) {
cout << i << "# ";
i++;
}
cout << endl;*/
//2. Пользователь ввел любое целое положительное число, а на экран вывелись все числа от введенного ... | TOOL | 0.997329 | 3.198829 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-10-26T12:05:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eea2ca08ec7b... |
146a0d2e-a516-4676-a917-57b83f052dad | harshm413/lots-of-dynamic-programming-cpp | Tiling Problem/tiling_floor_memoization.cpp | #include <iostream>
#include <vector>
using namespace std;
// Helper function with memoization
int countWaysMemoHelper(int n, vector<int>& dp) {
// Base cases
if (n == 0 || n == 1) return 1;
// Return memoized result if available
if (dp[n] != -1) return dp[n];
// Calculate the result by placing o... | ALGO | 0.999984 | 6.938928 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-01-01T21:20:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4ef66eeaabb... |
881449ca-84f7-4670-b4c9-7d5bd208bfda | EladLaviMagen/BlockchainProject | SHA-256/SHA-256/SHA256.cpp | #include "SHA256.h"
//Setting static variable
std::vector<uint32_t> SHA256::m_state;
//defines
#define BITS_512 64
#define BYTE 0x100
#define WORD 0x100000000
std::string SHA256::conv(std::string str)
{
//Resetting values, preparing for the process
SHA256::m_state.clear();
for (int i = 0; i < 8; i++)
{
m_state... | ALGO | 0.999601 | 5.574895 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2024-06-17T13:43:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ab163fadfa... |
7466cd32-d42f-4bb0-bfe7-767da87777b5 | Dharnesh67/decode-cpp | Dynamic Pr/cses_Removing_digits.cpp | #include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
using namespace std;
vector<int> dp;
int mini(int x){
int m = INT_MIN;
while (x != 0)
{
if (x % 10 > m)
m = x % 10;
x /= 10;
}
return m;
}
int f(int n)
{
if(n==0) return 0;
if (n <=9 ) r... | ALGO | 0.999737 | 4.332813 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-10-23T10:03: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": "f5d2b6d6595... |
bfae907a-8b05-4b83-9502-8643ed356fc8 | kbkarthi/Prep | LongestCommonSubSeq.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
int GETMAX (int a, int b)
{
return (a > b) ? a : b;
}
int LongestCommonSubSeq(char a[], char b[], int aLength, int bLength, char outputStr[])
{
int output[aLength + 1][bLength + 1];
//int maxSize = GETMAX(aLength, bLength);
//outputStr = (char... | ALGO | 0.999994 | 4.216171 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2016-05-27T06:48:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffed6b191... |
18fc75b0-dde2-487d-bb20-eb30a407340c | ANYbotics/grid_map | grid_map_filters/src/MeanInRadiusFilter.cpp | /*
* MeanInRadiusFilter.cpp
*
* Created on: May 3, 2017
* Author: <NAME>, <NAME>
* Institute: ETH Zurich, ANYbotics
*/
#include "grid_map_filters/MeanInRadiusFilter.hpp"
#include <math.h>
#include <grid_map_core/grid_map_core.hpp>
using namespace filters;
namespace grid_map {
MeanInRadiusFilter::Mean... | ALGO | 0.980679 | 6.820611 | {
"github_metadata": {
"branch": "master",
"commit_count": 803,
"repo_created_at": "2014-09-11T17:17:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2885,
"forks": 834,
"issues": 105,
"pull_requests": 46
},
"file_meta": {
"content_id": "4... |
1d54c7bb-e7d1-4a45-8beb-e03698fe0055 | The-Wolf-Dev/Omaha-Hi-Lo | OmahaComp/src/Poker.cpp | #include <string>
#include <iomanip>
#include <Poker.h>
#include <Tools.h>
Poker::Poker(const std::vector<Card>& handASetup, const std::vector<Card>& handBSetup, const std::vector<Card>& boardSetup)
: m_handA{ handASetup }, m_handB{ handBSetup }, m_board{ boardSetup } {
}
Poker::winpair_t Poker::getWinner() {
m_ha... | TOOL | 0.93275 | 5.816334 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-05-26T15:20:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b760c54c976... |
5fe599c9-e99d-4697-8102-0f33bff04aa4 | bu-hpc/QSketch | include_host/sketch/device_sketch/device_sketch_v2.h | #pragma once
namespace qsketch {
#ifdef QSKETCH_KERNEL_NAMESPACE
#undef QSKETCH_KERNEL_NAMESPACE
#endif
#define QSKETCH_KERNEL_NAMESPACE Sketch_GPU_Sub_Warp_Kernel
namespace QSKETCH_KERNEL_NAMESPACE {
template <typename Key_T, typename Count_T, typename Hashed_T, typename Seed_T, typename Hash_Function>
__devic... | ALGO | 0.997173 | 4.518572 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-09-01T03:45:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2291411c361... |
4232ede1-75b0-447c-8fa5-484b3a666837 | ZeroNerodaHero/contest | silver/2017-12/shuffle0.cpp | #include <iostream>
#include <fstream>
#include <map>
int size;
using namespace std;
int iscycle(int ar[], bool visited[], int start){
int tmpq = start;
if(start == ar[start]){
visited[start] = true;
return 1;
}
int tmp[size];
tmp[0] = start;
start = ar[start];
for(int i =... | ALGO | 0.999752 | 3.475284 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-08-03T04:34:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee2bc29e3... |
11cae552-8367-4821-9dfe-016dbec02392 | kz04px/verbose-parakeet | src/search/classic/alphabeta.cpp | #include "alphabeta.hpp"
#include <cassert>
#include <limits>
#include "../controller.hpp"
#include "is_endgame.hpp"
#include "qsearch.hpp"
namespace classic {
int alphabeta(libchess::Position &pos, Stack *ss, int alpha, const int beta, int depth) {
assert(-mate_score <= alpha);
assert(alpha < beta);
asse... | ALGO | 0.999815 | 6.997481 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2020-06-02T14:43:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d15a8c99... |
8d4b8d8f-8d46-4b14-a842-1d6ec329608e | hirakuuuu/kyopro | ABC/283/abc283_e.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
const int MOD_NUM = 1000000007;
const int mod_num = 998244353;
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void... | ALGO | 0.999909 | 3.984202 | {
"github_metadata": {
"branch": "master",
"commit_count": 452,
"repo_created_at": "2022-02-25T05:22:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "501fbbb1... |
2b8fbb27-b58d-4e7b-999f-85948b1bae31 | Oreobird/demo | ai/face_quality/evg_detector.cpp | #include "evg_common.h"
#include "evg_quality.h"
#include "evg_timing.h"
#include "evg_detector.h"
using namespace std;
using namespace cv;
void SDMLandmarkDetector::draw(cv::Mat img, cv::Scalar color, bool show, std::string img_save_path)
{
int face_num = m_face_boxes.size();
for (int i = 0; i < face_num; i++)
{... | TOOL | 0.929114 | 3.871675 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2017-06-18T14:37:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c222c7beb... |
ba821e3f-e613-42a6-b95a-63babc374a8f | caraujoufsm/Paradigmas_de_Programacao | t5/vectorscore.cpp | #include <string>
#include <vector>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iterator>
#include <algorithm>
using namespace std;
class Score {
private:
string nome;
string descr;
int pontos;
public:
Score(string nome, string descr, int pontos) {
this->nome = nome;
this->descr = desc... | ALGO | 0.98787 | 4.457669 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2017-03-08T12:33: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": "462b1d2f7... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.