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 |
|---|---|---|---|---|---|---|---|
b470ecad-9176-4c06-8d83-0dc845338ba8 | danielbociat/AlgoLabETH | Week06/Kingdom Defense/main.cpp | #include <iostream>
#include <vector>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/push_relabel_max_flow.hpp>
typedef boost::adjacency_list_traits<boost::vecS, boost::vecS, boost::directedS> traits;
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::no_property,
bo... | ALGO | 0.999896 | 4.251143 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-12-03T11:22:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "601c8f6d5e1... |
d2f50813-5a1a-4674-8a36-75df08fb0fb0 | winhows5/Leetcode-Answers | 0040. Combination Sum II/ans1.cpp | /* time cost: 7ms (84.03%) */
/* time complexity: O(2^n) */
static int x = [](){
std::ios::sync_with_stdio(false);
cin.tie(NULL);
return 0;
}();
class Solution {
public:
vector<vector<int>> combinationSum2(vector<int>& candidates, int target) {
sort(candidates.begin(), candidates.end());
... | ALGO | 0.999994 | 5.901442 | {
"github_metadata": {
"branch": "master",
"commit_count": 468,
"repo_created_at": "2017-11-20T14:45: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": "271f93f3... |
bfad7b09-76c6-41e6-97a9-c9510e0e15df | cy1366371760/CP | gcpc2023/j/sol.cpp | #include<bits/stdc++.h>
#define nl '\n'
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define sc second
#define pii pair<int, int>
#define pll pair<ll, ll>
template<typename T> bool chkmin(T &a, T b){re... | ALGO | 0.999967 | 4.227019 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-10-09T22:22: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": "ebddd0a78db... |
09443005-c66a-4418-bc72-92e1483c8625 | kiwibrowser/src | native_client/src/trusted/validator_arm/arm_helpers.cc | /*
* Copyright (c) 2013 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <assert.h>
#include "native_client/src/trusted/validator_arm/arm_helpers.h"
namespace nacl_arm_dec {
uint64_t VFPExpandImm(uin... | ALGO | 0.973968 | 5.492374 | {
"github_metadata": {
"branch": "master",
"commit_count": 672,
"repo_created_at": "2020-04-18T07:16:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2888,
"forks": 414,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "48c... |
59a767b5-85e3-4632-a942-daf8f244277c | MahamTahir31/Data-Structures | Data Structures/ETNode.cpp | #include <iostream>
#include <string.h>
#include <cstring>
#include <iomanip>
#include <cstdlib>
using namespace std;
// Expression Tree Node Program :
// ______________________________
struct ETnode{
char ch;
struct ETNode *LeftChild, *RightChild;
};
int IsOperator(char c)
{
if (c == '^')
{
... | ALGO | 0.999981 | 4.013246 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-07-04T18:00:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45f06b12dc5a... |
f95693ed-2622-4c8a-8bfa-19051c2b72a3 | syedtaqi95/CarND-Naive-Bayes-C- | classifier.cpp | #include "classifier.h"
#include <math.h>
#include <string>
#include <vector>
#include <iostream>
#include <numeric>
using Eigen::ArrayXd;
using std::string;
using std::vector;
using std::cout;
using std::endl;
using std::begin;
using std::end;
// Initializes GNB
GNB::GNB(int X_size) {
/**
* Done: Initialize GNB... | ALGO | 0.998767 | 6.08052 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2020-12-04T11:52:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91523d031ec8... |
a88082ec-50b2-4aa1-8114-614ab0a3d303 | lballabio/QuantLib | ql/termstructures/volatility/abcd.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2006, 2007 <NAME>
Copyright (C) 2006 <NAME>
Copyright (C) 2005, 2006 <NAME>
Copyright (C) 2007 <NAME>
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and develo... | ALGO | 0.974313 | 7.775464 | {
"github_metadata": {
"branch": "master",
"commit_count": 17543,
"repo_created_at": "2015-12-17T16:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6151,
"forks": 1964,
"issues": 51,
"pull_requests": 11
},
"file_meta": {
"content_id":... |
f0e2c068-f8e5-4f49-be86-64718ef679d2 | ZRZRING/algorithm | Practice/Codeforces/Codeforces Round (Div. 1 + Div. 2)/700-900/Codeforces Round 889/B.cpp | #include <bits/stdc++.h>
#define int64 long long
#define endl '\n'
#define PII std::pair<int64, int64>
#define init_0(x) memset(x, 0, sizeof(x))
#define init_inf(x) memset(x, 0x3f, sizeof(x))
inline int64 read() {
bool sym = 0; int64 res = 0; char ch = getchar();
while (!isdigit(ch)) sym |= (ch == '-'), ch = getcha... | ALGO | 0.999935 | 4.729745 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-03-11T04:17:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd3a46317062... |
82ee8b15-be22-4954-88c0-6ba463f02e7a | realmelan/leetcode | solutions/leetcode/minMalwareSpread2.cpp | // minMalwareSpread2.cpp
// leetcode
//
// Created by <NAME> on 10/22/18.
// Copyright © 2018 <NAME>. All rights reserved.
//
#include "common.h"
using namespace std;
namespace minMalwareSpread2 {
class Solution {
public:
/**
* For each intial node, find M(initial) if it is removed.
* To find the M(ini... | ALGO | 0.999963 | 5.737775 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2018-02-06T17:48:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69380f93... |
a17fd0e0-43bf-411a-9eca-a00651e80ced | scheinerman/Cplusplus-For-Mathematicians-Code | Programs-by-Chapter/12-polynomials/Polynomial.h | #ifndef POLYNOMIAL_H
#define POLYNOMIAL_H
#include <vector>
#include <iostream>
using namespace std;
template <class K>
class Polynomial {
private:
vector<K> coef;
long dg;
void deg_check() {
dg = -1;
for (long k=0; k< long(coef.size()); k++) {
if (coef[k] != K(0)) dg = k;
}
coef.res... | TOOL | 0.933593 | 4.779434 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-06-21T13:01:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a39e0cf056f... |
55fa3ecd-6430-4415-9a99-61da41ed7028 | ritsuxis/kyoupro | abc041-060/abc053b.cpp | #include<bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n ; i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) // decltypeで型取得、引数があればva_argsのところに入れる
using namespace std;
typedef long long ll; //... | ALGO | 0.999444 | 3.612673 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2020-01-09T16:37: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": "9d31b7043... |
eccab1fa-beba-4720-b0a4-d0e6648f0e42 | owlpaw20/CPArchive | BZOJ/[BZOJ P2818] GCD.cpp | #include <bits/stdc++.h>
using LL = long long;
const int MAX_N = 1e7 + 5;
int N, primes[MAX_N], cnt, phi[MAX_N];
bool flag[MAX_N];
LL sum_phi[MAX_N];
void phi_sieve(int N) {
phi[1] = 1;
for (int i = 2; i <= N; ++i) {
if (!flag[i]) primes[++cnt] = i, phi[i] = i - 1;
for (int j = 1; j <= cnt; ++j) {
... | ALGO | 0.999943 | 4.246988 | {
"github_metadata": {
"branch": "main",
"commit_count": 162,
"repo_created_at": "2023-12-17T02:02: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": "65e80ff515... |
f9b7a2ae-768e-41e8-a6e4-6a98f5f6e90d | mohitsharma0690/multi_scale_head_gesture | crf/HCRF2.0b/libs/shared/hCRF/src/InferenceEngineBrute.cpp | #include "inferenceengine.h"
#include <iostream>
using namespace std;
InferenceEngineBrute::InferenceEngineBrute()
{
}
InferenceEngineBrute::~InferenceEngineBrute()
{
}
int InferenceEngineBrute::forwardBeliefLog(FeatureGenerator* fGen, Model* model,
DataSequenceRealtime* dataSequence, dVector* prob)
{
ret... | ALGO | 0.999097 | 5.569795 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-05-16T17:46:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7909bf6d0... |
c26bc17c-5cc9-4b8d-84b2-f8243bd3adeb | StarRocks/starrocks | be/src/exprs/function_helper.cpp | // Copyright 2021-present StarRocks, Inc. 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required ... | TOOL | 0.959938 | 7.532382 | {
"github_metadata": {
"branch": "main",
"commit_count": 21361,
"repo_created_at": "2021-09-04T02:29:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10338,
"forks": 2050,
"issues": 499,
"pull_requests": 376
},
"file_meta": {
"content_id":... |
1055838a-da8c-41d5-a9ca-34d1517c51f1 | Nur-Alam-Limon/Competitive-Programming | Ruet_HobekiHobena/ICPC Regional/Strange Typewriter.cpp | //RUET_HobeKiHobena
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXS = 1000000;
const int MAXC = 26;
int out[MAXS];
int f[MAXS];
int g[MAXS][MAXC];
int buildMatchingMachine(string arr[], int k)
{
memset(out, 0, sizeof out);
memset(g, -1, sizeof g);
int states = 1;
for (int ... | ALGO | 0.99969 | 4.242548 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-11-27T09:40: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": "fbcdcd1b6deb... |
6b494b0c-34f8-47b0-beec-7e5bc544f791 | shantanuhallur/DSA-problems | 0889-construct-binary-tree-from-preorder-and-postorder-traversal/0889-construct-binary-tree-from-preorder-and-postorder-traversal.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.999924 | 6.437616 | {
"github_metadata": {
"branch": "main",
"commit_count": 6334,
"repo_created_at": "2022-04-14T11:43:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ad305e79... |
50281c48-abbc-4b91-99ad-4a36f9171eea | tuannt8/tuan-ercp | ERCP_contact_cut/CuttingSimulation_GPU/meanValueCoord.cpp | #include "StdAfx.h"
#include "meanValueCoord.h"
#include "releaseLog.h"
meanValueCoord::meanValueCoord(void)
{
m_container = NULL;
}
meanValueCoord::~meanValueCoord(void)
{
if (m_container)
{
delete m_container;
}
}
// void meanValueCoord::init( TopologyContainer* container, arrayVec3f* points, arrayVec3i* fa... | ALGO | 0.992208 | 3.649248 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2015-03-17T12:26: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": "23f778a02... |
65534523-078c-41ac-8a02-26d5ef91dfbe | tshev/sgl | src/sgl/test/src/sgl.v1.test.function.median3.cpp | #include <sgl/sgl.h>
namespace sgl {
namespace v1 {
namespace test {
void median3() {
{
int a[] = {1, 2, 3};
while (true) {
int* b[] = {&a[0], &a[1], &a[2]};
std::stable_sort(&b[0], &b[0] + 3, [](auto x, auto y) mutable { return *x < *y; });
assert(&sgl::v1::me... | TEST | 0.986816 | 6.015544 | {
"github_metadata": {
"branch": "master",
"commit_count": 291,
"repo_created_at": "2019-06-29T19:12:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f67b2746... |
6027ca95-73cb-47d7-9f83-afb71eb84445 | John-Ueberroth/tic-tac-toe | ticTacToe(Completed).cpp | //This is supposed to make a playable tic tac toe game to the console
//lets give it a shot
#include <iostream>
#include <string>
using namespace std;
int main()
{
//spaces, i'm sorry, I tried to do it the right way but I couldnt replace it with mark.
char space1='1';
char space2 = '2';
char space3 = '3';
char s... | ALGO | 0.982489 | 3.110694 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-07-01T22:24: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": "0090020fcfc2... |
1c35d1c6-29bc-4eb7-8770-c077a61c80c1 | kajikentaro/atcoder | atcoder/abc_old/200d.cpp | #include<bits/stdc++.h>
#include<atcoder/all>
#define rep(x,y) for(int x=0;x<y;x++)
#define rrep(x,y) for(int x=y-1;x>=0;x--)
#define orep(x,y) for(int x=1;x<=y;x++)
#define ll long long
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b)... | ALGO | 0.999911 | 3.394358 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2021-03-28T00:14: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": "64e7e65d... |
0014d21c-9136-4733-84f2-76b877836269 | FlyLikeSoarin/atp-cpp-semester-1 | Nikita_Chubarev/task_sum_products/sum_products.cpp | #include <iostream>
bool is_index_unused(int num_indexes, size_t*& indexes, size_t new_index){
for (int i = 0; i < num_indexes; ++i) {
if (new_index == indexes[i]) {
return false;
}
}
return true;
}
long long calculate(int current_array, size_t*& indexes, size_t*& starts_of_indexes,
... | ALGO | 0.99975 | 4.326838 | {
"github_metadata": {
"branch": "master",
"commit_count": 316,
"repo_created_at": "2021-09-21T05:30:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 16,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "97678f7... |
b0c5acc0-9095-46ea-afcc-f2f306fd1eda | NamSeok-Bae/Problem-Solving | 백준/Gold/1477. 휴게소 세우기/휴게소 세우기.cc | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int n,m,l;
vector<int> v;
int result;
int main() {
cin>>n>>m>>l;
for(int i=1;i<=n;i++) {
int num; cin>>num;
v.push_back(num);
}
v.push_back(0);
v.push_back(l);
sort(v.begin(), v.end());
in... | ALGO | 0.999995 | 3.636475 | {
"github_metadata": {
"branch": "main",
"commit_count": 171,
"repo_created_at": "2023-01-26T12: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": "2118796b42... |
df90018f-0ab9-4f47-aa93-5ee2a6f90aa1 | satyampandey9811/competitive-programming | 2. Leetcode/medium level/075. construct binary search tree from preorder traversal.cpp | // link to question - https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
... | ALGO | 0.999993 | 6.444278 | {
"github_metadata": {
"branch": "master",
"commit_count": 1478,
"repo_created_at": "2019-08-20T10:43: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": "e13b6bb... |
a07ff33d-8eb0-4be7-b1aa-15c90f6881bc | JJTam/COMP4411 | Modeler/kumaLSystem.cpp | #include "LSystem.h"
#include "kumaLSystemOP.h"
#include <list>
#include <map>
#include <vector>
using namespace std;
vector<LSystem*>* kumaLSystems = nullptr;
void kumaLSystemSetup()
{
if (kumaLSystems != nullptr)
{
return;
}
kumaLSystems = new vector<LSystem*>;
map<int, list<int> > oneMap;
map<int, pair<... | TOOL | 0.91263 | 3.009132 | {
"github_metadata": {
"branch": "master",
"commit_count": 301,
"repo_created_at": "2022-04-29T14:45: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": "c3f19bd3... |
931f4611-5d86-404d-ab88-c8ea1b7f58cd | Grzeszuk/Grafika-Sprawozdanie-1 | zadanie 5/zadanie 5.cpp | #include "stdafx.h"
#include "math.h"
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
using namespace std;
GLdouble ox = 0.0, oy = 0.0, oz = 0.0;
GLfloat xstep = 1.0f;
GLfloat ystep = 1.0f;
GLfloat windowWidth;
GLf... | TOOL | 0.983194 | 3.685267 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-03-14T16:17: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": "3bb010ec42... |
ed3ceaf0-4d94-4e15-9b82-3ba6a1ec9818 | ishandutta2007/codeforces-f | ftiasch/normal/1036/D.cpp | #line 1 "sol.cpp"
#include <bits/stdc++.h>
const int N = 300'000;
int n, m, a[N], b[N];
int main() {
scanf("%d", &n);
for (int i = 0; i < n; ++i) {
scanf("%d", a + i);
}
scanf("%d", &m);
for (int i = 0; i < m; ++i) {
scanf("%d", b + i);
}
if (std::accumulate(a, a + n, 0LL) != std::accumulate(b,... | ALGO | 0.999952 | 3.421079 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43: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": "c285a10392f3... |
a576b989-d847-4574-b0c3-c73c9501f442 | amanharsh3/random | sorting_&_searchin/Distinct Numbers.cc | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define endl "\n"
#define pb push_back
#define INF 1e18
#define all(x) begin(x), end(x)
#define print(a) for(auto &i: a) cout<<i<<" ";
const int mod = 1e9 + 7;
// cout << fixed << setprecision(0) << pi << endl;
... | ALGO | 0.99964 | 4.153379 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-06-21T18:55: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": "8eedd52bac0... |
14a021c0-51ce-464a-bb5a-4be9d8b7348d | tetat/Codeforces-Problems-Sol | Difficulty1000/967B.cpp | /// Problem Name: Watering System
/// Problem Link: https://codeforces.com/problemset/problem/967/B
/**
* winners never quit
**/
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long Long;
const int N = 1e6;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0)... | ALGO | 0.999954 | 3.704826 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2021-05-21T17:12: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": "62aa216bea4... |
a8e2e77a-7ef6-4a3d-bf51-22d40520b81c | davidbolin/ngme2 | src/include/solver.h | #ifndef __Solver__Solver__
#define __Solver__Solver__
#define COMPLEX R_COMPLEX
#include <Rcpp.h>
#undef COMPLEX
#include <iostream>
#include <string.h>
#include <Eigen/Dense>
#include <Eigen/LU>
#include <Eigen/Sparse>
#include "MatrixAlgebra.h"
class solver
{
private:
public:
int n;
solver(const solver &){};
... | ALGO | 0.999281 | 5.092562 | {
"github_metadata": {
"branch": "devel",
"commit_count": 882,
"repo_created_at": "2021-06-07T13:25:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0aa16ed2... |
e42813c1-004e-4e65-aea7-f394f7b4bf53 | AdaCompNUS/despot | examples/cpp_models/simple_rock_sample/src/simple_rock_sample.cpp | #include "simple_rock_sample.h"
#include <despot/core/builtin_lower_bounds.h>
#include <despot/core/builtin_policy.h>
#include <despot/core/builtin_upper_bounds.h>
#include <despot/core/particle_belief.h>
using namespace std;
namespace despot {
/* ====================================================================... | ALGO | 0.970602 | 6.39837 | {
"github_metadata": {
"branch": "API_redesign",
"commit_count": 241,
"repo_created_at": "2015-06-26T05:56:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 257,
"forks": 105,
"issues": 6,
"pull_requests": 2
},
"file_meta": {
"content_id": ... |
33f640ea-286b-40d2-9fcb-9e1a32c4d752 | Huqingnan123/MyLeetcode | 剑指Offer36.二叉搜索树与双向链表/剑指Offer36-二叉搜索树与双向链表.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
Node* left;
Node* right;
Node() {}
Node(int _val) {
val = _val;
left = NULL;
right = NULL;
}
Node(int _val, Node* _left, Node* _right) {
val = _val;
left = _left;
right = _right;
... | ALGO | 0.999998 | 6.092664 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2018-10-02T07:59: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": "a3f476e4... |
b8722b58-e471-4059-b614-c6f3a51216b6 | artem-fomin-by/StringProject | Krit3/main.cpp | #include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
const string wordsSourceFilepath = "source.txt";
constexpr char Separator = ';';
string filepath, outputFilepath;
getline(cin, filepath);
getline(cin, outputFilepath);
auto file = ifstream(filepath);
... | TOOL | 0.973286 | 3.596961 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-11-24T12:04: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": "dda3a6f8c44... |
8a765413-f599-4992-bd16-de9ce1dece2b | VastoLorde95/Competitive-Programming | Hackerrank/Ad Infinitum/Ad Infinitum 11/A.cc | #include<stdio.h>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<map>
#include<set>
#include<vector>
#include<utility>
#include<math.h>
#define sd(x) scanf("%d",&x);
#define sd2(x,y) scanf("%d%d",&x,&y);
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z);
using namespace std;
int t, n, k,... | ALGO | 0.999604 | 3.915517 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2017-07-25T11:08:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 171,
"forks": 41,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d7a46... |
bd18f47b-1450-405a-a1a2-2e438b563f31 | hyturing/Competitive-Programming | Codechef/Starter50/blimp.cpp | /**
* Author: hyturing
* Created:
**/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define sz(x) ((int)(x).size())
#define all(x) x.begin(),x.end()
#define endl "\n"
#define pb push_back
const int MOD = 1e9+7;
const int MM = 998244353;
const int N = 1e5+5;
const long long INF = 1e18... | ALGO | 0.999967 | 4.053583 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2021-06-22T01:38:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fcd9be485d... |
51f3c2f6-68a9-428d-8849-a075b0b77f62 | Manish-CS25/A2Z_DSA_Leetcode | 3434-find-the-number-of-distinct-colors-among-the-balls/find-the-number-of-distinct-colors-among-the-balls.cpp | class Solution {
public:
vector<int> queryResults(int limit, vector<vector<int>>& queries) {
int n = queries.size();
vector<int> ans(n);
set<int> sz;
unordered_map<int, int> mp;
unordered_map<int, int> freq; // Tracks occurrences of column values
for (int i = 0; i < ... | ALGO | 0.999918 | 6.421985 | {
"github_metadata": {
"branch": "main",
"commit_count": 1511,
"repo_created_at": "2024-05-11T08:34: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": "b5d55a7a1... |
14bbb1dd-ab64-45bd-92f9-ecba71ee08ae | duny31030/My_road_of_ACM | 中国石油大学OJ训练赛/3-p-02/G.cpp | /*
* =========================================================================
*
* Filename: G.cpp
*
* Link: http://exam.upc.edu.cn/problem.php?cid=1387&pid=6
*
* Version: 1.0
* Created: 2018/07/07 18时24分19秒
* Revision: none
* Compiler: g++
*
* Author:... | ALGO | 0.998833 | 4.381867 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2018-04-12T04:50: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": "67d9d5a15... |
6edcfea9-bfec-4194-9e2f-cf2907563da6 | Cybertron3/competitive | CC/testonly/KW6.cpp |
// from a scalar
#include<bits/stdc++.h>
using namespace std;
//#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define sd(x) scanf("%d",&x)
#define sld(x) scanf("%lld",&x)
#define pld(x) printf("%lld\n",x)
#define pd(x) printf("%d\n",x)
#define moder 1000000007
ll... | ALGO | 0.999693 | 3.465529 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-04-15T01:12: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": "b49d7f798... |
bf383586-e2f5-415a-8417-d3dd8a0ac860 | utkarsh123871/question-solving | Delete nodes having greater value on right - GFG/delete-nodes-having-greater-value-on-right.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void print(Node *root)
{
Node *temp = root;
while(temp!=NULL)
{
cout<<temp->data<<" ";
temp=temp->next;
... | ALGO | 0.999888 | 5.582312 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2023-07-04T13:59: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": "a7a6e0a8dc6... |
544d79d7-2afc-4a1d-a4ee-6bdff5e67e84 | madeibao/CTest | string/单词拆分.cpp |
// 解法四:动态规划
// 这道题同样适合用动规来做。我们这样来定义状态f(i):
// 当字符串s的子串[0, i] 能够被拆分,则f(i) = true
// 当字符串s的子串[0, i]不能被拆分,则f(i) = false
// 即 f(i) 代表着字符串s的某个前缀,是否能拆分。
// 对于状态转移,这样来考虑:我们枚举所有能进行拆分的位置(分割点),看能否转移过去即可。
// 求f(i)时,我们枚举分割点j ∈ [0, i - 1],字符串被切割成了两部分:[0, j],[j + 1, i]。只需要满足 f(j) = true 并且子串 [j + 1, i] 是 wordDict 中的字符串,则 f(i) =... | ALGO | 0.999808 | 4.468512 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2020-12-29T10:46:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "915d56ca... |
a41a3e91-e60c-42cd-8b20-2bc15a328375 | minhvpham/codeblock | tinhoc/roadrail.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define fu(a,b,c) for(int i=a;i<=b;i=i+c)
#define fd(a,b,c) for(int i=a;i>=b;i=i-c)
int m,n,x,y,z,h;
vector<int> a[20000];
vector<int> b[20000];
int f[200001],cha[200001],k[200001];
void dfs(int g)
{
for(int i=0; i<a[g].size(); i... | ALGO | 0.999926 | 3.640956 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-01-01T20:12:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "33dd773fea97... |
9b8918c7-e46b-491a-bf2c-5e6ff98ddb57 | cppikigai/algorithms_kata | solutions/leetcode_125.cpp | /*
* 125. Valid Palindrome
* https://leetcode.com/problems/valid-palindrome/
*/
#include <iostream>
#include <string>
class Solution
{
public:
bool isPalindrome(std::string s)
{
if (s.length() <= 1)
return true;
int left = 0;
int right = s.length() - 1;
while (... | ALGO | 0.998533 | 6.918624 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-03-10T21:56:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b15eb85ede... |
9e21de1b-01a4-4142-b264-f001ecf2d157 | pyyyyyyyyy/AI | main.cpp | #include <iostream>
#include <cmath>
#include <ctime>
#include<cstdlib>
using namespace std;
// 定义数组:colony[][]:种群数组 fitness[]:种群适应值 Distance[]种群距离 citydistance[]:各城市距离 best_path[]:最佳种群
// 定义变量:city_num:基因个数 pop_size:种群个数 improve_count:改良次数 itter_time:进化代数
// 相关概率: pm:变异概率 pc:交叉概率
const int city_num = ... | ALGO | 0.999992 | 3.335552 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-11-11T13:16: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": "964a7c4cdf... |
40eab4b7-9dd4-47cc-9f75-cb6ada38d885 | jkt10125/Competitive-Programming | Problems/D_-_1_Operation_2.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b, c) for(int i=(int)a; i<=(int)b; i+=(int)c)
#define F0R(i, n) for(int i=0; i<(int)n; i++)
#define F1R(i, n) for(int i=1; i<=(int)n; i++)
#define FORn(i, a, b, c) for(int i=(int)a; i>=(int)b; i+=(int)c)
#define F0Rn(i, n) for(int i=(int)n-1; i>=0; i--)
#... | ALGO | 0.999867 | 3.459137 | {
"github_metadata": {
"branch": "main",
"commit_count": 206,
"repo_created_at": "2022-09-18T00:42: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": "8b8f5f6991... |
d7c42680-8fb9-4fc1-ba2b-a8bf6dd5dc6d | omardoescode/competitive-programming | DataStructures/multiset.hpp | // Fenwick tree (OR) binary indexed tree
#pragma once
#include <bits/stdc++.h>
using namespace std;
template <typename T>
// assumes 0-indexing
struct BIT {
vector<T> arr;
BIT(int n) {
n = 1 << (int)ceil(log2(n));
arr.resize(n, 0);
}
BIT(const vector<T> &a) {
int n = 1 << (int)ceil(log2(a.size())... | ALGO | 0.999627 | 5.403712 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2025-02-01T16:01: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": "d5542008e01... |
dfad8191-a334-4723-b96c-999ffca75293 | zyin422/CPGrind | RD/TreeDistancesI.cpp | // #pragma GCC optimize ("trapv")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define IOS \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define endl "\n"
int INF, MOD;
vector<int> p1, p2;
vecto... | ALGO | 0.999997 | 4.657198 | {
"github_metadata": {
"branch": "main",
"commit_count": 138,
"repo_created_at": "2023-09-26T06:04:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e16178f31e... |
1470beda-c17d-486a-8363-d69548afc600 | durumi99/baekjoon | [카카오 인턴]두 큐 합 같게 만들기.cpp | #include <string>
#include <vector>
#include <queue>
using namespace std;
void popAndInsert(queue <int> &popQueue, queue <int> &insertQueue){
insertQueue.push(popQueue.front());
popQueue.pop();
}
long getSum(vector<int> queue){
long tmp = 0;
for(int i = 0 ; i < queue.size() ; i++)
tmp += queue[... | ALGO | 0.999971 | 4.353254 | {
"github_metadata": {
"branch": "master",
"commit_count": 689,
"repo_created_at": "2020-12-12T04:43: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": "f4e066c1... |
15e6e809-217e-4eff-8979-be4f8316215b | ChrisMaxheart/Competitive-Programming | Codeforces/Good Bye 2017/New Year and Curling.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool reversecompare(int a, int b)
{
return a > b;
}
int main ()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, r;
double dummy, itung;
int disk[1010];
double y[1010];
bool found;
cin >> n >> r;
for... | ALGO | 0.999937 | 3.833081 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2019-04-04T17:01:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d594d685... |
19d8223f-0c89-4aea-bfb3-2eabe2ec31f7 | xcf1992/leetcode | C++/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <stdio.h>
#include <map>
#include <set>
#include <numeric>
#include "extra_data_types.hpp"
using namespace std;
class Solution {
pub... | ALGO | 0.999741 | 5.865646 | {
"github_metadata": {
"branch": "master",
"commit_count": 1784,
"repo_created_at": "2017-12-26T04:19:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3eb9164... |
47dfe2e6-1dc3-438d-8ac8-478cea5680e5 | MarshalllG/RPEnumV3 | RP_Enumeration.cc | #include "RP_Enumeration.hh"
// Insert here the code in the method of class EnumerationWLOpt
void EnumerationRPOpt::First()
{ // insert first router
point router;
router.row = 0;
router.col = 0;
while (in.IsWall(router.row, router.col))
{
if (router.col < in.Columns()-1)
rout... | ALGO | 0.99086 | 4.132271 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-09-06T17:55: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": "52f714eb5dd9... |
6928695c-659a-45fc-96cf-bd3577f27c28 | bbalage/ProdSysHandIn | src/Optimizer/Optimizer.hpp | #ifndef PROD_SYS_HAND_IN_OPTIMIZER_OPTIMIZER_HPP
#define PROD_SYS_HAND_IN_OPTIMIZER_OPTIMIZER_HPP
#include <memory>
#include "../Planner/Planner.hpp"
#include "../Simulator/Simulator.hpp"
#include "../Evaluator/Evaluator.hpp"
#include "../util/output.hpp"
#include "../Model/Model.hpp"
class Optimizer
{
public:
O... | ALGO | 0.993539 | 6.528644 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2023-04-11T17:00: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": "f35b38172... |
f12e202c-e1ea-44ee-bfc5-5a299b3b5fdf | wg-perception/people | people_tracking_filter/src/mcpdf_pos_vel.cpp | /*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2008, <NAME>, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* ... | ALGO | 0.973715 | 6.055211 | {
"github_metadata": {
"branch": "melodic",
"commit_count": 238,
"repo_created_at": "2012-10-12T00:01:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 280,
"forks": 202,
"issues": 15,
"pull_requests": 10
},
"file_meta": {
"content_id": "13... |
a87f42c5-1971-46eb-9585-9c23c16086c7 | gabriel88766/C-CPP-AlgorithmsAndContests | Codeforces/1999/C.cpp | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
const ll INF_LL = 0x3f3f3f3f3f3f3f3f, MOD = 998244353; //1e9+7
const int INF_INT = 0x3f3f3f3f;
const long double PI = acosl(-1.), EPS = 1e-9;
using namespace std;
//cout << fixed << setprecision(6)
int main(){
ios_base::sync_wi... | ALGO | 0.999831 | 5.277568 | {
"github_metadata": {
"branch": "master",
"commit_count": 436,
"repo_created_at": "2020-08-21T00:21: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": "5b7d07f0... |
87ddb962-90e3-4a59-a4da-79a186b8c013 | qiaotian/CodeSprint | leetcode/cpp/qt_range_sum_query_2d_mutable.cpp | /**
* @Author: <NAME>
* @Date: 2016-08-04T14:22:43+08:00
* @Email: <EMAIL>
* @Last modified by: <NAME>
* @Last modified time: 2016-08-04T14:22:45+08:00
* @Inc: Google
* @Difficulty: Hard
* @Tag: Binay Index Tree, Segment Tree
*/
/*
Given a 2D matrix matrix, find the sum of the elements inside the rectangle define... | ALGO | 0.99989 | 6.384814 | {
"github_metadata": {
"branch": "master",
"commit_count": 675,
"repo_created_at": "2016-02-12T17:26:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "414f3807... |
0be19b4b-0d95-4730-a0e4-2272591a4a7e | ishandutta2007/codeforces-g | gustav/normal/69/B.cpp | #include <cstdio>
#include <cstring>
#define MAXN 105
#define MAXM 105
int N, M;
int l, r, t;
int c[ MAXM ];
int win[ MAXN ];
int best[ MAXN ];
int main( void )
{
scanf( "%d%d", &N, &M );
memset( win, -1, sizeof win );
memset( best, 0x3f, sizeof best );
for( int i = 0; i < M; ++i ) {
scanf( "%d%d%d%d"... | ALGO | 0.999561 | 4.014324 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60b6992dee23... |
f8997689-1403-4ac6-9013-93750fb6f4c5 | Amit3200/codes_algo | Interview Preparations/top_view_of_binary_tree.cpp | //author : '<NAME> @amit3200'
//it was all meant to happen as i was all talk!
#include <bits/stdc++.h>
using namespace std;
/* A binary tree node has data, pointer to left child
and a pointer to right child */
struct Node
{
int data;
struct Node* left;
struct Node* right;
};
void topView(struct Node *roo... | ALGO | 0.999939 | 3.86978 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-11-11T22:40:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "508f515f4... |
238dd044-da37-41a8-bf83-0e363d9d2396 | plter/spx4cocos2dx | cocos2d-x-2.2/projects/Spx4CC/Classes/spx4cc/CCUtils.cpp | /****************************************************************************
Author: Luma (<EMAIL>)
https://github.com/stubma/cocos2dx-common
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Softwa... | TOOL | 0.977912 | 5.064571 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2013-10-31T10:10:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad48664f40... |
152f02eb-7396-4540-bf0a-db946b7533f0 | ishandutta2007/codeforces-r | rednextcentury/normal/198/B.cpp | #include <bits/stdc++.h>
#define ii pair<bool,int>
#define s second
#define f first
#define OO 1e9
#define disout for(int i=0 ; i <= n+k ; i++)cout << dist[0][i] << ' ';cout<<endl;for(int i=0 ; i <= n+k ; i++)cout << dist[1][i] << ' ';cout << endl;
using namespace std;
const int N = 3e5 + 500;
bool Grid[2][N];
int d... | ALGO | 0.999959 | 3.645923 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58: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": "0295bc484ce5... |
c963b1af-2a24-4f44-b924-e0369340911c | HansGiesen/hls_tuner | prebuilt/hls/proj_cholesky/solution1/syn/systemc/cholesky_alt_4.cpp | #include "cholesky_alt.h"
#include "AESL_pkg.h"
using namespace std;
namespace ap_rtl {
void cholesky_alt::thread_bitcast_ln405_119_fu_4579_p1() {
bitcast_ln405_119_fu_4579_p1 = xor_ln405_59_fu_4573_p2.read();
}
void cholesky_alt::thread_bitcast_ln405_11_fu_2095_p1() {
bitcast_ln405_11_fu_2095_p1 = xor_ln40... | ALGO | 0.960585 | 3.147704 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2019-06-14T18:35:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fe284de0... |
f4dd8cde-7fe1-4481-a291-488c843920be | tugas-itb-erick/IF3230-Sistem-Paralel-Terdistribusi | Raft/src/raft_simulation.cpp | #include <raft_simulation.hpp>
namespace raft {
RaftSimulation::RaftSimulation(int cluster_size_){
cluster_size = cluster_size_;
servers.resize(cluster_size+1);
server_online.resize(cluster_size+1);
for( int i = 1; i <= cluster_size; ++ i ){
servers[i] = Server( cluster_size, i, Sender(this,i) );
server... | ALGO | 0.980361 | 5.09256 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2018-10-28T16:38:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cebc3030d6... |
f02f70d0-c8fd-43b1-b529-845cbe3d4e6b | jhonatheberson/data-structure | c++/listasLab/Aula6/q9.cpp | #include<iostream>
using namespace std;
typedef struct s{
char chave; // chave (conteúdo armazenado)
struct s *prox; // ponteiro para o próximo elemento
} No;
void empilha(No *topoP, char x, int &ind){
ind++;
No *novoNo = new No();
if(ind == 0){
novoNo->prox = NULL;
}else{
novoNo-... | ALGO | 0.999574 | 3.712914 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2019-10-10T20:15: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": "18be43209... |
7a3842a1-5a2d-477e-b5d5-76f5201bac2c | AMReX-Astro/Nyx | Source/TimeStep/Nyx_enforce_minimum_density.cpp | #include <Nyx.H>
#include <Nyx_enforce_minimum_density.H>
#include <constants_cosmo.H>
using namespace amrex;
void
Nyx::enforce_minimum_density( MultiFab& S_old, MultiFab& S_new,
#ifdef SDC
MultiFab& hydro_source,
MultiFab& reset_e_src,
#endif
... | ALGO | 0.9989 | 5.615267 | {
"github_metadata": {
"branch": "development",
"commit_count": 2430,
"repo_created_at": "2016-08-02T19:03:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 96,
"forks": 37,
"issues": 3,
"pull_requests": 3
},
"file_meta": {
"content_id": "4... |
3f0fad0a-95ea-4895-a6e0-d4f54fe18a0c | samirali123/BSTShelter | lab3.cpp | // <NAME>
// lab3.cpp
// CPSC2430
// Professor Diaz
// Purpose: Facilitaing a team to allow them to search for entities (Pets) by name, and gathering other
// information about said entity, such as age. We store the information in a BST
// Note: Possible improvements: Failsafe feature for if a Pet with the same name ... | TOOL | 0.992196 | 4.752202 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-10-23T21:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41857d44de94... |
0e882d97-770f-4467-bcbf-372bd68874b8 | david2du/david_training | gao/2020/Unit1/homework/hm-B.cpp | #include <bits/stdc++.h>
using namespace std;
struct S
{
int val;
int nxt;
};
const int MAXN = 200000;
S s[MAXN];
int head, tot;
int num;
void buildLink()
{
int i = 0;
for (i = 0; i < num; i++)
{
cin >> s[i].val;
tot++;
if (i > 0)
{
s[i - 1].nxt ... | ALGO | 0.99995 | 3.879626 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2020-01-13T12:39:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8eedddad... |
d5552e6e-4f3b-4a72-8604-33c29fae1fb7 | papyrussolution/OpenPapyrus | Src/Include/mariadb/server/private/bounded_queue.h | /* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the ho... | TOOL | 0.9942 | 6.3024 | {
"github_metadata": {
"branch": "master",
"commit_count": 979,
"repo_created_at": "2017-01-05T07:15:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 259,
"forks": 67,
"issues": 10,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8fc... |
1df74c15-a263-4d79-b420-94373a3159ea | selfboot/LeetCode | Math/343_IntegerBreak.cpp | /*
* @Author: <EMAIL>
* @Last Modified time: 2016-07-04 15:01:50
*/
class Solution {
public:
/*
Magic factor 2 and 3.
Break the numbers into magic factor only 2 and 3 if number >= 4,
Then we will get the max product.
If we break a number N into two factors x, N-x, product is p=x(N-x).
To g... | ALGO | 0.999978 | 5.570398 | {
"github_metadata": {
"branch": "master",
"commit_count": 174,
"repo_created_at": "2015-09-14T06:47:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1123,
"forks": 318,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "54b... |
4b743da8-848a-414e-a722-31a1daa58b09 | saketrule/hackerrank_top_solutions_dataset | kruskalmstrsub/cpp/maheshmhegade.cpp | #include <iostream>
#include <map>
#include <vector>
#include <set>
#include <cstring>
#define ii pair<int,int>
using namespace std;
void fillArr(int *id_arr, int *size_arr, int graph_size){
for(int idx=0; idx<graph_size; idx++){
size_arr[idx] = 1;
id_arr[idx] = idx;
}
}
int getRoot(int *id_a... | ALGO | 0.999883 | 4.282898 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-03-12T09:26:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03651a1b9e... |
d2ed717c-02b1-4377-a691-780bbbb50032 | Aishuav01/cs721-AdvancedAlgorithmsAnalysis | maxima.cpp | // <NAME>
#include <iostream>
#include <fstream> // For input and output files
#include <algorithm> // Needed for sort()
#include <map> // Needed for map<double, double> bst
#include <cstring>
using namespace std;
class Point
{ public:
void setMaximal(){
maximal = true;
} // Sets maxi... | ALGO | 0.996197 | 3.914001 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-02-26T20:51: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": "43f8599a0b52... |
80b27622-e27b-4d47-bed8-544ff1e56188 | Yawn-Sean/Daily_CF_Problems | daily_problems/2025/02/0228/personal_submission/cf1468k_lengli.cpp | /*
lengli_QAQ
Hope there are no bugs!!!
*/
#include <bits/stdc++.h>
#define fastio std::ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0)
#define all(x) x.begin(),x.end()
#define pb push_back
#define i64 long long
void solve(){
std::string s;
std::cin>>s;
std::vector<int> dx={1,0,-1,0},dy={0,-1,0,... | ALGO | 0.999871 | 3.857046 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "81a2... |
7bd0ad3c-bd25-468d-8a89-9ca9dd7821fa | CheaSim/ACM | 专题/字符串/a.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define per(i,a,n) for(int i=(n-1);i>=(a);i--)
#define fi first
#define se second
typedef pair <int,int> pII;
typedef long long ll;
const int INF = 0x3f3f3f3f;
//head
typedef unsigned long long ull;
const int maxn = 1e5+10;
ull xp[... | ALGO | 0.999933 | 3.491606 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-08-01T14:04: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": "1cb07f35c... |
e069cc21-b374-481d-b48e-26bf3e4f82fd | DawnteaStudio/TIL | coding-test/Baekjoon/10000/10828.cpp | #include <iostream>
#include <vector>
#include <sstream>
#include <string>
using namespace std;
void command_print(string command, vector<int> &v)
{
if(command == "top")
{
if(v.size() == 0)
cout << -1 << '\n';
else
cout << v.back() << '\n';
}
else if(command == "size")
{
cout << v.si... | ALGO | 0.945437 | 4.426227 | {
"github_metadata": {
"branch": "main",
"commit_count": 1633,
"repo_created_at": "2023-04-27T15: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": "625c47fac... |
965c0795-82d0-4a73-9d61-d547fc7f4b4a | rdkit/rdkit-orig | Code/SimDivPickers/Wrap/MaxMinPicker.cpp | // $Id$
//
// Copyright (C) 2003-2008 <NAME> and Rational Discovery LLC
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#define NO_IMPORT_AR... | ALGO | 0.974493 | 6.212065 | {
"github_metadata": {
"branch": "master",
"commit_count": 1953,
"repo_created_at": "2012-08-17T08:43:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23,
"forks": 16,
"issues": 8,
"pull_requests": 2
},
"file_meta": {
"content_id": "ee91a7... |
624b0cea-62e1-4bf9-8ae5-5823978bec4f | Clqsin45/acmrec | codeforpro/508D Tanya and Password.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 200005
map<string, int>f;
int fa[N];
string dir[4000];
string temp;
vector<int> vec[4004];
stack<int>ans;
string ch;
int deg[N];
void dfs(int x){
int y;
while(!vec[x].empty()){
y = vec[x].back();
vec[x].pop_back();
dfs(y);
}
... | ALGO | 0.999996 | 3.443867 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-11-28T03:37: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": "2d50108548... |
74642167-8123-4b9c-82e2-f9433cfaf019 | NorMstu3593/Data_Structure | 散列表查找.cpp | #include <iostream>
using namespace std;
#define MAX 1000
typedef struct node {
int key; //关键字域
node* next; //指针域
} node, *link;
int p; //除留余数法的p值
node hashtab[MAX]; //结点数组,用于存放每个单链表的头指针地址
void get_prime(int n) {
bool find_prime = false;
for (int i = n; i >= 2; i--) {
... | ALGO | 0.999963 | 3.9039 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-07-08T16:11: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": "063f764bd8a9... |
f9674bc5-d7d7-4040-b0ba-c20eb4391053 | ishandutta2007/codeforces-x | xuanquang1999/normal/655/D.cpp | //84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i, r, l) for(int i = (r); i >= (l); --i)
#define ft... | ALGO | 0.999886 | 3.222095 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8799e68059ee... |
153eded4-ea2c-4274-baba-35a3f3291a40 | vimal-ai/dsa-cp | binary_tree/travelApplication.cpp | int search(int arr[], int start, int end, int key){
for(int i=start;i<=end;i++){
if(key == arr[i]) return i;
}
}
Node* buildFromPre(int pre[], int in[], int start, int end){
if(start>end) return NULL;
static int idx = 0;
int curr = pre[idx];
idx++;
Node* node = new Node(cu... | ALGO | 0.999954 | 4.83602 | {
"github_metadata": {
"branch": "master",
"commit_count": 136,
"repo_created_at": "2021-06-01T11:53: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": "7f20bf9e... |
19561a12-4b96-4c83-985c-8b23509c8b61 | srilali26/csa0652-DAA | 15.daa.cpp | #include <stdio.h>
#include <stdlib.h>
void add(int n, int a[n][n], int b[n][n], int result[n][n]) {
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
result[i][j] = a[i][j] + b[i][j];
}
void subtract(int n, int a[n][n], int b[n][n], int result[n][n]) {
for (int i = 0; i < n; i++)
... | ALGO | 0.999978 | 5.618537 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-24T06:42: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": "8634410febec... |
e0ab7419-6c99-4a6a-bc0b-89fd351e40c3 | paras-13/DSA | CPP/Number Theory/sieveOfEratosthenes.cpp | // Print all primes smaller than or equal to n using sieve algorithm
// Time Complexity:
//? Naive Approach: O(N*sqrt(n))
//? Sieve Alogorithm: O(N* log(logN));
#include <iostream>
#include <vector>
using namespace std;
bool isPrime(int n) {
if(n == 1) return false;
if(n==2 || n==3) return true;
if(n%2 =... | ALGO | 0.999938 | 5.218929 | {
"github_metadata": {
"branch": "main",
"commit_count": 299,
"repo_created_at": "2023-08-10T10:18: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": "d08ad033a8... |
9451617c-82cc-4dff-a822-371aae6383e9 | makogo82/MatlabProject | ENEA/IRE_REF/matlabFileSource/ire_delta_ref.cpp | //
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: ire_delta_ref.cpp
//
// MATLAB Coder version : 3.1
// C/C++ source code generated on : 14-Apr-20... | ALGO | 0.997081 | 5.900479 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2015-02-24T12:39: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": "6c5788b74... |
ec1f0bbf-2706-45b6-afdd-a56a9278d156 | ioperations/leetcode | cc/1996_the_number_of_weak_characters_in_the_game.cc | // This is a personal academic project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java:
// https://pvs-studio.com
/*You are playing a game that contains multiple characters, and each of the
characters has two main properties: attack and defense. You are given a 2D
integer ... | ALGO | 0.999854 | 5.531255 | {
"github_metadata": {
"branch": "master",
"commit_count": 587,
"repo_created_at": "2022-12-03T15:39:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04a20a64... |
5627c921-ad89-4f9d-aacb-1718aa453a19 | plasm-language/pyplasm | src/xge/unwrapper.cpp | #include <xge/xge.h>
#include <xge/unwrapper.h>
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
static Triangle2i triangleProject(int texturedim,float fa... | ALGO | 0.991165 | 4.281863 | {
"github_metadata": {
"branch": "master",
"commit_count": 271,
"repo_created_at": "2011-09-15T08:40:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 57,
"forks": 26,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7545a... |
5374e064-3ad0-4beb-9c5b-aa72cd5c86d1 | Shiro1214/HuffmanEncoding | TextCompression301.cpp | // TextCompression301.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#pragma
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "Node.h"
#include <chrono>
#include <time.h>
#include <streambuf>
#include <unordered_map>
#include <math.h>
using... | ALGO | 0.999216 | 3.802047 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-10-06T09:46: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": "690cddacba... |
5bcfd700-3216-4cff-b49b-38ded53c0575 | shoraaa/CompetitiveProgramming2021 | CoHuong/2-10/vvcan.cpp | #include <bits/stdc++.h>
#define print(_v) for (auto &_ : _v) {cerr << _ << ' ';} cerr << endl;
using namespace std;
void file() {
const string FILE_NAME = "vvcan";
freopen((FILE_NAME + ".inp").c_str(), "r", stdin);
freopen((FILE_NAME + ".out").c_str(), "w", stdout);
}
using ll = long long;
using ld = long double... | ALGO | 0.999976 | 4.119952 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-12-18T11:41:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "287356b4f074... |
591cf9a3-bb78-40d4-8c1a-e4154bd0d061 | LirazBalas1/matala--4-cpp | main.cpp | //<EMAIL>
//211801220
//<NAME>
#include "tree.hpp"
#include "complex.hpp"
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <SFML/Graphics.hpp>
#include <cmath>
#include <sstream>
using namespace std;
//depth tree
template <typename T>
int levels_tree(Node<T>* node) {
if (!n... | ALGO | 0.998495 | 3.614213 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-02T19:18: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": "6bd21fe9f47c... |
04ee6175-02fb-4ce2-839c-6d633b197a91 | prasant8717/leetcode | mergeStonesminimumcost.cpp | class Solution {
public:
int mergeStones(vector<int>& stones, int k) {
int n = stones.size();
if (((n - 1) % (k - 1)) != 0)
return -1;
vector<int> vs(n + 1);
for (int i = 1; i <= n; ++ i)
vs[i] = vs[i - 1] + stones[i - 1];
vector<vector<vector<int>>> v... | ALGO | 0.99986 | 5.248834 | {
"github_metadata": {
"branch": "main",
"commit_count": 579,
"repo_created_at": "2024-10-24T02:50:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e8dcebad3... |
645a4d75-699c-4f6d-9f89-db827298cd53 | OpenSpace/OpenSpace | modules/telemetry/src/util.cpp | /*****************************************************************************************
* *
* OpenSpace *
* ... | TOOL | 0.961249 | 5.095013 | {
"github_metadata": {
"branch": "master",
"commit_count": 12070,
"repo_created_at": "2015-07-01T15:59:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 882,
"forks": 139,
"issues": 600,
"pull_requests": 6
},
"file_meta": {
"content_id": "7... |
4905b6a9-9118-44a3-94c1-9bab81c53837 | mileniummi/Algorithms_2019-20 | lab_3(Heaps)/Radix_sort(Цифровая сортировка).cpp |
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int ASCII(char a) {
int b = a;
return b;
}
char symbol = 'a';
string str[1000];
int count_mass[26];
void countSort(int n, int k)
{
for (int i = 0; i < 26; i++)
{
count_mass[i] = 0;
}
string temp_str[1000];
... | ALGO | 0.999976 | 3.677106 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-01-10T11:30: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": "6edbf9868b22... |
eaa2cd2b-bdb1-4a74-9a17-de7f96a94879 | EliLillyCo/LillyMol | src/Utilities/GFP_Tools/gfp_server.cc | /*
A server for doing gfp searches
Comminucates with clients via ZeroMQ with
data transferred via serialized protocol buffers.
*/
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <fstream>
#include <iostream>
#include <memory>
#include <optional>
#include <queue>
#include <string>
#include ... | WEB | 0.976227 | 5.084759 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2018-03-22T13:39:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 107,
"forks": 37,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "94072b2... |
855561cb-7f67-44a2-9cfe-d4ba8c133ced | YottabyteM/Parallel | Lab4/Gaussian_normal_MPI.cpp | #include<stdio.h>
#include<cmath>
#include<mpi.h>
const int N_[10] = { 16, 32, 64, 128, 256, 512, 1024, 2048, 3072, 4096 };
const int total_count[10] = { 10000, 1000, 200, 25, 3, 1, 1, 1, 1, 1 };
float m[4096][4096];
void set(int N) {
const int MIN = -2, MAX = 2;
for (int i = 0; i < N; i++)
{
for (int j = 0; j ... | ALGO | 0.999786 | 4.040505 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2023-03-12T12:19: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": "5605d7b5e... |
50a83d72-3664-4241-941a-bed4b07326b2 | velincegorgiev/QtWinSoft | zadaci_od_stl/01_2.cpp | // 2.Преклопи го printArray така што ќе добие уште два целобројни аргументи lowSubscript и highSubscript.
// Повик на оваа функција треба да ги отпечати елементите помеѓу lowSubscript и highSubscript.
// Ако нивните вредности излегуваат од димензиите на полето, printArray треба да врати 0, во спротивно бројот
// на ... | ALGO | 0.994137 | 5.301126 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-11-18T20:26: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": "b54440370e2c... |
8e965638-784f-40cc-9f93-ec9b684b8440 | johnnoG/OOP_Cpp_home-assignments | HW1/HW1/Exp.cpp | //
// func.cpp
// HW1
//
// Created by <NAME> on 28/10/2022.
//
#include "Exp.hpp"
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
void createExpression(Expression* &Exp){
for (int i = 0; i < 2; i++) {
cout << "enter the "<< i+1 <<" number: " <... | TOOL | 0.998393 | 4.511538 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-11-12T12:05: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": "b784e8690cf7... |
ab9d06ab-29aa-4b7b-9bdd-128b660ffc52 | pizibing/swingengine | SEFoundation/SEBase/SEHashTable.inl | // Swing Engine Version 1 Source Code
// Most of techniques in the engine are mainly based on <NAME>'s
// Wild Magic 4 open-source code.The author of Swing Engine learned a lot
// from Eberly's experience of architecture and algorithm.
// Several sub-systems are totally new,and others are re-implimented or
// re-organ... | ALGO | 0.943893 | 5.339895 | {
"github_metadata": {
"branch": "master",
"commit_count": 833,
"repo_created_at": "2015-04-15T02:44: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": "43421b8b... |
abd621fd-49d3-489a-8b99-847778cd0dba | ICS3U-Programming-JosephK/Unit3-04-CPP | integer.cpp | // Copyright (c) 2022 Immaculata HS All rights reserved.
//
// Created by: <NAME>
// Created on: Oct 11 2022
// This program checks if an integer is a positive, negative, or zero
#include <iostream>
int main() {
// initializing variables
int secretNumber, userInteger;
int guess;
// Asking for user f... | ALGO | 0.954606 | 4.531723 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-10-12T00:04:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14527521c06c3... |
b8fb8804-8348-4647-9b9e-7d3dcb3dd6d5 | minghsu0107/workspace | C++/Practice2/minDollar.cc | #include <iostream>
using namespace std;
int c[6]={1,5,4,2,7,3};
int val[6]={1,1,1,1,1,1};
int arr[101];
int print[101];
int find(int m){
arr[0]=0;
for(int k=0;k<=m;k++){
bool found=false;
int min=0;
for (int i=0;i<6;i++){
if(k>=c[i]){
int v=val[i]+arr[k-c[i]]... | ALGO | 0.999903 | 3.550248 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2019-09-30T19:27: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": "97bd84eec... |
e7813b97-4752-4680-812d-8af1520e385d | opencodeiiita/Code-Digger | Tasks/task5-Jhandu_Bam/RayLikesAnime.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mp make_pair
#define ss second
#define ff first
#define db cout<<"Here"<<endl
const int mod=1e9+7;
void dfs(vector <int> g[], int vertex, bool vis[]){
vis[vertex]=true;
for(int child : g[vertex]){
if(vis[c... | ALGO | 0.999953 | 4.055434 | {
"github_metadata": {
"branch": "main",
"commit_count": 405,
"repo_created_at": "2022-12-17T18:28:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23,
"forks": 77,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "b9dc46489... |
47e22781-8d72-4e87-be75-65a59e9f0a09 | zjtone/hafumanCode | 哈夫曼编码_最小堆_2/哈夫曼编码_最小堆_2/BinTreeNode.h | #ifndef _BINTREENODE_H
#define _BINTREENODE_H
#include"word.h"
template<class T>
struct BinTreeNode{
T value;
BinTreeNode *leftChild;
BinTreeNode *rightChild;
BinTreeNode(){
leftChild = rightChild = NULL;
}
BinTreeNode(T v){
value = v;
leftChild = rightChild = NULL;
}
BinTreeNode(T v , BinTreeNode<T> *lef... | ALGO | 0.988354 | 3.277866 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-01-08T03:49: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": "f99e1f7857... |
53eedbe2-0ef9-49bb-b9e2-72274d6933d6 | cat-on-laptop/study | 백준/Gold/2239. 스도쿠/스도쿠.cc | #include <iostream>
#include <vector>
#include <cstdlib>
#include <string>
#define endl '\n'
using namespace std;
int arr[9][9], cnt;
vector<pair<int, int>> pos;
bool check(int row, int col){
int ROW = (row / 3)*3;
int COL = (col / 3)*3;
// 세로 줄 확인
for(int i = 0; i < 9; ++i){
if(i == row) con... | ALGO | 0.999931 | 4.653359 | {
"github_metadata": {
"branch": "main",
"commit_count": 379,
"repo_created_at": "2022-05-30T07:42: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": "b3c70d725a... |
45b09096-591d-4521-af61-32b871e4f47d | harish2222/Data-Structures | main.cpp | #include <iostream>
#include <utility>
using namespace std;
class student;
int main()
{
int x;
cin >> x;
student st;
for (int i = 0; i > x; i++){
st.get_data();
st.display_data();
}
return 0;
}
class student{
public :
static string st_name;
static int reg_no;
... | ALGO | 0.983695 | 3.303165 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2022-01-26T13:19: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": "49576d2a0... |
e292f926-d1bd-4079-9ea2-3597fa0b5f9e | bvquoc/CP-Trainning-2021 | 0 - Contest 2020/Ninh Binh PreVNOI 2017/PREVNOIB/Contestants/Ti089/TEAWORLD.cpp | //
// main.cpp
// TEAWORLD.cpp
//
// Created by QuangHuy on 12/3/17.
// Copyright © 2017 QuangHuy. All rights reserved.
//
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iomanip>
#include <stack>
#include <deque>
#include <queue>
#include <... | ALGO | 0.999874 | 3.721597 | {
"github_metadata": {
"branch": "master",
"commit_count": 611,
"repo_created_at": "2020-06-03T07:47:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b585401c... |
2020ce52-89c4-4713-a04e-edc2ab52224e | TelegramMessenger/Telegram-iOS | third-party/openh264/third_party/openh264/src/codec/processing/src/vaacalc/vaacalculation.cpp | /*!
* \copy
* Copyright (c) 2013, Cisco Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above co... | TOOL | 0.913074 | 6.745444 | {
"github_metadata": {
"branch": "master",
"commit_count": 28524,
"repo_created_at": "2018-11-14T18:06:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6895,
"forks": 1916,
"issues": 531,
"pull_requests": 45
},
"file_meta": {
"content_id":... |
2a87dc0e-0a14-4006-bf89-dfaf5b386a5e | fsjhhh/acm_title | cpp/nk/67746/I.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <iomanip> // std::fixed std::setprecision(x) 保留x位小数
#include <array>
#include <bitse... | ALGO | 0.999986 | 3.493655 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-10-30T10:57: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": "b597c2f14ae... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.