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
641bfe86-d6fe-4584-8328-a564c4e1310a
NERSC/timemory
source/timemory/math/compute.hpp
// MIT License // // Copyright (c) 2020, The Regents of the University of California, // through Lawrence Berkeley National Laboratory (subject to receipt of any // required approvals from the U.S. Dept. of Energy). All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy...
TOOL
0.945163
7.374421
{ "github_metadata": { "branch": "develop", "commit_count": 1235, "repo_created_at": "2018-01-12T17:10:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 362, "forks": 38, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c155...
185ad284-848f-440a-95ed-7528b01e08f6
raveeshm2/DataStructures
graph.cpp
#include <iostream> #include <vector> #include <stack> #include <queue> using namespace std; class Graph{ int size; vector<vector<int> > graph; vector<bool> visited; bool isDirected; void emptyVisited(){ fill(visited.begin(),visited.end(),false); } void bfsUtil(int root){ if(!visited[root]){ queue<int> ...
ALGO
0.999973
5.382707
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2017-01-14T18:43: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": "4b0eddd64...
584be3dc-c4d6-4dbb-8e17-9d1f2fd43fe9
Avinash10098/dp
houseRobber.cpp
#include <bits/stdc++.h> using namespace std; ////////////////////////////////////////////////////////////////////////////////////////////////////// // same for house robber int noAdjecntElemetHelper(int index, vector<int> &arr, vector<int> &dp) { if (index == 0) { return arr[index]; } if (in...
ALGO
0.999982
4.231987
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-07-24T20:09:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "01d61772e6c4...
eee0fa27-e427-41c1-a116-5407a157db01
ZeroFive0505/Programmers
Level2/Tuple/Tuple/Source.cpp
#include <iostream> #include <algorithm> #include <set> #include <string> #include <vector> using namespace std; vector<int> solution(string s) { vector<int> answer; set<int> st; vector<string> v; bool num = false; string temp; for (int i = 0; i < s.length(); i++) { if (!num && is...
ALGO
0.997137
4.343991
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2021-05-11T00:48: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": "da84d6218...
61ea5ee8-09c2-4948-8443-44e00300da06
ishandutta2007/codeforces-n
nikolapesic2802/normal/1229/C.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> #define ll long long #define pb push_back #define sz(x) (int)(x).size() #define mp make_pair #define f first #define s second #define all(x) x.begin(), x.end() #define D(x) cerr << #x << " is " <<...
ALGO
0.99991
3.703961
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:35:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0e8bf4fce223...
c00ef429-b236-42b4-809b-42db91cfd1bc
ggmacedo/aprendendocplusplus
Gabriel Gomes Macedo- 1IT - Segunda lista vetor e matriz/Exercicio 3.cpp
#include <iostream> #include <locale.h> #include <conio.h> using namespace std; int main (void) { setlocale(LC_ALL, "Portuguese"); int i; int a[5]; int b[10]; int c[15]; int n1=0; int n2=0; cout << "\n"; for ( i=0 ; i<=4 ; i++ ) { cout << "\n Informe o número da " << i+1 << "ª posição do vetor A: "; cin >> n1; co...
ALGO
0.998466
3.402889
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-08-14T15:12:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cd5e2563b4...
43b4bbb5-ffa4-4e58-967a-179f08903df9
harshvarmora28/competitive_programming
bubble_sort.cpp
// Author: <NAME> // Purpose: Sorting an array using bubble sort algorithm // Date: 4 May,2022 #include<bits/stdc++.h> using namespace std; void bubbleSort(int n, int *arr){ // For round 1 to n - 1 for(int i = 1; i < n; i++) // Process elements till (n - i)th index for(int j = 0; j < n - i; j+...
ALGO
0.999782
5.332475
{ "github_metadata": { "branch": "master", "commit_count": 105, "repo_created_at": "2021-11-04T09:52: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": "6131ece6...
9b89f1c1-f6bb-4a67-ba21-baa8c04647ae
Davalixi333/MTAdaptiveFEM
src/mt_fwd.cc
#include "mt_ctx.h" #include "mt_io.h" #include "mt_pw.h" #include "reEstimate.h" #include"mt_refine.h" #include <Eigen/SparseLU> #include <deal.II/base/quadrature.h> #include <deal.II/base/function.h> #include <deal.II/dofs/dof_tools.h> #include <deal.II/fe/fe_q.h> #include <deal.II/fe/fe_values.h> #include <deal...
ALGO
0.999742
4.488836
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2023-08-17T02:25:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "6e5f4368c81d...
ea229fb4-f7b8-4a13-a786-cef49154af52
morimoto0606/procon
atcoder/aizu/SelfDestract.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll N; cin >> N; vector<ll> L(N); vector<ll> R(N); for (auto i = 0; i < N; ++i) { ll a; cin >> a; L[i] = a + i; R[i] = i - a; } map<ll, ll> numL; for (auto x : L) { ++...
ALGO
0.999962
3.524884
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-12-25T14:38: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": "dd24bef726...
97f81d22-abbd-4e87-b609-0dc7f11a18aa
viktordanov/NeuralNetworks
NeuralNetwork.hpp
#include <cstdio> #include <vector> #include "Matrix.hpp" using namespace std; class NeuralNetwork { Matrix *L; Matrix *W; int layersLength; int weightsLength; Matrix *deltas; Matrix lastError; public: NeuralNetwork(vector<int>); ~NeuralNetwork(); vector<double> guess(vector<double>); /** *...
ALGO
0.941915
3.992792
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2019-04-17T19:29:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7dcf1e9f20...
87fb1ba6-1d4c-41d5-87ba-e33bc1203fcd
dealii/dealii
include/deal.II/cgal/intersections.h
// ------------------------------------------------------------------------ // // SPDX-License-Identifier: LGPL-2.1-or-later // Copyright (C) 2022 - 2024 by the deal.II authors // // This file is part of the deal.II library. // // Part of the source code is dual licensed under Apache-2.0 WITH // LLVM-exception OR LGPL-...
ALGO
0.998925
6.877814
{ "github_metadata": { "branch": "master", "commit_count": 65304, "repo_created_at": "2014-07-17T14:00:26.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1530, "forks": 789, "issues": 533, "pull_requests": 92 }, "file_meta": { "content_id": ...
537c4918-04d2-4525-b2e1-6538b8276c8d
Janek1804/Cpp-practice
kol2.cpp
#include <iostream> #include <stdlib.h> #include <time.h> #include <unistd.h> class complex{ public: double *real_; double *imaginary_; complex(){ double offset = std::sin(time(0)); srand(time(0)); real_=new double; imaginary_=new...
ALGO
0.944371
3.838889
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2023-01-10T16:12:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bae624d53...
5876b38c-8241-4e69-a57c-48f19200697a
aobolensk/pp_2020_spring
modules/task_2/iamshchikov_i_sparse_matrix_mult/sparse_matrix_mult.cpp
// Copyright 2020 <NAME> #include <omp.h> #include <algorithm> #include <cstring> #include <vector> #include <random> #include <ctime> #include <cmath> #include "../../modules/task_2/iamshchikov_i_sparse_matrix_mult/sparse_matrix_mult.h" CcsMatrix::CcsMatrix(int _M, int _N, int nz) { if (_M <= 0 || _N <= 0) throw ...
ALGO
0.998678
4.205085
{ "github_metadata": { "branch": "master", "commit_count": 1853, "repo_created_at": "2020-02-27T13:09:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 70, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a835b6...
c9c0a852-e4bb-44f4-8b6a-5d60f4afcb44
NVIDIA/caffe
src/caffe/layers/lstm_unit_layer.cpp
#include <algorithm> #include <cmath> #include <vector> #include "caffe/layer.hpp" #include "caffe/layers/lstm_layer.hpp" namespace caffe { template <typename Dtype> inline Dtype sigmoid(Dtype x) { return 1. / (1. + exp(-x)); } template <typename Dtype> inline Dtype tanh(Dtype x) { return 2. * sigmoid(2. * x) -...
DATA
0.94301
7.515641
{ "github_metadata": { "branch": "caffe-0.17", "commit_count": 4839, "repo_created_at": "2015-02-21T18:41:24.000Z", "is_fork": true, "is_org_owned": true, "forked_from": "BVLC/caffe", "stars": 671, "forks": 261, "issues": 19, "pull_requests": 1 }, "file_meta": { "conten...
434ac931-a2e5-417b-a51d-2378883818fe
demiurge-project/experiments-loop-functions
loop-functions/mate/SPD11/MateSPD11LoopFunc.cpp
/** * @file <loop-functions/mate/SPD11/MateSPD11LoopFunc.cpp> * * @author <NAME> - <<EMAIL>> * * @package AutoMoDe-Mate * * @license MIT License */ #include "MateSPD11LoopFunc.h" /****************************************/ /****************************************/ MateSPD11LoopFunction::MateSPD11Loop...
ALGO
0.999612
4.439925
{ "github_metadata": { "branch": "master", "commit_count": 116, "repo_created_at": "2018-01-18T09:42:55.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "af9650d75...
64ccc2ac-9b4e-4887-95c9-41ee64473535
ishandutta2007/codeforces-a
aropan/normal/526/C.cpp
#include <iostream> #include <cstdio> #include <cassert> #include <ctime> #include <cmath> #include <cstring> #include <string> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <map> #include <set> using namespace std; template <typename T> T sqr(T x) { return x * x; } template <typen...
ALGO
0.999784
3.278835
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "73b79b326cd2...
fe7a0dcf-54b8-4a71-a947-86ac05c31b11
Geetansh01/dsa-lb-codes
W12/L173/MakeTreeGivenTraversals.cpp
#include<iostream> #include<queue> #include<map> using namespace std; class Node{ public: int data; Node* left; Node* right; Node(int val){ this->data = val; this->left = NULL; this->right = NULL; } }; //Returns root node of created tre...
ALGO
0.999936
5.250405
{ "github_metadata": { "branch": "main", "commit_count": 164, "repo_created_at": "2023-11-04T13:51: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": "c2f16c2c5e...
90a5189d-04b1-44e0-a9a0-29009de4b7c0
cogschris/CSCI104
hw7/bst.h
/** * bst.h * Implements a(n unbalanced) BST storing Key,Value pairs */ #ifndef BST_H #define BST_H #include <iostream> #include <exception> #include <cstdlib> #include <utility> /* ----------------------------------------------------- * Regular Binary Tree Nodes -------------------------------------------------...
ALGO
0.982841
4.173608
{ "github_metadata": { "branch": "master", "commit_count": 115, "repo_created_at": "2016-08-19T20:40: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": "7f5b7154...
82133dac-c80c-4c4f-a529-2e41c922efa3
LeonardoBalbin/Grupo9_Sistema_de_Gestion_de_Procesos
Posible ejemplo de pila.cpp
#include <iostream> #include <cstdlib> // Para system("pause") using namespace std; // Estructura para representar un proceso struct Proceso { int id; string nombre; int prioridad; }; // Estructura de nodo para la lista enlazada struct Nodo { Proceso proceso; Nodo* siguiente; }; class GestorProc...
ALGO
0.999421
6.146617
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2025-05-17T23:18: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": "bd5198d6d9c...
787bab6b-7493-4b07-ba89-a36c49c14a87
Nickel-Angel/ACM-and-OI
Codeforces/CF1721E.cpp
/* * @author Nickel_Angel (<EMAIL>) * @copyright Copyright (c) 2022 */ #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <vector> using std::max; using std::min; using std::pair; using std::sort; using std::swap; using std::vector; typedef long long ll; const int maxn = 1e6 + 20; c...
ALGO
0.999964
3.658593
{ "github_metadata": { "branch": "main", "commit_count": 71, "repo_created_at": "2021-08-01T23:31:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "05e8e40c5bf...
ec584130-d3cf-4166-9e95-1bb91d0243b7
Sazzach/ResourceDocUofU
stress-tests/number-theory/Eratosthenes.cpp
#include "../utilities/template.h" struct prime_sieve { typedef unsigned char uchar; typedef unsigned int uint; static const int pregen = 3*5*7*11*13; uint n, sqrtn; uchar *isprime; int *prime, primes; // prime[i] is i:th prime bool is_prime(int n) { // primality check if(n%2==0 || n<=2) return n==2; retur...
ALGO
0.998287
3.877541
{ "github_metadata": { "branch": "master", "commit_count": 846, "repo_created_at": "2020-02-26T04:15:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f29d86b3...
34faf988-aec3-4f45-853d-cc90343c9b31
Jha01Sarvjeet/Practice-Cpp
18 _sorting/1_bubble_sort.cpp
// Bubble sort #include <bits/stdc++.h> #include <iostream> using namespace std; void bubbleSort(vector<int> &arr) { bool flag = false; int n = arr.size(); for (int i = 0; i < n - 1; i++) { for (int j = 0; j < n - i - 1; j++) { if (arr[j] > arr[j + 1]) { ...
ALGO
0.999938
5.449574
{ "github_metadata": { "branch": "main", "commit_count": 371, "repo_created_at": "2024-04-26T13:31: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": "8180d41432...
d480808b-2a90-46ab-acc2-5b81d8a0eb82
cuhk-eda/ripple-fpga
src/lg/lg.cpp
#include "lg.h" #include "lg_main.h" #include "../lgclk/lgclk.h" #include "../lgclk/lgclk_plan.h" bool legCLB1Succ = false; // true; void legalize(vector<Group> &groups, lgSiteOrder siteOrder, lgRetrunGroup retGroup) { printlog(LOG_INFO, " = = = = legalization = = = = "); double begHpwl = 0; Legalizer ...
ALGO
0.998412
3.666877
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2019-03-21T07:48:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 90, "forks": 20, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "26fe983d...
49e08515-d29a-40e8-933a-2781f95e6a06
slk000/newbie
acm/poj/3050.cpp
//AC //http://poj.org/problem?id=3050 //force dfs #include <cstdio> #include <vector> #include <cstring> #include <algorithm> #include <iostream> #include <queue> #include <set> using namespace std; #define INF 0x3f3f3f3f #define MAX 5 set<int> s; const int rr[] = { -1,1,0,0 }; const int cc[] = { 0,0,-1,1 }; const int ...
ALGO
0.999509
4.013093
{ "github_metadata": { "branch": "master", "commit_count": 61, "repo_created_at": "2016-08-22T14:47: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": "536b23027...
c4ada5ef-bb7e-439e-ad21-33aa6fc3a16e
FrknTnc/Algorithms
Select Algorithm/main.cpp
#include<iostream> #include<algorithm> #include<climits> using namespace std; int partition(int arr[], int l, int r, int k); //O(n) int findMedian(int arr[], int n) { sort(arr, arr+n); return arr[n/2]; } int kthElement(int arr[], int l, int r, int k) { if (k > 0 && k <= r - l + 1) { int n = r-l+1; int i, m...
ALGO
0.999993
5.308581
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2022-10-12T21:40: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": "bac42a49a23...
deeb4479-24f8-4af2-a34a-5b81eaa40454
JasonMcKinnerney/CompSci_Fundamentals_cpp
ProjectDirectory/04C++ Crand-Elifs/lab3.cpp
//<NAME> jlm573 //09/23/2020 //CS1428 Lab //Lab 3 //Description: this program will allow the user to play a game of Slug, // Frog, Snake against a randomized computer opponent #include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { int user_num; int comp_num; // Generat...
ALGO
0.975354
3.258557
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2022-08-09T21:36: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": "3d353f5bac10...
5fbcfc72-31ff-40dd-84aa-fe6b1ce6fd06
deckhouse/prompp
pp/wal/hashdex/scraper/scraper.h
#pragma once #include <simdutf/simdutf.h> #include <span> #include "bare_bones/algorithm.h" #include "bare_bones/vector.h" #include "bare_bones/xxhash.h" #include "parser.h" #include "prometheus/hashdex.h" #include "prometheus/metric.h" #include "prometheus/textparse/escape.h" #include "prometheus/value.h" #include...
TOOL
0.917247
7.582179
{ "github_metadata": { "branch": "pp", "commit_count": 13992, "repo_created_at": "2025-03-04T13:44:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 311, "forks": 4, "issues": 2, "pull_requests": 8 }, "file_meta": { "content_id": "1721bcba2...
4a72cefd-a1b2-4c38-ae96-554be420c5f7
abhik2003/my_cp
codechef_137/Speedrun.cpp
#include <iostream> #include <iomanip> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <vector> #include <set> #include <map> #include <queue> #include <stack> #include <algorithm> #include <numeric> #include <cmath> #include <climits> #include <cassert> #include <bitset> #include <fs...
ALGO
0.999989
4.067912
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2023-05-03T13:41: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": "c58bac050...
e3bc2990-adda-46e5-a76d-bb1b3946d4fc
TrifanBogdan24/Probleme-PBINFO
pbinfo/coduri-cpp/clasa-X/fsumvecrec.cpp
// #1843 - FSumVecRec #include <iostream> using namespace std; // SOLUTIA PBINFO INCEPE AICI // IMPLEMENTAREA FUNCTIEI TREBUIE SA FIE MUSIA RECURSIVA int suma(int v[105], int n, int i, int j) { if (i != 0) return v[i - 1] + suma(v, n, i - 1, j); else if (j != n) return v[j + 1] + suma(v, n, i...
ALGO
0.99995
4.236704
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-05-02T23:21: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": "3ba620bfe48...
e0e7c4a4-9d1f-4e62-81b8-e4a245bd8f3e
mahboobali09771/leetcode
0085-maximal-rectangle/0085-maximal-rectangle.cpp
// TC O(n*m) SC O(n) class Solution { public: int largestRectangleArea(vector<int>& arr) { int n = arr.size(); int nsi[n]; stack<int> st; nsi[n-1] = n; st.push(n-1); for(int i=n-2; i>=0; i--){ while(st.size()>0 && arr[st.top()]>=arr[i]) st.pop(); ...
ALGO
0.99985
6.12978
{ "github_metadata": { "branch": "main", "commit_count": 726, "repo_created_at": "2024-01-02T19:51: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": "c64e89ac18...
50090956-a407-449b-aefe-4864697ac001
kamyu104/LeetCode-Solutions
C++/subarrays-distinct-element-sum-of-squares-i.cpp
// Time: O(nlogn) // Space: O(n) #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; // bit, fenwick tree, ordered set, math class Solution { public: int sumCounts(vector<int>& nums) { static const int MOD = 1e9 + 7; using ordered_set = tree<...
ALGO
0.999995
6.298796
{ "github_metadata": { "branch": "master", "commit_count": 19395, "repo_created_at": "2018-10-11T17:38:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4939, "forks": 1616, "issues": 1, "pull_requests": 55 }, "file_meta": { "content_id": ...
51efa50b-b29b-4412-8b05-e5fda818b5ae
chmnchiang/bcw_codebook
codes/Math/Square_Matrix_pinv.cpp
Mat pinv(Mat m) { Mat res = I; FZ(used); for(int i=0; i<W; i++) { int piv = -1; for(int j=0; j<W; j++) { if(used[j]) continue; if(abs(m.v[j][i]) > EPS) { piv = j; break; } } if(piv == -1) continue; used[i] = true; swap(m.v[piv], m.v[i]);...
ALGO
0.999968
3.307131
{ "github_metadata": { "branch": "master", "commit_count": 361, "repo_created_at": "2014-06-03T11:38:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 111, "forks": 22, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6fd8e...
c34dcc55-e7ba-4184-b63c-73a15407172a
openLB/openLB
src/particles/hlbm/hlbmDynamics2D.h
/* DESCRIPTOR Boltzmann sample, written in C++, using the OpenLB * library * * Copyright (C) 2006-2016 <NAME>, <NAME>, <NAME>, <NAME> * E-mail contact: <EMAIL> * The most recent release of OpenLB can be downloaded at * <http://www.openlb.net/> * * This program is free software; you can redistribute it an...
ALGO
0.978739
6.081447
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-11-03T07:46:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 40, "forks": 15, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6980a387...
e513de77-cecd-4377-a14e-f74b8f0be92d
mdtariqueh007/My_Leetcode
1632-number-of-good-ways-to-split-a-string/number-of-good-ways-to-split-a-string.cpp
class Solution { public: int numSplits(string s) { int n = s.length(); vector<int> prefix(n,0); vector<int> suffix(n,0); vector<bool> vis(26,false); for(int i = 0;i<n;i++){ if(vis[s[i]-'a']==false){ prefix[i] = (i==0)?0:prefix[i-1] + 1; ...
ALGO
0.999974
4.811903
{ "github_metadata": { "branch": "main", "commit_count": 1880, "repo_created_at": "2024-02-25T20:28: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": "cd7294b9b...
42ee725a-e9b6-4730-b639-7bb6b29160a0
purdue-cap/DryadSynth
dryadsynth/StarExec/src/z3/src/ackermannization/lackr.cpp
/*++ Copyright (c) 2015 Microsoft Corporation Module Name: lackr.cpp Abstract: Author: <NAME> Revision History: --*/ #include "ackermannization/lackr.h" #include "ackermannization/ackermannization_params.hpp" #include "tactic/tactic.h" #include "ackermannization/lackr_model_constructor.h" #include "acke...
ALGO
0.997514
5.716601
{ "github_metadata": { "branch": "master", "commit_count": 628, "repo_created_at": "2020-02-24T07:23:23.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 28, "forks": 6, "issues": 1, "pull_requests": 7 }, "file_meta": { "content_id": "352aa273...
9bfe953d-b964-4885-bc86-ddfbfc058334
AlejandroSherman/CS100Lab6Decorator
main.cpp
#include <iostream> using namespace std; #include <vector> #include <list> #include "BubbleSort.hpp" #include "SelectionSort.hpp" #include "Div.hpp" #include "ListContainer.hpp" #include "Pow.hpp" #include "Sub.hpp" #include "VectorContainer.hpp" #include "add.hpp" #include "base.hpp" #include "container.hpp" #include...
ALGO
0.977721
3.540129
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2020-03-14T22:04: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": "7c9b45ae7...
a494076b-5c56-4342-bec6-08bc7831e44e
dragons6641/BOJ
graph_theory/BOJ15558.cpp
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #define MAX_R 2 #define MAX_C 100000 #define MAX_QUEUE (MAX_R * MAX_C) #define MAX_DIR 3 #define START_R 0 #define START_C 0 #define START_TIME 0 struct Node { int r; int c; int time; }; // cols int N; // 점프력 int K; int directR[MAX_DIR] = { 0, 0, 1 }; int direct...
ALGO
0.99997
3.597099
{ "github_metadata": { "branch": "main", "commit_count": 567, "repo_created_at": "2021-05-21T07:02: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": "51f4b8b6f5...
7208e08d-63b4-4c7d-ae44-c817379b4882
noah-ftnx/rpl
sde/12/03_.cpp
#include <vector> #include <algorithm> using namespace std; vector<int> kMaxSumCombinationBF(vector<int> &a, vector<int> &b, int n, int k){ vector<int> combinations; for (int i=0; i<n; i++) { for (int j=0; j<n; j++) { combinations.push_back(a[i]+b[j]); } } sort(combinations.begin(), combination...
ALGO
0.999995
5.086644
{ "github_metadata": { "branch": "main", "commit_count": 459, "repo_created_at": "2021-12-12T21:22:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "44e9407db1...
a6f221e9-169a-46f6-b9a5-93b9a0942a31
skytthe/advent-of-code
2015/cpp/day21/day21.cpp
#include <iostream> #include <fstream> #include <sstream> #include <string> #include <unordered_map> #include <vector> #include <map> #include <set> #include <numeric> #include <algorithm> #include <climits> #include <cctype> using namespace std; /* Weapons: Cost Damage Armor Dagger 8 4 0 Shorts...
ALGO
0.997686
4.003839
{ "github_metadata": { "branch": "master", "commit_count": 119, "repo_created_at": "2024-10-15T18:31: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": "f1a248d3...
05722f3d-82c2-4cd5-92fd-d2cc7f1e475a
XuXwGit/DynamicRerouting
RouteManager.cpp
#include "RouteManager.h" RouteManager::RouteManager(int n, int m, int w, int k, vector<ReroutingAlgorithmType> enabledAlgorithms) : graph(n, m, w), currentRoutes(k), enabledAlgorithms(enabledAlgorithms) { } RouteManager::~RouteManager() { for (auto algorithm : algorithms) { delete algorithm; ...
ALGO
0.97231
5.533026
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-01-14T19:09:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "892b2b2b37ad...
0888d0aa-59c0-45ef-963e-f7e7347652b1
Kenshin2438/CP-Code-Collection
Contest/NIO Cup 2022 Nowcoder Multi-University Training Contest 8/F.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define all(a) begin(a), end(a) #ifdef LOCAL #include "debug.hpp" #else #define debug(...) 42 #endif void solve() { int n, m; cin >> n >> m; ll p, x, a, b, c; cin >> p >> x >> a >> b >> c; unordered_map<ll, int> pos; int ans = 0; for (...
ALGO
0.999547
4.734108
{ "github_metadata": { "branch": "master", "commit_count": 95, "repo_created_at": "2022-04-15T06:16:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b0d769d5a...
6c78a8c4-5592-4870-a9ac-86c66be7aa6b
ishandutta2007/codeforces-i
intothenight/normal/1327/F.cpp
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace chrono; using namespace __gnu_pbds; mt19937 rng(high_resolution_clock::now().time_since_epoch().count()); mt19937_64 rngll(high_resolution_clock::now().time_since_epoch().count()); te...
ALGO
0.999935
4.510973
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T05:39:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6293c85c8b2a...
d121b65e-0e02-4936-8bcd-e904739b2437
durkinza/csClasses
CS 395/assignment2/5.cpp
/*********************************************************** * NAME: <NAME> * ID: durk7832 * QUESTION: Asn2.5 * DESCRIPTION: Russian peasent mult. ***********************************************************/ #include <iostream> #include <math.h> /* floor */ using namespace std; int mult(int one, int two){ ...
ALGO
0.999778
4.293954
{ "github_metadata": { "branch": "master", "commit_count": 261, "repo_created_at": "2016-10-24T19:06: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": "fa438209...
3bfe7472-29b9-43c7-b509-9ac5e535a27f
EnmmmmOvO/Computer-Science-Engineering
COMP6771/Week07/tut07/source/constexpr.cpp
#include <array> #include <cassert> #include <vector> #include <iostream> enum class number_type { prime, composite, }; auto generate_primes_lookup_table(int largest_value) -> std::vector<number_type> { assert(largest_value > 1); // all values initialized to "prime" auto result = std::vector<number_type>(st...
ALGO
0.999266
5.730174
{ "github_metadata": { "branch": "master", "commit_count": 82, "repo_created_at": "2022-05-12T11:59:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "941152b56...
77369efc-9e3e-4eba-874d-aa7592173843
ishandutta2007/codeforces-a
alexandr_ts/normal/1305/E.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <numeric> #include <map> #include <vector> #include <set> #include <cassert> #include <algorithm> #include <cstdio> #include <sstream> #include <cmath> #include <random> #include <sstream> #include <string> #include <memory> #include <queue> #include <unorde...
ALGO
0.999924
3.287173
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3bfda84b364f...
8d846b17-77f4-4362-9b6b-75c60d3656b0
gonnaflick/Circuitos-Logicos-II
bcd-7segment/bcd-decoder.ino
int buttonPinA = 2; int buttonPinB = 3; int buttonPinC = 4; int buttonPinD = 5; int segmentA = 46; int segmentB = 48; int segmentC = 51; int segmentD = 49; int segmentE = 53; int segmentF = 50; int segmentG = 52; int A; int B; int C; int D; void bcd(int dec_value) { switch(dec_value) { case 0: digit...
ALGO
0.956102
4.646947
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-10-03T05:47: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": "27e70bc334ee...
aac7342b-d2e0-4a53-a773-d63eba60ac0a
thanh-nguyen03/CPP-Code
CodePTIT-CPP/CodePTIT-CPP-Vn/CPP0720_DAY_SO_BITONIC.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double db; const long long mod = 1e9 + 7; #define faster() ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define pb push_back #define all(x) x.begin(), x.end() #define vi vector<int> #define vll vector<ll> #define tester() int t;...
ALGO
0.999809
4.274587
{ "github_metadata": { "branch": "main", "commit_count": 62, "repo_created_at": "2022-02-23T14:43:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b8bbe23cc4e...
db75f93b-bb9d-4c7a-b2ec-5ee1d92976d4
Nihhh1/nihhh1.github.io
files/文档/dijstra堆优化.cpp
#include <cstring> #include <iostream> #include <algorithm> #include <queue>//堆的头文件 using namespace std; typedef pair<int, int> PII;//堆里存储距离和节点编号 const int N = 1e6 + 10; int n, m;//节点数量和边数 int h[N], w[N], e[N], ne[N], idx;//邻接矩阵存储图 int dist[N];//存储距离 bool st[N];//存储状态 int pr[N];//储存路径 int a[N];//辅助输出路径 void add(i...
ALGO
0.999968
3.940845
{ "github_metadata": { "branch": "master", "commit_count": 298, "repo_created_at": "2024-11-11T04:56:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "adadb71a...
00912577-e2e9-4fa4-aa12-6a0e5f97fe8c
alejodetes/cpp
5.cpp
/****************************************************************************** Diseñe un algoritmo que dadas las edades de tres personas, las compare y determine quiénes son contemporáneos. (Tienen la misma edad). *******************************************************************************/ #in...
ALGO
0.997717
3.76005
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-02-28T21:51: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": "e262a3e46c84...
1db5c424-2f0d-4f86-89d5-859c5ff68142
notePad265/cPlusPlus98111417
王健伟cPlusPlus学习笔记/002基本语言/012结构体变量做函数参数的3种方式与c++对结构的扩充_添加成员方法.cpp
#include<iostream> #include<cstdlib> using namespace std; struct Student { //成员变量 int number; //学号 char name[100]; //学生名 }; void functionStruct(Student temstu) // 形参用结构体变量 { temstu.number = 1002; strcpy_s(temstu.name, sizeof(temstu.name), "lisi"); return; } void functionStruct02(Student &temstu) // 形参用结构体引用 ...
ALGO
0.915245
3.860138
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-10-08T16:59:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 15, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c5579bcbe...
07f26ea9-7d7d-415b-8ffe-4aace4a1f3b1
abhinavpy/Operating-Systems-Lab-Spring-2019
Lab9 - Disk Scheduling Algorithms/SSTF.cpp
#include<bits/stdc++.h> using namespace std; struct node { int distance; bool accessed; }; void calculateDifference(vector<int> queue, int head, struct node *diff, int n) { for(int i=0; i < n; ++i) { diff[i].distance = abs(queue[i] - head); } } int findMin(node diff[], int n) { int in...
ALGO
0.999991
4.284019
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2019-01-06T05:20:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a223fcb31...
fb93a651-aac1-4889-aaa2-b7f10cc7451d
myluda12/ft_Containers
iterators/vector.hpp
// constructing vectors #pragma once #include "reverse_iterator.hpp" #include "iterator_traits.hpp" #include "random_access_iterator.hpp" #include <iostream> #include <vector> #include <memory> namespace ft { template <class T, class Alloc = std::allocator<T> > class vector { public : ...
TOOL
0.908347
3.968004
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2022-08-27T21:43: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": "d5c4ce97999f...
6b53a361-fd96-4aad-b635-22bf4e88b041
NocturnaLL/Leetcode
maxSumKpairs.cpp
#include <unordered_map> #include <vector> #include <stdio.h> #include <stdlib.h> using namespace std; /* You are given an integer array nums and an integer k. In one operation, you can pick two numbers from the array whose sum equals k and remove them from the array. Return the maximum number of operations you c...
ALGO
0.999768
6.7515
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2024-10-01T05:18: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": "91ba48edde5...
ae4aa1e7-84eb-4617-bfc8-6554c50b9fb6
rafaelstjf/K-means
Kmeans.cpp
#include "Kmeans.hpp" Kmeans::Kmeans() { model = new Model(); srand(27182378127381273); numGroups = 0; } Kmeans::~Kmeans() { } void Kmeans::initialCenters() { //get Numgroups centers using a random object on the model double **m = model->getMatrix(); int index =0; for(int i = 0; i < numGro...
ALGO
0.999521
4.688065
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2016-07-05T11:34:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "158af79b18...
14e02ab6-4854-4c6c-ba5a-1aa37b5b75b2
jhnaldo/problem-solving
acmicpc/cpp/2178.cc
#include <stdio.h> class Node{ public: Node(int _x, int _y, int _pos){ x = _x; y = _y; pos = _pos; next = NULL; } int x; int y; int pos; Node* next; }; class Queue{ public: Queue(){ head = tail = NULL; } void push(int x, int y, int pos){ Node* node = new Nod...
ALGO
0.999966
3.27886
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2018-02-25T16:12: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": "1f6c8717b...
280ec800-d262-4d46-8629-ef2b70cea9b6
Farama-Foundation/Procgen2
games/maze/maze_generator.cpp
#include "maze_generator.h" struct Wall { int x1; int y1; int x2; int y2; }; std::vector<int> Maze_Generator::get_neighbor_indices(int x, int y) const { std::vector<int> neighbors; for (int dx = -1; dx <= 1; dx += 2) { int nx = x + dx; if (nx < 0 || nx >= array_width) ...
TOOL
0.905443
5.541574
{ "github_metadata": { "branch": "main", "commit_count": 125, "repo_created_at": "2022-09-05T16:41:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 29, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a1642da5e3...
d00e96dd-b35e-440f-bcf0-8039c6fc8102
justYu2001/ntut-111-os
personal_homework/homework_3/problem_1/main.cpp
#include <iostream> #include <random> #include <ctime> #include <pthread.h> #include <unistd.h> using namespace std; int north_farmer_number = 1; int south_farmer_number = 1; pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; default_random_engine generator(time(NULL)); uniform_int_distribution<int> uniform_distribu...
ALGO
0.99855
5.299305
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2023-04-04T01:55: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": "dddee9d84d4...
a8285b69-8d34-454a-a552-12c1b6668194
xSeanliux/CompetitiveProgramming
CF/1223D/1223D.cpp
#include <iostream> #include <vector> #include <algorithm> #include <utility> #define pii pair<int,int> #define F first #define S second #define ericxiao ios_base::sync_with_stdio(0);cin.tie(0); using namespace std; const int INF = 1e6; int q, n; vector<pii> v; vector<int> arr, lis, dp; int main(){ ericxiao; ...
ALGO
0.999973
3.737762
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2018-11-18T06:45: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": "119d04e04...
8646aa1f-5b54-4c32-b207-53cfa9c535af
zudydy/problem-solving
백준/Silver/2805. 나무 자르기/나무 자르기.cc
// https://www.acmicpc.net/problem/1654 // written by julyy #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); long long n, m, length, low, high, mid, max, sum; cin >> n >> m; vector<long long> vec; for (in...
ALGO
0.999996
4.380424
{ "github_metadata": { "branch": "main", "commit_count": 992, "repo_created_at": "2021-12-14T17:57: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": "dcd9f65913...
f1c822a2-eda3-40e8-91ef-e2dc3fcfa3fa
inte2000/play_with_algo
tic-tac-toe/NegamaxAlphaBetaSearcher.cpp
#include "StdAfx.h" #include "NegamaxAlphaBetaSearcher.h" NegamaxAlphaBetaSearcher::NegamaxAlphaBetaSearcher(Evaluator *evaluator) { #ifdef _DEBUG _searcherCounter = 0; #endif m_evaluator = evaluator; } NegamaxAlphaBetaSearcher::~NegamaxAlphaBetaSearcher(void) { } int NegamaxAlphaBetaSearcher::SearchBestPlay...
ALGO
0.999571
5.978152
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2018-09-03T15:39:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 68, "forks": 37, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5d6212e...
eb2b9161-0ce2-4c5d-a080-e8c611d24414
kimmstop/PS
BOJ_prob/Divide and Conquer/C++/BOJ_2630.cpp
#include <iostream> using namespace std; int entire_len; int paper[128][128]; int paper_type[2]; void isUnified(int cur_r, int cur_c, int cur_len); int main() { cin >> entire_len; for(int i = 0; i < entire_len; i++){ for(int j = 0; j < entire_len; j++){ cin >> paper[i][j]; } ...
ALGO
0.99984
3.468326
{ "github_metadata": { "branch": "main", "commit_count": 331, "repo_created_at": "2020-10-04T05:36: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": "4e0c33f0f6...
41b46802-1209-417e-9d17-16f6fc8dea7d
armangupta48/Top-Interview-Questions
1415. The k-th Lexicographical String of All Happy Strings of Length n.cpp
1415. The k-th Lexicographical String of All Happy Strings of Length n Medium 378 12 Add to List Share A happy string is a string that: consists only of letters of the set ['a', 'b', 'c']. s[i] != s[i + 1] for all values of i from 1 to s.length - 1 (string is 1-indexed). For example, strings "abc", "ac", "b" and "...
ALGO
0.999978
5.876757
{ "github_metadata": { "branch": "main", "commit_count": 73, "repo_created_at": "2021-03-26T07:58: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": "49cecd4b88b...
2899f846-5b9d-41ba-a034-c2256f69f5c8
chenyong2github/UnrealEngine
Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDBendingConstraintsBase.cpp
// Copyright Epic Games, Inc. All Rights Reserved. #include "Chaos/PBDBendingConstraintsBase.h" namespace Chaos::Softs { namespace Private { void Calculate3DRestAngles( const FSolverParticles& InParticles, const TArray<TVec4<int32>>& Constraints, TArray<FSolverReal>& RestAngles) { RestAngles.Reset(C...
ALGO
0.999299
7.005964
{ "github_metadata": { "branch": "5.3", "commit_count": 258706, "repo_created_at": "2022-07-28T06:53:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 37, "forks": 12, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "f20114...
a7cdfbfb-62a6-454a-9b32-785a82d5551f
Chayan199916/go-data-go
datastructure/array problems (c++ implementation)/longest_span_with_same_sum.cpp
#include <iostream> using namespace std; int find_longest_span(int *arr1, int *arr2) { int span = 0; for (int i = 0; i < 7; i++) { int sum1 = 0, sum2 = 0; for (int j = i; j < 7; j++) { sum1 += arr1[j]; sum2 += arr2[j]; if (sum1 == sum2) ...
ALGO
0.999774
4.184062
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2021-05-24T14:17:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "50ed07500d1...
c2459e82-c61a-4cb9-95cf-8d6810532e82
SinaPourSoltani/Pick-and-place
Robotics/Reachability/reachability.cpp
// // reachability.cpp // Robotics and Computer Vision // // Created by <NAME> and <NAME> on 30/10/2020. // Inspired by solution to programming exercise 5 from Robotics course from // 1st semester Master's programme in Advanced Robotics Technology // #include <rw/rw.hpp> #include <rw/invkin.hpp> #include <rwlibs/...
ALGO
0.985755
5.05807
{ "github_metadata": { "branch": "main", "commit_count": 46, "repo_created_at": "2020-10-30T08:01: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": "a656abb8655...
fdfcbdb3-12a9-4abb-8ff1-64d97349fe56
fuyukiovo/ConnectFour
connectfour_AI.cpp
#include <iostream> #include <vector> #include <time.h> #include <stdlib.h> using namespace std; void printboard(vector<vector<int> > gameBoard) { cout << "| 1 | 2 | 3 | 4 | 5 | 6 | 7 |" << endl; for(int i = 5; i >= 0; i--) { cout << "|"; for(int j = 0; j < 7; j++) { switch(gameBoard[i][j]) { case -1: co...
ALGO
0.999593
4.019535
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-02-20T14:26: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": "96424db5a7...
394e2a46-ccce-4f23-ba5f-bee5df6ef27f
kagezu/mik32
exemple/osc/main.cpp
#include "main.h" #include "lcd.h" #include "adc.h" #include "timer.h" #include "dma.h" #include "lagrange.h" #include "encoder.h" #include "fft.h" constexpr int ADC_CH = 0; // Номер канала ADC constexpr int INT_FQ = 200; // Hz опрос энкодера constexpr int INFO_FQ = 2; // Hz обновление текста cons...
TOOL
0.970064
4.586744
{ "github_metadata": { "branch": "master", "commit_count": 169, "repo_created_at": "2025-01-26T17:25:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a72c92be...
79363c2d-123f-4e4a-ae13-c9396b08eb19
HabanaAI/Intel_Gaudi3_Software
synapse/src/graph_compiler/passes/sram_management/strategy_operations_accumulator.cpp
#include "strategy_operations_accumulator.h" #include <utility> #include "habana_graph.h" #include "slicing_utils.h" #define SOL_GEN_TRACE(...) LOG_TRACE(SRAM_SOL_GEN, __VA_ARGS__) #define SOL_GEN_DEBUG(...) LOG_DEBUG(SRAM_SOL_GEN, __VA_ARGS__) HandleEachStrategyOperation::HandleEachStrategyOperation(const HabanaGra...
ALGO
0.965273
6.933521
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2024-06-05T09:30:40.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 9, "forks": 5, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "a8807f2b9af3...
035381a6-c810-45af-b1dc-184da2e0c3d0
NgTienHungg/PTIT-Source
SPOJ PTIT/BCCAITUI.cpp
// https://www.spoj.com/PTIT/problems/BCCAITUI/ // BCCAITUI - <NAME> #include <bits/stdc++.h> using namespace std; int n, M; struct Data { int wei; int val; } a[105]; bool cmp(Data a, Data b) { return (double)a.val / a.wei > (double)b.val / b.wei; } int Try(int i, int W, int V) { if (W > M) ...
ALGO
0.99999
3.790817
{ "github_metadata": { "branch": "main", "commit_count": 106, "repo_created_at": "2021-07-04T02:14:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 130, "forks": 36, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2e7b993...
82710e97-0a36-49c5-9982-d19854c99e6f
arhbear/Cpp
task1.cpp
#include <iostream> using namespace std; int main() { int n = 0, sum = 0, pr = 1, i, max, min, k = 2; bool el = 1; cout << "Input number: "; cin >> n; max = min = n % 10; while (k <= n / 2){ if (n % k ==0){ el = 0; break; } k++; } if (el...
ALGO
0.999489
4.382604
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2019-11-23T14:05: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": "948ecad3a7...
c9f47936-54da-4413-9841-61b6e46f423b
JianShiUSC/oa
24_LRU_Cache_Count_Miss.cpp
// 实现 LRU Cache再判断啥时候miss就好了,返回miss数。 class LRUCache { private: struct Node { int val; Node* prev; Node* next; Node(int v) : val(v) {} }; int maxSize; Node* head; Node* tail; unordered_map<int, Node*> keyToNode; void insertToEnd(int v) { Node* nd = n...
ALGO
0.999941
5.435922
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2016-11-25T20:41:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f9adbbe55...
32eb53db-db55-4673-808e-e48d613e6d23
FeynmanTech/FeynmanPowder
src/simulation/Air.cpp
#include <cmath> #include <algorithm> #include "Config.h" #include "Air.h" #include "Simulation.h" //#include <powder.h> //#include <defines.h> #include "Gravity.h" /*float kernel[9]; float vx[YRES/CELL][XRES/CELL], ovx[YRES/CELL][XRES/CELL]; float vy[YRES/CELL][XRES/CELL], ovy[YRES/CELL][XRES/CELL]; float pv[YRES/CE...
ALGO
0.999148
3.93942
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2015-02-21T21:55:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0434f40af...
8819179d-c1f8-4433-8137-3aa5238e8d0e
Jaysanghani08/CSES-ProblemSet
2.SortingAndSearching/6.MovieFestival.cpp
// link : // soln : #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<vi> vvi; typedef pair<ll, ll> pll; typedef pair<int, int> pii; typedef map<int, int> mii; typedef set<int> si; #define ld long double #define all(a) (a).begin(), (a).en...
ALGO
0.999982
4.557454
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2024-01-15T05:05: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": "c3c7f96c990...
abcbf7cb-85f6-4df2-86d8-bb73cae8aea8
BayajidAlam/algorithms
Mid_term/Can_go.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; vector<pair<int, int>> v[N]; class cmp { public: bool operator()(pair<int, int> a, pair<int, int> b) { return a.second > b.second; } }; void dijkstra(int src, int n) { int dis[N]; for (int i = 0; i <= n; i++) { dis[i...
ALGO
0.999948
4.293218
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2024-01-29T07:10: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": "9db73c1093d...
97979fb5-a8c7-4bd4-90d9-52c54dc1ba54
zyz9066/Data-Structures
Assignment 1 Array Manipulation/Exercise3.cpp
// Exercise3.cpp by <NAME> // IDE: Dev-C++ 5.11 // updated 2019-02-10 #include "Array.h" #include <iostream> #include <stdlib.h> #include <time.h> using namespace std; // main function int main( int argc, char ** argv ) { try { Array<int> A(10); // Initialize random seed srand(time(NU...
ALGO
0.99666
4.551302
{ "github_metadata": { "branch": "master", "commit_count": 66, "repo_created_at": "2019-02-16T19:18: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": "820252cee...
11123f95-74b6-4c2c-b744-27ac372b0328
Mohamed-Elhabashy/competitive-programming
Codeforces/670/D1.cpp
#include <bits/stdc++.h> using namespace std; const long long N = 1e6; int d() { int ret; scanf("%d", &ret); return ret; } long long lld() { long long ret; scanf("%lld", &ret); return ret; } bool cmp(pair<int, int> s, pair<int, int> f) { if (f.first > s.first) return true; else i...
ALGO
0.999983
3.502146
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-04-17T04:58: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": "da8db622a2...
fba214ca-16a3-4923-b3c3-00482d36b16f
manmeet0307/Pepcoding-IP
LinkedList/add_poly.cpp
#include <iostream> #include <vector> #include<unordered_map> using namespace std; class Node { public: int coeff; int power; Node *next; Node(int data,int p, Node *next) { this->coeff = data; power = p; this->next = next; } }; Node *head1 =...
ALGO
0.999612
4.237652
{ "github_metadata": { "branch": "master", "commit_count": 165, "repo_created_at": "2020-04-18T13:39:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "69dd95e2...
6135e62d-44b1-4a19-b772-008c94fbdbbf
PauloMiranda98/Competitive-Programming-Notebook
test/data_structures/segment_tree_2d_test.cpp
#include "../../code/data_structures/segment_tree_2d.h" int mat[1010][1010]; int bruteForce(int x1, int y1, int x2, int y2){ int mx = -0x3f3f3f3f; for(int a=x1; a<=x2; a++) for(int b=y1; b<=y2; b++) mx = max(mx, mat[a][b]); return mx; } void testInsertAndQuery(){ int n = 600; int m = 565; SegTree2...
ALGO
0.981587
4.540777
{ "github_metadata": { "branch": "master", "commit_count": 245, "repo_created_at": "2020-02-22T03:30:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 27, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ab550f3...
a7ef2d7c-66f3-43d1-8b5d-e5b12af8d336
yuki-koyama/sequential-line-search
src/preference-regressor.cpp
#include <cmath> #include <fstream> #include <iostream> #include <mathtoolbox/constants.hpp> #include <mathtoolbox/log-determinant.hpp> #include <mathtoolbox/probability-distributions.hpp> #include <nlopt-util.hpp> #include <sequential-line-search/preference-regressor.hpp> #include <sequential-line-search/utils.hpp> u...
ALGO
0.999553
4.014241
{ "github_metadata": { "branch": "master", "commit_count": 487, "repo_created_at": "2018-02-13T12:06:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 51, "forks": 11, "issues": 10, "pull_requests": 0 }, "file_meta": { "content_id": "32f6b...
5dfa7047-2245-423f-8564-66479f07fa89
alexandraback/datacollection
solutions_5644738749267968_0/C++/shindannin/GoogleCodeJamForPractice.cpp
// topcoder.cpp : コンソール アプリケーションのエントリ ポイントを定義します。 // #include <stdio.h> #include <tchar.h> #include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algo...
ALGO
0.999838
3.588384
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c2223f75b...
418d7b60-dd48-476b-a2a5-50ad9893a1fa
Hcque/acm
z4_max_flow.cpp
#include <iostream> #include <queue> #include <cstring> using namespace std; const int N = 1e3+10, M = 2e5+10, INF = 1e9; int n,m,S,T; int h[N],e[M],ne[M],idx,f[M]; void add(int a, int b, int c){ e[idx]=b,f[idx]=c, ne[idx]=h[a],h[a]=idx++; } int vis[N],d[N],pre[N]; bool bfs(){ queue<int> que; memset(vis,...
ALGO
0.999667
4.401141
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2021-08-12T03:53: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": "4d64a339e...
3c6abb5b-fedb-45ca-8e59-374acfa1643a
cms-sw/cmssw
SimTracker/VertexAssociation/src/VertexAssociatorByPositionAndTracks.cc
#include <CLHEP/Units/SystemOfUnits.h> #include "SimTracker/VertexAssociation/interface/VertexAssociatorByPositionAndTracks.h" #include "SimTracker/VertexAssociation/interface/calculateVertexSharedTracks.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" VertexAssociatorByPositionAndTracks::VertexAssociator...
ALGO
0.917814
6.253893
{ "github_metadata": { "branch": "master", "commit_count": 251237, "repo_created_at": "2013-06-26T14:09:07.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1144, "forks": 4480, "issues": 947, "pull_requests": 108 }, "file_meta": { "content_id...
58b16d1d-820a-4e97-a9d9-65aa8bc09915
prashantsinha0604/Leetcode
2-add-two-numbers/add-two-numbers.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* addTwoNumbe...
ALGO
0.999959
6.1121
{ "github_metadata": { "branch": "main", "commit_count": 368, "repo_created_at": "2024-04-07T09:00: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": "9ee3f0bcec...
fcbd03b7-aad7-4b2b-9b96-09d066b91bf8
devanbenz/spray-paint
src/heap/min_heap.h
#pragma once #include "heap.h" #include <cassert> #include <concepts> #include <algorithm> template <typename T> requires Comparable<T> class MinHeap : public BaseHeap<T> { public: explicit MinHeap(int cap); void put(T value) override; T pop() override; bool is_leaf(int idx) override; [[nodis...
ALGO
0.951175
6.828177
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2024-11-16T00: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": "7ba36f9fee7...
7dccb562-092b-4cfb-8f54-3d948cb5c3e1
shaygeko/competitive_programming
codesprint/midcard_gpt.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; const ll MOD = 1000000007; vector<ll> seg_func(vector<ll> &ar, vector<ll> &br) { ...
ALGO
0.999937
5.321637
{ "github_metadata": { "branch": "main", "commit_count": 116, "repo_created_at": "2022-01-25T04:43: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": "e33a2fc53d...
3f86d7c0-3024-4c26-a28a-c216081cdf9a
bryanSME/hipparchus-_cpp
geometry/partitioning/BoundaryProjector.h
#pragma once /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "Licens...
ALGO
0.999422
5.682014
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2022-08-15T23:45:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5361a501de9...
ef5c1bb4-0bbf-4b01-84e2-4c5b30946688
anaherthel/sarpfiles
AuxFiles/Refer/IgorMalheiros/MDHDARP_src/src/MyLazyCallback.cpp
#include "MyLazyCallback.h" #include <iostream> #include <vector> #include <limits.h> #include <stdlib.h> #include <algorithm> using namespace std; //construtor da classe MyLazyCallback::MyLazyCallback(IloEnv env, const IloArray<IloArray<IloBoolVarArray> >& x_ref, Data* data) : IloCplex::LazyConstraintCallbackI(env),...
ALGO
0.995621
3.165374
{ "github_metadata": { "branch": "master", "commit_count": 386, "repo_created_at": "2019-11-28T11:14:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "15bd29b7...
4eed150c-10ca-444f-aff7-60861145ea31
da0ran9e/Algorithm-Competivive-Programing
src/x.cpp
#include <iostream> #include <vector> #include <math.h> #include <algorithm> struct rock { int weight, limit, cost; bool operator < (const rock &other) const { return weight + limit < other.weight + other.limit; } }; std::vector <rock> listRocks; int n; long long dp[1005][20005]; ...
ALGO
0.99987
4.214779
{ "github_metadata": { "branch": "main", "commit_count": 705, "repo_created_at": "2022-12-08T15:43:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a26e370e1f...
42383ec8-7af1-4b01-b32e-0edd40b56839
madhu9613/dsa_codeforce_folder
contest/codeforce trainning dp/rabbit.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string str; cin >> str; vector<int> dp(n, INT_MIN); // Use size n instead of n+1 dp[0] = 0; // Start at index 0 (1st cell) for (int i = 0; i < n; i++) { if (str[i] == 'w') { continue; // Skip ...
ALGO
0.999984
4.36277
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2025-03-26T07:13: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": "3f7a4b3e7a4...
652df0d9-df63-4504-a790-77ec5aa27b5d
Daiver/jff
py3/rasterizer1/csrc/barycentric.h
#ifndef RASTER_BARYCENTRIC_H #define RASTER_BARYCENTRIC_H #include <vector> /* def barycoords_from_2d_triangle(tri_points, p): p1 = tri_points[0] p2 = tri_points[1] p3 = tri_points[2] denom = (p2[1] - p3[1]) * (p1[0] - p3[0]) + (p3[0] - p2[0]) * (p1[1] - p3[1]) l1 = (p2[1] - p3[1]) * (p[0] - p3[...
ALGO
0.997909
6.876511
{ "github_metadata": { "branch": "master", "commit_count": 398, "repo_created_at": "2013-08-17T15:03:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "3ec62bd9...
b6d9fc8d-d22a-4621-8365-e61b46844551
AbhayMadaan9/Programs
ImplementPriorityQueue.cpp
/* class priQueue{ int *arr; int size; priQueue(){ arr = new int[1000]; size = -1; } void push(int x); void pop(); int getMaxElement(); bool isempty(); }; */ /* Time Complexity of push operation: O(log(N)) Spac...
ALGO
0.999752
4.974444
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2023-02-01T11:49: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": "d2c473d171c...
6dea6ad0-cf02-471f-90a7-9ca67fff299d
Hasin-Ishrak/CodeFolio
vscode(c++)/dominant_piranha.cpp
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0); cin.tie(nullptr); #define prb cin.exceptions(ios::badbit | ios::failbit); #define ll long long #define yo '\n' #define pb push_back const ll mod = 1e6 + 123; int main() { fast; prb; ll t; cin >> t; while (t--)...
ALGO
0.999878
4.072595
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-12-02T16:27: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": "d948410609a2...
b5bd3cfc-2fdd-42f7-a521-36ceb52253e7
5ebastian5/Mis-Estudios
Universidad/Estructura de Datos/Quiz/Quiz.cpp
#include <iostream> #include <conio.h> #include <stdlib.h> struct nodo{ int x; nodo *izq,*der; }; void enlazar(nodo *aux, nodo *n); void mostrarinorden(nodo *aux); void mostrarpreorden(nodo *aux); void mostrarpostorden(nodo *aux); nodo *raiz; using namespace std; main(){ int op; d...
ALGO
0.999831
4.297605
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-08-22T14:18: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": "159cb1aa0c29...
6d6ef9ed-ab29-4ab5-a790-22dc808c70ea
bytedance/Fastbot_Android
native/model/Graph.h
/* * This code is licensed under the Fastbot license. You may obtain a copy of this license in the LICENSE.txt file in the root directory of this source tree. */ /** * @authors <NAME>, <NAME>, <NAME> */ #ifndef Graph_H_ #define Graph_H_ #include "State.h" #include "Base.h" #include "Action.h" #include <map> nam...
ALGO
0.950398
6.431152
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2020-12-04T12:04:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1118, "forks": 253, "issues": 74, "pull_requests": 1 }, "file_meta": { "content_id": "843d55...
3f4b2959-e644-488d-949b-d942abd29182
akashtadwai/programming-practice
Graphs and Trees/BFS/max_dist_fromland.cpp
// https://leetcode.com/problems/as-far-from-land-as-possible/ #include <bits/stdc++.h> using namespace std; class Solution { public: int maxDistance(vector<vector<int>> &matrix) { int n = matrix.size(), m = matrix[0].size(); queue<pair<int, int>> q; vector<pair<int, int>> directions{{0, 1}, {1, 0}, {-1...
ALGO
0.999882
5.40821
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2020-06-02T16:12: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": "3998d7646...
c8754f89-80b0-4567-a8cd-d4fc2037902d
bartandrews/DiagHam_Stability
trunk/FQHE/src/Programs/FQHEOnSphere/FQHES2xS2BosonsDelta.cc
#include "HilbertSpace/BosonOnS2xS2.h" #include "HilbertSpace/BosonOnS2xS2Long.h" #include "HilbertSpace/BosonOnS2xS2HardcoreNoNearestNeighbors.h" #include "Hamiltonian/ParticleOnS2xS2DeltaHamiltonian.h" #include "Hamiltonian/ParticleOnS2xS2GenericTwoBodyHamiltonian.h" #include "Architecture/ArchitectureManager.h" #i...
ALGO
0.959993
3.90505
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2022-07-12T10:41:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "98de236fd4d...
e6471c56-aab4-4c6f-8319-96cdcc38ce4b
imhdx/My-all-code-of-Vjudge-Judge
CodeForces/385C/15231647_TLE_2000ms_199900kB.cpp
#include<bits/stdc++.h> using namespace std; int a[1000011]; #define MAXN 10000010 #define MAXL 20000010 int prim[MAXN]; int check[MAXL]; long long int num[10000010]; int main() { int i; int cnt=0; int tot = 0; for (int i = 2; i < MAXL; ++i) { if (!check[i]) { prim[tot++...
ALGO
0.999959
3.597289
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2019-03-16T14:21: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": "7a5b11c51...
3daf5ac6-04b4-480d-a110-029e38a3d990
Ngocanhjr/Data-structure
#CTUer/DSA2425/Phân Tích Thiết Kế Thuật Toán/C_C++/T_PNK/Graph 3 - Shortest Path Problem/Dijkstra_version3_weightMatrix.cpp
#include <stdio.h> #include <iostream> using namespace std; // Bước 1: Biểu diễn bằng phương pháp ma trận trọng số (adjacency matrix) #define NO_EDGE -1 // Không có cung giữa hai đỉnh #define MAX_N 101 // Tối đa 100 đỉnh, đánh số đỉnh từ 1 struct Graph { // Khai báo struct kiểu C++, không cầ...
ALGO
0.999988
4.842896
{ "github_metadata": { "branch": "master", "commit_count": 237, "repo_created_at": "2024-08-16T16:05: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": "3e1b92ce...
3615d6ca-a19d-454b-a7c7-da3cd12b72df
toast3rx/CrazyChess
Utils.cpp
#include "Utils.h" uint64_t Utils::getFile(int f) { return (0x0101010101010101ULL << (f - 1)); } uint64_t Utils::getRank(int r) { return (0xffULL << (8 * (r - 1))); } int Utils::popLsb(uint64_t &n) { int LsbIndex = __builtin_ffsll(n) - 1; n = n & (n - 1); return LsbIndex; } int Utils::getBits(const ui...
TOOL
0.921728
4.36404
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2023-04-20T15:53:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ea1fd6232...
4c1506fb-5991-4d41-a91b-39c10206103f
DaAlG/code_studying
jeehyun/개별문제/Baekjoon/15990_1, 2, 3 더하기 5.cpp
/* * DP * 15988 1, 2, 3 더하기 3 */ #include <iostream> #include <cstring> #define MAX 1000001 #define MOD 1000000009 using namespace std; // dp[n][i] = 마지막에 오는 수가 i일 때, 1, 2, 3의 합으로 정수 n을 만드는 경우의 수 long long dp[MAX][4]; void solve() { dp[1][1] = dp[2][2] = 1; dp[3][1] = dp[3][2] = dp[3][3] = 1; for (int i = 4; ...
ALGO
0.999939
4.251012
{ "github_metadata": { "branch": "master", "commit_count": 1042, "repo_created_at": "2020-09-13T08:06:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a189fe6f...