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 |
|---|---|---|---|---|---|---|---|
d9cb0336-2d13-4dad-b092-967af06c3ce6 | maeth2/Kickstart | 2019/A/training.cpp | /*
Solution to the problem is to first sort the students based on skill level Si*.
Afterwards use the sorted list to calculate the prefix sums of students skills from Si to Si + P**
Finally loop throught the list again using the equation below and find the minimum time required:
time = Si * P - PS[i... | ALGO | 0.99996 | 4.298801 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2022-12-20T00:09:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ac79b06c... |
51ad5dc2-7e91-4963-90ae-e30d3f36f679 | Tutul-dhar/LeetCodeDaily | 1857. Largest Color Value in a Directed Graph.cpp | class Solution {
private:
vector<vector<int>> g;
vector<int> vis, inDegree,inStack;
int n, ans;
bool checkCircle(int node) {
vis[node] = 1;
inStack[node] = 1;
for (int ch : g[node]) {
if (!vis[ch]) {
if (checkCircle(ch))
return tr... | ALGO | 0.999502 | 5.148612 | {
"github_metadata": {
"branch": "main",
"commit_count": 206,
"repo_created_at": "2024-09-28T04:35: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": "833519fc2d... |
92f38fdf-2e83-46bc-93c2-8743d908d2f7 | AnonCSR/PathFinder | pathfinder/src/query/executor/binding_iter/nested_loop_anti_join.cc | #include "nested_loop_anti_join.h"
#include <algorithm>
#include "query/executor/binding_iter/empty_binding_iter.h"
#include "query/var_id.h"
template<bool B>
void NestedLoopAntiJoin<B>::_begin(Binding& _parent_binding) {
parent_binding = &_parent_binding;
lhs_binding = std::make_unique<Binding>(parent_bind... | ALGO | 0.963176 | 3.854311 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-10-13T06:22:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68e1d2416f81... |
38bf9d6f-fdc9-4163-aea4-094354284692 | haryung-lee/algorithm | 백준/Silver/17245. 서버실/서버실.cc | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
using namespace std;
typedef pair<int, int> pii;
typedef pair<int, char> pic;
typedef long long ll;
int dy[] = {0, 1, 0, -1}, dx[] =... | ALGO | 0.999901 | 3.689538 | {
"github_metadata": {
"branch": "main",
"commit_count": 155,
"repo_created_at": "2022-12-19T08:20: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": "8e6fe79661... |
63f0bbcb-6786-4786-b099-f8d07de7f9ac | Tasnimobile/Sorting-Algorithms | SelectionSort.cpp | /**
* @file SelectionSort.cpp
* @author <NAME>
* @brief Implementation for SelectionSort
* @version 0.1
* @date 2024-07-04
*
* @copyright Copyright (c) 2024
*
*/
#include "SelectionSort.hpp"
template <class T>
size_t SelectionSort<T>::findMinMax(const std::vector<T>& list, size_t start) {
// Initialize... | ALGO | 0.99986 | 6.284901 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-23T23:08: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": "6d2c95d3f4b3... |
356dce01-047b-450e-ae20-81ce652ddf35 | xantares/ahmed | H/mblock.cpp | /*
AHMED -- Another software library on Hierarchical Matrices for
Elliptic Differential equations
Copyright (c) 2012 <NAME>
You should have received a copy of the license along with
this software; if not, see AHMED's internet site.
*/
#include "mblock.h"
/* solves X (PL)^H = X L^H P^{... | ALGO | 0.987907 | 3.804803 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-09-10T19:31:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "caf63d49... |
93d81e42-790e-464a-a9f6-75315e6d3b6b | misalakash96/CNS_LAB | ASSIGNMENT_NO_01/DEC.cpp | // decrypt code using Caesar Cyphe
#include <iostream>
#include <string>
using namespace std;;
string caesar_decrypt(string ciphertext, int shift)
{
string decrypted_text = "";
for (char &c : ciphertext)
{
if (isalpha(c))
{
char base = islower(c) ? 'a' : 'A';
c = (c ... | ALGO | 0.981169 | 3.351054 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-12-07T04:41:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b079319fc943... |
3b158064-499c-4dbf-84a6-d12f126444f9 | djdnl13/AlgoritmosParalelos | OpenMPIProgrammingAssignments/exercise1.cpp | /*
* Compile: g++ -std=c++11 -fopenmp -o exercise1 exercise1.cpp
* Run: ./exercise1 <number of threads>
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <omp.h>
using namespace std;
void Gen_bins(double min, double max, double bin_maxes[], int n_binss[], int n_bins... | ALGO | 0.998778 | 4.404808 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2016-01-12T03:00: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": "db82b29c9... |
8c5a2bd2-d181-48c5-a264-93679cedb917 | ikn1062/roboti-irl | src/cartpole/src/ergodic_script.cpp | #include <iostream>
#include <string>
#include <vector>
#include <ergodiclib/file_utils.hpp>
#include <ergodiclib/ergodic_measure.hpp>
#include <ergodiclib/ergodic_controller.hpp>
#include <cartpole/cartpole_sys.hpp>
#include <ergodiclib/fourier_basis.hpp>
#if defined(__APPLE__)
#include </opt/homebrew/include/armadil... | ALGO | 0.974482 | 5.701426 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-02-15T20:29: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": "7d4d382b9c2... |
b8fb8c5b-a190-4979-94d4-0ba387d69c94 | Akshay199456/100DaysOfCode | Topics/Topic/Data Structures and Alogrithms (Topic)/Leetcode(Website)/128(Longest Consecutive Subsequence).cpp | // This problem was also solved using the UMPIRE approach
/*
-------------------------Question:
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
Your algorithm should run in O(n) complexity.
Example:
Input: [100, 4, 200, 1, 3, 2]
Output: 4
Explanation: The longest ... | ALGO | 0.99988 | 6.574 | {
"github_metadata": {
"branch": "master",
"commit_count": 1403,
"repo_created_at": "2019-12-08T19:14:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "acbf264... |
7814b723-d978-4c76-9aa7-528d6baeedc8 | yzwangfeng/reram-synthesis | hybrid-synthesis/source/main.cpp | /*
* main.cpp
*
*/
#include <dirent.h>
#include "farm.h"
#include "map.h"
#include "pipe.h"
#include "primitive.h"
#include "reduce.h"
#include "skeleton.h"
using namespace std;
void image_convolution(int bit_width) {
/*
* initialize input data
*/
const int image_size = 100;
const int filter... | TOOL | 0.971075 | 4.191017 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2021-06-03T08:21:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "563681feed... |
f9d5566b-b22b-4947-8320-5dbeec165ce6 | Armando405/Proyecto_La_Secante2 | include/calculadora.hpp | #pragma once
using namespace std;
class calculadora {
private:
double inicio;
double fin;
int numPuntos;
int numFix;
public:
//Inicio del programa, esto es lo primero que ve el usuario.
void ingresarRango() {
cout << "Hola, bienvenido al método numérico de la secante para resolver ecuaciones ... | ALGO | 0.991917 | 4.568665 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-06-18T16:40: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": "9866a08d063f... |
280417d1-678e-42be-ab46-f9ce5106f3a2 | darang22/PL-OS | src/PCP.cpp | #include <algorithm>
#include <unistd.h>
#include <iostream>
#include <sys/wait.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sstream>
#include <pthread.h>
#include <semaphore.h>
#include <vector>
#include "msg.h"
using namespace std;
//Vector donde se guarda el nombre de... | ALGO | 0.969521 | 4.128306 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-06-30T14:25:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b874eb655e... |
2736acf3-2b03-4838-97d2-1def51c6c2a9 | AbooodJbr/data-structures | BST/BST/BST.h | #pragma once
using namespace std;
template <typename T>
class Node {
T data;
Node<T> *parent, *left, *right;
template <typename T>
friend class BST;
};
template <typename T>
class BST {
private :
Node<T>* root; int n;
Node<T>* createNode(const T& data) {
Node<T>* obj = new Node<T>;
obj->data = data;
obj... | ALGO | 0.997452 | 3.800589 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-05-15T20:53: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": "69f283b12516... |
ca970ed7-67f4-4c07-ad9d-e028ac415858 | ov-wagle/DataStructuresAndAlgorithms | CPP/1-D-Array/pair_sum_approach.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[]) {
int numOfElements, i, array[100], target, left = 0, right, result;
cout << "Enter number of elements : ";
cin >> numOfElements;
right = numOfElements - 1;
for (i = 0; i < numOfElements; i++) {
cin >> array[i];
}
cout << "En... | ALGO | 0.999937 | 4.969363 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2021-07-07T07:57: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": "7ae2223c34b... |
620b55a4-a0e4-4a03-808a-015533fd7c7e | takoyaki65/kyopro-code | atcoder/abc179/d_snuke.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < (n); ++(i))
#define repeat_from(i, m, n) for (int i = (m); (... | ALGO | 0.999972 | 4.416573 | {
"github_metadata": {
"branch": "master",
"commit_count": 153,
"repo_created_at": "2020-08-16T07:54: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": "eaee58b1... |
93f219bc-7826-42cc-8946-fbf13226c9c3 | Md-Nasiat-Hasan-Fahim/Problem-Solving-with-C | .acmx/solutions/Codeforces - Technocup 2022 - Elimination Round 3/D_Yet_Another_Sorting_Problem.cpp | #include <bits/stdc++.h>
using namespace std;
#define FastIO ios_base::sync_with_stdio(false), cin.tie(0)
#define endl '\n'
#define int long long
#define all(x) x.begin(), x.end()
#define pb push_back
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define check(x) cout << (#x) << " is " << (x) << endl;
const in... | ALGO | 0.99999 | 3.993764 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-07-05T03:33: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": "6b95504b3d9a... |
66860a21-8d64-4a9d-af45-f1ca4504e964 | haoel/leetcode | algorithms/cpp/frogJump/FrogJump.cpp | // Source : https://leetcode.com/problems/frog-jump/
// Author : <NAME>
// Date : 2016-11-12
/***************************************************************************************
*
* A frog is crossing a river. The river is divided into x units and at each unit there
* may or may not exist a stone. The frog ... | ALGO | 0.999866 | 5.639235 | {
"github_metadata": {
"branch": "master",
"commit_count": 788,
"repo_created_at": "2014-10-20T03:22:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17857,
"forks": 4931,
"issues": 26,
"pull_requests": 28
},
"file_meta": {
"content_id": ... |
fe3d95c9-7f6e-495d-ada6-5b7338097a73 | Boris-Bodin/coding-games | src/puzzle/ascii-art/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
int main()
{
int L;
cin >> L; cin.ignore();
int H;
cin >> H; cin.ignore();
str... | ALGO | 0.999315 | 3.206365 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-02-28T19:55: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": "9594cb3c8f6... |
00cd008d-8c3b-4e1e-a3d5-0bdcfab14d5b | PaulKGrimes/supermix | library/examples/lna/lna_opt.annotated.cc | // Build a two-stage low noise amplifier, and optimize the component values.
// Shows how to use the optimizer and its associated classes
// Look at lna.cc first to get details on building and simulating the amplifier
// circuit.
#include "supermix.h"
int main()
{
// Set the global temperature and normalization i... | ALGO | 0.988703 | 5.813512 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-10-22T17:03:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5833e1f851... |
854839fe-d075-4c18-9a09-e2ae74316f76 | zixfy/cpp-leetcode | [2428]沙漏的最大总和.cpp | // 给你一个大小为 m x n 的整数矩阵 grid 。
//
// 按以下形式将矩阵的一部分定义为一个 沙漏 :
// 返回沙漏中元素的 最大 总和。
//
// 注意:沙漏无法旋转且必须整个包含在矩阵中。
//
//
//
// 示例 1:
// 输入:grid = [[6,2,1,3],[4,2,1,5],[9,2,8,7],[4,1,2,9]]
// 输出:30
// 解释:上图中的单元格表示元素总和最大的沙漏:6 + 2 + 1 + 2 + 9 + 2 + 8 = 30 。
//
//
// 示例 2:
// 输入:grid = [[1,2,3],[4,5,6],[7,8,9]]
// 输出:35
// 解... | ALGO | 0.999991 | 6.286493 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-09-01T09:04: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": "51cb49c253b2... |
50648c33-e9c1-4a4f-a9f4-bf1fd0ec26c6 | cocojk/algorithm | datastructure/bitmask/16.4.GRADUATION.cpp |
/*
문제
1학년은 노는 게 남는 거란 선배의 말을 철석같이 믿고, 전공 과목은 다 수강철회하고 교양 과목은 다 F 받는 방탕한 1학년을 보냈던 태우는 이제 와서 자신의 행동을 후회하고 있습니다. 졸업 전에 채워야 할 학점이 너무 많기 때문입니다. 졸업 필수 학점을 채우려면 전공 과목 N 개 중 K 개 이상을 수강해야 합니다. 그런데 각 과목은 해당 과목의 선수과목을 미리 수강했어야만 수강할 수 있으며, 각 학기마다 모든 과목이 개설되는 것이 아니기 때문에 문제가 복잡해졌습니다. 어떻게 해야 최소 학기에 졸업을 할 수 있을까요?
각 과목의 정보와... | ALGO | 0.999816 | 4.136796 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-10-23T06:43: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": "cd68f5c36... |
f44fb867-8961-4597-9d39-3e5874203168 | fcnoronha/competitive-programming | Codforces/pairOfTopics.cpp | //codeforces.com/contest/1324/problem/D
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define fr(i, n) for(int i = 0; i < n; i++)
#define frr(i, n) for(int i = 1; i <= n; i++)
#define dbg(x) cout << #x << " = " << x << endl
#define all(x) x.begin(),x.end()
#define ms(x, i) memset(x, i, sizeof(x)... | ALGO | 0.999912 | 3.619718 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2018-07-05T22:15:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51f6eeaf... |
23d603f6-b819-4469-a3a9-d00af94889fd | PrathameshJadhav30/DSA-Course | 014 - Problems on Binary Search/01-Search in Rotated Sorted Array/1-Brute Force Apporach/SearchinRotatedSortedArray.cpp | // Brute Force Apporach - Linear Search
// Problem Link : https://leetcode.com/problems/search-in-rotated-sorted-array/description/
#include <iostream>
#include <vector>
using namespace std;
// Brute-force solution: Linear search
int search(vector<int>& nums, int target) {
// Loop through the array
for (int i ... | ALGO | 0.999989 | 6.257618 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2025-05-13T15:46: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": "3e839571644... |
63814b9e-622a-4364-a1bc-2dfda3d72b3e | Fengdalu/acm-icpc | CF/309/A.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <set>
using namespace std;
#define N 2000
#define LL long long
#define MOD 1000000007
LL inv[N], num[N];
void init()
{
num[0] = num[1] = 1LL;
for(int i = 2; i < N; i++) num[i] = (num[i - 1] * (LL)i) % MOD;
inv[0] = inv[... | ALGO | 0.999988 | 3.967612 | {
"github_metadata": {
"branch": "master",
"commit_count": 772,
"repo_created_at": "2014-12-24T15:25:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba8829e2... |
f940df23-66a6-4577-9496-3962bd746e50 | TomCN7/RecastExperiment2 | Recast/Source/RecastFilter.cpp | //
// Copyright (c) 2009-2010 <NAME> <EMAIL>
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including c... | ALGO | 0.981807 | 6.522182 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2013-11-11T04:04: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": "d13ea28fe... |
19e8fb11-3d7d-48d2-9e61-d44b544c442b | lanl/SNAP | ports/kokkos-direct/snappy.hpp | #ifndef SNAPPY_HPP
#define SNAPPY_HPP
#include <Kokkos_Core.hpp>
#include <Kokkos_Parallel.hpp>
#include <Kokkos_View.hpp>
#include <Kokkos_Serial.hpp>
#include <impl/Kokkos_Timer.hpp>
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <cstdlib>
#include <cmath>
#include <vector>
#... | ALGO | 0.995306 | 4.650652 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2013-02-14T19:39:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 49,
"forks": 34,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "0b5905e11d... |
c4f6976b-e44d-414f-b5f3-0945481bd420 | LowToneVoice/experiments | simulation/oscillation_lambda.cpp | #include <iostream>
#include <fstream>
#include <TFile.h>
#include <TH1F.h>
#include <TF1.h>
#include <TTree.h>
#include <TCanvas.h>
// data labels
std::string PHASE_CONTRIB = "g";
std::string MAIN_SUB = "mix";
std::string ANGLE_DELTA_DEG = "90";
std::string TIME_MIN = "20";
std::string ANGLE_FROM_PARALLEL_DEG = "1e-2... | ALGO | 0.939694 | 4.551426 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2023-11-17T06:01:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "eabe19b951d... |
42072f3e-36db-4654-97ea-228252806b29 | superman0110/Learning-Git | cocomo-model.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
double drivers[15][5] = {
{0.75, 0.88, 1, 1.15, 1.40},
{ 1.00, 0.94, 1, 1.08, 1.16},
{0.70, 0.85, 1.15, 1.30},
{ 1.00, 1.00, 1, 1.11, 1.30},
{ 1.00, 1.00, 1, 1.06, 1.21},
{ 1.00, 0.87, 1, 1.15, 1.30},
{ 1.00, 0.87, 1, 1.07, 1.15},
{1.46, 1.1... | ALGO | 0.998779 | 4.30597 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-10-02T12:43:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8fc802c4... |
86259bcf-6b99-4529-9ba4-f26b83f3809d | Pahandrovich/Num_met_Dirichlet_Task | Num_met_6s_2_01/DirichletTask.cpp | #include "DirichletTask.h"
#include <algorithm>
Dirichlet_Test::Dirichlet_Test(int _n, int _m) :Dirichlet_Base(_n, _m)
{
for (int j = 1; j < m; j++)
for (int i = 1; i < n; i++)
{
Right[(n - 1)*(j - 1) + (i - 1)] = -f(a + i * h, c + j * k);
}
Init_Right();
}
double Dirichlet_Test::Mu1(double y) const
{
re... | ALGO | 0.997991 | 4.209737 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-04-21T08:41: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": "ccafc1246... |
e653ee7e-ad8f-4614-8a2a-03b9ba47633f | Anugrahchaturvedi/mycpp | milestone2/tree/treeuse.cpp | #include<iostream>
#include<queue>
#include"tree.h"
using namespace std;
void printlevelwise(treeNodes<int>* root){
if(root==NULL)
return ;
queue<treeNodes<int>*> q;
q.push(root);
while (q.size()>0)
{
treeNodes<int>* node=q.front();
cout<<node->data<<":";
q.pop();... | ALGO | 0.999299 | 4.450591 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2022-11-07T18:20: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": "2e9e228a080... |
56069232-bf28-47f3-83db-6414b6dbe80e | CryptDB/cryptdb | crypto/online_ope.cc | #include <string.h>
#include <string>
#include <crypto/online_ope.hh>
#include <iostream>
#include <cmath>
#include <sstream>
template<class EncT>
struct tree_node {
EncT enc_val;
tree_node *left;
tree_node *right;
tree_node(const EncT &ev) : enc_val(ev), left(0), right(0) {}
~tree_node() {
... | ALGO | 0.995667 | 4.740613 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2014-01-03T16:26:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 512,
"forks": 97,
"issues": 7,
"pull_requests": 2
},
"file_meta": {
"content_id": "4558481... |
791206d6-8b3c-4944-ab7e-058302f7de71 | andrewzolotukhin/codeforces | 2120/A/solution.cpp | #include <bits/stdc++.h>
using namespace std;
bool solve() {
int w1, h1, w2, h2, w3, h3;
cin >> w1 >> h1 >> w2 >> h2 >> w3 >> h3;
if (w3 + w2 + w1 == h1 && h3 == h2 && h2 == h1) {
return true;
}
if (h3 + h2 + h1 == w1 && w2 == w3 && w3 == w1) {
return true;
}
if (w2 + w3 == w1 && h2 == h3 && h... | ALGO | 0.999893 | 4.424315 | {
"github_metadata": {
"branch": "master",
"commit_count": 283,
"repo_created_at": "2024-11-24T12:17: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": "50761adb... |
d1611b93-0963-484f-b76b-5b6fdcc120ae | DeadHeadRussell/cs488 | src/Trackball.cpp | #include "Trackball.h"
#include <cmath>
// The following functions were taken (and slightly modified) from the provided demo code
void vCalcRotVec(float fNewX, float fNewY,
float fOldX, float fOldY,
float fDiameter,
float *fVecX, float *fVecY, float *fVecZ) {
long... | ALGO | 0.91066 | 6.19383 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2012-07-12T16:27: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": "4e1bcaa36... |
e67e72bc-f4b2-48a8-b886-fc150572dd0a | Multiset-24/Programming | Competitive-programming/dp_form_1_first_problme.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1e9+7;
int n,A,B;
int dp[101][101][101][11];
int rec(int i,int a,int b,int last){
// prune
// base
if(i==n){
if(a==0&&b==0){
return 1;
}else{
return 0;
}
}
// cache c... | ALGO | 0.99943 | 4.25291 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2023-10-13T13:24: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": "135f87b3fec... |
fa2fa5b9-df7a-4d75-a937-e7b9b7f57a9f | ermolaevv/ppc-2024-autumn | tasks/mpi/chizhov_m_all_reduce_boost_realization/src/ops_mpi.cpp | // Copyright 2023 <NAME>
#include "mpi/chizhov_m_all_reduce_boost_realization/include/ops_mpi.hpp"
#include <algorithm>
#include <functional>
#include <random>
#include <string>
#include <vector>
bool chizhov_m_all_reduce_boost_mpi::TestMPITaskSequential::pre_processing() {
internal_order_test();
// Init vectors
... | ALGO | 0.964537 | 4.962153 | {
"github_metadata": {
"branch": "master",
"commit_count": 440,
"repo_created_at": "2024-10-04T18:18:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 157,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b04d44... |
897afc7f-4743-42f9-aa2b-674bcee2ec7e | luparral/algo3 | TP3/ejercicio3/ejercicio3.v2.cpp | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
//Estandarizar la salida
using namespace std;
typedef vector< vector <float> > grafo;
//Grafo es un vector de vectores de int, que tiene n (n = cantidad de vertices) en la posición 0, n-1 en la segunda y así.
//Recordar:
//los cant_nodos v... | ALGO | 0.999711 | 4.678192 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-03-29T01:14: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": "0e6d26b4c3... |
ff7bacbc-57c4-4ef3-b8c5-f3c34661cada | ricardo0129/usaco_practice | Chapter_2/2.3/concom.cpp | /*
ID: ruizr271
TASK: concom
LANG: C++
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vll vector<ll>
#define FOR(i,n) for(int i=0;i<n;i++)
#define pb push_back
#define f first
#define s second
const... | ALGO | 0.999948 | 4.192918 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2021-05-14T23:52: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": "7ba76c2f6... |
971a2110-c7c5-4723-be56-15553a0e9b62 | rokyan/leetcode | medium/cpp/1756.cpp | // https://leetcode.com/problems/design-most-recently-used-queue/description/
class MRUQueue
{
public:
MRUQueue(int n)
{
block_size = static_cast<int>(std::sqrt(n)) + (block_size * block_size < n);
const auto total_blocks = n / block_size + (n % block_size != 0);
blocks.resize(total_blo... | ALGO | 0.999191 | 6.57329 | {
"github_metadata": {
"branch": "master",
"commit_count": 2228,
"repo_created_at": "2022-09-17T09:45:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8636f99... |
41d0e067-0fdf-40a8-8c5a-fc91fdac87c1 | Octobug/notes | algorithms_and_data_structures/leetcode/binary_search/e_00069_sqrt_x/main.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution
{
public:
int mySqrt(int x)
{
if (x < 1)
{
return 0;
}
if (x < 4)
{
return 1;
}
int left = 0;
int right = x;
int mid;
... | ALGO | 0.999936 | 4.727096 | {
"github_metadata": {
"branch": "main",
"commit_count": 1765,
"repo_created_at": "2021-01-27T06:21:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "873d8b47... |
cd33c3e5-76f7-4f38-a28b-b1c5291a27d1 | chmnchiang/bcw_codebook | Contest/Japan2014/pD.cpp | #include<bits/stdc++.h>
#include<unistd.h>
using namespace std;
#define FZ(n) memset((n),0,sizeof(n))
#define FMO(n) memset((n),-1,sizeof(n))
#define MC(n,m) memcpy((n),(m),sizeof(n))
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define ALL(x) begin(x),end(x)
#define SZ(x) ((int)(x).size()... | ALGO | 0.999924 | 3.487001 | {
"github_metadata": {
"branch": "master",
"commit_count": 361,
"repo_created_at": "2014-06-03T11:38:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 111,
"forks": 22,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4ab0... |
bb6e648c-38e0-492e-b4d1-6082c04b689f | ishandutta2007/codeforces-s | sonechko/normal/979/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ull unsigned long long
#define mp make_pair
#define ll long long
const int N = 4e5 + 11;
const int MOD = 1e9 + 9;
int k1[N],k2[N],k3[N];
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
... | ALGO | 0.999694 | 3.775524 | {
"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": "bcb51119777e... |
56259282-0f17-45d6-8551-b7713717e9ea | VIRAJcHOPADE/Data-Structures-in-CPP | Linked List 1/DeleteNodeRecursive.cpp | /*Given a singly linked list of integers and position 'i', delete the node present
at the 'i-th' position in the linked list recursively.
Sample Input 1 :
1
3 4 5 2 6 1 9 -1
3
Sample Output 1 :
3 4 5 6 1 9
Sample Input 2 :
2
30 -1
0
10 20 30 50 60 -1
4
Sample Output 2 :
10 20 30 50
*/
#include <iostream>
class Nod... | ALGO | 0.999803 | 4.700652 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-03-26T15:35:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "766e8c74e41... |
e1052db0-094b-471b-8a3c-05c88549c08a | Shashankiitr/Nongamba- | Codeforces/A_Rook.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <numeric>
using namespace std;
void solve(){
string s; cin >> s; char C = s[0]; int A = s[1] - '0';
int X[8] = {1, 2, 3, 4, 5, 6, 7, ... | ALGO | 0.999331 | 3.303862 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-02-04T10:11:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56d30d3944a... |
de423a0f-c7d0-4eb4-bb24-7bedd98ccc96 | pavel-ryzhov/global_vars | runs/002765.cpp | // T9.cpp : Defines the entry point for the console application.
//
//<NAME>.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <map>
#include <list>
#include <iostream>
#include <algorithm>
#define N 50000
#define M 100000
using namespace std;
struct t_node{
string word;
int fre... | ALGO | 0.999924 | 3.345537 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-07-04T20:43: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": "3a02aa497ac1... |
722478df-2e0d-4ebd-802e-46d6afc7cc20 | HarvardAgileRoboticsLab/drake | drake/matlab/util/quat2expmapSequencemex.cpp | #include <mex.h>
#include "drake/math/expmap.h"
#include "drake/matlab/util/drakeMexUtil.h"
using namespace std;
using namespace Eigen;
DLL_EXPORT_SYM
void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
if (nrhs != 2) {
mexErrMsgTxt(
"Drake:quat2expmapSequencemex:Incorrect Us... | ALGO | 0.976778 | 5.781271 | {
"github_metadata": {
"branch": "master",
"commit_count": 15922,
"repo_created_at": "2015-10-23T15:10:06.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "RobotLocomotion/drake",
"stars": 10,
"forks": 9,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"co... |
e9fdfa84-2e1d-4739-bbbd-927968b4ff5e | fabiokochem/AlgoQuest | Implementations/Graphs/adj_matrix.cpp | /*
An adjacency matrix is a 2D array used to represent a graph.
Each cell in the matrix indicates whether there is an edge between two vertices.
For an undirected graph, the matrix is symmetric. For a directed graph, it is not.
How to Use:
- Use a 2D vector or array to store the adjacency matrix.
- If there i... | ALGO | 0.999777 | 6.508952 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-12-29T13:38: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": "b3dffcb1934... |
4c26d719-75a1-43bf-bba5-4cc45cf17866 | HarshCasper/NeoAlgo | C-Plus-Plus/Bit--Manipulation/Max_XOR_of_Two_Array.cpp | /*
Given an integer array nums, return the maximum result of nums[i] XOR nums[j],
where 0 ≤ i ≤ j < n.
*/
#include<iostream>
#include<vector>
using namespace std;
// Constructing a trie
struct trie {
trie *zero,*one;
};
//Building the trie
void insert(int num,trie *root) {
trie *ptr=root;
for(int ... | ALGO | 0.999953 | 5.549089 | {
"github_metadata": {
"branch": "master",
"commit_count": 7521,
"repo_created_at": "2020-06-24T16:04:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 887,
"forks": 1041,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89... |
c1fbacf2-f8bd-449b-b787-86be7224b736 | joelchaconcastillo/MyResearchTopics | Many-Objective-MaxMin-Dominance/generate3_2.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main(){
//Tchhebycheff
//Asumiendo punto de referencia en 0: la función es max(w1*f1, w2*f2, w3*f3).
//Asumiendo continuidad del frente, el minimo se producira con w1*f1 = w2*f2 = w3*f3
//es decir, f2 = w1/w2 * f1, f3 = w1/w3*f1
//Supongamos que todo... | ALGO | 0.999785 | 3.696955 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2018-05-10T19:21: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": "ffce00e3... |
93c1190c-90c0-4d30-b442-9c277ee5fdca | KodairaTomonori/AtCoder | ABC/129/D.cc | #include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i < n; i ++)
#define rep1(i, n) for (int i=1; i <= n; i ++)
#define _min(x, y) x = min(x, y)
#define _max(x, y) x = max(x, y)
using namespace std;
static int grid[2005][2005] = {};
static int L[2005][2005] = {};
static int R[2005][2005] = {};
static int D[2005]... | ALGO | 0.999807 | 3.975216 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2019-03-14T13:33:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0623f8452... |
88869c09-901d-4632-aff3-abfe00e9dfdc | olivxu/leetcode | 0234.Palindrome_Linked_List/0234.Palindrome_Linked_List_version_1.cpp | /* 三种解法:
* 1. 数学方法:
* e.g. 1->2->2->1
* 1 + 20 + 200 + 1000 == 1000 + 200 + 20 + 1
* 问题:不通用,可能遇到过不了的case,链表里的数据不一定小于10,链表很长的时候,数据会溢出
* 不推荐使用此方法
* 2. 快慢指针 + 翻转链表:
* 慢指针确定中点,翻转后半张链表,再比较两个链表
* 翻转链表参考206题
* 3. 递归:
* 利用递归的栈的特性
*/
/**
* Definition for singly-linked list.
* struct ListNode {... | ALGO | 0.999987 | 5.803106 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2020-08-11T14:55: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": "46be0641e... |
4fd94190-359a-453e-86a6-ca1d8e3f8c7e | Xeoul/projects | CISP 360/midterm.cpp | #include <iostream>
#include <fstream>
#include <cstdlib>
//#define junk value
using namespace std;
// Linear Search returns array index of found value,
// OR -1 if value not found
int
searchLinear(int ar[], int numElements, int value)
{
int i;
bool found;
i = 0;
while (i < numElements || !found) {
... | TOOL | 0.983393 | 3.124003 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-05-26T21:23:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "542529c23... |
f02c6b96-4d43-4e10-ae76-bdf581861d31 | xfmeng17/leetcode | cpp/0064.cpp | class Solution {
public:
int minPathSum(vector<vector<int>> &grid) {
// return func1(grid);
// return func2(grid);
return func3(grid);
}
// ** top-down recursion
// ** of cause, time-limit-exceeded
int func1(vector<vector<int>> &grid) {
int height = grid.size();
if (height <= 0) {
re... | ALGO | 0.999994 | 5.766968 | {
"github_metadata": {
"branch": "master",
"commit_count": 539,
"repo_created_at": "2018-02-12T06:37:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a0bc283... |
8784d9e8-94aa-48e5-ad3a-389d07632180 | nikita-l-dyablo/chekers | src/CheckerGame.h | // Created by <NAME> on 27.05.24.
#ifndef CHEK_CHECKERGAME_H
#define CHEK_CHECKERGAME_H
#include <vector>
#include <string>
#include <sstream>
#include "Board.h"
#include "Checker.h"
#include "Position.h"
#include <fstream>
#include <iostream>
#include <algorithm>
// Класс для управления игрой в шашки
class CheckerG... | ALGO | 0.993381 | 4.863583 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-29T05:13:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f7fe0908fcb... |
516ddd50-5b87-4f99-bc40-087459a0e04d | Opynicus/misc | leetcode/129.求根节点到叶节点数字之和.cpp | /*
* @lc app=leetcode.cn id=129 lang=cpp
*
* [129] 求根节点到叶节点数字之和
*/
// @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(nullp... | ALGO | 0.999951 | 6.28656 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2022-04-10T11:15: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": "eb277fd8863... |
37a4347d-a80b-4df5-b0f7-dd0ba8dad4d3 | JupiterIvy/PCA-Comandos-basicos | Exercicios-31-01-23/20230131_001.cpp | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <string.h>
#include <conio.h>
void maiusculo(int tam, char word[]){
int i, maiusc;
printf("\nConversão para maiusculo \n");
for (i = 0; i < tam; i++){
maiusc = word[i] - ('a'-'A');
printf("%c", maiusc);
}
}
void inverte(int tam, char word[]){... | TOOL | 0.990183 | 3.336869 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-12-08T03:05: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": "cb87c16ee94... |
ac6983b1-ffa3-48bd-ad03-2b0c9839a641 | teju85/CorrDim | src/maps/HenonMap.cpp | /***************************************************************************\
Tool to find the correlation dimension of a sequence.
Copyright (C) 2010 Tejaswi.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Fou... | ALGO | 0.998206 | 4.546118 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2011-06-13T01:30:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8c040c32a... |
01f58cc8-3469-4965-9b7e-5d4520121eff | LenartPiotr/AdventOfCode2023 | AdventOfCode2023/day5.cpp | #include <iostream>
#include <vector>
#include <array>
#include <string>
#include <sstream>
#include <algorithm>
#include "days.h"
#define isDigit(X) ((X) >= '0' && (X) <= '9')
using namespace std;
int findRightMapIndex(const vector<array<long long, 3>>& map, long long value) {
for (int i = 0; i < map.size(); i++)... | ALGO | 0.999555 | 5.436643 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-12-02T16:09: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": "01e497e86b2... |
cb97fac6-f353-4ad2-9229-30a3ad1880e9 | tenick/cp | Codeforces/Div2/Educational/155/c2.cpp | #include <iomanip>
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <stack>
#include <queue>
using namespace std;
#include <ext/pb_ds/assoc_contai... | ALGO | 0.999961 | 5.00358 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2024-10-10T14:34:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89fd1820... |
2dd7ecf9-e239-42aa-8a97-9aa0d9dc623a | ishandutta2007/codeforces-b | bigbag/normal/1188/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int max_n = 1000111, mod = 998244353;
int mul(int x, int y) {
return (1LL * x * y) % mod;
}
int power(int a, int b) {
if (b == 0) {
return 1 % mod;
}
if (b % 2 == 0) {
return power(mul(a, a), b / 2);
}
return mul(a, power(a,... | ALGO | 0.999938 | 4.475668 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05: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": "34d441decc1f... |
2c1d8c10-031e-4081-a69d-84023e536607 | Arjun3492/DSA | 1)Array/medium/3)majorityElement.cpp | // Find the Majority Element that occurs more than N/2 times
// Problem Statement: Given an array of N integers, write a program to return an element that occurs more than N/2 times in the given array.
// You may consider that such an element always exists in the array.
// BRUTE FORCE APPROACH
// run a nested loop ,s... | ALGO | 0.999994 | 6.131052 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2023-08-23T18:10: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": "f388584e5c... |
47885d2c-e707-4596-a653-aa04acb7c35e | muyeon-jo/problems | sequence.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int compare(const void* a, const void* b) {
return *(int*)a - *(int*)b;
}
int main() {
FILE* fp_in, * fp_out;
fp_in = fopen("sequence.inp", "r");
fp_out = fopen("sequence.out", "w");
int n;
fscanf(fp_in, "%d", &n);
int* arr = (int*)... | ALGO | 0.999998 | 3.359412 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-03-07T01:08:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e64bc374a1... |
c3958078-004c-49ea-927f-b7f967f381c3 | Rtakaha/roboCon | senpai/Detect.h | //
// Detect.h
//
//
// Written by kimoto on 2017/06/25.
//
//
#ifndef ____Detect__
#define ____Detect__
#include "ev3api.h"
#include "Clock.h"
#include "GyroSensor.h"
#include "ColorSensor.h"
#include "SonarSensor.h"
using namespace ev3api;
//#include "BoundaryDefine.h"
#define LIGHTDATA_N 10//光センサの記録回数
#define ... | TOOL | 0.91315 | 5.217526 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-05-28T04:03: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": "03cee44ac... |
56cb1d03-065e-40be-9f9f-7e5bbe4fd2c1 | taitruong256/Competitive-programming | IUH_Olympic_ICPC/Codecamp/round1/I.cpp | /*==============================================================================================================
__ __ _____ ______ _______
| | | | / __ \ / _____| / __... | ALGO | 0.999996 | 3.873479 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-04-14T06:59: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": "d75f00223187... |
805405b3-54fa-4a92-a815-47618daa54d3 | shanto86/problem-book-1-solutions | Easy Problems/UVa 202 - Repeating Decimals.cpp | /**
* problem: UVa 202 Repeating Decimals
* author: sjsakib
* approach:
**/
#include <bits/stdc++.h>
using namespace std;
int mem[30007];
vector<int> v;
void repeating(int a, int x) {
memset(mem, -1, sizeof(mem[0])*3007);
v.clear();
printf("%d/%d = ", a, x);
printf("%d.", a/x);
a =... | ALGO | 0.999444 | 4.328071 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2017-09-22T22:05:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 56,
"forks": 26,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "637cded... |
696adadc-8128-4af4-ba0c-09f280b8792a | Vesion/Misirlou | leetcode/428-SerializeAndDeserializeNaryTree.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
// Similar to 297-SerializeAndDeserializeBinaryTree
// preorder traversal, '#' for nullptr, need save size of children
class Node {
public:
int val;
vector<Node*> children;
Node() {}
Node(int _val) {
... | ALGO | 0.996798 | 5.272401 | {
"github_metadata": {
"branch": "master",
"commit_count": 525,
"repo_created_at": "2016-02-04T08:08: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": "406a5e41... |
ef67b267-fb59-4de8-a0bd-5af323263619 | JFMACS/Algorithm-UVA | uva202.cpp | #include <iostream>
#include <cstdlib>
#include <cstdio>
using namespace std;
int main()
{
int x,y;
int result[3001];
int left[3001];
while( cin>>x>>y ){
int flag = 0;
cout<<x<<"/"<<y<<" = "<<x/y<<".";
x = x%y;
for( int i = 0 ; i < 3001 ; i++ ){
x *= 10;
... | ALGO | 0.99966 | 4.104554 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-05-08T06:12: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": "cd9e116bff... |
28d0bc1e-eca4-47ce-9759-62e73c746ee1 | leverimmy/Codes | 题目/洛谷/P2002 消息扩散/message.cpp | #pragma GCC ("-W1,--stack=128000000)
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cctype>
#include <iostream>
#include <string>
#include <vector>
#define ll long long
#define rgi register int
#define rgl register long long
#define il inline
using namespace std;
const int N = 1e5 + 10;
const int... | ALGO | 0.999698 | 3.954178 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-11-04T09:43: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": "b711ba347... |
9199e7fb-8c88-471e-b96a-3590473fb73b | Masud-Abdullah/Phitron | Phitron/Semester2/Basic_Data_Structures/Module 21/3_Convert_array_to_bst.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *left;
Node *right;
Node(int val)
{
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
void level_Order(Node *root)
{
if (root == NULL)
{
cout << "Tree Nai\n";
... | ALGO | 0.999986 | 4.474871 | {
"github_metadata": {
"branch": "main",
"commit_count": 172,
"repo_created_at": "2023-06-30T17:26: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": "e371a4dcdf... |
96cf11fd-509e-4fb9-b085-2cf44638b621 | aaronbloomfield/pdr | labs/lab01/svutil.cpp | // utility functions for vectors of strings
#include "svutil.h"
// prints the strings in the vector
void svOutput ( const vector<string> &vect ) {
for (int i=0; i < vect.size(); ++i) {
cout << vect.at(i) << " ";
}
cout << endl;
}
// finds a string in a vector and returns its index
int svFind ( c... | TOOL | 0.978824 | 5.389338 | {
"github_metadata": {
"branch": "master",
"commit_count": 2942,
"repo_created_at": "2013-12-28T14:02:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 116,
"forks": 484,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8e... |
5c984327-b150-446e-8d5c-610d567bedb0 | Kewth/OJStudy | lg5288.cpp | #if 0
2020.04.07
去年 HNOI 居然有我能自己做的题!
首先不难发现没有操作当且仅当所有线段都形如 (i, n) 。
把线段看作点建图,从 (1, n) 所在的三角形开始,在一个三角形内,由一个点向另外两个点连边。
在这样建出来的有根二叉树上考虑问题,
事实上这个二叉树从根开始的右链是类似于虚节点一样的东西,仅用于保持树的形态。
那么只要从根向下对实际节点进行旋转操作就一定能把线段放在正确位置。
所以最小的操作次数就是实际节点的数量,而操作的方案数就是实际节点的拓扑序种类数。
树的拓扑序数量是 n! / mul(size[u]) ,每次操作 size 发生改变的点至多只有一个,很好维护。
ps:
对于建树,... | ALGO | 0.999954 | 4.674666 | {
"github_metadata": {
"branch": "master",
"commit_count": 779,
"repo_created_at": "2019-02-26T09:28:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f55ca56a... |
8d701a0f-fc80-472e-8185-be8b84034851 | GlebNM/TicTacToe | src/State.cpp | #include "State.h"
#include "Other.h"
#include "cassert"
#include <iostream>
int State::getSmallCellPosition(Position position) {
return position.x * 9 + position.y;
}
int State::getBigCellPosition(Position position) {
return position.x / 3 * 3 + position.y / 3;
}
bool State::isOccupied(Position position) co... | ALGO | 0.996192 | 5.812182 | {
"github_metadata": {
"branch": "dev",
"commit_count": 58,
"repo_created_at": "2022-03-08T11:22:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "e653da51b022... |
a13209ce-ff56-4d4e-b122-d192c2a78259 | yosupo06/library-checker-problems | graph/enumerate_triangles/sol/correct.cpp | #include <cstdio>
#include <tuple>
#include <utility>
#include <vector>
int main() {
using i64 = long long;
static constexpr i64 mod = 998244353;
int n, m;
std::scanf("%d %d", &n, &m);
std::vector<i64> xs(n);
for (auto &x : xs) {
scanf("%lld", &x);
}
std::vector<std::pair<int, int>> edges(m);
fo... | ALGO | 0.999975 | 4.773839 | {
"github_metadata": {
"branch": "master",
"commit_count": 3115,
"repo_created_at": "2019-05-30T20:49:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 589,
"forks": 137,
"issues": 98,
"pull_requests": 3
},
"file_meta": {
"content_id": "c6... |
abb9ef0d-4241-483b-b95d-fac5c044a47a | wzr1005/patcode | PAT/1145 Hashing - Average Search Time/1145 Hashing - Average Search Time.cpp | #include <cstdio>
#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
int Msize, n, m;
int isPrime(int n) {
for (int i = 2; i <= sqrt(n); i++) {
if (n % i == 0) return 0;
}
return 1;
}
int main() {
cin >> Msize >> n >> m;
while (!isPrime(Msize)) Msize++;
vector<int> v(Msize);
for (int i... | ALGO | 0.999696 | 3.507763 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-02-22T16:24:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7625fd71d... |
3786ae68-9162-4796-927b-6c6932e19cfc | akishichinibu/cpparmc | include/stream/bwt/encode.hpp | #ifndef CPPARMC_BWT_ENCODE_HPP
#define CPPARMC_BWT_ENCODE_HPP
#include <numeric>
#include <execution>
#include <vector>
#include "compile_base.h"
#include "logger.hpp"
#include "stream/generator.hpp"
#include "utils/timer.hpp"
#include "utils/darray.hpp"
namespace cpparmc::stream {
using namespace utils;
... | TOOL | 0.993492 | 7.262293 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-04-26T14:33: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": "0013cbf15... |
42767c11-7769-48de-983c-775122cd9d98 | rupesh-72/LeetCode | 1669-merge-in-between-linked-lists/1669-merge-in-between-linked-lists.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:
ListNode* mergeInBetw... | ALGO | 0.999921 | 5.116961 | {
"github_metadata": {
"branch": "main",
"commit_count": 512,
"repo_created_at": "2022-12-23T12:40: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": "243161df1f... |
b3d907ae-e174-48ec-9e64-320669bae2bd | aiekick/Lumo | 3rdparty/taskflow/examples/sycl/sycl_matmul.cpp | // The example shows how to use syclFlow to multiply two 2D matrices.
#include <taskflow/taskflow.hpp>
#include <taskflow/sycl/syclflow.hpp>
// Matrix multiplication using GPU
auto gpu(int M, int N, int K) {
std::vector<int> ha, hb, hc;
int *da, *db, *dc;
tf::Executor executor;
tf::Taskflow taskflow("Matrix... | ALGO | 0.964472 | 6.904971 | {
"github_metadata": {
"branch": "master",
"commit_count": 675,
"repo_created_at": "2022-05-15T13:47:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 58,
"forks": 11,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "23c081... |
3ad49634-2828-4551-8f90-db8cdfebf391 | jigjnasu/leet_code | 64_minimum_path_sum.cpp | /*
LeetCode.com
Problem No: 64
Problem: Minimum Path Sum
<NAME> @ cpp.rakesh at gmail.com
Date: 26/05/2021
*/
#include <bits/stdc++.h>
inline void print(const std::vector<std::vector<int>>& grid) {
printf("----------------------------------------------\n");
for (const auto& row : grid) {
for... | ALGO | 0.999985 | 5.768948 | {
"github_metadata": {
"branch": "master",
"commit_count": 387,
"repo_created_at": "2016-09-02T02:47: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": "838225b0... |
4a56a0fc-a9c5-4caf-b71c-a4e4493ae40d | gianlucamarano23/Heap-Sort | src/Heap.cpp | /****************************************************************************/
//
// main.cpp
// Project: heap Sort
//
// Created by GianLuka23 on 18/10/2019.
// Copyright © 2019 MacBook. All rights reserved.
// insert here description and complexity analysis of heap sort algorithm
//
/****************************... | ALGO | 0.998086 | 4.730391 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2019-10-28T13:08:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "27f0f213a... |
1d3ad650-bba2-4f7d-9db1-cb0d6b6b3281 | unluckyjung/Algorithm | BaekJoon/10826.cc | #include <bits/stdc++.h>
using namespace std;
string memo[10002];
string sum(string num1, string num2) {
reverse(num1.begin(), num1.end());
reverse(num2.begin(), num2.end());
int maxLen = max((int) num1.size(), (int) num2.size());
while (num1.size() < maxLen) {
num1 += "0";
}
while (num2.size() < ... | ALGO | 0.999972 | 4.589668 | {
"github_metadata": {
"branch": "master",
"commit_count": 773,
"repo_created_at": "2019-03-11T09:43:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f88fb3d... |
2c28fed4-4160-4a0d-b854-41c9f2448a76 | ftiasch/dreadnought-code-library | merge/HalfPlaneIntersection.cpp | struct Point {
int quad() const { return sign(y) == 1 || (sign(y) == 0 && sign(x) >= 0);}
};
struct Line {
bool include(const Point &p) const { return sign(det(b - a, p - a)) > 0; }
Line push() const{ // 将半平面向外推 eps
const double eps = 1e-6;
Point delta = (b - a).turn90().norm() * eps;
return Line(a - delta, b ... | ALGO | 0.999983 | 4.763758 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2019-02-02T10:12:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 47,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a044f926... |
be46bde9-6f63-462c-8c9b-055e7b03c77c | jakubprzydatek/przygotowaniadomatury | Kuba Przydatek pd 24/okregi 79/79.1/main.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <math.h>
using namespace std;
int ktora_cwiartka(float x, float y, float r)
{
float granicax=fabs(x);
float granicay=fabs(y);
if(r>=granicax || r>=granicay)
{
return 0;
} else if(x>0 && y>0)
{
return 1;
} els... | ALGO | 0.998527 | 3.606308 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-12-05T00:58:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ad61f451637... |
3c7aac38-0af0-4eee-aa99-39a737ee45fd | sahuaman83/Competetive | Graph/Detect cycle in a directed graph(DFS).cpp | class Solution
{
public:
//Function to detect cycle in a directed graph.
bool cycle_dfs(int node,vector<int> adj[],vector<int> &vis,vector<int> &dfs_vis)
{
vis[node]=1;
dfs_vis[node]=1;
for(auto it:adj[node])
{
if(vis[it]==1 && dfs_vis[it]==1)
return true;
else
... | ALGO | 0.999907 | 5.859422 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2020-03-29T19:58:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7b1435a4... |
0fe092da-cea6-443f-bead-a4529f8e7389 | anarkh97/aero-s-foam | Paral.d/MDNLStatic.h | #ifndef _MD_NL_STATIC_H_
#define _MD_NL_STATIC_H_
template <class Scalar> class GenDecDomain;
typedef GenDecDomain<double> DecDomain;
class Domain;
template <class Scalar> class GenParallelSolver;
typedef GenParallelSolver<double> ParallelSolver;
template <class Scalar> class GenFullSquareMatrix;
typedef GenFullSquare... | ALGO | 0.96403 | 4.220772 | {
"github_metadata": {
"branch": "master",
"commit_count": 3168,
"repo_created_at": "2024-11-06T21:17:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42a5662... |
8a5b370b-6efc-4d33-afeb-1ea474373fd9 | Wild-Donkey/Code | PYYZ/C36/C_Pro.cpp | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define Wild_Donkey 0
using namespace std;
inline unsigned RD()... | ALGO | 0.99981 | 4.375085 | {
"github_metadata": {
"branch": "main",
"commit_count": 182,
"repo_created_at": "2021-02-23T08:38:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fa6bfb8d8... |
ac54a9de-104a-43c8-bd13-8055d8923b4c | fulltopic/torchpractice | src/gymtest/lunarlstm5.cpp | /*
* lunarlstm5.cpp
*
* Created on: Jul 18, 2020
* Author: zf
*/
#include <string.h>
#include <string>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <spdlog/spdlog.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <torch/torch.h>
#include <cpprl/cpprl.h>
#include <matplotlibc... | ALGO | 0.965533 | 5.804364 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-03-18T13:46:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df47736f5... |
ce68f841-923f-4ae4-8841-f3fb2de8386f | halismai/bitplanes | test/test_init.cc | #include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <bitplanes/core/bitplanes_tracker_pyramid.h>
#include <bitplanes/core/homography.h>
#include <bitplanes/core/types.h>
#include <Eigen/LU>
using namespace bp;
int main()
{
cv::Mat image(480*3, 640*3, CV_8UC1);
cv::... | ALGO | 0.93086 | 5.819981 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2016-10-17T02:34:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 39,
"forks": 20,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2b603... |
1c9783cd-6622-484b-8b27-2d412765e3aa | aquirin/macsd | src-macsd/www/www.cpp | #include "www.h"
www::www(const string & name, const vector<string> & shap, const vector<string> & link, const multimap<pair<string,string>, string> & rn) {
_name = name;
for (unsigned int i = 0; i < shap.size(); ++i) {
_desc_nodo.insert(pair<unsigned int, string>(i+1, shap[i]));
_rdesc_nodo.insert(pair<string... | ALGO | 0.989369 | 3.399149 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2015-03-14T11:00:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "82c20bfa... |
cd3f2438-d9c4-49ee-a422-4f3d289bce10 | pushrsp/Algorithm | 백준/Gold/2668. 숫자고르기/숫자고르기.cc | #include <iostream>
#include <vector>
using namespace std;
int N;
int arr[101];
int exist[101];
int visit[101];
bool DFS(int start, int from, int to) {
if (start == to)
return true;
if (visit[to] == 1)
return false;
visit[to] = 1;
return DFS(start, to, arr[to]);
}
int main() {
... | ALGO | 0.999981 | 3.835593 | {
"github_metadata": {
"branch": "main",
"commit_count": 1110,
"repo_created_at": "2022-05-23T09:32: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": "5f536b8f2... |
c1f546fa-48ca-4d2d-bd2c-52e4f04634ee | NandishM0618/DSA | IMPORTANT QUESTIONS ON DSA/Stacks/stackusequeues.cpp | //stack (last in first out) insertion and deletion happens at the same ends
//queue (first in first out) insertion and deletion happens at different ends
//implementing stack by using queue (making push operation costly)
// #include <bits/stdc++.h>
// using namespace std;
// class Stack
// {
// queue<int> q1, q2... | ALGO | 0.998796 | 4.858836 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-08-09T18:20: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": "5818cdbbce7... |
bef1520c-b25e-4f6c-a74a-d711cdf00896 | evasabeeh/DSA | ARRAY/stock.cpp | #include<bits/stdc++.h>
using namespace std; //maximize the profit
//if array is in decreasing order then no profit can be earned
int main(){
vector<int> price={180, 225, 720, 100, 540, 675, 720}; //represents cost on each day
int n = prices.size();
i... | ALGO | 0.999875 | 4.906072 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2024-06-16T11:13: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": "13531b5b637... |
4ff96465-f68a-4df2-92d2-44f81e0d482a | aarafat27/Algorithm | Activity Selection.cpp | #include <iostream>
#include <queue>
#define Num 11
using namespace std;
class Action
{
public:
int start;
int end;
Action(int start, int end)
{
this->start = start;
this->end = end;
}
bool operator < (const Action &A) const
{
return end > A.end;
}
};
void displayPQ(pri... | ALGO | 0.999919 | 4.620523 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-02-07T09:41:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94caaa47e1c... |
bc45e2ef-1144-471d-b600-2d15c705e098 | 39ali/Angine-2.0 | temp/game.cpp | #include "game.h"
Game::Game() : m_width(1024), m_height(1280), m_box_r(10), m_max_velocity(0.3)
{
createWindow(m_width, m_height, "game", glm::vec3(0.5, 0.5, 0.5));
m_octree = new QuadTree(0, Cube(glm::vec3(0), m_box_r));
};
Game::~Game()
{
delete m_octree;
delete m_model;
delete m_material;
};
glm::vec3 scal... | TOOL | 0.991418 | 4.168681 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-07-23T06:50: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": "987593558... |
9b490aca-0976-468f-9e49-0f82427b864f | hristogwivanov/Strypes-CPP-Academy | Homeworks/Homework1/Task4/Task4.cpp | #include <iostream>
#include <fstream>
using namespace std;
int main() {
float num1, num2, num3;
char choice;
cout << "Това е програма която извежда най-голямото от 3 реални числа" << endl;
cout << "Моля въведете 'k' за вход от клавиатурата или 'f' за четене от файл" << endl;
cin >> choice;
... | ALGO | 0.991004 | 3.895283 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2024-09-28T15:19: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": "903aceea889... |
b7bc54a9-2b27-4290-906f-803ccbf46872 | rajneesh-rana/learning | main.cpp | #include<iostream>
#include <vector>
using namespace std;
double findMedianSortedArrays(const vector<int> &A, const vector<int> &B) {
// Do not write main() function.
// Do not read input, instead use the arguments to the function.
// Do not print the output, instead return values as specified
// Still... | ALGO | 0.999991 | 5.705948 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-03-15T01:27: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": "b136d110fa... |
570ba5c8-2d73-4128-92c3-7b7785b87be6 | adnanaziz/EPIJudge | epi_judge_cpp_solutions/online_sampling.cc | #include <algorithm>
#include <functional>
#include <iterator>
#include <random>
#include <vector>
#include "test_framework/generic_test.h"
#include "test_framework/random_sequence_checker.h"
#include "test_framework/timed_executor.h"
using std::bind;
using std::default_random_engine;
using std::random_device;
using ... | ALGO | 0.987472 | 7.016115 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2017-12-21T06:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2874,
"forks": 1899,
"issues": 47,
"pull_requests": 33
},
"file_meta": {
"content_id": "... |
1130ab56-b9f4-4c32-8fb9-97f29b2ede32 | KHowarth422/AstroDynamics | modelClasses.h | #include <utility>
#include <vector>
#include <unordered_map>
#include <string>
#include <string.h>
#include <iostream>
#include <fstream>
#include <cmath> // for pow() and trig functions
#include <cassert>
// ==========================================================================================
// Class represent... | ALGO | 0.977872 | 3.938858 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-08-12T22:01:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a149c4cabdc... |
457bedc5-c113-4149-abd4-9d0fb1d0263c | jjuarez99/project1 | project1.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main (){
double a,b,c;
cout<< "a=";
cin>>a;
cout<< "b=";
cin>>b;
cout<< "c=";
cin>>c;
if(a==0){
cout<< "a cannot be zero";
return 0;
}
double d=b*b-4*a*c;
double root1;
double root2;
... | ALGO | 0.996763 | 3.478151 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-11-24T16:21: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": "1eea587192... |
40e8c271-8b18-4659-9fc1-237ee1e8a62d | dokyeonglee/algorithm | BOJ/21944.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
map<int, pair<int, int>> problems;
map<int, set<int>> difficulty;
map<int, set<pair<int, int>>> algorithm;
int p, l, g;
... | ALGO | 0.999414 | 3.968491 | {
"github_metadata": {
"branch": "master",
"commit_count": 1717,
"repo_created_at": "2021-01-01T10:38: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": "905f370... |
481f2e3f-f218-4705-b4e2-018cf679324e | jitendra-sr/DSA_CPP | Sorting_Techniques/quickSort.cpp | class Solution {
int partition(vector<int>& arr, int low, int high) {
int pivot = arr[low];
int i = low, j = high;
while(true){
while (arr[i] < pivot) i++;
while (arr[j] > pivot) j--;
if (i >= j) return j;
swap(arr[i], arr[j]);
i++;... | ALGO | 1 | 7.092618 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2024-12-08T11:31: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": "f1ea97467... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.