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
892a9420-a0f8-489e-9f3e-32bc6c85cc89
idealisthhh/PTA_Ladder
L2-019.cpp
#include <bits/stdc++.h> #define MAXN 10002 #define Inf 0x7FFFFFFE typedef long long LL; using namespace std; // #define idealist 1 #define singletest 1 /********************************** * 考察 STL map 的运用。 ***********************************/ /******************* CODE *********************/ int n, m; map<str...
ALGO
0.999955
3.514779
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2020-05-25T13:02:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a00b1f4ba...
e6ea7382-513d-4486-9220-9a39e9bb6f38
arush077/dsa_new_notes
graphs/0.IMP/ALL ALGO (IMPORTANT REVISE)/ REVISE/DFS/-1.src to dest tak.cpp
src -------> dest jaana he to u can use dfs or bfs both as simple traverse hi karna he tumhe //prefer bfs over dfs anytime to avoid backchodi recursion shit //also bfs takes up less time //normal bfs code me ek line zyada likna he bas if(node==dst){//do shit + break;} q.insert(src,0); ...
ALGO
0.999486
4.80175
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2023-09-04T07:36: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": "c667fe4c232...
d7294833-47b2-489a-a94b-84f825d45a5c
Phoenix-RK/GeeksForGeeks
Linked List/Given a linked list, reverse alternate nodes and append at the end .cpp
//Phoenix_RK /* https://practice.geeksforgeeks.org/problems/given-a-linked-list-reverse-alternate-nodes-and-append-at-the-end/1 Given a linked list, you have to perform the following task: Extract the alternative nodes from starting from second node. Reverse the extracted list. Append the extracted list at the end...
ALGO
0.999871
6.421864
{ "github_metadata": { "branch": "master", "commit_count": 380, "repo_created_at": "2020-03-27T07:09:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "6c9adc93...
b3d28bf4-910a-4804-9cfc-33239df569bc
Ricky-Ting/coding-in-NJU
C++/2018_practice/OJ3-6(单源最短路)/B.cpp
#include<iostream> #include<cmath> using namespace std; struct node { double x; double dot[4]; }; int n; node b[21]; // barrier double dp[100][4]; void solve(); void input(); int main() { input(); solve(); } void input() { scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%lf%lf%lf%lf%lf",&b[i].x,&b[i].dot[0],&b...
ALGO
0.999622
3.342455
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2018-02-06T10:45: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": "789ec1f4b...
afcbbc8a-78f3-4981-acbc-14383f9ec834
STommydx/cp-templates
examples/abc254_f/main_sparse_table.cpp
#include "../../commons.hpp" #include "../../functional.hpp" #include "../../sparse_table.hpp" #include <cmath> #include <iostream> #include <numeric> using namespace std; int no_of_test_cases = 1; int solve() { int n, q; cin >> n >> q; vll a(n), b(n); cin >> a >> b; vll ad(n), bd(n); adjacent_difference(a.be...
ALGO
0.99975
5.301134
{ "github_metadata": { "branch": "master", "commit_count": 156, "repo_created_at": "2024-03-08T22:44:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "37505bee...
23e3c140-d3fb-40ac-b626-3fa800e46145
MutiaraUtami/MetodeNumerik
eliminasijacobi.cpp
#include <iostream> #include <cmath> using namespace std; #define EPSILON 0.00001 // toleransi kesalahan #define MAX_ITER 1000 // maksimal iterasi int main() { int n = 3; // jumlah variabel (x1, x2, x3) float a[3][3], b[3]; // matriks koefisien dan vektor konstanta float x[3] = {0, 0, 0}; // nilai awal ...
ALGO
0.999996
5.272106
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-03T04:07:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8979ffc578e9...
f3873280-1852-4425-a297-9013de5f01dd
H-Shen/My_Code_Collection
校招Collection/2016/二维数组打印.cpp
// https://www.nowcoder.com/practice/6fadc1dac83a443c9434f350a5803b51 class Printer { public: vector<int> arrayPrint(vector <vector<int>> arr, int n) { const int initial = -123456; for (int i = 0; i < n; i++) { reverse(arr[i].begin(), arr[i].end()); } vector<int> item(2...
ALGO
0.999961
5.023676
{ "github_metadata": { "branch": "master", "commit_count": 1586, "repo_created_at": "2019-04-11T06:48:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "49d659f...
5eeed891-d075-422f-877c-b4e9db61ab27
dustingarner/LeetcodeProblems
Leetcode105.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.99999
6.743478
{ "github_metadata": { "branch": "main", "commit_count": 337, "repo_created_at": "2024-01-04T17:05: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": "ba89d69f98...
3fda2417-194a-4a12-92f7-a4a884e8e72f
catboost/catboost
library/cpp/yt/compact_containers/compact_vector.h
#pragma once #include <util/system/defaults.h> #include <cstdint> #include <iterator> #include <limits> namespace NYT { //////////////////////////////////////////////////////////////////////////////// template <class T> struct TCompactVectorOnHeapStorage; //! A vector-like structure optimized for storing elements...
TOOL
0.977269
7.477932
{ "github_metadata": { "branch": "master", "commit_count": 49562, "repo_created_at": "2017-07-18T05:29:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8472, "forks": 1231, "issues": 604, "pull_requests": 23 }, "file_meta": { "content_id":...
4507538e-fbf2-40a0-bd1b-6104758db013
skystone1000/LeetCode
Problems/#1971. Find if Path Exists in Graph.cpp
// #1971. Find if Path Exists in Graph // https://leetcode.com/problems/find-if-path-exists-in-graph/description/ #include<bits/stdc++.h> using namespace std; // Approach 4: Disjoint Set Union (DSU) // Let n be the number of nodes and m be the number of edges. // Time complexity: O(m⋅α(n)), Space complexity: O(n) cl...
ALGO
0.999907
6.5756
{ "github_metadata": { "branch": "main", "commit_count": 168, "repo_created_at": "2021-05-12T12:39:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a4fe1455b5...
f06626c9-b3d1-462c-aebc-bb99dc2ef89b
Exawind/nalu-wind
include/kernel/Kernel.h
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC // (NTESS), National Renewable Energy Laboratory, University of Texas Austin, // Northwest Research Associates. Under the terms of Contract DE-NA0003525 // with NTESS, the U.S. Government retains certain rights in this software. // // This sof...
TOOL
0.933723
6.578225
{ "github_metadata": { "branch": "master", "commit_count": 2492, "repo_created_at": "2018-05-03T15:39:32.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 137, "forks": 93, "issues": 18, "pull_requests": 7 }, "file_meta": { "content_id": "95dd...
21fb54ad-f789-4ad1-92f4-d65eed5a049d
SuperBigFive/Charming_XCPC
Codeforces/Speicial Round/DP Round1/Z(补).cpp
#include <bits/stdc++.h> #define ll long long #define int ll using namespace std; const int N = 2e7 + 5; int t, c, d, x; int POW2[55]; vector <int> vis (N), prim; void init () {} void sieve () { POW2[0] = 1; for (int i = 1; i < 55; ++i) POW2[i] = POW2[i - 1] * 2; for (int i = 2; i < N; ++i) { if (!vis[i]) prim....
ALGO
0.999783
4.644827
{ "github_metadata": { "branch": "main", "commit_count": 86, "repo_created_at": "2023-03-06T12:05:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "867eacc23bf...
0a45fadc-fd6b-44fa-ab76-f8d9402d55ad
SebSecRepos/cpp-learning
56.Crear_grep/main.cpp
#include<iostream> #include<string> #include<sstream> #include<regex> using namespace std; /* .: Coincide con cualquier carácter. \d: Coincide con un dígito. \w: Coincide con un carácter alfanumérico. []: Clase de caracteres, por ejemplo, [aeiou] coincide con cualquier vocal. *, +, ?: Cuanti...
TOOL
0.935565
4.436586
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-02-26T22:24: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": "12dbc6f5e39...
e5bc7082-9bb5-437e-8003-a06da1b18375
loggerJK/BOJ
14502.cpp
#include <iostream> #include <vector> #include <algorithm> #include <queue> using namespace std; int N = 0, M = 0; typedef struct node { int status; bool visited; }; vector<vector<node>> map; // N X M 지도 vector<pair<pair<int, int>, bool>> zero_nodes_info; vector<pair<int, int>> two_nodes_info; void bfs(vec...
ALGO
0.999983
4.489482
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2020-02-10T12:59:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "972c55dac...
2396e0bf-8a6f-41d9-aaa8-21762e88386f
Odyflame/ProgrammersCodingPractice
2019 카카오 개발자 겨울 인턴십/튜플.cpp
/* 2015112119 ÀÌÇöÀç */ #include <iostream> #include <algorithm> #include <vector> #include <string> #include <sstream> #include <map> #include <set> using namespace std; bool desc(pair<int, int> a, pair<int, int > b) { return a.second > b.second; } vector<int> solution(string s) { vector<int> answer; map<int, in...
ALGO
0.998921
3.733938
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2020-03-15T11:41: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": "6cea8e463...
b4e90872-69d4-49eb-8a59-df1c97b1aece
Rea1kah2/LAB-ALPRO-2
Pertemuan 3/operasi_kondisi.cpp
#include <iostream> using namespace std; int main(){ cout << "Operator Kondisi\n"; cout << "----------------\n"; int nilai; cout << "Masukkan Nilai : "; cin >> nilai; // struktur if-else statement // if(kondisi){ => saat kondisi if = true, maka blok kode if akan dieksekusi, jika false, m...
ALGO
0.963356
3.968367
{ "github_metadata": { "branch": "main", "commit_count": 73, "repo_created_at": "2025-03-07T08:22: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": "c1f60edb6dc...
6d1aa859-253e-4e32-8cc1-ad79b34a532c
Xiiqiing/APP-UCPH
hd1/handin/2_6.cpp
#include "2_6.h" #include <cmath> #include <iostream> double fun(double x) { return exp(x) + pow(x, 3) - 5; } double fun_d(double x) { return exp(x) + 3 * pow(x, 2); } // for-loop // double newton_Raphson(double initialGuess, double epsilon) // { // double x_p = initialGuess, double x_n = x_p - fun(x_p) /...
ALGO
0.999927
3.958979
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-03-31T21:21:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "83477b8624dc...
cdebc18c-b908-4476-af6d-9f07028a71cf
Parnidadu/Eminence-CP-dec
assignment on advance recursion/staircase.cpp
/*A child is running up a staircase with N steps, and can hop either 1 step, 2 steps or 3 steps at a time. Implement a method to count how many possible ways the child can run up to the stairs. You need to return number of possible ways W. */ int staircase(int n){ /* Don't write main(). * Don't read input, it...
ALGO
0.999166
4.181062
{ "github_metadata": { "branch": "master", "commit_count": 195, "repo_created_at": "2018-12-29T07:48:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "85764b6b...
ef5428aa-7970-41f8-a929-ed6ca5bb1367
mksaadi/Coding-Interview-Prep
Leetcode/137. Single Number II.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define FastIO \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define nl "\n" #define all(x) (x).begin(), (x).end() // approach 1: O(N) (my solution) // int singleNumber(vector<int> &nums) // { // int ans = 0; // ...
ALGO
0.999986
4.638277
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2023-02-01T12:05: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": "f8e21173c7a...
81034265-6e44-41aa-a93e-bb79d5c9f627
Vignesh750/Search
binary_search_iterative.cpp
#include <iostream> using namespace std; //! Program to return the index of a key element if it is present in a given array. //! Here we use the Binary search method int binary_search_iterative(int arr[], int n, int key) { int low = 0; // starting index int high = n - 1; // ending index while (low <= high) ...
ALGO
0.999906
5.282244
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2022-09-14T15:04: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": "e3a1d25659...
2b332a52-ec89-4660-94d8-f3a64cbc80c7
TopPano/hugin_lite
src/foreign/vigra/vigra/watersheds.hxx
/************************************************************************/ /* */ /* Copyright 1998-2005 by <NAME> */ /* Cognitive Systems Group, University of Hamburg, Germany */ /* ...
ALGO
0.999858
7.190914
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2015-04-28T11:13:25.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "50cd5d4ecf3...
113c3ba5-a613-4cee-84de-778d0b294947
AGarraffa/Section8_Operators-Statements-Logic
increment/increment.cpp
#include <iostream> using namespace std; int main() { int counter{ 10 }; int result{ 0 }; cout << "Counter: " << counter << endl; // 10 counter++; cout << "Counter: " << counter << endl; // 11 ++counter; cout << "Counter: " << counter << endl; // 12 // as a stand alone statement, the prefix or postfix no...
ALGO
0.957904
4.532537
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-11-16T22:26: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": "14b8a650ba28...
5ff8db6e-16c0-4bfb-8930-a87cfc267920
RDXhada/FMI-Code-Cpp
EGN.cpp
#include <iostream> using namespace std; int main(){ long EGN; cin >> EGN; cout << "The date is: "; int month = (EGN/1000000)%100; int zeromonth = month - 40; //days int days = (EGN/10000)%100; cout << days; //month cout << " "; switch(zeromonth){ c...
ALGO
0.990298
3.251218
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2021-10-21T12:14: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": "8c961a5e54b...
db24b878-916c-4b02-aad2-0d3191bc9056
niklasb/contest-algos
suffixarray_lcp_based.cpp
const int maxn = 200010, maxlg = 18; // maxlg = ceil(log_2(maxn)) struct SA { pair<pair<int,int>, int> L[maxn]; // O(n * log n) space int P[maxlg+1][maxn], n, stp, cnt, sa[maxn]; SA(const string& s) : n(s.size()) { // O(n * log n) rep(i,0,n) P[0][i] = s[i]; sa[0] = 0; // in case n == 1 for (stp = 1, c...
ALGO
0.999989
4.547025
{ "github_metadata": { "branch": "master", "commit_count": 114, "repo_created_at": "2012-10-28T17:43:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 126, "forks": 44, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "94e94...
b5d70e5d-08f3-4874-8a91-18402247585e
FeZar97/ArtOfDeveloping
YellowBelt/YellowBelt53/main.cpp
#include <iostream> #include <vector> #include <sstream> #include <iomanip> #include <string> #include <cmath> #include <memory> using namespace std; class Figure { public: virtual string Name() const = 0; virtual float Perimeter() const = 0; virtual float Area() const = 0; }; class Triangle : public Fig...
ALGO
0.990193
5.90807
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2020-11-13T15:19: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": "3c0a3802a...
a1cb4e90-c0d9-4d33-8705-fd8797f4ac6c
DakshNsut/Data_Structures_and_Algorithms
Array/trapping_rainwater.cpp
#include <iostream> #include <vector> #include <unordered_map> using namespace std; // ------------------------- Method-1 ------------------------- int trapping_rainwater(int arr[], int n){ int *left = new int[n]; int *right = new int[n]; left[0] = arr[0]; for(int i=1; i<n; i++){ left[i] = max...
ALGO
0.99999
6.307949
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-05-19T06:57: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": "bd7f1afb7293...
cd82bb9b-9206-4114-9a69-80945a190aa3
TonChan0828/AtCoder
ABC/ABC286/B.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; // aをbで更新 return true; } return false; } template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; // aをbで更新 return true; } return fal...
ALGO
0.99989
3.401772
{ "github_metadata": { "branch": "master", "commit_count": 1492, "repo_created_at": "2022-04-11T13:21:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3c894db...
43aa4f62-127a-453e-8cb3-1611fabcc210
83demon/Long-integer-multiplication
toom_cook.cpp
// // Created by vo1ku on 19.10.2020. // #include "toom_cook.h" LongIntMult Toom_Cook::multiply(std::vector<int> &a, std::vector<int> &b){ LongIntMult C; vector_len_check(a,b,parts_to_split-1); std::vector<int> res; if(a.size()==3 && b.size()==3){ long long A = C.join(a), B=C.join(b); ...
ALGO
0.999483
3.783776
{ "github_metadata": { "branch": "Labwork2", "commit_count": 18, "repo_created_at": "2022-04-08T16:55: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": "786f0c5...
1e17c4d3-db02-4728-bde4-56aa13ed1557
int-i/ICE2004
psj/week14/hw01/heap.h
// 중복 삽입 방지를 위한 Define Guard #ifndef ICE2004_WEEK14_HW01_HEAP_H #define ICE2004_WEEK14_HW01_HEAP_H #include <cstddef> #include <queue> #include <utility> /** * 배열로 구현되는 힙 클래스 * @tparam T 힙에 담을 타입 * @param cmp 힙 원소 비교자 */ template<typename T, typename Compare = std::greater<T>> class ArrayHeap { public: using ...
ALGO
0.99135
5.8922
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-08-04T15:29:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4f55e20a265...
8521fec0-7d3d-45ee-9ffa-5cde40df78ac
johannesgerer/jburkardt-cpp
linpack_bench/linpack_bench_d.cpp
# include <cstdlib> # include <iostream> # include <iomanip> # include <cmath> # include <ctime> using namespace std; int main ( void ); double cpu_time ( void ); void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy ); double ddot ( int n, double dx[], int incx, double dy[], int incy ); int dge...
ALGO
0.99829
4.787035
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2012-12-02T14:18:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 53, "forks": 41, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b7c430c4...
a28f071d-dc16-47f6-8bca-9e368953e616
alisw/AliPhysics
PWGLF/RESONANCES/AliRsnCutDaughterSigmaStar2010PP.cxx
// // All cuts for single pions in Sigma* analysis 2010, // based on track quality and particle identification // with TPC and TOF. // Author: <NAME>. // // #include <Riostream.h> #include "AliPID.h" #include "AliPIDResponse.h" #include "AliRsnCutDaughterSigmaStar2010PP.h" ClassImp(AliRsnCutDaughterSigmaStar2010PP) ...
DATA
0.943864
4.930825
{ "github_metadata": { "branch": "master", "commit_count": 89208, "repo_created_at": "2016-06-21T19:31:29.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 104, "forks": 792, "issues": 0, "pull_requests": 9 }, "file_meta": { "content_id": "724...
3f3de5a0-0c9d-4af7-aad0-69ec5dadecf1
ROCm/OpenFOAM_HMM
src/finiteArea/finiteArea/fam/famD2dt2.H
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
ALGO
0.994859
5.747414
{ "github_metadata": { "branch": "suyash/hmm", "commit_count": 25733, "repo_created_at": "2022-10-27T12:31:36.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 25, "forks": 4, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "35...
4d1b02b3-2246-47f4-a6ad-784ebf78b571
sakil744/fcfs-fjs-rfjs
Rsjf.c++
#include <iostream> using namespace std; int main() { int n; cout << "Enter the number of processes: "; cin >> n; int pr[n], at[n], bt[n], rt[n], wt[n], tat[n]; double totalWT = 0, totalTAT = 0; for (int i = 0; i < n; i++) { pr[i] = i + 1; } cout << "Enter Arrival Time and Burst...
ALGO
0.999989
4.397486
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-05-20T15:42: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": "8da6fdeb8177...
d040f8f6-f938-43a8-9592-b7395fce7640
agul/contest-tasks
caide_archive/2016-04-10/gcjA/gcjA.cpp
#include "Head.h" #include "IO/IO.h" using namespace std; int __; IO io; const int MOD = 1000000007; const int MAXN = 111111; void solve(istream& ins, ostream& out) { io.assign_files_input_txt(); io >> __; for (int test = 1; test <= __; ++test) { if (test % 10 == 0 || test == __) { cerr << test << endl; } ...
ALGO
0.999769
4.79265
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2020-04-26T23:57:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5ce07e1a0...
4f1a7c0e-15f4-4947-9ce0-3545fd5619d7
lemonadesaltbagel/algorithms
lintcode/134.lru-cache.cpp
#include <list> #include <unordered_map> #include <utility> using namespace std; class LRUCache { private: int capacity; unordered_map<int, list<pair<int, int>>::iterator> m; list<pair<int, int>> l; public: /* * @param capacity: An integer */ LRUCache(int capacity) : capacity(capacity) { // do int...
ALGO
0.998875
6.027384
{ "github_metadata": { "branch": "master", "commit_count": 149, "repo_created_at": "2014-05-01T08:54: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": "976df91d...
f35228b3-acb7-4f95-bf54-03056ec73abf
zmrdltl/problemSolving
boj/algorithm/4일(정수론)/14476.cpp
#include <bits/stdc++.h> using namespace std; int lgcd[1000010], rgcd[1000010], a[1000010], n; int gcd(int a, int b){ if(b == 0) return a; return gcd(b, a%b); } int main(){ cin >> n; for(int i = 1; i <= n; i++) cin >> a[i]; for(int i = 1; i <= n; i++) lgcd[i] = gcd(a[i],lgcd[i-1]); for(int i =...
ALGO
0.999962
3.552283
{ "github_metadata": { "branch": "master", "commit_count": 2037, "repo_created_at": "2020-07-23T07:18:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8d20ae3...
72851f4c-a23b-41fe-93dc-ff6fa05f6a90
91month/Data-structure
非线性三-图-邻接表-遍历.Cpp
//-------- 连通图以邻接表存储时的深度-广度优先搜索遍历-------// // 理解邻接表存储方式方法 //理解连通图以邻接表存储时的深度-广度优先搜索遍历算法及实现 #include <iostream> #include<fstream> using namespace std; #define OK 1 #define ERROR 0 #define OVERFLOW -2 #define MVNum 100 //最大顶点数 #define MAXQSIZE 100 //最大队列长度 bool visited[MVNum]; ...
ALGO
0.99976
3.806902
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2021-01-25T11:27: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": "fea0ae0824...
ab3d9ca0-a573-471c-9940-6e361f4d2208
zumayamx/ComputationalMethods
5_2_actividad/sumPrimeAsync.cpp
/* * Adding into a single variable from multiple threads * Using a mutex to protect the variable * * Base code from <NAME> * * <NAME> * 2024-06-07 */ #include<stdio.h> #include<stdlib.h> #include<pthread.h> #include<cmath> #define DEFAULT_NUMBER 5000000 // Structure to send data to the threads typedef struc...
ALGO
0.994803
4.937358
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2024-04-27T03:58: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": "e62f105446c...
894e1128-e4fa-4be8-a5c9-5f67b0653713
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Gemma/top0-100/lfu-cache-LFUCache.update/177812_Bypass.cpp
void sum_update(const char *p, int32 len) { switch (cursum_type) { case CSUM_MD5: md5_update(&md, (uchar *)p, len); break; case CSUM_MD4: case CSUM_MD4_OLD: case CSUM_MD4_BUSTED: if (len + sumresidue < CSUM_CHUNK) { memcpy(md.buffer + sumresi...
ALGO
0.997353
5.263718
{ "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": "d8d26de30227...
bc7b9d09-70f3-444f-a27e-7208633fe4aa
ZikXewen/Submissions
laptop/thailandoi/o61_oct_hopper.cpp
#include <bits/stdc++.h> using namespace std; const int MXN = 3005; int N, M, v[MXN], mm[MXN]; vector<int> g[MXN]; int dfs(int u){ if(!mm[u]) for(int v: g[u]) mm[u] = max(mm[u], dfs(v) + 1); return mm[u]? mm[u] : ++mm[u]; } int main(){ scanf("%d %d", &N, &M); for(int i = 0; i < N; i++) scanf("%d", &v[i]); int l = ...
ALGO
0.999973
3.251159
{ "github_metadata": { "branch": "master", "commit_count": 104, "repo_created_at": "2019-11-09T11:34: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": "0f9eebb8...
c5754d33-28fc-463c-b392-1bbdb8ea7797
wanimaru47/AOJ
volume11/cpp/aoj1196.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> P; typedef vector<P> vec; typedef vector<vec> mat; const int INF = 1 << 28; mat v; int long_path(int now, int pre, int d) { if (v[now].size() == 1) return 0; int ret = 0; for (int i = 0; i < v[now].size(); i++) { if (v[now][i].s...
ALGO
0.999968
3.51741
{ "github_metadata": { "branch": "master", "commit_count": 444, "repo_created_at": "2014-08-24T01:15:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "e6f40ddd...
5a2be724-0fd0-4c79-83a9-a6c798ff85cb
ishandutta2007/codeforces-k
krk/normal/436/C.cpp
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> using namespace std; typedef pair <int, int> ii; const int Maxk = 1005; const int Maxn = 12; int n, m, k, w; char B[Maxk][Maxn][Maxn]; vector <ii> W[Maxn * Maxn]; int comp, siz[Maxk], par[Maxk]; vector <int> neigh[Maxk]; bool taken[Maxk]; in...
ALGO
0.999885
3.183802
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9343cbb149f2...
f3c4fbad-2c8d-4ba1-9049-d942f38a131d
saubhik/LeetCode.cc
src/leetcode/flip-string-to-monotone-increasing.cc
class Solution { public: /* int minFlipsMonoIncr(string s) { int n = s.length(); int leftFlips[n + 1]; int rightFlips[n + 1]; leftFlips[0] = 0; for (int i = 1; i <= n; ++i) { leftFlips[i] = leftFlips[i-1] + (s[i-1] - '0'); } rightFlips[n] = 0; int ans = leftFlips[n]; for...
ALGO
0.999978
5.258373
{ "github_metadata": { "branch": "master", "commit_count": 304, "repo_created_at": "2019-10-27T01:16: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": "b77f3853...
77c67386-026d-43e9-95e3-f1c59b541ac5
Mohamed-Nasser-M/Problem-Solving-Training
phase-2-1/Codeforces/Data Structures/505B - Mr. Kitayuta's Colorful Graph.cpp
/* ----------------- إِنَّا لا نُضِيعُ أَجْرَ مَنْ أَحْسَنَ عَمَلا ----------------- */ #include <bits/stdc++.h> #define IOS ios::sync_with_stdio(false);cin.tie(0); #define ll long long #define ld long double #define For1(n) for(int i=0; i<n; i++) #define For2(n) for(int j=0; j<n; j++) #define test int t; cin >> t; w...
ALGO
0.999946
4.214343
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2024-04-09T11:27:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "343ff3744c2...
a0d4cb50-c3be-4261-81fb-239aef44aba0
trilinos/Trilinos
packages/galeri/src-epetra/CrsMatrices/Galeri_BentPipe2D.h
// @HEADER // ***************************************************************************** // Galeri: Finite Element and Matrix Generation Package // // Copyright 2006 ETHZ/NTESS and the Galeri contributors. // SPDX-License-Identifier: BSD-3-Clause // *********************************************************...
ALGO
0.994472
5.988307
{ "github_metadata": { "branch": "master", "commit_count": 104031, "repo_created_at": "2015-11-16T19:39:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1299, "forks": 593, "issues": 263, "pull_requests": 61 }, "file_meta": { "content_id":...
0d9b0b23-e1e7-48fe-9e1d-1b9f5ec86b86
ishandutta2007/codeforces-i
itst/normal/1042/F.cpp
#include<bits/stdc++.h> //This code is written by Itst using namespace std; inline int read(){ int a = 0; char c = getchar(); bool f = 0; while(!isdigit(c)){ if(c == '-') f = 1; c = getchar(); } while(isdigit(c)){ a = (a << 3) + (a << 1) + (c ^ '0'); c = getchar(); } retur...
ALGO
0.999901
3.801297
{ "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": "eb95d002c855...
678268aa-dda4-430f-98e9-f56a538b2c1f
Kawser-nerd/CLCDSA
Source Codes/AtCoder/agc002/C/3461080.cpp
#include <iostream> #include <bitset> #include <fstream> #include <string> #include <cstring> #include <cmath> #include <cstdlib> #include <ctime> #include <vector> #include <algorithm> #include <numeric> #include <map> #include <set> #include <stack> #include <queue> #include <deque> #include <functional> #include <cc...
ALGO
0.999925
3.185738
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2019-09-30T05:38:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 8, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "ca221b28...
dac54043-51fc-4b9d-9eed-aa635e06783e
hyunwoo0318/Algorithm
Algorithm/13549.cpp
//#include<iostream> //#include<queue> //#include<deque> // //#define MAX_COST 100040 // //using namespace std; // 일반적인 bfs 풀이 //bool visited[100001] = { false }; //int check[100001] = {}; // //int main() //{ // queue<int> q; // int n, k; // cin >> n >> k; // int ans = 0; // // q.push(n); // visited[n] = true; // whi...
ALGO
0.999935
3.888782
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2022-03-03T09:21: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": "5c5c9855f...
9d968fe0-37e4-4770-9550-a8ea7dafa154
GersonCavalheiro/OpenMPSnapshot
May2023/RepCPP/204892746/main.cc
#include <cstdlib> #include <cstdio> #include <math.h> #include <mpi.h> #include <omp.h> #include <assert.h> #include "L.h" float * simulate(const float alpha, const long n_segments, const int n_steps, float *d_buf1, float *d_buf2, const int rank, const int world_size, const long segments_per_process); float * simul...
ALGO
0.99997
4.630524
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2024-08-19T17:35:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "41999c3744...
9bdcad50-d89b-4946-bc55-5831b7b26be5
picaresquepicaro/leetcode
tree/postorder.cpp
#include <iostream> #include <vector> #include <math.h> #include <stdio.h> #include <list> #include <algorithm> #include <set> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullp...
ALGO
0.999984
5.296868
{ "github_metadata": { "branch": "main", "commit_count": 37, "repo_created_at": "2024-04-20T22:59: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": "3543020fcfc...
b7dc8cc6-5d1c-4837-81cf-36ab0d97d9eb
iamrishiksahu/cpp-practice
Basic Maths/euclidAlgoToFindGCD.cpp
#include <iostream> using namespace std; // Question: Find the GCD of a and b. GCD = HCF int findGCD(int a, int b) { /* Approach: Euclid algorithm states that if you subtract the numbers a and b then the resulting number and b will also have the same GCD as was in a and b. and if you con...
ALGO
0.999875
5.010973
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-01-13T14:09:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d4660fbfbd40...
b44bde21-0327-4d11-a94c-6160a032873e
MilaHalko/S2_Coursework-OP
SLAR_tests/SLAR_tests/classMatrix.cpp
#include "classMatrix.hpp" Matrix::Matrix(int size, float e, vector<vector<float>> &A, vector<float> &B): size(size), e(e), iterationCounter(0) { this->A.resize(size); this->B.resize(size); this->X.resize(size); this->oldX.resize(size); for (int i = 0; i < size; i++) { this->A[i].resiz...
ALGO
0.999595
4.194448
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2021-05-13T12:22: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": "babb6950e7e...
e4e06a50-dabb-492b-a173-5de5664fc41a
onionhoney/codesprint
judge/sessions/Codesprint_individual/yizhu621@gmailcom/PB_02.cc
// // main.cpp // CodesprintLA ProblemB // // Created by <NAME> on 1/28/17. // Copyright © 2017 <NAME>. All rights reserved. // #include <iostream> using namespace std; int main(int argc, const char * argv[]) { int tc; cin >> tc; int size[tc]; for (int i = 0; i < tc; i++) { size[i] = 0...
ALGO
0.998861
4.523311
{ "github_metadata": { "branch": "master", "commit_count": 52, "repo_created_at": "2018-04-17T22:14: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": "0a77cd6ac...
eb863054-1db3-44d7-9069-c477c0a93e18
GarrettXUPT/ADT
BinaryTree/Splay.cpp
#include"Splay.h" template<typename T> BinNodePosi(T) Splay<T>(BinNodePosi(T) v) { if (!v) return nullptr; // 若v结点不存在,则直接返回空指针 BinNodePosi(T) p; BinNodePosi(T) g; // 建立v的父节点与祖父节点 while ((p = v->parent) && (g = p->parent)) { // 直下而上,反复对v做双层扩展 BinNodePosi(T) r = g->parent; // 每轮都以v的元祖父为父 if (IsLChild(*v)) { ...
ALGO
0.999934
3.846112
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2020-10-15T03:19: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": "1a4b30490ca...
e8725e62-a332-45d9-937a-6d69ee4b59e6
TheRadDani/DSA
binarySearch.cpp
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run a...
ALGO
0.999676
5.774102
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-03-20T01:06: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": "fade35a70a69...
6b968c7a-bacc-4f69-87c2-f0af2b43eef4
OpenMS/OpenMS
src/openms/extern/IsoSpec/IsoSpec/marginalTrek++.cpp
/* * Copyright (C) 2015-2020 <NAME> and <NAME>. * * This file is part of IsoSpec. * * IsoSpec is free software: you can redistribute it and/or modify * it under the terms of the Simplified ("2-clause") BSD licence. * * IsoSpec is distributed in the hope that it will be useful, * but WITHOUT ANY WAR...
ALGO
0.999577
4.659912
{ "github_metadata": { "branch": "develop", "commit_count": 34896, "repo_created_at": "2014-01-09T10:15:13.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 518, "forks": 358, "issues": 638, "pull_requests": 64 }, "file_meta": { "content_id": ...
72cef5d4-1f5e-46f7-9f48-d497fcade4ab
xunzhang/paracel
alg/clustering/sc_driver.cpp
/** * Copyright (c) 2014, Douban Inc. * All rights reserved. * * Distributed under the BSD License. Check out the LICENSE file for full text. * * Paracel - A distributed optimization framework with parameter server. * * Downloading * git clone http://code.dapps.douban.com/paracel.git * * Authors: <NAME...
ALGO
0.923292
5.232018
{ "github_metadata": { "branch": "develop", "commit_count": 332, "repo_created_at": "2013-11-08T10:37:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 23, "forks": 5, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "79ea63...
dd49db7d-98a0-4af5-9261-72387b73fef7
rajvardhan1110/Codeforces
virtual contest/984_div3/Q3.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll MOD = 1000000007; // 1e9 + 7 void inputV(vector<ll> &v, int size) { v.resize(size); for (int i = 0; i < size; i++) { cin >> v[i]; } } void printV(const vector<ll> &v) { for (ll val : v) { cout << val << "...
ALGO
0.999953
5.409205
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-03-28T15:17: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": "251330d9899e...
1c533608-5e0b-4397-9160-7c9f19e5465b
yongsyongs/BOJ-solutions
solutions/class2/9012.cpp
#include <iostream> #include <stack> #include <cstring> using namespace std; int main() { int T; cin >> T; bool *result = new bool[T]; for(int a = 0; a < T; a++) { char str[51] = {}; cin >> str; bool isBalanced = true; stack<char> stack; for(int i = 0; i...
ALGO
0.999863
4.805051
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2022-10-08T05:04: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": "1e4acd9ec9a...
b0315eb1-f589-4bea-8574-060522412dc1
BBB965/BAEKJOON_ALGORITHM
프로그래머스/lv3/92344. 파괴되지 않은 건물/파괴되지 않은 건물.cpp
#include <string> #include <vector> using namespace std; int accum[1010][1010] = {0,}; int solution(vector<vector<int>> board, vector<vector<int>> skill) { int N = board.size(); int M = board[0].size(); int answer = N * M; for (int i = 0; i < skill.size();i++) { int type = skill[i][0]; ...
ALGO
0.999924
5.554917
{ "github_metadata": { "branch": "main", "commit_count": 228, "repo_created_at": "2023-05-30T01:26:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b5e672effe...
3e6e6ad3-775c-4b6b-b530-8d2ebeb49ef5
Acver14/forCodingTest
before 2022.04.27/BaekJoon/BruteForce/C++/13460.cpp
//2021.09.30 #include<iostream> #include<vector> using namespace std; char a[10][10]; int n, m; int cnt = 0; int ans = 0; class pos{ public: int x, y; char c; pos(int X, int Y, char C){ x = X; y = Y; c = C; } pos(){ x = y = c = 0; } }; pos R, B; int moveLeft(p...
ALGO
0.999876
3.578115
{ "github_metadata": { "branch": "main", "commit_count": 203, "repo_created_at": "2021-06-09T13:18: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": "f7f78df7b5...
d4a30f3f-cc77-4477-9c2f-3137d9f02463
SakshamSahgal/Competitive-Programming
Codeforces + Codechef/Append for OR.cpp
#include<bits/stdc++.h> #define lli long long int #define ld long double #define GO_FAST ios_base::sync_with_stdio(0);ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); // basic debugging macros lli __i__,__j__; lli inf = 9e18; #define line_printer(l) cout<<"\n"; for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl; #define...
ALGO
0.999356
3.430797
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2021-12-26T10:02: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": "e0d00c56332...
4610ec40-e58e-47fa-94db-3d5a59705a2a
Chenpi-Sakura/algorithm_practice
cpp/Self-Improvement/WebRecord/luogu/DataStruct/LinearDataStruct/P1160.cpp
/* P1160 队列安排 题目描述 一个学校里老师要将班上 N 个同学排成一列,同学被编号为 1~N,他采取如下的方法: 1. 先将 1 号同学安排进队列,这时队列中只有他一个人; 2. 2~N 号同学依次入列,编号为 i 的同学入列方式为:老师指定编号为 i 的同学站在编号为 1~(i-1) 中某位同学(即之前已经入列的同学)的左边或右边; 3. 从队列中去掉 M 个同学,其他同学位置顺序不变。 在所有同学按照上述方法队列排列完毕后,老师想知道从左到右所有同学的编号。 输入格式 第一行一个整数 N,表示了有 N 个同学。 第 2~N 行,第 i 行包含两个整数 k,p,其中 k 为小于 i 的正整数,p 为 0 或...
ALGO
0.999987
4.082431
{ "github_metadata": { "branch": "main", "commit_count": 62, "repo_created_at": "2024-10-21T12:31:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "496b88c41e3...
96dbf92c-59c0-47f5-88a9-f5076a0c8b53
crackersamdjam/DMOJ-Solutions
DMOPC/dmopc16c4p6.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define sc(x) do{while((x=getchar())<'0'); for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0');}while(0) char _; #define MM 1000002 #define f first #define s second int a[MM],N,Q,xk,yk; ll cnt[MM]; //number of contiguous subseqs with index as smalle...
ALGO
0.999968
4.039902
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2021-08-08T18:36: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": "838e3731e...
ce3963c4-2471-40ee-a075-af9a43bb2859
brett-swiecicki/RouletteStrategy
RouletteStrategy/OptimalSimProcessor.h
//<NAME> #ifndef OPTSIM_H #define OPTSIM_H #include <future> #include <thread> #include "ProcessorCommons.h" #include "SimSolution.h" #include "Simulator.h" using namespace std; class SimStakeFinder { public: SimStakeFinder(ProcessorCommons& p_commons_in, Solution* global_sol_in) : osp_commons(p_commons_in), glo...
ALGO
0.999835
4.782983
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2017-06-24T05:04: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": "9a62e9861...
05dacd11-975e-4514-969f-c0260c18b3f4
msneddon/nfsim
src/NFreactions/reactantLists/reactantTree.cpp
/* */ #include "reactantTree.hh" #define DEBUG_MESSAGE 0 #include <math.h> using namespace NFcore; ReactantTree::ReactantTree( unsigned int reactantIndex, TransformationSet *ts, unsigned int init_capacity) { //cout<<"Creating reactant tree... "<<endl; //cout<<" Initial Capacity: "<< init_capacity <<"...
ALGO
0.940291
3.663352
{ "github_metadata": { "branch": "master", "commit_count": 209, "repo_created_at": "2015-03-19T16:46:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 17, "forks": 18, "issues": 12, "pull_requests": 1 }, "file_meta": { "content_id": "b7792...
024ba803-b228-4e4f-87ed-8144537de582
wiwitrifai/competitive-programming
icpc/acpc2015/fractionstellar.cpp
#include <bits/stdc++.h> using namespace std; long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; } long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; } int main() { int t; scanf("%d", &t); while(t--) { long long a, b, c, d; scanf("%lld%lld%lld%lld", &a, &b, ...
ALGO
0.999216
5.156839
{ "github_metadata": { "branch": "master", "commit_count": 628, "repo_created_at": "2016-05-21T12:11:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 37, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8f23024...
645584c4-a4cf-48c5-8b7b-2c28570c108c
ialhashim/3d-workspace
MathLibrary/Bounding/MinOBB2.cpp
// Geometric Tools, LLC #include "MinOBB2.h" MinOBB2::MinOBB2 (std::vector<Vector2> &points) { // Get the convex hull of the points. std::vector<Vector2> hullPoints; ConvexHull2 hull(points); int hullNumSimplices = hull.getNumSimplices(); std::vector<int> hullIndices = hull.getIndices(); int numPoints ...
ALGO
0.999077
7.291034
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2015-03-13T03:20:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 32, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "851c254...
b4283484-45c2-41f7-9cc5-da8016e29e33
cheremnov/Parallel_Computing_CMC_2020
Task2/tsk2_vector.cpp
#include "tsk2_vector.h" #include "tests/test_Vector.h" #include <mpi.h> #include <chrono> #include <cassert> typedef std::chrono::high_resolution_clock Time; typedef std::chrono::milliseconds ms; typedef std::chrono::duration<float> fsec; /** * Calculate a dot product of the two vectors * They must be the same size...
ALGO
0.983011
5.754456
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2020-09-20T16:42: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": "ad18c7a6e...
272bdc1e-837a-4fda-b307-140291bbeeec
Oracynx/Source-Code
Problem/Luogu/P3939.cpp
#include <cmath> #include <cstdio> #include <cstring> #include <string> using namespace std; #define reg struct control { int ct, val; control(int Ct, int Val = -1) : ct(Ct), val(Val) { } inline control operator()(int Val) { return control(ct, Val); } } _endl(0), _prs(1), _setprecis...
ALGO
0.999979
4.587355
{ "github_metadata": { "branch": "master", "commit_count": 682, "repo_created_at": "2023-12-24T08:55: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": "99edfa19...
e8aa3f8a-ad81-4288-86b2-f17e42971777
hesuhesu/Git-chana
Baekjoon_Algorithm_solved/1406(에디터)/1406.cpp
#include <iostream> #include <stack> using namespace std; int main() { int M; string str = ""; stack<char> left; stack<char> right; cin >> str; for (int i = 0; i < (int)str.size(); i++) { left.push(str[i]); } cin >> M; for (int i = 0; i < M; i++) { char ...
ALGO
0.999894
4.403639
{ "github_metadata": { "branch": "main", "commit_count": 1274, "repo_created_at": "2022-03-08T02:22:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "90c2539ad...
d4259c82-5cbc-4fcf-97fc-c2bf060556ad
mjerkovi/Lottery_Scheduler_FreeBSD
usr/ports/editors/fxite/files/patch-src__help.cpp
--- src/help.cpp.orig 2013-10-03 09:22:51 UTC +++ src/help.cpp @@ -36,6 +36,12 @@ #define sendString(iMessage, wParam, lParam) sendMessage(iMessage, wParam, reinterpret_cast<long>(lParam)) +#ifdef FOX_1_7_50_OR_NEWER +# define RxFind(rx,subj,start,beg,end,npar) (rx.search(subj,strlen(subj),start,strlen(subj),FXRex...
TOOL
0.91594
5.48075
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-03-05T01:58:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 3, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "b4d63f8277...
0ed15856-a6c1-4089-a350-2447b733dd5c
phitronio/Batch-4-Basic-Data-Structures
Module 18/max_height.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: int val; Node *left; Node *right; Node(int val) { this->val = val; this->left = NULL; this->right = NULL; } }; Node *input_tree() { int val; cin >> val; Node *root; if (val == -1) r...
ALGO
0.998911
3.882029
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-11-27T09:01:17.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 58, "forks": 30, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b269c02d5c...
a8e222f5-e4d4-402a-aade-87ea9f213b91
dhanashreek89/MRPlus_agent
sample_app.h
#include "map_reduce.h" using namespace map_reduce; template<typename KeyType, typename ValueType> class MyMapper : public Mapper<KeyType, ValueType> { int inputSize; int iter; int stat; string word; public: MyMapper(MRContext<KeyType, ValueType> ctx) : Mapper<KeyType, ValueType>(ctx), inputSize(0), iter(0), ...
ALGO
0.916545
3.364233
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2016-07-19T22:30: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": "42265faef1...
a98be80b-6a0a-4da4-b0b7-5bad7ae62b7b
uxth/leetcode
cpp/70.climbing-stairs.cpp
/* * @lc app=leetcode id=70 lang=cpp * * [70] Climbing Stairs * * https://leetcode.com/problems/climbing-stairs/description/ * * algorithms * Easy (48.42%) * Likes: 5720 * Dislikes: 183 * Total Accepted: 862.1K * Total Submissions: 1.8M * Testcase Example: '2' * * You are climbing a staircase. It ...
ALGO
0.999985
5.71961
{ "github_metadata": { "branch": "main", "commit_count": 202, "repo_created_at": "2023-08-31T18:12:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "37a4e92b97...
8c1647a7-6061-40a3-8fb8-0b3c2f1a6a32
kai824/personal_projects
Competitive Programming/Code_archive/dj subs/cute/234278_ans.cpp
// ans.cpp 28 Oct 17, 14:47:19 100 0 Judging completed in 4.359s on AWS Oregon. #include <bits/stdc++.h> using namespace std; bool hasEnding (string fullString,string ending) { if (fullString.length() >= ending.length()) { return (0 == fullString.compare (fullString.length() - ending.length(), ending.lengt...
ALGO
0.999942
3.746903
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2021-12-27T04:41:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "02e29629c0ac...
7825abba-9dbc-48c8-b245-26326f338f61
VinVash/450-DSA
Striver/Graph/8. number-of-islands/main.cpp
#include <bits/stdc++.h> using namespace std; // Space complexity: O(N^2) - visited matrix + O(N^2) - if all the elements are 1 (queue space) // Time complexity: O(8 * N^2) ~ O(N^2) void bfs(int r, int c, vector<vector<int>> &vis, vector<vector<char>> grid) { vis[r][c] = 1; queue<pair<int, int>> q; q.push({ r, c })...
ALGO
0.999937
6.032942
{ "github_metadata": { "branch": "main", "commit_count": 143, "repo_created_at": "2022-07-05T10:42:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "09fcca5785...
ffc18654-2002-42d5-9cce-fb6320996883
fengjiran/leetcode_practice
solutions/0306-additive_number/additive_number.cpp
// // Created by richard on 12/27/23. // #include "utils.h" namespace AdditiveNumber { class Solution { public: bool isAdditiveNumber(std::string num) { int n = num.size(); if (n < 3) { return false; } for (int secondStart = 1; secondStart < n - 1; secondStart++) { ...
ALGO
0.999251
6.882777
{ "github_metadata": { "branch": "main", "commit_count": 251, "repo_created_at": "2023-12-24T08:37: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": "f97c1d35d6...
d0086bd2-43bf-4f43-a3ac-0d35334318b5
ishandutta2007/codeforces-f
fanache99/normal/1498/B.cpp
#include <iostream> #include <fstream> #include <vector> #include <algorithm> #include <stack> #include <cassert> #include <map> #include <numeric> #include <cstring> #include <set> #include <ctime> #include <queue> #include <cmath> #include <iomanip> #include <iterator> #include <bitset> #include <unordered_map> usin...
ALGO
0.999847
3.950775
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:43: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": "ba33b27f1f1f...
22788388-755f-4511-8f90-b76ec3a2c895
zhaohuanzhendl/algorithm
leetcode/tree/Binary_Tree_ZigZag_Level_Order_Traverse.cc
/* * Filename Binary_Tree_ZigZag_Level_Order_Traverse.cc * CreateTime 2017-03-16 01:31:36 * * Copyright (C) <NAME> * Copyright (C) <EMAIL> */ #include <iostream> #include <algorithm> #include <vector> #include <queue> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *ri...
ALGO
0.999995
5.875229
{ "github_metadata": { "branch": "master", "commit_count": 83, "repo_created_at": "2016-12-15T07:18: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": "660e88b0b...
e24184f4-7abe-4ab9-beeb-f201d08d39ac
OpenMatrixLanguage/Continuous_Integration_Linux_OS66
third_party/intel/compilers_and_libraries_2019.5.281/linux/mkl/benchmarks/hpcg/src/CG_ref.hpp
/******************************************************************************* * Copyright 2014-2019 Intel Corporation. * * This software and the related documents are Intel copyrighted materials, and * your use of them is governed by the express license under which they were * provided to you (License). Unle...
ALGO
0.993503
6.203629
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2019-06-24T18:43:26.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1e7cdf7ed1...
6ad61e92-af94-44c2-98ce-ba101888bac4
KimSeongYong1992/Algorithm-Practice
백준/Platinum/16975. 수열과 쿼리 21/수열과 쿼리 21.cc
#include <iostream> #include <vector> #include <queue> using namespace std; struct NODE { int iMin; int iMax; long long llAdjust = 0; }; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int iNum = 0; cin >> iNum; vector<NODE> vecSeg; vector<long long> vecData; vecSeg.resize(iNum...
ALGO
0.999645
4.208079
{ "github_metadata": { "branch": "main", "commit_count": 293, "repo_created_at": "2024-04-23T02:15: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": "d097dce105...
4966b0e8-809f-48b4-b2ba-11efd62a89f6
abhishek12328/Coding-Practice-Problems-and-Solutions
Backtracking/NQueens.cpp
/*The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. N Queens: Example 1 Given an integer n, return all distinct solutions to the n-queens puzzle. Each solution contains a distinct board configuration of the n-queens’ placement, where 'Q' and '.' bo...
ALGO
0.999611
4.80443
{ "github_metadata": { "branch": "main", "commit_count": 262, "repo_created_at": "2021-05-28T08:27: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": "dca31246af...
498046c2-5adf-4e0b-a105-f1962acce973
nathansttt/hog2
deprecated/coprobber/CopRobberGame.h
#include "GraphEnvironment.h" #include "Map2DEnvironment.h" #include "CopRobberEnvironment.h" #include "MarkovGame.h" #include "DSDijkstra_MemOptim.h" #include "TwoCopsDijkstra.h" #ifndef COPROBBERGAME_H #define COPROBBERGAME_H /*! The Cop vs. Robber game: This is what we are talking of! \see CopRobberEnvironment....
ALGO
0.9889
3.338681
{ "github_metadata": { "branch": "PDB-refactor", "commit_count": 2251, "repo_created_at": "2015-08-19T21:02:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 117, "forks": 62, "issues": 9, "pull_requests": 1 }, "file_meta": { "content_id":...
910c1023-f0e2-46fe-9049-da68ba39f2ba
SiliconVillager/gpg-source-backup
8/Chapter 5 Networking and Multiplayer/04 3D Streaming in MMO/Demo/3DStreamer/height_map.cpp
#include "height_map.h" #include "terrain.h" #include "log.h" float Noise2D(int seed, int x, int y) { int n = x + y * 57 + seed; n = (n << 13) ^ n; return ( 1.0f - ( (n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0f); } float CosInterpolate(float v1, float v2, float a) { float angle...
ALGO
0.942815
5.460729
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-06-16T15:05:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c107635f089d...
0e2df84a-793a-4494-8b71-e53c12d4ae38
winteryy/BaekJoon-Practice
14888.cpp
#include <iostream> #include <vector> using namespace std; int n; int minN = 1000000001; int maxN = -1000000001; vector<int> nums; vector<int> op(4); void BT(int value, int depth){ if(depth==n){ if(value<minN){ minN = value; } if(value>maxN){ maxN = value; ...
ALGO
0.999901
3.869777
{ "github_metadata": { "branch": "main", "commit_count": 310, "repo_created_at": "2022-06-21T18:04: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": "eb77e66753...
8218ab70-9488-4b52-8d39-ffdeac7bb6f3
Xilinx/merlin-compiler
trunk/regression_test/test_case/test_cases_unit/msg_report/Xilinx/merlin_related/test_false_dependence/src/hestonEuroBarrier.cpp
//(C) Copyright 2016-2021 Xilinx, Inc. //All Rights Reserved. // //Licensed to the Apache Software Foundation (ASF) under one //or more contributor license agreements. See the NOTICE file //distributed with this work for additional information //regarding copyright ownership. The ASF licenses this file //to you under...
ALGO
0.986811
4.629169
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2021-08-03T08:55:11.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 58, "forks": 17, "issues": 8, "pull_requests": 0 }, "file_meta": { "content_id": "53d515d3f4...
fdd0837b-840b-43f2-a4dd-d0dd64603241
LingNc/LingNc
school/Atcoder/ABC384/C_Perfect_排名表.cpp
#include<bits/stdc++.h> template<typename iii> iii gcd(iii a,iii b){return b==0?a:gcd(b,a%b);} template<typename iii> iii lcm(iii a,iii b){return a/gcd(a,b)*b;} #define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0) #define yes(res) cout<<((res)?"YES":"NO")<<'\n' #define foe(i,a,b) for(int i=(a);i<=(b);i++) #define...
ALGO
0.99995
3.907308
{ "github_metadata": { "branch": "master", "commit_count": 308, "repo_created_at": "2023-12-25T12:49:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cfbd2808...
f4b9722e-7fef-40ad-8066-c1a537ea6fec
endixk/c-playground
boj/src/0260/Q26072.cpp
// BOJ Contest 895-E // Supported by GitHub Copilot #include <bits/stdc++.h> using namespace std; #define MAX 100001 int N, L; int X[MAX], W[MAX]; double diff(double loc){ double ret = 0; for(int i=0; i<N; i++) ret += W[i] * (X[i] - loc); return abs(ret); } int main() { cin.tie(nullptr)->sync_with_st...
ALGO
0.999961
5.082514
{ "github_metadata": { "branch": "main", "commit_count": 71, "repo_created_at": "2022-06-13T05:45: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": "b20a457ef4a...
1ca80fde-38bd-42ff-bc54-801a4fd54055
rupertsteel/advent-of-code-2022
day18/day18.cpp
#include <fmt/format.h> #include <iostream> #include <fstream> #include <ranges> #include <string> #include <vector> #include <algorithm> #include <numeric> #include <chrono> #include <regex> #include <map> #include <set> #include <deque> #include <functional> #include <variant> #include <thread> #include <stack> #in...
ALGO
0.965713
5.42336
{ "github_metadata": { "branch": "main", "commit_count": 76, "repo_created_at": "2022-12-01T09:02: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": "7ec4831a7b1...
0c0891e7-fb77-4bbf-a752-3a2dfc456425
lukaswit/advent-of-code-2024
day05/part02.cpp
#include <iostream> #include <fstream> #include <string> #include <cstring> #include <vector> #include <cstdint> #include <ctype.h> #include <algorithm> #include <map> //************************************************************************** */ // Function declarations //********************************************...
ALGO
0.999724
5.780876
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-12-18T19:46: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": "db0d243a27e4...
77af8e7f-5f30-4e41-aaa4-f2521725c956
AymanSalah96/CompetitiveProgramming
UVA/12124.cpp
#define _CRT_SECURE_NO_WARNINGS #include <cstring> #include <map> #include <deque> #include <queue> #include <stack> #include <sstream> #include <numeric> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <hash_map> #include <fstream> #include <string> #include <cstdlib> #include <ctime...
ALGO
0.999708
3.804755
{ "github_metadata": { "branch": "master", "commit_count": 276, "repo_created_at": "2017-03-13T14:38:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d4f413c...
e6c41eaf-0300-4cc7-8c11-289fc10c7784
amit-mittal/Programming-Questions-Practice
c,c++/hacker_rank/hacker_country.cpp
#include <cstdlib> #include <cstdio> #include <cstring> #include <iostream> #include <vector> #include <string> #include <set> #include <map> #include <cmath> #include <stack> #include <queue> #include <deque> #include <algorithm> #include <utility> using namespace std; #define mod 1000000007 #define inf 2147483647...
ALGO
0.999915
3.564214
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2018-01-16T02:05:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c3c8fe4638...
d79581b2-738a-4b23-b4cf-ce36a900884a
cran/libgeos
src/geos/simplify/PolygonHullSimplifier.cpp
/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2022 <NAME> <<EMAIL>> * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published ...
ALGO
0.998568
7.057647
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2020-07-09T01:14:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a27a7b9117...
7eede7ce-0988-416b-85bb-6f3a176a17bb
itohdak/Competitive_Programming
AtCoder/ABC/archive/239/G.cpp
#include <bits/stdc++.h> #include <print.hpp> using namespace std; #include <atcoder/all> using namespace atcoder; #define ll long long #define ld long double #define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--) #define rrep(i,n) R...
ALGO
0.999974
3.870032
{ "github_metadata": { "branch": "master", "commit_count": 98, "repo_created_at": "2020-10-16T18:27: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": "17ebb0d79...
158f030f-de55-48da-b116-739973bed235
ivan-guerra/advent_of_code
src/2021/day_07/aoc_2021_7_2.cc
#include <algorithm> #include <cstdlib> #include <fstream> #include <iostream> #include <sstream> #include <string> #include <vector> using CrabPosVec = std::vector<int>; [[nodiscard]] CrabPosVec ParsePositions(const std::string& filename) { std::ifstream fhandle(filename); std::string line; std::getline(fhandl...
ALGO
0.99889
6.069756
{ "github_metadata": { "branch": "master", "commit_count": 147, "repo_created_at": "2022-12-16T05:07: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": "29bcd949...
dc2bcc2c-aab4-4328-82c1-4696e689336d
ZoranPandovski/al-go-rithms
math/PrimeNo_check/cpp/miller_rabin_primality_check.cpp
#include <bits/stdc++.h> using namespace std; long long mul(long long a, long long b, long long mod) { if(double(a)*b < 1e18) return a*b%mod; long long c = 0; while(b) { if(b&1) c=(c+a)%mod; b = (b/2); a = (a*2)%mod; } return c; } long long modexp(long long base, long l...
ALGO
0.999012
4.939139
{ "github_metadata": { "branch": "master", "commit_count": 7457, "repo_created_at": "2017-06-05T19:20:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1359, "forks": 1929, "issues": 20, "pull_requests": 44 }, "file_meta": { "content_id": ...
6876dffc-a27e-4e23-9675-8679a448c544
ex-MingNine9999/algorithm
Problems/boj10655.cpp
//Problem Number : 10655 //Problem Title : 마라톤 1 //Problem Link : https://www.acmicpc.net/problem/10655 #include <iostream> #include <vector> #include <algorithm> #define F first #define S second using namespace std; vector<pair<int, int> > v; vector<int> dp; int dis(pair<int, int> a, pair<int, int> b) { int x...
ALGO
0.999966
4.116848
{ "github_metadata": { "branch": "master", "commit_count": 160, "repo_created_at": "2020-03-25T07:39:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ee205e76...
1c55fd54-34c6-4256-b811-c35579596e3f
HariPasapuleti/Leetcode-Problems
2343-count-unguarded-cells-in-the-grid/2343-count-unguarded-cells-in-the-grid.cpp
class Solution { public: int countUnguarded(int m, int n, vector<vector<int>>& guards, vector<vector<int>>& walls) { vector<vector<int>> board(m, vector<int>(n, 0)); for (int i = 0; i < walls.size(); i++) { board[walls[i][0]][walls[i][1]] = 2; } f...
ALGO
0.999943
5.699059
{ "github_metadata": { "branch": "main", "commit_count": 2067, "repo_created_at": "2024-07-02T18:13:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "da8790542...
9e1e2ab9-c6a2-4783-93c2-741cda35e776
HowardChengUleth/Contest
UAPC/2024/triangletrees.cc
#include <bits/stdc++.h> using namespace std; int N, M; vector<vector<int>> adj; vector<int> color; void DFS(int v) { assert(color[v] == 0); bool used[4] = {false}; for (auto w : adj[v]) { used[color[w]] = true; } for (int c = 1; c <= 3; c++) { if (!used[c]) { color[v] = c; break; ...
ALGO
0.999985
4.458998
{ "github_metadata": { "branch": "master", "commit_count": 600, "repo_created_at": "2020-05-11T16:38:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "80ff643b...