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 |
|---|---|---|---|---|---|---|---|
edc6e7b0-81b8-4aab-9b3c-3d6df94fbd89 | Ibn-Omar-Romel/Competitive_Programming_Codeforces | C_Less_or_Equal.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.999914 | 3.441261 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2025-06-02T10:07: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": "18c6c26aceb... |
eb668bf3-7633-47c0-8663-6bfee9281a2b | varshap17/DSA | Linked List/partition a linked list around a given value.cpp | // Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
/* Link list node */
struct Node* partition(struct Node* head, int x);
struct Node {
int data;
struct Node* next;
Node(int x) {
data = x;
next = NULL;
}
};
/* Function to print linked list */
void printList(str... | ALGO | 0.999888 | 5.501343 | {
"github_metadata": {
"branch": "main",
"commit_count": 550,
"repo_created_at": "2021-10-28T18:10:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3ae7e26a8... |
37e98a60-0a71-4174-8297-5380f5d758a5 | milkmull/Vertex | vertex/include/vertex/math/core/functions/geometric.hpp | #pragma once
#include "vertex/math/core/functions/common.hpp"
#include "vertex/math/core/functions/comparison.hpp"
#include "vertex/math/core/functions/exponential.hpp"
#include "vertex/math/core/functions/trigonometric.hpp"
namespace vx {
namespace math {
////////////////////////////////////////////////////////////... | TOOL | 0.9607 | 7.447009 | {
"github_metadata": {
"branch": "main",
"commit_count": 700,
"repo_created_at": "2024-01-07T00:28:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3b0ff8567... |
dc047abc-5731-4be0-85dc-2fa957b7f6ec | ishandutta2007/codeforces-d | deemo/normal/1468/M.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef long double ld;
#define F first
#define S second
const int MOD = 1e9 + 7;//XXX
const int C = 26;//XXX
void add(int &x, int y){
x += y;
while (x >= MOD) x -= MOD;
while (x < 0) x += MOD;
}
int fix(int x){
whi... | ALGO | 0.999533 | 3.315276 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31: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": "ee473ac05ffb... |
d7ba53d7-60c2-405a-b826-64ca59642108 | skytower144/CodingTestStudy | 백준/Silver/11728. 배열 합치기/배열 합치기.cc | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int n, m;
cin >> n >> m;
vector<int> A(n, 0);
vector<int> B(m, 0);
for (int i = 0; i < n; i++)
cin >> A[i];
for (int i = 0; i < m; i++)
... | ALGO | 0.999993 | 3.481234 | {
"github_metadata": {
"branch": "main",
"commit_count": 613,
"repo_created_at": "2023-11-13T17:28: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": "2912c76252... |
6812c1a3-76c8-41e8-9e7a-81beea434709 | cai-lw/cs-97si-solutions | assn10/2774.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
struct LEntry {
int p1, p2, idx;
bool operator<(LEntry &other) {
return p1 < other.p1 || (p1 == other.p1 && p2 < other.p2);
}
};
int p[30][200011], sa[200011], step, n;
LEntry l[200011];
string s;
vo... | ALGO | 0.999891 | 4.404737 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2018-03-11T14:24:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "38dceef3... |
49a04f10-6c96-4369-8a1f-6194239aafe0 | benny5555/leetcode-problems | templates/diff.h | #include <bits/stdc++.h>
using namespace std;
struct Diff2d {
vector<vector<int>> diff;
void set(int m, int n, vector<vector<int>>& arr) {
for (auto& a : arr) {
int x1 = a[0], y1 = a[1], x2 = a[2], y2 = a[3];
++diff[x1][y1];
if (x2 + 1 < m && y2 + 1 < n) ++diff[x2 + 1][y2 + 1];
if (x2 + ... | ALGO | 0.999607 | 4.485029 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2022-02-27T17:51: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": "6d473f2ab9a... |
58272a05-b86d-4f9d-bc97-3622081b0d42 | 1337Impact/42-matrix | ex02/main.cpp | #include "fma.hpp"
template <typename T> void print_vector(std::vector<T> v) {
for (unsigned long i = 0; i < v.size(); i++) {
std::cout << v[i] << " - ";
}
std::cout << std::endl;
}
void test_lerp_float() {
assert(lerp(0.0f, 1.0f, 0.0f) == 0.0f);
assert(lerp(0.0f, 1.0f, 1.0f) == 1.0f);
assert(lerp(2.0... | TEST | 0.951875 | 6.09276 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-09-25T13:10: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": "a246eab61f2d... |
70801098-ab73-4781-8b7b-c80337c02e85 | anagorko/algorytmika | home/jannec/maxcounter.cpp |
vector<int> solution(int N, vector<int> &A) {
vector<int> b(N); // b from board
int cou = 0; // cou from counter. I will use it to remember current value.
int max = 0; // max is used to remember the highest value.
int len = A.size(); // len stands from lenght
for(int var = 0; var < N; var++){ ... | ALGO | 0.999927 | 4.590973 | {
"github_metadata": {
"branch": "master",
"commit_count": 185,
"repo_created_at": "2014-08-29T11:24:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "314dec12... |
9bf2f153-a5cd-4c72-a694-66889b66de74 | pamellaccar/gromacs_with_packmol | install/gromacs-2022.1/src/gromacs/fft/gpu_3dfft.cpp | /*
* This file is part of the GROMACS molecular simulation package.
*
* Copyright 2021- The GROMACS Authors
* and the project initiators <NAME>, <NAME> and <NAME>.
* Consult the AUTHORS/COPYING files and https://www.gromacs.org for details.
*
* GROMACS is free software; you can redistribute it and/or
* modify i... | ALGO | 0.93808 | 7.008157 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-07-29T20:06:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6a6021b7fe... |
81323a66-92d8-4220-bff2-207596a429c3 | ishandutta2007/codeforces-s | sooke/normal/932/F.cpp | #include <cctype>
#include <cstdio>
#include <cstring>
#include <algorithm>
inline int read() {
char c, _c; int x; for (c = _c = getchar(); !isdigit(c); c = getchar()) { _c = c; }
for (x = 0; isdigit(c); c = getchar()) { x = x * 10 + c - '0'; } return _c == '-' ? -x : x;
}
const int N = 1e5 + 5, E = 2e5 + 5, ... | ALGO | 0.999807 | 3.918012 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67c1aab021a4... |
74ddee4a-5e76-4125-bb3b-5af0be977134 | henryxian/misc | test/christmas_tree.cpp | #include <stdio.h>
#include <stdlib.h>
// 链接的时候会报打不开gdi32.lib的错误,每次都要手动在属性中移除才能成功运行。
int main(int argc, char* argv[]) {
//int a;
//scanf_s("%d", &a);
//printf("hello %d", a);
//getchar();
//return 0;
int n = argc > 1 ? atoi(argv[1]) : 4;
for (int j = 1; j <= n; j++) {
int s = 1 << j, k = (1 << n) - s, x;
fo... | ALGO | 0.998257 | 3.634651 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-07-13T17:18: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": "5fdbeba761... |
d12a5e79-0ec5-4bae-8b3f-ff5cde955510 | wldn143/ProblemSolving | 백준/비트마스킹/boj13244.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
using namespace std;
int t, n, m, a, b, cnt, c[1001][1001], visited[1001]; //메모리초과 시 배열 벡터로
void dfs(int node)
{
visited[node] = 1;
for (int i = 1; i <= n; i++)
{
if (c[node][i] && !visited[i])
dfs(i);
}
}
i... | ALGO | 0.999986 | 3.996977 | {
"github_metadata": {
"branch": "main",
"commit_count": 256,
"repo_created_at": "2022-02-08T13:56: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": "92207e0054... |
f5ab55ee-7271-402c-8249-200b4aaad293 | samar-gupta/DSA_POTD | Leetcode/Shortest Palindrome.cpp | //Company Tags : GOOGLE
//Leetcode Link : https://leetcode.com/problems/shortest-palindrome
//Approach (Using simple substring check for Prefix and Suffix)
//T.C : O(n^2)
//S.C : O(n)
class Solution {
public:
string shortestPalindrome(string s) {
string rev = s;
reverse(begin(rev), end(rev));
... | ALGO | 0.999983 | 6.722734 | {
"github_metadata": {
"branch": "main",
"commit_count": 1308,
"repo_created_at": "2023-09-28T21:09: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": "fea370ae5... |
fc32e676-e363-41b8-9e34-9ed360ae47d2 | mink97/Algorithm | 0x12-수학/쉽게_푸는_문제.cpp | #include <bits/stdc++.h>
using namespace std;
int A, B;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> A >> B;
int i = 1;
int num = 1;
int ans = 0;
while (i < A) {
i += num;
num++;
}
if (i - 1 < B) {
ans += (i - A) * (num - 1);
while ... | ALGO | 0.999904 | 4.0864 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2022-06-11T07:08: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": "2d51900852... |
2b60a63f-efe5-4eb9-af92-a5a3f8182c9a | yuba-lab/miscellanea | ntuj/2943.cpp | #include <stdio.h>
int a[40], rsub[40], rend[40];
int x, m;
int exist(){
int mx, y, z;
mx = x;
if(x < 0) return false;
if(a[x]==0) return true;
if(a[x] == 1){
--x;
y = exist();
rsub[mx] = --x;
z = exist();
rend[mx] = x;
}
return y && z;
}
int fill(int L,int R){
if(L>R) return 0;
... | ALGO | 0.999979 | 4.324775 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2016-05-22T13:54:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cba46d28b9... |
05788fb9-fc60-43e3-9a21-8677fc4c7462 | AsemDevs/CodingJourney | Problem Solving/HackerRank/C++/forLoop.cpp | #include <iostream>
#include <cstdio>
using namespace std;
/*
- two positive integers [a, b]
- a <= b
- if n >= 1 and n <= 9 then print english presentation of the word.
- else if n > 9 and it is even number, print "even"
- else if n > 9 and it is odd number, print "odd"
*/
int main() {
int ... | ALGO | 0.999782 | 4.055308 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-05-25T17: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": "4736f73d44... |
1996dd30-f239-4b63-b5e8-b40f2ccb01d6 | thailin1/Programming-Cpp | KOLOKWIUM/example/zad22.cpp | #include <iostream>
using namespace std;
int suma_cyfr(int n) {
int suma = 0;
while (n > 0) {
int cyfra = n % 10;
suma += cyfra;
n /= 10;
}
return suma;
}
int main() {
int liczba;
cout << "Podaj liczbę naturalną: ";
cin >> liczba;
int wynik = suma_cyfr(liczba);
... | ALGO | 0.998929 | 5.510069 | {
"github_metadata": {
"branch": "main",
"commit_count": 185,
"repo_created_at": "2023-07-26T06:10:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18c6382cb0... |
ecc64c09-d894-4b74-a37d-7572a0b3af8d | tsushiy/competitive-programming-submissions | AOJ/AOJ vol.16/aoj1627.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,b,e) for(int i=(b);i<(e);++i)
#define rep(i,e) for(int i=0;i<(e);++i)
int n, m, ans, match[9][9];
bool check(int y){
int win=0, lose=0;
rep(x, n){
if(match[y][x]==1) win++;
else if(match[y][x]==-1) lose++;
}
return (win<=(n-1)/2 && lose<=(n-1... | ALGO | 0.999974 | 3.873 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2019-03-15T11:29: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": "d8da112dd... |
13d2b489-9776-4010-8eac-b4b1e6e42141 | ChristianPastenC/ADA | DP_Algorithms/main.cpp | #include <iostream>
#include "KnapsackSolver.h"
#include "RodCutter.h"
#include "MatrixChain.h"
using namespace std;
int main() {
cout << "======== KNAPSACK PROBLEM ========" << endl;
KnapsackSolver knapsack(140);
int values[] = {79, 32, 47, 48, 26, 85, 33, 40, 45, 59};
int weights[] = {85, 26, 48, ... | ALGO | 0.992908 | 3.894066 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-07-02T18:33: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": "5b7424419830... |
15aa8f86-e393-4efa-bb6d-89771d4b0044 | ReverseThrottle/Simple_C_PlusPlus | Code Hunter.cpp | /*
<NAME>
Code Hunter
Find errors in the code
Comment on every line and where the errors were located
Errors can be indicated by <----------------------------------------------------
*/
#include <iostream>
#include <string>
using namespace std;
int main()
{
//Declaring variables and init them to zero
string... | ALGO | 0.986507 | 3.454814 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2020-09-22T21:18: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": "dfe497d2c... |
008d77b1-059d-4163-bf05-44c96c2b1f36 | Dharnesh67/decode-cpp | TREES/BINARY TREE/diameterofBinaryTree.cpp | #include<bits/stdc++.h>
using namespace std;
// USING QUEUE
class Node
{
public:
int val;
Node *left;
Node *right;
Node(int val)
{ // CONSTRUCTOR
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
// tree construction using level order searching
Node* construct(... | ALGO | 0.99996 | 5.607566 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-10-23T10:03:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da0c415abb6... |
ff4c846b-4c1f-413e-aeb9-7b75d4dc1506 | jimlinntu/gym | leetcode/379/main-hashset.cc | class PhoneDirectory {
public:
/** Initialize your data structure here
@param maxNumbers - The maximum numbers that can be stored in the phone directory. */
int n;
unordered_set<int> nums; // available nums
PhoneDirectory(int maxNumbers) {
n = maxNumbers;
for(int i = 0; i < n; i+... | ALGO | 0.994356 | 5.653611 | {
"github_metadata": {
"branch": "master",
"commit_count": 591,
"repo_created_at": "2019-10-09T14:58:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "87273cd9... |
b73764f0-4c2f-44d2-acb0-9be35ae23091 | byoushinwokamu/baekjoon | src/16928.cpp | #include <iostream>
#include <queue>
using namespace std;
int dis[101];
int jump[101];
int main() {
cin.tie(NULL);
cout.tie(NULL);
ios::sync_with_stdio(false);
int n, m, x, y;
cin >> n >> m;
n += m;
for (int i = 0; i < n; i++) {
cin >> x >> y;
jump[x] = y;
}
dis[1] = 1;
queue<int> q;
... | ALGO | 0.999889 | 3.350131 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2024-09-22T04:24: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": "68c4a22e506... |
95c4aed6-9c01-457e-ba70-cb4012e396bf | ielevenliu/Algorithm_Dome | MaxGap.cpp | /*
*@Author: lwl
*@Date: 2019-12-16
*@Description: 利用桶排序的思想,计算一个数组排序后,相邻两数的最大差值,要求时间复杂度O(N),空间复杂度O(N)
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <time.h>
using namespace std;
class CGetMaxGap {
private:
int getBucketNum(int val, int min, int max, int len) {
return static_cast<int>((val... | ALGO | 0.999594 | 5.066365 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2019-12-18T13:00:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b16d4354... |
175ab4ca-56cb-42cd-9a66-e116faded3ae | igor4ikc/oop-2.6 | lab 2.6/Source.cpp | #include "Time.h"
#include<iostream>
using namespace std;
int main()
{
Time::Triad t1(1, 2, 3), t2(7, 4, 8);
cin >> t1 >> t2;
cout << t1 << t2;
bool t = t1 > t2;
cout << "t1 > t2 = " << t << endl << endl;
Time a(1, 2, 3), b(4, 6, 2);
cin >> a;
cout << "a " << a;
cout << "++a " << ++a;
cout << "--a " <... | ALGO | 0.980833 | 3.897899 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-03-30T20:58: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": "51801d033b... |
ed80afe9-f965-4649-b019-54acde303852 | mgordenko/c_plus_plus_course | 2023_2024_2nd_sem_rus/16_sem/task04/main.cpp |
// Вам дан словарь, состоящий из пар слов.
// Каждое слово является синонимом к парному ему слову.
// Все слова в словаре различны. Для каждого данного слова
// определите его синоним.
// Для решения данной задачи используйте STL
// Формат ввода
// Программа получает на вход количество пар синонимов N (0 ≤ N ≤ 105)... | ALGO | 0.99989 | 5.188986 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-01-09T20:00:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b528e72fd... |
8ec2cc7c-8b36-4f30-9aee-cc90bcb93582 | cddchen/algorithm | 图论/树上启发式合并/cf600e.cpp | #include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
int n, c[maxn];
vector<int> e[maxn];
int fa[maxn], sz[maxn], son[maxn];
void dfs(int u, int f) {
fa[u] ... | ALGO | 0.999961 | 4.134231 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-12-28T11:10: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": "be8a7bacad... |
ef8b513d-42ec-4e6f-acdd-dcd2da0f51b8 | senku-kz/SPP_Lessons | lesson-23.cpp | #include <stdio.h>
void swap(int *x, int *y){
int temp = *x;
*x = *y;
*y = temp;
}
int main() {
printf("Lesson 23 – Pointers As Parameters\n");
int x = 10;
int *px1 = &x;
int *px2 = px1;
int **ppx = &px2;
printf("x = %i, &x = %p \n", x, &x);
printf("px1 = %p, *px1 = %i, &px1 ... | TOOL | 0.925454 | 4.771919 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-09-06T04:24: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": "2531e62507... |
e0948c22-1074-4757-87f0-a5edc29cabc7 | iamslash/learntocode | algospot/INSERTION/a.cpp | // Copyright (C) 2016 by iamslash
// https://algospot.com/judge/problem/read/INSERTION
#include <cstdio>
#include <cstdlib>
#include <map>
int N;
int shifted[50000];
int A[50000];
/////////////////////////////////////////////////////////////////////////////
// treap
typedef int KeyType;
struct Node {
KeyType key;... | ALGO | 0.999978 | 4.011168 | {
"github_metadata": {
"branch": "master",
"commit_count": 2102,
"repo_created_at": "2020-11-23T21:43:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "633349c... |
fa86733c-e5c3-4267-9fb9-91adf5ec0f87 | ETLCPP/etl | include/etl/covariance.h | ///\file
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2021 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and ass... | ALGO | 0.906525 | 7.280601 | {
"github_metadata": {
"branch": "master",
"commit_count": 5548,
"repo_created_at": "2014-10-16T11:12:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2570,
"forks": 455,
"issues": 39,
"pull_requests": 2
},
"file_meta": {
"content_id": "cd... |
78aa29b6-7396-4ccf-985f-3b6580698de4 | Codewith-Vishal/C-program | Swap_alternate.cpp | #include<iostream>
using namespace std;
// Printing the array
void printing(int arr[] , int size) {
for(int i = 0; i<size; i++) {
cout<<arr[i]<<" ";
} cout<<endl;
}
// Two pointer approach
void swap_alternate(int arr[] , int size) {
int first = 0;
int second = 1;
while(first < size && sec... | ALGO | 0.99995 | 5.453879 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-11-03T09:37: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": "24ec6db821e0... |
ca97e59a-893e-4048-881b-dd097b835d5c | ShreyanshKatiyar007/Leetcode | C++/Ques_11.cpp | // Given an m x n matrix, return all elements of the matrix in spiral order.
class Solution
{
public:
vector<int> spiralOrder(vector<vector<int>> &matrix)
{
vector<int> ans;
int row = matrix.size();
int col = matrix[0].size();
int count = 0;
int total = row * col;
... | ALGO | 0.999997 | 6.566291 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-08-01T17:37:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e7f20191ee... |
bc9ea0df-bc6f-4943-b99e-882ef16aba5d | Saurav15/DSA | DSA/Hard_Cash(CASH).cpp | #include<iostream>
#define Log(x) std::cout << x << std::endl;
int hardCash() {
int T;
Log("Enter number of TC:");
std::cin >> T;
while (T > 0)
{
Log("Enter bags : ");
int noOfBags;
std::cin >> noOfBags;
Log("Enter the divisible number : ");
int divisibleBy;
std::cin >> divisibleBy;
int coinsInNB... | ALGO | 0.999666 | 3.960468 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-06-10T13:01: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": "46fd4ea289... |
8187e0e3-2978-499e-b3ee-a91df2603cc9 | KoJJang/algo_baekjoon_prac | 15653.cpp | //#include <stdio.h>
//#include <algorithm>
//#include <queue>
//using namespace std;
//
//struct balls {
// int depth;
// int rx, ry, bx, by;
//};
//int irx, iry, ibx, iby, hx, hy;
//
//int n, m, ans = -1;
//int map[10][10];
//int dir[4][2] = { {1,0},{0,1},{-1,0},{0,-1} };
//bool visit[10][10][10][10];
//char st... | ALGO | 0.999777 | 3.468668 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-02-19T12:47: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": "e4a5f62be... |
7daa8f0f-7f85-4b55-bd1d-8adca62347ab | NaraaDev/CPP | CSES2216.cpp | #include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define mp make_pair
#define pb push_back
ll gcd(ll a, ll b)
{
if (a == 0)
return b;
if (b == 0)
return a;
if (a == b)
return a;
if (a > b)
return gcd(a - b, b);
return gcd(a, b - a);... | ALGO | 0.999971 | 3.888999 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2024-07-25T22:57:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b96b9611e... |
ee1c354d-217c-45be-a8e4-5952901a4a1f | anas-mejdoub/42-CPP-Modules | CPP-Module-09/ex01/RPN.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* RPN.cpp :+: :+: :+: ... | ALGO | 0.966132 | 4.915385 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-11-22T14:49: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": "23d43bd88b... |
4557580e-4a07-4194-a7a0-76560d02c0a7 | fsps60312/old-C-code | C++ code/Uva Online Judge/Q11139(2).cpp | #include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<map>
using namespace std;
typedef long long LL;
int n;
#define N 125
int gc[N][N],sum1[N][N],sum2[N][N];
LL dp[N][N];
LL fff(int x,int y)//x dots each column, y dots each row
{
//pick: area = dots inside + dots on side / 2 - 1
//dot... | ALGO | 0.999897 | 3.172649 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-06-03T16:13: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": "120cc5ad25... |
aacb5a45-0857-4cb4-91f3-f98b7ee9f1f0 | anico-dev/Data-Structures | Queue/priority queue(using linked list).cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
struct list
{
int priority;
int info;
struct list * next;
};
struct list * front =NULL,*rear=NULL;
void insertqueue(int item,int pr)
{
struct list * ptr,*q;
ptr=new list;
if(front==NULL||ptr->priority<=front->priority)
{
ptr-... | ALGO | 0.999819 | 3.515575 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-07-24T17:36: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": "c8b85fe79... |
28e85efb-f606-4196-abc1-70d690e9ddc4 | Ypsidshi/LR7 | LR7B.cpp | #include <stdio.h>
#include <stdlib.h>
#include <clocale>
#define MAX_VERTICES 100
// Функция для добавления вершины в список смежности
void addEdge(int* adjacencyLists[], int u, int v) {
adjacencyLists[u][v] = 1;
adjacencyLists[v][u] = 1; // Для неориентированного графа
}
// Функция для обхода в глубину
vo... | ALGO | 0.999873 | 5.058713 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-31T13:58: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": "1f86d37c9218... |
da29bb4b-449e-4053-9c05-e041a6585cc3 | towfiq-rakin/DSA-II | Practice_Problems/nine.cpp | /*
Problem 9: Quantum Data Teleportation Network
You are a systems engineer at Q-Net Corp, which manages a futuristic quantum data
teleportation network between research stations spread across a planetary grid. Each station
can process quantum packets using a sequence of matrix transformations. Additionally,
quantum... | ALGO | 0.999979 | 5.106683 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2025-03-12T13:10: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": "3e88dbbc83b... |
4c541220-ef2a-4426-ba5e-86efba0fbfa2 | Amitpatil215/DSA | 4_strive_videos/2_DP _playlist/4_problem_on_0-1_knapsack/23_unbounded_knapsack.cpp | /*
Unbounded Knapsack
venice 22
Problem Statement
You are given ‘N’ items with certain ‘PROFIT’ and ‘WEIGHT’ and a knapsack with
weight capacity ‘W’. You need to fill the knapsack with the items in such a way
that you get the maximum profit. You are allowed to take one item multiple
times. For Example Let us say we h... | ALGO | 0.999995 | 5.366328 | {
"github_metadata": {
"branch": "master",
"commit_count": 295,
"repo_created_at": "2021-04-17T08:02:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca2185d3... |
a99c4df1-a894-4c09-b404-572cb0244c7d | kaetemi/gdemu | knot/knot.cpp | // from http://jlswbs.blogspot.be/
#include "SPI.h"
#include "GD.h"
byte i;
float x = 0.1;
float y = 0;
void setpixel(byte x, byte y, byte color)
{
unsigned int addr = RAM_SPRIMG|(x & 0xf)|(y << 4)|((x & 0x30)<<8);
byte mask = 0xc0 >> ((x >> 5) & 6);
GD.wr(addr, (GD.rd(addr) & ~mask) | (color... | ALGO | 0.958894 | 4.725675 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2016-01-08T09:31:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "411705833... |
e26af3f6-004d-441e-bf13-57bff6085b38 | Dies-Irae/LeetCode-Solutions | 23. Merge k Sorted Lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
int returnMin(vector<ListNode*>& ptrLists){
auto tmp = ptrLists.begin();
auto minPointer = ptrLists.begin()... | ALGO | 0.99992 | 5.963532 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-04-21T11:08: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": "eb5f4bdd52... |
cd71a2c1-4620-4cfc-ab01-e2b892b33954 | 3abqreno/ProblemSolving | C/126-Treasure Hunt.cpp | // _____ _
// |____ | | |
// / / __ _| |__ __ _ _ __ ___ _ __ ___
// \ \/ _` | '_ \ / _` | '__/ _ \ '_ \ / _ \
// .___/ / (_| | |_) | (_| | | | __/ | | | (_) |
// \____/ \__,_|_.__/ \__, |_| \___|_| |_|\___/
// | |
// |_|
#include<iostream>
#incl... | ALGO | 0.999841 | 3.987532 | {
"github_metadata": {
"branch": "main",
"commit_count": 346,
"repo_created_at": "2022-08-05T12:03:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b7e9392d5... |
df39d450-a56c-4cca-8e6d-e48af042ec4c | AliOsm/CompetitiveProgramming | UVA/231 - Testing the CATCHER.cpp | #include <stdio.h>
#include <vector>
#include <memory.h>
#include <algorithm>
using namespace std;
vector<int> arr;
int dp[32768];
int n;
int calc(int i) {
int &res = dp[i];
if(res != -1) return res;
res = 0;
for(int j = i + 1; j < n; j++)
if(arr[j] < arr[i])
res = max(res, c... | ALGO | 0.999614 | 3.611439 | {
"github_metadata": {
"branch": "master",
"commit_count": 595,
"repo_created_at": "2016-10-14T11:29:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 138,
"forks": 49,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21328... |
32677da3-eb61-4bab-90ef-58c7a796607c | vic-lsh/os-scheduler | src/scheduler/scheduler.cc | #include "../utils/schedutil.h"
#include "scheduler.h"
namespace scheduler
{
void set_queue_front_to_running(
std::queue<Process *> &q,
RandNumAccessor &rnum,
int quantum)
{
if (q.size() == 0)
{
return;
}
else
{
if (q.front()->state == TERMINATED)
q.pop();
... | ALGO | 0.999887 | 4.77324 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2019-02-20T23:41: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": "7b5a8dfc... |
a73d3982-12a5-417b-8a9f-96249964c676 | Maheshselukar999/C-plus-plus | Assignment/constructor, destructor, Encapsulation, Abstraction/2.cpp | #include<iostream>
using namespace std;
class Addition // adition class definition
{
public:
float a,b; //data member
Addition() //default constructor
{
cout<<"For Addition"<<endl;
cout<<"Enter the No1=";
cin>>a;
cout<<"Enter the No2=";
cin>>b;
cout<<"Addition of "<<a<<" and "<<b<<" is "<<a+b<... | TOOL | 0.939805 | 3.753982 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-08-17T15:44:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7edd7c87649d... |
bb590856-8749-4bb7-97c9-e31d0d40c5ce | glennlopez/Cpp.Playground | zyBooks/6 - User defined functions/6.10 - Functions with string vector/activity/tryit_replace_space.cpp | /*
Gettng a string from the user using getline and convert
any spaces to -
*/
#include <iostream>
#include <string>
using namespace std;
//loop variables
int i = 0;
/* mod space */
void changeSpace(string& modStr){
//loop through strings
for (i = 0; i < modStr.length(); i++){
//if space found change to -
... | TOOL | 0.953075 | 3.706974 | {
"github_metadata": {
"branch": "master",
"commit_count": 1869,
"repo_created_at": "2015-11-10T16:22:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "dbc6a0... |
ff1459df-9d2d-4ed8-99b6-a5c3a12e4f4e | jav040/myProjects | CSE100/pa2/src/Autocomplete.hpp | /**
* CSE 100 PA2 C++ Autocomplete
*/
#ifndef AUTOCOMPLETE_HPP
#define AUTOCOMPLETE_HPP
#include <vector>
#include <string>
#include "MWT.hpp"
#include <unordered_map>
#include <algorithm>
using namespace std;
/**
* You may implement this class as either a mulit-way trie
* or a ternary search trie.
*
* Y... | ALGO | 0.972071 | 3.956174 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2019-08-06T08:05:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 27
},
"file_meta": {
"content_id": "6edade07... |
011df906-ddb4-4f9a-ae65-e389c4186403 | VenusHui/VenusHui | ACM-ICPC/LeetCode/P150.cpp | // 150. 逆波兰表达式求值
class Solution {
public:
int evalRPN(vector<string> &tokens) {
stack<int> nums;
int size = tokens.size();
for (int i = 0; i < size; i++) {
if (tokens[i][0] >= '0' && tokens[i][0] <= '9' || tokens[i].size() > 1) {
int tmp = stoi(tokens[i]);
nums.push(tmp);
} els... | ALGO | 0.999694 | 5.734687 | {
"github_metadata": {
"branch": "main",
"commit_count": 368,
"repo_created_at": "2021-08-18T02:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4505e65953... |
d99b3ba2-27d5-412f-a9a3-68b90daef65f | duny31030/My_road_of_ACM | 各种OJ/hiho1602-2.cpp | /*
* =========================================================================
*
* Filename: hiho1602-2.cpp
*
* Link: http://hihocoder.com/problemset/problem/1602
*
* Version: 1.0
* Created: 2018/09/03 02时04分05秒
* Revision: none
* Compiler: g++
*
* Aut... | ALGO | 0.999965 | 3.738181 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2018-04-12T04:50: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": "4f7c75cf5... |
b7b4fd79-9845-40f8-8297-64ea2763416b | jitender1222/ineuronPPT-Assignment-DSA- | Arrays/Assignment-4 2DArray/Q3.cpp | #include <iostream>
struct Node
{
int data;
Node *next;
};
int nthNodeFromEnd(Node *head, int n)
{
if (head == nullptr)
return -1;
Node *slowPtr = head;
Node *fastPtr = head;
// Move the fast pointer n positions ahead
for (int i = 0; i < n; i++)
{
if (fastPtr == nullp... | ALGO | 0.999896 | 5.744032 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2023-05-31T11:45: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": "0158c9811d6... |
268ac3ab-948f-4085-98eb-1189690f6c2e | ajtheSQUIRREL/Programming | C++/Numerical Methods/LinearRegression.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cout << "Enter The Number Of Points : ";
cin >> n;
float point[n][2];
for (int i = 0; i < n; i++)
{
cout << "Enter Point " << i + 1 << " : ";
cin >> point[i][0] >> point[i][1];
}
float sumX = 0, sumY = 0,... | ALGO | 0.996786 | 4.206395 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2023-04-10T19:24: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": "324b4e8af... |
f0ba8dbb-ba04-4a7f-a55c-795ab668c134 | eugeneer-code/study-groups-problem | sources/core/SolveTree.h | #ifndef STUDY_GROUPS_PROBLEM_SOLVETREE_H
#define STUDY_GROUPS_PROBLEM_SOLVETREE_H
#include "Matrix.h"
#include <vector>
/**
* Индекс элемента в матрице решений
*/
struct IndexResult {
int row = -1; // строка
int column = -1; // колонка
int cost = 0; // штраф, вычисленный для... | ALGO | 0.999989 | 4.534818 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2024-10-31T14:25:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "727283c8969... |
023f5fe0-24d7-4e39-a583-10a197072f3c | zhanglid/EE500 | ASAM-2D/CauchyASAM.h | #pragma once
#include <vector>
#include <string>
#include "ASAM.h"
class CauchyASAM : public ASAM
{
double denchy;
std::vector<double> xmdchy; /* miscel. parameters */
std::vector<double> ymdchy; /* miscel. parameters */
void Init();
public:
CauchyASAM(const std::vector<double>&, const std::vector<double>&, c... | ALGO | 0.999197 | 4.457906 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-03-21T01:08:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebcbfaa424... |
c3e2d86b-60fe-4c00-b5f6-5646e628cf8c | elkcl/prak-cmc-sem04 | mz01/mz01-6.cpp | #include <iomanip>
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
using ld = long double;
constexpr int PRECISION = 10;
class Point
{
private:
int64_t x, y;
public:
Point(int64_t _x = 0, int64_t _y = 0) : x{_x}, y{_y} {}
int64_t
get_x() const
{
return x;
}... | ALGO | 0.999287 | 5.485316 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-02-21T19:49: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": "664cbc880da... |
7f7deb76-981a-471b-add2-0b848f1ee660 | Nagllort/codingames | puzzle/shadows-of-the-knight-episode-2/solution.cpp | #include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
using namespace std;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
struct Axis{
Axis(int currentPosition, int maxPosition): position_(cu... | ALGO | 0.999858 | 3.654981 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-07-13T11:32: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": "f9ed2b44f... |
252e1f2b-81e1-44aa-b34e-212f86f836bd | arpit-15s/Leetcode | 101-symmetric-tree/101-symmetric-tree.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.999992 | 6.23412 | {
"github_metadata": {
"branch": "main",
"commit_count": 785,
"repo_created_at": "2022-04-25T14:30: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": "c69a4db2f5... |
4e432aef-0669-45d7-a474-3d1dfd6d5b88 | knst/Competitive-programming | codeforces/390/b.cpp | /*****************************************************************************
* codeforces: knst
* topcoder: knstqq
* projecteuler: knstqq
* **************************************************************************/
#include <algorithm>
#include <iostream>
#include <limits>
#include <map>
#include <set>
#i... | ALGO | 0.99974 | 4.539125 | {
"github_metadata": {
"branch": "master",
"commit_count": 200,
"repo_created_at": "2015-03-06T16:13:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5125fbb... |
d4c59da6-1052-4b63-9dfb-79b41d3e87af | SearchTheTruth/LinuxOpenNote | c++/Chapter_14/14_39.cc | #include <iostream>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
class equalLenth {
public:
equalLenth(size_t n) : threshold(n) {};
bool operator()(const string& str) {
return str.size() == threshold;
}
private:
size_t threshold;
};
... | ALGO | 0.997018 | 4.183782 | {
"github_metadata": {
"branch": "master",
"commit_count": 272,
"repo_created_at": "2018-05-24T07:19: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": "0816f7cb... |
74e784a9-49e7-40d9-816d-238932a41a12 | mdarikrayhan/Competitive-Programming | codeforces/1230/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define take(x) for(auto &it :x){cin>>it;}
template<class T, class U> T GCD(T a, U b) { return(!b ? a : GCD(b, a % b)); }
template<class T, class U> T LCM(T a, U b) {... | ALGO | 0.999924 | 3.605783 | {
"github_metadata": {
"branch": "master",
"commit_count": 8052,
"repo_created_at": "2022-05-15T11:22:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "304b6b... |
f3ee487d-27f4-4c41-b3ec-49627ad4f3bb | ishandutta2007/codeforces-s | shnirelman/normal/521/C.cpp | #include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
using li = long long;
using ld = long double;
using pii = pair<int, int>;
const int INF = 1e9 + 13;
const int M = 1e9 + 7;
const int N = 1e5 + 1;
const int A = 26;
/*
*/
int sum(int a, int b) {
int res = a + b;
if(res >= M)
... | ALGO | 0.999961 | 4.259604 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "415cd059580d... |
51ad7cd5-92c0-491c-be74-3a5326ba50e4 | audeering/opensmile | src/include/rnn/rnnVad2.hpp | /*F***************************************************************************
* This file is part of openSMILE.
*
* Copyright (c) audEERING GmbH. All rights reserved.
* See the file COPYING for details on license terms.
***************************************************************************E*/
/* openSMIL... | ALGO | 0.968204 | 7.411869 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-10-15T13:44:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 699,
"forks": 88,
"issues": 33,
"pull_requests": 1
},
"file_meta": {
"content_id": "2960d0... |
b19aecdc-3ad0-4697-a29f-3903e221689e | fudoge/Problem_Solving | 백준/Gold/14949. 외계 미생물/외계 미생물.cc | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int h, w;
const int MOD = 1e9 + 7;
ll fact[401], invFact[401];
ll bpow(ll base, ll exp) {
ll res = 1;
while (exp > 0) {
if (exp % 2) {
res = (res * base) % MOD;
}
exp >>= 1;
base = (base * base) %... | ALGO | 0.999992 | 4.788025 | {
"github_metadata": {
"branch": "main",
"commit_count": 2019,
"repo_created_at": "2023-10-24T07:58: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": "1ee242e78... |
b257a32e-0844-4461-af60-9ad55db50ad0 | ksaveljev/UVa-online-judge | 11342.cpp | #include <iostream>
#include <map>
#include <cmath>
using namespace std;
int main(void) {
int n, k;
bool found;
map<int, bool> squares;
for (int i = 0; i < 224; i++) {
squares.insert(make_pair(i*i, true));
}
cin >> n;
while (n--) {
cin >> k;
found = false;
for (int i = 0; i < 224; i++... | ALGO | 0.999791 | 3.46072 | {
"github_metadata": {
"branch": "master",
"commit_count": 788,
"repo_created_at": "2011-04-04T11:43:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 106,
"forks": 69,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "cb93c... |
b65de7ca-6717-41f2-85b7-4f1292723ba1 | joon0723/Ds- | 2021202054_DS_project3/Source code/MatrixGraph.cpp | #include "MatrixGraph.h"
MatrixGraph::MatrixGraph(bool type, int size) : Graph(type, size)
{
m_Mat = new int*[size];
for(int i=0; i<size; i++)
{
m_Mat[i] = new int[size];
memset(m_Mat[i], 0, sizeof(int)*size);
}
}
MatrixGraph::~MatrixGraph()
{
for(int i=0; i<getSize(); i++)
{
delete[] m_Mat[i];
}
delete... | ALGO | 0.923099 | 3.725555 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2022-11-20T05:29: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": "2297af08369... |
b3316436-bdd0-4e81-a9ac-cb937af93922 | Holmes233666/leetcode_exercise | projects/轮转数组/test.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
// 我的做法
class Solution {
public:
void rotate(vector<int>& nums, int k) {
k = k % nums.size();
vector<int> res(nums.size(), 0);
for (int i = nums.size()-1, rote_num = 0; rote_num < k; i--) {
res[k-rote_... | ALGO | 0.999959 | 5.709345 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2024-07-22T04:28: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": "cf20516497b... |
899cc257-5ea4-44bf-a2ca-bceff7714d7c | guningyi/fitness | ALGORITHM/hash/V1/Lumia.cpp | #include <iostream>
#include <string>
#include "hash.h"
using namespace std;
int main(int argc, char **argv)
{
strElemType r[12]={{17,1},{60,2},{29,3},{38,4},{1,5},{2,6},{3,7},{4,8},{5,9},{6,10},{7,11},{8,12}};
int i, p, j;
KeyType k;
CHashTable H; //create object
for(i = 0; i < 11; i++)
{
... | ALGO | 0.998719 | 3.85481 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2013-05-08T14:16:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16137606c... |
0db47fa3-2072-401e-b5b4-8ee06af9a9a4 | yancouto/competitive-programming | ojs/la/2451.cpp | #include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef pair<int, int> pii;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
template<typename T> inline T ... | ALGO | 0.999887 | 3.817445 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2016-08-26T11:17:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e0a21e2... |
10006684-da16-4a9f-81af-d34e57683edd | sivasai444/cryptography | CSA5154 18.cpp | #include <stdio.h>
#include <math.h>
long long int power(long long int a, long long int b, long long int P) {
if (b == 1) {
return a;
} else {
return (((long long int)pow(a, b)) % P);
}
}
int gcd(int a, int b) {
int t;
while (1) {
t = a % b;
if (t == 0)
... | ALGO | 0.999967 | 4.022818 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-07-23T06:48:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e08786c3436a... |
019c25a6-a599-411c-b842-59c63e94e9e1 | H-Shen/My_Code_Collection | Leetcode/253/253.cpp | class Solution {
public:
int minMeetingRooms(vector<vector<int>>& intervals) {
unordered_map<int,int> unmap;
for (const auto &i : intervals) {
for (const auto &j : i) {
unmap[j] = 0;
}
}
int index = 0;
int length = (int)unmap.size();
... | ALGO | 0.999991 | 6.170815 | {
"github_metadata": {
"branch": "master",
"commit_count": 1586,
"repo_created_at": "2019-04-11T06:48:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1188d41... |
0a1bcafa-cffe-4f23-b614-6847d7e37448 | donaldong/kattis | solutions/thesaurus/thesaurus.cpp | #include <bits/stdc++.h>
using namespace std;
struct node;
using vs = vector<string>;
using vn = vector<node*>;
using hmap = unordered_map<string, node*>;
hmap M;
struct node {
bool visited;
size_t length;
node *p;
node() {}
node(string &str) {
length = str.size();
p = this;
}
};
node* get_nod... | ALGO | 0.999968 | 3.963241 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2017-12-17T06:38:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5a23c5bd3... |
bda3e29e-8d75-4346-bbaa-41bbd4daffb5 | TurquoiseHzy/DS-2 | AVL/dlinklist.h | #ifndef DLINKLIST_H
#define DLINKLIST_H
class DLinkListNode{
public:
int TermID;
int DocID;
int Times;
DLinkListNode *next,*pre;
public:
DLinkListNode(int TID,int DID,int T):
TermID(TID),
DocID(DID),
Times(T),
next(NULL),
pre(NULL)
{
}
};
class DLinkList{
public:
DLinkListNode *head,*tail;
unsigned... | ALGO | 0.957187 | 4.232819 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-12-19T09:29:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5912b77193... |
e56bf2ff-8e5d-46a0-a2ab-b2d1be05792f | WebPlatformForEmbedded/WPEWebKit | Source/WTF/wtf/dragonbox/detail/log.h | /*
* Copyright (C) 2023 Apple Inc. 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 condition... | ALGO | 0.991085 | 7.273324 | {
"github_metadata": {
"branch": "wpe-2.46",
"commit_count": 283204,
"repo_created_at": "2014-12-18T18:08:02.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "WebKit/WebKit-http",
"stars": 227,
"forks": 150,
"issues": 20,
"pull_requests": 9
},
"file_meta": {
... |
a02bca2a-b62c-4b76-89dd-438a69109f6f | YouYue123/MfileReader | MfileReader/MFile.cpp | #include "MFile.h"
using namespace std;
#include<fstream>
#include<iostream>
/********* UI所用到的控件指针*******/
extern GLUI *glui, *glui2;
extern GLUI_Spinner *light0_spinner, *light1_spinner;
extern GLUI_RadioGroup *radio;
extern GLUI_Panel *obj_panel;
extern GLUI_FileBrowser *fb,*ft;
extern GLUI_EditText... | TOOL | 0.901276 | 3.101507 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-09-25T03:49:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbacf0a493... |
78ba9ec8-58b1-4739-8c0b-150400772114 | NiteshShivam/Programming | Trie/3093. Longest Common Suffix Queries.cpp | /*
https://leetcode.com/problems/longest-common-suffix-queries/description/
mik-video:
https://youtu.be/jZX2Z5DKR2M?list=PLpIkg8OmuX-I99uuP2BZOz4mI_lms4gVG
*/
class Solution {
public:
struct trieNode{
int idx;
trieNode *children[26];
};
trieNode* getNode(int i){
trieNode* temp = ne... | ALGO | 0.999963 | 6.379997 | {
"github_metadata": {
"branch": "main",
"commit_count": 540,
"repo_created_at": "2021-01-15T22:49: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": "23342a140b... |
c4e908d0-615e-4489-98db-6919c1bd3daf | ShayanBinMehar/OOP-Lab-02 | lab-2-task-9.cpp | #include <iostream>
using namespace std;
struct Student {
string name;
int rollNumber;
int marks;
};
int main() {
int numStudents;
cout << "Enter the number of students: ";
cin >> numStudents;
Student* students = new Student[numStudents];
for (int i = 0; i < numStudents; ++i) {
... | TOOL | 0.993303 | 5.016074 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-22T10:23: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": "5cb0d845fb1a... |
52be7dee-7d6e-48f7-b540-2bbafdfffa6b | NVIDIA/cutlass | include/cutlass/epilogue/threadblock/epilogue_with_visitor.h | /***************************************************************************************************
* Copyright (c) 2017 - 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are p... | ALGO | 0.977522 | 6.124355 | {
"github_metadata": {
"branch": "main",
"commit_count": 667,
"repo_created_at": "2017-11-30T00:11:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8078,
"forks": 1336,
"issues": 322,
"pull_requests": 54
},
"file_meta": {
"content_id": "82... |
9f4d3d52-8cf7-4b0d-ae82-34c5daf49758 | choreonoid/choreonoid | src/Util/RangeLimiter.h | /*! @file
@author <NAME>
*/
#ifndef CNOID_UTIL_RANGE_LIMITER_H_INCLUDED
#define CNOID_UTIL_RANGE_LIMITER_H_INCLUDED
#include <cmath>
#include <vector>
#include "exportdecl.h"
namespace cnoid {
class RangeLimiter
{
public:
template <class TArray>
bool apply(TArray& valueSeq, double upperLimit, double lower... | ALGO | 0.999098 | 5.954726 | {
"github_metadata": {
"branch": "master",
"commit_count": 6913,
"repo_created_at": "2020-06-25T17:36:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 166,
"forks": 49,
"issues": 7,
"pull_requests": 6
},
"file_meta": {
"content_id": "d9686... |
2d5b4516-76b3-40f4-9a30-d58843a0621f | zouzhua/Directory_Analyzer | temp.cpp | /* 乱码解决办法
* 需要设置编码为GBK,否则中文输出乱码
* 设置GBK编码后,输出正常,但调试时查看变量是还是乱码,不过不影响,程序正确运行
* is_find,is_find_child待解决
* */
#include <iostream>
#include <io.h>
#include <time.h>
#include <cstring>
#include <stdio.h>
using namespace std;
//存储文件夹下的文件的链表
typedef struct File_Node{
struct File_Node *next;
string name;
long ... | TOOL | 0.998379 | 4.072252 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-03-18T02:10:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "13d2fa8af... |
b50e2520-ad71-43e2-9e1b-71160c3fed5b | realAYAYA/UnrealEngine-ToonLit | UnrealEngine/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncCore/Source/ConcertSyncCore/Private/HistoryEdition/HistoryBottomUpAnalysis.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "HistoryEdition/HistoryAnalysis.h"
#include "HistoryEdition/ActivityDependencyEdge.h"
#include "Containers/Queue.h"
#include "HistoryEdition/ActivityDependencyGraph.h"
#include "HistoryEdition/ActivityNode.h"
namespace UE::ConcertSyncCore
{
FHistoryAnalys... | ALGO | 0.996458 | 7.509069 | {
"github_metadata": {
"branch": "5.4",
"commit_count": 164,
"repo_created_at": "2023-03-14T06:10:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 66,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "732b44f6b5... |
5692309a-3b49-4883-8626-1f16dcbc860a | mostafa-saad/MyCompetitiveProgramming | Olympiad/POI/official/2008/code/klo/prog/klob1.cpp | /*************************************************************************
* *
* XV Olimpiada Informatyczna *
* *
* Zadanie: Klock... | ALGO | 0.999989 | 3.24321 | {
"github_metadata": {
"branch": "master",
"commit_count": 439,
"repo_created_at": "2017-02-05T22:26:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 415,
"forks": 85,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "573fe... |
a6e75484-3d25-43dc-abcf-a30adf967c6a | opencv/opencv_contrib | modules/tracking/src/trackerBoosting.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, i... | ALGO | 0.995614 | 4.592139 | {
"github_metadata": {
"branch": "4.x",
"commit_count": 4557,
"repo_created_at": "2013-09-11T13:28:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9757,
"forks": 5828,
"issues": 553,
"pull_requests": 88
},
"file_meta": {
"content_id": "35... |
07998ce8-d294-4827-a98b-9603ee1eec2f | akhilr007/Interview-Bundler | dynamic programming/04-jump-gamp-1D.cpp | class Solution{
public:
// time complexity -> O(k ^ n)
// space complexity -> O(n)
int solveRec(int idx, vector<int>& nums, int n){
if(idx >= n-1) return true;
for(int j=1; j<=nums[idx]; j++){
if(solveRec(idx + j, nums, n) == true) return true;
}
return false;... | ALGO | 0.999963 | 5.400415 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2023-02-28T15:18:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "016decbaffe... |
c9577e1d-2d93-4edd-a10b-78476148a604 | Minipoloalex/comp_prog | usaco/silver/graphs/trees/milkvisits.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g;
vector<char> milk;
vector<int> vis;
void dfs(int u, int cc_id) {
vis[u] = cc_id;
char cu = milk[u];
for (int v: g[u]) {
if (!vis[v] && milk[v] == cu) {
dfs(v, cc_id);
}
}
}
void solve() {
int n, m;
... | ALGO | 0.99998 | 4.612696 | {
"github_metadata": {
"branch": "main",
"commit_count": 529,
"repo_created_at": "2023-08-01T10:35: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": "21f873c7c2... |
c3796e8d-afe0-4dac-80ec-a10c4cb74ae6 | QuMuLab/planner-for-relevant-policies | src/search/pdbs/pattern_generation_haslum.h | #ifndef PDBS_PATTERN_GENERATION_HASLUM_H
#define PDBS_PATTERN_GENERATION_HASLUM_H
#include "../operator_cost.h"
#include "../state_registry.h"
#include <map>
#include <set>
#include <vector>
class Options;
class CanonicalPDBsHeuristic;
class PDBHeuristic;
class State;
// Implementation of the pattern generation algo... | ALGO | 0.999675 | 6.417453 | {
"github_metadata": {
"branch": "master",
"commit_count": 4270,
"repo_created_at": "2020-04-05T00:06:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 33,
"forks": 18,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "3d5d86... |
4b7b24a4-f6d3-4d00-a448-d9d10331f432 | DanielTLouis/LeetCodePractices | LeetCode/LeetCode_0012_IntegerToRoman.cpp | /*
12. Integer to Roman
Solved
Medium
Topics
Companies
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
Symbol Value
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
For example, 2 is written as II in Roman... | ALGO | 0.999586 | 5.317897 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2023-11-20T20:41: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": "935935974b... |
7008cedb-52ae-48d2-bfe1-882aca6acb4d | fundamental/zyn-ui-two | layout.cpp | #include "layout.h"
#include <vector>
#include <cstdio>
#include <cassert>
struct BB
{
bool expandable;
float aspect;
float rel;
};
struct LayoutEngine
{
LayoutEngine(int traits_)
:traits(traits_), expandable_id(-1), unused_space(-1),
x(-1), cy(-1), unit_cost(-1), label_h(-1), cy_label... | TOOL | 0.918663 | 5.67406 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2014-09-20T04:52:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 6,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "23b9d723... |
79e631fb-1372-4b94-b5f7-122ea049b509 | ishandutta2007/codeforces-f | fairywinx/normal/1741/E.cpp | #include <iostream>
#include <vector>
#include <random>
#include <ctime>
#include <algorithm>
#include <set>
#define all(a) a.begin(), a.end()
using namespace std;
void solve() {
int n;
cin >> n;
vector<int> a(n);
for (int &i : a)
cin >> i;
vector<int> dp(n + 1);
dp[n] = 1;
for (i... | ALGO | 0.999402 | 4.474653 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f57c14ebf42c... |
a83396ff-c4d8-4e69-bae4-08a6908da842 | IEIAuto/AutoDRRT | src/autodrrt.core/external/eagleye/eagleye_rt/src/smoothing_node.cpp | // Copyright (c) 2019, Map IV, Inc.
// 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 conditions and... | ALGO | 0.990742 | 6.083149 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-08-11T02:20:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 14,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "7e57603fb... |
423288bd-33fd-42f2-ad48-e04b65169233 | jasonj2333/Python_SPP | informatykaEuropejczyka/Rozdzial2/prog2_26.cpp | //sortowanie szybkie - rekurencja
#include <iostream>
using namespace std;
const int MAX = 100;
void dane (int &n)
{
cout<<"podaj liczbe elementow tablicy: ";
cin>>n;
}
void wczytaj (double T[], int n)
{
cout<<"podaj elementy tablicy:"<<endl;
for (int i=0;i<n;i++)
{
cout<<"T["<<i<<"] = ";
cin>>T[i];
}
}
vo... | ALGO | 0.999931 | 4.830194 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2021-11-04T11:09: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": "2a641cf1140... |
f726f025-ee4d-47b6-886b-1052e68b8b04 | danielgalvis98/Competitive-Programming | Codeforces-647-Div2/A.cc | #include <bits/stdc++.h>
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,end=b;i<end;i++)
#define ALL(s) s.begin(),s.end()
#define SZ(s) int(s.size())
#define pb push_back
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
typedef long long int ll;
typedef vector<i... | ALGO | 0.99985 | 3.799918 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2019-01-29T20:00:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 63,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd47ac30... |
08f3e1af-5729-44c7-82e5-dfa4e7df5997 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1248/Standings5/29141547_63001653.cpp | #include<bits/stdc++.h>
using namespace std;
const long long p = 1e9 + 7;
long long dp[100005][2];
int main(){
ios::sync_with_stdio(false);
int n, m;
memset(dp, 0, sizeof(dp));
cin>>n>>m;
dp[1][1] = 2;
for(int i = 2; i <= n; i++){
dp[i][0] = dp[i - 1][1] % p;
dp[i][1] = (dp[i - 1... | ALGO | 0.99999 | 4.035372 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57bc37421... |
c1056bdf-3d34-4e26-858e-2c27d56183b1 | Rozaq26/KOMGRAF4709 | HW2/MatrixTest.cpp | #include <iostream>
using namespace std;
void tambahMatriks(int matriks1[2][2], int matriks2[2][2], int hasil[2][2]) {
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
hasil[i][j] = matriks1[i][j] + matriks2[i][j];
}
}
}
void kurangMatriks(int matriks1[2][2], int matr... | ALGO | 0.997643 | 5.902875 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2023-09-26T03:31:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d284f11a60e... |
9e511e60-75d2-4857-b5d5-b5cdba765232 | Shahraaz/CP_P_S4 | Topcoder/practice/PlayingCubes.cpp | //Optimise
#include <bits/stdc++.h>
using namespace std;
#define Online 1
// #define multitest 1
#define Debug 1
#ifdef Debug
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__);
template <typename Arg1>
void ZZ(const char *name, Arg1 &&arg1)
{
std::cerr << name << " = " << arg1 << endl;
}
template <typename Arg1, typename... | ALGO | 0.999813 | 4.22251 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2019-05-19T15:13:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c12334592... |
25e2e1d9-4f2c-4a1f-b119-05dc1f19b388 | maryskar/spbspu-labs-2023-aads-904-a | tarasenko.ksenia/common/const_bidirect_iter.h | #ifndef CONST_BIDIRECT_ITER_H
#define CONST_BIDIRECT_ITER_H
#include <iterator>
#include <cassert>
#include "Tree.h"
namespace tarasenko
{
template< typename T, typename Compare >
class BinarySearchTree;
template< typename T, typename Compare >
class RedBlackTree;
template< typename T, typename Compare >
... | ALGO | 0.988838 | 6.295201 | {
"github_metadata": {
"branch": "master",
"commit_count": 5308,
"repo_created_at": "2024-02-09T14:14: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": "667e80d... |
a65eba86-a2aa-46f1-a4c1-e89c95f2927c | Rebellion-167/Hashing-for-DSA | countFrequency.cpp | //Given an array, find the number of occurrences of each element in the array.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;//to store the number of elements
cout << "Enter the number of elements : ";
cin >> n;
int arr[n];//Declaring the array to store the elements
//Takin... | ALGO | 0.999613 | 4.332035 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-18T15:06: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": "4bd2b969a373... |
b650c2a5-06cd-4cdd-b751-affcf31e9a9e | jk-jung/problem-solving | codeforces/Codeforces Round 28x/R288_div2_B.cpp | #include <cstring>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <set>
#include <map>
#include <array>
#include <stack>
#include <queue>
#include <vector>
#include <numeric>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<i... | ALGO | 0.999983 | 3.563058 | {
"github_metadata": {
"branch": "main",
"commit_count": 1582,
"repo_created_at": "2021-06-24T13:40:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aabef0356... |
4b7ac1ac-ea2a-43fa-a124-04c5c686abf1 | xiayuzizhuo666/classwork-project2025.4 | 通讯录系统v2.0.1(2025课设)/addressbook.cpp | #include "addressbook.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
AddressBook::AddressBook() : size(0) {} // 构造函数,初始化联系人数为0
void AddressBook::addContact() { // 添加联系人,检查容量和重复后存入数组
if (size >= MAX_CONTACTS) {
cout << "通讯录已满,无法添加!" << endl;
... | TOOL | 0.912033 | 4.356228 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-03-19T13:59:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "13d2cd320e0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.