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 |
|---|---|---|---|---|---|---|---|
3a7c8daa-ab24-49b4-8fa0-22b7684c4c5b | rnishiura/atcoder | contests/296/c.cpp | /*
Author: rnishiura
Problem:
Date: 23-03-
Description:
*/
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(x, n) for(ll x=0; x<n; x++)
#define repi(x, a, b) for(ll x=a; x<b; x++)
#define rrep(x, n) for(ll x=n-1; x>=0; x--)
#define rrepi(x, a, b) for(ll x=b-1; x>=a; x--)
#define square(z) ((z)*(z... | ALGO | 0.999928 | 4.41417 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2022-05-14T15:03: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": "002d314acaa... |
28dd5916-37de-4206-9ed2-1d9e70b18189 | xwxing1229/LeetCode | Cpp/1616_split_two_strings_to_make_palindrome.cpp | // https://leetcode.cn/problems/split-two-strings-to-make-palindrome/
class Solution {
public:
bool checkPalindromeFormation(string a, string b) {
int n = a.size();
if (isPalindrome(a) || isPalindrome(b)) {
return true;
}
bool flag1 = true, flag2 = true;
for (int... | ALGO | 0.999935 | 6.260231 | {
"github_metadata": {
"branch": "main",
"commit_count": 677,
"repo_created_at": "2021-01-08T04:09: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": "5c12f6429b... |
4a505f88-5c90-471a-a62e-1cd24d3e6ec6 | wangyileipku/ACM | Google Code Jam/2012round2_B.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <utility>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#include <time.h>
#include <stdio.h>
#define FORST(X,S,T) for(int X=S; X<=T; X++)
#define RFORST(X,S,T) for(int X=S; X>=T; X--)
#define ... | ALGO | 0.999668 | 3.585828 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2013-06-11T00:08:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a9982d0ff... |
e40c03f0-5586-4b89-bba7-000d62dae2c4 | AyVeeKay/ScientificWork | Pandore/pandore/src/operatorsP0/frequency/pfftdeconvolution.cpp | /* -*- c-basic-offset: 3; mode: c++ -*-
*
* Copyright (c), GREYC.
* All rights reserved
*
* You may use this file under the terms of the BSD license as follows:
*
* "Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met... | ALGO | 0.922716 | 4.347633 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2018-12-13T12:43: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": "5381def80... |
dec47706-d9bf-4a4f-8785-b81b15a14139 | MiguelCigano/initial_cpp | Clases/data_member001.cpp | #include <iostream>
#include <chrono>
using namespace std;
class lazy_cahe {
public:
lazy_cahe() : has_approx_(false), approx_(0.0) {}
double lazy_operation() const
{
if (not has_approx_) {
approx_ = pi_as_double();
has_approx_ = tr... | ALGO | 0.999775 | 5.873373 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2022-10-24T13:18:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f03582552b7... |
0142e740-cc3c-4c18-8f78-fb5e95d2115c | ildyria/Arimaa | MCTS_array/src/tools/trees/Tree_shift.h | #pragma once
#include "../typedef.h"
#include <vector>
#include "../Timer.h"
#include "Tree_dump.h"
#include "Tree_index.h"
#include "../Count.h"
#include <iostream>
#include "Tree_integrity_check.h"
template<class N> class Tree
{
static u_long compacting;
// mark all nodes to be removed as not attributed (no pare... | ALGO | 0.933224 | 4.21527 | {
"github_metadata": {
"branch": "master",
"commit_count": 856,
"repo_created_at": "2014-09-17T16:17:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e61fd153... |
135a58d5-dffc-4040-b762-7e7612884dd3 | CedricVanhaverbeke/algo1 | theorie/8_containers/boom/BinBoom.h | #include <cassert>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <memory>
#include <queue>
#include <sstream>
#include <stack>
using namespace std;
template <class T>
class Binboom;
template <class T>
class Binknoop;
template <class T>
using Binknoopptr = std::unique_ptr<Binknoop<T>>;
templa... | ALGO | 0.981968 | 3.700399 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2019-02-24T11:49:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "785c6d246... |
a2ae4ddc-404c-4137-bd3e-b8f9eaf50540 | p-mazhnik/mipt-cpp | HomeWork/Dijkstra_inf_6.cpp | //
// Created by pavel on 19.11.2017.
//
#include <iostream>
#include <vector>
typedef std::vector<std::vector<int>> G_matrix;
void print(const std::vector<int> &parent, int StartVertex, int finishVertex) {
if(finishVertex == StartVertex){
std::cout << finishVertex + 1 << ' ';
return;
}
p... | ALGO | 0.999972 | 4.741624 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2017-02-27T20:58:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b80dd3faf... |
de9b9e9b-f8db-44fc-abc8-9d683b5326b3 | nicohusser/Google-Frequency-Doc | Source Files/Main.cpp | /*
* Main.cpp
*
* Created on: Jan 23, 2014
* Author: nicolas.husser
*/
#include "String_Operations.h"
#include "Math_Operations.h"
#include "File_Operations.h"
#include "Map_Operations.h"
#include <fstream>
#include <iostream>
#include <string>
#include <iomanip>
#include <vector>
#include <unordered_map>
... | TOOL | 0.983508 | 3.77215 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2014-02-05T02:19:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a73a9cc1... |
adbe7af4-0fee-47c8-8538-c224ffb094a1 | uma07/Histogram-Normalization | hist.cpp |
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
void image_histogram(Mat image, int histogram[])
{
//Initialize all intensity values to 0
for(int i = 0; i < 256; i++)
histogram[i] = 0;
//Calculate the no of pixels for each intensity values
... | ALGO | 0.995978 | 4.127194 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-03-19T06:39: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": "4a793081bf... |
0cbea44e-9c50-4fa7-a1bd-c7f9431d2b93 | CryptMatrix/ZKMath | src/emp-zk-math/ZKmath-functions.cpp | #include "emp-zk/emp-zk-math/ZKmath-functions.h"
void ZKPositiveDigDec(int party, IntFp *x, IntFp *y, uint64_t *digit_size, int num_digits, int dim) // x:dim;y:num_digits*dim; num_digits: the number of sigits,digit_size: the size of each digit
{
uint64_t curr_x = 0;
uint64_t ori_y = 0;
IntFp *sum_ydigits = new Int... | ALGO | 0.997182 | 3.965253 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-12-23T03:11:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07bede4ef0... |
1e756cb2-c999-4396-aa46-5e13131af25c | HarshBalwanix/AbdulBariSirCppDeepDiveCourse | 18 Exception Handling/10PracticeStudentExercise#13.cpp | /*
Create a class for Stack with Exceptions
1 StackOverflow
2 StackUnderflow
*/
#include<iostream>
using namespace std;
class StackOverflow:exception{};
class StackUnderflow:exception{};
class Stack
{
private:
int *stk;
int top=-1;
int size;
public:
Stack(int sz)
... | ALGO | 0.996979 | 4.41223 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-03-29T19:01: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": "2ce234db04e9... |
c265a035-9b2f-405e-8f2e-39ef378493a3 | benedictaquino/cpp-primer | ch03/src/ex3_45_2.cpp | /* This program prints the elements of a multidimensional array */
#include <iostream>
using std::cin; using std::cout; using std::endl;
int main()
{
// Initialize 2-dimensional array
int ia[3][4] = { // three elements; each element is an array of size 4
{0, 1, 2, 3}, // initializers for the ro... | TOOL | 0.984993 | 4.073064 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2018-10-22T13:27: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": "0de148c3... |
f4472740-44b2-4bdf-9127-58cb2c086b71 | lsh23/algorithm_exercise | coding_test/DFS_BFS/acm_5014.cpp | #include<bits/stdc++.h>
using namespace std;
int main(void){
int f,s,g,u,d;
cin >> f >> s >> g >> u >> d;
// 총 f 층
// 스타트링크는 g층
// 현재 위치 s층
// 위로 u층 만큼 이동
// 아래로 d층 만큼 이동
vector<int> visited(f+1,0);
visited[s] = 1;
int answer = -1;
queue<pair<int,int>> q;
q.push(make_p... | ALGO | 0.999531 | 3.704485 | {
"github_metadata": {
"branch": "master",
"commit_count": 200,
"repo_created_at": "2020-05-15T05: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": "c8ebc482... |
14fec21d-6801-4de2-8073-e285c9c73512 | mavenlin/cuda-convnet | thirdparty/thrust/system/cuda/detail/detail/launch_closure.inl | /*
* Copyright 2008-2012 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... | TOOL | 0.966233 | 7.525885 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2014-02-21T06:51:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 43,
"forks": 23,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ed4e65... |
19c8d986-1642-42fc-be98-2f4a71d44ff5 | Dhruv-bansal15/CP | Codeforces_beta_round#67/modified_gcd.cpp | #include<bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cst... | ALGO | 0.999833 | 3.618152 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2021-07-23T08:36: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": "1ef3dfa52f5... |
f00cf90b-b9cd-4f7e-8c0d-60ecd0554859 | leyicai/LeetCode-Solution | cpp/260_SingleNumberIII.cpp | class Solution {
public:
vector<int> singleNumber(vector<int>& nums) {
vector<int> res = {0, 0};
int diff = 0;
for (auto i : nums) {
diff ^= i;
}
diff &= -diff;
cout << diff << endl;
for (auto i : nums) {
if (i & diff) {
res[0] ^= i;
}
else {
res[1] ^= i;
}
}
return res;
}
};
... | ALGO | 0.999993 | 5.258167 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-08-25T14:40:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "818c973c0... |
8352d9f7-3cab-4c0d-b075-67c7e4fdcbd5 | diazf/indri | include/indri/JelinekMercerTermScoreFunction.hpp | /*==========================================================================
* Copyright (c) 2004 University of Massachusetts. All Rights Reserved.
*
* Use of the Lemur Toolkit for Language Modeling and Information Retrieval
* is subject to the terms of the software license set forth in the LICENSE
* file include... | ALGO | 0.985577 | 6.857685 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2018-04-08T12:28:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "54ccf034... |
495ec479-955d-4190-9124-cc6b912d8697 | biswajit-k/DSA | template/fenwic_bit_tree.cpp | #include<bits/stdc++.h>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/assoc_container.hpp>
#define llint long long int
#define all(v) v.begin(),v.end()
#define sz(x) (int)(x).size()
#define deb(x) cerr<<#x<<" is "<<x<<'\n';
#define boost std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
... | ALGO | 0.998949 | 3.721284 | {
"github_metadata": {
"branch": "main",
"commit_count": 501,
"repo_created_at": "2023-06-11T15:37: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": "0b2389ba87... |
c86adb0c-54e1-4656-84b7-07e2bf9364bd | hs05june/CP | cp_practice/contests/1739C.cpp | // ੴ ਵਾਹਿਗੁਰੂ
#include<bits/stdc++.h>
#define rp(i,a,n) for(int i=a;i<n;i++)
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define ll long long
#define int long long
#define deq deque<ll>
#define mii map<ll,ll>
#define pii pair<ll,ll>
#define pb push_back
#define f first
#define s second
#define lb(a,b,c) lower_b... | ALGO | 0.999808 | 4.540273 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-07-20T13:09: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": "890317f144e... |
ff632e3c-c387-4302-bd42-fd8376705f18 | lucasnell/sappp | src/math.cpp | #include <RcppArmadillo.h>
#include <cmath>
#include "sappp_types.h" // integer types
using namespace Rcpp;
// Logit and inverse logit
//[[Rcpp::export]]
arma::vec logit(arma::vec p) {
arma::vec out = arma::log(p / (1-p));
return out;
}
//[[Rcpp::export]]
arma::vec inv_logit(arma::vec a){
arma::vec out ... | ALGO | 0.99965 | 5.888315 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2017-08-20T21:00: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": "700bf579f... |
59d76dab-2ee0-441b-9257-350290100ef9 | wangli-cn/online-judge-libs | recursion/combination_sum.cc | //============================================================================
// Given a set of candidate numbers (C) and a target number (T),
// find all unique combinations in C where the candidate numbers sums to T.
//
// The same repeated number may be chosen from C unlimited number of times.
//
// Note:
// All nu... | ALGO | 0.999968 | 5.899866 | {
"github_metadata": {
"branch": "master",
"commit_count": 160,
"repo_created_at": "2015-05-06T14:36: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": "96f2be3f... |
2a52295b-6ff9-42bc-b6f5-2c72506353ab | ishandutta2007/codeforces-k | k21/normal/498/A.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define DEBUG(x) cerr << '>' << #x << ':' << (x) <... | ALGO | 0.999392 | 4.138667 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "e7b9ace524ec... |
6fcbf5eb-bfb0-49b4-8289-85a37b38c418 | ShubhamSinghRaghav/Competitive-Programming | Competitive Codes/Codechef/SnackDown 19/CHEFPRMS.cpp | #include <bits/stdc++.h>
using namespace std;
int checkSemiprime(int num)
{
if(!((double)(sqrt(num))-(int)sqrt(num))) return 0;
int cnt = 0;
for (int i = 2; cnt < 2 && i * i <= num; ++i)
while (num % i == 0)
num /= i, ++cnt;
if (num > 1)
++cnt;
return cnt == 2;... | ALGO | 0.999915 | 4.815619 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2018-09-19T12:10: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": "b416c1997... |
4b9860da-a88e-44d5-8f68-79aea624ff7c | LJFYC007/code | Prob/test10/std/hippocentaur/hippocentaur.cpp | /***************************************************************
File name: 1.cpp
Author: ljfcnyali
Create time: 2020年09月29日 星期二 19时37分04秒
***************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for ( int i = (a), _end_ = (b); i <= _end_; +... | ALGO | 0.999982 | 4.077441 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2018-08-02T05:42:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "54fea4c32... |
d72547da-1ae7-4dda-ad05-f42c11d6e2dc | tomasz-kapela/DMapProblem | include/capd/autodiff/EvalMul.h | /////////////////////////////////////////////////////////////////////////////
/// @file EvalMul.h
///
/// @author <NAME>
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2000-2017 by the CAPD Group.
//
// This file constitutes a part of the CAPD library,
// distributed und... | ALGO | 0.984945 | 6.243735 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-02-22T08:19: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": "3a39a273c35f... |
543d3b02-eaa5-4b97-b834-b9f911bd4175 | ashishtad/LeetCode | Reverse_wordsInString.cpp |
///////////////////////////////////////////////////////////////
// 151. Reverse Words in a String
// Solved on: 19/07/2020
//////////////////////////////////////////////////////////////
class Solution {
public:
string reverseWords(string s) {
string result="";
if( s.empty() )
ret... | ALGO | 0.999982 | 6.114738 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2020-05-02T11:36: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": "245cc8c8... |
cf04204a-7cb5-4596-95b7-635d50c54039 | erbaibhav/Open-Contributions | Cpp Codes/MedianOfTwoShortedArray.cpp | // Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.
// The overall run time complexity should be O(log (m+n)).
// Example 1:
// Input: nums1 = [1,3], nums2 = [2]
// Output: 2.00000
// Explanation: merged array = [1,2,3] and median is 2.
// Example 2... | ALGO | 0.999997 | 6.35311 | {
"github_metadata": {
"branch": "main",
"commit_count": 892,
"repo_created_at": "2021-09-30T13:56:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 123,
"issues": 0,
"pull_requests": 10
},
"file_meta": {
"content_id": "18b704... |
f9a3b3c5-c3b4-4be6-9e09-34fc8ffb905a | chiriacandrei25/The-Bible-of-Algorithms | Prime Numbers Factorization.cpp | #include <iostream>
using namespace std;
int f[100], expo[100], len;
void primeFact(int n) {
if(n == 1) {
len++;
f[len] = 2;
expo[len] = 0;
return;
}
int d = 2;
while(1LL * d * d <= n && n > 1) {
int k = 0;
while(n % d == 0) {
k++;
... | ALGO | 0.999369 | 4.037683 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2019-12-05T09:05:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 40,
"issues": 2,
"pull_requests": 4
},
"file_meta": {
"content_id": "a677ba9... |
224de154-3789-4b54-93d4-2238aab7c411 | heremaps/here-data-sdk-cpp | olp-cpp-sdk-core/include/olp/core/client/BackdownStrategy.h | /*
* Copyright (C) 2020-2022 HERE Europe B.V.
*
* 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 law... | ALGO | 0.981717 | 7.494153 | {
"github_metadata": {
"branch": "master",
"commit_count": 1428,
"repo_created_at": "2019-06-25T13:18:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 54,
"forks": 43,
"issues": 0,
"pull_requests": 17
},
"file_meta": {
"content_id": "9585b... |
054d7bed-0e98-4336-8c42-2e61fb14a9f4 | ldionne/mpl11 | include/boost/mpl11/detail/count_if/variadic_sizeof.hpp | /*!
* @file
* Defines `boost::mpl11::detail::count_if::variadic_sizeof`.
*
*
* @copyright <NAME> 2014
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE.md or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_MPL11_DETAIL_COUNT_IF_V... | TOOL | 0.908575 | 6.850473 | {
"github_metadata": {
"branch": "master",
"commit_count": 649,
"repo_created_at": "2012-09-08T15:21:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 114,
"forks": 10,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5b77... |
9b02d3cc-3186-47f3-b6f3-ca324b36fc9c | signife/Baekjoon | BasicAlgoLecture/5Stack/6549LargestRectangle/6549.cpp | #include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
while (true)
{
int n;
cin >> n;
if (n == 0)
break; // 입력의 마지막에는 0이 주어진다.
stack<pair<int, int>> s; // long long ... | ALGO | 0.999903 | 3.975267 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2023-04-05T04:47: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": "870077f513f... |
4e748aca-c2cc-46db-a0be-c9387af9c47f | magicfrog2009/code | leetcode/26.删除排序数组中的重复项.cpp | /*
* @lc app=leetcode.cn id=26 lang=cpp
*
* [26] 删除排序数组中的重复项
*
* https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/description/
*
* algorithms
* Easy (47.75%)
* Likes: 1270
* Dislikes: 0
* Total Accepted: 225.7K
* Total Submissions: 470.9K
* Testcase Example: '[1,1,2]'
*
* 给定一个排... | ALGO | 0.999912 | 5.87559 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-12-10T03:27: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": "e2150abba... |
1ac2e04f-d876-4065-b717-fa161a7e01c4 | CompPhysics/ComputationalPhysics | doc/Programs/LecturePrograms/programs/IntroProgramming/cpp/program4.cpp | // Program to calculate function exp(-x)
// using straightforward summation with differing precision
using namespace std;
#include <iostream>
#include <cmath>
// type float: 32 bits precision
// type double: 64 bits precision
#define TYPE double
#define PHASE(a) (1 - 2 * (abs(a) % 2))
#define TRUN... | ALGO | 0.999214 | 4.44949 | {
"github_metadata": {
"branch": "master",
"commit_count": 887,
"repo_created_at": "2016-01-04T09:01:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 390,
"forks": 137,
"issues": 2,
"pull_requests": 6
},
"file_meta": {
"content_id": "2642e... |
b74ba857-49c8-4f57-9431-ef0fb223707a | devgoel186/SIP-Prep-CPP | 13-Heaps/mergeKSortedArrays.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
vector<int> mergeKArrays(vector<vector<int>> &arr, int k)
{
vector<int> index(k, 0);
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> minheap;
for (int i = 0; i < k; i++)
{
minheap.push(make_pair(a... | ALGO | 0.999992 | 4.867143 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2021-06-11T09:13:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "93c81cdee5... |
44f78cc5-c913-4417-a266-11cf637f7f0d | TambePranav/Leetcode | Topological sort - GFG/topological-sort.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
bool dfs(vector<int> adj[],vector<bool>&vi,vector<int>&ans,int node)
{
vi[node]=1;
for(auto i:adj[node])
{
if(!vi[i])dfs(adj,vi,ans,i);
}
... | ALGO | 0.999976 | 6.612991 | {
"github_metadata": {
"branch": "main",
"commit_count": 442,
"repo_created_at": "2023-06-15T11:09: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": "5dc545bd4c... |
1e60fbcd-9d84-4466-b94c-4ab42da2bb88 | ashutosh210798/May-LeetCoding-Challenge-2020 | Day 18 - Permutation in String.cpp | class Solution {
public:
int arr[26][20110];
bool checkInclusion(string p, string s) {
if (p.length() > s.length()) {
return false;
}
map<char, int>m;
for (int i = 0; i < p.length(); i++)m[p[i]]++;
for (int i = 0; i < s.length(); i++) {
arr[s[i] - 'a'][i]++;
}
for (int i = 0; i < 26;... | ALGO | 0.999935 | 5.872018 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-05-08T09:35: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": "5e4e9996b... |
f2009566-25d3-4fed-83c6-19ba6f3c20e8 | jonathandpenha1/Msc.CA | OOPS/OOPS/employee.cpp | #include<iostream.h>
#include<conio.h>
class employee
{
public:
int ecode,salary;
char ename[20];
public:
void get()
{
cout<<"Enter employee details: "<<endl;
cin>>ecode>>ename;
}
};
class fulltime:public employee
{
public:
int dailywages,NoOfDays;
public:
void getf()
{
cout << "Enter fullt... | TOOL | 0.902416 | 3.571347 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-06-17T08:16: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": "cae12a9fb855... |
69036a8f-7c68-40f7-a898-05476ce30a04 | dune-community/dune-xt | dune/xt/grid/functors/refinement.hh | // This file is part of the dune-xt project:
// https://zivgitlab.uni-muenster.de/ag-ohlberger/dune-community/dune-xt
// Copyright 2009-2021 dune-xt developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
// or GPL-2.0+ (h... | ALGO | 0.95301 | 7.392822 | {
"github_metadata": {
"branch": "master",
"commit_count": 8210,
"repo_created_at": "2019-08-19T06:52:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "799b9c54... |
9ea22548-740a-4b6f-ba77-b461ae3eebba | mirtaba/ACMICPC-INOI_Archive | Olympiad Programs/Helli Programming Training/HelliNet day2F .cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>
#include <cmath>... | ALGO | 0.999989 | 3.343431 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-03-16T09:07:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a3e74b270... |
315a5d21-3f38-4831-a8f7-be0e62721926 | ShimuGuyue/AlgorithmPractice-Codes | Codeforces/比赛/Codeforces Round/Codeforces Round 995 (Div. 3)-DEFG/CF2051B.cpp | #include <iostream>
void Solve(void);
int main(void)
{
#ifdef Shimu_Guyue
freopen(".in.in" , "r", stdin );
freopen(".out.out", "w", stdout);
#define RUN_TIME \
std::clog << (clock() * 1.0 / CLOCKS_PER_SEC) * 1000 << " ms" << std::endl;
#else
#define RUN_TIME
#endif
std::ios::sync_with_stdio(false)... | ALGO | 0.999944 | 3.701465 | {
"github_metadata": {
"branch": "main",
"commit_count": 399,
"repo_created_at": "2024-11-05T08: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": "46da2f8a99... |
932f23dc-ebbe-4583-b714-f66b0a9a4246 | americano212/algorithm-solving-archive | 백준/Platinum/1893. 시저 암호/시저 암호.cc | #include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <map>
using namespace std;
int t;
vector<int> L;
vector<int> r;
string a, w, s;
void get_pi(string b) {
L.clear();
L.resize(b.length());
int j = 0;
for (int i = 1; i < b.length(); i++) {
... | ALGO | 0.999754 | 3.861786 | {
"github_metadata": {
"branch": "main",
"commit_count": 522,
"repo_created_at": "2022-04-09T17: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": "801bba5205... |
b917ac9d-37b1-42e6-8232-3ef0b35c542f | huevosverdes/RNGStudy | cpp/Ease.cpp | #include "Ease.h"
#ifndef M_PI
#define M_PI (3.14159265358979323846264338327950288)
#endif /* M_PI */
double Ease::ease(double t, EasingMethod method)
{
assert(0.0 <= t && t <= 1.0);
double result = 0.0;
switch(method)
{
case Ease::EasingMethod::QUAD_IN : result = Ease::quadIn(t); bre... | ALGO | 0.989262 | 6.047158 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2023-02-21T01:14: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": "0d322f2e9... |
dc5dc173-2af1-42b7-9102-22a547dc80d4 | NelsonGomesNeto/Competitive-Programming | Online Judges/Huxley/231SomandoÁrvores.cpp | #include <bits/stdc++.h>
#define lli long long int
using namespace std;
const int maxN = 1e5, inf = 1e9; int sum;
struct Tree
{
int value, left, right;
};
vector<Tree> tree; int t = 0;
char treeString[maxN]; int sat;
int numDigits(int num)
{
int sz = num <= 0;
while (num) num /= 10, sz ++;
return sz;
}
void... | ALGO | 0.999959 | 4.046188 | {
"github_metadata": {
"branch": "master",
"commit_count": 333,
"repo_created_at": "2019-08-07T17:50:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6eff533... |
d739e703-ed53-4e3c-a58f-a8d45539d13a | AJ-54/Coding-BLocks-CP-Solutions | NumberTheory/primality_test.cpp | #include<iostream>
#include<bits/stdc++.h>
#define ull unsigned long long
using namespace std;
ull mul(ull a, ull b, ull mod)
{
ull res = 0;
a %= mod;
while (b)
{
if (b & 1)
res = (res + a) % mod;
a = (2 * a) % mod;
b >>= 1;
}
return res;
... | ALGO | 0.999774 | 4.480107 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-09-17T14:46:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c47933414e... |
c9232136-b8e6-4400-9348-c0e20fa04929 | NirmalKAhirwar/leetcode | find-first-and-last-position-of-element-in-sorted-array/find-first-and-last-position-of-element-in-sorted-array.cpp | class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
int sp = 0;
int ep = nums.size()-1;
vector<int> ans{-1,-1};
while(sp <= ep)
{
int mid = (sp + ep)/2;
if(nums[mid] == target)
{
ans[0]= mid;
... | ALGO | 0.999898 | 6.302047 | {
"github_metadata": {
"branch": "master",
"commit_count": 480,
"repo_created_at": "2023-02-28T16:14:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc08dcd7... |
07581053-9c9d-4711-929f-6684c47bc3a6 | yitzman/EX3 | ex3_final_but_really/Parser.cpp | //
// Created by avi on 21/12/2019.
//
#include "Parser.h"
//constructor
Parser::Parser(vector<vector<string>> v) : m_vector(v) {}
//constructor for running a scope inside a program.
Parser::Parser(vector<vector<string>> v, unordered_map<string, DefineVarCommend *> map_var,
unordered_map<string, Defin... | TOOL | 0.979496 | 3.648763 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2019-12-12T08:26: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": "2c89837b0... |
e08669b9-a3ae-47d4-972c-8e06c930607e | CGAL/cgal | Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_unit_square.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Barycentric_coordinates_2/Delaunay_domain_2.h>
#include <CGAL/Barycentric_coordinates_2/Harmonic_coordinates_2.h>
using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
using FT = typename Kernel::FT;
using Point_2 = type... | TEST | 0.949193 | 5.614023 | {
"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... |
39840899-225b-4ac8-942a-80fa2fcae29e | greysonj92/Programming-Pearls-Solutions | 30bitsrand.cpp | #include<iostream>
#include<fstream>
#include<string>
#include<set>
#include<time.h>
using namespace std;
//supposed to generate 30 random bits, as opposed to the 15 that rand() generates
unsigned long bigrand() {
//generates empty array of size 30
int number[30];
for (int i = 0; i < 30; i++) {
number... | ALGO | 0.996665 | 3.792255 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-06-21T20:38: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": "518daf970b... |
ba2a12f2-15a3-4a46-aabd-1b794e648729 | ZzzYL9/Codes | 象棋/QtChess/movegenerator.cpp | #include "movegenerator.h"
#include "commdef.h"
#include <math.h>
#include <QDebug>
MoveGenerator::MoveGenerator()
{
}
MoveGenerator::~MoveGenerator()
{
}
bool MoveGenerator::validateMove(const char *arrChessman, int srcPos, int dstPos)
{
if (srcPos == dstPos)
{
return false;
}
int movingC... | ALGO | 0.990867 | 4.520498 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-04-15T13:30:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "356df8910... |
f3031e34-e9a4-4907-8831-f1f3691e39b8 | rahularya50/ioi_prep | misc/USACO/lilians_bad_code.cpp | #include <iostream>
#include <math.h>
#include <stdlib.h>
using namespace std;
int main(){
int N, score = 0;
double x, y, R;
cin >> N;
cin >> R;
for(int i = 0; i < N; ++i){
cin >> x;
cin >> y;
cout << "Received: " << x << " " << y << "\n";
double hi = sqrt(x * x + y... | ALGO | 0.999742 | 3.470751 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2018-05-31T13:52:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "702aa0cea... |
afeb7e8a-2d76-443a-b998-661c679fa6ee | sejalrai23/DSA-Practise | Possible paths between 2 vertices - GFG/possible-paths-between-2-vertices.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to count paths between two vertices in a directed graph.
int countPaths(int V, vector<int> adj[], int source, int destination) {
// Code here
queue<int> q;
... | ALGO | 0.999815 | 6.045823 | {
"github_metadata": {
"branch": "main",
"commit_count": 2811,
"repo_created_at": "2021-11-21T12:48:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90d2886de... |
acb188e0-6dca-4eb5-ac09-ee145453872a | cssartori/adalg | max_flow/src/main.cpp | /**
* Implementation of Ford Fulkerson's algorithm as Fattest Path augmenting path.
* Main function to solve the max-flow problem in stdin and return the value
* in stdout.
* <NAME> - 2017/1
* CMP588 - Advanced Algorithms, UFRGS, Prof. <NAME>
*/
#include <cstdio>
#include <chrono>
#include "../include/ffgraph.h... | ALGO | 0.999413 | 4.72364 | {
"github_metadata": {
"branch": "master",
"commit_count": 253,
"repo_created_at": "2019-03-22T14:45:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d65027ba... |
02ddb5d4-0e26-4b5d-94e8-93c8d77acc94 | gayathrisuresh150501/MyCodingPractice | conversion.cpp | #include<bits/stdc++.h>
using namespace std;
int binToDec(int n)
{
int twoPow = 1, decVal = 0;
while(n)
{
int rem = n % 10;
decVal += rem * twoPow;
twoPow *= 2;
n /= 10;
}
return decVal;
}
int octToDec(int n)
{
int octVal = 0, eightVal = 1;
while(n)
{
... | ALGO | 0.9988 | 4.106005 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-08-25T04:50: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": "fdd57c1f469e... |
d673f938-ead4-4edc-a2e8-9da751f361bd | wencakisa/elsys-oop | homeworks/second_term/01_turtle/sierpinski.hh | // -------------------------------------------
// NAME: <NAME>
// CLASS: XIa
// NUMBER: 4
// PROBLEM: #1
// FILE NAME: sierpinski.hh
// FILE PURPOSE:
// Definition of the Sierpinski curve
// implemented in ./sierpinski.cc
//
// This solution of the Sierpinski curve
// is based on the one in the book
// ... | ALGO | 0.992401 | 6.034353 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2017-09-21T18:32: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": "2275643eb... |
a1b9e3e7-fc64-4dc7-8645-9606c5f063e9 | MinkuruDev/Nov2022 | bdc/conf.cpp | #include <iostream>
#include <string>
#define MAXN 100
using namespace std;
char s[MAXN];
int cnt[26], cnt2[26];
bool checkPalin(int l, int r){
while (l < r){
if(s[l] != s[r])
return false;
l++; r--;
}
return true;
}
void resetCount(){
for(int i = 0; i<26; i++){
... | ALGO | 0.999993 | 3.554505 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-12-01T01:07: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": "8639c9229a... |
de786621-b228-416a-9688-43cb2f1eb3ba | CGAL/cgal | Spatial_searching/test/Spatial_searching/Distance.h | struct Distance {
typedef Point Point_d;
typedef Point Query_item;
typedef double FT;
double transformed_distance(const Point& p1, const Point& p2) const {
double distx= p1.x()-p2.x();
double disty= p1.y()-p2.y();
double distz= p1.z()-p2.z();
return distx*distx+disty*disty+distz*distz;
}
t... | ALGO | 0.999547 | 6.119649 | {
"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... |
c9a1425b-e61e-4a0c-8ad3-e0d262833338 | kav6778/leetcode | DSA/Bit Manipulation/AND Product.cpp | // https://www.hackerrank.com/challenges/and-product/problem
#include<iostream>
#include<bits/stdc++.h>
#define endl "\n"
#define ll long long
#define ld long double
using namespace std;
long first_equal_bit(long a, long b){
int sum =0, ans =0;
for(int i=0; i<32; i++){ // looping through eeach bit
int... | ALGO | 0.999918 | 4.800063 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2023-08-11T14:35: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": "54aba9d5053... |
08bce88d-0d5e-472b-bc0b-08fa6abbceea | Dudubraga/Competitive-Programming | SPOJ/maximum-subset-sum/maximum-subset-sum.cpp | #include <iostream>
using namespace std;
int main(){
int T, N;
cin >> T;
while(T--){
cin >> N;
int numbers[N];
int total = 0;
for(int i = 0; i < N; i++){
cin >> numbers[i];
total += numbers[i];
}
/* subset sum going forward */
... | ALGO | 0.999884 | 4.050858 | {
"github_metadata": {
"branch": "main",
"commit_count": 247,
"repo_created_at": "2023-03-28T18:56: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": "d0ee3c1523... |
342d69ab-da36-4f35-9da9-8f8fde33c782 | DimitrisGan/RecommendationCryptoSystem | Assignment.cpp | //
// Created by dimitrisgan on 16/11/2018.
//
#include "Assignment.h"
void ReverseAssignment::operator()(kClusters &allClusters , unordered_map<string , myVector> &in_umap , DistanceMetrics *dist) {
RevAssign(allClusters, in_umap, dist );
}
ReverseAssignment::ReverseAssignment(AbstractLshCube *myStructure_p... | ALGO | 0.991442 | 4.202709 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2018-12-27T16:28:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d54e63f1... |
e39e03f3-f22a-43bf-ae0f-55967a291722 | dhagarwa/ves3d-cxx0 | etc/CurvFlowMex.cc | #include "mex.h"
void CurvFlow(float* x,int vec_len,float ts,int m,float *x_final);
//Matlab syntax Xf = CurvFlow(X, ts, m);
void mexFunction(
int nlhs,
mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
{
if (nrhs != 3) {
mexErrMsgTxt("CurvFlowMex requires thre... | ALGO | 0.997775 | 4.839309 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-08-18T20:55:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a82ca7dd6... |
1321be6f-7062-485d-94d6-930d7f2402a9 | ncbi/sra-tools | tools/loaders/bam-loader/taskflow/cuda/algorithm/transform.hpp | #pragma once
#include "../cudaflow.hpp"
/**
@file taskflow/cuda/algorithm/transform.hpp
@brief cuda parallel-transform algorithms include file
*/
namespace tf {
// ----------------------------------------------------------------------------
// transform
// -----------------------------------------------------------... | TOOL | 0.998987 | 7.735888 | {
"github_metadata": {
"branch": "master",
"commit_count": 7459,
"repo_created_at": "2014-08-21T21:25:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1236,
"forks": 264,
"issues": 22,
"pull_requests": 5
},
"file_meta": {
"content_id": "0e... |
47ce5586-974b-47e4-bde5-3e418685b190 | Gopal1252/DP | Grid_Based/Maximum_sum_rectange.cpp | //this questiong is basically an extension of Kadane's algorithm
//https://www.geeksforgeeks.org/maximum-sum-rectangle-in-a-2d-matrix-dp-27/ {refer this to understand}
//https://hack.codingblocks.com/app/contests/1338/337/problem
//https://practice.geeksforgeeks.org/problems/maximum-sum-rectangle2948/1
//https://leetc... | ALGO | 0.999866 | 5.46521 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-08-31T19:01: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": "df5655b7bba... |
b102bdc3-2dfb-4374-8f91-f80255ec3a14 | nitinkedia7/competitive-coding | codeforces/round_457/binary_seq.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
unsigned long long n;
int k;
cin >> n >> k;
int m = 0;
vector<int> ret;
while(n) {
if (n&1) {
ret.push_back(1);
m+... | ALGO | 0.999996 | 3.76075 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-01-03T04:55: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": "8e83c2656... |
7a5eab74-51cc-4049-8afe-25be977366a3 | CodeCraftsman906/profile | FOCP - II Assignment 1/Q4.cpp | #include <iostream>
using namespace std;
void printSpiral(int n) {
int arr[n][n];
int value = 1;
int top = 0, bottom = n - 1, left = 0, right = n - 1;
while (top <= bottom && left <= right) {
// Fill the top row
for (int i = left; i <= right; i++) {
arr[top][i] = value++;
... | ALGO | 0.999443 | 5.695795 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2024-11-14T16:19: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": "f41438b5dd6... |
5dbdca0e-852d-4ddc-9372-8df51b90737c | TheFaisman/project-kestrel | Chapter_3/exercise_3_9.cpp | #include "../std_lib_facilities.h"
/*
Write a program that converts spelled-out numbers such as "zero" and "two"
into 0 and 2. When the user inputs a number, the program should output the
corresponding digit. For values 0, 1, 2, 3, and 4. Write NaN otherwise.
*/
int main() {
string input;
cout << ... | ALGO | 0.928443 | 5.288855 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2021-07-03T06:00: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": "ca335892a9... |
f5958dc4-8be7-49b3-b1e3-55e4b9522249 | ishandutta2007/codeforces-p | pavement/normal/1486/D.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
#define int long long
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define ppb pop_back... | ALGO | 0.999991 | 4.170248 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f929669de42... |
a94c40e2-a3e8-4162-982e-97684c42aec1 | cedar-framework/cedar | src/2d/gallery.cc | #include <cedar/2d/gallery.h>
namespace cedar { namespace cdr2 { namespace gallery {
using namespace cedar;
stencil_op<five_pt> poisson(len_t nx, len_t ny)
{
auto so = stencil_op<five_pt>(nx, ny);
so.set(0);
real_t hx = 1.0/(so.len(0)-1);
real_t hy = 1.0/(so.len(1)-1);
real_t xh = hy/hx;
real_t yh = hx/hy;
... | ALGO | 0.988622 | 5.948027 | {
"github_metadata": {
"branch": "main",
"commit_count": 555,
"repo_created_at": "2016-01-11T22:38:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13,
"forks": 3,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "179a0b068... |
5de851d7-309a-40f0-a2be-8c9b7bcfd399 | p-mazhnik/mipt-cpp | 1sem/Base_seminar/6_90/main.cpp | #include <iostream>
#include <stdlib.h>
#include <ctime>
#include <fstream>
#define long 11
using namespace std;
void rand_array(int *a, int n) // заполнение массива длины n случайными числами от 1 до long
{
srand(time(NULL));
for (int i = 0; i < n; ++i) {
a[i] = rand() % (long + 1);
};
}
void p... | ALGO | 0.999585 | 3.571493 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2017-02-27T20:58:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "227924eff... |
fa24e530-4887-4f05-bb48-12ec6a016e09 | sanjusss/leetcode-cpp | 0/0/70/71.cpp | /*
* @Author: sanjusss
* @Date: 2021-06-08 13:50:48
* @LastEditors: sanjusss
* @LastEditTime: 2021-06-08 14:35:07
* @FilePath: \0\0\70\71.cpp
*/
#include "leetcode.h"
// class Solution {
// public:
// string simplifyPath(string path) {
// string_view sv = path;
// string::size_type cur = 0;
/... | ALGO | 0.998104 | 5.574729 | {
"github_metadata": {
"branch": "master",
"commit_count": 2055,
"repo_created_at": "2019-04-04T03:17: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": "0e06d61... |
c646a597-5721-42ac-a037-2952b7d1c42f | ored95/cpp-student | 07 Working plan/test.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <chrono>
using namespace std;
using namespace std::chrono;
struct date {
int d, m, y;
};
// Source: https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week#Sakamoto's_methods
// By default: Sun - 0, Mon - 1, Tue - 2, Wed - 3, Thu - 4, Fr... | ALGO | 0.998773 | 4.318206 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2022-03-17T11:07:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60bc2b18757... |
67f7abca-58f7-4b5a-9c6e-275067fee643 | kuroni/purdue-icpc-training-2019 | PC2/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXV = 111, MAXE = 22222;
struct edge {int e, nxt;};
int V, E;
edge e[MAXE], er[MAXE];
int sp[MAXV], spr[MAXV];
int group_cnt, group_num[MAXV];
bool v[MAXV];
int stk[MAXV];
int cnt[MAXV];
int ans;
vector<string> langs[MAXV];
void fill_forward(int x) {
int i... | ALGO | 0.999691 | 3.701778 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2019-09-28T21:17:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bb2ee54e... |
bab46b36-ceda-4b5e-956e-b9ddba1abbf5 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1245/all/29612940_63997567.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define ff first
#define ss second
#define sz(vv) (int) vv.size()
#define all(a) a.begin(), a.end()
#define lb lower_bound
#define ub upper_bound
#define _ << " " <<
//#define int ll
int gcd(int a, int b) {
if (a == 0 |... | ALGO | 0.998571 | 4.701256 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40: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": "84f2a6a55... |
8aff9fd6-8419-49c5-a3e2-7048a6fb6374 | arthurherbout/crypto_code_detection | data/code-jam/files/186264_antimatter_171116_0_extracted_A.cc | #include <cstdio>
#include <vector>
#include <string>
#include <sstream>
using namespace std;
#define f fgets(buf,1000,stdin)
char buf[1000];
struct node {
double weight;
string feature;
node *l, *r;
int state;
} nodes[5000];
int ni = 0;
node* nodestack[1000];
int nsi = 0;
node* make() {
node* ret = nodes ... | ALGO | 0.983712 | 3.561368 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2019-09-20T18:35:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "97364db8... |
42df5f4c-d752-436b-9234-f3781b9d81f3 | 15831944/RealCadVS | source/Ncinters.h |
#define MAX_INTERSECTIONS 100
class Intersect
{private:
int n;
Entity *ints[MAX_INTERSECTIONS];
void intersect(Entity *,Entity *);
void LineLine(Line *,Line *);
void LineCircle(Line *,Circle *);
void LineEllipse(Line *,EllipseE *);
void LineCurve(Line *,Curve *);
void CircleC... | ALGO | 0.994043 | 4.650605 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-05-14T15:45:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f73d33720... |
48241768-0d83-4f6d-ab2c-7126a1217966 | steve-warlock/Project | admitere/TM/TM_2013/problema_3.cpp | //
// main.cpp
// Shokran
//
// Created by <NAME> on 16.02.2021.
//
#include <iostream>
#include <fstream>
#include <algorithm>
#include <queue>
#include <vector>
#include <cmath>
#include <cstring>
#include <utility>
#include <cassert>
#include <cstring>
#include <string>
#include <sstream>
#include <iomanip>
#inc... | ALGO | 0.999488 | 4.358625 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-10-21T11:51: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": "2838707947d5... |
0f85efab-e96e-47a8-9c33-d93c90c10222 | NagaNitishChowdary/GRAPHS | 56) ARTICULATION_POINT_IN_A_GRAPH.CPP | // PROBLEM LINK --- https://practice.geeksforgeeks.org/problems/articulation-point-1/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=articulation-point
#include<bits/stdc++.h>
using namespace std;
int timer = 0 ;
void dfs(int node,int parent,vector<int> &vis,int tin[],int low[],vector<int> ... | ALGO | 0.999795 | 5.677255 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2022-08-09T17:32: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": "edffc90f1a9... |
62a28c5f-4646-475d-ae92-6844faef68eb | phuid/adventofcode | 2020/day4/day4new.cpp | #include <iostream>
#include <regex>
#include <fstream>
#include <string>
#include <vector>
std::vector<std::string> inputvector;
std::vector<std::string> passvector;
std::regex regexes[]{
std::regex("(byr:((19[2-9][0-9])|(200[0-2])) )"),
std::regex("(iyr:(20((1[0-9])|(20))) )"),
std::regex("(eyr:(20((2[0... | ALGO | 0.97814 | 4.422745 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2021-12-09T20:17:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32f06d947... |
cd88a220-9180-4d52-8a1e-49dbc5aec86a | wltn716/algorithm_practice | programmers/binary-search/43236.cpp | // 출처: 프로그래머스 코딩 테스트 연습, https://programmers.co.kr/learn/challenges/43236
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
int solution(int distance, vector<int> rocks, int n) {
ll answer = 0;
sort(rocks.begin(), rocks.end());
ll st = 0;
ll ed =... | ALGO | 0.99997 | 5.40308 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2021-08-15T20:50: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": "eab9d9529... |
52f7687d-685c-4659-8667-d88de12c5b3a | luiz-berto/ed-tp2 | src/NonRecursiveQuickSort.cpp | #include "NonRecursiveQuickSort.hpp"
#include "Stack.hpp"
/*
* QuickSort clássico. A escolha do pivô é o elemento central.
*
* @param arr - vetor a ser ordenado.
* @param start - início do vetor.
* @param end - final do vetor.
* @param sd - objeto que contabiliza informações sobre a execução do algoritmo de ordenação
... | ALGO | 0.999808 | 6.432539 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2019-05-25T18:00: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": "c0bc0dee7... |
6e86b36e-e46c-4b99-960b-3aa5506adbd2 | milideva/MyCoding | DataStructures/BST/LCA_BST.c++ | #include <iostream>
#include <vector>
#include <climits>
#include <cstdlib>
#include <cmath>
#include <cfloat>
#include <iomanip>
using namespace std;
/*
235. Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST.
*... | ALGO | 0.999994 | 7.38314 | {
"github_metadata": {
"branch": "master",
"commit_count": 268,
"repo_created_at": "2020-06-16T14:51: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": "49340303... |
d99ed955-ff98-4a43-ad6e-de1c26527f7b | rtsoliday/elegant | src/poissonBuffer.cc | #include "poissonBuffer.h"
#include "poisson.h"
#include "manual.h"
void testFunc() {
return;
}
void poissonSolverWrapper(double **ion2dDensity, double **ionPotential, long N_x, long N_y,
double **xkick, double **ykick, double delta[2]) {
double x_max, y_max;
x_max = N_x * delta[0] /... | ALGO | 0.971485 | 4.295273 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2025-02-15T21:20:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd7b1ef3... |
1603c3a0-6df0-469d-a0fb-ead1070f6144 | FuadBinAkhter/UVA | UVA - 10179.cpp | #include<bits/stdc++.h>
using namespace std;
bool Check(int N,int pos){return (bool)(N & (1<<pos));}
int Set(int N,int pos){ return N=N | (1<<pos);}
int cnt=1;
int N=1000000,prime[1000000];
int status[(1000000/32)+10000];
void sieve()
{
int i, j;
int sqrtN;
sqrtN = int( sqrt(N));
for( i = 3; i <= s... | ALGO | 0.999986 | 4.233564 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-06-30T12:16: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": "cbf6855c7... |
f1d27343-dfbf-4723-8bc5-78c5c6d6f40e | quantmharsh/DSA-C- | Stack/sorting/trees/bst.cpp | #include<iostream>
#include<queue>
using namespace std;
class node{
public:
int data;
node*left;
node*right;
public:
node(int d)
{
this->data=d;
this->left=NULL;
this->right=NULL;
}
};
node * insertintotree( node* &root , int d)
{
//base case
if(... | ALGO | 0.99996 | 3.451298 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2023-02-11T06:36: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": "5528f3701e... |
70ee6cac-9ff1-43d3-abbd-719632345ca2 | KSP-07/LeetCode-Questions | 2466-count-ways-to-build-good-strings/2466-count-ways-to-build-good-strings.cpp | class Solution {
public:
int mod = 1e9 +7;
long long solve(int target , int zero , int one , vector<long long> &dp){
if(target == 0) return 1;
if(target <0) return 0;
if(dp[target] != -1) return dp[target];
return dp[target] = solve(target - one , zero , one, dp)%mod + solve(ta... | ALGO | 0.999845 | 5.488841 | {
"github_metadata": {
"branch": "main",
"commit_count": 1717,
"repo_created_at": "2023-01-10T10:07: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": "81d4ceaeb... |
2fc7a60d-0453-4bf2-8e02-fb5e09e6d757 | CHH3213/Books | 自动驾驶/视觉SLAM理论与实践--深蓝/课件及作业/L6/code/direct_method.cpp | #include <opencv2/opencv.hpp>
#include <sophus/se3.h>
#include <Eigen/Core>
#include <vector>
#include <string>
#include <boost/format.hpp>
#include <pangolin/pangolin.h>
using namespace std;
typedef vector<Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d>> VecVector2d;
// Camera intrinsics
// 内参
double fx ... | ALGO | 0.993242 | 5.691714 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2022-11-01T02:30:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 618,
"forks": 262,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e783... |
0e4101e1-f2c6-4aa4-8f5b-eb1bb5eef560 | Sameer-Mann/codes | cpp/data structures/segment_tree/weighted_subarray_sum.cpp | #include <bits/stdc++.h>
#define int long long int
using namespace std;
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {return os << "(" << P.first << "," << P.second << ")";}
template<class T> ostream& operator<<(ostream &os, vector<T> V) {for(auto v : V) os << v << " ";return os<<"";}
templa... | ALGO | 0.999915 | 5.181254 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2019-09-27T13:36: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": "f9296389a... |
e6816b46-3fec-429a-ac2e-f607302df7a5 | vanah313/2019_Spring_CSC_5 | labs/Lab 052319/MarkSort_DataBaseConcept_Index/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on May 23, 2019 10:05 AM
* Purpose: Database Concept -> using an Index
*/
//System Libraries Here
#include <iostream> //Input/Output Library
#include <cstdlib> //Random function
#include <ctime> //Time Library
using namespace std;
//User Libraries Here
//Gl... | ALGO | 0.999697 | 4.247966 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-05-21T19:06: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": "af3fa53c07... |
d6ca4558-83ed-41b4-8822-eceb46133867 | skygragon/Q.solution | leetcode/456.132-pattern.cpp | /*
* [456] 132 Pattern
*
* https://leetcode.com/problems/132-pattern
*
* Medium (28.20%)
* Total Accepted: 7295
* Total Submissions: 25900
* Testcase Example: '[1,2,3,4]'
*
*
* Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a
* subsequence ai, aj, ak such
* that i < j < k and ai < ak... | ALGO | 0.999968 | 6.083282 | {
"github_metadata": {
"branch": "master",
"commit_count": 522,
"repo_created_at": "2017-03-02T02:05:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47dd8e8... |
1e31d286-4dc3-41c5-8184-1c4c570d40a2 | tomerten/steibs | cpp/tests/src/origcodetest.cpp | #include <boost/math/tools/roots.hpp>
#include <ibs>
#include <ste>
//#include <boost/math/tools/roots.hpp>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
template <class T> struct synchronousPhaseFunctor {
synchronousPhaseFunctor(T con... | ALGO | 0.999134 | 4.241426 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2021-07-27T07: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": "6d94f71912b... |
3e7e237b-12ac-4bf8-bac9-c743f7d9e675 | thegamer1907/Code_Analysis | Codes/AC/3060.cpp | #include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<int> z_function(const char* s, int n) {
int l = 0, r = 0;
vector<int> z(n, 0);
for (int i = 1; i < n; ++i) {
if (i > r) r = i;
if (i == r || i + z[i - l] >= r) {
while (r < n && s[r] == s[r - i])... | ALGO | 0.999949 | 3.492123 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2019-05-24T10:35:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66c0f4446... |
cc174191-e307-46df-8ba1-98bcd931996e | cacophonix/SPOJ | MARTIAN.cpp | /*
USER: zobayer
TASK: MARTIAN
ALGO: dynamic programming
*/
#include <cstdio>
#include <algorithm>
using namespace std;
const int BUFF = 1 << 21;
int yeyenum[512][512], bloggium[512][512], maximum[512][512];
static char buff[BUFF], *ptr = buff;
#define nextint(n) n=0;while(*ptr<48)ptr++;do{n=n*10+*ptr++-48;}while(*... | ALGO | 0.998994 | 3.193203 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2012-11-13T17:07:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 92,
"forks": 101,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "c3c92a... |
a89b4b63-dbea-4b48-ac0f-900b553d7bc6 | rahulpinto19/design-analysis-and-algorithm | subsetsum.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
bool help(vector<int> v, int pos, int sum, vector<vector<int>> &dp, vector<int> &ans, int &final)
{
// cout<<sum<<endl;
if (sum == 0)
{
return 1;
}
if (pos >= v.size() || sum < 0)
return 0;
if (dp[pos][... | ALGO | 0.9994 | 3.899675 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-06-13T10:00: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": "80f3870c904... |
459d8d68-80a7-4d73-bc94-516b52b9a108 | Hamdi-Kaoubi/Programming-Advices-PSets | 08 - Algorithms & Problem-Solving Level 4/problem58-isoverlap-periods.cpp | #include <iostream>
using namespace std;
struct sDate
{
short Day;
short Month;
short Year;
};
struct sPeriod
{
sDate StartDate;
sDate EndDate;
};
short ReadYear()
{
short year;
cout << "Please enter a year : ";
cin >> year;
return year;
}
short ReadMonth()
{
short month;
co... | ALGO | 0.998351 | 4.019683 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2025-02-24T15:35:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "328f9889ac3... |
f560b795-74d0-493d-852a-e81bb4ce8944 | Sudhir769/LeetCode-Blind-75 | DAY16/Ques3/Solution.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
int n = grid.size();
int m = grid[0].size();
int vis[n][m];
int cntfresh=0;
queue<pair<pair<int, int>, int>>q;
for(int i=0;i<n;i++){
... | ALGO | 0.999889 | 5.150477 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2023-11-29T22: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": "66221f9b063... |
f50a856c-d001-438e-bf9e-cc9c4aa6979a | SkAravindh/GeomAlgo | codes/Geom_Support.h | #ifndef GEOM_SUPPORT_H
#define GEOM_SUPPORT_H
#include <algorithm>
#include "Vector_3.h"
#include "Mesh.h"
#define PI 3.14
typedef Vector_3<double> Vector3;
class Triangle; //fwd
class EdgeOrder; //fwd
Vector3 getNormal(const Triangle *t);
double getShortestDisPointToPlane( const Triangle *t, const Point *p) ;
Vecto... | ALGO | 0.97872 | 4.437168 | {
"github_metadata": {
"branch": "master",
"commit_count": 203,
"repo_created_at": "2020-12-14T21:40: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": "5e51745d... |
43fd5ea9-49d6-46e0-916d-bb89284aafae | dmehrab06/Time_wasters | codeforces/422/D2.cpp |
#include <bits/stdc++.h>
#define FREP(i,I,N) for(int (i)=(int)(I);(i)<=(int)(N);(i)++)
using namespace std;
int prime[5000004];
int smprime[5000004];
long long int fval[5000004];
long long int calc(int n, int MDD){
long long int ans = 0;
long long int per = smprime[n]; long long int tot = (long long int)n... | ALGO | 0.999942 | 4.866192 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-09-26T07:24: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": "a7b273bb6a... |
e06f7574-6028-4c26-ba60-72689df963f9 | HeroIsUseless/c | a7_3.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node *next;
};
class Queue {
private:
Node *head, *rear;
int size;
public:
Queue(){
size = 0;
head = rear = nullptr;
}
~Queue(){
while(head){
Node *pnode = head;
head = head->ne... | ALGO | 0.999931 | 4.06157 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2018-07-10T13:43:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5a5da97f... |
2fdc7d9c-af15-4484-999a-0612d6e792be | leiyang1985/code_for_quantum | ch4/ope.cpp | #include <stdio.h>
#include <math.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_spline.h>
#include <gsl/gsl_integration.h>
double psi2(double x,void *par)//求norm的积分函数
{
void **par_arr=(void **)par;
gsl_interp_accel *acc=(gsl_interp_accel *)(par_arr[0]);
gsl_spline *spline=(gsl_spline *)(par_arr[1]);
double p... | ALGO | 0.999861 | 3.402257 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2025-03-31T08: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": "5550ed467... |
1fab59e3-c6bb-431c-a3e1-dffa3586e4b6 | dkjkls/USV-ObstacleAvoidanceAlgorithm | algorithm/ParticleDO.h | #pragma once
#include "Pathpoint.h"
#include "USVDoc.h"
#include "USVView.h"
class ParticleDO
{
public:
ParticleDO();
~ParticleDO();
void set_BasicP_num(int m);
int get_BasicP_num()const;
void set_pathpoint();
bool calculate_ColREG(int num);//计算满足避碰规则的通行方向 true为左侧通行,FALSE为右侧通行
bool judge_PATH_effectivity();
f... | ALGO | 0.994489 | 4.190624 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-07-21T07:37:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 65,
"forks": 24,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f47226fc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.