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 |
|---|---|---|---|---|---|---|---|
cde4c53d-b8cd-4119-801c-8cb0fef583cf | curusarn/ctu-fit-mi-paa | knapsack-problem/src/main_knapgen.cc |
#include <iostream>
#include <vector>
#include <cassert>
#include <limits.h>
#include "task.h"
#include "record_collector.h"
#include "knapgen/knapcore.h"
#define uint unsigned int
#define NEUTRAL_WEIGTH 100
#define NEUTRAL_PRICE 100
#define NEUTRAL_RATIO 0.65
#define NEUTRAL_GRANULARITY 0
#define X_VALUES 42... | ALGO | 0.979303 | 4.764751 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2017-10-10T08:56: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": "483bf61ae... |
685c468a-9ee7-4f6e-b8ea-7bf0bcae60af | iamhimansu/cpp | zigZagPatternTopDown.cpp | #include <iostream>
int main() {
bool reverse = false;
int rows{0}, columns{0};
std::cout << "ENTER NUMBER OF ROWS: " << std::endl;
std::cin >> rows;
std::cout << "ENTER NUMBER OF COLUMNS: " << std::endl;
std::cin >> columns;
int array[rows][columns];
std::cout << "ENTER rows x columns... | ALGO | 0.999231 | 4.919983 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2023-07-29T17:16: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": "4309e714e45... |
992bc864-b3ed-4705-a799-dc3aa2a71c6b | kamyu104/LintCode | C++/word-search.cpp | // Time: O(m * n * l), l is length of the word
// Space: O(l)
class Solution {
public:
/**
* @param board: A list of lists of character
* @param word: A string
* @return: A boolean
*/
bool exist(vector<vector<char>> &board, string word) {
unordered_set<string> ret;
vector<v... | ALGO | 0.99973 | 6.355797 | {
"github_metadata": {
"branch": "master",
"commit_count": 1293,
"repo_created_at": "2015-02-16T16:25:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 631,
"forks": 261,
"issues": 1,
"pull_requests": 3
},
"file_meta": {
"content_id": "8d4... |
ac914c26-f372-4889-8302-d0632567dc65 | waiwai444/oj | uva/656 - Optimal Programs/656.cpp | #include <stdio.h>
#define ADD 0
#define DIV 1
#define DUP 2
#define MUL 3
#define SUB 4
#define LIMIT 30000
#define MAX_N 10
#define MAX_COM 10
#define MAX_STACK_SIZE 6
int n;
int x[MAX_N], y[MAX_N];
struct command_seq
{
char com_num;
char command[MAX_COM];
};
struct stack
{
char top;
int value[MA... | ALGO | 0.999746 | 3.21325 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2020-03-29T06:14: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": "ee32bb0f5... |
a1c32db0-6e3e-426c-b03e-568f2e435ec4 | ishandutta2007/codeforces-nonalphabetic | _ss/normal/1545/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(vr) vr.begin(), vr.end()
#define vi vector<int>
#define vll vector<... | ALGO | 0.999934 | 4.572052 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:49: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": "6c9375da5fae... |
2965b181-d371-49f3-8b80-8d120ec0550c | pauloamed/ICPC | strings/hash.cpp | // extracted from https://codeforces.com/blog/entry/12145?#comment-168098
// see also https://cp-algorithms.com/string/string-hashing.html
struct SingleHash {
vector<int> suf, b;
int mod;
SingleHash(string s, int base = 153, int _mod = 1000000009) {
int n = s.length();
suf.assign(n + 1, 0);... | ALGO | 0.999511 | 5.519164 | {
"github_metadata": {
"branch": "master",
"commit_count": 554,
"repo_created_at": "2018-03-21T12:47:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c0f80a... |
b8ee2e5f-f30f-4de6-9e42-19586e504f6f | ArraryChen/Codeup_Coding | 第五章/5.6-大整数运算/A-a+b/2021.3.9.cpp | #include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
const int maxn = 1010;
struct bign{
int d[maxn];
int len;
bign(){
memset(d, 0, sizeof(d));
len = 0;
}
};
bign change(char str[]){
bign a;
a.len = strlen(str);
for (int i = 0; i < a.len; i++)
{
a.d[i] = str[a.len - i - 1] - ... | ALGO | 0.999833 | 3.903879 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-03-01T06:21:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd02db3ee33... |
cc001f8b-4c46-4018-8fd9-e35c4230cd14 | theMorshed/c_plus_plus_problem_solving | Codeforces/DIV3_B/substrings_sort.cpp | // Link: https://codeforces.com/problemset/problem/988/B
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<string> strs(n);
for (int i = 0; i < n; i++)
cin >> strs[i];
sort(strs.begin(), strs.end(), [&](string a, string b)
{ return a.size() < b.si... | ALGO | 0.999998 | 3.90334 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-12-09T16:40: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": "69b7baca27d... |
db95937e-82bb-468f-99cc-9731c6379f41 | ducvinh101101/PostApp | Bai tap lon/Bai 2/List.cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
class Node
{
public:
T value;
Node<T> *next;
Node<T> *prev;
Node(T x = NULL, Node<T> *N = NULL, Node<T> *P = NULL)
{
value = x;
next = N;
prev = P;
}
};
template <class T>
class myList
{
Node<T> *head ... | ALGO | 0.999778 | 3.445138 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-03-10T11:37: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": "269c6a20ed7... |
99fee719-cf24-42fd-b703-93173dbd5679 | hcmlab/ssi | libs/build/openSMILE-2.2rc1/src/include/dspcore/amdf.hpp | /*F***************************************************************************
* openSMILE - the open-Source Multimedia Interpretation by Large-scale
* feature Extraction toolkit
*
* (c) 2008-2011, <NAME>, <NAME>, <NAME>: TUM-MMK
*
* (c) 2012-2013, <NAME>, <NAME>, <NAME>: TUM-MMK
*
* (c) 2013-2014 audEERING ... | TOOL | 0.907182 | 4.518774 | {
"github_metadata": {
"branch": "master",
"commit_count": 342,
"repo_created_at": "2017-02-22T10:17:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 62,
"forks": 26,
"issues": 7,
"pull_requests": 1
},
"file_meta": {
"content_id": "851a52d... |
cf72c595-899f-49ed-8a64-0ff04d984cea | AryanTapre/DSA | 02_Searching/09_search_rotated_sorted_array.cpp | // search in rotated sorted array
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int find_pivot(vector<int> arr) {
int start = 0;
int end = arr.size()-1;
int mid;
while(start <= end) {
if(start == end) {
return start;
}
mid = start + (... | ALGO | 0.999993 | 5.429494 | {
"github_metadata": {
"branch": "master",
"commit_count": 233,
"repo_created_at": "2024-05-02T10:22:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a86a348... |
bf0a8153-9ea4-48a3-ad44-4e8ee635c545 | seanmenzies/UnrealProjects | CustomMathLibrary.cpp | float UCustomMathLibrary::GetLandscapeHeightAtLocation(UWorld* WorldRef, FVector Location)
{
FHitResult HitResult;
FCollisionQueryParams Params;
//Params.AddIgnoredActor(this);
FVector Start = Location + FVector(0, 0, 1000.f);
FVector End = Location + FVector(0, 0, -1000.f);
bool bGroundCheck = WorldRef->LineTrac... | TOOL | 0.954117 | 3.674762 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-07-15T11:23: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": "f65eb8da4f1... |
a93e1681-0875-492d-83b8-ebd72dec86e2 | canyos/algorithm | 백준/Gold/1038. 감소하는 수/감소하는 수.cc | #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <map>
using namespace std;
typedef long long ll;
int n;
int nCr[15][15];
int start[11][11] = { {}, {1,1,1,1,1,1,1,1,1,1} }; //i번째 자리수에서 j로 시작하는 수의 개수
ll result;
void func(int n, int k) {//n자리수 중 k... | ALGO | 0.999889 | 4.099518 | {
"github_metadata": {
"branch": "main",
"commit_count": 314,
"repo_created_at": "2024-08-16T08:08: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": "cee106bd47... |
a21d66bd-e2ce-467d-aa60-82c7005c93b3 | samyam/DTCF | DLTC/exec.cc | #include "exec.h"
#define EXPLEV 0
#define EXTLEV 1
#define SUMLEV 2
extern int tasknum;
extern ofstream ofs;
extern ofstream ofm;
extern vector<DLTC::Multiplication> m;
extern vector<DLTC::Summation> s;
namespace DLTC{
#if TASCEL
void execS(int id, TaskPool* tp) {
#else
void execS(int id, TaskPool tp) {
#endif
if... | TOOL | 0.98152 | 4.568759 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2014-08-14T17:38:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d95153bb... |
4e97006f-3539-4ba4-9a62-a2982b0ddb93 | Alphonse-03/Leetcode | 890-find-and-replace-pattern/890-find-and-replace-pattern.cpp | class Solution {
public:
// vector<pair<int,int>> helper(string& str){
// vector<pair<int,int>> patt;
// unordered_map<char,int> mp;
// int x=0;
// int c=1;
// int i=0;
// while(i<str.size()){
// if(mp.find(str[i])==mp.end()){
// m... | ALGO | 0.999947 | 5.885011 | {
"github_metadata": {
"branch": "main",
"commit_count": 1220,
"repo_created_at": "2022-02-07T18:29:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5d7c9c47... |
77b47d27-caf4-46d9-b04b-10ce5b1dc6e5 | zhangqizky/target_locator | src/detector/Target.h | #include<iostream>
#include<fstream>
#include<opencv2/opencv.hpp>
#include<opencv2/core/core.hpp>
#include "opencv2/video/tracking.hpp"
#include <opencv2/legacy/legacy.hpp> //#include "cvAux.h"
#include <opencv2/highgui/highgui.hpp>
#include<vector>
#include<sstream>
#include<math.h>
#include<stdio.h>
using ... | ALGO | 0.993375 | 4.050128 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-05-09T02:12:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "120becadc5... |
a2e69ee4-65be-4c06-acf8-2ad5698abf8e | OI-wiki/OI-wiki | docs/dp/code/tree/tree_1.cpp | #include <algorithm>
#include <iostream>
using namespace std;
struct edge {
int v, next;
} e[6005];
int head[6005], n, cnt, f[6005][2], ans, is_h[6005], vis[6005];
void addedge(int u, int v) { // 建图
e[++cnt].v = v;
e[cnt].next = head[u];
head[u] = cnt;
}
void calc(int k) {
vis[k] = 1;
for (int i = head... | ALGO | 0.999604 | 3.665163 | {
"github_metadata": {
"branch": "master",
"commit_count": 12101,
"repo_created_at": "2018-07-11T03:28:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23612,
"forks": 4310,
"issues": 112,
"pull_requests": 9
},
"file_meta": {
"content_id":... |
238965a6-e43a-45b6-96b1-d6a71d90992a | viren-sureja/Love-Babbar-450 | 10_stack_and_queues/05_implement_N_stacks_in_one_array.cpp | /*
link: https://www.geeksforgeeks.org/efficiently-implement-k-stacks-single-array/
TODO learn this properly.
*/
// ----------------------------------------------------------------------------------------------------------------------- //
// A C++ program to demonstrate implementation of k stacks in a singl... | ALGO | 0.994181 | 5.615083 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2021-03-21T14:17:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 356,
"forks": 169,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "352c5... |
d57aeec2-0279-48a5-8361-1938bb978e68 | RajanyaD/Practathon-22 | Dynamically_creating_dataset.cpp | #include<bits/stdc++.h>
#include<random>
using namespace std;
#include<time.h>
default_random_engine de(time(0)); //seed
normal_distribution<double> nd(0, 100); //mean followed by stdiv
struct Node{
vector<int>a;
int c=0;
Node *left=NULL;
Node *right=NULL;
};
class Pair{
public:
int dist=... | ALGO | 0.999883 | 4.609444 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-08-14T04:52: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": "a18a3144bd7e... |
c95730e4-7965-4efa-bdbe-9d32cf7bb819 | Coder-Goo/AlgorithmLearning | nowcoder/剑指offer/JZ25合并两个排序的链表.cpp | //其实就是归并排序的合并两个数组,建立一个附加数组
//判断两个数组元素的大小,把小的放入附加数组中,如果一个数组已经复制完全,那么就将另一个数组的所有数都复制到附加数组结尾
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLists(ListNode* l1, List... | ALGO | 0.999908 | 5.654691 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2021-06-13T08:05:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2e49953d... |
ddab38ee-e7b0-47ac-8ec4-a4fe9af1ff04 | TieJianKuDan/algorithm_cplus | src/cut_off_tree.cpp | /*
* @Author: TieJianKuDan
* @Date: 2022-05-23 09:16:46
* @LastEditors: TieJianKuDan
* @LastEditTime: 2022-05-23 11:03:38
* @FilePath: \AlgorithmProblem\src\cut_off_tree.cpp
* @Description: 675. 为高尔夫比赛砍树
* Copyright (c) 2022 by TieJianKuDan, All Rights Reserved.
*/
#include <functional>
#include <iostream>
#in... | ALGO | 0.999893 | 5.175626 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2022-03-04T05:46: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": "5bff257a7... |
852d9114-4d0d-46c7-8aa4-ddfc1bb99eb5 | setnemo/cpp-sandbox | coursera/cpp-white-belt/week_02/18_buses_3.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
using namespace std;
int main() {
bool flag = false;
int lines, stops, it = 1;
string stop, bus;
map <int, set<string>> exists;
set<string> exist;
bus = "New bus ";
cin >> lines;
while (lines--) {
... | ALGO | 0.988372 | 4.261226 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2020-09-26T11:09: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": "49164e544... |
14fd1519-4cac-4ec7-b53f-a14e506451c9 | tweilu/boids | src/Rules.cpp | #include "Rules.h"
#include "extra.h"
using namespace std;
void Rules::init(int num_boids)
{
predatorOn = false;
scatter = false;
secs = 0;
for(int i=0; i < num_boids; i++)
{
Vector3f p = randPosVec3f();
Vector3f v = randVelVec3f();
if (i==0)
{
boids.pus... | ALGO | 0.99759 | 4.305581 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2013-12-03T01: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": "831f992b6... |
cca319f0-7735-4d21-a443-52a44ee34471 | Sebarl/Evolutionary-Algorithms-for-NES-Pinball | OwnPinballAE/include/MicParallelEvolutionEngine.h | #ifndef MICPARALLELEVOLUTIONENGINE_H
#define MICPARALLELEVOLUTIONENGINE_H
#include <SimpleEvolutionEngine.h>
#include "PlatformSpecific.h"
#include <omp.h>
#include "PinballEvaluator.h"
#include <sstream>
template <class T>
class MicParallelEvolutionEngine : public SimpleEvolutionEngine<T>
{
protected:
un... | ALGO | 0.971327 | 5.383285 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-12-04T01:47: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": "19f38a0d45... |
f5b2b7b1-c7a7-4482-977c-a4928b4762a6 | rupav/cp | competitive_coding/contests/535/535C.cpp | #include<bits/stdc++.h>
using namespace std;
vector<string> permute(string s, int n, string t){
if(n == 0){
// base case
return vector<string> (1, t);
}
vector<vector<string>> temp(n);
for(int i=0; i<n; i++){
temp[i] = permute(s.substr(0, i) + s.substr(i+1, n-i), n-1, t+s[i]);
... | ALGO | 0.999843 | 3.377323 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-01-30T05:56: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": "51fa5f52e028... |
13c1a1b5-f531-4265-8ae1-660cf9eae858 | jh9amn/Master-DSA | GFG POTD/Number of occurrence.cpp | //{ Driver Code Starts
// Initial function template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int bs (vector<int> a, int target){
int s = 0;
int l = a.size()-1;
int ans = 0;
while(s <= l){
... | ALGO | 0.998172 | 5.454852 | {
"github_metadata": {
"branch": "main",
"commit_count": 450,
"repo_created_at": "2024-01-06T15:19:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf498c43eb... |
54dd92af-cf6f-4846-8361-e63ca39d38c8 | HongSongUi/Algorithm-Coding-Test- | 백준/Silver/14492. 부울행렬의 부울곱/부울행렬의 부울곱.cc | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n = 0;
cin >> n;
vector<vector<bool>> a(n, vector<bool>(n, 0));
vector<vector<bool>> b(n, vector<bool>(n, 0));
bool tmp;
for (int i = 0; i < n; i++)
{
for (int j = 0 ;j < n; j++)
{
cin >> tmp;... | ALGO | 0.999964 | 4.688567 | {
"github_metadata": {
"branch": "main",
"commit_count": 381,
"repo_created_at": "2024-04-06T15:47: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": "efed910532... |
f85fa8e1-ba0d-41b0-8c57-1369103e31e7 | tesseract-ocr/tesseract | src/lstm/lstm.cpp | ///////////////////////////////////////////////////////////////////////
// File: lstm.cpp
// Description: Long-term-short-term-memory Recurrent neural network.
// Author: <NAME>
//
// (C) Copyright 2013, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this f... | DATA | 0.969456 | 5.102636 | {
"github_metadata": {
"branch": "main",
"commit_count": 6559,
"repo_created_at": "2014-08-12T18:04:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 68226,
"forks": 10036,
"issues": 418,
"pull_requests": 26
},
"file_meta": {
"content_id": ... |
0fa20994-a347-4d33-9a33-2c6e10595532 | wenhanshi/lemsvxl-shock-computation | osf-to-esf/dbsk2d/dbsk2d_ishock_lineline.cxx | // This is brcv/shp/dbsk2d/dbsk2d_ishock_lineline.cxx
//:
// \file
#include <vcl_cstdio.h>
#include "dbsk2d_ishock_lineline.h"
#include "dbsk2d_lagrangian_cell_bnd.h"
//: \todo Need new formula for the special case
dbsk2d_ishock_lineline::
dbsk2d_ishock_lineline (int newid, double stime,
dbs... | ALGO | 0.929911 | 3.804534 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-11-02T14:11: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": "01046ab58... |
27890bdc-a5c5-45ea-8fa5-3a4830c17b09 | sauloverissimo/foggeett | foggeett/functions/adx.hpp | #pragma once
#include <vector>
#include <string>
#include <optional>
#include "functions.hpp" // Inclui Tick, KPIResult, etc.
/**
* ADX: Average Directional Index
* Mede a força da tendência com base em high, low e price.
*
* @param ticks Vetor de candles (Tick) com campos: price, high, low
* @param campo ... | ALGO | 0.958916 | 6.266832 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2025-04-29T11:48: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": "cb3786ead74... |
1da3f5f9-32a8-4414-a7a2-6368639a4f21 | LastComrade/Striver-SDE-Sheet | Day-02 (Arrays Part - 2)/Merge Intervals.cpp | // Problem Link - https://leetcode.com/problems/merge-intervals/solution/
// <---------------------- ONLY SORTING SOLUTION ---------------------->
class Solution
{
public:
vector<vector<int>> merge(vector<vector<int>> &intervals)
{
sort(intervals.begin(), intervals.end());
vector<vector<int>> merged;
... | ALGO | 0.999999 | 6.274768 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2022-06-11T07:52:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9bcb64b59f... |
eba2c164-d03d-4f8a-98d6-f00d7bc3670d | AlienceGG/LeetCode-3 | problems/154.Find_Minimum_in_Rotated_Sorted_Array_II/AC_binary_search_logn.cpp | /*
* Author: illuz <<EMAIL>[at]<EMAIL>>
* File: AC_binary_search_logn.cpp
* Create Date: 2015-04-24 22:40:17
* Descripton: The worst is O(n)
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 0;
class Solution {
public:
int findMin(vector<int> &num) {
int left = 0, right = nu... | ALGO | 0.999912 | 4.802181 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2017-02-27T15:37:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20d94d8e... |
7a147c31-4fb3-4523-89b1-fcabbf3a0e64 | coderKillo/cpp_playground | 2048Game.cpp | #include <iostream>
#include <chrono>
#include <thread>
#include <cstdint>
#include <string>
#include <random>
#include <ctime>
#include <vector>
//#define DEBUG
constexpr uint8_t MAX_WIDTH = 4;
constexpr uint8_t MAX_HEIGHT = 4;
void clrscr()
{
std::cout << "\033[2J\033[1;1H";
}
struct Point
{
Point(int px... | TOOL | 0.968435 | 4.286464 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-01-26T23:01: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": "f4777fbf9... |
8f9c96c4-f8fa-4032-b6e0-e45a6b2965fd | wdiiahk/procon-archive | atcoder.jp/arc061/arc061_a/Main.cpp | //デバッグ用オプション:-fsanitize=undefined,address
//コンパイラ最適化
#pragma GCC optimize("Ofast")
//インクルードなど
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//マクロ
//forループ
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
//FORAは範囲for文(使いにくかったら消す)
#define R... | ALGO | 0.999912 | 4.106479 | {
"github_metadata": {
"branch": "main",
"commit_count": 544,
"repo_created_at": "2021-03-07T00:32: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": "82fe1b7917... |
e94bf7a0-2df5-4ecc-a029-2b60dbf4185f | lawfree/data_struc_algo | recursive_retrospective_divide/rescursive_retrospective_1008.cpp | #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <algorithm>
using namespace std;
class Recursive_retrospective{
public:
Recursive_retrospective() {}
/*
* 1
* 1 2
* 1 2 3
* 1 3
* 2
* 2 3
* 3
*/
void subsetI(vector<int... | ALGO | 0.999396 | 4.701695 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2019-07-15T01:29:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "904157b56... |
1997141e-2730-4e5c-a81a-f9052a4bf77b | mauliktrapas/data-structure-and-algorithm | advance2.7.2/main.cpp | #include <iostream>
using namespace std;
class TwoD{
public : void search(int** ar, int fromRow, int toRow,
int fromCol, int toCol, int key)
{
int i = (toRow+fromRow )/2;
int j = (toCol+fromCol )/2;
if (ar[i][j] == key)
cout << " x-cordinate " << i << " y cordinate " << j << endl;
else
{
... | ALGO | 0.999481 | 4.023717 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-03-19T08:32: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": "00cc3902a3... |
0c5696aa-d7b5-4a25-bb28-8fc032fd32c0 | DenialRiver1434/USACO-Study | 5-MinorSites/c-YS/QueueOperate.cpp | #define pb push_back
#define mp make_pair
#define mt make_tuple
#define is insert
#define ll long long
#define for_loop(i, begin, n) for (ll i = begin; i < n; i ++)
#include <bits/stdc++.h>
using namespace std;
ll powermod(ll base, ll exp, ll MOD) {
base %= MOD;
ll result = 1;
while (exp > 0) {
if (exp % 2 == 1) ... | ALGO | 0.999153 | 4.600144 | {
"github_metadata": {
"branch": "main",
"commit_count": 276,
"repo_created_at": "2021-12-13T00:32:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "212779e0d5... |
1e4ac960-111c-41c4-b387-443819ee90c8 | minpark96/Data-Structure-and-Algorithm-Study | CodingTest/3-A-15686.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
무식하게 풀면 된다.
bfs까지 필요없는데 거리를 bfs로 구하려고 했다. 조합을 구하는 방법을 구하는게 어려웠다.
*/
#pragma region 최초 풀이
int n, m, a[54][54];
int min_ret = 2147483647;
vector<pair<int, int>> h, c;
vector<int> v;
void comb(int curr)
{
if (v.size() == m)
{
int sum = 0;
for (pair<... | ALGO | 0.999582 | 4.2413 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2023-12-28T02:27:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62672d353... |
4543e4ab-bffd-4d90-b82d-dfe891a52306 | ishandutta2007/codeforces-l | low_/normal/1209/B.cpp | #include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<deque>
#include<set>
#include<map>
#include<bitset>
#include<ctime>
#include<queue>
using namespace std;
#define int long long
#define mn 2605
#define inf 4444444444444444444
#define mod 1000000009
#defin... | ALGO | 0.999908 | 3.421254 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04cbe3231fc0... |
8114df2f-c3d0-45f1-adb3-3f49a31322cf | ilhamfp/competitive-programming | Codeforce/897C - Nephren gives a riddle.cpp | // # ======================================= #
// # <NAME>, 22 Desember 2017 #
// # ======================================= #
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define nl printf("\n");
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;... | ALGO | 0.999702 | 3.269443 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2018-02-18T10:22:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "8448ec6a9... |
bff83edb-140b-40aa-9bab-524bcb1d967f | Vishnuvardhan799/DSA_PREP1 | DSA_PREP/week-1 (BinarySearch)/striver/BS2.cpp | #include <bits/stdc++.h>
// lower bound
int lowerBound(vector<int> arr, int n, int x)
{
int low = 0;
int high = n - 1;
int ans = n;
while (low <= high)
{
int mid = low + (high - low) / 2;
if (arr[mid] >= x)
{
ans = mid;
high = mid - 1;
}
... | ALGO | 0.999969 | 5.485497 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-11-30T07:50: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": "e2eb188594a3... |
3644f851-1ae4-469d-8ba2-c92e0015d200 | R-Brunson/CSC-134 | Module 5/M5LAB2_Brunson.cpp | // M5LAB2
// <NAME>
// 4/2/2025
// calculate the area of a box w/ functions
#include <iostream>
using namespace std;
// Declare (Write the prototypes for)
// the getLength,
// getWidth, getArea, and displayData
// functions here.
void displayData(double len, double wid, double aREA);
double getWidth();
double getLeng... | TOOL | 0.986949 | 4.766411 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2025-01-13T15:35:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f70bc451aa... |
ad3e5c53-0942-4f13-9a2a-45329954147f | cyjseagull/gem5-nvmain-hybrid-simulator | gem5-stable/src/base/intmath.cc | /*
* Copyright (c) 2001, 2003-2005 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: redistributions of source code must retain the above copyright
... | ALGO | 0.999961 | 5.060417 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2015-09-14T01:17:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 77,
"forks": 49,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "80dda3f... |
2101e0da-bcd3-48d4-a08e-6cb2e7bbf1d8 | yinghaoyu/algorithms | graphic/Kruskal.cc | #include <algorithm>
#include <iostream>
#include <vector>
// 克鲁斯卡尔最小生成树
// 算法思想:使用并查集
// (1)总是从权值最小的边开始找,依次找权值依次变大的边(权值相等任选其一)
// (2)如果当前的边进入最小生成树的集合中不会形成环,就要当前边;否则舍弃
// (3)找完所有边之后,最小生成树的集合也就得到了
using namespace std;
class Kruskal
{
private:
static const int MAXN = 5001;
static const int MAXM = 200001;
vect... | ALGO | 0.999945 | 3.954975 | {
"github_metadata": {
"branch": "master",
"commit_count": 364,
"repo_created_at": "2022-03-22T08:13: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": "c850e6ac... |
f9056e05-6975-4813-8495-a769b6b7551a | LinYunWen/acm | Shortest-path/POJ-2387.cpp | /*
*using Bellman-Ford to find out the shortest path
*form node1 to nodeN.
*/
#include <cstdio>
#include <cstring>
using namespace std;
int graph[1100][1100];
int dis[1100];
int T,N;
int flag;
#define INF 9999999
void relax(int u,int v)
{
if(dis[u]+graph[u][v] < dis[v]){
dis[v] = dis[u]+graph[u][v];... | ALGO | 0.999947 | 3.763581 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-01-26T08:10: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": "80d911970c... |
0cbc3f18-897c-486a-ae5b-8ebb89393de8 | kusano/Shogi55GUI | engine/board.cpp |
#include "board.h"
#include "config.h"
#include "mt19937ar.h"
/*
* 駒の動き
*/
int CBoard::PieceMoveNear[30][16] = {
{ }, {}, // 空
{ -7, }, {}, // 歩
{ -8, -7, -6, 6, 8 }, {}, // 銀
{ }, {}, // 角
{ }, ... | ALGO | 0.994349 | 3.986116 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-01-07T18:05: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": "e23126763... |
1245dce5-a5ce-4c39-b87d-6f04d4bab5f7 | hyeon0121/programmers_problem | 길찾기게임.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
struct Node{
int x;
int y;
int number;
Node * left;
Node * right;
};
bool desc(Node a, Node b)
{
if(a.y == b.y)
{
return a.x < b.x;
}
return a.y > b.y;
}
void addNode(Node* p... | ALGO | 0.999997 | 4.30799 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2019-07-15T04:21: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": "bc071e06e... |
d4d0c73f-d510-4448-ac8d-a6ba39a27028 | djhendrix2/CSCI130_Week6_HW_DillonHendrix | P3/main3.cpp | /*****************************************
Programmer: <NAME>
Discription: Exercise 7 in 6.2 manipulating factors to determine hydroelectric power.
Date: 9/27/22
*****************************************/
#include <iostream>
#include <cmath>
using namespace std;
// Function declaration
double getHvalue(do... | ALGO | 0.999249 | 5.408047 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-09-29T16:01: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": "162053a4ff28... |
f1f19d9a-d73c-4a46-aa8f-63de78d9b347 | parasnaulia/Dsa-array | Dsa Revision/double.cpp | #include <iostream>
using namespace std;
#include <bits/stdc++.h>
class node
{
public:
int val;
node *prev;
node *next;
node(int val)
{
this->val = val;
prev = NULL;
next = NULL;
}
};
void traversal(node *head)
{
node *pp=head;
while(pp... | ALGO | 0.999866 | 4.008049 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-12T10:11:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "477b7faf8bcc... |
7571cc9c-0dfe-4d9e-bb96-e076b9334816 | Xilinx/vcu-ctrl-sw | exe_encoder/TwoPassMngr.cpp | /******************************************************************************
*
* Copyright (C) 2018 <NAME>. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without ... | TOOL | 0.90474 | 5.401434 | {
"github_metadata": {
"branch": "master",
"commit_count": 180,
"repo_created_at": "2017-02-02T06:41:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 39,
"forks": 31,
"issues": 11,
"pull_requests": 2
},
"file_meta": {
"content_id": "4dc77b... |
c26f4360-4fc8-4101-ba67-2ef77d82d449 | NICTA/obsidian | src/fwdmodel/magnetic.hpp | //!
//! Contains the interface for the magnetic forward model.
//!
//! \file fwdmodel/magnetic.hpp
//! \author <NAME>
//! \date 2014
//! \license Affero General Public License version 3 or later
//! \copyright (c) 2014, NICTA
//!
#pragma once
#include "fwdmodel/fwd.hpp"
#include "fwdmodel/gravmag.hpp"
namespace obsi... | ALGO | 0.95603 | 6.233291 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-06-18T07:55:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c954548f2... |
4de52446-58fc-4c70-9e97-d502303af010 | caonann/algorithm_cpp | sort/mergeSort.cpp | /*
@filename mergeSort.cpp
@author caonan
@date 2022-05-15 16:33:00
@reference leetcode
@url https://leetcode-cn.com/problems/sort-an-array/
@brief 实现归并排序
*/
#include <assert.h>
#include <stdio.h>
#include <algorithm>
#include <bitset>
#include <deque>
#include <iostream>
#include <list>
#inc... | ALGO | 0.999997 | 5.996107 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2022-03-20T14:27: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": "84a9ec99d28... |
ebebe9c3-dd2d-4551-ab55-a5f3bbcb5420 | Astatine404/DS_repo | components.cpp | #include<iostream>
using namespace std;
const int N=20;
void createGraph(int G[N][N], int n)
{
int a, b;
//Initialize graph
for(int i=1; i<=n; i++)
{
for(int j=1; j<=n; j++)
G[i][j] = 0;
}
cout<<"Enter pair and weight";
while(true)
{
cin>>a;
if(a==99)
break;
cin>>b;
G[a][b] = 1;
}
}
void print... | ALGO | 0.999966 | 3.6647 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-04-05T17:47: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": "091f355245... |
c77c79e7-452a-442a-a56d-1358cdb4883a | lucas-ham/HW6CS221 | tree.cc | #include <string>
#include "tree.hh"
tree_ptr_t create_tree(const key_t& key, const value_t& value, tree_ptr_t left, tree_ptr_t right)
{
tree_ptr_t newTree = new Tree();
newTree->key_ = key;
newTree->value_ = value;
newTree->left_ = left;
newTree->right_ = right;
return newTree;
/*
allocate space for a tree ... | ALGO | 0.998448 | 4.474485 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-03-13T02:21: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": "556cea0b994... |
6e9bf685-dc93-4f8e-a8e0-c07b6bbbd11c | CMMayer/Toolkit-for-Ring-LWE-v1.0 | include/Transformations/MatrixRealGS.h | #pragma once
#ifndef MATRIX_REAL_GS_H
#define MATRIX_REAL_GS_H
#include "boost/numeric/ublas/matrix.hpp"
#include "Transformations/AbstractVectorTransformation.h"
namespace RLWE_Toolkit {
namespace Transformations {
class MatrixRealGS;
}
}
/*
Represents the prime-indexed real transformations D_p and U_p in th... | ALGO | 0.974487 | 6.450644 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2015-12-15T13:20:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 8,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f59ff0ef... |
22d14185-f046-4f8c-87d1-cdf344146efb | ishandutta2007/codeforces-f | far_from_noob/normal/1353/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define dd double
#define endl "\n"
#define pb push_back
#define all(v) v.begin(),v.end()
#define mp make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pll pair<ll,ll>
#define fo(i,n) for(int i=0;i<n;i++)
#define fo1(i,n) for(int... | ALGO | 0.999744 | 3.908403 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43: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": "3dd5e074a0be... |
3c4f2f19-5671-4caa-ac78-391f75df54aa | junlong-gao/recreations | src/code_practise/leetcode/cpp/00489.cpp | /**
* // This is the robot's control interface.
* // You should not implement it, or speculate about its implementation
* class Robot {
* public:
* // Returns true if the cell in front is open and robot moves into the cell.
* // Returns false if the cell in front is blocked and robot stays in the curren... | ALGO | 0.993479 | 6.281972 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-05-24T05:16:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a60b09d3... |
76b470af-37b7-4327-8808-ef81d268aecd | MightyBhargava/DAA- | DAY-2/floydas.cpp | #include <stdio.h>
#define INF 99999
#define V 4 // Number of vertices
// Function to print the solution matrix
void printSolution(int dist[V][V]) {
printf("The following matrix shows the shortest distances between every pair of vertices:\n");
for (int i = 0; i < V; i++) {
for (int j = 0; j < V; j++)... | ALGO | 0.999995 | 4.769435 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-09-05T06:58: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": "9271b2ebd1c7... |
40324492-bc8e-4fed-959c-05d247ee08c1 | lunlun1992/LeetCode | 43. Multiply Strings.cpp | //大整数乘法,注意点如下
//注意存放中间结果的位置,我是从小到大存储的,乘数1的第i位乘以乘数2的第j位,对应的位置是i+j
//注意最后多余0的去除,原因是前面仍然存在很多0,要加一个while循环去除
class Solution {
public:
string multiply(string num1, string num2) {
string ans = "";
int len1 = num1.size();
int len2 = num2.size();
vector<int> prod(220, 0);
for(int... | ALGO | 0.999992 | 4.791291 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2017-01-16T12:43: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": "567963c41... |
b94d9ff6-0ee8-461a-ace6-b449ce1109be | ghdic/CodingProblemSolving | BaekjoonProblemSolving/BaekjoonProblemSolving/4597.cpp | /*
https://www.acmicpc.net/problem/4597
&Title
4597번 - 패리티
&Question
1의 개수가 홀수개인 비트스트링을 "홀수 패리티"를 가지고 있다고
한다. 또, 짝수개인 경우에는 "짝수 패리티"를 가지고 있다고 한다.
또, 0도 짝수로 간주한다. 따라서, 1이 없는 비트 스트링은
짝수 패리티를 가지고 있다. 마지막 숫자가 지워진 비트 스트링이
주어지고, 이 비트 스트링의 패리티가 주어졌을 때, 마지막 숫자를
올바르게 구하는 프로그램을 작성하시오.
&Input
입력은 여러 개의 비트 스트링으로 이루어져 있다. 각... | ALGO | 0.998916 | 4.101668 | {
"github_metadata": {
"branch": "master",
"commit_count": 423,
"repo_created_at": "2018-01-01T19:38:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b6351ea... |
957e5414-4df4-4970-845c-c80f26e1f325 | DigitalHumanSpace/MetaHuman_DNA_Tools | dnacalib/DNACalib/src/dnacalib/commands/CalculateMeshLowerLODsCommand.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "dnacalib/commands/CalculateMeshLowerLODsCommand.h"
#include "dnacalib/CommandImplBase.h"
#include "dnacalib/dna/DNA.h"
#include "dnacalib/dna/DNACalibDNAReaderImpl.h"
#include "dnacalib/types/Aliases.h"
#include "dnacalib/types/UVBarycentricMapping.h"
name... | TOOL | 0.978713 | 6.586758 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-06-11T15:16:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17cf0488de8... |
d97c23c1-171d-418b-9351-25b3fa01e40d | mohitkumaragrawal/cpp-algo | binary-tree/diameter-and-height.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include "binary-tree.hpp"
using namespace std;
int calc_height(node_i* root) {
if (!root) return 0;
return max(calc_height(root->left_child), calc_height(root->right_child)) + 1;
}
int calc_diameter(node_i* root, int& height) {
if (!root) {
heigh... | ALGO | 0.999698 | 4.734646 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2022-02-23T08:44:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e16b97d... |
6701b599-7352-430c-a0fc-58e6baeab323 | GOR-OM/DSA-Problem-for-placement | Binary Search/Search Element in Rotated Sorted Array - I.cpp |
#include <bits/stdc++.h>
using namespace std;
int search(vector<int>& nums, int target) {
int n = nums.size();
int low = 0, high = n-1;
while(low <= high) {
int mid = low + (high-low)/2;
if(nums[mid] == target) return mid;
else if(nums[mid] >= nums[low]) {
if(target >=... | ALGO | 0.999972 | 5.803032 | {
"github_metadata": {
"branch": "main",
"commit_count": 274,
"repo_created_at": "2024-01-11T09:22: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": "0195b6ea78... |
42c54cc1-17fe-4a6e-97cc-49e328dfad44 | electronicarts/CnC_Generals_Zero_Hour | GeneralsMD/Code/Libraries/Source/Compression/EAC/huffencode.cpp | /*
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option... | TOOL | 0.941757 | 4.076465 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-08-22T01:39:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4261,
"forks": 1411,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a69a25d... |
0d067d1a-420a-41d5-90ec-9528f86ac06f | GiuliaLavizzari/LabMuoni | effSingle/MCsimulation.cpp | #include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <TAxis.h>
#include <TCanvas.h>
#include <TF1.h>
#include <TFitResult.h>
#include <TH1D.h>
#include <TLate... | ALGO | 0.95495 | 3.864932 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-11-17T19:09:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc2c3488f03... |
13264acf-fb2a-40aa-bcdc-2768d47f9cf6 | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/1_8709_165.cpp | #include <bits/stdc++.h>
using namespace std;
int a[100005];
int val[100005];
vector<int> v[100005], adj[100005];
map<pair<int, int>, int> maps, check;
int abb = 1;
int flag = 0;
int visit[100005];
int bfs(int x) {
queue<int> q;
q.push(x);
visit[x] = 1;
while (!q.empty()) {
x = q.front();
q.pop();
i... | ALGO | 0.999996 | 3.878714 | {
"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": "7084f365f66... |
b6767213-e1e0-4a22-87c6-f51068504b37 | yashs33244/my-cpp-codes | graphs_az_march/dfs/Find_the_Number_of_Rooms.cpp | #include <bits/stdc++.h>
using namespace std;
// Shorthand for common data types
#define int long long
#define ll long long
#define ld long double
#define ar array
#define vi vector<int>
#define vvi vector<vi>
#define vvvi vector<vvi>
#define vs vector<string>
#define vvs vector<vs>
#define pii pair<int, int>
#define ... | ALGO | 0.999798 | 5.805294 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-12T18:11: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": "7cd93d925108... |
ade93bd0-d0cc-420d-9e22-80ac9feca538 | arangodb/arangodb | 3rdParty/boost/1.78.0/boost/accumulators/statistics/kurtosis.hpp | ///////////////////////////////////////////////////////////////////////////////
// kurtosis.hpp
//
// Copyright 2006 <NAME>, <NAME>. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_ACCUMULATORS_STA... | ALGO | 0.951861 | 6.785548 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
c5bc57a1-dc33-4660-a131-c905e7e81cf9 | xinyufei/route_recommendation_trust | to_cpp/wrapper.cpp | #include <Python.h>
#include <iostream>
#include <string>
#include <map>
int main() {
// Initialize the Python Interpreter
Py_Initialize();
// Import the Python module
PyObject* pName = PyUnicode_DecodeFSDefault("algorithm_for_game");
PyObject* pModule = PyImport_Import(pName);
Py_DECREF(pName... | TOOL | 0.990013 | 6.368403 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-11-02T03:10: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": "b606f580297... |
dfa543df-5663-40de-822e-58d902733ca3 | TigerMee/leetcode_onlinejudge | backtracking/sudoku_solver2.h |
// 每一步选取可能性最小的方格(非严格)
//
class Solution2 {
const int DIMENSION = 3;
const char EMPTY = '.';
typedef vector<vector<char> > BoardType;
int _caculate_count;
public:
void solveSudoku(vector<vector<char> > &board) {
// Start typing your C/C++ solution below
// DO NOT write int main() fu... | ALGO | 0.999729 | 5.665434 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2013-07-13T14:31:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5656f7a748... |
283f4514-5ad7-480f-bbe6-1770861aa25d | dhineshmuthukaruppan/my_solution__competitive_programming | Datastructures general problems Implementations/17 hashing - chaining method/main.cpp | #include <iostream>
#include <vector>
using namespace std;
class Node{
public:
int data;
Node *next;
};
class Hashtable{
public:
Node **HT;
Hashtable();
~Hashtable();
int hash(int key);
void insert(int key);
int se... | ALGO | 0.999732 | 4.608278 | {
"github_metadata": {
"branch": "master",
"commit_count": 908,
"repo_created_at": "2020-03-11T12:03: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": "73c14233... |
253d7944-140d-4b72-9faa-1c213433fbfb | KIMBIBLE/C_tutorial | c_coding_tutorial/tutorial_26/tutorial_26/HW26.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
int inputNumber();
int playOneGame(int num, int key);
int main()
{
int num;
int win = 0, draw = 0;
int key;
int res;
srand((unsigned int)time(NULL));
key = rand() % 3 + 1;
num = inputNumber();
while (res = playOneGame(num, key)) {// return > lose : 0,... | ALGO | 0.999797 | 3.768522 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2016-12-27T13:16: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": "773205507... |
0e1ad155-958b-4ff2-a2b1-85b63ee60124 | ShironCat/UNESP | SEM3/LABED1/18-04-18/E1.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
typedef struct ELEMENTO {
string nome;
struct ELEMENTO *prox;
} lista;
lista *insereLista(lista *inicio, lista *fim, string nome) {
lista *novo = new lista();
novo->nome = nome;
if(inicio == NULL) {
novo->prox = n... | ALGO | 0.997601 | 3.484752 | {
"github_metadata": {
"branch": "main",
"commit_count": 179,
"repo_created_at": "2019-01-09T11:33: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": "c198f2c26b... |
bf7b1e6a-23eb-4465-95bd-102f8698f234 | tienit150198/ACM | Contest/ContestLast2018/ACM2019_01/is_anagram.cpp | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define DEBUG(x) { cout << #x << " = "; cout << (x) << end... | ALGO | 0.999974 | 4.083204 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-06-28T11:23:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e283b9bd5... |
f64267b1-e3fb-4223-84fb-9f7aacce6c40 | njrafi/Competitive-Programming-Solutions | LightOJ/1071 - Baker Vai.cpp | #include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define gc getchar
#define pc putchar
#else
#define gc getchar_unlocked
#define pc putchar_unlocked
#endif
using namespace std;
#define vi vector<int>
#define si set<int>
#define vs vector<string>
#define pii pair<int, int>
#define vpi vector<pii>
#define pri priority_queue... | ALGO | 0.999857 | 3.544894 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-09-23T14:35:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3eac34d4... |
462b1db8-2a2b-4293-ada1-f3b4dc8688cf | ar90n/lab | contest/topcoder/322/BattleshipChecker_ontheway.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
class BattleshipChecker {
public:
int bs( ve... | ALGO | 0.999687 | 5.1089 | {
"github_metadata": {
"branch": "main",
"commit_count": 792,
"repo_created_at": "2017-01-03T04:15:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 151
},
"file_meta": {
"content_id": "c5c06ae8... |
ea0cb9e6-1d7d-45c5-8470-3fd8e6bd2928 | StevenL2017/Codeforces | problem/archive/675/675E.cpp | #include <iostream>
#include <cstdio>
#include <climits>
#include <cmath>
#include <cstring>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <algorithm>
#include <functional>
using namesp... | ALGO | 0.999795 | 4.032554 | {
"github_metadata": {
"branch": "master",
"commit_count": 1534,
"repo_created_at": "2022-09-26T06:10:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2add21... |
69edb0e8-101e-4820-bdd7-2a9ecd54570e | gashe-soo/Algorithm | Baekjoon/2178_미로탐색.cpp | #include <iostream>
#include <queue>
#include <string>
//백준 2178번 미로 탐색
using namespace std;
// 보자마자 생각난건 다익스트라 알고리즘
// 하지만 bfs로도 풀 수 있을 것 같아, bfs로 풀었다.
// 하지만 다익스트라도 버릴 수 없어 혼합된 형태의 알고리즘 작성.
typedef pair<int, int> pi;
int map[100][100];
int dist[100][100];
int n, m;
int dx[4] = { -1,1,0,0 };
int dy[4] = { 0,0,-1,... | ALGO | 0.99993 | 4.011817 | {
"github_metadata": {
"branch": "master",
"commit_count": 263,
"repo_created_at": "2020-05-12T06:23:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14822b71... |
d94cf883-390e-4263-a382-bc268f593833 | RyanCCK/Leetcode-Submissions | 0022__generate_parentheses.cpp | /*
LEETCODE PROBLEM 22 | Generate Parentheses | 5/12/2022
*****************************************************************************************************************************
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
Constraints:
1 <= n <= 8
... | ALGO | 0.99799 | 6.629032 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2022-04-16T21:18: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": "16ede76cabc... |
4cceabf7-46b0-4cd7-806a-9869b60d2399 | ishandutta2007/codeforces-c | chemthan/normal/547/B.cpp | //#include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, n) for(int i = 0; i < n; i++)
#define FOR2(i, a, b) for(int i = a; i < b; i++)
#define FORd(i, n) for(int i = n - 1; i >= 0; i--)
#define FORd2(i, a, b) for(int i = a - 1; i >= ... | ALGO | 0.999977 | 3.190488 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48b6c6cbca9c... |
bfa73eb3-52ad-4336-8ee8-2c648ea0a026 | nilot-pal/SPHinXsys-nilo | tests/2d_examples/test_2d_droplet_impact_on_solid_test_with_mu/src/droplet_impact.h | /**
* @file wetting.h
* @brief Numerical parameters and body definition for 2D two-phase wetting flow.
* @author <NAME>
*/
#include "sphinxsys.h" // SPHinXsys Library.
using namespace SPH; // Namespace cite here.
//----------------------------------------------------------------------
// Basic geometry paramet... | ALGO | 0.998294 | 4.937227 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-12-18T18:59:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6487507d3b0e... |
836b2a7d-7c08-4fba-8260-66c61ff4c19c | RUSHDCAT/Contest-Solutions | wf11/e.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cout.tie(0);
int n, m, p, q, cas = 0;
while (cin >> n >> m >> p >> q) {
if (not (n || m || p || q)) break;
int r = n + m;
vector<vector<int> > sum(r+1, vector<int>(r+1, 0));
// cout <... | ALGO | 0.9999 | 4.053946 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-06-30T17:32:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de14d241d... |
a9deb0e1-d94b-4c35-8dd0-dc8ad29da28d | omjain2001/Leetcode | 2471-minimum-amount-of-time-to-collect-garbage/minimum-amount-of-time-to-collect-garbage.cpp | class Solution {
public:
int garbageCollection(vector<string>& garbage, vector<int>& travel) {
int time = 0;
int n = garbage.size();
vector<int> cum(n,0);
for(int i=0; i<travel.size(); i++){
cum[i+1] = cum[i] + travel[i];
}
int mc = 0, mi = 0, pc = 0, pi ... | ALGO | 0.999736 | 5.490458 | {
"github_metadata": {
"branch": "main",
"commit_count": 815,
"repo_created_at": "2024-03-09T04:13: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": "c148d058ab... |
e4293fda-ac52-4601-bc84-29eb7adf60e6 | chapterjason/Clod | src/Clod/Algorithm/JarvisMarch.cpp | #include <Clod/Algorithm/JarvisMarch.hpp>
#include <Clod/Geometry/Vertex.hpp>
namespace Clod
{
std::vector<Vertex> JarvisMarch(const std::vector<Vertex> &vertices)
{
const auto size = static_cast<int>(vertices.size());
std::vector<Vertex> convexHull;
auto leftmostIndex = 0;
... | ALGO | 0.999965 | 6.722114 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2024-02-21T20:25: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": "d4d682130... |
d03510f9-3403-4fd6-897d-91e1b02d639a | kernsuite-debian/carta-casacore | casa6/casa5/code/synthesis/MeasurementComponents/nPBWProjectFT.cc | // -*- C++ -*-
//# nPBWProjectFT.cc: Implementation of nPBWProjectFT class
//# Copyright (C) 1997,1998,1999,2000,2001,2002,2003
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public Lice... | ALGO | 0.974549 | 5.762712 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-06-30T10:51:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5840eac603d... |
997cfca4-4c23-463c-a879-376378c271f0 | akash701752/leetcode | 1579-Remove-Max-Number-of-Edges-to-Keep-Graph-Fully-Traversable.cpp | class Solution {
public:
int maxNumEdgesToRemove(int n, vector<vector<int>>& edges) {
int res = 0;
vroot = vector(2, vector(n,0));
for(int t : {0,1}) for(int j=0;j<n;j++) vroot[t][j] = j;
auto vedge = vector(3, vector<pair<int,int>>());
for(auto& e:edges) vedge[e[0]-... | ALGO | 0.999929 | 5.562404 | {
"github_metadata": {
"branch": "main",
"commit_count": 982,
"repo_created_at": "2021-10-05T14:16: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": "e4b162a11a... |
16b3f77a-8764-468f-b9cf-1b68bce88e08 | Isaac-Zimba-J/Cpp-programming | Santa Claus/Santa.cpp | #include <iostream>
#include <thread>
#include <mutex>
#include <chrono>
#include <random>
#include <vector>
#include <condition_variable>
using namespace std;
int numberOfElf = 6;
int numberAllowed = 3;
int elfNumberCounter = 0;
mutex elfMutex;
condition_variable elfCV;
int reindeerCounter = 0;
int numberOfReindeer... | TOOL | 0.915529 | 4.615495 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-02-11T09:20:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3714ae4f21cd... |
360cc409-606f-4060-945c-a0a1e4e62a14 | ruifshi/LeetCode | LeetCode/RobotRoomCleaner.cpp | #include "stdafx.h"
#include "RobotRoomCleaner.h"
bool Robot::move() {
return true;
}
void Robot::turnLeft() {
return;
}
void Robot::turnRight() {
return;
}
void Robot::clean() {
return;
}
//O(matirx size)
void Solution::cleanRoom(Robot& robot) {
int cur_dir = 0;
unordered_map<int, unordered_map<int,int>>... | ALGO | 0.999656 | 5.085253 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2018-11-21T08:10:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c768cb1f7... |
0a7b1b84-4e10-4c6e-9eb4-d820455a2842 | bkhnk48/hoangnv-sfm | src/App.cpp | #if defined(__linux__)
#include <GL/glut.h>
#else
#include <GLUT/glut.h>
#endif
#include <random>
#include <lib/nlohmann/json.hpp>
#include "model/SocialForce.h"
#include "constant/Constant.h"
#include "renderer/Renderer.h"
using namespace std;
using namespace Constant;
using namespace Renderer;
using json = nlohman... | ALGO | 0.918677 | 3.431033 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2023-11-18T04:30:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bd184bf1f... |
eb2decf4-28ca-439b-9562-d62e34e1c538 | arangodb/arangodb | 3rdParty/boost/1.78.0/libs/yap/example/autodiff_library/autodiff.h | /*
* autodiff.h
*
* Created on: 16 Apr 2013
* Author: s0965328
*/
#ifndef AUTODIFF_H_
#define AUTODIFF_H_
#include <boost/unordered_set.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_sparse.hpp>
#include <boost/numeric/ubla... | ALGO | 0.99073 | 3.223784 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
72fc969f-5ce7-4513-9506-5d5aff1384d5 | ybouret/yttrium | src/mkl/y/mkl/algebra/ortho-space.cpp |
#include "y/mkl/algebra/ortho-space.hpp"
#include "y/mkl/algebra/lu.hpp"
namespace Yttrium
{
namespace MKL
{
bool OrthoSpace:: Build(Matrix<apz> &Q,
const Matrix<apz> &P)
{
const size_t p = P.rows; // number of vectors
const size_t ... | ALGO | 0.958667 | 4.775144 | {
"github_metadata": {
"branch": "main",
"commit_count": 5725,
"repo_created_at": "2023-06-28T20:59: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": "670bc8969... |
1f3f45a9-e869-4001-aa05-11641c428c17 | SuHyeonJeong/acm_study | 2020_acm/DFS와 BFS/2178_re.cpp | #include <iostream>
#include <string>
#include <queue>
using namespace std;
int map[101][101];
bool visit[101][101];
int N, M;
queue<pair<int, int>> q;
int dx[] = { -1,1,0,0 };
int dy[] = { 0,0,-1,1 };
void BFS()
{
while (!q.empty())
{
int y = q.front().first;
int x = q.front().second;
q.pop();
for (int i... | ALGO | 0.999961 | 3.915874 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2019-02-25T12:11: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": "e21474fd0... |
9e919979-a33b-4f1a-b01b-202bf0bf38fa | Illumina/ExpansionHunter | ehunter/alignment/AlignmentFilters.hh | //
// Expansion Hunter
// Copyright 2016-2019 Illumina, Inc.
// All rights reserved.
//
// Author: <NAME> <<EMAIL>>
//
// 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.a... | ALGO | 0.990443 | 6.913003 | {
"github_metadata": {
"branch": "master",
"commit_count": 240,
"repo_created_at": "2016-11-10T19:53:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 195,
"forks": 53,
"issues": 81,
"pull_requests": 5
},
"file_meta": {
"content_id": "c3304... |
d17bec3f-44ff-4342-a21c-ef79beaf923f | dmh2000/go_leetcode | hr/code/dijkstra.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <cstdlib>
#include <cstdint>
#include <climits>
#include <string>
using namespace std;
// for input
struct node_t {
int64_t p;
int64_t q;
int64_t len;
node_t(int64_t xp,int64_t xq,int6... | ALGO | 0.999798 | 4.379679 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-09-21T22:20: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": "3301ac28c0ce... |
b003711f-bc05-4552-87b6-e86a2d5386a3 | Azure-Vani/acm-icpc | bzoj/1270.cpp | //#define Debug
#include <cstdio>
#include <algorithm>
#include <cctype>
namespace Solve {
typedef long long Int64;
const int MAXN = 2011;
inline int ScanInt(void) {
int r = 0, c;
while (c = getchar(), !isdigit(c)) {}
r = c - '0';
while (c = getchar(), isdigit(c)) r = r * 10 + c - '0';
return r;
}
int... | ALGO | 0.999789 | 3.181269 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2013-05-10T16:02:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd6914a... |
55f46c9d-0c32-4daa-ab40-c5184f061c67 | yixin-cfd/unstructured_2d | src/dissipRoe2.cpp | /// @file dissipRoe2.cpp
///
/// Computation of 2nd-order upwind dissipation.
///
//*****************************************************************************
//
// (c) <NAME>, CFD Consulting & Analysis, www.cfd-ca.de
// Created February 15, 2014
// Last modification: July 7, 2014
//
//==========================... | ALGO | 0.999757 | 6.521408 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-11-04T03:11:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c107c1b2a6e... |
89215600-b49f-441a-a5c7-ccc4862ff612 | DaAlG/code_studying | jeehyun/개별문제/Baekjoon/4179_불!.cpp | /*
* 그래프
* 4179 불!
*/
#include <iostream>
#include <queue>
#define MAX 1001
using namespace std;
int n, m;
char map[MAX][MAX];
bool visited[MAX][MAX];
int dx[] = { -1, 1, 0, 0 };
int dy[] = { 0, 0, -1, 1 };
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> n >> m;
queue<pair<... | ALGO | 0.999971 | 3.774782 | {
"github_metadata": {
"branch": "master",
"commit_count": 1042,
"repo_created_at": "2020-09-13T08:06:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1761eec8... |
b2077c4c-3216-41e6-923a-096208484745 | CarloNicolini/multilouvain | src/MutableVertexPartition.h | #ifndef MUTABLEVERTEXPARTITION_H
#define MUTABLEVERTEXPARTITION_H
#include <string>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
#include "GraphHelper.h"
using std::string;
using std::map;
using std::set;
using std::make_pair;
using std::pair;
using std::sort;
using std::reverse;
/**********... | ALGO | 0.984067 | 6.531235 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2015-09-23T07:46:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf4a8154f... |
a64e0f53-5883-48e2-a82e-f2e9a0c2255d | DaniloLMD/ic | graph-problems-tool/target/classes/c-projects/BFS/main.cpp | #include <iostream>
#include <set>
#include <vector>
#include <map>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
#include <cstring>
#include <queue>
using namespace std;
//Global variables
const int V = int(1e3);
int *mat;
int N_vertices;
int distances[V], visited[V];
// Declarations
void graphAdjMat... | ALGO | 0.99905 | 4.225975 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2024-10-28T12:31:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c1fb35fb... |
9adc5a31-e9a6-450a-878b-c0570dc03f66 | buxucixingztx/cpp_learning | leetcode/leetcode_p207/code_207.cpp | // 力扣第207题,课程表
/*
你这个学期必须选修 numCourse 门课程,记为 0 到 numCourse-1 。
在选修某些课程之前需要一些先修课程。 例如,想要学习课程 0 ,你需要先完成课程 1 ,我们用一个匹配来表示他们:[0,1]
给定课程总量以及它们的先决条件,请你判断是否可能完成所有课程的学习?
*/
#include <iostream>
#include <vector>
#include <unordered_map>
#include <queue>
using namespace std;
class Solution_00{
public:
bool valid = true;
... | ALGO | 0.999804 | 6.00104 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2020-06-11T14:40: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": "294b52bb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.