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 |
|---|---|---|---|---|---|---|---|
73815ea8-5917-4030-937d-7b6d71b941c4 | MakinoRuki/Codeforces | ER119/1620D.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#define N 200
#define M 10005
#define inf 1000000000
using namespace std;
typedef long long ll;
const ll mod = 1000000007LL;
const ll m... | ALGO | 0.999642 | 3.727039 | {
"github_metadata": {
"branch": "master",
"commit_count": 3630,
"repo_created_at": "2017-11-19T03:14: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": "780f6f9... |
a2d60d0d-b60f-4bd2-bb73-eaaa46d3576e | GGaoe/code | 数列2/数列2/源.cpp | #include <iostream>
using namespace std;
#define ull unsigned long long
static const int maxx = 20;
int k, c;
ull m;
ull q[30];
#define Mod 998244353
struct Matrix {
ull arry[maxx][maxx];
Matrix() {
for (int i = 0; i < maxx; i++) {
for (int j = 0; j < maxx; j++) {
arry[i][j] = 0;
}
}
}
};
Matrix Matr... | ALGO | 0.999955 | 3.51855 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-26T10:20: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": "61d3f268e697... |
0f55915c-beb7-4cf8-a951-9b9be6295b9b | Divyamsirswal/DAA---Design-and-Analysis-of-Algorithm | week5_ques2.cpp | //<NAME> ----> keep pushing the limits
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define vi vector<int>
#define endl "\n"
#define all(x) x.begin(),x.end()
#define pi pair<int,int>
#define umpi unordered_map<int,int>
#define umpc unordered_map<char,int>
#define vvi(x,y) vector<vector<ll>>(... | ALGO | 0.99978 | 4.455256 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-02-15T00:55:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "33320f02033... |
d486238f-c4bb-4d90-8932-3172201652fc | comp0zr/Project-Euler-Solutions | 107_Minimal-network.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M;
vector<vector<int>> adj;
vector<vector<int>> weight;
int FindNext(set<int> &unvisited, vector<int> &cheapest, vector<int> &edge)
{
int mn = 1e9;
int next = -1;
for(auto node : unvisited)
{
if(cheapest[node] < mn)
{
... | ALGO | 0.999975 | 4.637791 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2017-05-01T21:37:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 7,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "75752622... |
6b25d1ef-2fc3-4120-8941-7c3466020fdb | ishandutta2007/codeforces-i | invusr/normal/808/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long s64;
inline int getint()
{
static char c;
while ((c = getchar()) < '0' || c > '9');
int res = c - '0';
while ((c = getchar()) >= '0' && c <= '9')
res = res * 10 + c - '0';
return res;
}
const int MaxN = 100005;
int n, a[MaxN];
s64 sum[MaxN];
i... | ALGO | 0.999874 | 4.065865 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed335e1814de... |
1add7d1d-dd06-4925-8238-e183d3acb797 | sakethgetla/codePractice | cpp/LinkedListProblems.cpp | #include <cstdlib>
#include <unordered_map>
#include <cassert>
#include <vector>
#include "helperFunctions.cpp"
using namespace std;
ListNode* removeElements(ListNode* head, int val) {
if (head != nullptr) {
head->next = removeElements(head->next, val);
return (head->val == val) ? head->next : h... | ALGO | 0.997809 | 4.865162 | {
"github_metadata": {
"branch": "master",
"commit_count": 105,
"repo_created_at": "2019-12-14T05:44: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": "7c61eeb3... |
f6a37038-d077-442d-aed6-4d784cc7c599 | evtnlife/exercicies | palindromo/palindromo.cpp | #include <iostream>
#include <string>
using namespace std;
class Palavra {
char * palavra;
char * palavraCopy;
int size = 0;
public:
Palavra(int sz, const char & plv);
~Palavra();
void inversePalavra();
void comparePalavras();
};
Palavra::Palavra(int sz, const char& plv){
size = sz;
palavra = new char[sz]{... | ALGO | 0.999777 | 4.162833 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-12-23T17:40: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": "f35e9b461d... |
4bfca770-1434-498f-befe-de383884095a | HarkiratSingh7/OSBasicAlgos | ProcessSchAlgos/lib/sjfs.h | // Shortest Job First Scheduling
// or shortest next cpu burst algorithm
#ifndef SJFS_H
#define SJFS_H
#include <iostream>
#include <queue>
#include <iomanip>
#include <algorithm>
#define INT_DISP_LENGTH 17
struct SJFProcessCharacteristics
{
unsigned int id;
unsigned int msBurstTime;
unsigned int waitTi... | ALGO | 0.999506 | 4.986038 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-05-06T07:47:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30d08025a... |
d703abe3-2b31-412c-9b15-6e52996fea20 | kkddhh7/boj_algorithm | 1107_remotecontroller.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
bool button[10] = { true, true, true, true, true, true, true, true, true, true };
bool is_possible(int num)
{
string n = to_string(num);
for(int i = 0; i < n.size(); i++)
{
if(!button[n[i] - '0'])
... | ALGO | 0.999795 | 3.404364 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-07-15T15:06: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": "9f9c6afd769... |
0f081435-05f5-4ba1-9833-b99d56e8ec16 | CyberCat3589/transport-directory | transport directory/input_reader.cpp | #include "input_reader.h"
#include <algorithm>
#include <cassert>
#include <iterator>
/**
* Парсит строку вида "10.123, -30.1837" и возвращает пару координат (широта, долгота)
*/
transport_catalogue::Coordinates ParseCoordinates(std::string_view str)
{
static const double nan = std::nan("");
auto not_spac... | TOOL | 0.93358 | 6.029269 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-04-14T17:05: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": "60db86fc6c2... |
3d0266c6-9d6e-4aa3-b0f5-0b46f50246b6 | priyanshuBS/dsa | arrays/unionOfSortedArray.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n1, n2;
cin >> n1 >> n2;
int arr1[n1];
int arr2[n2];
vector<int> unionArr;
cout << "Element for array1: ";
for (int i=0; i<n1; i++) {
cin >> arr1[i];
}
cout << "Element for array2: ";
for (in... | ALGO | 0.999993 | 4.422852 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-07-20T18:11: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": "5d39b2ab38b2... |
54bfec5d-5f02-4202-8b40-9a38837f0e1a | apoorvKautilya21/Data-Structures-And-Algorithm-in-C- | 22. Binary Trees/1_buildTrees.cpp | #include<iostream>
using namespace std;
class node {
public:
int data;
node*left;
node*right;
node(int d) {
data = d;
left = NULL;
right = NULL;
}
};
node* buildTree() {
int d;
cin >> d;
if(d == -1) {
return NULL;
}
node*p = new node(d);
p -> left = buildTree();
p -> right = buildTree();
ret... | ALGO | 0.99995 | 4.179212 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2021-02-06T05:03: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": "dd6faa700a6... |
5609c0ff-117b-40da-8a08-448ab4547bf1 | NishchayBhokare/DSA_Code_Files | 13_Dynamic Programming/35 buy and sell stock I.cpp | //GFG.
//best time to buy and sell stock question.
int maximumProfit(vector<int> &prices) {
int profit = 0, mini = prices[0]; //storing first stoack price is as minimum..and considering we have buy it.
for(int i=1; i<prices.size(); i++){ //now iterating from first index.
int cost = prices... | ALGO | 0.999892 | 5.969769 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2022-08-07T09:43:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3196e3db... |
5d047586-2033-41dd-9737-53dea1f0f445 | wwwwodddd/Zukunft | PE/103.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
using namespace std;
int n = 7;
int a[10];
bool test(int x) {
vector<pair<int, int> >b;
for (int i = 0; i < 1 << x; i++) {
int s = 0;
int c = 0;
for (int j = 0; j < x; j++) {
if (i >> j & 1) {
s += a[j];
c += 1;
}
}
b.p... | ALGO | 0.999598 | 3.179503 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2018-12-31T17:17:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae1d757... |
55590e06-e671-4d3d-9e83-0b41245c1447 | mmasztalerczuk/Algorithms | UVa/10443.cpp | #include <cstdio>
#include <algorithm>
int lose(char a, char b) {
if (a == 'S' && b == 'R')
return 1;
if (a == 'R' && b == 'P')
return 1;
if (a == 'P' && b == 'S')
return 1;
return 0;
}
int main() {
int n = 0;
scanf("%d", &n);
for(int test=0;test<n;test++) {
... | ALGO | 0.999791 | 3.964958 | {
"github_metadata": {
"branch": "master",
"commit_count": 99,
"repo_created_at": "2014-08-30T18:22:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d5109e7b... |
2a457400-75e1-4ab0-9913-a32390616654 | Aqsa2209/OOP-LAB-TASKS-24k-0923- | OOP Lab 9 Tasks/T1(H.W).cpp | #include <iostream>
#include <cmath>
using namespace std;
class Shape {
public:
virtual double getArea() const = 0; // Pure virtual function
};
class Rectangle : public Shape {
private:
double width;
double height;
public:
Rectangle(double w, double h) : width(w), height(h) {}
double getArea() ... | TOOL | 0.947451 | 6.643353 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-01-29T14:46: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": "8daeac96f1a... |
adb41bde-24a2-4f90-be5d-68e21abbaf20 | XUN-XIE/CS-self-study | 3_Algorithms/Robert/Algorithm_Robert/C++/Chapter4/Chapter4_1/Cycle_Two_Color/CycleDetection.hpp | #include "../Graph.hpp"
class Cycle
{
private:
bool * marked;
bool hasCycle;
void dfs(Graph & G, int v, int u)
{
// v = 当前访问 Node
// u 是 访问 v 之前的 上一次 访问 Node
// 理解, 假设 图结构 就是一个单线圈,每次沿着一个方向
// 递归调用,v 和 u 每次沿着该方向前移,直到最后的 v 遇到了最开始访问的结点 s(or 0)
// 就会通过 else if 中的判断... | ALGO | 0.995439 | 4.560991 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-11-03T06:45:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01f94ec43... |
0582ade8-b89c-46cf-8c48-a4c1dd153450 | ishandutta2007/codeforces-f | farhod_farmon/normal/781/C.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define sc scanf
#define pr printf
#define pb push_back
#define ll long long
#define fin(s) freopen( s, "r", stdin );
#define fout(s) freopen( s, "w", stdout );
const long long N = 200200;
const long long MAGIC = sqrt(N);
const long long mod = 1e9 + 7;
usin... | ALGO | 0.999849 | 3.991498 | {
"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": "42353385142e... |
fd333ea1-e6be-446e-a500-76d57b7373ba | shinobu-x/algorithms | miller_rabin_primality_test.hpp | #ifndef MILLER_RABIN_PRIMALITY_TEST
#define MILLER_RABIN_PRIMALITY_TEST
struct MillerRabinPrimalityTest {
template <typename word, typename dword, typename sword>
struct MathMod {
static word mod, inv, r2; word x;
static constexpr int word_bits = sizeof(word) * 8;
MathMod() : x(0) {}
MathMod(word _x... | ALGO | 0.983212 | 5.868279 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2020-10-24T07:50: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": "cf1a16518... |
6b53c040-017e-467a-b5dc-d8fa6cdc89e0 | ToshihideMatsuda/atcoder | programs/ABC/ABC200-299/ABC200-250/ABC211/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0; i < n; i++ )
#define reps(i,m,n) for(ll i = m; i < n; i++ )
#define max(a,b) (a>b?a:b)
#define max3(a,b,c) max(a,max(b,c))
#define min(a,b) (a<b?a:b)
#define min3(a,b,c) min(a,min(b,c))
#define INF 1 << 30... | ALGO | 0.998193 | 3.584471 | {
"github_metadata": {
"branch": "master",
"commit_count": 444,
"repo_created_at": "2022-02-28T00:05: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": "312d7778... |
2cfba992-71a9-46ba-ba52-e17cebc92a4b | wondol2/ps | contest/CF-Global19/Dsol.cpp | #include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "debug.h"
#define flush() cout.flush();
#else
#define debug(x)
#define flush()
#endif
constexpr int MAXSUM = 100 * 100 + 10;
int sqr(int x) {
return x * x;
}
void solve() {
int n; cin >> n;
vector<int> a(n), b(n);
for (au... | ALGO | 0.999976 | 4.103005 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2022-01-12T06: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": "80ef6cb05... |
7f4a40ba-b9a3-461d-9751-191ec4b5b357 | ayushi7474/CB_Solutions-C-Plus-Plus-master-Course- | Binary Tree/Build_BST.cpp | /*You are given a sorted data of n integers. You have to form a balanced Binary Search Tree and then print preorder traversal of the tree.
Input Format
First line contains integer t as number of test cases.
Each test case contains following input. First line contains integer n which represents the length of the data a... | ALGO | 0.999984 | 5.839778 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-09-02T19:08: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": "56f37028b9... |
ede98935-1547-42f5-bc6b-07f4553ca522 | Williamlittlewhite/Programming-Practice | PTA_advanced_level03/1022.cpp | //#define _CRT_SECURE_NO_DEPRECATE
//#include<iostream>
//#include<cstdio>
//#include<vector>
//#include<map>
//#include<set>
//#include<string>
//#include<algorithm>
//using namespace std;//这句一定放在包含头文件后的第一句话!!
////本题注意难点是利用map的特性,类似于python中的字典来存储,同时set集合具有自动排序的功能,可以简化排序这一步骤
////map.find如果没找到会返回map.end的迭代器,这种判断是否能找到相应的... | ALGO | 0.992649 | 3.01513 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2022-03-08T11:25: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": "eda4ff49612... |
d1670b73-a38e-47a5-8544-54f552db02c8 | ishandutta2007/codeforces-q | qinzhaoyang/normal/1672/F2.cpp | #include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int T, n, a[N], b[N], c[N], vis[N], ins[N];
vector<int> G[N];
int main() {
for (scanf("%d", &T); T; T--) {
scanf("%d", &n); int mx = 0;
for (int i = 1; i <= n; i++) scanf("%d", &a[i]), c[a[i]]++;
for (int i = 1; i <= n;... | ALGO | 0.998938 | 3.297416 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:56: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": "a1c6f3f50047... |
56eed177-d4ec-4efa-a250-676f0b4b12a2 | gosujuna/cf | H_Mad_City.cpp | #include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "zdebug.h"
#else
#define debug(...) 42
#endif
#define int long long
using str = string; // ben qi python
using i64 = long long;
#define endl '\n'
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
void solve() {
... | ALGO | 0.999863 | 5.515669 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2023-02-22T22:21: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": "1c293f3df... |
b9ff7dba-4166-4e84-903d-ee257021c046 | kaob1/CSCI104hw | hw6/Hashtable.cpp | #include <iostream>
#include <string>
#include <time.h>
#include <math.h>
#include <cstdlib>
#include "Hashtable.h"
using namespace std;
Hashtable::Hashtable(bool d, unsigned int p){
trackA=0;
trackP=0;
arrsize=arrayIndices[trackA];
prime=doublehashingPrimes[trackP];
probing =p;//determine which p... | ALGO | 0.991419 | 3.917966 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-08-02T18:37: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": "bef5e1aede4e... |
8aad99cd-a148-41fc-a6a4-7f3f83a1b32a | md-waliul-hasan/spoj | DIV.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define SIZE_N 1000000
#define SIZE_P 1000000
bool flag[SIZE_N+5];
int primes[SIZE_P+5];
int seive()
{
int i,j,total=0,val;
for(i=2;i<=SIZE_N;i++) flag[i]=1;
val=sqrt(SIZE_N)+1;
for(i=2;i<val;i++)
if(flag[i])
for(j=i;j*i<... | ALGO | 0.999765 | 3.834516 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-03-02T19:42:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5fc158f7... |
3f83fe54-03d0-4ea7-9f89-358932a64739 | caoahn/CodePTIT-DSA | ktchu trinh tren do thi vo huong.cpp | #include<bits/stdc++.h>
using namespace std ;
int n,m ;
vector<int> adj[1001] ;
bool visited[1001] ;
int p[1001] ;
bool dfs(int u) {
visited[u] = true ;
for(auto v : adj[u]) {
if(!visited[v]) {
p[v] = u ;
if(dfs(v)) return true ;
}
else if(v != p[u]) return true ;... | ALGO | 0.999988 | 4.736637 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-23T13:43: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": "9ee4ab922a61... |
3a180529-c636-41ba-949c-03387720436d | a-fratip/Programming-Methodology-II | Graph Project/Code/Undirected.cpp | #include "Undirected.h"
#include <vector>
#include <iostream>
using namespace std;
Undirected::Undirected()
: Graph(), EdgeWeightTotal{0}
{
}
Undirected::Undirected(const Undirected& rhs)
: Graph(rhs), EdgeWeightTotal{rhs.EdgeWeightTotal}
{
}
int Undirected::getEdg... | ALGO | 0.951833 | 5.858071 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-05-05T02:06: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": "a2875298641... |
77e4857c-4abb-43ec-acbc-0ac37150eabc | puneetmnit/playground | Algorithms/merge_arrays.cpp | /**@file playground/Algorithms/merge_arrays.cpp
* @author puneet
* @version 704
* @date
* Created: Wed Jun 1 23:04:52 2016 \n
* Last Update: Wed Jun 1 23:04:52 2016
*
* This merges the two sorted array with O(1) space complexity
*/
/*========================================================================... | ALGO | 0.999822 | 5.89311 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2016-05-24T04:29: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": "9a7cf9540... |
38585d3e-b424-4b23-8753-0977c946999a | istio/envoy | source/extensions/filters/network/redis_proxy/command_splitter_impl.h | #pragma once
#include <cstdint>
#include <string>
#include <unordered_map>
#include <vector>
#include "envoy/stats/scope.h"
#include "envoy/stats/stats_macros.h"
#include "envoy/stats/timespan.h"
#include "common/common/logger.h"
#include "common/common/utility.h"
#include "common/singleton/const_singleton.h"
#inclu... | WEB | 0.947017 | 7.879158 | {
"github_metadata": {
"branch": "master",
"commit_count": 6563,
"repo_created_at": "2017-10-20T16:25:41.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "envoyproxy/envoy",
"stars": 35,
"forks": 59,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content... |
52e424b4-4df6-4396-9af2-2ebe81bc2a4d | Pikanick/Data-Structures-and-Algorithms | A3/AvlTree2.h | #ifndef AVL_TREE_H
#define AVL_TREE_H
#include "dsexceptions.h"
#include <algorithm>
#include <iostream>
using namespace std;
// AvlTree class
//
// CONSTRUCTION: zero parameter
//
// ******************PUBLIC OPERATIONS*********************
// void insert( x ) --> Insert x
// void remove( x ) --> Remove ... | ALGO | 0.986259 | 5.603803 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-12-22T22:19: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": "12ea7102119d... |
b59df665-d1db-4ed1-80bc-d78f98220ac3 | BossChengZhe/Practice-Leetcode | binary-tree/Leetcode_109.cpp | #include "iostream"
#include "vector"
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
struct TreeNode {
int val;
TreeNode *left;
Tr... | ALGO | 0.999993 | 5.59888 | {
"github_metadata": {
"branch": "master",
"commit_count": 99,
"repo_created_at": "2020-05-28T04:18:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "285fbdc15... |
e552aa65-15ed-4a84-a1a3-1436f69fb7ca | misaka18931/misaka-cp | extra/NOI2021/xpath/xpath.cpp | #include <algorithm>
#include <cstdio>
#include <climits>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
typedef long long i64;
typedef unsigned i32;
typedef unsigned long long u64;
template<typename T>
void chkmax(T &a, const T &b) {
a = max(a, b);
}
template<typename T>
... | ALGO | 0.999724 | 4.59555 | {
"github_metadata": {
"branch": "main",
"commit_count": 332,
"repo_created_at": "2020-12-30T07:06:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbc903e727... |
962c4bcb-a6d3-4f01-90c0-01f3e1b8a701 | mit-biomimetics/Cheetah-Software | common/include/Controllers/PositionVelocityEstimator.h | /*! @file PositionVelocityEstimator.h
* @brief All State Estimation Algorithms
*
* This file will contain all state estimation algorithms.
* PositionVelocityEstimators should compute:
* - body position/velocity in world/body frames
* - foot positions/velocities in body/world frame
*/
#ifndef PROJECT_POSITI... | ALGO | 0.906068 | 7.397025 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-06-17T20:27:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2931,
"forks": 985,
"issues": 55,
"pull_requests": 5
},
"file_meta": {
"content_id": "4c82e... |
b9cc0637-c95b-4bc4-9d02-f2f9bd167dd7 | Bernini0/Greedy-Best-First-and-A-Star | calculate.cpp | #include <bits/stdc++.h>
using namespace std;
// Function to convert degrees to radians
double toRadians(double degrees) {
return degrees * M_PI / 180.0;
}
// Function to calculate distance between two GPS coordinates in kilometers
double calculateDistance(double lat1, double lon1, double lat2, double lon2) {
... | DATA | 0.982777 | 4.461258 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-17T12:50: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": "ee526c502862... |
89cc795e-a717-4467-9379-c60b818ac609 | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p02866/s644133468.cpp | #include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
#include <unordered_set>
#include <tuple>
#include <cmath>
#include <limits>
#include <type_traits>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <que... | ALGO | 0.999913 | 4.144084 | {
"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": "f544e59f3a... |
da41e472-b0a5-4e3b-8796-e0e6392b8d5c | yangzy723/Bubble-and-Bubble | aicontroller.cpp | #include "aicontroller.h"
#include "bomb.h"
#include "fire.h"
#include "player.h"
#include "pushprop.h"
#include "hardwall.h"
#include "softwall.h"
#include "gamescene.h"
#include "speedprop.h"
#include "numplusprop.h"
#include "rangeplusprop.h"
AIController::AIController(const char* upimage_route,
... | TOOL | 0.963571 | 3.628627 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-10T12:48:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e4428bdb2d7... |
588afc9a-e3bf-4490-8b3f-40dcabb2e971 | Tora416/MultiCodeEmbed | dataset/dataset_raw/gcj_cpp/Hurski/5304486_5697460110360576_Hurski.cpp |
#include <algorithm>
#include <bitset>
#include <chrono>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <s... | ALGO | 0.999307 | 3.479066 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2025-07-10T08:38: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": "2f67dec78... |
9e0bdcf3-bd9e-4858-a08b-2e47330c4ac1 | akhikolla/testpackages | fuzzedpackages/drf/src/src/prediction/collector/OptimizedPredictionCollector.h | /*-------------------------------------------------------------------------------
This file is part of generalized random forest (grf).
grf is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3... | ALGO | 0.908128 | 7.436552 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-15T17:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "929db186a6... |
1352211d-172c-4bce-9f7b-fc2097a0b948 | sendoru/problem_solving | source/atcoder/arc165_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;
const ll MOD9 = 998244353;
const ll MOD1 = (ll)1e9 + 7;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
// 합이 n, 최소공... | ALGO | 0.999749 | 5.572678 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2021-05-01T19:31: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": "a504bef64a2... |
f28218c7-621b-488d-8d41-822270a09d23 | zjonkg/PiedraPapelTijeras | server.cpp | #include <iostream>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <map>
#include <string>
#pragma comment(lib, "ws2_32.lib")
struct GameSession {
sockaddr_in player1Addr;
sockaddr_in player2Addr;
std::string player1Move;
std::string player2Move;
bool player1HasMoved = false;
bool player... | WEB | 0.979348 | 5.686277 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-02-18T16:09: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": "70dfcf2ea965... |
5b51e121-7bad-448a-b4ca-d65436bf4d0b | Mridul-Singh-01/DSA-Practice | Arrays/mergeOperations.cpp | // Find minimum number of merge operations to make an array palindrome
// Given an array of positive integers. We need to make the given array a ‘Palindrome’. The only allowed operation is”merging” (of two adjacent elements).
//Merging two adjacent elements means replacing them with their sum.
// The task is to find t... | ALGO | 0.999998 | 5.678192 | {
"github_metadata": {
"branch": "master",
"commit_count": 179,
"repo_created_at": "2024-06-20T15:33:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a04e1cec... |
38f9a23f-209b-4b45-ad4c-edea10426213 | kimcodingvv/Problem-solving | Codeforces/Codeforces Round #617 (Div. 3)/C - Yet Another Walking Robot.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define all(x) (x).begin(), (x).end()
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef long long ll;
typedef pair <int, int> pii;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int test; cin >> test; while (test--... | ALGO | 0.999994 | 3.679792 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2020-01-24T16:29: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": "1be2c9f74... |
8d97fc95-fd97-4c9f-bf3f-13550b93c768 | danielvitor2d/Problem-Set | DFS/First-promotion/First-promotion.cpp | /*
Author: [UFC-QXD] <NAME> <<EMAIL>>
Problem: First Promotion
Link: https://neps.academy/problem/823
Origin: OBI 2020 - First Phase - Level 2
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long i64;
typedef pair<int, int> ii;
typedef pair<i64, i64> ll;
typedef vector<int> vi;
typedef vector<i64> vi... | ALGO | 0.999291 | 4.006527 | {
"github_metadata": {
"branch": "main",
"commit_count": 120,
"repo_created_at": "2020-10-04T01:36:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13be297be9... |
c71d8998-6dfc-4519-a2a2-74f3fdeaa15d | taoye20/code_thinking | coding_thinking/115不同的子序列.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int numDistinct(string s, string t) {
//dp表示在s以i-1为结尾,t在以j-1为结尾时,s子序列中包含多少个t
vector<vector<int>> dp(s.size() + 1, vector<int>(t.size() + 1, 0));
//初始化
for (int i = 0; i <= s.size(); i++) dp[i][0] = 1;... | ALGO | 0.999985 | 5.368263 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2023-09-19T15:15: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": "2c5ebf12a... |
c9386e6e-6cd0-41b2-9aa7-6976887cf061 | DavidBShan/Competitive-Programming2022-2024 | Other/DMOPC17C1P3.cpp | #include <bits/stdc++.h>
using namespace std;
const int MM = 1e5+5;
int N, M;
vector<pair<int, int>> adj[MM];
pair<int, int> dis[MM]; bool vis[MM];
int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> N >> M;
for(int i = 1, u ,v, w; i <= M; i++){
cin >> u >> v >> w;
adj[u].p... | ALGO | 0.999975 | 3.954181 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-17T04:58: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": "2b7c675776d7... |
4c8e70fe-0b5c-421b-9dbc-29a7d312c8bc | jepetolee/algorithm_training | Algorithm/Dynamic Programming/(Dynamic Programming) JLIS.cpp | #include <iostream>
using namespace std;
const long long NEGINF = numeric_limits<long long>::min();
unsigned int N[100], M[100];
int cache[101][101];
int length1, length2;
int jlis(int index1, int index2)
{
int &ret = cache[index1 + 1][index2 + 1];
if (ret != -1)
return ret;
ret = 2;
long long a = (index1 == -1)... | ALGO | 0.999981 | 3.727865 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2021-06-20T10:22:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bdbd8c32826... |
b5fe81f5-0cf6-4e94-bf9e-261763e8ef90 | matytynka/nai-labs | lab4/zad1.cpp | #include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
using namespace cv;
void fixPointsOrder(vector<Point> in, vector<Point> &out) {
sort(
in.begin(),
in.end(),
[](auto &a, auto&b) {
return a.y < b.y;
}
);
sort(
in.beg... | ALGO | 0.984399 | 4.233415 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2020-10-13T11:35: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": "48f40aacb7f... |
257b9ff5-f831-47bf-80bf-e1e0da2b013e | ijleesw/cp | kks227/13-prefix-sum/11660.cpp | #include "bits/stdc++.h"
using namespace std;
using IntVec = vector<int>;
int main()
{
int n, m;
cin >> n >> m;
vector<IntVec> matx(n + 1, IntVec(n + 1, 0));
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
int x;
scanf("%d", &x);
matx[i + 1][j +... | ALGO | 0.999689 | 4.196972 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-04-30T03:47: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": "99d8e53744... |
91494141-8498-4a2b-b4f2-ad79de10bcb4 | mbalsdon/daily-dosu | src/DosuConfig.cpp | #include "DosuConfig.h"
#include "Logger.h"
#include "Util.h"
#include <nlohmann/json.hpp>
#include <fstream>
#include <iostream>
#include <chrono>
#include <ctime>
int DosuConfig::logLevel;
bool DosuConfig::logAnsiColors;
std::string DosuConfig::discordBotToken;
std::string DosuConfig::osuClientID;
std::string Dosu... | CONFIG | 0.908735 | 6.790564 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2023-05-21T00:07:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db519f906a3... |
e09ec3d7-84d7-48c6-83b8-92369872f150 | abhibansal530/Codes | codeforces/463.cpp | //<NAME>
#include<bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define TR(v,it) for( LET(it,v.begin()) ; it != v.end() ; it++)
#define loop(a,b) for(int i=a;i<b;i++)
#defin... | ALGO | 0.999916 | 3.054878 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-03-22T19:52: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": "7ce7d8eac... |
6f4a2f31-e17b-4b0c-9747-e86631cf816e | Leon-Zhaohw/NumericalProjectsCollections | LinearSystem/parallelMultigrid/MGPCG-1.0/Public_Library/Interpolation/INTERPOLATION_FORWARD.h | //#####################################################################
// Copyright 2006, <NAME>.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
// Header INT... | ALGO | 0.990166 | 4.368338 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2021-08-02T02:06:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7311c9... |
7ad672bb-b8b8-4c99-bff7-fd28848ab98c | aman1123721214/Dynamic-Programming | REV/random_65_GFG_Largest_Sum_Subarray_of_Size_at_least_K.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution{
private:
public:
long long int maxSumWithK(long long int a[], long long int n,
long long int k){
//kadane's algo to find maxSum subArray till index "i"
vector<long long int> maxSum(n);
long long i... | ALGO | 0.999935 | 4.444705 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-07-13T03:50: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": "f8dee09892a6... |
95fd6015-82eb-4555-bee9-9b7d78d63b89 | Pxguin/cpp | olympiads/polish/2016/round_3/day_2/parade.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define chmax(a, b) a = max(a,b)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define v vector
v<v<int>> adj;
int ans;
int dfs(int cur, int par) {
int mx1 = 0, mx2 = 0, sz = adj[cur].size();
for (int x : adj[cur]) {
if (x!=par) {
... | ALGO | 0.994692 | 4.170571 | {
"github_metadata": {
"branch": "main",
"commit_count": 352,
"repo_created_at": "2024-01-02T19:14: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": "bbc7038bc0... |
28873066-46cd-486e-9812-48927a483532 | loal123/CP | codeforces/Codeforces_Codeforces_Round_936_Div_2/A_Median_of_an_Array.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define SZ(x) ((int)... | ALGO | 0.999881 | 4.253943 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-12-23T13:34: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": "23f48c47f29... |
b684980f-3d7f-4b78-af21-d5092d517886 | Surya-Kumar-03/Love-Babbar-DSA-Sheet-Solutions | palindromeString.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int isPalindrome(string S)
{
// Your code goes here
for(int i=0,j=S.size()-1;i<j;i++,j--)
{
if(S[i]!=S[j])
return 0;
}
... | ALGO | 0.999846 | 5.298297 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-09-28T05:17:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f866b75cf8... |
86640db7-aded-4257-ae98-f3be8f7e29e8 | Fengoi/For-Future-OI | NOI/题目纪念/青蛙的约会(exgcd经典例题).cpp | //书上的经典例题!(洛谷上也有)
#include<bits/stdc++.h>
using namespace std;
typedef long long lt;
lt exgcd(lt a, lt b, lt &x, lt &y){
if(b == 0){
x = 1, y = 0;
return a;
}
lt gcd = exgcd(b, a%b, x, y);
lt t = x;
x = y;
y = t - a/b * y;
return gcd;
}
int main(){
lt nok = 0, x, y, m... | ALGO | 0.999962 | 3.698146 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2023-11-26T16:41: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": "1d60899b65... |
758c26a0-d8d5-4df1-9391-eb5235b7fc0c | elanhickler/RS-MET | Libraries/RobsJuceModules/rapt/Math/Types/Polynomial.cpp |
// construction:
template<class T>
rsPolynomial<T>::rsPolynomial(int degree, bool initWithZeros)
{
coeffs.resize(degree+1);
if(initWithZeros)
rsArrayTools::fillWithZeros(&coeffs[0], degree+1);
}
// operators:
/*
template<class T>
rsPolynomial<T> operator+(const rsPolynomial<T>& p, const rsPolynomial<T>& q)
... | ALGO | 0.985961 | 5.50416 | {
"github_metadata": {
"branch": "master",
"commit_count": 7682,
"repo_created_at": "2025-02-11T22:26:54.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "RobinSchmidt/RS-MET",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"conte... |
a7cead14-5360-4b14-9bff-b6347244d8c6 | jinkyongpark/practicealgorithm | Code/요리사.cpp | #include <iostream>
#include<algorithm>
#include<cmath>
#include <vector>
using namespace std;
const int MAX = 20;
int T, n;
int food[MAX][MAX];
bool check[MAX]; //team 구분
int minans;
vector<int> team1, team2;
void calcSynergy() {
int s1 = 0, s2 = 0;
for (int i : team1)
for (int j : team1)
s1 += food[i][j];
... | ALGO | 0.999935 | 5.075481 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2019-04-21T15:23: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": "dc8d54010... |
1d2c617f-1fcd-4a16-83c1-8c89d470ccdc | sangmichaelxie/doremi | flash-attention/csrc/cutlass/include/cutlass/gemm/kernel/sm90_gemm_tma_warpspecialized_persistent.hpp | /***************************************************************************************************
* Copyright (c) 2023 - 2023 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... | TOOL | 0.979133 | 6.774013 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2023-05-25T01:55:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 340,
"forks": 34,
"issues": 14,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e3f92e... |
2a890393-5097-4139-b107-fc2917547803 | Lodour/ACM-ICPC | codes/codeforces/699B.cpp | #include <algorithm>
#include <iostream>
#include <cassert>
#include <cstring>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <map>
#include <set>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef vector<int> ... | ALGO | 0.999918 | 3.022914 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2015-09-20T15:57: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": "b15b6281f... |
bdb48b3a-a106-422a-9f55-f6e05a25582a | edualvs/codigos | C++/Tarefacasa03-19013049-01.cpp | #include <iostream>
#include <locale.h>
#include <fstream>
#include <conio.h>
#include <vector>
using namespace std;
//Criptador e Desencriptador
//<NAME> - 190136049
ifstream arquivo;
int chave=0;
string destino;
void inicio() {
//Entrada da chave
while (chave <= 0 || chave > 50) {
cout << "------------------... | TOOL | 0.914123 | 3.223185 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-01-24T16:58: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": "e3b652c8e8e2... |
dc3bef7b-9953-4a6d-a539-be8f19deec98 | NoAvailableAlias/signal-slot-benchmarks | benchmark/lib/libsigcplusplus/sigc++/tuple-utils/tuple_transform_each.h | /* Copyright (C) 2016 <NAME>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distr... | TOOL | 0.945043 | 7.265163 | {
"github_metadata": {
"branch": "master",
"commit_count": 202,
"repo_created_at": "2015-05-16T14:09:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 141,
"forks": 30,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "e2b82... |
04c9b2f5-ed80-4cd0-b27a-a000e2247a8a | ama29n/DSA | Matrix/02_k_smallest_element_in_sorted_matrix_LC_378.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
// 1 5 9
// 10 11 13
// 12 13 15
int lessOrEqualToK(int el, vector<vector<int>>& matrix, int n) {
int c = 0, j = n - 1;
for(int i = 0; i < n; i++) {
while(j >= 0 && matrix[i][j] > el)
j... | ALGO | 0.999915 | 5.416464 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2022-07-03T18:24: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": "597251f5d6... |
2c1216c6-bd58-478b-8973-033949b01387 | khy0e/programmers | 백준/Silver/2630. 색종이 만들기/색종이 만들기.cc | #include <iostream>
using namespace std;
bool color;
bool m[129][129];
int blue;
int white;
int n;
void paper(int x, int y, int size)
{
bool check = true;
if (m[y][x] == 1)
color = 1;
else
color = 0;
for (int i = y; i < y + size; i++)
{
for (int j = x; j < x + size; j++)
... | ALGO | 0.999776 | 4.28564 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2024-09-03T00:26: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": "4d7c6f8168f... |
f903ec8c-67d9-461f-a1aa-afa93435301b | Honeta/ACM-ICPC | ICPC/J.cpp | #include <bits/stdc++.h>
using namespace std;
string a,b;
int A[4],B[4];
int cal(int sta)
{
int up[4]={0,0,0,0},down[4]={0,0,0,0}, ans = 0;
for(int i=0;i<4;i++)
{
int m=B[i]-A[i];
//cout<<m<<endl;
if(sta&(1<<(3 - i)))
{
up[i]=(m>0)?10-m:-m;
if (i && up... | ALGO | 0.999944 | 4.329882 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-01-27T12:44:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dd4ec55cb08... |
a25bf42f-8ac4-4c40-a886-050c7a1096c9 | Exalibur77/Data-Structure-and-Algorithm | Graph/FloodFill.cpp | //{ Driver Code Starts
#include<iostream>
#include<vector>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void dfs(int row , int col , int n , int m , int prevColor , int newColor , vector <vector<int>>& visited ,vector<vector<int>>& image , int dx[] , int dy[]){
visited[row... | ALGO | 0.999742 | 6.090764 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2022-01-10T18:02:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "030e4139331... |
94b78adb-4391-4a3d-a064-efe21c4b2c0e | LordLKY/SysY-compiler | opt/RA.h | #pragma once
#include "../IRModule.h"
#include <unordered_set>
#include <unordered_map>
#include <deque>
using std::unordered_map;
using std::unordered_set;
using std::deque;
class raPass{
public:
unordered_map<string, FuncModule *>* pFT;
raPass(unordered_map<string, FuncModule*>* pFT): pFT(pFT){}
void R... | ALGO | 0.974073 | 4.845105 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-10-16T10:10:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39fa99445938... |
6c2c8539-ea03-455e-80e2-be92a6c0ae8f | menaehab/Codeforces-Solutions | 0 - 1000 problems/John and Swaps.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <iomanip>
#include <string>
#include <set>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#define speedup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long ... | ALGO | 0.999913 | 3.789735 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2024-08-24T15:38: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": "dc705db968... |
3a77ec35-f2b0-4004-8ab9-4d6d601b0081 | zxysnow/leetcode | 10-regular-expression-matching.cpp | class Solution {
public:
bool isMatch(string s, string p) {
int m = s.size(), n = p.size();
vector<vector<bool> > dp(m + 1, vector<bool>(n + 1, false));
dp[0][0] = true;
for (int i = 1; i <= n; i++) {
dp[0][i] = (p[i - 1] == '*' && i >= 2 && dp[0][i - 2]);
}
... | ALGO | 0.999937 | 5.151844 | {
"github_metadata": {
"branch": "master",
"commit_count": 280,
"repo_created_at": "2015-01-04T05:35:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b31f55... |
da8188d5-87bf-4929-aa7f-422c52dd5dd9 | atulRanaa/problem-solving-directory | Spoj/CMPLS.cpp | // spoj
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 3e5+5;
const ll MOD = 1000000007;
#define all(x) x.begin(),x.end()
#define pii pair<ll,ll>
#define pis pair<ll,string>
#define F f... | ALGO | 0.999993 | 3.286845 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2019-03-24T17:39: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": "98ce564c1... |
62c5d343-3c69-41af-b5ec-87794a28598f | icenamor/Temporal | search/partial_order_lifter.h | #ifndef PARTIAL_ORDER_LIFTER_H
#define PARTIAL_ORDER_LIFTER_H
#include "state.h"
#include "operator.h"
#include "scheduler.h"
#include <list>
enum ActionType {
start_action = 0, end_action = 1, dummy_start_action = 2, dummy_end_action = 3
};
struct InstantPlanStep {
ActionType type;
int endAction;
... | ALGO | 0.970485 | 7.128778 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-06-18T08:26:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fcefd6043... |
b14acabf-69ad-4dd5-8803-7d6f849a64b8 | potty10/chess-ai | src/cpp/negamax.cpp | #include <limits>
#include "chess.hpp"
#include "utils.hpp"
#include "negamax.hpp"
using namespace chess;
const int WIN_VALUE = 9999999;
const int DRAW_VALUE = 0;
const float POSTIIVE_INFINITY = std::numeric_limits<float>::infinity();
const float NEGATIVE_INFINITY = -std::numeric_limits<float>::infinity();
int larry... | ALGO | 0.999368 | 5.60472 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-03-19T18: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": "cbccade1b29... |
e2347f13-53ef-4726-953a-2f0d0005dd67 | liuq901/code | HD/hd_4630.cpp | #include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
struct tree
{
int l,r,x;
};
tree a[131100];
int pos[50010],ans[50010];
vector <pair <int,int> > b[50010];
void build(int x,int l,int r)
{
a[x].l=l,a[x].r=r;
if (l==r)
{
a[x].x=b[l].empty()?-1:b[l].ba... | ALGO | 0.999983 | 4.126978 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2013-09-18T08:58:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34d7d663... |
951a10c5-18ba-40d3-ad6b-5145d6d02efa | Coder-forfun/Hactoberfest-accepted | TicTacToe/tic_tac_toe.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
char square[10] = {'o','1','2','3','4','5','6','7','8','9'};
int win();
void boardlayout();
int main()
{
int player = 1,i,choice;
char mark;
do
{
boardlayout();
player=(player%2)?1:2;
cout << "Player " << player << ",... | ALGO | 0.993309 | 3.614343 | {
"github_metadata": {
"branch": "main",
"commit_count": 395,
"repo_created_at": "2021-09-30T19:26:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 112,
"forks": 371,
"issues": 13,
"pull_requests": 284
},
"file_meta": {
"content_id": "f87... |
2ed9fe06-80f8-4799-a8cf-7ad53657863b | Hira02/DSA | Verify Preorder Serialization of a Binary Tree.cpp | /*
Problem Description : (LC 331)
--------------------------------------------------------------------------------------
One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node,
we record the node's value. If it is a null node, we record using a sentinel value such as #.
... | ALGO | 0.999805 | 6.205112 | {
"github_metadata": {
"branch": "master",
"commit_count": 456,
"repo_created_at": "2020-05-04T17:09:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dfcf679b... |
419b19f5-1892-489b-ba0a-9a635025be62 | btkruppa/Scheduler | Scheduler_Simulation_Project/main.cpp | /***************************************************
file: main.cpp
class: CPTR 352 - OS Design
purpose: Run the high level code for the CPU
scheduler simulation.
creators: <NAME> & <NAME>
date: June 2016
***************************************************/
#include <i... | TOOL | 0.968073 | 3.2554 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-07-07T19:13:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1e21fc626... |
36273ddc-802a-441b-93e9-6760671646d4 | MostafaGalal1/CP-Submissions | Codeforces/1873/224539539.cpp | #include <bits/stdc++.h>
#include <random>
using namespace std;
typedef long long ll;
typedef long double ld;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_sta... | ALGO | 0.999942 | 4.829344 | {
"github_metadata": {
"branch": "main",
"commit_count": 1484,
"repo_created_at": "2023-10-10T14:00: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": "277d6c636... |
897d9e7b-54e8-4778-aaeb-0e04e62ceb8c | abhiXsliet/Solved-DSA-Problems | Leetcode Contests/Weekly Contest 443/004-minimum-operations-to-make-elements-within-k-subarrays-equal.cpp | // https://leetcode.com/problems/minimum-operations-to-make-elements-within-k-subarrays-equal/
#include <bits/stdc++.h>
using namespace std;
class Solution {
private:
typedef long long ll;
const ll INF = 1e15;
// TC : O(N*log(N))
// SC : O(N)
vector<ll> getMedianXsizeWindow(vector<int> &nu... | ALGO | 0.999858 | 6.0477 | {
"github_metadata": {
"branch": "main",
"commit_count": 2156,
"repo_created_at": "2023-07-29T13:17:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c78559af7... |
005bfdbd-7a1b-4ff5-aa9d-72b78607f7a5 | kemier/leetcode-solution | 200-300/204_CountPrimes.cc | #include <vector>
using namespace std;
class Solution
{
public:
bool isPrime(int x)
{
for (int i = 2; i * i <= x; ++i)
{
if (x % i == 0)
{
return false;
}
}
return true;
}
int countPrimes(int n)
{
int ans =... | ALGO | 0.999894 | 5.132849 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2021-02-22T07:58: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": "184631542de... |
f5ee4040-6ced-44d1-9807-9bb873167118 | janbuca369/C-practice-for-Beginner | C++ practice for Beginner/46 C++/main.cpp | #include <iostream>
// Singly Linked Lists
using namespace std;
void add_node(int n);
void display();
struct node{
int data;
int *next;
};
node *head = NULL;
int main()
{
cout<<"Before any data is entered: ";
display();
add_node(1);
cout<<"After one data is entered: ";
display();
add... | ALGO | 0.998885 | 4.447929 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2025-03-10T08:19: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": "87db603b257... |
40b1b623-1168-4205-a837-de153c291c7c | likunjk/LeetCode | Wildcard_Matching(2).cpp | int dp[1009][1009];
class Solution {
public:
// 因为'*'与前面一个字符无关,不等同于正则匹配,为了不重复计算子问题,可以采用动态规划
// 即使用动态规划,超大规模的案例仍然超时.不过跟普通方法相比,仍然快不少
// 动态规划的复杂度是O(n*n*n), 考虑到每个点都是*,每个点都要循环n次判断
bool isMatch(const char *s, const char *p)
{
if(s==NULL || p==NULL) //我们规定非法指针统一为false
return false;
... | ALGO | 0.999963 | 4.044971 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2014-09-13T13:57: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": "bcc2b94a... |
0db023e1-1d7f-4b1f-ab01-687cac2e2577 | fightyz/dailyprogrammer | Challenge#162/easy.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cctype>
using namespace std;
int main() {
ifstream in("input.in");
streambuf *cinbuf = cin.rdbuf();
cin.rdbuf(in.rdbuf());
ofstream out("output.out");
streambuf *coutbuf = cout.rdbuf();
cout.rdbuf(out.rdbuf());
/* Load dicti... | ALGO | 0.998452 | 4.044137 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-05-14T15:38: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": "6a8982941e... |
c216a5d9-de93-48ec-a4d0-3b34a30e2427 | prady8339/problem-solving | 102-binary-tree-level-order-traversal/binary-tree-level-order-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999974 | 5.952936 | {
"github_metadata": {
"branch": "main",
"commit_count": 2118,
"repo_created_at": "2022-11-26T16:43: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": "6f4f97260... |
5007a3db-d7bc-485b-8fd1-36d75e491b33 | hossaintaufiq/DSA_Practice | Stack Array/main.cpp | #include <iostream>
#include <string>
#include "stacktype.h"
using namespace std;
// Function to check if a string of parentheses is balanced
bool isBalanced(const string& str) {
StackType<char> stack;
for (char ch : str) {
if (ch == '(') {
stack.Push(ch);
} else if (ch == ')') {
... | ALGO | 0.988766 | 6.474213 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-09-25T15:53:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ede4bd5b867... |
c967c557-f697-4937-85e4-4e1bad815df9 | yplusplus/OnlineJudge | hdoj/1166 敌兵布阵 - 线段树.cpp | #include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
#include "vector"
#include "queue"
using namespace std;
#define pb push_back
#define lc(x) (x << 1)
#define rc(x) (x << 1 | 1)
#define MAX 50005
int seg[MAX<<2];
int n;
void pushup(int p) {
seg[p] = seg[lc(p)] + seg[rc(p)];
}
void build(... | ALGO | 0.999439 | 3.974131 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-23T18:32:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84cc257eb2e8... |
499d2a51-a9e0-48c6-a8b8-c7d84b7804da | ntloi95/Codeforces | codeforces/1481/B.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 50;
int main()
{
int nTest;
cin >> nTest;
while (nTest--)
{
int n, k, h[111];
cin >> n >> k;
for (int i = 0; i < n; i++)
{
cin >> h[i + 1];
}
int p;
boo... | ALGO | 0.999844 | 3.529611 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2021-02-02T05:09: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": "88c3cbe39... |
4ff422db-67e8-48f9-b46e-c99cd419220a | cran/oapackage | src/Deff.h | /*! \file Deff.h
* \brief Contains functions to generate optimal designs
*
*/
#ifndef DEFF_H
#define DEFF_H
#include "arraytools.h"
#include "arrayproperties.h"
/// calculate score from from set of efficiencies
double scoreD ( const std::vector<double> dd, const std::vector<double> alpha );
/// different algori... | ALGO | 0.998207 | 4.322331 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-06-17T16:45:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f7919cfb8e... |
b47d249c-ba3c-4ab8-8832-e5ccb34855a0 | Sameerbrundavanam/A2ZDSA | BinarySearch/Ship_Packages_within_K_days.cpp | class Solution {
public:
bool help(vector<int>& weights, int d,long long mid){
long long n = weights.size();
long long days = 1, curWeight = 0;
for(int i=0;i<n;i++){
if(curWeight + weights[i] > mid){
curWeight = weights[i];
days++;
}
... | ALGO | 0.999996 | 5.529091 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2025-01-22T05:35: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": "db5463a3f43... |
1ee52c21-3f95-4022-910a-212008cf2417 | avakkyan/Algorithms2 | lab 11/C.Face_control/main.cpp | #include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
#include <iostream>
#include <vector>
using namespace std;
const int INF = 1e9;
bool solve(vector<vector<pair<int, int>>>& adj_list, int n, int k) {
vector<int> distances(n, INF);
distances[0] = 0;
for (int i = 0; i < ... | ALGO | 0.999996 | 5.165626 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2023-03-19T18:37: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": "4377e87e8f7... |
9e76ff4c-0844-465d-a460-d1ebc6fee592 | hjiang13/LLM4IR | Benchmarks/Human_xBenchmarks_164/test/CPP_117.cpp | /*
Given a string s and a natural number n, you have been tasked to implement
a function that returns a vector of all words from string s that contain exactly
n consonants, in order these words appear in the string s.
If the string s is empty then the function should return an empty vector.
Note: you may assume the i... | ALGO | 0.999531 | 4.709179 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-05-21T20:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aed769ae1ea... |
7adb71f1-76ef-4589-a572-b4486ad4d71b | ironsoul0/acm | Algos & DS/LKSH/Day 2/Kuhn_Algorithm.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int64;
const int N = (int) 1e2 + 7;
const double EPS = (double) 1e-6;
#define fs first
#define sc second
///<NAME> находит максимальное паросочетание в двудольном графе
///Задача:
///Дано имя из латинских букв. Даны кубики на которых написаны некоторы... | ALGO | 0.999999 | 3.415497 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-09-19T16:32: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": "8012bc0b4a... |
e44da9a2-2f81-4eb3-9a01-eec399f325a1 | ParthPan7/Data-Structures-And-Algorithms---Problem-Solving | ValidPath.cpp | /*
Valid Path - InterviewBit (Graph DS)
There is a rectangle with left bottom as (0, 0) and right up as (x, y). There are N circles such that their centers are inside the rectangle.
Radius of each circle is R. Now we need to find out if it is possible that we can move from (0, 0) to (x, y) without touching any circle.... | ALGO | 0.999818 | 4.51229 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2021-05-30T01:50: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": "80c7eb6ce5a... |
6b8cd153-badc-4e7a-b6c8-407e26046f78 | adityasharma28/tire_leetcode_day14 | tire_leetcode_day14.cpp | struct TrieNode {
bool isEnd;
TrieNode *child[26];
TrieNode(){
isEnd = false;
for(int i=0;i<26;++i)
child[i] = NULL;
}
};
class Trie {
public:
/** Initialize your data structure here. */
TrieNode *root = new TrieNode();
/** Inserts a word into the trie. */
vo... | ALGO | 0.999744 | 5.16061 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-05-14T11:47:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12ba7c6394... |
baf13356-7c6b-49ec-9aa1-4cfc0ffbab6a | Ahmed-Zaher/CompetitiveProgramming | SPOJ/SPOJ CRAYON.cpp | /*
* Let's first compress all integers we see into integers from 0 to MX
* The thing to note here is that the number of segments having one point in
* common with a range [l, r] = total number of segments (that aren't cleared)
* - (# segs ending at r_seg < l + # segs starting at l_seg > r)
* So this r... | ALGO | 0.999867 | 4.770818 | {
"github_metadata": {
"branch": "master",
"commit_count": 219,
"repo_created_at": "2020-01-25T18:42:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "089ecef7... |
fb241c27-0d5c-412f-917f-0812ff2c593e | ishandutta2007/codeforces-u | uryuuu/normal/1383/B.cpp | #include<iostream>
#include<stdio.h>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<string>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<unordered_map>
#include<time.h>
#include<cstdlib>
typedef long long ll;
//#pragma comment(li... | ALGO | 0.999836 | 3.389852 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb4f4bcc4059... |
bc2114eb-8ce1-4861-81b9-29d2d8f84c23 | surajkr20/DSA | 2D-Vectors/NintDClockwise.cpp | // Ques. write a program to rotate the matrix by 90 degrees clockwise. (leetcode 48)
#include<iostream>
#include<vector>
#include<climits>
using namespace std;
int main(){
int m;
cout<<"Enter the no of row/collumn : ";
cin>>m;
int arr[m][m];
for(int i=0; i<m; i++){
for(int j=0; j<m; j++){... | ALGO | 0.999834 | 5.634114 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-01T10:39:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afbd49d74459... |
2252be55-c294-41f2-817f-f9bab68f680d | rlagmltn/MyC-Learning | MyC++Learning/OCA.cpp | //#include <iostream>
//#include <vector>
//using namespace std;
//
//vector<pair<int, int>> xy;
//int n, m, cnt;
//int dx[] = { 0, 0, 1, -1 };
//int dy[] = { -1, 1, 0, 0 };
//bool visited[101][101] = { false };
//
//void solve(int x, int y, int c)
//{
// visited[x][y] = true;
// if (c == n) return;
// for (int i = 0; ... | ALGO | 0.999926 | 3.409656 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2022-12-15T00:45: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": "17be1e6be... |
d2cc7f37-eff0-4986-bbf3-18745dbedfa3 | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/13_22136_28.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <ctype.h>
using namespace std;
typedef long long LL;
typedef long double LD;
const int inf=1000000000, N=100+5;
const double eps=1e-10;
LL unlucky(LL n, LL p) {
... | ALGO | 0.999217 | 4.214627 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "279ad0aa9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.