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 |
|---|---|---|---|---|---|---|---|
b42c73eb-a671-49df-8cc5-3fb5fa9a8c58 | KwanwooKo/Problem-Solving | JongmanBook/boardcover.cpp | #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#define endl '\n'
using namespace std;
class Solution {
private:
int n, m, ans;
int map[21][21];
int block[4][2][2] = {
{ {0, 1}, {1, 0} },
{ {0, 1}, {1, 1} },
{... | ALGO | 0.999287 | 4.18845 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2022-02-06T08:34: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": "a1cd2a21453... |
de92d902-fbd6-44fc-a570-0483e1712db4 | guzy0324/ray_tracing | moving_sphere.h | #ifndef MOVING_SPHERE_H
#define MOVING_SPHERE_H
#include "rtweekend.h"
#include "hittable.h"
#include "aabb.h"
class moving_sphere : public hittable {
public:
__device__ moving_sphere() {}
__device__ moving_sphere(
point3 cen0, point3 cen1, float _time0, float _time1, float r, materi... | ALGO | 0.980428 | 6.701815 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2020-12-29T09:10:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b10f6656228... |
56b4bb89-a335-48dc-8671-9fa1e1390595 | stan-dev/math | stan/math/prim/fun/rep_matrix.hpp | #ifndef STAN_MATH_PRIM_FUN_REP_MATRIX_HPP
#define STAN_MATH_PRIM_FUN_REP_MATRIX_HPP
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/err.hpp>
#include <stan/math/prim/fun/Eigen.hpp>
namespace stan {
namespace math {
/**
* Implementation of rep_matrix returning an Eigen matrix with scalar
* type equal to... | TOOL | 0.975876 | 6.986112 | {
"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": ... |
79cbd4aa-d651-478e-b5bf-54c25fa0eb85 | iamslash/learntocode | leetcode/BestMeetingPoint/a.cpp | /* Copyright (C) 2019 by iamslash */
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <algorithm>
// // 556ms 7.26% 9.9MB 75.86%
// // Q. G can be empty()?
// // Q. what is the range of count of '1'?
// // brute force
// // O(YXN) O(N)
// // N: count of 1
// class Solution {
// privat... | ALGO | 0.999773 | 5.556212 | {
"github_metadata": {
"branch": "master",
"commit_count": 2102,
"repo_created_at": "2020-11-23T21:43:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "273250b... |
41772164-16c3-42fd-a057-27c9109861c9 | tumbris/Algo_lab1_sorting | src/Tests.cpp | #include <Tests.h>
#include <Sortings.h>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <vector>
#include <sstream>
#include <random>
#include <future>
#include <map>
#include <iomanip>
namespace std
{
template <>
struct less<sg::TestConfig>
{
bool operator()(const sg::TestCon... | TEST | 0.9532 | 6.585932 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-05-08T19:58: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": "47842af84... |
410dc0b8-56e7-46a4-a326-988efdaf1a28 | Akash-Deb-Nath/problem-solving | CodeForces/NewRating.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll t;
cin >> t;
while (t--)
{
ll n;
cin >> n;
vector<ll> a(n + 1);
for (ll i = 1; i <= n; i++)
{
... | ALGO | 0.999972 | 5.002542 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-05-27T14:16:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2fd1579dd9... |
c6428ab9-4726-48f5-9f6f-1189e7d8da80 | pmonasse/polarect | libOrsa/orsa.hpp | /**
* @file orsa.hpp
* @brief Model estimation by ORSA (aka AC-RANSAC) algorithm.
* @author <NAME>, <NAME>
*
* Copyright (c) 2011,2020 <NAME>
* Copyright (c) 2011 <NAME>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser Gene... | ALGO | 0.996961 | 7.524652 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2021-02-02T07:45: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": "6d6be3dc7... |
7f29e5d6-af41-4a85-808e-9a43cfb24e61 | cutbm2015/NTUSTOOP_WKTai_Project1 | Project01/Integer.cpp | #include "Integer.h"
void Integer::operator=(const Integer other) {
this->value = other.value;
this->inf = other.inf;
this->positive = other.positive;
}
Integer Integer::operator+(Integer other) {
Integer self = *this;
//-5 + 3
// 3 - 5
if (positive == false && other.positive == true) {
... | ALGO | 0.945907 | 4.03568 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-02-24T12:06: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": "f7ba005b44... |
7abfe09d-cb14-4d1e-85a1-664a7e2484f4 | someshjoyguru/dsa-cp | contests/all_submissions/Stones.cpp | #include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
double dp[41][41][41][41][2]; // DP array to store probabilities
bool computed[41][41][41][41][2]; // Memoization array
// Recursive function to calculate probability of Alice winning
double probability(int R1, int B1, int R2, int B2, in... | ALGO | 0.997709 | 5.295311 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2023-12-27T13:13: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": "268436d1d0c... |
3efe8e39-7fa4-432b-9352-b111a5250692 | xianyujoyyy/my_projects | data_structure/HuffmanTree.h |
#include <string>
#include <limits.h>
using std::string;
class HfTree {
public:
struct HfCode {
char word;
string code = "";
};
HfTree(char* _words, int* _weight, int _size)
: length_(2 * _size) {
queue_ = new HfNode[length_];
for (int i = _size; i < lengt... | ALGO | 0.999824 | 3.664818 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-04-02T10:51:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3eb92c87... |
ff685b56-6bd8-4698-b280-e83bf428ce71 | DouMiaoO-Oo/note | jianzhi_offer(剑指offer)/二叉搜索树的最近公共祖先.cpp | /**
* struct TreeNode {
* int val;
* struct TreeNode *left;
* struct TreeNode *right;
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* };
*/
class Solution {
public:
/**
* @param root TreeNode类
* @param p int整型
* @param q int整型
* @return int整型
*/
int lowestCommon... | ALGO | 1 | 6.261442 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2018-07-31T12:56: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": "b3f21e64a... |
725491fe-11f6-48b5-a30a-70db2b7d6958 | ishandutta2007/codeforces-b | barichek/normal/832/C.cpp | #include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
using namespace std;
typedef long long li;
const int MAX = 1e6;
struct line
{
double a, b;
set<line>::iterator self;
double eval(double x) const { return a * x + b; }
bool operator<(const line& l) const;
double inter(... | ALGO | 0.999695 | 4.042526 | {
"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": "88ceb0a9455e... |
db293363-8504-4cce-aafc-68822c553821 | GDieser/Ejercicios-C-1C | 4- C++ U4 CICLOS COMBINADOS - CORTE DE CONTROL/eje26.cpp | #include <iostream>
#include <ctime>
using namespace std;
int main() {
srand(time(0)); // Inicializar la semilla para generar números aleatorios
// Mensaje de bienvenida
cout << "Bienvenido al juego de piedra, papel o tijera!" << endl;
// Opciones del juego
string opciones[3] = {"piedra", "papel... | ALGO | 0.966963 | 5.336297 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-04-07T15:25: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": "d7d576aba4a... |
dfd2c453-fc05-477b-8ece-01cfa597800c | CherryGS/ACM | _cf/contest/1535/c.cpp | #include <map>
#include <set>
#include <cmath>
#include <queue>
#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
#define ull unsigned long long
#define cint const int&
#define Pi acos(-1)
const int mod = 1e9+7;
const int inf_int ... | ALGO | 0.999879 | 3.565677 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2021-10-29T11:11: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": "0dfd1c09b... |
1f84d12b-7b19-4217-9f4f-30faaedf6ce8 | sxs-collaboration/spectre | src/Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/DampedWaveHelpers.cpp | // Distributed under the MIT License.
// See LICENSE.txt for details.
#include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/DampedWaveHelpers.hpp"
#include <cmath>
#include <cstddef>
#include "DataStructures/DataVector.hpp"
#include "DataStructures/Tags/TempTensor.hpp"
#include "DataStructures/TempBuf... | ALGO | 0.998569 | 7.441288 | {
"github_metadata": {
"branch": "develop",
"commit_count": 17103,
"repo_created_at": "2017-04-07T17:28:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 168,
"forks": 202,
"issues": 530,
"pull_requests": 57
},
"file_meta": {
"content_id": ... |
f4621502-9e13-4e1a-bf5b-d9e00ccb98cd | sugyan/atcoder | abc133/b/main.cpp | #include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int main() {
int n, d;
cin >> n >> d;
vector<vector<int>> x(n, vector<int>(d));
for (int i = 0; i < n; ++i) {
for (int j = 0; j < d; ++j) {
cin >> x[i][j];
}
}
int answer = 0;
for (int i... | ALGO | 0.999941 | 3.718831 | {
"github_metadata": {
"branch": "master",
"commit_count": 716,
"repo_created_at": "2019-02-09T16:06:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7344e93e... |
c70793c3-46c0-44ff-9719-04cdb216f0f3 | BrunoGentile/tpIntegradorFinalProgramacion | funciones.cpp | #include "Juego.h"
#include <iostream>
#include <cstdlib>
#include <ctime>
#include "rlutil.h"
void inicializarSemilla() {
std::srand(std::time(NULL)); // Inicializar la semilla para generación de números aleatorios
}
void jugarUnJugador(std::string & jugadorConMayorPuntajeNombre, int & puntajeMayor) {
std::... | TOOL | 0.972502 | 3.947898 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-06-28T15:24:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73bbe66d66... |
834b6b3b-8ac2-4183-a7e0-db1dc39a4ad0 | ishandutta2007/codeforces-m | monogon/normal/1393/B.cpp |
#include <bits/stdc++.h>
#define ll long long
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
#define pii pair<int, int>
#define rep(i, a, b) for(int i = (a); i < (b); i++)
using namespace std;
template<typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
... | ALGO | 0.999843 | 4.37123 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1e2a2bef8de... |
acc1f95d-fd40-4e77-a2ba-f42eae0681ea | ishandutta2007/codeforces-h | hollwoq_pelw/normal/1015/F.cpp | /*
// is short or still long ???
hollwo_pelw's template(short)
// Note : -Dhollwo_pelw_local
*/
#include<bits/stdc++.h>
using namespace std;
void FAST_IO(string filein = "", string fileout = "", string fileerr = ""){
if (fopen(filein.c_str(), "r")){
freopen(filein.c_str(), "r", stdin);
freopen(fileout.c_str(), ... | ALGO | 0.999857 | 3.892628 | {
"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": "99b6f62e1ef4... |
569cd63a-7bbf-4976-b4c2-8a63879103e8 | Aman100/Design-Patterns | SOLIDDesignPrinciple/Liskov Substitution Principle/Rule3_4/eg2.cpp | /*
Third, Fourth rules are related to DataType.
*/
#include<bits/stdc++.h>
using namespace std;
class Base
{
public:
long long int powerOfTwo(int num)
{
return 1LL<<num;
}
};
void caller(Base &b, int num)
{
long long int res=b.powerOfTwo(num);
cout<<res<<endl;
}
//Above code written in year 2022.
//Below code is wri... | ALGO | 0.999539 | 5.497754 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-03-22T17:06: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": "12c6b1f41c6... |
5792cdb7-7327-4466-9347-576faaaf2c08 | ashcode07/c--begin | MENU.CPP | //menu program
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include<process.h>
void getval();
void display();
void add();
void search(int sk);
void modify(int ak);
void del(int ak);
void menu()
{
int choice;
do{
clrscr();
cout<<"\n\n\t\t MAIN MENU OF FLIPKART";
cout... | TOOL | 0.968629 | 3.144248 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-11-11T20:01: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": "01038821de... |
8756834c-676d-41dd-9391-55f47bce3e42 | Matheus-Aguilar/Competitive-Programming | Codeforces/Gym/2023 ICPC Gran Premio de Mexico 2da Fecha (104412)/k.cpp | #include<bits/stdc++.h>
#define optimize ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long
#define MAXN 1100
using namespace std;
int n, k;
int g[MAXN][MAXN];
int main(){
optimize;
cin >> n >> k;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
... | ALGO | 0.99998 | 4.291479 | {
"github_metadata": {
"branch": "master",
"commit_count": 170,
"repo_created_at": "2020-03-12T18:00:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d78ddac... |
37366093-f49b-44ef-a113-d842979a9970 | Alex-Tsvetanov/Informatics | codes/Alex/Национални състезание по информатика (България)/Olimp/2015-2016/I/SMG/C/AIC/stepen.cpp | #include <iostream>
#include <vector>
#include <utility>
#include <cmath>
using namespace std;
const int maxX = 1000000000;
vector < pair < int, int > > ans;
int main ()
{
cin.tie (nullptr);
ios::sync_with_stdio(false);
int X;
cin >> X;
///*
for (int a = sqrt (X) ; a >= 2 ; a --)
{
... | ALGO | 0.999191 | 3.634637 | {
"github_metadata": {
"branch": "master",
"commit_count": 282,
"repo_created_at": "2015-09-19T19:14:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "d428b8fd... |
66d1b7d3-b924-49b5-8e33-1629324f88c6 | okuchap/cppAlgo | 16B.cpp | #include<iostream>
using namespace std;
#define MAX 100000
int partition(int A[], int p, int r){
/* Aの最後の要素を分割の基準にする */
int x, i, j, swap;
x = A[r];
i = p - 1; /* iは基準より小さいグループの中で一番右端に位置するものを指すポインタ */
for (j = p; j < r; j++){
if (A[j] <= x)
{
i = i + 1;
swap ... | ALGO | 0.999758 | 5.097923 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-10-19T06:12: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": "a346d3575c... |
a53b9ece-f772-4a78-8fbd-35bafcda7368 | marcoarceo/Priority-Queue-Parallel-Processors | minHeap.h | #pragma once
#include "job.h"
#include <iostream>
#include <string>
#include <queue>
#include <vector>
using namespace std;
class minHeap
{
public:
minHeap();
minHeap(int processor);
~minHeap();
bool insertJob(string jobDescription, int nProcs, int nTicks); // Inserts the job to waitQueue
job findShortest... | ALGO | 0.984293 | 4.68997 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-11-02T01:52:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d863bda65... |
5048df78-947d-423a-b84d-9618dc9dad91 | NavyaBattu201/Transaction_Management_System | sll.cpp | #include "sll.h"
#include <algorithm>
#include <iostream>
sll::sll() {
first = new sllnode;
last = new sllnode;
first = last = nullptr;
len = 0;
}
void sll::GX(int k) {
int count = 0;
sllnode *temp = first;
while (temp != nullptr) {
if (temp->currbal >= k) {
count++;
... | ALGO | 0.999843 | 4.053983 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-07T15:34: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": "c4cbba72c2fc... |
9a464f52-95dd-413a-81c5-344ef82cac01 | ishandutta2007/codeforces-b | barichek/normal/1696/C.cpp | //#pragma GCC optimize("Ofast", "unroll-loops")
//#pragma GCC target("sse", "sse2", "sse3", "ssse3", "sse4")
#ifdef __APPLE__
# include <iostream>
# include <cmath>
# include <algorithm>
# include <stdio.h>
# include <cstdint>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bit... | ALGO | 0.999937 | 4.21802 | {
"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": "d87876fa94a5... |
3dfa5a0d-3b21-4f4c-b74a-902f740600b3 | timprepscius/GeometricTools | WildMagic5/SamplePhysics/RoughPlaneParticle2/RoughPlaneParticle2.cpp | // Geometric Tools, LLC
// Copyright (c) 1998-2013
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
//
// File Version: 5.0.0 (2010/01/01)
#include "RoughPlaneParticle2.h"
WM5_WINDOW_APPLICATION(RoughPl... | ALGO | 0.912704 | 5.634814 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2013-04-04T19:48:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f1a04d7... |
6b5563bc-870f-4d96-9d99-2b9fa7fca617 | CalvinNeo/ACM | SRC/hhu3.1005.cpp | //#include <iostream>
//#include <fstream>
//#include <vector>
//#include <queue>
//#include <cstring>
//#include <string>
//#include <algorithm>
//#include <stack>
//#include <functional>
//#include "stdlib.h"
//#include "time.h"
//#include <set>
//#include <map>
//#include <queue>
//#include <string.h>
//#include <... | ALGO | 0.999836 | 3.372233 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2016-10-18T09:05: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": "1ba2ab7c1a... |
69b77ead-18d7-497e-a7a5-66e49fccdef9 | 0s4l/cloaked-archer | software/FSM_library/ignore/utilities.h | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <utility>
#include <algorithm>
#include <stack>
#include <bitset>
#include <cmath>
void printBlockingStates(vector<FSM_struct>& FSMArr, vector<bool>& accessed, vector<bool>& coaccessed, Event_wrapper& Events)
{
//Open... | ALGO | 0.989987 | 4.139135 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2013-09-10T16:14:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2758bba8b... |
cdeb60b2-8444-4517-aeaf-e52ac373054b | dreamsxin/example | algorithm/算法的乐趣代码/code11/calendar2/sun.cpp | #include "stdafx.h"
#include <math.h>
#include "calendar_const.h"
#include "sun.h"
#include "vsop87_data.h"
#include "support.h"
#include "nutation.h"
double CalcPeriodicTerm(const VSOP87_COEFFICIENT *coff, int count, double dt)
{
double val = 0.0;
for(int i = 0; i < count; i++)
val += (coff[i].A * co... | ALGO | 0.999765 | 4.915823 | {
"github_metadata": {
"branch": "master",
"commit_count": 2757,
"repo_created_at": "2014-12-02T09:30:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 184,
"forks": 51,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "3cb2... |
c4f25daf-5506-4de5-b122-9c45c730e8dd | qqricky/XCPC_Tranning | nk22_3C.cpp | #include <bits/stdc++.h>
#define ll long long
#define INF 0x3f3f3f3f
const int N=5e5+10;
using namespace std;
ll ans=0;
struct state {
int len,link;
int ch[26]={};
};
state st[2*N];
int sz, last;
void sam_init() {
//ind[0]=INF;
sz = last = 0;
st[0].len = 0;
st[0].link = -1;
}
void sam_extend (char cc) {
... | ALGO | 0.999975 | 3.785028 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-11-23T06:42: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": "f62692c714... |
1c106aae-fcaa-4cbf-a4af-9ccf2c24b6e2 | nikhilsourav/Data-Structures-and-Algorithms | 12. Linked List/03 DLL/06. Insert at pos/insert.cpp | /*
// https://bit.ly/3qHNdnQ
Given a doubly linked list insert a node at given position
The item's index should be the given index (pos) after insertion
list [1<=>2<=>3]
item: 70, pos = 1 (0-based index)
output: [1<=>70<=>2<=>3]
*/
#include <bits/stdc++.h>
using namespace std;
// Node class... | ALGO | 0.999918 | 5.714742 | {
"github_metadata": {
"branch": "master",
"commit_count": 181,
"repo_created_at": "2021-07-09T05:37:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 70,
"forks": 19,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff9527... |
693d6ee1-7190-4f56-a58a-791fe72dd53f | nxson2004/Kattis-Solutions | brexitnegotiations.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int>> g;
vector<bool> seen;
vector<int> in, cost, f;
void dfs(int x) {
seen[x] = 1;
f[x] = cost[x];
for (int v : g[x]) {
if (!seen[v]) dfs(v);
f[x] = max(f[x], f[v] + 1);
}
}
int main() {
scanf("%d", &n);
g.re... | ALGO | 0.999498 | 3.508234 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2021-04-20T16:05:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "addb02e90... |
afe3ea27-57f0-4b9f-98ec-70978535d7e3 | bvquoc/CP-Trainning-2021 | 0 - Contest 2020/PreVOI2019/PreVOI2019-Day2/Contestants/Ti158/paint.cpp | #include <bits/stdc++.h>
#define For(i,a,b) for(int i = a; i <= b; ++i)
#define Ford(i,a,b) for(int i = a; i >= b; --i)
#define maxN 1000001
#define fi first
#define se second
#define Bit(x, i) ((x >> i) & 1)
#define fast_read ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
struct pii
{
in... | ALGO | 0.999927 | 3.698957 | {
"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": "12228371... |
4a3fbc8a-54e7-412b-8e6b-1d6cd6c7bac4 | jasonliao/cpp-beginner | cola-machine.cpp | /*
*
* Requires:
* variables, data types, and numerical operators
* basic input/output
* logic (if statements, switch statements)
*
* Write a program that presents the user w/ a choice of your 5 favorite beverages (Coke, Water, Sprite, ... , Whatever).
* Then allow the user to choose a beverage by entering a nu... | TOOL | 0.92926 | 3.607666 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-05-29T16:00:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92a7d0d69a... |
38addc39-ea8f-429d-8314-b6afec6feede | ppdog0/poj | POJ/Skill/2785.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
const int MAX_N = 4e3 + 10;
//输入
int n;
int A[MAX_N], B[MAX_N], C[MAX_N], D[MAX_N];
int CD[MAX_N * MAX_N]; //C和D中数字的组合方法
void solve() {
// 枚举从C和D中取出数字的所有方法
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
CD[i * n + j] = C[i]... | ALGO | 0.999937 | 4.024281 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2020-08-29T02:58: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": "dd8f1a070... |
dab25b2b-4bca-4996-b3b7-4df4c0f036a2 | Ashis1811/LeetCode | 2665-minimum-time-to-repair-cars/2665-minimum-time-to-repair-cars.cpp | class Solution {
public:
bool helper(vector<int>& ranks, int cars, long long mid)
{
long long totalCar = 0;
for(auto rank : ranks)
{
totalCar += sqrt(mid / rank);
if(totalCar >= cars) return true;
}
return false;
}
long long repairCars(vect... | ALGO | 0.99998 | 5.658331 | {
"github_metadata": {
"branch": "main",
"commit_count": 974,
"repo_created_at": "2025-03-05T18:44: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": "df9ac17815... |
529113ee-fb84-444b-8b09-dc74008e8999 | gagang033/system-design | lld/cache-system/cpp/main.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int key;
Node *next,*prev;
Node(int key){
this->key=key;
this->prev=this->next=nullptr;
}
};
class DoublyLinkedList {
public:
Node *head,*tail;
DoublyLinkedList(){
t... | ALGO | 0.999488 | 4.687533 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-08-16T07: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": "285fab23d00... |
32dd2e9e-0fbe-4838-9749-44b7ab94538b | aman4374/DSA- | binarysearch.cpp | // #include<iostream>
// #include<vector>
// using namespace std;
// int binarysearch(vector<int> arr, int target){ // iterative code
// int st=0;
// int end=arr.size()-1;
// while(st<=end){
// int mid = st+((end-st)/2);
// if(arr[mid] == target){
// return mid;
// }
// ... | ALGO | 0.999942 | 5.264838 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-02-23T15: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": "19ff2b5fc115... |
be92b022-6db4-48a6-a0a5-9d4d0762bee9 | lyccrius/OI-Solution | Luogu/P2901 [USACO08MAR]Cow Jogging G.cpp | #include <iostream>
#include <vector>
#include <deque>
#include <queue>
typedef std::vector<int> vic;
typedef std::deque<int> diq;
const int maxN = 1000;
const int maxM = 1e4;
const int maxK = 100;
const int inf = 1e9;
int n, m, k;
int u, v, w;
int h[maxN + 10];
struct Graph {
struct Vertex {
int head;
... | ALGO | 0.999993 | 4.44966 | {
"github_metadata": {
"branch": "main",
"commit_count": 653,
"repo_created_at": "2022-09-28T05:47: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": "1a5f288fca... |
ad350342-bb13-4194-b98f-8e3ee8b8cf90 | sanyamsinghal/Data_Structures_And_Algorithms | CSES_Problem_Set_TreeAlgorithms_Section/TreeDiameter.cpp | /*
User:- sanyam
*/
#include <bits/stdc++.h>
using namespace std;
#define ip(x) \
ll x; \
cin >> x;
#define op(x) cout << x;
#define pb push_back
#define mp make_pair
#define ll long long int
#define mod 1000000007
#define w(t) \
int t; \
cin >> t while (t--)
#define triplet pair<int, pair<int, ... | ALGO | 0.998537 | 3.756894 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2020-04-08T00:26: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": "5aafe3a7b... |
4b02f4a0-9bac-4377-a677-c63f1356e7b6 | kaichenhong/Coding_Practice | LeetCode/0039_Combination Sum_Medium/0039_Combination Sum_Medium.cpp | /**
* LeetCode: 39. Combination Sum (Medium)
*
* Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target.
*
* The same repeated number may be chosen from candidates unlimited numb... | ALGO | 0.999982 | 6.365784 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2019-08-25T14:27: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": "cd222e53... |
a731a7a0-845b-4811-846c-89ee3ff03b49 | Gecode/gecode | gecode/search/cutoff.cpp | /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* <NAME> <<EMAIL>>
*
* Contributing authors:
* <NAME> <<EMAIL>>
*
* Copyright:
* <NAME>, 2013
* <NAME>, 2013
*
* This file is part of Gecode, the generic constraint
* development environment:
* htt... | TOOL | 0.97752 | 6.774236 | {
"github_metadata": {
"branch": "master",
"commit_count": 5620,
"repo_created_at": "2015-11-06T07:33:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 309,
"forks": 77,
"issues": 40,
"pull_requests": 9
},
"file_meta": {
"content_id": "1c5b... |
a9340ecb-1406-4cb4-b734-8df675c53497 | anonymoussrm/cheat | followpos.cpp | #include<iostream>
#include<stdlib.h>
#include<string.h>
using namespace std;
string p[20],first[20],temp,s;
static string follow;
int n;
void abc(string ,char);
string Firstpos(char a)
{int i=0; string str;
while(first[i][0]!=NULL)
{
if(first[i][0]==a)
str=first[i];
i++;
}
str.erase(str.begin());
... | ALGO | 0.999079 | 3.280618 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-05-05T12:45: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": "019c796145... |
cee5ba1e-1b99-41f3-a3df-c8ef3fc805e9 | developeSHG/Algorithm-Baekjoon_Programmers | 프로그래머스/lv2/1844. 게임 맵 최단거리/게임 맵 최단거리.cpp | #include<vector>
#include<queue>
using namespace std;
/*void dfs(int x, int y, int acc, vector<vector<int>>&maps)
{
maps[x][y] = acc;
for (size_t i = 0; i < 4; ++i)
{
const auto nx = x + dir[i][0],
ny = y + dir[i][1];
if (nx < 0 || nx >= maps.size() || ny < 0 || ny >= maps[0].... | ALGO | 0.999823 | 4.706857 | {
"github_metadata": {
"branch": "main",
"commit_count": 339,
"repo_created_at": "2023-01-12T06:47: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": "b29be7a226... |
d3998c3c-a683-43c2-85ab-6798ddb1b555 | nhatminh2947/LightOj | CTU 3/F.cpp | //******************************************************************
// Coded by: <NAME>
// Problem Code:
// Verdict:
//******************************************************************
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
... | ALGO | 0.999831 | 3.918456 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2014-06-23T12:16:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0b7d6cb95... |
2a5f9581-9bf4-401c-99cc-a72cf2e9bef1 | ishandutta2007/codeforces-r | rnsiehemt/normal/568/A.cpp | #include <bits/stdc++.h>
#define sz(x) ((int)((x).size()))
#define mod(x) ((x)%Mod)
typedef long long ll;
template <typename T> bool domin(T &a, T b) { return (b < a ? (a = b, true) : false); }
template <typename T> bool domax(T &a, T b) { return (b > a ? (a = b, true) : false); }
const int Max = 1*1000*1000 + 200*100... | ALGO | 0.999658 | 3.677487 | {
"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": "a89565a9997a... |
1d1f5a55-aa44-4e74-9943-452c823b38b7 | GaneshMaurya/Data-Structures-in-C-and-Python | C,C++/search_in_graph.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
using namespace std;
#define V 5
int visited[V];
vector<int> adj[V];
void addEdge(vector<int> adj[], int u, int v)
{
adj[u].push_back(v);
adj[v].push_back(u);
}
void search_dfs(int node, int n)
{
visited[node] = 1;
stack<int> s;... | ALGO | 0.999855 | 3.422653 | {
"github_metadata": {
"branch": "master",
"commit_count": 305,
"repo_created_at": "2020-08-19T07:05: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": "66430bd3... |
317dd9a5-6f7c-41a9-ba24-3b3f1a088c9a | Traydr/vu-procedural-programming | hw/03/3-1/main.cpp | #include <iostream>
// Description of task
// Write a program that sums only positive numbers from all entered numbers. Display the sum. If you entered the negative number the program stops.
bool tryAgain()
{
char answer;
std::cout << "Would you like to try again? (y)\n";
std::cin >> answer;
return answer == 'y';... | ALGO | 0.994812 | 4.05522 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-09-26T05:38: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": "24d6e5fa9a8... |
a92f5104-16fb-46fc-8c2f-2780979fee13 | Kushagra-Madhukar/dsa_practice | Find the number of islands - GFG/find-the-number-of-islands.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to find the number of islands.
void dfs(vector<vector<char>>& grid, int i, int j, int vis[][501]) {
int n = grid.size();
int m = grid[0].size();
if(i<0 || ... | ALGO | 0.999781 | 6.662242 | {
"github_metadata": {
"branch": "main",
"commit_count": 198,
"repo_created_at": "2022-04-21T03:32: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": "b0974aa80c... |
e05b2053-1ea1-4de9-a5c5-565566df84a9 | hoshinon57/Algorithm | AtCoder/ABC001-100/ABC061-080/ABC062-C.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long ll;
// const ll INF64 = 1LL << 60;
const ll INF64 = ((1LL<<62)-(1LL<<31)); // 10^18より大きく、かつ2倍しても負にならない数
const int INF32 = 0x3FFFFFFF; // =(2^30)-1 10^9より大きく、かつ2倍しても負にならない数
template<cla... | ALGO | 0.999869 | 4.19906 | {
"github_metadata": {
"branch": "master",
"commit_count": 2016,
"repo_created_at": "2022-04-21T13:54: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": "6e22030... |
694020ff-4c67-4b9b-8a87-289101033428 | oltex/library | function/function.h | #pragma once
#include <utility>
#include <cmath>
namespace library {
template<typename type, typename size_type = unsigned long long>
inline constexpr auto fnv_hash(type const& key) noexcept -> size_type {
constexpr size_type _fnv_offset_basis = sizeof(size_type) == 4 ? 2166136261U : 14695981039346656037ULL;
con... | ALGO | 0.989305 | 6.004558 | {
"github_metadata": {
"branch": "main",
"commit_count": 410,
"repo_created_at": "2024-06-01T20:01: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": "a10296e7a0... |
18388675-840f-4cff-a563-62beb1639599 | treecode/Bonsai | runtime/src/load_kernels.cpp | #include "octree.h"
#include "devFunctionDefinitions.h"
void octree::load_kernels() {
//If we arrive here we have acquired a device, configure parts of the code
//Get the number of multiprocessors and compute number of
//blocks to be used during the tree-walk
nMultiProcessors = devContext->multiPr... | ALGO | 0.99038 | 3.816457 | {
"github_metadata": {
"branch": "master",
"commit_count": 1020,
"repo_created_at": "2012-04-14T14:16:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 71,
"forks": 28,
"issues": 4,
"pull_requests": 1
},
"file_meta": {
"content_id": "9a4be... |
800705e0-e4d2-4b10-be44-cf95ef8fe360 | liuchuo/PAT | BasicLevel_C++/1078. 字符串压缩与解压 (20).cpp | #include <iostream>
using namespace std;
int main() {
char t;
cin >> t;
getchar();
string s, num;
getline(cin, s);
int cnt = 1;
if (t == 'D') {
for (int i = 0; i < s.length(); i++) {
if (s[i] >= '0' && s[i] <= '9') {
num += s[i];
} else {
... | ALGO | 0.999529 | 3.424364 | {
"github_metadata": {
"branch": "master",
"commit_count": 703,
"repo_created_at": "2016-01-06T05:06:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3399,
"forks": 809,
"issues": 44,
"pull_requests": 9
},
"file_meta": {
"content_id": "ee... |
5af4322e-6cf4-4994-918b-b7d93c15d744 | imranur-rahman/LightOJ-Solutions | Data Structures/Codeforces - 180A.cpp |
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define vpii vector<pii>
#define vvpii vector<vpii>
#define vvi vector<vi>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define sz size()
#define ll long long
#define FOR(i, k, n) for(int i=(i... | ALGO | 0.999985 | 3.580416 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-05-02T16:15: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": "9664ce2481... |
2f3a2412-58d9-475c-b33b-1c0e9f8e44d5 | aayushverma1802/The-Lazy-Song | BrahMos/450_Delete_Node_in_a_BST.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.999998 | 5.811737 | {
"github_metadata": {
"branch": "main",
"commit_count": 1126,
"repo_created_at": "2022-09-05T15:28:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2784b5ada... |
47880d52-f069-46f6-a692-d9d13df21770 | tsingcoo/NJUWA | GenAlign/pre_process.h | //
// Created by 王青龙 on 04/11/2016.
//
#ifndef INCREALIGN_PREPRO_H
#define INCREALIGN_PREPRO_H
#include <string>
#include <fstream>
#include <sstream>
#include <unordered_map>
#include <vector>
#include <iostream>
class PrePro{
public:
void readFile(std::string str){
std::ifstream fin(str);
std::... | DATA | 0.908339 | 4.104741 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-05-31T04:13:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0836ce523... |
8d4c7516-e492-4fa0-a5ab-8c53a9d07dc9 | MiniMIP-Opt/MiniMIP | minimip/data_structures/strong_sparse_vector.h | // Copyright 2024 the MiniMIP Project
//
// 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 agree... | TOOL | 0.908811 | 5.908192 | {
"github_metadata": {
"branch": "main",
"commit_count": 497,
"repo_created_at": "2022-03-17T11:40:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a87cc7169ae... |
bd6503af-4ae2-4bc7-9a67-473fe64e1a88 | 2694048168/C-and-C-plus-plus | ModernCppChallenge/CH10_ArchiveImageDatabase/problem_79/main.cpp | /**
* @file main.cpp
* @author <NAME> (<EMAIL>)
* @brief Finding files in a ZIP archive
* @version 0.1
* @date 2024-01-27
*
* @copyright Copyright (c) 2024
*
*/
#include "ziplib/ZipArchive.h"
#include "ziplib/ZipFile.h"
#include <cstddef>
#include <filesystem>
#include <iostream>
#include <regex>
#include ... | TOOL | 0.96905 | 6.436824 | {
"github_metadata": {
"branch": "master",
"commit_count": 344,
"repo_created_at": "2020-08-08T16:47:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 58,
"forks": 18,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f50fb3... |
f2283ca8-5bc7-491f-8830-73fab7171d0f | somasekhar-udatha/DSA | reverseLevelOrderTraversal.cpp | #include <iostream>
using namespace std;
#include<queue>
#include<stack>
class Node{
public:
int data;
Node* left;
Node* right;
Node(int d){
this->data = d;
Node* left = NULL;
Node* right = NULL;
}
};
Node* buildTree(Node* root){
cout<<"enter da... | ALGO | 0.999956 | 4.608613 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-06-20T16:36: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": "3ea48fc1d65... |
856eae13-b158-4b45-a9e0-24ce803d1da6 | gatordan82/Cpp-for-C-Programmers | Ch2/gcd.cpp | /**********************************************************************
Filename: gcd.cpp
Chapter: 2 Native Types and Statements
Compiler: Borland C++ Version 5.01 Summer 1998
C++ for C Programmers, Edition 3 By <NAME>
************************************************************... | ALGO | 0.999325 | 5.730257 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2016-09-15T00:44:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0657d24db... |
649fc059-70c9-484b-8238-af5271de97f5 | chenghuipeng/topcoder2 | examples/2.5/Dijkstra2.cpp | /** @file
* @brief Dijkstra
* @author malin
* @date
* @version 2.0
* @note
* Using the adjacency list method.
*/
#include <iostream>
#include <vector>
#include <string>
#include <limits>
#include <algorithm>
#include <math.h>
#include <queue>
using namespace std;
const int MAXINT = numeric_limits<int>:... | ALGO | 0.999823 | 4.622291 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-09-21T14:17: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": "6aa07f799a... |
1f021bb6-022e-4044-8b4e-17e03ab40762 | tarunsinghdev/DSA-CRACKER | Arrays/20_RearrangeTheArrayInAlternatingPositiveAndNegativeItemsWithO1ExtraSpace.cpp | #include<bits/stdc++.h>
using namespace std;
/* Approach 1 : If ordering was not important we can simply separte the positive values to one side and negative value to the other and then rearrange them alternatively
int main(){
int n;
cin>>n;
vector<int >v(n);
for(auto &it : v) cin>>it;
int k = n-1, j = 0;
whil... | ALGO | 0.999999 | 4.521918 | {
"github_metadata": {
"branch": "main",
"commit_count": 127,
"repo_created_at": "2020-10-16T12:13:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 110,
"forks": 65,
"issues": 9,
"pull_requests": 19
},
"file_meta": {
"content_id": "c8e7bd... |
8d6271e4-c33b-423d-bc8a-d5ec0e0ab1e0 | Amit-priyu/Data-Structure-Algorithm | Grpah/5.noOfIsland.cpp | #include<bits/stdc++.h>
using namespace std;
// finding the no of connected island...
void bfs(int r,int c,vector<vector<int>>&vis,vector<vector<char>> graph){
vis[r][c]=1;
queue<pair<int,int>> q;
q.push({r,c});
int n=graph.size(); int m=graph[0].size();
while(!q.empty()){
int r=q.front().f... | ALGO | 0.999609 | 5.170472 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-12-24T16:57: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": "a1755c0c5de... |
9e7e6413-c483-457a-ae38-9148d76c2999 | Anup0099/450DSA_Question | out/production/DSA_Babber/BinaryTree/addtwonumber.cpp | #include <bits/stdc++.h>
using namespace std;
// Consider an array a1,a2,…,an
// consisting of numbers 1
// and −1
// . Define A
// -characteristic of this array as a number of pairs of indices 1≤i<j≤n
// , such that ai⋅aj=1
// .
// Find any array a
// with given length n
// with A
// -characteristic equal to the ... | ALGO | 0.99986 | 4.407095 | {
"github_metadata": {
"branch": "main",
"commit_count": 2046,
"repo_created_at": "2021-08-16T08:40:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4be94dab6... |
bd12a9ac-27ab-4bd7-946b-8c0d61c057a8 | aushafy/cpp-bubble-short | bubble_sort.cpp | #include<iostream>
#include<conio.h>
#include<stdio.h>
using namespace std;
void swap(int *xp, int *yp) // membuat fungsi swap
{
int temp = *xp;
*xp = *yp;
*yp = temp;
}
// A function to implement bubble sort
void bubbleSort(int arr[], int n)
{
int i, j;
for (i = 0; i < n-1; i++)
... | ALGO | 0.99997 | 4.720335 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-07-16T13:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2df7a7e41... |
ba45e9c1-407e-4abb-a420-5344ae681832 | JACazares/6.5320-Final-Project | test.cpp | #include "kd-tree.h"
#include "range-tree.h"
#include <iostream>
#include <chrono>
#include <vector>
using std::cout;
using std::vector;
int N = (int)1e7;
Range search_range = Range(Point(12000, 1567), Point(46000, 27000));
vector<Point> points;
vector<pair<Point, int>> points_with_index;
void kd_test()
{
KDNode... | ALGO | 0.991017 | 4.591212 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-05-08T03:40: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": "c84193715524... |
194889ae-e11d-43eb-aed5-dfac5f9395de | Haipm26/learningC | code c/contest 10 26 den 30/Untitled1.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <string.h>
//int comp(const void *a, const void *b){
// char *x = (char *)a;
// char *y = (char *)b;
// return x - y;
//}
//
//int main(){
// char c[100000];
// gets(c);
// qsort(c, strlen(c), sizeof(char), comp);
// int cnt[1000] = {... | ALGO | 0.999991 | 3.42136 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-03-28T06:14: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": "a1658f0042... |
22708f41-90ec-414c-bff8-a619dcb689d2 | Tassa/PokemonGamma | Pokemon Gamma/Pokemon Gamma/exp.cpp | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// Pokemon Gamma Engine //
// Garazbolg 10/01/2014 //
// ... | ALGO | 0.931874 | 3.578573 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2014-05-08T01:23: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": "c0685e410... |
45f01d7e-dfab-4b55-95c3-2fb245042c8c | Jerrysun7617/CodeBlock-Without-Chinese-Path | Structure and Algorithms/Binary Search/Local Minimum/The_leftest_position/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int findPos(vector<int> arr, int n) {
// write code here
int pos = -1;
if(arr.empty() || n == 0)
return -1;
//
if(arr[0] > n || arr[n-1]<0)
return -1;
int left = 0;
int right = n - 1;
int mid = 0;
while(left ... | ALGO | 0.999977 | 4.650743 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-06-24T10:39: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": "ba14a8bde4... |
b6eddf4c-e4bf-4f64-86b0-3c85defd7d5b | arulkolla/competitive-programming | codeforces/1307/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = 200007;
const int MOD = 1000000007;
void solve() {
int n, m, k;
cin >> n >> m >> k;
int a[k + 7];
for (int i = 0; i < k; i++) {
cin >> a[i];
}
vector<int> g[n + 7];
int e1, e2;
for (int i = 0; i < m; i++) {
cin >> e1 >> e2;
g[e1].push_back(e... | ALGO | 0.999977 | 3.701515 | {
"github_metadata": {
"branch": "master",
"commit_count": 849,
"repo_created_at": "2021-01-12T05:23:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ad6fc3d... |
ad56ec54-a92c-4ddc-8fb2-d1316e2e58f8 | amad00r/practica-pro2 | program.cc | /** @mainpage Simulación del rendimiento de procesadores interconectados.
<NAME>, grupo 12. Cuatrimestre Primavera 2023. FIB UPC.
@file program.cc
@brief Programa principal de la práctica de PRO2 (Simulación del rendimiento de procesadores interconectados).
*/
#include "ProcesosPendientes.hh"
#include "... | ALGO | 0.956127 | 4.15733 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2023-03-30T19:54: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": "1a8d06d0c... |
2fad25eb-4e78-4541-b9be-7f5c77456256 | adrianbg/kaldi.js | src/bin/thresh-post.cc | // bin/thresh-post.cc
// Copyright 2012 Johns Hopkins University (Author: <NAME>)
// See ../../COPYING for clarification regarding multiple authors
//
// 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... | DATA | 0.951228 | 7.020453 | {
"github_metadata": {
"branch": "js",
"commit_count": 7477,
"repo_created_at": "2017-09-24T20:08:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 61,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4acb1a5404... |
aa2d3bf4-020b-4e91-b148-11cb60f323e9 | taracoelho3/CS-375 | projects/coelho_t_p4/BST.cpp | #include "BST.h"
BST::BST(Node* root_node){
root = root_node;
}
Node* BST::get_root(){
return root;
}
void BST::set_root(Node* r){
root = r;
}
std::string BST::search(Node* x, int k){
if (x == nullptr){
return "Element " + std::to_string(k) + " not found in tree. Took ";
}
else if (k == ... | ALGO | 0.998104 | 3.944567 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-03-04T17:15: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": "2313e73ae0... |
4c7d6e68-398b-4f18-a35c-606986ef5bb0 | moooyo/algorithm-solution | leetcode/664-奇怪的打印机/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <cstring>
using namespace std;
#define _DEBUG
class Solution
{
public:
int strangePrinter(string s)
{
int len = s.length();
int dp[len][len];
for (int i = 0; i < len; i++)
{
dp[i][i] = 1;... | ALGO | 0.999985 | 3.991262 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-05-07T14:38: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": "8c1a5cf3057... |
f1038e10-907a-44ec-8c31-9c212e75ef15 | xvzc/algorithms | boj/solved/11047/20241105_111554_main.cpp | #include <bits/stdc++.h>
#ifdef LOCAL
#define IF_LOCAL if constexpr (true)
#else
#define IF_LOCAL if constexpr (false)
#endif
#define debug IF_LOCAL std::cout << "[DEBUG]" << ' '
#define endl '\n'
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef unsigned long lon... | ALGO | 0.999994 | 4.168721 | {
"github_metadata": {
"branch": "main",
"commit_count": 337,
"repo_created_at": "2019-10-05T12:46:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "372509fa9e... |
d1898986-fdee-4d9f-8d10-8631ed554ac3 | slava-sh/code-plagiarism-detector | data/final-10/sources/u200626_420_B_6443126.cpp | #include <algorithm>
#include <iostream>
#include <stdio.h>
#include <memory.h>
#include <string.h>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <ctime>
#include <bitset>
#include <ctype.h>
#include <complex>
#include <cassert>
using namespace std;
#defi... | ALGO | 0.999994 | 3.239133 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2015-04-26T21:39:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c42036b8... |
ebfc11df-2b32-4a12-8120-b7574faaeba0 | wcysai/Calabash | ITMO Winter Camp 2019/Day2/g.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define Rep(i, n) for (int i = 1; i <=int(n); i++)
#define range(x) begin(x), end(x)
#define PROBLEM "gems"
int n, k;
vector<int> pre[32];
int occ[32];
char str[1 << 20];
typedef long long LL;
int main() {
freopen(P... | ALGO | 0.999947 | 3.551456 | {
"github_metadata": {
"branch": "master",
"commit_count": 601,
"repo_created_at": "2018-09-13T09:53:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 63,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06bdd3... |
2244858a-4253-4737-9694-bcfae9c1564e | himanshugupta09/LEETCODE_SOLUTIONS | Dynamic_Programming/is-subsequence.cpp | class Solution {
public:
bool isSubsequence(string s, string t) {
// Get the lengths of the input strings.
int n = s.size(); // Length of string 's'.
int m = t.size(); // Length of string 't'.
// Create a 2D DP (dynamic programming) table with dimensions (n+1) x (m+1) and ... | ALGO | 0.999813 | 6.952734 | {
"github_metadata": {
"branch": "main",
"commit_count": 2882,
"repo_created_at": "2022-06-14T15:17:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "f670a656f... |
8b59e5a3-ca53-4aca-af07-07185a2c8bbb | 42somoim/42somoim3 | hwalee/3주차_DP_2/가장 긴 바이토닉 부분 수열.cpp | #include <iostream>
using namespace std;
int DP_up[1010];
int DP_down[1010];
int DP[1010];
int check_max(int* arr, int size)
{
int max = arr[1];
for (int i = 1; i <= size; i++)
{
if (max < arr[i])
max = arr[i];
}
return (max);
}
int main()
{
int n;
int arr[1010];
cin >> n;
for (int i = 1; i <= n; i++)
... | ALGO | 0.999946 | 3.811541 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2020-10-02T05:15:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "34a96b7fee71... |
2c86d588-f2a4-48f6-9312-04d802b0aee7 | cran/hpa | src/hpaBinary.cpp | #include "hpaMain.h"
#include "hpaML.h"
#include "hpaBinary.h"
#include "polynomialIndex.h"
#include "hpaValidation.h"
#define ARMA_DONT_USE_OPENMP
#include <RcppArmadillo.h>
#include <RcppParallel.h>
using namespace Rcpp;
using namespace RcppArmadillo;
using namespace RcppParallel;
// [[Rcpp::depends(RcppArmadillo)]... | ALGO | 0.999869 | 6.959615 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-01-27T22:46:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f7e48f47c... |
e302fb6d-abcf-4ff1-877a-367cbe7e6496 | Zih0770/GIAfem | demos/SG.cpp | #include "mfem.hpp"
#include <fstream>
#include <iostream>
using namespace std;
using namespace mfem;
int main(int argc, char *argv[])
{
string mesh_file = "data/4S.msh";
//bool static_cond = false;
//bool pa = false;
//bool fa = false;
//const char *device_config = "cpu";
bool visualization = true;... | ALGO | 0.961171 | 4.330997 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2024-11-12T17:14: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": "37f932a999d... |
919b9d5e-6a74-4354-ae6e-a1c31af6a790 | thilio/Competitive-programming-team | WF_notebook/Graphs/steiner_tree.cpp | /*Computes the min. cost subgraph connecting all terminals
Complexity: O((2**t) * (n**2) + (3**t) * n)
Computes the cost of a tree that connects each subset of
terminals with a given root. One may use this information to
build a forest.
Terminals as leafs:ignore the terminal vertices in the
graph, ie, skip them in t... | ALGO | 0.998797 | 3.635108 | {
"github_metadata": {
"branch": "main",
"commit_count": 391,
"repo_created_at": "2021-01-09T16:55:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e77d9acce... |
6eb7f4e1-5c9c-418d-9fc3-3cf75d9a16df | hadleyhzy34/data_structure_and_algorithm | array/leetcode_array/26_remove_duplicates_from_sorted_array.cpp | //
// 26_remove_duplicates_from_sorted_array.cpp
// leetcode_array
//
// Created by Hadley on 16.04.20.
// Copyright © 2020 Hadley. All rights reserved.
//
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
class Solution26 {
public:
int removeDuplicates(vector<... | ALGO | 0.99925 | 5.798585 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2020-09-06T13:38:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e3dd5c7... |
04cac1e4-cdf2-462e-b730-97853024d72d | hku-mars/LTAOM | FAST_LIO/include/FOV_Checker/FOV_Checker.cpp | #include "FOV_Checker.h"
FOV_Checker::FOV_Checker(){
// fp = fopen("/home/ecstasy/catkin_ws/fov_data.csv","w");
// fprintf(fp,"cur_pose_x,cur_pose_y,cur_pose_z,axis_x,axis_y,axis_z,theta,depth\n");
// fclose(fp);
}
FOV_Checker::~FOV_Checker(){
}
void FOV_Checker::Set_Env(BoxPointType env_param){
env... | ALGO | 0.965444 | 3.612755 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-03-27T19:17:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 439,
"forks": 52,
"issues": 20,
"pull_requests": 0
},
"file_meta": {
"content_id": "f00ab5df... |
0798fc04-7a2b-4d59-9c9b-0b29973c4a84 | DreamBlack/leetcode | Helloworld/832FlippinganImage.cpp | /*
Problem:Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image.
To flip an image horizontally means that each row of the image is reversed. For example, flipping [1, 1, 0] horizontally results in [0, 1, 1].
To invert an image means that each 0 is replaced b... | ALGO | 0.999896 | 5.346728 | {
"github_metadata": {
"branch": "master",
"commit_count": 204,
"repo_created_at": "2018-01-08T14:49:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c193ffaa... |
a929843c-f6f3-43c3-b13d-828af73caea5 | Md-Imam-Hasan/leetcode-problem-solving | 567-permutation-in-string.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
bool checkInclusion(string s1, string s2)
{
if (s1.length() > s2.length())
return false;
vector<int> fs1(26, 0), fs2(26, 0);
int l = 0, r = s1.length();
for (int i = 0; i < s1.length(); i++)
{
if (fs1[s1[i] - 9... | ALGO | 0.99996 | 5.631414 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2024-05-02T16:55: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": "8cccc51e5d0... |
c3760d24-8473-49fe-9de9-6c64213261cd | shas9/codehub | Codeforces/Round/Round 501/New folder/Chaos Strings - 02.cpp | #include <bits/stdc++.h>`
#define slld(longvalue) scanf("%lld", &longvalue)
#define plld(longvalue) printf("%lld\n", longvalue)
#define slf(longvalue) scanf("%lf", &longvalue)
#define plf(longvalue) printf("%lf\n", longvalue)
#define sc(letter) scanf("%c", &letter)
#define pc(letter) printf("%c", letter)
#define ss(... | ALGO | 0.99999 | 3.696782 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-07-25T17:32: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": "f0512246d3... |
78c62d04-bd4d-464b-8afd-1998f75224ed | Edith-mounting/Competitive_programming_problems_solution | C_Zero_Path.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(){
int n, m;
cin >> n >> m;
vector< vector<int>> a( n, vector<int>(m,0));
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
cin >> a[i][j];
}
}
if( (n + m)%2 == 0){
cout << "NO";
return;
... | ALGO | 0.999959 | 4.209099 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-06-25T18:23: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": "9e1b0504baac... |
d14dd6c3-ae4e-49c8-996c-baf963a8add9 | c15de18/g2503- | Dictionary.cpp | #include<iostream>
using namespace std;
typedef struct HBTNode
{
int key;
char Mean[10];
HBTNode *left;
HBTNode *right;
}HBTNode;
HBTNode *Root = NULL;
void create_HBT()
{
int nodes, i = 0;
HBTNode *Newnode, *current;
cout<<"Enter the number of nodes to insert : ";
cin>>nodes;
for... | ALGO | 0.999897 | 3.543046 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-05-05T15:12: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": "d0017e3fa39b... |
977b30fc-7846-470a-ae9f-60722b110557 | Mohamed-tarek0/C-plus-plus | lamda/task9.3.cpp | #include <iostream>
int main() {
int x = 3, y = 9, z = 10;
auto print = [&]() {
x *= 2;
y *= 2;
z *= 2;
std::cout << "Updated values (by reference): x = " << x << ", y = " << y << ", z = " << z << std::endl;
};
auto print_value = [=]() {
std::cout << "Values (b... | TOOL | 0.969178 | 6.488934 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-10-25T12:03:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75647d38b30e... |
09cbc01a-c6b9-4f09-83ab-f44aa5dd0f68 | shiyanalex/cppnotes | stuff/z-function.cpp | #include <iostream>
#include <vector>
std::vector<int> v;
// O(n^2)
void zfunc(std::vector<int>& v) {
std::vector<int> sol(v.size(), 0);
for (int i = 1; i < v.size(); ++i) {
int k = 0;
int j = i;
while (v[k] == v[j]) {
++sol[i];
++k;
++j;
... | ALGO | 0.999902 | 4.5622 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2023-06-03T15:36: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": "aaf83b8ed... |
ef4979ff-6ebf-4302-9b39-15906bccd3fb | wang-yp-whu/bluecup | bluecup/others/pull_carriage.cpp | #include "m.h"
using namespace std;
queue<char> a;
queue<char> b;
vector<char> q;
int win = 0, cnt = 0, f = 0;
int start = 0, rear = 0;
void play()
{
if(a.size() == 0 || b.size() == 0)
{
cnt = 100000;
f = 1;
string winner;
while(a.size())
{
winner += a.front... | ALGO | 0.999993 | 3.374589 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-21T13:23: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": "1ec4fdfac4e5... |
577da9a2-215a-428c-8e2d-07c6f6dc00ef | rwollman/NUPACK | src/source/external/boost-simd/include/boost/simd/arch/common/simd/function/remceil.hpp | //==================================================================================================
/*!
@file
@copyright 2016 NumScale SAS
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
//===========================... | ALGO | 0.912437 | 6.612417 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-07-08T21:09:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44f4b173d... |
56ca5d43-6fdc-4b56-a5df-732884b1c628 | GaloisInc/LinearArbitrary-SeaHorn | include/ufo/ExprBv.hh | #ifndef __EXPR_BV__HH_
#define __EXPR_BV__HH_
/** Bit-Vector expressions
* This file is included from middle of Expr.hpp
*/
namespace expr
{
namespace op
{
namespace bv
{
struct BvSort
{
unsigned m_width;
BvSort (unsigned width) : m_width (width) {}
BvSort (const... | ALGO | 0.948636 | 5.88553 | {
"github_metadata": {
"branch": "master",
"commit_count": 1273,
"repo_created_at": "2018-05-17T20:20:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 21,
"forks": 8,
"issues": 4,
"pull_requests": 1
},
"file_meta": {
"content_id": "1b15f1e... |
6bbcc402-ef3b-4c7e-bdc4-b6f548fb6341 | zm2417/luogu-cpp | 1219.cpp | #include <iostream>
using namespace std;
int ans = 0;
void dfs(int i, int n, int s[], int m[], int d[], int cd[])
{
if (i >= n)
{
if (ans < 3)
{
for (int j = 0; j < n; j++)
{
cout << s[j] + 1 << ' ';
}
cout << endl;
}
... | ALGO | 0.999909 | 3.718671 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-01-26T06:59: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": "972c92fef... |
da372047-8066-4164-8600-f2a954e74efa | IhorVodko/Hackerrank_solutions | Algorithms/pokerNim.cpp | // problem: https://www.hackerrank.com/challenges/poker-nim-1/problem?isFullScreen=true
#include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'pokerNim' function below.
*
* The function is expected to ret... | ALGO | 0.99972 | 5.795219 | {
"github_metadata": {
"branch": "master",
"commit_count": 679,
"repo_created_at": "2020-04-28T17:08:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "662ac28... |
0222d896-3697-4dbf-8791-beeb0062520a | Tudat/tudat | examples/pagmo/zdtMultiObjectiveOptimizerComparison.cpp | #include <iostream>
#include <boost/filesystem.hpp>
#include "pagmo/algorithms/de1220.hpp"
#include "pagmo/algorithms/pso.hpp"
#include "pagmo/algorithms/de.hpp"
#include "pagmo/algorithms/bee_colony.hpp"
#include "pagmo/algorithms/sga.hpp"
#include "pagmo/algorithms/sea.hpp"
#include "pagmo/algorithms/sade.hpp"
#inc... | ALGO | 0.999718 | 5.937451 | {
"github_metadata": {
"branch": "master",
"commit_count": 6497,
"repo_created_at": "2016-01-22T10:01:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 87,
"forks": 148,
"issues": 1,
"pull_requests": 7
},
"file_meta": {
"content_id": "89fed... |
db7e276a-ce14-4e0f-b084-350dda2fb23e | sleepynoid/Breakout | main.cpp | #include <SFML/Graphics.hpp>
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Graphics/RenderTarget.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/CircleShape.hpp>
#include <SFML/Graphics/Shape.hpp>
#include <SFML/System/Vector2.hpp>
#include <cmath>
#include <vector>
using namespace s... | TOOL | 0.966793 | 5.362382 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-01-28T03:52:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e6ff1444439... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.