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 |
|---|---|---|---|---|---|---|---|
43bf7d2a-b6ce-4a48-9154-141b138a7d5f | yoon-yk/LeetcodeSubmission | 0359-logger-rate-limiter/0359-logger-rate-limiter.cpp | class Logger {
public:
/** Initialize your data structure here. */
Logger(): curr{}, prev{}, init_time{0} {
}
/** Returns true if the message should be printed in the given timestamp, otherwise returns false.
If this method returns false, the message will not be printed.
Th... | TOOL | 0.901678 | 6.005982 | {
"github_metadata": {
"branch": "main",
"commit_count": 6029,
"repo_created_at": "2021-05-29T13:24: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": "164523662... |
1643acd1-3e83-40eb-9366-046ba118274d | minhaz1217/My-C-Journey | EWU/cse107/Final/15_2(using stl sort, find, count).cpp | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int arr[] = {1,2,1,6,4,5,6,10,1};
int arr2[] = {20,50,30};
int arr3[12];
int arrLength = 9;
int *ptr;
ptr = find(arr,arr+arrLength, 6);
cout << "First object with value 6 was at: " << (ptr-arr) << endl;
int n = c... | ALGO | 0.999073 | 3.804938 | {
"github_metadata": {
"branch": "master",
"commit_count": 365,
"repo_created_at": "2018-12-07T07:32:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f50028c... |
626ae4ea-ee63-4a1e-a9c9-190f14dccfb1 | fripSide/UVaEveryday | uva/06/0608/UVa11809.cc | #include <cstdio>
#include <cstring>
#include <cmath>
int main() {
const int maxn = 1000;
char f[maxn];
double M[11][31];
const double min_dif = 1e-5;
long long E[11][31];
double m, t;
long long e;
for (int i = 0; i <= 9; ++i) {
for (int j = 1; j <= 30; ++j) {
e = (1... | ALGO | 0.990542 | 3.190144 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2016-06-05T15:30: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": "343ed1515... |
eede9826-3ff0-4316-82cb-79bdc8c01036 | la-rubia/EDA-FIB | X18624.cc | #include <iostream>
#include <vector>
#include <set>
using namespace std;
using VC = vector<char>;
int n,m;
VC l;
bool vocal(char c) {
return c=='a' or c=='e' or c=='i' or c=='o' or c=='u';
}
void b(int k, string r, set<string>& s) {
if(k==n) s.insert(r);
else {
for(int i=0; i<m; i++) {
... | ALGO | 0.999136 | 3.828393 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2022-10-15T13:14:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd52eb43709... |
4ae4507e-1b3b-4d99-8d62-d5b45ffc811a | ApoorvaSunkad/LinkedList_Questions_CPP | decimalequivalentofbinaryLL.cpp | /*
Given a singly linked list of length n. The link list represents a binary number, ie- it contains only 0s and 1s. Find its decimal equivalent.
The significance of the bits decreases with the increasing index in the
linked list.
An empty linked list is considered to represent the decimal value 0.
Since the answer ... | ALGO | 0.999995 | 4.840364 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2024-01-01T08:42: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": "68eb70fa002... |
1cb1d864-5943-4476-80e5-3be54f63b0f0 | kliszym/foot_tracker | FootTracker/FootTracker.cpp | #include "pch.h"
#include "FootTracker.h"
#include <opencv2/features2d.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
static std::vector<Point> people_;
static float m_width_;
static float m_height_;
static int error_;
bool imageRead(cv::Mat& image, char* path) {
image = cv::imread(path, cv::... | TOOL | 0.953645 | 4.006129 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-12-04T17:29:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0e2f15571... |
abd88a12-ab01-4ef7-a49d-e4b7e08f2d0f | rohit-b04/dsa-vault | Arrays/Find-Repeated-And-Missing-Values.cpp | class Solution {
public:
vector<int> findMissingAndRepeatedValues(vector<vector<int>>& grid) {
vector<int> ans;
long long int col = grid[0].size(), row = grid.size();
long long int n = col * row;
long long int sn = n * (n + 1) / 2;
long long int s2n = (n * (n + 1) * (2 * n + ... | ALGO | 0.999893 | 5.501066 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2025-04-09T06:07: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": "d069997e1a3... |
9a07c5cc-8313-4ea3-ac7b-ab53541d1be6 | madhok/Craftsmanship | Strings/LongestDistinctCharactersInString.cpp | /*
Given a string, find length of the smallest substring with maximum number of distinct characters. For example, for input "abca", the output is 3 as "abc" is the smallest substring with maximum number of distinct characters.
Input:
The first line of input contains an integer T denoting the number of test cases.
Th... | ALGO | 0.999792 | 5.041284 | {
"github_metadata": {
"branch": "master",
"commit_count": 164,
"repo_created_at": "2012-09-08T23:13:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3579029e... |
1fe32622-62a3-415a-bc58-805499501b4c | SeungJL/BaekJoon-Study | 2022/03_Mar/7th/1260/수경.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M, V;
bool graph1[1001][1001];
bool vertices1[1001];
void DFS(int index) {
if (!vertices1[index]) {
printf("%d ", index);
vertices1[index] = true;
}
for (int i = 1; i <= N; i++) {
if (graph1[index][i]) {
graph1[index... | ALGO | 0.999995 | 4.199129 | {
"github_metadata": {
"branch": "main",
"commit_count": 681,
"repo_created_at": "2022-01-28T04:31:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "84a4632cdf... |
a8d6c44e-af67-4629-966d-17e92d8ef3cf | bhatiamanan/code_i_do | Easy/Minimum distance between two numbers/minimum-distance-between-two-numbers.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int minDist(int a[], int n, int x, int y) {
// code here
int xPos = -1;
int yPos = -1;
int ans=INT_MAX;
for(int i=0;i<n;i++){
if(a[i]==x){
... | ALGO | 0.999855 | 5.84427 | {
"github_metadata": {
"branch": "main",
"commit_count": 723,
"repo_created_at": "2023-02-07T18:59: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": "ff37ba780d... |
e0a77854-21ce-4459-9534-a53435c5150d | oceanbase/oceanbase | src/rootserver/ob_unit_placement_strategy.h | /**
* Copyright (c) 2021 OceanBase
* OceanBase CE is licensed under Mulan PubL v2.
* You can use this software according to the terms and conditions of the Mulan PubL v2.
* You may obtain a copy of Mulan PubL v2 at:
* http://license.coscl.org.cn/MulanPubL-2.0
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BAS... | ALGO | 0.936675 | 5.885649 | {
"github_metadata": {
"branch": "develop",
"commit_count": 18841,
"repo_created_at": "2021-05-31T14:36:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9275,
"forks": 1759,
"issues": 441,
"pull_requests": 77
},
"file_meta": {
"content_id"... |
3108fa71-7983-4f84-b46d-27c89fc8bc75 | MAZHARMIK/Interview_DS_Algo | HashMap/Restore the Array From Adjacent Pairs.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=aRsdEts7i0k
Company Tags : will soon update
Leetcode Link : https://leetcode.com/problems/restore-the-array-from-adjacent-pairs/
*/
/**************************************************************** C++ ***********... | ALGO | 0.999433 | 5.904922 | {
"github_metadata": {
"branch": "master",
"commit_count": 5946,
"repo_created_at": "2020-07-12T13:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2586,
"forks": 1357,
"issues": 7,
"pull_requests": 37
},
"file_meta": {
"content_id": "... |
320df908-6830-44d0-ae3e-7c3fe7f036c5 | ishandutta2007/codeforces-p | penguin1017/normal/708/D.cpp | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define ll long long
#define lb(x) ((x)&-(x))
#define pii pair<int,int>
#define vi vector<int>
#define pb push_back
#define fi first
#define se second
#define de(x) cout<<#x<<" x"<<endl
#define LCAFA rep(i... | ALGO | 0.999873 | 3.763716 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84f7a3e666ac... |
7033b2d5-a217-4f03-bc7d-0a0bea1050f0 | mrdrivingduck/leet-code | 842.SplitArrayIntoFibonacciSequence.cpp | /**
* @author <NAME>.
* @version 2020/12/08
*/
/*
Given a string S of digits, such as S = "123456579", we can split it
into a Fibonacci-like sequence [123, 456, 579].
Formally, a Fibonacci-like sequence is a list F of non-negative integers
such that:
0 <= F[i] <= 2^31 - 1, (that is, each i... | ALGO | 0.999941 | 6.067885 | {
"github_metadata": {
"branch": "master",
"commit_count": 195,
"repo_created_at": "2019-08-01T14:06: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": "4cb08ab5... |
07e4d9d1-9914-44fe-92ee-72065269052e | raincross7/code-similarity | codes/train_code/problem116/problem116_38.cpp | /**
* created: 21.06.2020 23:49:31
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pcnt(bit) __builtin_popcount(bit)
#define mod 10000... | ALGO | 0.999926 | 3.859666 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07: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": "1266e3ab447f... |
a4d1858f-ad34-493e-bde0-add0e1dc44a9 | Namnamseo/ps-archive | apio/2013/2-toll.cpp | #include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
#include <algorithm>
#include <numeric>
#include <cstring>
#include <vector>
#include <cstdio>
using namespace std;
using ll=long long;
using pp=pair<int,int>;
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=1;i<=n;... | ALGO | 0.999966 | 3.658143 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2018-05-23T05:55:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "741a1384811... |
0a36a4d5-a91d-4c98-970b-144e0ce17937 | subhamengine/Leetcode | 2131-longest-palindrome-by-concatenating-two-letter-words/2131-longest-palindrome-by-concatenating-two-letter-words.cpp | class Solution {
public:
int longestPalindrome(vector<string>& words) {
/* There are a number of matching digraphs and its reversal */
/* There are an even number of matching squares */
/* Among the squares, select one square that has odd number */
int count = 0;
map<string, ... | ALGO | 0.999946 | 5.795131 | {
"github_metadata": {
"branch": "main",
"commit_count": 1009,
"repo_created_at": "2022-04-12T06:58:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "560de3b40... |
6e1a0b3a-5198-471e-b770-e27a21e1ab50 | Sacshamm/DSA | Trees/109.Morris Traversal.cpp |
// For inorder
class Solution{
vector<int>getinorder(Node*root){
vector<int>inorder;
Node*cur = root;
while(cur!=NULL){
// if there is no left print the root and move right
if(cur->left = NULL){
inorder.push_back(cur->val);
cur=cur->right;
}... | ALGO | 0.999991 | 5.992746 | {
"github_metadata": {
"branch": "main",
"commit_count": 236,
"repo_created_at": "2022-08-01T10:18: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": "4cc9f1c4d7... |
250fb98d-e10b-4d90-9163-1251d55c0953 | miaoZmiao/zuo_algorithm_class_cpp_impl | src/19、暴力递归到动态规划(二)/Code02_ConvertToLetterString.hpp | #pragma once
#ifndef Code02_ConvertToLetterString_HPP
#define Code02_ConvertToLetterString_HPP
#include <string>
#include <iostream>
#include "utility_func.hpp"
using namespace std;
namespace Code02_ConvertToLetterString {
int process(string & arr, int index);
// str只含有数字字符0~9
// 返回多少种转化方案
int number(strin... | ALGO | 0.97719 | 3.9888 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-10-20T15:43: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": "cff7aac91a... |
59205d4e-b6c5-4cdd-83c3-6190785918cf | AutumnKite/Codes | Codeforces/1079/G/std.cpp | #include <bits/stdc++.h>
const int N = 300005, LG = 19;
int n, d[N];
int Log[N];
struct Node {
int l, r;
} a[N][LG];
struct ST {
int st[N][LG];
std::function<int(int, int)> val;
template<typename func>
ST(func _val) {
val = _val;
}
void init() {
for (int i = 1; i <= 3 * n; ++i) {
st[i][0] = i;
}
... | ALGO | 0.999925 | 3.450858 | {
"github_metadata": {
"branch": "master",
"commit_count": 683,
"repo_created_at": "2019-08-18T00:53:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a03dd36... |
1a18ec5f-bfcb-48d8-9881-0e4e1842c587 | markinspencer/AdventOfCode2023 | src/day02/day02.cpp | #include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <numeric>
#include <map>
using lines = std::vector<std::string>;
lines load_input(const std::string& file){
lines lines;
std::ifstream fs(file);
std::string line;
while (std::getline(fs, line)) {
... | ALGO | 0.984969 | 5.68479 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-12-02T03:10: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": "5043d99d99dc... |
282004a8-5fbc-4ad6-b8d6-54c3cdfd5d80 | TINABJan254/CPP-PTIT | CPP0139_SoSmith.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
bool prime[1000000];
void sieve(){
for (int i = 0; i <= 1000000; i++)
prime[i] = true;
prime[0] = prime[1] = false;
for (int i = 2; i <= sqrt(1000000); i++){
if (prime[i]) {
for (int j = i*i; j <= 1000000; j += i)
prime[j] = false;
}... | ALGO | 0.998858 | 5.086904 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2023-09-10T00:56: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": "947995ec2... |
faaeeaf0-6c6d-4030-a97f-339629d2d910 | study-cote/Baekjoon | 수학/9020_골드바흐의 추측/9020_성재.cpp | #include <iostream>
#include <cmath>
using std::cin;
using std::cout;
class primeFactor {
const int arr_size = 10000;
int T, n;
bool* arr;
void cal(); // 에라토스테네스의 체
void printAnswer(); // 결과 출력
public:
primeFactor(int data) : T(data) { // 생성자
arr = new bool[arr_size];
for (int i = 2; i < arr_si... | ALGO | 0.999843 | 4.19157 | {
"github_metadata": {
"branch": "main",
"commit_count": 196,
"repo_created_at": "2021-08-17T05:19:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12db8b41006... |
d73f72a6-3164-4de4-989b-1c6f3dfc61c9 | liuvaneshka/BookClub | Grafo.h | #ifndef GRAFOS_GRAFO_H
#define GRAFOS_GRAFO_H
#include <string>
#include "Lista.h"
#include "Prim.h"
#include "Lectura.h"
using namespace std;
class Grafo {
private:
int ** matriz_adyacencia;
Lista<Lectura*>* vertices;
Prim * algoritmo_arbol_expansion;
//PRE: -
//POST: Agranda dinamicamente la ... | ALGO | 0.911678 | 3.686855 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2022-06-17T13:46:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4177f5becb3... |
d517101c-8591-4dab-8b78-2c402900f174 | ssasied/my-leetcode-solutions | 30-substring-with-concatenation-of-all-words/substring-with-concatenation-of-all-words.cpp | class Solution {
public:
vector<int> findSubstring(string s, vector<string>& words) {
vector<int> found;
if (words.empty() || s.empty()) return found;
int ssize = s.size();
int wsize = words[0].size();
int wordCount = words.size();
int windowSize = wsize * wordCount;
if (ssize < window... | ALGO | 0.999386 | 6.115145 | {
"github_metadata": {
"branch": "main",
"commit_count": 168,
"repo_created_at": "2024-03-20T13:23: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": "fc7976be69... |
a18c5a59-a33f-4050-b2c6-2b77683675c3 | alaneos777/club | project euler/107.cpp | #include <bits/stdc++.h>
using namespace std;
struct node{
int value;
node * parent;
int rank;
node(int value){
this->value = value;
this->parent = this;
this->rank = 0;
}
};
struct disjointSet{
int N;
vector<node*> nodes;
disjointSet(int N){
this->N = N;
nodes.resize(N);
}
void makeSet(int v){... | ALGO | 0.999916 | 3.750165 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-08-06T04:13:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6184f0095... |
bb1db15c-0cbc-43c9-b608-83c4425307a4 | yarin-pi/Codeforces-Solutions | 1000-1300rank/Raspberries/solution.cpp | #include <algorithm>
#include <iostream>
#include <vector>
int main() {
int T;
std::cin >> T;
while (T--) {
int s, k;
std::cin >> s >> k;
int count_even = 0;
int min = k - 1;
std::vector<int> a(s);
for (int i = 0; i < s; i++) {
int temp;
std::cin >> temp;
a[i] = temp;
... | ALGO | 0.999904 | 3.92618 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-19T14:55:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25d0a69abff2... |
da4128c8-dab5-4432-bb31-7708a517bf5f | CollComm/prep | letter_combinations_of_a_phone_number.cpp | class Solution {
string getDigitsMapping(char c)
{
switch(c)
{
case '0':return string(" ");
case '1':return string("1");
case '2':return string("abc");
case '3':return string("def");
case '4':return string("ghi");
case '5':r... | ALGO | 0.999965 | 6.137429 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2013-11-15T02:06: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": "15cc8e944... |
545dd4de-1554-42e2-98c6-613bdf826952 | hjiang13/LLM4IR | results/Task2_IR_Decompilation/DecompiledResuts_Human_x_164_O1/MetaLLama_Human_x_164_O1_decompiled/CPP_8.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
int* data;
int* begin;
int* end;
} Vector;
void sum_product(Vector* result, Vector* input) {
int sum = 0;
int product = 1;
int size = input->end - input->begin;
if (size == 0) {
result->begin = (int*)mallo... | ALGO | 0.999273 | 5.156374 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-05-21T20:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7af29d8402e... |
4e20e019-2646-43d2-838b-08cc960159e3 | ormo91/nauka | PolaFigur/pola.cpp | #include <iostream>
#include <string>
#define PI 3.14
void MenuBox ();
void MenuDecision (int);
void CircleArea (double);
void SquareArea (double);
void RectangleArea (double,double);
void TriangleArea (double,double);
bool IsRight (std::string);
int main ()
{
int option;
char ch;
do
{
std:... | TOOL | 0.903433 | 3.177571 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-09-18T23:00: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": "262357bfd... |
24626f84-59c1-47e3-88e1-2d9c40cc420c | baetuc/E-vote-protocol | OfficeClient/Client.h | #include <NTL/ZZ.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <sstream>
#include "FFunction.h"
#include "GFunction.h"
using namespace std;
using namespace NTL;
#define INFORMATION "votingInformation"
#define ID_OK 0
#define ID_INVALID 1
#define ID_USED 2
#define NOT_OK 1
Z... | WEB | 0.98916 | 3.535541 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-01-06T01:27: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": "7eb964e78b... |
fc4ac479-c1a1-428f-ad60-798f342bddec | ShallowU/NUAA-DataStructure | 数据结构课设/必做题/1_进程统计/1proceepid.cpp | #include <iostream>
#include <windows.h>
// #include <time.h>
#include <iomanip>
#include <cstdio>
#include <ctime>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;
struct CurrentProcess
{ // 当前进程节点
string name; // 进程名
string pid;
... | TOOL | 0.950159 | 3.388206 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-01-12T11:00:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47ee76e97bdb... |
d4361998-0f77-475f-881e-f8116d6345b7 | kiran4sure/Algorithms | GeeksForGeeks/CompetativeProgramming_CP1/Feb_01_stack_divideAndConquor/balance_bracket.cpp |
#include <bits/stdc++.h>
using namespace std;
/*
check if opening and closing brackets are balanced or in sync.
eg: {(<>)} is balanced
{(()}) is not balanced
*/
bool validate_bracket(string &s, unordered_map<char, char> &ip, unordered_map<char, char> &op)
{
stack<char> st;
for (char c : s)
{
if (ip.count(... | ALGO | 0.999848 | 5.06321 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2020-05-23T08:04:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 15
},
"file_meta": {
"content_id": "ce105429... |
027bf937-d5b7-4655-9468-34b5bffcda31 | Ayush12062000/Data-Structures-and-Algorithms | Questions/QuickSort Application/Majority_map_approach.cpp | #include <iostream>
#include<climits>
#include<ctime>
#include <bits/stdc++.h>
#include<stdlib.h> /* srand, rand */
#include<time.h>
typedef long long int ll;
#define deb(x) cout<<#x<<": "<<x<<"\n"
#define scan(arr, n) for(int i=0;i<n;i++) cin>>arr[i];
#define input(n) ll n; cin>> n
#define inputs(m,n) ll m,n; cin>>m>... | ALGO | 0.999974 | 4.053487 | {
"github_metadata": {
"branch": "main",
"commit_count": 266,
"repo_created_at": "2021-03-18T15:37: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": "fbbd3fa2a3... |
86dd595e-8f53-49c5-8352-75bb6b9e39ce | Ajay-patidar0/ATM-simulator | ATM.cpp | #include <iostream>
#include <string>
using namespace std;
struct Account {
string accountNumber;
string name;
double balance;
int pin;
Account* next;
};
class ATM {
private:
Account* head;
public:
ATM() {
head = nullptr;
}
void createAccount(string accountNumber, string... | ALGO | 0.973849 | 5.350332 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-05-05T13:51: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": "d9662ca277e1... |
56087b74-9920-48ad-b1fc-8c9515cecb05 | Lind-Project/lind_project | tests/applications/mysql/mysys/mf_keycache.cc | /* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certai... | ALGO | 0.97994 | 5.304573 | {
"github_metadata": {
"branch": "main",
"commit_count": 1187,
"repo_created_at": "2018-03-28T07:51:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30,
"forks": 8,
"issues": 23,
"pull_requests": 0
},
"file_meta": {
"content_id": "04e0470f... |
6303dcef-f755-4cb2-8412-d21ef6d4f7e1 | dviropa/Ex1_graph_Algorithms_cpp | main.cpp | // main.cpp
//#<EMAIL>
#include <iostream>
#include "Graph.h"
#include "Algorithms.h"
using namespace graph;
void printMenu() {
std::cout << "\n=== Graph Menu ===\n";
std::cout << "1. Add Edge\n";
std::cout << "2. Print Graph\n";
std::cout << "3. Run BFS\n";
std::cout << "4. Run DFS\n";
std::... | ALGO | 0.992054 | 4.733667 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2025-03-31T18:25: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": "337bd4f4278... |
25f053d1-2c82-43b8-86ac-643a82545833 | osamamuhammad3623/implemented-data-structures-and-algorithms | merge_sort.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void merge_(vector<int> vector1, vector <int> vector2, vector<int> result) {
int pos1{}, pos2{};
int size1 = vector1.size();
int size2 = vector2.size();
//merge 2 arrays in case they are same size.
while (pos1 < size1 && pos2 < si... | ALGO | 0.999976 | 5.413028 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-06-22T03:11:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0532bd1f... |
80b6b491-50a3-40f4-bc80-d84b96ac6ccf | lausai/UVa | 2_stars/356.cpp | #include <cstdio>
#include <cmath>
using namespace std;
int main()
{
int n = 0;
bool first_round = true;
while (EOF != scanf("%d", &n)) {
int segment_in_circle = 0;
int inside_circle = 0;
double radius = n - 0.5;
... | ALGO | 0.999567 | 3.614881 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2014-05-29T13:00: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": "f112a0183... |
4e86c851-5d0a-4bcd-894e-b18d4dddfe40 | TI-for-Coding/PS | JW/B2667(단지번호붙이기) - 메모리초과.cpp | #include<bits/stdc++.h>
using namespace std;
/*
- DFS와 BFS문제 구분법
BFS는 너비우선탐색으로 현재 나의 위치에서 가장 가까운 노드를 먼저 방문하는 것이다
방문하면서 현재 위치는 pop해주고 방문한 곳은 체크한 뒤, 방문할 곳은 큐에 넣는 과정입니다
따라서, 미로 탐색과 같은 알고리즘은 최단 거리만을 가지고 탈출하는 것이기에 BFS가 적합합니다
하지만 가령, 미로탐색을 진행하는데, 이동할 때마다 가중치가 붙어서 이동한다거나,
이동 과정에서 여러 제약이 있을 경우, DFS로 구현하는 것이 좋습니다.
*/
/... | ALGO | 0.999917 | 3.86275 | {
"github_metadata": {
"branch": "main",
"commit_count": 212,
"repo_created_at": "2021-07-14T14:01:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d57c56ee1c2... |
ea26935a-001b-45f5-9d6c-87ebfa09d79e | pashneal/learnC | tripleSum/tripleSum.cpp | /*
* Puzzle Link: https://www.hackerrank.com/challenges/triple-sum/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=search
* Puzzle Difficulty: Medium
*
* Initial Thoughts:
* I first misread the statement and thought that a O(n^3) solution was necessary
* However i found... | ALGO | 0.999698 | 4.366589 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-02-17T18:49: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": "975018096... |
31371cd0-5fc5-4cb5-9bd1-30b8d98d387f | verma16Ayush/leetcode | 556.next-greater-element-iii.cpp | /*
* @lc app=leetcode id=556 lang=cpp
*
* [556] Next Greater Element III
*/
#include <bits/stdc++.h>
using namespace std;
// @lc code=start
class Solution {
public:
vector<int> solve(vector<int>);
};
vector<int> Solution::solve(vector<int> A) {
vector<int> a((int)1e5);
// int c1 = 0;
// for(int i : ... | ALGO | 0.999959 | 5.306117 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2021-05-20T10: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": "2bab338d1... |
6ddbb7d5-88ad-4a67-9adb-fa037b1e48d1 | vu-luong/Algorithm | Code Tohuuquan/T/TNHWIFI.cpp | #include <cstdio>
#include <cmath>
#include <algorithm>
#define FOR(i, a, b) for(int i = a; i <= b; i++)
using namespace std;
const int MAXM = 30005;
const int MAXN = 1005;
int d[MAXM][MAXN];
int M, N, K, res, cnt;
int main() {
scanf("%d %d %d", &M, &N, &K);
for (int k = 0; k < K; k++) {
int x, y, r... | ALGO | 0.999005 | 3.573018 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-07-09T02:58:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb5df12ac... |
d74f9195-3f77-406f-9072-d7376b145ca2 | fabbrito/leetcode-cpp | Challenges/src/C69_Sqrt(x)/Solution69.cpp | #include "pch.h"
#include "Solution69.h"
namespace leetcode_69 {
using namespace std;
class Solution;
}
class leetcode_69::Solution {
public:
// Newton's method: r_n+1 = r_n - f(r_n)/f'(r_n)
// Using f(r) = r**2 - x => f'(r_n) = 2 r_n
// Then r_n+1 = r_n - (r_n**2 - x)/(2 r_n)
// = r_n - r_n/2 + x/(2... | ALGO | 0.999974 | 5.340501 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2023-10-17T02:43: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": "ae6b7392b... |
955a3a7f-33e5-45d4-a8a1-205da124d255 | Debjit0001/Bisu-Da-Cpp-Assignments | Question 14/main.cpp | // 14. Write a program which takes the radius of a circle as input from the user, passes it to another function that computes the area and the circumference of the circle and displays the value of area and circumference from the main() function.
#include <iostream>
using namespace std;
class CircleCalculator {
public... | TOOL | 0.994948 | 6.253121 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-04-24T15:59:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "186626500c1... |
8a747912-0fcb-4aaa-bd6d-90fd3cd66acb | camppp/CS562_Project | Test Code_codellama/test1884.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <unordered_set>
using namespace std;
int main(int argc, char* argv[]) {
if (argc != 2) {
cerr << "Usage: " << argv[0] << " <source_code_file>" << endl;
return 1;
}
ifstream file(argv[1]);
if (!file) {
cerr << "E... | TOOL | 0.943442 | 6.506474 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2023-09-11T21:25:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b237e685afa... |
a8673549-7846-4f8a-b08e-d7bc5912267b | alexliu07/CPPCodes | questions/101~150/149.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int m, n, maxd = 0, tmpa, tmpb, tmpc, tmpd, tmpm, mins = 0;
cin >> m >> n;
//最大公因数
for (int i = 1; i * i <= m; i++) {
if (m % i == 0) {
tmpa = i;
tmpb = m / i;
for (int j = 1; j * j <= n; j++) {
... | ALGO | 0.999992 | 4.386599 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-09-24T07:00: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": "c8b9e0fb74ef... |
253d37fc-0e65-45e9-bdf6-d3c6ff374426 | splguyjr/Baekjoon | 백준/Bronze/1373. 2진수 8진수/2진수 8진수.cc | #include <iostream>
#include <string>
using namespace std;
int main() {
string a;
cin >> a;
string b;
b = a;
if (a.size() % 3 == 1)
b = "00" + a;
if (a.size() % 3 == 2)
b = "0" + a;
a = "";
for (int i = 0; i < b.size(); i = i+3) {
if (b.substr(i, 3) == "111") {
a += '7'; }
else if (b.substr(i,... | ALGO | 0.999904 | 3.284565 | {
"github_metadata": {
"branch": "main",
"commit_count": 623,
"repo_created_at": "2023-02-01T09:59: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": "3250830508... |
2d5013e6-7d5e-4db5-84b7-8c9b45668285 | kadirmalak/cpp-workspace | Templates/Templates.cpp | // Templates.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <vector>
#include "MemoryCell.h"
using namespace std;
template<typename T>
T add(T num1, T num2) {
return num1 + num2;
}
template <typename T>
class MemoryCell
{
public:
explicit MemoryCell(... | ALGO | 0.964038 | 4.789428 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-12-11T16:43:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c12dffb2c... |
7e789c84-1145-4e37-b452-9a373c72c1da | ishandutta2007/codeforces-r | reyna/normal/818/F.cpp | // In the name of God
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#incl... | ALGO | 0.999483 | 3.681575 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7239374f243e... |
9ea29e98-745e-4b06-b5f0-67109a2b840a | sohyun022/coding-test | 백준/Gold/7576. 토마토/토마토.cc | #include <iostream>
#include <queue>
using namespace std;
int n,m;
int box[1000][1000]={};
int day[1000][1000]={};
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
queue <pair<int,int>> q;
void bfs() {
while (!q.empty()) {
int x=q.front().first;
int y=q.front().second;
q.pop();
... | ALGO | 0.999983 | 3.628955 | {
"github_metadata": {
"branch": "main",
"commit_count": 252,
"repo_created_at": "2024-01-14T14:07: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": "042dfc3417... |
84a44d45-7c8b-40cf-a2d2-a5641b5d906e | Altu-Bitu-2/Notice | 06월 07일 - 위상 정렬/라이브 코딩/2252.cpp | //
// Created by BaeSuA on 2022-06-07.
//
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
//위상정렬
vector<int> topologicalSort(int n, vector<int> &indegree, vector<vector<int>> &graph) {
queue<int> q; //진입차수가 0인 정점 관리하는 컨테이너
vector<int> result; //결과
for (int i = 1; i <= n; i++)... | ALGO | 0.999997 | 5.309521 | {
"github_metadata": {
"branch": "main",
"commit_count": 271,
"repo_created_at": "2022-02-22T12:42:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 34,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d929b6803... |
557df7e4-9538-4d7d-8793-a266aea4b34c | TobiasMadsen/ncdDetect2 | src/cumulant.cpp | #include <Rcpp.h>
using namespace Rcpp;
double phi(double t, NumericVector & p, NumericVector & s, int idxStart, int idxStop){
double ret = 0;
for(int i = idxStart; i < idxStop; ++i){
ret += p[i]*exp(t*s[i]);
}
return ret;
}
double phiD1(double t, NumericVector & p, NumericVector & s, int idxStart, int id... | ALGO | 0.999579 | 6.171417 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-06-08T08:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d80d4f2210... |
dda692ff-22c9-49e7-a7a5-41b52698552d | riteme/test | oi/Contest/2017-7/2017-7-4/graph.cpp | #include <cstdio>
#include <cstring>
#include <climits>
#include <algorithm>
using namespace std;
#define NMAX 100
#define MMAX 2000
typedef long long i64;
#define rep(x, l, r) for (int x = l; x <= r; x++)
static int n, m, P;
static int u[NMAX + 10], v[NMAX + 10];
static i64 A[NMAX + 10][NMAX + 10];
static i64 B[... | ALGO | 0.9999 | 3.716762 | {
"github_metadata": {
"branch": "master",
"commit_count": 550,
"repo_created_at": "2015-04-26T07:16:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "9fc74e32... |
0e3f02af-789e-48cf-afd2-196041b692f2 | jiantao/LeetCode | is_same_tree.cpp | /*
* =====================================================================================
*
* Filename: is_same_tree.cpp
*
* Description:
*
* Version: 1.0
* Created: 03/31/2013 09:48:44 PM
* Revision: none
* Compiler: gcc
*
* Author: <NAME> (),
* ... | ALGO | 0.999907 | 5.864857 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2013-04-08T21:59: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": "373407506... |
9008e334-dfd7-4aba-b672-9792ee10da73 | faxinwang/OJ_PAT | 2 advance/21 - 40/1026. Table Tennis (30)(Wrong with the last case).cpp | /*
1026. Table Tennis (30)
时间限制
400 ms
内存限制
65536 kB
代码长度限制
16000 B
判题程序
Standard
作者
<NAME>
A table tennis club has N tables available to the public. The tables are numbered from 1 to N.
For any pair of players, if there are some tables open when they arrive, they will be assigned
to the available table with the smal... | ALGO | 0.991247 | 3.962385 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-07-26T13:27: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": "87de1ce2b... |
ce412fc8-9bd5-40d5-b313-f7840d733d32 | Hiver93/BaekJoonOJ | 프로그래머스/3/214288. 상담원 인원/상담원 인원.cpp | #include <string>
#include <vector>
#include <queue>
using namespace std;
int K, N;
vector<vector<int>> rVec;
int result[20]{0};
int ans = 2147483647;
vector<priority_queue<int,vector<int>,greater<int>>> pq;
int waitingTime(int end, int st){
if(end < st){
return 0;
}
return end - st;
}
int getT... | ALGO | 0.99984 | 4.625844 | {
"github_metadata": {
"branch": "master",
"commit_count": 403,
"repo_created_at": "2021-10-30T13:34: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": "5aa33dc1... |
4c0356f1-445b-467d-9c29-5679741434ba | enc1cxx/otus-cpp-basics-lesson8 | my_realization.cpp | #include <algorithm>
#include <fstream>
#include <iostream>
#include <iterator>
#include <map>
#include <chrono>
#include <future>
const size_t TOPK = 10;
using Counter = std::map<std::string, std::size_t>;
std::string tolower(const std::string &str) {
std::string lower_str;
std::transform(std::cbegin(str),... | ALGO | 0.995267 | 6.346318 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-11-26T13:33: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": "93a026f5f343... |
abe18b2c-b594-40a0-8118-042f7154b8bc | donbasta/competitive-programming | submissions/online-judges/cf/errichto-gym-matrix-expo/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll MOD = 1e9 + 7;
// const int SZ = 2;
typedef vector<vector<ll>> matrix;
matrix magic, identity;
ll n, k, p ,q, r;
vector<ll> ar, c;
matrix mul(matrix a, matrix b, int sz){
matrix d(sz, vector<ll>(sz));
for(int i = 0; i < sz; i++) {
f... | ALGO | 0.999924 | 3.950993 | {
"github_metadata": {
"branch": "master",
"commit_count": 175,
"repo_created_at": "2018-10-17T04:26:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "768caebc... |
4e9e5fea-b990-4488-81f7-3ba3032680f3 | yujiaoki/competitive-programming | Atcoder/abc185/c.cpp | #include <bits/stdc++.h>
#include<atcoder/all>
using namespace atcoder;
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) s... | ALGO | 0.99997 | 4.577685 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-11-29T21:21:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a253fc445... |
b02f37e2-0ae4-49f3-a38c-6c0ceb87c32b | vkoshta92/dsa- | 6 sorting/bubblesort1.cpp | // 7,4,8,5,3
// 4,7,5,3,8
// 4,5,3,7,8
// 4,3,5,7,8
// sabse bde element ko last me le jana h
// har round me 0-3
// 0-2
// 0-1
// 0-0
// timecomplexity-O(n2) == worst case
// space complexity- O(1)
// best case-O(n)
// avg case- O(n2)
#include <iostream>
using namespace std;
int main()
{
int arr[1000];
in... | ALGO | 0.999814 | 5.172641 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-01-07T06:32:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "096ae74284d... |
3d851e82-c110-409f-a414-3b0a92b240c5 | shadab127/programming | codeforces/dsu/p1.cpp | /**
* @Author: shadabKhan
* @Date: Saturday, September 28th 2019, 3:05:07 pm
* @Last modified by: shadabKhan
* @Last modified time: Saturday, September 28th 2019, 10:40:13 pm
*/
#include<bits/stdc++.h>
using namespace std;
#define maxx 100000
map<int,int> mymap[maxx];
void dfs(vector<int>&dominating_color,vec... | ALGO | 0.999972 | 4.212573 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2019-08-17T13:43: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": "a464b5ccd... |
9c652b43-33e5-4471-a18c-8e365ceccbd7 | Divyanshu-Bhatt1/ImportantQuestionDsa | Array_basic/05_q.cpp | // Binary Array Sorting
// Input:
// 5
// 1 0 1 1 0
// Output:
// 0 0 1 1 1
// Explanation:
// After arranging the elements in
// increasing order, elements will be as
// 0 0 1 1 1.
// or also u can use sort fx
#include <iostream>
#include <algorithm>
using namespace std;
void binSort(int A[], int N)
{
// Your... | ALGO | 0.999994 | 5.281667 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-01-22T16:04: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": "c249a0e730... |
978b3181-c6ec-4265-a62c-d9d3328ae51a | Shazil-55/LinkList | LSLL.h | #pragma once
#include "Stack.h"
#include <iostream>
using namespace std;
template <typename T>
struct Node
{
T info;
Node<T>* next;
Node()
{
info = 0;
next = nullptr;
}
Node(T value)
{
info = value;
next = nullptr;
}
};
template <typename T>
class LSLL
{
Node<T>* head; // jo pehle object(node) ko p... | ALGO | 0.996834 | 3.572837 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-02-28T15:18: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": "b9b729961d... |
5da40c99-54f7-40ee-8c1e-864bb22bde85 | amit-nafshi/ece0302-an | projects/project2/FindPalindrome.cpp | #include <string>
#include <vector>
#include <iostream>
#include "FindPalindrome.hpp"
using namespace std;
//------------------- HELPER FUNCTIONS -----------------------------------------
// non-class helper functions go here, should be declared as "static" so that
// their scope is limited
// helper function to co... | TEST | 0.969698 | 6.008874 | {
"github_metadata": {
"branch": "main",
"commit_count": 138,
"repo_created_at": "2023-05-21T22:26:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a3f9cb9f8... |
8fa95b45-472a-447a-83d1-1284cce829fb | GraceYongqi/bishe_test | caculation.cpp | //
// Created by Grace on 2018/4/28.
//
#include "caculation.h"
int CaculateDensity(int *xres, int *yres, int approxStart, int approxEnd,
vector<int> is_tag, vector<int> contentStart, vector<int> contentEnd, int contentStartLength,
int contentEndLength, int length, ofstream &lo... | DATA | 0.975399 | 3.75835 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2018-04-21T16:04: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": "f6e5b3679... |
9a609ee8-0049-49ff-af9a-c26e9611554b | Faten-55/file-p | Encryption.c++ | #include <iostream>
#include <fstream>
#include <string>
using namespace std;
string caesarCipher(const string& inputText, int shift, bool encrypt = true) {
string result;
int shiftAmount = encrypt ? shift : (26 - shift);
for (char character : inputText) {
if (isalpha(character)) {
ch... | TOOL | 0.943443 | 6.745491 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-16T18:27:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee7370210e60... |
b7052280-c522-4429-97d1-f0e43ee72c03 | rahulgitx/dsa-locale | dsa with c++/tree/BST/deletion_in_bst.cpp | #include <iostream>
using namespace std;
struct node{
int data;
node* left;
node* right;
node(int a)
{
this->data = a;
this->left = NULL;
this->right = NULL;
}
};
void inorder(node* root)
{
if (root != NULL)
{
inorder(root->left);
cout << root->... | ALGO | 0.999943 | 3.413784 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-06-02T13:30: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": "55b8d147421... |
ba169bef-6e1b-4b5c-ab2f-efc7eaae4ecc | AntLJ/TestUploadFolder | LIB/SiNDYLib/build/SpatialIndex.cpp | /*
* Copyright (C) INCREMENT P CORP. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY INCREMENT P CORP., WITHOUT WARRANTY OF
* ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NONINFRINGEMENT.
*
* IN NO EVENT SHALL THE AU... | ALGO | 0.988898 | 4.960407 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2020-01-21T05:06:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "418744b4... |
0f1411e4-3109-4e91-9784-4462ef982241 | somya1210/Leetcode-Grinding | single-number-iii/single-number-iii.cpp | class Solution {
public:
vector<int> singleNumber(vector<int>& nums) {
// o(n) using map
// o(n) without space
vector<int>ans;
uint axorb=nums[0];
for(int i=1;i<nums.size();i++)
{ axorb=axorb^nums[i];
}
uint rightsetbit=axorb^(axorb&(axorb-1)); //xsum ^ (xsum ... | ALGO | 0.999995 | 5.172897 | {
"github_metadata": {
"branch": "main",
"commit_count": 731,
"repo_created_at": "2021-06-17T18:48:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3968ae7071... |
87c5fb78-9229-40c3-9a8a-3ed56801b238 | pmoulon/groupsac | cpp/thirdParty/armadillo/include/armadillo_bits/op_inv_meat.hpp | // Copyright (C) 2010 NICTA and the authors listed below
// http://nicta.com.au
//
// Authors:
// - <NAME> (conradsand at ieee dot org)
//
// This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness
// for any purpose. You can redistribute this file
// and/or modify it under t... | ALGO | 0.998447 | 6.100674 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2015-04-07T06:59:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d07fb587f... |
6da25bbd-1224-4bd6-9fc7-eceff5026467 | RfastOfficial/Rfast | src/reg_lib.h | //Author: <NAME>
#ifndef _reg_lib_
#define _reg_lib_
// [[Rcpp::depends(RcppArmadillo)]]
#define ARMA_64BIT_WORD
#include <RcppArmadillo.h>
#include "my_k_sorted_array.h"
using namespace std;
using namespace arma;
using namespace Rcpp;
double most_frequent_value(vec, a_node*, const int);
double average_value(vec, a... | ALGO | 0.99488 | 3.21087 | {
"github_metadata": {
"branch": "master",
"commit_count": 1015,
"repo_created_at": "2019-10-06T14:25:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 152,
"forks": 20,
"issues": 18,
"pull_requests": 1
},
"file_meta": {
"content_id": "e775... |
8cddc7b4-5db6-4fea-9cb5-37b7382a2c6c | yd8421/TicTacToe | Tic-Tac-Toe.cpp | #include<bits/stdc++.h>
using namespace std;
#define COMPUTER 1
#define HUMAN 2
#define SIDE 3
#define CM 'O'
#define HM 'X'
void showBoard(char board[][SIDE]){
printf("\n\n");
for(int i=0;i<SIDE;i++){
printf("\t\t\t");
for(int j=0;j<SIDE;j++){
printf(" %c ",board[i][j]);
... | ALGO | 0.999748 | 4.25399 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-01-11T16:36:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ebd2913ccf... |
293f5e5a-cdf0-4246-bed3-a7dec2490de5 | qiufengyu/LetsCode | Challenge-2022-08/09-binary-trees-with-factors.cpp | #include "../header.h"
int const M = 1000000007;
class Solution {
public:
int numFactoredBinaryTrees(vector<int>& arr) {
unordered_map<int, long> m;
sort(arr.begin(), arr.end());
for (int const& x: arr) {
m[x] = 1;
}
for (int i = 0; i < arr.size(); ++i) {
... | ALGO | 0.999979 | 5.30731 | {
"github_metadata": {
"branch": "main",
"commit_count": 218,
"repo_created_at": "2020-06-03T15:05: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": "b80a3cf351... |
f8fcff84-7632-4a8d-8b8a-09f83a3eb9a2 | xyluo2028/LCPrac | src/DFS/judge24Points.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
class Solution {
public:
bool judgePoint24(vector<int>& nums) {
float result = 0.0;
deque<float> dQ;
for (int i = 0; i < 4; i++) dQ.push_back((float)nums[i]);
bool judge = false;
DFS(dQ, judge);
... | ALGO | 0.993832 | 4.944626 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2020-07-13T09:13: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": "31e451b9e... |
b4f3d559-7ec3-4f22-a19d-433141c4c5cc | JKW8357/PS | 백준/Silver/20493. 세상은 하나의 손수건/세상은 하나의 손수건.cc | #include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,-1,0,1 };
pair<int, int> cur = { 0, 0 };
int cur_time[100005];
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n, t;
cin >> n >> t;
int dir = 0;
for (int... | ALGO | 0.999982 | 3.853897 | {
"github_metadata": {
"branch": "main",
"commit_count": 1323,
"repo_created_at": "2024-08-17T11:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84d9c9479... |
d998887d-bdca-4119-b491-ac4d0d40f375 | cheon-yong/algorithm | programmers/코딩테스트 고득점 Kit/정렬/h-index.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<int> citations) {
int answer = 0;
int len = citations.size();
sort(citations.begin(), citations.end(), less<int>());
int max = citations[len - 1];
// h는 hindex 후보
for (int h = 0; h < max... | ALGO | 0.999921 | 5.463841 | {
"github_metadata": {
"branch": "main",
"commit_count": 197,
"repo_created_at": "2021-01-28T12:21:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ae1024b5c... |
9005017a-355b-4d06-a57a-b254f3ad2d4c | NREL/EnergyPlus | third_party/ssc/shared/lib_ondinv.h | /**
BSD-3-Clause
Copyright 2019 Alliance for Sustainable Energy, LLC
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met :
1. Redistributions of source code must retain the above copyright notice, this list of conditions
and the... | ALGO | 0.931454 | 6.311944 | {
"github_metadata": {
"branch": "develop",
"commit_count": 40658,
"repo_created_at": "2013-11-22T14:47:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1278,
"forks": 441,
"issues": 908,
"pull_requests": 48
},
"file_meta": {
"content_id":... |
854b1c09-9427-4d51-8f37-9685dcc0d683 | Ethan-Chiu/cg-final-project | EthaneEngine/src/Ethane/Math/BVH.h | //
// BVH.h
// EthaneEngine
//
// Created by 邱奕翔 on 2023/6/7.
//
#pragma once
#include <stack>
#include "Math.h"
namespace Ethane {
namespace GpuModel {
enum MaterialType
{
LightSource,
Lambertian,
Metal,
Glass
};
struct Materia... | ALGO | 0.979649 | 6.186544 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-05-02T02:09:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "797ada7c68d... |
6c510acb-5e0d-4f65-88db-ae0115094f89 | ncduy0303/Competitive-Programming | Others/Offline Dynamic Connectivity.cpp | // Use DSU (with rollback) to solve offline dynamic connectivity problems
// Time complexity: O(qlogqlogn)
// Problem link: https://dunjudge.me/analysis/problems/422/
#include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
const int MAX_N = 3e5 + 1;
const int MOD = 1e9 + 7;
const int INF... | ALGO | 0.999961 | 4.989006 | {
"github_metadata": {
"branch": "master",
"commit_count": 406,
"repo_created_at": "2020-03-11T05:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 403,
"forks": 123,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "aef5... |
85839eee-6993-491b-87e1-3f8e3b655c1b | alihusnain88/DSA | Leetcode/Binary Search Tree/Construct Binary Search Tree from Preorder Traversal.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.999949 | 6.124289 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2024-10-05T15:50: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": "8480a42bb23... |
1a18ce67-ad5d-45fd-9489-2c123b7ac3f7 | StanislavPuzevich/Algorithmic-tasks | Algorithmic-tasks/3_EasyProblem_41.cpp | //20. Valid Parentheses(Easy)
//
//--------------------------------------------------------------
// https://leetcode.com/problems/valid-parentheses/description/
//--------------------------------------------------------------
//
//Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', dete... | ALGO | 0.964732 | 6.72048 | {
"github_metadata": {
"branch": "master",
"commit_count": 372,
"repo_created_at": "2022-01-28T07:38: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": "a4f43d3b... |
df6e78ac-925b-4c37-a46c-8e5121e492d8 | wokeeuplikethis/333 | QuickSort.cpp | #include "QuickSort.h"
void QuickSort::Print() {
std::cout << "Быстрая сортировка:" << std::endl;
}
void QuickSort::PrintCounters()
{
std::cout << "Quick ";
ISort::PrintCounters();
}
void QuickSort::AbsSort(std::vector<int>& arr, int size)
{
AbsQuicksort(arr, 0, size-1);
}
void QuickSort::AbsQuicksort(std::... | ALGO | 0.999172 | 5.122278 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-01-31T05:08: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": "dbcbae1ee1ee... |
aeff53c1-fe25-4079-8362-40609c5a86e1 | namhai0510/C-- | C--/two_substrings.cpp | #include <bits/stdc++.h>
using namespace std;
#define nothing ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define endl "\n"
#define ll long long
#define ull unsigned long long
#define fi first
#define se second
#define pb push_back
const ll oo = 1e13;
const ll modd = 1e9 + 7;
const int maxn = 1e6 + 5... | ALGO | 0.999988 | 3.74546 | {
"github_metadata": {
"branch": "main",
"commit_count": 617,
"repo_created_at": "2022-11-05T14:19:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09d367a69a... |
719e0ed5-5317-4ec5-9e65-cd2a2542143c | JayantGoel001/SPOJ | EXPEDI - Expedition.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define int long long int
#define pii pair<int,int>
#define double double_t
#define INF 1e18
using namespace __gnu_pbds;
using namespace std;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_... | ALGO | 0.999964 | 4.391611 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2020-12-10T09:44:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d731eac9... |
e4b40282-581a-4203-af5f-0febb6b1f75a | free-stardust/LeetCode | cpp/84.largest-rectangle-in-histogram.cpp | /*
* @lc app=leetcode.cn id=84 lang=cpp
* @lcpr version=30204
*
* [84] 柱状图中最大的矩形
*
* https://leetcode.cn/problems/largest-rectangle-in-histogram/description/
*
* algorithms
* Hard (46.03%)
* Likes: 2791
* Dislikes: 0
* Total Accepted: 447.9K
* Total Submissions: 969K
* Testcase Example: '[2,1,5,6,2... | ALGO | 0.999941 | 6.697577 | {
"github_metadata": {
"branch": "main",
"commit_count": 135,
"repo_created_at": "2021-02-22T05:12: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": "51837a710a... |
e67019af-aa79-4ec6-aa9f-0c944a0d39da | korliakov/physmod_hw | wk_19_5/task1.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <map>
#include <random>
#include <vector>
#include <set>
#include <cstdint>
#include <filesystem>
class App {
private:
int n = 1000;
float r = 2;
std::vector<double> x;
float x_0 = 0.5;
int number_of_seq = 30000;
float delta_... | ALGO | 0.995146 | 3.994282 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2021-09-17T10:19: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": "fff5df0cc... |
644eb1c2-585a-4f7c-94a1-a3adeda15920 | adityakrmaurya/Data-Structures-and-Algorithms | Data-Structures/week2_priority_queues_and_disjoint_sets/1_make_heap/build_heap.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using std::cin;
using std::cout;
using std::make_pair;
using std::pair;
using std::swap;
using std::vector;
template <typename T> void exch(T &a, T &b) {
T temp = a;
a = b;
b = temp;
}
class HeapBuilder {
private:
int data[1000000];
int n;
vector... | ALGO | 0.999877 | 3.985919 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2020-06-03T16:28: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": "90c9cdbe3... |
339dab1f-892e-4d78-8702-a49ef03f650c | chandan22051592/DSA-Practice | Seaching/BinarySearch/PrataSpoj.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool isPossible(vector <int> cookRanks, int nP, int mid){
int currP = 0 ;
for(int i =0 ;i<cookRanks.size();i++){
int R = cookRanks[i];int j = 1 ;
int timetaken = 0;
while(true){
if(timetaken +... | ALGO | 0.999936 | 4.043612 | {
"github_metadata": {
"branch": "practice",
"commit_count": 7,
"repo_created_at": "2024-04-20T14:38: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": "72754157... |
dd3a8f79-48f5-408a-8550-f223220d6d87 | rbichaev/msu_cpp_spring_2020 | 09/threadsort.h | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <thread>
#include <mutex>
using num_type = std::vector<uint64_t>;
// класс ThreadSort
// сначала два потока считывают числа блоками, сортируют их и записывают в отдельные файлы
// затем с этими файлами происходит ... | ALGO | 0.997636 | 3.955749 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2020-03-05T21:13: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": "80718e80a... |
04e28540-fc31-4ac2-a23c-43be991609d2 | nao-kobayashi/playground_c- | ModernC++/weasel/Weasel.cpp | #include <array>
#include <iomanip>
#include <algorithm>
#include <sstream>
#include "Weasel.h"
Weasel::Weasel(string_view t)
: target(t), chardist(0, 26), ratedist(0, 100) {
random_device rd;
auto seed_data = array<int, mt19937::state_size> {};
generate(begin(seed_data), end(seed_data), ref(rd));
... | ALGO | 0.999 | 5.192775 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2019-09-29T08:39: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": "6967b377f... |
59d9e8be-7b0a-4920-a8fb-9f027fd32ef8 | yetanotherbot/leetcode | 241. Different Ways to Add Parentheses/solution.cpp | class Solution {
private:
inline int compute(int a, int b, char op) {
switch (op) {
case '+': return a + b;
case '-': return a - b;
case '*': return a * b;
default: return -1;
}
}
public:
vector<int> diffWaysToCompute(string input) {
if... | ALGO | 0.999989 | 5.46489 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2016-08-09T12:43: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": "db11c3294... |
905d7f41-9968-4b49-9ff8-cd8aeb3741ae | Dikea/leetcode | 109/solution.cc | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), le... | ALGO | 1 | 6.47275 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2017-01-09T15:20: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": "462b1dac6... |
d4cce57b-828f-4e04-8380-2faa02dd807d | Sameem-Amjad/Data-Structure-And-Algorithm | Stack/SingleStackPallindrome.cpp | #include <iostream>
using namespace std;
class Stack
{
private:
int top;
char *array;
int size;
public:
// Constructor to initialize the stack with a given size
Stack(int a) : top(-1), size(a)
{
array = new char[size];
}
// Check if the stack is empty
bool isEmpty()
{
... | ALGO | 0.99889 | 6.423385 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2023-10-08T19:47: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": "58d043c13... |
b8c15182-88f6-4b63-b3eb-4b0d3bd8f077 | SivaprasadTamatam/-Word-Ladder-II | main.cpp | #include <iostream>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<unordered_map>
using namespace std;
vector<vector<string> > sol;
set<string> getSet(vector<string>& wordList) {
set<string> res;
for(string str : wordList) {
res.insert(str);
}
... | ALGO | 0.999995 | 4.651656 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-09-28T08:51:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36544c8ea8... |
90590a3b-2889-48ab-9b66-9515e490bf1f | maazl/analyze | src/moment.h | #ifndef MOMENT_H_
#define MOMENT_H_
#include "math.h"
#include "mathx.h"
class Mean
{protected:
double Count;
double Sum;
public:
Mean() : Count(0), Sum(0) {}
void push(double val, double weight = 1) { Count += weight; Sum += val * weight; }
double count() const { return Count; }
double sum() const { return Su... | ALGO | 0.936785 | 5.264321 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2017-11-05T21:38: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": "8a8c1318... |
b62d621d-4f9b-4be5-ba1e-cff00e700302 | lanny105/LeetCode | Best Time to Buy and Sell Stock with Cooldown/Method.cpp | //Say you have an array for which the ith element is the price of a given stock on day i.
//
//Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple times) with the following restrictions:
//
//You may not engage in multip... | ALGO | 0.999088 | 4.800786 | {
"github_metadata": {
"branch": "master",
"commit_count": 427,
"repo_created_at": "2016-05-30T19:52:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc6f8d11... |
e0d9b5db-fe2c-4710-a15e-dafd27212b73 | CISVVC/cis202-examples | sorting_and_searching/split/main.cpp | // Class splitstring which adds method split()
// Use the following class with the split function to aid in splitting a csv string
#include <string>
#include <vector>
#include <iostream>
using namespace std;
class splitstring : public string {
vector<string> flds;
public:
splitstring(const char *s) : stri... | TOOL | 0.923666 | 4.822298 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-02-21T16:15:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "135e488f3a... |
2dcdadb7-d306-491b-a2c6-40103f7347af | xdanielsb/competitive-programming | contest/codechef/may20B/corus/t.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define debug1( x ) cout << #x << " = " << x << endl;
#define debug2( x, y) cout <<#x << " = " << x << " , " <<#y << " = " << y <<endl;
#define F first
#define S second
#define PB push_back
#define size( x ) int( ( x ).size( ) )
#define endl '\n'
#define rep(i, a, b) for( _... | ALGO | 0.999549 | 3.217482 | {
"github_metadata": {
"branch": "master",
"commit_count": 225,
"repo_created_at": "2019-04-14T05:25:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bcda945... |
30aea03e-1de5-4d93-9ffc-f40a3ba89b4d | sandhu28/APNA-COLLEGE-DSA-SHEET-QUES | Trees/segment trees/Questions/Range Xor Queries.cpp | #include<iostream>
#include<bits/stdc++.h>
#define pii pair<int,int>
#define lli long long int
#define li long int
#define vi vector<int>
#define vvi vector<vector<int>>
#define vpii vector<pair<int,int>>
#define vlli vector<lli>
#define vli vector<li>
#define all(x) (x).begin(),(x).end()
#define rep(i,k,n) for (int i ... | ALGO | 0.999992 | 4.64433 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2022-05-26T17:13:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ff5c6021... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.