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
4144617c-19aa-407b-b94b-ca13a2cddb0d
ASSERT-KTH/Supersonic
predictions/supersonic_predicted_submissions/Codenet/p01564/499411287/7.cpp
#include <algorithm> #include <array> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <unordered_map> #include <unordered_set> #include <valarray> #include <vector> using namespace s...
ALGO
0.99997
4.945354
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-02-03T10:33:34.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1fd1aa05e1604...
eba8fb17-dea0-4506-ba0c-4bbc0e62cfdd
hitesh11tahiliani/DSA-Leetcode
732-my-calendar-iii/732-my-calendar-iii.cpp
// Time Complexity: O(N ^ 2) // Space Complexity: O(N) class MyCalendarThree { public: // finding number of overlapping elements at time points -> line sweeping MyCalendarThree() {} int book(int start, int end) { // new event starts here -> increase by 1 lines[start]++; // the e...
ALGO
0.999932
6.081018
{ "github_metadata": { "branch": "main", "commit_count": 1049, "repo_created_at": "2022-09-26T18:23:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5c46eeabb...
bf75f3ce-d565-4bd1-9018-6cfbb24d4591
princeb612/hotplace
sdk/base/nostd/pq.hpp
/* vim: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab smarttab : */ /** * @file {file} * @author <NAME> (<EMAIL>) * @desc * * Revision History * Date Name Description * */ #ifndef __HOTPLACE_SDK_BASE_NOSTD_PRIORITYQUEUE__ #define __HOTPLACE_SDK_BASE_NOSTD_PRIORITYQUEUE__ #include <...
ALGO
0.986543
5.75792
{ "github_metadata": { "branch": "master", "commit_count": 608, "repo_created_at": "2023-07-30T09:18: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": "ff724ed9...
6f2b4928-678c-49d7-9aaf-e432574b4724
kuisskui/data_structure_and_algorithm
grader/last_one.cpp
#include <iostream> using namespace std; void check_tt(int a[], int *tt, int n) { if (*tt >= n) { *tt %= n; } while (a[*tt] == 0) { (*tt)++; if (*tt >= n) { *tt %= n; } } } int main() { int n, t, tt; cin >> n >> t; int a[n]; int i = 0; while (i < n) { i++; a[i]...
ALGO
0.999971
3.323688
{ "github_metadata": { "branch": "main", "commit_count": 56, "repo_created_at": "2022-09-22T15:03:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e4cc7885089...
edebf33d-9d6a-476b-87ac-3bd212ee3bea
brankarios/Practice-and-Leetcode
C++/AyP/C3P7.cpp
/*Escriba un algoritmo que reciba como entrada un fecha (día y mes) del año actual e imprima por pantalla el número de días transcurridos desde el 1ro de Enero*/ #include <iostream> using namespace std; int main(){ int day, month, days_passed; cout << "Introduzca una fecha, primero el dia: " << endl; cin >>...
ALGO
0.993879
3.700861
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2023-11-23T20:58: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": "520e7925803...
6841f446-c7e6-4fc2-ab82-33fb224d934e
gnahtb/Code-Archive
CP/Codeforces/1493D.cpp
#include <bits/stdc++.h> #define sz(a) (int)a.size() using namespace std; using ll = long long; const int LIM = 2e5; const int N = 2e5 + 2; const ll MOD = 1e9 + 7; ll power(ll x, ll y) { if (y == 0) return 1; ll z = power(x, y / 2); (z *= z) %= MOD; if (y % 2 != 0) (z *= x) %= MOD; return z; } ...
ALGO
0.999954
4.585032
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2021-07-22T18:42: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": "4ea0690f1e7...
64b3df37-c576-4adf-be55-ee6e2c7990e0
vchong/sha256
wiki_segfault.cpp
#include <cstdlib> #include <cstring> // memcpy, memset #include <string> #include <iostream> using namespace std; #define ROL(v, c) (((v) << (c)) | ((v) >> (32 - (c)))) #define ROR(v, c) (((v) >> (c)) | ((v) << (32 - (c)))) #if 1 // len usually does not include null terminator; o1 is the most significant dword, 07 ...
ALGO
0.989988
4.800001
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2016-09-02T06:39: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": "06d170998c...
85a71f76-4df5-43c3-9eb7-75ca4d4ee5e0
devmehta29/advanced_algorithms
03.cpp
/* Input 6 0 16 13 0 0 0 0 0 10 12 0 0 0 4 0 0 14 0 0 0 9 0 0 20 0 0 0 7 0 4 0 0 0 0 0 0 Output 23 */ #include <iostream> #include <vector> #include <queue> #include <climits> #include <cmath> using namespace std; bool bfs(vector<vector<int> >& rg, int source, int sink, vector<int>& parent){ queue<int> q; vector<bo...
ALGO
0.99999
4.568445
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-08-05T03:54: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": "bc7934da92d...
b4e7d001-f98a-4c74-ab58-8693aaf0b1b6
chinmey/practice
graphs/strongly connected component (kosaraju algorithum).cpp
/* used for directed graphs*/ #include <iostream> #include <list> #include <stack> using namespace std; class Graph { int V; // No. of vertices list<int> *adj; // An array of adjacency lists // Fills Stack with vertices (in increasing order of finishing // times). The top element of stack has th...
ALGO
0.999779
6.800438
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-07-09T14:06: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": "a9d0ef86d0...
5a1375aa-6cec-4420-892e-9a87207d5155
debabrota1604/DSA_CPP
ds_tree/c02_p01_binarySearchTree.cpp
// C++ program to insert a Node in a BST #include <bits/stdc++.h> using namespace std; // Given Node struct Node{ int key; struct Node *left, *right; Node(int data):key(data), left(nullptr), right(nullptr){} }; // Function to insert a new Node with given key in BST Node* insert(Node* Node, int key){ // If th...
ALGO
0.99998
4.644795
{ "github_metadata": { "branch": "main", "commit_count": 102, "repo_created_at": "2023-06-16T02:02:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6825cb52c2...
1c17c254-dd65-4f42-9969-296f8115000f
y-yasutomo/competitive-programming
atcoder/c++/_old/ABC058C.cpp
#include <iostream> #include <algorithm> #include <vector> #define rep(i,n) for (int i=0; i < (n); ++i) using ll = long long ; using namespace std; const int INF = 1001001001; int main() { int n ; cin >> n ; vector<int> a(26) ; rep(i,n){ string s ; cin >> s ; vector<int> tmp(2...
ALGO
0.999986
3.499697
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2022-03-26T07:50: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": "ee0ad9d0246...
560461c8-4e6c-4275-b447-4728ae87ad39
KnightChan/LeetCode-cpp
Source/p106 Construct Binary Tree from Inorder and Postorder Traversal.cpp
#include "leetcode.h" /** Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. */ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val...
ALGO
0.999971
6.488502
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2015-03-08T06:15:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bd85ae7a9...
c2c0ca01-acab-4c95-a653-788f9415f23c
marcinms7/Cpp-Algorithms
GraphsTraining/main.cpp
#include <iostream> #include <queue> #include <vector> using namespace std; template< typename T, int columns, int rows > void BFS(int v, T(&array)[columns][rows] ); template< typename T, int columns, int rows > void DFS(int v, T(&array)[columns][rows] ); template< typename T, int columns, int rows > void travelling_...
ALGO
0.999822
3.825644
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2021-07-09T23:21: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": "d0ca062750d3...
ea035883-f0af-4bcb-99bd-1db216d35736
ishandutta2007/codeforces-s
strawberryc/normal/1080/D.cpp
#include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #define For(i, a, b) for (i = a; i <= b; i++) #define Rof(i, a, b) for (i = a; i >= b; i--) const int N = 40; typedef long long ll; int n; ll k, f[N], g[N], p2[N]; bool greaters(ll a, ll b, ll c) { if (c < 0) return 0; ...
ALGO
0.999811
4.001187
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:07:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0893180c72e4...
b4a0fb52-fcb7-4a2d-9cb0-98d138895b4f
gazzsha/CPP-Containers
src/s21_map/iterators_map.tpp
namespace s21 { template <typename key_type, typename mapped_type, typename Comp> IteratorMap<key_type, mapped_type, Comp>::IteratorMap( NodeMap<key_type, mapped_type>* node) : current_node(node) { key_type temp_k = current_node->key; mapped_type temp_v = current_node->value; pairIter = std::make_pair<ke...
ALGO
0.956978
5.736817
{ "github_metadata": { "branch": "develop", "commit_count": 84, "repo_created_at": "2024-02-11T20:56:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0359e1ab...
cee1b2f1-0290-4ba9-9a7f-b1de041a3e62
runner365/LiveVideoCoreSDK
RtmpLivePushSDK/boost/boost/math/special_functions/sign.hpp
// (C) Copyright <NAME> 2006. // (C) Copyright <NAME> 2006. // (C) Copyright <NAME> 2011 (added changesign). // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_M...
ALGO
0.941045
6.542069
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2016-03-03T09:29:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2057, "forks": 595, "issues": 15, "pull_requests": 0 }, "file_meta": { "content_id": "aaf...
1f881a7d-3514-4d60-bc81-16b2f0718e39
VastoLorde95/Competitive-Programming
CodeChef/WF/Easy Medium/DEVGOSTR/A.cc
#include <bits/stdc++.h> #define sd(x) scanf("%d",&x) #define sd2(x,y) scanf("%d%d",&x,&y) #define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z) #define fi first #define se second #define pb push_back #define mp make_pair #define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it) #define _ ios_base::sync_with_s...
ALGO
0.999755
3.35976
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2017-07-25T11:08:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 171, "forks": 41, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "151bbe...
c428432f-c305-4997-9d54-7ddbab6baa8b
secretflow/spu
src/libspu/mpc/cheetah/arithmetic.cc
// Copyright 2021 Ant Group Co., Ltd. // // 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 ...
ALGO
0.992094
6.933699
{ "github_metadata": { "branch": "main", "commit_count": 706, "repo_created_at": "2022-07-02T09:05:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 292, "forks": 135, "issues": 25, "pull_requests": 15 }, "file_meta": { "content_id": "dff01...
460a4d4c-4779-4f0a-b763-37a160a5b18d
hamzashahid456/Data-Structures
Lab Tasks/LabTask5.cpp
// #include <iostream> // using namespace std; // struct BT // { // BT *left, *right; // int value; // BT(int value) // { // this->value = value; // this->left = this->right = nullptr; // } // }; // class BST // { // private: // BT *root; // void Insert(int value, BT *&temp...
ALGO
0.999864
3.43951
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2022-02-11T07:31: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": "948140204dc...
1828d9a2-c691-4513-aafd-ec090c5ff2c8
I-amArnav/SOC-Mastering-Competitive-Programming
Week 3/codeforces/temp.cpp
#include <bits/stdc++.h> using namespace std; int getSum(vector<vector<int>> &pref, int r1, int c1, int r2, int c2, int n, int m) { r1 = max(r1, 0); c1 = max(c1, 0); r2 = min(r2, n - 1); c2 = min(c2, m - 1); if (r1 > r2 || c1 > c2) return 0; return pref[r2 + 1][c2 + 1] - pref[r2 + 1][c1] - pref...
ALGO
0.999754
4.33202
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-06-22T06:27: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": "6fe14322e436...
1412041d-eca4-48db-a938-1f7b3c7b40df
mikgal04/shapes
main_shapes.cpp
#include <iostream> #include <vector> #include <fstream> #include <sstream> class Shape { public: virtual double getArea() const = 0; virtual double getVolume() const = 0; virtual void showInfo() const = 0; }; class Triangle : public Shape { private: double base; double height; public: Tria...
TOOL
0.953673
4.42842
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-03-10T14:27: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": "9a76177dbf7b...
04f7f09f-da52-4168-8f81-5f7bf1f30a1e
alibaba/heterogeneity-aware-lowering-and-optimization
runtime/generic/nn/pooling.cc
//===- pooling.cc ---------------------------------------------------------===// // // Copyright (C) 2019-2020 Alibaba Group Holding Limited. // // 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 ...
TOOL
0.92473
7.068713
{ "github_metadata": { "branch": "master", "commit_count": 973, "repo_created_at": "2020-08-22T04:45:46.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 255, "forks": 75, "issues": 21, "pull_requests": 42 }, "file_meta": { "content_id": "3318...
7e44bcb3-bec4-4e75-a76b-55213c1243c4
dealii/dealii
source/base/polynomials_barycentric.cc
// ------------------------------------------------------------------------ // // SPDX-License-Identifier: LGPL-2.1-or-later // Copyright (C) 2021 - 2024 by the deal.II authors // // This file is part of the deal.II library. // // Part of the source code is dual licensed under Apache-2.0 WITH // LLVM-exception OR LGPL-...
ALGO
0.997849
7.245779
{ "github_metadata": { "branch": "master", "commit_count": 65304, "repo_created_at": "2014-07-17T14:00:26.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1530, "forks": 789, "issues": 533, "pull_requests": 92 }, "file_meta": { "content_id": ...
66c692be-a2dd-4d14-b137-485d0aa7bba4
dokyeonglee/algorithm
BOJ/25049.cpp
#include <iostream> #include <vector> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<int> arr(n + 1); for(int i = 1; i <= n; i++){ cin >> arr[i]; } vector<long long> dp(n + 2); vector<long long> dp2(n + 2); long l...
ALGO
0.999986
3.955148
{ "github_metadata": { "branch": "master", "commit_count": 1717, "repo_created_at": "2021-01-01T10:38: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": "491714c...
500833c9-3d6f-42f8-84fb-128a37a3f597
zjp255/Project3
string/源.cpp
#include<iostream> using namespace std; class MyString { public: char* ch; MyString(string str); ~MyString(); int getLength() { return length; } bool SubString(MyString& ms, int pos, int len) { if (pos > length || pos < 1 || pos + len - 1 > length) return false; for (size_t i = pos; i <= pos + len - ...
ALGO
0.99712
4.012636
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2023-03-19T06:42:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bfd11e9f7f...
ca895afa-4989-4d05-9f63-9601e542da7a
akhilkammila/leetcode-screenshotter
editorial_code/1000-1999/1971. Find if Path Exists in Graph/cpp-2.cpp
class Solution { public: bool validPath(int n, vector<vector<int>>& edges, int source, int destination) { // Store all edges according to nodes in 'graph'. unordered_map<int, vector<int>> graph; for (auto& edge : edges) { int a = edge[0], b = edge[1]; graph[a].push_ba...
ALGO
0.999992
6.649812
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2023-06-02T16:24:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 912, "forks": 294, "issues": 7, "pull_requests": 0 }, "file_meta": { "content_id": "f9f6754...
1c23ad86-50e5-4049-9bf8-3afdf4b5636e
mzl13/Lithium
Src/AmrCore/AMReX_Interp_1D_C.H
#ifndef AMREX_INTERP_1D_C_H_ #define AMREX_INTERP_1D_C_H_ #include <AMReX_FArrayBox.H> #include <AMReX_BCRec.H> #include <AMReX_Vector.H> #include <cmath> namespace amrex { AMREX_GPU_HOST inline Vector<Real> ccinterp_compute_voff (Box const& cbx, IntVect const& ratio, Geometry const& cgeom, Ge...
ALGO
0.999018
6.118392
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2020-01-21T10:19:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "019a657c...
f1b8d8a4-d220-4fd6-b9dd-9529cec33d72
qbammey/ddem
demosaicing_algorithms/aicc/libdemosaicking.cpp
/* * Copyright 2009-2015 IPOL Image Processing On Line http://www.ipol.im/ * * This program 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 of the License, or * (at your option) any late...
ALGO
0.998313
5.686005
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2022-10-30T19:12:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e4f3f726dff...
a23d35cc-e3fc-441d-a121-a921b7a6202c
victorgdc/leetcode-submissions
problems/longest-string-chain/Accepted/3-2-2023, 5_33_32 PM/Solution.cpp
// https://leetcode.com/problems/longest-string-chain class Solution { public: bool check(string s, string t) { if (s.size() != t.size() + 1) return false; int i, j; i = j = 0; while (i < s.size()) { if (j < t.size() && s[i] == t[j]) { i++; j++; ...
ALGO
0.999995
6.302296
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2023-09-11T23:53: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": "7fa39a03ab...
06aed523-2c18-4ee4-9447-d847b2ebb67d
Jasper1467/MyLeetCodeSolutions
cpp/interleaving_string.cpp
#include <string> #include <map> class Solution { public: bool isInterleave(const std::string &s1, const std::string &s2, const std::string &s3) { if (s3.size() != s1.size() + s2.size()) return false; return dfs(s1, s2, s3, 0, 0); } private: std::map<std::pair<int, int>, b...
ALGO
0.998587
5.891711
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-08-29T21:12:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3f674fbd46...
c10494bb-822e-4fac-9478-8ebb22714f2b
sindreoy/MasterProjectCpp
PBModel.cpp
// // Created by <NAME> on 18.03.2018. // #include <gsl/gsl_vector_double.h> #include <gsl/gsl_matrix.h> #include <gsl/gsl_multifit_nlinear.h> #include "PBModel.h" /* Constructors */ PBModel::PBModel() = default; PBModel::PBModel(char const *f, realtype kb1, realtype kb2, realtype kc1, realtype kc2, ...
ALGO
0.993364
3.357331
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2018-03-17T15:09:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6444c74b3...
07e22e7f-19ce-4e64-bfb4-cbbbd282c041
WangLuning/ECE438-Communication-Network
mp4/src/csma.cpp
#include <iostream> #include <fstream> #include <vector> #include <algorithm> #include <random> #include <ctime> using namespace std; class node{ public: int maxbackoff; int backoff; int maxpacket; int packetleft; int numOfCollision; node(int s,int L){maxbackoff = s; backoff = 0; maxpacket = L;...
ALGO
0.998166
3.650279
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-09-15T21:00:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b45bae2ef5...
982236ff-5f24-4cf8-b66f-1f0385a67b95
rafaelcsva/CompetitiveProgramming
code/uva/11728.cpp
//20, 06, 2018, 21:41:00 Rafaelcs cpp #include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long double ld; typedef long long ll; typedef unsigned long long ull; const int N = int(1e4); vector<ll>primes; bool isComposite[N]; ll answer[N]; const ll LIM = 1000; void sieve(){ for(int i ...
ALGO
0.999914
4.280501
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2017-08-30T23:18:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b4158c03c...
96909260-9a99-4108-ac6e-63676a56fb44
IlyaZh/leetcode
heap/973_K_closest_points_to_origin/solution.hpp
// https://leetcode.com/problems/k-closest-points-to-origin/ // 973. K Closest Points to Origin // Given an array of points where points[i] = [xi, yi] represents a point on // the X-Y plane and an integer k, return the k closest points to the origin (0, // 0). // The distance between two points on the X-Y plane is t...
ALGO
0.999989
6.850973
{ "github_metadata": { "branch": "master", "commit_count": 181, "repo_created_at": "2022-07-06T17:39: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": "7e744286...
bc8f5eaa-05a0-4a71-b20d-40dbcc8827fb
Readiz/ProblemSolving
boj_unrated/from20210401/9711.cpp
#include <stdio.h> #ifndef ONLINE_JUDGE #define READIZ_DEBUG #endif #ifdef READIZ_DEBUG #define printd(...) { printf("[DEBUG] "); printf(__VA_ARGS__); printf("\n"); } inline void testInit(char fbasename[]) { char fname[100]; char* ftailname = "_input.txt"; int p; for (p = 0; ...
ALGO
0.999666
4.52358
{ "github_metadata": { "branch": "master", "commit_count": 250, "repo_created_at": "2020-04-18T09:52: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": "ab8c5242...
b9dcf097-395a-4334-aee9-4b07d01b2f3f
Ashai-project/DroneOptimization
test/GA_PARA_speed_test.cpp
#include <iostream> #include <vector> #include <chrono> #include "../src/Cuda/DroneUtil.h" // テストの回数と固定シードのリスト const int testCount = 1; // テスト回数 int N ; //要素数 // 最適解の計算時間を求める関数 void calculateAverageTime() { double totalDuration = 0.0; // 全体の計算時間を保持する変数 std::vector<int> seedList(testCount); for (int i...
ALGO
0.981485
5.777568
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-10-14T06:10: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": "04794fefe72...
449b1422-158e-48ca-bba0-2d875bb2a77f
DepletedPrism/Algorithm-Template
Graph/MST/Boruvka.cpp
// LOJ #123 // DeP #include <cctype> #include <cstdio> #include <algorithm> using namespace std; namespace IO { const int MAXSIZE = 1 << 18 | 1; char buf[MAXSIZE], *p1, *p2; inline int Gc() { return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin), p1 == p2)? EOF: *p1++; } template<typ...
ALGO
0.999991
4.119208
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2020-01-01T08:16:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e426250f3...
5ff8440f-bdf2-42e9-a5a0-b3246e46e1d4
Nelarius/rayfinder
src/common/ray_intersection.cpp
#include "aabb.hpp" #include "bvh.hpp" #include "ray.hpp" #include "ray_intersection.hpp" #include "triangle_attributes.hpp" #include <algorithm> #include <bit> #include <cassert> #include <cmath> #include <cstdint> namespace nlrs { namespace { glm::vec3 offsetRay(const glm::vec3& p, const glm::vec3& n) { constex...
ALGO
0.998841
6.91634
{ "github_metadata": { "branch": "main", "commit_count": 359, "repo_created_at": "2023-10-29T08:57:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 36, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c885eea23...
48c5c398-dfc4-4db6-bc18-f2c380186472
roblox-ui/word-chain
ConsoleApplication1/ConsoleApplication1.cpp
#include <iostream> #include <vector> #include <string> #include <unordered_set> #include <unordered_map> #include <fstream> #include <algorithm> #include <map> #define MAX_ITERS 100 uint64_t make_number(std::string word) { uint64_t number = 0; uint64_t multiplier = 1; for (char c : word) { number += (c - 'a') *...
ALGO
0.999402
4.209711
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-09-02T18:21: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": "77c2c4e9e2...
14016b0f-096a-4423-a369-31a056edaa00
FantomasM/2024-LeetCode_tasks
Medium/Product_of_array_except_self/src/task.cpp
#include <iostream> #include <iomanip> #include <vector> #include <cassert> using namespace std; class Solution { public: int extract_from_left_vector(const vector<int> & left_vector,int index) { if(index==0) { return 1; } else { return left_vector[index]; ...
ALGO
0.999957
5.807675
{ "github_metadata": { "branch": "main", "commit_count": 72, "repo_created_at": "2024-06-19T09:32:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "37fadf50778...
ff27681a-9284-4c35-8fda-15c96d9da03a
lealb/leetcode
c++/605_Can_Place_Flowers.cpp
#include <iostream> #include <vector> using namespace std; /** * The input array won't violate no-adjacent-flowers rule. * The input array size is in the range of [1, 20000]. * n is a non-negative integer which won't exceed the input array size. */ class Solution { public: bool canPlaceFlowers(vector<int> &flo...
ALGO
0.999997
6.075294
{ "github_metadata": { "branch": "master", "commit_count": 149, "repo_created_at": "2019-04-11T11:58: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": "6fed8a62...
fe04c80d-1a56-402c-b9ab-a15902f4d66f
voidmind26/cpp
weektest2/2.cpp
#include<iostream> #include<cmath> #include<cstdio> #define dl double using namespace std; int nm[1000005][2]; double ab[1000005]; int gcd(int a, int b) { int r; while (b > 0) { r = a % b; a = b; b = r; } return a; } int main() { int n1; dl d; cin >> n1 >> d; int ...
ALGO
0.999944
3.281641
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2023-08-02T11:20: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": "67ef260a311...
6d5f509d-357f-4e2c-b1a0-749e7e5678de
ChiyosBigDragon/MyPortal
content/blog/2019/04/29/code/c.cpp
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) #define all(x) (x).begin(),(x).end() using namespace std; const int INF=1145141919,MOD=1e9+7; const long long LINF=8931145141919364364,LMOD=998244353; // const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1}; template<class T> struct SegmentTree{ ...
ALGO
0.99994
3.855428
{ "github_metadata": { "branch": "master", "commit_count": 149, "repo_created_at": "2019-03-15T04:14:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7cee7fe7...
1519cac3-7819-438c-bdcc-c6b2f61b085f
Vwsrenzk/OI
0402/BZOJ 1069.cpp
/* 旋(wo)转(bu)卡(hui)壳(de)裸题。显然四个点一定在凸包上。然后枚举四边形的对角线O(N^2),然后可以发现可以在凸包上O(N)找到在对角线两侧的离对角线最远的点,用这四个点更新答案。 考虑优化时间,在固定对角线的一个定点i,枚举另一个定点j时,考虑两侧最优解x,y,但j沿着凸包逆时针旋转的时候,x,y也沿着凸包逆时针旋转。因此我们只需要找到一开始的x,y,然后就可以O(N)扫过去了。时间复杂度O(N^2)。 */ #include <cmath> #include <cstdio> #include <cstring> #include <cstdlib> #include <iostream> #include...
ALGO
0.999929
3.94572
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2019-03-30T03:35:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f92df27c75...
dc83a41c-3d45-4e13-b78e-267c035e399b
salvatorespoto/PhysicEngine
Viewer/Viewer/include/PhysicEngine/collision.cpp
#include "collision.h" namespace PhysicEngine { void ProcessCollidingContact(RigidBody& rbA, RigidBody& rbB, const glm::vec3& collidingPoint, const glm::vec3& normal) { // 1. Compute the inpulse force // r1, r2: colliding point coordinates relatives to the objects center of mass glm::vec3 rA = collidingPoin...
ALGO
0.999573
6.686351
{ "github_metadata": { "branch": "develop", "commit_count": 47, "repo_created_at": "2019-08-21T10:32:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d5d5827d...
f9605dfe-a0f5-4d0b-90db-9814316c7e67
Laakeri/pmcenum-ijcai
src/utils.hpp
#pragma once #include <iostream> #include <vector> #include <algorithm> #include <cstdlib> #include <chrono> namespace triangulator { // Interface namespace utils { template<typename T> bool IsSorted(const std::vector<T>& vec); template<typename T> void SortAndDedup(std::vector<T>& vec); template<typename T> void ...
TOOL
0.959083
5.942213
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2019-05-30T14:46: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": "b3e03d221e...
c40cd0e5-15ac-454b-a80f-adae67037fac
haiguanplayer/ACM-ICPC
各种比赛/2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛/F. Islands.cpp
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<vector> using namespace std; const int N = 10005; int n,m; vector<int> G[N]; int low[N],dfn[N],stack[N],instack[N],belong[N],in[N],out[N]; int head,indexx,cnt; void Init() { for(int i = 0;i < N;i++) { G[i].clear(); ...
ALGO
0.999908
4.327482
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2016-09-22T15:57:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "939d7cc3a...
6905aed8-cd89-4475-855c-81b41d837fdd
Intelligent-Computing-Research-Group/PIMLC
src/placement.cpp
/** * @file placement.cpp * @brief Task placement strategy * @author <NAME> * @version 4.0 * @date 2022-11-18 * @note */ #include "placement.h" #include <limits> #include <cmath> #include <cstring> double calculateStandardDeviation(bigint arr[], int n) { double sum = 0.0, mean, stdDeviation ...
ALGO
0.999989
5.55809
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2022-01-24T06:22:13.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0effe87c51cb...
eb459b22-f84a-4dc8-bb03-a439331e903f
ehnryx/lca
graph/tests/closure_openpitmining.cpp
// boj/15273 %:include "graph/max_closure.h" %:include "graph/dinic.h" %:include "graph/push_relabel.h" #include <bits/stdc++.h> using namespace std; constexpr char nl = '\n'; int main() { cin.tie(0)->sync_with_stdio(0); int n; cin >> n; vector<int> weights(n); vector<pair<int,int>> edges; for(int i=0;...
ALGO
0.999873
4.127009
{ "github_metadata": { "branch": "master", "commit_count": 188, "repo_created_at": "2018-04-25T18:09:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "148be418...
cf73dd9e-2d08-47ce-883e-9d574fd45cf2
marianojhb/proyectodados
vectores.cpp
#include <iostream> #include <stdlib.h> #include <time.h> #include "rlutil.h" #include "funciones.h" using namespace std; void cargarVectorAleatorio(int vec[], int tam) { int i; for (i=0; i<tam ; i++ ) { vec[i]=rand()%6+1; } } void cargarVectorManual(int vec[],int tam ) { int i; for (i...
TOOL
0.975276
3.241745
{ "github_metadata": { "branch": "main", "commit_count": 55, "repo_created_at": "2024-06-07T12:21:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6731cc72b4f...
a64ae90c-3416-4cd9-936a-de1d6fa7ace1
DhruvMalik07/Codefoces_sol
1360B.cpp
// Wrong #include<bits/stdc++.h> using namespace std; #define cn cout<<"NO\n" #define cy cout<<"YES\n" void solve() { int n; cin >> n; int grid[n][n]; for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { cin >> grid[i][j]; } } for(int i...
ALGO
0.999552
3.827104
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-02-28T12:08:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7c32935c61fb...
368d8a9c-3c60-4a5f-a14f-b4ade3bb97ad
smitsekhadiaa/DSA-CODES-NOTES
Leetcode/LeetcodeDaily/Find_And_Replace_Pattern.cpp
// // 890. Find and Replace Pattern // // Medium // // 3269 // // 152 // // // Add to List // // Share // // Given a list of strings words and a string pattern, return a list of words[i] that match pattern. You may return the answer in any order. // // A word matches the pattern if there exists a permutation of le...
ALGO
0.997662
6.315506
{ "github_metadata": { "branch": "main", "commit_count": 98, "repo_created_at": "2022-01-23T05:22:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6eabc9a058d...
beb62471-b054-43d4-8d0b-77ede27acf72
mmatrosov/FKN2020
preliminary/F/33917756.cpp
#include <iostream> #include <iomanip> #include <cmath> #include <vector> #include <algorithm> using namespace std; int main() { int n, k; cin >> n >> k; vector <int> a; for (int i = 0; i < n; i++) { int tmp; cin >> tmp; if (tmp > 0) { a.push_back(tmp);...
ALGO
0.999923
3.156834
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2020-09-24T17:37: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": "9bcc46b2b...
1810230a-62b6-4718-b5c2-6c155b7f2e5f
nev1xta/Luna-16
Math_ksp.cpp
#include <iostream> #include <cmath> #include <iomanip> using namespace std; using ll = long long; using ld = long double; const ld g0 = 9.80665; // ускорение свободного падения const ld e_num = 2.71828; // число Эйлера const ld w = 2164; // скорость истечения топлива из сопла двигателя const ll m0 = 690000; // ма...
ALGO
0.992252
3.622324
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-12-25T21:14:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5576d03beeb3...
00cd6ddc-51c8-4a52-a33b-bebd70371a7c
nevervhoodo/tracer
src/tracer.cpp
#include "tracer.h" #include "glmextra.hpp" #include <iostream> #include <vector> #include <omp.h> #define _USE_MATH_DEFINES #include <cmath> using namespace glm; using namespace std; #define DEBUG false #define DEBUG2 false #define ARAY false #define ANTIAL 2.0 void print (dvec3 v) { cout <<"vec is "<<v.x<<" ...
ALGO
0.992771
4.018254
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2015-11-25T19:26: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": "787d00352...
fe003adb-b2f5-4d38-a0db-fd7c5c70997e
Bibs24/Leetcode-GFG-Progress
Matrix Exponentiation - GFG/matrix-exponentiation.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: vector<vector<long long>> mul(vector<vector<long long>> mat1,vector<vector<long long>> mat2){ vector<vector<long long>> res(2,vector<long long>(2,0)); for(int i=0;i<2;i++){ ...
ALGO
0.999932
5.107516
{ "github_metadata": { "branch": "main", "commit_count": 537, "repo_created_at": "2022-04-29T15:48:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8b087f4947...
27d290d6-d569-4fd1-a0ac-961e6f995a23
Juan-Baldelomar/LinearEquation-Solver
Tools.cpp
#include <bits/stdc++.h> #include "Tools.hpp" /* Realiza la lectura de una matriz, se hace paso por referencia. M: es la matriz que tiene los valores. datafile: es el fichero donde está almacenada la matriz */ void ReadMatrix(vector<vector<double> > &M, string filename) { std::ifstream readf(filename); ...
ALGO
0.996968
3.496669
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2020-09-05T06:54: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": "5f2b937361...
d0df9029-526e-4b59-aa01-a8501d8b0d49
gtianyi/rationalRealtimeSearch
cpp/domain/HeavyTilePuzzle.h
#pragma once #include "SlidingTilePuzzle.h" class HeavyTilePuzzle : public SlidingTilePuzzle { public: using SlidingTilePuzzle::SlidingTilePuzzle; Cost getEdgeCost(State state) { return state.getFace(); } Cost heuristic(const State& state) { // Check if the heuristic of this state has been updated ...
ALGO
0.933158
5.164774
{ "github_metadata": { "branch": "master", "commit_count": 358, "repo_created_at": "2020-08-25T20:48: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": "f7fc3f8d...
c68155ac-9e00-4f5f-91ea-4c0035533f96
SubashChandra/geeksCoding
1_LinkedLists/25_pairWiseSwap2.cpp
//do a pair wise swap on the linked list //recursive approach //O(n) time //O(1) space #include<iostream> #include<cstdio> #include<cstdlib> using namespace std; struct node { int data; struct node *next; struct node *arbitptr; }; typedef struct node Listnode; typedef Listnode *Listnodeptr; void printList(Lis...
ALGO
0.999957
4.425725
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2015-01-30T18:18:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4f764da4f...
a29e554a-2290-45b8-943a-f46f20b2b5d7
igor-sumin/Yandex-MIPT-Cplusplus-course
white/4 week/11. Rational/2_rational_eq_add_sub.cpp
#include <iostream> using namespace std; class Rational { private: // числитель int p; // знаменатель int q; // Нахождение НОД int GCD(int a, int b) { if(a < 0) { a = -a; } if(a == 0) { return b; } return GCD(b % a, a); } ...
ALGO
0.993304
5.254907
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2021-01-02T20:36:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "641426718349...
f16448b4-3627-4215-945f-c90825bfd52c
sheikh-arman/Graph_BFS_DFS_lightoj_Solution
lightoj-1175 - Jane-and-the-Frost-Giants-Solution_Accepted.cpp
/* <NAME> University of Barisal Problem name : lightoj-1175 - Jane and the <NAME> Algorithm : BFS */ #include<bits/stdc++.h> #define nl printf("\n"); #define N 200001 #define PR pair<int,int> #define sf(n) scanf("%d", &n) #define sff(n, m) scanf("%d %d",&n,&m) #define sfl(n) scanf("%lld", &n) #define sfu(n) s...
ALGO
0.999985
3.806156
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-08-25T08:16: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": "e13edb14c2...
d7f2242f-f7b4-4213-9ec2-268331dd3d5e
PaulWang0513/Electronic-System-Level-Design-and-Synthesis
hw3/Base_Implementation/MedianMeanFilter.h
#ifndef MEDIANMEAN_FILTER_H_ #define MEDIANMEAN_FILTER_H_ #include <systemc> #include <cynw_p2p.h> using namespace sc_core; #include "filter_def.h" class MedianMeanFilter : public sc_module { public: sc_in_clk i_clk; sc_in<bool> i_rst; cynw_p2p<sc_dt::sc_uint<24>>::in i_rgb_median; cynw_p2p<sc_dt::sc_...
ALGO
0.984534
5.866923
{ "github_metadata": { "branch": "main", "commit_count": 83, "repo_created_at": "2023-03-21T02: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": "08b580178e2...
9738a272-7616-4bdd-b95c-351bde50a6d7
StefanShivarov/introduction-to-programming-fmi-2024-25
Week 04/Pract. 04/Student solutions/Task11.cpp
#include <iostream> using namespace std; const unsigned int ROWS = 4; const unsigned int COLS = 4; int calcSum(const int arr[], const unsigned int n); int main() { int matrix[ROWS][COLS]; for (int i = 0; i < ROWS; ++i) { for (int j = 0; j < COLS; ++j) { cin >> matrix[i][j]; } ...
ALGO
0.999834
5.087094
{ "github_metadata": { "branch": "main", "commit_count": 244, "repo_created_at": "2024-10-05T13:48:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 18, "forks": 12, "issues": 0, "pull_requests": 123 }, "file_meta": { "content_id": "690ae2...
4b2cf9bf-7994-49af-8681-70decefcc425
kobanium/aobazero
src/usi-engine/GTP.h
/* This file is part of Leela Zero. Copyright (C) 2017-2019 <NAME> and contributors Leela Zero 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 of the License, or (at your ...
ALGO
0.911491
6.230772
{ "github_metadata": { "branch": "release", "commit_count": 339, "repo_created_at": "2019-03-03T15:58:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 57, "forks": 8, "issues": 23, "pull_requests": 2 }, "file_meta": { "content_id": "36494...
bc7a1603-fae3-467a-8296-1d256f450c28
ishandutta2007/codeforces-b
brunovsky/normal/1753/A1.cpp
#include <bits/stdc++.h> #ifdef LOCAL #include "code/formatting.hpp" #else #define debug(...) (void)0 #endif using namespace std; void solve() { int N; cin >> N; vector<int> a(N), pos; int s = 0; for (int i = 0; i < N; i++) { cin >> a[i]; if (abs(a[i])) { s++; ...
ALGO
0.998428
4.290241
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-11T01:05:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e5a1f71b2568...
556a5d33-2dc1-46a7-8373-77a63f9586c9
altamsh04/DSA-Problem-Solutions
StriversDSA/LinkedList/rotate_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: ListNode* rotateRight...
ALGO
0.999975
6.191413
{ "github_metadata": { "branch": "main", "commit_count": 446, "repo_created_at": "2024-01-04T17:17:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7d81c03308...
f3e5933f-055e-48ca-b0fc-b4b07ff8c78b
aryan-michael/dsa-prep
arrays/move_zeroes_to_end.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n; cout << "enter size of array: "; cin >> n; int arr[n]; cout << "enter elements of array: "; for(int i=0; i<n; i++) cin >> arr[i]; // Brute force approach - Time complexity is 0(n + n-x) // vector<int> temp; // for(int...
ALGO
0.99997
4.389246
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-11-18T20:36: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": "5dc1f81101...
11208c75-da7d-4296-ac3f-31a499d007c2
yashgovani/data-structure-algorithm
Binary Search/searchToInsert.cpp
// Given a sorted array of distinct integers and a target value, // return the index if the target is found. If not, return the index where it would be if it were inserted in order. #include <bits/stdc++.h> using namespace std; int searchInsert(vector<int> &nums, int target) { int low = 0; int high = nums.size...
ALGO
0.999972
6.065161
{ "github_metadata": { "branch": "development", "commit_count": 12, "repo_created_at": "2024-08-28T17:42: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": "54eb...
3ccc4265-7410-472e-91e5-6b7bceec4ba9
RaffaeleVentriglia/ASD
Algoritmi/algoritmi.hpp
#ifndef ALGORITMI_HPP #define ALGORITMI_HPP #include <iostream> #include <vector> #include <cstdlib> using namespace std; class algoritmi { private: // * Merge Sort template <typename T> static void merge(typename vector<T>::iterator, typename vector<T>::iterator, typename vector<T>::iterator); ...
ALGO
0.999488
5.796391
{ "github_metadata": { "branch": "main", "commit_count": 56, "repo_created_at": "2021-10-06T12:25: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": "e4362c88554...
7d41071a-1271-46d9-9916-ead1a3c80325
dampers/algorithm
1231Bj.cpp
#include<bits/stdc++.h> using namespace std; int p[1001][3]; int v[1001][3]; int c[1001]; int cp[1001]; int n; int f(int x,int y,int cpp) { int xx, yy; if(cpp == n-1) { return 1; } for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(cp[i] == 0 && c[j] == 0) { xx = p[i][0] + v[j][0]; yy = p[i][1...
ALGO
0.999983
4.079304
{ "github_metadata": { "branch": "master", "commit_count": 518, "repo_created_at": "2018-10-16T12:05:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "3d6e3c4f...
f48cffaf-71b7-421c-b5d6-0c610d798df4
py100/University
ACM/2016tour/newTech/suffixarray/MilkPatterns_2.cpp
#include <stdio.h> #include <algorithm> #include <iostream> #include <cstring> #include <vector> #include <cmath> using namespace std; const int maxn = 20020; int s[maxn]; int sa[maxn], n; int low[maxn][33]; vector<int> h; int tta[maxn],ttb[maxn],wv[maxn],tts[maxn]; int Rank[maxn],height[maxn]; int k; int cmp(int *r,...
ALGO
0.999989
3.988909
{ "github_metadata": { "branch": "master", "commit_count": 49, "repo_created_at": "2016-03-10T05:13:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c34906ec4...
b0c2dfb9-00ef-4b56-bb70-a5dacc18af0b
DreamLife-Jianwei/Qt-Vtk
12_Vtk9ReadDicomDemoQmake/Vtk9/include/vtk-9.0/vtkCellTreeLocator.h
/*========================================================================= Program: Visualization Toolkit Module: vtkCellTreeLocator.h Copyright (c) <NAME>, <NAME>, <NAME> All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WIT...
ALGO
0.995799
3.680259
{ "github_metadata": { "branch": "master", "commit_count": 91, "repo_created_at": "2021-06-22T02:34:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 174, "forks": 45, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "04d09e...
17041d23-8b29-4eac-bb09-c4611b29670e
kmtusher97/Solved-Problems
UVA/424/12806240_AC_0ms_0kB.cpp
#include <iostream> #include <cstdio> #include <string.h> using namespace std; char sum[1000], number1[1000], number2[1000]; int main() { while(scanf("%s", number2) == 1) { if(!strcmp(number2, "0")) { for(int i=strlen(sum)-1; i>=0; i--) printf("%c", sum[i]); printf("...
ALGO
0.999754
3.419898
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2018-12-04T07:18: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": "d02afdeeb...
9ddf9bb7-de5e-4c2f-b970-63f3020a7e0b
kjhccscrepo/Sorting-Array-inclassacti
Sorting Algo.cpp
// Sorting Algo.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include <array> #include <random> #include <string> void SortMyArray(std::array<int, 10>& Arr10, int size, int iterations = 0) { bool contIt = false; int minimum = Arr10[iterations]; for (...
ALGO
0.999539
5.064573
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-04-14T19:57:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7e13bb4c1ea5...
6074feab-cb54-435d-84ef-5bbac7180178
seifmohamed0/Leetcode-solutions
1898-maximum-number-of-removable-characters/1898-maximum-number-of-removable-characters.cpp
class Solution { public: bool valid(string& s , string& p , vector<int>&removable , int k){ vector<bool>vis(s.size()); for(int i = 0; i < k ; i++){ vis[removable[i]] = true; } int ptr = 0; for(int i = 0; i < s.size() && ptr < p.size() ; i++){ if((...
ALGO
0.999919
5.679595
{ "github_metadata": { "branch": "main", "commit_count": 650, "repo_created_at": "2022-06-24T13:31: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": "303264006d...
db093790-ec87-4d60-b551-0c99bef2d7a4
NVIDIA/cccl
libcudacxx/include/cuda/std/__algorithm/is_heap_until.h
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // SPDX-FileCopyrightText: Copyrigh...
ALGO
0.988614
7.406903
{ "github_metadata": { "branch": "main", "commit_count": 11478, "repo_created_at": "2020-09-17T18:58:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1794, "forks": 242, "issues": 1001, "pull_requests": 158 }, "file_meta": { "content_id": ...
b187c8e8-0136-44df-9cbd-3b2a191a2043
P41NT/Competitive-Programming
Codeforces/1143C_Queen/C. Queen.cpp
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define int long long int void dfs(int curr, vector<int> &ans, vector<int> &respect, vector<int> &parent, vector<vector<int>> &adj) { int r = 1; for (auto s : adj[curr]) { if (s == parent[curr]) continue; r &= respect[s]...
ALGO
0.999965
4.237089
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2024-06-14T05:52:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c0ce4ef568d...
2c15181d-ebe5-42f1-9579-e076169ec23f
ChetanThorat18/LeetCode
Leetcode_Problems/1422-maximum-score-after-splitting-a-string/Approach2.cpp
class Solution { public: int maxScore(string s) { // Approach 2 : Two Pass int n = s.length(); int result = INT_MIN; // Count of total ones in the string int total_ones = 0; for(int i=0; i<n; i++){ if(s[i] == '1') total_ones++; }...
ALGO
0.999904
5.304137
{ "github_metadata": { "branch": "main", "commit_count": 1404, "repo_created_at": "2024-01-25T16:43:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a0f010134...
2ec4ec28-6d20-4e64-a88d-fc7991eaf061
davidmunozsanchez/1GII
1ER CUATRI/FP/PROGRAMACION/VARIOS/intercambiar_5R3.cpp
/* Programa para intercambiar una variable de un vector con la variable de otro vector correspondiente a la misma posicion */ #include <iostream> using namespace std; int main(){ // Declaracion de variables y del tamanio del vector a modo de prueba int vector1 [5]; int vector2 [5]; int i, posicion1, posicion2...
ALGO
0.970953
4.492181
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-08-28T09:55: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": "3fb0932792c4...
9c4928fa-b179-40e1-9735-7f26ce27bab1
AlexLee1999/Leetcode-Practice
algorithm/C++/0102-Binary_Tree_Level_Order_Traversal.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999976
6.08577
{ "github_metadata": { "branch": "main", "commit_count": 147, "repo_created_at": "2021-01-21T02:44:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "41de9d179c...
d624eaec-d30f-4b71-9233-276c8ee390a4
Kagitoshi/PPandP-Using-CPP
Chapter 4/Exercises/12/main.cpp
#include "std_lib_facilities.h" int main() { cout << "Please allow me to find all of your prime numbers\n" << "between 1 and a number of your choosing. Please enter the\n" << "max number I should look for primes to: "; int max{}; cin >> max; vector<int> primes{}; int primeNumCo...
ALGO
0.997412
4.766086
{ "github_metadata": { "branch": "main", "commit_count": 73, "repo_created_at": "2023-08-09T05:28:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "82c16a7f241...
63183303-f473-43ae-87f0-10d4170ccf33
Robbbert/hbmame
src/osd/modules/render/d3d/d3dhlsl.cpp
// license:BSD-3-Clause // copyright-holders:<NAME> //============================================================ // // d3dhlsl.cpp - Win32 Direct3D HLSL implementation // //============================================================ // MAME headers #include "emu.h" #include "drivenum.h" #include "render.h" #includ...
TOOL
0.900593
6.857232
{ "github_metadata": { "branch": "master", "commit_count": 88214, "repo_created_at": "2017-11-19T00:33:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 102, "forks": 42, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fac...
08a8bcb2-3e18-4e89-b8a3-a99d68e3c459
avivweinstein/grokking
two_pointers/subarray_product.cpp
using namespace std; #include <deque> #include <iostream> #include <vector> class SubarrayProductLessThanK { public: static vector<vector<int>> findSubarrays(const vector<int>& arr, int target) { vector<vector<int>> result; int rightPtr, leftPtr = 0; double product = 1; while(right < arr.s...
ALGO
0.999452
5.900481
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2022-07-19T02:13:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f4251d9e777...
70385efe-6e76-4247-b25a-2034c27a542a
yuliyu123/Algorithms
leetcode/string/atoi.h
using namespace std; int myAtoi(string str) { int i = 0; int ans = 0; int sigh = 1; for (; i < str.length() && str[i] == ' ';) { ++i; } if (str[i] == '-') { sigh = -1; ++i; } if (str[i] == '+') { ++i; } for (; i < str.length() && str[i...
ALGO
0.997722
3.798186
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2017-04-18T08:55:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "855418c32...
01ee993b-e362-46a3-b14c-55b184eba2e3
iuyoy/basicCSKnowledge
leetcode/230. Kth Smallest Element in a BST/KthSEiaBST.cpp
/* Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements. Follow up: What if the BST is modified (insert/delete operations) often and you need to find the kth smallest frequently? How would you optimize the...
ALGO
0.999998
6.497298
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2018-04-12T21:09: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": "9b0d39a07...
9c528c8e-7323-4c4d-bfdb-c65f950850c2
egelja/caelus-cml
src/libraries/dynamicMesh/dynamicMesh/meshCut/edgeVertex/edgeVertex.cpp
/*---------------------------------------------------------------------------*\ Copyright (C) 2011-2015 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of CAELUS. CAELUS is free software: you can redistribute it and/or modify it ...
TOOL
0.901984
6.750353
{ "github_metadata": { "branch": "master", "commit_count": 156, "repo_created_at": "2021-06-14T18:42:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "56cc15d7...
5dbf260c-1fff-4822-a0c9-9ec69ae8f67a
ashishmainali/Haash
HAASH.h
#ifndef H_HAASH #define H_HAASH #include <string> class HAASH{ private: typedef unsigned long long uint64; const uint64 hPrime[8] = {0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL,...
ALGO
0.999611
4.832372
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2020-04-22T19:25: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": "a32fee3b3...
1b8edbf0-9227-47ec-808e-64a9358d4cfa
220v-K/DataStructure-2021DGU
Project03/Tree.h
using namespace std; template < class TE, class KF > class Tree; template < class TE, class KF > class TreeNode; template < class TE, class KF > class TreeNode // Facilitator class for the Tree class { private: // Constructor TreeNode(const TE& elem, TreeNode* right, TreeNode* sub, TreeNode* employer)...
ALGO
0.996147
3.761973
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2021-09-03T19:26: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": "093074b89...
16447e44-5a26-4b3c-b608-8c6762356693
francis-maes/lbcpp
extern/shark/src/LinAlg/eigen.cpp
//=========================================================================== /*! * \file eigen.cpp * * \brief eigenvalues of arbitrary matrices * * \par Copyright (c) 1998-2000: * Institut für Neuroinformatik<BR> * Ruhr-Universität Bochum<BR> * D-44780 Bochum, Germany<BR> * Phone: +...
ALGO
0.999803
3.093845
{ "github_metadata": { "branch": "master", "commit_count": 3495, "repo_created_at": "2015-03-21T09:43:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f3427f2...
5560dcd9-659b-48b0-8207-21b8265e11b1
272572PPiwnicki/DataStructuresP1
SLL_SP.cpp
#include<iostream> #include "SLL_SP.h" #include "Node.h" using namespace std; void SLL_SP::insertFront(int value) { Node* newNode = new Node(value); if (!head) { head = newNode; size++; } else { newNode->next = head; head = newNode; size++; } } void SL...
ALGO
0.991257
3.798213
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-10T11:58:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5314ea6c9098...
40d3620e-ae3f-4242-8f75-1042d7405b30
edamame8888/edamame-s_ABC
20-29/020/C/C.cpp
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
ALGO
0.999929
3.65369
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2018-07-26T11:50: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": "bc9615f13...
c137e39d-9d29-4150-9da1-2065773f6615
Kalit31/cp-playground
LeetCode/leetcode-february-2021/week2/PeekingIterator.cpp
#include <bits/stdc++.h> using namespace std; /* * Below is the interface for Iterator, which is already defined for you. * **DO NOT** modify the interface for Iterator.*/ class Iterator { public: struct Data; Data *data; Iterator(const vector<int> &nums); Iterator(const Iterator &iter); // Retu...
ALGO
0.997955
5.753077
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2019-12-14T13:01: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": "d30c9ee5a...
7a94948b-88a6-4f26-af0e-a9559247ea93
vitorguidi/Competitive-Programming
Treinos equipe/xv de piracikobus/2018/09-16 Damascus 2015/j.cpp
#include "bits/stdc++.h" using namespace std; #define pb push_back #define mp make_pair #define fst first #define snd second #define fr(i,n) for(int i=0;i<n;i++) #define frr(i,n) for(int i=1;i<=n;i++) #define ms(x,i) memset(x,i,sizeof(x)) #define dbg(x) cout << #x << " = " << x << endl #define all(x) x.begin(),x.en...
ALGO
0.999853
3.910617
{ "github_metadata": { "branch": "master", "commit_count": 253, "repo_created_at": "2018-05-13T17:40:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b19ae593...
9673f7d6-0eef-45f4-8248-c5d48145ab19
Francesco-Nasoni/Pandemic-Simulation
Versione_4/pandemicCM.cpp
#include <algorithm> #include <cassert> #include <iostream> #include <random> #include "pandemicCM.hpp" PandemicCM::PandemicCM(const Pandemic &p, double V_B_E, double V_Y_E, double V_R_E) : Pandemic(p), quar{false}, vacc_1{false}, vacc_2{false}, vacc_B_effect{V_B_E}, vacc_Y_effect{V_Y...
ALGO
0.994193
6.379022
{ "github_metadata": { "branch": "main", "commit_count": 74, "repo_created_at": "2023-03-05T17:36: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": "11094557a89...
044a55f7-bd74-4011-abfd-f6c646db0fd1
therajsoren/leetcode-solutions
sliding-window/Hotels_Along_the_Croatian_Coast.cpp
// https://www.spoj.com/problems/HOTELS/ #include <bits/stdc++.h> #define endl '\n' #define rep(i, n) for (int i = 0; i < (n); i++) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long; void solve() { int n , m; cin >> n >> m; vector<int> v(n); rep(i, n) cin >> v[i]; int m...
ALGO
0.99995
4.42815
{ "github_metadata": { "branch": "main", "commit_count": 105, "repo_created_at": "2024-01-27T14:10:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "18ddafb477...
a508ca75-d1f2-4af0-8807-c04ac16c0119
xKarnSinghx/ProblemSetSolution
CF/SymmMat.cpp
/* B. Symmetric Matrix time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Masha has n types of tiles of size 2×2. Each cell of the tile contains one integer. Masha has an infinite number of tiles of each type. Masha decides to construct the square of size m×m consi...
ALGO
0.999987
4.621568
{ "github_metadata": { "branch": "master", "commit_count": 1218, "repo_created_at": "2019-11-11T14:42:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8cef0af...
22b92d2e-4644-4e05-8ff5-93de99b83bf1
jayin92/NYCU-CP1
week5/pH.cpp
// :80 <enter> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<int, ll> pil; typedef pair<ll, int> pli; typedef pair<double,double> pdd; #define SQ(i) ((i)*(i)) #define MEM(a, b) memset(a, (b), sizeof(a)) #define SZ(i) int(i.size()) ...
ALGO
0.99977
4.175995
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2022-03-11T05:13:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6a4c288151b...
b01aba89-dcb1-45da-9516-0d928ab9f0a7
zorchenhimer/GameOfLife
Life.cpp
#include "Life.h" #include <random> Life::Life() { std::random_device rd; std::mt19937_64 gen(rd()); this->WorldGrid = new bool*[GRID_HEIGHT]; for (int i = 0; i < GRID_HEIGHT; i++) { this->WorldGrid[i] = new bool[GRID_WIDTH]; } this->tempgrid = new bool*[GRID_HEIGHT]; for (int i = 0; i < GRID_HEIGHT; i++) {...
ALGO
0.977699
4.194839
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2014-11-11T23:41: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": "358c761d5c...
8c52b87c-60aa-4d6e-9243-61c1b927fee3
lcy960729/Algorithm_Solution_Collection
Baekjoon/implement/17377.cpp
#include <iostream> #include <algorithm> #include <cstring> #include <vector> #include <cmath> #include <map> #include <set> #define pii pair<int, int> #define ll long long #define Int_MAX 1e9 #define LL_MAX 3e18 using namespace std; const double eps = 1e-6; struct Point { string name; int x = -1, y = -1; }...
ALGO
0.977821
4.187736
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2020-10-19T13:03: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": "fca81e2a63e...
11ca1e68-e60d-4668-97bb-831c58c7f1c2
ChuangRoy/RoyChuangs-Code
Algo/CSES/Mathematics/Josephus Queries.cpp
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define AC ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); #define pb emplace_back int j (int n, int k) { if (n == 1) return 1; int m = (n+1) / 2; ...
ALGO
0.999979
4.193631
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2024-06-14T13:02: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": "bb1549ae4...