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
4cfb925d-b868-4f77-8249-59fc92cccd8e
Sorabh3127/CU_Codechef
Assignment/14_out_of_the_abyss.cpp
#include<bits/stdc++.h> using namespace std; // Om : A Peaceful Soul #define ll long long #define ff first #define ss second #define pb push_back #define vi vector<int> #define rep(i,a,b) for(int i=a;i<b;i++) #define scnarr(a, n) \ for (int i = 0; i < n; ++i) \ cin >> a[i] #define vi vector<int> #...
ALGO
0.999812
4.568017
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2021-11-07T15:34:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dc1a91fb2...
050eb2a8-02ae-465d-9d23-f97a97da4ab2
se-sic/dune-VaRA
dune-performance-regressions/src/poisson-alugrid.cc
// // Created by abeltluk on 5/12/23. // // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- // vi: set et ts=4 sw=2 sts=2: #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <iostream> #include <dune/common/filledarray.hh> #include <dune/common/parallel/mpihelper.hh> #include <dune/grid/utility/...
ALGO
0.907475
5.655319
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2023-05-12T11:49:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a2fed0aba03...
699c38ae-7470-422b-b895-2b8cbd31a91b
kwonsunbin/SW-Certi-PRO
문자열집합.cpp
#include <stdio.h> #include <string> #include <unordered_map> #include <iostream> using namespace std; int N; int M; struct Node{ bool isWord; unordered_map<char,Node*> children; Node() { isWord = false; } }; Node *root = new Node(); int ans; void insert(string word){ Node *temp = r...
ALGO
0.999978
3.681693
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2023-01-14T01:16: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": "989f8ad4b5a4...
490ae2c8-29b6-411f-9e8d-516f868d5512
sgrade/cpptest
leetcode/strobogrammatic-number-ii.cpp
// 247. Strobogrammatic Number II // https://leetcode.com/problems/strobogrammatic-number-ii/ #include <bits/stdc++.h> using namespace std; class Solution { public: vector<vector<char>> reversible_pairs = { {'0', '0'}, {'1', '1'}, {'6', '9'}, {'8', '8'}, {'9', '6'} }; vector<string...
ALGO
0.99981
6.372786
{ "github_metadata": { "branch": "master", "commit_count": 2401, "repo_created_at": "2020-08-01T16:38:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "16a9777...
a4fae24a-5ad9-4810-be87-5214d37cf34d
LowaiDobie/Csci-135
compare.cpp
/* <NAME> CSCI-135 lab 3a compare.cpp asks the user to input two dates (the beginning and the end of the interval). 2/22/2021 */ #include <iostream> #include <fstream> #include <cstdlib> #include <climits> using namespace std; int main(){ // read the datafile ifstream fin("Current_Reservoir_Levels.tsv"); i...
TOOL
0.981497
4.167906
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-08-25T19:19: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": "4c0826178d2c...
e0f8ac33-c0e1-4ce7-8c2b-ca2805855c1c
redbindy/ComputerScience
data_structure/tree/binary_search_tree.h
#pragma once #include <cassert> #include <cstdlib> namespace binary_search_tree { template<typename T> struct bst_node_t { T key; struct bst_node_t* p_left; struct bst_node_t* p_right; }; template<typename T> void destroy_recursive(bst_node_t<T>** const pp_root) { if (*pp_root == nullptr) { return;...
ALGO
0.997456
5.230093
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2024-11-20T10:23: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": "a41800f58...
0be01ef1-343d-4fd9-a176-413fe27849cb
EeeUnS/2020CppStudy
week1/dohun_kim/week1_5.cpp
#include <iostream> #include <vector> #include <list> #include <string> class Node { private: std::string name; int x; int y; public: Node(std::string _name, int _x, int _y) : name(_name), x(_x), y(_y) {} void print() { std::cout << "(" << name << ", " << x << ", " << y << ")"; } }; class Gra...
ALGO
0.996439
5.178483
{ "github_metadata": { "branch": "master", "commit_count": 81, "repo_created_at": "2019-12-26T09:44:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "01279e1d0...
6737897f-b2dc-4dfe-abe6-923c8c1d719a
Wild-Donkey/Code
Luogu/P4200-P4499/P4213_MrDuSieve.cpp
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #define Wild_Donkey 0 using namespace std; inline unsigned RD()...
ALGO
0.999861
4.15204
{ "github_metadata": { "branch": "main", "commit_count": 182, "repo_created_at": "2021-02-23T08:38:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fe4d79f1cc...
88df167e-ed45-45fe-bec9-7302f3d31c2b
Rupesh-Singh-Karki/DSA
Lec 073 BST Day 5/sizeoflargestbst.cpp
/* Following is Binary Tree Node structure: class TreeNode { public: int data; TreeNode *left, *right; TreeNode() : data(0), left(NULL), right(NULL) {} TreeNode(int x) : data(x), left(NULL), right(NULL) {} TreeNode(int x, TreeNode *left, TreeNode *right) : data(x)...
ALGO
0.99992
5.779547
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2024-07-19T21:40: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": "8bccafa92c1...
d4deb57e-33f1-4cf0-9ab6-95cc8508d027
DongwookHong/codingtest
4.6/괄호변환.cpp
#include <string> #include <vector> #include <stack> using namespace std; bool check(string input) { stack<char> st; for (char c : input) { if (c == '(') { st.push(c); } else { if (st.empty()) return false; st.pop(); } } return st.empty(); }...
ALGO
0.999961
5.516821
{ "github_metadata": { "branch": "main", "commit_count": 52, "repo_created_at": "2025-02-15T11:58: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": "2f410bad6fc...
ecb2d271-c9b9-45aa-9c7f-b22f0a394e2b
div-bargali/Data-Structures-and-Algorithms
C++/Algorithms/Mathematical/Lucky_number_comment.cpp
/* This function receives the value of n1 from the user, and outputs a "lucky number" if there is a duplicate number among the input numbers, and a "not lucky number" if there is no duplicate number. */ #include<iostream> using namespace std; int main() { int n,n1,n2,d1,d2,ct=0,flag=0; cout<<"Enter a number: "; ...
ALGO
0.999356
3.539356
{ "github_metadata": { "branch": "main", "commit_count": 1091, "repo_created_at": "2020-10-05T15:13:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 272, "forks": 388, "issues": 2, "pull_requests": 4 }, "file_meta": { "content_id": "0a919...
d03eb34f-6c45-4dd6-a233-8528f474c375
RakeshRoxx/dsa
sorting/selectionSort.cpp
#include<bits/stdc++.h> using namespace std; void selectionSort(int arr[], int n) { // devide the array in two part sorted and unsorted // take the min value from the unsorted part and put it in sorted part int minValueIdx; for (int i = 0; i < n - 1; i++) { minValueIdx = i; for (int j = i + 1; j < n; j++) ...
ALGO
0.99999
4.999099
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2021-11-22T07:17: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": "561169cce90...
21956744-d41a-4b90-939f-8c81c2af092d
ProMix0/Laboratory
Term5/Parallel/v25/serial.cpp
#include <fstream> #include <iostream> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <vector> using namespace std; #define THREADS_PER_BLOCK 64 #define GRAVITATIONAL_CONSTANT 6.7e-11 #define TIME_STEP 0.001f #define PI 3.14152926f typedef struct { float...
ALGO
0.994598
4.394938
{ "github_metadata": { "branch": "master", "commit_count": 94, "repo_created_at": "2022-09-29T04:35:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d7e8bafcc...
ad562809-7fb9-45b6-b306-464df89abd99
koba-e964/contest
yukicoder/458.cpp
#include <iostream> #include <vector> #define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++) using namespace std; typedef vector<int> VI; int main(void){ int n; cin >> n; vector<bool> tbl(n + 1, true); tbl[0] = tbl[1] = false; REP(i, 2, 200) { REP(j, 2, n / i + 1) { tbl[i * j] = false; } } ...
ALGO
0.999925
3.801893
{ "github_metadata": { "branch": "master", "commit_count": 2836, "repo_created_at": "2013-09-13T04:48:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 25, "forks": 5, "issues": 20, "pull_requests": 0 }, "file_meta": { "content_id": "8108c...
7b020909-0c67-445e-b1c0-c4f5305bed58
ltroska/hpx_examples
matrix_matrix_product/src/matrix_matrix_product.cpp
// Copyright (c) 2016 <NAME> // // 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) #include <hpx/hpx_init.hpp> #include <hpx/hpx.hpp> #include <boost/range/irange.hpp> #include <hpx/include/parallel_algorithm.hpp>...
ALGO
0.977417
5.916213
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2016-05-03T22:48:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e2d04f194...
0478f1d8-4b8b-486e-abfb-57a525376005
d2macster/leetcode-cpp
src/E/4/E479_LargestPalindromeProduct.cpp
// // Created by <NAME> on 5/14/18. // #include <string> #include <cmath> #include <iostream> #include <vector> using namespace std; class Solution { long getPalindrome(long v) { string s = to_string(v); string r = s; reverse(s.begin(), s.end()); return stol(r + s); } bool...
ALGO
0.99912
5.169425
{ "github_metadata": { "branch": "master", "commit_count": 640, "repo_created_at": "2018-01-08T18:54: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": "59847c23...
9a8dc0f7-7920-49b7-a3f9-d9df617358cc
ZongrongLi/pat
patcode/a1098_1.cpp
#include <stdio.h> #include <cstdio> #include <algorithm> #include <string.h> #include <stdlib.h> #include <math.h> #include <queue> #include <utility> #include <vector> #include <iostream> #include <string> #include <set> using namespace std; int n = 0; int A[2000] = { 0 }; int B[2000] = { 0 }; int C[2000] = { 0 }; b...
ALGO
0.999973
3.092782
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2018-02-14T03:07:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0bf29e3f69...
b807391e-c1c9-4bd0-b376-a8afe1a3ef67
iam83/CPP_learning
CPP_others/Maps_example/main.cpp
#include <iostream> #include <map> #include <ctime> // ++i = i+i then cout // i++ = cout i, then i+i ?? void printMap(const std::map<int, int> &data){ int i = 0; for (auto &pair : data){ std::cout << i++ << " -- "; std::cout << pair.first << " " << pair.second << std::endl; } std::co...
TOOL
0.979925
3.539713
{ "github_metadata": { "branch": "master", "commit_count": 556, "repo_created_at": "2022-03-04T14:05:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6b6ffc03...
616d2091-c369-4315-88b8-352ee012fba7
cosmo8724/Algorithm
BackJoon/Solved/14867 O.cpp
/* 23. 09. 20 */ #include <bits/stdc++.h> using namespace std; int max_a, max_b, target_a, target_b, ret{ numeric_limits<int>::max() }; vector<function<void(int&, int&)>> oper{ [](int& current_a, int&) { current_a = max_a; }, [](int&, int& current_b) { current_b = max_b; }, [](int& current_a, int&) { current_a = ...
ALGO
0.999828
4.490545
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2023-04-24T15:21:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b5870ea241a...
4ee93e49-2cdf-4fa1-85b3-90fedc22ad53
raincross7/code-similarity
codes/train_code/problem331/problem331_275.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; long long MOD = 10000000000 + 7; vector<ll> C; vector<vector<ll>> A; int N,M; ll X; ll MAX = 1000000000000000000; ll min_val = MAX; void solve(string S){ if(S.size() < N){ solve(S+"0"); solve(S+"1"); return;...
ALGO
0.999958
4.138
{ "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": "3a3cf8f026d0...
219bf873-9ba9-4eab-89b4-ad3426d34aa0
tinoryj/Mathematical-Contest-in-Modeling
Trainings/2017_CUMCM_UESTC/Answer/code/按回答长度律师专业程度处理.cpp
// // main.cpp // 20170506-3 // // Created by tinoryj on 2017/5/6. // Copyright © 2017年 tinoryj. All rights reserved. // #include <iostream> #include <cstdio> #include <cstdlib> #include <stdlib.h> #include <string> #include <fstream> #include <cerrno> #include <vector> #include <cstring> #include <time.h> typedef ...
TOOL
0.992577
3.575563
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2018-02-14T09:49:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3c84613a...
122d1cdf-6c73-4e80-9055-042b371f6d5d
PushyamiKaveti/MultiCamRectification
src/LevenbergMarquardt.cpp
#include "LevenbergMarquardt.hpp" #include <cmath> #include <iostream> #include <fstream> /////////////////////////////////////////////////////////////////////// /// This function solves a non-linear system. /// the a vector is the unknown /// the b vector is the const data /// The vector X corresponds to the st...
ALGO
0.999887
5.018398
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2020-07-29T17:12:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8fa045543a...
68ba613c-2452-4861-97a1-171102297ed0
dhruvrajput1/cppcodes
Character Array/permutations.cpp
#include<iostream> using namespace std; int length(char* arr){ int cnt = 0; int i = 0; while(arr[i] != '\0'){ cnt++; i++; } return cnt; } bool permutation(char* arr1, char* arr2){ int freq1[26] = {0}; int freq2[26] = {0}; for(int i = 0; i < length(arr1); i++){ ...
ALGO
0.999967
4.253975
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2024-01-22T07:40: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": "af91cc040e...
254abcbc-32b2-413d-94b5-b42860bd3e62
rose/hex
boardsim.cpp
#ifndef _BOARDSIM_H #define _BOARDSIM_H #include "board.cpp" #include <ctime> #include <cstdlib> using namespace std; class BoardSim:public Board { #define ME 1 #define OPP 0 public: BoardSim(int sizeIn):Board(sizeIn) { // make the board and fill it with random values // store information about ...
ALGO
0.954709
5.678808
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2014-05-31T17:19: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": "dde4737b31...
ebfa46b9-9edc-4a3b-b5e9-774b926629f7
pingo95/SEP-Gruppe-11-W-rmeleitung
Quellcode/algorithms/LU.hpp
#ifndef LU_HPP #define LU_HPP #include "LU.h" template <class T> algorithms::LU<T>::LU() { } template <class T> void algorithms::LU<T>::decompose(CRS<T> const & matrix) { L.resize(matrix.getSize()); for(int i=0; i<L.size(); ++i) { L[i].resize(L.size()); L[i][i] = 1; } QVector<QVecto...
ALGO
0.991248
6.078971
{ "github_metadata": { "branch": "master", "commit_count": 170, "repo_created_at": "2015-08-29T14:14: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": "f976ada3...
4858351c-bfcc-48ec-8234-1f4906c2057d
riyaz28/some-CP-problems
B_OR_in_Matrix.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define all(x) x.begin(),x.end() #define pii pair<int,int> #define pb push_back #define mp make_pair #define setp(n) cout<<fixed<<setprecision(n) #define lb lower_bound #define ub upper_bound #define mod 1000000007 #define op(x) cout<<x #define ip(x) ci...
ALGO
0.999881
3.335632
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2020-11-15T11:13: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": "05e6e30aa95...
5cfacf3b-e217-4ecd-8607-2751672994c5
Tudor67/Competitive-Programming
LeetCode/Problems/Algorithms/#712_MinimumASCIIDeleteSumForTwoStrings_sol1_dp_O(N1xN2)_time_O(N1xN2)_extra_space_32ms_16MB.cpp
class Solution { public: int minimumDeleteSum(string s1, string s2) { const int N1 = s1.length(); const int N2 = s2.length(); // dp[i1][i2]: min cost to make s1[i1 .. ] and s2[i2 .. ] equal vector<vector<int>> dp(N1 + 1, vector<int>(N2 + 1)); for(int i1 = N1 - 1; i1 >= 0; --...
ALGO
0.999996
5.950619
{ "github_metadata": { "branch": "master", "commit_count": 615, "repo_created_at": "2020-02-27T19:56:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "30bd85db...
71a46335-8629-4c76-9f29-4d0d228ceb84
josiashod/reseau_v2v
core/graph.cpp
#include "graph.h" #include <random> #include <stack> #include <limits> #include <queue> #include <QDebug> namespace osm { double distance(QPointF s, QPointF e) { QPointF d = e - s; return std::sqrt((d.x() * d.x()) + (d.y() * d.y())); } Node::Node(long long id, double x, double y): d_id{id}, d_pos{x, y}, d_...
ALGO
0.9964
4.157142
{ "github_metadata": { "branch": "main", "commit_count": 131, "repo_created_at": "2024-10-03T08:45:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d20c23b46f...
0055660b-3f6f-436c-b4d1-51fce6409099
ongyiumark/programming-problems
in_progress/Uncompleted Contests/ABC233/ABC233D.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<int,pair<int,int>> piii; template <typename T> using ordered_set = __gnu_pbds::...
ALGO
0.999899
4.65113
{ "github_metadata": { "branch": "main", "commit_count": 227, "repo_created_at": "2020-10-09T05: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": "6ac3a80562...
02acfc59-4d2a-435e-92d4-7eaf24bfb7f2
kingkk31/BOJ
source code/3033_가장 긴 문자열.cpp
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <queue> #include <vector> #include <stack> #include <set> #include <map> #include <list> #include <string> #include <string.h> #include <math.h> #include <algorithm> #include <malloc.h> #include <functional> #include <time.h> #include <cctype> #pragma ...
ALGO
0.99999
4.040011
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2016-01-09T13:33:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7fc984585...
c09689e0-d49f-4354-a59f-f226dabb7c66
ramesh11011/Coding-Challenges
Day 9/nthdigit.cpp
#include <iostream> #include <cmath> using namespace std; class Solution { public: int findNthDigit(int n) { long long digitLength = 1; long long count = 9; long long start = 1; // Step 1: Find the range (1-digit, 2-digit, etc.) while (n > digitLength * count) { ...
ALGO
0.999775
6.359699
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2025-05-29T05:48:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fe26ef6c5a1...
cda3c0c2-2831-46cb-88a0-bd5e34abdee3
MAZHARMIK/Interview_DS_Algo
Bit_Magic/Maximum_Product_of_Word_Lengths.cpp
/* Company Tags : Google Leetcode Link : https://leetcode.com/problems/maximum-product-of-word-lengths/ */ //Approach-1 (Without Bit magic) class Solution { public: int maxProduct(vector<string>& words) { int n = words.size(); int maxP = 0; bool nocommon = true; fo...
ALGO
0.999775
6.2904
{ "github_metadata": { "branch": "master", "commit_count": 5946, "repo_created_at": "2020-07-12T13:13:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2586, "forks": 1357, "issues": 7, "pull_requests": 37 }, "file_meta": { "content_id": "...
124e293c-6167-4823-878e-7b09d1b8c6c1
isfahanUacm/UICPC
2021/UICPC DIV1/Contests/UICPC Round #12 (Div 1)/solutions/Problem G - H to O/htoo2.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int ll source[30], target[30]; string s, t; ll j, k; void myfill(string st, bool flag){ for (int i = 0; i < st.length(); ++i) { j = i; while(i+1 < st.length() && st[i+1] < 60) i++; if(flag) // for filling sourc...
ALGO
0.999964
3.804448
{ "github_metadata": { "branch": "main", "commit_count": 113, "repo_created_at": "2021-09-15T16:29:50.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c626e6baa91...
50e9cfec-d977-49d0-a9b9-a8bf9dd0477b
WiseCoder24/DSA
Binary Search Tree/bst_intro.cpp
#include<bits/stdc++.h> using namespace std; struct Node{ int data; Node *left, *right; Node(int val){ data = val; left = NULL; right = NULL; } }; Node* insertBST(Node* root, int val){ if (root == NULL) { return new Node(val); } if (val < root->data) ...
ALGO
0.999991
5.210506
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2023-06-12T10:45: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": "cc402f822b...
4e327b91-a9ba-4d07-be28-5432890da1d5
loook98/PlayWithAlgorithm
DailyCodingChallenge/Solution1380_1.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: vector<int> luckyNumbers (vector<vector<int>>& matrix) { int m = matrix.size(); int n = matrix[0].size(); vector<int> minRow(m, INT32_MAX); vector<int> maxCol(n, INT32_MIN); for (int i = 0; i < m; ++i) ...
ALGO
0.999977
5.35824
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2022-06-18T07:41: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": "ad2390d24...
34d33ba3-0744-4832-856d-597b7ff249eb
Roopam-mishra/CPP_Algorithms_and_Problems
Problems/DSU/JABO.cpp
/* Question link: https://www.codechef.com/problems/JABO */ ********************************************************** #include <iostream> #include <algorithm> #include <vector> #include <math.h> #include <cstring> #include <string> #include <stack> #include <queue> #include <deque> #include <map> #include...
ALGO
0.997205
4.435171
{ "github_metadata": { "branch": "master", "commit_count": 125, "repo_created_at": "2019-10-21T16:02:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "22bc27e9...
f287b15c-05d8-40aa-bf0c-49eb33b5245f
chltkdgns1/Algorithm_first
괄호의 값.cpp
#include <iostream> #include <string> #include <stack> using namespace std; int main() { stack <int> s; string e; cin >> e; for (int i = 0; i < e.length(); i++) { int t = 0; if (e[i] == '(') s.push(-1); else if (e[i] == '[') s.push(-3); else if (e[i] == ')') { if (s.empty()) {cout << 0;return 0;} whil...
ALGO
0.999731
4.027935
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-11-03T12:50: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": "e2a7f4c34f...
0b58e0be-4a56-4cf5-a09a-62a5d21adee9
Schr0Smi1ey/Phitron
3. Data Structures/Linked list/Singly linked list/14_sort_linked_list.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 sort(node *head) // as like selection sort // Time complexity : O(N^2) { for(node* i=head;i->next...
ALGO
0.999936
4.303751
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-10-17T07:43: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": "0448e65357b6...
7d79830f-665d-4b81-972d-eaabdf6b39d3
HiImKing1509/Learning_Algorithm
Level 800/Second-Price Auction.cpp
/*------------------------------------------------------------------------* | User: <NAME> | | Degree: Student - Formal University | | Study Computer Science at University of Information Technology | | Country: Viet...
ALGO
0.999992
3.587904
{ "github_metadata": { "branch": "main", "commit_count": 399, "repo_created_at": "2021-10-08T02:57:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b7e5b89693...
9bf34a9f-1efd-4c3d-97b0-89ea6d9b3260
GregoryScottSelf/LinkedList
Source.cpp
//<NAME> //CSI 330 //Ch 5 Problem 10 Linked List #include<iostream> using namespace std; struct node { int data; node *next; }; //Input:node_head is used to determine if this list is empty //Output:true is returned if the list is empty, false otherwise bool emptylist(node *head_next) { //if there is nothing in th...
TOOL
0.996137
4.585812
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2019-01-15T02:41: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": "3cd13dde64...
2c67ba5f-fe96-4ed7-ae86-cfa1ee13db15
buiquoccuongk8lk/2024
26.06.2024/vrange1.cpp
/* ---------------------- * * * Code by watbor * * :> * --------------------------*/ #include <bits/stdc++.h> using namespace std; #define myClass class WORK,class HARD #define tct template<myClass> #define ll long long #define fi first #define se second #define pb push_back #define ii pa...
ALGO
0.999991
4.199114
{ "github_metadata": { "branch": "main", "commit_count": 90, "repo_created_at": "2024-08-05T03:06: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": "65ec5f19698...
a6706b85-7aac-416e-abf9-baa37a016052
DavidNexuss/RA3
src/cardinality.cpp
#include <cstdint> #include <cmath> #include "cardinality.hpp" #include <algorithm> #include "util.hpp" #include <unordered_set> #include <set> Result estimateCardinalityHyperLogLog(const std::vector<int>& values, int buckets) { Timer timer; timer.tic(); Result result; int p = std::log2(...
ALGO
0.996959
6.950494
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2024-12-23T10:55:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c38e43609b...
f24e064f-8b99-4f24-a436-1cf679faee37
ArseniyKholod/stce_ss24_ex12
thirdParty/dcl6i38ngl_v381/case_studies/diffusion/gt2s_ga1s_cp/main.cpp
/** dco/c++ v3.8.1 -- Algorithmic Differentiation by Operator Overloading in C++ COPYRIGHT 2022 The Numerical Algorithms Group Limited and Software and Tools for Computational Engineering @ RWTH Aachen University This file is part of dco/c++. **/ #include <cstdlib> #include <iostream> #include <cassert> #include...
ALGO
0.999812
5.155779
{ "github_metadata": { "branch": "main", "commit_count": 52, "repo_created_at": "2024-05-28T11:17:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "88a68c8c8b7...
e6b06446-c2c8-4f71-aa10-6f5e963180a4
carisamuelson/StepRite
algorithms/calc_force.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include "lib.cpp" double * ForceCalculations(double ** lcsv, double ** rcsv, int num_elements, int weight, int target); double * ForcePerSensor(double ** lcsv, double ** rcsv, int num_elements); using namespace std; int main(int argc, char *argv[]) { if...
DATA
0.903309
3.846828
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2014-01-07T15:44: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": "9ef6e7619...
4d24d0d2-4785-43b5-b6c8-38493164c264
mostafa-saad/MyCompetitiveProgramming
Olympiad/POI/official/2004/code/kag/kagwer.cpp
/************************************************************************* * * * XI Olimpiada Informatyczna * * * * Rozwiązanie zad...
ALGO
0.999842
4.42623
{ "github_metadata": { "branch": "master", "commit_count": 439, "repo_created_at": "2017-02-05T22:26:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 415, "forks": 85, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "66643...
cc67f220-ed03-4845-8d08-b93370deabe3
Tichau/advent-of-code-2022
solvers/day01.cpp
#include "day01.h" #include <string> int day01_part1(std::ifstream& input) { std::string line; int calories = 0; int maxCalories = 0; while (!input.eof()) { std::getline(input, line); if (line == "") { if (calories > maxCalories) { ma...
ALGO
0.998937
5.372961
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2022-12-13T12:24:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d5a458913b1...
8608732a-f186-4c15-9ced-8dc50dcb4c59
coolteju/Data-Structures-in-cpp
NQueenProblem.cpp
#include<iostream> #include<stdlib.h> using namespace std; int rowsAndColumns=0; int queens=0; int placedQueens=0; int **chessBoard=NULL; int main(void) { //function declarations void printArray(); bool checkQueen(int,int); bool placeQueen(int); cout<<"\nEnter the number of ROWS and COLUMNS: "...
ALGO
0.998684
4.30812
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-04-17T10:50:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1e1f2398ac...
01280df1-4383-4b7f-8037-1f7e4ee4cb1f
PyayAungSan/Data-Structure-and-Algorithm
Greedy/dot_product.cpp
#include <algorithm> #include <iostream> #include <vector> using namespace std; bool descending (int i, int j) {return (i<j) ; } long long max_dot_product(vector<int> a, vector<int> b) { // write your code here sort(a.begin(), a.end(), descending); sort(b.begin(), b.end(), descending); long long res...
ALGO
0.99997
4.556763
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2017-06-01T20:11:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "905e4d0d90...
2896a405-b55e-4df2-a317-39deaf3f0f00
StevenTan123/competitive_programming_public
Codeforces/_1976_E.cpp
#include <bits/stdc++.h> using namespace std; const long long MOD = 998244353; struct Node { Node *prev = nullptr, *next = nullptr; int val; Node(int v) : val(v) {} }; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, q; cin >> n >> q; int l[q]; int r[q]; f...
ALGO
0.999992
4.301884
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-01-07T20:58: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": "801e1fb0d536...
c0a93a75-4962-46a0-b0b3-0c5d074f2c8c
imranraad07/Hackerrank
Algorithm/Dynamic Programming/Equal.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int T ; cin >> T ; while(T--){ int n ; cin >> n ; int arr[n] ; for(int i = 0 ; i < n ; i++){ cin >> arr[i] ; } sort(arr , arr+n) ; int ret = 1e9 ; for(int x = arr[0] - 5 ; ...
ALGO
0.999889
4.164546
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2016-07-03T08: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": "73da83893...
787f3d2a-5a21-4d4a-95c5-81ca8bfff44e
whjkm/LeetCode
C++/137/main.cpp
#include <iostream> #include <vector> using namespace std; // 转化为2进制处理,按照32位,依次处理每一位上的0,1个数。 class Solution { public: int singleNumber(vector<int>& nums) { int len = nums.size(); int res = 0; for(int i = 0; i < 32; ++i) { int count = 0; int bit = 1 << i; ...
ALGO
0.999939
4.914197
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2018-08-18T08:52:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "73e9106ef...
91f7b9d0-5fbd-4424-9256-20cc0a54bd29
elmaakter1412/first-repo
theory_final_exam/8_final.cpp
#include<bits/stdc++.h> using namespace std; int LCS_length(const string& s, const string& t, int m, int n, vector<vector<int>>& dp){ if(m == 0 || n == 0){ return 0; } if(dp[m][n] != -1){ return dp[m][n]; } if(s[m-1] == t[n-1]){ dp[m][n] = 1 + LCS_length(s, t, m-1, n-1, dp)...
ALGO
0.99999
5.181687
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-06-17T13:56: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": "8e34f9d3d233...
6e91e0de-8641-4d74-acd2-11ce0296afbc
nikitg13/Engineering-SY-COMP-VIIT
SEM-1/DSAL/DSA/Assignment no. 2.cpp
#include <iostream> using namespace std; struct spar { int row, col, data; }; void convert (int row, int col, int** mat, spar sparse[], int non_zero_elements) { sparse[0].row = row; sparse[0].col = col; sparse[0].data = non_zero_elements; int row_count = 0, i , j; for(i = ...
ALGO
0.999727
4.527094
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-02-21T17:48:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8d0e5a7c4d7e...
1aaca545-432f-464d-847a-67c708fcc131
rgb-xyz/AdventOfCode
2022/Day12.cpp
#include <deque> #include <fstream> #include <iostream> #include <string> #include <vector> #define PLOT_TRAIL struct Pos { int x = 0; int y = 0; }; struct Site { char height{}; int steps = INT_MAX; #ifdef PLOT_TRAIL struct { char height{}; bool isOnTrail = false; Pos b...
ALGO
0.999674
6.195449
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2022-12-02T11:46:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "20178c39b7f...
e865fd0a-13bb-4844-99da-2da4f9b92647
NekoMio/ACMcode
NeverBeSolved/2018-5-17/D.cpp
#include <cstdio> #include <cstring> #include <algorithm> #include <map> using namespace std; map<unsigned int, int> H; unsigned int base = 31; char s[8][25]; unsigned int Hash(int x, int y) { unsigned int ans = 0; for (int i = 1; i <= 7; i++) for (int j = 1; j <= 4; j++) ans = ans * base + s[i + x - 1][j + y - ...
ALGO
0.999117
3.228112
{ "github_metadata": { "branch": "master", "commit_count": 122, "repo_created_at": "2017-07-14T23:35:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dd4bb2ed...
4ccc280c-fd9e-4bc5-82bd-0a90417dca4d
Ranajit2005/CPP-Practice-github
2nd & 3rd Sem Practice/GraphUsingQueue.cpp
#include<iostream> using namespace std; class Q{ int size; int front; int rear; int *arr; public: Q(int s){ size = s; front = rear = -1; arr = new int[size]; //to be remember } bool isFull(Q *q); bool isEmpty(Q *q); void EnQ(Q *q,int ); int DeQ(Q *q); ...
ALGO
0.998864
4.096056
{ "github_metadata": { "branch": "main", "commit_count": 224, "repo_created_at": "2023-11-05T16:37: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": "10b1ecba55...
0a496076-d0fc-4399-9473-ed8d4fe9bf89
hws2002/algorithm
boj/CPP/Shorst_Path_Problem/Floyd/11404/11404_base1.cpp
// 음수 간선 x, 모든 쌍에 대해서 최단 거리 구하기 // e(u,v)가 하나이상일 수 있는 그래프 // 플로이드 와샬 // without memory optimization // vertex number starts with 0!!!!!! #include <iostream> #include <vector> #include <algorithm> #define MAX_V 100 typedef long long ll; using namespace std; int n,m; int adj[MAX_V][MAX_V] = {0}; ll dist[MAX_V][MAX_...
ALGO
0.999991
3.973287
{ "github_metadata": { "branch": "main", "commit_count": 527, "repo_created_at": "2023-07-05T17:54:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "144be0ee64...
dac3298e-e418-4941-8ab7-3c25bc63dd51
GOPIS28/c_plus0522
pro (101).cpp
#include <iostream> using namespace std; int main() { int rows1, cols1, rows2, cols2; cout << "Enter the number of rows for the first matrix: "; cin >> rows1; cout << "Enter the number of columns for the first matrix: "; cin >> cols1; cout << "Enter the number of rows for the second matrix: "; ...
ALGO
0.999777
4.949959
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-05-14T07:41: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": "c9acdd69079a...
a8dda492-2b95-4dd8-887e-957bdac1c10c
Cauahu/hihoCoder-training
allwaytofindmaxkth/allwayfindmaxkth.cpp
#include <iostream> #include <vector> #include <set> using namespace std; int slution_divide(vector<int> &vec, int l, int h, int k){ //分治法 if(l < h){ int left = l, right = h, key = vec[l]; while(left < right){ while(left < right && vec[right] > key) right--; swap(vec[left], vec[right]); while(left ...
ALGO
0.999942
4.356698
{ "github_metadata": { "branch": "master", "commit_count": 166, "repo_created_at": "2016-03-18T02:44:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3708a458...
711fe241-5952-47c0-89c9-7fdae22d6d81
harumo11/camera_calibrators
calibrate_with_chess.cpp
#include <iostream> #include <opencv2/calib3d.hpp> #include <opencv2/core/persistence.hpp> #include <opencv2/highgui.hpp> #include <opencv2/imgproc.hpp> std::vector<std::vector<cv::Point3f>> calc_board_corner_positions(const cv::Size &board_size, float square_size, ...
ALGO
0.94901
5.982109
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-05-14T06:34: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": "c09db83857bd...
e40ee3b2-bebc-4a0f-86f7-80f32952f94a
sweeneychris/TheiaSfM
libraries/statx/statx/distributions/evd/gpd_ceres.cc
// Copyright (C) 2014 <NAME> <<EMAIL>> // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list...
ALGO
0.999933
7.117076
{ "github_metadata": { "branch": "master", "commit_count": 958, "repo_created_at": "2015-02-11T18:15:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 933, "forks": 280, "issues": 36, "pull_requests": 10 }, "file_meta": { "content_id": "c7...
117f0d94-816f-4cf9-b078-e615975869a8
Zeronfinity/LightOJ-Solutions
1164 - Horrible Queries.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long struct node { ll prop = 0, s; } tr[300000]; void create(ll n, ll b, ll e) { tr[n].s = 0; if (b == e) return ; ll l = 2*n; ll r = 2*n + 1; ll m = (b+e)/2; create(l, b, m); create(r, m+1, e); } void update(ll n,...
ALGO
0.99973
4.246432
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-12-04T08:03:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0c4db6c0c9...
f4a7aa26-ada3-4ca7-ac35-336cf8b83c74
AnastasiaTuryk/Basics-of-Programming-
CW_3/task2/Source.cpp
#include<iostream> #include<fstream> #include<string> using namespace std; void name(string* a, int& k, string test) { ifstream fout; fout.open(test); string line; bool repeat = false, take = false; if (fout.is_open()) { while (getline(fout, line)) { for (int i = 0; ...
TOOL
0.98476
3.65029
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2020-03-19T14:21:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "499330c10...
e4a08c17-180c-42cd-bfec-d7058804bca5
NamanAg0502/programming
cpp/339B.cpp
#include "/Users/na/stdc++.h" using namespace std; #define PI 3.1415926535897932384626 #define MOD 1000000007 // 998244353 #define vi vector<int> #define ll long long #define ull unsigned long long #define vvi vector<vector<int>> #define vll vector<long long> #define pb push_back #define eb emplace_back #define mp(a, ...
ALGO
0.999996
3.62864
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2022-06-15T05:35:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6a8bfeac7f...
5134b144-7cdd-4d8f-9b0c-b54c41d03bd6
gy31/Algorithm-BOJ
6978_월드컵.cpp
#include<stdio.h> int score[6][3]; void pro(int x, int y) { if(y == 6) {x++; y = x+1;} if(x == 5 && y == 6) { int sum = 0; for(int i = 0; i < 4; i++) { for(int j = 0; j < 6; j++) { sum += score[i][j]; } } if(sum == 0) printf("%d ", 1); ...
ALGO
0.999974
3.049827
{ "github_metadata": { "branch": "main", "commit_count": 76, "repo_created_at": "2023-09-26T10: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": "9ff34f7ce1e...
f51fff29-7726-4f3e-9e74-d08a3684466b
Geant4/geant4
source/processes/electromagnetic/standard/src/G4ModifiedTsai.cc
// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration...
ALGO
0.908378
6.175492
{ "github_metadata": { "branch": "master", "commit_count": 83, "repo_created_at": "2016-06-21T08:25:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 705, "forks": 340, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "1c0670...
d4ba871e-0329-430a-b07f-fa9e9040e253
DasAlvarp/god-hel-me
Vec.cpp
#include "Vec.h" #include "Matrix.h" #include <cstdarg> #include <list> #include <iostream> #include "math.h"" class Vec { float values[4]; int len = 3; float magnitude; float* normal; //vector3 is like a vector4 for easy math. Vec::Vec(float val1, float val2, float val3) { values[0] = val1; values[1] = v...
TOOL
0.97663
3.630626
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2017-02-03T16:20: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": "1e0bbba806...
35971e24-9a29-4ccc-b739-085195911d7e
LGKZanini/MaratonUSP
maratona_22/ex04.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pii pair<int, int> #define INF 0x3f3f3f3f #define fi first #define mp make_pair #define se second #define FI(n) for(int i = 0; i < n; i++) #define FOR(i,a,n) for (int i=(a);i<(n);++i) #define t cout << "TESTE" << endl #define debug(x) if(...
ALGO
0.999977
3.339164
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2020-03-13T20:28:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ebbfe7bacb...
41f50b75-2b48-48ac-b77d-f294c24f2c87
zwliew/competitive-programming
solutions/codeforces/contest/451/c.cc
#include <algorithm> #include <array> #include <bitset> #include <chrono> #include <climits> #include <cmath> #include <cstring> #include <deque> #include <ext/pb_ds/assoc_container.hpp> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include ...
ALGO
0.999857
4.547668
{ "github_metadata": { "branch": "master", "commit_count": 230, "repo_created_at": "2019-01-26T15:14:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "7bd93970...
16350af7-d7f7-485f-bbbd-0169161b2e42
faroukq1/solve
codeforces/B_Startup.cpp
#include <iostream> #include <vector> #include <unordered_map> #include <algorithm> using namespace std; void solve() { int N, K; cin >> N >> K; unordered_map<int, vector<int>> brand_map; for (int i = 0; i < K; i++) { int brand, cost; cin >> brand >> cost; brand_map[brand].push...
ALGO
0.999787
4.572522
{ "github_metadata": { "branch": "main", "commit_count": 518, "repo_created_at": "2024-07-03T19:34: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": "49db2773a8...
df01c1a0-82b1-40b2-8d59-c2bc8be7bb7b
rohit-b04/myVScode
uniquechars_str.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; /* void rec_count(string str, vector<int>& v, int& count, int ind) { // cout << count << endl; if(ind == str.size()) return ; v[str[ind] - 'a']++; count = count+v[str[ind] - 'a']; ind++; rec_count(str, v, count, ind); } */ void co...
ALGO
0.999942
4.628105
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-07-31T15:51:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4a4c56c4c846...
d244c430-5803-4b86-85f8-9375b68bcdbf
byj200493/myTexturing
libs/tex/nnf_patch_search.cpp
#include "texturing.h" #define ALPHA 0.5 TEX_NAMESPACE_BEGIN /* created at 08/15/2017 */ float rand_float(float min, float max) { return min + (max - min)*(float)rand() / RAND_MAX; } /* created at 08/15/2017 */ float rand_minus1_1() { return rand_float(0.0f, 2.0f) - 1.0f; } /* created at 08/15/2017 */ void get_random...
ALGO
0.999284
5.509015
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2019-03-10T00: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": "e4c505e84...
ef6862fb-2002-4fac-83d3-3f5f5e381024
DevSaurabhGirme/DS_Algo
1971_Find_if_Path_Exists_inGraph_II.cpp
class Solution { public: bool validPath(int n, vector<vector<int>>& edges, int source, int destination) { // map for building the graph unordered_map<int, vector<int>> graphMap; for(vector<int> &edge : edges) { // retrieving each edge from edges vector i...
ALGO
0.999993
6.352451
{ "github_metadata": { "branch": "master", "commit_count": 599, "repo_created_at": "2024-03-09T10:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "209d4c04...
bf7002c2-cc1a-4dda-a54f-cea5ae5c868b
ZheWANGGlobal/SecondPaper
hCRF_Toolbox_full_3.0a/libs/shared/hCRF/src/InferenceEnginePerceptron.cpp
#include "inferenceengine.h" #include <assert.h> #include <vector> using namespace std; InferenceEnginePerceptron::InferenceEnginePerceptron() {} InferenceEnginePerceptron::~InferenceEnginePerceptron() {} void InferenceEnginePerceptron::computeMi(FeatureGenerator* fGen, Model* model, DataSequence* X, ...
ALGO
0.998647
5.796378
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2017-12-07T13:20:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eebb241ae...
fa5f9475-0564-4cca-8732-f4cd19f166a1
kevindryz/LeetCode-Hot100
链表/23.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* merge(ListN...
ALGO
0.999938
5.85217
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-03-07T08:06:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "79c5584dde9...
8b4c8b94-7fe5-4244-a9a8-b7a954d0197c
rakeshranjandas/Algorithms-Practice
_code/Repo/BST-preorderCanExist.cpp
#include<iostream> using namespace std; void printLeaf(int a[], int l, int h, bool *can) { if (!(*can)) return; if (l > h) return; if (l == h) { // cout << a[l] << " "; return; } // root is a[l] // l+1 is left child // first bigger number is right child int ri = h+1; for (int i = l+1; i <= h; i...
ALGO
0.999297
3.916105
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2020-08-03T18:03: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": "cc92b63cc4...
b7e7f556-fc27-4b6c-b479-a66c8dbe3541
ishandutta2007/codeforces-t
toxel/normal/587/E.cpp
#include<bits/stdc++.h> const int N = 200010; const int MAX = 1 << 18; struct Matrix{ static const int BIT = 30; int a[BIT]; Matrix():a(){} explicit Matrix(int value):a(){ if (!value) { return; } for (int i = BIT - 1; i >= 0; -- i){ if (value >> i & 1...
ALGO
0.999489
4.740596
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16: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": "dd1e3163cf22...
67fde22f-11ae-4f8b-a087-2fa5ca70a83d
apache/doris
be/src/vec/aggregate_functions/aggregate_function_min_max.cpp
// 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 the Apache License, Version 2.0 (the // "License"); you may...
TOOL
0.942202
7.210196
{ "github_metadata": { "branch": "master", "commit_count": 26499, "repo_created_at": "2017-08-10T12:13:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13962, "forks": 3497, "issues": 2697, "pull_requests": 616 }, "file_meta": { "content_i...
efdfb519-a1d5-42f4-bb14-e24c0151d547
Qiti0/codeforces
C_Choose_the_Different_Ones.cpp
#include <bits/stdc++.h> using namespace std; const int mod = 1e9+7; const double pi = acos(-1.0); const int N = 2e5 + 10; typedef long long ll; typedef pair<int,int> pii; inline int lowbit(int x) {return x & (- x);} map <int,int> mp; void solve() { int n,m,k;cin >> n >> m >> k; vector <int> a(n),b(m); mp...
ALGO
0.999993
3.89841
{ "github_metadata": { "branch": "codeforces", "commit_count": 8, "repo_created_at": "2024-07-24T02:13: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": "deb892...
9466812d-df82-4631-8c41-9c572eb489b2
abhinavgpt1/DSA-cpp
DSA-self/Graphs (Striver-TUF)/ArticulationPoint1(gfg_hard).cpp
/** * Articulation Point - I * ---------------------- * Given an undirected connected graph with V vertices and adjacency list adj. * You are required to find all the vertices removing which (and edges through it) disconnects the graph into 2 or more components and return it in sorted manner. * Note: Indexing is ...
ALGO
0.99977
5.514153
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2023-03-11T17:03:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5ebd6881d...
26114e02-d335-4723-b082-8599c539d106
vachelch/Online-Judge
Leetcode/C++/ Premium New Playground 2 Vachel_chen 105. Construct Binary Tree from Preorder and Inorder Traversal.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: map<int, int> inorder_idx; TreeNode* recursive(vector<int>& preorder, int pre_l, int pre_r, vecto...
ALGO
0.999992
6.573366
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-04-05T07: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": "87dccf1661...
95cf28de-f92f-472c-87a9-43856c34ab04
DmitriiTunikov/WayForShape
motion_planning/math_types/polygon/polygon.h
/* * Motion planning problem project. * * FILE: polygon.h * AUTHORS: * <NAME> * LAST UPDATE: 19.05.2018 * NOTE: polygon class declaration file */ #pragma once #include <vector> #include "../../../support/support.h" #include "../../../anim/render/drawable/drawable.h" #include "../segment/segment.h" /* Polygo...
ALGO
0.988457
4.796474
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-10-16T19:07:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "17b960cbf2...
6d595f56-f823-4753-b09a-6f07c4629a01
jismith/Data_Structures
BHeap.cpp
#include "BHeap.h" #include <stdexcept> #include <iostream> //NOTE: this is an implementation of a MAX HEAP, so the top will be the max element. //helper functions to compute locations of parents and children in vector int BHeap::parent(int i) { return (i - 1) / 2; } int BHeap::left(int i) { return 2 * i + 1; } in...
ALGO
0.998596
4.341323
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-08-25T01:52: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": "b5907c787186...
f1c0777a-2d97-4ed9-bd95-92d023f0ca1e
bewuethr/stroustrup-ppp
code_snippets/Chapter25/chapter.25.5.6-2.cpp
// // This is example code from Chapter 25.5.6 "An Example: Simple encryption" of // "Programming -- Principles and Practice Using C++" by <NAME> // #include "std_lib_facilities.h" //------------------------------------------------------------------------------ void encipher( const unsigned long *const v, u...
ALGO
0.999772
5.287176
{ "github_metadata": { "branch": "main", "commit_count": 222, "repo_created_at": "2014-08-28T01:21:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 328, "forks": 126, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "9d92bb...
6655a34c-b4ca-44a1-ab37-b5dcf474b472
lballabio/QuantLib
ql/math/polynomialmathfunction.cpp
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2015 <NAME> Copyright (C) 2015 <NAME> This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can r...
ALGO
0.987637
7.256606
{ "github_metadata": { "branch": "master", "commit_count": 17543, "repo_created_at": "2015-12-17T16:29:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6151, "forks": 1964, "issues": 51, "pull_requests": 11 }, "file_meta": { "content_id":...
b6ae9aca-b21a-4c07-9d20-eb694fea57e0
puba5/Algorithm_Study
sungunjo/BJ_15591.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; #define INF 1000000008 typedef struct _question { int k; int v; _question(int _k, int _v) : k(_k), v(_v) {}; } Question; void dijkstra(vector<vector<int> > &map, int start) { vector<int> exclude_s; for (int i = 0; i < map.size(); ...
ALGO
0.999901
4.252145
{ "github_metadata": { "branch": "master", "commit_count": 416, "repo_created_at": "2020-03-26T02:12:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5aadb88d...
be4b95d2-072a-4cfe-a2bd-75ea5f6150f8
fredericstrand/INF205
assignment_3/molecule.cpp
#include "molecule.h" #include <cmath> Molecule::Molecule(int id, double x, double y, double z, double vx, double vy, double vz) Molecule::Molecule(int id, double x, double y, double z, double vx, double vy, double vz) : m_id(id), m_coords({x, y, z}), m_vels({vx, vy, vz}) { } int Molecule::get_...
ALGO
0.967163
5.373162
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2025-02-01T13:39: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": "f50e76be080...
b70e4e9f-f75b-4439-b61f-567aa77052d4
christoffer-arvidsson/adventofcode
aoc2020/src/day01.cpp
#include <algorithm> #include <cstdint> #include <fstream> #include <iostream> #include <optional> #include <ostream> #include <vector> #include "problem.h" #include <gtest/gtest.h> class Day01 : public Problem { public: Day01(const std::string& input) : Problem(input) {} std::pair<bool, std::uint64_t> par...
TEST
0.967629
5.156815
{ "github_metadata": { "branch": "master", "commit_count": 196, "repo_created_at": "2019-12-03T19:04:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e33b5324...
57843efa-5332-4e70-9b2a-e67c8581b499
shivareddy37/Kidnapped_vechicle
src/particle_filter.cpp
#include <random> #include <algorithm> #include <iostream> #include <numeric> // for INFINITY #include <math.h> #include <iostream> #include <sstream> #include <string> #include <iterator> #include "particle_filter.h" using namespace std; using std::normal_distribution; using std::default_random_engine; void Part...
ALGO
0.995177
5.907578
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2017-08-21T17:26:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a740f8ee96...
eb8041e7-fd09-4d51-9c06-218a32a2cefc
choward1491/DeterministicDP
src/control1D/ddp_control1d.cpp
#include "ddp_control1d.hpp" namespace ddp { /* double Qf, Q, R, dt, alpha, beta, Ns, Nc; double xb[2], dx; double ub[2], du; std::vector<double> x, u; */ control1d::control1d(){ } control1d::~control1d(){ } void control1d::setStateRange(double xmin, double xmax, int Nx) { xb[0] = xmin; xb[1] = xm...
ALGO
0.978457
4.366873
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2017-01-23T07:07:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ca46c8bfa...
34f485db-3621-4528-b250-cfd1d60c10e9
J-e-e-t/CSES-solution
Additional Problems/28.Writing_Numbers.cpp
/* Time limit: 1.00 s Memory limit: 512 MB You would like to write a list of positive integers 1,2,3,… using your computer. However, you can press each key 0–9 at most n times during the process. What is the last number you can write? Input The only input line contains the value of n. Output Print the last ...
ALGO
0.999916
4.447312
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2022-12-15T11:26: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": "339f10b952f...
ea24f5b3-76e2-414c-b51e-557fb2ab2425
pongsaphol/submission
programming/2002.cpp
#include <bits/stdc++.h> #define x first #define y second using namespace std; using vi = vector<int>; using vivi = pair<vi, vi>; const int N = 1e4+5, INF = 1e9; int n, m, dp[N][32]; vector<vivi> V[N]; bool calc(int start, vivi &now) { bool st = false; for(auto x : now.x) st |= !(start & (1 << x)); for(auto x : n...
ALGO
0.999081
4.141833
{ "github_metadata": { "branch": "master", "commit_count": 287, "repo_created_at": "2018-10-02T16:54:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8dacb7b9...
9f8951fd-bb06-421c-9701-b11ff113b5de
alexandraback/datacollection
solutions_1485490_0/C++/rofi/C.cpp
#include <cstdlib> #include <cmath> #include <map> #include <utility> #include <set> #include <sstream> #include <iostream> #include <iterator> #include <string> #include <vector> #include <list> #include <algorithm> #include <functional> #include <stack> #include <queue> #include <numeric> using namespace std; #defin...
ALGO
0.999865
3.791547
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6740eb132...
862dba0e-5cb4-4934-9ecc-3917d024c545
ishandutta2007/codeforces-r
rnsiehemt/normal/487/B.cpp
#include <cstdio> #include <queue> const int inf = 999999999; struct Max { int i, v; Max(int ii, int vv) : i(ii), v(vv) { } bool operator<(const Max &m) const { return v < m.v; } }; struct Min { int i, v; Min(int ii, int vv) : i(ii), v(vv) { } bool operator<(const Min &m) const { ...
ALGO
0.99998
3.905743
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:58:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f785f1f30e53...
72fd0595-9bbe-414a-b8c3-0eef659b95b7
Guanymsl/C
2.ZJ/f377.cpp
#include <iostream> #include <cstring> #include <stack> #include <vector> #define IO ios_base::sync_with_stdio(0) , cin.tie(0) , cout.tie(0); #define pb push_back using namespace std; stack<char> ans , op; int priority(char c){ if(c == ')') return 3; if(c == '+' || c == '-') return 2; if(c == '*' || c ...
ALGO
0.999889
4.363974
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-18T08:50:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9181603e89a7...
16015e57-97e4-4f4d-b17f-dac08e821d27
MMG2210/DSA-Solved
138-copy-list-with-random-pointer/138-copy-list-with-random-pointer.cpp
/* // Definition for a Node. class Node { public: int val; Node* next; Node* random; Node(int _val) { val = _val; next = NULL; random = NULL; } }; */ class Solution { public: /*Node* copyRandomList(Node* head) { unordered_map<Node*, Node*> m; Node* p...
ALGO
0.998357
5.37657
{ "github_metadata": { "branch": "main", "commit_count": 1826, "repo_created_at": "2022-03-19T10:49:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "19fda5ebf...
bc29b5a3-0894-4604-a110-24ce95e38089
ThreeAi/Lesson2
Lesson2/matrix.cpp
#include <iostream> #include <limits.h> using namespace std; int** Initialization() { int** m = new int* [1]; m[0] = new int[2]; m[0][0] = 0; m[0][1] = 0; return m; } void Delete(int** m) { for (int i = 1; i <= m[0][0]; i++) { delete[] m[i]; } delete[] m[0]; delete[] m; } int** Input(bool flag) { setloca...
ALGO
0.999497
3.393494
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2022-09-19T17:37: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": "ba93171bef...
440c23ad-0854-46fd-a6eb-aba242160f10
Leapense/problems
8914번: Password/Password.cpp
/* ************************************************************************** */ /* */ /* ::: ::: ::: */ /* Problem Number: 8914 :+: :+: :+: ...
ALGO
0.999892
4.630128
{ "github_metadata": { "branch": "master", "commit_count": 2661, "repo_created_at": "2024-10-12T10:53: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": "153a749...
10924e0c-d588-4430-ba76-d8f04c8abaa8
zhaisc2001/Data-Structure-and-Algorithm
LinkList.cpp
#include<iostream> using namespace std; typedef struct Node{ int data; struct Node *next; } Node; typedef struct Node *LinkList; //Time complexity is O(n) bool GetItem(LinkList *L, int i, int *e){ LinkList p = *L; int j = 1; while(j<i && p){ p = p->next; ++j; } if(j>i || !...
ALGO
0.999711
3.595656
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-07-20T13:40: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": "258e861676f7...
e6d53262-54f0-4208-bcac-60b16f38abf3
melonattacker/atcoder
contests/APC/APC001/a.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; // const int INF = 1 << 30; const long long INF = 1LL << 60; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; cin >> n; for(int k = 0; k < n; k++) { int P, Q, a, b, c; cin >> P >> Q >> a >> b >> c; ...
ALGO
0.999013
3.617985
{ "github_metadata": { "branch": "main", "commit_count": 481, "repo_created_at": "2020-11-22T14:40:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2954d7cfb0...