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
a5c5f8fd-1738-42f1-a2a0-19f0bd0473a0
mabarrera4/UVa-Online-Judge-Solutions
10728.cpp
/* * 10728. Help! * status: Accepted */ #include <cassert> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <set> #include <vector> #include <map> using namespace std; enum { S = 0, T = 1 }; #define N 1024 char buff[2][0x400]; int n[2][2],g[N][N],yes,len[2]; map<string,int> m[2][...
ALGO
0.999444
3.506561
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2018-05-19T19:11:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "953f774bb0...
051be942-89f7-43ca-90e7-ae768d2ad901
dmlc/dgl
src/graph/transform/to_simple.cc
/** * Copyright (c) 2019 by Contributors * @file graph/transform/to_simple.cc * @brief Convert multigraphs to simple graphs */ #include <dgl/array.h> #include <dgl/base_heterograph.h> #include <dgl/packed_func_ext.h> #include <dgl/transform.h> #include <utility> #include <vector> #include "../../c_api_common.h"...
ALGO
0.948606
6.164527
{ "github_metadata": { "branch": "master", "commit_count": 4416, "repo_created_at": "2018-04-20T14:49:09.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13984, "forks": 3049, "issues": 444, "pull_requests": 134 }, "file_meta": { "content_id"...
d896f958-d604-4c66-adad-3f42ceb8be51
Ramazanm1nd3R/univer_learning_materials
Algoritmiz/Lab12/LabLab12.cpp
//1 #include <iostream> #include <string> struct Plane { std::string id, arrival_time, leave_time; }; Plane parse_input() { Plane plane; std::cin >> plane.id >> plane.arrival_time >> plane.leave_time; return plane; } int calculate_flight_time(const std::string& s1, const std::string& s2) { int h1,...
ALGO
0.996735
3.494908
{ "github_metadata": { "branch": "main", "commit_count": 62, "repo_created_at": "2024-10-12T17:10: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": "00afdeeb70f...
d1d7247b-a29f-4ec6-a07f-ac10b6112c95
AyVeeKay/ScientificWork
Pandore/pandore/src/operatorsP0/edgedetection/psobel.cct
/* -*- c-basic-offset: 3; mode: c++ -*- * * Copyright (c), GREYC. * All rights reserved * * You may use this file under the terms of the BSD license as follows: * * "Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met...
ALGO
0.998898
5.519382
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2018-12-13T12:43:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "65cb4c419...
7e410fcc-76c7-446f-bfdd-4c1413d898f7
ParthAher07/Advent-Of-Code-2024
d23/p1.cpp
#include <iostream> #include <fstream> #include <sstream> #include <vector> #include <unordered_map> #include <unordered_set> #include <set> #include <algorithm> using namespace std; // Function to find all triangles in the graph vector<set<string>> findTriangles(const unordered_map<string, unordered_set<string>> &gr...
ALGO
0.999879
5.964616
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2024-12-06T11:00: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": "09dc9082b50a...
1ea66658-8d65-4e04-83e9-7ba41234617f
DavidGugea/DataStructures
src/main/java/CCPPSol/LinearDataStructures/Lists/AssociationList/AssociationList.cpp
#include <iostream> using namespace std; class Node { public: int key; int value; Node* next; Node(int key, int value) { this->key = key; this->value = value; } }; class AssociationList { private: int size = 0; public: Node* head; int get_size() { return this...
ALGO
0.985984
4.694305
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2023-01-31T21:37:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "720ee8d5e...
bac2596c-87bc-4396-8ab7-9f7c9b70f046
AtelierAmber/Space-Strategy-Game
Space Strategy/Space Strategy/AI.cpp
#include "AI.h" #include "Grid.h" #include <algorithm> AI::AI(Fleet* playerFleet, std::string team, MainGUI* gui){ } AI::~AI(){ } void AI::init(Fleet* playerFleet, std::string team, MainGUI* gui, Sakura::ResourceManager* resourceManager, Grid* grid){ m_playerFleet = playerFleet; m_fleet.init(m_playerFleet, team...
ALGO
0.958494
4.804283
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2016-10-20T19: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": "bb93c061d...
6c7e0836-6421-4210-960b-f812efc05d6e
ishandutta2007/codeforces-i
-is-this-fft-/normal/398/B.cpp
#include <iostream> #include <set> #include <iomanip> using namespace std; const int MAX_N = 2e3 + 5; typedef long double ld; ld dp [MAX_N][MAX_N]; int main () { ios::sync_with_stdio(false); int n, m; cin >> n >> m; ld nsq = (ld) n * (ld) n; dp[0][0] = 0; for (int i = 0; i <= n; i++) { for (...
ALGO
0.999687
4.218364
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T05:39:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8b571e15fd2b...
61c238f6-2c1f-4446-853e-f8109a38feb4
vedantkokane10/LeetCode_75
Linked LIst/4_ Maximum Twin Sum of a Linked List.cpp
/* 2130. Maximum Twin Sum of a Linked List In a linked list of size n, where n is even, the ith node (0-indexed) of the linked list is known as the twin of the (n-1-i)th node, if 0 <= i <= (n / 2) - 1. For example, if n = 4, then node 0 is the twin of node 3, and node 1 is the twin of node 2. These are the only nodes ...
ALGO
0.99989
6.215557
{ "github_metadata": { "branch": "main", "commit_count": 43, "repo_created_at": "2023-10-15T05:51:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bbce26aa523...
b9c89bb6-3c22-4c4a-8671-04eee5085f4b
floresc35/cs201r-pgm3-7-floresc35
CS201Prgm3.cpp
// Name: <NAME> // Program 3 - Distance // get 2 values //calc distance to origin & print //repeat //no while true statements - gladbach #include <iostream> #include <cstdlib> #include <cmath> using namespace std; /*int main() { //define values int x1, y1, x2, y2; float dist1, dist2; char userChoice = 'Y'; c...
TOOL
0.984814
3.663533
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-12-11T14:10: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": "292e0de717b4...
b3735235-7289-4c1a-8abe-b0fff344e1dc
ishandutta2007/codeforces-s
serotonin/normal/1328/E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int sz=2e5+5; int a[sz], done[sz], prnt[sz], spar[sz][20]; vector <int> g[sz]; void dfs(int u, int p, int lvl) { done[u]=lvl; prnt[u]=p; for(int i=0; i<g[u].size(); i++) { int v=g[u][i]; if(!done[v]) dfs(v,u,lvl+1); ...
ALGO
0.999974
4.273469
{ "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": "53d3ab7f2cff...
162f94f1-59bf-4b9c-a4e5-c55dc2f2ee6e
MHF2145/Data-Structure-2023
Other Class/Strukdat Kelas B(1)/Praktikum Final/S.cpp
#include<bits/stdc++.h> using namespace std; int solve(int arr[], int n, int k) { map<int, int> m[69]; int len[n + 1] = {0}; int power[69] = {0}; power[0] = 1; int ans = 0; for(int i = 1; i <= 10; i++) power[i] = (power[i - 1] * 10) % k; for(int i = 0; i < n; i++) { int x = arr[i];...
ALGO
0.999787
4.501203
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2023-04-12T09:46:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "579173203fd...
e644a732-c8a2-4c02-986a-3d20fb1687a9
Devang-soni/Leetcode
Medium/1514. Path with Maximum Probability/Path-with-Maximum-Probability.cpp
/* You are given an undirected weighted graph of n nodes (0-indexed), represented by an edge list where edges[i] = [a, b] is an undirected edge connecting the nodes a and b with a probability of success of traversing that edge succProb[i]. Given two nodes start and end, find the path with the maximum probability of su...
ALGO
0.999982
6.376755
{ "github_metadata": { "branch": "master", "commit_count": 229, "repo_created_at": "2024-06-01T09:00: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": "c89ca826...
c55c667e-2630-4857-a7ef-ab49fdd2e123
nataraj2/MultiphaseSolverAMReX
amrex_Old/Src/AmrTask/rts_impls/mpi_omp/AsyncMultiFabUtil.cpp
#include <AMReX_MultiFabUtil.H> //#include <AMReX_MultiFabUtil_F.H> #include <AsyncMultiFabUtil.H> #include <AMReX_MultiFabUtil_C.H> #include <Perilla.H> #include <WorkerThread.H> using namespace amrex; using namespace perilla; void average_down_push (Amr& amr, MultiFab& S_fine, MultiFab& S_crse, MultiFab& crse_S_fin...
ALGO
0.995647
5.078634
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2022-08-24T07:25:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 2, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "b5b55c370...
a945db91-322b-4690-b086-ba2ca202baa6
ChamDog/SteelMeasure
MFCApplication1 - 最终/MFCApplication1/Matrix.cpp
// CMatrix.cpp: implementation of the CMatrix class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include <iostream> #include "pch.h" //using std::cout; //using std::endl; #include <iomanip> using std::setw; #include <cassert> #include <math.h> #include "Matrix.h" ...
TOOL
0.973298
4.443983
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2024-09-06T01:32: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": "7bed0acce78...
be8eb412-9265-475d-a923-acdd58adbee3
liuyubobobo/Play-Leetcode
2001-2500/2179-Count-Good-Triplets-in-an-Array/cpp-2179/main.cpp
/// Source : https://leetcode.com/problems/count-good-triplets-in-an-array/ /// Author : liuyubobobo /// Time : 2022-02-20 #include <iostream> #include <vector> using namespace std; /// Using Segment Tree /// Time Complexity: O(nlogn) /// Space Compelxity: O(n) template<typename T> class SegmentTree{ private: ...
ALGO
0.999982
6.126902
{ "github_metadata": { "branch": "master", "commit_count": 2592, "repo_created_at": "2016-12-01T17:08:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2732, "forks": 718, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "77...
37e41807-bb87-432c-9b10-937b5c20e19b
rainbow-auto/rainbow-codes
Comp/23-08-02 ZR/B.cpp
#include <iostream> using namespace std; const int maxn = 200005; int to[maxn], pre[maxn], last[maxn]; int w[maxn]; int cnt; inline void addEdge (int u, int v, int ww) { cnt ++; to[cnt] = v; w[cnt] = ww; pre[cnt] = last[u]; last[u] = cnt; } int n; int x, y[maxn]; bool in[maxn]; set<int> s; int...
ALGO
0.999766
3.3997
{ "github_metadata": { "branch": "master", "commit_count": 749, "repo_created_at": "2024-09-07T02:10:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "96f7bb97...
4b1a33fa-51c3-45c5-a4c6-1226a0b6563a
actium/codeforces
0400/00/400a.cpp
#include <iostream> #include <string> #include <vector> void answer(const std::vector<std::pair<unsigned, unsigned>>& v) { std::cout << v.size(); for (const auto& x : v) std::cout << ' ' << x.first << 'x' << x.second; std::cout << '\n'; } void solve(const std::string& s) { constexpr unsigned...
ALGO
0.998206
4.191315
{ "github_metadata": { "branch": "master", "commit_count": 4876, "repo_created_at": "2020-06-17T16:27:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5287453...
27cecc08-2683-4485-bf3d-c4f224149a94
thazhemadam/generic-red-black-trees
include/rb_tree.h
#ifndef RB_TREE_H #define RB_TREE_H #include "rb_node.h" #include "utils.h" #include <memory> using namespace std; template <typename T = int, typename Compare = std::less<T>> class RBTree { private: RBNode<T> *root_; Compare compare; // rotate functions void rotate_left (RBNode<T> *pivot); void rotate_right (RB...
ALGO
0.978202
5.817923
{ "github_metadata": { "branch": "main", "commit_count": 153, "repo_created_at": "2021-04-02T05:54:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "b5240790ec...
af9afdab-f102-4873-8228-cbf49ecbff2b
ClarissaDamas/Projetos-em-c
Ordenacao2.cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> typedef struct Elem { char c; int f; struct Elem *next; } stElem; typedef struct { char caractere; int valor; } Elemento; typedef struct Lst { int n; stElem *first; int tamanho; Elemento elementos[30]; } stLst; stElem *buscaAtualiza...
ALGO
0.999879
3.094097
{ "github_metadata": { "branch": "main", "commit_count": 64, "repo_created_at": "2024-07-18T19:10:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "07afed769f7...
86ca542e-abf3-429c-a738-8369a9f4aa3e
hju00/Problem-Solving
백준/Gold/1005. ACM Craft/ACM Craft.cc
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; const int MAX_N = 1000; // 최대 건물 수 vector<int> adj[MAX_N + 1]; // 건물 간의 관계 int indegree[MAX_N + 1]; // 진입 차수 int construct_time[MAX_N + 1]; // 각 건물의 건설 시간 int dp[MAX_N + 1]; // dp[i]: i번째 건물을 짓기까지 걸리는 최소 시간 int topology...
ALGO
0.999991
5.371805
{ "github_metadata": { "branch": "main", "commit_count": 367, "repo_created_at": "2024-10-25T13:48: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": "f361b48907...
be85765e-d3ac-4dc8-a533-111231484c33
yuvashankar/Research
src/wavelet.cc
// MIT License // Copyright (c) [2017] [<NAME>] // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify...
ALGO
0.995356
4.910985
{ "github_metadata": { "branch": "master", "commit_count": 381, "repo_created_at": "2016-01-12T22: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": "da29147b...
093442aa-3e37-4ff5-8aca-bb1e6e9540c7
Le0-dot/trie
src/trie/auxiliary/functions.hpp
#include <iterator> #include <ranges> #include <algorithm> #include <functional> #include "types.hpp" #include "concepts.hpp" #include "helpers.hpp" #include "data_structures/static_vector.hpp" #include "data_structures/static_stack.hpp" namespace trie::static_trie_auxiliary::functions { namespace { usi...
ALGO
0.996146
7.262508
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2022-11-03T16:53: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": "4f23bf496d0...
5c6e404c-c8dc-460e-8693-69ff51966085
MMadadiAsl/Stimulation-induced-decoupling
spike_statistics.cpp
//********************************************************************************************** //********************************************************************************************** // Code developed by <NAME>. // Email: <EMAIL> // Necessary functions for spike count statistics. //***********************...
ALGO
0.984491
4.201925
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2022-10-26T17:04:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "10706d9fdef...
362394dc-1740-438c-b983-dfa3f82a05f1
poon-zx/kattis
solutions/jugglingpatterns.cpp
#include <algorithm> #include <array> #include <bitset> #include <climits> #include <cmath> #include <cstddef> #include <cstdint> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <ios> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <map> #inclu...
ALGO
0.999532
4.613655
{ "github_metadata": { "branch": "main", "commit_count": 289, "repo_created_at": "2025-02-03T16:25:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "18c4bf284d...
236db889-6f06-4ef9-a8a5-87dd47335800
EmilioPeJu/problems
beautifullyrics.cpp
#include <bits/stdc++.h> using namespace std; #define INF 4000000000 typedef long long ll; typedef pair<int, int> ii; typedef tuple<int, int, int> iii; typedef vector<ii > vii; typedef vector<iii > viii; struct Node { size_t count; char last; size_t index; }; struct Node adapt(string in) { size_t count = 0; ...
ALGO
0.999966
3.346295
{ "github_metadata": { "branch": "master", "commit_count": 111, "repo_created_at": "2018-06-24T20:44:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b5a8a2f6...
0f28c795-3e85-48cb-93cf-e3e5dcabcc04
visar-93/deitel-cpp-how-to-program-8th-exercises
Chapter 18/18.17/Example.cpp
#include "stdafx.h" #include <iostream> #include <string> using namespace std; int main() { char vowels[10] = { 'a','A', 'e','E', 'i','I','o','O','u','U' }; string sentence = ""; int count = 0, counta = 0, counte = 0, counti = 0, counto = 0, countu = 0; cout << "Enter a sentence: \n"; getline(cin, sentence); ...
ALGO
0.995296
4.355482
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-03-28T20:22: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": "5e26acafe4f5...
3c9e025e-981c-4c9b-9385-870173e51d9a
introlab/rtabmap
corelib/src/rtflann/util/heap.h
/*********************************************************************** * Software License Agreement (BSD License) * * Copyright 2008-2009 <NAME> (<EMAIL>). All rights reserved. * Copyright 2008-2009 <NAME> (<EMAIL>). All rights reserved. * * THE BSD LICENSE * * Redistribution and use in source and binary fo...
ALGO
0.993406
7.056602
{ "github_metadata": { "branch": "master", "commit_count": 3531, "repo_created_at": "2014-08-11T18:38:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3232, "forks": 839, "issues": 525, "pull_requests": 7 }, "file_meta": { "content_id": "4...
45a327ee-6370-4e7f-bd0c-f93edf296703
AndrewMonteith/AISearch
AISearch/ReverseSubsection.cpp
#include "Annealing.h" #include <algorithm> ReverseSubsection::ReverseSubsection(Graph* g) { std::random_device seed; rnd = std::mt19937(seed()); indiciesDis = std::uniform_int_distribution<>(0, g->getNumberOfCities() - 1); } void reverseSubsectionWraparound(std::vector<int>& vec, int upper, int lower) { auto ...
ALGO
0.99578
4.071895
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2018-11-04T10:40: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": "f9a6ab486...
8928a06b-b696-4919-8d47-a6736dfbcb4b
fangohr/oommf
oommf/app/oxs/contrib/oommf-pbc_2.1/kl_uniformexchange.cc
/* FILE: kl_uniformexchange.cc -*-Mode: c++-*- * * Uniform 6 neighbor exchange energy on rectangular mesh, * derived from Oxs_Energy class. * File based on: uniformexchange.cc * */ #include <string> #include "nb.h" #include "director.h" #include "mesh.h" #include "meshvalue.h" #include "simstate.h"...
ALGO
0.995785
4.239556
{ "github_metadata": { "branch": "master", "commit_count": 298, "repo_created_at": "2015-09-24T11:27:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 30, "forks": 8, "issues": 5, "pull_requests": 0 }, "file_meta": { "content_id": "e77bf85...
cedc998e-eb67-4c08-abce-7f2e7f2d0126
Alex7Li/ProgrammingContests
Codeforces/AngryStudents.cpp
# include <bits/stdc++.h> //https://codeforces.com/problemset/problem/1287/A using namespace std; # define rep(i, a, b) for(int i = a; i < (b); ++i) # define trav(a, x) for(auto& a : x) # define all(x) begin(x), end(x) # define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> ...
ALGO
0.999812
3.748184
{ "github_metadata": { "branch": "master", "commit_count": 84, "repo_created_at": "2017-08-14T19:06: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": "41a71c607...
558010e4-aac6-4e06-b78a-8191c51fbe8d
NTNUNSL/Plume-source-searching-simulator
main_greedy.cpp
#include "gdm.hpp" #include "zigzag.hpp" #include "search.hpp" #include <vector> #include <unistd.h> #include <fstream> #include <stdlib.h> #include <time.h> using namespace std; int main(int argc,char *argv[]) { srand(time(0)); //cout<<"algorithm: greedy"<<endl; // Program parameters int loop = 1000; bool save...
ALGO
0.999656
4.825341
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-03-02T03:06:13.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a38ada7dbb6...
86aa3d84-2026-434d-a17a-411aa9b70e91
avinashw50w/ds_algo
Leetcode/DP/66. Plus One.cpp
/*Given a non-empty array of digits representing a non-negative integer, increment one to the integer. The digits are stored such that the most significant digit is at the head of the list, and each element in the array contains a single digit. You may assume the integer does not contain any leading zero, except the ...
ALGO
0.999961
6.199231
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2019-06-23T03:49:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9f621f779...
8fe4b2db-3b86-429d-868c-4504b8fcfc8d
reddy-lab-code-research/MuST-CoST
data/transcoder_evaluation_gfg/cpp/DOUBLE_FACTORIAL.cpp
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // #include <iostream> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <iomanip> #include...
ALGO
0.999759
5.453046
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2022-02-08T19:28:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 11, "forks": 5, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "3c0898d212a...
83f746e7-866b-4f26-8744-da469212b403
ajayayrekar/Assignment-No-24
3.cpp
//3. Define a function to calculate x raised to the power y. #include<iostream> using namespace std; double power(double x, int y) { if(y == 0) { return 1; } double temp = power(x, y/2); if(y%2 == 0) { return temp*temp; } else { if(y > 0) { return x*temp*temp; ...
ALGO
0.99753
5.870621
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-02-19T18:51: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": "08473bdefb2f...
2bd86c2a-c614-4c51-bad6-47a4a2aac494
NREL/EnergyPlus
third_party/cpgfunctionEP/src/lu.cpp
// // Created by jackcook on 8/17/21. // #include <include/cpgfunction/lu.h> #include <algorithm> double jcc::dot(int &n, std::vector<double> &A, int &begin_x, int &incx, int &begin_y, int &incy, int &n_threads) { int k; double summation = 0.; // reduction notes: https://stackoverflow.com...
ALGO
0.99991
6.064863
{ "github_metadata": { "branch": "develop", "commit_count": 40658, "repo_created_at": "2013-11-22T14:47:34.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1278, "forks": 441, "issues": 908, "pull_requests": 48 }, "file_meta": { "content_id":...
4457075d-75b2-4cc0-af5c-d4b891362c61
souravdev33/SOURAV_CODES
Codeforces/C_Ski_Resort.cpp
#include <iostream> #include <bits/stdc++.h> #include <algorithm> #define yes cout<<"YES"<<endl; #define no cout<<"NO"<<endl; #define MOD 1000000007 using ll=long long; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int tc; cin >> tc; while (tc--) { ...
ALGO
0.999726
4.140566
{ "github_metadata": { "branch": "main", "commit_count": 71, "repo_created_at": "2024-08-14T20:48:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3064a93d86b...
6e2cac66-b625-4821-93f6-d9c6818340f4
bhanson10/PHGN-317-Useless-Machine
code1.ino
#include <Servo.h> #include <stdlib.h> #include <stdio.h> Servo servo1; const int switch1 = 4; int count = 0; void setup() { pinMode(switch1,INPUT); servo1.attach(9); servo1.write(0); Serial.begin(9600); } void loop() { int randNumber = 1; if (count % 4 == 0){ randNumber = 1; } else...
TOOL
0.934834
4.759849
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2020-11-29T14:23: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": "bce949ecbcd4...
c832955c-6ffa-4ac6-bff0-df6e4612bc45
liuxiyang641/coding-oj
leetcode/684.cpp
// https://leetcode.com/problems/redundant-connection/ #include<algorithm> using namespace std; int find(int i, int* parent) { while(parent[i] != i) { i = parent[i]; } return i; } void unionSet(int x, int y, int* parent) { int parentX = find(x, parent); int parentY = find(y, parent); ...
ALGO
0.99995
5.363628
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-03-18T12:35:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9d6503e85864...
80c28a4f-c329-47ed-a10f-cf2cd2a4c573
Piyushjar/Strivers-sheet-challlenge
problems/top_view_of_binary_tree.cpp
#include <bits/stdc++.h> using namespace std; // Following is the TreeNode class structure: template <typename T> class TreeNode { public: T val; TreeNode<T> *left; TreeNode<T> *right; TreeNode(T val) { this->val = val; left = NULL; right = NULL; } }; vector<int> getT...
ALGO
0.999987
5.261689
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2023-06-05T06:17: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": "1a1522140c4...
2348e668-49d0-4ee7-88f8-be31c1b1a282
JayTheCoder77/Striver-Dsa
Greedy/Medium/JobSequencingProfit/greedy.cpp
for optimizing this further the internal loops can use disjoint set union #include<bits/stdc++.h> bool comp(const vector<int> &a , const vector<int> &b){ // sort according to profit return a[2] > b[2]; } vector<int> jobScheduling(vector<vector<int>> &jobs) { // Write your code here int n = jobs.size(...
ALGO
0.999984
5.138541
{ "github_metadata": { "branch": "main", "commit_count": 177, "repo_created_at": "2024-11-18T12:45: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": "09013f8c39...
ebd40b3d-0569-47c8-85fc-c6c136a0a250
sonaspy/PAT-PTA
ADVANCED/1063.cpp
// author -<EMAIL> // coding - utf_8 #include <bits/stdc++.h> #define test() freopen("in", "r", stdin) using namespace std; int main(int argc, char const *argv[]) { /* code */ //test(); int n, m, n1, a1, a2, tmp, nc, nt; cin >> n; set<int> v[n + 1]; vector<int> lists; for (int i = 1; i <= ...
ALGO
0.999753
3.870178
{ "github_metadata": { "branch": "sonaspy", "commit_count": 525, "repo_created_at": "2018-11-25T17:50: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": "73be89a...
c101fd02-f955-4ff9-b8fc-c92c5224df64
majiaoliya/HelloWorld
hdu/2016东北ccpc/5927用tarjanTLE了/main.cpp
/** 用Tarjan求TLE */ #include <iostream> #include <stdio.h> #include <string.h> #include <vector> //#include <algorithm> #define ll long long int #define MAXN 100005 using namespace std; int t, n, q, pre[MAXN], m; bool is[MAXN]; //是否重要 bool rs[MAXN]; //是否是结果 bool vis[MAXN]; struct Node { int x, y, lca; } query[MAXN...
ALGO
0.999743
4.027269
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2019-11-25T12:51:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cffd30fceb...
9bcb94b5-11be-4680-a1d5-c12bfdad80bb
joshua-jin/algorithm-campus
chingjun/50-product-of-array-exclude-itself.cpp
class Solution { public: /** * @param A: Given an integers array A * @return: A long long array B and B[i]= A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1] */ vector<long long> productExcludeItself(vector<int> &nums) { // write your code here vector<long long> prodFront, prodBack; ...
ALGO
0.999988
5.218009
{ "github_metadata": { "branch": "master", "commit_count": 208, "repo_created_at": "2016-01-23T05:03:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f819106b...
af996315-a148-4848-bb2d-a25ab6de119a
hsidky/SAPHRON
src/Moves/SpeciesSwapMove.h
#pragma once #include "Utils/Rand.h" #include "Move.h" #include "../Worlds/WorldManager.h" #include "../DensityOfStates/DOSOrderParameter.h" #include "../ForceFields/ForceFieldManager.h" #include "../Simulation/SimInfo.h" namespace SAPHRON { // Species swap move. This move swaps the species identity between two par...
TOOL
0.935827
7.255222
{ "github_metadata": { "branch": "master", "commit_count": 609, "repo_created_at": "2015-01-08T20:46:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 7, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "d2c3ca1b...
9fcfac1f-2626-413d-b03e-197d0bdc1a60
maximusyoung007/LeetCode
c++/0081.cpp
#include "0081.h" bool Solution0081::search(vector<int> &nums, int target) { if(nums.size() == 0) { return false; } if(nums.size() == 1) { if(nums[0] == target) { return true; } else { return false; } } int left = 0,right = nums.size() - 1; ...
ALGO
0.999981
5.744775
{ "github_metadata": { "branch": "master", "commit_count": 828, "repo_created_at": "2019-03-21T08: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": "ee1be53a...
7e1e26e3-50dc-4e5c-9b7e-bce211a80275
Soumalya1857/Dump
Leetcode/DPssssss/partition-equal-subset-sum.cpp
class Solution { public: bool canPartition(vector<int>& nums) { int size = nums.size(); if(size == 0 || size == 1) return false; long long int sum = 0; for(int i=0;i<size;i++) { sum+=nums[i]; } if(sum%2 == 1) return false...
ALGO
0.99985
5.809721
{ "github_metadata": { "branch": "master", "commit_count": 176, "repo_created_at": "2020-05-22T04:49:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fb7f2feb...
21e76e28-01b1-4186-9025-1bfe25c36dd3
DaniDiazTech/competitive-programming
codeforces/1844B.cpp
// Made by <NAME> (@Danidiaztech) #include <bits/stdc++.h> using namespace std; #define ll long long const int mod = 1e9 + 7; const string yes = "YES", no = "NO"; void solve(){ int n; cin >> n; int k = n / 2; if (n >= 3) cout << 3 << " "; int j = 4; for (int i = 1; i < k; i++){ cout << j << ' '; ...
ALGO
0.999874
4.013212
{ "github_metadata": { "branch": "main", "commit_count": 163, "repo_created_at": "2022-07-09T05:32:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9a1f88470f...
2041839a-9d32-46cd-8762-bee64ebad2f4
paraggoyal28/cp
cses/1671.cpp
#include <bits/stdc++.h> #define vi vector<int> #define pii pair<int, int> #define mii map<int, int> #define rep(i, a, b) for (int i = a; i < b; i++) #define int long long #define ld long double #define pb push_back #define all(v) v.begin(), v.end() #define back(v) v.rbegin(), v.rend() #define nl "\n" #define yes cout ...
ALGO
0.999986
4.392703
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2024-01-07T13: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": "fbc37577e...
1e0a9b4b-8589-4407-9b89-f8a0e600b5e5
JairZhu/Backup-of-undergraduate-study-materials
算法设计与应用基础/算法设计课件/code/图/dfs/edgeclassify/dfs1.cpp
/* dfs with edge classified */ #include <vector> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int V = 1010; int edge[V][V]; int parent[V], pre[V], post[V], tag; vector<int> graph[V]; int n, m, k, u, v; /* DAG的深度有限搜索标记 INIT: edge[][]邻接矩阵;pre[], post[], tag全置0; CALL: dfstag(i,n);...
ALGO
0.999708
3.823056
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2019-06-11T13:18:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8e96d8b3...
96c78b39-7c10-4a36-85c7-0a9f5b66e97b
eschliec/TopAnalysis
Configuration/analysis/common/src/KinReco.cc
#include <cmath> #include <cassert> #include <algorithm> #include <utility> #include <cmath> #include <TLorentzVector.h> #include <TMath.h> #include "KinReco.h" #include "utils.h" #include "analysisUtils.h" #include "classes.h" TtFullLepKinSolver::TtFullLepKinSolver(const std::vector<double> &nupars, ...
ALGO
0.999314
4.469686
{ "github_metadata": { "branch": "master", "commit_count": 5841, "repo_created_at": "2013-06-26T14:21: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": "fa6f522...
45ce7d9f-8ce3-41a5-bd69-2fb003916a90
felipeSucupiraO/Topicos-Avancados-em-Programacao
sem5/soma2.cpp
#include <bits/stdc++.h> using namespace std; long long int somaAteIndex(int index, vector<long long int> &vetorArvoreFenwick) { long long soma = 0; while(index) { soma += vetorArvoreFenwick[index]; index -= (index & -index); } return soma; } void adicionarNaArvoreFenwick(int posicao, ...
ALGO
0.999772
5.013865
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2024-06-24T20:04: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": "0dff708a7c...
c8c452cd-4688-4040-b0f0-782302377889
govg/podcuda
magma-1.5.0/src/zpotrf_mgpu_right.cpp
/* -- MAGMA (version 1.5.0) -- Univ. of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver @date September 2014 @precisions normal z -> s d c */ #include "common_magma.h" #include "trace.h" #define get_time magma_wtime extern "C" void magma_zherk_mgpu...
ALGO
0.996865
5.219699
{ "github_metadata": { "branch": "master", "commit_count": 67, "repo_created_at": "2014-08-25T14:08:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5504ac3e4...
14fe5194-88cd-4427-8c70-2dab27db677e
delta4d/AlgoSolution
zoj/08/1718.cpp
#include <cmath> #include <cstdio> #include <memory> using namespace std; const double INF = 9876543210.0; const int MAXN = 101; double d[MAXN]; bool visit[MAXN]; struct cell { double x; double y; double z; double r; }c[MAXN]; inline double dis(const cell &a, const cell &b) { double d = (a.x - b.x) * (a.x - b.x)...
ALGO
0.999255
3.591735
{ "github_metadata": { "branch": "master", "commit_count": 154, "repo_created_at": "2013-02-15T16:09:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8ba21ea7...
975e18b4-a2cb-4b0f-8d4b-cfd5f01f4b6d
OshriHalimi/shape_completion
src/benchmark/external/Descartes/external/mem_MeshFix/include/TMesh/edge.h
/**************************************************************************** * TMesh * * * * Consiglio Nazionale delle Ricerche * * Istituto ...
TOOL
0.980039
6.567739
{ "github_metadata": { "branch": "master", "commit_count": 274, "repo_created_at": "2019-09-08T18:57:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 28, "forks": 4, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "8efd9bc...
a0f9b8ce-a5af-4da8-a58f-9a6672e71a24
nlavroffulb/RNA_secondary_structure_prediction_MC
rosenbluth_growth_class.h
#include <vector> #include "math_functions.h" #include "polymer_generation.h" #include "helix_generation.h" #include "helix_struct.h" class rosenbluth_growth { private: //wicks chandler parameters std::vector<double> weights; std::vector<double> energies; //std::vector<int> monomer_limits; public: rosenbluth...
ALGO
0.999716
4.577518
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-08-14T12:25: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": "024b823ba78c...
5ccc7449-dd0c-42ae-8edc-5f5600fdc385
ThibaultMarechal/SortAlgorithm
sortm.cpp
/* * sortm.c * * Created on: Apr 21, 2018 * Author: thibault */ #include "sortm.h" #include <vector> #include <iostream> #include <stdlib.h> using namespace std; vector<int> vectorGenerator(int size, int min, int max) { vector<int> vec(size); for (unsigned int i = 0; i < vec.size(); i++) { vec[i] = ((r...
ALGO
0.998725
5.168415
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-04-22T20:53: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": "df57932d7d...
469d786a-52ca-4981-92aa-41cca2802787
PRCinguhou/NTU_CV_HW
hw3/r07922166_HW3_ver1/main.cpp
// // main.cpp // test // // Created by 李淑貞 on 2018/9/12. // Copyright © 2018年 李淑貞. All rights reserved. // #include <iostream> #include <opencv2/imgcodecs.hpp> #include <stdio.h> #include <opencv2/core/core.hpp> #include "opencv2/highgui/highgui.hpp" #include <opencv2/imgproc/imgproc.hpp> #include <math.h> using...
ALGO
0.99125
4.173798
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2018-09-13T08: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": "b3b98759f5...
7cc04ad0-f6bb-4289-a39d-de9e375bdc6b
Hemanth040304/STL-cpp
unordered_map.cpp
/* insert(): The run time of this method is O(1), insertion in map is done using make_pair find(): The run time of this method is O(1), it returns pair of key and value to us. size(): The run time of this method is O(1) [] bracket operators: The run time of this method is O(1), if the key exists, then it returns a r...
TOOL
0.901888
3.773388
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2023-03-14T13:23:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "508b1e40ea0...
545855a6-c7a5-4dbb-9be5-42f83ae2b55a
Muskan-1527/Data-structure-And-Algorithm
Algorithmic Tools/Week 4/Binary Search.cpp
#include<bits/stdc++.h> using namespace std; int binary_search(int a[] , int n , int x) { int start = 0; int end = n-1; while(start <= end) { int mid = (start + end)/2; if(a[mid] == x) { return mid; } else if(x < a[mid]) end = mid-1; ...
ALGO
0.999989
4.51022
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2020-06-25T19:05:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "0c3d326b2...
d6be543b-996d-4d71-9ec8-56e8a5e8978f
tcmmichaelb139/Competitive-Programming
Usaco/2019-2020/US-Open/GoldP3.cpp
#include "bits/stdc++.h" using namespace std; int main() { freopen("exercise.in", "r", stdin); freopen("exercise.out", "w", stdout); ios_base::sync_with_stdio(0); cin.tie(0); long long n, MOD; cin >> n >> MOD; auto add = [&](long long a, long long b) { return (a + b) % MOD; }; auto mu...
ALGO
0.999993
4.435822
{ "github_metadata": { "branch": "main", "commit_count": 267, "repo_created_at": "2021-02-18T22:39: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": "47afce7982...
24c47d7c-3d53-4f52-9255-899dcfb49a9f
wisdompeak/LeetCode
Dynamic_Programming/2338.Count-the-Number-of-Ideal-Arrays/2338.Count-the-Number-of-Ideal-Arrays.cpp
using LL = long long; LL M = 1e9+7; class Solution { LL dp[10001][15]; // dp[i][j]: how many distinct ways to put j same factors in the first i positions (allowing multple factors in the same position) public: int idealArrays(int n, int maxValue) { dp[0][0] = 1; for (int i=1; i<=n; ...
ALGO
0.999991
4.941571
{ "github_metadata": { "branch": "master", "commit_count": 8912, "repo_created_at": "2017-03-01T10:30:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6018, "forks": 1314, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "a...
ca3724c6-3bc3-4e6d-ae41-6276ebc9ddec
kapishps/AlgoDS
HackerEarth/DisjointSet/city-and-fireman-vincent.cpp
#include <iostream> #include <algorithm> using namespace std; int parent[1001],rnk[1001]; int mod=1000000007; int findset(int x) { if(x != parent[x]) parent[x] = findset(parent[x]); return parent[x]; } void unionset(int x, int y){ x = findset(x), y = findset(y); if (rnk[x] < rnk[y]) p...
ALGO
0.99997
4.624181
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2016-07-09T19:34:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e6548d64b...
7683d3c3-82ad-4c74-9de0-517c854f3a2d
aliammari1/Leetcode_problems
solutions/reverse-vowels-of-a-string/Wrong Answer/9-10-2023, 2_55_50 PM/Solution.cpp
// https://leetcode.com/problems/reverse-vowels-of-a-string class Solution { public: string reverseVowels(string s) { string s1; int start = 0, end = s.length() - 1; while(start <= end) { if(s[start] == 'a' || s[start] == 'e' || s[start] == 'i' || s[start] == 'o' || s[st...
ALGO
0.999935
6.255371
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2023-09-17T20:50: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": "ce3152c37abd...
b66ece89-e416-4704-bd77-702d61a61cfc
thegamer1907/Code_Analysis
DP/2868.cpp
#include <iostream> using namespace std; typedef long long LL; const LL MOD = 1000000007; LL n, k; LL cnt[4002], c[4002][4002]; void init() { for (int i = 0; i <= 4000; i ++) c[i][0] = 1; for (int i = 1; i <= 4000; i ++) for (int j = 1; j <= i; j ++) c[i][j] = (c[i-...
ALGO
0.999923
4.141742
{ "github_metadata": { "branch": "master", "commit_count": 73, "repo_created_at": "2019-05-24T10:35:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8c4dbac95...
d4e92398-2698-4d56-902d-e02c2d874ac4
mmatrosov/FKN2020
preliminary/G/33915625.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define ul unsigned long #define ld long double #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") using namespace std; using namespace __gnu_pbds; //...
ALGO
0.999912
4.011293
{ "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": "5b8378925...
66caf106-c18a-4ac7-9d16-a5487850fa26
niloo30/GFG
Difficulty: Medium/k largest elements/k-largest-elements.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: vector<int> kLargest(vector<int>& arr, int k) { // Your code here //min heap priority_queue<int,vector<int>,greater<int>> pq; for(int ele:arr) ...
ALGO
0.999708
6.553825
{ "github_metadata": { "branch": "main", "commit_count": 128, "repo_created_at": "2025-02-06T08:54: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": "9c76be8574...
132414e2-bb5c-4a07-8adc-ba3d54cb4437
teju85/programming
euler/p160.cpp
// // Challenge name: Problem 160 // Difficulty : medium // Link : http://projecteuler.net/index.php?section=problems&id=160 // Compile : g++ -Wall -g -o p160 p160.cpp // Run : ./p160 // #include <stdio.h> #define INT unsigned long long int INT last5digits(INT n) { INT prod = 1; f...
ALGO
0.999801
5.754919
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2014-11-09T03:31:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a18d8f4aa...
75126eaa-9ac3-436b-bb38-cbd8132ff63c
stanford-ppl/Green-Marl
src/backend_gps/gm_gps_bb_rw_analysis.cc
#include <stdio.h> #include "gm_backend_gps.h" #include "gm_error.h" #include "gm_frontend.h" #include "gm_transform_helper.h" #include "gm_traverse.h" #include "gm_rw_analysis.h" #include <set> typedef gm_gps_basic_block gps_bb; extern void gm_flush_reproduce(); //----------------------------------------------------...
TOOL
0.901049
4.979979
{ "github_metadata": { "branch": "master", "commit_count": 1216, "repo_created_at": "2012-01-04T22:00:23.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 102, "forks": 36, "issues": 8, "pull_requests": 1 }, "file_meta": { "content_id": "b35b4...
2aceb310-541d-40dc-a1c8-856b2886fa46
dev1600/Algorithms
Graph/Articulation_point_Tarjan.cpp
#include <bits/stdc++.h> using namespace std; #define V 6 vector<int>graph[V]; void addEdge(int u,int v) { graph[u].push_back(v); graph[v].push_back(u); } void dfs(int u,vector<int> &disc,vector<int> &low,vector<int> &parent,vector<bool> &articulation_point) { static int tim=0; disc[u]=low[u]=tim; ...
ALGO
0.999833
5.147961
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2021-08-19T17:04: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": "1972b79be...
38fbf951-a8a8-4176-8bcf-5748cd8e5e08
ThanhLinh023/University
HelloWorld/Mang2chieu/bai5.cpp
#include<iostream> using namespace std; void input(int a[][50], int &m, int &n, int t) { cout << "Nhap vao mang 2 chieu " << t << " :" << endl; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { cin >> a[i][j]; } } } int main() { int m, n, p, q, a[50][50]...
ALGO
0.999754
3.179799
{ "github_metadata": { "branch": "main", "commit_count": 68, "repo_created_at": "2021-12-28T08:19: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": "094af62d60c...
bc05a5cc-7fb0-4093-bba8-53e577085e18
kyt9613/ALGORITHM_CLASS
기말고사_2.cpp
#include <stdio.h> #include <stdlib.h> struct vertex; struct edge; struct ioedge; struct graph; typedef enum { FRESH, VISITED } status; typedef struct vertex { int name; struct ioedge *inedges; struct ioedge *outedges; int TPOrder; status st; } vertex; typedef struct edge { vertex *origin; vertex *dest; } e...
ALGO
0.999987
3.591785
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2020-09-03T08:00: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": "9424f34e4c63...
bd134cb4-303d-486f-aee5-5778b9a20787
HZX-sparkle/C
Single-linked_list.cpp
#include<stdio.h> #include<stdlib.h> struct node { int data; struct node* next; }; struct node* createList(int data[], int n); void freelst(struct node* h); void printlst(struct node* h); int main() { struct node* header = NULL; int* data, n, i; scanf("%d", &n); data = (int*)malloc(n * sizeof(int)); if (!data)re...
ALGO
0.999752
3.375002
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2022-09-22T09:33: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": "71c226c4f2b...
e370bb58-57b4-48a7-b302-0e1517111ab0
AnshAg111/6Companies30days
Merge Without Extra Space - GFG/merge-without-extra-space.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: //Function to merge the arrays. void merge(long long arr1[], long long arr2[], int n, int m) { // int i=0; // while(i<n){ // if(arr...
ALGO
0.999987
5.277526
{ "github_metadata": { "branch": "main", "commit_count": 224, "repo_created_at": "2023-01-08T16:51: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": "05858b5e98...
f4de09fb-7296-42f0-8f45-94297575f332
gamer943/Test
test/calculate.h
#ifndef _CALCLULATE_H_ #define _CALCLULATE_H_ #include "linkedbinarytree.h" inline int priority_level(char c) { switch(c) { case '+': case '-': { return -3; } case '*': case '/': case '%': { return -2; } default: return 0; } } template<typename T> class Calculate : public LinkedBin...
ALGO
0.999444
3.989585
{ "github_metadata": { "branch": "master", "commit_count": 226, "repo_created_at": "2019-10-17T15:45: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": "edd9ded0...
1eece000-bbca-4903-9cc3-2bce888be3de
yuecharlielee/c-
sprout/69.cpp
#include <algorithm> #include <cstdlib> #include <fstream> #include <functional> #include <iostream> #include <limits.h> #include <math.h> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; long long int a[10000], b[10000], c[10000], current[10000]; int check(int M, int n) { ...
ALGO
0.999993
4.186642
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2021-08-13T17:15: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": "9eb6dd806c6...
bf2a1c97-1ac6-4e9a-9af8-a527b0107c83
moond0wner/telephone_directory.cpp
telephone_directory.cpp
#include <iostream> #include <vector> #include <Windows.h> #include <algorithm> using namespace std; vector<string> names; vector<string> numbers; void delete_contact() { int choose; cout << "Список контактов указан ниже, выберите номер контакта который хотите удалить." << endl; for (size_t i = 1; i <= names.s...
TOOL
0.986046
3.572433
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-11-03T13:09: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": "087d8b0e6265...
269841b4-18c7-4c41-888d-7787f7ddc588
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Phi/top0-100/perfect-rectangle-Solution.isRectangleCover/177852_DoS_Overflow.cpp
parse_object(JsonLexContext *lex, JsonSemAction *sem) { /* * an object is a possibly empty sequence of object fields, separated by * commas and surrounded by curly braces. */ json_struct_action ostart = sem->object_start; json_struct_action oend = sem->object_end; JsonTokenType tok; if (ostart != ...
TOOL
0.982696
5.961037
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-03-22T14:39: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": "8c6d033e97c1...
8da59a3f-f083-41e0-9af7-e5257165d5d9
asleepzzz/nhwc_miopen
src/include/miopen/softmax.hpp
/******************************************************************************* * * MIT License * * Copyright (c) 2017 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * ...
TOOL
0.926702
6.676537
{ "github_metadata": { "branch": "master", "commit_count": 8098, "repo_created_at": "2020-07-15T05:50: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": "a7bde09...
f21c5eb6-7308-420d-b23a-38270794241f
abhijeetp94/Hacktoberfest-21
Zombies_War/ZombiesWar.cpp
#include <iostream> #include <stdlib.h> #include <unistd.h> #include <time.h> using namespace std; int createZombie() { if (rand() % 67 < 10) return 11; else return rand() % 10 + 1; } int main() { srand(time(NULL)); char enter; // game stats int playerAlive...
TOOL
0.910844
3.361279
{ "github_metadata": { "branch": "master", "commit_count": 60, "repo_created_at": "2021-10-04T09:39:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 14, "issues": 1, "pull_requests": 3 }, "file_meta": { "content_id": "a312f84e...
4292dc9d-75c4-4675-b105-9e916a254921
thirofoo/atcoder-archives
abc405/abc405_b_65636446_AC.cpp
/* * Author: through * Submission URL: https://atcoder.jp/contests/abc405/submissions/65636446 * Submitted at: 2025-05-10 21:03:56 * Problem URL: https://atcoder.jp/contests/abc405/tasks/abc405_b * Result: AC * Execution Time: 1 ms */ #include <bits/stdc++.h> #include <atcoder/all> using namespace std; using na...
ALGO
0.999992
3.970206
{ "github_metadata": { "branch": "main", "commit_count": 5513, "repo_created_at": "2022-12-17T09:45:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "bb6b53a8f...
b3100403-b175-49c4-86c8-43e40a70b2a0
kwakjames5/Three-Dollar
056_Majority_element_169/majority_element.cpp
#include "majority_element.h" #include <iostream> #include <vector> #include <map> // link: https://leetcode.com/problems/majority-element/ // date: 6/3/2020 // description: given a nums vector of ints, returns the int that comes up more at least nums.size()/2 int Solution::majorityElement(std::vector<int>& nums) ...
ALGO
0.999892
6.055382
{ "github_metadata": { "branch": "master", "commit_count": 126, "repo_created_at": "2020-03-16T18:03:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4b18b9ba...
8ffc8b7c-bf53-4d68-9689-de3894236170
CamelliaDPG/Camellia
src/Mesh/MeshTopologyView.cpp
// // MeshTopologyView.cpp // Camellia // // Created by <NAME> on 6/23/15. // // #include "MeshTopologyView.h" #include "CamelliaDebugUtility.h" #include "MeshTopology.h" using namespace Camellia; using namespace std; template<typename A> long long approximateSetSizeLLVM(set<A> &someSet) // in bytes { // 48 ...
ALGO
0.943062
6.375848
{ "github_metadata": { "branch": "master", "commit_count": 4441, "repo_created_at": "2012-04-24T18:09:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 15, "forks": 9, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3115d3...
e879edbe-4fc7-43d6-b86f-0c90094b2d0e
Shrimp33/Clock
algorithm/main.cpp
#define prod #include <iostream> #include <stdlib.h> #include "calc.cpp" int main() { #ifdef prod double* arr = new double[4]; arr[0] = 2.2; arr[1] = 1.3; arr[2] = 1.2; arr[3] = 0.1; while (true) { // Get input int int input; std:...
ALGO
0.92291
3.163572
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2023-01-08T02:46:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dab9662b05...
b94da231-6a82-44a1-9af4-461ff9c30fe8
jinnatul/problemSolving
src/CodeForces/0 Codeforces/codeforces 1272A. Three Friends.cpp
#include<bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") /// Typedef typedef long long ll; #define sc1(a) scanf("%lld",&a) #define sc2(a,b) scanf("%lld %lld",&a,&b)...
ALGO
0.999976
5.251928
{ "github_metadata": { "branch": "master", "commit_count": 521, "repo_created_at": "2018-08-06T22:11:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "812bf880...
a3357527-39c0-464b-b37e-a80c1b6fe761
linkumokunn/code_la
TIOJ/1409.cpp
/* ============================================================================= /\ \ / /\ |\ /| |=========== / \ \ / / \ | \ / | | / \ \ / / \ | \ / | | / \ | / \ | \...
ALGO
0.998146
3.584392
{ "github_metadata": { "branch": "main", "commit_count": 104, "repo_created_at": "2021-11-23T02:23: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": "076a1339df...
5fe299d3-08c6-487a-ac4e-c953ef0104de
wpilibsuite/allwpilib
wpilibc/src/main/native/include/frc/simulation/DifferentialDrivetrainSim.h
// Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. #pragma once #include <frc/EigenCore.h> #include <frc/kinematics/DifferentialDriveKinematics.h> #include <frc/system/Li...
ALGO
0.984471
7.303952
{ "github_metadata": { "branch": "main", "commit_count": 7447, "repo_created_at": "2014-09-30T20:51:33.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1185, "forks": 658, "issues": 433, "pull_requests": 134 }, "file_meta": { "content_id": "9...
4fca27e2-838d-4c24-a918-6f442b384786
luobuyu/Code-test-daily
ICPC/2021hanjia/最短路线代/std.cpp
//minamoto #include <bits/stdc++.h> using namespace std; #define getc() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++) char buf[1 << 21], *p1 = buf, *p2 = buf; int read() { int res, f = 1; char ch; while ((ch = getc()) > '9' || ch < '0') (ch == '-') && (f = -...
ALGO
0.999995
3.803082
{ "github_metadata": { "branch": "master", "commit_count": 150, "repo_created_at": "2021-09-10T08:03: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": "3f94f566...
74464c80-af77-4716-bfed-4da07de0849b
mgalang229/Codeforces-1497A-Meximization
sol.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int tt; cin >> tt; while (tt--) { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } // sort the array in non-decreasing order sort(a.begin(), a.end()); // create tw...
ALGO
0.999987
4.160738
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-03-18T12:27: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": "d8c535cfe172...
9b6dd8f0-63d5-4573-bf6a-f73bb606000e
CGAL/cgal
Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h
// Copyright (c) 2013 GeometryFactory (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org). // // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : <NAME> #ifndef CGAL_POLYGON_MESH_PROCESSING_REFINE_H #define CGAL_POLYGON_MESH_PROCE...
ALGO
0.971783
6.451736
{ "github_metadata": { "branch": "master", "commit_count": 113659, "repo_created_at": "2014-10-01T12:22:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5443, "forks": 1475, "issues": 511, "pull_requests": 136 }, "file_meta": { "content_id...
1516810c-1cd1-46aa-a681-a02d0fa83aef
d-nery/aoc
cpp/2024/21.cpp
#include <bits/stdc++.h> #include "../utils/utils.h" using namespace std; // from / to 0 1 2 3 4 5 6 7 8 9 A // 0 ^< ^ ^> ^^< ^^ ^^> ^^^< ^^^ ^^^> > // 1 >v > >> ^ ^> ^>> ^^ ^^> ^^>> >>v // 2 ...
ALGO
0.998736
5.919365
{ "github_metadata": { "branch": "main", "commit_count": 106, "repo_created_at": "2021-12-01T14:26:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "234cfe44d5...
8c2cb815-3823-43f2-b173-503e2f330624
PointCloudLibrary/pcl
surface/include/pcl/surface/on_nurbs/nurbs_solve.h
/* * Software License Agreement (BSD License) * * Copyright (c) 2012-, Open Perception, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code...
ALGO
0.997206
5.841826
{ "github_metadata": { "branch": "master", "commit_count": 14566, "repo_created_at": "2013-02-12T16:40:25.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 10495, "forks": 4656, "issues": 432, "pull_requests": 147 }, "file_meta": { "content_id...
3a184359-749a-40b4-9ac3-e7b9281eeac4
eraDong/RandomThings
ContestSolutions/Codeforces/Round #833 div2/B.cpp
/* 题目意思是找出字符串中子串有多少个diverse,diverse定义为子串出现的 最大相同数字的数量 ≥ 出现不同数字的次数 由于数字只有 0 ~ 9 所以 最坏情况是 0 ~ 9都出现且都出现十次 即 10*10 最大步进≤100 优化后可以 就可以进行暴力 算法复杂度是 O(100 * 10 * n) 犯蠢的点:两个循环是可以枚举完所有子串情况的。 */ #include<iostream> #include<queue> #include<vector> #include<cstring> #include<cmath> #include<algorithm> #includ...
ALGO
0.999738
4.395511
{ "github_metadata": { "branch": "main", "commit_count": 46, "repo_created_at": "2022-10-10T09:11:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1c99f67eed8...
e6942fe9-a400-47e0-976f-b4670fb71d2b
fminkin/game-of-life
SimpleAlgorithm.h
// // Created by fedor on 10/15/16. // #ifndef LIFE_SIMPLEALGORITHM_H #define LIFE_SIMPLEALGORITHM_H #include <thread> #include "BaseAlgorithm.h" #include "Barrier.h" class SimpleAlgorithm : public BaseAlgorithm { private: Field fields[2]; int threadCount, currentField; std::mutex m; Barrier b; st...
ALGO
0.990376
4.990855
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-11-29T01:47:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fcb61650d5...
52798d4f-81c5-416f-8e84-97f4723fbf58
fff123-a11y/Tanchishen
源.cpp
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <time.h> #include <windows.h> #include <stdlib.h> #include <conio.h> #define MY_BUFSIZE 1024 //控制台窗口标题的缓冲区大小 #define INITIALTIME 200 //蛇的状态(上,下,左,右) #define U 1 #define D 2 #define L 3 #define R 4 typedef struct Snake { int x; ...
TOOL
0.994343
3.185148
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-10-12T08:54:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eba86abefcdf...
2a1d04ed-2414-4a40-88e9-df1cc75e559b
KaisHasan/Spoj
Spoj_MDIGITS_Counting_Digits.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int , int> pi; typedef pair<double , int > dpi; typedef pair<long long , long long> pll; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<pi> vpi; typedef unsigned long long ull; #define MP make_pair #define mem(a , v) mems...
ALGO
0.999448
3.834236
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2019-07-07T11:27:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a9b21f9cf0...
8b6beb4f-08cf-48c8-99be-3eede9abb23e
iamar7/Algorithms
graph-algorithms/count_of_ways_n/Count_of_ways_n.cpp
#include <iostream> #include <vector> const int MOD = 1000000007; int size, n; std::vector< std::vector<long long> > multiple (std::vector< std::vector<long long> > a, std::vector< std::vector<long long> > b){ std::vector< std::vector<long long> > res(size); for (int i = 0; i < size; i++) res[i].resize(size); ...
ALGO
0.99995
4.715236
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-10-15T18:45: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": "f53e173526...
7b511446-0427-4d98-b727-7879a052c715
CS340-Group-3/Midterm
src/MovieLibrary.h
#ifndef MOVIELIBRARY_H #define MOVIELIBRARY_H #include "MovieElement.h" #include "Tokenizer.h" #include "UserInput.h" using namespace std; /* * A MovieLibrary manages a list of MovieElements. * The library can parse a CSV file into the movie * list internally, which can be sorted by user input. */ class MovieLib...
ALGO
0.980945
6.60455
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2020-10-12T03:47:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c1324a05d5...
208b6603-2a32-4953-90f0-efdee78aee42
MansiMittal7/LeetCode_Questions
0008-string-to-integer-atoi/0008-string-to-integer-atoi.cpp
class Solution { // public: // int myAtoi(string s) { // long long int i=0 , n=s.length(),sign=1,result=0; // for(long long int i = 0; i<s.size();){ // while(s[i]==' ') i++; //keep increasing i and ignoring blanck spaces // if( s[i]=='+'){ //checking for si...
ALGO
0.9989
4.373258
{ "github_metadata": { "branch": "main", "commit_count": 1230, "repo_created_at": "2023-01-19T05:53: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": "fe7250eb7...
88027b04-8e11-4f75-8946-4a59fa383ce1
Smoooky/42-ft_containers
headers/rbtree.hpp
// // Created by matsony on 19.07.22. // #ifndef FT_CONTAINERS_FINAL_RBTREE_HPP #define FT_CONTAINERS_FINAL_RBTREE_HPP #include <cstdlib> #include <functional> #include "utils.hpp" #include "iterators.hpp" #include "pair.hpp" namespace ft { const int BLACK = 0; const int RED = 1; template<typename Data, typename A...
ALGO
0.960153
6.208897
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2022-10-06T09:11:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7fd986cdbe...