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 |
|---|---|---|---|---|---|---|---|
272c1470-80d0-4a9c-af7d-40e2afa88691 | NayemAhmed02/Problem_Solving | Print a simple binary tree.cpp | #include<bits/stdc++.h>
using namespace std;
template <typename T>
class Treenode
{
public:
T data;
Treenode* left;
Treenode* right;
Treenode(T data)
{
this->data = data;
left = NULL;
right = NULL;
}
~Treenode()
{
delete left;
delete right;
... | ALGO | 0.998987 | 4.235576 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2022-09-11T20:30:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "870b86db1f7... |
800e025e-f103-4301-9afa-e89c0bcf63bc | audemard/minicdcl | core/Dimacs.h | #ifndef Minisat_Dimacs_h
#define Minisat_Dimacs_h
#include <stdio.h>
#include "utils/ParseUtils.h"
#include "core/SolverTypes.h"
namespace CDCL {
//=================================================================================================
// DIMACS Parser:
template<class B, class Solver>
static void readCla... | ALGO | 0.968317 | 5.858194 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-07-02T21:00:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9276d456e... |
8fbce174-6df5-4b27-b6ad-f9293ac0a9e8 | google/graph-mining | in_memory/clustering/in_memory_clusterer.cc | // Copyright 2023 Google LLC
//
// 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 or agreed to in w... | ALGO | 0.979019 | 7.343491 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-07-26T01:37:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 679,
"forks": 37,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "2e7955627... |
2b53aa00-4d07-4acc-8e06-9f5a50f51cd1 | Ninjaclasher/Competitive-Programming | COCI/coci07c3p5.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<long long>> dp(16, vector<long long>(140, -1));
vector<long long> po10(17, 1);
long long a, b, s, mmi = -1;
long long next(long long pre, long long dig, long long sum)
{
if (sum < 0) return 0;
long long mi = pre, ma = pre + po10[dig]-1;
if (mi >... | ALGO | 0.99948 | 3.792229 | {
"github_metadata": {
"branch": "master",
"commit_count": 218,
"repo_created_at": "2018-07-09T14:51:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a20fd15... |
fb09a191-7709-4648-b700-122e1683891f | will-leeson/esbmc | src/esbmc/bmc.h | /*******************************************************************\
Module: Bounded Model Checking for ANSI-C + HDL
Author: <NAME>, <EMAIL>
\*******************************************************************/
#ifndef CPROVER_CBMC_BMC_H
#define CPROVER_CBMC_BMC_H
#include <goto-symex/reachability_tree.h>
#includ... | ALGO | 0.993761 | 6.300368 | {
"github_metadata": {
"branch": "master",
"commit_count": 18970,
"repo_created_at": "2022-05-17T19:36:09.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "esbmc/esbmc",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id":... |
b9e60f1e-5aec-4ddd-a36c-07ca314da3a8 | KatsuyaKikuchi/ProgrammingContest | AtCoder/Virtual/20200217/030.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)
const ll MOD = 1000000007;
const ll INF = (ll) 1e15;
struct RootedTree {
RootedTree(int n, int roo... | ALGO | 0.999976 | 4.330691 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2020-12-04T21:42: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": "7434af93a... |
75ed9343-65ed-42f4-b170-5d6c16a211a0 | TosakaUCW/CompetitiveProgramming | Codeforces/Contest/Div2 919 1920/[Codeforces 1920B] Summation Game.cpp | #include <stdio.h>
#include <string>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue>
#include <set>
#include <map>
int read(int x = 0, int f = 0, char ch = getchar())
{
while (ch < 48 or 57 < ch) f = ch == 45, ch = getchar();
while(48 <= ch and ch <= 57) x = x * 1... | ALGO | 0.999628 | 4.488483 | {
"github_metadata": {
"branch": "master",
"commit_count": 506,
"repo_created_at": "2018-09-23T04:02:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a04ee81... |
f68a7e7e-3cee-404f-9335-6ec23871256f | kutiny/palabras | old_files/quick.cpp | // metodo de ordenamiento Quick Sort y Merge Sort
#include <cstdlib>
#include <iostream>
using namespace std;
void ordenaQS(int v[], int primero, int ultimo);
int ordenaMS(int a[], int low, int high);
int merge(int a[], int low, int high, int mid);
void impre(int v[], int n);
int main(int argc, char *argv[])
{ int... | ALGO | 0.999951 | 5.035098 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2018-06-01T21:47:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84f3710f9... |
75f6924a-d1b7-4520-b1da-db4e2eb759f5 | cyph3rms1n/CP-Sheet-31 | R-800/CF_1900_A.cpp | // codeforces.com/problemset/problem/1900/A
// Cover in Water
/**
* Author: k7
**/
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = LLONG_MAX >> 1;
// Utility Functions
inline void fast_io() {
ios::sync_wit... | ALGO | 0.999686 | 4.283536 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2025-03-27T18:54:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52a127d40f1... |
870cad9b-576a-4ec1-93f7-f37893ec0a2d | NVIDIA/tensorflow | tensorflow/lite/delegates/gpu/cl/kernels/work_group_picking.cc | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | ALGO | 0.950107 | 6.840985 | {
"github_metadata": {
"branch": "r1.15.5+nv23.03",
"commit_count": 64202,
"repo_created_at": "2020-05-13T21:34:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1146,
"forks": 178,
"issues": 41,
"pull_requests": 9
},
"file_meta": {
"conten... |
ab3ea9dc-b2fd-4445-b8a5-a198cfac8d0f | kririae/Learning | Algorithms/最终集训/51nod 1833 - 神之dp.cpp | /*
简单环的定义是啥?
或者说,“简单环”能够造成什么限制?
——只算环上的边,每个点的出度和入度都为1
题目转化为以下形式,从G = (V, E)中选取n条边,使得每个点的出度和入度都是1
dp方式如下 f[i][S]表示前i个点都有出边,S的点有了入边,的情况的个数
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 20;
int n, m, a[N + 1][N + 1], f[N + 1][(1 << N) + 5];
int main() {
scanf("%d%d", &n, &m);
for (int i = 1, x, y; i... | ALGO | 0.999979 | 4.35101 | {
"github_metadata": {
"branch": "master",
"commit_count": 829,
"repo_created_at": "2017-06-21T14:30:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 18,
"pull_requests": 1
},
"file_meta": {
"content_id": "3ffbc86... |
27dfb587-dd7b-4b68-80d3-c9d44f665e96 | shaikin5130203/Homework | Homework_2/Task_3.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main(){
int n, z, i;
double x, lt;
long double result;
cout << "Enter the number of progression terms: "<< endl;
cin>>n;
cout << "Choose the option: " << endl;
cout <<"-----------------------------------------" << endl;
cout <<"1- e^x... | ALGO | 0.999286 | 3.793891 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-09-17T16:20: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": "216a4a21d36b... |
5ba0257d-17b2-4621-abdf-cf63c1e9d0f8 | gaditi123/task_scheduling_algorithms | scheduing algorithms/rr.h | #ifndef RR_H
#define RR_H
#include "./main.h"
#include <bits/stdc++.h>
using namespace std;
void rr_function(vector<Process> processes, int numberOfProcesses, int timeQuantum)
{
cout << "\n\t*** Round Robin ***\n";
int processesCompleted = 0, currentTime = 0;
vector<bool> alreadyInQueue(numberOfProces... | ALGO | 0.99906 | 4.398194 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2021-11-01T06:08: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": "7dacd50ded5... |
1849531f-c0c7-491f-9e71-7770f55b6316 | adarsh200496/Particle-Simulation | openmp/main.cc | #include <iostream>
#include <chrono>
#include <cmath>
#include <cstddef>
#include <cstdlib>
#include "state.h"
#include "timestep.h"
using namespace state;
using namespace timestep;
static void parse_args(int argc, char **argv, size_t &n_charges_per_dir, size_t &n_steps, std::string &precision)
{
if (argc < 3 || a... | ALGO | 0.998811 | 5.342209 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2021-09-28T13:49: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": "3d816e55e... |
31a35e6e-4e61-48bf-8468-492d7f9dac2e | Andrei0872/Algorithms | C++/DP/zigzag-sum.cpp |
/**
*
* Given a matrix of N x N, determine the sum of the zigzag sequence with the largest sum
* A zizgag sequence statrs from the top and ends at the bottom
* Two consecutive elements of a sequence cannot belong to the same column
*
*/
/*
Example
4 2 1
3 9 6
11 3 15
Output : 28 (4 + 9 + 15)
*/
#include ... | ALGO | 0.999993 | 4.938274 | {
"github_metadata": {
"branch": "master",
"commit_count": 350,
"repo_created_at": "2018-07-06T16:00:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2784ff2... |
2eec6048-95d0-4687-82b6-55c6c56cae87 | ishandutta2007/codeforces-a | alexandr_ts/normal/498/A.cpp | #include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, n) for (int i = a; i < b; i++)
using namespace std;
typedef long long ll;
const ll N = 1e5;
struct pt {
ll x, y;
};// a[N];
int main() {
pt st, en;
cin >> st.x >> st.y >> en.x >> en.y;
ll cnt = 0, n;
cin >> n;... | ALGO | 0.999573 | 4.140287 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "27206c0a7dba... |
4003c6d0-e7f3-4cda-93c8-22905b951a34 | usgs-coupled/phast3 | src/phastinput/KDtree/KDtree.cpp | // This is the main DLL file.
#include <boost/multi_array.hpp>
#include "KDtree.h"
using namespace boost;
// Note: No header files should follow the next three lines
#if defined(_WIN32) && defined(_DEBUG)
#define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
// static
std::list < KDtree * >KDtree::KDtreeList;
KD... | ALGO | 0.946321 | 5.643994 | {
"github_metadata": {
"branch": "master",
"commit_count": 6600,
"repo_created_at": "2021-10-05T00:02:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4721c83... |
d9b61734-1b82-42a9-9242-f6bc148c413f | Shivam8105/Learning-DSA | Arrays and Vectors/moveNegatives.cpp | #include <iostream>
#include <vector>
using namespace std;
void moveNegatives(vector<int> &v) {
int n = v.size();
for (int i = 1; i < n; ++i) {
if (v[i] < 0) {
int temp = v[i];
int j = i - 1;
// Shift all non-negative elements right
while (j >= 0 && v[j] ... | ALGO | 0.999994 | 4.996595 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2025-07-15T18:09:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf47f846def... |
de0aef10-3818-4e44-9d27-d498409f379e | gusah009/Algorithm | 2020-1/200322/Plates.cpp | #include <iostream>
#include <algorithm>
#define INF 987654321;
using namespace std;
#define endl "\n"
#define MAX 51
using namespace std;
int Arr[MAX];
int Select[MAX];
int T, N, K, P;
int plates[51][31];
int maxim = 0;
bool check = false;
void DFS(int Cnt, int tot)
{
if (Cnt == N)
{
int sum = 0;
for... | ALGO | 0.999889 | 4.57482 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2021-04-14T02:49:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "506bd2b7b4... |
169c3d91-5da0-4859-abb3-75f4bc88c68d | Luinesse/Algorithm_Study | 6week/p14889.cpp | #include <iostream>
#include <vector>
using namespace std;
int n;
int score[20][20];
bool check[20];
int minValue = 99999;
void team(int idx, int cnt) {
vector<int> start;
vector<int> link;
int stScore = 0;
int liScore = 0;
if(cnt == (n / 2)) {
for(int i = 0; i < n; i++) {
if(... | ALGO | 0.999991 | 4.197063 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-06-30T04:41: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": "8cb9ae9d60b... |
f3df9847-d404-4fde-a1f1-2626ddd43016 | kazunetakahashi/atcoder | 2019/0216_ABC118/D2.cpp | #define DEBUG 1
/**
* File : D2.cpp
* Author : <NAME>
* Created : 2/16/2019, 10:46:37 PM
* Powered by Visual Studio Code
*/
#include <iostream>
#include <iomanip> // << fixed << setprecision(xxx)
#include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ;
#include <vector>
#include <string> // to... | ALGO | 0.999971 | 3.461247 | {
"github_metadata": {
"branch": "master",
"commit_count": 5889,
"repo_created_at": "2014-11-15T16:16:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6fbc4a... |
b39fecd6-3b23-49e5-916b-9925f34682ea | rahul17081998/Data-Structure | code_cpp/self pased DSA/Dynamic Programming/17_coin_change_problem_recursion.cpp | #include<bits/stdc++.h>
using namespace std;
// recursive solution
int getMin(int coins[], int n, int val)
{
if(val==0) return 0;
int res = INT_MAX;
for (int i = 0; i < n; i++)
{ if(coins[i] <= val)
{
int sub_res = getMin(coins, n, val-coins[i]);
if(sub_res!=INT_M... | ALGO | 0.999909 | 5.279095 | {
"github_metadata": {
"branch": "main",
"commit_count": 132,
"repo_created_at": "2022-08-03T12:52: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": "039b577883... |
b93dbdbc-a793-4aaf-946e-8a42d5d98b13 | Tora416/MultiCodeEmbed | dataset/dataset_raw/gcj_cpp/abhisheksaini/3264486_5736519012712448_abhisheksaini.cpp | #include <bits/stdc++.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
long long mod = 1e9 + 7;
long long INF = 1e7;
double EPS = 1e-12;
typedef long long int lld;
typedef pair<lld, lld> PA;
lld powP(lld a, lld b) {
if (b == 0)
return 1 % mod;
lld k;
k = powP(a, b / 2);
k = k * k % mod;
if ... | ALGO | 0.99961 | 3.874136 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2025-07-10T08:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a52b5bf74... |
124b6a11-af32-499b-9693-a0e169cbff32 | famousghost/MySolutionForDelegates | Delegates.h | #include <iostream>
#include <memory>
#include <vector>
template<typename Func>
struct Function
{
};
template<typename RetType, typename... Args>
struct Function<RetType(Args...)>
{
public:
using ReturnType = RetType;
template<typename F>
Function(F f, const std::string& p_name, size_t p_typeAddress, si... | TOOL | 0.909276 | 5.496133 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2023-12-21T09:43: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": "5456e3ed1... |
b352167a-3f6f-427f-a80d-7879252dadb9 | facebookresearch/faiss | faiss/cppcontrib/sa_decode/PQ-inl.h | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#ifndef PQ_INL_H
#define PQ_INL_H
#include <cstddef>
#include <cstdint>
namespace faiss {
namespace cppcontrib {
/////////////... | ALGO | 0.982821 | 6.998158 | {
"github_metadata": {
"branch": "main",
"commit_count": 1500,
"repo_created_at": "2017-02-07T16:07:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 36174,
"forks": 3965,
"issues": 228,
"pull_requests": 47
},
"file_meta": {
"content_id": "... |
f7c338db-2d87-4998-9f91-80db1351f3ab | sonir/boids | src/floy.h | #ifndef floy_H
#define floy_H
#include "ofMain.h"
// C style 80s :)
typedef struct{
int count;
ofVec2f sum;
float distance;
float strength;
} flockingForce;
// C++ style 90s :)
/*
class flockingForce {
public:
int count;
ofVec2f sum;
float distance;
float strength;
};
*/
class floy{
publ... | ALGO | 0.987503 | 4.802568 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-04-11T23:28: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": "df7d5b3d94... |
54a3b2fc-0f99-4378-a8c0-6fb6df71f364 | ren2504413601/Data-Structure-and-Algorithm | FIFO分支限界法(旅行商问题)/Travel.cpp | /*旅行商问题分支限界法求解*/
#include<iostream>
#include<cstring> //'memset' is defined in header <cstring>
using namespace std;
const int NoEdge = -1;
const int MAX = 20;
int G[MAX][MAX];
int ans[MAX], x[MAX];
int bestc, cc;
void init(int n)
{
int i, j, len;
memset(G, NoEdge, sizeof(G));
while (cin >> i >> j)
{
if (i == 0 &... | ALGO | 0.999972 | 3.67361 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-04-10T14:22:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51ef4b3114... |
89398ad7-5fb2-44b2-9b99-5655e5df99ad | zukun/rcc | libpmk-2.5/libpmk2/pyramids/pyramid-matcher.cc | // Copyright 2007, Massachusetts Institute of Technology.
// The use of this code is permitted for research only. There is
// absolutely no warranty for this software.
//
// Author: <NAME> (<EMAIL>)
//
#include <assert.h>
#include <math.h>
#include <memory>
#include "util/bin-weight-scheme.h"
#include "pyramids/pyrami... | ALGO | 0.986502 | 6.346824 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2013-02-21T15:10:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f08ea8... |
29bd820e-a9d1-4f76-a044-616bfaf4f3d3 | natanalmeida03/competitive-programming | vjudge/lista_2/vjudge_Consecutive_Integers/main.cpp | #include <iostream>
using namespace std;
int main()
{
int n = 0, x, verif, j = 0, auxnum = 0, tam;
string s="", auxstr = "";
while(n!=-1)
{
int *dif;
string *seq;
cin>>n;
if(n == -1){
exit(0);
}
dif = new int[n+1];
seq = new st... | ALGO | 0.997421 | 3.741752 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2023-04-12T21:35:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20774d37ebb... |
fa737ffe-703b-48b3-82be-71dbb64185d4 | Ahmed-0sama/CP-Library | G. Generating sorted subsequences/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
#define int long long
#define endl '\n'
void printSubsequences(const vector<int>& seq) {
for (int num : seq) {
cout << num << " ";
}
cout << endl;
}
void generateSubsequences(vector<int>& arr, vector<in... | ALGO | 0.99999 | 6.174175 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-07-04T09:08: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": "c5ae02d4d3d... |
6ece91f6-bba7-4a3e-858c-8d3845de2a1c | sxyugao/Codes | Luogu/P2713/P2713.cpp | #include <cstdio>
#include <iostream>
using namespace std;
#define gc c = getchar()
int read(){
int x = 0, f = 1; char gc;
for(; !isdigit(c); gc) if(c == '-') f = -1;
for(; isdigit(c); gc) x = x * 10 + c - '0';
return x * f;
}
#undef gc
const int MAXN = 1000005;
int heap[MAXN], lson[MAXN], rson[MAXN];
int d[MAXN], ... | ALGO | 0.999978 | 3.45468 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2018-09-16T12:55:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "54268299... |
c3ae0554-d0e3-4e59-a56c-51fdaf4dde33 | wiuiu/myleetcode | lc/lc350.cpp | #include "lc.h"
// 看了题解 350.leetcode
vector<int> intersect(vector<int> &nums1, vector<int> &nums2)
{
unordered_map<int, int> nums1_count;
for (const auto &num : nums1)
{
++nums1_count[num];
}
vector<int> result;
for (const auto &num : nums2)
{
if (nums1_count.find(num) != n... | ALGO | 0.999985 | 5.530306 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-07-08T09:05:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a517f888ad... |
257c6240-a7a5-4b1c-8811-33074a31eb80 | PetersResearchGroup/PCND | hoomd/md/CosineSqAngleForceCompute.h | // Copyright (c) 2009-2016 The Regents of the University of Michigan
// This file is part of the HOOMD-blue project, released under the BSD 3-Clause License.
#include "hoomd/ForceCompute.h"
#include "hoomd/BondedGroupData.h"
#include <memory>
#include <vector>
/*! \file CosineSqAngleForceCompute.h
\brief Decla... | TOOL | 0.957645 | 6.912744 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-03-19T20:16: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": "6830d41e64... |
4d54f4c7-f896-4117-9060-3c6a2f24077d | ishandutta2007/codeforces-i | ichyo/normal/406/C.cpp | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
using namespace std;
typedef vector<int> Node;
typedef vector<Node> Graph;
Graph G;
Graph R;
Graph UG;
int size;
int pa[100010];
int pb[100010];
int pc[100010];
bool used[100010];
void insert(int a, int b, int c){
// printf("insert %d %d %d\n"... | ALGO | 0.999986 | 3.514787 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "3f3e8f0dc221... |
1ee9db05-3c9d-40aa-9726-bc06aba5edb0 | GameFoundry/bsf | Source/Foundation/bsfUtility/ThirdParty/simdpp/detail/insn/bit_and.h | /* Copyright (C) 2011-2014 <NAME> <<EMAIL>>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef LIBSIMDPP_SIMDPP_DETAIL_INSN_BIT_AND_H
#define LIBSIMDPP_SIMDPP_DETAIL_INSN_BIT_AND_H
#if... | TOOL | 0.967767 | 6.296867 | {
"github_metadata": {
"branch": "master",
"commit_count": 5221,
"repo_created_at": "2018-03-15T10:17:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1752,
"forks": 194,
"issues": 99,
"pull_requests": 8
},
"file_meta": {
"content_id": "e0... |
4d532199-5744-4e0d-974b-77182ff54071 | rkoch/uzh-inf02b-a2 | Task_C/src/main.cpp | //
// main.cpp
// Mail
//
// Created by <NAME> on 09.02.12.
// Updated by <NAME> on 15.01.13.
// Copyright 2013 Universität Zürich. All rights reserved.
//
// Authored by <NAME>
// Public repository at https://github.com/rkoch/uzh-inf02b-a2
//
#include <iostream>
#include <vector>
#include <algorithm>
#include ... | ALGO | 0.989812 | 4.837379 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2013-03-03T12:36: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": "835638951... |
a240ff88-51f9-46f7-948a-01677e536b6b | Gremreaper/Company-Questions | TCS/shift3code2.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> arr(n); // Initialize the vector with size n
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
vector<int> ans;
priority_queue<pair<int, int>> pq;
// Add th... | ALGO | 0.999998 | 6.043617 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-09-21T07:07:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5b2c0f9471a... |
a00ed85d-8de6-4a2a-b272-a5a41a477c44 | Mohnish156/AVC-Project- | Finalcode.cpp | #include <stdio.h>
#include <unistd.h>
#include <time.h>
#include "E101.h"
#include <cmath>
#include <stdlib.h>
int error();
int main(){
//Quad 1: Gate opening
int connect = 0;
int request = 0;
char address[15] = "172.16.31.10";
char say[24] = "Please";
connect = connect_to_server(address, 10... | ALGO | 0.955275 | 3.27507 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-06-17T07:37: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": "359c90f2ed... |
47bc32a2-4c6b-4ee9-b91d-a274be719178 | sandeshsuryawanshi/sms-LeetCode | 1443-minimum-time-to-collect-all-apples-in-a-tree/1443-minimum-time-to-collect-all-apples-in-a-tree.cpp | class Solution {
public:
int minTime(int n, vector<vector<int>>& edges, vector<bool>& hasApple)
{
int time = 0;
unordered_map<int, vector<int> > map;
for(auto p : edges)
{
map[p[0]].push_back(p[1]);
map[p[1]].push_back(p[0]);
}
... | ALGO | 0.999758 | 5.170754 | {
"github_metadata": {
"branch": "main",
"commit_count": 759,
"repo_created_at": "2022-10-02T20:59: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": "164ae42bce... |
61c698b4-697f-4efa-9b31-2a4a36b457fe | KakaoSoup/EEE5501 | HW3/thread/sort.h | #ifndef __SORT_H__
#define __SORT_H__
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <new>
#include <pthread.h>
#include <thread>
/* Assignment 3: Multi-threading
Fill in the sort function to implement a merge-sort algorithm.
*/
#define MAX_THREADS 1024
// merge with 2... | ALGO | 0.999877 | 4.647397 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-05-24T06:01: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": "056cf3dc1c5... |
afffec32-a91f-4ffa-bdd7-e410bbcd9d45 | jaeseung-lee/ps | cc/16947.cc | #include <cstring>
#include <iostream>
#include <queue>
#include <vector>
#define endl '\n'
using namespace std;
vector<int> edges[3001];
bool visited[3001];
int N;
bool is_in_cycle[3001];
void input();
void solve();
void dfs(int now_index, int prev_index);
void check(int now_index);
int main() {
ios::sync_with_... | ALGO | 0.999952 | 3.883523 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2021-09-20T13: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": "1b69dbae9d0... |
c235f6e8-dd3b-47d3-bd12-74a3cdd87d92 | ishandutta2007/codeforces-n | neal/normal/1491/G.cpp | #include <algorithm>
#include <array>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>
using namespace std;
// http://www.open-std.o... | ALGO | 0.999983 | 4.176476 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c65126fd3a6f... |
6a6a26ba-7394-45be-9da8-a2810f3c42f8 | YooLc/Codes-Backup | 2020/7.10/poj3061.cpp | #include <iostream>
#include <cstdio>
inline int rd()
{
int t = 0, f = 1; char ch = getchar();
while (!(ch >= '0' && ch <= '9')) { if (ch == '-') f = -1; ch = getchar(); }
while (ch >= '0' && ch <= '9') { t = t * 10 + ch - '0'; ch = getchar(); }
return t * f;
}
const int MAXN = 1e5 + 50, INF = 1 << 30;
... | ALGO | 0.999823 | 3.328908 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2020-08-03T12:22: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": "822473197... |
b58bc341-3c29-4e36-ac3d-cb991af62272 | ItssPrem/LP2 | astar.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
// Structure to represent a node in the grid
struct Node {
int x, y;
int g, h, f;
Node* parent;
Node(int x, int y, int g = 0, int h = 0, Node* parent = nullptr)
: x(x), y(y), g(g), h(h), f(g + h), pa... | ALGO | 0.99994 | 5.941334 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-08T18:06: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": "f2b6f1797e98... |
2052f63c-d2f5-4baf-b64f-51db599ef450 | Nishithjupally/DataStructures | ds/dij.cpp | #include <iostream>
#include <utility>
#include <list>
#include <queue>
#include <vector>
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> vertexpair;
int counter = 0;
class Graph
{
public:
int n;
list<int> *adjacency;
list< pair<int, int> > *adj;
Graph(int x)
{
n = x;
adjacency = new list<... | ALGO | 0.999838 | 3.755788 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-01-14T11:57: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": "953108ee2219... |
1272ab08-1ff0-40b8-b9da-dd8e8f6c7f62 | pank7/pank7-test | cpp/perm.cpp | #include <iostream>
template<class T>
void permutation(T a[], int t, int n)
{
if (t == n) {
for (int i = 0; i < n; ++i) {
std::cout << a[i] << " ";
}
std::cout << std::endl;
return;
}
for (int j = t; j < n; ++j) {
std::swap(a[j], a[t]);
pe... | ALGO | 0.999653 | 4.419393 | {
"github_metadata": {
"branch": "master",
"commit_count": 170,
"repo_created_at": "2011-12-21T08:27: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": "c3feb251... |
a3fce79d-a11c-491c-a5af-8bf932e0115b | MahiAlJawad/Competitive-Programming | Codeforces/CF 149A.cpp | /******************************************************************************************************************************
*** "In the name of Allah(swt), the most gracious, most merciful. Allah(swt) blesses with knowledge to whom he wants." ***
*** Author : <NAME> ... | ALGO | 0.999657 | 3.269523 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2017-08-03T17:45: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": "b23393666... |
cdc55802-864b-4c4f-be12-e00f0b96a428 | thegamer1907/Code_Analysis | Codes/AC/188.cpp | // Think Twice Code Once
// NullByte 0x00
#include <iostream>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <stdio.h>
#include <time.h>
using namespace std ;
// Template
typedef long long ll ;
typed... | ALGO | 0.999944 | 3.487399 | {
"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": "495d3fa4a... |
8dd880ab-40da-49db-9687-e19714f52091 | ishandutta2007/codeforces-p | piyushsethia1999/normal/1220/D.cpp | #include <bits/stdc++.h>
#define pb push_back
#define fi first
#define int long long
#define se second
#ifndef print
#define print(...)
#endif
using namespace std;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int l) { uniform_int_distribution<int> uid(0, l - 1); return uid(r... | ALGO | 0.999936 | 3.091049 | {
"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": "d2d768506f81... |
cf1f604e-3319-4a94-bd44-2b9292b6d10e | burhankapadia18/CPP-DSA | Data-structures/Array/problems/median_rowiseSorted_matrix.cpp | #include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
// template<typename T>
#define ll long long int
#define ld long double
#define mod 1000000007
#define inf 1e18
#define ESPILON 1e-9
#define endl "\n"
#define pb ... | ALGO | 0.999882 | 4.817457 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2021-02-14T06:44: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": "bee27c85308... |
122b9164-9497-4961-9174-c3969d455e1a | Intiser/ProblemSolvingAndContest | UvaOnlineJudge/10375F.cpp | #include<iostream>
#include<stdio.h>
#include<vector>
using namespace std;
#define sc(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define scc(x,y) scanf("%d %d",&x,&y)
#define sccc(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define FOR(x,y) for(int x = 0;x<y;x++)
#define FORR(x,y) for(int x = 1;x<=y;x++)
#define prc(c) ... | ALGO | 0.999508 | 3.781401 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-09-06T19:17: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": "79df8270d1... |
824cacac-16f0-4476-9edd-d2cd20f53457 | markspindler/MergeMedian | MergeMedian.cpp | /**
MergeMedian v1.0.0 (c) by <NAME>
MergeMedian is licensed under a Creative Commons Attribution 3.0 Unported License.
To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/.
**/
static const char* const CLASS = "MergeMedian";
static const char* const HELP = "Returns the median of all co... | ALGO | 0.999326 | 6.444899 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-11-14T16:19:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35c262bbe34e... |
39250255-5433-4ffd-9a79-a8ea60bd7a44 | zino23/Data_Structures_and_Algorithms | problem_sets/AcWing/fundermental_algorithms/math/prime/POJ2689_prime_dist.cpp | #include <iostream>
#include <type_traits>
#include <vector>
using namespace std;
const int N = static_cast<int>(static_cast<float>(1e6));
int primes[N];
bool flag[N];
int cnt;
void linear_sieve(int n)
{
for ( int i = 2; i <= n; i ++ )
{
if ( !flag[i] ) primes[cnt ++] = i;
for ( int j = 0; primes[j] <= n / i; ... | ALGO | 0.999943 | 4.535331 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-09-06T08:37:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f037491ae... |
4715094c-090e-48f3-85d9-22577b0d0798 | nahid597/coding-interview | deletenthelementfromend.cpp | #include<bits/stdc++.h>
using namespace std;
struct node{
int data;
node *next;
};
node *newNode(int data)
{
node *newNode = (node*)malloc(sizeof(node));
newNode->data = data;
newNode->next = NULL;
return newNode;
}
node *insertNodeatFirst(node *head, int data)
{
node *new_node = newNode(d... | ALGO | 0.999711 | 3.599476 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-10-23T21:06: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": "bac7812dc87a... |
a1a2e3f9-6b0a-4ca9-bab9-d8d83dd60bf6 | danyala1/aisd3 | aisd3/Header.h | #include <stdio.h>
#include <iostream>
#include <list>
using namespace std;
template<typename T>
struct List {
double degree;
T coefficent;
List* next;
};
template<typename T>
class Equalization
{
public:
list<List<T>> head;
int count = 0;
auto begin() { return head.begin(); }
auto en... | ALGO | 0.964716 | 3.590145 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-12-11T18:59: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": "df152e553f22... |
7a6f2b10-31f5-4bd9-bdfa-1f1b2f341742 | kihort-si/itmo | a&sd/0/solution.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
bool isSquared(const string& s) {
size_t t = s.size();
if (t % 2 != 0) {
return false;
} else {
for (size_t i = 0; i < t / 2; i++) {
if (s[i] != s[t / 2 + i]) {
return false;
}
}
}
return true;
}
in... | ALGO | 0.999613 | 4.701201 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2023-09-17T10:27:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42009caf6d... |
9c6a12fb-2304-4731-8b36-8ecb13bc1c8a | Seoha57/Programmers | C++/Lv2 괄호 회전하기.cpp | /********************
괄호 회전하기
문제 설명
다음 규칙을 지키는 문자열을 올바른 괄호 문자열이라고 정의합니다.
(), [], {} 는 모두 올바른 괄호 문자열입니다.
만약 A가 올바른 괄호 문자열이라면, (A), [A], {A} 도 올바른 괄호 문자열입니다.
예를 들어, [] 가 올바른 괄호 문자열이므로, ([]) 도 올바른 괄호 문자열입니다.
만약 A, B가 올바른 괄호 문자열이라면, AB 도 올바른 괄호 문자열입니다.
예를 들어, {} 와 ([]) 가 올바른 괄호 문자열이므로, {}([]) 도 올바른 괄호 문자열입니다.
대괄호, 중괄호,... | ALGO | 0.999519 | 5.29801 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2021-03-12T07:38: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": "258bee1a881... |
3b4a88d2-76d9-42c7-a90f-52601409d62b | ttzztztz/leetcodeAlgorithms | 位运算/411. Minimum Unique Word Abbreviation.cpp | class Solution {
public:
string minAbbreviation(string target, vector<string>& dictionary) {
const int n = target.size();
unordered_set<int> bitset;
for (const string& word : dictionary) {
if (word.size() != target.size()) continue;
bitset.insert(str_difference(target... | ALGO | 0.99979 | 6.084504 | {
"github_metadata": {
"branch": "master",
"commit_count": 872,
"repo_created_at": "2019-09-03T06:57:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2dbcf6... |
b4647a07-2634-4b66-b0a0-93fcfe01f835 | atcoder/ac-library | test/example/maxflow_practice.cpp | #include <atcoder/maxflow>
#include <iostream>
using namespace std;
using namespace atcoder;
int main() {
int n, m;
cin >> n >> m;
vector<string> grid(n);
for (int i = 0; i < n; i++) {
cin >> grid[i];
}
/**
* generate (s -> even grid -> odd grid -> t) graph
* grid(i, j) cor... | ALGO | 0.999977 | 4.243752 | {
"github_metadata": {
"branch": "master",
"commit_count": 276,
"repo_created_at": "2020-09-08T13:18:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2080,
"forks": 254,
"issues": 10,
"pull_requests": 3
},
"file_meta": {
"content_id": "252... |
f1b42d86-5aba-48a2-a082-60ccbbfe9c3b | lukaszlipski/Digit-Recognition | neurons/include/opennn/order_selection_algorithm.h | /****************************************************************************************************************/
/* */
/* OpenNN: Open Neural Networks Library ... | ALGO | 0.999197 | 7.16145 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-03-09T23:12:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68d3c79b0e... |
d4d0f1b0-7935-42a1-ab54-bcd0119d3616 | U-Keun/CodingTestPractice | 백준/Gold/2573. 빙산/빙산.cc | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#define FAST_IO cin.tie(NULL)->ios::sync_with_stdio(false);
using namespace std;
#define REP(i,a,b) for (int i = a; i <= b; i++)
int n, m;
vector<vector<int>> sea;
int dr[4] = { 0, -1, 1, 0 },
dc[4] = { -1, 0, 0, 1 };
// 빙산이 녹는다 -> tr... | ALGO | 0.99998 | 4.70083 | {
"github_metadata": {
"branch": "main",
"commit_count": 1459,
"repo_created_at": "2023-04-02T14:11: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": "a7622ef4c... |
ef15dee0-53ee-49ba-8a1a-310e516020fa | Farhanalam0844/DSA-Sem3 | Lists/iterators.cpp | #include<iostream>
using namespace std;
struct node {
node* next;
int data;
};
class forward_list {
private:
node* FRONT;
int n;
public:
forward_list() {
FRONT = NULL;
n = 0;
}
void push_front(int val) {
node* temp;
temp = new node;
if (temp == NULL) {
throw "forward list overflow\n";
}
temp->d... | ALGO | 0.998424 | 4.065035 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-08-09T07:47:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "464edb31cf6e... |
becf190c-4819-4be5-93f7-564e2a67f863 | Shourov1702040/Algorithms-in-Cpp | Compiler desgn/solve - 1.cpp | /* Write a C/C++ program that reads text from a file and prints on the terminal each input
line, preceded by the line number. The output will look like -
1 This is the first trial line in the file,
2 and this is the second line.
Try the problem once using fgetc() function and once using fgets... | TOOL | 0.938517 | 3.078733 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2021-09-28T08:09:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7860c52076... |
3e74d3f5-4b90-439b-8a4d-23a128e8f33e | MPatel2412/Leetcode | 1463-cherry-pickup-ii/1463-cherry-pickup-ii.cpp | class Solution {
private:
int r, c;
vector<int> dy = {-1, 0, 1};
public:
bool isInside(int y) {
return (y >= 0 && y < c);
}
int f(int x, int y1, int y2, vector<vector<int>>& grid, vector<vector<vector<int>>>& dp) {
if(x >= r || !isInside(y1) || !isInside(y2)) return 0;
int &... | ALGO | 0.999969 | 5.638476 | {
"github_metadata": {
"branch": "main",
"commit_count": 1178,
"repo_created_at": "2023-12-06T02:54: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": "fe8459f62... |
f8bf3767-de30-4b65-b803-c942e25d89dd | kennethabarr/neoParSA | parsa/move/fixedThetaMove.hpp | /*
* fixedTheta.hpp
*
* Created on: Jul 26, 2014
* Author: zhlou
*/
#include "xmlUtils.h"
#include <exception>
#include <stdexcept>
template<class Problem>
const char *fixedThetaMove<Problem>::name = "fixedThetaMove";
template<class Problem>
fixedThetaMove<Problem>::fixedThetaMove(Problem & problem,
... | ALGO | 0.960542 | 5.814704 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-12-07T21:53: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": "02f9f423de... |
1061eaae-1956-4602-b241-939cea5300f7 | Kausthubha1710/DSA | RemoveVowels.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution{
public:
// T.C - O(N^2)
// S.C = O(N)
string RemoveVowels(string s){
for(int i=0; i<s.length(); i++){
if(s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u' || s[i] == 'A' || s[i] == 'E' || s[i] == 'I'... | ALGO | 0.990794 | 4.908771 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-06T08:17: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": "e7b67a6387b6... |
b4d25d2e-3f70-49d1-9c61-2a87594e23b2 | chjon/EssayTeaSolver | Vertex_Cover.cpp | #include "Vertex_Cover.h"
#include "DPLL.h"
/**
* Generate exclusion clauses of size k + 1
*/
void Vertex_Cover::generateExclusionClauses(
std::unordered_set<CNF_Clause*>* clauses,
std::unordered_set<int>* varsSoFar,
unsigned int k,
int index,
unsigned int numVertices
) {
if ((int) k < 0) {
... | ALGO | 0.997726 | 5.964662 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2019-05-19T17:21: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": "d4c30bb11... |
32885366-a6d1-4ee7-b103-9ed9cfada509 | yashkapoor007/geeksforgeeks | tree_4.cpp | #include<iostream>
#include <queue>
#include "Tree.h"
using namespace std;
int findsum(Tree<int>* root,int sum)
{
if(root==NULL)
return sum==0;
int ans=0;
int subsum=sum-root->data;
if(subsum==0&&root->children.size()==0)
return 1;
for(int i=0;i<root->children.size();i++)
{
ans=ans||findsum(root->ch... | ALGO | 0.99995 | 4.305342 | {
"github_metadata": {
"branch": "master",
"commit_count": 164,
"repo_created_at": "2018-01-20T17:45: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": "e3971df3... |
d9fe5ee2-58b4-4715-9e24-f5e7a57470d3 | viennacl/viennacl-dev | examples/tutorial/qr.cpp | /* =========================================================================
Copyright (c) 2010-2016, Institute for Microelectronics,
Institute for Analysis and Scientific Computing,
TU Wien.
Portions of this software are copyright by UChicago Argonne, LLC.
... | ALGO | 0.945469 | 5.49757 | {
"github_metadata": {
"branch": "master",
"commit_count": 1482,
"repo_created_at": "2013-02-22T14:47:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 288,
"forks": 89,
"issues": 85,
"pull_requests": 4
},
"file_meta": {
"content_id": "334... |
eb782256-ebd4-4d43-ab64-254e2a9babe4 | stan-dev/math | stan/math/prim/fun/digamma.hpp | #ifndef STAN_MATH_PRIM_FUN_DIGAMMA_HPP
#define STAN_MATH_PRIM_FUN_DIGAMMA_HPP
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/fun/boost_policy.hpp>
#include <stan/math/prim/functor/apply_scalar_unary.hpp>
#include <boost/math/special_functions/digamma.hpp>
namespace stan {
namespace math {
/**
* Return ... | ALGO | 0.981408 | 6.888346 | {
"github_metadata": {
"branch": "develop",
"commit_count": 28933,
"repo_created_at": "2015-07-01T18:40:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 785,
"forks": 195,
"issues": 298,
"pull_requests": 19
},
"file_meta": {
"content_id": ... |
cd426c68-7b44-4d64-a171-c5acb2d62721 | ishandutta2007/codeforces-l | littlelittlehorse/normal/429/C.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
using namespace std;
struct node{
node *next;
vector<int> where;
} *first[25];
vector<int> v[25], use;
int cnt, n, a[25], amount[25], c[25],... | ALGO | 0.999993 | 3.318063 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17: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": "e50117817a40... |
a66363cc-ddea-49a7-8796-b0c4b35d9404 | chat-code/leetcode-everyday | archive/202110/20211025_377/abel.cpp | // Date: Wed Oct 27 15:06:18 2021
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
using namespace std;
const int INF = 0x3f3f3f3f, MOD = 1e9 + 7;
co... | ALGO | 0.999944 | 4.879912 | {
"github_metadata": {
"branch": "master",
"commit_count": 1880,
"repo_created_at": "2019-12-12T12:17:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5de9cdca... |
e07189f9-662b-4a31-9780-570ec1d3b2c9 | rareone0602/Competitive-Programming-Solutions | CF917B.cpp | #include <bits/stdc++.h>
using namespace std;
int up = 0, down = 0, ans = 0;
typedef pair<int, int> PII;
vector<PII> g[100];
int dp[100][100][26];
int mex(set<int> &S) {
int cur = 0;
for (int v: S) if (v != cur) break; else ++cur;
return cur;
}
int dfs(int i, int j, int c) {
if (dp[i][j][c] != -1) return dp[i][... | ALGO | 0.999943 | 3.643133 | {
"github_metadata": {
"branch": "master",
"commit_count": 158,
"repo_created_at": "2016-08-04T03:53:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1092af5... |
e96db471-55a1-4755-833a-72e95cccf308 | rjg-lyh/line_detector_CPP_Orin | src/control.hpp | #pragma once
#include<tools.hpp>
#include<eigen3/Eigen/Dense>
#include<eigen3/Eigen/Core>
#include<eigen3/Eigen/SVD>
#include<CppLinuxSerial/SerialPort.hpp>
using namespace mn::CppLinuxSerial;
struct Camera
{
float deltax; // Translation to the origin of the robot
float deltay;
float deltaz; ... | TOOL | 0.988407 | 5.108104 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2023-06-07T11:59: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": "69f6952df... |
1df26871-e1d6-4a89-8b2f-5de5734b4e40 | parthiv360/CP_DSA | spoj_ACM/math/ADST01.cpp | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rep1(i, n) for (ll i = 1; i <= n; i++)
#define pie acos(-1.0)
typedef long long ll;
typedef long double ld;
typedef long long int lli;
typedef long long unsigned llu;
typedef pair<ll, ll> pl;
#defin... | ALGO | 0.999965 | 4.657214 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2022-09-02T05:47: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": "64d1589dba3... |
c2c3ec94-6d1c-455f-bf17-1c26088c343c | nicholasfresneda/kmeans | serial_impl/Cluster.cpp | #include "Cluster.hpp"
#include <math.h>
#include <fstream>
#include <string>
#include <iostream>
using namespace std;
Coord::Coord(int xVal, int yVal)
{
this->x = xVal;
this->y = yVal;
}
int Coord::getEuclideanDistance(Coord coord)
{
double p1 = pow(coord.x - this->x, 2);
double p2 = pow(coord.y - th... | ALGO | 0.958672 | 4.592548 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-04-11T18:42: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": "d5fab5f89... |
e9d75a0f-339f-4944-b719-2681251dffc2 | gokulp/Dijkstra-with-Fibonacci | ssp.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include "fibonacci.h"
#include "Graph.h"
using namespace std;
int main (int argc, char *argv[])
{
char *line= NULL;
size_t size =100;
int n, m;
list <Node *> Path;
Node * adjVertex = NULL;
int weight= 0, newWeight = 0;
unordered_map<int, ... | ALGO | 0.99964 | 3.326666 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2015-06-19T15:40: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": "14f405d9f8... |
c6a14d5a-2330-417d-9d42-14af3b02a089 | OpenDigitalTwin-Dev/FENGSim | toolkit/Geometry/vtk/ThirdParty/vtkm/vtk-m/vtkm/worklet/contourtree/VertexDegreeUpdater.h | //============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE... | ALGO | 0.999214 | 7.177167 | {
"github_metadata": {
"branch": "main",
"commit_count": 1345,
"repo_created_at": "2021-12-22T12:15:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 54,
"forks": 15,
"issues": 4,
"pull_requests": 2
},
"file_meta": {
"content_id": "6a6fc7eb... |
839d71fa-e8dd-4d1c-b538-bef0a0f2bcf5 | ucyang/AlgoEx | baekjoon/1557/square_free_numbers.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
using ull = unsigned long long;
constexpr ull MAX_PRIME = 100'000;
constexpr ull MAX_RESULT = 2'000'000'000;
void sieve(vector<ull>& p)
{
vector<bool> b(MAX_PRIME + 1, true);
ull n = static_cast<ull>(sqrtl(MAX_PRIME)), i, j;
p ... | ALGO | 0.999971 | 4.840324 | {
"github_metadata": {
"branch": "main",
"commit_count": 153,
"repo_created_at": "2019-10-19T08:35:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ec5b2b44f... |
11564ba2-83cb-47c1-8359-458c7d14d86d | RezaSi/ICPC | sgu/406.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
vector<int> v[n + 10];
for(int i = 0 ; i < n ; ++i){
int x;
cin >> x;
for(int j = 0 ; j < x ; ++j){
int temp;
cin >> temp;
v[i].push_back(temp);
}
}
for(int i = 0 ; i < m ; ++i){
int x;
cin >> x;
int temp[... | ALGO | 0.99977 | 3.475131 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-04-24T04:20:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7816457c6d... |
4c83e4a0-7632-4691-ab1e-ce64044cd901 | ishandutta2007/codeforces-b | bixind/normal/852/G.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <queue>
#include <iomanip>
#include <set>
#include <cmath>
#include <cstdlib>
#include <map>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <sstream>
#include <stdlib.h>
#include <assert.... | ALGO | 0.999954 | 3.972423 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1810e8e0f4c2... |
79b385e6-8b08-4144-ac52-431c461f556d | ishandutta2007/codeforces-h | holyk/normal/1139/D.cpp | // Author: HolyK
// Created: Thu Sep 22 09:20:45 2022
#include <bits/stdc++.h>
template <class T, class U>
inline bool smin(T &x, const U &y) {
return y < x ? x = y, 1 : 0;
}
template <class T, class U>
inline bool smax(T &x, const U &y) {
return x < y ? x = y, 1 : 0;
}
using LL = long long;
using PII = std::pai... | ALGO | 0.999919 | 4.414543 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23c54ce2fc5b... |
7a58f55c-93ba-477b-9065-bc1147fcb38f | po-sc/ccccc | homework/homework/homework 5.cpp | //#include <iostream>
//using namespace std;
//int main()
//{
// system("chep 1251");
// bool a, b, c;
// cout << "На улице день?\n";
// cout << "Да(1)/Нет(0)\n";
// cin >> a;
// cout << "Раздвинуты шторы?\n";
// cout << "Да(1)/Нет(0) \n";
// cin >> b;
// cout << "Лампа включена?\n";
// co... | ALGO | 0.996624 | 3.875609 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-03-15T22:01: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": "4faba00a3f... |
edb2ba8d-55da-4334-af25-04908f49aacd | paolo-torres/interview-prep | leetcode/all/all/surrounded_regions.cpp | /*
Given a matrix, capture ('X') all regions that are surrounded ('O')
Distinguish captured vs escaped, 'X' vs 'O' vs 'E'
Time: O(m x n)
Space: O(m x n)
*/
class Solution {
public:
void solve(vector<vector<char>>& board) {
int m = board.size();
int n = board[0].size();
... | ALGO | 0.999824 | 7.003509 | {
"github_metadata": {
"branch": "master",
"commit_count": 676,
"repo_created_at": "2019-10-28T15:50: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": "9bb1ef1f... |
9f0c6a22-0383-4c3a-976a-b6be4973cfaf | MountainBaek/PS_ | 15591-ing.cpp | /*15591¹ø MooTube*/
#include<iostream>
#include<queue>
#include<vector>
using namespace std;
using pii = pair<int, int>; //pair<next node, cost>
int N, Q;
vector<pii>tree[5001];
int bfs(int K,int V) {
int res = 0;
vector<bool>visit(N + 1, 0);
vector<int>min_cost(N + 1, INT_MAX);
queue<pii>q;
q.push({V,INT_MAX}); ... | ALGO | 0.999949 | 4.456174 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-10-02T01:29: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": "87a79e54a68c... |
ef863b09-ff7f-466b-bcb0-710a14ba1408 | wh1t3p1g/csprogram | oj_60_最短路径问题.cpp | /**
* https://www.nowcoder.com/practice/e372b623d0874ce2915c663d881a3ff2?tpId=40&tqId=21483&tPage=1&rp=1&ru=/ta/kaoyan&qru=/ta/kaoyan/question-ranking
* 最短路径 floyd(n^3 适合200以下) && dijkstra
* 运行时间:108ms 占用内存:8048k
* 运行时间有点长
*/
#include <iostream>
#include <vector>
using namespace std;
struct Edge{
int position;... | ALGO | 0.999925 | 3.790996 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2018-02-28T04:19:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b1cad216... |
3a323189-38a0-44c9-8af3-61317f356453 | nasa/astrobee | mobility/mapper/include/mapper/linear_algebra.h | /* Copyright (c) 2017, United States Government, as represented by the
* Administrator of the National Aeronautics and Space Administration.
*
* All rights reserved.
*
* The Astrobee platform is licensed under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with... | ALGO | 0.983998 | 6.645965 | {
"github_metadata": {
"branch": "master",
"commit_count": 551,
"repo_created_at": "2017-08-29T23:16:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1170,
"forks": 343,
"issues": 13,
"pull_requests": 11
},
"file_meta": {
"content_id": "34... |
64a70d7e-dd44-4060-be53-da62b38c0e15 | tangjz/acm-icpc | lydsy/4955.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 10001, INF = 0x3f3f3f3f;
int n, m, qtot, que[maxn], stot, b[maxn], nxt[maxn];
pair<int, int> a[maxn], seg[maxn];
int main() {
scanf("%d%d", &n, &m);
for(int i = 0; i < n; ++i) {
scanf("%d%d", &a[i].first, &a[i].second);
... | ALGO | 0.999992 | 3.40605 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2013-10-06T18:57:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 45,
"forks": 13,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "09f475... |
212b405f-d9d2-4c75-879b-6a24d97d5811 | raincross7/code-similarity | codes/train_code/problem018/problem018_316.cpp | #include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define mset(arr, val) memset((arr), (val), sizeof(arr))
#define For(i, init, n) for (int64_t (i) = (init); (i) < (n); (i)++)
#define ___ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
// const double PI = acos(-1.0), E = ex... | ALGO | 0.999664 | 3.728545 | {
"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": "3fd27e3bb3fe... |
e02fbcdd-3d58-453d-b915-9d498160d7fd | lasithagt/robot-motion | robot_control/scripts/stiffness_identification_surface_static.cpp |
#include <ros/ros.h>
#include <stdlib.h>
#include <stdio.h>
#include <memory>
#include <string.h>
#include <cmath>
#include <iostream>
#include <fstream>
#include <std_msgs/Time.h>
#include <std_msgs/Bool.h>
#include <geometry_msgs/PointStamped.h>
#include <robot_kinematics.hpp>
#include <robot_motion_library.hpp>... | ALGO | 0.967852 | 3.733327 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-02-05T16:18:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db0d7b29e... |
3684f675-9aed-4f83-8756-341b85f29c1a | yuedaowener/CodingBetter | books/code_interview_guide_for_programmer/chp02_link_list.cpp | # include<vector>
# include<math.h>
# include<iostream>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode(int x) : val(x), next(nullptr) {} // todo:这是啥?和类的构造函数的区别是啥?
};
struct ListDoubleNode
{
int val;
ListDoubleNode *next;
ListDoubleNode *last;
ListDoubleNode(int ... | ALGO | 0.999141 | 4.821858 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2021-04-13T11:53: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": "f65456497... |
3f76e1bd-e5b0-4d45-aa7b-ca60e2792a26 | Bhanunar1/Codsoft | tic tac toe game.cpp | #include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
class TicTacToe
{
private:
char sheet[3][3]={ {' ',' ',' '},{' ',' ',' '},{' ',' ',' '} };
char player='X';
public:
void displaySheet()
{
cout<<"--------------"<<endl;
for(int i=0;i<3;++i){
cout<<"| ";
for(int j=0;j<3;++j){
... | ALGO | 0.98762 | 4.458618 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-02-03T09:25: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": "f560f6bf4a67... |
c5ea10a7-791d-4322-ba96-978cdf83582d | iprosenjitp/Online-Judge | Codeforces/1433C-Dominant Piranha.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--){
int n;
cin >> n;
int A[300005];
int maxDiff = 0, maxVal = 0, maxIn = 0, ans;
for(int i = 0; i < n; i++){
cin >> A[i];
if(i != 0 && abs(A[i]-A[i-1]) > maxD... | ALGO | 0.999982 | 3.706125 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-13T11:02:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "089522a44fa0... |
fae4cc84-08bb-4af5-901f-d17571978be1 | nikhilyadv/UVA | Problem Solving Paradigms/Complete Search/416 - LED Test.cpp | #include<bits/stdc++.h>
using namespace std;
int n ;
bool res;
vector<string> a , b(11);
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
freopen("in.txt" , "r" ,stdin);
freopen("out.txt" , "w" , stdout);
b[0] = "YYYYYYN";
b[1] = "NYYNNNN";
b[2] = "YYNYYNY";
b[3] = "YYY... | ALGO | 0.999938 | 3.764633 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-06-10T18:37:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fa18642a8... |
55f05626-1f8b-4677-b121-909c2304bb38 | PokerM/CodeCraft2019 | CodeCraft-2019/CodeCraft-2019.cpp | #include "iostream"
#include <vector>
#include <fstream>
#include <set>
#include <algorithm>
#include <time.h>
#include <sys/time.h>
#include "TxtHandler.h"
#include "Car.h"
#include "Cross.h"
#include "Road.h"
#include "Answer.h"
#include "Scheduler.h"
#include "Graph.h"
using namespace std;
vector<Car> car_ve;
v... | TOOL | 0.965822 | 3.632618 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-04-14T06:30:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83edf3f5d... |
8c84c19c-af19-483c-a911-c60abf16dfbb | HimangsKalita/DataStructure-Algorithms-CPP | CP/Luv - Competitive Porgramming/Sets/2_he_monk_and_the_magical_candy_bags.cpp | // https://www.hackerearth.com/practice/data-structures/trees/heapspriority-queues/practice-problems/algorithm/monk-and-the-magical-candy-bags/?fbclid=IwAR2kDiVkEaxu9dkCTCUhzXLuIccNn0Gz3dSfkaSUjlDE6Nb9UHMzt8HNDo4
// Problem
// Our Monk loves candy!
// While taking a stroll in the park, he stumbled upon N Bags with ca... | ALGO | 0.999934 | 5.011584 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2022-02-08T16:25:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40ed1c7fe83... |
35d39a0d-5c27-4510-9f92-f20c05647a03 | J-Dun/PICNIC | src/time/PICTimeIntegrator_EM_Explicit.cpp | #include "PICTimeIntegrator_EM_Explicit.H"
#include "NamespaceHeader.H"
void PICTimeIntegrator_EM_Explicit::initialize( const std::string& a_restart_file_name )
{
m_fields->copyEToVec( m_E );
m_fields->copyBToVec( m_B );
m_fields->copyEoldToVec( m_Eold );
m_fields->copyBoldToVec( m_Bold );
}
int PICTimeInte... | ALGO | 0.999032 | 6.384485 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2024-05-17T06:17:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79bb7410... |
3f050a8c-320c-4772-a5f8-512fffc54df8 | atlas25git/LeetCode | 105BTFromPreIn.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999996 | 6.661704 | {
"github_metadata": {
"branch": "main",
"commit_count": 120,
"repo_created_at": "2021-07-03T04:46:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e120a6fce0... |
93abb9f8-41f2-443b-8b4a-65b6a4c9ebd7 | miguelsndc/competitive-programming-lib | Solutions/Codeforces/2109_c.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
using vc = vector<T>;
using ll = long long;
const int maxn = 2e5 + 5;
const ll inf = 1e18;
namespace rg = std::ranges;
void solve() {
int n, x;
cin >> n;
cout << "digit" << endl;
cin >> x;
cout << "digit" << endl;
cin >> x;
... | ALGO | 0.998838 | 3.799668 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2025-03-19T13:03: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": "e7c14876135... |
6adafb8e-ab46-44ff-88cd-0456fbc08f0a | terz99/course-algorithms-data-structures | hw7/p2c/BinarySearchTree.cpp | #include <bits/stdc++.h>
#include "BinarySearchTree.h"
using namespace std;
/**
* Default constructor. Sets the root Node element to NULL
*/
BinarySearchTree::BinarySearchTree(){
this->root = NULL;
}
/**
* Private method. Inserts a new element into the binary search tree.
* It is called by its corresponding pu... | ALGO | 0.999652 | 4.497222 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-06-07T22:19: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": "f7b4f8aada... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.