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
854af1fd-d227-480c-8241-f84a3078fdf6
Ekumen-OS/beluga
beluga/include/beluga/algorithm/amcl_core.hpp
// Copyright 2024 Ekumen, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in...
ALGO
0.998272
7.612283
{ "github_metadata": { "branch": "main", "commit_count": 313, "repo_created_at": "2022-10-21T20:30:35.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 246, "forks": 23, "issues": 31, "pull_requests": 4 }, "file_meta": { "content_id": "5b208cc...
f29c6bdf-14df-4c8a-aef8-20b973c678a8
Nek5000/nekRS
src/solvers/elliptic/ellipticBuildPreconditionerKernels.cpp
/* The MIT License (MIT) Copyright (c) 2017 <NAME>, <NAME>, <NAME>, <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the ri...
ALGO
0.920041
5.397734
{ "github_metadata": { "branch": "master", "commit_count": 405, "repo_created_at": "2019-08-04T08:45:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 339, "forks": 91, "issues": 14, "pull_requests": 2 }, "file_meta": { "content_id": "95fe9...
eec31007-d88d-4b47-9f3d-1bd6d43f7b96
ArthurEmidio/programming-problems
codeforces/154/B2.cpp
#include <bits/stdc++.h> using namespace std; int main() { #ifdef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int n; scanf("%d", &n); vector<int> v(n); for (int i = 0; i < n; i++) scanf("%d", &v[i]); sort(v.begin(), v.end()); ...
ALGO
0.999375
3.573323
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2016-08-18T02:30: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": "67d22dfe4...
d1c0fc15-ea7d-4850-85d0-ff721ee0c2cd
MakerFace/leetcode
src/Sep/9.18/6181.cpp
/** * @file 6180.cpp * @brief * @author chenqi (<EMAIL>) * @version 1.0 * @date 2022-09-18 */ #include <bits/stdc++.h> using namespace std; class Solution { public: int longestContinuousSubstring(string s) { int ans = 0; int len = 0; int n = s.size(); int i = 0, j = 0; while (j < n) { ...
ALGO
0.999928
4.694886
{ "github_metadata": { "branch": "main", "commit_count": 161, "repo_created_at": "2022-02-24T06:13:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e541c8d90f...
0d75017e-5b48-42fb-9148-1f8963c15ae5
nicyun/DirectedMST
src/Network.cpp
#include <iostream> #include <vector> #include "Network.hpp" #include "Simulator.hpp" using namespace std; Network::Network(int n) { numNode = n; vector<double> tmp(numNode, INF); for(int i = 0; i < numNode; i++){ graph.push_back(tmp); } } void Network::addEdge(int i, int j, double weight) { if(i == j) retur...
ALGO
0.999849
3.744877
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2012-01-04T08:58: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": "8c99ab5888...
e993e93f-4a5f-4b85-b1cd-dd297c510301
Boris1991/searching_engine
src/ConverterJSON.cpp
#include <vector> #include <string> #include <filesystem> #include <iostream> #include <fstream> #include "ConverterJSON.h" bool ConverterJSON::loadConfig() { std::ifstream configFile(configFilePath); if (!configFile.is_open()) { std::cerr << "Could not open file: " << configFilePath << std::endl; ...
DATA
0.918749
4.927811
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-02-14T03:53:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "592a48571f8f...
0567f713-3a48-48f7-8f82-c25bba979d00
Talluripavan/C-Coding
middle-element-in-ll/main.cpp
#include<stdlib.h> #include <stdio.h> struct node { int data; struct node *next; }; void Newnode (struct node **head, int data) { struct node *nnode = (struct node *) malloc (sizeof (struct node)); nnode->data = data; nnode->next = *head; *head = nnode; } void printLl (struct node *h) { struct node *hea...
ALGO
0.999694
4.241939
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2020-10-29T07:07: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": "342c6cd33306...
df434564-8c0d-4842-bdf8-28ad487495f6
codymorg/Homework
Archive/2019.01/CS280/subset/subsets.cpp
#include <iostream> #include <vector> #include <algorithm> using std::vector; using std::cout; using std::for_each; #define BRANCHING_FACTOR 2 #define FIRST_INDEX 0 template<typename T> bool Add(vector<T> const& set, vector<T> sub, int index) { if (index < int(set.size())) { sub.push_back(set[index]); Ad...
ALGO
0.993473
5.404668
{ "github_metadata": { "branch": "master", "commit_count": 161, "repo_created_at": "2019-09-13T17:22:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "90495d9e...
4d2d60e4-a221-4c6b-b18a-9bba5fc349b9
Pablorg99/UCO-Practices
Segundo/POO/Practice_1/Exercise_2/guess.cc
/*------------------------------------------------------------------------------ Practice 1 Exercise 2 guess.cc This program asks for a number to the user and generates a random number between 1 and 10. The program says to the user if the number he has introduced is greater, less or equal to the number generated by th...
TOOL
0.913094
3.878171
{ "github_metadata": { "branch": "master", "commit_count": 342, "repo_created_at": "2018-04-12T22:50:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aedb20a6...
0f305d72-51d5-4244-a4b7-b6ede650d571
kauanpecanha/Faculdade
Cpp_Algorithms_and_Data_Strucutres-master/Trabalho3_Algoritmos/Questao4.cpp
#include <iostream> using namespace std; void printArray(int arr[], int l) //procedimento de impressao do vetor { int i = 0; do { cout<<arr[i]<<" "; i++; } while(i!=l); } int partition( int arr[],int begginer, int last) //rotina de partição do vetor { int i = begginer; i...
ALGO
0.999981
5.286096
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2023-09-28T17:30: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": "eae10bc3f...
2557c125-56b6-474d-98e0-9c77466febf2
b718/FillerProject
priority.cpp
/* * File: priority.cpp * Description: Implements a priority ordering structure specially made for determining the * order of neighbours visited in PA2's filler::fill function. * Note that this does NOT serve the same purpose as the stack/queue * ordering structure whi...
ALGO
0.993478
6.374099
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-05-09T06:08: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": "1fc3b09abd...
b65b1354-3a97-4404-9d69-e26fa79202e8
Mohiuddin-Khaled/DS
Week-3-Assignment-1/remove_duplicates_I.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: int val; Node *next; Node(int val) { this->val = val; this->next = NULL; } }; void insertAtNode(Node *&head, Node *&tail, int val) { Node *newNode = new Node(val); if (head == NULL) { head = newNod...
ALGO
0.999958
4.438362
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-06-10T01:33: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": "20c6c29ec09...
7f36e830-292b-4f9a-b005-fef696513361
lchiaying/Matrix
main.cpp
#include <iostream> #include <vector> #include <armadillo> #include "symm_matrix_mult.h" using namespace std; using namespace arma; #ifdef MKL #define dspmv_ DSPMV #define dgemv_ DGEMV #endif extern "C" { void dspmv_(const char * UPLO, const int * N, const double * ALPHA, double * AP, double * X, ...
ALGO
0.999718
5.804516
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2015-08-09T16:46: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": "aea87f06d1...
030fd33d-b63c-4c32-ba09-7ac8cc03e6c4
mehmetdemir2019/Data_Structures_and_Algorithms
Hafta5_Tekbaglidongusel_Linklists/Hafta5_ders.cpp
#include <stdio.h> #include <stdlib.h> struct node { int data; struct node* next; }; struct node* head = NULL; struct node* temp = NULL; void addFoot(int sayi) { struct node* willbeadded; willbeadded = (struct node*)malloc(sizeof(struct node)); willbeadded->data = sayi; willbeadded->next = NU...
ALGO
0.99234
3.769143
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-03-11T10:46: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": "ca874e3fe4b3...
f82c9336-686d-45db-bb5a-2ada50ccc4ca
YasirAli851/Data-structures-and-algorithms
Mathematics/GeeksForGeeks/Prime_number.cpp
Prime number:-It is a number that has two factors(i.e 1 and number itself). For example:- 2,3,5,7,11,13. All the number above have only two factors and that is 1 and the number itself. Code to check prime numbers:- #include<iostream> using namespace std; bool check_prime(int n) { if(n==1) { return fal...
ALGO
0.999963
4.798177
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2022-07-29T08:00: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": "3a4f3f5b3df...
3aa294e6-04b7-4f46-ae6d-02a673d9f3a1
VA-run23/Data-Structures-And-Algorithms
Graphs/cycleDetection.cpp
//34.7 //DFS tree, Back Edge => cyclic //Check as it is giving output of cycle is present even for acyclic #include <bits/stdc++.h> using namespace std; #define vi vector<int> #define vvi vector<vi> #define pii pair<int, int> #define vii vector<pii> #define rep(i,a,b) for (int i=a; i<b; i++) #define ff first #define ...
ALGO
0.999953
4.911858
{ "github_metadata": { "branch": "main", "commit_count": 60, "repo_created_at": "2025-01-04T07:47:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a5ee41def06...
1e26ded7-b1b6-4e9a-bf42-c05f95fec6c3
mukhoplus/BOJ
1_cpp/2941/MAIN.cpp
#include <iostream> #include <string> using namespace std; int main() { string word; int cnt = 0; cin >> word; int s = word.size(); bool* check = new bool[s]; for (int i = 0; i < s; i++) check[i] = false; for (int i = 0; i < s-1; i++) { if (word.substr(i, 2) == "c=" || word.substr(i, 2) == "c-" || word.su...
ALGO
0.999447
3.294725
{ "github_metadata": { "branch": "main", "commit_count": 716, "repo_created_at": "2021-03-06T10:55: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": "92e532459f...
48382253-0167-4258-a43f-3ec58cd9baed
igkiou/sparse_linear_model
mexfiles/kernel_obj_grad_mex.cpp
/* * kernel_obj_grad_mex.c * * Created on: Aug 24, 2011 * Author: igkiou */ #include "sparse_classification.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { /* Check number of input arguments */ if (nrhs != 4) { ERROR("Four input arguments are required."); } /* C...
ALGO
0.981984
5.751079
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2011-11-30T09:28:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 12, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "45c479b...
53bd7028-f6b8-46ec-a80b-46482226e0f0
kunalduttagit/C-course
3. Queue/3. Applications/stack.hpp
// // QueueUsingStack.hpp // DSA // // Created by <NAME> on 09/12/22. // #ifndef QueueUsingStack_hpp #define QueueUsingStack_hpp #include <iostream> using namespace std; template <class T> class node { public: T data; node *next; node(int x) { data = x; next = NULL; } }; templ...
ALGO
0.929864
4.006548
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2022-09-26T19:21: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": "27a108149a5...
20a211bd-e027-4811-b285-1121674c44a6
a-y-khan/docker_examples
multistage_from_image/binomial.cpp
#include <iostream> int min(const int a, const int b) { return (a < b) ? a : b; } int binomialCoeff(const int n, const int k) { int C[n+1][k+1]; for (int i = 0; i <= n; ++i) { for (int j = 0; j <= min(i, k); ++j) { // base case if (j == 0 || j == i) ...
ALGO
0.999931
6.194763
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2018-05-04T02:35:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6ec1168a8...
79d9d06d-98bc-4bb4-a87b-1d4b10f81f0b
ishandutta2007/codeforces-s
sooke/normal/1404/B.cpp
#include <bits/stdc++.h> inline int read() { char c; int x; for (c = getchar(); !isdigit(c); c = getchar()); for (x = 0; isdigit(c); c = getchar()) { x = x * 10 + c - '0'; } return x; } const int N = 1e6 + 5; int n, s, t, ds, dt, ft[N], hs[N], dep[N], siz[N], top[N]; std::vector<int> e[N]; void dfs1(int...
ALGO
0.999956
4.35917
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:07: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": "ffa24b44ebdf...
f7482858-7a88-4e6c-bd1e-b8e440f422ff
chickenoverrice/C_CPP
VM/processVM/vm.cpp
#include <iostream> #include <fstream> #include <string> #include <vector> #include <map> #include <stdlib.h> #include <string.h> #include <assert.h> #include <algorithm> using namespace std; typedef int (*pfunc)(string, string); map<string, pfunc> funcMap; map<string, int> regMap; map<string, int> labelMap; map<stri...
TOOL
0.902035
3.352321
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-05-13T22:41: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": "85de4fcc25...
425a6723-ddb2-45e2-b52d-116fbd92ae14
ryo-manba/AtCoder
ABC/ABC032/a/main.cpp
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; const int INF = (int)1e9; const ll INFL = (ll)1e15; const int MOD = 1e9 + 7; int dy[]={0, 0, 1, -1, 0}; int dx[]={1, -1, 0, 0, 0}; template<class T> inline bool chmax(T& a, T b) {...
ALGO
0.999947
3.718723
{ "github_metadata": { "branch": "master", "commit_count": 319, "repo_created_at": "2021-02-24T11:34: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": "f4df7a7d...
6b97019e-13ad-4231-b968-9c8a29e167d0
stevebraveman/Code
LUOGU/[SDOI2016]生成魔咒.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <map> #define MAXN 1000100 using std::map; map <int, int> t[MAXN]; int len[MAXN], fa[MAXN], si[MAXN], tot = 1, last = 1, n, x; long long ans; void insert(int k) { int p = last; int np = last = ++tot; si[np] = 1; len[np] = len[p] ...
ALGO
0.999706
3.669737
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2019-08-07T02:51: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": "727cb7889...
db482776-78d4-47d8-b4ad-97a924ebbbf7
munh-orgil/leetcode
2025/02. feb/(22) 1028. Recover a Tree From Preorder Traversal.cpp
#include<bits/stdc++.h> using namespace std; 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), left(left), right...
ALGO
0.999857
4.401602
{ "github_metadata": { "branch": "main", "commit_count": 430, "repo_created_at": "2024-01-03T02:25: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": "60e1dc0d10...
9bcb9838-5476-4bc9-994d-00e24f617d88
adityaa30/programs
ContestFiles/CSES/Sorting and Searching/Sum-of-Three-Values.cpp
#include <bits/stdc++.h> using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, x; cin >> n >> x; vector<array<int, 2>> A(n); for (int i = 0; i < n; ++i) { cin >> A[i][0]; A[i][1] = i + 1; } sort(A.begin(), A.end()); for (int i = 0; i ...
ALGO
0.999978
4.484622
{ "github_metadata": { "branch": "main", "commit_count": 121, "repo_created_at": "2020-09-15T17:15:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 9, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5d4384b8c...
1d0d4e93-81ba-4c55-bdab-a45ecb61ed21
zhuli19901106/leetcode-zhuli
explore/top-interview-questions-medium/0821_fraction-to-recurring-decimal_1_AC.cpp
// F the edge cases #include <cmath> #include <cstdint> #include <unordered_map> #include <vector> using std::abs; using std::unordered_map; using std::vector; class Solution { public: string fractionToDecimal(int numerator, int denominator) { static const int R = 10; int64_t n1 = numerato...
ALGO
0.999845
5.929893
{ "github_metadata": { "branch": "master", "commit_count": 234, "repo_created_at": "2016-12-03T04:46:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 557, "forks": 157, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "50cd...
b0155ce2-737d-4778-af43-87cba080b76b
westgate458/LeetCode
P0671.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.999992
6.550467
{ "github_metadata": { "branch": "master", "commit_count": 517, "repo_created_at": "2018-10-14T01:23:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aa632fd0...
dffa8dfa-4c85-4891-b76d-dcd34a8edb3b
umontreal-simul/latnetbuilder
examples/tutorial/NetSearchCBC.cc
// This file is part of LatNet Builder. // // Copyright (C) 2012-2021 The LatNet Builder author's, supervised by <NAME>, Universite de Montreal. // // 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 Lice...
ALGO
0.950738
5.720291
{ "github_metadata": { "branch": "master", "commit_count": 748, "repo_created_at": "2016-03-22T19:19:51.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 16, "forks": 8, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "3854732f...
e7c157f2-67b9-4895-99bc-02d17aa9d618
richenyunqi/CCF-CSP-and-PAT-solution
CCF CSP/201709-2. 公共钥匙盒.cpp
#include <bits/stdc++.h> using namespace std; using gg = long long; struct Key { //钥匙编号,取/还时间,flag=0表示是还;flag=1表示是取 gg num, time, flag; Key(gg n, gg t, gg f) : num(n), time(t), flag(f) {} }; //优先级:时间小、先还后取、编号小的优先 bool operator<(const Key& k1, const Key& k2) { return tie(k1.time, k1.flag, k1.num) > tie(k2.t...
ALGO
0.999979
4.022163
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2018-12-24T07:45:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 758, "forks": 132, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "bec57...
8df76f26-a4e1-4291-b480-792115a7150f
xxioachou/ACM
contest/2024SCNU校赛_热身赛/baoli_D.cpp
#include <bits/stdc++.h> #define x first #define y second #define sz(x) ((int)x.size()) using namespace std; typedef long long ll; typedef pair<int, int> PII; const int inf = 0x3f3f3f3f; const ll INF = 1e18; void solve() { ll n; cin >> n; vector<ll> a(n + 1), s(n + 1), v{0}; for(int i = 1; i <= n; i++) { cin >>...
ALGO
0.9998
3.765777
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2023-08-01T12:58:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2192a66da16...
02cade80-3364-4862-9371-a35d1628bd3c
acorovic/operativni_sistemi
w8/MEMORIJA-virtualna/main.cpp
/* Napisati konkurentni program koji simulira menjanje kapaciteta raspolozive memorije pri izvrsavanju nekog programa. Program je predstavljen klasom Program. U konstruktoru klase prosledjuje se ukupni kapacitet RAM memorije. Nit predstavljena datom funkcijom "izvrsavanje" izvrsava listu naredbi program...
TOOL
0.970371
4.967299
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2016-03-03T18:52: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": "40ddda2ef...
a5ad2eb7-52d5-445d-accf-da5edb078c54
spad1e/competitive-programming
codeforces/cf1906/J.cpp
#include <bits/stdc++.h> #define pii pair<int, int> #define ll long long using namespace std; const int MX = 5e3 + 3; const int MOD = 998244353; ll dp[2][MX][2], p[MX], a[MX]; int main() { int n; cin >> n; for (int i = 1; i <= n; ++i) cin >> a[i]; p[0] = 1; for (int i = 1; i <= n; ++i) p[i] = (p[i-1]<<1) % ...
ALGO
0.99999
4.351171
{ "github_metadata": { "branch": "master", "commit_count": 220, "repo_created_at": "2024-04-05T12:40: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": "635f238f...
e59df8d4-657c-46dc-87cb-358f76aca64b
shivangigoel1302/leetcode_solutions
implement_magic_dictionary.cpp
class MagicDictionary { public: /** Initialize your data structure here. */ vector<string>words; MagicDictionary() { } void buildDict(vector<string> dictionary) { for(auto word:dictionary){ words.push_back(word); } } int count(string w,string s){ int cha...
ALGO
0.999804
5.627585
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2020-06-22T17:52:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ea61de6b1...
5d1c49e4-490b-4daa-ba25-9cb757164b37
himanshurobo/datastructurecoding
array/PascalsTriangle_118.cpp
/* Given a non-negative integer numRows, generate the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it. Example: Input: 5 Output: [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ] WrittenBy : <NAME> Problem : Pascal's Triangle I Ti...
ALGO
0.999861
5.851809
{ "github_metadata": { "branch": "master", "commit_count": 79, "repo_created_at": "2019-08-22T05:49: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": "1a460882f...
a82130c8-76e1-46bc-aa81-ef511b01fdd9
shubharthaksangharsha/shubhi-prep
mycodes/arrays/moveZeros.cpp
#include<iostream> #include<vector> using namespace std; void input(vector<int>&arr){ for(auto &i: arr){ cin >> i; } } void display(const vector<int>arr){ for(auto const i: arr){ cout << i << " "; } cout << endl; } void moveZeros(vector<int>&arr){ //[0, 1, 0, 3, 12] //Usin...
ALGO
0.99997
5.128145
{ "github_metadata": { "branch": "main", "commit_count": 107, "repo_created_at": "2021-08-22T05:47: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": "acb5049d85...
44597c86-3578-40c2-93d8-1a231492431d
mlpack/ensmallen
include/ensmallen_bits/fw/update_full_correction.hpp
/** * @file update_full_correction.hpp * @author <NAME> * * Update method for FrankWolfe algorithm, recalculate the coefficents of * of current atoms, while satisfying the norm constraint. * Used as UpdateRuleType. * * ensmallen is free software; you may redistribute it and/or modify it under * the terms of th...
ALGO
0.979497
6.726127
{ "github_metadata": { "branch": "master", "commit_count": 3534, "repo_created_at": "2018-10-03T01:53:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 790, "forks": 128, "issues": 7, "pull_requests": 5 }, "file_meta": { "content_id": "4e28...
b9176bbf-4beb-4590-90da-e3ab640afac0
imjoyhalder/Leetcode_Problem_solving
June/Day-25/2040. Kth Smallest Product of Two Sorted Arrays.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long class Solution { public: ll cntpos(ll m, ll x, vector<int>& nums2) { ll s = 0; ll e = nums2.size()-1; ll ans = -1; while(s <= e) { ll mid = (s + e) / 2; if(x * (ll)nums2[mid] <= m) { ...
ALGO
0.999992
5.092713
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2025-01-11T17:10:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f5c710a04eb...
dd2b0e28-3495-4607-9a44-e391677696c6
VanViet1608/Thu-t-to-n-s-p-x-p
sellsort.cpp
#include <iostream> using namespace std; // gap là biến chia đôi dãy số sau mỗi lần sort 1 phần nhỏ // temp là biến lưu trữ dùng để so sánh, giống insertion sort // các bạn lấy giấy thực hiện lại các bước chạy của đoạn code cho dễ hiểu void sort (int vv[], int n) { int gap, i, j, temp; for(gap = n/3; gap > 0; ga...
ALGO
0.999981
4.469984
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-04-13T13:38: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": "1bab8658cba7...
6158bd7e-5f06-40b5-baf2-cac1c2b51d11
youhyeoneee/Algorithm
백준/큰돌 C++/2주차/4949.cpp
#include <iostream> #include <string> #include <stack> using namespace std; string str; void Remove(stack<char> &s, char ch, bool isBig) { char left, right; if (isBig) { left = '['; right = ']'; } else { left = '('; right = ')'; } if (!s.empty()) ...
ALGO
0.999783
4.708062
{ "github_metadata": { "branch": "master", "commit_count": 398, "repo_created_at": "2022-03-04T13:38: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": "693bd046...
f81b06d9-7b68-4387-82fb-847666849855
OrigenesZhang/-1s
codeforces/R591/CF1223F.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++) #define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--) #define REP(i, n) FOR(i, 0, (n)-1) #define sqr(x) ((x) * (x)) #define all(x) (x).begin(), (x).end() #de...
ALGO
0.999827
3.511587
{ "github_metadata": { "branch": "master", "commit_count": 1525, "repo_created_at": "2017-02-01T16:05:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "551d78b...
4bda555e-d7d1-4617-b97f-f3446843035f
HieuNguyenMinh1804/thuc-hanh-02
bai1.cpp
#include<bits/stdc++.h> #define ll long long #define endl "\n" using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t; cin >> t; while(t--){ string s1, s2, add = ""; cin >> s1 >> s2; for(int i = 0; i < s1.size(); ++i) if(s1[i] == '6') s1[i] = '8'; for...
ALGO
0.999833
4.668771
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-04-13T07:52: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": "049c4fddb6d8...
0a672025-85ff-40a9-b6a4-a96d0065e56b
UppermanJ/CSC-College
CSC 210/10 - PointersAndDynamicVariablesAsClassMembers/main.cpp
#include <iostream> #include <string> #include "Rectangle.h" #include "Rectangle.cpp" using namespace std; // Driver / Client void show_rect(Rectangle list[]) { char alphabet[] = { 'A', 'B', 'C', 'D' }; int i = 0; int arrSize = (sizeof(list[...
TOOL
0.969427
3.758922
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2022-03-04T02:15:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "508795c92...
e2e8f30a-8811-4fd8-a269-9013fa941eac
winersch/Algorithm
백준/Gold/20040. 사이클 게임/사이클 게임.cc
#include <iostream> #include <vector> #include <algorithm> #include <queue> #include <cstring> #include <stack> #include <map> #include <numeric> #include <cmath> using namespace std; int n, m; int parent[500001]; int findParent(int a) { if (parent[a] == a) { return a; } else { return parent...
ALGO
0.999972
3.799153
{ "github_metadata": { "branch": "main", "commit_count": 768, "repo_created_at": "2023-08-07T05:08: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": "4f74fa5a2d...
ca344944-7164-49ec-b048-6c747d01a06d
leonsliangyu/LeetCode
Design_Browser_History.cpp
class BrowserHistory { private: vector<string> forwards; vector<string> backward; string page; public: BrowserHistory(string homepage) { page=homepage; } void visit(string url) { backward.push_back(page); page=url; forwards.clear();...
ALGO
0.999447
5.401727
{ "github_metadata": { "branch": "master", "commit_count": 331, "repo_created_at": "2020-06-04T05:07: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": "c5014386...
15c06fdf-6e8e-4ff0-adc0-d4393db017a5
WhiteCells/code
algo/lc/2_linked_list/reverse-linked-list2.cpp
#include "../../head_file.h" /* problme: url: */ struct ListNode { int val; ListNode *next; ListNode(int val) : val(val), next(nullptr) {} }; class Solution { public: ListNode *reverseList(ListNode *head) { } }; class List { public: List() : head_(nullptr), size_(0) { } ...
ALGO
0.999598
5.476973
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2023-07-29T04:29:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e610640907c1...
d2c697c7-0d40-4851-a944-6914bc630dec
bvquoc/CP-Trainning-2021
0 - Contest 2020/PreVOI2019/PreVOI2019-Day1/Contestants/Ti121/ODDCOIN.cpp
#include <bits/stdc++.h> #define getbit(x, i) (x >> (i - 1) & 1) #define onbit(x, i) (x | (1 << (i - 1))) #define offbit(x, i) (x ^ (1 << (i - 1))) #define cntone(x) (__builtin_popcount(x)) #define sum(x, y, u, v) (f[u][v] - f[x - 1][v] - f[u][y - 1] + f[x - 1][y - 1]) using namespace std; typedef long long ll; const...
ALGO
0.99963
3.681861
{ "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": "a264a888...
5072c403-a57e-4b40-993f-b946498e3272
cheuk-fung/Programming-Challenges
ZOJ/3229.cc
/* * SRC: ZOJ 3229 * PROB: Shoot the Bullet * ALGO: Network flow * DATE: Aug 13, 2012 * COMP: g++ * * Created by <NAME> */ #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int INF = 0x3f3f3f3f; const int MAXV = 1500; const int MAXE = 1000000; struct Edge { int v, c, ...
ALGO
0.999774
3.242152
{ "github_metadata": { "branch": "master", "commit_count": 423, "repo_created_at": "2011-03-05T17:28:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f6819bee...
e3bda39f-c5fa-46a5-9f3e-3d54936cc9d3
Rohan27s/Mission-4-months
01. Rotated Sorted Array.cpp
#include <bits/stdc++.h> using namespace std; /******* All Required define Pre-Processors and typedef Constants *******/ #define ff first #define ss second #define mid(l, r) (l + (r - l) / 2) #define int long long #define mod 1000000007 #define MOD1 = 998244353; #define pb push_back #define mp make_pair #define pq_m...
ALGO
0.999884
4.838477
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2021-09-05T05:55:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "152a8ef81cf...
8286d5d7-3b3f-4ee2-aafd-7c8bc3f2d2c4
llynv/CP-files
junks/segmentTree.cpp
#include <bits/stdc++.h> using namespace std; #define LOCAL #define int long long #define ii pair<int, int> #define fi first #define se second #define pb push_back string to_upper(string a) { for (int i=0;i<(int)a.size();++i) if (a[i]>='a' && a[i]<='z') a[i]-='a'-'A'; return a; } string to_lower(string a) { for (int ...
ALGO
0.999996
5.375813
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2023-05-26T04:12: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": "efc8ef7afcb...
d696263f-7ff9-41ee-989f-4c9f58850802
satyamtiwari736182/CP
pepcoding/Level 2/Tree/36_Path Sum In Binary Tree - 2.cpp
// 1. You are given a partially written function to solve. // 2. You are required to complete the body of PathSum function. The function is expected to return all root-to-leaf paths where each path's sum equals targetSum. // 3. Input and Output is managed for you. #include "makeTree.h" void pathSum(Node *root, int tar...
ALGO
0.999791
5.296122
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2022-02-26T18:00: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": "bf0396737d0...
175a1dc5-e834-447c-bc15-79e9201ff364
fuuzen/parallel-programming
lab4/test2/main.cpp
#include "main.h" #include <cmath> #include <string> #include <cstdio> void * calc_by_double(void* arg) { Args* args = (Args*)arg; double x, y; for (int i = 0; i < args->count_all; i++) { x = static_cast<double>(rand()); y = static_cast<double>(rand()); if (x * x + y * y <= QUADRA_RAND_MAX_DOUBLE) { ...
ALGO
0.997512
4.380866
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2025-03-06T12:39: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": "2aae8f90e...
f96e1331-200d-4e58-985f-93baa67878c9
Solvify/Solvify
leetcode/2021/february/practice/cpp/206-ReverseLinkedList.cpp
#include<iostream> using namespace std; // 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) {} }; void display(ListNode* list) { ...
ALGO
0.999924
6.035651
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2021-02-18T05:37:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "19429f8d7...
bdb31eee-f042-437b-a8e5-af160b6d8957
ehomeshasha/acoj
ZJ-01/acoj/普及-/12011. 机器翻译-循环队列解法.cpp
#include <iostream> using namespace std; /** 小晨的电脑上安装了一个机器翻译软件,他经常用这个软件来翻译英语文章。 这个翻译软件的原理很简单,它只是从头到尾,依次将每个英文单词用对应的中文含义来替换。 对于每个英文单词,软件会先在内存中查找这个单词的中文含义,如果内存中有,软件就会用它进行翻译; 如果内存中没有,软件就会在外存中的词典内查找,查出单词的中文含义然后翻译,并将这个单词和译义放入内存,以备后续的查找和翻译。 假设内存中有M个单元,每单元能存放一个单词和译义。 每当软件将一个新单词存入内存前,如果当前内存中已存入的单词数不超过M-1,软件会将新单词存入一个未使用的内存单元; ...
ALGO
0.999867
3.619954
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2022-11-19T11:45: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": "6fe2bccb5...
221006bc-7120-4d4e-9f44-3f5d95e090cc
ishandutta2007/codeforces-a
abc864197532/normal/1623/B.cpp
#include <bits/stdc++.h> using namespace std; #define lli long long int #define mp make_pair #define pb push_back #define eb emplace_back #define pii pair <int, int> #define X first #define Y second #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() void abc() {cout << endl;} template <typename T, t...
ALGO
0.999754
4.247385
{ "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": "4489d6b609bb...
64d1db99-229c-448d-a431-a73ab8e53c85
satya-arjunan/visiocyte
released_plugins_more/visiocyte_plugins/neurontracing_MOST/mostVesselTracer.cpp
/* mostVesselTracer.cpp Copyright 2010 <NAME> 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...
TOOL
0.984676
3.449747
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2019-02-15T09:14: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": "a75004e47...
30ce8c7f-6f2e-41f7-91b4-082c8698538a
charliecqc/AlgorithmPro
FD_Jury_Compromise/main.cpp
#include <stdio.h> #include <stdlib.h> #include <iostream> #include <queue> #include <vector> #include <math.h> #include "start.h" #pragma warning( disable : 4996) using namespace std; Cand* best; //seek the worst case's index void set_best(int num, Cand* cands, Cand next) { int i; int all1 = 0, all2 = 0; int temp...
ALGO
0.999814
3.181189
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2016-11-10T15:33:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "02c8156663...
cfa1f49c-794f-4ea6-928b-7ee6331efd44
kyamagu/mexopencv
src/+cv/fitLine.cpp
/** * @file fitLine.cpp * @brief mex interface for cv::fitLine * @ingroup imgproc * @author <NAME> * @date 2011 */ #include "mexopencv.hpp" #include "opencv2/imgproc.hpp" using namespace std; using namespace cv; /** * Main entry called from Matlab * @param nlhs number of left-hand-side arguments * @param plhs...
ALGO
0.93444
6.50887
{ "github_metadata": { "branch": "master", "commit_count": 1445, "repo_created_at": "2011-12-26T01:59:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 664, "forks": 319, "issues": 37, "pull_requests": 2 }, "file_meta": { "content_id": "b7...
b28ba93c-7ef4-48f7-b126-da5123804da4
RAJ4823/Codes
LeetCodes/reverse-vowels-of-a-string/11-13-2023, 9_14_36 AM/reverse-vowels-of-a-string.cpp
// Link: https://leetcode.com/problems/reverse-vowels-of-a-string /** Submission Info: * * AUTHOR: the_247 | <NAME> * TITLE: reverse-vowels-of-a-string * RUNTIME: 11 ms * MEMORY: 8.1 MB * DATE: 11-13-2023, 9:14:36 AM * */ // Solution: class Solution { public: bool isVowel(char &ch) { if(ch =...
ALGO
0.999879
6.454014
{ "github_metadata": { "branch": "master", "commit_count": 124, "repo_created_at": "2022-07-27T10:16:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "76eebb98...
65a089ed-1f36-43e3-a418-2b271df49d58
csus4uwu/sync2024
sol/CF/1426E.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n; cin >> n; array<int, 3> a, b; for (int i = 0; i < 3; i++) { cin >> a[i]; } for (int i = 0; i < 3; i++) { cin >> b[i]; } int x = min(a[...
ALGO
0.999966
4.426895
{ "github_metadata": { "branch": "main", "commit_count": 829, "repo_created_at": "2024-03-03T00:44: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": "084a5f787c...
f80ca21b-c643-481e-9bb2-f3056dcfaa71
hedwig3798/codingtest
프로그래머스/unrated/150365. 미로 탈출 명령어/미로 탈출 명령어.cpp
#include <bits/stdc++.h> const int INF = 987654321; using namespace std; string solution(int n, int m, int x, int y, int r, int c, int k) { string answer = ""; int count = 0; int dis = abs(x-r) + abs(y-c); bool flag = false; if (dis % 2 != k % 2 || dis > k) return "impossible"; ...
ALGO
0.99998
4.066978
{ "github_metadata": { "branch": "main", "commit_count": 520, "repo_created_at": "2022-12-14T07:28: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": "5767f28628...
123a6a76-42ff-4630-b56f-ef4d22d2e49b
Mahbub2001/Algorithms
Graph/Bellmenford/minimum_cost.cpp
#include <bits/stdc++.h> using namespace std; #define endl "\n"; const long long int INF = 1e18; class Edge { public: int a, b; long long int w; }; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, e; cin >> n >> e; vector<Edge> v(e); for (int i = 0;...
ALGO
0.999962
4.67245
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2023-09-30T21:01:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "aeeab7d65bf...
5d061dea-a690-40e8-9fbe-8049c3679dab
yubinbai/pcuva-problems
UVa 377 - Cowculations/sol.cpp
/* 377 - Cowculations */ #include <stdio.h> #include <string.h> int str2num(char *s) { int i; int num = 0; for (i = 0; i < strlen(s); i++) { num *= 4; if (s[i] == 'U') { num++; } else if (s[i] == 'C') { num += 2; } e...
ALGO
0.999952
3.390678
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2013-05-08T15:36:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 50, "forks": 40, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "b4844ba...
31f97638-7899-4630-a5e7-1ff72af2fea7
Matteovullo/Prog-II
PROGETTI/Progetto_16_02_2022.cpp
#include <iostream> #include "static_stack.h" #include "static_queue.h" #include "bst.h" using namespace std; class OperazioneAritmetica{ protected: double opSinistro; double opDestro; public: OperazioneAritmetica(double opSistro, double opDestro) : opSinistro(opSinistro), opDestro(opD...
ALGO
0.98776
4.064686
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-09-20T13:33: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": "74a5f0b798cd...
d18f8504-3c7e-443e-aa10-355a9cc55a80
gsk1208/Cpp_codes
DSA/06_Linked List/20_CircularLinkedList.cpp
#include<iostream> using namespace std; class Node { public: int data; Node* nxt; }* Head; void Create(int A[], int n) { int i; Node* t, *Last; Head = new Node; Head->data = A[0]; Head->nxt = Head; Last = Head; for(int i=1; i<n; i++) { t= new Node; t->data...
ALGO
0.999908
5.218054
{ "github_metadata": { "branch": "main", "commit_count": 37, "repo_created_at": "2021-12-30T15:11:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "52b8370d528...
65a9b9e0-7bca-4235-947f-4d5422c92c5b
hongge831/PAT_basic_solutions
pat_basic_1018.cpp
#include <stdio.h> #include<iostream> #include <string> #include <algorithm> using namespace std; int main(){ int N, pjCount = 0; char jia, yi; int jiaR[3] = { 0 }, yiR[3] = { 0 };//数组三个位置上分别代表B/C/J获胜的数量 cin >> N; for (int i = 0; i < N; i++) { cin >> jia >> yi; switch (jia) { case 'C': if (yi == 'B') ...
ALGO
0.999974
3.413535
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2017-07-09T14:49:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c402a025f...
52f0a48b-a15a-493b-a57e-08ac6cfed78d
Neha-Bhagwat/DSA_SDE
LinkedLists/reversal.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) {} * }; */ //logic:in place, change the direction of the lin...
ALGO
0.999932
5.942201
{ "github_metadata": { "branch": "main", "commit_count": 127, "repo_created_at": "2025-06-02T11: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": "f3d0cacfad...
7172a6e3-6682-4907-86e8-23093b1386ea
Tu-hai-long-vuong/D22-NguyenDucCanh
tohopketiep.cpp
#include <bits/stdc++.h> using namespace std; int n, k, ok = 1; int a[1001]; void in() { for (int i = 1; i <= k; i++) { cout << a[i] << ' '; } cout << endl; } void sinh() { int i = k; while (a[i] == n - k + i) { // a[i] == n - k + i là điều kiện dừng i--; // tìm i đầu tiên mà a[i...
ALGO
0.999746
3.301523
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2025-02-22T17:19:35.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d8c910a61a4d...
ce01f201-717e-461c-a5ef-4e0e0e5d1e51
sarwar76200/Code-Templates
Disjoint set union.cc
#include <bits/stdc++.h> using namespace std; class DisjointSet { private: vector<int32_t> parent, comp_size; size_t components, nodes; public: explicit DisjointSet(size_t size) { DisjointSet::nodes = size; DisjointSet::components = 0; parent.resize(nodes, -1); comp_size.re...
ALGO
0.998148
3.080506
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2022-02-07T06:23: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": "b28b84b54...
8ad1cb49-c585-4495-96e2-047c776adc9f
keunoh/c-algorithm
solve_bruteforcing/2589.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <queue> using namespace std; int H, W; const int MAX = 51; char map[MAX][MAX]; bool visited[MAX][MAX]; int path[MAX][MAX]; int dy[] = {0,0,-1,1}; int dx[] = {-1,1,0,0}; queue<pair<int, int>> q; int max_len = 0; int BFS(int y, int x) { path[y][x] = 1; ...
ALGO
0.999789
3.69578
{ "github_metadata": { "branch": "main", "commit_count": 369, "repo_created_at": "2022-10-24T15:08:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "847c3f7b0f...
87c2d8fa-58f0-41e8-ae8d-e0ce02a9df00
habiburrahmantalha/UVA-online-Judge
10452Marcus_help.cpp
#include<stdio.h> #include<queue> #include<string> #include<string.h> #include<map> #include<algorithm> using namespace std; int X[]={0,-1,0}; int Y[]={-1,0,1}; char path[]={'I','E','H','O','V','A','#'}; int move[10]; int n,m; char g[10][10]; bool valid(int x,int y) { if(x>=0 && x<n && y>=0 && y<m) return tru...
ALGO
0.999973
3.364826
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2016-10-08T20:02:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "00b3a8084e...
2f2bc4f6-11bd-41da-ba34-82d8a0d7f68f
Marsilea149/LeetCode-Practice
315_CountofSmallerNumberAfterSelf.cpp
//Code from Huahua: https://zxi.mytechroad.com/blog/algorithms/array/leetcode-315-count-of-smaller-numbers-after-self/ //Difficulty: 9/10 //Key: Binary Indexed Tree or FenwickTree //complexity: nlog(n) class FenwickTree { public: FenwickTree(int n) : sums_(n + 1, 0) { } void update(int i, int ...
ALGO
0.999991
6.575555
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2020-04-22T20:20: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": "3788661dc...
eadbdd96-6553-4748-9f29-b3a879f7b3c9
RosettaCommons/rosetta
source/src/core/pack/guidance_scoreterms/sap/util.hh
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*- // vi: set ts=2 noet: // // (c) Copyright Rosetta Commons Member Institutions. // (c) This file is part of the Rosetta software suite and is made available under license. // (c) The Rosetta software is developed by the co...
CONFIG
0.962701
6.252882
{ "github_metadata": { "branch": "main", "commit_count": 11737, "repo_created_at": "2023-11-17T16:42:18.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 296, "forks": 100, "issues": 27, "pull_requests": 9 }, "file_meta": { "content_id": "689c...
8db91d11-6717-4962-a6e3-9e9e72ff9ac0
softdream/robot_projects
tele_control/include/ekf_fusion.h
#ifndef __EKF_FUSION_H #define __EKF_FUISION_H #include <iostream> #include <Eigen/Dense> #include <cmath> #ifndef M_PI #define M_PI 3.141592653 #endif namespace ekf { template<typename T> class EKF { public: using DataType = T; using Vector2 = typename Eigen::Matrix<T, 2, 1>; using Vector3 = typename Eigen::Ma...
ALGO
0.992179
5.699825
{ "github_metadata": { "branch": "master", "commit_count": 91, "repo_created_at": "2023-04-17T03:42:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 34, "forks": 9, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "edf45476...
4f017b91-2575-4490-9364-22a8262fd7b5
JoysonAJ/Academic
Sem/Cpp/Queue/CirQ.cpp
#include <iostream> using namespace std; class CirQ{ int Qsize, q[20], front = -1, back = -1, ele; public: CirQ(int n){ Qsize = n; } void Insert(){ if ((front == 0 && back == Qsize - 1) || (front == (back + 1) ) ){ cout << "Queue is full"; return; }...
ALGO
0.993866
3.928146
{ "github_metadata": { "branch": "main", "commit_count": 103, "repo_created_at": "2022-02-26T10:35:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7638864bf1...
26d0550e-25e1-4308-a263-0f5219ed3352
debaonline4u/C_Programming
Code_Chef/Chef_Split_Sum.cpp
#include<stdio.h> // Split Sums Problem Code: SPSUM int gcd(long long int s1,long long int s2) { if(s1==0) return s2; else return(gcd(s2%s1,s1)); } int main() { int test_case; long long int n,m,sum,diff,s1,s2; // Taking input for test case and run each test_case. for(scanf("%d",&test_case);test_case>0;te...
ALGO
0.999988
3.844452
{ "github_metadata": { "branch": "master", "commit_count": 94, "repo_created_at": "2018-02-26T10:37:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "87b415e8b...
a60c0f78-9310-4665-b82e-7a7a22c8b095
rikimaru35kg/atcoder-learning
mytool/scc.cpp
#include <bits/stdc++.h> using namespace std; struct SCC { SCC (int n): n(n), from(n), ifrom(n) {} void add_edge (int a, int b) { from[a].push_back(b); ifrom[b].push_back(a); } vector<vector<int>> scc () { vector<vector<int>> groups; postorder = vector<int>(); visited.as...
ALGO
0.99999
4.727243
{ "github_metadata": { "branch": "main", "commit_count": 1982, "repo_created_at": "2023-05-31T00:38: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": "01ee888c7...
270f4129-dc9d-4bbc-95e3-171cee1ef721
dalanlan/algo
mergeKLists.cpp
/* LintCode: merge k sorted lists http://www.lintcode.com/zh-cn/problem/merge-k-sorted-lists/ */ // solution 1: divide and conquer // /** * Definition of ListNode * class ListNode { * public: * int val; * ListNode *next; * ListNode(int val) { * this->val = val; * this->next = NULL;...
ALGO
0.999869
6.01652
{ "github_metadata": { "branch": "master", "commit_count": 149, "repo_created_at": "2015-07-12T23:53:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8a39d55e...
15a60278-086d-4ae1-8e9a-d53be9c4458c
KULeuven-COSIC/SortingHat
src/cpp_pdte_transciphering/test_pdte_transciphering.cpp
/********************************************************************************* * Implementation of PDTE plus transciphering using the FINAL library. * All the trees are stored as JSON files in the directory named data. * * First, we run the homomorphic comparisons (using our recursive grouped comparison * ...
ALGO
0.999436
4.130768
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2022-07-18T13:53:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 19, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0925d41e87d...
f666a4ed-a798-4e75-a72b-ce1133251bc7
Wataru-Oshima-Tokyo/csci551_final_project
src/simple_pthread.cpp
#include <iostream> #include <pthread.h> #define NUM_THREADS 3 using namespace std; #define ROW 9 #define COL 9 #define rep(i,a,b) for(int i=a; i<b;i++) #define MULTI int p[ROW][COL]; struct arg_struct{ int index; }; //Failed!!! void *test2(void *args){ arg_struct _args = *((struct arg_struct*)args); in...
ALGO
0.930681
3.673756
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2022-04-21T20:43: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": "5d6ae941145...
4e606700-83c0-4662-ac58-967a8626dcec
amir5200fx/Tonb0.1
Tonb0.1/AutLib/Base/containers/ADT/Ary1d/Adt_Ary1dI.hxx
#pragma once namespace AutLib { template<class T> Adt_Ary1d<T> operator+(const Adt_Ary1d<T>& V1, const Adt_Ary1d<T>& V2) { if (V1.Size() NOT_EQUAL V2.Size()) { FatalErrorIn("AutLib::ADT_Ary1d<T>& AutLib::ADT_Ary1d<T>::operator/=(const ADT_Ary1d<T>& Other)") << "No match between two array sizes" << ab...
TOOL
0.933521
6.428398
{ "github_metadata": { "branch": "master", "commit_count": 66, "repo_created_at": "2019-02-06T13:38: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": "ef859ad6a...
4148ad97-96bf-4dbd-97f1-bfe298cec5f3
Lightwing-Ng/Online-Codings
HerbMedicine.cpp
#include <iostream> using namespace std; int main() { int T, M; while (cin >> T >> M) { int time[M + 1], value[M + 1], f[M + 1][T + 1]; for (int i = 0; i < M + 1; i++) for (int j = 0; j < T + 1; f[i][j++]) for (int i = 1; i <= M; i++) cin >> time[...
ALGO
0.999944
3.867603
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-03-11T20:02: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": "d580f1cb07...
3b554df4-951a-451a-8ff4-7c29f55dad90
Kan19990810/Cpp
爱刷算法基础课/数据结构/839模拟堆.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; const int N = 100010; int d[N], seq[N], pos[N]; int idx, s; int n, k, x; string str; void heap_swap(int k, int t) { swap(seq[pos[k]], seq[pos[t]]); swap(pos[k], pos[t]); swap(d[k], d[t]); } void down(int k) { int t = k; ...
ALGO
0.999578
4.267247
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2023-07-03T14:53: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": "43de1a409...
946cc799-1699-4da6-9e36-72a4136d180f
jaARke/LeetCode
909.cpp
#include <bits/stdc++.h> using namespace std; class Solution { private: int boardSize; void findRowCol(int next, int& row, int& col) { row = (next / boardSize - (next % boardSize == 0 ? 1 : 0)); if (row % 2 == 0) { col = (next % boardSize) - 1; if (col < 0) { ...
ALGO
0.999919
5.377111
{ "github_metadata": { "branch": "master", "commit_count": 72, "repo_created_at": "2022-06-20T14:34: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": "efbea0b96...
f884960d-011b-4df4-bccb-2241e29f444b
sinaghadermarzi/super_graph_coloring_for_sodoku
Super_Graph_Coloring.cpp
// Super_Graph_Coloring.cpp : Defines the entry point for the console application. // #include <fstream> #include <string> // A C++ program to implement greedy algorithm for graph coloring #include <iostream> #include <list> using namespace std; // A class that represents an undirected graph class Graph { int V; ...
ALGO
0.999524
5.166444
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-07-30T03:10: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": "cede6f22c52f...
b47d516b-7ac2-4883-a085-9b24bbccda17
overflow218/Algorithms
231130.cpp
/* leetcode 1611번 이게 생각해보면 f(n) = x로 고정된 상태임. 글고 숫자가 10억 범위까지 들어올 수 있는데 커지는거 생각하면 20억 까지 될수 있다고 봐야지. 그러면 int 자료형에 다 담기는 정도네 1번, 2번 반복하면서 진행해주면 될 거 같긴한데 그러면 너무 많다. 생각을 좀 해보면 11 이 연속으로만 붙어있어야 왼쪽의 1을 없애고 옆으로 갈 수 있딴 말이지.. 11, 110, 1100, 11000, .... 꼴만 -> 10, 100, 1000, 10000.. 꼴로 바꿀수 있다는 말이지 000 에서 100 만들려면 000 ->...
ALGO
0.999955
5.424294
{ "github_metadata": { "branch": "master", "commit_count": 351, "repo_created_at": "2020-09-08T07:03: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": "ddc04042...
6975a90b-e46d-4c80-8f95-3931b8b2fd14
LSH3333/PS
baekjoon/11724.cpp
#include <iostream> using namespace std; #include <vector> vector<int> edge[1001]; bool mark[1001]; void dfs(int n) { if(mark[n]) return; mark[n] = true; //cout << n << ' '; for(int x : edge[n]) dfs(x); } int main() { int N, M; // 정점, 간선 cin >> N >> M; for(int i = 0; i < M; i++) { ...
ALGO
0.999849
3.884615
{ "github_metadata": { "branch": "master", "commit_count": 1357, "repo_created_at": "2021-07-07T06:42:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dd1984f...
415b747c-f85c-4a3c-a30b-881cf027afb6
T1fon/TAP_rgz
Model/GenerateModel.cpp
#include "GenerateModel.hpp" using namespace model; GenerateModel::GenerateModel() { } QVector<QPair<QString,QVector<QPair<QString,QString>>>> GenerateModel::generateDMA(QString start_change, QString end_change, QString alphabet) { //<правило начальное, <символ, правило конченое>> QVector<QPair<QString,QVec...
ALGO
0.990092
4.453845
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-05-29T08:55: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": "e5dae63a8a45...
3560f4fd-101a-4f4f-bdb9-984ac9ee3fdf
HyunsunHong/Algorithm
BOJ/2630.cpp
/* divide and conquer */ #include <iostream> using namespace std; int N; int map[129][129]; int ans_zero = 0; int ans_one = 0; void solve(int sr, int sc, int n) { int one_cnt = 0; int zero_cnt = 0; for(int r = sr; r < sr + n; r++) { for(int c = sc; c < sc + n; c++) { if(map[r][c...
ALGO
0.999923
4.103533
{ "github_metadata": { "branch": "main", "commit_count": 128, "repo_created_at": "2023-01-01T11:22: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": "80376b5d69...
e3b7802b-3dd6-4f88-8e94-78d21cc0c61a
RosettaCommons/rosetta
source/src/core/energy_methods/FaMPAsymEzCGEnergy.cc
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*- // vi: set ts=2 noet: // // (c) Copyright Rosetta Commons Member Institutions. // (c) This file is part of the Rosetta software suite and is made available under license. // (c) The Rosetta software is developed by the co...
ALGO
0.988652
5.636759
{ "github_metadata": { "branch": "main", "commit_count": 11737, "repo_created_at": "2023-11-17T16:42:18.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 296, "forks": 100, "issues": 27, "pull_requests": 9 }, "file_meta": { "content_id": "031e...
05be66da-7116-48c3-8371-ae01291a0317
EfesX/algos
algotrening/season_7/s7e2_c.cc
#include <iostream> #include <vector> #include <numeric> using namespace std; struct sparse_table_t { // матрица для хранения максимумов на отрезках vector<vector<int>> maxv; // матрица номера максимального из нескольких // подряд идущих элементов массива vector<vector<int>> idxs; // быстрое...
ALGO
0.999976
5.504408
{ "github_metadata": { "branch": "main", "commit_count": 55, "repo_created_at": "2025-05-08T06:07: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": "7070f8829fa...
8cae2c6b-f041-4eba-b07d-306be5439926
shayan-mrafiee/USACO-CP
USACO & CP/USACO & CP/Topics/Greedy Algorithms/USB vs. PS2.cpp
//#include <bits/stdc++.h> // //using namespace std; //using ll = long long; //#define all(x) x.begin(), x.end() // //int main() { // ios::sync_with_stdio(false); // cin.tie(nullptr); cout.tie(nullptr); // // int a, b, c, m; cin >> a >> b >> c >> m; // vector<int> USBs, PS2s; // // for (int i = 0; i <...
ALGO
0.999445
3.974771
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2025-05-22T03:43: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": "90695a424d2...
0dc4c4f9-7349-4560-92be-2f10f6a4126b
ttzztztz/leetcodeAlgorithms
单调栈_单调队列/1793. Maximum Score of a Good Subarray.cpp
class Solution { public: int maximumScore(vector<int>& nums, int k) { const int n = nums.size(); vector<int> f(n), g(n), stk; for (int i = 0; i < n; i++) { while (!stk.empty() && nums[stk.back()] >= nums[i]) { stk.pop_back(); } ...
ALGO
0.999958
5.561428
{ "github_metadata": { "branch": "master", "commit_count": 872, "repo_created_at": "2019-09-03T06:57:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a350ab7...
077665d8-5484-4b5d-b0e0-f7bd5f36a95b
tanyardr/hackerrank
CodeSprint10_Zigzag_Array.cpp
/*Problem: Zigzag Array - World CodeSprint10 Level: Easy Link: https://www.hackerrank.com/contests/world-codesprint-10/challenges/zigzag-array Coder: taniadr // https://github.com/taniadr/hackerrank */ #include <bits/stdc++.h> #include <vector> using namespace std; //void zigZag(int arr[], int n) int minimumDeletion...
ALGO
0.999993
4.129023
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2017-04-09T15:47: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": "4ceae7155...
edca717e-5001-4f08-aead-562428c5ffde
mahantaf/feature-interaction-detector
include/Transpiler/Transpiler.cpp
// // Created by mahan on 3/28/21. // #include "Transpiler.h" set<pair<string, string>> findPairsWithSameFirst(set<pair<string, string>>& vars) { set<pair<string, string>> duplicatePairs; for (set<pair<string, string>>::iterator i = vars.begin(); i != vars.end(); ++i) { pair<string, string> selector =...
TOOL
0.927662
4.552033
{ "github_metadata": { "branch": "main", "commit_count": 53, "repo_created_at": "2020-11-30T13:46:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "863a30a4f87...
92496ba1-d561-474b-ac62-29aa36286150
anuragyes/DSA
Heap_DSA.cpp/replace_acc_rank.cpp
#include <iostream> #include <vector> #include <algorithm> #include <unordered_map> using namespace std; // Function to replace each element of the array with its corresponding rank // void replaceWithRank(vector<int> &arr) // { // // Create a copy of the original array // vector<int> temp = arr; // // So...
ALGO
0.999976
4.939919
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-01-14T09:19:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f92658505396...
67cd1622-5c99-4368-b457-36567591e896
Nusrat008/C-programming
Fudamental C-code/Stackoverflow_1_counter.cpp
#include<iostream> #include <bits/stdc++.h> #include<vector> using namespace std; #include<string> int a, b, c; int voters, counter1 = 0, counter2 = 0, counter3 = 0; vector <char> vote_count; vector<char> take_vote(){ char vote; cout<<"\nCandidates are Adam,Bilal,Catherine.Enter A,B,C according to your choice."<...
ALGO
0.999448
3.5762
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2024-03-18T23:17: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": "46d01d913c5...
b99ce570-5b3f-4956-af48-e4bf6b47d4da
GApo407/CPP.Project
点和圆的关系(多文件编程)/程序.cpp
#include <iostream> #include "点的属性.h" #include "圆的属性.h" #include "圆的实现.cpp" #include "点的实现.cpp" using namespace std; // 点到圆心的距离公式:(圆心1,点2) 根号{ (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2) } // 判断关系: 点到圆心的距离 与 半径对比{ (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2) 与 R * R 对比 } // 判断点与圆的关系 void isInCircle(Circle &a, Point &b) { ...
ALGO
0.991545
4.641644
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2025-05-13T01:55:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7420c97e285...
cee49785-c3fd-4ec0-a649-97879b4d6fe8
mouredev/retos-programacion-2023
Retos/Reto #4 - PRIMO, FIBONACCI Y PAR [Media]/c++/adrigrillo.cpp
#include <cmath> #include <string> #include <iostream> bool isPerfectSquare(int number) { auto result = std::sqrt(number); return (result * result == number); } /** * Check if the number is a fibonacci number. A number belongs to fibonacci numbers if * (5 * number^2 + 4) or (5 * number^2 - 4) is a perfect s...
ALGO
0.99864
5.571199
{ "github_metadata": { "branch": "main", "commit_count": 16771, "repo_created_at": "2022-12-22T06:18:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5464, "forks": 2961, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "05...
18ec6b02-c6e7-4013-83e0-a6e745006984
abhinav8925/Codechef-Solutions
Vaccine Distribution.cpp
/* ***** !!!!! <NAME> !!!!! ***** Date - 30th May 2023 Code by - <NAME> Problem link -> https://www.codechef.com/problems/VACCINE2 */ #include <iostream> #include <algorithm> #include <bits/stdc++.h> #define ll long long int #define endl "\n" using namespace std; int N=1000001; vector<int> arr(N,true); ve...
ALGO
0.999655
3.977419
{ "github_metadata": { "branch": "main", "commit_count": 252, "repo_created_at": "2022-08-08T16:27:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d54900df58...