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 |
|---|---|---|---|---|---|---|---|
373980be-a994-4422-833b-96234d9ae7d4 | Bungmint/competitiveprogramming | contest/codeforces/786/C.cpp | // Copyright © 2022 <NAME>. All rights reserved.
//#pragma GCC optimize("O3")
//#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
#pragma region TEMPLATE
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using vpi = vector<pii>;
using pll = pair<ll, ll>;
using vl = vecto... | ALGO | 0.999888 | 4.730948 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2021-02-28T11:36: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": "41bbb2261... |
581ee296-0268-4268-8d80-0b20f5c1da10 | egirizkiyan/tugas-praktikum-alpro-sortir- | jawaban2.cpp | #include <iostream>
#include <string>
// Fungsi untuk menukar dua elemen dalam array
void swap(std::string &a, std::string &b) {
std::string temp = a;
a = b;
b = temp;
}
// Fungsi untuk mengurutkan array menggunakan algoritma Bubble Sort
void bubbleSort(std::string arr[], int n) {
for (int i = 0; i < ... | ALGO | 0.999865 | 5.516095 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-26T18:25: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": "dfd5b251b4a8... |
2d05119a-51b5-4d53-ba52-c9690cb90b78 | cdht/Algorithm | BinaryTreeFlattenBinaryTreetoLinkedList.cpp | /*
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ \
2 5
/ \ \
3 4 6
The flattened tree should look like:
1
\
2
\
3
\
4
\
5
\
6
*/
#include <iostream>
using namespace std;
struct TreeNode {
int val;
TreeNode* left;
TreeNode* ri... | ALGO | 0.999989 | 5.388564 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2015-11-04T15:57:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0949a1a10... |
65c62e8d-a933-445e-8c73-1b26518adb82 | GeorgeLyon/SwiftHDL | mlir/circt/lib/Dialect/FIRRTL/Transforms/InferReadWrite.cpp | //===- InferReadWrite.cpp - Infer Read Write Memory -----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | TOOL | 0.940541 | 5.193735 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-10-24T15:25:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d63a619375c2... |
2662cfbb-7179-4b6b-b5eb-812ddb9b4cc9 | Wildanzulfikar/lsp-c- | Lsp_C++.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
struct Siswa {
string nama;
string password;
int nilai[5];
float rataRata;
int nilaiMax;
int nilaiMin;
};
bool sortByRataRataAsc(const Siswa& a, const Siswa& b) {
return a.rataRata < b.rataRata;
}
bool sort... | TOOL | 0.990069 | 3.602653 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-03-30T16:06:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2134b6d6572... |
a6f58f0e-03a4-4260-ad45-e316cbbbc83b | DavidTrd/Euler2D | Euler2D_0.3/flx.h | #ifndef FLX_H_INCLUDED
#define FLX_H_INCLUDED
#include <vector>
#include <iostream>
#include "data.h"
#include "sit.h"
using namespace std;
data flx(sit& g, int i, vector<data>& w){
data _flx;
int cellL = g.stena[i].indBunLev;
int cellR = g.stena[i].indBunPra;
//Rusanov:
vector<double> ul(2), ... | ALGO | 0.995402 | 3.058519 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-12-07T14:10: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": "0417572a7cfc... |
1bb6d75a-5a7d-4907-a6f5-6359f6780d68 | FedeZara/competitive_programming_solutions | Others/bdgft/bdgft.cpp | // https://www.codechef.com/submit-v2/BDGFT
#include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin >> T;
for (int t = 0; t < T; t++)
{
string s;
cin >> s;
int result = 0;
vector<int> ones_prefix, zeros_prefix;
int ones_count = 0, zeros_count =... | ALGO | 0.999654 | 4.489426 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2022-04-10T20:03: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": "0fbe3f104... |
6abfb054-c0e3-49c9-9d8b-8eb1164f06e9 | redcpp/Competitive-Programming | atcoder/abc_059/D.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef pair<int,int> pii;
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define... | ALGO | 0.99982 | 3.875228 | {
"github_metadata": {
"branch": "master",
"commit_count": 245,
"repo_created_at": "2016-10-10T01:03: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": "9b00fb75... |
d1e2d5ad-f368-41d4-9541-208f0eddd1e4 | k3rb3cks/Practice_Repo | reverseArr.cpp | #include<bits/stdc++.h>
void reverse_d(int arr[], int d)
{
for(int i = 0; i < d/2; i++)
{
int temp = arr[d - i - 1];
arr[d - i - 1] = arr[i];
arr[i] = temp;
}
}
void reverse_rem(int arr[], int n, int d)
{
for(int i = d; i < (n + d - 1)/2; i++)
{
int temp = arr[n + d... | ALGO | 0.999819 | 4.917184 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-07-11T16:38:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e17a0194f1c... |
509717c6-06fe-4890-b6c0-c9c98a3349dd | CallMeQan/Training-for-HSG-HCM-vietnam-2024 | cplusplus/contest/de_kt_thang10/b.cpp | /*
author: Qan
*/
#include <bits/stdc++.h>
#include <vector>
#define fi first
#define se second
#define pb push_back
#define int long long
#define PI 3.1459
#define endl "\n"
#define pii pair<int,int>
using namespace std;
const int MOD = 1e9+7;
const int N = 1e6 + 9;
bool multiTestCases = false;
int n;
int a[N];
... | ALGO | 0.999693 | 4.91793 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2023-07-05T11:13:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bdd8aa9049... |
3d67d9f5-ede0-4ed5-96b0-670a039d9168 | BrandonW24/CS475-Parallel-Programming | project0/prog0.cpp | // ConsoleApplication2.cpp : Defines the entry point for the console application.
//
#include <omp.h>
#include <stdio.h>
#include <math.h>
#include <cstdio>
#include <float.h>
//#define NUMT 4 //Change this to NUMT 1 for the first part, take the timing, then back to 4 and take the runs.
#define SIZE 55000 //... | ALGO | 0.99661 | 3.930255 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-09-26T04:48: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": "525e435de... |
a51bddd0-5112-4722-81e6-665c25a0bd74 | amritansh22/Data-Structures-and-Algorithms-in-cpp | Delete_element_from_circular_linkedlist.cpp | #include <bits/stdc++.h>
using namespace std;
// Structure of a node
class Node {
public:
int data;
Node* next;
};
// Insert a node at the beginning
void pushBeg(Node **head, int data){
Node *newNode = new Node();
newNode->data = data;
newNode->next = *head;
if(*head != N... | ALGO | 0.999754 | 4.926357 | {
"github_metadata": {
"branch": "master",
"commit_count": 555,
"repo_created_at": "2019-09-17T12:42:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 382,
"forks": 342,
"issues": 14,
"pull_requests": 86
},
"file_meta": {
"content_id": "69... |
74679eb2-c7b3-4f7b-891a-d03d9e37d09a | SahilKuchlous/CP | APIO/bridge.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
bool comp (const pair<int, int> p1, const pair<int, int> p2) {
return p1.first+p1.second < p2.first+p2.second;
}
priority_queue<int> lpq;
priority_queue< int, vector<int>, greater<int> > rpq;
long long lsu... | ALGO | 0.999661 | 3.657599 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2021-01-14T07:06:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "468ed6db7bd... |
8e63fe94-c0ed-4086-b349-10e7c7baadac | Cbkhare/Challenges | HackerRank_ClassesBoxIt.cpp | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <ostream>
using namespace std;
#define DE... | ALGO | 0.994506 | 3.506793 | {
"github_metadata": {
"branch": "master",
"commit_count": 519,
"repo_created_at": "2015-08-13T16:35:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c6c7414... |
870f1e83-5f29-4fa5-b8c3-2f2a1377e81d | sumit-raghukant-soni/Leetcode_Solutions | 147-insertion-sort-list/insertion-sort-list.cpp | /**
* Definition for singly-linked list.
* 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) {}
* };
*/
class Solution {
public:
void insert(stack<Lis... | ALGO | 0.999998 | 5.952025 | {
"github_metadata": {
"branch": "main",
"commit_count": 3622,
"repo_created_at": "2023-08-17T22:13:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81496cb70... |
c3d65e5d-6049-41ba-93b7-26f1fb4f386d | mauriciopoppe/competitive-programming | UVa/10500/10503.the-domino-solitaire.cpp | #include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<cctype>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<string>
#include<bitset>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<stack>
#include<sstream>
#include<utility>
#include<numeric>
#include<func... | ALGO | 0.999894 | 3.963849 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2018-02-05T05:31:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4bfc86988... |
79e1791f-1580-4230-891d-c1a9bc982647 | paal-prime/paal-bs | facility_location/MCTS_fl.h | #ifndef FACILITY_LOCATION_MCTS_FL_H_
#define FACILITY_LOCATION_MCTS_FL_H_
#include <mcts/MonteCarloTree.h>
#include <random>
#include <limits>
#include <cmath>
#include <algorithm>
#include <vector>
#include <numeric>
#include <functional>
#include <utility>
namespace facility_location
{
using mcts::Fitness;
/... | ALGO | 0.99945 | 6.763145 | {
"github_metadata": {
"branch": "dev",
"commit_count": 382,
"repo_created_at": "2013-07-16T07:50:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5be5fe2ebe6a... |
12e631a2-9289-4b6a-9d9b-b8fd5414db99 | pedroteosousa/maratona | online-judges/codeforces/950/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define debug(args...) fprintf(stderr,args)
#define pb push_back
#define mp make_pair
typedef long long ll;
const int N = 5e6 + 5;
const ll inf = 1791791791;
const ll mod = 1e9+7;
int b[N];
int v[N];
int update(int p, int val, int n) {
for(;p < n; p += p & -p) b[p] +=... | ALGO | 0.999936 | 3.439719 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2017-03-12T00:00: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": "03e62ee8... |
3feae10a-45c2-461b-9817-a987680ae0a5 | gpeyre/numerical-tours | matlab/toolbox_graph/mex/fm2dAniso.cpp | #include "fm2dAniso.h"
void mexFunction( int nlhs, mxArray *plhs[],
int nrhs, const mxArray*prhs[] )
{
//------------------------------------------------------------------
/* retrive arguments */
//------------------------------------------------------------------
if( (nrhs!=3) && (nrhs!=4) )
mexErrMsgTxt... | ALGO | 0.99805 | 3.031621 | {
"github_metadata": {
"branch": "master",
"commit_count": 554,
"repo_created_at": "2013-10-22T08:19:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 826,
"forks": 330,
"issues": 28,
"pull_requests": 4
},
"file_meta": {
"content_id": "da6... |
9773ba72-799b-4817-a2d5-9230ef7c64ba | saurav-inde/Maze-solver-Pid-and-Iterative- | Maze follower/final/final.ino | #define MOTOR_RIGHT_FORWARD 10
#define MOTOR_RIGHT_BACKWARD 11
#define MOTOR_RIGHT_PWM 6
#define MOTOR_LEFT_FORWARD 8
#define MOTOR_LEFT_BACKWARD 9
#define MOTOR_LEFT_PWM 5
// #define FRONT_LEFT_IR A3
#define FRONT_RIGHT_IR 4
#define FRONT_CENTER_IR 3
#define EXTREME_LEFT_IR A5
#define EXTREME_RIGHT_IR 12
int senso... | TOOL | 0.945179 | 3.99139 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-08-20T16:35:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9707a75f23... |
a99ef481-9ee1-4b07-a66c-c232322009e1 | K-ona/CPPTraining | LeetCode/300/229.cpp | class Solution {
public:
vector<int> majorityElement(vector<int>& nums) {
vector<pair<int, int>> Con = {{INT_MAX, 0}, {INT_MIN, 0}};
for (int i = 0; i < nums.size(); ++i) {
bool exist = false;
for (int j = 0; j < 2; ++j) {
if (nums[i] == Con[j].first) {
++Con[j].second;
... | ALGO | 0.999992 | 5.531239 | {
"github_metadata": {
"branch": "main",
"commit_count": 531,
"repo_created_at": "2020-10-24T07:49: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": "da45b7474d... |
d1e71e02-5aae-4ddd-9586-93d88d32cf93 | Lee-DongWon/Baekjoon_Problems | 1920.cpp | #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
bool search(int left, int right, int num, int *arr1) {
int mid = (left + right) / 2;
bool result;
if (left > right) {
return false;
}
else {
if (arr1[mid] > num) {
result = search(left, mid - 1, num, arr1);
}
else if (ar... | ALGO | 0.999996 | 3.908748 | {
"github_metadata": {
"branch": "master",
"commit_count": 154,
"repo_created_at": "2019-07-23T04:07:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea6ae075... |
10fd4421-97ee-401d-9a37-da04202ab103 | xiaoLann2001/study | forC++/leetcode/图论/深搜/98.所有可达路径/邻接矩阵版/main.cpp | #include <bits/stdc++.h>
using namespace std;
// 邻接矩阵 vector<vector<int>>
// 邻接表 vector<list<int>>
class Solution {
public:
vector<vector<int>> result;
vector<int> path;
void backtracking(vector<vector<int>> &graph, int s) {
// 终止条件
if (s == graph.size() - 1) { // 若到达终点 n, 记录 path,并返回
... | ALGO | 0.999984 | 4.271445 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2024-04-09T00:39: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": "b447284bf13... |
de238333-27e0-4f48-bb3f-ad34c1333b5b | alifakahr186/Data-Structures-and-Algorithms | Tree/BinaryTree/Traversal/Inorder.cpp | #include <iostream>
#include <limits>
using namespace std;
class Node {
public:
int data;
Node *left, *right;
// Constructor to initialize the node with data and nullptr children
Node(int value) {
data = value;
left = right = nullptr;
}
};
class BinaryTree {
public:
Node*... | ALGO | 0.999954 | 6.514413 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-02-05T13:17: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": "1bf14cc1dd1... |
ed5c8807-b2a0-4fb4-8ceb-dff475b9f656 | pablo-Acha/Progra-Competitiva | CodeforcesRound1029/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define pb push_back
#define all(x) x.begin(), x.end()
#define rndl " \n"
ll MAXN = 1e5+100;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
int n;
... | ALGO | 0.999938 | 4.185684 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-07-03T20:54: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": "5275bc5875... |
0f75b5b4-6288-4a54-abcc-9f942a0dff8c | tanh-x/voronoi-viz | include/utils/SplayTree.hpp | #ifndef SPLAYTREE_HPP
#define SPLAYTREE_HPP
#include <iostream>
#include <sstream>
void splayTreeTest1();
void splayTreeTest2();
void splayTreeTest3_4();
template<typename K, typename V = std::less<K>>
class Node {
public:
K key;
V value;
Node<K, V>* left {nullptr};
Node<K, V>* right {nullptr};
... | ALGO | 0.92344 | 6.166137 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-04-23T10:06: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": "2f910c02d60... |
5fda95ae-e4fa-4b9e-848a-76d74b9ab3ad | vivek22122014/21daysofcode | rearrangearr.cpp | //Rearrange array such that arr[i] >= arr[j] if i is even and arr[i]<=arr[j] if i is odd and j < i
//Given an array of n elements. Our task is to write a program to rearrange the array such that
//elements at even positions are greater than all elements before it and elements at odd positions are less than all elemen... | ALGO | 0.999947 | 4.196241 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-12-21T20:49: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": "13c0d77b0c5d... |
07c9c7c7-93ff-492b-896f-6a95a11c0a1e | simongog/sdsl-lite | lib/lcp_support_tree.cpp | #include "sdsl/lcp_support_tree.hpp"
namespace sdsl
{
void construct_first_child_lcp(int_vector_buffer<>& lcp_buf, int_vector<>& fc_lcp)
{
typedef int_vector_size_type size_type;
size_type n = lcp_buf.size();
if (n == 0) { // if n == 0 we are done
fc_lcp = int_vector<>(0);
}
{
int_... | ALGO | 0.996402 | 4.69818 | {
"github_metadata": {
"branch": "master",
"commit_count": 1969,
"repo_created_at": "2013-02-28T22:34:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2269,
"forks": 354,
"issues": 71,
"pull_requests": 25
},
"file_meta": {
"content_id": "... |
7aeeb391-41ae-47e9-8b82-c7785cde3105 | Kfkcome/lougu | csp/2023-03-4.cpp | #include <bits/stdc++.h>
using namespace std;
int n, q;
struct range
{
unsigned long long l, r;
int id;
} user[20001];
int top;
unsigned long long hexToDec(string a) // 十六进制字符串转整形
{
int result = 0;
for (int i = 0; i < a.size(); i++)
{
if (a[i] >= '0' && a[i] <= '9')
{
res... | ALGO | 0.999659 | 3.950774 | {
"github_metadata": {
"branch": "main",
"commit_count": 151,
"repo_created_at": "2023-07-16T08:07:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "854d529287... |
af4922d5-2178-4cd8-9255-2866052785b7 | danyanp/algorithm | 大数运算/Fibonacci.cpp | #include<stdio.h>
#include <time.h> //用到clock()函数
#include <iostream>
using namespace std;
int fibonacci(int n){
if (n == 1 || n == 2) {
return 1;
}else{
return fibonacci(n - 1)+fibonacci(n - 2);
}
}
long fib(int n, long a, long b, int count)
{
if (count == n) return b;
return fib(n, b,... | ALGO | 0.999944 | 4.248496 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-01-05T07:55:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab8e80d4f2... |
42c6308f-74c5-4ea8-8453-95abecc9a2f1 | omd24/vulkan-demo-framework | VulkanDemoFramework/Framework/Foundation/Bit.cpp | #include "Bit.hpp"
#include "Memory.hpp"
#include <string.h>
namespace Framework
{
uint32_t trailingZerosU32(uint32_t x)
{
/*unsigned long result = 0; // NOLINT(runtime/int)
_BitScanForward( &result, x );
return result;*/
#if defined(_MSC_VER)
return _tzcnt_u32(x);
#endif
}
uint32_t leadingZeroesU32(uint32... | TOOL | 0.907701 | 6.424076 | {
"github_metadata": {
"branch": "main",
"commit_count": 109,
"repo_created_at": "2023-02-10T16:32: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": "4970267d17... |
b437be8b-c24c-4bc5-ab9e-5b5f670bde88 | manishdevX/leetcode-solutions | rearrange-array-elements-by-sign.cpp | // LINK - https://leetcode.com/problems/rearrange-array-elements-by-sign/description/
// n = size of nums
// Solution 1 TC = O(n), SC = O(1)
// TLE
class Solution
{
public:
vector<int> rearrangeArray(vector<int> &nums)
{
int n = nums.size();
for (int i = 0; i < n - 1; i++)
{
... | ALGO | 0.999998 | 5.56893 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2023-07-17T20:22:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0a28ef0c... |
db25bdd2-9fba-49dc-9100-48c1b74c3f29 | karin0/problems | conts/cf/r484d2/a.cpp | #include <bits/stdc++.h>
#define rep(__i,__s,__t) for((__i)=(__s);(__i)<=(__t);++(__i))
#define re(__i,__s,__t) for((__i)=(__s);(__i)<(__t);++(__i))
#define per(__i,__s,__t) for((__i)=(__s);(__i)>=(__t);--(__i))
#define pe(__i,__s,__t) for((__i)=(__s);(__i)>(__t);--(__i))
#ifdef AKARI
#define SAY(x) std::cerr << #x... | ALGO | 0.999995 | 3.635435 | {
"github_metadata": {
"branch": "master",
"commit_count": 225,
"repo_created_at": "2017-05-22T16:54:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5100157c... |
a5b1ab7a-a48f-4113-bd79-16f87b6e61ae | 2k3hocviec/28tech | Graph/BT17Graph.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
int n, m, s,t, i, j, chuaxet[100], truoc[100];
vector <int> Ke[100];
void Init(){
cin >> n >> m;
while(m--){
cin >> i >> j;
Ke[i].push_back(j);
Ke[j].push_back(i);
}
for (int i = 1... | ALGO | 0.999994 | 4.247313 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-06-16T07:39: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": "9702ef69279f... |
bc273151-7692-4b2e-82cb-3dca31a4d088 | shishircsehstu/uva-Accepted-code | 10474 - Where is the Marble?.cpp | #include<bits/stdc++.h>
#define all(v) v.begin(),v.end()
#define sc scanf
#define si(t) scanf("%d",&t)
#define sl(t) scanf("%I64d",&t)
#define sii(a,b) scanf("%d%d",&a,&b)
#define pt(a) printf("%d\n",a)
#define PLN(a) printf("%I64d\n",a)
#define pf printf
#define gcd(a,b) __gcd(a,b)
#define ff first
#define ss seco... | ALGO | 0.999631 | 3.207487 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2017-08-26T19:18: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": "986149ae... |
901fb966-7a40-4a81-8a77-b354b02f781c | MaryannXu/hw4 | equal-paths.cpp | #ifndef RECCHECK
//if you want to add any #includes like <iostream> you must do them here (before the next endif)
#include <stdlib.h>
#include <algorithm>
#endif
#include "equal-paths.h"
using namespace std;
// You may add any prototypes of helper functions here
/*
bool isHeightBalancedHelper(Node * node, int& heigh... | ALGO | 0.999905 | 5.033988 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-03-20T20:29: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": "9fa401d94c5d... |
6ac43b54-de6b-49cf-97a2-c13c361b7776 | dtr-beast/Competitive-Programming | Relevel.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
bool sort_func(vector<int> a1, vector<int> a2)
{
if (a1[0] < a2[0])
return true;
if (a1[0] == a2[0])
return a1[1] < a2[1];
return false;
}
signed main()
{
int n;
cin >> n;
vector<vector<int>> a(n, vector<int>(3... | ALGO | 0.999964 | 3.886561 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2020-10-16T15:01:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f72d2992... |
afd66d60-a41c-4373-85a9-f12752012d5c | cy1366371760/CP | abc367/f/sol.cpp | #include<bits/stdc++.h>
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define sc second
#define pii pair<int, int>
#define pll pair<ll, ll>
template<typename T> bool chkmin(T &a, T b){return (b < a) ? a... | ALGO | 0.999966 | 4.337474 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-10-09T22:22: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": "a5e966e7f86... |
2dee9932-caa3-4ae2-ae3b-cdbec4c37b65 | init-nahuel/progra-competitiva | catedras/grafos_II/Algoritmo_de_Kruskal.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// Necesitamos UnionFind para Kruskal
struct DSU{ //Disjoint Set Union (o Union Find)
// Casi O(1) amortizado
vector <int> parent, sz; // sz = size
DSU(int n){
parent.resize(n);
sz.resize(n);
for(int i=0; i<n; i++)... | ALGO | 0.99999 | 4.85538 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2023-03-15T03:27: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": "561194c897... |
e97b32f8-8b0a-4856-ba18-90d4cd8b35e9 | celinaark/modele-epidemiologique-multi-agent | C++/Simulation.cpp | // Simulation.cpp
#include "Simulation.hpp"
#include <iostream> // Pour std::cout, std::cerr pour les messages et debugging
#include <algorithm> // Pour std::shuffle pour l'ordre aléatoire des agents
#include <vector> // Utilisation intensive de std::vector
#include <cmath> // Pour std::log (dans generer_temps_... | ALGO | 0.9993 | 5.935694 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-16T21:54: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": "068464bbc68d... |
9fdebd30-b2cb-4e20-9495-09dfe597b7ef | de-fernandez/DSA-CpE-010-CpE21S4 | Hands-on Activity 5.1 Queues/HOA 5.1, (Table 5 - 3) - Fernandez, CPE21S4, CPE 010.cpp | #include <iostream>
using namespace std;
class Queue {
private:
int* q_array;
int capacity;
int q_size;
int q_front;
int q_back;
void copyQueue(const Queue& other) {
capacity = other.capacity;
q_size = other.q_size;
q_front = other.q_front;
q_back = other.q_back... | ALGO | 0.921439 | 5.264135 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2024-08-12T06:41: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": "cdc79599e15... |
93d68b87-cf0a-48c6-a137-b5873d94d672 | danielvallejo237/OptEstocastica | GeneticAlgorithms/Tarea4/GridEvaluator.cpp | #include "GridEvaluator.h"
GridEvaluator::GridEvaluator()
{}
GridEvaluator::GridEvaluator(KusiakLayoutEvaluator * simulator_, WindScenario * scenario_,
int gridWidth_, int gridHeight_)
{
simulator = simulator_;
scenario = scenario_;
simulator -> initialize(*scenario);
N = scenario -> nturbines;
TerrainWidth ... | ALGO | 0.955736 | 4.796082 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-02-02T16:39: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": "c22811ebdfe... |
75eaf485-96b0-43d2-adaa-1330f65b7d9f | DKrepsky/PDI | aula6/ex2/src/main.cpp | /*
* Apresente uma tabela que mostra todos os setes momentos centrais normalisados
* e invariantes. Veja Gonzalez (2010) pagina 555. Não esqueça de apresentar os
* dados no formato sinal(phi[i])log10(|phi[i]|).
*
* Referencia:
* - Gonzalez (2010)
*/
#include <iostream>
#include <cmath>
#include <opencv2/opencv.... | ALGO | 0.999118 | 4.862477 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2017-09-19T15:30:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13ec9953b... |
fb07f83b-8182-48fd-9eec-a0ea06be8b1a | nshetty836/CollegeDatabase | BST.h | #ifndef BST_H
#define BST_H
#include <iostream>
#include <cstddef>
#include <algorithm>
using namespace std;
template <class T>
class TreeNode{
public:
TreeNode();
TreeNode(int key, T data);
virtual ~TreeNode();
int key;
T data;
TreeNode<T>* left;
TreeNode<T>* right;
};
template <class... | ALGO | 0.993141 | 3.415631 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2020-11-24T19:43:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d30e97f043... |
5bc21d1c-dc26-457d-ad1f-3847c4dd257b | AndyThio/multithreadingcilk | shortest_path/edgeCentric/main.cpp | #include <iostream>
#include <chrono>
#include <cilk/cilk.h>
#include <cilk/cilk_api.h>
#include <cilk/reducer.h>
#include <vector>
#include <ctime>
#include <utility>
#include <atomic>
#include <limits>
using namespace std;
using namespace std::chrono;
const unsigned int inf = numeric_limits<unsigned int>::max();
... | ALGO | 0.999984 | 5.121718 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2016-10-10T22:10: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": "0fde9a09e... |
23155bed-80a0-4ae7-9893-b38d6c0c3eb0 | tatsumack/atcoder | dp/J.cpp |
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include ... | ALGO | 0.999864 | 3.79368 | {
"github_metadata": {
"branch": "master",
"commit_count": 527,
"repo_created_at": "2018-03-12T23:22: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": "458c4ec3... |
44f60470-7884-4a3d-b0ec-fe15faaf48d3 | DenKisliy/SlayTheSpire_DungeonArchitect_UE5 | EnvironmentBuilder/Plugins/DungeonArchitect/Source/DungeonArchitectRuntime/Private/Builders/Grid/Stair/GridDungeonStairGenerator.cpp | //$ Copyright 2015-24, Code Respawn Technologies Pvt Ltd - All Rights Reserved $//
#include "Builders/Grid/Stair/GridDungeonStairGenerator.h"
#include "Builders/Grid/GridDungeonBuilder.h"
#include "Builders/Grid/GridDungeonBuilderLib.h"
#include "Builders/Grid/GridDungeonModel.h"
/////////////////////// Base Stair G... | ALGO | 0.982759 | 6.159986 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-06T14: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": "d5f8e8a0c645... |
5837d994-0a13-4956-a41f-57732d625371 | raincross7/code-similarity | codes/train_code/problem335/problem335_358.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;
typedef long long ll;
const ll inf = 1e15;
ll mod = 1000000007;
ll modfact(ll a) {
ll res = 1;
while(a) {
res = res * a % mod;
a--;
}
return res;
}
int main() {
ll n... | ALGO | 0.999982 | 3.6184 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fe43d7b9272... |
d0249255-5336-458c-a222-b2500b7df164 | ParthGupta84616/LeetCode | 54.cpp | class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
int n = matrix.size(), m = matrix[0].size();
int top = 0, right = m - 1;
int bottom = n - 1, left = 0;
vector<int> ans;
while (left <= right && top <= bottom) {
// top -> right
... | ALGO | 0.999999 | 6.624456 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2025-05-02T15:27:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17f44119d15... |
0f807ff5-8001-4a92-86b7-bbddddac6ccf | dakdevs/Moorpark-Computer-Science | M10B/Homework/Homework-2.cpp | // <NAME> - CS M10B
/* ****************************************************
ASSIGNMENT -------------------------------------------
Design a class that will determine the monthly payment
on a home mortgage. The class should have member
functions for setting the loan amount, interest rate,
and number of years of the... | ALGO | 0.957728 | 4.570451 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2015-09-29T19:22:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "592e5954... |
dcb5a60b-d5e9-4302-a1af-37711f0d0383 | dgtoan/THCS2_PTIT | SoDep2_ver1.cpp | #include <stdio.h>
#include <math.h>
int sum(int a[20], int n) {
int s = 0;
for (int i = 0; i < n; i++)
s += a[i];
return s;
}
int dx(int a[20], int n) {
for (int i = 0; i < n/2; i++)
if (a[i] != a[n-i-1]) return 0;
return 1;
}
int dep(int n) {
int a[20], i = 0;
while (n >... | ALGO | 0.993988 | 3.94716 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-03-26T10:05:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04133bd03b2... |
897b6643-2fc3-4b80-912b-a8038dfd93c9 | Lebokomape/guessing-game | quadratic/quadratic.cpp | #include <iostream>
#include <complex>
#include <cmath>
using namespace std;
int main() {
using Complex = complex<float>;
int a = 0, b = 0, c = 0;
char choice;
do {
cout << "Enter integers coefficient of a: ";
cin >> a;
cout << "Enter integers coefficient of b: ";
cin >... | ALGO | 0.90366 | 3.66538 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-28T18:33: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": "9782a1fa9384... |
725485cf-c8c7-45d4-8f12-facbabfb6d62 | l0nl1f3/1-l0nl1f3-s-code-repo | HackerEarth/AugustCircuits17/GaryinOSClass/GaryinOSClass_2.cpp | #include <bits/stdc++.h>
#define fir first
#define sec second
using namespace std;
typedef long long LL;
template <typename T> inline bool cmin(T & a, const T & b) { return a > b ? a = b, 1 : 0;}
template <typename T> inline bool cmax(T & a, const T & b) { return a < b ? a = b, 1 : 0;}
int inp() {
int x = 0, f = 1... | ALGO | 0.999875 | 3.084202 | {
"github_metadata": {
"branch": "master",
"commit_count": 328,
"repo_created_at": "2017-02-11T04:20:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aeb0b2ab... |
74d6c9f2-20b3-4f97-b138-cdb3e75b2408 | platypuxbepo/conf_files | coding_learning/07/733b.cpp | #include <iostream>
using namespace std;
#define lgt 5 // LD addition to change the nb of indices,
// lower is easier for testing.
void sort(int n);
void swap (int *p1, int *p2);
int arr[lgt];
int main()
{
for (int i = 0; i < lgt; ++i) {
cout << "Enter array element #" << i << ": ";
cin >> a... | ALGO | 0.999764 | 5.039612 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2016-11-14T06:48:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8533a89... |
be1d5d58-1016-46ec-90ad-be59e8cdd94e | SwitchWasp/a | cpp/sprawdzian/main.cpp |
#include <iostream>
#include <string>
using namespace std;
string liczba;
int main() {
cout << "Program sprawdzajacy czy liczba jest palidromiczna\n";
cout << "Podaj calkowita liczbe dodatnia: ";
cin >> liczba;
int liczba_1 = stoi(liczba, nullptr, 10), i = 0, j = liczba.length();
cout << liczb... | ALGO | 0.998759 | 4.211256 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-10-26T17:21:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "358f6dc2775... |
5cf43d5d-3625-4081-8007-a343c4c8c722 | ssc1729-archived/MissionRnD-C-Recursion-Worksheet | src/Spiral.cpp | /*
Write a program to generate elements of a matrix in spiral order.
Store the generated elements in single dimensional array and return that array.
Directions for Spiral are : Go Right ,Go Down ,Go Left, Go Up
Ex:
Matrix:
1 2 3
4 5 6
7 8 9
Spiral order:
1 2 3 6 9 8 7 4 5
Given matrix is a two dimensional array(inp... | ALGO | 0.999897 | 5.506095 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2016-03-24T12:21: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": "d7c997874... |
a604887a-fe9c-43e9-b7f0-b96a003438ad | ishandutta2007/codeforces-m | mangooste/normal/1647/F.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define all(a) begin(a), end(a)
#define len(a) ((int)((a).size()))
int main() {
ios::sync_with_stdio(false), cin.tie(nullptr);
int n;
cin >> n;
vector<int> a(n);
for (auto &x : a) cin >> x;
const... | ALGO | 0.999887 | 4.147209 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "ec4fb16ea44b... |
9ebbf1b0-a4b2-434b-9d88-ded2f74c05a0 | lakshmanaram/Competitive-programming | kickstart-17/round c/B-small.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ifstream infile;
ofstream outfile;
long long t;
infile.open("B-large.in");
outfile.open("B-output.out");
infile>>t;
for(long long tk=1;tk<=t;tk++){
int n;
infile>>n;
bool flag = true;
vector<string> arr... | ALGO | 0.999858 | 4.354537 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2015-11-15T14:22:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ab84b99... |
2b1046fa-f60e-4a1c-873d-4764f3125dc6 | ishandutta2007/codeforces-q | qwertypi/normal/1228/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<set<int>> graph(300000);
vector<pair<int, int>> A;
int ans[300000];
ll f(ll x){
return x * (x - 1) / 2;
}
int main(){
fill(ans, ans+300000, 2);
int n, m;
cin >> n >> m;
for(int i = 0; i < m; i++){
int v1, v2;
cin >> v1 >> v2;
v1--;... | ALGO | 0.999959 | 3.553765 | {
"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": "fac6ef508a79... |
4a43132b-3794-461d-abb0-ef959042b848 | Mobius0100/Code | CPP/OJ/HDOJ/2093_str.cpp | /*
涉及字符串输出控制,字符串转数字,表格形式,可作为典型例题;
*/
#include <algorithm>
#include <string>
#include <iostream>
#include <cstdio>
using namespace std;
const int maxn = 10010;
struct Student{
char name[10];
int ac_cnt,tscore;
}stu[maxn];
//输入:字符串s,字符串的起始和末尾位置
//输出:转换后的数字
int str2num(string s, int start, int end){
... | ALGO | 0.998716 | 3.325377 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-04-11T08:12: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": "04ee4f192a1... |
48fe0df5-0cc8-44ed-869f-d841c15ed4a2 | cbritopacheco/rodin | examples/BoundaryOptimization/AcousticCloaking.cpp | /*
* Copyright <NAME> 2021 - 2022.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at
* https://www.boost.org/LICENSE_1_0.txt)
*/
#include <Rodin/Solver.h>
#include <Rodin/Geometry.h>
#include <Rodin/Math.h>
#include <Rodin/Variational.h... | ALGO | 0.997134 | 4.298293 | {
"github_metadata": {
"branch": "master",
"commit_count": 952,
"repo_created_at": "2021-10-28T14:22:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 51,
"forks": 9,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "287fc59... |
7fcecafd-35a0-45c2-bb5e-5a8f94ed0213 | satyajeetramnit/Placement-2023 | Amazon/Interview (w.r.t. Drive 27.07.2022)/Round 3 (19.08.2022)/mergeNodesBetweenZeros.cpp | #include<bits/stdc++.h>
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) {}
};
ListNode* mergeNodesBetweenZeros(ListNode* head) {
ListNode* ans =... | ALGO | 0.999967 | 4.512203 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2022-05-11T11:05:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 139,
"forks": 33,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "deedcf9f... |
834ef0a8-e9a5-498f-8fd6-390231b80b8c | RiMe-13/ps | baekjoon/1197.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int v, e;
int parent[10001];
vector<pair<int, pair<int, int>>> edge;
int find(int x) {
if (parent[x] == x) return x;
return parent[x] = find(parent[x]);
}
void _union(int x, int y) {
x = find(x);
y = find(y);
if (x !... | ALGO | 0.99997 | 5.18627 | {
"github_metadata": {
"branch": "main",
"commit_count": 148,
"repo_created_at": "2025-03-11T06:16: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": "1d153cbc8b... |
3a4eade7-e5bc-48ce-a6cc-c27bb64e1d1a | google/syzygy | syzygy/optimize/transforms/basic_block_reordering_transform.cc | // Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable... | ALGO | 0.998309 | 7.69485 | {
"github_metadata": {
"branch": "master",
"commit_count": 3143,
"repo_created_at": "2014-09-03T23:55:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 375,
"forks": 59,
"issues": 41,
"pull_requests": 1
},
"file_meta": {
"content_id": "c884... |
d52aaa4e-caeb-4beb-9f1e-27f9891b607c | viralvaghela/hacktoberfest_2021 | cpp/CPP STL/map.cpp | // stores in key-value pair
// all kyes are unique
// stored in sorted order
#include <iostream>
#include <map>
using namespace std;
int main(){
// declaration
map<int,string> mp;
// assigning values
// m[key]=value
mp[1]="Adarsh";
mp[2]="Navneet";
mp[30]="Sinha";
// inserting eleme... | ALGO | 0.985282 | 3.150296 | {
"github_metadata": {
"branch": "main",
"commit_count": 674,
"repo_created_at": "2021-10-02T05:13:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 47,
"forks": 202,
"issues": 1,
"pull_requests": 33
},
"file_meta": {
"content_id": "fb2913... |
97d53e68-713c-4ad4-8dff-4b04e0606283 | takaxyz/atcoder | ABC194/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define PRINT(a) cout << (a) << endl
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ... | ALGO | 0.999851 | 3.30397 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2018-10-28T03:22: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": "f49eaf693... |
ce424d85-33e9-4859-9c54-7f5443aaf001 | vladmihailescu/Judge | Example/source2.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pb push_back
ifstream fin("mana.in");
ofstream fout("mana.out");
vector <pair<double,double> >v;
inline long double dist(double x, double y, double a, double b)
{
return (x-a)*(x-a)+... | ALGO | 0.999899 | 3.608633 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2018-06-24T15:54:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c05ac9c3... |
08a95e3d-fe25-44b7-a4a4-9cd4a923a35b | yashmittal-git/LeetCoding | excel-sheet-column-number.cpp | // 171. Excel Sheet Column Number
// Given a column title as appear in an Excel sheet, return its corresponding column number.
// For example:
// A -> 1
// B -> 2
// C -> 3
// ...
// Z -> 26
// AA -> 27
// AB -> 28
// ...
// Example 1:
// Input: "A"
// Output: 1
// Example 2:
// Inp... | ALGO | 0.999855 | 5.473197 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2019-04-16T13:11:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72ee890b0... |
35d41798-2020-4508-a17e-1257f6d51888 | shyswy/AlgorithmStudy | 2022/7579secondtime.cpp | #include <iostream>
using namespace std;
int mem[101], cost[101];
int dp[101][10001]; //앱의 개수, 비용 총합( 가능한 모든 비용의 합)
const int max_c = 10000;// 100개 앱, 각 비용 100이 최대 따라서 100*100 이 최대 비용.
int main() {
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++)cin >> mem[i];
for (int i = 1; i <= n; i++) cin >> cost[i];
fo... | ALGO | 0.999992 | 3.393165 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-01-16T05:28: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": "16f2b1fd1fdb... |
8e9eb362-a8d2-4493-a0e2-9a38db638273 | toyopo12/Algorithm | 백준/Gold/2572. 보드게임/보드게임.cc | #include <iostream>
#include <vector>
using namespace std;
vector<pair<int, char>> path[505];
char card[1010];
long long dp[505][2];
long long N, M, K, good, awesome, result;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin >> N;
for(int i = 0; i < N; i++) c... | ALGO | 0.999936 | 4.071677 | {
"github_metadata": {
"branch": "main",
"commit_count": 767,
"repo_created_at": "2024-02-10T06:53: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": "d92273f4a9... |
680a560c-f440-456e-8be9-5f4d9e618c81 | asukero/HyperPageRank | HyperPageRank/Hypergraph.hpp | #pragma once
#include <iostream>
#include <string>
#include <memory>
#include <vector>
#include "Node.hpp"
#include "Matrix.hpp"
typedef std::vector<long> IndexList;
template<typename T>
class Hypergraph {
public:
// Constructor
Hypergraph();
// Destructor
~Hypergraph();
// Creates and adds a node to the graph ... | ALGO | 0.985291 | 4.404191 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2016-12-15T21:27: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": "56066f1e9... |
a81a4bdd-586d-409d-8f7a-12356402d63d | una1veritas/Algorithm-Design | C++stringsplit/src/C++stringsplit.cpp | //============================================================================
// Name : C++stringsplit.cpp
// Author : <NAME>
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//===========================================================================... | TOOL | 0.967131 | 4.509119 | {
"github_metadata": {
"branch": "master",
"commit_count": 675,
"repo_created_at": "2015-11-11T13:46: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": "915e4737... |
b4cfe109-b62c-4a58-9b44-3be28f721709 | raincross7/code-similarity | codes/train_code/problem188/problem188_108.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <stdlib.h>
#include <cmath>
#include <math.h>
#include <fstream>
#include <bitset>
#include <time.h>
#include <queue>
//#define int long long
using namespace std;
con... | ALGO | 0.999973 | 3.282456 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb30458552a7... |
3f436834-a574-42bd-8d38-4e550001d056 | lcccc/nfcjcodes | poj1936.cpp | /*
* Author: FreePascal
* Created Time: 2011/10/30 14:28:47
* File Name: poj1936.cpp
*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <deque>
#include <list>
#include <stack... | ALGO | 0.999929 | 3.689832 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2011-12-09T05:04: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": "0d9254d58... |
fa295fbe-7921-49e3-9ec0-fa7b6621eae9 | RooBarsic/ITMO | semestr4/algorithms/stage_1/problem_2025.cpp | /// timus problem : 2025. Стенка на стенку
/// http://acm.timus.ru/problem.aspx?space=1&num=2025
/// We have x groups with a people and y groups with (a+1) peopel& so ans =
/// a(n-a) + a(n-2a) + ... + a(n-xa) + (a+1)(n-xa-(a+1)) +
/// + (a+1)(n-xa-2(a+1)) + ... + (a+1)(n-xa-y(a+1))
/// solution time complexity = O(T)... | ALGO | 0.999932 | 3.596371 | {
"github_metadata": {
"branch": "master",
"commit_count": 302,
"repo_created_at": "2018-09-30T16:11:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "78d66814... |
0af220ac-5e66-4353-ae67-14b964684d61 | kamyu104/LeetCode-Solutions | C++/shortest-completing-word.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
string shortestCompletingWord(string licensePlate, vector<string>& words) {
string result;
const auto& counter = counts(licensePlate);
for (const auto& word : words) {
if ((result.empty() || word.length() < result.length()) ... | ALGO | 0.999898 | 6.58172 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
866c082f-90a0-4356-b346-b903d4ab5529 | TsanRu/SummerCourse_Week1 | Problem_3_sol.cpp | #include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <climits>
using namespace std;
int main() {
vector<int> num1, num2;
string input;
int m, n, left, right, totalLeft;
double median;
cout << "Please enter nums1: ";
getline(cin, input);
... | ALGO | 0.999811 | 3.934179 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-18T08:30: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": "786ee6279e71... |
0d8aa2c3-b7d6-418c-ac40-ff3cce138506 | RiyaJain12/DSA-with-Cpp | heap/insertion.cpp | // node: ith index
// left child: 2*i index
// right child:2*i +1
// parent: i/2 index
#include<iostream>
using namespace std;
class heap{
public:
int arr[100];
int size;
heap(){
arr[0]=-1;
size=0;
}
//time Complexity(O(logn))
void insert(int val){
size=size+1;
int index=size;
a... | ALGO | 0.999708 | 3.68536 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-06-06T14:21:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16fe8dbeb06... |
7064b8d0-650d-4670-bdf0-e18db3ecae4c | murtasgael/MarketSimulation | Simulation/brownian.cpp | Simulation::Simulation(const TimeFrame & tf, size_t & n){
SimulationException::checkConstructor(n);
Chart chart(tf,n);
size = nbTicks*n;
dt = (double)1/nbTicks;
}
void Simulation::toChart(const TabExt<double> & St){
SimulationException::checkToChart(this,St);
for(size_t i=1; i <= chart.taille(); i... | ALGO | 0.997672 | 4.633969 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-26T00:54: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": "bb17970ed1f0... |
e5545715-c708-4b2c-8026-a81be2886d2d | Laquum/uva_exercises | uva/u11728.cpp | /* u11728.cpp */
#include <bits/stdc++.h>
using namespace std;
int main()
{
int k = 0;
int N;
while(cin >> N)
{
if(N == 0)
break;
int S = N;
int sum = 0;
do
{
sum = 0;
vector<int> factors;
int i;
... | ALGO | 0.999976 | 4.316272 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-04-19T12: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": "91f6bc661af... |
0d5d16bb-ac50-4870-9659-002e58b0b2e4 | Taseen2/LEETCODE-PROBLEM-OF-THE-DAY | 2402.cpp | /* You are given an integer n. There are n rooms numbered from 0 to n - 1.
You are given a 2D integer array meetings where meetings[i] = [starti, endi] means that a meeting will be held during the half-closed time interval [starti, endi). All the values of starti are unique.
Meetings are allocated to rooms in the fol... | ALGO | 0.999997 | 6.698597 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2025-07-10T14:15: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": "0c1018ec045... |
216eea87-2658-4b27-8d5f-f40c35f1f398 | rahulmittal4233/Geeksforgeekscode | GFG Tree 1- LeftViewTree.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
struct node
{
int data;
struct node *left, *right;
};
struct node *newnode(int item)
{
struct node *temp = new node;
temp->data = item;
temp->left = temp ->right = NULL;
return temp;
};
/*
void printpre... | ALGO | 0.999384 | 3.400119 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-06-14T07:23: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": "e9e77d6388... |
8d5648b2-2a3a-47db-b77e-3710ed256e16 | libmv/libmv | src/libmv/correspondence/feature_matching_FLANN.h | // Copyright (c) 2009 libmv authors.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish... | ALGO | 0.972456 | 6.338795 | {
"github_metadata": {
"branch": "master",
"commit_count": 859,
"repo_created_at": "2011-05-17T07:35:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 318,
"forks": 83,
"issues": 5,
"pull_requests": 2
},
"file_meta": {
"content_id": "e5f8b9... |
d4ea1516-7353-44e7-831d-05a668b5b1ab | joshualass/CP | Solutions/Default/threestevens2.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t; cin >> t;
while(t-->0) {
int m; cin >> m;
vector<pair<int,int>> sizes(m);
vector<vector<int>> adj(m);
set<int> gone;
for(int... | ALGO | 0.999959 | 4.151208 | {
"github_metadata": {
"branch": "main",
"commit_count": 426,
"repo_created_at": "2023-03-13T21:46: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": "2b622d3d5d... |
56989253-e5de-4f1d-b726-ef0b2cc89464 | YadaYuki/atcoder- | kyopro-tessoku/a56_3.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long N, Q;
cin >> N >> Q;
string S;
cin >> S;
int L = 27;
long long MOD = 1e9 + 7;
long long Hash[N + 1]; // Hash[i] = Hash of S[0..i-1]
Hash[0] = 0;
for (int i = 1; i <= N; i++)
{
Hash[i] = (Hash[i - 1] * L... | ALGO | 0.999882 | 4.595221 | {
"github_metadata": {
"branch": "master",
"commit_count": 1837,
"repo_created_at": "2021-08-12T12:50:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "979f19c... |
aaaa59c0-49f8-4569-99ee-c787ca240710 | glerium/acm-life | codeforces/2098-div-2/B.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define rep(i,x,y) for(int i=x;i<=y;i++)
using namespace std;
typedef long long ll;
constexpr int maxn = 2e5+10;
constexpr ll mod = 998244353;
void solve() {
int n,k; cin >> n >> k;
vector<int> a(n+5);
rep(i,1,n) cin >> a[i];
sort(a.begin() + 1, a.begin() + n +... | ALGO | 0.99997 | 5.014812 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2023-05-16T06:00:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc6154ac3cc... |
eb79a56a-5383-49db-9cb6-049dc95af2b1 | whqnloyd/MyTest | Localization/Practice_purpose/Pose_Estimation.h | // Class Pose estimation is for estimating robot pose (x,y, theta)
#pragma once
#include "SAT_Const.h"
#include "SAT_VecMat.h"
//#include "StdAfx.h"
#define ENCODER_THSH 50000 //
#define W_L 6.5140e-6 // encoder_value * alpha_r = right_wheel_movement(m)
#define W_R -6.5511e-6 // encoder_value * alpha_l = le... | ALGO | 0.966948 | 4.140399 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2018-05-21T01:54: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": "677f44e0... |
905c718f-d95a-4c2a-9be4-40d473e60417 | wonseokdjango/Coursework | TheoryOfComputation/hw03/Kubica/main.cpp | /**
*@File main.cpp
*@Author <NAME>
*@Brief main for Kubica
*/
#include <cstdio>
#include <vector>
#include <algorithm>
#include <time.h>
#include "common.hpp"
static void readInput(char* _fname, std::vector<pat_t>& _p, std::vector<s64_t>& _t);
int main(int argc, char* argv[])
{
clock_t s, e;
st... | ALGO | 0.999943 | 4.582034 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2017-10-09T04:23: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": "9634411e1... |
1c354443-d231-4b40-9b9a-2bf1eda26d18 | larrylai19/CppPractice | UVa/00820-2.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define CLR(c) memset(c, 0, sizeof(c))
static auto __ = []
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
return 0;
}();
template <typename T>
T QPOP(queue<T>& q)
{
T tmp = q.front();
q.p... | ALGO | 0.999894 | 4.431346 | {
"github_metadata": {
"branch": "master",
"commit_count": 274,
"repo_created_at": "2020-06-26T07:56: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": "98c61f39... |
8cb90f7e-c2f1-4490-86de-a035959ade0a | 7hokerz/bakjoon | bakjoonmoeum(C++)/중요유형(잘 모르는)/DP/기초/1로만들기/12852번(역추적).cpp | #include <iostream>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <stdlib.h>
using namespace std;
typedef long long ll; typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<int,pii> rpii;//오른쪽 ... | ALGO | 0.99998 | 3.62263 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2024-05-02T12:50:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "470185330eb... |
9bb69997-2e09-414e-b339-a5207a828894 | jose-brandao/MDTs | src/experiments/threadLocal/manualThreadLocal.cc | #include <atomic>
#include <iostream>
#include <list>
#include <map>
#include <mutex>
#include <thread>
#include <vector>
#define MAXTHREADS 100
#define LOOP 200000000
#define TARGET 50000000
#define BENCH_RUNS 5
using namespace std;
class threadId{
private:
int count;
map<thread::id,int> id;
mutex m;... | TOOL | 0.945392 | 5.558649 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2018-05-10T08:15: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": "f8a41c0c8... |
b75cc3c6-6fd9-493a-a308-7b1faf263c6c | Rahul35500/Practice_codes | Algorithm/Algorithm.cpp | #include<iostream>
#include<algorithm>
#include<numeric>
#include<vector>
#include<list>
using std::vector;
using std::list;
//usinf nae//
using namespace std;
int main()
{
vector<int>v;
for (int i = 0; i < 5; i++)
{
v.push_back(i);
}
for (int i = 0; i < 5;)
{
v.push_back(i++);
}
int i = 0;
std::generat... | ALGO | 0.996184 | 3.420511 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-13T17:12: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": "767503a8cc... |
796fd6d9-2a85-4450-87df-66ca573489cf | raincross7/code-similarity | codes/train_code/problem124/problem124_66.cpp | //include
//------------------------------------------
#include <bits/stdc++.h>
using namespace std;
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.s... | ALGO | 0.999902 | 3.927083 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "335e972dc284... |
2eb25f15-dda8-4faf-960d-48008f84fe7d | BtraRahul/LC-Problems | 2217-step-by-step-directions-from-a-binary-tree-node-to-another/2217-step-by-step-directions-from-a-binary-tree-node-to-another.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.999998 | 6.327693 | {
"github_metadata": {
"branch": "main",
"commit_count": 944,
"repo_created_at": "2024-02-17T18:04:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f2c8a5329... |
2c01b75a-2245-4087-9637-0391f6edf21d | SameerPatil20/Competitive_programming_Sam_2027 | CodeforcesBeforeSummer24/C_Clock_Conversion.cpp | #include<bits/stdc++.h>
#define rp(n) for(decltype(n) i=0;i<n;i++)
#define rp2(n,j) for(decltype(n) j=0;j<n;j++)
#define ll long long int
#define set(a,n,k) for(int lambda=0;lambda<n;lambda++){a[lambda]=k;}
#define out(a,n,k) for(int lambda=0;lambda<n;lambda++){cout<<a[lambda]<<k;}
#define in(a,n) for(int lambda=0;lamb... | ALGO | 0.98822 | 3.484093 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-09-30T16:03: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": "29c565e96f42... |
e2e137b8-f072-46f7-a1ef-a90a18c1fe45 | ApoorvHelper/Buffer_Overflow | README.cpp | // <NAME>..
// This code vulnerable to Buffer Overflow
#include <iostream>
using namespace std;
int main(void)
{
int arr[10];
int arr_num;
int num,i;
cout << "Enter the count of numbers? ";
cin >> num;
for (i = 0; i < num; i++)
{
cout << "Enter a number to be stored: ";
cin >> arr_num;
... | ALGO | 0.970562 | 3.305476 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-11-23T15:22: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": "4b061dc40348... |
50e235b6-7c1f-41e1-a30a-d9587b1b68a8 | CunZy/codetree-TILs | 240815/이상한 진수 2/awkward-digits-2.cpp | #include <iostream>
#include <climits>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
// int n;
// cin >> n;
// int a[20] = {};
// int here = 0;
// while(true) {
// if(n < 2) {
// a[here] = n;
// break;
// }
// a[here++] = n % 2;
// ... | ALGO | 0.999975 | 4.523028 | {
"github_metadata": {
"branch": "main",
"commit_count": 2834,
"repo_created_at": "2023-11-09T03:39: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": "b42cd8a79... |
6ae94e98-69c9-48c4-a711-ceffdd15020f | k4sud0n/codetree-TILs | 240113/정렬된 숫자 위치 알아내기/indices-of-sorted-array.cpp | #include <iostream>
#include <algorithm>
using namespace std;
class Array {
public:
int number;
int index;
Array(int number = 0, int index = 0) {
this->number = number;
this->index = index;
}
};
bool cmp(Array a1, Array a2) {
if(a1.number == a2.number) return a1.index < a2.index;... | ALGO | 0.999976 | 4.70837 | {
"github_metadata": {
"branch": "main",
"commit_count": 612,
"repo_created_at": "2023-11-23T08:33: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": "c8988dad98... |
9d316e8e-37c9-4e8a-89f3-123047f63b11 | Algorithm-study-seoul22/Algorithm-Study | 이재홍/week27/16927_rotating_array_2.cpp | #include <iostream>
#include <vector>
using namespace std;
struct Coordinate {
int x;
int y;
Coordinate(): x(), y() {}
Coordinate(int x, int y): x(x), y(y) {}
Coordinate operator+(const Coordinate& rhs) {return {x + rhs.x, y + rhs.y};}
Coordinate &operator+=(const Coordinate& rhs) {x += rhs.x;... | ALGO | 0.999937 | 4.920851 | {
"github_metadata": {
"branch": "main",
"commit_count": 844,
"repo_created_at": "2023-02-20T03:44:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 6,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "f6b793adc64... |
854f96de-610c-4906-8bd9-51c3990789b8 | pytorch/pytorch | caffe2/serialize/inline_container.h | #pragma once
#include <cerrno>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <istream>
#include <mutex>
#include <ostream>
#include <unordered_set>
#include <c10/core/Allocator.h>
#include <c10/core/Backend.h>
#include "caffe2/serialize/istream_adapter.h"
#include "caffe2/serialize/read_adapter_in... | TOOL | 0.902534 | 7.525668 | {
"github_metadata": {
"branch": "main",
"commit_count": 90499,
"repo_created_at": "2016-08-13T05:26:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 91573,
"forks": 24684,
"issues": 5000,
"pull_requests": 1303
},
"file_meta": {
"content_i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.