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 |
|---|---|---|---|---|---|---|---|
3696ce9d-4f0f-410f-a184-3fa03358740b | ericschreiber/DPHPC23-SmokyRhino | SDDMMlib/src/SDDMM/coo_opt_vectorization_gpu/coo_opt_vectorization_SDDMM_GPU.cpp | // coo_opt_vectorization_SDDMM_GPU.cpp
#include "coo_opt_vectorization_gpu/coo_opt_vectorization_SDDMM_GPU.hpp"
#include <iostream>
#include <type_traits>
#include <typeinfo>
#include "coo_opt_vectorization_gpu/coo_opt_vectorization_SDDMM.cuh"
#include "utils.h"
void coo_opt_vectorization_SDDMM_GPU<float>::SDDMM_COO... | ALGO | 0.997835 | 6.390144 | {
"github_metadata": {
"branch": "master",
"commit_count": 486,
"repo_created_at": "2023-10-05T12:14:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "129ef39e... |
e415a25b-bc46-466a-b1d8-9024d920f01b | nucleargezi/acm-icpc | codeforces/edu/80-89/1354 edu87 -ak/1354B.cpp | #include "MeIoN_Lib/MeIoN_all.hpp"
void before() {}
#define tests
NAME MeIoN_is_UMP45() {
SV(s, '0');
const int n{len(s)};
int ans{inf<int>};
FOR(i, 1, 4) {
FOR(k, 1, 4) {
FOR(j, 1, 4) {
if (i == k or i == j or k == j) continue;
vector<int> L(n, inf<... | ALGO | 0.999849 | 4.527443 | {
"github_metadata": {
"branch": "master",
"commit_count": 264,
"repo_created_at": "2024-10-29T13:52:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ecd16068... |
d410ec96-2cff-4675-9a7e-4f4eb427b1d4 | cmuparlay/flock | include/parlay/kth_smallest2.h |
#ifndef PARLAY_KTH_SMALLEST_H_
#define PARLAY_KTH_SMALLEST_H_
#include "random.h"
#include "sequence_ops.h"
namespace parlay {
template <class Seq, class Compare>
typename Seq::value_type kth_smallest_old(Seq const &s, size_t k, Compare less,
random r = random()) {
using T = ... | ALGO | 0.999906 | 6.998224 | {
"github_metadata": {
"branch": "main",
"commit_count": 227,
"repo_created_at": "2022-01-06T21:31:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 82,
"forks": 17,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d7e2bb7d... |
108c569c-936d-4b00-96c0-2615cc2d8242 | ishandutta2007/codeforces-s | slime/normal/1672/C.cpp | //Awwawa! Dis cold yis ratten buy Pikachu!
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define vi vector<int>
#define pi pair<int, int>
#define mod 1000000007
template<typename T> bool chkmin(T &a, T b){return (b < a) ? a = b, 1 : 0;}
templa... | ALGO | 0.999694 | 4.223187 | {
"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": "e94fc65cc4e0... |
4c040c88-3f0a-489a-bb14-1ee87bacf49c | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/05/0517/personal_submission/cf909d_WanderOvO.cpp | /*
压缩相同的字符
a(2)b(1)c(1)a(2)
假如某个字符本轮被删除了,那么其两边的字符都是下轮要考虑的对象
假如某个字符左右两边的字符本轮都没有被删除,则下轮无需考虑该字符
先把初始需要删的点存一下,然后做第一轮删除
*/
int T;
int n, pre[N], ne[N];
string s;
bool deleted[N];
void del(int p) {
int pre_p = pre[p], ne_p = ne[p];
if (pre_p != -1) {
ne[pre_p] = ne_p;
}
if (ne_p != -1) {
... | ALGO | 0.999981 | 3.590735 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "f48f... |
f57af0e1-550a-4e9e-ae24-a8925f033609 | keshavsingh4522/hacktoberfest | DP/unique-paths.cpp | #include<bits/stdc++.h>
using namespace std;
// PROBLEM LINK: https://leetcode.com/problems/unique-paths/
int uniquePaths(int m, int n) {
vector< vector<int>>dp(m,vector<int>(n));
for(int i = 0;i<m;i++){
dp[i][n-1] = 1;
}
for(int j = 0;j<n;j++){
dp[m-1][j] = 1... | ALGO | 0.999973 | 4.885406 | {
"github_metadata": {
"branch": "master",
"commit_count": 1792,
"repo_created_at": "2020-09-24T18:11:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 864,
"forks": 3955,
"issues": 175,
"pull_requests": 2716
},
"file_meta": {
"content_id"... |
66301448-e79e-4ed0-a429-4f912955d4e3 | pbraga88/study | Legacy/CPA_cpp/4_AccessingDifferentKindOfData/4.1_ArraysOfPointersAsMultidimensionalArrays/src/main.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
/******Regular two dimensional array********************************/
// int rows = 5;
// int columns = 5;
// int **array;
// array = new int* [rows];
// for(int r = 0; r < rows; r++){
// array[r] = new int[columns];
// }
// *(*(array)... | ALGO | 0.982333 | 3.57674 | {
"github_metadata": {
"branch": "master",
"commit_count": 148,
"repo_created_at": "2018-11-02T07:32: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": "08ee71a3... |
deece3f6-5e1c-416a-908c-c9a8383b980a | WilsonToapanta7/Estructura-de-datos | AlgoritmoDijkstra/Dijkstra.cpp | #include<iostream>
#include<queue>
#include<stack>
#include<limits>
using namespace std;
class Graph {
private:
int **adjMatrix;
int vertexCount;
// below attributes are for Prims
int *key;
int *distance;
int *parent;
public:
Graph(int vertexCount);
~Graph();
void addEdgeDirectedWei... | ALGO | 0.999918 | 4.592536 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-03-20T23:34: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": "45a729a55e... |
bb552141-9b72-4b9a-92e0-fbadf32040c1 | mrkimkim/Competitive-Programming-Summary | Samsung SW Test Pre/3190.cpp | #include <iostream>
#define MAX 102
#define forall(i,a,b) for(int i = a; i < b; ++i)
using namespace std;
struct p {
int x;
int y;
};
struct d {
int t;
char direction;
};
int N, K, L;
int M[MAX][MAX];
int M2[MAX][MAX];
int x, y;
int direction;
int v[4][2] = { {0, 1}, {0, -1}, {1, 0}, {-1, 0} }; // Right, Left, D... | ALGO | 0.999897 | 3.686683 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2017-04-29T09:12: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": "5613dc8be... |
6416a614-4ea1-40c5-8566-d2ba0eca9b27 | KenAdeniji/WordEngineering | cpp/Practical C++/Chapter14OverloadingOperators/QuePrentice-HallIndiaPracticalC++RobMcGregorOperatorOverloadingMultiply.cpp | #include <iostream>
using namespace std;
//2016-10-04 cl /clr QuePrentice-HallIndiaPracticalC++RobMcGregorOperatorOverloadingMultiply.cpp
struct ThreeDimensionalPoint
{
double x;
double y;
double z;
};
// Function prototypes
ThreeDimensionalPoint operator*(const ThreeDimensionalPoint& pointFirst, ThreeDimensional... | TOOL | 0.992203 | 5.930725 | {
"github_metadata": {
"branch": "main",
"commit_count": 2334,
"repo_created_at": "2023-02-21T12:06: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": "46157e552... |
4fc53e40-f78b-4f61-be46-00ddc2184e29 | jonathanknorn/kattis | asciifigurerotation.cpp | //
// Created by <NAME> on 15-09-26.
//
#include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
int main(){
map<char, char> convert = {
{' ', ' '},
{'+', '+'},
{'-', '|'},
{'|', '-'},
};
string line;
int n;
getlin... | ALGO | 0.999951 | 4.439185 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2016-01-21T22:07:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3690ca2a... |
ce5b903b-08c7-4402-a0a8-32ede0fd76bb | fuhaoda/ITR | include/angle_based_classifier.h | #ifndef __ANGLE_BASED_CLASSIFIER_H__
#define __ANGLE_BASED_CLASSIFIER_H__
#include <string>
#include <set>
#include <memory>
#include "fdf.h"
#include "vlbfgs.h"
#include "data.h"
#include "types.h"
class ABCFunc;
class AngleBasedClassifier {
public:
// Constructor
// c: Positive real value for the large-margin... | DATA | 0.914413 | 6.601815 | {
"github_metadata": {
"branch": "master",
"commit_count": 262,
"repo_created_at": "2018-10-16T13:38:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63f6eb53... |
703ed3e2-0280-4fd8-a349-e4c9b67b21fe | funkey/bmrm | solver/bmrminnersolver/l2n2_linesearch.hpp |
#ifndef _L2N2_LINESEARCH_HPP_
#define _L2N2_LINESEARCH_HPP_
#include "model.hpp"
#include "sml.hpp"
#include "bmrminnersolver.hpp"
/**
* Solve the bmrm problem in the "primal" using linear search (as in the convergence proof)
* when \Omega(w) = 0.5*|w|_2^2
*/
class CL2N2_LineSearch : public CBMRMInnerSolver... | ALGO | 0.998982 | 5.375844 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2012-09-24T12:52:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ae854ff2... |
919d4a8d-1423-4bba-9442-8f95261fc1b8 | Faiax/Codeforces-Problems | 96A-Football.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
int x = 0; // counter value 1 // for counting 1
int y = 0; // counter value 2 // for counting 0
int z = 0;// counter value 3 //for if one of the O or 1 reaches in 7 in straight
cin >> s;
for(int i = 0; i < s.size(... | ALGO | 0.999617 | 3.654614 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2022-11-11T15:49: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": "c83499b68cc... |
c439168c-9085-4a0a-9c51-611b6ff1d5a5 | BRAINSia/AtlasWerks | Code/Applications/AtlasWerks/GreedyAtlasBuilderGPU.h | /* ================================================================
*
* AtlasWerks Project
*
* Copyright (c) <NAME>, <NAME>, <NAME>,
* <NAME>. All rights reserved. See Copyright.txt or for details.
*
* This software is distributed WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or ... | ALGO | 0.991405 | 5.822589 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2013-02-01T13:40:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49a63b1107... |
631e7ae4-c213-45be-9198-4eae3c50932e | Louis-Ian/Sistemas-Operacionais | TP01/fibonacci_Q2_b.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <unistd.h> // Para usar fork()
#include <sys/wait.h> // Para usar wait()
using namespace std;
int fibonacci_formula(int n){
n--;
int fibonacci_n = round(1/sqrt(5) * pow((1 + sqrt(5)) / 2, n) - 1/sqrt(5) * pow((1 - sqrt(5)) / 2, n));
return fibonac... | ALGO | 0.999226 | 4.223303 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2020-12-18T14:27:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46847732764... |
5d6c80cc-327c-4897-b153-32872e1e6318 | skjha1/Data-Structure-Algorithm-Programs | src/Algorithms/Dynamic Programming/12 Coin change problem : maximum no of ways.cpp | #include <bits/stdc++.h>
using namespace std;
int getMaxNumberOfWays(int coins[], int n, int sum) {
int t[n + 1][sum + 1];
// initialization
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= sum; j++) {
if (i == 0)
t[i][j] = 0;
if (j == 0)
t[i][j] = 1;
}
}
for (int i = 1; i <= n; i++)
for (... | ALGO | 0.999926 | 4.440964 | {
"github_metadata": {
"branch": "master",
"commit_count": 682,
"repo_created_at": "2020-08-12T04:43:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 652,
"forks": 257,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6c81... |
b5d175e5-767f-41a5-ab6e-ebbb7c4d6a4d | szq998/Leetcode | 154.寻找旋转排序数组中的最小值-ii.cpp | /*
* @lc app=leetcode.cn id=154 lang=cpp
*
* [154] 寻找旋转排序数组中的最小值 II
*/
// @lc code=start
class Solution {
public:
int findMin(vector<int> &nums) {
const int N = nums.size();
if (nums[0] < nums[N - 1]) {
// 旋转了n次,也即没有旋转
return nums[0];
}
int search_start =... | ALGO | 0.999982 | 6.479079 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2021-04-19T05:13: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": "bc2a54a26... |
ab60d2df-331b-435d-ba70-d691422e112f | sylvainthery/ASTex | Algo/PatchExchange/PatchProcessor.h | /*******************************************************************************
* ASTex: *
* Copyright (C) IGG Group, ICube, University of Strasbourg, France *
* ... | TOOL | 0.978257 | 7.07941 | {
"github_metadata": {
"branch": "sylvain",
"commit_count": 200,
"repo_created_at": "2017-10-23T08:43:45.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "ASTex-ICube/ASTex",
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content... |
d8c456c5-6840-4769-a4d2-4f4234e5f1aa | donbasta/leetcode-submissions | Medium/955.cpp | class Solution {
public:
int minDeletionSize(vector<string>& strs) {
int n = strs[0].length();
int m = strs.size();
int ans = 0;
vector<pair<int, int>> itv;
itv.emplace_back(0, m - 1);
for (int i = 0; i < n; i++) {
bool can = true;
for (auto i... | ALGO | 0.999998 | 5.817821 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-05T03:05: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": "f00e52c8ab74... |
d0c7172f-56f1-459f-9104-f7e84af9a8de | agnusmaximus/BareBonesDistributedNN | src/distributed/evaluator_nn.h | #ifndef _EVALUATOR_NN_
#define _EVALUATOR_NN_
#include "distributed_defines.h"
class EvaluatorNN : public NN {
public:
EvaluatorNN(NNParams *params, std::vector<MPI_Comm> &layer_comms, int rank, int n_procs) : NN(params), layer_comms(layer_comms) {
this->rank = rank;
this->n_procs = n_procs;
this->cur_step = S... | ALGO | 0.978735 | 6.938466 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2017-01-27T03: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": "9f165a6e0... |
73a203ba-7c60-46f0-a4ad-5f490a1adf27 | krunopcpp/test-threads-vc- | Source.cpp | /*
Hi,
I send you my experiment with 20 threads calculating the same function for N= 5000
The total number of multiplications if N=10000 is smaller than 10000^2 = 4 * 5000^2,
but I run 20 threads for N=5000, and performance is much better than one thread for N=10000
-also all four cores of i3 proc are employed n... | ALGO | 0.999538 | 3.716214 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-02-07T23:44: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": "ba72d3e53f... |
9fde6672-36c4-4682-b0ef-e651cc2f25d2 | AyobAsroutVargas/tsp | main.cpp | #include "naive-tsp.h"
#include "greedy-tsp.h"
#include "dp-tsp.h"
#include <filesystem>
#include <string>
int main(int argc, char* argv[]) {
if(argc < 2) {
std::cout << "Usage: ./main <Path>(Path to dir with graph files)\n";
return 0;
}
std::string path = argv[1];
for (const auto & entry : std::file... | ALGO | 0.983113 | 4.069126 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-04-03T21:10: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": "f53d723d28b8... |
5ca3d3d1-2d10-4ba5-932d-19c2c61a9075 | willard-yuan/BoVW | bow_module.hpp | #ifndef bow_module_hpp
#define bow_module_hpp
#include <stdio.h>
#include "utils.h"
#include "covdetExtractor.hpp"
struct kmeansParameters{
bool printMode; // 是否打印输出聚类的信息
arma::uword max_iterations ; // 设置聚类最大迭代次数
};
class bowModel {
public:
bowModel(){};
bowModel(int _numWords,std::... | DATA | 0.982523 | 4.766844 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2016-08-07T09:33:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3abb69903... |
c22a2f20-cfd5-4057-9a8c-65e1f9d5c492 | zchee/cuda-sample | 4_Finance/BlackScholes/BlackScholes_gold.cpp | /*
* Copyright 1993-2015 NVIDIA Corporation. All rights reserved.
*
* Please refer to the NVIDIA end user license agreement (EULA) associated
* with this source code for terms and conditions that govern your use of
* this software. Any use, reproduction, disclosure, or distribution of
* this software and related... | ALGO | 0.999517 | 6.613469 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-10-06T22:31:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 371,
"forks": 179,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "2aa817... |
47fa1fe0-44e9-4cfa-818e-6e0f480edd07 | citizenfx/fivem | code/vendor/botan/include/botan/package.h | /*
* Rivest's Package Tranform
* (C) 2009 <NAME>
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#ifndef BOTAN_AONT_PACKAGE_TRANSFORM_H_
#define BOTAN_AONT_PACKAGE_TRANSFORM_H_
#include <botan/block_cipher.h>
namespace Botan {
class RandomNumberGenerator;
/**
* Rivest's Package Tranform... | TOOL | 0.9026 | 6.637994 | {
"github_metadata": {
"branch": "master",
"commit_count": 12090,
"repo_created_at": "2017-01-16T21:18:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3859,
"forks": 2340,
"issues": 469,
"pull_requests": 118
},
"file_meta": {
"content_id"... |
dba608ed-24d8-41fd-8549-dc6b1ebf8cc2 | Div1der/spoj | RPLN.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <cassert>
#include <utility>
#include <iomanip>
using namespace std;
const i... | ALGO | 0.999966 | 4.221303 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-03-01T03:04: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": "1afc956f0... |
6b963e99-e1a7-4199-bf10-1db8c8e9cf4c | generalized-intelligence/GAAS | algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/nvbio/nvBowtie/bowtie2/cuda/locate_inl.h | /*
* nvbio
* Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice,... | ALGO | 0.998976 | 7.276893 | {
"github_metadata": {
"branch": "main",
"commit_count": 765,
"repo_created_at": "2019-01-29T06:14:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1991,
"forks": 453,
"issues": 7,
"pull_requests": 3
},
"file_meta": {
"content_id": "82d201... |
bfabe56f-4b4d-4b1e-8dca-ef573921a29c | MicheleMiccinesi/AlgoRythms | Concurrent/006std/pmergesort.cpp | /* License : <NAME> 2018 - */
/* Mergesort with Parallel merge components */
/* DBG */
template <class T>
bool checkOrder(std::vector<T>& V, int i,int j){
for( int k=i+1; k<=j; ++k )
if( V[k]<V[k-1] )
return false;
return true;
}
template <class T>
bool printVector(std::vector<T>& V, in... | ALGO | 0.999985 | 5.600501 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-07-17T10: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": "f3dcc0f02... |
11b2e213-155d-483e-9451-65e053b5dff5 | Ashik1704026/codeforce | 1316B.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define memset(x,v) memset(x, v, sizeof(x))
#define lcm(a,b) a*b/__gcd(a,b)
#define mp make_pair
#define pb push_back
int main(){
fast;
int t;
cin >> t;
while(t --){
... | ALGO | 0.999993 | 3.409548 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2019-11-21T09:42: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": "9ab67bdb3... |
c4f1840b-6330-4606-842f-3864f2617779 | wjwjddusl/C | over60.cpp | #include <iostream>
using namespace std;
class Dept{
int size;
int *scores;
public:
Dept(int size){ //생성자
this->size =size;
scores = new int [size]; //size 길이 만큼 동적 배열 생성
}
Dept(const Dept &d); //복사생성자
~Dept(); //소멸자
int getSize(){
return size;
}
void read(); //size 만큼 읽어 scores에 저장
bool isOver6... | TOOL | 0.97083 | 3.504013 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2022-03-28T10:39:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d7c3045e3f... |
7b384d74-5e0b-40fd-b6cb-563c76b39279 | shayolk/LeetCode-Solutions | Find All Groups of Farmland.cpp | class Solution {
int n, m;
vector<vector<bool>> vis;
vector<vector<int>> ans;
bool ok(int r, int c) {
return r>=0 && r<n && c>=0 && c<m;
}
vector<int> dfs(int r, int c, vector<vector<int>>& land) {
// cout<<r<<" "<<c<<"\n";
vis[r][c]=true;
vector<int> re... | ALGO | 0.999938 | 5.653224 | {
"github_metadata": {
"branch": "main",
"commit_count": 343,
"repo_created_at": "2021-08-03T15:29: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": "94ff827bb6... |
c9b19c4d-bbac-4ed0-b571-248d7fa8372b | bhushangawde/Leetcode-Solutions | 95_Unique_Binary_Search_Trees_II.cpp | // Bottom up dp
/**
* 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 *ri... | ALGO | 0.999998 | 6.514636 | {
"github_metadata": {
"branch": "main",
"commit_count": 412,
"repo_created_at": "2021-06-23T18:15:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63b9a83d6a... |
bec477cd-2bb9-45e9-8658-b398c760826f | 0-sv/datastructures-algorithms | lab08ex1/skeleton/Cake.cpp | //=====================================================================
// FILE: penguin.cpp
//=====================================================================
//=====================================================================
// STUDENT NAME: <<NAME>>
// MATRIC NO. : <A0174730H>
// NUS EMAIL : <<EMAIL>>
... | ALGO | 0.999021 | 4.452412 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-02-26T09:06: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": "c63d990769... |
2102010b-9e70-469b-aa06-5da5d0379c9f | chenyong2github/UnrealEngine | Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/ContactTriangles.cpp | // Copyright Epic Games, Inc.All Rights Reserved.
#include "Chaos/Collision/ContactTriangles.h"
#include "Chaos/DebugDrawQueue.h"
namespace Chaos
{
namespace CVars
{
extern int32 ChaosSolverDebugDrawMeshContacts;
}
extern bool bChaos_Collision_EnableEdgePrune;
void FContactTriangleCollector::SetNumContacts(co... | ALGO | 0.995038 | 5.380719 | {
"github_metadata": {
"branch": "5.3",
"commit_count": 258706,
"repo_created_at": "2022-07-28T06:53:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 12,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c6a752... |
f3cf0eb1-d9fa-4b04-ae96-6679152e0f9e | namkongkirat/Kathford | 5th Semester/Simulation & Modeling/LAB 4/KS_Test.cpp | #include <stdio.h>
int main(){
float RN[20], a, b, c, d, dp = 0, dm = 0, dd = 0, temp;
int n, i, j;
printf("Enter the number of random number to input:");
scanf("%d", &n);
printf("\nEnter the random numbers:\n");
for(i = 0; i < n; i++){
printf("%d: ", i+1);
scanf("%f", &RN[i]);
}
printf("\nIn Ascending o... | ALGO | 0.999453 | 3.258849 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2017-07-16T16:06: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": "5d6ec044b... |
c48910fd-8532-4985-b8a1-75de2a7afa3c | ishandutta2007/codeforces-m | moransky/normal/960/F.cpp | // Skyqwq
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define mp make_pair
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
template <typename T> void chkMax(T &x, T y) { if (y > x) x = y; }
template <typename T> void chkMin(T &x, T y) { if (y < x) x = y; }... | ALGO | 0.999983 | 3.858696 | {
"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": "45562fa23e29... |
831314bc-11bb-4f20-8d0d-367ee526869e | austinmarsray/DataStructure | BindaryTree/BindaryTree/Stack.h | #ifndef _STACK_H_
#define _STACK_H_
/*栈结构的实现
*作者:雷海星
*时间:2019年9月22日
*/
#include <iostream>
#include <fstream>
#include <cassert>
#include <string>
using namespace std;
template<typename T>
class Stack
{
private:
T *data;
int top;
int maxsize;
void overflowProcess();
public:
//构造函数
Stack(int size = 10);
//解析函... | ALGO | 0.950636 | 4.22009 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-10-18T16:34: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": "162d777a76... |
b6b43503-0e04-4bb6-953b-a77a58a375b9 | vinhqngo5/CS112.L11.KHTN_Team011 | CodeforcePractice/Really Big Numbers/main.cpp | #include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
const int maxn = 2e5 + 5, mod = 1e9 + 7;
int a[maxn];
long long change(long long r)
{
long long t = 1e18, ans = 0;
--t;
bool ok = false;
for(; t>0; t/=10) {
if (r / t >= 1) {
ans = ans * 10 + r / t;
... | ALGO | 0.999967 | 3.765765 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2020-09-15T14:40:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0123905... |
c4afaaff-3e8d-447a-84a6-06e723a3f7f9 | raincross7/code-similarity | codes/train_code/problem321/problem321_86.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 7;
const long long MOD = 1e9 + 7;
int a[N];
int main(){
int n, k;
scanf("%d%d", &n, &k);
for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
long long ans = 0;
for (int i = 1; i <= n; i++){
for (int j = i + 1; j <= n; j++){
if (a[i] > a[j]) ans... | ALGO | 0.999967 | 3.917424 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b43e5e5a2656... |
606c3142-aed0-454e-9c12-ba22fcb486b8 | upTina/leetcode | 034-Search_for_a_Range.cpp | class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
int first = findfirst(nums, target);
int last = findlast(nums, target);
return vector<int> { first,last };
}
int findfirst(vector<int>&nums, int target) {
int left = 0;
int right = nums.size() - 1;
int mid;
while (left <=... | ALGO | 0.999983 | 5.876863 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2018-02-13T13:13:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "023137f9... |
d6cc4e94-7c4e-474f-b2ac-3559aa8fba5c | weixiangchen1/LeetCode | 236.二叉树的最近公共祖先2.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
bool FindPath(TreeNode* root, TreeNode* x, stack<TreeNode*>& Path)
{
if(root == nul... | ALGO | 0.999995 | 6.277604 | {
"github_metadata": {
"branch": "main",
"commit_count": 210,
"repo_created_at": "2022-04-20T15:52: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": "0807afc9a6... |
8ace2de7-55c8-4aa6-a820-976c1e0cc488 | Abaiz-khan/Data-Structures-Cpp- | Data Structures/linklist(single)/new2.cpp | #include <iostream>
using namespace std;
class Node {
public:
int val;
Node* next;
Node(int data){
val = data;
next = NULL;
}
};
void display(Node* head){
Node* temp = head;
while (temp != NULL )
{
cout<<temp->val<<"->";
temp = temp->next;
}
cout << "NULL";
}
void insertat... | ALGO | 0.999566 | 3.610185 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-14T14:49:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "174679b33ba8... |
0f310644-9e1e-4681-bd1a-2c691b36078e | parvanitis15/Boggle-Game | tests/test_boggle.cpp | #include "Board.h"
#include "Trie.h"
#include "boggle_algorithm.h"
#include <algorithm>
#include <chrono>
#include <gtest/gtest.h>
#include <unordered_set>
class BoggleTest : public ::testing::Test
{
protected:
BoggleTest() : wordsList{}, expectedWords{}, board{} // Initialize all members in constructor
{
... | TEST | 0.910758 | 7.53862 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2025-02-27T14:45: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": "b59793237e6... |
3472dc66-fa1f-48c8-ae8c-ce8e390d8749 | VisH317/USACO-Questions | Bronze/2020-2021/Feb/year.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
string years[] = {"Ox", "Tiger", "Rabbit", "Dragon", "Snake", "Horse", "Goat", "Monkey", "Rooster", "Dog", "Pig", "Rat"};
int y[101];
bool isPrev[101];
string first[101], second[101];
int countYears(int i, int n, int cur, int yearIdx) {
cur+=isPrev[i]?-1*(yearI... | ALGO | 0.999729 | 3.490006 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-12-04T23:12: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": "4a063abc5b68... |
ad5fe01c-3768-42ed-9ff4-584ae9b9260f | pdeitel/CPlusPlus20ForProgrammers | examples/ch07/fig07_02.cpp | // fig07_02.cpp
// Pass-by-value used to cube a variable's value.
#include <fmt/format.h>
#include <iostream>
int cubeByValue(int n); // prototype
int main() {
int number{5};
std::cout << fmt::format("Original value of number is {}\n", number);
number = cubeByValue(number); // pass number by value to cubeB... | ALGO | 0.996604 | 6.138624 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2020-04-17T17:53:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 220,
"forks": 104,
"issues": 4,
"pull_requests": 1
},
"file_meta": {
"content_id": "63ed5... |
01accd5f-4979-411f-b757-d83bc6ba6a1c | hamedomarkhaled/thePrestigeChessEngine | Moves.cpp | #include "Moves.h"
#include "Board.h"
#include "iostream"
/**
0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15 always black
16 17 18 19 20 21 22 23
24 25 26 27 28 29 30 31
32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47
48 49 50 51 52 53 54 55 always white
56 57 58 59 60 61 62 63
**/
/**Black Bishop is meant for the squa... | ALGO | 0.969984 | 5.091764 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-01-21T18:41:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "01272e522a... |
b72af4f0-143a-44b9-8fa9-56da915d537f | CGAL/cgal | Miscellany/doc/Miscellany/CGAL/Handle_hash_function.h |
namespace CGAL {
/*!
\ingroup MiscellanyRef
The class `Handle_hash_function` is a model for the `UniqueHashFunction`
concept. It is applicable for all key types with pointer-like
functionality, such as handles, iterators, and circulators.
Specifically, for a `key` value the expression `&*key` must
return a unique ad... | TOOL | 0.900312 | 7.086925 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
83a3bccf-aa34-445f-b9a0-5447fc7ed9d0 | Vaveform/All_tasks_Coursera_belts | Brown_Belt/Week 3/Demography/src/Demography.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <optional>
using namespace std;
template <typename Iterator>
class IteratorRange {
public:
IteratorRange(Iterator begin, Iterator end)
: first(begin)
, last(end)
{
}
Iterator begin() const {
r... | ALGO | 0.993539 | 4.817769 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2020-05-18T16:00: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": "5bb56149c... |
168e7826-9749-4a8a-a6a6-91c3309a8da4 | zml24/oi | dp/number.cpp | int f[N][10];
void init(int n) {
memset(f, 0, sizeof f);
for (int i = 0; i <= 9; i++)
if (i != 8) f[1][i] = 1;
for (int i = 2; i <= n; i++)
for (int j = 0; j <= 9; j++) {
if (j == 8) continue;
for (int k = 0; k <= 9; k++) {
if (k == 8) continue;
... | ALGO | 0.999616 | 4.106597 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2020-09-01T11:27:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dea850a8a... |
e1ee0fdc-9b77-4b33-9735-260a5df88f5f | AndrewPoarch/Algorithms-Data-Strcutures-1-sem | laba3/A.cpp | #include <iostream>
struct Node
{
int value;
struct Node* next;
};
struct Stack {
Node* head = nullptr;
void add_node(int value) {
Node* new_node = new Node;
new_node -> value = value;
new_node -> next = nullptr;
if (head == nullptr) {
head = new_node;
} else {
new_node->next ... | ALGO | 0.999798 | 4.91626 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-04-05T11:05: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": "77b4db475a9b... |
b932f643-6380-4b8a-aee9-6e8f3263e44e | hichemaichour/ACM-ICPC | Contests/USACO/Chapter 2/Section 2.3/nocows.cpp | /*
ID: b0002141
PROG: nocows
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <string>
#include <iterator>
#inc... | ALGO | 0.999972 | 4.055243 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-09-06T05:49:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20acdb4ab5... |
6af3d3bc-d39b-46da-80a6-fc7699f4c482 | mrmarkwell/advent_of_code | 2015/day1.cc | /*
--- Day 1: Not Quite Lisp ---
Santa was hoping for a white Christmas, but his weather machine's "snow"
function is powered by stars, and he's fresh out! To save Christmas, he needs
you to collect fifty stars by December 25th.
Collect stars by helping Santa solve puzzles. Two puzzles will be made available
on each d... | ALGO | 0.99851 | 5.865091 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2024-05-14T05:50: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": "acfd9837744... |
70e59bb1-ba5d-4c10-a82d-c91da0a142ef | cadenzah/cs | ps/baekjoon/basic_io/1924.2007.bad.cpp | #include <iostream>
using namespace std;
int main(void) {
ios::sync_with_stdio(false);
cin.tie(NULL);
// 2007년 1월 1일은 월요일
// 2007년 x월 y일은?
// 2월은 28일까지 있다
// 1월 1일 기준으로 1일씩 더한다
// 1월 2일은 1(화요일), 1월 3일은 2, ...
int month_days, days, x, y;
cin >> x >> y;
switch(x) {
case 1: month_days = 0; ... | ALGO | 0.999792 | 3.248278 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2020-02-19T14:44: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": "5c442b902... |
3a38256f-0d45-476e-801d-81127eb98e16 | tlhasami/LeetcodeQuestionSolutions | binary_exponention.cpp | #include <iostream>
using namespace std;
double myPow(double x, int n) {
long long exp = n; // Use long long to avoid overflow for INT_MIN
double ans = 1;
if (exp < 0) {
x = 1 / x; // Handle negative exponent
exp = -exp; // Convert n to positive
}
double ans = 1 ;
while(n>0){... | ALGO | 0.99988 | 5.573514 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-04-16T07:26:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44e58fa1eca3... |
81a92390-2e36-4d18-85b7-4efe5778fb01 | TobiasDault/Triangulation | PolygonTriangulation.h | //
// Created by <NAME> on 2/16/22.
//
#ifndef CODE_POLYGONTRIANGULATION_H
#define CODE_POLYGONTRIANGULATION_H
#include <QtWidgets>
#include <QApplication>
#include <QLabel>
#include <QString>
#include <QTranslator>
#include <cstdlib>
#include <vector>
#include "CGALComponents.h"
bool isClipable(const Polygon &P, s... | TOOL | 0.98883 | 6.538712 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-04-06T00:11: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": "4f5df48d467c... |
63cb856e-680f-4b9c-ab62-7fc712cb84a8 | jeff-muriuki/OOP-Assignment-one | index.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
class Book
{
private:
string title;
string author;
string bookNumber;
bool isAvailable;
public:
Book(string title, string author, string bookNumber)
: title(title), author(author), bookNumber... | TOOL | 0.99101 | 6.130205 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-05T19:59: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": "cb43c8518b28... |
86b14e3b-0faf-4f42-b81c-67a21c04a62e | AkiLotus/AkikazeCP | Vault/Codeforces Rounds/CFR555D3/CFR555D3E.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define y0 holdtheflower
#define y1 enjoythecolorandscent
#define yn walkthroughthesoulgarden
#define j1 feelthewarmbreathofkindnessandsalvation
#define endl '\n'
mt19937 rng32(chrono::steady_clock::now().time_since_epoch().count());
mt19937... | ALGO | 0.999995 | 3.883602 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2018-07-18T04:56:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a71e752d1... |
ce54a6f0-d49b-42a5-91fa-6c9458c1b1fd | tshrjn/EPI | 03 Arrays & Strings/03_14.cpp | #include "/Users/tshrjn/stdc++.h"
using namespace std;
bool is_valid_Sudoku(std::vector< std::vector<int> > &A)
{
//Check rows
for (int i = 0; i < A.size(); ++i)
{
std::vector<int> is_present(A.size() + 1, false);
for (int j = 0; j < A.size(); ++j)
{
if(A[i][j] != 0 && is_present[A[i][j]] == true)
retu... | ALGO | 0.989574 | 5.133112 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-02-26T16:17:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f5cf969a2... |
57a84195-9b0f-47d4-8093-1d8147cd0a6a | npow/LeetCode | RotateList/main.cc | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *rotateRight(ListNode *head, int k) {
if (!head) return NULL;
ListNode *h = head, *n = head;
int nu... | ALGO | 0.999993 | 5.919774 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2012-10-21T05:04: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": "ff7ffacda... |
018f8357-cc79-4a5c-98f1-84bbb5d771c1 | nns503/ProblemSolving_NS_CPP | 프로그래머스/2/159993. 미로 탈출/미로 탈출.cpp | #include <bits/stdc++.h>
#define Y first
#define X second
using namespace std;
int dy[4] = {-1, 1, 0, 0};
int dx[4] = {0, 0, -1, 1};
int maxY, maxX;
bool OOB(int y, int x){
return (y < 0 || x < 0 || y >= maxY || x >= maxX);
}
int solve(int stY, int stX, vector<string> &board, char target){
queue<pair<int, in... | ALGO | 0.999934 | 4.758915 | {
"github_metadata": {
"branch": "main",
"commit_count": 1067,
"repo_created_at": "2022-10-05T02:03:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f316bea6e... |
dfc7d264-b30d-4d9b-a27a-e03ebc6a30b3 | RaoufGhrissi/problem-solving | Competitions/Codeforces/Div 3/Codeforces Round 943 (Div. 3)/f.cpp | #include <bits/stdc++.h>
#define pp pair<int,int>
#define ll long long
#define inf 1e18
using namespace std;
void solve() {
freopen("a.txt", "r", stdin);
int t;
cin>>t;
while(t--) {
int n, q;
cin>>n>>q;
vector<int> v(n);
map<int,vector<int>> pos;
for (int i=0... | ALGO | 0.999957 | 4.353321 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-12-04T17:18:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "121f050310e... |
bec6852e-df0e-4b2c-93b7-d2567d82b468 | cqnkxy/LeetCode-Cpp | Russian Doll Envelopes.cpp | /*
You have a number of envelopes with widths and heights given as a pair of integers (w, h).
One envelope can fit into another if and only if both the width and height of one
envelope is greater than the width and height of the other envelope.
What is the maximum number of envelopes can you ... | ALGO | 0.999996 | 5.783812 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2015-11-21T09:12: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": "4465046a... |
de955939-aec2-491b-970b-76e7ad6f1aa9 | rsln-s/aggregative-coarsening-for-multilevel-hypergraph-partitioning | packages/fei/base/fei_Vector_Impl.hpp | /*--------------------------------------------------------------------*/
/* Copyright 2005 Sandia Corporation. */
/* Under the terms of Contract DE-AC04-94AL85000, there is a */
/* non-exclusive license for use of this work by or on behalf */
/* of the U.S. Government... | TOOL | 0.903556 | 6.4686 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-04-04T20:05:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4fde713766... |
327f02b1-c5ab-4d5d-90d5-294547cca42d | cheneymi/CS-Study | CS100/week8/primeringbetter/primeringbetter/primeringbetter.cpp | //
// primeRing.cpp
// tree
//
// Created by <NAME> on 02/03/2017.
// Copyright © 2017 <NAME>. All rights reserved.
//
#include <iostream>
#include "math.h"
using namespace std;
int isPrime(int n) { // 判断质数
if (n==1 || (n>2 && n%2==0)){
return 0;
} else if (n==2){
return 1;
}
f... | ALGO | 0.999898 | 4.260934 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-08-15T13:57: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": "9f014d1c8... |
5571b2a4-5395-4fc7-adbb-d29a7cf944fa | Seokwon-Park/BAEKJOON-BOJ | 백준/Platinum/6549. 히스토그램에서 가장 큰 직사각형/히스토그램에서 가장 큰 직사각형.cc | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int INF = 0x3f3f3f3f;
const ll MOD = 1000000007;
int treeHeight;
int treeSize;
ll MakeSegTree(vector<ll>& arr, vector<ll>& segTree,int node, int s... | ALGO | 0.999935 | 5.310336 | {
"github_metadata": {
"branch": "main",
"commit_count": 2927,
"repo_created_at": "2023-03-13T07:02:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50437c903... |
595a4ec3-cfa9-4ece-9f6c-c8685b57be5b | httpspedroh/aeds1 | C++/Listas/Lista 1/question07.cpp | #include <iostream>
#include <math.h>
#include <string.h>
#include <locale.h>
using namespace std;
// --------------------------------------------------------------------------------------------------------------------------- //
class Carro
{
int distancia;
float combustivel;
public:
Carro(int ... | TOOL | 0.91925 | 4.811671 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2023-03-08T19:48:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4fc2ba7ea5... |
c0a894da-408e-45d9-84f1-1b44df4558dc | JU4N98/competitive_programming | Simulaciones/2021-01-10/G.cpp | #include <bits/stdc++.h>
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define forn(i,n) forr(i,0,n)
#define dforn(i,n) for(int i=n-1;i>=0;i--)
#define forall(it,v) for(auto it=v.begin(); it!=v.end(); it++)
#define sz(c) ((int)c.size())
#define rsz resize
#define pb push_back
#define mp make_pair
#define lb lower_boun... | ALGO | 0.999829 | 3.22711 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2021-04-03T19:29: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": "c9f30344a... |
683de73c-1130-4aad-b8ac-02c6c035512a | YushaArif99/Semester-Projects | Data Structures/Assignments/Assignment 2/Q 2/A2.Q2.cpp | /*****************************************************
Code: <NAME>
ID: 18K-1289
Sec: B
Description: Breaks the numbers in the linked list
into digits. Uses exhaustive searching to find
all possible palindromes in the list of digits
Once found, stores the palindrome in a vector passed
as argument. Then continues to che... | ALGO | 0.999924 | 4.722872 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2022-03-15T02:52:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "db5285d215f... |
08e9e647-1f39-428c-913a-da81234c6d9e | naoyam/tapas | sample/exafmm-dev-13274dd4ac68/uniform/parallelfmm.h | #include "serialfmm.h"
class ParallelFMM : public SerialFMM {
private:
int EXTERNAL;
MPI_Request *requests;
#if PRINT_COMM
std::ofstream fid;
#endif
void gatherMultipoles() {
int i = getGlobKey(IX[gatherLevel],gatherLevel) + globLevelOffset[gatherLevel];
for_m sendMultipole[0][m] = globMultipole[i][m]... | ALGO | 0.980247 | 4.729597 | {
"github_metadata": {
"branch": "master",
"commit_count": 150,
"repo_created_at": "2014-07-10T06:51:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd5bdc5e... |
56d10cdb-7ef7-4bbf-8041-b6a33c31606b | ishandutta2007/codeforces-z | zoli9/normal/629/C.cpp | #include <bits/stdc++.h>
using namespace std;
long long n, m;
long long ossz1, ossz2;
int mindif, dif;
int kell1, kell2;
long long hany[2009][2009];
const long long MOD=1000000007;
long long ans=0;
string s;
int main()
{
for(long long i=0; i<=2005; i++)
{
hany[i][0]=1;
}
for(long long j=1; j<=20... | ALGO | 0.999987 | 3.753282 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "788516d087ca... |
b0b4fa89-cdfa-4ed5-a9b4-c97bef3963d9 | ishandutta2007/codeforces-g | gs12117/normal/913/C.cpp | #include<cstdio>
int n,m;
int c[100100];
long long int dp[100100][2];
int main() {
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) {
scanf("%d", &c[i]);
}
dp[0][0] = (m % 2)*c[0];
dp[0][1] = 2 * c[0];
for (int i = 1; i < 31; i++) {
dp[i][0] = dp[i - 1][0] + ((m >> i) % 2)*dp[i - 1][1];
if (i<n&&dp[i][0] ... | ALGO | 0.999962 | 3.236399 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55: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": "2628eb871656... |
5f384364-48c8-4cec-aecd-5d2b24489f8a | 5TEMIR/C-Archive | 13/structure_1.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
struct Hotel // структура отеля
{
string f, i, o;
int day, month, year;
int days;
};
bool vis(int y)
{ // високосный год
return ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0);
}
int EndOfMonth(int m, int y)
{ // конец месяц... | ALGO | 0.991374 | 3.646922 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2023-04-22T07:09: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": "42f216af770... |
403e91c0-3ce5-41ff-af47-afb2c1738023 | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p03736/s769400427.cpp | #include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const ll INF=1e15;
const int MAX_N... | ALGO | 0.999621 | 3.650165 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea56a8176e... |
18f452f8-4673-4c7c-9eb0-6cde781751d6 | raincross7/code-similarity | codes/train_code/problem192/problem192_250.cpp | #include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
const int64_t inf = 4e18 + 11;
signed main () {
int n, k;
cin >> n >> k;
vector < pair < int, int > > p(n);
vector < int > f(n), s(n);
for (int i = 0; i < n; ++i) {
cin >> p[i].x >> p[i].y;
f[i] = p[i].... | ALGO | 0.999915 | 4.375126 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c7ce4da513f... |
0ec4471c-73a1-4ed7-9d8c-a59daf59e415 | chetna205/DSA-BCA-II-File-Projects | array.cpp | #include <iostream>
using namespace std;
class Array {
public:
int numbers[100]; // Assuming a maximum of 100 elements
int size;
void setSize(int s) {
size = s;
}
void inputElements() {
cout << "Enter the elements of the array:\n";
for (int i = 0; i < size; i++) {
... | ALGO | 0.999747 | 5.23655 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-08-23T14:22: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": "7632d45cf4d6... |
308a37ff-54cf-42fb-8695-0f4b70e87019 | rajeevt09/AlgorithmsCode | sorting/part2/4billion.cpp | #include <vector>
#include <string>
using namespace std;
/*
// we need to find missing number in 4 Billion Integers
// we have 10 Mb of available memory
*/
// Available memory = 10 Mb
#define AVAIL_MEM 10 * 2^20
// divide the integers into blocks of Range size 4 Kb
#define RANGE_SIZE 4 * 2^10
int main()
{
cout ... | ALGO | 0.989661 | 3.210943 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-07-14T20:53: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": "64648933b9... |
d2bd77f2-06c3-407a-95da-02a72c1d5cc2 | aklk1ng/code | cpp/leetcode/938.二叉搜索树的范围和.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), right(right) {}
... | ALGO | 0.999994 | 6.468137 | {
"github_metadata": {
"branch": "main",
"commit_count": 495,
"repo_created_at": "2022-02-09T13:42: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": "16849a3967... |
f9ccf732-693b-45a7-8d7e-e3f4f57f9ea8 | wellwisher-dat/wishersource | [C++] Исходные коды/[C++] Вычисление составной функции с помощью функций.cpp | /* Составьте программу для вычисления составной функции:
s = { e(f(x)) } 1 < x*b < 10
{ sqrt(abs(f(x)+4*b)) } 10 <= x*b < 20
{ b*f(x)^2 } иначе
Должны быть использованы следующие функции:
• функция f выполняет запрос к пользователю и возвращает значение ex либо x2;
• функция one выполняет вычисление по первой ф... | ALGO | 0.984948 | 4.334792 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2015-10-31T15:29: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": "63a85b1ab... |
669cafaf-3ad6-4544-9caa-ce1dc9678166 | ishandutta2007/codeforces-o | orzdevinwang/normal/1575/K.cpp | //#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define L(i, j, k) for(int i = (j); i <= (k); ++i)
#define R(i, j, k) for(int i = (j); i >= (k); --i)
#define ll long long
#define vi vector <int>
#define sz(a) ((int) (a).size())
using namespace std;
const int N = 8e5 + 7, mod = 1e9 + 7;
int qpow (int x, ll y) {
... | ALGO | 0.999134 | 4.080142 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:45:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3b818326cf0... |
c5a88054-d30a-4317-8fcb-4b7b48d2574e | hyul77/Algorithm | 백준/Silver/9461. 파도반 수열/파도반 수열.cc | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <vector>
#include <cmath>
#include <stack>
#include <algorithm>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int T, X;
cin >> T;
... | ALGO | 0.999947 | 4.304412 | {
"github_metadata": {
"branch": "main",
"commit_count": 391,
"repo_created_at": "2024-01-04T07:57:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b60338b602... |
858dfb77-0155-4c2c-86b1-e0a9bc8fc1a2 | LeandraHall/Leandra-CPP-Projects | leandraHallExam2ProgrammingQuestion.cpp | //<NAME> 3/3/2022 SCIS-123-01
#include <iostream>
#include <iomanip>
using namespace std;
int main (){
//Variable declarations
const float tenPercent = 0.1, twentyPercent = 0.2, thirtyPercent = 0.3; //These are the discounts represented by contants
int roomNum, roomDays;
float roomCost, newRoomCost,... | TOOL | 0.916318 | 3.360214 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-03-12T23:28: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": "efed62ea72e... |
b2b59c62-cc29-4472-9fb5-39cc97a09e73 | BBDEngine/ChessEngine | src/square.h | #pragma once
#include "color.h"
#include <cassert>
#include <cstdint>
#include <iostream>
/*
We represent the board as an array of 64 values ranging from 0 to 63.
Each value represents a square on the board.
*/
namespace BBD
{
typedef int8_t Direction;
enum Directions : Direction
{
NORTH = 8,
SOUTH = -8,
... | ALGO | 0.928364 | 5.999096 | {
"github_metadata": {
"branch": "main",
"commit_count": 241,
"repo_created_at": "2025-02-18T13:29:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e65d9fd3a5c... |
ff1eb9c7-2370-4e7a-a471-a0b678e063b4 | Mhammedhelal/Problem-Solving-with-C- | ICPC Assiut University Community Sheets/Sheet #6 (Math - Geometry)/X. Rectangle.cpp | #include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;
struct point
{
double x;
double y;
};
double maximum(double a, double b, double c, double d)
{
return max(max(max(a, b), c), d);
}
double minimum(double a, double b, double c, double d)
{
return min(min(min(a, b), c), d);
}
int main()
... | ALGO | 0.999923 | 3.562395 | {
"github_metadata": {
"branch": "main",
"commit_count": 202,
"repo_created_at": "2023-02-07T17:44: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": "59ec9e39ee... |
37690abf-d570-4692-8ff7-7b82d62cb845 | kasselhingee/scorematchingad | inst/include/manifoldtransforms/manifold_Euc.hpp | #ifndef mantrans_manifold_Euc
#define mantrans_manifold_Euc
// code for various tools for the additive log ratio transform
#include <RcppEigen.h>
namespace mantran {//names space for manifold-transformation pair (triplets}
template <typename Type>
struct Euc : public manifold<Type> {
~Euc(){};
Euc(){};
std::stri... | ALGO | 0.901232 | 5.585458 | {
"github_metadata": {
"branch": "main",
"commit_count": 2154,
"repo_created_at": "2022-12-08T22:06: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": "a336e2225... |
b6196bd3-2494-4d37-af70-6e2573a5afd3 | BoringMarsh/Data-Structure-Course-Design | Project7/7_2151294_马威.h | #ifndef _MINHEAP_H_
#define _MINHEAP_H_
#include<iostream>
#include<stdlib.h>
using namespace std;
#define MINHEAP_DEFAULT_SIZE 20
template<class _class>
class MinHeap {
private:
_class* data;
int size;
int maxSize;
void siftDown(const int start, const int m);
void siftUp(const int start);
void siftAll();
pub... | ALGO | 0.949469 | 4.025584 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-09-12T01:08: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": "b032565eec70... |
5307f2fa-a754-4eec-8668-b48803ef053d | FazleRabbeBipul/CSES-Graph-Algorithms | Counting_Rooms.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define pii pair<int, int>
#define pll pair<long long int, long long int>
#define ALL(s)... | ALGO | 0.999814 | 5.417632 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-10-07T04:49:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b0fa0f631a... |
8834c4a4-bc58-4b5c-831d-2e74577e5ea7 | jaaguptamme/data-structures | Tree/Reroot.cpp | //source: https://codeforces.com/blog/entry/124286
#include "bits/stdc++.h"
using namespace std;
namespace reroot {
const auto exclusive = [](const auto& a, const auto& base, const auto& merge_into, int vertex) {
int n = (int)a.size();
using Aggregate = decay_t<decltype(base)>;
vector<Aggreg... | ALGO | 0.999899 | 4.373628 | {
"github_metadata": {
"branch": "main",
"commit_count": 197,
"repo_created_at": "2023-02-03T14:12: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": "b8eb64182f... |
78558ebc-3948-498d-afc6-5cd34307a936 | asadtab/Programiranje1 | 2D staticki nizovi/Zadatak 1.cpp | #include <iostream>
#include <iomanip>
using namespace std;
/*
Napisati program koji će omogučiti:
Unos 2D niza od 10 x 10 elemanata vodeći računa da su svi elementi dvocifreni (ukoliko unos nekog elementa ne zadovoljava uslov,
ponavljati unos tog elementa dok se ne zadovolji uslov); Koristiti funkciju unos
Izvršiti... | ALGO | 0.996387 | 4.887981 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2020-02-22T14:37: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": "1901c449... |
6bb65e90-4371-483f-948c-6b27918b4985 | nawngs/CompetitiveProgramming | hoc thay dong/d13chstr.cpp | #include <bits/stdc++.h>
#define name ""
#define ll long long
#define ld long double
#define fi first
#define se second
#define pll pair < ll, ll >
#define pii pair < int, int >
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define SZE(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#def... | ALGO | 0.999963 | 3.805954 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-06-19T07:51:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9dee6982de... |
36157a4a-ecba-47bc-8e2f-6eb646aa8532 | lmalano/Algoritmos | Algoritmos y Estructuras de Datos - Nazzi/Clase/Tercera Unidad/Conjunto (set) con bits.cpp | <pre><p>#include <cstdlib>
#include <iostream>
using namespace std;
const int N = 15;
//declarando la clase conjunto
class conjunto{
public:
conjunto(); //constructor
~conjunto(); //destuctor
void imprimir();
void ordenar();
bool pertenece(int x);
int cardinalidad();
voi... | ALGO | 0.998114 | 4.281205 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-08T20:20: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": "ba9df6a036... |
1b6345a8-c04e-4ef9-abe6-7a38aaac4804 | letrungkien211/Algorithms | Template/template - Copy.cpp |
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include <map>
#include <queue>
#include<unordered_set>
#include<unordered_map>
using namespace std;
class Solution {
public:
unordered_map<string,vector<vector<string>>> paths;
vector<vector<string>> getPaths(const string &start, const s... | ALGO | 0.999947 | 4.808042 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2014-02-09T12:31:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50949f412... |
7f0a0ac0-01a2-4bb1-af07-a9ee797d98a7 | simonnguyen175/cp-repo | training/anh_dung_day/9-22-2021/YUKIKASSEN.cpp | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define EPS 1e-9
using namespace std;
inline int cmp(double a, double b) {
return (a < b - EPS) ? -1 : ((a > b + EPS) ? 1 : 0);
}
struct Point{
int x, y;
Point() { x = y = 0; }
Point(int x, int y) : x(x), y(y) {}
Point operator + (... | ALGO | 0.999975 | 4.141542 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-11-16T14:21: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": "5a4c106db4... |
4c4ce2b0-98ec-4d9a-aa21-127c7db077e9 | gasduster99/theses | herbie/lockwood/aim_optimization/Lockwood/source/Bluebird/Streamline.h |
#ifndef STREAMLINE_H
#define STREAMLINE_H
#include "AbstractLayer.h"
#include "AbstractDomain.h"
#include "AnalysisLocation.h"
#include "Particle.h"
struct strcell{
double TOFa; //starting time of flight
double TOFb; //ending time of flight
double delTOF; //duration of TOF in cell
double v; //av... | ALGO | 0.974978 | 4.784425 | {
"github_metadata": {
"branch": "master",
"commit_count": 812,
"repo_created_at": "2019-10-25T22:31:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ee446cc... |
24f6d9ad-f9ee-4911-bc4d-d82db49f068c | kao027/cs124 | progset1/tests.cpp | #include <iostream>
#include <vector>
#include <cassert>
#include "mst.h"
using namespace std;
// Test inserting and extracting elements
void testInsertAndExtract() {
Heap heap;
heap.insert({5.0, 1});
heap.insert({3.0, 2});
heap.insert({8.0, 3});
assert(heap.extractMin() == (w_pair{3.0, 2}));
... | TEST | 0.97333 | 6.078256 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2025-02-15T20:11:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "286f619810f... |
8ccb1714-2378-4b04-81cb-8e3cfeab8a28 | yijunyu/demo | datasets/github_cpp_10/3/124.cpp | //#include "AVLTree.h"
//#ifndef __AVLTREE_H__
//#define __AVLTREE_H__
//#include <stdlib.h>
//#define MAX(a,b) ((a) > (b) ? (a) : (b))
///**//*
//*********************************************************************
//* CONFIG
//*********************************************************************
/... | ALGO | 0.995399 | 4.039942 | {
"github_metadata": {
"branch": "master",
"commit_count": 162,
"repo_created_at": "2019-03-16T07:13:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd31eafc... |
e0a0e1d1-264c-4157-bb51-bee23281cb50 | Quinny/Problem-of-the-Week | year2/week3/solution/week3.cpp | #include <iostream>
#include <unordered_set>
using Dictionary = std::unordered_set<std::string>;
bool is_valid(std::string letters, const Dictionary& d) {
if (letters.size() == 0)
return true;
std::string tmp;
for (std::size_t i = 0; i < letters.size(); ++i) {
tmp += letters[i];
i... | ALGO | 0.999743 | 4.706013 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2015-01-27T20:22:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e919845cd... |
329d6ba2-603e-45eb-bb53-171f9fe3e7bc | kimryungyo/ProblemSolving | 백준/Gold/2378. 불필요한 수/불필요한 수.cpp | #include <bits/stdc++.h>
using namespace std;
static map<long long, int> prime_factorization(long long x) {
map<long long, int> factors;
long long num = x;
long long d = 2;
while (d * d <= num) {
while (num % d == 0) {
factors[d]++;
num /= d;
}
d += (d ==... | ALGO | 0.999998 | 4.261528 | {
"github_metadata": {
"branch": "main",
"commit_count": 226,
"repo_created_at": "2024-10-28T05:04:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da472e5252... |
9cb92341-1a73-4814-b7ed-9be95ab16a8a | PremT0301/DLP | Practical-2.cpp | #include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
#include <algorithm>
using namespace std;
typedef unordered_map<char, int> Transition;
typedef unordered_map<int, Transition> TransitionTable;
int main() {
int numStates;
int initialState;
vector<int> acceptingStates;
... | ALGO | 0.999876 | 5.510371 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2025-01-01T07:56: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": "7c5e2db82e3... |
49b7d4f2-44ef-45ce-9d9c-fc5a7240721f | DennisCa-UNJBG/Calc-Matrices | 8-MGaussSeidel.cpp | #include <string>
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
class Matrices{
public:
Matrices(int filas, int columnas);
void rellenar();
void imprimir();
void metodoGaussSeidel();
void pivoteoMatriz(int filInit, int colInit);
bool EpsilonSeidel(double* oldSol,... | ALGO | 0.99949 | 4.547431 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-12-22T20:59: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": "a58bb214b1c8... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.