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 |
|---|---|---|---|---|---|---|---|
29f69e6a-2692-4d35-8fd6-a66e11573c44 | Tornerro/Algoritmi-Fundamentali | Algoritmi/Dijkstra/main.cpp | #include <iostream>
#include <fstream>
#include <queue>
#include <vector>
#include <climits>
using namespace std;
ifstream fin("dijkstra.in");
ofstream fout("dijkstra.out");
int main()
{
int n, m, x, y, c, s;
fin>>n>>m;
int d[n+1], t[n+1], viz[n+1];
vector <pair <int, int>> v[n+1];
for(int i=1; i<=... | ALGO | 0.999979 | 3.780983 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-03-10T17:23: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": "62aa4d462a... |
63a0cfdc-aea9-4c16-936b-f7ae29aea2cc | dalveer16/Daily-DSA-Practice | Daily Challenge/238-Product-of-Array-Except-Self.cpp | class Solution {
public:
vector<int> productExceptSelf(vector<int>& nums) {
int n = nums.size();
vector<int> leftProducts(n);
vector<int> rightProducts(n);
vector<int> answer(n, 1);
// Calculate products of elements to the left of each element
int product = 1;
for (int i = 0; i < n; i++)... | ALGO | 0.999971 | 6.992486 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2024-03-03T12:54: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": "6f4eb3a2a8... |
7b9babe0-a4ca-46f7-9b82-e42280cfb9dc | RoboTrainerAID/robotrainer_control | robotrainer_controllers/include/drive_modes/ackermann.h | #ifndef ACKERMANN_MODE_H
#define ACKERMANN_MODE_H
#include "drive_modes/differential.h"
#include "drive_modes/pivot.h"
// AckermannMode inherits from DifferentialMode, because it is essentially
// DifferentialMode with a non-zero minimum turning radius.
class AckermannMode : public DifferentialMode {
protected:
... | ALGO | 0.969551 | 6.551188 | {
"github_metadata": {
"branch": "melodic",
"commit_count": 47,
"repo_created_at": "2024-12-17T16:18:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adf994762... |
4fca3c1b-d5a5-4098-b0f4-40c1609f7048 | leanmangun/OOPkohw | (rec)fibonccinumber.cpp | #include <iostream>
int fibonacci(int n) {
if (n == 0) {
return 0; // Base case: F(0) = 0
} else if (n == 1) {
return 1; // Base case: F(1) = 1
}
return fibonacci(n - 1) + fibonacci(n - 2); // Recursive case
}
int main() {
int n;
std::cout << "Enter a non-negative integer: ";
... | ALGO | 0.999676 | 5.978634 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-22T11:35: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": "be5a30b0920e... |
d2ff02d6-f84b-4991-85fc-9a319874b273 | suee97/algorithm | algorithm/삼성DX알고리즘특강/dx05_2.cpp | #include <iostream>
using namespace std;
struct node {
int val;
node* next;
};
int main() {
int test_case;
int T;
cin >> T;
for(test_case = 1; test_case <= T; ++test_case)
{
int n, m, l;
cin >> n >> m >> l;
node pool[2100];
int nodeCnt = 0;
for (int i = 0; i ... | ALGO | 0.999876 | 3.725019 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2022-09-29T11:17: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": "2010a92fe26... |
eb61f9e6-7ded-4357-bf7b-102abdd284be | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/ai_code/train/0_0_1956.cpp | #include <iostream>
#include <string>
#include <unordered_map>
int main() {
std::string s, t;
std::cin >> s >> t;
int n = s.length();
std::unordered_map<char, char> mapping;
for (int i = 0; i < n; i++) {
if (mapping.find(s[i]) != mapping.end()) {
if (mapping[s[i]] != t[i]) {
... | ALGO | 0.999989 | 5.049464 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59: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": "300011b7767... |
30b6bf88-afd5-4c67-9883-fee27ce6c39a | ishandutta2007/codeforces-c | cookiedoth/normal/1380/B.cpp | /*
Code for problem B by cookiedoth
Generated 12 Jul 2020 at 06.25 PM
!
\_()_/
^_^
~_^
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <alg... | ALGO | 0.999905 | 4.728716 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17: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": "ac1a5ba8f230... |
b56a3b34-8a73-4fd3-8b21-0b6c824b09cd | troyfeng116/daily-problem | solutions/2020/12-2020/Dec132020.cpp | #include <iostream>
using namespace std;
/*
Given a binary tree and an integer k, filter the binary tree such that its leaves don't contain the value k.
Here are the rules:
- If a leaf node has a value of k, remove it.
- If a parent node has a value of k, and all of its children are removed, remove it.
*/
typedef st... | ALGO | 0.999956 | 6.277375 | {
"github_metadata": {
"branch": "master",
"commit_count": 261,
"repo_created_at": "2020-08-10T18:03:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "310108df... |
6dfed2e8-36d4-4c0a-ad9c-0a2410a91a30 | robertobbaik/Algorithm | 백준/Gold/1753. 최단경로/최단경로.cc | #include <iostream>
#include <vector>
#include <queue>
#include <climits>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(NULL);
//freopen("1753.txt", "r", stdin);
int V, E;
cin >> V >> E;
int start;
cin >> start;
vector<vector<pair<int, int>>> graph(V + ... | ALGO | 0.999964 | 4.052344 | {
"github_metadata": {
"branch": "main",
"commit_count": 344,
"repo_created_at": "2024-12-24T01: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": "c94c5b1357... |
b2a24643-139f-444d-9686-c845e2f24c03 | knst/Competitive-programming | codeforces/312/c.cpp | /*****************************************************************************
* codeforces: knst
* topcoder: knstqq
* projecteuler: knstqq
* **************************************************************************/
#include <algorithm>
#include <iostream>
#include <limits>
#include <map>
#include <set>
#i... | ALGO | 0.999897 | 3.85064 | {
"github_metadata": {
"branch": "master",
"commit_count": 200,
"repo_created_at": "2015-03-06T16:13:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7299e8f... |
29ffb6dc-2611-4ab3-92e0-2f3997d903b1 | gilsonpcf/algoritmos | exercicios/ascencio/cap06/cpp/EX8.CPP | #include <stdio.h>
int main()
{ int X[5], Y[5], R[10], i, j, z, aux;
for (i=0;i<5;i++)
{ printf("\nDigite o %d.o elemento do vetor X: ", i+1);
scanf("%d%*c", &X[i]);
}
for (i=0;i<5;i++)
{ for (j=0;j<4;j++)
{ if (X[j] > X[j+1])
{ aux = X[j];
X[j] = X[j+1];
X[j+1] = aux;
}
}
}
f... | ALGO | 0.999951 | 4.328574 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2019-03-28T20:58:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a5acfe... |
0a1b31d7-2072-466c-9b40-b3c545f923c0 | OxDuke/Bilevel-Planner | third_party/mosek/9.0/tools/examples/fusion/cxx/breaksolver.cc | //
// Copyright: Copyright (c) MOSEK ApS, Denmark. All rights reserved.
//
// File: breaksolver.cc
//
// Purpose: Show how to break a long-running task.
//
// Requires a parameter defining a timeout in seconds.
//
#include <fusion.h>
#include <iostream>
#include <random>
#include <thread>
#include <stdlib.h>
#... | ALGO | 0.934601 | 5.595243 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-05-07T18:14:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 39,
"forks": 10,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a20bb36... |
644e70c6-ca86-4479-adc8-b60d8ca2453e | nickchen111/Leetcode | Binary_Tree/226. Invert Binary Tree.cpp | /*
226. Invert Binary Tree
*/
//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... | ALGO | 0.999994 | 5.658099 | {
"github_metadata": {
"branch": "main",
"commit_count": 2388,
"repo_created_at": "2023-08-16T05:31: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": "4250d1331... |
c4198c6b-123b-4d2f-b106-57c99fc26558 | baihuaxie/leetcode | 15_graph/329_longest_increasing_path_in_matrix.h | #ifndef _93_LONGEST_INCREASING_PATH_IN_A_MATRIX_H_
#define _93_LONGEST_INCREASING_PATH_IN_A_MATRIX_H_
#include <iostream>
#include <vector> // std::vector
#include <queue> // std::queue
using namespace std;
class Solution {
public:
int longestIncreasingPath(vector<vector<int>>& matrix) {
// f... | ALGO | 0.999971 | 5.918386 | {
"github_metadata": {
"branch": "master",
"commit_count": 150,
"repo_created_at": "2020-05-24T04:34:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71beb845... |
59d375e7-aa41-47ea-878d-d45b9460ff34 | smu-cs-3353/22s-pa02-dahyundudes | src/InsertionSort.h | //
// Created by Zachary on 3/3/2022.
//
#ifndef INC_22S_PA02_INSERTIONSORT_H
#define INC_22S_PA02_INSERTIONSORT_H
#include "Sort.h"
template <class T>
class InsertionSort : public Sort<T> {
public:
/**
* Default Constructor
*/
InsertionSort();
/**
* Copy Constructor
*/
InsertionS... | ALGO | 0.988103 | 5.708992 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2022-02-28T17:27:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "57da7548c44d... |
dc374e42-ab77-4bc9-9b98-b33df584063f | mohammadruman/Daa-lab | lab6/2.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
#include <algorithm>
#include <chrono>
using namespace std;
using namespace std::chrono;
// Function to display the array
void displayArray(int arr[], int n)
{
for (int i = 0; i < n; i++)
{
cout << arr[i] << " ";
}
cout << endl;
}
// Func... | ALGO | 0.999177 | 4.936263 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-09-30T03:41:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b19bce770c78... |
e1985a41-ebbc-46ea-82ec-2508cc9d2cc8 | ruippeixotog/google-code-jam-2018 | round2/gridception.cpp | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#define MAXN 20
using namespace std;
int r, c; string grid[MAXN];
bool enabledColorMasks[1 << 4];
int colorMask, limitI, limitJ;
bool visited[MAXN][MAXN];
char validColor(int i, int j) {
int sideI = i >= limitI, sideJ... | ALGO | 0.999914 | 4.4373 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-03-30T22:12:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae1b1c2d... |
dc861767-8e71-4849-8669-e8db45a9092f | lja9702/JinAh-BOJ | BaekjoonOnline/2568_electricString.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
vector <int> v, stor[100001], res;
vector <pair<int, int> > temp;
int cnt = 0, arr[500001];
bool check[500001];
vector<int> f(vector<int> ori){
vector<int> b;
b.swap(ori);
return b;
}
int main(){
int n, a, b;
scanf("%d", &n);
for(int i ... | ALGO | 0.999988 | 3.297352 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-02-18T16:20: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": "eaae767de1... |
5d211c39-52fe-4752-8f8c-a4ad5ada2dc4 | coffree0123/Leetcode | solutions/131_Medium_Palindrome Partitioning.cpp | class Solution {
public:
bool check(vector<string> &cur) {
if (cur.size() == 0) return false;
for (string &s : cur) {
if (s.size() == 0) return false;
int l = 0, r = s.size()-1;
while (l < r) {
if (s[l] != s[r]) return false;
l += 1... | ALGO | 0.999994 | 6.173335 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2021-03-07T12:40: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": "c646b0fd7... |
c32e3138-f183-4a3b-8d82-38fd8d88023d | Almanova/ADS | temp/Amanov/D.cpp | #include <bits/stdc++.h>
#define vincit_omnia_veritas ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
using namespace std;
const int inf = (int)1e9;
const double eps = (int)1e-9;
const int maxchar = 26;
template<ty... | ALGO | 0.999939 | 4.607864 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-10-12T12:44: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": "2fede9c575... |
492db985-865e-421d-ac49-7b9908128ede | Wang-Jingrun/LeetCode | src/09.dynamic_programming/day42_kamacoder_46_01backpack.cpp | #if 1
//二维dp数组实现
#include <vector>
#include <iostream>
using namespace std;
int n, bagweight; // bagweight 代表行李箱空间
// 二维dp数组01背包
void solve()
{
vector<int> weight(n, 0); // 存储每件物品所占空间
vector<int> value(n, 0); // 存储每件物品价值
for (int i = 0; i < n; ++i)
{
cin >> weight[i];
}
for (int j = 0; j < n; ++j)
{
ci... | ALGO | 0.99998 | 3.990204 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2023-12-27T03: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": "7327081e643... |
abd5b34d-ed2f-467a-8de8-2eedc00d063f | Wizmann/ACM-ICPC | hihoCoder/1224.cc | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define print(x) cout << x << endl
#define input(x) cin >> x
const int SIZE = 100100;
const int INF = 0x3f3f3f3f;
vector<int> g[SIZE];
int n;
int ans;
int dfs(int ptr, int depth) ... | ALGO | 0.995344 | 3.243747 | {
"github_metadata": {
"branch": "master",
"commit_count": 3480,
"repo_created_at": "2011-12-19T02:04:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 63,
"forks": 29,
"issues": 97,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7a4... |
ca24054a-ed56-4458-b9d4-594f39b7bfa6 | gw4621/Algorithm-Problem-Solving | BOJ/1890_jump.cpp | /*
* DP problem
* Can be solved with priority queue, but takes much time and space
* Solved with dps + dp
*/
#include <cstdio>
#include <stack>
int N;
int board[100][100];
long long route[100][100];
bool visited[100][100];
long long solve(){
std::stack<std::pair<int, int>> st;
std::pair<int, int> pos;
int move, r... | ALGO | 0.999963 | 4.373527 | {
"github_metadata": {
"branch": "master",
"commit_count": 105,
"repo_created_at": "2020-01-31T08: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": "2ecd6399... |
58e51ad7-eb55-488d-8980-6e7d9f4de851 | raincross7/code-similarity | codes/train_code/problem330/problem330_363.cpp | #include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <set>
#include <cctype>
#include <bitset>
#include <type_traits>
#include <list>
using namespace std;
#define REP(i, n) for (int... | ALGO | 0.999957 | 3.763783 | {
"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": "032ddacaee10... |
0ee3f129-ba9b-4501-a418-90e57d8722e6 | charon25/ConsoleCurvePlotter | main.cpp | #define NUMBER_OF_POINTS_X 200
#define NUMBER_OF_POINTS_Y 50
#include <iostream>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <cmath>
#include "PolynomeHybride.h"
#include "PolynomeBuilder.h"
#include <regex>
using namespace std;
void afficherMenu(); //Fonction qui affiche le menu
void sel... | ALGO | 0.996215 | 4.719761 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2021-04-22T09:56:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f875ba5700... |
755d4209-d091-4b19-98b7-fd01a8aa8dfb | Davidguzley/TC1031_Actividades_Integrales | Actividad Integral 1 .- Conceptos Básicos y Algoritmos Fundamentales/main.cpp | /*
* main.cpp
*
* Created on: 21/09/2020
* Author: <NAME>
*/
#include <fstream>
#include "sorts.h"
#include "cuenta.h"
#include "casosPrueba.h"
using namespace std;
int main() {
//Para archivos
ifstream inputFile;
ofstream outputFile;
//Vector
vector<Cuenta> v;
//Variables del txt
string n... | TOOL | 0.979454 | 3.846866 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2020-09-20T19:35: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": "e1da25a3a... |
a7a08c99-a09a-4a62-a69f-0a2d9957c1ac | davidstutz/daml-shape-completion | data/shapenet/libsimplifymesh/remesher/libremesh/patch2d.h | #ifndef REMESHER_PATCH_2D_HEADER
#define REMESHER_PATCH_2D_HEADER
#include <vector>
#include "defines.h"
#include "refptr.h"
#include "patch3d.h"
#include "vertexinfo.h"
#include "trianglemesh.h"
#define CREATE_DEBUG_3D_MESHES 0
#define CREATE_DEBUG_2D_MESHES 0
#define DEBUG_MESH_3D_PATCH_FILE "../debug/patch3d.off"... | ALGO | 0.926417 | 6.585616 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-05-15T15:58:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "61c46d0f6... |
b47c9ef1-deaf-4f39-b72e-57372116e88c | mjg-sudo/test | Project20/Project1/02-二叉树的 深度.cpp | #include <iostream>
using namespace std;
template <typename T>
class BinaryNode {
template <typename T>
friend class BinaryTree;
private:
T data;
BinaryNode* lchild;
BinaryNode* rchild;
public:
BinaryNode() {
this->lchild = NULL;
this->rchild = NULL;
}
BinaryNode(const T& val) {
this->data = val;
thi... | ALGO | 0.999513 | 4.482136 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-04-12T12:50: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": "d227e8bc86... |
a777f439-5c5b-4b37-8a4c-fbdb21667ad6 | Shubho-Saha/xpsc-problem-solvers-club | week_17/A_Sorting_with_Twos.cpp | #include <bits/stdc++.h>
#define ll long long int
#define all(x) x.begin(), x.end()
#define nl '\n'
#define fastIO() ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
bool sorted(vector<int> &v, int l, int r)
{
for(int i=l; i<r; i++) {
if (v[i] > v[i+1]) return false;
}
retu... | ALGO | 0.999852 | 4.308843 | {
"github_metadata": {
"branch": "main",
"commit_count": 188,
"repo_created_at": "2024-10-26T18:08: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": "72f96ffa1d... |
053d1106-e090-40ae-ba03-189f84ee2f9c | FirescuOvidiu/Advent-of-Code-2023 | Day 12/day12-part2.cpp | #include "../AOCHeaders/stdafx.h"
bool checkInMap(long long x, long long y, long long lines, long long columns)
{
return x >= 0 && y >= 0 && x < lines && y < columns;
}
char & getEl(long long it2,
long long a,
long long b,
long long ... | ALGO | 0.999852 | 4.183852 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2023-12-04T05:25:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6251507ebe0... |
d664a340-7946-475f-a80b-a5c2f3fad509 | KRD-KOMM-VL/verifikasjonsprogramvare | cppvv/src/arithm/elgamal/elgamal.hpp | /**
* @file elgamal.hpp
* @author <NAME> <<EMAIL>>
* @date Time-stamp: <2012-12-20 22:56:25 leo>
*
* @brief The header of the elGamal namespace.
*
* @see elgamal.cpp
*/
#ifndef _ELGAMAL_H_
#define _ELGAMAL_H_
#include "../group/group.hpp"
namespace cppVerifier {
namespace arithm {
/**
* @brief C... | ALGO | 0.942414 | 6.494958 | {
"github_metadata": {
"branch": "master",
"commit_count": 339,
"repo_created_at": "2013-07-31T08:33:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "375cac9c8... |
3d8c751b-3955-49d8-8a2d-954e7fcd8158 | vhbb/cmssw | RecoVertex/KinematicFit/interface/MultiTrackPointingKinematicConstraint.h | #ifndef MultiTrackPointingKinematicConstraint_H
#define MultiTrackPointingKinematicConstraint_H
#include "RecoVertex/KinematicFitPrimitives/interface/MultiTrackKinematicConstraint.h"
#include "RecoVertex/KinematicFitPrimitives/interface/KinematicState.h"
#include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
/**
... | ALGO | 0.94768 | 4.241931 | {
"github_metadata": {
"branch": "vhbbHeppy80X",
"commit_count": 163384,
"repo_created_at": "2013-07-23T13:22:20.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "cms-sw/cmssw",
"stars": 4,
"forks": 5,
"issues": 19,
"pull_requests": 6
},
"file_meta": {
"cont... |
bd2bee0f-29ac-46cc-898a-a18cf9f61b66 | Simrankumari-tech/lecture-25-tree-and-heap | 3_insertAtMid.cpp | #include<bits/stdc++.h>
using namespace std;
class node{
public :
int data;
node*next;
node(int d){
data = d;
next = NULL;
}
};
void insertatend(node*&head , node*&tail , int d){
if(head == NULL){
node*n = new node(d);
head = tail = n;
}
else{
node*n = new node(d);
tail ... | ALGO | 0.999728 | 4.767267 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-10-29T14:17:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32e0f0f8a4e1... |
b6a55ed0-6703-49af-9d63-d4804a3b85ae | Mickai55/FMI-Unibuc-Homework | Year 1 Sem 2/NFA - DFA bun/src/AFN.cpp | #include "AFN.h"
#define MAX_STATE INT_MAX
#define MAX_SYMBOL INT_MAX
AFN::AFN () { }
AFD& AFN::turn_into_AFD ( )
{
//Initializarea dimensiunii si alfabetului AFD-ului
queue < set <int> > states_to_check; // Coada in care stocam starile/multimile de stari ale AFN-ului
vector < set <int> > states; // Star... | ALGO | 0.999493 | 3.826364 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-01-12T21:12:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "b699f06a5d... |
f7ba658f-0799-4fc5-9fd2-8d18cb618b8b | abeaumont/competitive-programming | kattis/lawnmower.cc | // https://open.kattis.com/problems/lawnmower
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0), ios::sync_with_stdio(0);
while (1) {
int x, y;
double w;
cin >> x >> y >> w;
if (!x && !y && !w) break;
vector<double> xs(x), ys(y);
for (int i = 0; i < x; i++) cin >> xs[i]... | ALGO | 0.999554 | 4.119558 | {
"github_metadata": {
"branch": "master",
"commit_count": 2070,
"repo_created_at": "2018-01-15T20:00:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 568,
"forks": 185,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "808... |
ac64778d-5c94-4b1c-9bc7-b157b0a62ad9 | NandKasar10/Cpp-DSA | 2d array/.vscode/scaffl.cpp | #include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int deci(vector <int> v){
int sum=0;
for(int i=0;i<v.size();i++){
sum+=v[i]*(pow(2,v.size()-i-1));
}
return sum;
}
void swap(vector <int> &v){
for(int i=0;i<v.size();i++){
if(v[i]==0)v[i]=1;
els... | ALGO | 0.999951 | 4.381158 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-27T10:16: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": "5b020b4fadda... |
9b55deed-f0ad-4c03-b1a2-746dda97a505 | mrdylan123/kmint | kmintapp/src/main.cpp | #include "kmint/main.hpp" // voor de main loop
#include "kmint/graphics.hpp" // kleuren en afbeeldingen
#include "kmint/math/vector2d.hpp" // voor window en app
#include "kmint/play.hpp" // voor stage
#include "kmint/ui.hpp" // voor window en app
#include "kmint/map/map.hpp" // Voor... | ALGO | 0.982629 | 3.648543 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-11-09T14:57: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": "21337bd74... |
9a9e657f-4297-493c-896b-2773116088fe | raincross7/code-similarity | codes/train_code/problem149/problem149_398.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define perm(c) sort(ALL(c));for(bool c##p=1;c##p;c##p=next_permutation(ALL(c)))
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
... | ALGO | 0.999982 | 3.956138 | {
"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": "dec44f9ffb4a... |
7012fd2b-5c80-494b-bc4d-edf2efdfaff7 | aperezyus/RASPV | raspv/src/RGBD/plane.cpp | /**
* This file is part of stairs_detection.
*
* Copyright (C) 2019 <NAME> <alperez at unizar dot es> (University of Zaragoza)
* For more information see <https://github.com/aperezyus/stairs_detection>
*
* stairs_detection is free software: you can redistribute it and/or modify
* it under the terms of the GNU General P... | ALGO | 0.996946 | 5.202189 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-09-26T14:18: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": "6184b1d2dd9... |
acdc1a41-8d31-4ae6-886d-681afe0831cb | hyperpace/study_algo_gangnam | BSH/once_upon_a_time/5670/main.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
struct trie_node {
bool fin;
unsigned char cnt;
vector<trie_node *> next;
trie_node() : fin(false), cnt(0), next(vector<trie_node *>('z' - 'a' + 1, nullptr)) {
}
};
struct trie {
trie_node *start;
static voi... | ALGO | 0.999628 | 3.855211 | {
"github_metadata": {
"branch": "master",
"commit_count": 326,
"repo_created_at": "2019-01-07T05:50:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18db66b7... |
66c315f5-ed22-46d2-bd1c-7853cc3a1b8d | gordonshumwayalf/paddle-develop | paddle/phi/kernels/impl/erfinv_grad_kernel_impl.h | // Copyright (c) 2022 PaddlePaddle Authors. 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... | ALGO | 0.991755 | 7.069854 | {
"github_metadata": {
"branch": "main",
"commit_count": 2018,
"repo_created_at": "2025-01-07T12:09:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "327c5f6d... |
7e9ed5e0-8dfb-4802-b418-a2588ebd97f9 | ishandutta2007/codeforces-s | skip2004/normal/1039/D.cpp | #include<bits/stdc++.h>
const int maxn = 100100;
int n;
struct T {
int to, nxt;
} way[maxn << 1];
int h[maxn], num;
inline void link(int x, int y) {
way[++num] = {y, h[x]}, h[x] = num;
way[++num] = {x, h[y]}, h[y] = num;
}
int ans[maxn];
int dp[maxn], sum, len;
int head[maxn], next[maxn];
inline void dfs(int x, int ... | ALGO | 0.99995 | 4.12581 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63bb17c5d6ce... |
15e5f6ad-ec40-4da6-b395-c945b6ceb8f1 | danilopereira10/codeforces | 520B.cpp | //#include <stdio>
#include <iostream>
#include <cmath>
#include <vector>
#include <stack>
#include <tuple>
#include <cstring>
#include <cstdlib>
#include <bits/stdc++.h>
#include <iomanip>
#include <unordered_map>
#include <set>
#include <algorithm>
#include <set>
using namespace std;
typedef long long ll;
typedef v... | ALGO | 0.999962 | 3.229353 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-02-25T22:12: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": "2939a928bee0... |
a4d6a6b4-0a05-4312-a59f-33b25615f901 | Surfacerobot/crs_application_sizen | src/trajopt_ros/trajopt_ifopt/src/joint_velocity_constraint.cpp | /**
* @file joint_velocity_constraint.h
* @brief The joint_velocity constraint
*
* @author <NAME>
* @date May 18, 2020
* @version TODO
* @bug No known bugs
*
* @copyright Copyright (c) 2020, Southwest Research Institute
*
* @par License
* Software License Agreement (Apache License)
* @par
* Licensed under... | ALGO | 0.934577 | 7.396397 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-10-12T07:03:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5b5c9b9ae... |
8320ae34-a3ca-4004-994a-c09256608b2e | viktorzetterstrom/game-of-life-miun | include/GoL_Rules/RuleOfExistence_VonNeumann.h | /**
* @file RuleOfExistence_VonNeumann.h
* @author <NAME>
* @date October 2017
* @version 0.1
* @brief Von Neumann's RuleOfExistence, differs from Conway in that only 4 neighbours are accounted for.
*/
#ifndef GAMEOFLIFE_RULEOFEXISTENCE_VONNEUMANN_H
#define GAMEOFLIFE_RULEOFEXISTENCE_VONNEUMANN_H
#include... | ALGO | 0.994054 | 5.44821 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2018-10-31T21:06: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": "3eaa4c8b9... |
ee539c06-5be3-4c88-96ce-0de5fe3c1ef3 | w-modz/Uni-S3-AlgoLab7 | HashTable2/HashTable2.cpp | // ALGO2 IS1 221A LAB06
// <NAME>
// <EMAIL>
#include <iostream>
#include <string>
#include <array>
#include <ctime>
#include <random>
#include <forward_list>
#include <sstream>
#define RESIZE_THRESHHOLD 0.75
using namespace std;
#define DEFAULT_SIZE 10
#define EXPANSION_MULTIPLIER 10
template<typename T>
struct No... | ALGO | 0.95608 | 4.935196 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-12-13T22:19: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": "763d1250d7a5... |
ca70fb50-8550-45a5-b491-e11c35849e00 | arjunkeerthi/point-bot | control_robot/move_robot.cpp | #include <ros/ros.h>
#include <message_filters/subscriber.h>
#include <message_filters/synchronizer.h>
#include <message_filters/sync_policies/approximate_time.h>
#include <image_transport/image_transport.h>
#include <image_transport/subscriber_filter.h>
#include <opencv2/highgui/highgui.hpp>
#include "opencv2/calib3d/... | ALGO | 0.992623 | 6.683772 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-04-26T21:31: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": "e6027d4f2... |
cc1ca13c-d64e-4312-9801-5bdae33c54d1 | ryleydennis/dice | dice.cpp | #include <regex>
#include <iostream>
#include <string>
#include <cstdlib>
#include <time.h>
#include <unistd.h>
#include <signal.h>
//forward declarations
void user_loop();
void interpret_text(std::string textj);
int eval_dice(std::string text);
void ctrl_c_handler(int s) {
std::cout << std::endl;
exit(s);
}... | TOOL | 0.94465 | 4.922724 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-09-08T12:42: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": "2288ccfd6f... |
a1b40ced-d193-4cea-8c4b-d52d5e24a175 | ethliup/MBA-VO | src/ba_tracker/merge_hessian_gradient_cost.cpp | #include <Eigen/Dense>
#include <cuda_runtime_api.h>
namespace SLAM
{
namespace VO
{
void merge_hessian_gradient_cost(const int num_frames,
const int spline_deg_k,
const double *frame_cost_gradient_hessian_gpu,
... | ALGO | 0.994904 | 5.522906 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-08-17T05:32:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 55,
"forks": 6,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "11c91d14d32... |
39515e6d-c651-4c83-a75e-8426d08a4dc3 | mgruppi/simpgpu | heap_pair.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
struct elem {
int id;
float cost;
};
ostream& operator<<(ostream &out, const elem &e) {
out << "(" << e.id << "," << e.cost << ")";
return out;
}
bool compare(elem &a, elem &b)
{
return a.cost < b.cost;
}
void percUp(int i, elem* heap)
{
while... | ALGO | 0.998885 | 3.995947 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-07-19T16:45:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7e2402f0c... |
a88c3faf-4375-4357-8050-b21d52a05b99 | Doo66/FileCompress | Heap.h | #ifndef __HEAP_H__
#define __HEAP_H__
#include <vector>
#include <cassert>
/*比较器*/
template<class T>
class Less
{
public:
bool operator() (const T& left, const T& right)
{
return left<right;
}
};
template<class T>
class Greater
{
public:
bool operator() (const T& left, const T& right)
{
return left>right;
}... | ALGO | 0.99573 | 3.967066 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-06-30T10:57: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": "b4eae426c6... |
a77cf1a2-a362-4761-87cb-88716b73d25a | Itchykite/Benchmark-test | src/simd_cpp_fma_mt.cpp | #include <iostream>
#include <vector>
#include <thread>
#include <chrono>
#include <immintrin.h>
#include <cmath>
void compute_fma(const float* a, const float* b, float* c, size_t start, size_t end) {
__m256 one = _mm256_set1_ps(1.0f);
size_t i = start;
for (; i + 7 < end; i += 8) {
__m256 va = _mm... | ALGO | 0.999834 | 6.490997 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-06-18T12:46:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84b030dfaf61... |
52d82cd7-946b-480d-860e-b9ef5766fd01 | nhhoang14/CodePTIT_Source | CodePTIT - CPP/CPP0620.cpp | //https://code.ptit.edu.vn/student/question/CPP0620
//SẮP XẾP SINH VIÊN THEO LỚP
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
class SinhVien{
private:
string msv;
string name;
string cl;
string email;
public:
SinhVien();
friend istream &op... | ALGO | 0.996285 | 3.770922 | {
"github_metadata": {
"branch": "main",
"commit_count": 646,
"repo_created_at": "2024-04-19T11:42:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be443a27b9... |
e37a7082-2c12-4845-b647-ade5428798b2 | colmap/colmap | src/colmap/mvs/cuda_transpose.h | // Copyright (c), ETH Zurich and UNC Chapel Hill.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, th... | ALGO | 0.944327 | 7.696273 | {
"github_metadata": {
"branch": "main",
"commit_count": 2214,
"repo_created_at": "2014-08-16T00:55:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8989,
"forks": 1696,
"issues": 1026,
"pull_requests": 34
},
"file_meta": {
"content_id": "... |
66c86490-11fc-4451-875b-2ede054f32d7 | tmsalab/rrum | src/rRUM_Gibbs.cpp | #include <RcppArmadillo.h>
#include <rgen.h>
#include <simcdm.h>
// [[Rcpp::interfaces(r, cpp)]]
arma::field<arma::mat>
parm_updatecpp(unsigned int N, unsigned int J, unsigned int K, unsigned int C,
const arma::mat Y, const arma::mat &Q, arma::mat &alpha,
arma::cube &X, arma::mat &Smat, ... | ALGO | 0.999814 | 6.134892 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2017-09-29T04:36:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "365689c70ecc... |
42ab39a3-ecfb-45e5-abbc-67ea13523084 | likooooo/CppBaseLib | Math/include/Mat2dTranspose.hpp | /*
* @Description: 矩阵的转置
* @Version: 1.0
* @Autor: like
* @Date: 2021-11-09 06:56:59
* @LastEditors: like
* @LastEditTime: 2021-11-09 09:00:16
*/
#ifndef MAT2D_TRANSPOSE_HPP
#define MAT2D_TRANSPOSE_HPP
#include <Mat.hpp>
/*后继:原始矩阵点->新矩阵点*/
int GetNext(int i, int m, int n){return (i%n)*m + i / n;}/*新矩阵的row ... | ALGO | 0.998491 | 5.206298 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2020-10-23T07:24:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a80258e101... |
e8c1d6c9-64cc-4dc9-9ec6-d13b5baa6af3 | Mechazo11/swe_interview_dsa_leetcode_cpp | LEETCODE_PRACTICE/11_container_with_most_water.cpp | #include <iostream> // Provide input output stream (essentially )
#include <vector> // implements dynamic array
#include <string> // string handling functionality
#include <algorithm> // various algorithms like sort(), find() etc.
#include <memory> // Smart pointers
#include <cmath> // Math library
#include <unordered_... | ALGO | 0.999976 | 5.559791 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-04-03T15:57: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": "dfe5b3019596... |
3fd06ee3-9e5b-4834-b664-ea90d7f78406 | encrypted-def/basic-algo-lecture | 0x1A/solutions/1005.cpp | // Authored by : scsc3204
// Co-authored by : -
// http://boj.kr/ddd8214a903148c381289d51e1027039
#include <bits/stdc++.h>
using namespace std;
int solve() {
int n, k; cin >> n >> k;
vector<int> adj[n + 2];
int cost[n + 2] = {};
int tot[n + 2] = {};
int ind[n + 2] = {};
for(int i = 1; i <= n; i++)
cin... | ALGO | 0.999916 | 3.765409 | {
"github_metadata": {
"branch": "master",
"commit_count": 1862,
"repo_created_at": "2020-02-19T10:47:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2560,
"forks": 601,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "0e... |
0b1e8860-d0bf-411d-b190-d02c7d24a148 | OwaisK4/Competitive-Programming | Codeforces/Contests/Codeforces Round 981 (Div. 3)/C_Sakurako_s_Field_Trip.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define all(a) a.begin(), a.end()
#define seed chrono::high_resolution_clock::now().time_since_epoch().count()
#define file_read(filepath) freopen(filepath, "r", stdin);
#define file_write(filepa... | ALGO | 0.999846 | 4.169877 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-04T18: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": "54f9f1be0437... |
ff9eefd2-01dc-4fa2-a708-c11ef6bd22ff | MJahangeerQureshi/OptimalLazyDialerWebapp | a-star-solver/main.cpp | #include <iostream>
#include <map>
#include <math.h>
#include <vector>
#include <string>
std::map < std::string, std::tuple<float, float>> num2Coord;
enum move
{
L = 0,
R = 1,
U = 2,
};
struct State
{
std::string state; // string representation of the state
move finger;
State* prevState; // Previous state poin... | ALGO | 0.999914 | 4.199445 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-07-07T11:38: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": "5aeb2c02f818... |
4b2808dc-d67c-4657-947a-87b1294a66f6 | ffbh123456/code | codeforce/codeforce/code/Karen and Supermarket.cpp | #include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <functional>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
#include <sstream>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <set>
using namespac... | ALGO | 0.999891 | 3.228766 | {
"github_metadata": {
"branch": "master",
"commit_count": 186,
"repo_created_at": "2018-02-04T01:42:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1346282d... |
b4da8ad7-52b8-4323-a009-fcb33686f3de | ishandutta2007/codeforces-h | hitonanode/normal/1513/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
int main() {
cin.tie(nullptr), ios::sync_with_stdio(false);
int N;
cin >> N;
vector<int> A(N), B(N);
for (auto &x : A) cin >> x;
for (auto &x :... | ALGO | 0.999966 | 4.214278 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "99611e30e664... |
9fdb2514-2f82-403e-9155-f43f35cd1aa2 | qagr49/303-Project-3B | morse_tree.h | #pragma once
#include <fstream>
#include <vector>
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
/** A node for a Binary Tree. Part of the code on blackboard*/
template<typename Item_Type>
struct BTNode
{
// Data Fields
Item_Type data;
BTNode<Item_Type>* left;
BTNode<Item_Type>* righ... | ALGO | 0.970755 | 3.559778 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-05-03T20:22: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": "34e4f8f288... |
246c3eb0-d667-4ef1-a1dd-d9c324ba5e74 | AtulKumarIndian/450-coding-questions | C++/MinMaxArray.cpp | #include <bits/stdc++.h>
using namespace std;
struct MinMaxArray
{
int min,max;
};
MinMaxArray Getminmax(int arr[], int n)
{ int j;
MinMaxArray MinMax;
if (n==1)
{
MinMax.max = MinMax.min = arr[0];
return MinMax;
}
if(arr[0]> arr[1])
{
MinMax.max= arr[0];
... | ALGO | 0.999779 | 4.188926 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-09-03T11:34: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": "29a944609639... |
f89e6722-e54d-4a71-850a-44b2388a6560 | MedAzizTousli/Competitive-Programming-Solutions | Codeforces/!Junior Training Sheet/A/A_Lunch_Rush.cpp | #include <bits/stdc++.h>
#define int long long
#define ll long long
#define FLASH ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) // rep(i, 1, 5) --> {1,2,3,4} ... | ALGO | 0.999937 | 3.378009 | {
"github_metadata": {
"branch": "master",
"commit_count": 505,
"repo_created_at": "2019-04-23T21:46:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8106b396... |
07079060-50e6-4e08-8412-8ec54cf5ded5 | MuhammadAzqiMadaniArdan/Cpp-X | materi looping/ming 5 1/index.cpp | #include <iostream>
using namespace std;
int main(){
int input;
int input2;
cout << "masukkan element pertama: ";
cin >> input;
cout << "masukkan element kedua: ";
cin >> input2;
int angka1[input][input2];
int angka2[input][input2];
cout <<"---Array Pertama---"<<endl;
for (int i ... | ALGO | 0.994319 | 3.822715 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-30T10:57: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": "72bcd6e76897... |
a33b23a9-372b-40a8-9931-d7eaffc81178 | dizzydroid/ASU_Sheets-Solutions | Source Code/Sheet2/Exercise(5)_ver2.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string grade;
double grade_num;
cout << "Enter numerical grade value: ";
cin >> grade_num;
switch (int(grade_num * 10)) {
case 40:
grade = "A+";
break;
case 37 ... 39:
grade = "A";
break;
case 30 ... 36:
grade = "A-";
break;
c... | TOOL | 0.910942 | 4.497748 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2023-03-17T08:55:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a453bf490f1... |
28b1ef1e-3e8a-4eb2-bd40-adbc8bd0e382 | wcl20/Imperial-Individual-Project | layer1/include/qd/qd.hpp | #ifndef __QD_HPP__
#define __QD_HPP__
// Genotype
#include <sferes/gen/evo_float.hpp>
// Phenotype
#include <sferes/phen/parameters.hpp>
// Evaluator
#include <sferes/eval/eval.hpp> // Simple Evaluator
#include <sferes/eval/parallel.hpp> // Parallel Evaluator
// Statistics
#include <sferes/stat/best_fit.hp... | ALGO | 0.993685 | 5.650049 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-06-21T12:12: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": "54c443e89e... |
336a4ad8-f059-4698-a7e9-5dff24c5fc1b | adamritter/fastgron | src/jsonutils.hpp | #pragma once
#include <algorithm>
#include <string>
#include <string_view>
#include <vector>
using std::string;
using std::string_view;
using std::vector;
// Flags
const unsigned SPACES = 1;
const unsigned SEMICOLON = 2;
const unsigned COLOR = 4;
const unsigned COLORIZE_MATCHES = 8;
const unsigned INVERT_MATCH = 16;... | TOOL | 0.922489 | 6.550761 | {
"github_metadata": {
"branch": "main",
"commit_count": 234,
"repo_created_at": "2023-05-27T19:00:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 641,
"forks": 11,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "7697b98... |
be755ac5-692f-41b4-bd3e-d5eab48be798 | Mekki1Ponden/lab_prog | SourcePrivate.cpp | #include <iostream>
#include "headerPrivate.h"
using namespace std;
float childQueuePrivate::arithmeticMath()
{
Unit* buff = getTail();
float sym = 0;
float iter = 0;
float start = (size % 2 == 1) ? buff->data : buff->prev->data;
Unit* tail = getTail();
if (size % 2 == 1) {
iter = size / 2 + 1;
}
else {
i... | ALGO | 0.983859 | 3.676176 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-29T20:53: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": "e44f749aec12... |
811845e4-2dac-417d-b76c-7ca8f0bc77e4 | himanshu864/DSA_CPP | 2D_Array/peakgridII.cpp | #include <bits/stdc++.h>
using namespace std;
// T.C: NlogM
vector<int> findPeakGridII(vector<vector<int>> &mat)
{
int s = 0;
int e = mat[0].size() - 1;
while (s <= e) // apply binary on columns
{
int col = (s + (e - s) / 2);
int row = 0; // find row with maximum in that col
in... | ALGO | 0.999969 | 5.443369 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2024-04-13T16:29:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7c4690f6e... |
950910ca-8a08-462a-a6c6-5922e7ee048e | Yingyan-Xu/AlgoLab-AS19-ETH | week7/radiation/algorithm.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <limits>
#include <stdexcept>
#include <tuple>
using namespace std;
#include <CGAL/QP_models.h>
#include <CGAL/QP_functions.h>
#include <CGAL/Gmpz.h>
typedef CGAL::Gmpz ET;
typedef CGAL::Quadratic_program<ET> Program;
typedef CGAL... | ALGO | 0.99918 | 4.02027 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-02-17T22:37: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": "3e40eeb009... |
e2a6a7f3-390c-4d41-8898-2492c0667de7 | li924579/ACM | 2015暑假集训/DAY-6/B.cpp | //
// Created by CQU_CST_WuErli
// Copyright (c) 2015Äê CQU_CST_WuErli. All rights reserved.
//
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <string>
#include <time.h>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include... | ALGO | 0.999952 | 3.639936 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2016-07-07T06:13:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea01e6571... |
4574dc90-f39f-47f9-b20b-15ae50b137ad | SayaUrobuchi/uvachan | UVa/10996.cpp | #include <stdio.h>
#include <string.h>
#define EMPTY 0
#define UNDETERMINED 0
#define BLACK 1
#define WHITE 2
#define AMBIGUOUS 3
int n, m, c, edge, step, bound, complete;
int qx[400], qy[400];
int wayx[4] = {0, 1, 0, -1};
int wayy[4] = {1, 0, -1, 0};
char used[20][20];
char board[20][20];
char buf[2008];
int valid(... | ALGO | 0.999926 | 3.626393 | {
"github_metadata": {
"branch": "master",
"commit_count": 105,
"repo_created_at": "2017-06-12T06:49:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f64e078... |
da2da374-012c-4473-b6ae-205bb341553e | diegoximenes/icpc | judges/spoj/done/TRIP.cpp | #include<cstdio>
#include<cstring>
#include<deque>
#include<set>
#include<algorithm>
using namespace std;
#define mp make_pair
#define pb push_back
#define MAX 85
int n, m, t, dp[MAX][MAX];
char s1[MAX], s2[MAX];
set< deque<char> > out;
set< deque<char> >::iterator it;
set< pair< pair<int, int>, deque<char> > > build... | ALGO | 0.999968 | 3.79185 | {
"github_metadata": {
"branch": "master",
"commit_count": 119,
"repo_created_at": "2019-03-30T15:08:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02e6192e... |
4c3e3773-d6de-4c7c-b14a-1780ae22c5c4 | shaileshKumar55/GFG-Problems | Balanced string.cpp | /*
Given an integer N.Create a string using only lowercase characters from a to z that follows the given rules.
When N is even:
Use N/2 characters from the beginning of a-z and N/2 characters from the ending of a-z.
When N is greater than 26,continue repeating the instructions until length of string becomes N.
When... | ALGO | 0.999869 | 5.442992 | {
"github_metadata": {
"branch": "main",
"commit_count": 277,
"repo_created_at": "2022-11-21T19:46:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e15aba625a... |
e7a6156e-8b95-4dba-b165-4adf6c48428a | crbonilha/cp-problems | codeforces/edu/two-pointers/3f.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXN = 1e5;
int n, m;
char s[MAXN+1], cards[MAXN+1];
int c[26];
int cur[26];
bool isEnough(int cand) {
for(int i=0; i<26; i++) {
if(cur[i]+(cand == i) > c[i]) {
return false;
}
}
return true;
}
in... | ALGO | 0.999977 | 3.598186 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-07-30T23:50:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68f0495b55a... |
3dececdb-066d-4d2a-af0f-c5723d0bcd8d | Baplisca/AtCoder-Submission | atcoder.jp/abc308/abc308_b/Main.cpp | #include <bits/stdc++.h>
using namespace std;
signed main()
{
int n, m;
cin >> n >> m;
vector<string> s(n);
for (int i = 0; i < n; i++)
{
cin >> s[i];
}
vector<string> d(m);
vector<int> p(m + 1);
map<string, int> mp;
for (int i = 0; i < m; i++)
{
cin >> d[i];... | ALGO | 0.999927 | 3.813087 | {
"github_metadata": {
"branch": "master",
"commit_count": 1610,
"repo_created_at": "2020-08-25T04:37:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c05f8c... |
666d8b4a-86a3-4a5c-8e26-43830f70aa68 | Rudolf-Gama/Striver-A2Z_DSASheet | LinkedList/SLL/EasyMediumSLL/reverse.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node* next;
Node(int data1,Node* next1){
data=data1;
next=next1;
}
Node(int data1){
data=data1;
next=nullptr;
}
};
Node* convertLL(vector<int> arr){
Node* head=new Node(arr[0]);
Node* mo... | ALGO | 0.999977 | 5.49748 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-08-16T06:52:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a99b72469c... |
a320708d-a17a-4dfa-b652-08a1bce9480d | ab1hi2shek/SPOJ-Solutions | MAYA.cpp | /*
Code By - <NAME>
College - NIT Durgapur
Date - 14/09/2017
Logic - AdHoc
Category - very Easy
Platform - SPOJ
*/
#include <bits/stdc++.h>
using namespace std;
//data types
#define ll long long int
#define ull unsigned long long int
#define l long int
#define ul unsigned long int
//stl
typedef vector<ll>... | ALGO | 0.998407 | 3.559727 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-09-12T17:24:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50f06ca621... |
3ce54ee8-5c1c-47f1-addd-8aef44621f38 | stulwd/algorithmAndDataStructs_CPP | 08_graph/noGTest.cpp | #include <iostream>
#include "Graph.h"
#include "dfs.h"
#include "bfs.h"
#include "dfp.h"
using namespace std;
/**
* 无向图测试,包含Graph.h dfs.h bfs.h dfp.h
* */
int main(){
Graph<string> g(100);
g.addNode("a", 0);
g.addNode("b", 1);
g.addNode("c", 2);
g.addNode("d", 3);
g.addNode("e", 4);
g.a... | TEST | 0.932388 | 3.553687 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2020-10-12T09:17: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": "2524eb5b547... |
0ba19859-23d5-415a-85cd-6611fa5c7814 | quq99/Leetcode_notes | Array/medium/64_Minimum_Path_Sum/MiniPathSum.cpp | // MiniPathSum.cpp
#include<vector>
#include<algorithm>
using std::vector;
using std::min;
class MiniPathSum {
public:
int minPathSum(vector<vector<int>>& grid) {
if (grid.size()==0 || grid[0].size()==0) return 0;
int m = grid.size();
int n = grid[0].size();
... | ALGO | 0.999953 | 5.880075 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2019-05-16T18:05:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f28752e1... |
2960d8ae-c1d0-4bc9-a0dc-c2af1d25f1ee | brandenburg/schedcat | native/src/blocking/mpcp.cpp | #include "sharedres.h"
#include "blocking.h"
#include "stl-helper.h"
#include "math-helper.h"
# include "mpcp.h"
static void determine_mpcp_ceilings(const Resources& resources,
const unsigned int cluster,
PriorityCeilings& ceilings)
{
ceilings.reserve(resources.size());
foreach(resources, it)
{
... | ALGO | 0.992555 | 5.835809 | {
"github_metadata": {
"branch": "master",
"commit_count": 301,
"repo_created_at": "2012-04-11T16:06:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 39,
"forks": 30,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e28f2e... |
8cff94c6-a1d4-40e9-b928-9f6b8bc2ae61 | pilsen-kon/lote-problemas-c- | Problemas C++/Práctica1-Dias transcurridos entre dos fechas.cpp | #include <iostream>
using namespace std;
void Mensaje();
void ingresarFecha1(int &anio1, int &mes1, int &dia1, int &diaJuliano1);
void ingresarFecha2(int &anio2, int &mes2, int &dia2, int &diaJuliano2);
int numDias(int mes, int anio);
bool esBisiesto(int anio);
int valorAp(int anio, int mes);
int valorMp(int mes);
int... | ALGO | 0.998395 | 3.824831 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-01-16T23:38: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": "052b9f3acbd7... |
3e461d3f-b51c-4663-99ec-1df2e60e59cf | Shivam06/Cpp-Programming | STL/Iterators.cpp | #include<iostream>
#include<vector>
using namespace std;
#define all(c) c.begin(), c.end()
#define tr(c, itr) \
for (auto itr = c.begin(); itr != c.end(); itr++)
void printVector(vector<int>& v) {
for (int i = 0; i < v.size(); i++) {
cout << v[i] << " ";
}
cout << endl;
}
void printVectorItr(vec... | ALGO | 0.997046 | 4.275663 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2020-03-31T19: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": "bd889fe0... |
99c7e602-1b9a-42c6-b123-3d93c66c1115 | vineethm1627/CPP | Interview Preparation/09 Linked Lists/floyds_cycle.cpp | #include <iostream>
using namespace std;
class node {
public:
int data;
node *next;
node(int data) {
this->data = data;
next = NULL;
}
};
void insertAtTail(node *&head, int data) {
if(head == NULL) {
head = new node(data);
return;
... | ALGO | 0.999406 | 4.993151 | {
"github_metadata": {
"branch": "master",
"commit_count": 630,
"repo_created_at": "2020-09-22T19:11:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef21feb... |
16b6ea1d-ddf1-415b-8b17-663cd1c5874e | 1517005260/Coding | Day14/从中序与后序遍历序列构造二叉树/106.从中序与后序遍历序列构造二叉树.cpp | /*
* @lc app=leetcode.cn id=106 lang=cpp
*
* [106] 从中序与后序遍历序列构造二叉树
*/
// @lc code=start
/**
* 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(nu... | ALGO | 0.999979 | 6.70572 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2025-01-22T11:53: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": "daf3008d3... |
a4ea6295-7f87-4575-8d08-610923d5139e | derkl0/COMP.3040 | NFA.hpp | #ifndef NFA_HPP
#define NFA_HPP
#include <functional> // function
#include <vector> // vector
#include "Alphabet.hpp"
#include "DFA.hpp"
#include "String.hpp"
using namespace std;
template <class State>
class NFA {
public:
function<bool(State)> Q;
State q0;
function<vector<State>(State, Character)> Delta... | ALGO | 0.999457 | 6.96842 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2020-11-16T17:51: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": "c7beb2f12... |
94eed2d6-4a9c-4eff-a5c2-1306dc692b06 | swiackichris/Codility-Lessons | Codility-Lessons/Lesson 09 - Maximum slice problem/MaxProfit/MaxProfit.cpp | // MaxProfit.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
int solution(vector<int> &A) {
// write your code in C++14 (g++ 6.2.0)
int N = A.size();
if (N < 2) return 0;
int profit = A[1] - A[0];
int currentProfit = A[1] - A[0];
in... | ALGO | 0.999379 | 5.609013 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2019-08-15T15:29: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": "ee257e327... |
8146e415-acfc-4d12-9a91-38982411a7c0 | bandoleRo54/Parallel-PracticalSession_Quiz1 | src/carlopi.cpp | #include <iostream>
#include <cstdlib>
#include <cmath>
#include <bits/stdc++.h>
#include <pthread.h>
using namespace std;
struct ThreadData {
int tosses_per_thread;
int points_inside_circle;
};
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
int total_points_inside_circle = 0;
// Generacion de valores al... | ALGO | 0.999753 | 5.283133 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-02-07T23:49: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": "907bba72934d... |
a712280d-1f49-46d8-bc27-46fb70ceff98 | tanuj208/CP-codes | codeforces/round565/loseIt.cpp | #include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#define pb push_back
#define mp make_pair
#define sz(a) (ll)(a).size()
#define all(a) a.begin(), a.end()
#define ff first... | ALGO | 0.99991 | 4.08614 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-12-06T08:21: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": "db3734fbfd... |
6950876f-f32f-4576-8593-d84d3e4958dc | cocolin041/Data_structure | potd/potd-q17/Node.cpp | #include "Node.h"
#include <iostream>
using namespace std;
void sortList(Node **head) {
// your code here!
if (*head != NULL) {
if ((*head)->next_ != NULL) {
int cout = 0;
Node *oldhead = *head;
while (*head != NULL) {
cout += 1;
*head = (*head)->next_;
}
*head = oldhead;
Nod... | ALGO | 0.999951 | 4.945253 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2018-10-12T03:53: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": "ae22dd259... |
5fab26b0-1bf5-43f9-a1e9-4f27aa0710eb | ADVRHumanoids/ct | ct_core/include/external/cppad/cg/model/model_c_source_gen_rev1.hpp | #ifndef CPPAD_CG_MODEL_C_SOURCE_GEN_REV1_INCLUDED
#define CPPAD_CG_MODEL_C_SOURCE_GEN_REV1_INCLUDED
/* --------------------------------------------------------------------------
* CppADCodeGen: C++ Algorithmic Differentiation with Source Code Generation:
* Copyright (C) 2012 Ciengis
*
* CppADCodeGen is distrib... | TOOL | 0.927506 | 5.911884 | {
"github_metadata": {
"branch": "discrete_DMS",
"commit_count": 1447,
"repo_created_at": "2018-09-24T08:42:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5... |
826564a3-f822-4faa-bfda-ad451dbe4b8f | LandBuffalo/MTO-parallel | MTO-parallel-dual-buffer/src/random.cc | #include "random.h"
Random::Random()
{
}
Random::~Random()
{
}
int Random::RandIntUnif(int min_value, int max_value)
{
if (min_value != max_value)
return min_value + rand() % (max_value - min_value + 1);
else
return min_value;
}
real Random::RandRealUnif(real min_value, real max_value)
{
if (min_value != ... | TOOL | 0.976126 | 3.941127 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-09-12T12:29: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": "edcfc7bb9f... |
0a090d60-70f5-4aa2-80e2-f89c03521934 | eren-jaegar/DSA | Dynamic Programming/32. Count number of ways to reach a given score in a game.cpp | /*
Approach - 1
we do not have to consider permutations so, we do not go by standard dp.
we create a 1-D table.
first iterate for 3 then for 5 and then for 10.
this ensures that first we are finding all the possible ways to reach a number using only 3.
then when we iterate for 5 then we get all possible ways to reach a... | ALGO | 0.999973 | 4.749289 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-07-10T19:13: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": "91675b579b4b... |
cace0c2a-cecc-493a-8308-fda8186bb7c2 | thisisakshatsri/leetcode_solutions | 152-maximum-product-subarray/152-maximum-product-subarray.cpp | class Solution {
public:
int maxProduct(vector<int>& nums) {
//empty array case
if(nums.size() == 0 ) return 0;
//To store the max and min product
int maxSub = nums[0];
int minSub = nums[0];
int maxProduct = nums[0];
for(int i=1; i<nums.size(... | ALGO | 0.999946 | 6.143731 | {
"github_metadata": {
"branch": "main",
"commit_count": 359,
"repo_created_at": "2022-07-19T18: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": "fcc18ffc4f... |
440658a6-b56e-4cd6-9f6c-ced707922b3a | Mugdha-Hazra/POTD-Questions | Medium/Sum of bit differences/sum-of-bit-differences.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
long long sumBitDifferences(int arr[], int n) {
// code here
long long ans=0;
for(int i=0;i<32;i++){
long long z=0;
... | ALGO | 0.999791 | 5.845759 | {
"github_metadata": {
"branch": "main",
"commit_count": 633,
"repo_created_at": "2022-11-22T03:24:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43a9d50e9... |
41434ba3-f62b-4f9e-b348-b358f8411193 | mamun2040500/Phitron | XPSC/Week-08/Day-05/K_Swords.cpp | #include<bits/stdc++.h>
#define vi vector<int>
#define vll vector<ll>
#define ll long long int
#define pii pair<int, int>
using namespace std;
int main()
{
ll t = 1;
// cin >> t;
while (t--)
{
ll n;
cin >> n;
vll a(n);
vll b(n);
ll mx = 0;
for (ll i = 0; ... | ALGO | 0.999972 | 3.51687 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2024-03-16T12:40: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": "7dd8e0fb73b... |
f0707dd0-d3d5-4e33-9f3a-905576e5bb74 | Oein/PS | acmicpc/2___/28__/284_/2848/2848.cpp | #include <vector>
#include <algorithm>
#include <queue>
#include <iostream>
#include <map>
#include <set>
#include <math.h>
#include <numeric>
#include <cassert>
#include <stack>
#include <cstring>
#include <climits>
typedef long long ll;
typedef unsigned long ull;
#define interface struct
#define zx3f 1061109567
ty... | ALGO | 0.99997 | 3.459695 | {
"github_metadata": {
"branch": "main",
"commit_count": 998,
"repo_created_at": "2023-09-22T23:36: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": "9cdec966d4... |
2c6907f4-c462-4326-8b89-e8be8c0f04f7 | AashutoshKS/CODE-TATVA-DSA-SHEET | MATHS/829. Consecutive Numbers Sum.cpp | //PROBLEM :
Given an integer n, return the number of ways you can write n as the sum of consecutive positive integers.
//CODE :
class Solution {
public:
int consecutiveNumbersSum(int n) {
//The sum of k consecutive numbers starting from x is:
//Sum = x... | ALGO | 0.999989 | 5.496521 | {
"github_metadata": {
"branch": "main",
"commit_count": 385,
"repo_created_at": "2025-03-15T10:33:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d18ae65ff... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.