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
024a5e53-472f-4313-94d3-2f55c7e37752
martiserra46/puzzles
vector_utils.cpp
#include "vector_utils.h" #include <vector> #include "position.h" std::vector<std::vector<char>> create_matrix(int rows, int columns) { return std::vector<std::vector<char>>(rows, std::vector<char>(columns, '\0')); } void fill_matrix(std::vector<std::vector<char>> &matrix, char value) { for (int i = 0; i < m...
TOOL
0.980964
5.714726
{ "github_metadata": { "branch": "main", "commit_count": 228, "repo_created_at": "2021-07-15T16:01: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": "b5b0632b16...
776d6cdb-5694-4020-8a3c-1c53e45805de
hkaur008/competitive-programming-target-questions
codechef/A_Big_Sale.cpp
#include <bits/stdc++.h> using namespace std; #define light \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ll long long int #define test \ ll t; \ cin >> t; \ while (t--) #define forl(n) for (ll i = 0; i < n; i++) #d...
ALGO
0.998556
4.066402
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2021-01-02T06:59:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ec52a0ba1388...
e8a171bf-87fd-4c5c-bda7-09ada162adec
prash628/Other-Competitive-Programming
HackerRank/World Cup SemiFinals/QuantumLand.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <iomanip> using namespace std; int N; int A[100000]; int where[100000]; double res; int visit[100000]; vector<int> startPts; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT *...
ALGO
0.999901
3.297361
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2015-09-23T21:10: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": "b172a550d2...
74493746-f95e-41bf-840c-508866387af8
Aidavdw/komurasaki_air_breathing
public/sim_case.h
#pragma once #include "domain.h" #include <map> #include "beam_section.h" #include "IValve.h" #include "reed_valve_geometry.h" #include "pythoninterface/record.h" // Changes the behaviour of how the solver works. struct SolverSettings { double AUSMSwitchBias = 10.0; // Bias parameter for AUSM switching functio...
ALGO
0.990927
3.982504
{ "github_metadata": { "branch": "main", "commit_count": 347, "repo_created_at": "2023-03-07T03:29: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": "d45d93d02c...
6d3f66b8-ae4e-4f01-a9df-721df0a043b4
mfranzil-unitn/unitn-prog1
exams/2015.1/3.cc
#include "3.h" #include <iostream> using namespace std; static int succ(int value, const queue &q) { return ((value+1)%(q.dim)); } static int fullp(const queue &q) { return (succ(q.tail, q) == q.head); } static int emptyp(const queue &q) { return (q.tail == q.head); } void init(queue &q, int maxdim) { q.head =...
TOOL
0.991467
3.399384
{ "github_metadata": { "branch": "master", "commit_count": 64, "repo_created_at": "2018-09-04T16:51:02.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "98fff5c0a0...
f6866a55-fc3c-4bac-882d-9f5604f8cac8
o7Techno/CSA-HW
АВС ИДЗ#4/CSA_1.cpp
#include <iostream> #include <fstream> #include <pthread.h> #include <vector> #include <cstdlib> #include <ctime> #include <unistd.h> // для функции sleep #include <cstring> struct Phone { pthread_mutex_t lock; // Мьютекс для телефона bool is_busy; // Состояние телефона }; std::vector<Phone> phones; ...
ALGO
0.988354
5.504618
{ "github_metadata": { "branch": "main", "commit_count": 37, "repo_created_at": "2024-09-28T09:37: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": "c09487fbc74...
f1bbf3c4-04cb-48ca-ad30-89417ee5329a
trilinos/Trilinos
packages/rol/src/zoo/testproblems/ROL_FreudensteinRoth.hpp
// @HEADER // ***************************************************************************** // Rapid Optimization Library (ROL) Package // // Copyright 2014 NTESS and the ROL contributors. // SPDX-License-Identifier: BSD-3-Clause // *************************************************************************...
ALGO
0.999662
5.632138
{ "github_metadata": { "branch": "master", "commit_count": 104031, "repo_created_at": "2015-11-16T19:39:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1299, "forks": 593, "issues": 263, "pull_requests": 61 }, "file_meta": { "content_id":...
77dce9fd-2f36-40fd-8d0f-afa9e6376b6e
HMS97/Course_Project
parallel_computing_homework/cpp_mpi.cpp
#include<stdio.h> #include <vector> #include <iostream> #include <algorithm> #include <iterator> // ostream_iterator #include "/usr/include/mpi/mpi.h" const int MAX_NUMBERS = 100; using namespace std; int prime_number(int n) { int i; if(n < 2 ) return 0; for(i = 2; i < n; i++) { if(...
ALGO
0.999929
4.108888
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-12-01T22:59: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": "93670e3e04...
812751d1-e904-425f-8579-9fa5b16e7f5e
LAPKT-dev/LAPKT-public
src/engine/bfws_2h_consistency.hxx
/* Lightweight Automated Planning Toolkit Copyright 2022 <NAME> <<EMAIL>><NAME> <<EMAIL>> 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 rig...
ALGO
0.997868
6.813497
{ "github_metadata": { "branch": "Devel2.0", "commit_count": 988, "repo_created_at": "2014-09-25T05:10:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 40, "forks": 24, "issues": 17, "pull_requests": 4 }, "file_meta": { "content_id": "168e...
4c400585-c350-4bf3-ab3a-e83c953e227e
seguone/Programacion-1-UTN
TP_4/Ej_23.cpp
#include <iostream> using namespace std; int main() { int num; int ultimoImpar = 0; // inicializo en 0 por si no se ingresan impares int anteultimoImpar = 0; bool hayImpar = false; // bandera para verificar si hubo al menos un impar do { cout << "Ingrese un numero: "; cin >> nu...
ALGO
0.996921
3.566659
{ "github_metadata": { "branch": "main", "commit_count": 130, "repo_created_at": "2025-04-20T11:02: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": "8d5c7457ec...
801f208c-667d-44d7-bfc8-bc088359a601
18padx08/neural-network-rg-flow
RBMCPU/ModCD.cpp
#include "ModCD.h" namespace ct { namespace optimizers { ct::optimizers::ModCD::ModCD(shared_ptr<Graph> graph, double learningRate, double momentum) : learningRate(learningRate), momentum(momentum) { this->theGraph = graph; } ct::optimizers::ModCD::~ModCD() { } shared_ptr<Tensor> ct::optimizers::...
ALGO
0.921115
4.510822
{ "github_metadata": { "branch": "master", "commit_count": 60, "repo_created_at": "2018-07-30T14:22: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": "c8490cf9f...
673764df-bb33-4fcf-8745-6aa3dd35e4c8
lukealpha/Trainer
提高组/模拟赛3/number.cpp
#include <cstdio> #include <iostream> #include <algorithm> #include <cstring> using namespace std; const int maxn = 100010; int n,k; int prem[maxn]; int num[maxn]; int vis[maxn]; struct segment{ int l,r; }sg[maxn]; bool cmp(segment a, segment b){ return a.r < b.r; } int main(){ //freopen("number.in","r",stdin); //...
ALGO
0.999981
3.680032
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2021-12-18T11:36:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "03197a771...
b2e513f0-bd58-48f9-9454-a02be6c5506d
Jamiroquai88/X-Vector-forward-pass-OpenCL
layers/stacking.cpp
// // stacking.cpp // GMU-XVEC // // Created by <NAME> on 08/12/2018. // Copyright © 2018 <NAME>. All rights reserved. // #include <stdio.h> #include "stacking.hpp" #include "../utils.hpp" #include "../opencl_utils.hpp" cl_mem StackingLayer::forward(cl_mem input, unsigned long &rows, unsigned long &cols, cl_dev...
ALGO
0.910566
4.467398
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2018-12-01T15:05:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "427bf9676...
33bf507b-e295-4f04-8bd6-5b4e89708095
dvtdat/cp
dp training/gridsum.cpp
// sadge catto noice #include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") using namespace std; typedef pair<int, int> ii; typedef pair<int, ii> iii; typedef long long ll; typedef long double ld; const l...
ALGO
0.999988
5.236901
{ "github_metadata": { "branch": "main", "commit_count": 125, "repo_created_at": "2021-08-19T09:07: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": "8ee92ecfa8...
4b648da5-085c-4b9b-b6d7-cd023001a939
DengZhengyuan/AM3611
Assignment/Assignment 3/problem5_4.cpp
/* NAME: <NAME> STU #: 251006745 DATA: Oct. 10, 2019 PROB #: problem 5.4 DESCRIPTION: calculate the standard deviation CMD: g++ problem5_4.cpp -o problem5_4.out && ./problem5_4.out */ #include <iostream> #include <cmath> #include <cassert> #include <fstream> double get_me...
ALGO
0.975739
4.572115
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2019-09-07T01:17: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": "4981504f6...
eff24b6d-ff5d-452e-8a55-b7f3423f9570
TimothyHorscroft/competitive-programming
codeforces/1909/a.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #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 vi vector<int> #define vvi vector<vi> #define pii pair<int,int> signed main() { ios::sync_with_stdio(0), cin.tie(0); auto solve = [&]()...
ALGO
0.999832
4.367511
{ "github_metadata": { "branch": "master", "commit_count": 92, "repo_created_at": "2020-07-03T11:07: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": "7f622be8c...
1f5114b6-d1d6-4df5-b005-c137177add32
kamyu104/LintCode
C++/letter-combinations-of-a-phone-number.cpp
// Time: O(n * 4^n) // Space: O(n) // Iterative solution. class Solution { public: /** * @param digits A digital string * @return all posible letter combinations */ vector<string> letterCombinations(string& digits) { if (digits.empty()) { return {}; } vector...
ALGO
0.999883
6.775356
{ "github_metadata": { "branch": "master", "commit_count": 1293, "repo_created_at": "2015-02-16T16:25:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 631, "forks": 261, "issues": 1, "pull_requests": 3 }, "file_meta": { "content_id": "a39...
7d0f1484-9e98-4207-adbc-3eb1765f143b
yousuf-cse-bd/RandomCodes
RecursiveSumNaturalNumber.cpp
/** * @file RecursiveSumNaturalNumber.cpp * @author <NAME> (<EMAIL>) * @brief Program to find sum of natural numbers using recursion * @version 0.1 * @date 2023-01-18 * @since WednesDay; 12:53 AM * @copyright Copyright (c) 2023 * @institute: Dept. of CSE, Varendra University, Rajshahi, Bangladesh */ #include ...
ALGO
0.999884
5.326934
{ "github_metadata": { "branch": "master", "commit_count": 356, "repo_created_at": "2022-06-19T05:11: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": "59ecc4dc...
26745806-3508-435c-8307-54c6f80f5720
krishnakumardangi/cpp_code
data_structure/linked_list.cpp
#include<iostream> #include<stdlib.h> // provide a declaration of 'malloc' using namespace std; struct node { int val; struct node* next; }; struct node* insert(int x, struct node* position_head, struct node* current_position) { struct node* new_node = (struct node*)malloc(sizeof(struct node)); new_node->val = x;...
ALGO
0.999739
3.891656
{ "github_metadata": { "branch": "main", "commit_count": 55, "repo_created_at": "2023-11-30T10:23: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": "a3c2927023c...
fbe87996-1e88-49ab-a77c-e8a7c68cf99d
floft/freetron
boxes.cpp
#include <cmath> #include <algorithm> #include "box.h" #include "math.h" #include "boxes.h" #include "options.h" // Find all the boxes in the image std::vector<Coord> findBoxes(Pixels& img, const Blobs& blobs, Data& data) { typedef std::vector<Coord>::size_type size_type; std::vector<Box> boxes; std::vec...
ALGO
0.999597
5.543967
{ "github_metadata": { "branch": "master", "commit_count": 192, "repo_created_at": "2012-11-05T06:57:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 21, "forks": 6, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "aadbd07...
ad8b2226-3c17-4a20-a9eb-0733424046a3
ishandutta2007/codeforces-c
chen_zexing/normal/1156/E.cpp
#include <stdio.h> #include<iostream> #include <string> #include <string.h> #include <vector> #include <cmath> #include <algorithm> #include <queue> #include <climits> #include <set> #include <unordered_map> #include <time.h> #include <map> #include <stack> #include <unordered_set> #define hash hassh using namespace st...
ALGO
0.999871
4.007042
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:17: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": "b60875433dcb...
b3e95d89-9998-4713-8633-99e44108a419
Schala/GLoarbLine
AppWarrior/Source/Crypt/HLBlowfish.cpp
#include "HLBlowfish.h" #include "HLBlowfishData.h" void HLBlowfish::Init() { UInt32 i; for (i=0;i<8;i++) { mEncodeIvec[i]=0; mDecodeIvec[i]=0; } mEncodeIvecOffset=0; mDecodeIvecOffset=0; } inline UInt32 HLBlowfish::F(UInt32 in, bf_key *key) { UInt16 a; UInt16 b; UInt16 c; UInt16 d; UInt32 y; //split input i...
ALGO
0.995135
5.644907
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2016-04-09T01:16:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6c7cb9596b...
00f6da0d-8e3f-4b8c-8bb3-72da32815d3b
LucasKogachi/beecrowd
1 Beginner/1118 - Several Scores with Validation/answer.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); double A, B; int X; double err = 0.0001; cout << fixed << setprecision(2); do { cin >> A; while (A < 0 - err || A > 10 + err) { cout << "nota invalid...
TOOL
0.98299
4.242205
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2025-03-31T19: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": "7a8b8410b0cc...
6d368653-7a0c-4960-b4c2-43a5e05df06f
techyvish/Algorithms
AlgorithmTutorials/Backtracking-Extra/Queens.cpp
// // Subsets.cpp // AlgorithmTutorials // // Created by <NAME> on 7/10/14. // Copyright (c) 2014 Vishal. All rights reserved. // #include <cstdio> #include <cmath> #include <cstring> #include <ctime> #include <iostream> #include <algorithm> #include <set> #include <vector> #include <sstream> #include <typeinfo> ...
ALGO
0.997291
4.315457
{ "github_metadata": { "branch": "master", "commit_count": 218, "repo_created_at": "2013-09-06T19:25: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": "6b16f18a...
381cea30-abaf-4566-b1f9-1ca2ae539e6a
shivamEr/DSA-In-CPP
BinarySearch/875_koko_eating_banana.cpp
class Solution { public: long long findHour(int k, const vector<int>& piles) { long long hour = 0; for (int num : piles) { hour += (num + (long long)k - 1) / k; // ceil(num / k) } return hour; } int minEatingSpeed(vector<int>& piles, int h) { int low = ...
ALGO
0.99992
5.660523
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2024-06-29T04:25: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": "da8291b85...
95d04ace-2203-41bc-8691-ec43f25be763
Golangltd/codeclass
interface{}/src/opencv-master/opencv110/cvaux/src/cvcorrespond.cpp
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, instal...
ALGO
0.991393
4.304268
{ "github_metadata": { "branch": "master", "commit_count": 206, "repo_created_at": "2018-08-14T03:58:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 615, "forks": 195, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "16de1...
4b40abf1-a195-4c6e-9671-212efcefb814
sxs-collaboration/spectre
src/Time/TimeSteppers/DormandPrince5.hpp
// Distributed under the MIT License. // See LICENSE.txt for details. /// \file /// Defines class DormandPrince5. #pragma once #include <cstddef> #include "DataStructures/TaggedVariant.hpp" #include "Options/String.hpp" #include "Time/TimeSteppers/RungeKutta.hpp" #include "Utilities/Serialization/CharmPupable.hpp" ...
ALGO
0.999791
7.285846
{ "github_metadata": { "branch": "develop", "commit_count": 17103, "repo_created_at": "2017-04-07T17:28:20.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 168, "forks": 202, "issues": 530, "pull_requests": 57 }, "file_meta": { "content_id": ...
81994043-3089-45ee-b647-214404827e2c
ricardo0129/KattisSolutions
graph/sssp/xentopia.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; #define ll long long #define vi vector<int> #define pii pair<int,int> #define pll pair<ll,ll> #define vll vector<ll> #define FOR(i,n) for(int i=0;i<n;i++) #define rep(i, a, b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #defi...
ALGO
0.999887
3.627372
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2022-04-05T17:33:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "28bc18a242c...
bbb02e9f-5746-4294-8166-90b96bca97b2
cho-hm02123/Algorithm_Study
Beakjoon/A/30892.cpp
/* https://www.acmicpc.net/problem/30892 상어 키우기 * * 문제: N마리의 상어, 상어는 서로 같거나 다른 크기의 몸집 A_i * 자기보다 작은 상어는 전부 먹을 수 있음, 이때 상어의 크기는 잡어먹힌 상어의 크기만큼 커짐 * 크기가 T인 아기 상어가 N마리의 상어 크기 정보를 알고있음 * 최대 K 마리까지 적절한 순서로 잡아먹고 몸집을 최대로 키울 예정 * 최대 K 마리를 적절한 순서로 잡아먹을 때 몸이 최대 얼마나 커질 수 있는지 * * 입력: 상어의 마리 수 N, 먹을 수 있는 상어의 최대 마리 수 K, 최초 크기 T * N...
ALGO
0.999977
4.751996
{ "github_metadata": { "branch": "main", "commit_count": 537, "repo_created_at": "2024-01-10T04:53: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": "5826420e3c...
5ea83d6f-5abc-44cf-bd88-f9a32125e7d8
delphox60/BOJ-solutions
1966.cpp
#include <iostream> #include <queue> #include <vector> #include <utility> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); queue<pair<int, int>> q; priority_queue<int, vector<int>, less<int>> pq; int N; cin >> N; for (int i = 0; i < N; i++) { int...
ALGO
0.999853
3.665861
{ "github_metadata": { "branch": "main", "commit_count": 101, "repo_created_at": "2021-10-04T00:40:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "edd3c40669...
9fba2a31-5187-4e03-8998-20cc1fa01aac
I221165/PDC-Project
src/Partitioner.cpp
// ────────────────────────────────────────────────────────────────────────────── // File: src/Partitioner.cpp // ────────────────────────────────────────────────────────────────────────────── #include "Partitioner.h" // for computePartition signature :contentReference[oaicite:0]{index=0}:contentReference[oaicite:1]...
ALGO
0.999261
6.681002
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2025-05-02T18:52: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": "65172eb33ec...
e5dc7f8d-c064-4c31-b664-1a852164e674
efeslab/thermometer-artifact
prefetcher/fdip_shotgun_l1i/fdip_shotgun_l1i.cc
#include "ooo_cpu.h" #include <deque> #include <unordered_map> #include <utility> using std::cout; using std::endl; using std::deque; using std::unordered_map; using std::pair; extern uint8_t predecode_latency; extern uint8_t pt; struct predecode_entry { uint64_t ip; uint64_t target; uint8_t branch_type...
ALGO
0.939046
6.277031
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2022-06-28T22:42:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 2, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "59cc2fe1aa5...
fe8309f2-6a31-4311-9de8-1b74b406e273
jansendavid/Parallel-TDVP
src/prepare_state.cpp
#include "itensor/all.h" #include "itensor/util/print_macro.h" using namespace itensor; using std::vector; int main() { int N = 800; //number of sites auto sites = SpinHalf(N); //Make initial MPS psi to be in the Neel state auto state = InitState(sites); auto sweeps_gs = Sweeps(5); //number of sweeps i...
ALGO
0.998153
3.988321
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2022-12-19T21:17: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": "45aa3cb5824...
537aa9b1-b74b-43a3-81d3-9daa529eeab4
valadezed/Robo-Vacuum
YOUSPINMERIGHTROUND.ino
#include "SR04.h" #include <Servo.h> Servo servo1; // BLUE Servo servo2; // GREEN Servo servo3; // ORANG Servo scanServo; // twelve servo objects can be created on most boards int globalPos = 0; int driveTime = 0; int startpos1 = 80; int startpos2 = 100; int startpos3 = 20; int pos1 = 0; int pos2 = 0; in...
TOOL
0.980637
4.150201
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2024-04-16T00:15: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": "40883188b3a...
1891c798-0dc9-4a9c-9c98-a287b8183e5d
Panguins/OneTap
target_selection.h
#pragma once #include "playerlist.h" struct possible_point_t { int m_target_hitbox; float m_damage; bool m_checked_damage, m_checked_hitchance; vec3 m_aimpoint; possible_point_t( const vec3& aimpoint, int target_hitbox, float damage = 0.f ) : m_target_hitbox( target_hitbox ), m_damage( damage ), m_checked_dama...
ALGO
0.934089
4.681165
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-12-24T09:07:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 79, "forks": 43, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "168b27c0ab...
937fb2dc-7184-43b3-92f9-ea2905ac0d51
manishatak37/PRODIGY_SD_03
Contact Management System.cpp
#include <iostream> #include <vector> #include <string> #include <fstream> using namespace std; // Define the Contact structure struct Contact { string name; string phoneNumber; string email; }; // Function to load contacts from a file void loadContacts(vector<Contact>& contacts, const string& filename) ...
TOOL
0.990241
5.537418
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-08-03T10:57: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": "3bc2a3efe86f...
f654ce82-81d2-471e-adf8-197f7cc054c0
CodePuppet32/CP
Binary Tree/maxPathSum.cpp
#include <bits/stdc++.h> using namespace std; struct Node { int data; Node* left, *right; Node(int data) : data(data), left(NULL), right(NULL){} }; int helperFunc(Node* node, int& res) { if (!node) return 0; int ls = helperFunc(node->left, res); int rs = helperFunc(node->right, res); ...
ALGO
0.999993
5.571712
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2022-01-25T03:46: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": "fa6b9204db6...
b6b877b8-ec83-41a5-9925-d817af36e276
NassimaMO/42_core_curriculum
cpp00-04/cpp_module_02/ex03/bsp.cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* bsp.cpp :+: :+: :+: ...
ALGO
0.998957
5.885412
{ "github_metadata": { "branch": "master", "commit_count": 329, "repo_created_at": "2022-05-24T16:30: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": "0a7048b9...
6a39ee0d-acb5-4ebc-8162-38686bc798c8
eligao/6.837-Assignments
zero/main.cpp
#include "GL/freeglut.h" #include <cmath> #include <iostream> #include <sstream> #include <vector> #include "vecmath.h" #include "util.h" using namespace std; // Macros #define MAX_BUFFER_SIZE 256 #define PI 3.141592653 // Globals // This is the list of points (3D vectors) vector<Vector3f> vecv; // This is the list ...
TOOL
0.934418
3.750224
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2015-04-07T17:06:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4544a698c6...
66395196-4e61-4365-ba7e-72658ca422bb
ttaramandi/aztec-kiw
barretenberg/cpp/src/barretenberg/dsl/acir_format/poseidon2_constraint.cpp
#include "poseidon2_constraint.hpp" #include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp" namespace acir_format { template <typename Builder> void create_poseidon2_permutations(Builder& builder, const Poseidon2Constraint& constraint) { using field_ct = bb::stdlib::field_t<Builder>; ...
ALGO
0.989584
7.095175
{ "github_metadata": { "branch": "master", "commit_count": 4714, "repo_created_at": "2024-02-24T20:03:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b90eb8a...
3ca53d4a-d614-47c0-a453-9d23b6bae4f6
Pankaj-krCP/DSA-And-CP
Coding Ninja - CP/18. Greedy Problem/Save_Energy.cpp
#include <iostream> using namespace std; int main() { long n; cin >> n; long arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } long ans = 0; long cur = 0; while (cur < (n - 1)) { long next = cur + 1; while (next < (n - 1)) { if (...
ALGO
0.999959
4.004064
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2024-01-13T18:04: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": "abe424b845b...
d67e271d-7f2e-4c0f-86cb-a98759a89c6c
GoblinDynamiteer/cpp-direkt-book
ch02/exercise02_11/e02_11.cpp
/* * Exercise from book * C++ Direkt by <NAME> * http://skansholm.com * * Sida 64 * * Kommun befolkningsutveckling * In: År * Ut: Invånarantal vid inmatat år * * Data: * Invånare: 26000 st * Födda/år: 0.7% * Döda/år: 0.6% * Inflytt/år: 300 st * Utflytt/år 325 st * */ #include ...
ALGO
0.998384
3.841646
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2017-01-17T16:24:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "952fab675...
e15adf77-c31e-4836-86fd-8b868a113a5c
SorahISA/competitive_programming
TIOJ/1926.cpp
#include "lib1926.h" #pragma GCC optimize("Ofast", "unroll-loops") #include <bits/stdc++.h> using namespace std; #define int long long #define double long double using pii = pair<int, int>; template<typename T> using Prior = std::priority_queue<T>; template<typename T> using prior = std::priority_queue<T, vector<T>, g...
ALGO
0.999948
3.486481
{ "github_metadata": { "branch": "master", "commit_count": 677, "repo_created_at": "2020-05-23T13:25:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dd4249aa...
6f8b8ec7-d987-4ae2-a61e-8cd822f79988
aditya94127/dsa-questions
HashMap/LC-3265.cpp
// 3265. Count Almost Equal Pairs I // You are given an array nums consisting of positive integers. // We call two integers x and y in this problem almost equal if both integers can become equal after performing the following operation at most once: // Choose either x or y and swap any two digits within the chosen n...
ALGO
0.999924
6.15371
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2025-06-08T04:46: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": "3101283eb4a...
27b384d3-fc21-4155-b840-d8365200340c
kriti-raj/CodeChef-Contests-CPP
START77C/Concat_Palindrome.cpp
// Code by <NAME> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define PI 3.14159265358979323846; /*================================================*/ /*================================================*/ int main() { ll t(1); // ll case_no = 1; cin >...
ALGO
0.999988
4.073057
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2023-01-04T21:23:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b62660dbaa2...
38b4e247-5921-418e-89da-98abad61a87b
ngochien18/BlasterMasterNES
Mygame/Quadtree.h
#pragma once #include "queue" #include "Quadtreenode.h" #include "Camera.h" #include"Game.h" class Quadtree { Quadtreenode* root; public: Quadtree() { root = NULL; } Quadtree(Quadtreenode* root) { this->root=root; if (root == NULL) { DebugOut(L"something go wrong\n"); } split(root); } /*void Crea...
ALGO
0.988529
3.450956
{ "github_metadata": { "branch": "master", "commit_count": 162, "repo_created_at": "2024-10-19T04:36:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2cd6c6b9...
b87fe641-61f3-4b86-a1e5-6767762ef3cb
anstjaos/Algorithm
BOJ/1890.cpp
<<<<<<< HEAD #include <stdio.h> int N, arr[130][130]; long long dp[130][130]; int main() { scanf("%d", &N); for (register int i = 0; i < N; i++) { for (register int j = 0; j < N; j++) scanf("%d", &arr[i][j]); } if (arr[0][0] == 0) { printf("0\n"); return 0; } dp[0][0] = 1; for (register int i = 0; i < N...
ALGO
0.99996
3.9646
{ "github_metadata": { "branch": "master", "commit_count": 1275, "repo_created_at": "2019-03-31T08:27: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": "a4e7af0...
5cfb4146-7551-46cd-ac4d-0f0d8c803875
Johniel/contests
codeforces/620div2/B/main.cpp
// codeforces/620div2/B/main.cpp // author: @___Johniel // github: https://github.com/johniel/ #include <bits/stdc++.h> #define each(i, c) for (auto& i : c) #define unless(cond) if (!(cond)) using namespace std; template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first...
ALGO
0.999994
3.830103
{ "github_metadata": { "branch": "master", "commit_count": 2608, "repo_created_at": "2015-12-28T16:38:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dabe58d...
ca372fff-9f89-484d-8923-c817b33aaa45
JaimeNevado/CPP_SOFTWARE
Practica4/ej2.cpp
#include <iostream> #include <array> using namespace std; const int N = 4; typedef array<int, N>TVector; typedef array<TVector, N>TMat; void escribirMat(TMat m){ for (int i = 0; i < N; i++){ for (int j = 0; j < N; j++){ cout << m[i][j] << " "; } cout << endl; } } void gen...
ALGO
0.999318
4.734009
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2023-10-06T14: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": "dfacd54eb2...
ac4f7c74-857e-4906-a281-0d110aac28e3
CHART-Team/xitao
benchmarks/randomDAGs/sortlib.cxx
// tao_objs.cxx // // #include "taosort.h" // Use LOI instrumentation: #ifdef DO_LOI /* this structure describes the relationship between phases and kernels in the application */ struct loi_kernel_info sort_kernels = { 2, // 2 kernels in total 1, // 1 phase {"Merge_...
ALGO
0.998968
5.259912
{ "github_metadata": { "branch": "master", "commit_count": 373, "repo_created_at": "2021-03-09T16:05:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "12502f01...
844f5c8f-2ccb-495d-9fe3-af0f15ab33ac
MajharolTanvir/Data_structure
Module_3_practice/deticat_duplicate.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } int x; cin >> x; int l = 0, r = n - 1; for (int i = 0; i < n; i++) { int mid = (l + r) / 2; if (arr[mid] == x) ...
ALGO
0.999981
4.322294
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2024-06-24T12:35: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": "5d923bf8a61...
c8061aa5-3b38-450f-b8ba-9a60112ba431
fahimratul/Compiler_sessional
Compiler sessional/AssignmentB/symboltable.cpp
#include<bits/stdc++.h> using namespace std; #define size 10 #define id "202314105" //your student id #define lastdigit 5 // last digit of your student id class SymbolInfo{ public: string SymbolName; string symbolType; }; int numberofchar(){ string str=id; int sum=0; for(int i=0;i<str.length(...
ALGO
0.996009
4.927799
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2025-06-24T03:07: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": "425b9e48ba3...
ff0682ee-36ea-400e-8b16-66b64c1bdfc5
swapnilghosh04/Operating-System
operatingsystem/fcfs.cpp
#include <iostream> using namespace std; void findWaitingTime(int processes[], int n, int bt[], int wt[]) { wt[0] = 0; for (int i = 1; i < n; i++) wt[i] = bt[i - 1] + wt[i - 1]; } void findTurnAroundTime(int processes[], int n, int bt[], int wt[], int tat[]) { for (int i = 0; i < n; i++) t...
ALGO
0.999877
5.026031
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-02-23T18:03: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": "3aa68d54e7b2...
2f820eaf-8f90-42b8-b658-70bf7fba71e6
cho-hm02123/Algorithm_Study
Beakjoon/BFS/2146.cpp
/* 1. 섬의 외곽 좌표 구하기 2. 섬들 외곽좌표 차 가장 작은거 구하기 */ #include <iostream> #include <cmath> #include <algorithm> #include <queue> #include <vector> using namespace std; #define X first #define Y second int n; int arr[101][101]; bool flag[101][101]; int dx[4] = { 0, 1, 0, -1 }; int dy[4] = { 1, 0, -1, 0 }; vector <pair <int, ...
ALGO
0.999878
4.033655
{ "github_metadata": { "branch": "main", "commit_count": 537, "repo_created_at": "2024-01-10T04:53: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": "0c379c0fc8...
6b5d1d78-a335-4fd0-aefa-3755944d24de
DanielChappuis/reactphysics3d
src/collision/shapes/TriangleShape.cpp
/******************************************************************************** * ReactPhysics3D physics library, http://www.reactphysics3d.com * * Copyright (c) 2010-2024 <NAME> * ********************************************************************************* *...
ALGO
0.9553
7.758953
{ "github_metadata": { "branch": "master", "commit_count": 1990, "repo_created_at": "2013-05-24T18:06:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1637, "forks": 239, "issues": 70, "pull_requests": 4 }, "file_meta": { "content_id": "a...
00e24c46-88af-443e-9ae0-be44de981ba6
Migueldoniz/progs-c-c-
Geraldo/4.cpp
#include <bits/stdc++.h> using namespace std; void defmes(int mes){ switch (mes){ case 1: cout<<"Janeiro: "; break; case 2: cout<<"Fevereiro: "; break; case 3: cout<<"Março: "; break; case 4: cout<<"Abril: "; break; ...
TOOL
0.97316
3.321228
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-07-21T12:57: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": "0d038acb458c...
31b69fd0-eae0-491f-ad69-034c2423784b
CERN-PH-CMG/cmg-cmssw
RecoParticleFlow/PFProducer/interface/KDTreeLinkerAlgo.h
#ifndef KDTreeLinkerAlgo_h #define KDTreeLinkerAlgo_h #include "RecoParticleFlow/PFProducer/interface/KDTreeLinkerTools.h" #include <vector> // Class that implements the KDTree partition of 2D space and // a closest point search algorithme. class KDTreeLinkerAlgo { public: KDTreeLinkerAlgo(); // Dtor calls ...
ALGO
0.998264
4.790618
{ "github_metadata": { "branch": "heppy_94X_dev", "commit_count": 185721, "repo_created_at": "2013-09-25T08:23:20.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 19, "forks": 242, "issues": 16, "pull_requests": 1 }, "file_meta": { "content_i...
560477d8-049b-43ec-bb3c-6a01e1878ca7
flomar/CrypTool-VS2015
trunk/CrypTool/BitParity.cpp
/************************************************************************** Copyright [2009] [CrypTool Team] This file is part of CrypTool. 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 a...
ALGO
0.999739
5.478987
{ "github_metadata": { "branch": "master", "commit_count": 227, "repo_created_at": "2016-05-03T13:48:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8be9017f...
e3873405-75cc-4cb4-9e04-7e7c9bffa822
deepam20050/competitive-programming
solutions/CF1535D.cpp
// AC #include "bits/stdc++.h" using namespace std; #define sz(x) int((x).size()) #define all(x) begin(x), end(x) #define pb push_back #define eb emplace_back #define mp make_pair #define F first #define S second #define FOR(i, a, b) for (int i = (a); i < (b); ++i) using lli = long long; using pii = pair < int, int >...
ALGO
0.999981
4.105754
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2022-01-05T12:59: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": "ba8a74a665f...
5abad03d-b40b-4ab3-b4c7-9c6c8534ba74
99hgz/Algorithms
Problems/bzoj/3504.cpp
#include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std; typedef long long ll; int Q[11000], dep[11000]; int tot, Head[11000], cur[11000], Next[500010]; ll Val[500010], To[500010]; int n, m, S, T, u, v; bool bfs() { memset(dep, -1, sizeof dep); int t = 0, w = 1; ...
ALGO
0.999717
3.901501
{ "github_metadata": { "branch": "master", "commit_count": 190, "repo_created_at": "2017-04-21T11:47:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "838a8fcd...
2c50366f-21eb-42f7-9522-ce119984c637
Rayeesgithub/DSA_365_Challenges
Array/largest_sum_with_0.cpp
//https://www.geeksforgeeks.org/problems/largest-subarray-with-0-sum //striver sheet // Broute force #include <bits/stdc++.h> using namespace std; int solve(vector<int>&arr,int n){ int maxi_sum=INT_MIN; int maxi_len=INT_MIN; for(int i=0; i<n; i++){ int sum=0; int len=0; for(int j=i;j<n; ...
ALGO
0.999887
5.257967
{ "github_metadata": { "branch": "main", "commit_count": 446, "repo_created_at": "2024-05-21T07:46: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": "5c092dc6dc...
cbbdf8a6-9c16-4d48-bbfe-3da7243f076e
Freedom911/Practice
datastructures/tree/SingleValued.cpp
//Find count of single vlaued subtrees //eg 5 // 1 5 // 5 5 5 //4 output //three 5 leave nodes and one 5-5 node //we simply will do a post order traversal //Match left and right and increment count #include <iostream> struct Tree { int data; Tree*left; Tree*right; Tree(int val):data(...
ALGO
0.999874
4.978917
{ "github_metadata": { "branch": "master", "commit_count": 202, "repo_created_at": "2021-03-10T12:14: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": "01833c59...
db093e8a-3672-426f-a00c-fb5fa0cdf407
theomkumar/learning-cpp
Linked List/26.hashSet.cpp
/* Approach 1: class MyHashSet { public: vector<bool> m; MyHashSet() { m.resize(1e6+1); } void add(int key) { m[key] = 1; } void remove(int key) { m[key] = 0; } bool contains(int key) { return m[key]; } }; Approach 2: class MyHa...
ALGO
0.99853
5.036585
{ "github_metadata": { "branch": "master", "commit_count": 81, "repo_created_at": "2022-09-17T09:42:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "e96d06d29...
22e675cf-76d5-4a76-8917-214bb1171bb2
pandanon50/algorithm
c++/study/solve/3_16/20168.cpp
// BOJ 20168 골목 대장 호석 - 기능성 // https://www.acmicpc.net/problem/20168 #include <bits/stdc++.h> using namespace std; const int MAX_N = 12; int N, M, C, A, B, ret = 1e9; int visited[MAX_N]; vector<pair<int, int>> adj[MAX_N]; int dfs(int s, int e, int maxCost, int sumCost) { if (s == e) return maxCost; for (pair<i...
ALGO
0.999982
4.13861
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2024-03-10T07:01: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": "3a63df5be...
3b88376d-aa25-4cce-a9d0-331eedca0d43
GGoMak/Algorithm
goorm/4.3.2.cpp
#include <iostream> #include <string> #include <vector> /* * 비타알고 2020년 4월 3주차 2번 : Ctrl+F(난이도 3) * KMP 알고리즘 */ using namespace std; string str1, str2; vector<int> f; void getFail(){ f.resize(str2.length()); f[0] = 0; int j = 0, n = str2.size(); for(int i = 1; i < n; i++){ while(j > 0 &&...
ALGO
0.999715
4.754713
{ "github_metadata": { "branch": "master", "commit_count": 224, "repo_created_at": "2020-06-08T14:30: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": "cc1b3891...
a27f09ba-e8f2-4f3a-8b1c-8b9e20178bea
yuninxia/hands-on-simd-programming
02_Computations/02_dot_product/main.cpp
#include "../../include/simd_utils.h" #include <iostream> #include <iomanip> #include <vector> #include <random> /** * 02_Computations/02_dot_product - Implementing vector dot products with SIMD * * This example demonstrates different ways to calculate dot products using SIMD: * 1. Scalar implementation (baseline...
ALGO
0.999255
7.362562
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-02-08T20:35:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 50, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8c00eea2f5c...
591b2d34-1eaf-44a7-83db-7f6f97c5e639
cache-tlb/problem_solving
leet_code/97.Interleaving.String.cpp
class Solution { public: std::string str1, str2, str3; std::vector<int> cache; int rows, cols; int find(int idx1, int idx2) { int cache_id = idx1*cols + idx2; if (cache[cache_id] >= 0) return cache[cache_id]; int res = 0; if (idx1 == str1.length() && idx2 == str2.length()...
ALGO
0.999946
5.784524
{ "github_metadata": { "branch": "master", "commit_count": 153, "repo_created_at": "2016-01-22T12:00: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": "d008d624...
2f9527b3-f261-43d9-9c25-09613661123e
zzu-yaaa/Algorithm_CPP
WEEK04/SF_BOJ_1744.cpp
// 1744 수 묶기 #include <iostream> #include <vector> #include <queue> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, temp; priority_queue<int, vector<int>, greater<int>> negative; priority_queue<int> positive; cin >> n; int ans = 0; for (int i=0; i<n; i+...
ALGO
0.999991
4.0199
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2025-06-02T00:49:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5393dc78411...
acca56ff-d674-4d71-9129-dbc47b62f031
Justinshao33/competitive_programming
done/AtCoder/G_Big_Banned_Grid.cpp
#ifdef LOCAL #define _GLIBCXX_DEBUG 1 #endif #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx,popcnt,sse4,abm") #include<bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define pb push_back #define all(a) (a).begin(), (a).end() #define re...
ALGO
0.999992
4.931683
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2025-07-01T18:14: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": "2857e448a46...
fb7bde73-fa2c-4751-a97f-0fd565b60e62
wavescholar/numerical_libraries
itpp/itpp-4.3.1/itpp/base/bessel/gamma.cpp
/*! * \file * \brief Implementation of gamma functions * \author <NAME> * * ------------------------------------------------------------------------- * * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) * * This file is part of IT++ - a C++ library of mathematical, signal * processing, s...
ALGO
0.995064
5.555747
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2012-11-30T14:19:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 4, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "91171b75...
d5b1172e-fd2f-4a14-9f25-72db8a792abc
bradleypeterson/AlgoGauge
src/CLI_Parsing/CLI_Parser.hpp
/** * @brief This file handles all the command line parsing and translates the options * into algorithm objects that are then called to be run. It is also handles all the * errors that may be thrown. * @authors <NAME>.D., <NAME>, et al. * @copyright Weber State University */ //./AlgoGauge -j -v --algo bubble --n...
TOOL
0.978108
4.58793
{ "github_metadata": { "branch": "main", "commit_count": 186, "repo_created_at": "2023-10-28T20:05:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 2, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "4a55419860...
f41e917e-45a7-4876-86cc-dd450e7db8ee
sdaberdaku/AntibodyInterfacePrediction
antibody_interface_pred_train/src/Zernike/ZernikeMoments.h
/* * ZernikeMoments.h * * Created on: Jul 8, 2014 * Author: sebastian */ #ifndef ZERNIKEMOMENTS_H_ #define ZERNIKEMOMENTS_H_ #include "../Geometry/point3D.h" #include "Binomial.h" #include "Factorial.h" #include "GeometricMoments.h" #include <complex> #include <tuple> #include <boost/functional/hash.hpp> #...
ALGO
0.993169
5.398831
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2018-06-03T21:19:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fec3fe2ed...
6b389eea-72cb-42b6-8906-7b15ab955e78
H-Shen/My_Code_Collection
Luogu/P1801.cpp
#include <bits/extc++.h> using namespace std; using namespace __gnu_pbds; using ll = long long; namespace IO { template <typename T> inline void read(T& t) { int n = 0; int c = getchar_unlocked(); t = 0; while (!isdigit(c)) n |= c == '-', c = getchar_unlocked(); while (isdigit(c)) ...
ALGO
0.999982
4.085325
{ "github_metadata": { "branch": "master", "commit_count": 1586, "repo_created_at": "2019-04-11T06:48:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "93371ba...
1d3c0f2d-e60d-4e45-bb1f-b5d92a917e1c
hyunblnjeong/2020-AlgoStudy
04 Graph/11403.cpp
#include <iostream> #include <vector> #include <string.h> using namespace std; vector <vector <int> > v; int target, found, visit[100]; void search(int num) { if (found) return; visit[num] = 1; int next, len = v[num].size(); for (int i = 0; i < len; i++) { if (found) return; next = v[num][i]; if (next ==...
ALGO
0.999935
3.680958
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2020-07-31T04:40: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": "d32cee6ea...
012aaa0d-bedc-4859-8b18-1f2bd069bafc
01alchemist/TurboScript
benchmark/web-dsp/demo/cpp/dft.cpp
#include <iostream> #include <math.h> #include <limits> #include <complex> #include <vector> #include <ctime> #ifndef M_PI #define M_PI 3.141592653589793115997963468544185161590576171875 #endif #define t_SIZE 128 struct FourierTransform { int bufferSize; int sampleRate; int N; double bandWidth; double* sp...
ALGO
0.999284
4.979896
{ "github_metadata": { "branch": "master", "commit_count": 370, "repo_created_at": "2016-12-14T12:27:18.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 496, "forks": 35, "issues": 27, "pull_requests": 1 }, "file_meta": { "content_id": "d5de4...
6932f2f4-5f52-4380-ab0f-f80002885b20
DogeCoding/Algorithm
LeetCode/169.cpp
#include <stdlib.h> #include <iostream> #include <stdio.h> #include <math.h> #include <string> #include <cstdlib> #include <algorithm> #include <map> #include <vector> #include <stack> #include <queue> #include <unordered_map> using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x)...
ALGO
0.999957
4.315863
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2018-12-09T15:00: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": "85571c833...
4fc73494-694d-42ab-be43-8e43a06eb194
rv404674/CPcodes
a2 online judge/bfs,dfs,djikstra/lev2/escapefromjailspoj.cpp
#include<iostream> #include<iomanip> #include<sstream> #include<cstdio> #include<cmath> #include<cstring> #include<string> #include<vector> #include<list> #include<set> #include<map> #include<queue> #include<stack> #include<utility> #include<limits.h> #include<functional> #include<algorithm> using namespace std; in...
ALGO
0.999903
3.154427
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2017-11-10T13:57:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ae52a6b39f...
222f99b9-d940-4eeb-b23a-2167a83062d7
goshreyas/ProblemSolving
weekly_contest_165/number-of-burgers-with-no-waste-of-ingredients.cpp
/* * * URL: https://leetcode.com/contest/weekly-contest-165/problems/number-of-burgers-with-no-waste-of-ingredients/ * */ #include <bits/stdc++.h> using namespace std; #define GET_EXEC_TIME 0 #if GET_EXEC_TIME #include <chrono> using namespace std::chrono; #endif class Solution { public: vector<int> numOfB...
ALGO
0.999746
5.572352
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-12-02T01:25: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": "8e4fedb308...
6dc70ded-3d93-4b88-8fbe-887c3332c130
zcfilosi/datastructP3
TreeType.h
#include <string> #include <fstream> #include <iostream> #include <vector> //typedef int ItemType; template<class ItemType> struct TreeNode; #include "QueType.h" enum OrderType {PRE_ORDER, IN_ORDER, POST_ORDER}; template <class ItemType> class TreeType { public: TreeType(); // constructor ~Tree...
ALGO
0.991033
3.985902
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2017-04-04T23:08:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "cc249849d...
c6178197-5270-4af8-b360-3434f0cf1312
tasty-gumi/Code-Practice
cpp/82.删除排序链表中的重复元素-ii.cpp
/* * @lc app=leetcode.cn id=82 lang=cpp * * [82] 删除排序链表中的重复元素 II */ // @lc code=start /** * 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 ...
ALGO
0.999928
6.117928
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2025-01-23T05:26:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8fa693bf1...
ef4c8e73-8b53-49b6-b464-b296a03ca1bf
vikramkbgs/CP
Find the Town Judge.cpp
class Solution { public: int findJudge(int n, vector<vector<int>> &trust) { vector<vector<int>> graph(n + 1, vector<int>(n + 1, 0)); for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) if (i == j) graph[i][j] = 1; for (int i = 0; i...
ALGO
0.999786
4.605944
{ "github_metadata": { "branch": "master", "commit_count": 294, "repo_created_at": "2021-12-11T11:47: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": "f7c9d557...
750a956f-f96c-40b9-8970-45e6b183a44b
SiddhantAttavar/Competitive-Programming
ICO/INOI Past Problems/3_xN_Tiling.cpp
#include <bits/stdc++.h> using namespace std; #define range(i, s, n) for (int i = s; i < n; i++) #define len(a) (*(&a + 1) - a) #define print(x) cout << (x) << endl; #define input(type, x) type x; cin >> x; #define arrput(type, var, n) type var[n]; range(inputCount, 0, n) {cin >> var[inputCount];} #define setup() ios::...
ALGO
0.999703
3.968781
{ "github_metadata": { "branch": "main", "commit_count": 607, "repo_created_at": "2021-09-16T08:14:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dc06e9e1a...
1c75a2a5-0807-4506-b1bf-bfde9fe7d592
bvpcsiofficial/BVPCSI-HACKTOBERFEST
graph/depth_first_search_with_stack.cpp
#include <iostream> #include <list> #include <stack> #include <vector> constexpr int WHITE = 0; constexpr int GREY = 1; constexpr int BLACK = 2; constexpr int INF = 99999; void dfs(const std::vector<std::list<int> > &graph, int start) { std::vector<int> checked(graph.size(), WHITE); checked[start] = GREY; ...
ALGO
0.999971
4.829669
{ "github_metadata": { "branch": "main", "commit_count": 73, "repo_created_at": "2020-10-10T06:22:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "01e3ba9a9a...
adc692b8-24bd-45cf-9d07-d18323e385f8
mpc-msri/EzPC
SCI/src/GC/halfgate_eva.h
/* Original Work Copyright (c) 2018 <NAME> (<EMAIL>) Modified Work Copyright (c) 2021 Microsoft Research 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 limi...
ALGO
0.988485
6.663901
{ "github_metadata": { "branch": "master", "commit_count": 410, "repo_created_at": "2019-02-16T11:23:32.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 429, "forks": 129, "issues": 52, "pull_requests": 8 }, "file_meta": { "content_id": "6f18...
2d0d9642-7561-4282-b705-ae82fb4773e8
gauravshinde19/CPP-Programs
Bit/CheckOneOfTheBit.cpp
// Program to accept number from user and check whether 9th or 12th bit is ON or OFF #include <iostream> using namespace std; bool ChkBit(unsigned int iNo) { unsigned int iMask9 = 0x00000100; unsigned int iMask12 = 0x00000800; int iResult = 0; iResult = (iNo & iMask9) | (iNo & iMask12); if ((iRes...
ALGO
0.988123
5.716285
{ "github_metadata": { "branch": "main", "commit_count": 68, "repo_created_at": "2024-06-13T19:02:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eb9067d09a2...
6c6bb1ee-5519-4dc2-8f8e-fd0011a9656f
rkrishnavedic/exp_labs
closestpair.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define fori(n) for(long long i=0;i<n;i++) #define d7 1000000007 #define sp(n) setprecision(n) ll bs(ll v, ll a[],ll i, ll n){ if(i>n){return -1;} if(i==n){ if(v==a[n])return n; else{return -1;} } if(a[(i+n)/2]==v){ ...
ALGO
0.999708
3.782676
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2019-11-30T14:27: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": "925f54833...
96437c4a-3041-4f60-b468-732043b88ac6
jerry81/leetcode
Exercises/0-500/251-275/273TwoSum/twoSumBST.cpp
/* 653. Two Sum IV - Input is a BST Easy 6.3K 250 Companies Given the root of a binary search tree and an integer k, return true if there exist two elements in the BST such that their sum is equal to k, or false otherwise. Example 1: Input: root = [5,3,6,2,4,null,7], k = 9 Output: true Example 2: Input: root = ...
ALGO
0.999992
6.847195
{ "github_metadata": { "branch": "main", "commit_count": 5174, "repo_created_at": "2022-05-24T03:58: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": "4a15fb399...
663d6dd1-8d06-47d9-a0dc-f1b263346e84
modanhan/problem-solving
psc/2014/lahore 2014/c.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int tc; cin >> tc; for (int t = 1; t <= tc; t++) { string a; cin >> a; if (a[0] == '0') { cout << "Case #" << t << ": 0\n"; continue; } if (a.size() == 1) { cout << "Case #" << t << ": 1\n"; continue; } bool b...
ALGO
0.999565
3.529647
{ "github_metadata": { "branch": "master", "commit_count": 85, "repo_created_at": "2014-12-01T18:40:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "453e9e59a...
0577bb9f-5dcc-47f7-b15b-1138655bba2e
aloukikattrey/Data-Structure
Queue/queue-using-array.cpp
#include <iostream> using namespace std; //#define n 5 class queue { int *arr; int front; int back; int n; public: queue(int size) { n = size; arr = new int[size]; front = -1; back = -1; } bool isEmpty() { if (front == -1 || front > back) ...
ALGO
0.967221
4.09402
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2024-10-07T05:46: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": "425ab6c352...
84086b2c-fbaf-4ddf-a770-b2a8b80f1956
ishandutta2007/codeforces-z
zhukov_dmitry/normal/1721/F.cpp
#include <stdio.h> #include <bits/stdc++.h> #include <cstdint> #include <ctime> #include <functional> #include <limits> #include <random> #include <string_view> #include <type_traits> #include <utility> #ifdef ROOM_311 # ifndef OLYMP_DEBUG # define OLYMP_DEBUG # endif #else # define OLYMP_NDEBUG #endif //#include <o...
ALGO
0.999873
3.907122
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:43: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": "28c7e0a1d426...
5506a6a8-6f12-4170-b66c-00a814cf91b0
Mkjha101/C_DataStructures
October 15/1. Bubble Sort.cpp
#include <iostream> using namespace std; void bubbleSort(int arr[], int n) { for (int i = 0; i < n - 1; i++) { bool swapped = false; // Flag to track if any swapping happens in this pass for (int j = 0; j < n - i - 1; j++) { if (arr[j] > arr[j + 1]) { // Swap the elemen...
ALGO
0.999992
5.418612
{ "github_metadata": { "branch": "main", "commit_count": 58, "repo_created_at": "2024-08-06T05:03: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": "a050d7abacc...
42451f1a-3176-4cef-a85c-a7275f9be99d
yejun614/algorithm-solve
problems/baekjoon/p6064.cpp
/* * (230201) 카잉 달력 * https://www.acmicpc.net/problem/6064 * * [풀이] * 수학문제로 고민 끝에 공식을 만들어 풀이하였다. * (문제 내용은 홈페이지 참고) * * 우선 문제에서 말하는 내용을 이해할 수 있어야 한다. 문제에서는 아주 특이한 * 수 체계를 말하고 있는데 그 규칙은 아래와 같이 나타낼 수 있다. * * (M = 10, N = 12) * --+----------------------------------------------------------------------------- *...
ALGO
0.999751
4.462286
{ "github_metadata": { "branch": "main", "commit_count": 79, "repo_created_at": "2021-07-03T07:38:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1732d1a3542...
17048ac6-9375-4be4-b57c-e399dec6d194
Baejinho03/CPP
[35]중앙값_구하기.cpp
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; if (a > b) { // b < a < c if (a < c) cout << a; } else if (a > c) { // c < a < b if (a < b) cout << a; } else if (b > a) { // a < b < c if (b < c) cout << b; } else if (b > c) { // c < b < a if (b <...
ALGO
0.999773
3.349473
{ "github_metadata": { "branch": "main", "commit_count": 96, "repo_created_at": "2025-05-09T12:47:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f56a26a79c5...
f0ef3d4d-1d9b-4eeb-b1fd-95ede1124d25
DeagleGross/C-Algo-Structures
Algorithms/KDZ/AlgoHelper.h
// // Created by <NAME> on 29.03.2019. // #ifndef KDZ_BORDERMAKER_H #define KDZ_BORDERMAKER_H #include <vector> #include <iostream> using namespace std; class AlgoHelper { public: int getIstok(vector<vector<int>>& matrix) { vector<int> istoks = vector<int>(); for (int i = 0; i < matrix.size...
ALGO
0.998296
4.28511
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2019-07-26T16:15:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3cc1ed16f5...
5cfffbbf-8e51-4d2a-9676-3887472f2f48
metaphysis/Code
UVa Online Judge/volume001/124 Following Orders/program.cpp
// Following Orders // UVa ID: 124 // Verdict: Accepted // Submission Date: 2015-11-27 // UVa Run Time: 0.000s // // 版权所有(C)2015,邱秋。metaphysis # yeah dot net #include <bits/stdc++.h> using namespace std; #define MAXN 20 bool visited[MAXN]; int nChar, value[2 * MAXN], nLimit; char output[MAXN], input[MAXN], limit[M...
ALGO
0.99993
3.903704
{ "github_metadata": { "branch": "master", "commit_count": 1710, "repo_created_at": "2016-03-07T13:28:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 229, "forks": 50, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef5d...
79a28f8f-6c73-4aa2-af9d-b7491b989c55
Rconybea/xo-distribution
include/xo/distribution/KolmogorovSmirnov.hpp
/* @file KolmogorovSmirnov.hpp */ #pragma once #include "Distribution.hpp" #include "xo/indentlog/scope.hpp" #include <cmath> #include <cstdint> namespace xo { /* Kolmogorov-Smirnov probability distribution */ namespace distribution { class KolmogorovSmirnov : public Distribution<double> { p...
ALGO
0.995741
7.024261
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2023-10-23T17:40:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8df8603b7b6c...
35deee8a-1ba7-4e83-87bf-3fdaab017fa5
YueZhengRedMoon/LeetCode_Project
1000-1499/1124_longest-well-performing-interval.cpp
#include <iostream> #include <vector> #include <stack> class Solution { public: int longestWPI(std::vector<int> &hours) { int n = hours.size(); std::vector<int> prefix(n + 1); std::stack<int> stack; prefix[0] = 0; stack.push(0); for (int j = 1; j <= n; ++j) ...
ALGO
0.998539
4.435169
{ "github_metadata": { "branch": "master", "commit_count": 1013, "repo_created_at": "2023-04-06T13:45:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b63aee5...
3831cf0a-e249-4d88-9557-781759063fe2
srbcheema1/algo
ques/codeforces/812/two.cpp
#include<bits/stdc++.h> #define dout if(debug and (debug_test == 0 or _t == debug_test) ) cout<<" " #define endl "\n" using namespace std; #ifdef ONLINE_JUDGE #define DEBUG 0.0 #else #define DEBUG 1 #endif int debug = DEBUG;// it will take care of itself on online-judge int debug_test = 0; // test_case to be debugged ...
ALGO
0.999996
3.252885
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2018-08-20T20:51: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": "e60eace56...
3d83d71c-c88a-4eb1-89d5-24c00a1f07ff
forge-lab/upmax
algorithms/Alg_UpWMSU3.cc
/*! * \author <NAME> - <EMAIL> * * @section LICENSE * * Open-WBO, Copyright (c) 2013-2022, <NAME>, <NAME>, <NAME> * UpMax, Copyright (c) 2022, <NAME>, <NAME>, <NAME> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "S...
ALGO
0.999954
5.719558
{ "github_metadata": { "branch": "master", "commit_count": 134, "repo_created_at": "2020-08-29T20:53:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1bb49dfac...
d57e812c-1631-4096-878f-ee7caa0bb623
rjenez/W266-final-project
data/programming-homework-dataset-plagiarism-detection/src/B2016/Z5/Z3/student5897.cpp
#include <iostream> #include <stdexcept> #include <climits> #include <cmath> #define M LLONG_MAX #define m LLONG_MIN class Razlomak { long long int brojnik, nazivnik; long long int static NZD(long long int p, long long int q) { while(q) { long long int x=q; q=p%q; p=x; } return p; } static void s...
ALGO
0.986352
3.930151
{ "github_metadata": { "branch": "main", "commit_count": 125, "repo_created_at": "2022-02-09T00:45:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d65aada969...