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
d2a3c133-6566-4a5a-8ba0-d252a47c2eff
bsarvan/algorithms
FindMaxSimulataneousEvents/main.cpp
// // main.cpp // FindMaxSimulataneousEvents // // Created by <NAME> on 08/08/20. // Copyright © 2020 bsarvan. All rights reserved. // // Algorithm to find the maximum simultaneous events that can occur in an interval #include <iostream> #include <vector> using namespace std; struct Event { int start; i...
ALGO
0.999418
5.62843
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2020-12-30T08:33: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": "979d50b6b9...
77f36026-55bb-4f08-ae1c-41c2f3e3c05c
vol6tmetr/cpp-study
two_numbers_while/two_numbers_while.cpp
#include "../std_lib_facilities.h" int main() { cout << "Type in two numbers: "; constexpr double allowed_difference = 0.01; double number_1 = 0; double number_2 = 0; while (cin >> number_1 >> number_2) { if (number_1 > number_2) { cout << "Biggest number is " << number_1 << "\n" << "...
ALGO
0.971771
4.825085
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2019-05-01T08:45: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": "ab7b26518...
2093a820-4f0f-4031-a359-54627d09652d
sbmtrntr/AtCoder
APG4b/EX20.cpp
#include <bits/stdc++.h> using namespace std; // x番の組織が親組織に提出する枚数を返す // childrenは組織の関係を表す2次元配列(参照渡し) int count_report_num(vector<vector<int>> &children, int x) { // (ここに追記して再帰関数を実装する) if (children[x].size() == 0){ return 1; } int count_sum = 0; for (int c: children[x]){ int count = ...
ALGO
0.999942
4.646111
{ "github_metadata": { "branch": "main", "commit_count": 91, "repo_created_at": "2023-03-12T13:13: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": "e56cda18ad8...
3f1d71b5-a356-486a-905f-616fd5999d24
trilinos/Trilinos
packages/rol/src/sol/function/distribution/ROL_Gaussian.hpp
// @HEADER // ***************************************************************************** // Rapid Optimization Library (ROL) Package // // Copyright 2014 NTESS and the ROL contributors. // SPDX-License-Identifier: BSD-3-Clause // *************************************************************************...
ALGO
0.977457
6.309653
{ "github_metadata": { "branch": "master", "commit_count": 104031, "repo_created_at": "2015-11-16T19:39:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1299, "forks": 593, "issues": 263, "pull_requests": 61 }, "file_meta": { "content_id":...
735b2104-9ed6-4462-bff8-4cb300f33ebd
hiddely/eth-algolab
week11/planks/main_old.cpp
// // Created by <NAME> on 12/22/18. // #include <iostream> #include <vector> #include <algorithm> #include <list> #include <numeric> struct Less { bool operator() (int i,int j) { return (i > j);} } Less; int totalCount = 0; std::vector<int> combinations; std::vector<int> firstCombs; std::vector<int> secondComb...
ALGO
0.999848
4.693995
{ "github_metadata": { "branch": "master", "commit_count": 89, "repo_created_at": "2018-09-22T09:23: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": "1671f78e9...
1ee9b735-dccc-4d68-889f-73f26b407ebd
programmer-mursalin/Competetive-Programming
contest/cf1029/C_Cool_Partition.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; #define int long long #define gcd __gcd #define ALL(x) (x).begin(), (x).end() #define py cout << "YES\n"; #define pm cout << "-1\n"; #define pz cout << "0\n";...
ALGO
0.999817
4.349003
{ "github_metadata": { "branch": "main", "commit_count": 193, "repo_created_at": "2023-11-01T17:52:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "4baa323d5b...
1e0e8898-0863-4fda-b979-3e0d574e450b
Ahsanul24/My-Codes
Mishka and Game.cpp
// <NAME> // Coded by <NAME> // NSTU//CSTE #include<bits/stdc++.h> using namespace std; typedef long long int ll; #define MOD 1000000007 #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 loop for(int ...
ALGO
0.999816
3.195607
{ "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": "6e5b0f611c26...
faf9ce2f-ee1e-4092-bf1c-6bf4d1e7d09e
Feroz455/The-CPP-Standard-Template-Library-STL
STL Algorithm/for_each.cpp
/* Cpp_STL_Reference program for_each unaryFunction for_each(iterator start, iterator end, UnaryFunction f) */ #include<iostream> #include<algorithm> #include<vector> using namespace std; template<typename TYPE> struct increment: public unary_function<TYPE, void> { void operator()(TYPE &x){ x++;} }; //Helper funct...
ALGO
0.988081
5.778577
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2021-06-19T13:22: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": "efce1d6c38c...
ceb3ad3b-5d35-4984-b5df-fe6a743b705f
mirceamaierean/coding-solutions
nerdarena/paisprezece.cpp
#include <fstream> #include <bitset> #include <cmath> #define NMAX 1000000 using namespace std; ifstream cin("paisprezece.in"); ofstream cout("paisprezece.out"); bitset<NMAX + 1> ciur; int main() { for (int i = 4; i <= NMAX; i += 2) ciur[i] = 1; ; for (int i = 3; i <= NMAX; i += 2) if (ciur[i] == 0) ...
ALGO
0.999469
3.619764
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-08-11T11:44:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "02177a627f38...
4c5d05d5-54fc-48b6-b3b9-96a898e1a2f1
orijoon98/Algorithm_Study
C++/baekjoon/스도쿠_2239.cpp
#include <bits/stdc++.h> using namespace std; int board[10][10]; vector<pair<int, int>> v; bool flag; void Input() { for (int i = 1; i <= 9; i++) { string inputNum; cin >> inputNum; for (int j = 0; j < 9; j++) { board[i][j + 1] = inputNum[j] - 48; if (board[i][j + 1] == 0) v.push_back({ i,j + 1 }); } ...
ALGO
0.999972
5.328095
{ "github_metadata": { "branch": "main", "commit_count": 160, "repo_created_at": "2021-03-16T14:25:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "05149a2107...
dade9530-e2d9-4452-966d-a24ed49fa019
ishandutta2007/codeforces-p
peterr/normal/1558/B.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 4E6; int dp[MAXN + 1]; int where[MAXN + 1]; int sieve[MAXN + 1]; vector<int> primes; void add(int &x, int y, int mod) { x += y; if (x >= mod) x -= mod; assert(x >= 0 && x < mod); } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ...
ALGO
0.999991
4.159193
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:49: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": "370230cd334c...
bf15180f-75b4-4441-841b-0fc4856d8318
eashwaranRaghu/Data-Structures-and-Algorithms
Solutions/codechef/LEPERMUT.cpp
// Created on 25-06-2019 17:28:13 by necronomicon #include <bits/stdc++.h> using namespace std; #define MP make_pair #define PB push_back #define ARR_MAX (int)1e5 //Max array length #define INF (int)1e9 //10^9 #define EPS 1e-9 //10^-9 #define MOD 1000000007 //10^9+7 #define PI 3.1415926535897932384626433832795 typedef...
ALGO
0.999956
3.947239
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2019-07-12T14:53:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5d0ff5821...
6ed9258f-88e1-475b-b7be-20f1598ce4fa
bloopgoop/CIS-3100
test/Source.cpp
/*#include <iostream> #include <string> using namespace std; int main() { } 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) {} }; */ /* #include <iostream> #include <string> #in...
ALGO
0.999683
3.876496
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-05-11T16:45: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": "5189eb29a2...
ff861d23-f894-4f8f-b37d-6808241c4d48
ishandutta2007/codeforces-y
ytkn/normal/1627/D.cpp
#include <iostream> #include <algorithm> #include <iomanip> #include <vector> #include <queue> #include <deque> #include <set> #include <map> #include <tuple> #include <cmath> #include <numeric> #include <functional> #include <cassert> #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x...
ALGO
0.999213
3.745794
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:40: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": "b78bbd684d9c...
9ee3c1ff-41d8-4abe-a071-ac8ebad1b38c
Bonik0/lab_os
lab5-6/AVL-tree.hpp
#include <iostream> #include <set> class Node{ public: int id; int height; Node* left; Node* right; Node(int new_id){ id = new_id; left = right = nullptr; height = 1; } }; class AVL_tree { private: Node *root; ...
ALGO
0.998264
5.053799
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2023-11-06T00:08: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": "d7fc6fb95f2...
fbf86a5f-ecba-4144-8e73-5ff069517493
yooshnn/PS
bojSolution/20_/20677.cc
#include <bits/stdc++.h> #include <ext/rope> using namespace std; using namespace __gnu_cxx; #define sad cout.flush(), system("pause") typedef long long ll; typedef pair<int, int> pii; typedef tuple<int, int, int> tup; typedef tuple<int, int, int, int> tup4; const int INF = 1e8; int R, C; pii init, dest; char board[5...
ALGO
0.999976
4.503638
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2020-09-11T13:25:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dc1675e11...
0750273a-33c6-4327-9fcc-f848e8494072
FernandoAyach/competitive
beecrowd/c++/2162.cpp
#include <iostream> #include <vector> using namespace std; bool verifyPattern(int n, const vector<int>& heights, bool oddPattern) { for (int i = 1; i < n - 1; i++) { if ((oddPattern && i % 2 == 0) || (!oddPattern && i % 2 != 0)) { if (heights[i] >= heights[i - 1] || heights[i] >= heights[i + 1...
ALGO
0.999995
4.588587
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2023-07-14T14:43: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": "373a31d471f...
61bfe824-17d3-4fac-b261-a65eff0e0c19
liuyubobobo/Play-with-Algorithm-Interview
09-Dynamic-Programming/Course Code (C++)/08-Longest-Increasing-Subsequence/main2.cpp
#include <iostream> #include <vector> using namespace std; /// 300. Longest Increasing Subsequence /// https://leetcode.com/problems/longest-increasing-subsequence/description/ /// 动态规划 /// 时间复杂度: O(n^2) /// 空间复杂度: O(n) class Solution { public: int lengthOfLIS(vector<int>& nums) { if(nums.size() == 0) ...
ALGO
0.999894
5.381903
{ "github_metadata": { "branch": "master", "commit_count": 257, "repo_created_at": "2017-01-13T02:17:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1113, "forks": 456, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3b7...
6dbf9368-329b-4723-91f4-6243d0f035df
wogns1026/PS-boj-
1944.cpp
#include <iostream> #include <algorithm> #include <string> #include <string.h> #include <vector> #include <queue> #include <functional> using namespace std; typedef pair<int, int> pii; typedef pair<int, pair<pair<int, int>, pair<int, int>>> piii; int n, m, visit[51][51]; pii p[51][51]; char arr[51][51]; vector<pii> c...
ALGO
0.999933
3.813756
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2019-01-25T16:02: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": "52bdf50e5...
cdd915ea-1569-4285-a548-358fd316bb64
MingYuanTina/Resource
code_challenge/2C++Lib/Array/Problem01.cc
// Two Sum, Three Sum, Four Sum Question #include <string> #include <iostream> #include <sstream> #include <vector> #include <map> using namespace std; class Sum_To_Target { private: vector<vector<int> >res; vector<int>list; int target; public: Sum_To_Target(vector<int>l, int t){ for (int i = 0; i < l.size(); i...
ALGO
0.998944
5.147418
{ "github_metadata": { "branch": "master", "commit_count": 137, "repo_created_at": "2017-05-01T21:16: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": "00e32a33...
b0906739-d4c2-4af9-8e88-247db0832680
alexandraback/datacollection
solutions_5708284669460480_0/C++/BryceSandlund/TypewriterMonkey.cc
#include <iostream> #include <cstdio> #include <vector> #include <cmath> #define EP 1e-10 using namespace std; typedef long long ll; typedef vector<double> vd; ll count(string &cur, string &target) { ll total = 0; ll maxsize = (ll)(cur.size())-(ll)(target.size()); for (ll i = 0; i <= maxsize; ++i) { ...
ALGO
0.979521
3.556239
{ "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": "202418970...
5a79da06-811e-47d4-997f-4fee8ef1d6fd
yminjuu/BOJ-Baekjoon-Online-Judge
백준/Silver/11279. 최대 힙/최대 힙.cc
#include <iostream> #include <vector> #include <algorithm> using namespace std; int heap[100001] = { 0, }; int N, tmp, n, idx, siz = 0; int max(int a, int b) { if (heap[a] >= heap[b]) return a; else return b; } void pop() { if (siz == 1) { heap[1] = 0; siz--; ...
ALGO
0.999988
4.536824
{ "github_metadata": { "branch": "main", "commit_count": 132, "repo_created_at": "2024-02-08T14:39: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": "c36c0fe78e...
5759326a-bd68-4e63-9979-ac399b5be3c6
raincross7/code-similarity
codes/train_code/problem168/problem168_412.cpp
#include <bits/stdc++.h> using namespace std; template <class T> inline bool chmax(T &a, T b) { if(a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if(a > b) { a = b; return 1; } return 0; } typedef long long int ll; #defi...
ALGO
0.999983
4.161027
{ "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": "9bbde9db20fc...
61a30c02-554b-4a74-a65a-b201cb6eb12a
stan-dev/math
stan/math/prim/fun/lmultiply.hpp
#ifndef STAN_MATH_PRIM_FUN_LMULTIPLY_HPP #define STAN_MATH_PRIM_FUN_LMULTIPLY_HPP #include <stan/math/prim/meta.hpp> #include <stan/math/prim/fun/log.hpp> #include <stan/math/prim/functor/apply_scalar_binary.hpp> #include <cmath> namespace stan { namespace math { /** * Return the first argument times the log of the...
ALGO
0.993015
6.779667
{ "github_metadata": { "branch": "develop", "commit_count": 28933, "repo_created_at": "2015-07-01T18:40:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 785, "forks": 195, "issues": 298, "pull_requests": 19 }, "file_meta": { "content_id": ...
15fbe881-2cd5-4b15-81d0-8c8db2cd3a9b
its-sachin/LeetCode
Random/q15.cpp
#include <iostream> #include<bits/stdc++.h> using namespace std; class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { sort(nums.begin(),nums.end()); // for(int x:nums){ // cout<<x<<" "; // } // cout<<""<<endl; vector<vector<int>> ans; ...
ALGO
0.999867
5.308079
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2021-06-26T04:37:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "80cee1efb...
1058b9eb-675f-4d3c-b302-ec24f81d06ef
shakenokanzume/AtCoder_Sources
ABC_contest/239/d.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(int i = 0; i < n; i++) const int lim = 1000000007; // 素数判定用の関数 // 今回の問題では、2 <= num <= 200 の制限がかかる bool is_sosuu(int num){ if(num == 2) return true; for(int i = 2; i < num; i++){ if(num % i == 0){ ret...
ALGO
0.999453
4.262115
{ "github_metadata": { "branch": "main", "commit_count": 76, "repo_created_at": "2020-11-04T01:31:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "26cf52528d4...
5cbc9986-4ab9-4a02-a880-21ee0342f210
doroddong/baekjoon
1520_내리막길/main.cpp
// // main.cpp // 1520_내리막길 // // Created by 이동훈 on 2020/09/20. // Copyright © 2020 이동훈. All rights reserved. // #include <iostream> #include <cstring> #include <string> #include <algorithm> #include <set> #include <queue> #include <cmath> #include <cstdio> #define inRange(x,y,max_x,max_y) ((0<=x) && (x<max_x) &&...
ALGO
0.99998
4.300794
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2021-10-02T09:17: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": "5368cebcbd...
d4ad19d1-eea7-4c3c-82a8-e961b5556092
CENOS-Platform/third-party
Netgen/Netgen-Release/include/shapefunction_utils.hpp
#ifndef SHAPEFUNCTION_UTILS #define SHAPEFUNCTION_UTILS namespace ngfem { // combination of AutoDiff and linalg: // for shape functions template <int DIM, typename SCAL> auto GetGradient (const AutoDiff<DIM,SCAL> & ad) { Vec<DIM,SCAL> grad; for (int i = 0; i < DIM; i++) grad(i) = ad.DValu...
TOOL
0.958938
6.026236
{ "github_metadata": { "branch": "main", "commit_count": 157, "repo_created_at": "2022-07-07T06:14:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fd1d2782875...
eb41df64-2ac3-4620-a24b-5e95827280da
version0chiro/Leet-Code-Solutions
Unit Area of largest region of 1's - GFG/unit-area-of-largest-region-of-1s.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function to find unit area of the largest region of 1s. int solve(vector<vector<int>>& grid,int i,int j){ if(i<0 || j<0 || i>=grid.size() || j>=grid[0].size() || grid[i][j]==0...
ALGO
0.999905
6.213058
{ "github_metadata": { "branch": "main", "commit_count": 2860, "repo_created_at": "2021-03-26T07:35:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "766727bf8...
bceefa4c-ece2-4945-a242-fee2b98b18cf
raviteja1452/TicTacToeCpp
TicTacToeC++/tictactoe_ai.cpp
// Made in Love with Programming // <NAME> .. RationalScripts // TicTacToe Single Player, using AI (MiniMax Algorithm) // Reference : GeekforGeeks #include<iostream> using namespace std; // maximum function int maxx(int a,int b){ if(a > b){ return a; } return b; } // minx function int minx(int a,int b){ if...
ALGO
0.999774
4.202271
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2016-07-28T04:51:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "229dc98eb...
c551e9fa-df7d-4dc2-aaa3-6ef18f9ea455
cosmic-boy0111/Preparation
SheetProblems/Graphs/23_Find the City With the Smallest Number of Neighbors at a Threshold Distance.cpp
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define vs vector<string> #define vb vector<bool> #define pi pair<int,int> #define mi map<int,int> #define umi unordered_map<int,int> #define qi queue<int> #define vpi vector<pi> #define vvi vector<vi> #define ff first #define ss second #define inc(...
ALGO
0.999892
4.658596
{ "github_metadata": { "branch": "main", "commit_count": 32, "repo_created_at": "2022-03-22T04:58: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": "8f4e900bbb3...
785f3cf9-eea1-43c9-8ba0-c74a6393e678
kisuk010203/PS
CodeForces/Round943/943C.cpp
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); int T; cin >> T; while (T--) { int n; cin >> n; vector<int> x(n + 1); vector<int> a(n + 1); for (int i = 2; i <= n; i++) cin >...
ALGO
0.999954
3.109723
{ "github_metadata": { "branch": "master", "commit_count": 124, "repo_created_at": "2023-08-16T13: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": "dda42f8d...
66dd4957-e4d9-4858-b7f5-cef7f4031198
InsightSoftwareConsortium/ITK
Modules/Segmentation/Watersheds/include/itkWatershedSegmentTree.h
/*========================================================================= * * Copyright NumFOCUS * * 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 * * https://www.apache.o...
ALGO
0.989763
6.849924
{ "github_metadata": { "branch": "main", "commit_count": 57165, "repo_created_at": "2010-07-27T15:48:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1517, "forks": 701, "issues": 268, "pull_requests": 49 }, "file_meta": { "content_id": "5...
289cc60c-f5f6-4e0a-b56e-d410eebaca0b
xhuanhuan/submodular-dictionary-learning
SERS/mex_sers.cpp
/* Copyright 2011, <NAME> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any non-commercial purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission not...
ALGO
0.994405
5.898743
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-11-08T05:12: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": "99e7b88d5f...
10ca8e28-5650-4160-a20e-5ffd6179d3d2
pandyah5/Algorithm_ToolBox
Strassens.cpp
#include <iostream> #include <bits/stdc++.h> #include <algorithm> #include <cmath> using namespace std; int** matrix_add(int** matrix1, int** matrix2, int n){ int** res = (int**)malloc(sizeof(int*) * n); for (int k = 0; k < n; k++){ res[k] = (int*)malloc(sizeof(int) * n); } for (int i = 0; i < n; i++){ for (in...
ALGO
0.999984
4.844599
{ "github_metadata": { "branch": "master", "commit_count": 49, "repo_created_at": "2020-08-14T08:36:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "a89d601b1...
19970491-6622-4bd2-9ba2-aa15da363f6f
phanithlim/CPP
Assignment01/exercises_1.cpp
#include <iostream> using namespace std; int main(){ string number; float average; float sum = 0; char decimals_digit[] = "0123456789"; bool isDecimal = true; short int sizeNumber = sizeof(number) / sizeof(number[0]); cout << "Enter numer : "; getline(cin, number); //check numbe...
ALGO
0.996626
3.58924
{ "github_metadata": { "branch": "main", "commit_count": 76, "repo_created_at": "2022-08-11T01:33: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": "0be36ba99cf...
7ac1eeee-bc7b-4a87-bef6-110c6c43a202
theapi/hdd_rotary_encoder
HDDRotaryEncoder/HDDRotaryEncoder.ino
/* @see http://www.circuitsathome.com/mcu/reading-rotary-encoder-on-arduino Rotary encoder read example */ #define ENC_A 14 #define ENC_B 15 #define ENC_PORT PINC #define PROCESSING 1 volatile int counter = 0; // changed by encoder input volatile byte ab = 0; // The previous & current reading void setup() { /* ...
ALGO
0.986618
5.761632
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2015-02-28T16:32: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": "43a7003340...
bc10891d-9b63-4dda-9cf5-cc4e3c9c0448
Harshit-Verma-Official/Data-Structures-and-Algorithms
Array/LongestConsecutiveSubsequence.cpp
#include <bits/stdc++.h> using namespace std; // Method 1 // Time : O(nlogn) // Space : O(1) int findLongestConsecutiveSubsequence(int arr[], int n) { sort(arr, arr + n); int max_v = 1; int cur = arr[0]; int temp_v = 1; for (int i = 1; i < n; ++i) { if (arr[i] == arr[i - 1]) co...
ALGO
0.999787
5.501111
{ "github_metadata": { "branch": "main", "commit_count": 93, "repo_created_at": "2021-07-07T04:43:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5745e657767...
12bf8972-f9c0-4614-8c58-61770c267d04
HARSH-KUMAR-111/Leetcode
0987-vertical-order-traversal-of-a-binary-tree/0987-vertical-order-traversal-of-a-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999991
6.166707
{ "github_metadata": { "branch": "main", "commit_count": 353, "repo_created_at": "2024-02-20T11:46: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": "012fd3cae6...
4e790456-be88-4ff5-860b-a1afaccd131c
Cynaptic/ReiNN
ReiNN/matrix.cpp
#include <vector> class Matrix { public: static std::vector<double> multiply(const std::vector<double>& vec, const std::vector<std::vector<double>>& mat) { std::vector<double> result(mat[0].size(), 0.0); for (size_t i = 0; i < mat.size(); ++i) { for (size_t j = 0; j < mat[i].size(); ++j...
ALGO
0.996392
6.104877
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-01-11T15:32:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f33ed30c680b...
7ab4c3e1-57d3-49e0-909a-6814409bcdd9
prof1ssor/C-and-Python
loveCalculator.cpp
//C++ #include <iostream> #include <string> #include <algorithm> int main(){ std::string name1, name2; int pointT = 0, pointL = 0; std::cout << "Enter the name of the first person : " ; std::getline(std::cin,name1); std::transform(name1.begin(), name1.end(), name1.begin(), ::tolower); std::c...
ALGO
0.999656
4.826891
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-09-07T18:55: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": "90989c2ee69a...
68e3842b-c392-47f6-9b27-86637733aa8f
thecodekaiser/Data-Structures
BIT/LineIntersection/lpair.cpp
/** * This code uses BIT. * Author : thecodekaiser */ #include <iostream> #include <cstdlib> #include <cstdio> #include <map> #include <algorithm> using namespace std; map<long long, int> mapping; // Function : Binary Search int bs(long long * ptr, int N, long long val) { int lo = 0, hi = N-1; int mid; while(l...
ALGO
0.999933
3.576768
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2016-03-08T05:08:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4814626c4...
493ffbd0-8a92-44e3-98a0-f99fa4036d1b
lloyd-kai/cpp-lanqiaocup
2_13/MultidimensionlKnapsack_1.cpp
#include <iostream> #include <vector> using namespace std; #define maxn 110 int n, m, v[maxn], w[maxn], s[maxn]; int f[2][maxn]; //创建商品的结构体(或者类也可以) struct Goods { int w, v; }; int q[maxn]; int main() { //初始化数据 scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) { scanf("%d%d%d", &v[i], &w[i], &s[i]); } fo...
ALGO
0.999982
3.682225
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2024-12-30T08:13: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": "374f68a22d7...
d5afb511-b536-431f-9f10-f6d0f7a65701
cwshu/2015_parallel_programming_hw
hw1/pi_omp.cpp
#include <cstdio> #include <cstdint> #include <iostream> #include <chrono> #include <random> // MT19937: http://www.cplusplus.com/reference/random/mersenne_twister_engine/mersenne_twister_engine/ #include <pthread.h> #ifndef NUM_OF_THREAD #define NUM_OF_THREAD 4 #endif int compute_pi_by_random(int number_of_tosses){...
ALGO
0.999828
5.469578
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-11-02T08:10:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ed9965e9c1...
ab9adf37-6321-4af5-a717-0fc0af957755
iCoder0020/Competitive-Coding
CompCoding/C_Common_Number.cpp
#include <bits/stdc++.h> using namespace std; #define int long long int count(int x, int N) { queue<int>Q; Q.push(x); int cnt = 0; while(!Q.empty()) { int q = Q.front(); cnt++; Q.pop(); if(q*2 <= N) Q.push(q*2); if(q%2 == 0 && q+1<=N) Q.push(q+1); } return cnt; } int32_t m...
ALGO
0.999953
3.793756
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2018-09-29T11:23: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": "6f61a3e60...
8aefc41c-dc9f-45a5-bf39-e7c7fb66215e
abdullahejazjanjua/data_structures_algorithms
Assignments/2023038_3/2023038_Q1_3.cpp
#include <iostream> #include <algorithm> using namespace std; void countingSort(int arr[], int n) { if (n == 0) return; int maxVal = *max_element(arr, arr + n); int *count = new int[maxVal + 1]; for (int i = 0; i < maxVal + 1; i++) { count[i] = 0; } for (int i = 0; i < n; i...
ALGO
0.999969
5.539107
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2024-09-21T11:12: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": "629c45eb341...
e7e2878c-7fa2-4dc0-a1f0-024ec6a10013
fengvyi/LeetCode
C++/109. Convert Sorted List to Binary Search Tree.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), le...
ALGO
0.999999
6.320841
{ "github_metadata": { "branch": "master", "commit_count": 1188, "repo_created_at": "2017-08-06T09:52:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 144, "forks": 39, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "acd6...
82721316-8949-4e59-98c5-d7d2c4b268c2
hotaosa/AtCoder
EDPC/I/main.cc
#include <iostream> #include <vector> int main() { int n; std::cin >> n; std::vector<double> p(n + 1); for (int i = 1; i <= n; ++i) std::cin >> p[i]; std::vector<std::vector<double> > dp(n + 1, std::vector<double>(n + 1, 0.0)); dp[0][0] = 1.0; for (int i = 1; i <= n; ++i) { for (int j = 0; j <= i; +...
ALGO
0.999933
4.330993
{ "github_metadata": { "branch": "master", "commit_count": 523, "repo_created_at": "2021-04-06T09:44:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f25bf5f6...
7271734d-e47c-4d9d-bfc5-0b66737166b6
halide/Halide
apps/hist/hist_generator.cpp
#include "Halide.h" namespace { using namespace Halide::ConciseCasts; class Hist : public Halide::Generator<Hist> { public: Input<Buffer<uint8_t, 3>> input{"input"}; Output<Buffer<uint8_t, 3>> output{"output"}; void generate() { Var x("x"), y("y"), c("c"); // Algorithm Func Y("Y...
ALGO
0.997511
6.975607
{ "github_metadata": { "branch": "main", "commit_count": 23344, "repo_created_at": "2012-07-31T04:05:25.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 6126, "forks": 1080, "issues": 993, "pull_requests": 78 }, "file_meta": { "content_id": "...
19342b97-c4b5-4638-be27-454337405119
taiQui/SADM-project-M1
header/MB.hpp
#ifndef MB_hpp #define MB_hpp #include <iostream> #include <vector> #include <time.h> #include <cstdlib> #include "../header/Solution.hpp" using namespace std; class Solutions; #define RANDOM_FLIP 1 //Multidimentionnal bag class MB{ private: int _objectNumber; int _bagNumber; vector<int> _objectList; vect...
ALGO
0.997201
3.765113
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2019-04-24T08:03: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": "4fed0b56e...
df3056ac-1ec4-4a18-bca9-a1cfb650462e
kobe24o/LeetCode
程序员面试金典/16.17.contiguous-sequence-lcci.cpp
class Solution { public: int maxSubArray(vector<int>& nums) { vector<int> dp(nums); for(int i = 1; i < nums.size(); ++i) { if(dp[i-1] > 0) dp[i] = max(dp[i], nums[i]+dp[i-1]); } return *max_element(dp.begin(),dp.end()); } }; class Solution { public: int maxSubArray(vec...
ALGO
0.99997
5.434026
{ "github_metadata": { "branch": "master", "commit_count": 2735, "repo_created_at": "2019-07-24T05:05:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 33, "forks": 17, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5ec37...
da111b50-1c04-4990-a50b-1708d673c4fa
ShiraBrosh/Kosaraju-Synchronization-and-Server
level_10/graph.cpp
#include "graph.hpp" #include <iostream> // Required for std::cout Graph::Graph(int V) : V(V), maxSCCSize(0) , currentEdges(0) { maxEdges = V * (V - 1); // Maximum number of edges in a directed graph without self-loops adj.resize(V); } bool Graph::addEdge(int v, int w) { // Validate vertices if (v < ...
ALGO
0.998871
6.259243
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-12-16T11:52: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": "082ca86a6fbc...
f4ffe13a-c66f-4322-8d72-46022809350f
kaidul/Data_Structure_and_Algorithms_Library
algorithms/tsp.cpp
#define CITY 3 #define INF (1 << 30) bool visited [CITY] [1 << CITY]; // is_visited int dp [CITY] [1 << CITY]; // cost at particular state // path cost - weight[i][j] denotes cost for travel from city i to j int weight [CITY] [CITY] = { {0, 2, 3}, {19, 0, 6}, {7, 8, 0} }; int target = (1 << CITY) - 1; int orig...
ALGO
0.999954
3.868238
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2015-05-28T16:42:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 198, "forks": 78, "issues": 2, "pull_requests": 1 }, "file_meta": { "content_id": "6e9e1e...
5fd64eeb-0269-45eb-a1cc-4150c524e400
DangerousCactus/BOJ
임계경로.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; int main() { cin.tie(0)->sync_with_stdio(0); int n, m; cin >> n >> m; vecto...
ALGO
0.999779
3.33409
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-10-04T02:53: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": "bbb74ca70b...
e7d3620a-0695-47aa-85e6-9012dc97a0a0
moodom/leetcode
c++/347 Top K Frequent Elements.cpp
// Source : https://leetcode.com/problems/top-k-frequent-elements/ // Author : FangY // Date : 2018-12-14 /******************************************************************************* *Given a non-empty array of integers, return the k most frequent elements. * *Example 1: * *Input: nums = [1,1,1,2,2,3], k = 2 *Out...
ALGO
0.999995
6.098154
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2018-12-11T08:03:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "6a32a92b1...
caba7106-f371-40ba-bf1c-56f38ea9ceb9
Nitsua365/ConwaysGOL
cellFilter.cpp
#include "cellFilter.h" CellFilter::CellFilter(int x, int y) { this->x = x; this->y = y; this->filter = new bool* [x]; this->output = new bool* [x]; for (int i = 0; i < x; i++) { this->filter[i] = new bool[y]; this->output[i] = new bool[y]; } } CellFilter::~CellFilter() { f...
ALGO
0.944364
5.187412
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2021-09-10T04:13:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8ba86fdcd4aa...
5d7b6001-a3a9-4171-ad8c-65838a2b0942
sdcoull/AdventOfCode2021
AdventOfCode2021/dayEight.cpp
// // dayEight.cpp // AdventOfCode2021 // // Created by <NAME> on 08/12/2021. // https://adventofcode.com/2021/day/8 // #include "dayEight.hpp" using namespace AdventOfCode; using namespace std; void dayEight::partOne() { string myText; ifstream MyReadFile("Day8Input.txt"); int appearCount = 0; ...
ALGO
0.996368
4.207174
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2021-12-03T20:16: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": "c9c6f470ff0...
b8e312d3-b4e3-491f-822b-b0242e501535
henrybear327/Sandbox
AtCoder/Regular/083/a.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll a, b, c, d, e, f; scanf("%lld %lld %lld %lld %lld %lld", &a, &b, &c, &d, &e, &f); set<ll> denominator; for(int i = 0; i <= 100; i++) for(int j = 0; j <= 100; j++) { denominator.insert(100 * a * i ...
ALGO
0.999907
3.051574
{ "github_metadata": { "branch": "master", "commit_count": 1136, "repo_created_at": "2016-03-14T01:30:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "73c87bb...
10d62c2b-7114-4ca0-944d-b860b3e7e368
pedrocardoso5/Game-Pig-Dice
source/cpu.cpp
#include "../include/cpu.h" /*! * Solicita a próxima ação para a Inteligência Artificial. * * \param turn_total_ Pontos acumulados da rodada atual. * \param my_pts_ Pontuação geral da IA acumulado até o presente. * \param opponent_pts_ Pontuação geral do oponente acumulado até o presente. * \param n_my...
ALGO
0.99941
3.686271
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2019-04-04T12:46:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "33d44aef06...
bdeb411f-59e7-41f0-a6e5-4c081e932d18
Amit-unchartered/Code_with_CPP
codencode/matrix_exponentiation.cpp
//given a matrix A, and an integer N, calculate A^N //Naive Approach --> TC => O(M^3*N) //optimal approach --> TC => O(M^3*logN) #include<bits/stdc++.h> #define REP(i,n) for (int i=1; i<=n; i++) #define pb push_back #define ff first #define ss second #define ii pair<int, int> #define vi vector<int> #define vii vector...
ALGO
0.999808
3.851987
{ "github_metadata": { "branch": "main", "commit_count": 291, "repo_created_at": "2023-05-01T07:00:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a8ca84813d...
87b9c415-6c76-4202-aefe-afaf505bfc4f
SaulinTuhin/LeetCode
Cpp/Problem_2971.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; // Problem - 2971: https://leetcode.com/problems/find-polygon-with-the-largest-perimeter/ // C++ Solution! class Solution { public: long long largestPerimeter_forward(vector<int>& nums) { // O(nlogn) sort(nums.begin(), nums.end()); // ...
ALGO
0.99926
4.717315
{ "github_metadata": { "branch": "main", "commit_count": 184, "repo_created_at": "2024-01-03T16:44:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "83be7a30fc...
ea88fb3b-6bba-4316-948e-13a7a67ceee2
firiexp/contest_log
AOJ/1601.cpp
#include <iostream> #include <algorithm> #include <iomanip> #include <map> #include <set> #include <queue> #include <stack> #include <numeric> #include <bitset> #include <cmath> static const int MOD = 1000000007; using ll = long long; using u32 = uint32_t; using namespace std; template<class T> constexpr T INF = ::nu...
ALGO
0.999888
3.546012
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2018-09-25T02:26: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": "9d0d55d6a...
97b3c097-8263-4784-af0e-5eb2801aca29
Darbouka/VRMusic-Studio
src/audio/mixing/MixingEngine.cpp
#include "MixingEngine.hpp" #include <stdexcept> #include <algorithm> #include <cmath> namespace Mixing_DAW { MixingEngine::MixingEngine() { initializeComponents(); } MixingEngine::~MixingEngine() { shutdown(); } void MixingEngine::initialize() { try { initializeComponents(); updateState...
TOOL
0.918645
3.155198
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2025-06-07T12:34:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "d1b18fb26fe...
8fc9f896-b68a-41d6-95b1-716a81e74027
aritra-chy/Codeforces
B_Binary_Typewriter.cpp
/*------------------------------------------------------ author : <NAME> created : Monday | 21 April,2025 | 20:58:15 ------------------------------------------------------*/ #include <bits/stdc++.h> #include <string> #include <iomanip> #include <vector> #include <algorithm> #include <cmath> #include <io...
ALGO
0.99997
4.678768
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-07-09T16:47: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": "cd88e0b0016c...
5ec47de3-31e8-4b85-9406-e67b2b228b04
md-jonayed/Phitron_Course
Semester 1/DSA/Module 8( Assignment 2)/test.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: int value; Node *next; Node(int value) { this->value = value; this->next = NULL; } }; void insertHead(Node *&head, int value) { Node *newNode = new Node(value); newNode->next = head; head = newNode; } voi...
ALGO
0.999823
4.449713
{ "github_metadata": { "branch": "main", "commit_count": 141, "repo_created_at": "2023-06-09T17:07: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": "4bec2a0263...
87e71e93-bd6e-47e5-a9e5-1dc986e47818
ishandutta2007/codeforces-p
pwild/normal/1207/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef pair<ll,ll> pll; typedef vector<bool> vb; const ll oo = 0x3f3f3f3f3f3f3f3f; const double eps = 1e-9; #define sz(c) ll((c).size()) #define all(c) begin(c), end(c) #define FOR(i,a,b) for (ll i = (a)...
ALGO
0.99966
3.228868
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:49: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": "c950607685e8...
eacfac0d-855c-45cb-9ef8-5ed97f76e864
HardCoder05/Algoritmia
03 DIVIDE Y VENCERAS/Lab3 22-2/Lab3_P1_22-2.cpp
#include <iostream> #include<iomanip> using namespace std; void divideYVenceras(int evaluaciones[], int inicio, int fin, int& menorPeso, int& inicioMenor, int& finMenor) { if (inicio == fin) { menorPeso = evaluaciones[inicio]; inicioMenor = inicio; for(int i=inicio+1 ; i<30 ; i++){...
ALGO
0.999928
4.007615
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-11-22T16:44: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": "d8b06f07e93...
91130742-8b8a-460f-910e-b7fc65eaa6bd
octoant/cses-problemset-solutions
sorting-and-searching/array-division.cpp
/** * @author <NAME> (<EMAIL>) * @date December, 2022 */ #include <iostream> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, k; cin >> n >> k; vector<long long> a(n); for (auto &x : a) { cin >> x; } auto check = [&](long long mid) { ...
ALGO
0.999991
4.886794
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2021-04-15T12:06:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "21287d939...
625a3a87-04d1-4ef1-8344-14c4baf5181f
Maboroshi0327/DIP_Homework_2
FFT Programs/FFT.cpp
#include "FFT.h" void Removal_of_Periodic_Noise(int(&R)[MaxBMPSizeX][MaxBMPSizeY], int(&r)[MaxBMPSizeX][MaxBMPSizeY], int w, int h) { double* data = new double[MaxBMPSizeX * MaxBMPSizeY * 2]; // convert to the long 1D array int ptr = 0; for (int i = 0; i < w; i++) { for (int j = 0; j < h; ...
ALGO
0.999678
4.222813
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2023-06-01T16:14: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": "db1350957...
eaafd142-5f57-45b6-b8fa-261d0ad10bbd
minpark96/Data-Structure-and-Algorithm-Study
CodingTest/2-A-2178.cpp
#include <iostream> #include <vector> #include <string> #include <queue> using namespace std; #pragma region 최초 풀이 /* 미로 입력이 붙어서 들어오므로 문자열로 받아서 처리 최단 거리를 구하므로 dfs가 아니라 bfs로 처리 */ int dy[] = { -1, 0, 1, 0 }; int dx[] = { 0, 1, 0, -1 }; int n, m, cnt; string ipt; queue<pair<int, int>> que; int maze[104][104]; int ...
ALGO
0.999971
4.316138
{ "github_metadata": { "branch": "master", "commit_count": 92, "repo_created_at": "2023-12-28T02:27: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": "897653189...
f51a8c5d-4dde-46fd-a1e5-cd0de3f04455
NekomammaT/StocDeltaN_dist
sample/hilltop_SR.cpp
#include "../source/StocDeltaN.hpp" #include <sys/time.h> #define MODEL "hilltop_SR" // model name // ---------- box size & step h ------------ #define XMIN -21 #define XMAX 21 #define HMIN (1e-8) #define HOV (1./20) // ----------------------------------------- // ---------- for PDE ---------------------- #define MA...
ALGO
0.999679
5.876067
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2018-11-06T04:52: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": "1d03954b6...
953568ef-fa37-4eed-9d68-adac4ec77af0
wsdream/PPCF
PPCF/P_UIPCC/cP_UIPCC.cpp
/******************************************************** * cP_UIPCC.cpp: C++ implements on P_UIPCC * Author: <NAME> <<EMAIL>> * Created: 2014/4/29 * Last updated: 2015/02/11 ********************************************************/ #include <iostream> #include <cstring> #include <map> #include <vector> #include <...
ALGO
0.993678
5.422101
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2015-02-16T00:13:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "501cba0cde...
b1000eaa-552d-4220-85e4-51206fed4ad7
karin0/problems
probs/nc885b.cpp
#include <akari> IO<100, 100> io; cint N = 1000002; int mo; struct Mat { int a[2][2]; Mat operator * (const Mat &rhs) const { Mat r; re (i, 0, 2) re (j, 0, 2) r.a[i][j] = ((ll)a[i][0] * rhs.a[0][j] + (ll)a[i][1] * rhs.a[1][j]) % mo; return r; } } I; Mat pow(Mat a, int ...
ALGO
0.999911
4.219563
{ "github_metadata": { "branch": "master", "commit_count": 225, "repo_created_at": "2017-05-22T16:54:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "37f2cad2...
f8653642-4b0b-4732-b56e-2cc92c178ff3
liuchuo/LeetCode
C++/098. Validate Binary Search Tree.cpp
98. Validate Binary Search Tree Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes with keys greater than the node's key. Both t...
ALGO
0.999997
6.031772
{ "github_metadata": { "branch": "master", "commit_count": 354, "repo_created_at": "2016-04-01T13:53:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 534, "forks": 154, "issues": 5, "pull_requests": 4 }, "file_meta": { "content_id": "fe52...
c095d235-1038-4662-9313-3c977f3693d6
mrsac7/CSES-Solutions
src/1650 - Range Xor Queries.cpp
/* Problem Name: Range Xor Queries Problem Link: https://cses.fi/problemset/task/1650 Author: <NAME> (mrsac7) */ #include<bits/stdc++.h> using namespace std; template<typename... T> void see(T&... args) { ((cin >> args), ...);} template<typename... T> void put(T&&... args) { ((cout << args << " "), ...);} template<type...
ALGO
0.999994
4.880415
{ "github_metadata": { "branch": "master", "commit_count": 66, "repo_created_at": "2020-05-06T08:18:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 394, "forks": 157, "issues": 1, "pull_requests": 4 }, "file_meta": { "content_id": "97cf8...
d08438be-2f9d-4ea4-b561-0c72447e03c9
seilweiss/bfbbpc
src/Core/win/iCollide.cpp
#include "iCollide.h" #include "iTime.h" #include "xCollide.h" #include "xClumpColl.h" #include "xEnv.h" #include "xModel.h" static S32 sCollidingJSP; static F32 cbath; static xRay3 cbray; static const xMat3x3* cbmat; static RpIntersection cbisx_local; static U8 cbnumcs; static U8 cbmaxcs; static U8 FLOOR; static U8...
ALGO
0.99923
4.411719
{ "github_metadata": { "branch": "main", "commit_count": 58, "repo_created_at": "2023-02-23T21:08:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 19, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ca42db6841...
d5f3bd89-4611-49fd-bddd-36943b9627d9
ishandutta2007/codeforces-k
kamer/normal/1693/C.cpp
#include <iostream> #include <vector> #include <string> #include <tuple> #include <algorithm> #include <utility> #include <queue> #include <deque> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <iomanip> #include <fstream> #include <cmath> #include <complex> using namespace std...
ALGO
0.999683
3.71139
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:06:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d4e51a410faa...
e706ab01-3ee0-4d56-a843-a5e83a432064
amangupta590/NUMBER-THEORY-
KMP ALGO.cpp
#include<bits/stdc++.h> #define REP(i,n) for (int i = 1; i <= n; i++) #define mod 1000000007 #define pb push_back #define ff first #define ss second #define ii pair<int,int> #define vi vector<int> #define vii vector<ii> #define lli long long int #define INF 1000000000 #define endl '\n' const double PI = 3.1415926535897...
ALGO
0.999908
4.476984
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2020-06-30T15:02: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": "1e6a62445...
d7869f80-35ff-408c-9cee-b4a8e601e217
davidjcc/AOC2020
day_3.cpp
#include <iostream> #include "util.h" #include "tests.hpp" size_t check_slope(const Split_String& contents, size_t right, size_t down) { const auto width = contents[0].size(); const auto height = contents.size(); size_t x = right; size_t y = down; size_t count = 0; while (y < height) { ...
ALGO
0.998095
6.073849
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2020-12-22T17:38: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": "3561eba537f...
8b9b40ac-6e08-4914-844d-d7fd058c6027
dsthakur10/Coding
DSA Topic wise/8. Graphs/NetworkDelayTime.cpp
// Network Delay Time /* You are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] = (ui, vi, wi), where ui is the source node, vi is the target node, and wi is the time it takes for a signal to travel from source to target. We will send a s...
ALGO
0.999888
5.34102
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2022-06-29T13:54: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": "ac7da5b66...
00af4d57-5bd7-441d-8361-6903bb1fb88b
H-DNA/Leethub
0542-01-matrix/0542-01-matrix.cpp
class Solution { public: vector<vector<int>> updateMatrix(vector<vector<int>>& mat) { const int m = mat.size(); const int n = mat[0].size(); vector<vector<int>> res(m); for (auto& r: res) r = vector<int>(n, INT_MAX); vector<vector<bool>> checked(...
ALGO
0.999894
6.090784
{ "github_metadata": { "branch": "main", "commit_count": 750, "repo_created_at": "2024-11-20T18:01: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": "74ccf75f70...
5895ec7b-c52b-4ca5-b7e0-009a51fa01d3
jessicalberto/ENGEC330---Algorithms-Data-Structures
HomeworkOne/fibDigSum_A.cpp
#include <iostream> #include "bigNum.h" #include <string> #include <cstring> #include <sstream> #include <memory> using namespace std; class bigNum; bigNum fibDigSum(int nn){ // Initialize 0th and 1st element of digits vector bigNum a = bigNum(1); bigNum b = bigNum(1); bigNum c = bigNum(0); /* Calculate Fib...
ALGO
0.999842
4.47857
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-08-30T18:25: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": "8c41b60bf9...
918b6787-6528-4059-8d3b-382b14c3098e
changsongzhu/leetcode
C++/per_day/06-27-2017/004_h.cpp
/** 4[H]. Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1: nums1 = [1, 3] nums2 = [2] The median is 2.0 Example 2: nums1 = [1, 2] nums2 = [3, 4] The medi...
ALGO
0.999992
5.357884
{ "github_metadata": { "branch": "master", "commit_count": 395, "repo_created_at": "2017-03-15T23:33:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5b3715cf...
86972edf-752f-4f5b-a9c3-0f4adcc751c5
kizuku/Project-4
Translator.cpp
#include "provided.h" #include <string> #include <vector> #include <map> using namespace std; class TranslatorImpl { public: bool pushMapping(string ciphertext, string plaintext); bool popMapping(); string getTranslation(const string& ciphertext) const; private: vector<map<char, char>> mapping; // maps ciphe...
ALGO
0.998996
4.967657
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2018-03-11T04:17: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": "4dc5eb8900...
a37c8e39-d882-4b07-9cfe-34c09d78cbd0
VanAnh-13/Algorithm
ctdl/VectorList.cpp
#include <bits/stdc++.h> #define MAX 6 using namespace std; struct HangHoa { char maHang[50]; char tenHang[70]; char DVtinh[50]; int donGia; int soLuong; int thanhTien; void inputHangHoa() { cout << "\tNhap ma hang: "; cin.getline(maHang, sizeof(maHang) - 1); ...
TOOL
0.930815
3.229589
{ "github_metadata": { "branch": "udtt", "commit_count": 3, "repo_created_at": "2024-04-14T03:23:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "7e0170164da1...
54ffc83c-6c96-405c-8e12-e117e68487ac
chroniclesofcode/competitive-programming
atcoder/abc359E-Water_Tank.cpp
#include <bits/stdc++.h> using namespace std; #define MAINRET(x) in##x #define what_is(x) cout << #x << " is " << x << endl; #define prLL_vec(x, n) for (LL i = 0; i < n; i++) cout << x[i] << ' '; cout << endl; #define LL long long #define arr2 array<LL,2> #define arr3 array<LL,3> void solve(); MAINRET(t) main(void)...
ALGO
0.999973
4.332863
{ "github_metadata": { "branch": "main", "commit_count": 822, "repo_created_at": "2022-09-09T05:32: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": "d9336e3948...
2b410971-07dc-4827-89ee-88699480614f
davidgreisler/four-in-a-line
src/GameLogic/FourInALine/AAI.cpp
#include "AAI.hpp" #include "Game.hpp" #include <limits> #include <chrono> #include <stdexcept> namespace GameLogic { namespace FourInALine { const unsigned int AsynchronousArtificialIntelligence::INVALID_RESULT = std::numeric_limits<unsigned int>::max(); /** * Thrown when the computation is cancelled. */ class I...
ALGO
0.958434
6.995852
{ "github_metadata": { "branch": "master", "commit_count": 152, "repo_created_at": "2014-04-22T11:24:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 6, "pull_requests": 0 }, "file_meta": { "content_id": "3530b4a4...
3d35ce65-947f-4d33-a1ab-9c1692d36177
HEltim7/cpcode
CF/Problems/204E.cpp
#include <array> #include <vector> #include <iostream> #include <algorithm> using namespace std; #define endl '\n' using LL=long long; constexpr int N=2e5+10,M=20; int fa[N][M+1],dep[N]={1}; int id[N],ed[N],cnt[N],idx; vector<int> adj[N]; void get_lca(int u) { for(int v:adj[u]) { dep[v]=dep[u]+1; ...
ALGO
0.999964
4.935489
{ "github_metadata": { "branch": "master", "commit_count": 249, "repo_created_at": "2022-06-06T13:55: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": "6062b7a2...
031646cb-1062-4036-a750-714bf5aa2930
CNES/cars-filter
cars_filter/utils.h
// Copyright (C) 2024 Centre National d'Etudes Spatiales (CNES). // // This file is part of cars-filter // // 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/license...
ALGO
0.971914
6.890404
{ "github_metadata": { "branch": "main", "commit_count": 58, "repo_created_at": "2024-11-19T17:18:50.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4c59b155d1f5...
36c716d3-4e56-4e8c-9b3c-5e2b0fec3dd6
maxymilianz/CS-at-University-of-Wroclaw
Intro to C/Solutions/4.2/4.2/4.2.cpp
// 4.2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <time.h> int mem[63] = { 0 }; int fibRec(int n) { if (n < 0 || n > 62) return -1; if (n == 0) return 0; else if (n == 1) return 1; return fibRec(n - 1) + fibRec(n - 2); } int fibIte(int n) { int a = 0, b =...
ALGO
0.994939
4.987122
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2018-03-11T14:46:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 12 }, "file_meta": { "content_id": "d72e180dd...
8a5570c0-009b-4425-9ebe-b6b790cd349c
varshithyadav/Dsa0156-C-
two floating number arithmetic c++.cpp
#include <iostream> #include <cmath> int main() { double num1, num2; std::cout << "Enter the first floating-point number: "; std::cin >> num1; std::cout << "Enter the second floating-point number: "; std::cin >> num2; std::cout << "Addition: " << num1 + num2 << std::endl; std::cout << "S...
TOOL
0.938899
5.200988
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2024-07-03T04:27: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": "cabed26d13c...
ef1a1f46-0252-4743-b4f8-7f2db9e4d1d6
Iftikhar-hasan12/Codeforces
Leetcode/Array Problem/3618. Split Array by Prime Indices.cpp
class Solution { public: vector<bool> isPrimeArr; // Precompute prime numbers up to n using Sieve of Eratosthenes void sieve(int n) { isPrimeArr.assign(n + 1, true); isPrimeArr[0] = isPrimeArr[1] = false; for (int i = 2; i * i <= n; ++i) { if (isPrimeArr[i]) { ...
ALGO
0.99995
5.621066
{ "github_metadata": { "branch": "main", "commit_count": 159, "repo_created_at": "2025-03-28T00:00: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": "c3da84f736...
c5fec15e-92fe-4ad4-b3c6-e7b18d5cdec5
Boruwka/pw_zadanie_zaliczeniowe_cpp_2022
smieci_z_pipami.cpp
ContestResult TeamConstProcesses::runContest(ContestInput const & contestInput) { ContestResult r; uint64_t num_of_procs = this->getSize(); uint64_t input_size = contestInput.size(); int fd_memory = -1; int flags, prot; prot = PROT_READ | PROT_WRITE; flags = MAP_SHARED | MAP_ANONYMOUS; v...
ALGO
0.99926
3.485611
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-02-04T10:09: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": "b03d924c4d42...
2f6ae3bc-217c-4e5d-b339-45952c941cc1
Cartus/AMR-Parser
data/align/scripts/cpp/transpose-adtable.cpp
#include <iostream> #include <fstream> #include <sstream> #include <string> using namespace std; double a[220][220][220]; double d[220][220][220]; int main() { ifstream fin0("a1"); ifstream fin1("d1"); ofstream fout0("atable"); ofstream fout1("dtable"); for (int i = 0; i < 220; i++) for (int j = 0; j < 220; j++)...
ALGO
0.99944
3.15841
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2018-11-18T04:49:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 0, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "9bf8cb9a...
1805cd21-4c3b-4b97-8ae9-69b791e4e871
sindeedindeed/DSA-II
Assignment/djikstra.cpp
#include <iostream> #include <vector> #include <queue> #include <climits> #include <algorithm> using namespace std; void dijkstra(int n, vector<vector<pair<int, int>>>& adj, vector<int>& dist, vector<int>& prev) { vector<bool> visited(n, false); dist[0] = 0; for (int i = 0; i < n; ++i) { int u = ...
ALGO
0.999992
4.483168
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2024-03-12T13:13: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": "36a6b616c09...
01e20d08-08a5-4d04-a8b9-9c2d7767a4a3
theguyoncloud/demoCpp
StringsCPPprog/countVowelNConso.cpp
//Write a program to count a number of vowels and consonants in a string? //it assume no gaps in string. #include<iostream> #include<string> using namespace std; int main(){ string inptString; cout << "Type the string in which you want to find the character: "; cin >> inptString; int vowelsFound...
ALGO
0.999602
4.667032
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-05-02T09:30: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": "3d0eb9cc92c0...
46e76390-9d28-4b9e-9954-15659ede70da
JimWright4089/Contest
2020/ICPC_PacNW/ContestData/triptik/submissions/accepted/atlas1d_arknave.cpp
#include <algorithm> #include <cassert> #include <iostream> #include <queue> #include <set> #include <tuple> #include <utility> #include <vector> #define DEBUG 0 using namespace std; using ll = long long; constexpr int INF = 1e9 + 7; int main() { int n, k; cin >> n >> k; vector<ll> pts(n); ll max_...
ALGO
0.999985
4.584024
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2023-02-28T19:54: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": "c5dce02cee9f...
1d1cb260-6a7e-4b3d-b722-a5535f422dda
meiyoumingzile/ICPC_AlgorithmTemplete
ICPC_AlgorithmTemplete/图论/双联通分量/题目/poj1144(割点模板注意输入).cpp
#include<iostream> #include<algorithm> #include<cstdlib> #include<cstdio> #include<vector> #include<queue> #include<stack> #include<cmath> #include<string> #include<cstring> #include<ctime> #include<map> #include<set> //#include<windows.h> using namespace std; //std::ios::sync_with_stdio(false); #pragma comment(linker,...
ALGO
0.999513
4.130503
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2018-11-29T13:30:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ed2be772f...
a1c93e27-8360-44fb-abcb-f631d8b6fd4c
dangkhoauit184/phamdangkhoa_dev_oop
Bai012_ClassSinhVien/main.cpp
#include <iostream> #include "SinhVien.h" using namespace std; int main() { int n; cout << "Nhap so luong sinh vien: "; cin >> n; // Cap phat mang dong cho danh sach sinh vien SinhVien* dssv = new SinhVien[n]; for (int i = 0; i < n; i++) { cout << "Nhap thong tin sinh vien thu " <...
TOOL
0.993371
4.000993
{ "github_metadata": { "branch": "main", "commit_count": 62, "repo_created_at": "2025-01-29T12:07: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": "6947425e4ac...
67cdc0ce-602e-4483-bc98-7629598d38ce
KaiBritt/ComputationalGeometry
triangulation_couting/main2.cpp
#include <algorithm> #include <float.h> #include <iostream> #include <format> #include <map> #include <set> #include<vector> // // // // Created by kai on 3/7/25. // // // std::string diagnoalToStr(std::map<int, std::vector<int>> diagonals) { std::string out; std::string diagToAdd; std::pmr::set<std::string...
ALGO
0.999457
5.33931
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2025-02-15T15:32: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": "fb68dd150d56...