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
a166568a-6ac8-4b6f-8ba4-08fc46515054
devinamatthews/molssi-sss-2017
vectorization_samples/driver.cxx
#include <cstdio> #include <limits> #include <algorithm> #include <vector> #include <omp.h> void transpose(int m, int n, const double* A, int lda, double* B, int ldb); template <typename Experiment> double benchmark(Experiment&& exp, int num_repeat=1) { double min_time = std::...
ALGO
0.994685
4.824276
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2017-07-19T14:47:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 23, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71528ff7...
1a21b5b7-2545-41da-866b-517dd7a75919
phuicy/ROBOOP
source/dynamics.cpp
/* ROBOOP -- A robotics object oriented package in C++ Copyright (C) 1996-2004 <NAME> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) an...
ALGO
0.998934
5.188432
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2016-01-22T11:19:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "302d6a7b...
b90a8127-f432-4144-8f44-03e22e08903d
DengzhiLiu/CG
RayTracing/RayTracing/BSPTree.cpp
#include "BSPTree.h" #include "Material.h" #include "Triangle.h" BSPTree::BSPTree() { minnum = 8; maxdepth = 10; } BSPTree::~BSPTree(void) { } // 判断一点是否在网格内 inline bool BSPTree::IsInBox(Point pos, Point Bmin, Point Bmax) { if (pos.X() < Bmin.X() || pos.X() > Bmax.X()) return false; if (pos.Y() < Bmin.Y() || po...
ALGO
0.999789
3.840664
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2015-04-08T15:41:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4696767e87...
51ea4c06-b8c6-4ab5-a5de-4e2d98df5648
moiyer/myLeetcode
Rotate Image.cpp
/* You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? */ //2013/6/29 21:26:26 //水题 class Solution { public: void rotate(vector<vector<int> > &matrix) { // Start typing your C/C++ solution below // DO NOT wri...
ALGO
0.999977
5.594214
{ "github_metadata": { "branch": "master", "commit_count": 132, "repo_created_at": "2013-06-13T06:21: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": "e6d7089f...
7481422f-17cf-4fdf-8913-8084c6d9230c
PearCoding/Ignis
src/runtime/bvh/BvhNAdapter.h
#pragma once #include "NArityBvh.h" #include <ranges> namespace IG { template <size_t N, typename Node, std::ranges::random_access_range PrimitiveRange> class BvhNAdapter { public: using Bvh = NArityBvh<N>; BvhNAdapter(std::vector<Node>& nodes, const PrimitiveRange& primitives) : nodes(nodes) ...
ALGO
0.972255
6.390709
{ "github_metadata": { "branch": "master", "commit_count": 1759, "repo_created_at": "2020-10-06T08:33:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 59, "forks": 11, "issues": 9, "pull_requests": 4 }, "file_meta": { "content_id": "60f54...
1c04386b-3f8c-4023-9fae-b749a981ebd5
slava-sh/code-plagiarism-detector
data/final-16/sources/u1641_48_E_219343.cpp
#include <iostream> #include <cstdio> #include <vector> #include <queue> #include <sstream> #include <map> #include <set> #include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <string> #include <stack> using namespace std; #define MAXN 220 int h, t, r, n, m; pair<int, int> a_head[MAXN],...
ALGO
0.999953
3.361939
{ "github_metadata": { "branch": "master", "commit_count": 135, "repo_created_at": "2015-04-26T21:39:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3fbd9551...
24d2e9a6-16c2-45e6-a759-4d0779301b98
dingqunfei/LeetCode
Problem401-450/p438_2.cpp
/** * @file p438_2.cpp * @brief * @author dingqunfei (<EMAIL>) * @version 1.0 * @date 2021-04-29 * * @copyright Copyright (c) 2021 DQFLYING * * @par : * * * Date : 2021-04-29 * Version : 1.0 * Author : dqflying * Lisence : * Description : * * * * */ class Solution {...
ALGO
0.99997
6.009129
{ "github_metadata": { "branch": "master", "commit_count": 304, "repo_created_at": "2020-04-30T17:46:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0458163e...
0cd2f229-e047-4a7c-88c1-005513693a1b
hbatmit/ns2.35
tcp/scoreboard1.cc
/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */ /* * Copyright (c) 1996 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are m...
TOOL
0.942371
4.109451
{ "github_metadata": { "branch": "master", "commit_count": 741, "repo_created_at": "2013-01-18T21:42:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 49, "forks": 102, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "bd8b6...
539b3e0a-683c-420e-8e99-884b06acbc7b
carterbrown-27/Contest-Programming-Practice
Notepad C++/736/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>; template<typename T> using uset = unordered_set<T>; template<typename T, typename U> using umap = unordered_map<T,U>; #define pb push_back void solve() { int n; cin >...
ALGO
0.999901
3.930485
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2020-05-13T00:52: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": "20d00342e...
a904572f-7db5-4611-b5ca-ced330c5475f
warrunner/Facebook-Hackercup
Qualifier Round/Codes/xs_and_os.cpp
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; vector<pair<int, int>> vis; int checkCol(vector<string> grid, int rc) { int count = 0; pair<int, int> p; for(int i=0; i<grid[rc].length(); i++) { if(grid[rc][i] == 'O') { return 0; } else if(grid[rc][...
ALGO
0.999846
4.003549
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2021-08-31T19: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": "6d34c19f4c06...
5302cf7a-722b-4528-bffb-89383627dc0b
noushad970/Data-Structure-and-Algorithm-Learning
LinkedList/CirculerLinkedList.cpp
#include<iostream> using namespace std; class node { public: int data; node* next; node(int val) { data= val; next=NULL; } }; void display(node* head) { node* temp=head; do{ cout<<temp->data<<" "; temp=temp->next; }while(temp!=head); cout<<endl; }...
ALGO
0.999557
3.924193
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2024-02-19T17:33: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": "d7a84a03adf...
5fecc321-122f-46b2-a6c9-de58b883efd9
VlaKu94/Homework_Skillbox
Module_13/work_2.cpp
/* * С помощью списка инициализации задаётся вектор цен на продукты (дробнымичислами). * Таким же образом с помощью списка инициализации задаётся вектор покупок (в виде индексов), которые совершает человек. * Необходимо вывести на экран итоговую стоимость покупок. Вектор цен и вектор покупок можно задать напрямую в ...
ALGO
0.966871
4.735227
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2023-03-03T20:55: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": "5c014b1c8eb...
e059cf4c-51c2-41cc-8265-431477efde20
MingshanJia/DataFlowAnalysis
CloneBen/google_code/1/2/Nyan101_1_0.cpp
#include <cstdio> #include <queue> #include <tuple> #include <vector> #include <algorithm> #include <map> typedef long long llint; using namespace std; int N, Q; llint X1, X2, A1, B1, C1, M1; llint Y1, Y2, A2, B2, C2, M2; llint Z1, Z2, A3, B3, C3, M3; int L[400002], R[400002]; int K[100002]; map<int,int> mp; vector...
ALGO
0.999772
3.954808
{ "github_metadata": { "branch": "master", "commit_count": 802, "repo_created_at": "2019-10-14T10:49: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": "2782fe12...
3f3b5f03-0860-414d-8723-39391d00b6bf
ACM-TOMS/CALGO
0940/Original-Submission/Src/ThirdParty/armadillo-3.6.3/include/armadillo_bits/glue_conv_meat.hpp
// Copyright (C) 2010-2011 NICTA (www.nicta.com.au) // Copyright (C) 2010-2011 <NAME> // // This file is part of the Armadillo C++ library. // It is provided without any warranty of fitness // for any purpose. You can redistribute this file // and/or modify it under the terms of the GNU // Lesser General Public Licens...
ALGO
0.993426
5.879819
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2021-11-17T18:24:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 11, "forks": 1, "issues": 9, "pull_requests": 0 }, "file_meta": { "content_id": "4f1fa213ac5...
d05f2f11-6c9c-4ba1-9bc9-4dc2ff31bcac
pmai6/HPC-polynomial
utils.cpp
/* * CX 4220 / CSE 6220 Introduction to High Performance Computing * Programming Assignment 1 * * Utility function implementation * */ #include <mpi.h> #include "utils.h" //------------------- Timer Functions (Do not change) -------------------// void set_time(double &t, const int rank, MPI_Comm c...
ALGO
0.999614
5.705577
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-10-06T06:00: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": "5b7f8770ae...
4f6e0456-119a-40bb-9f6c-4c4424c81857
kamyu104/LeetCode-Solutions
C++/next-palindrome-using-same-digits.cpp
// Time: O(n) // Space: O(1) class Solution { public: string nextPalindrome(string num) { if (!nextPermutation(begin(num), begin(num) + size(num) / 2)) { return ""; } copy(begin(num), begin(num) + size(num) / 2, rbegin(num)); return num; } private: template<typ...
ALGO
0.999982
6.197642
{ "github_metadata": { "branch": "master", "commit_count": 19395, "repo_created_at": "2018-10-11T17:38:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4939, "forks": 1616, "issues": 1, "pull_requests": 55 }, "file_meta": { "content_id": ...
8411d547-f5d8-49a3-bb7e-8e76a7a412ed
haoel/leetcode
algorithms/cpp/bulbSwitcher/BulbSwitcher.IV.cpp
// Source : https://leetcode.com/problems/bulb-switcher-iv/ // Author : <NAME> // Date : 2021-03-29 /***************************************************************************************************** * * There is a room with n bulbs, numbered from 0 to n-1, arranged in a row from left to right. * Initially a...
ALGO
0.999987
6.084355
{ "github_metadata": { "branch": "master", "commit_count": 788, "repo_created_at": "2014-10-20T03:22:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 17857, "forks": 4931, "issues": 26, "pull_requests": 28 }, "file_meta": { "content_id": ...
4ae53dad-fd70-49e9-ab0a-97477be8ef0b
MartinUbl/scgms-contrib
misc-model/src/lotka-volterra/lvmodel.cpp
/** * SmartCGMS - continuous glucose monitoring and controlling framework * https://diabetes.zcu.cz/ * * Copyright (c) since 2018 University of West Bohemia. * * Contact: * <EMAIL> * Medical Informatics, Department of Computer Science and Engineering * Faculty of Applied Sciences, University of West Bohemia *...
ALGO
0.977019
5.983358
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2025-04-18T16:15:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cc603139d6...
f137294b-5f91-4e13-9b39-3809b7dd88e6
dominicusin/zfs-win
zfs-win/Compress.cpp
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolar...
ALGO
0.983649
6.179786
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2015-10-31T04:34:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 21, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "beed402d...
9c769cfd-687c-4033-b35a-436e68b444ac
krnbatra/SPOJ-Solutions
BGSHOOT.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define MOD 1000000007LL #define EPS 1e-9 #define io ios_base::sync_with_stdio(false);cin.tie(NULL); const int MAXN = 2e5+5; map<ll, ll> compress; ll cnt[MAXN]; pair<ll, ll> segments[MAXN], queries[MA...
ALGO
0.999972
4.599605
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2016-08-28T07:31:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 40, "forks": 27, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "3973d85...
a993ba89-f663-4911-bf20-843f097c6d4d
Nishanz/Assignments
DS/segtree.cpp
//By aMeYa PrAbHu #include <bits/stdc++.h> using namespace std; #define ll long long int typedef pair<ll,ll> pii; typedef vector<ll> vi; typedef vector< pii > vpii; #define mp make_pair #define pb push_back #define mt make_tuple #define F first #define S second #define sz(x) (ll)(x.size()) #define endl '\n' #define ...
ALGO
0.999901
3.306199
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2016-08-31T12:49: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": "67ab1af5b...
4d61632e-9c7e-4965-a434-c87460afd7de
Eirtrand/abba_ws
Master thesis attached files/Final System/damage_detection.cpp
#include "damage_detection.h" #include <qdebug.h> //Algorithm to detect damaged areas in sea cages-------------------------------------------// cv::Mat Hole_detection_algo(cv::Mat input_img) { cv::Mat output_img; //image with detected holes if((!input_img.empty())&& (input_img.channels()==1)) { QLi...
ALGO
0.917278
4.910176
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-03-28T12:57: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": "ea93e89909...
a4a131b4-cbb2-4d81-8d38-2b3357e3aeac
akshanshgusain/data_structures_algorithms
DynamicProgramming/DP_027.cpp
// // Created by <NAME> on 21/12/21. // #include<stdc++.h> using namespace std; int lcs(string X, string Y, int m, int n) { int T[m + 1][n + 1]; int i, j; for (i = 0; i <= m; i++) { for (j = 0; j <= n; j++) { if (i == 0 or j == 0) { T[i][j] = 0; } else if ...
ALGO
0.999951
5.291865
{ "github_metadata": { "branch": "master", "commit_count": 153, "repo_created_at": "2022-07-21T10:11:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "57ebd41b...
d63ceaf8-f972-464b-9939-49af25f19638
aksenoff/leetcode-challenge-2020
16-valid-parenthesis-string.cpp
// https://leetcode.com/problems/valid-parenthesis-string/ bool check(string s,int& stack, int& stars) { char c; while (s != "") { c = s.back(); s.pop_back(); switch (c) { case '(': if (stack == 0) { if (stars == 0) ...
ALGO
0.99942
5.473265
{ "github_metadata": { "branch": "master", "commit_count": 86, "repo_created_at": "2020-04-15T14:58: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": "626ce6e32...
66996d0a-4841-454f-96f4-6aee3db6dc4e
gkswns3708/BOJ_CPP
PS/BaekJoon 1933번 스카이라인 - 2.cpp
#include<bits/stdc++.h> #include <regex> #define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); using namespace std; #define INF (int)1e9+7 #define X first #define Y second #define sz(v) (int)(v).size() #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define compress(v) sort(al...
ALGO
0.999963
4.132
{ "github_metadata": { "branch": "main", "commit_count": 505, "repo_created_at": "2020-10-27T17:18:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4b5db0aa21...
497f435e-6edc-4428-8712-858aa5930a93
itoi10/algorithm
tessoku/a10.cpp
#include <algorithm> #include <iostream> using namespace std; int N, A[100009], P[100009], Q[100009]; int D, L[100009], R[100009]; int main() { cin >> N; for(int i = 1; i <= N; i++) cin >> A[i]; cin >> D; for(int i = 1; i <= D; i++) cin >> L[i] >> R[i]; // // O(N * D) // for(i...
ALGO
0.999989
4.303555
{ "github_metadata": { "branch": "main", "commit_count": 62, "repo_created_at": "2022-04-30T12:35: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": "ec22117b1c1...
f081a3cf-6e3d-4d19-99c7-ad5f8b4bf744
RandeXDev/TestWolcen
CSB_Silver_GoldPromo.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> using namespace std; /** * Auto-generated code below aims at helping you parse * the standard input according to the problem statement. **/ struct Vector2 { public: float x; float y; //CONSTRUCTORS Vector2(void) { x...
ALGO
0.999474
4.095212
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2021-04-15T21:14: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": "bba4edcc3ce...
84c74a15-e77d-4647-8ff4-11071f6b0649
ssudharsan93/graduate_program
Spring 2023/CS 5343/assignment4/Graph.cpp
#include "Graph.h" //----------------------------------------------------- //################# GRAPH METHODS START ################# //----------------------------------------------------- Graph::Graph(){ this->vertices = new vector<Vertex*>(); this->edges = new vector<Edge*>(); } Graph::~Graph() { delet...
ALGO
0.979085
3.651009
{ "github_metadata": { "branch": "main", "commit_count": 152, "repo_created_at": "2023-02-22T04:21:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "084aff4449...
26f1ca65-b6f6-4b26-a94e-d7b424b5ee10
adlin-creation/Enqu-te-Agent-Secret
Enquête-Agent-secret/historique.h
/* INF3105 - Structures de données et algorithmes Squellette pour le TP2 * Nom et prénom : <NAME> * Code permanent : LOUA20309509 */ #if !defined(__HISTORIQUE__) #define __HISTORIQUE__ #include <iostream> #include <string> #include "arbreavl.h" typedef int Date; // optionnel struct Intervalle{ Date de...
TOOL
0.922933
4.731046
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-05-02T22:50: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": "3107320b44da...
f2da8075-110f-46eb-8698-ec58e6825f70
cringevictim/parallel-calculations
PC3/PC3.cpp
#include <iostream> #include <chrono> #include <atomic> #include <random> #include <thread> #include <vector> #include <mutex> #include <limits> std::vector<int> g_values; std::mutex g_mutex; void fillVectorWithRandom(std::vector<int>& vec, int min, int max, int count) { std::mt19937 rng(time(nullptr)); std::unifo...
ALGO
0.999255
5.999117
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2024-04-04T12:58: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": "0a5aab8e6...
08659b09-d759-4291-ab3c-1358e53250d3
frozenca/CLRS3
15/15-3.cpp
#include <algorithm> #include <cassert> #include <cmath> #include <limits> #include <iostream> #include <vector> #include <utility> using Point = std::pair<double, double>; double distance(const Point& p1, const Point& p2) { return std::hypot(p1.first - p2.first, p1.second - p2.second); } std::pair<std::vector<s...
ALGO
0.999685
4.850307
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2021-02-09T03:14:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 55, "forks": 19, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "04bba54d9...
dc086179-b163-47ed-bd14-95b2fefd9f3a
dragan-university/coding-interview
hackerrank/algorithms/dp/coin_change/coin_change.cpp
/* DP solution as explained by <NAME> https://www.youtube.com/watch?v=_fgjrs570YE&list=PLrmLmBdmIlpsHaNTPP_jHHDx_os9ItYXr&index=10 -------------------------------------- coins: c[0],..., c[m-1] S[i,j] - number of ways to make change on the amount 'j' with coins c[0],...,c[i-1] S[0,j] = 0, j=0,1,2,...,n S[i,0] = 1, i=0...
ALGO
0.999935
4.110532
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2023-10-13T20:49:55.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fa7fd42f915...
9a5138ba-78dc-4737-8506-8e553a84d100
JuanAlbu/atividade-3-APA
heapSort/heapSort.cpp
#include <iostream> #include <stdlib.h> #include <fstream> using namespace std; void heapify(int arr[], int n, int i) { int largest = i; int l = 2*i + 1; int r = 2*i + 2; if (l < n && arr[l] > arr[largest]) largest = l; if (r < n && arr[r] > arr[largest]) largest = r; ...
ALGO
0.996458
3.89494
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-03-22T17:14: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": "8d5bf82cb0...
0e87d627-dbc3-40b4-beb4-972f327e52a4
jaykim305/VVCSoftware_VTM
source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp
/* The copyright in this software is being made available under the BSD * License, included below. This software may be subject to other third party * and contributor rights, including patent rights, and no such rights are * granted under this license. * * Copyright (c) 2010-2025, ITU/ISO/IEC * All rights reserve...
ALGO
0.999674
6.619892
{ "github_metadata": { "branch": "main", "commit_count": 8144, "repo_created_at": "2025-03-12T22:07:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a98b89531...
a0c32f6e-448f-440b-9c90-720883eb8ae3
tstanvir/DSA
LightOj_Solve/1303 - Ferris Wheel(BasicDS).cpp
/// <NAME> //Author: <NAME> //ICE,NSTU #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; const long long MOD = 1000000007; const double rad=(acos(-1)/180.00); #define SET(x) memset(x, 0, sizeof(x)) #define SET2d(x,m,n) ...
ALGO
0.999966
3.30264
{ "github_metadata": { "branch": "master", "commit_count": 162, "repo_created_at": "2020-01-26T19:06:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "906a95f3...
07ce4c1d-5e71-4141-813c-4f2e3fc9e88c
lheckemann/namic-sandbox
TetrahedralMeshGeneration/Tools/m2mcmp.cxx
/* * Author: <NAME> * * This tool compares the accuracy and quality of the two input tetrahedral * volume meshes. * * Quality is assessed using standard VTK MeshQuality class * Accuracy is evaluated using two methods: * 1) (Mesh volume overlap)/(Mesh 1 volume + Mesh 2 volume) * Mesh volume overlap is co...
ALGO
0.94859
5.648595
{ "github_metadata": { "branch": "master", "commit_count": 7250, "repo_created_at": "2017-12-09T21:14: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": "d83742d...
34adbb35-473e-4103-88c9-be589ca2a756
sahilarora1995/BasicInterviewCodes
Trees/tree33- Convert A Normal BST to BBST.cpp
/* Problem Statement: ------------------- Given a BST (Binary Search Tree) that may be unbalanced, convert it into a balanced BST that has minimum possible height. Core Logic: ------------------- Traverse given BST in inorder and store result in an array. This step takes O(n) time. Note that this array would be sort...
ALGO
0.999997
5.469922
{ "github_metadata": { "branch": "master", "commit_count": 170, "repo_created_at": "2017-07-31T15:38:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "60a44df0...
31331143-2b12-41f7-abe0-deb709506de0
nguyentuss/Competitive-Programming
CP/OnlineJudge/CSES/Apartments-1084.cpp
#include <bits/stdc++.h> using namespace std; int n , m , k; multiset<int> mini; multiset<int , greater<int>> maxi; vector<int> v; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); cin >> n >> m >> k; for (int i = 0 ; i < n ; i ++) { int x; cin >> x; v.push_back(x); } for (int i = 0...
ALGO
0.999964
3.901081
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-01-20T04:18: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": "c7f6a6087071...
6d8429e2-ac7d-4410-91d5-76b186b2ca0a
wilson100hong/CarND-Extended-Kalman-Filter-Project
src/tools.cpp
#include "tools.h" #include <iostream> using namespace std; using Eigen::VectorXd; using Eigen::MatrixXd; Tools::Tools() {} Tools::~Tools() {} VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations, const vector<VectorXd> &ground_truth) { // RMSE for px, py, vx, vy. Vec...
ALGO
0.974737
5.882757
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-01-21T19:50: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": "a641322a97...
c9111166-aa03-4b32-907c-cc0b6d0d2576
qdx/OS_benchmark
CPU_OS/read_time/main.cpp
/* Output format: * reading time ie. getticks() overhead * elapsed() overhead * for() loop overhead */ #include <stdio.h> #include <iostream> #include "cycle.h" using namespace std; int main(int argc, const char* argv[]){ // getticks() overhead: double sum = 0; for(int x = 0; x<10000; x++) { ticks t...
TOOL
0.933587
4.641456
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2014-03-22T05:05: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": "79a5275e1f...
01e2091e-dc4b-440a-b444-294501750403
shivam04/codes
code-interview-questions/calendar-matching.cpp
#include <vector> using namespace std; struct StringMeeting { string start; string end; }; struct Meeting { int start; int end; }; int timeInMin(string time) { int delim = time.find(":"); int h = stoi(time.substr(0,delim)); int m = stoi(time.substr(delim+1,time.length())); return h*60 + m; } string mi...
ALGO
0.998983
5.120023
{ "github_metadata": { "branch": "master", "commit_count": 131, "repo_created_at": "2016-12-05T11:36:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fbd30159...
c508bccb-cd44-4a35-9848-76f07c7900fe
pogery-foggy/BOJ_study
code/2023/easy_after_0913/10811.cpp
#include <iostream> using namespace std; int N, M; int arr[101]; void init() { cin >> N >> M; for (int i = 1; i <= N; i++) { arr[i] = i; } } void swap(int a, int b) { int temp = arr[a]; arr[a] = arr[b]; arr[b] = temp; } void solve() { for (int i = 0; i < M; i++) { int l, ...
ALGO
0.999986
4.705149
{ "github_metadata": { "branch": "main", "commit_count": 197, "repo_created_at": "2023-01-17T09:30: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": "3c2ff77e80...
b68da57b-82b0-4ca4-9311-67240ceb87d7
khoapham12397/CodeForces
ListOfInteger920G.cpp
#include <iostream> #include <vector> #include <algorithm> #include <bitset> using namespace std; typedef pair<int, int > ii; int K, P,cd; int cal(int ct,vector<ii> vt) { int t = vt.size(),res=0; for (int st = 1; st < (1 << t); st++) { int val = 1,sl=0; for (int j = 0; j < t; j++) { if ((st >> j) % 2 == 1) val...
ALGO
0.999931
4.474382
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-05-09T15:10: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": "1f8ed9c560...
5b1e3e09-4255-4551-aa5d-bd6ca22e3d0c
D-Robotics/hobot_dnn
dnn_node/src/output_parser/segmentation/ptq_yolo8_seg_output_parser.cpp
// Copyright (c) 2024,D-Robotics. // // 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...
DATA
0.930871
6.086254
{ "github_metadata": { "branch": "develop", "commit_count": 295, "repo_created_at": "2024-07-20T16:11:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 17, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a3be92d...
07075171-bc1c-43aa-8372-9671b3af8bf2
Adi1222/Coding-Interview-Preparation
Leetcode/Greedy/1288.cpp
/* Given a list of intervals, remove all intervals that are covered by another interval in the list. Interval [a,b) is covered by interval [c,d) if and only if c <= a and b <= d. After doing so, return the number of remaining intervals */ class Solution { public: static bool mycom(vector<int> &a, vector<int> &b...
ALGO
0.999769
5.564263
{ "github_metadata": { "branch": "master", "commit_count": 308, "repo_created_at": "2020-10-03T07:33:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dc8414ab...
78b598d2-29fc-4891-897e-fa6cc1fc422d
Cyber-SiKu/nowcoder
92-HJ91/92-1.cpp
#include <iostream> #include <vector> using namespace std; class Solution { private: int n, m; int out; public: Solution(/* args */); ~Solution(); void slove(); friend ostream& operator<<(ostream& os, const Solution& s); friend istream& operator>>(istream& is, Solution& s); }; Solution:...
ALGO
0.999968
3.614462
{ "github_metadata": { "branch": "master", "commit_count": 304, "repo_created_at": "2019-06-27T06:46:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "39870132...
20f1c8ad-e06f-4bad-8099-8f3396e6733f
kairadiant/CS211Projects
CS211eightQueensBoards.cpp
/* <NAME> CSCI 211 21D Assignment 10 */ #include <iostream> #include <cmath> #include <cstdlib> using namespace std; bool ok(int q[], int c){ //same ok function for(int i=0;i<c;i++){ if(q[i]==q[c]||(c-i)==abs(q[c]-q[i])){ return false; } } return true; } void print(int q[]){ static int s=1; typedef ch...
ALGO
0.998847
3.657566
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-03-12T00:34: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": "e8ec27b4d2e9...
fadce466-5ef7-4a29-abfc-087864df7a17
secret-snail/localization-server
test/common-test/cleartext-ref/matmult.hpp
#pragma once #include <algorithm> #include <cassert> // M mxn // N mmxnn // res mxnn template <typename T> void matmult(T* M, int m, int n, T* N, int mm, int nn, T* res) { (void)mm; assert(n == mm); for (int i = 0; i < m; i++) { // row for (int j = 0; j < nn; j++) { // col res[i * nn + j] = 0; ...
ALGO
0.992188
5.743267
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2022-10-10T00:16:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ff54a12973a...
afd1ce81-99b7-4b59-9262-2d62b8e5d03b
frankbozar/Competitive-Programming
Team Competition/ITSA2017/A7.cpp
#include<cstdio> #include<cstring> #include<vector> #include<algorithm> using namespace std; const int INF=1000; vector<vector<int>> e; int a[64][2][2][3][2][3]; int solve(int u, int ustat, int p, int pstat, int pneed, int pexac, int bstat) { bstat=min(bstat, 2); int& ans=a[u][ustat][pstat][pneed][pexac][bstat...
ALGO
0.999618
3.882523
{ "github_metadata": { "branch": "master", "commit_count": 133, "repo_created_at": "2016-12-01T17:21: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": "3d5dc5f0...
04839897-3863-414f-9190-cb58f9a1383e
ishandutta2007/codeforces-a
akim/normal/6/A.cpp
#include <algorithm> #include <iostream> #include <sstream> #include <utility> #include <cstdlib> #include <cstring> #include <cassert> #include <cstdio> #include <string> #include <vector> #include <queue> #include <cmath> #include <ctime> #include <stack> #include <map> #include <set> using namespace std; #define p...
ALGO
0.999395
3.851274
{ "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": "2c15b2dfe1b5...
03b85e65-930d-441f-a8ef-338e6e5af6cf
QuICC/QuICC-Solver
Components/Framework/include/QuICC/Generator/States/broken/CartesianExactScalarState.hpp
/** * @file CartesianExactScalarState.hpp * @brief Implementation of the equation to generate exact scalar states in a cartesian geometries */ #ifndef QUICC_EQUATIONS_CARTESIANEXACTSCALARSTATE_HPP #define QUICC_EQUATIONS_CARTESIANEXACTSCALARSTATE_HPP // Configuration includes // // System includes // #include <me...
ALGO
0.985104
6.011765
{ "github_metadata": { "branch": "main", "commit_count": 238, "repo_created_at": "2025-02-05T09:15:26.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 11, "pull_requests": 8 }, "file_meta": { "content_id": "1b13408c6b...
fb21b4a0-81c9-4dbd-ba1e-f98a97801747
nkn0506/CodeIt
20_count_inversions.cpp
/* Given an array of integers. Find the Inversion Count in the array. Inversion Count: For an array, inversion count indicates how far (or close) the array is from being sorted. If array is already sorted then the inversion count is 0. If an array is sorted in the reverse order then the inversion count is the maximum...
ALGO
0.9999
5.985085
{ "github_metadata": { "branch": "main", "commit_count": 106, "repo_created_at": "2022-05-14T09:36: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": "3e32aee687...
a7bf27df-7178-493b-8db8-847752e9d5e7
ailanzas/Logyalg_corte3
ejercicio2.cpp
/*Dado el nombre de un mes y si el anio o no es bisiesto, deducir el numero de dias del mes*/ #include <iostream> using namespace std; #include <iostream> using namespace std; int main() { int anio, mes, dias; cout << "Ingrese un año: "; cin >> anio; for (int i = 0; i < 1; i++){ bool bisiesto...
ALGO
0.984913
4.038833
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-04-11T15:24: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": "9e14cce9426c...
fce2ac18-dd30-4598-bbf7-19c182d172ce
Espebaum/baaaaaaaarkingdog_is_god
random/플로이드_2.cpp
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <stack> #include <queue> #include <deque> #include <map> #include <list> #include <utility> #include <cmath> #include <tuple> #define all(x) (x).begin(), (x).end() #define rep(i, a, b) for (int i = (a); i < (b); ++i) typedef long long...
ALGO
0.999977
3.861787
{ "github_metadata": { "branch": "main", "commit_count": 72, "repo_created_at": "2023-01-19T07:50: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": "bee3e87108f...
4235a012-2411-4a3e-abcf-a812c9bed4e1
ankursinha03/Competitive_Programming
algos/importnat/strings/palindromeCheck.cpp
#include <bits/stdc++.h> using namespace std; int isPalindrome(string A) { const int n = A.length(); int s = 0; int e = n - 1; while (s < e) { if (!isalnum(A[s])) { s++; } if (!isalnum(A[e])) { e--; } char p = tolower(A...
ALGO
0.999993
4.707305
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2021-07-31T19:11: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": "4cfc94694cd4...
ab2aac4c-9bef-48bb-9727-268f290afe8b
Eae02/convex-hull-exjobb
src/implementations/quickhull_avx2.cpp
#include "../point.hpp" #include "simd_utils.hpp" #include <algorithm> #include <vector> #include <span> #include <cmath> #include <thread> #include <iostream> #include <iomanip> #include <list> #include <mutex> #include <cassert> struct points { __m256d* x; __m256d* y; uint32_t vcount; uint8_t skipFirst; uint8_...
ALGO
0.999783
5.295452
{ "github_metadata": { "branch": "main", "commit_count": 139, "repo_created_at": "2023-01-24T12:33: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": "fadbda6a8b...
460a8890-567c-4290-93cf-a80472e73747
rough2002/DSA_Solutions
binary-search/binary-search.cpp
#include <iostream> #include <vector> using namespace std; int binarySearch (vector<int> arr , int k) { int n = arr.size(); int low = 0 , high = n-1; while (low <= high) // mistake { int mid = (high + low) /2; if(k == arr[mid]){ return mid; } else if...
ALGO
0.99994
5.258492
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2025-04-27T05:30: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": "89ff0228449...
8e29c542-8377-4e16-b402-69dc80960206
dnr2/maratona
URI/1001 - Extremely Basic.cpp
//https://www.urionlinejudge.com.br/judge/en/problems/view/1001 //#tag ad hoc //#sol sum the two numbers #include <cstdio> #include <cstring> #include <string> #include <cmath> #include <cstdlib> #include <iostream> #include <algorithm> #include <vector> #include <vector> #include <queue> #include <list> #include <sta...
ALGO
0.996357
3.180369
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2013-08-18T19:15:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0ddce1ee...
ac463acf-fac9-4e89-b6b6-41c247e976c9
a00012025/Online_Judge_Code
Zerojudge/d965(2).cpp
#define NDEBUG #ifdef NDEBUG #define debugf(...) ((void)0) #else #define debugf(...) printf(__VA_ARGS__) #endif // NDEBUG #include<bits/stdc++.h> using namespace std; int n,m,a[2001],tmp[2001],dp[2001][2001] ; int ST[20000],tag[20000] ; void modify(int l,int r,int L,int R,int id,int val) { if(l==L && r==R) {ST[id]...
ALGO
0.99995
4.050148
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2015-10-10T22:44: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": "220cce30af...
c0313787-1c11-4f03-8f99-74f951783075
HISKP-LQCD/Z2-phi4
modules/mutils.cpp
/******************************************************************************* * * File mutils.h * * Copyright (C) 2005, 2007, 2008, 2011, 2012, 2013 <NAME> * * This software is distributed under the terms of the GNU General Public * License (GPL) * * Utility functions used in main programs. * * The externally acces...
TOOL
0.936803
5.710642
{ "github_metadata": { "branch": "master", "commit_count": 267, "repo_created_at": "2020-11-20T16:34:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "de4c52a3b...
8b06a2c3-061d-474c-badb-4f60c5e7a86a
Jayant-001/DSA-using-CPP
New/stack/trappingRainWater.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; // Input format : // 6 // 3 0 0 2 0 4 int main() { int n; cin >> n; vector<int> arr(n); for(int i = 0; i < n; i++) { cin >> arr[i]; } vector<int> maxL(n); vector<int> maxR(n); vector<int> res; // finding maximum number in le...
ALGO
0.999986
4.711755
{ "github_metadata": { "branch": "master", "commit_count": 84, "repo_created_at": "2021-05-10T18:37: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": "99766c373...
dccc8c2b-42a6-4faf-b02b-86b878815288
maximesong/basketball
src/modeling.cpp
#include "modeling.h" #include <iostream> using namespace std; Ball calculateXyFallingBall(const Ball &ball, const Env &env, double t) { Ball next_ball; next_ball.r = ball.r; next_ball.weight = ball.weight; next_ball.m_coefficient = ball.m_coefficient; next_ball.restitution_coefficient = ball.restitution_coeffic...
ALGO
0.99884
4.426904
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2012-03-29T01:33:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6dc3aacef...
e5369a63-4e8b-44fb-8a31-8a3a42afa12a
AlexGabi17/leetcode
234-palindrome-linked-list/palindrome-linked-list.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: bool isPalindrome(Lis...
ALGO
0.999607
6.078841
{ "github_metadata": { "branch": "main", "commit_count": 174, "repo_created_at": "2024-02-17T12:01: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": "f69d74c614...
5e2cea93-c69d-4977-abe4-4a2b0a926f59
aulasau/BSU.Magistracy
Language R/CPlusPlusForR/CforR.cpp
#include <Rcpp.h> #include <iostream> #include <vector> #include<cmath> using namespace std; bool is_prime(long long n){ bool flag=true; for(int i = 2; i <= sqrt(n); i++) { if(n % i == 0) { flag = false; break; } } return flag; } // [[Rcpp::export]] vector<long long>...
ALGO
0.99963
5.053395
{ "github_metadata": { "branch": "master", "commit_count": 95, "repo_created_at": "2020-10-31T17:03: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": "64d65c7f8...
1c87eff1-978d-4229-b63b-b28221d0e714
suraj-iitb/algorithm-identification
BERT/Data_Dump/Bubble/C++/Code/bubble4692085.cpp
#include <iostream> #include <cmath> #include <vector> #include <string> #include <algorithm> void print_state(int* A, int N) { for (int i=0; i<N-1; i++) { std::cout << A[i] << " "; } std::cout << A[N-1] << std::endl; }; void swap(int* a, int* b) { int tmp = *b; *b = *a; *a = tmp; }; ...
ALGO
0.999802
4.313305
{ "github_metadata": { "branch": "main", "commit_count": 229, "repo_created_at": "2020-05-24T06:21:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 2, "pull_requests": 10 }, "file_meta": { "content_id": "518d1d66c...
8de39468-462b-4c69-8e81-5e69b8b5aece
mfem/mfem
examples/ex19.cpp
// MFEM Example 19 // // Compile with: make ex19 // // Sample runs: // ex19 -m ../data/beam-quad.mesh // ex19 -m ../data/beam-tri.mesh // ex19 -m ../data/beam-hex.mesh // ex19 -m ../data/beam-tet.mesh // ex19 -m ../data/beam-wedge.mesh // ex19 -m ../data/beam-quad-amr.me...
ALGO
0.976698
5.927034
{ "github_metadata": { "branch": "master", "commit_count": 24273, "repo_created_at": "2015-06-11T21:42:21.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1934, "forks": 544, "issues": 96, "pull_requests": 189 }, "file_meta": { "content_id": ...
eac00074-ddab-4b3c-bba5-71230dcea54d
myunbin/algorithm-BOJ
Code/1194.cpp
#include <bits/stdc++.h> using namespace std; const int MAX_N = 51; struct t { int x, y, k; }; int n, m; int dirx[] = {1, -1, 0, 0}; int diry[] = {0, 0, 1, -1}; int dist[MAX_N][MAX_N][1 << 6]; bool visited[MAX_N][MAX_N][1 << 6]; string s[MAX_N]; void bfs(int sx, int sy) { queue<t> q; q.push({sx, sy, 0}); visited[sx...
ALGO
0.999874
3.842284
{ "github_metadata": { "branch": "master", "commit_count": 510, "repo_created_at": "2020-03-10T16:50: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": "9c29e1fe...
05784e61-066c-41e8-9f8e-a6d3f8120a5a
JagmeetGurm/CPlusPlusProjects
SumPrimes/SumPrimes/SumPrimes.cpp
// SumPrimes.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> //using namespace std; //program to give sum of first 1000 primes int main() { int sum; //int variable to hold sum of primes sum = 5; //2 and 3 are already added bool t = true; int count = 2; //2,3...
ALGO
0.99895
3.783774
{ "github_metadata": { "branch": "master", "commit_count": 471, "repo_created_at": "2015-07-17T00:04: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": "8727a046...
c8ed48f9-3262-4199-b1e8-cef1714f2e6a
HarryLiker/Algorithms
SampleSearch/KMP-Search.hpp
#pragma once #include <vector> #include "TWord.hpp" #include <iostream> #include <sstream> std::vector<unsigned long long> PrefixFunction(const std::vector<TWord> &text) { std::vector<unsigned long long> prefix_vector(text.size()); for (unsigned long long i = 1; i < text.size(); i++) { prefix_vector...
ALGO
0.993716
4.624029
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2021-01-01T10:56: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": "535e8a64cbc8...
aaab97b0-8248-45b5-9f25-d43b286025a4
YZH-bot/SLAM_NOTED
floam/src/lidarOptimization.cpp
// Author of FLOAM: <NAME> // Email <EMAIL> // Homepage https://wanghan.pro // info: 向量求导知识: https://blog.csdn.net/qfikh/article/details/103102216 #include "lidarOptimization.h" EdgeAnalyticCostFunction::EdgeAnalyticCostFunction(Eigen::Vector3d curr_point_, Eigen::Vector3d last_point_a_, Eigen::Vector3d last_point_...
ALGO
0.998968
3.792884
{ "github_metadata": { "branch": "master", "commit_count": 175, "repo_created_at": "2024-01-08T08:29:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 51, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fdcd94f...
c2c9ca52-a70f-4a4e-ae0e-f15acc63e6b3
Sasso0101/Uni
Computer Programming 1/06 Functions 2/normalizeTime.cc
#include <iostream> using namespace std; int division(int dividend, int divisor, int& rest) { int remaining = dividend - divisor; if (divisor == 0) { cout << "Can't divide by 0!" << endl; return 0; } else if (dividend < divisor) { rest = dividend; return 0; } else if (remaining < divisor) { rest = remai...
ALGO
0.987706
4.036071
{ "github_metadata": { "branch": "main", "commit_count": 225, "repo_created_at": "2022-09-22T08:43: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": "28c8bf18d6...
6ebd1d09-2492-4ce4-8e75-10ad74165f28
neng2/Programming
Algorithm/C/10828_스택.cpp
#include <iostream> #include <string> #include <stdlib.h> using namespace std; typedef struct NODE { int data; // 스택 데이터 저장 공간 NODE *ptr_prev; // 다음 스택이랑 연결할 포인터 }NODE; typedef struct STACK { int len; // 스택 크기 저장할 변수 NODE *top; // 가장 위에 있는 스택과 연결할 포인터 }STACK; int main() { int n; STACK *a = NULL; // 스택 선언 a =...
ALGO
0.995621
3.977118
{ "github_metadata": { "branch": "main", "commit_count": 37, "repo_created_at": "2024-03-11T08: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": "42a7843124d...
5567a789-cf08-4efc-9103-53f08c7e7120
niuxu18/simplex
src/dualSimplex.cpp
#include "dualSimplex.h" using namespace std; void dualSimplex::setMatrix(int row, int vars, const double** data) { num_row = row; num_variable = vars; num_col = 1 + num_variable + num_row - 1; // b + variable + relaxation cout << "reading from data matrix: " << row << ", col:" << num_col << endl; ...
ALGO
0.992674
4.341578
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-02-27T08:39: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": "7e7f6f885f...
dd68cfbf-0573-43ba-bd2f-9f1028200ee8
mylinh030203/CTDL-GT
Lab2/BT1.cpp
#include <bits/stdc++.h> using namespace std; struct Dateofbirth { int ngay; int thang; int nam; }; struct SinhVien { string ten; Dateofbirth namsinh; double dToan; double dLy; double dNgoaingu; }; typedef struct node *pnode; struct node { SinhVien data; pnode Next; }; pnode crea...
TOOL
0.967423
3.797446
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-04-30T12:31:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7b99a68698ce...
96bf8901-f442-4061-8240-d637d9244e82
tshu-w/ICPC
training/Uva/12171.cpp
// written at 16:49 on 09 Aug 2017 #include <bits/stdc++.h> #define IOS std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); #define filename "" #define setfile() freopen(filename".in", "r", stdin); freopen(filename".ans", "w", stdout); #define resetfile() freopen("/dev/tty", "r", stdin); f...
ALGO
0.999492
3.792108
{ "github_metadata": { "branch": "master", "commit_count": 269, "repo_created_at": "2016-04-24T03:41:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 154, "forks": 33, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b4e86...
c854a529-2e16-44ee-b9a5-c4f0ae86f579
ronakgadhiya09/MyCodeLibrary
fenwickTree.cpp
#include<bits/stdc++.h> using namespace std; class fenwickTree { private: vector<int>fen; int size; public: fenwickTree(int N); ~fenwickTree(); void update(int index,int addVal){ while(index < size){ fen[index] += addVal; index += (index&(-index)); } } ...
ALGO
0.999958
5.693386
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-15T11:26: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": "d63929228604...
4c6e3113-5824-4856-afbd-635150f03dab
KarTaGo124/Algorithms-And-Data-Structures
4-stack/Stack.cpp
// // Created by <NAME> on 19/01/2025. // #include <iostream> using namespace std; template <typename T> class Stack { private: T *arr; int topIndex; int capacity; public: explicit Stack(int size) { capacity = size; arr = new T[capacity]; topIndex = -1; } ~Stack() { ...
ALGO
0.94243
5.540354
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2025-01-07T03:57: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": "8779d0fc79a...
b810a2e0-a82c-4803-9852-3c4eea309e6b
noahyzhang/2023_algorithm
其他问题/手机验证码.cpp
#include <string> #include <iostream> #include <unordered_map> // leetcode:https://leetcode.cn/problems/design-authentication-manager/description/ // 哈希表的思路 // 这个实现并没有删除过期节点的功能 class AuthenticationManager { public: explicit AuthenticationManager(int timeToLive) { time_to_live_ = timeToLive; } voi...
ALGO
0.996301
5.872756
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2023-02-27T04:33: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": "f321e652b...
9dcebeb7-5149-4773-9816-63d3a310a019
Goshenkata/vrp
euclidean_solver.h
#ifndef EUCLIDEAN_SOLVER_H #define EUCLIDEAN_SOLVER_H #include <vector> #include <map> #include <cmath> using namespace std; struct Point { int id; double x; double y; }; class EuclideanSolver { public: // Method to solve the Vehicle Routing Problem for multiple vehicles static vector<vector<int...
ALGO
0.999906
6.767146
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-04-02T17:40:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "58772da697cd...
31ef8688-6314-44ae-ab95-75e95410c56d
Coach-Academy/Winter-2-2023
Level 2/Class 2/Practice G1/Week 11/G.cpp
#include<bits/stdc++.h> #define ll long long #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cout.tie(nullptr); cin.tie(nullptr); int t; cin >> t; while (t--) { int n,k; string a,b; int freqa[30]={},freqb[30]={}; cin >...
ALGO
0.999956
4.314695
{ "github_metadata": { "branch": "main", "commit_count": 527, "repo_created_at": "2023-11-22T17:57:02.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "bd3e19490b1...
b76d3b1f-1676-45b8-9fe8-6ad57087ff84
0-jij-0/CompetitiveProgramming
Problems Archive/0000 - 0999/0288 - Equalize Them All.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; vector<int> freq, v; int main() { int n; cin >> n; v.resize(n); freq.resize(200001, 0); for (int i = 0; i < n; i++) { cin >> v[i]; freq[v[i]]++; } int max = max_element(freq.begin(), freq.end()) - freq.begin(); int idx = find(v.be...
ALGO
0.999826
3.133283
{ "github_metadata": { "branch": "main", "commit_count": 256, "repo_created_at": "2021-02-01T07:57:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 14, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "81df1425c...
05d54b3e-be62-464e-bf92-4abcc138e3dc
andasulca/lu
AlPr/Lab-F18/LabF18/main.cpp
/*************** <NAME>, as21271 F18. Create program to read given text file and print into another text file number of words by length. Count all one-letter words, all two-letter words, all three-letter words, ... and print number of words into output file. Word in input file is string separated with space or separa...
TOOL
0.965663
4.065016
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2021-09-22T07:04: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": "0e36fa5837d...
cad32f88-0acc-449e-b815-05019ee65c8b
vikash000x/DS---ALGO
graph/BFS_DFS/2360. Longest Cycle in a Graph.cpp
Input: edges = [3,3,4,2,3] Output: 3 Explanation: The longest cycle in the graph is the cycle: 2 -> 4 -> 3 -> 2. The length of this cycle is 3, so 3 is returned. Example 2: Input: edges = [2,-1,3,1] Output: -1 Explanation: There are no cycles in this graph. int result = -1; void dfs(int u, vector<int>& edg...
ALGO
0.999874
5.063808
{ "github_metadata": { "branch": "main", "commit_count": 41, "repo_created_at": "2024-02-04T18:31: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": "6c4870b3c89...
7089fb21-4b16-45f3-bac3-b17e2f099136
CodeName-Detective/OpenMP_Shared_Memory_Systems_NUMA_PDP
pi_numerical_methods/pi_v1_false_share_sync.cpp
#include <omp.h> #include <iostream> #define NUM_THREADS 8 static long num_steps = 100000000; double step; int main(){ int n_threads_heap; // False sharing happens because we created sum as array previously to preven to this here we used singl variable // to prevent Race condtion we use syncin...
ALGO
0.999769
4.354226
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-06-28T22:25:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0f4d536cae7...
880dd1ec-cd15-4d92-92f9-b9ffa5281b05
mirsking/mirsking_leetcode
medium173_BST_iterator/medium173_BST_iterator.cpp
#include <iostream> #include <vector> using namespace std; /** * Definition for binary tree */ struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; class BSTIterator { public: BSTIterator(TreeNode *root) { initNexts(root); } ...
ALGO
0.999993
5.552146
{ "github_metadata": { "branch": "master", "commit_count": 245, "repo_created_at": "2015-06-11T11:10: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": "c3564478...
43707452-e214-471e-a2bf-05d37e8986c4
emakryo/cmpro
src/arc77/d.cpp
#include<iostream> #include<iomanip> //#include<cstdio> #include<vector> #include<map> #include<queue> #include<algorithm> #include<cmath> #include<cassert> using namespace std; typedef long long ll; const int Nmax = 100000; const ll P = 1000000007; int N; int A[Nmax+1]; ll fact[3*Nmax]; ll ext_gcd(ll a, ll b, ll &x, ...
ALGO
0.999946
3.473788
{ "github_metadata": { "branch": "master", "commit_count": 264, "repo_created_at": "2017-01-24T09:57: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": "8f6403fd...
b968cb4b-b80f-4d75-a27f-1f110c24e33d
Darren2340/local_gnuradio
gnuradio/gr-digital/lib/mpsk_snr_est_cc_impl.cc
/* -*- c++ -*- */ /* * Copyright 2011,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your...
TOOL
0.9817
7.491275
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2014-07-14T23:30: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": "2d3e2b66ac...
e2489089-c339-45ea-ba29-1ba3f3cc88af
YooKyubin/algorithm
도시_분할_계획.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; struct Edge { int a; int b; int wieght; }; bool operator<(const Edge& a, const Edge& b) { return a.wieght < b.wieght; } int n, m; vector<int> head; void Init() { for (int i=0; i<=n; ++i) { head[i] = i; ...
ALGO
0.999982
4.740132
{ "github_metadata": { "branch": "master", "commit_count": 324, "repo_created_at": "2022-09-18T13:11: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": "ecd5f680...
fda070ac-5aeb-4c79-a318-d6afcd89a1fc
Socialfew146575/DSA
Heaps/09-Merge-K-sorted-array.cpp
#include <bits/stdc++.h> using namespace std; class node { public: int data; int row; int col; node(int data, int row, int col) { this->data = data; this->row = row; this->col = col; } }; class compare { public: bool operator()(node *a, node *b) { retu...
ALGO
0.999989
5.36902
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2022-09-25T19:27: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": "78d6ddebe91...
c0be92d0-7205-47d7-a132-47917300eeb2
antodld/pendulum_feasibility_solver
src/feasibility_solver.cpp
#include "../include/pendulum_feasibility_solver/feasibility_solver.h" #include "../include/pendulum_feasibility_solver/polygons.h" // #include <ScsEigen/Solver.h> bool feasibility_solver::solve(double t,double t_lift, bool dbl_supp, const Eigen::Vector2d & dcm, const Eigen::V...
ALGO
0.998524
4.543892
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2023-02-22T12:26:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b3958c755...
6e5811cf-5303-43a2-a070-52296eff5548
shuo-young/BlockWatchdog
gigahorse-toolchain/souffle-addon/num256.cpp
#include <string.h> #include <set> #include <boost/multiprecision/cpp_int.hpp> #include <boost/algorithm/string/join.hpp> #include <boost/algorithm/string.hpp> #include <iostream> using namespace boost::multiprecision; using namespace std; #define STRING_LEN 67 // 2 (for "0x") + 1 (for '\0') + 64 bytes for // ...
ALGO
0.962027
3.984299
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2023-08-02T09:02:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "03addd85...
98e92cfa-8fae-44ca-ab85-b68c533444b0
karygauss03/Competitive-Programming
Contests/Codeforces/Codefroces Round #719 (Div3)/CF1520-F2.cpp
//KARYGAUSS03 #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<ll> vl ; typedef pair<ll,ll> pl; #define mp make_pair #define pb push_back #define fi first #define se second #define all(v) (v).begin(),(v).end() #define rall(v) (v).rbegin(),(v).rend() #d...
ALGO
0.999863
3.46726
{ "github_metadata": { "branch": "main", "commit_count": 58, "repo_created_at": "2021-04-20T20:53:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "27711f8076c...
1e482968-e15c-43aa-8e62-7eb71d200388
Ashif29/Compititive-Programming
Codeforces/B_GCD_Length.cpp
/** * author: Asif * created: 00.03.2021 00:00:00 **/ #include <bits/stdc++.h> using namespace std; #define FOR(i, j, k, in) for (int i = j; i < k; i += in) #define RFOR(i, j, k, in) for (int i = j; i >= k; i -= in) #define REP(i, j) FOR(i, 0, j, 1) #define RREP(i, j) RFOR(i, j, 0, 1) #define INF (int)1e9 ...
ALGO
0.999871
3.704823
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2021-07-29T07:28: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": "dd4667f74a7...
9f7001ad-27b7-465a-8889-2bf689b1d3d2
yangjufo/LeetCode
2021/265. Paint House II.cpp
class Solution { public: int minCostII(vector<vector<int>>& costs) { int k = costs[0].size(); vector<int> dp(k, 0); int prevFirst = 0, prevSecond = 0, currFirst = 0, currSecond = 1; for (int i = 0; i < costs.size(); i++) { vector<int> next(k, INT_MAX); for (in...
ALGO
0.999987
5.81489
{ "github_metadata": { "branch": "master", "commit_count": 1058, "repo_created_at": "2018-03-25T13:07: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": "8905eae...
a31bb31e-d396-4f8b-9eb7-332948488ca4
ujunhwan/algorithms_cpp
BAEKJOON/DP/17070.cpp
// https://www.acmicpc.net/problem/17070 // 17070번 파이프 옮기기 #include <bits/stdc++.h> #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define decimal cout << fixed; cout.precision(6) using namespace std; typedef long long ll; typedef pair<int, int> pii; static const int INF = 0x7f7f7f7f; int n, a...
ALGO
0.99991
4.35709
{ "github_metadata": { "branch": "master", "commit_count": 374, "repo_created_at": "2020-02-26T12:18: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": "8b18c432...
5ca5e569-1d69-4840-b8d1-832c60e0c555
CodeX-Addy/Leetcode-Questions
Arrays & Strings/LeetCode_33.cpp
class Solution { public: int pivot(vector<int>&arr){ int s = 0, e = arr.size()-1; while(s<=e){ if(s==e) return s; int mid = s + (e-s)/2; if(mid-1>=0 && arr[mid] < arr[mid-1]) return mid - 1; else if(mid+1<arr.size() &&...
ALGO
0.999998
5.971582
{ "github_metadata": { "branch": "main", "commit_count": 212, "repo_created_at": "2023-01-05T14:46:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "500cfa2ff3...
8ac354d4-99c6-4ec7-aff8-f686bb193543
alenmarz/diht-algorithms-3sem
first_module/first/PrefixFunctionSearcher.cpp
//#include <istream> //#include <ostream> //#include <fstream> #include <iostream> #include <vector> #include <string> const size_t BUFFER_SIZE = 1024; class PrefixFunctionSearcher { public: PrefixFunctionSearcher(const std::string & pattern) : pattern_(pattern + '#'), prefix_function_(patter...
ALGO
0.993409
5.497437
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2018-02-20T13:08: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": "e8f24f5a9...
8245eb4b-75ce-4872-bfa5-788294d81e1b
h2h-park/Algorithms
Articulation_Point.cpp
//https://www.acmicpc.net/problem/11266 #include <stdio.h> #include <vector> #include <algorithm> #define MAX 10010 std::vector<int> vec[MAX]; std::vector<int> cut; int n, m, cnt; int num[MAX]; int dfs(int now, int par, int root) { bool flag = false; num[now] = ++cnt; int ret = num[now]; int tmp = 0; for (int...
ALGO
0.999966
4.026608
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2018-12-30T23:09:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f123369ca...
8c10dffb-dbc2-4aaa-8b52-7f989a2b2124
zoid/ztl
container/heap.hpp
#ifndef _heap_hpp_1337420 #define _heap_hpp_1337420 #include "../ztl_base.hpp" #include "../core/algorithm.hpp" #if _stl_use_containers #include <vector> #else #include "vector.hpp" #endif __ztl_namespace_start template<class T, class Compare = less<T> > class heap { public: typedef size_t size_type; heap() ...
ALGO
0.953221
5.448555
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2016-03-25T12:25: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": "acc76785d...
29c0a757-1d61-462d-a515-48d7f4e92612
ymd45921/HUST-ACM-training
vjudge/2020三月校内赛/problemSet361248/try/I.cpp
/** * * 这是一个最小Steiner Tree的问题 * * 给了两种解题方法 * * * 先不管什么Steiner Tree,这个是不是bfs就好了? * * 正确性:如果在一条路上怎么回头路?一定存在按照顺序的演进方法更新这种情况 */ #include <iostream> #include <cstdio> #include <cstring> #include <queue> #include <algorithm> #define norm 0 #define iron 1 #define coal 2 using namespace std; typedef long long longs...
ALGO
0.999851
3.409161
{ "github_metadata": { "branch": "master", "commit_count": 423, "repo_created_at": "2020-12-02T04:26: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": "1abec5ec...