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 |
|---|---|---|---|---|---|---|---|
c4261c27-2612-428a-a336-003a61e09758 | misaka12233/daily-coding | cf/cf#795_E.cpp | #include<bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 100000 + 10;
struct node{
int c;
int l, r;
}s[maxn];
bool cmp(node x, node y)
{
return x.l < y.l;
}
int T;
int n;
int val[maxn << 1], m;
int cnt[2][maxn << 1], sum[2][maxn << 1];
int getpos(int x)
{
int l = 1, r = m, mid;
whi... | ALGO | 0.999904 | 4.041434 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-04-01T13:31: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": "0bcde754d7... |
4587746f-11ba-4070-98d6-7f5f45e766a2 | marialyu/holycode | stepic/disjoint_set.cpp | #include <iostream>
#include <vector>
#include <string>
class DisjointSet
{
public:
DisjointSet (int n);
bool Check (int a, int b);
void Union (int a, int b);
private:
int Find (int a);
std::vector<int> reprs;
};
DisjointSet::DisjointSet (int n)
{
reprs.resize(n);
for (int i = 0; i < n... | ALGO | 0.999806 | 4.921049 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2016-02-01T08:53: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": "e2b35dc67... |
176c70fe-790e-4065-a234-15926427a992 | WOI-Core/woi-grader-archive | Camp2/Sandwich/Solutions/Sandwich.cpp | #include <iostream>
#include <algorithm>
using namespace std;
// Using vectors for dynamic sizing, although constraints are large
// The provided solution uses static arrays which is also fine
long long qs[2000001];
long long qs_walk[2000001];
int main(){
cin.tie(0)->sync_with_stdio(0);
int N;
cin >> N;... | ALGO | 0.999917 | 5.005047 | {
"github_metadata": {
"branch": "main",
"commit_count": 109,
"repo_created_at": "2025-06-17T12:20:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f4d3a34c04... |
ae2898bf-640f-4644-a53e-65b0954202de | riyuna/problem-solving | bapc 2018-pre/G/submissions/wrong_answer/ragnar-broken-unwrapping.cpp | #include <algorithm>
#include <array>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
using namespace std;
int main(){
array<int, 3> ts;
for(auto &x : ts) cin >> x;
int T = ts[0] + ts[1] + ts[2];
int n;
cin >> n;
array<vector<int>, 3> o;
while(n--){
int t;
string... | ALGO | 0.974126 | 4.188256 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2021-08-26T16:58: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": "6c152e9c465... |
842d50e8-b137-4ba9-b7d3-19f019ec2452 | TiagoSilva35/Competitive-programming | jakarta2023/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vector<int> > vv;
typedef vector<vector<ll> > vvll;
typedef vector<vector<p... | ALGO | 0.999978 | 4.103332 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2023-08-09T20:38:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05112769be6... |
28ae2355-1549-41ae-a615-45cd2c788c5f | Peter-Chou/data-structure-cpp | heap/complete_heap.h | #ifndef DATA_STRUCTURE_COMPLETE_HEAP_H_
#define DATA_STRUCTURE_COMPLETE_HEAP_H_
#include <utility>
#include "../_share/comparator.h"
#include "../vector/vector.h"
namespace datastruct {
// 判断PQ[i]是否合法
#define InHeap(n, i) (((-1) < (i)) && ((i) < (n)))
// PQ[i]的父节点(floor(i-1)/2,i无论正负)
#define Parent(i) ((i - 1) >> 1)... | ALGO | 0.982696 | 5.954537 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2018-11-18T07:50: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": "b5fef391b... |
42dd087f-f92a-467f-a073-654f0fe7a74b | 2lian/Legged-Robot-Movability-Cuda | leg_geometry.cu.h | #pragma once
#include "HeaderCPP.h"
#include "HeaderCUDA.h"
// extern float sin(float x); // shuts up clangd
// extern float cos(float x);
// extern float sqrt(float x);
#define LOWER_SIDE 0
#define UPPER_SIDE 1
template <uchar up_or_down = LOWER_SIDE>
__forceinline__ __host__ __device__ float
min_femur_to_gripper_d... | ALGO | 0.938144 | 5.282574 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2023-09-16T05:10:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "098b1848... |
2ce8779e-392b-45fe-af36-6a7bb0c5376c | rahulanwala/DSA-by-Love-Babbar | 11. Linked List/Code/removeloop.cpp | #include <bits/stdc++.h>
using namespace std;
// https://bit.ly/3rSdTDo
class Node
{
public:
int data;
Node *next;
Node(int d)
{
this->data = d;
this->next = NULL;
}
};
void insertNode(Node *&tail, int element, int d)
{
// empty list
if (tail == NULL)
{
Node *t... | ALGO | 0.999973 | 5.419858 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-06-10T05:53: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": "26e029d7bc3f... |
a3bcda36-29b3-4048-b2b6-460e841249c9 | cmu-db/peloton | src/optimizer/util.cpp | //===----------------------------------------------------------------------===//
//
// Peloton
//
// util.cpp
//
// Identification: src/optimizer/util.cpp
//
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
//
//===--------------------------------------------------------------... | ALGO | 0.950105 | 4.884885 | {
"github_metadata": {
"branch": "master",
"commit_count": 10740,
"repo_created_at": "2014-12-18T21:35:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2046,
"forks": 619,
"issues": 159,
"pull_requests": 28
},
"file_meta": {
"content_id": ... |
86445451-145d-43ac-b3bf-6b3e2606f104 | njkumar09/Basics_C- | magic ball 8 _ basic.c++ | #include <iostream>
int main() {
int gryffindor =0 ;
int hufflepuff=0;
int ravenclaw=0;
int slytherin=0;
int answer1 ;
int answer2 ;
int answer3;
int answer4;
std::cout << "The Sorting Hat Quiz!\n";
std::cout << "Q1) When I'm dead,I want people to remember me as:\n" << "1) The Good\n2) The Great... | TOOL | 0.946833 | 3.631771 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-03-02T07:11: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": "241ce0fb5b6... |
1238ef87-b6a1-4c1a-91a8-ae6b0978c6f8 | Granth-Gupta/Data-Structures-and-Algorithms | DSA/BFSGraph.cpp | #include <iostream>
#include <vector>
#include <queue>
class Graph {
private:
int numVertices;
std::vector<std::vector<int>> adjList;
public:
Graph(int n) : numVertices(n) {
adjList.resize(numVertices);
}
// Function to add an edge to the graph
void addEdge(int src, int dest) {
... | ALGO | 0.99991 | 6.946664 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-08-25T16:34: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": "f73ee5db232d... |
cef51bcd-84c3-4bcf-89e3-b2ce07021caf | zzun-d/Algorithm | 프로그래머스/lv1/42840. 모의고사/모의고사.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> one = {1, 2, 3, 4, 5};
vector<int> two = {2, 1, 2, 3, 2, 4, 2, 5};
vector<int> three = {3, 3, 1, 1, 2, 2, 4, 4, 5, 5};
vector<int> solution(vector<int> answers) {
vector<int> answer;
int score1 = 0, score2 = 0, score3 = 0;
for (int i=0;... | ALGO | 0.999992 | 5.018759 | {
"github_metadata": {
"branch": "master",
"commit_count": 241,
"repo_created_at": "2023-05-23T03:09: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": "0b6013ef... |
077c9960-39bb-4ca8-80d5-ce53bbe1367b | SibgatullinAP/HomeWork | 5sem/mathematical_workshop/MathPractice/20191116/13/task.cpp | #include "common.hpp"
#include "task.hpp"
void
replace (double * a, size_t l, size_t r,
size_t & c_b, double & s_b,
size_t & c_e, double & s_e,
bool & is_same)
{
size_t i, j;
if (l == r)
{
c_b = c_e = 0;
s_b = s_e = 0;
is_same = true;
return;
}
c_b = c... | ALGO | 0.999932 | 5.099623 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2020-09-26T21:05: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": "1f5b1a8d1... |
0602eb86-7195-4e33-9bfe-ce296dd1fc59 | shailja168/DSA_CPP | Stack & Queue/Stack/Prefix_Evaluator.cpp | #include <iostream>
#include <stack>
#include <string>
#include <math.h>
using namespace std;
//Time Complexity = O(n) where n = lenght of the string or expression
int solve(int a, int b, char ch){
switch (ch){
case '+': return a + b; break;
case '-': return a - b; break;
case '*': return a * b; brea... | ALGO | 0.999923 | 4.237273 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-12-06T10:10:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5838054054a... |
b61bff72-8985-46ed-aaa6-e8f0f405e204 | ishandutta2007/codeforces-g | gromah/normal/1139/C.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
#define N 100000 + 5
#define Mod 1000000007
int n, k, ans, Fa[N], Size[N];
int Find(int x)
{
return x == Fa[x] ? x : Fa[x] = Find(Fa[x]);
}
inline int Power(int u, int v)
{
int res = 1;
for (; v; v >>= 1)
{
if (v & 1)
res = 1LL * res * u % Mod;
u... | ALGO | 0.999947 | 4.331853 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55: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": "d509b6db345a... |
bee399c6-0b92-4d36-923b-133eeec21d36 | Priya-Thakur25/LeetCode | 0984-most-stones-removed-with-same-row-or-column/0984-most-stones-removed-with-same-row-or-column.cpp | class DisjointSet{
public:
vector<int>rank,parent;
DisjointSet(int n){
parent.resize(n+1);
rank.resize(n+1,0);
for(int i=0; i<=n; i++) parent[i] = i;
}
int findParent(int u){
if(parent[u] == u) return u;
return parent[u] = findParent(parent[u]);
}
vo... | ALGO | 0.999007 | 5.38378 | {
"github_metadata": {
"branch": "main",
"commit_count": 1591,
"repo_created_at": "2024-09-22T14:17: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": "33074eda7... |
b909704b-b144-4f9c-8d7a-0688cf6b326e | ksaveljev/CSES-problem-set | 1.introductory/two.sets.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int main(void) {
ll n, sum;
vector<int> a, b;
cin >> n;
sum = n * (1 + n) / 2;
if (sum % 2 != 0) {
cout << "NO" << endl;
} else if (n == 3) {
cout << "YES" << endl;
cout << 1 << endl;
... | ALGO | 0.999952 | 3.541969 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2020-01-20T12:29: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": "ba857f32c... |
6b108f2d-a8c6-416f-a0e8-9dde950e7faf | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p02866/s343177411.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
const int mod = 998244353;
int main() {
int n, d0;
cin >> n >> d0;
if(d0 != 0) {
cout << 0 << endl;
return 0;
}
vector<int> d(100005);
d.at(0) = 1;
int max_d... | ALGO | 0.999971 | 4.980782 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "7163a0a305... |
9014ff8e-ccf0-40ef-83bb-179146dc16d6 | webgeekhabib007/MyCompetitiveProgrammingTemplate | Graph/SCC.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long int;
#define nl "\n"
#define all(v) (v).begin(),(v).end()
int main(int argc, char const *argv[])
{
ll n,m;cin>>n>>m;
vector<vector<ll>> adj(n),adj1(n);
for(ll i=0;i<m;i++){
ll u,v;cin>>u>>v;
adj[u].push_back(v); // origianl... | ALGO | 0.999995 | 4.748811 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2023-12-16T13:47: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": "1d8d3a40f7d... |
0038516d-6b48-44a2-9097-3ce7a7a0ee21 | rohanrao619/Data_Structures_and_Algorithms | Graph/Cycle_Detection_in_Directed_Graph.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
/* Function to check if the given graph contains cycle
* V: number of vertices
* adj[]: representation of graph
*/
bool DFS(int curr,vector<int> adj[],bool visited[],bool rstack[])
{
visited[curr] = true;
rstack[... | ALGO | 0.999718 | 6.049483 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2020-03-08T17:20:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b1f10c84... |
49bf5f43-3981-487f-82dc-5d3abdd7a2ee | Girl-Code-It/DSA-BOOTCAMP-GCI-PUNE | Oishi/Basics of Programming/Patterns/15.cpp | #include <iostream>
using namespace std;
int main(int argc, char**argv){
int n;
cin >> n;
//write your code here
int s = (n-1)/2;
for (int i=0; i<=s; i++) {
int temp = i+1;
for (int j=i; j<s; j++) {
cout << "\t";
}
for (int k=1; k<=2*i+1; k++) {
... | ALGO | 0.999987 | 3.722789 | {
"github_metadata": {
"branch": "main",
"commit_count": 423,
"repo_created_at": "2022-03-22T18:39:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 55,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "fa898eb379... |
6e7e2fba-fc3e-4996-b1d9-2b3f808dba55 | BritoAlv/cs | competitive_programming/R1000/GoingCinema.cpp | // Problem: B. Going to the Cinema
// Contest: Codeforces - VK Cup 2022 - Отборочный раунд (Engine)
// URL: https://codeforces.com/contest/1781/problem/B
// Memory Limit: 512 MB
// Time Limit: 2000 ms
// Math Proof:
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
#define endl '\n'
#define wp... | ALGO | 0.999711 | 4.66803 | {
"github_metadata": {
"branch": "main",
"commit_count": 202,
"repo_created_at": "2022-06-16T15:43: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": "46a4de3c83... |
f77240ed-8e34-4d69-8539-3523f3a444e3 | Kevin-Silva/Cpp-Estudos | General Studies/CentsExec/main.cpp | #include <iostream>
using namespace std;
int main(){
int number_of_cents {0};
const int dollar{100};
const int quarter{25};
const int dime{10};
const int nickel{5};
const int penny{1};
cout << "Please, entre the number of cents: ";
cin >> number_of_cents;
cout <<"Dollar: " <<... | TOOL | 0.919434 | 3.67273 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2021-03-09T13: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": "9907d0d10da... |
9993408e-ddef-4bc7-9ed7-eca2db86f8fb | parkjk93/Algorithm | DataStructure/Queue.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node* nextnode;
};
class Queue {
public:
Node* front;
Node* rear;
Queue();
~Queue();
void Enqueue(int data);
void Dequeue();
void PrintQueue();
};
Queue::Queue() {
front = NULL;
rear = NULL;
}
Queue::~Queue() {}
void Queue::Enqueue... | ALGO | 0.983913 | 4.099045 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-04-06T08:25:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea2a25007... |
8cc3e096-3dba-4ffe-b89c-4c54c205f9a6 | Adam-Zhou-Hust/Codings | 剑指offer/Chap03/fig03_14.cpp | /**
* 输入一个整数数组,实现一个函数,调整数组中数字的顺序
* 使得所有的奇数位于数组的前半部,偶数位于数组的后半部
*/
// 这道题目,首先让我想到的是快速排序中,根据枢纽元素,把整个数组分为两部分
// 左边为小于枢纽元素的集合,右边为大于枢纽元素的集合
// 用到的是首尾指针,思想是元素交换,从而在O(n)时间内完成元素的一次排列
// 很显然,此题也是一样,两个指针,首指针指向左边第一个偶数,尾指针指向右边第一个奇数,交换之
// 迭代,直到两个指针位置颠倒,很显然,存在下列做法
#include <iostream>
inline
void Exchange(int *a, int *b) {
... | ALGO | 0.999882 | 4.569005 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2018-11-06T12:53:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45a5b9a6c... |
7733b1d8-55ca-44a5-bcb9-2e13d877b314 | Eviden0/Code | 算法数据结构补充/二叉搜素树.cpp | // #include <iostream>
// using namespace std;
// // 定义二叉树节点结构体
// struct TreeNode
// {
// int val;
// TreeNode *left;
// TreeNode *right;
// TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
// };
// // 插入节点函数
// TreeNode *insert(TreeNode *root, int val)
// {
// if (root == nullptr)
// ... | ALGO | 0.999911 | 4.134984 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2024-03-28T14:51: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": "de36e89fe1... |
de01c2a7-517d-43f9-8755-e84e01ca760f | anubansal17/Coding-Career-Journey | RoadMap/35_ConstructBTFromPostOrderAndInorder.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.999994 | 6.313183 | {
"github_metadata": {
"branch": "master",
"commit_count": 901,
"repo_created_at": "2020-02-09T14:11:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50945b3f... |
6e52ac5a-d834-4cfd-9cd9-230430d06731 | co-meng-2/CodeTest | CodeTest/BOJ_택배.cpp | #include <bits/stdc++.h>
#define fastio std::ios_base::sync_with_stdio(false);\
cin.tie(NULL)
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
int dx[4] = { -1,1,0,0 };
int dy[4] = { 0,0,-1,1 };
const int INF = 0x3f3f3f3f;
// 플로이드의 경로
// 경유점 저장
int n, m;
int ... | ALGO | 0.999948 | 3.820776 | {
"github_metadata": {
"branch": "BOJ",
"commit_count": 141,
"repo_created_at": "2023-09-04T02:33: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": "e8079cb2694... |
416a072e-448c-428c-ae07-37a0643b3d89 | ikr/algo-practice | atcoder/2023/abc308/E/solution.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T> constexpr int inof(const T x) {
return static_cast<int>(x);
}
template <typename T> constexpr int sz(const T &xs) { return inof(xs.size()); }
int main() {
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(cin.failbit)... | ALGO | 0.999979 | 4.388826 | {
"github_metadata": {
"branch": "master",
"commit_count": 5422,
"repo_created_at": "2016-06-23T07:28:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a801405... |
1bc26d37-f7c9-401e-8567-6d3e90f8f60f | redradist/Introduction_To_Algoritms-Luxoft- | Algorithms/SimpleSearch.cpp | #include "SimpleSearch.h"
#include <cassert>
int search_1(int A[], int size, int key)
{
assert(A != nullptr && size > 0);
for (int i = 0; i < size; i++)
{
if (A[i] == key)
{
return i;
}
}
return -1;
}
int search_2(int A[], int size, int key)
{
assert(A != nullptr && size > 0);
int i = 0;
while (... | ALGO | 0.999783 | 5.580607 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2016-06-25T09:45: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": "16a8d5b9f... |
515f7f74-9ae2-44a1-a628-dee11b2d08e7 | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p02259/s165792415.cpp | #include <iostream>
#include <vector>
using namespace std;
void printVector(const vector<int> &A) {
for(int i = 0; i < A.size(); i++) {
cout << A[i];
if(i+1 < A.size()) cout << ' ';
}
cout << endl;
}
int main() {
int n, count = 0;
auto swap = [](int &a, int &b) {
int... | ALGO | 0.999753 | 4.015553 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "836a60d65e... |
f7c79156-d875-43ce-af01-6d2d4e51d5d4 | Sourabh2001-dec/cp | babbar-sheet/ARRAY2/common-in-three-arrays.cpp | // Find common elements in three sorted arrays
// [Practice here: https://practice.geeksforgeeks.org/problems/common-elements/0 ]
#include <bits/stdc++.h>
using namespace std;
vector<int> commonEle(vector<int> &v1, vector<int> &v2, vector<int> &v3)
{
int i = 0;
int j = 0;
int k = 0;
vector<int> res;
int e1 ... | ALGO | 0.999923 | 5.529042 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2021-12-06T04:38: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": "4b2fc383f... |
ff5a14b5-1c07-4bb4-864b-52c5cb218f3a | Shinyodst/CS5103_rwm268_CourseProject | HugeNumbers.cpp | #include<iostream>
#include<string>
#include <bits/stdc++.h>
using std::cout;
using std::endl;
using std::cin;
using std::string;
using std::to_string;
using std::stol;
long addDigits(long,long);
long subDigits(long,long);
string digitToString(long);
string addDecimalPosition(string,int);
string addStrings(string,stri... | ALGO | 0.998202 | 3.912031 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-02-21T01:27:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0a60a51c2f... |
91282fed-83c4-437c-88c4-abcc6447d9fb | LGCooci/KCObjc4_debug | objc4-756.2/编译素材/dyld-655.1.1/dyld3/shared-cache/AdjustDylibSegments.cpp | /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
*
* Copyright (c) 2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.... | TOOL | 0.916372 | 6.594012 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2019-10-08T08:48:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1013,
"forks": 315,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "05bc... |
f7bc3803-e197-4de2-84a6-265f30dd15d1 | actium/codeforces | 1000/30/1036d.cpp | #include <iostream>
#include <vector>
template <typename T>
std::istream& operator >>(std::istream& input, std::vector<T>& v)
{
for (T& a : v)
input >> a;
return input;
}
void answer(unsigned x)
{
std::cout << x << '\n';
}
void no_answer()
{
std::cout << -1 << '\n';
}
void solve(std::vector... | ALGO | 0.999958 | 4.157262 | {
"github_metadata": {
"branch": "master",
"commit_count": 4876,
"repo_created_at": "2020-06-17T16:27:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de04f36... |
f0ee8da3-dc7c-4d68-be3c-5efbb57a5e2a | dvbuiilds/dsa-prep | leetcode/31. Next Permutation.cpp | /**
* @file 31. Next Permutation
* @author @dvbuiilds
* @brief
* @version 0.1
* @date 2022-04-03
* @link https://leetcode.com/problems/next-permutation/ @endlink
* @copyright Copyright (c) 2022
*
*/
/*
A permutation of an array of integers is an arrangement of its members into a sequence or linear order.
Fo... | ALGO | 0.999984 | 6.598168 | {
"github_metadata": {
"branch": "master",
"commit_count": 197,
"repo_created_at": "2021-06-21T19:16: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": "4586123f... |
5cb7ecbf-e00f-42f9-b9ce-2988d845320b | siddh34/DSA_TEMPLATES | 2DArrays/spiral_print.cpp | #include <bits/stdc++.h>
using namespace std;
void spiral_print(int arr[][10], int n, int m){
int start_row = 0;
int end_row = n - 1;
int start_col = 0;
int end_col = m - 1;
while(start_row <= end_row and start_col <= end_col){
// start row
for(int col = start_col; col <= end_col... | ALGO | 0.999827 | 4.740069 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-12-08T06:41: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": "dbbddfbef2c... |
b22b1a8b-f5f7-49d0-a925-be1eb8b29f9b | pumfit/PracticeForCodingTest | CodingTestExProject/CodingTestExProject/백준/2460.cpp | /*
2460 지능형 기차 2
최근에 개발된 지능형 기차가 1번역(출발역)부터 10번역(종착역)까지 10개의 정차역이 있는 노선에서 운행되고 있다. 이 기차에는 타거나 내리는 사람 수를 자동으로 인식할 수 있는 장치가 있다. 이 장치를 이용하여 출발역에서 종착역까지 가는 도중 기차 안에 사람이 가장 많을 때의 사람 수를 계산하려고 한다. 단, 이 기차를 이용하는 사람들은 질서 의식이 투철하여, 역에서 기차에 탈 때, 내릴 사람이 모두 내린 후에 기차에 탄다고 가정한다.
예를 들어, 위와 같은 경우를 살펴보자. 이 경우, 기차 안에 사람이 가장 많은 때는 2번역에서 ... | ALGO | 0.999609 | 4.017858 | {
"github_metadata": {
"branch": "master",
"commit_count": 450,
"repo_created_at": "2021-06-30T02:44: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": "3e8b2fe0... |
53bed9bc-2ab0-48d7-9969-3586ce50c96f | RollLikeRollo/FIT_VUT_BMS | utils.hpp | //***************************************
// <NAME>
// xzbori20
// BMS projekt
// 2023
//
// bms.hpp
//***************************************
#ifndef UTILS_HPP
#define UTILS_HPP
#include <algorithm>
#include <bitset>
#include <fstream>
#include <iostream>
#include <iterator>
#include <random>
#include <string>
#incl... | ALGO | 0.989667 | 6.089564 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-11-11T18:16:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c64039e14f01... |
c172f0c5-38c1-47d4-9ab8-fed8d0081f3b | shuaijiang/LeetCode | InterleavingString.cpp | /*
*Interleaving String
*Author: shuaijiang
*Email: <EMAIL>
*/
#include<iostream>
#include<vector>
#include<string.h>
#include<stdlib.h>
using namespace std;
class Solution {
public:
bool isInterleave(string s1, string s2, string s3) {
int m = s1.size();
int n = s2.size();
int k = s3.size()... | ALGO | 0.999811 | 4.494921 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2015-03-25T09:22:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d471a1f5... |
04f45818-85c7-4115-a6bf-8ca08d5c4fd0 | rishabg30/Question-Bank-DSA | Trees/Construct-Binary-Tree-From-PostOrder-And-InOrder-Traversal.cpp | #include <bits/stdc++.h>
using namespace std;
// https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/
class TreeNode {
public:
int val;
TreeNode *left = nullptr;
TreeNode *right = nullptr;
TreeNode(int val) {
this->val = val;
}
};
void postOrder_Traversal(TreeNode *root) {... | ALGO | 0.999998 | 6.151254 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-09-24T20:32: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": "ca97ef6b95a... |
bc432426-7fd3-4dab-a163-bbb72132e137 | yusuke-matsunaga/ym-logic | c++-srcs/dd/BddSupOp.h | #ifndef BDDSUPOP_H
#define BDDSUPOP_H
/// @file BddSupOp.h
/// @brief BddSupOp のヘッダファイル
/// @author <NAME> (松永 裕介)
///
/// Copyright (C) 2023 <NAME>
/// All rights reserved.
#include "ym/logic.h"
#include "BddOpBase.h"
BEGIN_NAMESPACE_YM_DD
//////////////////////////////////////////////////////////////////////
///... | TOOL | 0.972127 | 6.360981 | {
"github_metadata": {
"branch": "main",
"commit_count": 410,
"repo_created_at": "2016-02-10T04:27: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": "841c2b10a3... |
eb4d0fb9-af14-4666-b044-347f5c2d03f2 | tjdbssy137/sbs_202402 | homework/20240308_01/20240308_01/CardGame.cpp | #include "CardGame.h"
// 2) 섯다
//
// 1. 플레이어가 1000원을 갖고 시작한다
// 2. 화투카드 20장을 섞는다
// 3. 배팅을 한다. (플레이어만 배팅할 수 있고 상대는 무조건 콜)
// 4. 플레이어 1장, 상대한테 1장을 준다
// 5. 배팅을 한다(0원 가능)
// 6. 플레이어한테 1장 상대한태도 1장을 준다
// 7. 족보가 더 높은 쪽이 승리(족보는 인터넷 참고), (게임 재시작 족보는 제외 가능)
// 8. 플레이어가 0원이 되면 게임 종료
// 9. 매판 20장을 새롭게 섞는다.
CardGame::CardGame(... | TOOL | 0.975444 | 3.600763 | {
"github_metadata": {
"branch": "main",
"commit_count": 184,
"repo_created_at": "2024-02-07T11:25:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9bbe7f25c7... |
a184647f-5de8-45c5-9297-16e4f37b5daf | ds2465310/ShinDokyoung_CIS5_44187 | Hmwk/Assignment_4/Savitch_8thEd_Chap4_Prob6_Interest/main.cpp | /*
File: main.cpp
Author: <NAME>
Created on March 3, 2017, 9:36 AM
Purpose: Calculate the Interest Due on a Credit Account Balance.
*/
//System Libraries
#include <iostream>
using namespace std;
//User Libraries
//Global Constants
//Such as PI, Vc, -> Math/Science values
//as well as conversions from sys... | TOOL | 0.951388 | 4.567595 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-03-15T20:12: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": "0924c7587... |
a68e51f6-67df-4042-833b-ecbb38a1d384 | dhruv-yadav-nitj/striver-a2z-dsa-cpp | Step 05 ~ Strings/02.MEDIUM PROBLEMS/03-COUNT-NUMBER-OF-SUBSTRINGS.CPP | #include <bits/stdc++.h>
using namespace std;
// could not understand this problem
// this code was copy pasted from some comment for reference
class Solution
{
public:
long long int subwithk(string s, int k)
{
int arr[26] = {0};
long long int count = 0;
int distinct = 0;
int i... | ALGO | 0.99993 | 5.209978 | {
"github_metadata": {
"branch": "main",
"commit_count": 173,
"repo_created_at": "2023-06-07T19:26:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 52,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80f39aaa... |
66c4d0cf-ebc9-4a35-b5f9-d33cd8cf8d22 | Anuj0097/Competitive-Programming-C- | Friends_Meetup.cpp | #include <bits/stdc++.h>
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define int long long
#define ll long long
#define ld long double
#define mod 1000000007
#define PI 3.141592653589793238462
#define f first
#define s second
#... | ALGO | 0.999967 | 4.823365 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-05-24T08:50: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": "abdc124dfc... |
880e8b4c-ae2d-4407-98df-bf7ac7b40d10 | rashmith222/MissionRnD-C-Arrays-Worksheet | src/removeArrayDuplicates.cpp | /*
OVERVIEW: given an array that has duplicate values remove all duplicate values.
E.g.: input: [1, 1, 2, 2, 3, 3], output [1, 2, 3]
Ex 2: [4,4,2,2,1,5] output : [4,2,1,5]
INPUTS: Integer array and length of the array .
OUTPUT: Update input array by removing duplicate values and return the final array length
ERROR... | ALGO | 0.997416 | 4.439479 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2016-03-02T20:05: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": "bf71dcc3e... |
c3a6f91d-fc04-48d5-9811-9b384aae9c9f | kfernandez31/Competitive-programming | leetcode/0200-0299/0200. Number of Islands/solution_1.cpp | // Approach: DFS.
// TC: O(mn)
// SC: O(mn)
class Solution {
int m, n;
static constexpr pair<int, int> dirs[] = {{-1,0}, {0,1}, {1,0}, {0,-1}};
public:
bool dfs(vector<vector<char>>& grid, int i, int j) {
if ((i < 0 || m <= i) || (j < 0 || n <= j) || grid[i][j] == '0')
return false;
... | ALGO | 0.999995 | 6.702487 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-02-19T12:46: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": "ce610007b261... |
47e3bbe9-2bbd-49d5-b391-c9822165d3b1 | PayamBen/projectEuler | c++/pe-problem32/observ.c++ | #include <iostream>
#include <iomanip>
#include <deque>
#include <set>
#include <algorithm>
int main ()
{
std::deque<int> permutation (9);
const int init[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
std::set<int> products;
permutation.assign (init, init + sizeof (init) / sizeof (init [0]));
for (int i = 0; i... | ALGO | 0.999389 | 4.737203 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-07-21T10:02: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": "a04f387276... |
8b90de7b-a971-4931-9349-f94fb1467ac0 | sysulic/EPK | src/EpisCNF.cpp | #include "define2.h"
bool PropClause::entails(const PropClause& prop_clause) const
{
return literals.is_subset_of(prop_clause.literals);
}
PropTerm PropClause::negation() const
{
PropTerm result(length);
if (is_true()) {
result.literals.set();
return result;
}
for (size_t i = 0... | ALGO | 0.948704 | 5.771757 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2015-10-26T10:19:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7420eed9db... |
305c7a14-4bcc-4350-8810-919564702e79 | NikolajKlinkby/VMI-RAE-MCP-coincidense-DA-program | Source/VMI GIF/main.cpp | #include <iostream>
#include <cmath>
#include <fstream>
#include <TFile.h>
#include <TTree.h>
#include <TObject.h>
#include <Math/Minimizer.h>
#include <Math/Factory.h>
#include <Math/Functor.h>
#include <TSpline.h>
#include <vector>
#include <random>
#include <unistd.h>
#include <TMatrixD.h>
#include <chrono>
#include... | ALGO | 0.999922 | 4.172246 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-09-01T09:02: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": "3956b08515e... |
55e0b152-2a70-4af4-9586-b27df15f26eb | jieqiboh/questions | leetcode/210.CourseScheduleII/main.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <sstream>
#include <bitset>
#include <utility>
using namespace std;
void fast() {
ios::sync_with_... | ALGO | 0.999995 | 5.90871 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-01-11T10:25: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": "c5907b1eeed... |
f7abc439-b258-4862-95fe-18732d069269 | misttech/mist-os | src/ui/scenic/lib/view_tree/snapshot_types.cc | // Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/ui/scenic/lib/view_tree/snapshot_types.h"
#include <lib/syslog/cpp/macros.h>
#include "src/ui/scenic/lib/utils/helpers.h"
namespace {
boo... | TOOL | 0.938084 | 7.158367 | {
"github_metadata": {
"branch": "main",
"commit_count": 203067,
"repo_created_at": "2024-05-21T16:35:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ffebcdd... |
b3c0dbc1-58e0-4bb3-814d-d42ef3aa576f | FahadHasan8386/oNline_problem_solving | cf1473B.cpp | ///IN the name of Allah
#include <bits/stdc++.h>
using namespace std ;
int lcm (int a , int b)
{
return (a * b) / __gcd(a,b);
}
void fahad(const string& s , const string& t)
{
int lcm_length = lcm(s.size(), t.size());
string s_lcm = "" ,t_lcm = "";
for(int i = 0 ; i < lcm_length / s.size() ;i++)
... | ALGO | 0.999944 | 4.696123 | {
"github_metadata": {
"branch": "main",
"commit_count": 265,
"repo_created_at": "2023-05-17T10:10:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbb029573c... |
8d679bc6-e151-43dc-9893-d7bcd1bcdc67 | Touhid-Alam/C_PLUS_PLUS_LAB_WORK | Assignment_Overload/Task_1.cpp | #include<iostream>
using namespace std;
class Box{
private:
float length,width,height;
public:
Box(){
}
Box(float l,float w,float h){
length = l;
width = w;
height = h;
}
void setLength(float l){
length = l;
}
float getLength(){
return ... | TOOL | 0.975978 | 3.895052 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-08-10T00:15: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": "b0fbac4ddbff... |
dfc6ab14-2ee3-4e9a-95e1-f81995893e51 | vazpeitiah/competitive-programming | codeforces/problemset/1385A - Three Pairwise Maximums.cpp | #include <iostream>
using namespace std;
int main () {
int t; cin >> t;
int x, y, z, maxi, maxio, pmaxi;
while(t--) {
cin >> x >> y >> z;
maxi = max(x, max(y, z));
maxio=0;
if(maxi == x) maxio ++;
else pmaxi = x;
if(maxi == y) maxio ++;
else pmaxi = y;
if(maxi == z) maxio ++;
... | ALGO | 0.999966 | 3.391765 | {
"github_metadata": {
"branch": "main",
"commit_count": 148,
"repo_created_at": "2021-09-29T00:09: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": "2042894e49... |
d39f327f-f34c-4fa0-ba7d-ae05b902afe5 | NiloyKumarKundu/Programming-Problem-Solution | CPS (Level - 2)/Graph Theory/DFS/Bishu_and_his_Girlfriend.cpp | #include <bits/stdc++.h>
#define max 10000 + 5
#define mod 10000 + 5
#define pb push_back
#define pairs pair<int, int>
#define vi vector<int>
#define vb vector<bool>
#define vii vector<pairs>
#define lb lower_bound
#define ub upper_bound
#define lli long long int
#define endl '\n'
using namespace std;
vi graph[max];
v... | ALGO | 0.999798 | 3.753497 | {
"github_metadata": {
"branch": "main",
"commit_count": 370,
"repo_created_at": "2021-03-25T10:24: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": "94b7f90783... |
8d4eb3f0-240d-4f31-829b-30c8a77a39a0 | shrinish123/AZ201- | Module3/Graphs/1Foundations/Prob/1.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define ii pair<int,int>
#define F first
#define S second
int n,m;
vector<string> arr;
int ans =0;
int vis[1010][1010];
int dx[] = {1,0,-1,0};
int dy[] ={0,-1,0,1};
bool isValid(int x,int y){
if(x <0 || x>= n || y<0 || y>=m ... | ALGO | 0.999695 | 4.587434 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-07-30T08:58: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": "a83b36b25d7c... |
655cb181-d4c3-4000-8846-708c4ce235bb | GregWagner/Udemy-DSA-Courses | Coding-Minutes/Data_Structures_and_Algorithms_Essentials/Section_15_Linked_List/Exercises/kth_last_element.cpp | /*
* Implrmrny a function that returns the Kth last element
* of the linked list in a single pass. You can assume k
* will be less than the lenngth of the linked list.
* Hint: Use 2 pointer
*/
#include <iostream>
class node {
public:
int data;
node* next;
node(int data) {
this->data = data;
... | ALGO | 0.998362 | 5.974852 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2022-11-30T20:34: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": "70941403... |
12fb122a-2343-4d37-a88a-902593cef6e5 | xambassador/DSA | String/z-algorithm/z.cpp | #include <iostream>
using std::string;
using std::cin;
using std::cout;
using std::endl;
// -----------------------------------------------------------------------------
void build_z_array(int* z_array, string str) {
int l{}, r{}, n{str.length()};
for (int i{1}; i < n; i++) {
if (i > r) {
l... | ALGO | 0.999878 | 5.197658 | {
"github_metadata": {
"branch": "master",
"commit_count": 428,
"repo_created_at": "2020-08-22T06:10:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a20378a... |
9e7b1328-927d-4e62-ad9d-8f09afc4b16e | YooJaeJun/PS-Algorithm- | 프로그래머스/lv0/120861. 캐릭터의 좌표/캐릭터의 좌표.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<string> keyinput, vector<int> board) {
// 좌우상하
int dr[4] = {0,0,1,-1};
int dc[4] = {-1,1,0,0};
enum Dir { left, right, up, down };
int r = 0, c = 0;
int rStart = -board[1] / 2;
int rEnd = board[1] / 2;
... | ALGO | 0.999861 | 5.37277 | {
"github_metadata": {
"branch": "main",
"commit_count": 1235,
"repo_created_at": "2022-03-15T14:18:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "860800910... |
4624db4a-4ee3-48b5-b90f-1f93760d7951 | a-n-t-h-o-n-y/advent-of-code | 2020/cpp20/day_07/common.hpp | #ifndef DAY_07_COMMON_HPP
#define DAY_07_COMMON_HPP
#include <algorithm>
#include <charconv>
#include <fstream>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <ranges>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
using Color = std::string;
/// Numbe... | ALGO | 0.955968 | 5.76133 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2020-12-06T00:41: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": "9a1611c306c... |
cea90e4a-a89a-4c98-a0a7-1a7e1dc19d6e | wzmw-zr/Code-Archive | 2021/12/6/1.LeetCode2093.cpp | /*************************************************************************
> File Name: 1.LeetCode2093.cpp
> Author:
> Mail:
> Created Time: 2021年12月06日 星期一 10时23分55秒
************************************************************************/
#include <iostream>
#include <string>
#include <vector>
#include <queue... | ALGO | 0.999994 | 4.983545 | {
"github_metadata": {
"branch": "master",
"commit_count": 1859,
"repo_created_at": "2019-11-28T12:33: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": "83622b9... |
169ce214-b9c1-4b13-ab0a-427739348769 | MuhGhifari/ProgramNilaiMahasiswa | main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <string>
using namespace std;
// define fungsi2 validasi
bool validateNPM(string str);
bool validateNilai(string str);
string shorten(string str, int maxLen);
// struktur data mahasiswa
struct... | TOOL | 0.941819 | 4.774873 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-30T14:45: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": "16262a828b71... |
5b5779a3-4be2-4bbf-895c-210cdff69c46 | son-of-mountain/problem-solving | codeforces/icpc_mansoura/.history/session3/S - Min Cost String_20240810150356.cpp | #include<bits/stdc++.h>
using namespace std;
#define sonic ios_base::sync_with_stdio(false) ; cin.tie(NULL) ; cout.tie(NULL);
int main(){
sonic ;
string s ;
cin >> s ;
int cost[26];
for(int i=0; i<26; i++) cin >> cost[i];
// approach
// 1. for each character, if it is '?', calculat... | ALGO | 0.999985 | 3.404762 | {
"github_metadata": {
"branch": "main",
"commit_count": 132,
"repo_created_at": "2024-06-25T12:20:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0009663bdd... |
beda7a34-0acd-48c0-8421-ef4d53671ded | Martin20150405/SLAM_AR_Android | app/src/main/cpp/Matrix.cpp | //
// Created by Ads on 2017/3/5.
//
#include "Matrix.h"
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <include/Common.h>
const float PI= (const float) acos(-1);
#define I(_i, _j) ((_j)+ 4*(_i))
float sTemp[16];
void multiplyMM(float* r, const float* lhs, const float* rhs) {
... | ALGO | 0.997371 | 4.493416 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-06-10T06:12:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 130,
"forks": 55,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "682d8e0... |
2ce601f0-8880-41ec-91cd-76dcf5a1a884 | Ibujah/skeletonbasedreconstruction | src/lib/mathtools/application/Bspline.h | /*
Copyright (c) 2016 <NAME>
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 restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicen... | ALGO | 0.998866 | 6.34594 | {
"github_metadata": {
"branch": "master",
"commit_count": 524,
"repo_created_at": "2016-01-17T11:14:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f48e989e... |
327442f8-8c7a-49a2-92b6-286d18d0fe98 | AMIRIOX/MyLuoguRepo | luogu/P2910.cpp | #include <iostream>
#include <vector>
#define re register
using namespace std;
const int maxn = 10010;
// struct edge {
// int to;
// int dis;
// edge(int t = 0, int d = 0) : to(t), dis(d) {}
// };
int gr[maxn][maxn];
int ways[maxn];
const int inf = 0x7fffffff;
int ans;
int main() {
int n, m;
cin ... | ALGO | 0.999985 | 3.547966 | {
"github_metadata": {
"branch": "master",
"commit_count": 458,
"repo_created_at": "2020-07-11T06:47:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a19daeaf... |
7332d1ce-edde-4b14-80d5-dcea09245985 | xytpai/pmkl | pmkl/sorting/key_traits.h | #pragma once
#include "sorting_common.h"
namespace pmkl {
namespace sorting {
struct NullType {
using value_type = NullType;
template <typename T>
HOST_DEVICE_INLINE NullType &operator=(const T &) {
return *this;
}
HOST_DEVICE_INLINE bool operator==(const NullType &) {
return true... | TOOL | 0.916055 | 5.14958 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2022-08-13T04:48:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab494b768... |
f80fe048-b251-4507-ab29-b103b60ba562 | AnukaMithara/Competitive-Programming | Mora Xtreme 8.0/CPP/rat.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <stack>
using namespace std;
bool dfs(vector<vector<int>>& matrix, int x, int W, int H) {
if (x < 0 || x >= W) {
return false;
}
if (x == W - 1) {
return true;
}
if (matrix[x][0] != 1) {
return false;
}
... | ALGO | 0.999506 | 5.338999 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-10-01T15:36: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": "6383c3f7f4b... |
ffeb8997-ecb1-4f0f-96bf-56778135442c | SeppahBaws/AdventOfCode | 2022/AdventOfCode/src/Puzzles/Day03/Day3.cpp | #include "pch.h"
#include "Day3.h"
#include <unordered_map>
#include <fmt/core.h>
#include "Common/FileUtils.h"
#include "Common/Timer.h"
namespace Day3
{
u32 GetPriority(char c)
{
if (c >= 'a' && c <= 'z')
{
return 1 + c - 'a';
}
if (c >= 'A' && c <= 'Z')
{
return 27 + (c - 'A');
}
return 0;
... | ALGO | 0.995513 | 5.486143 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-12-01T12:30: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": "a4b8b2d4599f... |
77649171-d7c8-433e-b7e2-0f906c449934 | gdleonberg/Programming-Methodology-II | Project1/src/BankSim.h | // <NAME>
// BankSim.h: conducts the simulation backend for the banking project
// arrRate is the number of customers that arrive in each batch
// arrFreq is how far apart in time units each batch arrives
// arrDur is how many time units customers arrive for
// processTimes is an array containing the processing times... | ALGO | 0.982895 | 4.786191 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2016-11-03T20:31: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": "6db62d7bf... |
846f383f-676b-40c4-8e26-87ac795754e4 | bebeis/Algorithm_BaekJoon | 2775/2775/2775.cpp | //completion code
#include <iostream>
using namespace std;
int main(void) {
int T;
cin >> T;
while (T--) {
int k, n;
cin >> k >> n;
int array[k + 1][n + 1] = { 0, };
for (int i = 0; i < n + 1; i++) {
array[0][i] = i;
}
for (int i = 1; i < k + 1; i+... | ALGO | 0.99995 | 3.834325 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2021-06-18T18:40: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": "3e0be0ec153... |
dc2d9e77-e669-43be-a050-49a61b25120f | franky90237/LeetCode | Medium_1201. Ugly Number III.cpp | //2022-04-19
//TLE
//time : O(k), k is the nthUglyNumber
//space : O(1)
class Solution {
public:
int nthUglyNumber(int n, int a, int b, int c)
{
vector<int> divisor({a,b,c});
sort(divisor.begin(),divisor.end());
int size=1;
for(int i=1; i<3; ++i)
{
... | ALGO | 0.999963 | 5.336171 | {
"github_metadata": {
"branch": "main",
"commit_count": 1265,
"repo_created_at": "2021-11-09T02:29: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": "7583b4b26... |
2f7acdd3-2ab3-494e-8dae-7a29be3e705f | Sushreesatarupa/DSA-cpp | 06. Searching/First and last occurrences of x.cpp | /*
Given a sorted array arr containing n elements with possibly duplicate elements, the task is to find indexes of first and last occurrences of an element x in the given array.
Example 1:
Input:
n=9, x=5
arr[] = { 1, 3, 5, 5, 5, 5, 67, 123, 125 }
Output: 2 5
Explanation: First occurrence of 5 is at index 2 and last... | ALGO | 0.999836 | 5.852952 | {
"github_metadata": {
"branch": "main",
"commit_count": 870,
"repo_created_at": "2021-07-09T19:41:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 276,
"forks": 330,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "19d7f9... |
cef65381-506f-4bb9-a99c-6584f734ddef | maxmaxjian/superUglyNumber | main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
// class solution {
// public:
// int nthSuperUglyNumber(int n, const std::vector<int> & primes) {
// std::vector<int> super{1};
// super = grow(n, primes, super);
// return super[n-1];
// }
// private:
... | ALGO | 0.999943 | 5.931846 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-12-15T17:56: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": "c052c81f78... |
b22b5cc9-0151-484d-92f7-83a4ca1a09ae | Jxt1/IVE | reordering.h | #pragma once
#include "graph.h"
#include <vector>
void MDE(const Graph *data_graph, const Graph *query_graph, ui *&order, ui *candidates_count) {
bool is_isolated[260];
int query_vertex_number = query_graph->getVerticesCount();
order = new ui[query_vertex_number*2];
bool used[260];
bool extendable[... | ALGO | 0.999253 | 3.359249 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-03-14T06:52:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8154d81412... |
fbfa9c43-3648-4f0e-b57e-bc740b112546 | Adityadamen/DSA-AND-ALGORITHM | Arrays/Kth Max&Min.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <climits>
using namespace std;
int main()
{
int n, k;
cout << "enter size of array: " << endl;
cin >> n;
cout << "enter the elements of array: " << endl;
int a[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
sort(a, a ... | ALGO | 0.999937 | 4.449955 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2021-04-22T08:42:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fbc96d756... |
67a5ff4c-001a-40b9-bb5f-a395ad03600c | ferdouszihad/CPP-PRO-CODE | previous/m-8/reverseSection.cpp | #include <bits/stdc++.h>
using namespace std;
class Student
{
public:
string name;
int roll;
char sec;
int mark;
};
int main()
{
int n;
cin >> n;
Student a[n];
for (int i = 0; i < n; i++)
{
cin >> a[i].name;
cin >> a[i].roll;
cin >> a[i].sec;
cin >> a... | ALGO | 0.999578 | 3.626823 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-10-02T10:07: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": "c3f0ca630ee... |
8f664166-8c72-433c-a177-d7a032cf26b2 | chezbananas/codeforces | set_a/winner.cpp | using namespace std;
#include <iostream>
int main () {
string s, t;
cin >> s >> t;
char sRow = s[1];
char sCol = s[0];
char tRow = t[1];
char tCol = t[0];
int rowDistance = abs(sRow - tRow);
int colDistance = abs(sCol - tCol);
cout << max(rowDistance, colDistance) << endl;
whi... | ALGO | 0.999977 | 4.235444 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-07-26T04:19: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": "308b476fc5a... |
b38f3fca-2fbf-46d3-b0ea-21b843ec0092 | mahir-hs/Programming-Contest | CodeForces/2A - Winner.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace __gnu_cxx;
using namespace std;
#define FIO \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | ALGO | 0.999992 | 3.64595 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-08-02T09:15: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": "481a763f053... |
44b326d6-afd2-48b1-a5e2-c93c0af8c0bf | chinoxyz/Spoj | DIG.cpp | #include <cstdio>
#include <algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include <complex>
#include <iostream>
#include <valarray>
#include<cstring>
#include<queue>
#include<bitset>
#include<map>
#include<set>
#include<sstream>
#include<ctime>
#include <stack>
#include <iomanip>
using namespace s... | ALGO | 0.999853 | 3.904186 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2015-02-07T15:39:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6907ad535... |
740a2c6f-90ae-46d1-af8d-97bd450922de | rivercut404/LG_CT_Group | .history/BFS/BOJ_2468_20230816094709.cpp | #include "bits/stdc++.h"
#include <utility>
using namespace std;
#define X first
#define Y second
/***
Implementation Procedure
- find min and max height in map
- function that search # of regions by using BFS for some rain height
- iterate the function for rain height min to max
***/
int N;
int board[101][101];
... | ALGO | 0.999559 | 4.635244 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-07-13T12:48: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": "476b411ca77... |
ec0ec5ac-23d8-4627-82da-0da279274697 | ahampriyanshu/algo-ds-101 | Data-Structures/Tree/Binary-Tree/Serialize/Serialize.cpp | #include <stdio.h>
#define MARKER -1
struct Node
{
int key;
struct Node* left, *right;
};
Node* newNode(int key)
{
Node* temp = new Node;
temp->key = key;
temp->left = temp->right = NULL;
return (temp);
}
void serialize(Node *root, FILE *fp)
{
if (root == NULL)
{
... | ALGO | 0.997505 | 4.153837 | {
"github_metadata": {
"branch": "main",
"commit_count": 3367,
"repo_created_at": "2020-07-10T11:12:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 159,
"forks": 739,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d7a0... |
5c9f0645-0858-4d85-9baa-a349e6aa56b8 | stefdasca/CompetitiveProgramming | Codeforces/Gym/CF100283-gym-C.cpp | /*
CF 100283-gym-C
* Notice that we have to optimize the obvious O(n^2 * m * s) solution by reducing it by one of n factors.
* We can observe that each time we're doing an update, we're updating a square of size (t-1) * (t-1) except some corner triangles.
* Therefore, we can keep data of values whi... | ALGO | 0.999104 | 4.929729 | {
"github_metadata": {
"branch": "master",
"commit_count": 917,
"repo_created_at": "2018-09-28T18:19:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f078af... |
b418ff65-26d1-44b0-8f6c-0839eeb5ee42 | nkyos/Library | String/SA_IS.cpp | #include <bits/stdc++.h>
class SA_IS {
private:
std::string str;
std::vector<int> sa;
bool built = false;
static inline bool is_lms(const std::vector<int>& is_l, size_t idx) {
return idx > 0 && is_l[idx-1] && !is_l[idx];
}
void create_bin(const std::vector<int>& v, std::vector<int>& bin) {
std::... | ALGO | 0.999955 | 5.164675 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2018-02-27T15:30:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa7aef7d... |
8aeb51e0-971f-47ba-81eb-b9a240268a93 | BenjaminSchlaich/ProjectEuler | Problem102/problem102.cpp |
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include "triangle.hpp"
using namespace std;
Triangle parseString(const std::string& input)
{
std::stringstream ss(input);
std::vector<int> values;
std::string token;
while (std::getline(ss, token, ',')) {
value... | ALGO | 0.987813 | 5.019109 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2022-02-27T22:36: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": "70f54759f... |
da70891e-06b7-4283-ac68-5fc4a4c9c639 | AkshayBangarAB/DSA_CPP | Searching_Algorithms/Division_BS.cpp | //Write a Binary search program to perform division operation
// Write a program to perform division using binary search
#include <iostream>
#include <vector>
using namespace std;
int solve(int dividend, int divisor){
int s=0;
int e= abs(dividend);
int mid = s+ (e-s)/2;
int ans =-1;
while(s<=e){
... | ALGO | 0.999861 | 4.60041 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-02-01T08:58: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": "8fda4d99c4a... |
03a3553e-b6cf-4c79-9393-d0becdc5de3a | rijuyuezhu/XCPC-code | OI-time_Problems/图论与树/图论与树pre/POJ2942 Knights of the Round Table/main.cpp | //http://poj.org/problem?id=2942
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
ll read() {
ll x = 0, f = 1; char ch = getchar();
for(; ch < '0' || ch > '9'; ch = getchar()) if(ch == '-') f = -1;
for(; ch >= '0' && ch <= '9'; c... | ALGO | 0.999881 | 3.545954 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2023-03-05T03:20: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": "f5e983e6b... |
1cdd2c3e-f97c-4ee1-9cb1-b2af8f1eccb6 | luisa-maria1111/Hacker_Blocks_CPP | count_digits_decimal.cpp | /*
HACKER BLOCKS : COUNT DIGITS (accepts decimal numbers)
@author: <NAME>
*/
#include <iostream>
#include <string>
using namespace std;
int countDigit(const string &num, const string &digit)
{
int count = 0, remainder;
string testingDigit;
for(int i = 0; i <= num.length(); i++)
{
tes... | ALGO | 0.999381 | 4.170023 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-06-30T22:05:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9494530150... |
2f0713c6-8f50-42c6-b1f0-ff1ea0f862d1 | AplusB/ACEveryDay | Kirai/16_06_11_HIHO_1121.cpp | /*
━━━━━┒ギリギリ♂ eye!
┓┏┓┏┓┃キリキリ♂ mind!
┛┗┛┗┛┃\○/
┓┏┓┏┓┃ /
┛┗┛┗┛┃ノ)
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┃┃┃┃┃┃
┻┻┻┻┻┻
*/
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <climits>
#include <complex>
#include <fstream>
#include <cassert>
#include <cstdio>
#include <bitse... | ALGO | 0.998668 | 3.343644 | {
"github_metadata": {
"branch": "master",
"commit_count": 3924,
"repo_created_at": "2016-05-15T06:08:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 19,
"forks": 21,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "9f30a8... |
56f00820-4876-4b96-a0cc-7bdff088c4fd | huy0hoang/VuHuyHoang_monC | Chapter 3/Challenges/3.3.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
double score1, score2, score3, score4, score5;
// Get input from the user
cout << "Enter the first test score: ";
cin >> score1;
cout << "Enter the second test score: ";
cin >> score2;
cout << "Enter the third test sc... | ALGO | 0.970845 | 6.283658 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-11-25T07:53: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": "a75bcb9dc373... |
fce904ff-286a-4372-af76-0c77f67c711b | xlgames-inc/XLE | Foreign/cml-1_0_2/cml/mathlib/vector_ortho.h | /* -*- C++ -*- ------------------------------------------------------------
Copyright (c) 2007 <NAME> and <NAME> http://cmldev.net/
The Configurable Math Library (CML) is distributed under the terms of the
Boost Software License, v1.0 (see cml/LICENSE for details).
*------------------------------------------------... | ALGO | 0.998539 | 7.230534 | {
"github_metadata": {
"branch": "master",
"commit_count": 6572,
"repo_created_at": "2015-01-15T05:07:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 339,
"forks": 73,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "32a45... |
06a12a49-ec52-438e-860a-8beccdd68c4a | Symbolk/ACFan | @ACM/Schedule(E).cpp | #include <iostream>
#include <math.h>
#include <cstdlib>
using namespace std;
void Table(int k, int n, int **a);
int main()
{
int k;
cin >> k;
int n = 1;
for (int i = 1; i <= k; i++)
n *= 2;
int **a = (int **)malloc(sizeof(int *) * (n+1));
for(int i=0; i<=n; i++){
a[i] = (int *)malloc(sizeof(i... | ALGO | 0.999899 | 3.273581 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-01-03T12:12: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": "5791b65a3e... |
4347ae24-cfd3-4021-ad2f-78eaf055380f | Jacob-Barhak/BIM | simplemesh.h | #pragma once
#include "bmesh.h"
#include "flagged.h"
#include "xvec.h"
#include "xvecdim.h"
#include "geom.h"
class SimpleEdgeT;
class SimpleVertexT;
class SimpleFaceT;
class SimpleMeshT : public bm::MeshT<SimpleFaceT, SimpleEdgeT, SimpleVertexT> {
public:
SimpleMeshT() {}
~SimpleMeshT() {
}
void InitBBox... | TOOL | 0.927073 | 5.760889 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-08-09T09:19:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ab12b19a... |
7c07eae5-c31c-40a6-83c3-d4dd8df67926 | ROCm/hipCOMP-core | src/BitPackGPU.h | /*
* Copyright (c) 2020, NVIDIA CORPORATION. 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
* notice, this list of co... | ALGO | 0.98409 | 7.544184 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-02T15:09:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "236324cb6e692... |
62301b8d-7551-48ec-b471-424319712d81 | kmyobin/data_structure | heap_sort.cpp | #include <iostream>
#include <ctime>
using namespace std;
void max_heapify(int a[], int h, int m) { // 배열 / root / 크기
// parent node가 child node보다 커야 하는 maxheap
// 결론적으로 내림차순으로 정렬됨
int v = a[h]; // 일단 keep
int j = 0;
for (j = 2 * h; j <= m; j *= 2) {
if (j < m && a[j] < a[j + 1]) {
j = j + 1;
}
// j는 값이... | ALGO | 0.999234 | 4.087182 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2021-09-12T06:14: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": "ca4208970ed... |
7d1ea69a-8ae1-4a21-bacc-dfbbb2efa5a3 | dendibakh/Algorithm-Tasks | Coursera class/Coursera Assignments/BurrowsWheeler/src/BurrowsWheelerLib/BurrowsWheelerTransform.cpp | #include "BurrowsWheelerTransform.h"
#include <algorithm>
BurrowsWheelerTransform::BurrowsWheelerTransform(const std::string& str) : suffixArray(str) , originalStringRow(0) , transformedStr(str.size(), 0)
{
size_t N = suffixArray.getSet().size();
for (size_t i = 0; i < N; ++i)
{
if (suffixArray.ge... | ALGO | 0.96549 | 4.590752 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2015-06-21T13:05:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "761bafea0... |
7372618c-1801-48fd-92db-bea6abce51b6 | akgarhwal/LeetCode-Solutions | Solutions/C++/Accepted/102-binary-tree-level-order-traversal.cpp | /*
Problem Title: 102 - Binary Tree Level Order Traversal
Lang: C++
Runtime: 13 ms
Memory: 13.6 MB
Problem Url: https://leetcode.com/problems/binary-tree-level-order-traversal
Submission Url: https://leetcode.com/problems/binary-tree-level-order-traversal/submissions/767556144
*/
/**
* Definition for a binary tree no... | ALGO | 0.999996 | 6.191661 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2022-12-31T10:19: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": "57ca8e1835... |
29573d26-860b-4eba-9dc3-bd44a47d6e7e | dipu1207/speech-yes-no-detection | speech/speech.cpp | // speech.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<math.h>
int _tmain(int argc, _TCHAR* argv[]){
char inputFile[50]="yes3.txt";
//part 1
// first we will find the max positive and max negative value of... | TOOL | 0.929445 | 3.038789 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-09-12T07:09: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": "b7453580bee7... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.