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 |
|---|---|---|---|---|---|---|---|
7565c9d9-21d6-47fe-a29a-3164993ecea4 | deangelign/libFL | src/filtering.cpp | //
// Created by deangeli on 3/22/17.
//
#include "filtering.h"
float* circularCrossCorrelation1D(float *X1,float *X2,int N1,int N2,bool normalization){
float* signal = NULL;
float* filter = NULL;
float* output = NULL;
int signalSize;
int filterSize;
if(N1 > N2){
signal = X1;
f... | ALGO | 0.990548 | 5.352798 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2017-03-09T14:20:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "47cd9356e... |
796ef377-ae48-4ec9-b1b8-c5c36a658d26 | SBidaibek/acm | spring2017_kzcamp2/day3/b1.cpp | #include <bits/stdc++.h>
using namespace std;
#define forn(i, x, n) for (int i = int(x); i <= int(n); ++i)
#define for1(i, n, x) for (int i = int(n); i >= int(x); --i)
#define x first
#define y second
#define pb push_back
typedef long long ll;
typedef pair <int, int> pii;
typedef long double ld;
typedef vector <ll> ... | ALGO | 0.999993 | 4.235165 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-02-13T16:09:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b21c64a990... |
6474dcec-25e9-40d4-9df2-a0cd9bfb1744 | ForgotDream/Problemset | Luogu/P4213 【模板】杜教筛.cpp | /*
* @file P4213 【模板】杜教筛.cpp
* @author ForgotDream
* @brief Math
* @date 2024-02-04
*/
#include <bits/stdc++.h>
using i64 = long long;
using u32 = unsigned;
constexpr int N = 1e7 + 50;
int prime[N], cnt, lim = 1e7;
i64 phi[N], mu[N];
bool is_not_prime[N];
void init(int _n) {
phi[1] = mu[1] = 1;
fo... | ALGO | 0.999592 | 5.434428 | {
"github_metadata": {
"branch": "main",
"commit_count": 286,
"repo_created_at": "2023-04-20T07:00:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e7b1cfde2... |
c70a228b-3f04-405d-a28e-51db2bfe5dd5 | Perdente/Favorite-Problems | Graph_New/Bipartite Coloring/Mahmoud and Ehab and the bipartiteness.cpp | // https://codeforces.com/contest/862/problem/B
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define endl '\n'
void malena(){
int n; cin >> n;
vector<int> tree[n + 1], color(n + 1, -1);
for (int i = 0; i < n - 1; ++i) {
int u, v; cin >> u >> v;
tree[u]. push_back(v... | ALGO | 0.99996 | 4.559297 | {
"github_metadata": {
"branch": "master",
"commit_count": 326,
"repo_created_at": "2019-12-09T19:49:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bd06634... |
c9169dcb-15d7-40ca-82ad-8f73a6c5fc5a | yamate11/compprog | abc/abc212/f/cans.cc | #include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;
// @@ !! LIM(UnionFind cmpNaive debug)
// ---- inserted library file UnionFind.cc
class UnionFind {
protected:
int size;
vector<int> _leader;
vector<int> _rank;
vec... | ALGO | 0.999937 | 4.238121 | {
"github_metadata": {
"branch": "main",
"commit_count": 219,
"repo_created_at": "2021-03-11T06:12:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "391d070f0f... |
4c941022-0cba-47ca-a19d-12bae770fd30 | markpp/computer_vision_samples | cpp/pcl_projects/pcl_methods_playground/src/Segmentation/CPC.cpp | #include "CPC.hpp"
CPC::CPC()
{
}
void CPC::segmentPC( pcl::PointCloud <pcl::PointXYZRGB>::Ptr input_cloud_ptr,
std::map <uint32_t, pcl::Supervoxel<pcl::PointXYZRGB>::Ptr > supervoxel_clusters,
std::multimap<uint32_t, uint32_t> supervoxel_adjacency,
... | ALGO | 0.977192 | 5.472311 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2016-11-07T20:28:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ab06b47e... |
1e53c462-c8e1-46f7-bb06-1b11e2dc2916 | sipakhti/C-PLUS-data-structures | number_systems.cpp | #include <iostream>
#include <stack>
#include <string>
#include <cmath>
#include <stdexcept>
#include <typeinfo>
#include <exception>
// #include <number_systems.h>
using namespace std;
string dec_to_bin(int);
int bin_to_dec(string);
bool is_prime(int);
int number_reverser(int);
int optimized_number_reverser(int);
bo... | ALGO | 0.999178 | 3.304499 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2021-09-18T19:59:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e259b458... |
abf13366-6a14-43ac-8300-4677f7073287 | shvom667/CompetitiveProgramming | CF2030/E/brute.cpp | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define pb push_back
template <typename T>
using Vec = vector<T>;
#ifndef ONLINE_JUDGE
#include"/home/shivom/Downloads/CP/DataStructures/debug.cpp"
#include"/home/shivom/Downloads/CP/DataStructures/random_gen.cpp"
#else
#define dbg(...) 42
... | ALGO | 0.999989 | 4.622602 | {
"github_metadata": {
"branch": "master",
"commit_count": 164,
"repo_created_at": "2024-07-25T15:51: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": "ddf7396e... |
e46d92cf-89d4-45c3-a761-01a837ab53c3 | albertzheng07/EKF_Self_Driving_Project | src/kalman_filter.cpp | #include "kalman_filter.h"
using Eigen::MatrixXd;
using Eigen::VectorXd;
/* Static Helper functions */
static double unWrapAngle(double angle);
static VectorXd computePredictedMeasurement(const VectorXd& x_state);
// Please note that the Eigen library does not initialize
// VectorXd or MatrixXd objects with zeros u... | ALGO | 0.91906 | 6.580979 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-03-02T06:35: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": "bf06e1f0d... |
6ba02287-26c2-4770-96b4-c2efc9e63289 | wuxinrantj/Coding | LeetCode/66.加一/66.加一.cpp | /*
* @lc app=leetcode.cn id=66 lang=cpp
*
* [66] 加一
*
* https://leetcode-cn.com/problems/plus-one/description/
*
* algorithms
* Easy (43.55%)
* Likes: 445
* Dislikes: 0
* Total Accepted: 135.7K
* Total Submissions: 310.8K
* Testcase Example: '[1,2,3]'
*
* 给定一个由整数组成的非空数组所表示的非负整数,在该数的基础上加一。
*
* 最... | ALGO | 0.99948 | 5.94875 | {
"github_metadata": {
"branch": "master",
"commit_count": 186,
"repo_created_at": "2020-01-03T08:40:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d8ca739... |
96132e21-2319-46ca-9f32-13546ffe097e | samuraiexx/competitiveProgramming | WeekTraining/cp/ssp.cpp | #include<iostream>
using namespace std;
int n;
int bit[100001][26];
char seq[100001];
void update(int x,char d)
{
int tmp = x;
if(seq[x])
for(; tmp <= n; tmp += tmp&-tmp)
bit[tmp][seq[x]-'a'] -= 1;
seq[x] = d;
for(;x <= n;x+=x&-x)
bit[x][d-'a'] += 1;
}
bool query(int la, int ra)
{
int odd = 0;
la--; ... | ALGO | 0.999949 | 4.475042 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2017-10-10T19:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "746e49efe... |
b5e90808-2de6-42c8-a9b7-5c54996b7c09 | zotvent/competitive-programming | informatics/Поиск и сортировка/Линейный поиск в массиве/I - Матрица.cpp | #include <stdio.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <cstring>
using namespace std;
#define F first
#define S second
... | ALGO | 0.999948 | 3.455696 | {
"github_metadata": {
"branch": "master",
"commit_count": 506,
"repo_created_at": "2017-06-01T15:23:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64e7f1c... |
760d308e-4434-4ec6-8864-4344760d530c | RAJ107/Competitive-Programming | CSES/Introductory-Problems/Two-Knights.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cout << fixed << setprecision(20);
cin.tie(NULL);
cout.tie(NULL);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
long long int n; cin >> n;
for(long long int i = 1; i <= n; i++)... | ALGO | 0.999567 | 3.340839 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-09-01T03:39: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": "837f1a8309... |
ff55186c-7d51-441b-b4ee-b9a6411e3edf | duyvuleo/Transformer-DyNet | third_party/mteval/NISTEvaluator.h | #pragma once
#include <mteval/Evaluator.h>
#include <vector>
namespace MTEval {
// Calculates NIST and scores
class NISTEvaluator : public Evaluator {
NISTEvaluator(const NISTEvaluator&) = delete;
NISTEvaluator(NISTEvaluator&&) = delete;
NISTEvaluator& operator=(const NISTEvaluator&) = delete;
NISTEvaluator... | ALGO | 0.969435 | 7.159319 | {
"github_metadata": {
"branch": "master",
"commit_count": 240,
"repo_created_at": "2017-11-01T07:18:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 65,
"forks": 19,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "a8e9c1... |
9991993f-1973-4ae0-a123-16e4dc0479cd | jianglab/motioncorr | src/SP++3/include/huffmancode-impl.h | /*
* Copyright (c) 2008-2011 <NAME> (<NAME>), <EMAIL>
*
* 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 Foundation, either version 2 or any later version.
*
* Redistribution and use in source and bin... | ALGO | 0.986911 | 4.362799 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2015-07-24T20:50:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 14,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ad59c275... |
a347b8cd-106c-48f4-af69-60e48fbdab9d | ishandutta2007/codeforces-h | heart_blue/normal/514/B.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.99959 | 4.047733 | {
"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": "fa659ef95ed6... |
cc6e722d-420d-43bc-a537-8d5c9551a21a | guilhesme23/ppc | aoc/2022/05.cpp | #include <fstream>
#include <iostream>
#include <vector>
#include <stack>
#include <sstream>
int main() {
std::ifstream fin("input.txt");
std::string input;
std::vector<std::stack<char>> cargo;
while (getline(fin, input)) {
if (input == "") break;
std::stack<char> crates;
for (char c : input) {
... | ALGO | 0.999854 | 5.213166 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2023-03-11T01:43: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": "4ec72aa246f... |
48719070-e8a7-4038-9b5a-362078251691 | AmpiroMax/Leetcode | Search a 2D Matrix/untitled2/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int search(vector<int> &nums, int target)
{
int l = 0;
int r = nums.size();
while (l < r && nums[(r + l) / 2] != target)
{
cout << nums[(r + l) / 2] << endl;
cout << l << " " << r << endl;
if (target > nums[(r + l) / 2... | ALGO | 0.999942 | 4.780334 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2022-09-17T21:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e897b203... |
2003ba92-51c6-45cb-be01-f488b415eb6b | WhiZTiM/coliru | Archive2/ec/2207b7a94b431c/main.cpp | #include <iostream>
#include <iomanip>
#include <bitset>
#include <vector>
#include <chrono>
#include <ctime>
using namespace std;
using namespace chrono;
int main(){
const unsigned int n=1000000;
bitset< n > bs;
// bs.reset();
// dynbs.reset();
unsigned int i,r,R=10000;
high_resolution_clock::time_point... | TOOL | 0.938569 | 4.843493 | {
"github_metadata": {
"branch": "master",
"commit_count": 42630,
"repo_created_at": "2016-04-21T16:34: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": "ec397c... |
5a004d58-2837-47da-9b95-c6b9418e29cc | ishandutta2007/codeforces-x | xellos/normal/983/D.cpp | #include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserv... | ALGO | 0.998585 | 3.576878 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38: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": "eeafb51d0a73... |
38c16842-087f-4731-a812-1559952b7913 | aberry5621/cplusplus_book_source_code | SwapArrayElements.cpp | #include <iostream>
using namespace std;
void swap(int, int);
void swapFirstTwoInArray(int []);
int main()
{
int a[] = {1, 2};
// Swap elements using the swap function
cout << "Before invoking swap" << endl;
cout << "array is {" << a[0] << ", " << a[1] << "}" << endl;
swap(a[0], a[1]);
cout << "After inv... | ALGO | 0.999718 | 5.967951 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-09-26T17: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": "14d38ef527... |
49e3223c-bd99-4161-a0d4-f5fe27358818 | luyencode/cpp-solutions | solutions/5s0hO3hJ.cpp | /*
<NAME>ởi @nguyenvanhieuvn
Thực hành nhiều bài tập hơn tại https://luyencode.net/
*/
#include<stdio.h>
#include<conio.h>
//
//const int minYear = 1900, maxYear = 10000;
//int KiemTraNamNhuan(int nam)
//{
// return (nam % 4 == 0 && nam % 100 != 0) || (nam % 400 == 0);
//}
//int TimSoNgayTrongThang(int thang, i... | ALGO | 0.999414 | 3.594182 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-04-10T08:00:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 96,
"forks": 98,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "d62588d4f0... |
fc93b714-60b5-4616-9109-3ae99bbdd085 | irfanhamid/euler | trees/reconstruct.cpp | #include <iostream>
#include "tree.hpp"
using namespace std;
typedef euler::TreeNode_T<int> Tree_T;
// Helper functions to dump out the traversals
void Inorder(Tree_T* root, int* outputBuffer, int& cursor)
{
if (!root)
return;
Inorder(root->left, outputBuffer, cursor);
outputBuffer[cursor++] = root->data;... | ALGO | 0.999646 | 5.164359 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2014-01-25T08:30: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": "5c1906a21... |
92220bd9-d1aa-443d-98da-718d12ab0732 | Lin-jingy/ACM | luogu/P3810.cpp | #include <bits/stdc++.h>
class BIT{
#define lowb(x) ((-x) & x)
private:
int n;
std::vector<int> c;
public:
BIT() = default;
BIT(int N):n(N), c(N+1){}
void add(int i, int z){
for(; i <= n; i += lowb(i)) c[i] += z;
}
int pre(int i){
int sum = 0;
for (; i > 0; i -= l... | ALGO | 0.999973 | 4.998273 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2024-02-12T15:05:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3a199d34b6... |
40b04a6f-759a-4315-8ad1-e7dd3b673d99 | hsnavarro/imepp | GYM/ICPC/2018-2019-NEERC-Southern-Subregional/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int M = 1e7 + 5;
#define st first
#define nd second
int n, aux, it[M];
pair<int, int> last[M], ans[N];
pair<int, int> find(int x){
if(last[x].st < last[x].nd){
swap(last[x].st, last[x].nd);
return last[x];
}
if(it[x] == 1) retu... | ALGO | 0.999882 | 3.529766 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2018-08-22T02:40:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4496b64... |
6ca4eebb-d9f4-4e74-942d-012dcb566f87 | upccfeng/cpp-dev | leetcode/src/curated_tree_102_binary_tree_level_order_traversal.cpp | #include "treenode.hpp"
#include <vector>
namespace p_curated_tree_102_binary_tree_level_order_traversal
{
class Solution
{
void levelOrderTraversal(TreeNode* root, std::vector<std::vector<int>>& ret, int level)
{
if (root == nullptr)
{
return;
... | ALGO | 0.999976 | 6.720973 | {
"github_metadata": {
"branch": "master",
"commit_count": 284,
"repo_created_at": "2020-07-21T15:20:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "26376080... |
2744a94c-8dda-4a02-9b05-eb5e1329d961 | ishandutta2007/codeforces-b | baba/normal/916/E.cpp | //<NAME>
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> II;
typedef vector< II > VII;
typedef vector<int> VI;
typedef vector< VI > VVI;
typedef long long int LL;
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.... | ALGO | 0.999695 | 4.596135 | {
"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": "adf3c9659900... |
17c832d5-e393-43ad-b82c-6d9f911c910f | mahfuzswe/Codeforces_Problems | 1783A_Make_it_Beautiful.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int t; cin >> t; // read the number of test cases
while (t--) { // for each test case
int n; cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int sum = 0; // sum of all elem... | ALGO | 0.999752 | 4.290787 | {
"github_metadata": {
"branch": "main",
"commit_count": 181,
"repo_created_at": "2022-07-25T02:28: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": "7ce1966562... |
23508abf-5f3d-4512-bdd8-81a1de5b4987 | basuki57/Codeforces-1 | D - 641.cpp | #include <bits/stdc++.h>
using namespace std;
#define pan(i,n) for(int i=0;i<n;i++)
#define pans(i,n,a) for(int i=a;i<n;i++)
#define ll long long int
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define INF 1000000007
#define PI 3.141592653
#define inf 100007
#define pll pair<ll,ll>
#define pii p... | ALGO | 0.999956 | 4.206135 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-10-03T04:36: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": "7f9a8d31d... |
6aef9b6e-d043-497a-9801-e335fbc0377b | nguyenmanhthao996tn/ITCarSS6 | MyCar/Car2/Car2/Ver1/main.cpp | /*
* Ver1.cpp
*
* Created: 3/10/2017 3:14:01 AM
* Author: ThaoNguyen
*/
#include "function.h"
bool check_crossline( void );
bool check_rightline( void );
bool check_leftline( void );
uint8_t pattern = 10;
uint8_t sensor = 0x00;
uint16_t timer_cnt, encoder_pulse;
uint16_t bridgeCounter = 0;
int main(void)
{
... | TOOL | 0.926381 | 3.422019 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-03-16T17:30:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbf5c1c848... |
1786b3b0-3c5d-471c-9f2e-f48db3e723c9 | harshpreet931/CppRepo | TeachingTime/Question2.cpp | //
// Created by <NAME> on 23.11.2023.
//
//
// Created by <NAME> on 15.11.2023.
//
#include <bits/stdc++.h>
using namespace std;
class Time{
public:
int hr;
int min;
int sec;
Time(int h, int m, int s){
hr = h; min = m; sec = s;
}
void display(){
cout << hr << " : "<< min <<"... | ALGO | 0.996035 | 5.063832 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2023-09-05T05:31:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "649f4674101... |
90f1d2e1-b603-42fc-ad32-2ac289fe35d2 | heyuhhh/ACM | contests/2020多校联合训练/杭电/杭电5/1009.cpp | // Author : heyuhhh
// Created Time : 2020/08/04 12:49:25
#include<bits/stdc++.h>
#define MP make_pair
#define fi first
#define se second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;... | ALGO | 0.999747 | 4.571113 | {
"github_metadata": {
"branch": "master",
"commit_count": 693,
"repo_created_at": "2019-11-25T06:31:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb40d381... |
1987aec9-0541-4e8a-9158-9d9f9c74b23d | msu-coinlab/MSUCast | src/external_archive.cpp | #include <vector>
#include <algorithm>
#include <external_archive.h>
#include <range/v3/all.hpp>
#include "particle.h"
bool is_dominated(const std::vector<double>& a, const std::vector<double>& b, const double a_g, const double b_g){
using namespace ranges;
if ( a_g > 0 && b_g <= 0){
return true;
... | ALGO | 0.99997 | 5.666472 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2025-01-23T21:04:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db11bdcf354f... |
50b63d55-9e58-490b-acc8-2e4d3b4cf3ff | hxchengtj/leetcode | Binary Tree Level Order Traversal II.cpp | class Solution {
public:
vector<vector<int> > levelOrderBottom(TreeNode *root) {
int b = 0, e = 1;
vector<vector<int>> order;
if(root == NULL) {
return order;
}
TreeNode** node = new TreeNode* [1000000];
int* depth = new int [1000000];
node[0] = ro... | ALGO | 0.999987 | 5.57542 | {
"github_metadata": {
"branch": "master",
"commit_count": 773,
"repo_created_at": "2016-10-15T00:31: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": "1c17d551... |
02d22469-1367-49bd-a6bf-5d1715714930 | HimanshuSarma/Problem_solving | 297Serialize_and_Deserialize_Binary_Tree.cpp | #include <bits/stdc++.h>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), righ... | ALGO | 0.999831 | 5.379952 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-08-13T16:35: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": "e5ab1d163f3... |
8822f33a-e864-482c-9370-b4b07f0675f2 | Yuan-Hsuan/Kattis | terraces.cpp | #include<bits/stdc++.h>
using namespace std;
int x, y;
vector< vector<int> > land;
vector< vector<bool> > visited;
void right( int height, list< pair<int, int> > &queue, bool &can_rice, int &num, int i, int j ){
if( !visited[i][j+1] ){
if( height == land[i][j+1] ){
visited[i][j+1] = true;
... | ALGO | 0.999863 | 3.957632 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2022-06-21T14:34: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": "0fe5c47eb14... |
8fa7d355-2880-4824-93d3-f86a008754ef | Anonymous4test/Anonymous4test | aby3/aby3-RTR/Pair_then_Reduce/src/functions.cpp | #include "../include/datatype.h"
#include "../include/tasks.h"
#include "../include/functions.h"
#include "../include/gas_functions.h"
#include "cmath"
#include <memory>
bool load_graph_data(const std::string& graph_folder, std::vector<node>* nodes, std::vector<edge>* edges) {
// 构建节点数据文件路径
std::string n... | ALGO | 0.980858 | 4.366359 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-10-17T11:09: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": "5a4dc2937e3... |
2fdaac4a-335a-4115-84c9-4a84571b6560 | ImperishableMe/codeforces-practice | cf-round-641/E.cpp | #include <bits/stdc++.h>
using namespace std;
using PII = pair < int, int >;
int const N = 1010;
vector<string> g;
int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
int cid[N][N], vis[N][N], dist[N][N];
vector<int> comps;
int dfs(int x, int y, int c){
vis[x][y] = 1;
cid[x][y] = c;
int sz = 1;
for(in... | ALGO | 0.999946 | 4.15123 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2020-03-16T15:56:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "78e12a3d9... |
cc912835-5067-4962-8c7c-30b838551f49 | yogeshg/small-projects | cpp/hw5/graph_representation.h | #ifndef __GRAPH_REPRESENTATION_H__
#define __GRAPH_REPRESENTATION_H__
#include<sstream>
#include<string>
#include<utility>
#include<vector>
#include<iostream>
#include<algorithm>
#include<map>
#include<utility>
#include<memory>
#include<stack>
#include<set>
template <class VP, class EP>
class Adjacency_matrix {
p... | ALGO | 0.934249 | 4.85251 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2016-01-03T15:07:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "5a721afc... |
e5ad8da1-c16c-4c28-9dde-43a01f031ff0 | ishandutta2007/codeforces-n | nweeks/normal/1332/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define SZ(x) ((int)(x).size())
typedef long long ll;
int primes[11] = {
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31};
void solve()
{
int n;
cin >> n;
vector<int> arr(n);
for (auto &v : arr)
cin >> v;
vector<int> numbers[11];
for (auto v : arr)
{
int i(0);
whi... | ALGO | 0.999758 | 4.163603 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "1e162b8526d6... |
1f2289a2-e708-4c79-a1d3-28344f17b6c8 | JdeOz/Algoritmo-Genetico | src/main.cpp | #include <iostream>
#include <vector>
#include <map>
#include <random>
#include <cmath>
using namespace std;
struct Node {
int x, y;
Node(int x, int y) : x(x), y(y) {}
};
vector<Node> nodes;
int inicial;
int randomInt(int ini, int fin) {
random_device rd;
mt19937 mt(rd());
uniform_int_distribut... | ALGO | 0.999999 | 5.786607 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-04-09T06:25:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "e39f4a8d441... |
a7a09e53-9b78-4534-8e3c-d7d17185ac1d | Yu0727Harada/pro_con | ABC/ABC350/d.cpp | //
// Created by yu on 2024/04/26.
//
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cst... | ALGO | 0.999951 | 4.668677 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2020-08-09T08:23: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": "94e6d347... |
d82a9488-7776-4ff4-bdc0-a2c04165fe08 | Bruteforceman/cp-submissions | codeforces/1299/A.cpp | #include "bits/stdc++.h"
using namespace std;
int cnt[40];
int a[100010];
const int logn = 32;
int main(int argc, char const *argv[])
{
int n;
scanf("%d", &n);
for(int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
for(int j = 0; j < logn; j++) {
cnt[j] += ((a[i] >> j) & 1);
}
}
int opt = 0;
int id = 1;
for... | ALGO | 0.999988 | 3.682585 | {
"github_metadata": {
"branch": "master",
"commit_count": 488,
"repo_created_at": "2021-01-10T09:51: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": "cc6144fe... |
95521fa9-a803-4c3d-9330-8315e1fc74bf | xueyuhanlang/IsoSurfacing | ThirdParty/IsoEx/Extractors/MarchingCubesT.hh | /*===========================================================================*\
* *
* IsoEx *
* Copyright (C) 2002 by Computer Graphics Group, RWTH Aachen *
* ... | ALGO | 0.958598 | 6.548805 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-10-08T23:55:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "746b949c457... |
e0c317b0-56c8-485d-b66b-fc8f36e65e97 | Kevin4e/CartesianPlane-Triangle | CartesianPlane-Triangle/main.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
int main()
{
// Variable Declaration //
float xa,ya,xb,yb,xc,yc,dxab,dyab,dxbc,dybc,dxac,dyac,ab,bc,ac,p,sp,a,q;
string choice;
// Title & Variable Assignments //
std::cout << "Calculator of the perimeter and area of a triangle on a carte... | ALGO | 0.997913 | 5.12566 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-12-09T11:13:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5129fd20853... |
dc8e9b3d-633a-4995-a22f-5677d9f89882 | paulhnguyen/cs2 | hw6/tree.cc | #include "tree.hh"
//////////////////////////////////////////////////////////////////////////////
tree_ptr_t
create_tree(const key_type& key,
const value_type& value,
tree_ptr_t left,
tree_ptr_t right)
{
tree_ptr_t t = new Tree;
t->key_ = key;
t->value_= value;
t->le... | ALGO | 0.992809 | 3.735952 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2022-03-01T04:29:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbc00170f40... |
9554ff77-e556-4c15-b9c2-1b7e078db285 | shlykovvv/gauss | main.cpp | #include <iostream>
#include <cassert>
#include <vector>
#include <stdio.h>
#include <fstream>
#define MATRIX_FILE "C:/Users/Vova/CLionProjects/gauss/input3.txt"
struct RationalComplex final {
RationalComplex(RationalComplex const &complex) {}
long long int a_num, b_num, a_div, b_div;
RationalComplex(... | ALGO | 0.999295 | 3.977082 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2022-12-20T11:19: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": "10ea74e07... |
811f29e1-6d77-4e68-9f48-22ec2fa4d5ef | DuanYaQi/leetcode | DS_Tree/101+isSymmetric_Stack.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999965 | 6.335742 | {
"github_metadata": {
"branch": "master",
"commit_count": 309,
"repo_created_at": "2021-03-15T10:04:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c97e67b6... |
e03b1de0-ce64-47cc-b27f-5afb33504645 | liuyubobobo/Play-Leetcode | 0001-0500/0328-Odd-Even-Linked-List/cpp-0328/main.cpp | /// Source : https://leetcode.com/problems/odd-even-linked-list/description/
/// Author : liuyubobobo
/// Time : 2018-10-01
#include <iostream>
using namespace std;
/// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
/// Split ... | ALGO | 0.99983 | 5.773633 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "de... |
09e3841f-5414-417d-8326-a89677d3f73a | egg0315/LeetCode | 700-799/737.sentence-similarity-ii.cpp | /*
* @lc app=leetcode id=737 lang=cpp
*
* [737] Sentence Similarity II
*/
class Solution {
public:
unordered_map<string, string> parent;
bool areSentencesSimilarTwo(vector<string> &words1, vector<string> &words2,
vector<vector<string>> &pairs) {
if (words1.size() != words2.size... | ALGO | 0.999871 | 6.047279 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2019-09-09T05:11:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "736024656... |
ea48ae1a-d351-4367-b391-f4e765c28336 | rsf-23-21-00107/soft | source/source/stability/detail/eigenvalue_sorter.h | #ifndef __STABILITY_IRAM_EIGENVALUE_SORTER_H__
#define __STABILITY_IRAM_EIGENVALUE_SORTER_H__
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdexcept>
namespace stability
{
namespace detail
{
struct eigenvalue_sorter
{
void set_target_eigs(const std::string& which_)
{
... | ALGO | 0.99949 | 6.350447 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-11-22T06:48: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": "e7c0483a1c17... |
d01f2877-81d1-490b-8f88-5125a5ddd337 | FrankLu007/Threes_search | Threes.cpp | #include <cstdio>
#include <unordered_map>
#include <vector>
#include <cmath>
class Board
{
public:
int board[6];
Board() : board({0 ,0 ,0 ,0 ,0 ,0}) {}
int getindex(const int next_tile, const int dir = 4)
{
int index = dir;
for(int i = 0 ; i < 6 ; i++)
{
index <<= 4;
index += board[i];
}
index <<= ... | ALGO | 0.998591 | 3.209367 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-04-20T15:05: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": "edda3a86ca... |
208e056f-50f6-4b41-ada2-a0b4f2366ea0 | ShahPranav1094-Courses/365DaysChallenge | February2022/23-CloneGraph/Solution.cpp | // O(N) Time & O(N) Space
// Iterative
Node *cloneGraph(Node *node)
{
if (node == nullptr)
return node;
queue<Node *> q;
q.push(node);
Node *start = nullptr;
unordered_set<Node *> s;
unordered_map<Node *, Node *> m;
s.insert(node);
Node *copy_node = new Node(node->val);
m[... | ALGO | 0.999963 | 6.297622 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2022-01-01T13:25:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "355d323c9ded... |
a5614475-9c8d-40f5-a5f0-df6d23b8e3fd | jsj2008/School-1 | Computer_Science/Computer Science/CS 253 - Data Structures II/CS253 - McMillin/hw1 - merge vs insertion/hw1 code/cs253program1-sorts.cpp | // cs253program1-sorts.cpp : Defines the entry point for the console application.
//
// Programmer: <NAME>
// File: cs253program1-sorts.cpp
// Description: This program explores the complexities of merge sort and
// insertion sort. It is given a size by the user, and sorts an array of
// that size using insertion and ... | ALGO | 0.998929 | 5.422736 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-02-15T04:10:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db9d6567c... |
819caeaa-dff8-400d-8c12-0652d6dd6c64 | subharya83/cvml-exercise | ex24/imageStitcher.cpp | #include <iostream>
#include <vector>
#include <string>
#include <filesystem>
#include <random>
#include <algorithm>
#include <opencv2/opencv.hpp>
#include <opencv2/stitching.hpp>
namespace fs = std::filesystem;
// Compute edge density using Canny edge detector
double computeEdgeDensity(const cv::Mat& image) {
cv... | ALGO | 0.986211 | 7.287332 | {
"github_metadata": {
"branch": "main",
"commit_count": 431,
"repo_created_at": "2024-12-15T18:24:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 4,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "3814f3919... |
987322d2-c160-4528-ab14-b11c775ff92c | Jannatul-2003/DSA | BinaryTree.cpp | #include <bits/stdc++.h>
using namespace std;
//dll and do not handle wrong parent node
struct node
{
int val;
node *left_child;
node *right_child;
node* parent;
node(int data)
{
val=data;
left_child=right_child=parent=NULL;
}
};
struct BT
{
node *root = NULL;
void ad... | ALGO | 0.999998 | 4.815334 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-01-30T13:17: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": "30c5e1e5289... |
655a68ed-5eb4-49fc-8017-e992b2d5fdd8 | hitoshishinso/parallelProgramming | fork_text.cpp | /*Created By HitoshiShinso (<NAME>) Date : October 2018 :: 9:14 AM :: Windows Operating System*/
#include <bits/stdc++.h>
#include <unistd.h>
#include <sys/wait.h>
#define MAX 11111
#define lim 1e9+7
#define ll long long
#define SQRT 1060
#define sci(a) scanf("%d", &a)
#define scl(a) scanf("%lld", &a)
#define pfi(a) p... | ALGO | 0.99893 | 3.177222 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-12-06T01:32: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": "a09e1473e6... |
4d3aedb3-9554-4478-b91e-db9761d4063c | haribhumarapu/DSA0152-OBJECT-ORIENTED-PROGRAMMING-WITH-C- | add matrices.cpp | #include <iostream>
int main() {
int rows, cols;
std::cout << "Enter the number of rows: ";
std::cin >> rows;
std::cout << "Enter the number of columns: ";
std::cin >> cols;
int **matrix1 = new int *[rows];
for (int i = 0; i < rows; ++i) {
matrix1[i] = new int[cols];
}
int *... | ALGO | 0.997888 | 5.315211 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-06T03:27: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": "81ca0e89c3e7... |
cbf1050f-fbd2-414c-8155-5e35fb148cb6 | SoulGoodman54/QUADRATIC-EQUATION | Solve.cpp | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include "Functions.h"
/** @brief Compares a double type number with 0
@param a Number is compared with 0
@return Result comparison
*/
bool is_zero (double a){
return fabs(a) < EPS;
}
/** @brief Смотрит, какой вид имеет данно... | ALGO | 0.999873 | 3.556905 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-08-27T08:29:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2ef88e98b0b5... |
bbd7f3ad-3240-44a6-9f21-89914c68b8e2 | vian9/C-Codes | Love Babbar Sheet/Arrays/1_2Sum.cpp | // Link : https://leetcode.com/problems/two-sum/
// Time Complexity : O(n) and Space : O(n)
// Approach-> num[i] pr target-num[i] check kro ki exist krta h....and nhi to map m update kro
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
// Ek num lelo and map m dalte jao and check kro phle target... | ALGO | 0.999965 | 6.003606 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-11-05T17:45:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c9fd9df53... |
909debc9-9f03-423f-b6e0-7e43a7995718 | javiidiazglez/AyEDA | 2022/Práctica 05. Ordenación/ordenacion-conmodi/include/quicksort.h | /*
Universidad de La Laguna
Escuela Superior de Ingeniería y Tecnología
Grado en Ingeniería Informática
Algoritmos y Estructuras de datos Avanzados
Fecha: 29/04/2022
Autor: <NAME> (alu0101128894)
Práctica 5. Ordenación
Referencias: https://es.wikipedia.org/wiki/... | ALGO | 0.999863 | 5.034883 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-02-12T14:57:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "365dca179f0... |
e70c2de1-d890-4785-99a5-270d2eeaacea | PoWeiChiao/Cpp | DFS/FloodFill.cpp | #include <vector>
// An image is represented by an m x n integer grid image where image[i][j] represents the pixel value of the image.
// You are also given three integers sr, sc, and newColor. You should perform a flood fill on the image starting from the pixel image[sr][sc].
// To perform a flood fill, consider the ... | ALGO | 0.996217 | 6.715384 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2021-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": "9fea410cf66... |
6ef2754f-3f8c-43e2-ae28-ebd6de36937d | ArtemRoshko/lab5-10 | 5-10A/5-10/1L9.cpp | #include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
using namespace std;
// Функціональний об'єкт для порівняння парності
struct SameParity {
bool operator()(int a, int b) const {
return (a % 2) == (b % 2);
}
};
int main() {
vector<int> V = { 11, 14, 15, 16, 17, 17, 18, 10... | ALGO | 0.999279 | 5.706012 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-21T13:34: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": "30dd8b0efcd0... |
b5b08bc0-f9dc-45fd-88d0-04adf6d5e4b3 | ishandutta2007/codeforces-a | arayi/normal/1630/B.cpp | //Arayi
#include <bits/stdc++.h>
#define fr first
#define sc second
#define MP make_pair
#define ad push_back
#define PB push_back
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define lli long long int
#define y1 arayikhalatyan
#define j1 jigglypuff
#define ld long double
#define itn int
#... | ALGO | 0.999782 | 3.655076 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "c01de2432770... |
1c86ac0d-0b9b-4320-98a9-8bf6adbf5e79 | b08902043/ADA_homwork | hw4/hw4_3/ada-hw4-p3.cpp | #include "ada-hw4-p3.h"
#include<utility>
#include<iostream>
#define CONCEAL 1
#define KNOWN 2
using namespace std;
// feel free to use global variables
std::vector<int> contest;
std::vector<std::pair<int,int> > known,conceal;
void MakeAns(vector<int> &ans){
for(int i = 0;i < conceal.size();i ++){
ans.push_... | ALGO | 0.999919 | 3.757086 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-12-09T02:54:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4682df197... |
d089c54f-bd79-4f26-9566-2ec437c714f7 | OpenVPN/openvpn3 | openvpn/transport/client/httpcli.hpp | // OpenVPN -- An application to securely tunnel IP networks
// over a single port, with support for SSL/TLS-based
// session authentication and key exchange,
// packet encryption, packet authentication, and
// packet compression.
//
// Copyright (C) 2012- Op... | WEB | 0.97083 | 7.317298 | {
"github_metadata": {
"branch": "master",
"commit_count": 4488,
"repo_created_at": "2016-09-16T01:12:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1086,
"forks": 424,
"issues": 66,
"pull_requests": 10
},
"file_meta": {
"content_id": "0... |
5a13f74c-1128-4533-8b19-c503d6714d2d | JohannesBuchner/Chombo3.2 | releasedExamples/EBAMRCNS/src/SchlichtingIBC.H | #ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
#ifndef _EB_Schlichting_H__
#define _EB_Schlichting_H__
#include <iostream>
#i... | TOOL | 0.983065 | 4.831967 | {
"github_metadata": {
"branch": "master",
"commit_count": 747,
"repo_created_at": "2015-08-31T13:39:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77a7758e... |
2bc01511-c102-4d49-bb9d-694f3562fcd8 | hardik302001/leetcode | problems/cherry_pickup_ii/solution.cpp | // also see: https://leetcode.com/problems/cherry-pickup/
/*
Let MM be the number of rows in grid and NN be the number of columns in grid.
Time Complexity: (MN^2), since our helper function have three variables as input, which have MM, NN, and NN possible values respectively. In the worst case, we have to calculate ... | ALGO | 0.999994 | 6.313167 | {
"github_metadata": {
"branch": "main",
"commit_count": 3708,
"repo_created_at": "2022-03-01T17:28:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "517bec361... |
76dea955-c163-4650-94e9-c9dca1b8d6cc | ngtienthanh/crops-moveit | moveit_planners/ompl/core/ompl_interface/src/constraints_library.cpp | /*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2012, <NAME>, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* ... | ALGO | 0.986899 | 5.509431 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2013-07-16T13:08:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bc1e9e12e... |
4a97d029-c738-4193-91c5-5e9fe9077714 | olliw42/storm32bgc | old/betacopter/old/betacopter36dev-v005/libraries/AC_PrecLand/PosVelEKF.cpp | #include "PosVelEKF.h"
#include <math.h>
#include <string.h>
#define POSVELEKF_POS_CALC_NIS(__P, __R, __X, __Z, __RET_NIS) \
__RET_NIS = ((-__X[0] + __Z)*(-__X[0] + __Z))/(__P[0] + __R);
#define POSVELEKF_POS_CALC_STATE(__P, __R, __X, __Z, __RET_STATE) \
__RET_STATE[0] = __P[0]*(-__X[0] + __Z)/(__P[0] + __R) + __X[0]... | ALGO | 0.998049 | 5.387029 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2013-12-02T21:11:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 655,
"forks": 289,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d52cd... |
02c3fa52-8af4-4365-9466-2634c92845a1 | jwnicholas99/Brain-Computer-Interface-for-Detection-of-Emotions | BCIREBORN/L_SignalProcessing/AttentionDetection.cpp | #include "attentiondetection.h"
#include "..\L_Utilities\ParaReader.h"
CAttentionDetection::CAttentionDetection(void)
{
m_pAlphaFilter = m_pBetaFilter = NULL;
m_pSelEEGBuffer = NULL;
m_pSelEEGCopy = NULL;
m_pSelEEGData = NULL;
m_pTestFeaData = NULL;
m_hOutputResult = NULL;
//m_bReverseScore = 1;
m_fEEGMean... | ALGO | 0.94571 | 3.845213 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-01-25T20:09: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": "8cbd48ba76... |
237e59f7-5377-4fbd-9a48-cce1ab6e3d1c | ishandutta2007/codeforces-m | macesuted-moe/normal/1617/B.cpp | #include <bits/stdc++.h>
using namespace std;
bool mem1;
const int prime[22] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79};
void solve(void) {
int n;
cin >> n;
n--;
for (int i = 0; i < 22; i++)
if (n % prime[i] != 0) {
cout << prime[i] << '... | ALGO | 0.998084 | 3.404346 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4659be23219d... |
dfc77a2f-f9f4-43ec-9f67-a4a6e1cd4958 | luofengmacheng/algorithms | LeetCode/sudoku_solver2.cpp | /*
* author: <NAME>
* date: 2013/12/18
* source: LeetCode OJ
* title: Sudoku Solver
* language: C++
*/
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <utility>
#include <vector>
#include <map>
using namespace std;
void set_sudoku(vector<vector<char> > &board)
{
ifstre... | ALGO | 0.9998 | 5.305041 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2013-10-14T02:27:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 67,
"forks": 70,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "726886... |
d1d8210f-3905-4410-b0dc-3ea32a8d7cfd | isnanramalia/alpro-4208 | kerkel insertionSort/a2.cpp | #include <iostream>
using namespace std;
// pemanggilan fungsi dilakukan di definisi
void insertionSort(int arr[], int n);
int main()
{
int arr[] = {12, 11, 13, 5, 6};
int n = sizeof(arr) / sizeof(arr[0]);
insertionSort(arr, n);
cout << "Array yang telah diurutkan: \n";
for (int i = 0; i < n; i+... | ALGO | 0.999974 | 5.564454 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-03-16T03:14: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": "d02a12a178a... |
cd72bf08-f3ab-4312-914b-2da96e24c893 | nyanpasua/leetcode | src/problems/math/数论/[621]任务调度器.cpp | //给你一个用字符数组 tasks 表示的 CPU
//需要执行的任务列表。其中每个字母表示一种不同种类的任务。任务可以以任意顺序执行,并且每个任务都可以在
// 1 个 单位时间内执行完。在任何一个单位时间,CPU
//可以完成一个任务,或者处于待命状态。
//
// 然而,两个 相同种类 的任务之间必须有长度为整数 n 的冷却时间,因此至少有连续 n
// 个单位时间内 CPU 在执行不同的任务,或者在待命状态。
//
// 你需要计算完成所有任务所需要的 最短时间 。
//
//
//
// 示例 1:
//
//
//输入:tasks = ["A","A","A","B","B","B"], n = 2
//输出:8
//解... | ALGO | 0.999967 | 7.463596 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2019-12-30T06:04:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f75c3e8... |
67d618ea-2a92-4ca7-861a-35c6766c3a05 | mjwgoh/stochastic-calculus | Replication, Hedging and Rebalancing/replicating-strategies.cpp | #include <iostream>
#include <cmath>
#include <string>
using namespace std;
// Request for inputs
double InputRequest (double &U, double &D, double &S0, double &R) {
cout << "Please input S0: ";
cin >> S0;
cout << "Please input U: ";
cin >> U;
cout << "Please input D: ";
cin >> D;
cou... | ALGO | 0.999918 | 6.293251 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-02-17T15:49: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": "4d01bb809f53... |
3bcbbe4d-be0e-4428-a6d8-3543c871a148 | Maybetuandat/D21_PTIT | Semester3/C++/CPp0130.cpp | #include<bits/stdc++.h>
using namespace std;
bool kt(long long n)
{
if( n< 2)
return false;
for(int i=2; i<=sqrt(n); i++)
{
if( n % i == 0)
{
return false;
break;
}
}
return true;
}
void xuli(long long n)
{
if( kt(n))
{
cout <<n <... | ALGO | 0.999952 | 4.860253 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-02-16T14:10: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": "41c9a01c787... |
18b9663f-eea2-466e-b593-5ceeccbe7841 | srijan908/C-programs | abc203/c.cpp | #include<bits/stdc++.h>
using namespace std;
#define fo(i,k,n) for(long long i=k;i<n;i++)
#define endl "\n"
#define pb push_back
#define vii vector<ll>
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
typedef long long ll;
ll fun_ceil(ll n,ll k){
... | ALGO | 0.99943 | 3.330645 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-06-02T11:26: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": "bd2e19b993... |
739ad71e-4fdf-43a6-b39f-abfccd8e5963 | Joe676/Graph-algorithms | Graph.h | #ifndef GRAPH_H
#define GRAPH_H
#pragma once
#include "Matrix.h"
#include "List.h"
class Graph{
private:
Matrix* matrix;
GraphList* list;
int n;
int qE;
public:
Graph(int n_);
~Graph();
void addEdge(int u, int v, int w);
void removeEdge(int... | ALGO | 0.991956 | 4.400598 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-06-10T12:01:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "921b5a92c85b... |
87cf325b-6340-4c31-8b36-98fa9f901624 | Vishnu8989/Common-Interview-Questions | Other/prev_smallest_of_array.cpp | #include <iostream>
using namespace std;
void fun(int d[], int ret[], int a) // input array , returning array , size of both arrays
{
int smallest = d[0];
for (int i = 1; i < a; i++)
{
if (d[i] < smallest)
{
smallest = d[i];
ret[i] = -1;
}
else
... | ALGO | 0.99985 | 3.672678 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2021-10-18T10:34:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6726f72d... |
1347c2e7-e6f9-4ae3-aa44-f56e5c7f8cfb | biswarup55655/DSA_sem4_Practical | Day10(02.07.2021)/bellmanford.cpp | #include<iostream>
#include<fstream>
using namespace std;
struct edge{
int src,dst,wt;
};
int V;
int graph[1000][1000];
int parent[1000];
int dist[1000];
int output[1000][1000]={0};
edge Edges[1000];
bool bellmanFord(int E,int s)
{
for(int i=0;i<V;i++){
dist[i] = INT_MAX;
}
dist[s]=0;
for(int i=0;i<=V;++i)
... | ALGO | 0.999974 | 3.853798 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-08-04T15:28: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": "d168a325db3... |
09f05579-3246-4ce8-9c61-99a61233209d | AhkrinDescol/ProjectEulerSolutions | Problem 9/Problem 9/main.cpp | #include <iostream>
#include <cmath>
#include <vector>
// TASK: A pythagoran triplet is a set of three natural numbers, a < b < c,
// for which a^2 + b^2 = c^2. There is exactly one Pythagoran triplet
// where a + b + c = 1000. Find the product of abc.
int getProduct(const std::vector<int>& numbers);
std::vector<... | ALGO | 0.999069 | 5.212945 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2017-11-23T18:13: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": "f0bbdb1f5... |
ef26fb1f-bd83-46dd-85b8-de658083010b | leandropelorosso/albero | server/helper.cpp | #include <stdio.h>
#include <netcdf.h>
#include "iostream"
#include <chrono>
#include <assert.h>
#include <fstream>
#include <string>
#include <iomanip>
#include <assert.h>
#include "color.h"
#include "helper.h"
#include "pct.h"
#include "hcl.h"
#include "math.h"
#include <IL/il.h>
#pragma comment( lib, "DevIL... | DATA | 0.962049 | 4.632145 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-07-19T23:49: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": "d4736d8ab... |
eb356049-7d29-44b1-bb37-cacbad91978b | NVIDIA/thrust | thrust/binary_search.h | /*
* Copyright 2008-2013 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | ALGO | 0.999957 | 7.238469 | {
"github_metadata": {
"branch": "main",
"commit_count": 4758,
"repo_created_at": "2012-03-06T01:01:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4980,
"forks": 764,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "9842b... |
1cc631a3-9653-4e14-aad6-b05005553647 | tjujingzong/Leetcode | leetcode/1163-Dijkstra-Sequence.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> a[1005];
int dis[1005][1005];
int n;
bool isdijistra(int arr[]) {
for (int i = 3; i <= n; i++) {
if (dis[arr[1]][arr[i]] < dis[arr[1]][arr[i - 1]])
return false;
}
return true;
}
int main() {
cin >> n;
memset(dis, 0x3f, sizeof(dis));
int ... | ALGO | 0.999987 | 4.403432 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2022-08-02T03:32:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b1bcfefbbb... |
682d6dd1-b3e6-49bc-8d5a-e700efeeb548 | Yzabakli/Interview_Tasks_C__ | number_Tasks/Number_MaximumPossibleValue.cpp | //
// Created by Abakli on 17/08/2022.
//
#include <string>
#include <iostream>
static int maximumPossibleValue(int number){
std::string numberToString;
if (number > 0){
numberToString = std::to_string(number);
for (int i = 0; i < numberToString.length(); ++i) {
if (stoi(numbe... | ALGO | 0.997887 | 4.69372 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-08-13T10:49:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bdf2861c5... |
4a8be543-2184-4839-9750-ed89da113b93 | alexmijo/EoPI | BinarySearchTrees/BinarySearchTrees.cpp | #include <iostream>
#include <memory>
using namespace std;
template <typename T>
struct BSTNode {
T data;
unique_ptr<BSTNode<T>> left, right;
};
// 15.1
// Stupidly had the wrong idea at first so I took too long, otherwise fine.
// Edit: Nvm, had another stupidly wrong idea, so that wasted more time.
// Edit... | ALGO | 0.999734 | 6.726995 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2022-08-09T22:24:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9bda055d... |
4281bffa-bfad-4cd3-aa10-71fd7eb73198 | xdtianyu/android-8.0.0_r4 | external/skia/src/opts/SkBitmapFilter_opts.h | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkBitmapFilter_opts_DEFINED
#define SkBitmapFilter_opts_DEFINED
#include "SkConvolver.h"
#if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
#include <immintrin.h>
#el... | TOOL | 0.984341 | 6.632173 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2017-08-28T14:22:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 25,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "be801bd... |
9584f40f-5a3b-4d72-9ed0-6faca0fb738f | CodeKunalTomar/DSA | Graphs/isConnected.cpp | #include <iostream>
#include <queue>
#include <map>
using namespace std;
void BFS(int **edges, int n, int s, bool *visited)
{
queue<int> q;
q.push(s);
visited[s] = true;
while(!q.empty())
{
int x = q.front();
q.pop();
for(int i = 0; i < n; i++)
{
if(i =... | ALGO | 0.999959 | 4.273218 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-10-02T15:08:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf8fdb805cf5... |
440de652-1131-404b-b6e5-91fa6ad73179 | dominikMilde/DiscreteMathematics | Lab2 - graph cycle and girth/najkraciCiklus.cpp | #include<iostream>
#include<fstream>
#include<cmath>
using namespace std;
int main(void) {
ifstream stream;
string fileName;
cout << "Unesite ime datoteke: ";
cin >> fileName;
stream.open(fileName);
int n = 0;
stream >> n;
bool matricaSusjedstva[n][n];
stream.ignore(1, '\n');
... | ALGO | 0.999782 | 4.430401 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-02-15T08:41: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": "c917ce0c9bda... |
f8ae52b4-de06-4d8c-8626-d94c08ea3195 | CatKingWoof/Data_Structure | DS_HW1/0810917.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <sstream>
#include <cstdlib>
using namespace std;
struct MatrixTerm{
int row,col,value;
};
class sparceMatrix{
public:
int Rows,Cols,Terms;
vector<MatrixTerm> smArray;
sparceMatrix(std::ifstream& ifs);
sparceMatrix... | DATA | 0.988031 | 3.140226 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-10-29T07:59:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b75b5d295d... |
8c30c69a-e1ce-4b40-9dcd-8b887b077924 | emost22/cpp-boj | dp/17528.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#define INF 1000000000
using namespace std;
int dp[251][62501][2];
int list1[251], list2[251], N;
int func(int idx, int now, int t) {
if (idx == N + 1) return now;
if (dp[idx][now][t] != -1) return dp[idx][now][t];
dp[idx][now][t] = INF;
if (t) {
dp[... | ALGO | 0.999934 | 3.596411 | {
"github_metadata": {
"branch": "main",
"commit_count": 3886,
"repo_created_at": "2020-10-21T12:31: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": "6bba4b074... |
08589cb5-8a1d-4f41-b381-a89f5bee83f0 | tanmay-pro/CompProg | codeforces/1694/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PI 3.14159265
#define br cout << endl
#define fo(i, n) for (int i = 0; i < n; i++)
#define tr(container, it) \
for (auto it = container.begin(); it != container.end(); it++)
#define Fo(i, k, n) for (int i = k; k < n ? i < n : i > n; k < n ? ... | ALGO | 0.999959 | 4.410955 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-03-09T17:11: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": "0759a34d69ae... |
5ff30128-b2a8-4176-a1e3-da6abe295424 | Gawor270/CP | Codeforces/1754C.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define debug(x) cout << "[" << #x << " " << x << "] ";
#define ar array
#define ll long long
#define ld long double
#define sz(x) ((int)x.size())
#define all(a) (a).begin(), (a).end()
typedef vector<int> vi;
typedef pair<int,int> pi;
const int MAX... | ALGO | 0.998686 | 3.806415 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-08-19T22:03: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": "b1ce128fb838... |
d8f3baed-b5d6-432f-b13b-4d17622cb508 | ZiluZhang/LeetCode-Solutions | 206.cpp | // Reverse Linked List
// 递归和迭代,见代码
class Solution {
public:
// 递归
ListNode* reverseList(ListNode* head) {
if(head == NULL || head->next == NULL) return head;
ListNode* tmp = head->next;
head->next = NULL;
// 拿到后面reverse之后的结果
ListNode* newtmp = reverseList(tmp);
... | ALGO | 0.999939 | 5.469611 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2018-03-25T06:58:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95bd3c709... |
a833dec6-0f30-41a0-96bb-8caccbd5127c | lunarc/cpp_course | ch_concurrency/async2.cpp | #include <algorithm>
#include <atomic>
#include <chrono>
#include <cmath>
#include <ctime>
#include <execution>
#include <future>
#include <iostream>
#include <iterator>
#include <memory>
#include <numeric>
#include <random>
#include <ranges>
#include <thread>
#include <vector>
using namespace std;
// Function to per... | ALGO | 0.999349 | 6.83268 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2016-11-18T19:44:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be5a983f7... |
2c456bf5-ee32-4227-a32d-2777fbc2865c | jigjnasu/codility | exercises/chapter_13/fibonacci_matrix.cpp | /*
https://app.codility.com/programmers
Chapter 13, Fibonacci Numbers from Matrix
Solution by <NAME>, cpp.rakesh(at)gmail.com
Date: 07/04/2018
*/
#include "matrix.h"
Matrix<int, 2> power_mat(Matrix<int, 2> m, int y) {
if (y == 0) {
Matrix<int, 2> mat;
return mat;
} else if (y == 1) {
... | ALGO | 0.999839 | 5.166399 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2018-03-13T04:40: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": "b4e895797... |
2171a92b-9dbd-41bb-95a9-40f2de3b058a | Arpitmurailya18/AJfiles-CP | fearofthedark.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long double lld;
typedef unsigned long long ull;
typedef long long ll;
typedef int in;
typedef char ch;
typedef float fl;
typedef double dou;
typedef string ss;
#define ub upper_bound
#define lb lower_bound
#define AJ(i,a,b) for(int i=a;i<b;i++)
#define MOD 10000000... | ALGO | 0.999438 | 3.81475 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2024-06-13T10:58:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "242617dd117... |
5fd0fa0c-2dec-487a-89a6-c8f6450ec7c8 | arangodb/arangodb | 3rdParty/boost/1.78.0/boost/geometry/strategies/simplify/cartesian.hpp | // Boost.Geometry
// Copyright (c) 2021, Oracle and/or its affiliates.
// Contributed and/or modified by <NAME>, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
#ifndef BOOST_GEOMETRY_STRATEGIES_SIMPLIFY_CARTESIAN_HPP
#define BOOST_GEOMETRY_ST... | ALGO | 0.972896 | 7.582789 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
113cbba7-2610-4273-a904-baedd81492d4 | Djokovic0311/LeetCode | problems/basic_calculator_iii/solution.cpp | class Solution {
public:
int calculate(string s) {
s += "+";
char lastOperation = '+';
int lastNumber = 0, currNumber = 0, eval = 0;
stack<int> stack;
unordered_map<char,int> sign{{'+', 0}, {'-', 1}, {'*', 2}, {'/', 3}};
unordered_map<int, char> number{{0, '+'}, {1, '... | ALGO | 0.999895 | 4.989913 | {
"github_metadata": {
"branch": "main",
"commit_count": 3188,
"repo_created_at": "2023-01-03T19:43:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8eae4ab0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.