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
90cbad37-3d9f-4179-93a4-c299fe63a6a4
ishandutta2007/codeforces-m
mtsd/normal/1419/C.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <climits> #include <cmath> #include <complex> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <iomanip> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #includ...
ALGO
0.999853
3.67271
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-06T01:03: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": "8ce08d4c2f46...
eaf65858-3ccf-4af5-a37b-45ee8f449c5b
snzhang-PKI/Leetcode
454.cpp
#include <vector> #include <unordered_map> #include <map> using namespace std; class Solution { public: int fourSumCount(vector<int>& A, vector<int>& B, vector<int>& C, vector<int>& D) { unordered_map <int,int> mAB, mCD; for (auto a : A) { for (auto b : B) { long long ab = ...
ALGO
0.999726
6.07997
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2017-06-08T21:50:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6444ef73a...
c7215d3a-147e-49b9-83a6-b266e355f71e
HuiyanWen/Maze_Astar
code/utils.cpp
#include "stdafx.h" #include "utils.h" using namespace std; int duplicate(int *dot, int i, int temp1, int temp2) { for (int m = 0; m < i; m++) { if (dot[m * 2] == temp1&&dot[m * 2 + 1] == temp2) return 1; } return 0; } bool happened(double probability)//probability 0~1 { double MinProb = 1.0 / (RAND_MAX + 1); ...
ALGO
0.993707
3.55827
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-09-24T11:47:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 15, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dbd1c61e1...
d18e07ca-51d1-40ab-b7ef-1445cc38f32c
wakilkhan96/Competitive-Programming
UVa/541 - Error Correction.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; while( scanf("%d", &n)==1 && n ) { //cin.ignore(true, '\n'); int arr[n][n], col[n], row[n]; memset(row,0,sizeof(row)); memset(col,0,sizeof(col)); for(int x=0; x<n; x++) { for(int y=0...
ALGO
0.995894
3.451966
{ "github_metadata": { "branch": "main", "commit_count": 52, "repo_created_at": "2021-03-05T13:55:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6b1522ada2b...
fc772ed1-b04d-4b76-b918-9d4ea9f8896b
isanchez-aguilar/AtCoder
Educational DP - Knapsack 1.cpp
/* * User: Isanchez_Aguilar * Problem: AtCoder Educational DP - Knapsack 1 */ #include <bits/stdc++.h> using namespace std; using Long = long long; int main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, w; cin >> n >> w; vector< pair<Long, Long> > product(n); for (auto& p : product)...
ALGO
0.999992
3.933301
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2020-03-27T20:19: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": "4570875d9...
0d0b7e49-5fe6-47e6-9366-6c7099545700
Kawser-nerd/CLCDSA
Source Codes/AtCoder/abc013/D/1201161.cpp
#if 1 #include <iostream> #include <fstream> #include <string> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <queue> #include <stack> #include <array> #include <deque> #include <algorithm> #include <utility> #include <cstdint> #include <functional> #include <...
ALGO
0.999983
3.28437
{ "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": "2d5a3fdd...
d7bfc1c8-f2de-4758-beff-21645e3a5642
rsln-s/aggregative-coarsening-for-multilevel-hypergraph-partitioning
packages/stk/stk_classic/stk_search/stk_search/CoarseSearch.hpp
/*------------------------------------------------------------------------*/ /* Copyright 2010 Sandia Corporation. */ /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ /* license for use of this work by or on behalf of the U.S. Government. */ /* Export o...
ALGO
0.999025
5.712768
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2018-04-04T20:05:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f8a81f561e...
0abae933-ef70-4aa0-a02f-9787cda1035b
vansh2001/ece309-fall18-hrmaredd
lib/randomHash_Iterator.cpp
#include <stdio.h> #include <string> #include <iostream> #include "randomHash_Iterator.h" using namespace std; namespace ece309 { IntegerSetHT::iterator::iterator(int s, int *l) { passed_size = s; passed_table= l; for(index = 0; index < passed_size ; index++) { if(passed_table[index] >= 0) { break; } } } ...
ALGO
0.971811
3.977525
{ "github_metadata": { "branch": "master", "commit_count": 97, "repo_created_at": "2018-09-05T16:40: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": "44b68b9b0...
30e11388-e436-41f6-9431-57878522102d
GaussGreen/old-code
Bnp/src2/EuropeanGRFN.cxx
/******************************************************************************* * * FUNCTION : EuropeanGRFN.cxx * * PURPOSE : * * DESCRIPTION : * * CALLS : * *******************************************************************************/ #include "EuropeanGRFN.h" #include "num_h_interp....
ALGO
0.964335
5.693318
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2022-02-17T09:58:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0d037eb38246...
d28f1b94-5360-4989-9e98-58b393fc1b2e
mangoqwq/competitive-programming
Codeforces/cf1753a1.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ cin.tie(0)->sync_with_stdio(0); int T; cin >> T; while (T--){ int N; cin >> N; vector<int> a(N); int cnt = 0; for (int i = 0; i < N; ++i){ cin >> a[i]; if (a[i]) cnt++; ...
ALGO
0.999549
3.942721
{ "github_metadata": { "branch": "master", "commit_count": 540, "repo_created_at": "2020-08-28T16:37:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "38e15bc8...
2c66ed50-c2a6-4f2e-bbf2-9609d9ba3f81
vishalsharma325/DAA-lab
linearsrch.cpp
#include <iostream> using namespace std; int linearSearch(int arr[], int size, int key) { for (int i = 0; i < size; i++) { if (arr[i] == key) { return i; } } return -1; } int main() { int arr[8]; cout<<"Enter the elements of the array :" ; for (int i = 0; i < 8; i++) ...
ALGO
0.999368
4.911579
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2025-03-27T05:25: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": "2962a78cb7d...
9a089fbe-f6b1-4263-82cc-5ecb4f961c95
Harlinn/Harlinn.Windows
3rdParty/Harlinn.geos/src/index/strtree/SimpleSTRtree.cpp
/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2020 <NAME> * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the ...
ALGO
0.999265
6.578114
{ "github_metadata": { "branch": "master", "commit_count": 553, "repo_created_at": "2023-04-05T20:58:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 30, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "30cdf48...
54e6c30a-b566-4ab6-96a0-94ce22dbe1d1
dangdan2807/learning-c
NhapMonLapTrinh/CoBan/doc-ghi-file/bai6.cpp
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <fstream> using namespace std; struct PhanSo { int tuso; int mauso; }; struct DanhSach { PhanSo ds_ps[100]; int n; }; void doc_1_phan_so(PhanSo &a, ifstream &filein); void doc_file(DanhSach &ds, ifstream &filein); void xuat_mang(DanhSach a); in...
ALGO
0.961349
3.220506
{ "github_metadata": { "branch": "master", "commit_count": 177, "repo_created_at": "2019-11-07T14:33: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": "295adbaa...
87413a05-dd1d-48a0-89ee-9d3ffa72be32
KennethWang1221/Leetcode
data_structures/Leetcode_2013_Detect_Squares.cpp
// Full testable code #include <iostream> #include <vector> #include <unordered_map> #include <cmath> using namespace std; struct PairHash { template <class T1, class T2> size_t operator()(const pair<T1, T2>& p) const { return hash<T1>()(p.first) ^ hash<T2>()(p.second); } }; class DetectSquares {...
ALGO
0.997784
6.41374
{ "github_metadata": { "branch": "master", "commit_count": 1143, "repo_created_at": "2022-02-06T22:26: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": "b3b4ac5...
58755032-ca63-4c8d-8857-10c6cd55801a
jamornsriwasansak/wurstrenderer
dependencies/embree/tutorials/viewer/viewer_device.cpp
// ======================================================================== // // Copyright 2009-2018 Intel Corporation // // // // Licensed under the Apache License, Version 2.0 (the "License"); // // y...
ALGO
0.963217
5.912529
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2021-06-20T17:19:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "462bca66...
d488b03a-86bc-44b0-b0c7-585621530f3a
antori82/FANTASIA
FANTASIA/ThirdParty/aGrUM/Includes/agrum/tools/graphs/algorithms/triangulations/staticTriangulation.h
/** * * Copyright (c) 2005-2023 by <NAME>(_at_LIP6) & <NAME>(_at_AMU) * info_at_agrum_dot_org * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the Lice...
ALGO
0.972505
7.201281
{ "github_metadata": { "branch": "main", "commit_count": 115, "repo_created_at": "2021-03-01T21:03:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 26, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7b0a84078...
f8659a51-13b7-46f8-a128-702d7bbc58d0
jxihong/graph-library
src/test.cpp
#include "shortest_path.cpp" #include "search.cpp" #include "sort.cpp" #include <iomanip> using namespace std; using namespace graph; /* * Only tests the Adjacency List representation, but testing the Adjacency Matrix representation * should theoretically be identical */ int main(int argc, char *argv[]) { ifs...
ALGO
0.986899
4.9428
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2015-07-14T00:38:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2bb4e8a5b7...
ed780b85-ab0d-40e6-b966-a4ac9226ccba
aazannoorkhuwaja/C-plus-plus-CBL-Project
IF-Else/qns4.cpp
//4. Write a program to determine if a year is a leap year. #include <iostream> using namespace std; int main(){ cout <<"Enter Any year : "; int year; cin>>year; // A leap year occurs if: // if ( // Condition 1: The year must be divisible by 4. // This accounts for the extra 0.25 days in Earth's orbit. // ...
ALGO
0.999536
3.473668
{ "github_metadata": { "branch": "main", "commit_count": 111, "repo_created_at": "2025-01-21T14:08:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "31de6d8240...
7b3de88c-b267-401c-baa4-7ef852667e92
ljghy/acceleration
include/acc/BoundingBox.hpp
#ifndef ACC_BOUNDING_BOX_HPP_ #define ACC_BOUNDING_BOX_HPP_ #include <acc/Config.hpp> #include <acc/Vec3Op.hpp> namespace acc { struct BoundingBox { vec3_t lb; vec3_t ub; ACC_HOST_DEVICE void init(); ACC_HOST_DEVICE real_t minSqrDist(const vec3_t &) const; ACC_HOST_DEVICE real_t minDist(const vec3_t &) c...
ALGO
0.948252
7.681145
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2023-11-01T07:03: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": "414a041d2...
69074160-fdd8-48d2-93f2-b2635461bcef
Smorodov/Multitarget-tracker
src/Tracker/ldes/correlation.cpp
#include "correlation.h" #include "fft_functions.h" cv::Mat gaussianCorrelation(cv::Mat& x1, cv::Mat& x2, int h, int w, int channel, float sigma) { cv::Mat xy = cv::Mat(cv::Size(w, h), CV_32F, cv::Scalar(0)); cv::Mat xy_temp; cv::Mat x; cv::Mat y; double xx=0, yy=0; for (int i = 0; i < channel; i++) { x = x1.r...
ALGO
0.994375
4.977692
{ "github_metadata": { "branch": "master", "commit_count": 1129, "repo_created_at": "2013-08-01T05:09:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2293, "forks": 662, "issues": 81, "pull_requests": 0 }, "file_meta": { "content_id": "5...
eb47f335-b56a-47ff-9d3f-385ff17fa91a
DBSI-study/algorithm-ps
sickpickel/S2Week6/2110-sickpickel.cpp
#include <bits/stdc++.h> #define Max 200001 using namespace std; int N, C, arr[Max]; int countRouter(int distance){ int ret = 1; long long between = 0; for(int i = 1; i < N; i++){ between += arr[i] - arr[i - 1]; if(between >= distance){ between = 0; if(++ret > C) return ret; } } return ret; } int ...
ALGO
0.999997
4.548248
{ "github_metadata": { "branch": "main", "commit_count": 238, "repo_created_at": "2021-08-23T10:37:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b8da69e6c3d...
cce808d7-b4e4-48a4-96aa-04ab9d9a0a26
h-sooah/Algorithm
BOJ/20301.cpp
#include <iostream> #include <deque> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); // 입력 int N, K, M; cin >> N >> K >> M; // 큐 채우기 deque<int> dq; for (int i = 1; i <= N; i++) dq.push_back(i); // 반전 요세푸스 순열 int direction = 1, m = 0; for (int i = 0; i...
ALGO
0.999998
3.892243
{ "github_metadata": { "branch": "main", "commit_count": 296, "repo_created_at": "2022-09-12T13:34: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": "f1920f8870...
332ce154-6f6b-471e-9b29-0b751a3f957a
ysmin709/Algorithm-Excercise
Baekjoon/DynamicProgramming/1912/1912.cpp
#include <iostream> #include <vector> using namespace std; int main() { int n, temp; cin >> n; vector<int> vec; for (int i = 0; i < n; i++) { cin >> temp; vec.push_back(temp); } vector<int> dp(vec.size(), 0); dp[0] = vec[0]; // 초기값 설정 for (int i = 1; i < n; i++) { ...
ALGO
0.999986
4.63273
{ "github_metadata": { "branch": "main", "commit_count": 347, "repo_created_at": "2021-02-09T02:52: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": "c2250423de...
52385ab1-c643-42e9-929b-edb296d3ad88
gupta-manas6268/learning-C
TLE Eliminators/TLE Eliminators Level-2/Ch-005/0_32_01_pr.cpp
// Wrong. (Time-limit exceeded.) // B. T-primes // https://codeforces.com/problemset/problem/230/B #include<bits/stdc++.h> using namespace std; #define endl '\n' #define int long long const int MOD = 1e9 + 7; const int INF = LLONG_MAX >> 1; bool is_prime(int n){ for(int i=2; ...
ALGO
0.999171
5.444471
{ "github_metadata": { "branch": "main", "commit_count": 569, "repo_created_at": "2023-05-18T17:22:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "2d11814c7d...
3fe56ea4-8c98-4af7-8ce9-2e2eb633b40f
chengyiwei/algorithm
atcoder/ABC361/D/D.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; int main() { freopen ("D.in", "r", stdin); ios::sync_with_stdio(0); int n; cin >> n; string A, B; cin >> A >> B; int A_ = 0, B_ = 0; for (int i = 0; i < n; i++) { A_ |= (A[i] == 'W') << i; B_ |= (B[i] == ...
ALGO
0.999981
3.67836
{ "github_metadata": { "branch": "main", "commit_count": 68, "repo_created_at": "2024-08-13T07:27:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e21e3082458...
34323344-918d-4d98-926a-3baea1f090c9
Ibrahim-898/XPSC_ProblemSolving
Week12/Day1/D_Divide_and_Equalize.cpp
#include<bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define ld long double #define ios() ios_base:: sync_with_stdio(0);cin.tie(0); bool cmp(const pair<int,int> &a,const pair<int,int> &b){ if(a.first!=b.first) return (a.first<b.first); else return (a.second>b.second); } ...
ALGO
0.999688
4.773072
{ "github_metadata": { "branch": "main", "commit_count": 81, "repo_created_at": "2024-10-27T16:36: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": "76e3b8b9833...
b1b014db-ee6a-4b84-9c96-2b780dfd8cc8
matthew-lim-matthew-lim/my-leetcode
3136-ValidWord/3136-ValidWord.cpp
// Last updated: 7/15/2025, 8:44:17 PM class Solution { public: bool isValid(string word) { bool vowelFound = false; bool consonantFound = false; if (word.size() < 3) { return false; } for (char c : word) { c = tolower(c); if (!((c <= 'z'...
ALGO
0.995334
6.258863
{ "github_metadata": { "branch": "main", "commit_count": 836, "repo_created_at": "2024-11-20T11:22:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "806d9afad2...
57000e8f-a4e3-41ba-84dd-9856b5574c10
ozu-201/graph-puzzle-game-halil-nebioglu
src/mainTR.cpp
// // Created by in021397 on 12/14/2023. // #include <iostream> #include <fstream> #include <sstream> #include <vector> #include "List/Graph/Graph.h" using namespace std; int main(){ vector<string> words3Letters; vector<string> words4Letters; vector<string> words5Letters; // Open the file ifst...
ALGO
0.977412
4.572598
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-12-14T12:50:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "349490be55e7a...
cfeb20d7-ae89-492f-ac11-d428f701330c
trustworthy-systems-iitk/bsim
verilog/sat.h
#ifndef _SAT_H_DEFINED_ #define _SAT_H_DEFINED_ #include <map> #include <vector> #include <iostream> #include "core/Solver.h" #include "simplify.h" #include "cuddObj.hh" class node_t; // type of sets of nodes. typedef std::set<node_t*> nodeset_t; namespace sat_n { // ONE means non-inverted. // ZERO means in...
ALGO
0.997158
5.450344
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2020-06-23T17:35:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a18e4a917f...
27bca7f5-13fb-4f05-92eb-b917015bc7e4
sys010611/baekjoon
백준/Gold/1915. 가장 큰 정사각형/가장 큰 정사각형.cc
#include <iostream> #include <vector> #include <algorithm> #include <queue> #include <cmath> #include <cstring> using namespace std; int n, m; int arr[1001][1001]; int dp[1001][1001]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); memset(dp, 0, sizeof(dp)); cin >> n >> m; for (int i = 1; i <= n;...
ALGO
0.999904
3.3791
{ "github_metadata": { "branch": "main", "commit_count": 612, "repo_created_at": "2022-12-20T09:12: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": "77b7156b0a...
bdc5a935-c667-49ee-b523-5168aedd877b
Shuttles/HZOJ-C
3.40.cpp
/************************************************************************* > File Name: 3.40.cpp > Author: > Mail: > Created Time: 2019年08月14日 星期三 20时04分24秒 ************************************************************************/ #include <iostream> #include <cstdio> #include <cinttypes> #define max_n 500 usin...
ALGO
0.999828
3.663351
{ "github_metadata": { "branch": "master", "commit_count": 110, "repo_created_at": "2019-07-21T13:02: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": "55ba1925...
7135271f-c2ae-457f-aae8-14f42d2217da
anuragpratap05/levelup-recursion-and-backtracking
Queens Combinations - 2d As 1d - Queen Chooses.cpp
# levelup-recursion-and-backtracking#include<bits/stdc++.h> using namespace std; void queensCombinations(int qpsf, int n, bool** chess, int lcno) { if (qpsf == n) { for (int x = 0; x < n; x++) { for (int y = 0; y < n; y++) { if (chess[x][y]) { cout << "q\t"; } else { cout << ...
ALGO
0.999865
3.554932
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2021-01-26T10:42: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": "0122ab6323f...
57c03adc-bd3b-4f34-a79a-4123160621d6
dralves/sp1-sp2-galois
lonestar/experimental/sgd/sgd_copy.cpp
/* * This file belongs to the Galois project, a C++ library for exploiting parallelism. * The code is being released under the terms of the 3-Clause BSD License (a * copy is located in LICENSE.txt at the top-level directory). * * Copyright (C) 2018, The University of Texas at Austin. All rights reserved. * UNIVER...
ALGO
0.999731
5.808352
{ "github_metadata": { "branch": "master", "commit_count": 7804, "repo_created_at": "2018-09-11T20:57:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "a72e254...
db9dafa7-6d7f-44c1-bb3c-1682c1c2d414
SojebSikder/dsa-practice
leetcode/cpp/33. Search in Rotated Sorted Array.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int search(vector<int> &nums, int target) { int n = nums.size(); int low = 0, high = n - 1; while (low <= high) { int mid = (low + high) / 2; if (nums[mid] == target) ...
ALGO
0.999952
5.861519
{ "github_metadata": { "branch": "main", "commit_count": 159, "repo_created_at": "2023-02-26T05:06:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "887b7f0ed2...
f10ec7d1-ae92-40ad-92f1-995fadca2ca0
UtkarshPathrabe/Competitive-Coding
Model Algorithms/Graphs/Find Whether a Graph is Strongly Connected or Not.cpp
/* Time Complexity: O(V+E) */ #include <bits/stdc++.h> using namespace std; class Graph { int V; list<int> *adj; void DFSUtil (int u, bool visited[]); public: Graph (int v) {V = v; adj = new list<int>[V];} ~Graph () {delete [] adj;} void addEdge (int u, int v) {adj[u].push_back(v);} Graph transpose (); ...
ALGO
0.999687
4.996912
{ "github_metadata": { "branch": "master", "commit_count": 15222, "repo_created_at": "2014-12-02T06:31:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 52, "forks": 36, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "6446...
c4d4b4aa-7762-44dd-ac0e-e2d6ec293608
asjian/Chess-AI
engine/MoveGen.cpp
#include "MoveGen.h" #include "Constants.h" #include "Bitboard.h" #include <cstdint> namespace Chess { int MoveGenerator::countPins(ChessBoard* board, Color opp, uint64_t occ, Square kingPos) { uint64_t diagOpp = board->getPiecesByColor(rook, opp) | board->getPiecesByColor(queen, opp); uint64_t orthoOpp = boa...
ALGO
0.997869
6.108537
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2025-03-14T06:55: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": "54cad46bac...
8ab34d46-ab55-4272-9ec3-56afed6a9de0
Taowyoo/LeetCodeLog
src/16.3SumClosest/16.cpp
/* * File: 16.cpp * Created Date: 2021-01-23 * Author: <NAME>(<EMAIL>) * Brief: https://leetcode.com/problems/3sum-closest/ * ----- * Last Modified: 2021-01-23T08:28:12-08:00 * Modified By: <NAME>(<EMAIL>) */ /** * @brief Approach 1: Two Pointers * Time: O(n^2) * Space: O(log(n)) to O(n), depending on the i...
ALGO
0.999998
6.406448
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2020-07-29T17:43: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": "dcdab02be...
887b3779-28d9-42dd-9772-1eb35145ae67
Will-Bach90/algos
graphs/dfs.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; class Graph{ private: int V; vector<int> *adj; void DFSrecursive(int v, vector<bool> &visited); public: Graph(int V); void addEdge(int v, int w); void DFS(int v); }; Graph::Graph(int V)...
ALGO
0.999983
6.069653
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2024-02-16T22:33: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": "385cd9f40d69...
80c49ce3-6432-4500-8adb-3ebe249c0141
raincross7/code-similarity
codes/train_code/problem108/problem108_93.cpp
/* * @Author: AsilenceBTF * @Buff: ︿( ̄︶ ̄)︿ 芜湖塔台 起飞 * @Date: 2019-06-20 09:22:24 * @LastEditTime: 2020-09-21 20:39:52 */ #include <bits/stdc++.h> using namespace std; #define sz(x) int(x.size()) #define ALL(x) x.begin(), x.end() #define INF 0x3f3f3f3f #define debug(x) cout << "##### " << x << endl; typedef long l...
ALGO
0.999993
4.378045
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07: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": "1d5c24ce785e...
95225ed5-9158-476f-a131-4d090064d124
vmmc2/Competitive-Programming
Mock/mock4.cpp
input = [ [1,5,7], [2,3,10], [4,6,9] ] [1,5,7] [2,3,10] [4,6,9] output = [1,2,3,4,5,6,7,9,10] [1,2,5,6,7] [23,45] [34,56] pointers = [1,1]; sizeOfEachVec = [2,2]; [2,2,3] template<typename T> class MyIterator<T> { public: MyIterator(vector<vector<T>>& _input) { input = _input; n = (int...
ALGO
0.999993
5.601095
{ "github_metadata": { "branch": "master", "commit_count": 1704, "repo_created_at": "2018-10-09T00:24: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": "4fc78a1...
a6f79d4c-d191-4b76-b589-bdf2b364aee3
lukpazera/ACS3Sample
Src/pointSymmetryMap.cpp
#include <sstream> #include <chrono> #include "lxu_vector.hpp" #include "pointSymmetryMap.hpp" /* * Builds new symmetry map. * * Note that this works correctly ONLY if symmetry is turned on in MODO. * This is because MODO's symmetry SDK methods are dependend on the symmetry being on in UI. * The nice thing abo...
ALGO
0.946766
5.855278
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-10-25T11:01:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0fb481f90958...
d00ca184-dc21-45b7-a9f4-fe30e5dbc819
amrsamii/Problem-Solving
Codeforces/Sheet B/Steps/CF152-D2-B_2.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll n,m; bool valid(ll x, ll y){ return x>=1 && x<=n && y>=1 && y<=m; } int main() { // little faster reading, no c apis ios_base::sync_with_stdio(false); ll xc, yc, k; ll ans = 0; cin >> n >> m >> xc >> yc >> k; while (...
ALGO
0.999897
3.679929
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2020-02-15T18:15:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e2f81195c8...
d6876ccd-95ef-418c-9c0a-ebf3cb3f61eb
mposypkin/BNB-solver
problems/cover/poly/test.polylip.cpp
#include <stdio.h> #include <util/poly/polynom.hpp> #include <util/poly/polynomtxt.hpp> #include <util/poly/polyutil.hpp> #include <problems/optlib/conjgrad.hpp> #include <problems/optlib/fletchsearch.hpp> #include <common/go.hpp> #include <common/decomposer.hpp> #include <common/segvecdecomp.hpp> #include <common/lipz...
ALGO
0.998874
4.038099
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2015-03-22T08:12:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3e14891e2...
9001892b-2f09-472f-9f7e-78b64dc5d0de
dreyus95/AVSP_SourceQualityPrediction
CodeJamCrawler/dataset/08_24797_75.cpp
#include <algorithm> #include <iostream> #include <iterator> #include <sstream> #include <utility> #include <string> #include <vector> #include <fstream> #include <cmath> #include <set> #include <map> using namespace std; #define VT vector typedef VT<int> VI; typedef VT<VI> VVI; typedef VT<string> VS; typedef VT<doub...
ALGO
0.998562
4.050155
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2017-06-08T21:00:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e3d50214e...
05a81fb8-e850-46d7-a6c6-ea63cb5f493d
Chnmii/Nam1_Ky2
OOP/Class-Mtran.cpp
#include <bits/stdc++.h> #include <conio.h> using namespace std; class mt { private: int n; int **a; public: void nhap() { cin >> n; a = new int *[n + 1];             for(int i = 0; i < n; i++)             {                a[i] = new int [n + 1];                 for(int j = 0; j < n; i++)            ...
ALGO
0.999377
3.325674
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-12-28T16:32: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": "5c3365aa49f9...
3f8016da-7bf1-4a39-afe9-9d78628414d3
Yuchen-He1/CS263Project
CPP_benchmark/prime_sieve_benchmark.cpp
#include <iostream> #include <vector> #include <chrono> using namespace std; using namespace chrono; void prime_sieve(int N, vector<bool>& prime) { fill(prime.begin(), prime.end(), true); prime[0] = prime[1] = false; for (int p = 2; p * p <= N; p++) if (prime[p]) for (int i = p * p; i ...
ALGO
0.999054
5.582057
{ "github_metadata": { "branch": "main", "commit_count": 56, "repo_created_at": "2025-01-16T22:29: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": "de48eb85442...
f37269ca-41f2-4817-94ea-f50f6adbc026
AbrahamAriel/pcc-solutions
UVa/10172.cpp
#include <iostream> #include <stdio.h> #include <vector> int main() { int set; std::cin>>set; while((set--) > 0) { int N,S,Q, time = 0; std::cin>>N>>S>>Q; std::vector<std::vector<int>> vec(N, std::vector<int>()); std::vector<int> carrier; for(int i=0; i<N; i++) { int c; std::cin>>c; while((c...
ALGO
0.999272
3.358416
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2017-04-11T18:29: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": "e4dff1733...
5660518e-969f-4be2-ba5b-0bfbe0e43613
vedasjad/Leetcode
3395-minimum-length-of-anagram-concatenation/minimum-length-of-anagram-concatenation.cpp
class Solution { public: int minAnagramLength(string s) { int len = 1, n = s.size(); unordered_map<char, int> imaps[n]; unordered_map<char, int> imap; for (int i = 0; i < n; i++) { imap[s[i]]++; imaps[i] = imap; } while (len <= n) { ...
ALGO
0.999987
5.171852
{ "github_metadata": { "branch": "main", "commit_count": 262, "repo_created_at": "2023-10-30T17:25: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": "c0c8847f98...
4aec53fc-cc65-4692-bfcc-0ad544a3a357
AgentPengin/PhucCNH
CP-Code/VNOJ/HELLO22_SUBSQ.cpp
#include<bits/stdc++.h> #define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(); #define fi first #define se second #define ll unsigned long long #define EL "\n"; #define time cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n " #define db(x) do { std::cerr << #x << ": " << x << EL;} whil...
ALGO
0.999571
4.650033
{ "github_metadata": { "branch": "main", "commit_count": 368, "repo_created_at": "2021-10-31T02:21:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a0bdc5edf5...
0c7d3b08-c9e3-4a45-ae50-123b552a345c
raincross7/code-similarity
codes/train_code/problem355/problem355_418.cpp
#include<bits/stdc++.h> #define watch(x) cout << (#x) << " is " << (x) << endl typedef long long ll; using namespace std; int static fast = [](){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); return 0; }(); // freopen("input.txt", "r", stdin); pair<bool, string> check(char f, char sec, string s) { int ...
ALGO
0.999986
3.529794
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07: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": "b102bdc7b7a7...
fada8307-fb2b-49c6-b4a3-6c07927ab89d
darshna21-bit/darshna-practical-dhengre-sir-aissms
D27 InfixToPostfix.cpp
#include <iostream> #include <stack> #include <string> using namespace std; // Function to get precedence of operators int precedence(char op) { if (op == '+' || op == '-') return 1; if (op == '*' || op == '/') return 2; return 0; } // Function to convert infix expression to postfix string infixToPostfix(...
ALGO
0.998593
6.109426
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2024-12-19T07:56:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "66a718cc6ed...
15c48ff7-c6b8-4b2d-b138-e568b579db53
coal-library/coal
src/collision_utility.cpp
// Copyright (c) 2017, <NAME> // Authors: <NAME> (<EMAIL>) // // This file is part of Coal. // Coal is free software: you can redistribute it // and/or modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation, either version // 3 of the License, or (at your opti...
TOOL
0.926858
7.066585
{ "github_metadata": { "branch": "devel", "commit_count": 3500, "repo_created_at": "2014-12-05T15:10:40.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 459, "forks": 113, "issues": 36, "pull_requests": 0 }, "file_meta": { "content_id": "87a1...
d68f3a03-bf1b-481e-8eda-873a333e8427
ming197/leetcode
2.add-two-numbers.cpp
/* * @lc app=leetcode id=2 lang=cpp * * [2] Add Two Numbers */ // @lc code=start struct ListNode { int val; ListNode *next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(x), next(nullptr) {} ListNode(int x, ListNode *next) : val(x), next(next) {} }; class Solution { public: ...
ALGO
0.999887
6.724695
{ "github_metadata": { "branch": "main", "commit_count": 191, "repo_created_at": "2024-05-06T14:52:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "585d16801d...
e9d488db-7992-4619-8d8c-43d288f41044
DaisyCheng102/arts_of_coding_and_algorithms
Mike_and_Children/Mike_and_Children.cpp
#include <iostream> #include <vector> #include <fstream> #include <unordered_map> using namespace std; int main() { ifstream fin("input.txt"); int n = 10; int size, val; fin >> size; unordered_map<int, int> maps; int max = 0; int arr[size]; // to contain the numbers for (int i = 0, num...
ALGO
0.99957
3.952273
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2023-09-04T03:28: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": "764be9c650c...
235c9d92-87a8-4798-a703-699e83d27970
bielskij/AOC
2021/day18/main.cpp
#include "common/types.h" #include "utils/file.h" #include "utils/utils.h" #define DEBUG_LEVEL 5 #include "common/debug.h" struct SnailFishNumber { int value; int depth; SnailFishNumber() { this->value = 0; this->depth = 0; } SnailFishNumber(int value, int depth) { this->value = value; this->depth = ...
ALGO
0.998986
5.214522
{ "github_metadata": { "branch": "master", "commit_count": 236, "repo_created_at": "2019-12-05T10:57: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": "1c7e61ed...
9f1cb87d-6ff4-4193-9d6a-c22136be1507
SaulCondoriM/Analisis-de-Algoritmos
TAREA_06/problemaMochila.cpp
#include <iostream> #include <vector> using namespace std; int max(int a, int b) { return (a > b) ? a : b; } vector<int> Mochila(int M, vector<int>& p, vector<int>& b, int n) { int i, w; vector<vector<int>> V(n + 1 , vector<int> (M + 1, 0)); for (i = 0; i <= n; i++) { for (w = 0; w <=...
ALGO
0.999955
4.875608
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2023-06-23T14:42:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5edf22157ad...
ac90c542-7eb7-4cad-8e24-1061fc49d94b
NafiHasan/HabiJabi
C++/Topics/dp practice/brush3.cpp
#include <bits/stdc++.h> using namespace std; #define w(t) int t; cin >> t; while (t--) #define ll long long int #define vi vector<int> #define vll vector<long long int> #define en "\n" int unit[1000][2]; int dp[1000]; bool used[1000]; int n,w,k; int fnc(int x){ if (x==k+1) return 0; if (dp[x] !=-1)return dp...
ALGO
0.999834
4.141648
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-03-17T09:29:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bdf4f0dbb8e...
ba78d564-3819-4a6d-bc3e-4cb1a38727a3
glucas038/diferenca_entre_datas
codigo.cpp
#include<iostream> using namespace std; bool Bissexto(int ano){ double divisao1 = 0; double divisao2 = 0; double divisao3 = 0; divisao1 = ano % 4; divisao2 = ano % 100; divisao3 = ano % 400; if(divisao1 != 0){ return false; } else if (divisao2 != 0){ return true; } else if (divisao3 == 0){ return ...
ALGO
0.999831
4.071426
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-10-25T14:13: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": "381031ade273...
e01d7194-01ab-4232-a3b6-256dcac5f8bb
manav-bhullar/DSA
Stack Implementation/q1.cpp
#include <iostream> using namespace std; class Stack{ public: int* arr; int size; int top; Stack(int size){ this -> size = size; arr = new int[size]; top = -1; } void push(int d){ if(size - top > 1){ top++; arr[top] = d; } ...
ALGO
0.997406
4.414514
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2024-07-16T11:41: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": "6f6f8217a6...
ee6fc5da-9814-4464-8dab-c8e9de559fdd
huanyizhiyuan/Cpluspuls_Template
数据结构/线段树/线段树2(mul_tag).cpp
/*------------------------------------------------------------------------------------- 线段树:segment_tree 0、题目改动: 根据P3373 【模板】线段树 2 分为两种情况: (1)、给[l,r]段乘上x (2)、给[l,r]段加上x 这是相比原版线段树进化的地方! 1、数据介绍: 1.1、两个新数组 lzy_add[N<<2]:懒标记加,由原先lazy数组改过来。 lzy_mul[N<<2]:懒标记乘,新数组。 这里我们需要注意,懒标记乘优先级高于懒标记加,先乘再加。 1.2、往往会多一个mod 2、函数改动: 2...
ALGO
0.999759
3.904821
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-12-12T12:45: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": "1920367b498c...
0a61eae8-e8ee-4d9b-b172-d57a20fad183
Ritax2003/Placement-Code-Practice
8. Tree/04. ArrtoBT_LCA_printlvlwise_isBST_mirrorTree.cpp
#include<bits/stdc++.h> using namespace std; struct node{ int val; node* left; node* right; node(int x){ val = x; left = NULL; right = NULL; } }; node* arrtobin(vector<int>v){ if(v.size()==0) return NULL; queue<node*>q; node* root = new node(v[0]); q.push(roo...
ALGO
0.999992
4.617093
{ "github_metadata": { "branch": "main", "commit_count": 174, "repo_created_at": "2024-07-22T01:38: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": "fd06d2cbaf...
be59f6a5-1b72-4ea8-ad4f-fa0db8985555
Rafat001/Solved_UVA_Problems_By_Rafat001
UVA 11906.cpp
#include<bits/stdc++.h> using namespace std; int visit[105][105],even,odd,r,c,m,n,visit1[105][105]; struct node { int r; int c; }temp,nd; queue<node>q; void bfs(int x, int y) { int rw,cl,flag=0; nd.r=x; nd.c=y; q.push(nd); while(!q.empty()) { memset(visit1,0,sizeof(visit1)); ...
ALGO
0.999934
3.715808
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2016-10-08T04:27:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "59f0f9eea...
3b3a1261-e2e0-4161-86e9-1ba4e03f9c71
luqmanarifin/cp
0-unclassified/india.cpp
#include <iostream> #include<cmath> #include<limits.h> using namespace std; long long int A[10000007]; long long int L[10000005]; long long int R[10000004]; // long long int st[50000000]; long long int min1(long long int a,long long int b) { if(a>b) return b; else return a; } int getMid(int s,...
ALGO
0.99987
3.889784
{ "github_metadata": { "branch": "master", "commit_count": 772, "repo_created_at": "2016-02-09T04:26:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "eecac97e...
bb0fdab2-d846-4278-8d38-f01883e582bd
doum1004/code_assessment
leetcode/leetcode_cpp/top-k-frequent-elements copy.cpp
#include <iostream> #include <cassert> #include <unordered_map> using namespace std; /** https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/ //Solution1. sliding window (TwoPointers with map or array). map is slower (erase()->o(n), allocation overhead, potential reallocation) //time:o...
ALGO
0.999861
6.315039
{ "github_metadata": { "branch": "master", "commit_count": 625, "repo_created_at": "2020-01-05T08:23:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "db4acc29...
188e5f9c-5ef8-42d6-b0d9-d0d767d8022c
yerinirey/Algorithm
백준/Silver/6588. 골드바흐의 추측/골드바흐의 추측.cc
#include <iostream> #include <algorithm> #include <cmath> #define MAXNUM 1000001 using namespace std; bool prime[MAXNUM]; int n, m, x; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); for (int i = 2; i < MAXNUM; i++) prime[i] = true; for (int i = 2; i <= sqrt(MAXNUM); i++) { if (prime[i]) { ...
ALGO
0.999694
3.337636
{ "github_metadata": { "branch": "main", "commit_count": 86, "repo_created_at": "2024-07-24T08:39: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": "b856522dc4e...
05ef50ca-4191-4fda-be9c-52e657f4b929
devartstar/Algorithms
codeChef/Starters11/a.cpp
/* ------------------------------------- | | | Author - <NAME> | | Roll - 19MA20014 | | | ------------------------------------- LAB 5 : Ques :- 2.) Check if the given expression is correct or not. */ /* LOGIC :- The...
ALGO
0.998976
4.700989
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2021-05-02T08:47:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bc8e9b7a1...
8269ca54-2b26-4397-99fe-0231b4d7eda7
thong3le/graph-algorithms-cpp
temp/representation.cpp
#include <iostream> #include <vector> #include <fstring> #include <queue> using namespace std; typedef pair<int, int> ii; typedef vector<ii> vii; int V, E, total_neighbors, id, weight, a, b; int AdjMat[100][100]; priority_queue< pair<int, ii> > EdgeList; void adjacency_matrix(){ scanf("%d", &V); for (int i = 0; i...
ALGO
0.999575
3.798062
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-05-26T22:32:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c7d5d804ca...
e794dee6-badd-4d3d-9233-0c80ad844864
steve-cw-chung/codewars_CPP
array/155.MinOpToMakeArrayAltering.cpp
/* You are given a 0-indexed array nums consisting of n positive integers. The array nums is called alternating if: nums[i - 2] == nums[i], where 2 <= i <= n - 1. nums[i - 1] != nums[i], where 1 <= i <= n - 1. In one operation, you can choose an index i and change nums[i] into any positive integer. Return the minimu...
ALGO
0.999915
5.507809
{ "github_metadata": { "branch": "master", "commit_count": 138, "repo_created_at": "2020-07-03T03:37:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4a4bc878...
bfb1333b-9071-4498-8475-ebbfb109264b
Chaitya-007/GFG
Easy/Equilibrium Point/equilibrium-point.cpp
//{ Driver Code Starts #include <iostream> using namespace std; // } Driver Code Ends class Solution{ public: // Function to find equilibrium point in the array. // a: input array // n: size of array int equilibriumPoint(long long a[], int n) { // Your code here long long befo...
ALGO
0.999519
5.561847
{ "github_metadata": { "branch": "main", "commit_count": 1512, "repo_created_at": "2023-08-05T18:27:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6f09723ec...
350d5cf5-1a39-456b-a528-30c4eeef3cf8
19shmily/LeetCodeTest
44.通配符匹配.cpp
#include<iostream> #include<string> #include<vector> using namespace std; //超时,已寄 class Solution_44_1 { bool work(string s, string p, int n, int i) { bool flag = false; for (; n >= 0; n--) { if (flag) { if (i >= 0) { ...
ALGO
0.999969
4.084777
{ "github_metadata": { "branch": "main", "commit_count": 233, "repo_created_at": "2024-02-05T13:35: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": "f10572ecd8...
ef533bbe-7486-40a9-8bb0-723c2bba5f30
kz04px/swizzles
src/swizzles/search/root.cpp
#include "root.hpp" #include <chess/position.hpp> #include <chrono> #include <thread> #include "controller.hpp" #include "search.hpp" namespace swizzles::search { [[nodiscard]] auto get_nodes(const std::vector<ThreadData> &thread_data) noexcept -> std::uint64_t { std::uint64_t total = 0; for (const auto &data...
ALGO
0.999381
6.561956
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2021-04-11T21:39:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f5af1e7f0...
2826214a-da35-4136-9b3a-2972af635a14
gyubeomim/lockdpwn
cpp/1books/brain_STL/book_codes/02/ex02-08.cpp
#include <iostream> using namespace std; //////// 서버 ///////////// // 배열의 모든 원소에 반복적인 작업을 하도록 추상화되어 있음(구체적인 작업은 없음) void For_each(int *begin, int *end, void (*pf)(int ) ) { while( begin != end ) { pf( *begin++ ); // 클라이언트 함수 호출(콜백) } } /////// 클라이언트 ///////// void Print1(int n) // 공백을 이용하여 원소를 출력 {...
ALGO
0.946541
5.22891
{ "github_metadata": { "branch": "master", "commit_count": 1541, "repo_created_at": "2017-11-23T17:43:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1df8950...
10f49227-53dc-4180-b85d-a578a947413d
root-project/root
math/mathmore/src/SpecFuncMathMore.cxx
// @(#)root/mathmore:$Id$ // Authors: <NAME>, <NAME> 08/2005 // Authors: <NAME> & <NAME> 06/2005 /********************************************************************** * * * Copyright (c) 2005 , LCG ROOT MathLib Team * ...
ALGO
0.999353
4.555922
{ "github_metadata": { "branch": "master", "commit_count": 93033, "repo_created_at": "2013-06-27T10:46:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2899, "forks": 1363, "issues": 467, "pull_requests": 269 }, "file_meta": { "content_id"...
adf490d0-ec47-4e37-a0de-490a6e32e66c
pranayharjai7/LeetCode
Problems/MajorityElement.h
#ifndef LEETCODE_MAJORITYELEMENT_H #define LEETCODE_MAJORITYELEMENT_H #include <vector> #include <iostream> #include <algorithm> class MajorityElement { public: int majorityElementBruteForce(std::vector<int>& nums) { int n = nums.size(); for (int i = 0; i < n; ++i) { int freq = 0; ...
ALGO
0.9999
6.023398
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2025-04-13T20:50: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": "bf7a435093...
6fc2bf18-9e3d-4104-aeb2-7db73f2526e5
sh2268411762/Practice
牛客练习题/6.3.cpp
////#include <iostream> ////using namespace std; //// //// ////long fun(int n) ////{ //// if (n > 2) //// { //// return (fun(n - 1) + fun(n - 2)); //// } //// else //// { //// return (n); //// } ////} //// ////int main() ////{ //// int i; //// cout << "ui"; //// cin >> i; //// cout << endl; //// cout << fun(i) << end...
ALGO
0.999468
3.690365
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2020-05-08T13:51:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dd8d55d96...
dd6c57af-389e-4b85-bc86-8913e24210ba
lovell112/LearningCPP
arrays/mangcs4.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; int a[n][m]; for ( int i = 0; i < n; i++ ){ for ( int j = 0; j < n; j++ ){ cin >> a[i][j]; } } for ( int i = 0; i < n; i++ ){ for ( int j = 0; j < n; j++ ){ int t...
ALGO
0.999991
3.588532
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-12-07T18:27:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6d45994ddeb3...
9357f855-9544-4e2d-b428-aa8d5086d55d
solfridhj/mon-jasnow
lattice.hpp
// // lattice.hpp // exam // // Created by <NAME> on 04/05/2020. // Copyright © 2020 <NAME>. All rights reserved. // #pragma once // Increases matrix size allowed to allocate (might not be needed, depends on system) #define ARMA_64BIT_WORD 1 #include <iostream> #include <armadillo> #include <string> #include <ve...
ALGO
0.987821
5.49906
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2021-01-29T16:57: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": "a6954b785fcc...
ad4eff4c-0f70-415e-8ec7-741749c4ea6f
KiryLap/Project-C-
main.cpp
#include <iostream> #include <chrono> #include "Verification/utils.h" #include "Cheremshanov/functions1_by_Cheremshanov.h" #include "Muratov/functions2_by_Muratov.h" #include "Fomenko/functions3_by_Fomenko.h" #include "Sannikov/functions4_by_Sannikov.h" #include <vector> #include <utility> #include <string> #include <f...
ALGO
0.997608
5.376384
{ "github_metadata": { "branch": "main", "commit_count": 42, "repo_created_at": "2024-10-15T14:14: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": "b1ef34953fe...
6e44cd0c-9d74-4e67-9d47-a0ae13f7cd64
nisanil03/Leetcode
3741-reschedule-meetings-for-maximum-free-time-ii/3741-reschedule-meetings-for-maximum-free-time-ii.cpp
class Solution { public: int maxFreeTime(int eventTime, vector<int>& startTime, vector<int>& endTime) { int n = startTime.size(); vector<int64_t> gaps(n+1); gaps[0] = startTime[0]; for (int i = 1; i < n; ++i) gaps[i] = int64_t(startTime[i]) - endTime[i-1]; gaps[n] = int64_t(e...
ALGO
0.999961
5.475214
{ "github_metadata": { "branch": "main", "commit_count": 1462, "repo_created_at": "2024-10-22T18:22:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7c4dbe287...
df81223d-6b33-4648-9ac5-ed827e63fb24
shreddered/ComputerGraphics
lab02/src/cyrus_beck.cpp
#include "cyrus_beck.hpp" #include <algorithm> #include <cmath> #include <cstdint> #include <numeric> void line(cv::Mat image, cv::Point from, cv::Point to, uint8_t color) { const int dx = std::abs(from.x - to.x), dy = std::abs(from.y - to.y); const int signX = from.x < to.x ? 1 : -1, signY = fr...
ALGO
0.999766
5.209013
{ "github_metadata": { "branch": "master", "commit_count": 41, "repo_created_at": "2021-12-18T00:54: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": "c8d6bb930...
3a76a3ef-032c-40b9-b606-2246367fa8a9
damianMietus/Packing-Stacks-of-Boxes
boxes.cpp
// Reddit Daily Programmer // <NAME> // Challenge #349 [Intermediate] Packing Stacks of Boxes #include <iostream> #include <string> #include <stdlib.h> #include <list> #include <stdio.h> #include <stdlib.h> #include <sstream> #include <algorithm> // std::next_permutation, std::sort using namespace std; typedef str...
ALGO
0.999846
4.543212
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2018-09-28T13:28: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": "0a28c8dcd...
ce8e935d-7194-470c-962b-51420b1aa330
sio2whocodes/vgw_daily_week4
1113_11.13_임수정.cpp
#include<iostream> #include<string> using namespace std; class Course { public: Course(const string& courseName, int capacity) { numberOfStudents = 0; this->courseName = courseName; this->capacity = capacity; students = new string[capacity]; } ~Course() { delete[] students; } void doubleCapacity() { s...
TOOL
0.971581
4.306116
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-01-06T04: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": "be626579d7...
0998cb42-c578-4995-a15a-f176fc569fc9
constantinpape/custom_malis
include/custom_malis/custom_malis.hxx
#pragma once #include <algorithm> #include <map> // for benchmarking #include <chrono> #include "nifty/marray/marray.hxx" #include "nifty/tools/for_each_coordinate.hxx" #include "boost/pending/disjoint_sets.hpp" namespace custom_malis { template<unsigned DIM, typename DATA_TYPE, typename LABEL_TYPE> void comput...
ALGO
0.996707
4.596907
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2017-09-15T20:39:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "72322093c6...
2b66780c-516a-41d2-b3c6-c8d4709e7b7a
PaddlePaddle/Paddle
paddle/phi/kernels/gpu/reduce_amin_amax_common.h
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required...
ALGO
0.991749
6.940281
{ "github_metadata": { "branch": "develop", "commit_count": 54743, "repo_created_at": "2016-08-15T06:59:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 23037, "forks": 5770, "issues": 1009, "pull_requests": 823 }, "file_meta": { "content_...
556aa172-5f3f-406a-aadf-c53630c3878c
shun74/Barcode-Recognition
src/scan_utils.cpp
#include <vector> #include <scan_utils.h> void scan_utils::getWidthList(cv::Mat& line, std::vector<int>& width_list, std::vector<int>& x_list, int val1, int val2) { int width = 0; for (int i=0; i<line.cols; i++) { int val = line.data[i]; if (val == val1) { if (width ...
ALGO
0.961266
4.330729
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2022-11-22T05:44:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b5cc288f7c15...
1100a656-23f2-49e6-823e-6960a144ebb9
Kamrul-Hasan-1971/LightOJ
1112 - Curious Robin Hood.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int #define MX 100005 ll tree[MX*3],ara[MX+3]; void MakeTree( int node, int start, int endd ) { if( start == endd ) { tree[node] = ara[start] ; return ; } int left = no...
ALGO
0.999821
3.865609
{ "github_metadata": { "branch": "master", "commit_count": 100, "repo_created_at": "2019-05-02T20:05: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": "6d6aefdb...
66e21afb-5ae2-4783-9b1b-9935f1a28dd3
taawraat/UVa-solutions
11235 - Frequent values.cpp
#include <bits/stdc++.h> #define nline cout << '\n'; #define lastof(s) s.size() - 1 #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define pb push_back #define mp make_pair #define EPS 1e-5 #define pdd pair<do...
ALGO
0.999807
4.128992
{ "github_metadata": { "branch": "master", "commit_count": 116, "repo_created_at": "2020-10-04T13:29:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "972fdab3...
7e7fc0a7-2172-41eb-bb39-cb9d60492992
tildearrow/kwin-lowlatency
src/plugins/nightcolor/suncalc.cpp
/* KWin - the KDE window manager This file is part of the KDE project. SPDX-FileCopyrightText: 2017 <NAME> <<EMAIL>> SPDX-License-Identifier: GPL-2.0-or-later */ #include "suncalc.h" #include "constants.h" #include <QDateTime> #include <QTimeZone> #include <QtMath> namespace KWin { #define TWILIGHT...
TOOL
0.927706
7.04811
{ "github_metadata": { "branch": "Plasma/5.23", "commit_count": 20173, "repo_created_at": "2019-03-26T21:19:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 367, "forks": 8, "issues": 19, "pull_requests": 0 }, "file_meta": { "content_id":...
72ff57bc-977e-4f7e-b5b3-2d14670b2714
ipc2023-htn/TOAD
02-TOAD-Source/deprecated/hDfaDistance.cpp
// // Created by dh on 22.01.21. // #include <fstream> #include <cassert> #include "hDfaDistance.h" #include "utils/IntPairHeap.h" void hDfaDistance::write(const string& filename, FiniteAutomaton *dfa, progression::Model *htn) { ofstream hfile; hfile.open(filename); cout << "- generate inverse graph" << e...
ALGO
0.998673
4.037937
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2023-02-26T11:23:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6cc7fe678a5...
bf14c594-046c-4047-811f-f84e0ba3dffe
pavelsimo/ProgrammingContest
codeforces/PastContest/Codeforces Round #155 (Div. 2)/C.cpp
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <stack> #include <set> #include <map> #include <list> #include <bitset> #include <deque> #include <numeric> #include <iterator> #include <cstdio> #include <cstdlib> #include <cstring> #include <ccty...
ALGO
0.999998
3.952861
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2014-10-16T15:16:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9b90e1acde...
fcaa234f-a101-4bb4-9326-cd1c1990c992
kuyanov/mathpuz-solver
include/sat.h
#pragma once #include <cstdio> #include <cstdlib> #include <exception> #include <sstream> #include <string> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <vector> #define SAT 10 #define UNSAT 20 inline bool satisfiable(const std::vector<std::vector<int>> &cnf, std::vector<bool> &sol, ...
ALGO
0.993454
5.169174
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2024-07-13T10:58:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eeb2e85a280...
bcee7629-328f-4e92-ab7a-bd6aa0a65c91
Ahsanul24/My-Codes
M_Minimum_LCM.cpp
// <NAME> // Coded by <NAME> // NSTU//CSTE #include <bits/stdc++.h> using namespace std; typedef long long int ll; #define MOD 1e9 + 7 #define pb push_back #define vi vector<int> #define vl vector<ll> #define f first #define s second #define bit(a) __builtin_popcount(a) #define w(x) while (x--) #define test \ int ...
ALGO
0.999462
3.758775
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-01-24T11:20: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": "c598e438f881...
e5e8af97-cd34-4bd2-b05b-959e9c3a43d5
seulgit02/Algorithm
컨베이어벨트위의로봇(baekjoon_20055).cpp
#include <iostream> #include <vector> using namespace std; int main(void) { int N, K, temp; cin >> N >> K; vector<int> belt(2*N+1,0); vector<int> robot(N+1,0); for (int i = 1; i <= 2*N; i++) { cin >> belt[i]; } int step = 1; while (1) { // 1. 각 칸 위에 있는 로봇과 함께 벨트를 한칸씩 회전...
ALGO
0.99999
3.644391
{ "github_metadata": { "branch": "main", "commit_count": 41, "repo_created_at": "2025-01-15T14:44: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": "1c217e74e7d...
04ff1669-8a31-4965-a42a-36255c574fbb
ashrafulhoda789/Basic-Data-Structure
Assignment_2/Queries.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: int val; Node* next; Node(int val){ this->val = val; this->next = NULL; } }; void insert_at_head(Node*& head, int v) { Node* newNode = new Node(v); newNode->next = head; head = newNode; } void ins...
ALGO
0.999747
4.599996
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-07-12T06:10:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "21582d2540c7...
2422915b-6dc1-4981-918f-c090eb957692
mayank2498/Algorithms
Trees/vertical-order-tree-traversal.cpp
// in this case the order of each row is not maintained // to do that we can do a level order traversal using the same technique and store horizontal distances in the queue // https://www.geeksforgeeks.org/print-a-binary-tree-in-vertical-order-set-3-using-level-order-traversal/ #include<iostream> #include<bits/stdc++....
ALGO
0.999943
4.685237
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2017-12-17T18:53: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": "3bb1ea328...
28eb5cd9-0f4f-45fd-a9c0-9945f87c8ae3
prateeksharma21/Competitive-Programming
Contest/Codeforces/Codeforces Round #658/a.cpp
#ifdef Prateek #include "Prateek.h" #else #include <bits/stdc++.h> using namespace std; #define debug(...) 42 #endif #define F first #define S second #define pb push_back #define int ll #define f(i,x,n) for(int i=x;i<n;i++) #define all(c) c.begin(),c.end() using ll = long long; const int MOD = 1e9+7, N = 1e5 + ...
ALGO
0.999979
3.211516
{ "github_metadata": { "branch": "main", "commit_count": 102, "repo_created_at": "2019-09-30T19:06:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1d1a0c339...
ab74ecfb-6c92-4546-85c3-029c48a144b1
Orange1991/leetcode
105/cpp/main.cpp
#include <iostream> #include <vector> using namespace std; /** 二叉树节点的定义 */ struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; class Solution { public: /** * 根据前序遍历和中序遍历序列构造二叉树 * 序列中不存在重复元素 * input preorder : 前序遍历序列 ...
ALGO
0.999993
5.351326
{ "github_metadata": { "branch": "master", "commit_count": 170, "repo_created_at": "2015-06-01T15:11:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "172bbdc...
54894e5f-5735-4865-a424-7fe743b70979
SeyoungJeon/Algorithmus
Algorithmus/Algorithmus/2146.cpp
#include <iostream> #include <deque> #include <vector> #include <limits.h> #include <algorithm> using namespace std; int N, **visit, bridge = INT_MAX,cnt=0; int dx[4] = { 1,-1,0,0 }; int dy[4] = { 0,0,1,-1 }; bool **arr; deque<deque<pair<int, int>>> land; int BFS(int land_Num) { int min = 0; for (int i = 0; i < N;...
ALGO
0.999878
4.418081
{ "github_metadata": { "branch": "master", "commit_count": 152, "repo_created_at": "2019-07-22T08:05: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": "23a40db8...
51cbfd89-0548-44ce-aafb-d57749aa8e12
GameFoundry/bsf
Source/Foundation/bsfUtility/ThirdParty/simdpp/detail/insn/f_fmadd.h
/* Copyright (C) 2013-2014 <NAME> <<EMAIL>> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef LIBSIMDPP_SIMDPP_DETAIL_INSN_F_FMADD_H #define LIBSIMDPP_SIMDPP_DETAIL_INSN_F_FMADD_H #if...
ALGO
0.941839
7.060398
{ "github_metadata": { "branch": "master", "commit_count": 5221, "repo_created_at": "2018-03-15T10:17:21.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1752, "forks": 194, "issues": 99, "pull_requests": 8 }, "file_meta": { "content_id": "33...
42127f1c-9511-4462-a863-8d9da1f43fa7
raditya1710/competitive-programming
Codeforces/Round #441 (Div. 1, by Moscow Team Olympiad)/D.cpp
#include <bits/stdc++.h> using namespace std; const int N = 2e5; int segtree[(1 << 19) + 5]; int segmax[(1 << 19) + 5]; int ar[N + 5]; int n; inline void build(int l, int r, int idx){ if(l == r){ segtree[idx] = ar[l]; segmax[idx] = l; return; } int m = (l + r) >> 1; int chd = idx << 1; build(l, ...
ALGO
0.999978
4.766143
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2017-10-19T10: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": "44912b405...