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
fa8a86a6-08da-4da1-a4d5-2662a35fa70f
wirelesscheating/lab
wep.cpp
#include<bits/stdc++.h> using namespace std; string rc4(string plaintext, string key){ int S[256]; for(int i = 0; i < 256; i++) S[i] = i; int j = 0; int keylength = 8; for(int i = 0; i < 256; i++){ j = (j + S[i] + key[i%keylength])%256; S[i] += S[j]; S[j] = S[i] - S[j]; S[i] -= S[j]; } int i = 0; j ...
ALGO
0.999811
4.612334
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-04-11T20:27:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a09dba8f19...
877967d4-4959-4bcf-a716-83947394b2a9
ZiyanLai/C-for-Financial-Engineering
Level1/Level 1/Section 1.3/1.3.6/main.cpp
// // main.cpp // 1.3.6 // // Created by <NAME> on 5/27/20. // Copyright © 2020 <NAME>. All rights reserved. // Perform logical shift on an integer by two places to the right #include <stdio.h> int main() { int originalNumber; // declare the original number int shiftedNumber; // declare the shifted nu...
ALGO
0.94603
4.589436
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2020-05-28T03:48: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": "4d00db259...
855bc3c5-2098-42f1-afa9-986f3eee2664
TongariCorn/ADer
examples/LinearRegression.cpp
#include <iostream> #include <random> #include <vector> #include <algorithm> #include "../ader/variable.hpp" using namespace std; #define SAMPLE_NUM 30 int main() { random_device rnd; mt19937 engine(rnd()); // z = 2x + 3y - 10にN(0, 5)に従うノイズを乗せたサンプルを用意 uniform_real_distribution<> dist1(-10.0, 10.0);...
ALGO
0.999052
4.003734
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2019-09-03T05:59:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e2488baf6...
b5472d52-456b-495d-b27e-76568ece70c1
HarshCasper/NeoAlgo
C-Plus-Plus/cryptography/Homophonic_Cipher.cpp
#include<bits/stdc++.h> using namespace std; //Mapping one plain-text alphabet to more than one cipher-text alphabet. void mapping(vector<vector<char> > &code) { code[0].push_back('Q');code[0].push_back('4'); code[1].push_back('W'); code[2].push_back('E'); code[3].push_back('R'); code[4].push_back('T');code[4...
ALGO
0.999774
4.291663
{ "github_metadata": { "branch": "master", "commit_count": 7521, "repo_created_at": "2020-06-24T16:04:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 887, "forks": 1041, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1b...
7aa41754-9718-4df2-aed7-edab6104b25d
ishandutta2007/codeforces-m
mustang98/normal/787/D.cpp
#include <bits/stdc++.h> #define F first #define S second #define prev azaza #define mp make_pair #define pb push_back using namespace std; typedef long long ll; typedef long double ld; const int max_n = 100111; const ll inf = 1000111222LL * 1000111222LL; int n, q, s; vector<pair<int, int> > v[9 * max_n]; ll d[9 * m...
ALGO
0.999922
3.909901
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-06T01:03:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "107849649d80...
8307e7fe-5d59-4f46-8208-0b2db2bf0408
Hemantgithubpro/leetcode
Codeforces/Lists/TLE_Eliminators/900/24/soln.cpp
#include <bits/stdc++.h> using namespace std; // #define __gcd(a, b) gcd(a, b) typedef long long ll; void solve() { ll a, b; cin >> a >> b; // ig the difference is the maximum ans to achieve // gcd(a,b) = gcd(a-b,b) ll ans = abs(a - b); ll c = min(a, b); ll count = 0; if (ans > 0) ...
ALGO
0.999943
5.495535
{ "github_metadata": { "branch": "main", "commit_count": 236, "repo_created_at": "2025-03-06T19:40: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": "f738214f4d...
95780cfd-5cf9-4ee6-bc7e-7328da62f09f
ryuwldnjs/BOJ
백준/Gold/11780. 플로이드 2/플로이드 2.cc
#include <bits/stdc++.h> using namespace std; using ll=long long; using pii=pair<int,int>; using pll=pair<ll,ll>; const int INF = 1e9; struct Info{ int b, cost; }; vector<vector<int>> dist(105, vector<int>(105, INF)); vector<vector<Info>> graph(105); int n,m; void printPath(int s, int e){ vector<int> path; ...
ALGO
0.999998
4.182981
{ "github_metadata": { "branch": "main", "commit_count": 855, "repo_created_at": "2023-01-29T17:00: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": "e6f34daf7d...
b13ac45c-92ec-41d8-9bad-4c7577d702c1
AniketDGiri/DSA-with-CPP
Binary_Search/BS_on_Answers/Median-of-two-sorted-arrays.cpp
#include <iostream> #include <vector> #include <climits> using namespace std; class Solution { public: double OptimalApproach(vector<int> &nums1, vector<int> &nums2) { int n = nums1.size(); int m = nums2.size(); int totalSize = n + m; int i = 0, j = 0, cnt = -1, ele1, ele2, el...
ALGO
0.999995
5.1527
{ "github_metadata": { "branch": "main", "commit_count": 99, "repo_created_at": "2024-07-19T06:30: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": "4d275f50431...
9907baae-f4a1-4fae-b4c3-24c0cc33b1f9
FuHongbao/OJ_Code
278.cpp
/************************************************************************* > File Name: 278.cpp > Author: victoria > Mail: <EMAIL> > Created Time: 2019年08月16日 星期五 13时47分44秒 ************************************************************************/ #include <iostream> #include <algorithm> #include <string.h> using...
ALGO
0.999989
3.21054
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-10-02T11:25: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": "dab8b5330f...
a2dda336-60a3-4bc9-a2be-d32f93a660a7
SeanCampbell/WordAnalysis
vxl_src/contrib/brl/bpro/core/vil_pro/processes/vil_blob_detection_process.cxx
// This is brl/bpro/core/vil_pro/processes/vil_blob_detection_process.cxx #include <bprb/bprb_func_process.h> //: // \file #include <vil/vil_image_view.h> #include <vil/algo/vil_structuring_element.h> #include <vil/algo/vil_blob.h> #include <vil/algo/vil_binary_closing.h> #include <vcl_iostream.h> //: Constructor bo...
ALGO
0.940519
6.493453
{ "github_metadata": { "branch": "master", "commit_count": 67, "repo_created_at": "2016-02-16T04:49:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "204ef44c0...
e13e0c5a-ee0d-4105-9922-0c1b36560c6f
Marvelous-Software/Gateway
Structured programming/array.cpp
/*---------------------------------------------------------*/ /* Program chapter7_1 */ /* This program assigns a set of values to a */ /* one-dimensional array then prints a list of the array */ /* offsets and values to standard output. */ /*---------------------------------------------------------*/ #include <iostream...
TOOL
0.969246
3.996923
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2020-09-04T18:33: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": "e21474391...
51c7b750-1b50-462b-a6f2-bbc25ab6ed47
arangodb/arangodb
3rdParty/boost/1.78.0/boost/hana/fwd/unique.hpp
/*! @file Forward declares `boost::hana::unique`. @copyright <NAME> 2013-2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_HANA_FWD_UNIQUE_HPP #define BOOST_HANA_FWD_UNIQUE_HPP #include <boost/hana/config.h...
ALGO
0.960967
7.257557
{ "github_metadata": { "branch": "devel", "commit_count": 51986, "repo_created_at": "2011-10-26T06:42:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13878, "forks": 857, "issues": 743, "pull_requests": 38 }, "file_meta": { "content_id": ...
78356402-b5fe-4283-9f44-8a2fec1d33a3
Legend94rz/OJCodes
ACM/[USACO]Milk Measuring_Heuristics.cpp
/* ID: rz109291 PROG: milk4 LANG: C++ */ /* Given a Diophantine equation: \sum a_i * x_i = c, the Necessity and Sufficiency is: gcd(a_i)|c */ #include <iostream> #include <algorithm> #include <memory.h> #include <cstdio> using namespace std; int Q, P; int v[150]; bool use[150]; int ans[150], K; bool f[25000]; int cm...
ALGO
0.999805
3.289892
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2018-10-21T07:29: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": "74f5f48fc...
711ea312-e25d-4692-8ec9-3240f8b668de
TabotCharlesBessong/AlgorithmicPattern
divide_and_conquer/beautiful_array/solution.cpp
#include <iostream> #include <vector> using namespace std; vector<int> beautifulArray(int n) { if (n == 1) return {1}; vector<int> odd = beautifulArray((n + 1) / 2); // Solve for odd indices vector<int> even = beautifulArray(n / 2); // Solve for even indices vector<int> result; for (int x : odd) ...
ALGO
0.999841
5.235919
{ "github_metadata": { "branch": "master", "commit_count": 108, "repo_created_at": "2024-12-22T12:32:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "d28772aa...
3c63f049-7128-4667-bde4-79e0c4f19c4b
BaoTrung37/PTIT_Sources
SPOJ/P172PROH - ROUND 2H.cpp
// // Code By CodeWar :3 #include <bits/stdc++.h> #define pb push_back; typedef long long i64; const int mod = 1e9+7; using namespace std; string s; void input(){ cin >> s; } void solve(){ int cnt = 0; for(int i = 0 ; i < s.length() ;i++){ if(s[i] == 'c' && (s[i + 1] == '=' || s[i+1] == '-')){ ...
ALGO
0.999337
3.325256
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2020-06-10T16:51:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b775763af...
c6c6527f-8a5d-4c04-a1f9-0d0dc8b3075f
Nocte-/hexanoise
hexanoise/analysis.cpp
//--------------------------------------------------------------------------- // hexanoise/analysis.cpp // // Copyright 2014-2015, <EMAIL> Released under the MIT License. //--------------------------------------------------------------------------- #include "analysis.hpp" #include <algorithm> #include "node.hpp...
ALGO
0.995037
5.890653
{ "github_metadata": { "branch": "master", "commit_count": 100, "repo_created_at": "2014-04-01T13:32:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ca12e8f...
dd91de5c-7780-4709-9113-35c1598fa44a
Giordan0/URIOJ
Iniciante/2721.cpp
#include <iostream> using namespace std; int main() { int n, s = 0; for(int i = 0; i < 9; i++) { cin >> n; s += n; } switch(s%9){ case 1: cout << "Dasher" << endl; break; case 2: cout << "Dancer" << endl; break; case 3: cou...
ALGO
0.99982
3.765816
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2021-03-16T00:25: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": "3c96c995623...
7d380e93-31bb-4ddb-81a9-130b119c24dc
bacnx/VOI-Training
2020-12-02---KT-Thu-HSGQG-day2/domino.cpp
#include<bits/stdc++.h> using namespace std; typedef pair<int, int> pii; const int MAX = 502; const int dx[] = { -1, 1, 0, 0 }; const int dy[] = { 0, 0, -1, 1 }; int m, n; int a[MAX][MAX]; bool check(pii u, int i) { int x = u.first + dx[i] * 2; int y = u.second + dy[i] * 2; return 1 <= x && x <= m ...
ALGO
0.999906
4.357387
{ "github_metadata": { "branch": "master", "commit_count": 162, "repo_created_at": "2020-05-12T07:35:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7157512d...
8b3810d3-588f-45e3-a203-908e2dfcc521
WhiZTiM/coliru
Archive2/01/1636dba49df01d/main.cpp
#include <map> #include <iostream> #include <functional> #include <tuple> #include <iomanip> #include <utility> #include <unordered_map> #include <vector> using namespace std; template <typename T> class TD; struct NullType {}; template <int N> struct Disc { const static int value{N}; }; template <typename H, t...
ALGO
0.998993
4.387536
{ "github_metadata": { "branch": "master", "commit_count": 42630, "repo_created_at": "2016-04-21T16:34:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "366149...
f4b94bc8-900b-4b1f-997f-0535f0e629db
Pacific-salmon-assess/SalmonLRP_RetroEval
Code/Archive/Aggregate_LRPs_Hier_Surv_onlySR.cpp
#include <TMB.hpp> // Set up Lambert's W function to use to calculate SMSY // Code taken from https://kaskr.github.io/adcomp/lambert_8cpp_source.html // Step 1: Code up a plain C version // Double version of Lambert W function double LambertW(double x) { double logx = log(x); double y = (logx > 0 ? logx : 0); in...
ALGO
0.999858
6.544131
{ "github_metadata": { "branch": "master", "commit_count": 487, "repo_created_at": "2020-09-22T18:45:02.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 2, "issues": 5, "pull_requests": 0 }, "file_meta": { "content_id": "55fdcfac3...
f774ddf9-fb88-4fab-8c68-8b0baf796a94
ishandutta2007/codeforces-nonalphabetic
.o/normal/793/D.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <memory.h> #include <math.h> #include <assert.h> #include <stack> #include <queue> #include <map> #include <set> #include <algorithm> #include <string> #include <functional> #include <vector> #include <deque> #include <utility> #include <bitset> #inclu...
ALGO
0.999935
3.556318
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:49:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9610407d743d...
2566f83a-b80c-4c8f-b1c9-34127c59faa5
ShubhamKumaR-96/DSA_Question
Advance DSA/Sorting/SortedArray.cpp
// Given an array A[N] // Array A is sorted from x => x-y-1 // sorted from y => y - z we need to find x - z sorted array // Arr = 8 1 3 6 11 2 4 9 7 6 #include <iostream> #include <vector> using namespace std; void mergebwArr(vector<int> &v, int x, int y, int z) { int p1 = x, p2 = y; int temp[z - x + 1], p3 =...
ALGO
0.999972
5.148016
{ "github_metadata": { "branch": "main", "commit_count": 49, "repo_created_at": "2024-07-15T05:21:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4642729cc0b...
14ea3545-ae43-4d2e-aee4-263864e7c6e5
Satyam230ct/CP-template
String-Algos/Z-algo.cpp
// z[i] Gives us the max prefix match value of from index i // We can find max Prefix palindrome // good = s + '$' + reverse(s) then the longes prefix is i+z[i]==n vector<int> z_algo(string const &s) { vi z(n,0); z[0]=0; // As we know don't have any meaning for 0th index int l=0,r=0; for(int i=1;i<n;i+...
ALGO
0.999156
4.069276
{ "github_metadata": { "branch": "main", "commit_count": 80, "repo_created_at": "2021-09-08T00:42: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": "b4425bd6725...
c96f7a9b-1c25-4cc9-bdca-92a789c803fe
rummanqadir/PDC_Final_Project
functions.h
#include <iostream> #include <vector> #include <array> #include <cstdint> #include <numeric> #include <mpi.h> #include <unordered_map> #include <omp.h> vector<unsigned char> Swap(const vector<unsigned char>& v, int x, const vector<int>& inv) { int n = v.size(); int i = inv[x]; if (i >= 0 && i + 1 < n) { ...
ALGO
0.999928
4.425539
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-05-06T18:12: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": "074d1ca5d6ed...
842365d5-f9f4-4692-8915-f1ccf6d236f4
zixiao-bios/LeetCode
other/class_test1.cpp
/** Alice 的烦恼 Description Alice 是某大厂的程序员, 由于年龄到了35岁面临被裁员, 他准备去广场摆摊卖烤冷面. 为了控制成本, Alice 买了 nnn 根散装火腿肠作为重要原料. 这就带来了一个问题, 由于生产流程不够标准化, 火腿肠的长度各不相同. 为了保证买卖公平, 明码标价, 现在 Alice 准备把这些火腿肠切成等长的 mmm 份, 为了保证口感, 他还同时希望每一份的长度越长越好, 你能写出一个算法帮他算出每一份的最大长度吗? Input 输入的第一行为两个正整数 n,m∈[1,10000]n, m \in [1,10000]n,m∈[1,10000], 分别代表火腿肠的总数以及...
ALGO
0.99997
4.688671
{ "github_metadata": { "branch": "master", "commit_count": 250, "repo_created_at": "2022-02-27T05:58: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": "8491895f...
e350975a-8c29-4cc3-a9b2-5e0fd111eb0b
ArcherSore/codeforces
Codeforces Round 972 (Div. 2)/C_Lazy_Narek.cpp
// #pragma GCC optimize("O3,unroll-loops") // #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include <iostream> #include <vector> #include <cstring> #include <algorithm> #include <queue> #include <cmath> #include <numeric> #include <stack> #include <set> #include <map> using namespace std; using LL = long long; us...
ALGO
0.999879
5.225471
{ "github_metadata": { "branch": "main", "commit_count": 171, "repo_created_at": "2024-02-15T14:27:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "263cddad2f...
f06ce121-a2f6-4cf0-a2a1-9e6f893765e7
naveen-21tyagi/PSCP-Lab
assignment5/Q5.cpp
//862041_<NAME>_Section F #include<iostream> using namespace std; int main(){ cout<<"862041_<NAME>\n"; int n,in,pos; cout<<"Enter number of elements in array: "; cin>>n; //n store number of elements of array the user will enter int arr[n+1]; //declaration of array of size one greater than n ...
ALGO
0.999683
4.191514
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2021-12-17T07:03: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": "db831d5db2ac...
4e91c268-4aa3-48ae-945f-fcbd242a89d1
cg-tuwien/StatMC
src/display/pbrt/util/bluenoise.h
// pbrt is Copyright(c) 1998-2020 <NAME>, <NAME>, and <NAME>. // The pbrt source code is licensed under the Apache License, Version 2.0. // SPDX: Apache-2.0 /* This file contains modifications to the original pbrt source code for the paper "A Statistical Approach to Monte Carlo Denoising" (https://www.cg.t...
ALGO
0.982301
5.986135
{ "github_metadata": { "branch": "master", "commit_count": 743, "repo_created_at": "2025-01-30T10:48:40.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 14, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6bcef1db...
2427833f-47a1-403c-868d-bae22ddd6d2e
lhtrong/SearchEngine
Header.h
#pragma once #define _CRT_SECURE_NO_WARNINGS #include "dirent.h" #include <iostream> #include <cstdio> #include <io.h> #include <fcntl.h> #include <windows.h> #include <codecvt> #include <locale> #include<fstream> #include <stack> #include <wchar.h> #include <corecrt_wstring.h> #include <regex> #include <iterator> #inc...
TOOL
0.997082
3.400254
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-02-25T16:47: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": "7abe6e8fc92c...
dd4eacd1-d4ac-4548-8674-82bad5b2f4d9
ChantalDE/dailyCodingProblem
arrays/product.cpp
//Get the product of the array for each element, not including the element itself #include <iostream> using namespace std; int* productD(int input[], int size); int* productWD(int input[], int size); //fucntion W/ Division int* productD(int input[], int size){ int product = 1; for (int i = 0; i < size; i++){...
ALGO
0.999846
4.790998
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2021-07-22T20:13:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fd6f5048d82...
f7631932-9e19-4594-80d3-95b45026216a
gaojs/algorithm
leetcode/clang/932. 漂亮数组.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> // 利用分治思想(Divide-and-Conquer),找出一种放法。 // 奇数靠左,偶数靠右。a是个数组,n是数字元素的个数; // 将n1开始,步长为step的数字,放到p1到p2的连续的位置上。 void dc(int *a, int n, int p1, int p2, int n1, int step) { if (a == NULL || n <= 0 || p1 >=n || p2 >=n || p1 > p2) { return; // 参数不对 } else if (p1 == ...
ALGO
0.999893
4.031628
{ "github_metadata": { "branch": "master", "commit_count": 262, "repo_created_at": "2019-11-05T00:14:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "99109652...
e4408232-0333-4a59-9ae4-19a8d6ed6a6a
nagygeri97/AdventOfCode
2017/21/main.cpp
#include <iostream> #include <vector> #include <utility> #include <algorithm> #include <cmath> using namespace std; vector<string> patternFrom; vector<string> patternTo; int size = 3; vector<string> oldk = {".#.","..#","###"}; void first(){ string from,to; while(cin >> from >> to){ //cout << from <<" "<< to <<...
ALGO
0.999839
3.720041
{ "github_metadata": { "branch": "master", "commit_count": 158, "repo_created_at": "2017-12-22T20:31: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": "2013f74e...
77b46240-9c96-48cd-b4d0-ea3e355ad323
GRHayL/GRHayLET
GRHayLHDX/src/compute_ccc_centered_spacetime_quantities.cxx
#include "GRHayLHDX.h" extern "C" void GRHayLHDX_compute_ccc_centered_spacetime_quantities(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTSX_GRHayLHDX_compute_ccc_centered_spacetime_quantities; DECLARE_CCTK_PARAMETERS; constexpr std::array<int, Loop::dim> indextype = {1, 1, 1}; const Loop::GF3D2layout layout(cctkGH, ...
ALGO
0.99948
5.48071
{ "github_metadata": { "branch": "main", "commit_count": 209, "repo_created_at": "2023-06-29T05:34:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "79a8744cbdb...
61fb4f09-39b5-47eb-bcf9-9ec96f044552
Domagoj2002/Analiza_metagenomskog_uzorka_na_temelju_distribucije_k-mera-23-24
main.cpp
#include <iostream> #include <string> #include <cmath> #include <vector> #include <map> #include <memory> #include <fstream> #include <stdexcept> #include <regex> #include <filesystem> #include <random> #include <functional> #include <cstdlib> #include "bioparser/fasta_parser.hpp" using namespace std; namespace fs ...
DATA
0.995778
4.784134
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2024-04-05T07:24: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": "cc041f4a0e5...
029cda18-609c-43dc-b993-eaf065f8aeaf
Prathamkolettiwar/DSA
assign2.cpp
/* Assignment 2: Consider Employee database of PCCOE (at least 20 records). Database contains different fields of every employee like EMP-ID, EMP-Name and EMP-Salary. a. Arrange list of employees according to EMP-ID in ascending order using Quick Sort b. Arrange list of Employee alphabetically using Merge Sort ...
ALGO
0.996993
4.771062
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-10-10T09:26: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": "055cc8bee610...
211834fb-d64f-4100-ade0-c3fb18925344
yancouto/competitive-programming
ojs/timus/1065.cpp
#include <bits/stdc++.h> using namespace std; double dist[52][52]; bool seen[52][52]; int n, m; int x[1100], y[1100]; double memo[52][52]; int cross(int i, int j, int k) { return (x[j] - x[i]) * (y[k] - y[i]) - (y[j] - y[i]) * (x[k] - x[i]); } bool bad(int i, int j) { for(int p = 0; p < m; p++) if(cross(i, j, p +...
ALGO
0.999989
4.230527
{ "github_metadata": { "branch": "master", "commit_count": 143, "repo_created_at": "2016-08-26T11:17:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "edc53599...
b63f901b-f8ad-4c9f-a74a-c5672edee8fa
Prateek-5/Leetcode-Problems
LinkedList-Problems/92-Reverse-Linked-List-II.cpp
/* Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right, and return the reversed list. Example 1: Input: head = [1,2,3,4,5], left = 2, right = 4 Output: [1,4,3,2,5] Example 2: Input: head = [5], left = 1, ri...
ALGO
0.999996
6.002858
{ "github_metadata": { "branch": "main", "commit_count": 161, "repo_created_at": "2024-02-07T20:06: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": "62a7c32c1c...
a15d43ba-fad2-4776-8c28-e5c9003c7620
Gal2o/Algo_Study
AlgoStudy/1915 가장 큰 정사각형.cpp
//#include <bits/stdc++.h> // //#define mx 1001 //using namespace std; //typedef pair<int, int> pl; // //char input; //int n, m, answer, cnt; //int arr[mx][mx], dp[mx][mx]; // //// 많이 안 접해본 문제 //int main() { // cin >> n >> m; // // for (int i = 1; i <= n; i++) { // for (int j = 1; j <= m; j++) { // ...
ALGO
0.999978
4.127671
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2021-04-05T13:46: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": "3e6a9b973...
8119b171-a499-4b86-95a1-b7570e28b96e
contaconta/neurons
c++/tools/cube/cubeDecimateAcrossScales.cpp
///////////////////////////////////////////////////////////////////////// // This program is free software; you can redistribute it and/or // // modify it under the terms of the GNU General Public License // // version 2 as published by the Free Software Foundation. // // ...
DATA
0.976088
4.548594
{ "github_metadata": { "branch": "master", "commit_count": 1446, "repo_created_at": "2015-07-29T07:17:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e679718...
24d269f7-239d-4281-ae8f-3d6f49f5bcd7
YoonJihwan39/Algorithms-BOJ
Simulation/16235 나무 재테크.cpp
#include<iostream> #include<deque> #include<algorithm> using namespace std; int N, M, K; int A[11][11]; int land[11][11]; deque<int> dq[11][11]; int total_tree = 0; int dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}; int dy[8] = {1, 1, 0, -1, -1, -1, 0, 1}; void one_year(){ //spring&summer for(int i = 1; i <= N; i++){ ...
ALGO
0.99991
4.314135
{ "github_metadata": { "branch": "master", "commit_count": 171, "repo_created_at": "2019-03-31T10:38: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": "1d575b4c...
ecdb625f-247f-4c8f-bf78-49207f620579
mjb236/Programming_Work
CCAC/C Programming/Assignments/c7.cpp
/* <NAME> CIT 145 Chapter 7 Assignment Dev-C++ 4.9.9.2 */ #include <stdio.h> #include <stdlib.h> #define MAX 50 /* mystery function to implement and test */ int mystery(const char *s1, const char *s2); int main(void) { /* pointer variables for char arrays */ char *s1, *s2; /* character array...
ALGO
0.952169
4.100808
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2016-05-03T21:55: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": "590b645d90...
60728610-2690-4070-8e01-05e7b03b8e69
buitanphat247/C-Algorithm
so_hoc/primatr.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define usl unsigned long long #define ld long double #define pb push_back #define is insert #define fs first #define sc second vector<long long>prime; const long long nmax=1e7; bool isPrime(int num) { if (num < 2) return false; if (num =...
ALGO
0.999995
4.126675
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-02-18T18:44: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": "eaf9e75b79...
06f1e78a-00be-4a58-ac79-cbc90f425d82
TheGeekiestOne/Coursera-Data-Structures-and-Algorithms-Specialization
Course 4 - Algorithms on Strings/assignment 2/bwmatching/bwmatching.cpp
/* * Coursera/Algorithms on Strings/Week 2/Problem 3: * Implement Better Burrows–Wheeler Matching * * Author: <NAME> @ The Geekiest One * Site: http://ayran.dev * Respect Coursera Honor Code * Copyright © 2019. All rights reserved * */ #include <algorithm> #include <iostream> #include <vector> // Preprocess...
ALGO
0.999636
5.925927
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2019-06-10T08:56:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 165, "forks": 70, "issues": 1, "pull_requests": 2 }, "file_meta": { "content_id": "3a26e5...
aa1f386c-3fd6-4faf-b932-9b6736ccdbd2
nokotan8/coding-practice
leetcode/2_medium/0684_redundant_connection.cpp
#include <vector> class union_find { public: union_find(int n) { root.resize(n); height.resize(n, 1); for (int i = 0; i < n; i++) { root[i] = i; } } int find(int node) { int node_parent = root[node]; while (root[node_parent] != node_parent) { ...
ALGO
0.999973
5.948961
{ "github_metadata": { "branch": "main", "commit_count": 200, "repo_created_at": "2025-04-30T05:34: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": "79c9a7045f...
80ebd4d7-e4d9-4fa5-9bec-b4065c1751fe
kai-wei-kfuse/vscode
2022/202209/20220906/D.cpp
#include <algorithm> #include <iostream> #include <map> using namespace std; int main() { int t; cin >> t; int ca = 1; while (t--) { int n; cin >> n; map<int, int> mp; int tmp; for (int i = 1; i <= n; i++) { cin >> tmp; mp[tmp]++; }...
ALGO
0.999673
3.490403
{ "github_metadata": { "branch": "c++", "commit_count": 42, "repo_created_at": "2023-03-25T03:45:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ad750b717705...
d9bad5ca-08c2-4998-bcdb-abccfd890abb
alexandraback/datacollection
solutions_1482494_1/C++/Nia159630/solution.cpp
#include <stdio.h> #include <algorithm> using namespace std; struct Level { int a, b; }; bool cmp (Level a , Level b) { return a.b < b.b; } int main () { int T, tt, n, i, sc, rem, times, d, p; int finished[1000]; Level req[1000]; freopen ("B-large.in" , "r" , stdin); freopen ("output.txt" , "w" , stdout); sc...
ALGO
0.999856
3.348406
{ "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": "7a0525f30...
1400c075-d9b5-43f0-a437-fd2bbdd5db4d
personalrobotics/aikido
include/aikido/trajectory/BSpline.hpp
#ifndef AIKIDO_TRAJECTORY_BSPLIINE_HPP_ #define AIKIDO_TRAJECTORY_BSPLIINE_HPP_ #include "aikido/common/BSpline.hpp" #include "aikido/common/pointers.hpp" #include "aikido/distance/DistanceMetric.hpp" #include "aikido/statespace/StateSpace.hpp" #include "aikido/trajectory/Trajectory.hpp" namespace aikido { namespace ...
ALGO
0.993286
7.364099
{ "github_metadata": { "branch": "master", "commit_count": 1271, "repo_created_at": "2015-04-23T00:33:33.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 223, "forks": 30, "issues": 95, "pull_requests": 4 }, "file_meta": { "content_id": "f2b0...
5c080450-b356-4f36-b5f7-a8f31c90298c
sssn-tech/Algorithm-Problem-Set
solutions/leetcode/127.单词接龙.cpp
/* * @lc app=leetcode.cn id=127 lang=cpp * * [127] 单词接龙 */ // @lc code=start class Solution { public: int ladderLength(string beginWord, string endWord, vector<string>& wordList) { unordered_set<string> dict(wordList.begin(), wordList.end()); if (!dict.count(endWord) && beginWord != endWord) ...
ALGO
0.999982
6.013771
{ "github_metadata": { "branch": "main", "commit_count": 238, "repo_created_at": "2025-03-24T09:49:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71f95d7a34...
e7b997a7-5686-4b14-8282-e4c75f012122
borglab/gtsam
gtsam/3rdparty/Spectra/LinAlg/DoubleShiftQR.h
// Copyright (C) 2016-2025 <NAME> <<EMAIL>> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at https://mozilla.org/MPL/2.0/. #ifndef SPECTRA_DOUBLE_SHIFT_QR_H #define SPECTRA_DOUBLE_SHIFT_QR_H #...
ALGO
0.996743
6.438156
{ "github_metadata": { "branch": "develop", "commit_count": 19360, "repo_created_at": "2017-03-27T17:12:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3002, "forks": 845, "issues": 99, "pull_requests": 25 }, "file_meta": { "content_id": ...
7b1f8ea1-4fdf-4d08-bfab-24ec3cc76754
tanaygup/DSA
codeforces/angrymonk.cpp
#include <iostream> #include <vector> #include <queue> #include <functional> using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int t; cin >> t; while (t--) { int n, k; ...
ALGO
0.999963
4.088404
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-07-05T14:15: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": "cdbe162505f5...
79008107-ad85-4bad-9240-a9b2d08fbb49
techteak/QtDes
main.cpp
#include <iostream> #include <string.h> #include <time.h> #include "qt_des.h" using namespace std; int main() { cout << "DES Encryption" << endl; cout << "Author:fujingjing " << endl << endl; clock_t start, stop; char sKey[] = "<KEY>"; const char sSrc[1024] = "China Mobile (Shenzhen) Limited 中国...
ALGO
0.997192
3.106237
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2013-06-14T06:44: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": "508d1bf765...
a5cab03c-790f-40c9-9b5d-77feb2850abd
CGAL/cgal
Mesh_3/include/CGAL/Mesh_3/min_dihedral_angle.h
// Copyright (c) 2007-2009 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org). // // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : <NAME>, <NAME> #ifndef CGAL_MESH_3_MIN_DIHEDRAL_ANGLE_H #define CGAL_ME...
ALGO
0.996163
6.13307
{ "github_metadata": { "branch": "master", "commit_count": 113659, "repo_created_at": "2014-10-01T12:22:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5443, "forks": 1475, "issues": 511, "pull_requests": 136 }, "file_meta": { "content_id...
45c3ddb3-8089-4858-99a5-0783e93281e7
tiankonguse/ACM
contest/TheWaySoFar-Training/2013-Jakarta/J.cpp
#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; const int MAXN=1000010,N=1000000; int tree[MAXN*5][4],lazy[MAXN*5][4]; char a[10]; const int P=1000000007; int solve(int k,int m,int n,int mark,int x){ long long b=n,c=m-1; if (mark==0) b=(b-c+P)%P; else...
ALGO
0.999742
4.56577
{ "github_metadata": { "branch": "master", "commit_count": 185, "repo_created_at": "2013-03-25T04:04:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 69, "forks": 40, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e5661e...
40710a1a-e025-4bc0-bd5a-df5bd657d3d6
Mr-Tony921/xju-autopilot
pnc/common/filter/digital_filter.h
/****************************************************************************** * Copyright 2023 The XJU AutoPilot Authors. All Rights Reserved. *****************************************************************************/ #pragma once #include <deque> #include <vector> #include <cmath> #include "common/logger/lo...
ALGO
0.991472
6.746136
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-09T06:08:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fab9e8ea4d9...
f4d295f7-5111-4085-9119-b492381f893e
Sue-Shudan-Deng/CPP-Practice
submissions/search-in-rotated-sorted-array-ii/Accepted/11-9-2020, 4:52:50 PM/Solution.cpp
// https://leetcode.com/problems/search-in-rotated-sorted-array-ii class Solution { public: bool search(vector<int>& nums, int target) { // https://www.youtube.com/watch?v=e-UALGfQpOk // 解决方法居然是删除掉后面的元素即可 if (nums.size() == 0) { return false; } ...
ALGO
0.999997
6.600413
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-09-05T02:18: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": "2b197d9ec6...
a7e1cc0d-d3db-4e97-ad55-d1349fc7fde6
zhang-chuanfeng/cpplanguage
container_check.cpp
#include <iostream> #include <string> #include <vector> #include <list> #include <type_traits> #include <iterator> #include <algorithm> // 为 std::sort 添加头文件 // 主模板 - 用于检测是否有 begin() 和 end() 方法 template<typename T, typename = void> struct HasBeginEnd : std::false_type {}; // 特化版本 - 当类型T有begin()和end()方法时 template<type...
TEST
0.97096
6.314715
{ "github_metadata": { "branch": "master", "commit_count": 63, "repo_created_at": "2023-12-27T14:18: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": "e6bf1191d...
96df3463-4c72-4aae-904b-6381f2f3ae75
ncu571633/code
leetcode/34SearchforaRange.cpp
Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the order of O(log n). If the target is not found in the array, return [-1, -1]. For example, Given [5, 7, 7, 8, 8, 10] and target value 8, return [3, 4]. class Solution {...
ALGO
0.999996
5.941632
{ "github_metadata": { "branch": "main", "commit_count": 1113, "repo_created_at": "2014-02-21T00:40: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": "ee8300faf...
dc089397-7185-4a89-a008-5d5ce8ee29cd
GheoC/Structuri-de-Date
008_Tema_04/005_Problema05.cpp
///* Codificarea Huffmnan (5p) //* //* Se citeste un text dintr-un fisier. Sa se construiasca arborele de codificare Huffman. //* Sa se afiseze codul corespunzator fiecarui caracter si sa se codifice textul. //* Utilizati o coada de prioritate. //*/ // //#include<iostream> //#include<fstream> //#include<vector> //#incl...
ALGO
0.99901
3.510815
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2021-05-16T14:55: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": "e3cb24f6a...
c0040697-a203-4fb8-88ec-26c3b5050fab
MunoLike/KyoPro
abc267/b/main.cpp
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using i32 = int32_t; using i64 = int64_t; using u32 = uint32_t; using u64 = uint64_t; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(a) (a).begin(), (a).end() const i32 dy[] = {-1, 0, 1, 0, -1, -1, 1, 1}; const i32 dx[] = {0, 1, 0, ...
ALGO
0.999989
4.272336
{ "github_metadata": { "branch": "master", "commit_count": 82, "repo_created_at": "2024-08-19T13:48:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "a4a2b1968...
0f6b9090-d2d1-434c-935f-72968974ff33
Argus-66/Artificial-Intelligence_Assignments
Ghosh/assgn3_jobscheduling.cpp
#include <bits/stdc++.h> using namespace std; struct Job { char id; int deadline; int profit; }; bool compare(Job a, Job b) { return a.profit > b.profit; } void jobScheduling(vector<Job>& jobs) { sort(jobs.begin(), jobs.end(), compare); int n = jobs.size(); vector<char> schedule(n, '-')...
ALGO
0.999963
4.938337
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-05-08T18:49: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": "85945c238ea5...
cc0941ef-0802-46ec-a7ba-ef4865f154d8
runner365/LiveVideoCoreSDK
RtmpLivePushSDK/boost/boost/random/discrete_distribution.hpp
/* boost random/discrete_distribution.hpp header file * * Copyright <NAME> 2009-2011 * 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) * * See http://www.boost.org for most recent version including documentatio...
ALGO
0.93186
7.035652
{ "github_metadata": { "branch": "master", "commit_count": 59, "repo_created_at": "2016-03-03T09:29:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2057, "forks": 595, "issues": 15, "pull_requests": 0 }, "file_meta": { "content_id": "586...
10b12c6a-9a71-42eb-907c-136c22ea9c68
HarshBamotra/My_personal_files
Semester-II/Descreate structures/Programs_DS/FInal_DS_Practical.cpp
//<NAME> AC-1216 //Program to create a set class find the complement of set #include <iostream> using namespace std; class SET { private: //declaring private members int n; int a[100]; public: //declaring public members void input(int l) //defining function to input a set { ...
ALGO
0.962886
3.920541
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2021-02-01T07:05:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4aa3decda...
34cfe55d-524a-4a0b-bddd-732ba4accee9
DavinderSinghKharoud/AlgorithmsAndDataStructures
CSESProblemSet/treeDistanceII.cpp
#include<bits/stdc++.h> const double pi=acos(-1.0); using namespace std; #define endl '\n' #define sl(n) scanf("%lld",&n) #define mp make_pair #define pb push_back #define ppb pop_back #define fi first #define se second #define ll long long #define ull unsigned ...
ALGO
0.999868
3.507074
{ "github_metadata": { "branch": "master", "commit_count": 1507, "repo_created_at": "2019-12-22T03:07:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c7049aa...
964ca8bf-f4e0-4697-9f30-4d6ce41dcaff
w-ymir/PAT
Basic/1002/Source.cpp
#include <iostream> #include <string> #include <vector> #include <sstream> using namespace std; const vector<string> digitInPinyin = { "ling", "yi", "er", "san", "si", "wu", "liu", "qi", "ba", "jiu" }; // Calculate the sum of digits in string. int strDigitSum(string s) { int sum = 0; for (size_t i = 0; i < s.size(...
ALGO
0.999356
4.490493
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2018-03-02T06:14: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": "b900a65015...
1c81ab32-57d5-4a53-b8bf-321658bad63c
ishandutta2007/codeforces-h
hloya_ygrt/normal/768/D.cpp
// hloya template v24 // // // // // // // // // // // #include <bits/stdc++.h> #include <valarray> using namespace std; bool dbg = 0; clock_t start_time = clock(); #define current_time fixed<<setprecision(6)<<(ld)(clock()-start_time)/CLOCKS_PER_SEC #define f first #define s second #define mp make_pair ...
ALGO
0.999626
3.542879
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T02:01: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": "acf500e9ce39...
237a67dd-b8a7-4537-8e7a-9272dac2ce02
Jeong-Je/baekjoon-algorithm
백준/Gold/2110. 공유기 설치/공유기 설치.cc
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int N, C; cin >> N >> C; vector<int> X(N+1); for(int i=1;i<=N;i++){ cin >> X[i]; } sort(X.begin(), X.end()); // 우선 정렬 (x축에 일렬로) int right = X[N] - X[1]; // 가잔 먼 거리 in...
ALGO
0.999996
4.418798
{ "github_metadata": { "branch": "main", "commit_count": 412, "repo_created_at": "2023-05-04T13:47: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": "6326cd5bfc...
bd9eb200-3e09-404d-a9e8-90c9a7caf8fa
zhengry22/basics_of_programming
repos/P1026_luogu/P1026_luogu.cpp
#include<iostream> #include<vector> #include<string> using namespace std; vector<string> mes, word, words; string art; int cnt[7][201], start[7][201]; int total[201], bool sliced[201]; void deduplicate() { vector<int> redun; for (int i = 0; i < word.size(); i++) { for (int j = i + 1; j < word.size(); j++) { if...
ALGO
0.999783
3.720115
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-02-19T03:49: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": "ecab346a67da...
bf7ae5e0-9d64-4214-b21e-1267fe7e9270
clatisus/ACM-ICPC-Team-Archive
zhongzihao-personal/codeforces/472/E.cpp
#include<bits/stdc++.h> const int N = 10010; typedef std::pair <int, int> pii; int a[N], x[N], dp[N]; pii p[N]; int main(){ int n, l, r; scanf("%d%d%d", &n, &l, &r); int sum = 0; for (int i = 0; i < n; ++ i){ scanf("%d", &a[i]); sum += a[i]; } for (int i = 0; i < n; ++ i){ scanf("%d", &x[i]); p[i] = {x...
ALGO
0.999915
3.906237
{ "github_metadata": { "branch": "master", "commit_count": 577, "repo_created_at": "2018-06-11T16:19:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b186a4e2...
dbb46ef5-cf37-41e4-b0ea-e41cca308f9f
junluan/shadow
shadow/operators/kernels/binary.cpp
#include "binary.hpp" #include <cmath> namespace Shadow { namespace Vision { inline float Binary(float a, float b, int operation) { switch (operation) { case kAdd: return a + b; case kSub: return a - b; case kMul: return a * b; case kDiv: return a / b; case kPow: ...
TOOL
0.980629
7.672476
{ "github_metadata": { "branch": "master", "commit_count": 654, "repo_created_at": "2016-03-22T05:40:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 15, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9dc1b78...
b43fd79b-e887-4337-be85-b1c26dacce65
shahzad2615/Recursion-In-dsa
recusion.cpp
// print n to 1 using recursion #include <iostream> using namespace std; void print_numbers(int i,int n){ if(i<1){ return; } // cout<<i<<endl; print_numbers(i-1,n); cout<<i<<endl; } int main(){ int n=6; print_numbers(n,n); return 0; } // print 1 to n using backtrac...
ALGO
0.999589
5.176739
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-10-01T13:00:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ed927552eef3...
ef495701-cf1c-4b19-84a6-c0b4868f1410
ishandutta2007/codeforces-k
komendart/normal/234/C.cpp
#include <iostream> #include <vector> #include <cstdio> using namespace std; int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } vector<int> pr(n, 0); vector<i...
ALGO
0.999979
3.884675
{ "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": "d80d15860171...
a46b1543-fae7-4a8e-a635-8bc0f1062e98
utexas-bwi/bwi_common
bwi_kr_execution/src/learning/SarsaActionSelector.cpp
/* This algorithm is an implementation of * * Seijen, <NAME>., and <NAME>. "True Online TD (lambda)." * Proceedings of the 31st International Conference on Machine Learning (ICML-14). 2014. * */ #include "SarsaActionSelector.h" #include "DefaultActionValue.h" #include "RewardFunction.h" #include <actasp/AspKR...
ALGO
0.999842
6.139506
{ "github_metadata": { "branch": "master", "commit_count": 774, "repo_created_at": "2013-11-29T03:26:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 20, "forks": 32, "issues": 13, "pull_requests": 3 }, "file_meta": { "content_id": "4d1dbd...
162c94a8-67cc-408d-bc77-d9fd17c7bc8f
Jinqiang/demo_lidar
isamlib/numericalDiff.cpp
/** * @file numericalDiff.cpp * @brief Numerical differentiation. * @author <NAME> * @version $Id: numericalDiff.cpp 4038 2011-02-26 04:31:00Z kaess $ * * Copyright (C) 2009-2013 Massachusetts Institute of Technology. * <NAME>, <NAME>, <NAME>, * <NAME> and <NAME> * * This file is part of iSAM. * * iSAM is f...
ALGO
0.995887
6.208347
{ "github_metadata": { "branch": "master", "commit_count": 73, "repo_created_at": "2014-09-12T10:53:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 265, "forks": 242, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1496b...
24131d46-e452-4165-8751-eb47c1b8e835
OpenDigitalTwin-Dev/FENGSim
toolkit/Geometry/gmsh/Solver/convexCombinationTerm.h
// Gmsh - Copyright (C) 1997-2016 <NAME>, <NAME> // // See the LICENSE.txt file for license information. Please report all // bugs and problems to the public mailing list <<EMAIL>>. #ifndef _CONVEX_COMBINATION_TERM_H_ #define _CONVEX_COMBINATION_TERM_H_ #include <assert.h> #include "femTerm.h" #include "simpleFunctio...
ALGO
0.928477
3.956394
{ "github_metadata": { "branch": "main", "commit_count": 1345, "repo_created_at": "2021-12-22T12:15:26.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 54, "forks": 15, "issues": 4, "pull_requests": 2 }, "file_meta": { "content_id": "224ffe17...
0dfd0915-33de-4d32-842b-f8d9050a0225
cyscgzx33/Leetcode-Practice
Algorithm_in_topics/binary_tree/binary_search_tree_iterator.cpp
/** * Definition of TreeNode: * class TreeNode { * public: * int val; * TreeNode *left, *right; * TreeNode(int val) { * this->val = val; * this->left = this->right = NULL; * } * } * Example of iterate a tree: * BSTIterator iterator = BSTIterator(root); * while (iterator.hasN...
ALGO
0.999974
5.785881
{ "github_metadata": { "branch": "master", "commit_count": 266, "repo_created_at": "2018-08-31T18:59:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7d10c142...
6f604687-d695-4e4f-8dad-033fbfe3e13b
alexandraback/datacollection
solutions_5708284669460480_1/C++/MatCauthon/b.cpp
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <string> #include <cstring> #include <map> using namespace std; int longest_suffix(string s) { std::vector<int> v(s.size(),0);; v[0] = -1; v[1] = 0; for (int pos = 2,i=0; pos < s.size();) { if (s[pos-1]==s[i]) { i++; ...
ALGO
0.997304
3.307064
{ "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": "3cdd8bd3e...
39302336-f11b-4d17-8d99-d605b350b641
OsipovMax/ParallelProgrammingCourse
PracticalTask1/createC0.cpp
#include <vector> #include <fstream> #include <iostream> #include <boost\numeric\ublas\matrix.hpp> int main(int argc,char* argv[]) { boost::numeric::ublas::matrix<double> Ad; boost::numeric::ublas::matrix<float> Af; boost::numeric::ublas::matrix<double> Bd; boost::numeric::ublas::matrix<float> Bf; int n, m; cha...
ALGO
0.996682
3.722616
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2018-09-23T09:48: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": "6c7e86fbe...
2a589802-c3d2-4d19-ba56-32e68749f4d9
ammarali32/LAB3
MPIfirst/MPIfirst/MPIfirst.cpp
#include<iostream> #include<math.h> #include<chrono> #include<fstream> #include"mpi.h" #include<stdio.h> #include<stdlib.h> #include<algorithm> #define MAX 1000005 using namespace std; int LOM_PARTITION(int* A, int l, int r) { int pi = A[r]; int j = l - 1; for (int i = l; i < r; i++) { if (A[i] <= pi) { j++; ...
ALGO
0.997199
3.926531
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-03-26T13:36: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": "d437e71cf9...
9175b33e-5498-4c5b-9b9d-bd72dc5fb1e6
RafaelChavesPB/CompetitiveProgramming
codeforces_Weights_division.cpp
#include <bits/stdc++.h> #define ll long long #define pl pair<ll,ll> #define tl pair<ll,pl> using namespace std; vector<vector<pl>> adj; priority_queue<tl> pq; ll total; int dfs(int p, int v){ int qft=0; if(adj[v].size()==1 and adj[v].front().first==p) return 1; for(auto i : adj[v]){ if(i.f...
ALGO
0.999934
3.718241
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2021-08-18T19:49: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": "5f35f732ed...
5c0893e5-9ed1-4db2-82bf-9eca39af8df0
AMIRIOX/MyLuoguRepo
contest/ABC-386/E.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; void solve() { ll n, k, ans = 0; cin >> n >> k; vector<ll> a(n + 1); for(ll i = 1; i <= n; i++) cin >> a[i]; auto dfs = [&](auto self, ll idx, ll rem, ll val) { if(rem == 0) { ans = max(ans, val); re...
ALGO
0.999986
5.111506
{ "github_metadata": { "branch": "master", "commit_count": 458, "repo_created_at": "2020-07-11T06:47:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3b772535...
16aed818-3bcc-40ff-9f0a-d463897eeda7
Ibrahim-898/XPSC_ProblemSolving
Week3/Day7/I_Premutation.cpp
#include<bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define ld long double #define ios() ios_base:: sync_with_stdio(0);cin.tie(0); bool cmp(const pair<int,int> &a,const pair<int,int> &b){ if(a.first!=b.first) return (a.first<b.first); else return (a.second>b.second); } ...
ALGO
0.999939
3.887184
{ "github_metadata": { "branch": "main", "commit_count": 81, "repo_created_at": "2024-10-27T16:36:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8822ae383b5...
e827317b-589f-4725-ab02-758ac021a24c
2000zua/Practic-Task-2024
2117/main.cpp
#include <stdio.h> #include <cmath> #include <tuple> using ll = long long; std::pair<ll, bool> fac(const ll n) { // Returns either a square factor of n, or a non-square factor for(ll i = 2, lim = std::pow(n, 1.0/3) + 0.5; i <= lim; i++) if(!(n%(i*i))) return { i, true }; else if(!(...
ALGO
0.999973
4.189905
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-02-21T18:31: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": "2ba423231481...
b5abf6e0-587a-4843-bfde-01a2391e7fce
EspressoTrip-v2/LeetCodeChallenges-fun
LinkedLists/MNReversal_Medium/main.cpp
#include <iostream> using namespace std; /* * 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) {} * }; */ struct Li...
ALGO
0.999999
5.493937
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2021-06-28T12:54: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": "0fa2dbc4a2...
60bc83f2-6ac0-476c-a78a-d3d0b0a965fb
hianantk/Competitive-Programming
CodeForces/Codeforces Round 597/C.cpp
/*coderanant*/ #include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define f1(i,a,b) for(int i=a;i<b;i++) #define f2(i,a,b) for(int i=a;i>=b;i--) #define endl '\n' #define pb push_back #define gp " " #define ff first #define ss second #define mp make_pair const int mod=1000000007;...
ALGO
0.999951
3.789511
{ "github_metadata": { "branch": "master", "commit_count": 523, "repo_created_at": "2019-06-04T09:58:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e4a99dd2...
d5ac8667-a3a1-4156-bc90-f07e9010d04a
Zoanie/repository
first_and_last_elem/src/first_and_last_elem.cpp
//============================================================================ // Name : first_and_last_elem.cpp // Author : <NAME> // Version : // Copyright : I'll have 2 number 9s // Description : https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/ //==============...
ALGO
0.999762
6.555738
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2021-08-13T02:16:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8f6d21ce51...
6add615f-3f98-467b-8ea0-bf190479eb95
takmin/DataAugmentation
RandomRotation.cpp
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, instal...
ALGO
0.992823
6.124067
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2014-10-14T06:14:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 78, "forks": 25, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "22e66a1...
68df7b9d-909f-442e-8d8a-4e2a080474ae
aratrikchandra/Journey-Through-LeetCode-s-DSA-Challenges
DP/printing_LIS.cpp
#include <bits/stdc++.h> using namespace std; // Note // We need to Update maxLen and maxInd for every index and should move them outside of the if (dp[prev] + 1 > dp[i]) condition to ensure that they are correctly tracked. vector<int> longestIncreasingSubsequence(int n, vector<int> &arr) { vector<int> ans; //...
ALGO
0.99999
5.697828
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2024-05-24T19:15:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b48cd011ca6...
d797158d-fadb-4dda-80f6-df15187b72d8
benjaminva/TC2037-Metodos
Parallel Programs examples/example add array.cpp
#include <iostream> #include <thread> #include <algorithm> // #include <chrono> #define SIZE 100000000 using namespace std::chrono; using namespace std; void set_values(int start, int end, int* a){ for (int i = start; i < end; i++) { a[i] = 1; } } void add(int start, int end, int* a1, int* a2, int* b){ for (i...
ALGO
0.998164
4.161457
{ "github_metadata": { "branch": "main", "commit_count": 39, "repo_created_at": "2024-01-26T17:38: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": "16bb0a3e383...
2a3ef4ac-33ae-4108-a9a5-7f9431ab7b9a
longjianjiang/LeetOJ
cpp/28_implement_strStr.cpp
#include <iostream> #include <vector> #include <string> #include <stack> #include <queue> #include <map> #include <set> #include <unordered_set> #include <unordered_map> using namespace std; // 字符串匹配,查找p在s中的索引。 // 使用KMP算法 class Solution { public: int strStr_dfa(string haystack, string needle) { if (needle.empty()) ...
ALGO
0.99993
5.106946
{ "github_metadata": { "branch": "master", "commit_count": 706, "repo_created_at": "2018-04-12T14:07:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a98d2e52...
4ce29832-1d4c-473e-8334-43288a0b02c0
HanshiZ/final_mth451
MTH451/DoubleIntegrals/DoubleIntegrals/doubleinteg.cpp
#include "doubleinteg.h" #include "GaussianQuad.h" #include <stdio.h> double gaussianquad2(double* outer, double (*inner[])(double), double (*f)(double, double), int n, int m) { double integral = 0; double halfdif = .5 * (outer[1] - outer[0]); double mid = .5 * (outer[0] + outer[1]); for (int i = 1; i <= m; ++i) ...
ALGO
0.999749
4.79052
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-09-11T18:28: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": "bd2ac2c2493a...
9d46cb7c-f870-461d-aa02-3602419df3c7
Marcus-RR/MiSKZI
3lab/lab3_2.cpp
#include <iostream> #include <bitset> #include <vector> using namespace std; const uint8_t S[16] = { 0xB, 0x3, 0x5, 0x8, 0x2, 0xF, 0xA, 0xD, 0xE, 0x1, 0x7, 0x4, 0xC, 0x9, 0x6, 0x0 }; uint8_t S_star[256]; const string input_bits = "0000000100100011010001010110011110001001101010111100110111101111"; v...
ALGO
0.999798
3.668577
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-05-29T22:20: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": "6ea86f907945...
51cbb3d7-88c3-4fd0-8661-6f22782b753a
reachanihere/Data-Structures-and-Algorithms
Hashing/Print Intersection.cpp
/* Given two random integer arrays, print their intersection. That is, print all the elements that are present in both the given arrays. Input arrays can contain duplicate elements. Note : Order of elements are not important Input format : Line 1 : Integer N, Array 1 Size Line 2 : Array 1 elements (separated by space)...
ALGO
0.999947
5.019044
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2019-10-05T17:27:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 146, "forks": 113, "issues": 2, "pull_requests": 11 }, "file_meta": { "content_id": "9a60...
6c3541a9-3636-43c8-ab04-21786b1f41bb
prince-kb/DSA-Cpp
Rough/mergeSort.cpp
#include <iostream> #include <vector> #include <bits/stdc++.h> using namespace std; void printArray(vector<int> a) { cout << endl; for (int i = 0; i < a.size(); i++) cout << a[i] << " "; cout << endl; } void merge(vector<int> &arr, int l, int r) { int m = l + (r - l) / 2; int n1 = m - l +...
ALGO
0.999953
5.251157
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2023-12-19T12:36: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": "9fee5e72222...
30c5ff67-7055-4422-ad21-0ad719b49cdf
VladanPetkovic/vrp_heuristics
vrp_solver/src/solver/nearest_neighbor.cpp
// // Created by petkovic on 01.04.25. // #include <solver/nearest_neighbor.h> void NearestNeighbor::solve() { uint16_t start_node_id = vehicle.getDepartureNode().getId(); uint16_t num_of_nodes = graph.getNumNodes(); std::vector<bool> visited(num_of_nodes, false); visited[start_node_id - 1] = true; ...
ALGO
0.999975
5.557108
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2025-03-22T15:07: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": "5a36ef54317...
aa13d65a-f62c-489e-92e4-f79c098f6670
Algebraic-Programming/ALP
include/graphblas/algorithms/mpv.hpp
/* * Copyright 2021 Huawei Technologies Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
ALGO
0.99904
6.66288
{ "github_metadata": { "branch": "develop", "commit_count": 242, "repo_created_at": "2022-04-07T17:35:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 28, "forks": 5, "issues": 89, "pull_requests": 28 }, "file_meta": { "content_id": "44768...
230df0ab-1585-4332-b86f-0323e6bc79da
anasuss/LeetCode-Solutions
1559-detect-cycles-in-2d-grid/1559-detect-cycles-in-2d-grid.cpp
class Solution { public: int cnt = 0 ; bool visited[505][505] ; int dx[4] = {1,-1,0,0} ; int dy[4] = {0,0,1,-1} ; bool isvalide(int x , int y , int n , int m){ return x>=0 && y>=0 && x<n && y<m ; } void dfs(vector<vector<char>>& grid , int x , int y , int n , int m , bool &check , int par_r , int par_c ,ch...
ALGO
0.999972
5.626351
{ "github_metadata": { "branch": "main", "commit_count": 441, "repo_created_at": "2022-06-04T22:18: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": "67919d956e...
e97d2a7f-7ac3-4d3e-882b-c44ce7f22974
WangYang-wy/LeetCode
C++/020. Valid Parentheses.cpp
// // Created by 王阳 on 2018/3/27. // /** * Given a string containing just the characters '(', ')', '{', '}', '[' and ']', * determine if the input string is valid. The brackets must close in the correct order, * "()" and "()[]{}" are all valid but "(]" and "([)]" are not. */ #include <iostream> #include <vector> ...
ALGO
0.988418
5.407689
{ "github_metadata": { "branch": "master", "commit_count": 306, "repo_created_at": "2018-03-11T01:03:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c0ef449b...
5f6b2d4d-0888-4f1d-94da-1b5ab33e076f
emrainey/hobbies
projects/geometry/include/geometry/vector.hpp
#pragma once /// @file /// Definitions for the vector_ object. /// @copyright Copyright 2020 (C) <NAME>. #include <cstdio> #include "geometry/types.hpp" // #if defined(__x86_64__) // #include <emmintrin.h> // #include <immintrin.h> // #endif #include <initializer_list> using namespace basal::literals; namespace g...
TOOL
0.91517
7.144298
{ "github_metadata": { "branch": "main", "commit_count": 230, "repo_created_at": "2022-01-29T04:50:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 23, "pull_requests": 0 }, "file_meta": { "content_id": "f68ee0b3a...
ae62616d-45c8-4c39-a0cd-1e9025ca183c
CaseySanchez/ExpressionParser
Examples/MatrixExample/main.cpp
// Transforms a 2D vector by a 2D rotation matrix #include <iostream> #include <expression_parser.hpp> #include <expression_composer.hpp> #include <expression_simplifier.hpp> int main(int argc, char *argv[]) { try { std::shared_ptr<VariableNode> theta(new VariableNode(3.14159 / 4.0)); std::share...
ALGO
0.991793
5.772757
{ "github_metadata": { "branch": "master", "commit_count": 91, "repo_created_at": "2020-09-13T20:56:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 16, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "63383af4...
a675dc2f-94e0-431d-b883-e6148640c0a2
CaiHuicheng/Project
Code/C++练习/libstdc++-v3/testsuite/25_algorithms/lower_bound/1.cc
// Copyright (C) 2005-2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your op...
TEST
0.945725
5.33376
{ "github_metadata": { "branch": "master", "commit_count": 162, "repo_created_at": "2020-09-05T06:23:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f42e04c6...