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
ff07199c-e150-4460-8a20-372c95d87100
zhekkka/slae
functions.cpp
#include "iostream" #include "class.h" #include "cmath" double Norm1(Matrix &A) { double max = 0; double s = 0; for (int i = 0; i < A.dimension; i++) { for (int j = 0; j < A.dimension; j++) { s += std::abs(A.matrix[i][j]); } if (s > max) { max = s; ...
ALGO
0.999607
4.253577
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2022-11-12T13:17:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "29702e1fa3...
09e11cde-7d5e-48eb-86df-0cf119f603e9
hibit-at/atcoder
ABC/ABC100-199/ABC135/b.cpp
#include <algorithm> #include <iostream> #include <iomanip> #include <limits.h> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <utility> #include <vector> #include <stack> using namespace std; #define rep(i, n) for (int i = 0; i < n; i+...
ALGO
0.999729
3.303797
{ "github_metadata": { "branch": "master", "commit_count": 177, "repo_created_at": "2021-03-21T07:33:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c39d3677...
ee54c103-5e3a-4f37-ac34-2b32b46004cf
Suvekshyajha/numerical-method
lab3/doubleintegration.cpp
#include <iostream> #include <cmath> using namespace std; // Define the function to be integrated double f(double x, double y) { return x * y; // Example: f(x, y) = x * y } // Trapezoidal Rule for Double Integration double doubleIntegral(double a, double b, double c, double d, int nx, int ny) { double hx = (...
ALGO
0.9998
5.967116
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-01-07T12:26:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ac3df2398011...
14bc7824-2ca0-4919-8540-0ccadc1a19f5
BinomialSheep/CompetitiveC--
AtcoderContest/ARC160/A.cpp
#pragma region header #include <bits/stdc++.h> // デバッグ用マクロ:https://naskya.net/post/0002/ #ifdef LOCAL #include <debug_print.hpp> #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast<void>(0)) #endif using namespace std; using ll = long long; using vi = vector<int>...
ALGO
0.999996
5.064288
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2023-12-12T17:45: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": "e889e2423...
81f39eb5-a155-4d0b-9ffb-6220d12bcde2
vinay-th/Sem-4-Assignments
Data-Structures/Assignment-1/q6-tripletSparse.cpp
// Write a CPP program to represent sparse matrix in Triplet Representation. #include <iostream> using namespace std; int main() { int count; int mat[5][4] = { {0, 2, 0, 0}, {1, 0, 0, 3}, {0, 0, 0, 0}, {0, 3, 3, 0}, {2, 0, 0, 6}}; for (int i = 0; i < 5; i++) { for (int j = 0; j < 4; j++) { if (ma...
ALGO
0.999723
5.680277
{ "github_metadata": { "branch": "main", "commit_count": 182, "repo_created_at": "2024-12-23T12:25:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4f6fe6b11a...
c77cae37-3b96-4137-9e20-9ef363363528
autonomousvision/gaussian-opacity-fields
submodules/tetra-triangulation/src/triangulation.cpp
#include "triangulation.h" #include <CGAL/Delaunay_triangulation_3.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Triangulation_3.h> #include <CGAL/Triangulation_vertex_base_with_info_3.h> #include <CGAL/compute_average_spacing.h> #include <cassert> #include <fstream> #include <iost...
ALGO
0.986045
6.053833
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2024-04-16T10:17:21.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 915, "forks": 60, "issues": 37, "pull_requests": 3 }, "file_meta": { "content_id": "3e337f1e...
f086473d-2470-48ee-ad30-f5f1ce3c65d3
BNLIF/wire-cell-pid
src/PR3DCluster_dQ_dx_fit.h
#include <Eigen/SVD> std::vector<std::pair<double, double> > WCPPID::PR3DCluster::cal_compact_matrix(Eigen::SparseMatrix<double>& MW, Eigen::SparseMatrix<double>& RWT, int n_2D_w, int n_3D_pos, double cut_pos) // W plane ... { // initial data ... std::vector<int> count_2D(n_2D_w,1); std::map<int, std::...
ALGO
0.999946
3.827128
{ "github_metadata": { "branch": "master", "commit_count": 894, "repo_created_at": "2019-04-03T22:43: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": "9893dac82...
aa891aa3-fc6e-4f32-be0d-d6e62a19db71
ivgiuliani/ant
src/variables.cpp
#include <queue> #include <set> #include <vector> #include "debug.h" #include "predicate.h" #include "values.h" #include "variables.h" using ::std::string; using ::std::queue; queue<Predicate> _extract_predicate(Expression *); queue<string> _extract_variables(Predicate); /* * Estrae una lista di variabili da un es...
ALGO
0.977709
4.972342
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2009-10-01T19:05:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a04db56520...
47f371b9-5a87-4199-9c11-8226b4f4839b
kyungyonglee/social_overlay_network_simulator
son_test.cpp
#include <iostream> #include <sstream> #include <fstream> #include <cmath> #include <string.h> #include "son_friend_select.h" #include "son_msg_dist.h" #include "son_routing.h" #include "son_util.h" using namespace std; using namespace Starsky; #if 0 void printInfo(map<int, pair<double, double> > result) { ofstrea...
ALGO
0.93859
3.626266
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2011-10-20T20:12:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "76fa5aac4b...
d7a655cb-aede-484b-93cc-d8488f2d8a78
2006jjj/algorithms-and-data-structures
1. Сложность, тестирование, особые случаи/1.5 Даты.cpp
/*Задача 1.5 Как известно, два наиболее распространённых формата записи даты — это европейский (сначала день, потом месяц, потом год) и американски (сначала месяц, потом день, потом год). Системный администратор поменял дату на одном из бэкапов и сейчас хочет вернуть дату обратно. Но он не проверил, в каком формате да...
ALGO
0.999484
3.436047
{ "github_metadata": { "branch": "main", "commit_count": 151, "repo_created_at": "2025-02-27T18:51: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": "3042a6becf...
2ab8875d-a549-40b9-9236-50ac23b65fae
kwtoh/CG1103-Inventory-Management-System
idiotbox2/SortedLinkedList.h
#include<iostream> #include "ListBase.h" #ifndef __SORTEDDOUBLELINKEDLIST_H__ #define __SORTERDOUBLELINKEDLIST_H__ template<typename T> class SortedLinkedList : public ListBase<T>{ protected: struct ListNode { T* item; ListNode* next; ListNode* prev; }; ListNode* _head; ListNode* traverseTo(int index) { i...
TOOL
0.998331
4.026756
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2013-10-08T16:06: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": "7f2bec2663...
59f2594b-5a1e-43ea-830c-5e899151a449
taqsim/maqam
maqam/src/main/cpp/nodes/ak_sampler/dsp/Common/EnvelopeGeneratorBase.cpp
// // EnvelopeGeneratorBase.cpp // AudioKit Core // // Created by <NAME>, revision history on Github. // Copyright © 2018 AudioKit. All rights reserved. // #include "EnvelopeGeneratorBase.hpp" #include <cmath> namespace AudioKitCore { void ExponentialSegmentGenerator::reset(double initialValue, double targetV...
ALGO
0.941586
6.078064
{ "github_metadata": { "branch": "master", "commit_count": 22, "repo_created_at": "2024-02-02T15:05:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "960fcc439...
52288e0c-3b4a-4d33-bf90-3e7521f17823
Jitender-52/Leetcode
1380-lucky-numbers-in-a-matrix/1380-lucky-numbers-in-a-matrix.cpp
class Solution { public: vector<int> luckyNumbers (vector<vector<int>>& matrix) { int n = matrix.size(), m = matrix[0].size(); vector<int> row(n), col(m); for(int i = 0; i < n; i++) { int mini = 1e9; for(int j = 0; j < m; j++) mini = min(mini, ...
ALGO
0.999916
6.180871
{ "github_metadata": { "branch": "main", "commit_count": 3177, "repo_created_at": "2023-01-06T06:22: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": "ff8a993e2...
caa1b69c-ad8d-411f-af58-fd8949ce96ef
Laci556/distancesum
findShortestSum.cpp
#include "findShortestSum.h" #include <vector> int findShortestSum(char **grid, int m, int n) { // Create nodes for all the cells in the grid Node ***distances = new Node **[m]; int startRow, startCol; for (int i = 0; i < m; i++) { distances[i] = new Node *[n]; for (int j = 0; j < n; j++) { ...
ALGO
0.999777
5.355218
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-09-02T15:12: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": "984b5c3c8a8f...
23b94c47-e125-47c7-bccb-5caf88f1168a
krnbatra/SPOJ-Solutions
PRIME1.cpp
/*My First Template :D*/ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; #define INF 1000000000 #define MOD (ll)1e9+7 #define pb push_back #define EPS 1e-9 template <typename T> T mod(T a, T b){return (a%b>0)?(a%b) : mod(a+...
ALGO
0.999804
3.551213
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2016-08-28T07:31:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 40, "forks": 27, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "1712a2d...
638d2930-aab9-48d6-b06b-c25725ac2939
PinkySmile/SokuAI
Training/AITrainerScriptCPP/TournamentManager.cpp
// // Created by PinkySmile on 22/05/2021. // #include <numeric> #include <iostream> #include <functional> #include "TournamentManager.hpp" #include "Exceptions.hpp" #ifdef _DEBUG #define DISPLAY_PARAM true #define SOUND_PARAM 10, 10 #define GAME_TPS 60 #else #define DISPLAY_PARAM false #define SOUND_PARAM 0, 0 #defi...
TOOL
0.909823
4.65976
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2021-03-30T04:08:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8900804b...
b087cb7f-c47e-47ee-a5d6-7f0f37c2db81
ppplinday/vgg16-by-ARM-Compute-Library
arm_compute/core/CPP/kernels/CPPSortEuclideanDistanceKernel.h
/* * Copyright (c) 2017 ARM Limited. * * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights ...
ALGO
0.998895
7.294958
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2017-06-22T09:38:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 32, "forks": 14, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "5357b26...
d4ec6199-1d9a-46ce-806a-8f3c2358ad7d
fshp971/ACM-ICPC
codeforces/cf-1086D.cpp
#include<bits/stdc++.h> using namespace std; #define mem(a,b) memset(a,b,sizeof(a)) #define REP(i,a,b) for(int i = a; i <= b; ++i) #define PER(i,a,b) for(int i = a; i >= b; --i) #define MP make_pair #define PB push_back #define fi first #define se second typedef long long LL; typedef double DB; const int maxn = 2e5;...
ALGO
0.999818
3.88022
{ "github_metadata": { "branch": "master", "commit_count": 517, "repo_created_at": "2016-05-13T15:22:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "99a64b55...
0cda7092-2f06-4246-907f-6e5055920d30
aashishchachan/leetcode
Medium/dp/coin_change.cpp
#include <bits/stdc++.h> using namespace std; #define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); #define external_io() freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #define secsort() bool sortbysec(const pair<int,int> &a, const pair<int,int> &b){return (a.second < b.second);} #...
ALGO
0.999974
4.22869
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2021-06-11T06:18: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": "eb6bf1955...
96b426ac-28b0-4181-8b62-c12f56905cc8
Samdroid27/DSA
InterviewBit/Dynamic Programming/Evaluate Expression To True.cpp
int N=1e3+3; int dp[200][200][2]; int solve(string &s,int i,int j, bool isTrue){ if(i>j) return 0; if(i==j){ return isTrue ? s[i]=='T' : s[i]=='F'; } int ans = 0; for(int k=i+1;k<j;k+=2){ int lT = dp[i][k-1][1]!=-1 ? dp[i][k-1][1] : solve(s,i,k-1,true); int lF = dp[i][k-1][0...
ALGO
0.999987
4.684789
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2021-03-15T10: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": "61d3e53ef...
f9a02003-5b3b-4358-a64a-f3d45ffcaf7b
Maycon708/Maratona
URI/2089 - Lanchonete.cpp
#include <bits/stdc++.h> #define INF 0x3F3F3F3F #define rep(i, a, b) for (int i = int(a); i < int(b); i++) #define pb push_back #define pi 3.1415926535897932384626433832795028841971 #define debug(x) cout << #x << " = " << x << endl; #define debug2(x,y) cout << #x << " = " << x << " --- " << #y << " " << y << "\n"; #de...
ALGO
0.999922
4.029996
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2019-02-28T17:00: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": "25f19c8b77...
5e528b9b-4734-4a6a-8b7f-866c25428208
aehogan/tholedipoleplugin
platforms/reference/src/ReferenceTholeDipoleForce.cpp
#include "ReferenceTholeDipoleForce.h" #include "openmm/OpenMMException.h" using namespace TholeDipolePlugin; using namespace OpenMM; using std::vector; ReferenceTholeDipoleForce::ReferenceTholeDipoleForce() : _nonbondedMethod(NoCutoff) { initialize(); } ReferenceTholeDipoleForce::ReferenceTholeDipoleForce(Nonbo...
ALGO
0.996382
6.436916
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2025-07-11T03:06: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": "2d3e31fa7...
9db4a404-0658-4a7b-a940-f4dc87b425b1
KathyLin2009/usaco
cow_routing/cowroute.cpp
#include <iostream> #include <vector> #include <limits> using namespace std; int main() { freopen("cowroute.in", "r", stdin); freopen("cowroute.out", "w", stdout); int N, A, B; vector<pair<vector<int>, vector<int> > > info; cin >> A >> B >> N; for(int i = 0; i < N; i++) { int cost,...
ALGO
0.998883
3.349055
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2021-07-13T13:54: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": "e70e43467...
1bedecb3-e56c-4afe-b8f6-610bb399906b
CaHHaL/DSAwithCPP
Day231_Find the longest string.cpp
// Given an array of strings words[]. Find the longest string in words[] such that every prefix of it is also present in the array words[]. // Note: If multiple strings have the same maximum length, return the lexicographically smallest one. // Examples: // Input: words[] = ["p", "pr", "pro", "probl", "problem", "pr...
ALGO
0.999985
6.181899
{ "github_metadata": { "branch": "main", "commit_count": 266, "repo_created_at": "2024-08-30T06:09:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3b4708fe07...
97ab1798-c0eb-4dc2-8504-7f044e5a2c0d
firstTrip/CodingTest
49993/49993/49993/49993.cpp
//https://programmers.co.kr/learn/courses/30/lessons/49993 // 문자열의 시작이 스킬의 기초 스킬이 아닌경우 다 넘기기 // 그 이후 검사 // it find 이후 그 배열의 숫자 저장 후 C 보다 숫자가 작으면 탈락 바르게 정렬이 되어있는경우에 통과 answer ++ #include <string> #include <vector> #include <iostream> #include <algorithm> using namespace std; int solution(string skill, vector<string...
ALGO
0.999887
4.666645
{ "github_metadata": { "branch": "master", "commit_count": 150, "repo_created_at": "2022-01-13T12:12: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": "9d45d1d0...
6ce3a069-20ec-4288-bbe3-9af866603b7d
InnerShadow/Parallel-Programming
task3_3.cpp
#include "includs.hpp" #include "Tasks.hpp" static double t1; static void Matrixmultiplay(int rank, int size, int n, int q, unsigned long long int* A, unsigned long long int* B) { int amout = n / size + (rank >= size - (n % size)); unsigned long long int* buffer = new unsigned long long int[n * amout]{}; ...
ALGO
0.999693
3.769602
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2023-04-02T14:11: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": "6ff0f7cdcbf...
493aba32-4efa-4fb5-bd74-dd50e3f01c3b
AClearZhang/AlgorithmSlay
C++/JZOffer/29.ShunShiZhen.cpp
/* * @FilePath : \Algorithm&Interview\AlgorithmSlay\C++\JZOffer\29.ShunShiZhen.cpp * @Author : AClearZhang * @Date : 2021-04-28 23:11:58 * @E-mail : <EMAIL> * @Homepage : www.aclear.top * @LastEditors : AClearZhang * @LastEditTime : 20...
ALGO
0.999999
5.495351
{ "github_metadata": { "branch": "main", "commit_count": 299, "repo_created_at": "2020-11-13T03:29: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": "c6d3192987...
7441c528-6f55-492c-8f81-9f861932b026
manMp07/DSA_Problems
15. Dynamic Programming/Buy and Sell Stocks/Buy and Sell Stocks V.c++
#include<bits/stdc++.h> using namespace std; //Que.- You are given an array prices where prices[i] is the price of a given stock // on the ith day, and an integer fee representing a transaction fee. // Find the maximum profit you can achieve. You may complete as many // transactions as you like, but you...
ALGO
0.999913
5.051799
{ "github_metadata": { "branch": "main", "commit_count": 65, "repo_created_at": "2023-12-25T11:17:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0c617ca80d5...
c85b4895-633e-41ad-8bbe-838abfdf4e85
mostafa-saad/MyCompetitiveProgramming
Olympiad/POI/official/2009/code/slo/prog/slo.cpp
/************************************************************************* * * * XVI Olimpiada Informatyczna * * * * Zadanie: Sloni...
ALGO
0.999931
3.406152
{ "github_metadata": { "branch": "master", "commit_count": 439, "repo_created_at": "2017-02-05T22:26:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 415, "forks": 85, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7e476...
5fa8c009-56a0-4443-b040-a106983f7031
Tikhobaev/Disjoint-set-implementation
Disjoint_set3.cpp
// // Created by Илья on 002 02.10.19. // #include "Disjoint_set3.h" DSet3::DSet3(int n) : maxN(n) { arr = new int[maxN+1]; h = new int[maxN+1]; for (int i = 1; i <= maxN; i++) { arr[i] = 0; h[i] = 0; } } DSet3::~DSet3() { delete[] arr; delete[] h; } void DSet3::MakeSet(...
ALGO
0.999469
4.890478
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-10-24T11:33: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": "052bde3d0f...
64288bd6-d1c3-4a38-abb3-bf77b989b54b
LittleQili/Algorithm-and-Complexity-Assignments
Lab05/Code-P2.cpp
#include <iostream> #include <stdio.h> #include <queue> #include <string> using namespace std; //#define ONLY_COST //#define OUTPUT_HORIZONTAL const int MAXL = 100001; char DNA_x[MAXL+5]; char DNA_y[MAXL+5]; int lenx = 1,leny = 1; int line1[MAXL+1],line2[MAXL+1],linemid[MAXL+1]; #ifndef ONLY_COST queue<pair<int,int>>...
ALGO
0.999875
3.754562
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2020-03-01T15:29: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": "f96fc12b1...
0aa803bd-7c1b-4863-b649-3b2a8a1130fd
jun0kim3722/Object-Oriented-Programming-Cpp-ECE-39595
W3-UnitTestActivity/hash_list.cpp
#include "hash_list.h" hash_list::hash_list() { head = nullptr; iter_ptr = nullptr; size = 0; } /**----------------------------------------------------------------------------------- * START Part 1 *------------------------------------------------------------------------------------*/ void hash_list::i...
ALGO
0.916652
5.429933
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2025-01-18T20:19: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": "6b681cfb87e5...
ac1ae6e4-cae1-489d-b40d-e607e2f5cb14
sonusajid004/GeeksForGeeks--MyCodes
MergeSort_For_LInkedLists.cpp
void partition(Node *head,Node*& f,Node* &s) { s = head;f=head; while(f&&f->next&&f->next->next) { s=s->next; f=f->next->next; } Node* tem = s->next; s->next = NULL; s = tem; f = head; } Node* merge(Node* a,Node* b) { Node* tem = a; ...
ALGO
0.999998
4.601415
{ "github_metadata": { "branch": "master", "commit_count": 77, "repo_created_at": "2020-05-17T16:38: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": "468934be7...
0b67fd13-e1d7-445b-bef0-597689b0a56d
WolfireGames/overgrowth
Libraries/crunch-r319/crnlib/crn_prefix_coding.cpp
// File: crn_prefix_coding.cpp // See Copyright Notice and license at the end of inc/crnlib.h #include "crn_core.h" #include "crn_prefix_coding.h" //#include "rand.h" #ifdef CRNLIB_BUILD_DEBUG //#define TEST_DECODER_TABLES #endif namespace crnlib { namespace prefix_coding { bool limit_max_code_size(ui...
ALGO
0.960146
6.905152
{ "github_metadata": { "branch": "main", "commit_count": 193, "repo_created_at": "2022-03-08T09:38:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2697, "forks": 274, "issues": 64, "pull_requests": 21 }, "file_meta": { "content_id": "98e6...
cdf83828-ae18-4f04-bf7e-2e164f0e4fb9
spin-scenario/spin-scenario
src/kernel/equip/coil_biot_savart.cpp
/* Copyright 2019 The Spin-Scenario Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
ALGO
0.982106
4.096877
{ "github_metadata": { "branch": "master", "commit_count": 136, "repo_created_at": "2019-02-27T01:05:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 4, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "3732ef5...
a06e82fa-3916-404b-8402-6adeb9498779
Leslie-Chung/Discrete-Mathematics-course-design
蚁群算法.cpp
#include<time.h> #include<iostream> #include<string.h> #include<math.h> #include<stdlib.h> #define MAX_NUM 50 using namespace std; int N;//顶点个数 const int M = 200;//蚂蚁个数 int mp[MAX_NUM ][MAX_NUM ];//权值矩阵 double phe[MAX_NUM ][MAX_NUM ];//路径上存留的信息素 double phe2[MAX_NUM ][MAX_NUM ];//新留下的信息素 double rate = 0.5;//信息素挥发的速率 dou...
ALGO
0.999995
3.640384
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-03-05T04:31: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": "37eb4d4ee4...
2e4c3ae2-7e68-4857-b66a-253eb9f5e59e
jddelgado95/top100-leetcode-c-
problem5-2sum-inputarraysorted.cpp
/* Given a 1-indexed array of integers numbers that is already sorted in non decreasing order, find 2 numbers such that they add up to a specific target number. Let these 2 numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 <= numbers.length. Return the indices of two numbers index1 and index2 a...
ALGO
0.999996
6.308635
{ "github_metadata": { "branch": "main", "commit_count": 84, "repo_created_at": "2025-04-27T15:07: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": "b26e728361f...
52122aca-2706-44e9-a582-9407afd07365
Sai-Venky/TraversalWithC
challenges/hashing/flip-columns-for-maximum-number-of-equal-rows.cpp
// https://leetcode.com/problems/flip-columns-for-maximum-number-of-equal-rows /* class Solution { public int maxEqualRowsAfterFlips(int[][] matrix) { int ans = 0; int m = matrix.length, n = matrix[0].length; for(int i = 0; i < m; i++) { int cnt = 0; int[] flip ...
ALGO
0.999978
6.267318
{ "github_metadata": { "branch": "master", "commit_count": 530, "repo_created_at": "2020-05-03T14:48: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": "5c3caeb8...
1a2ba245-6208-4e46-98cc-35bd3dfe3c0e
AussieSeaweed/index-librorum-prohibitorum
spoj/PT07X/main.cpp
#include <iostream> #include <vector> #include <cstring> #define inf 999999999 using namespace std; vector<int> graph[100001]; int parent[100001]; int dp[100001][2]; int N; int solve(int node, bool must) { if (dp[node][must] != -1) return dp[node][must]; dp[node][must] = !must ? solve(node, true) : inf; ...
ALGO
0.99993
4.329197
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2021-10-17T05:11:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "92d46c592e8...
e18cc9cc-b01f-4cbd-893d-cdf84f90fa7e
muhammadsaadgondal/DSA_Assignment_02
Evaluate_Postfix.cpp
#include <iostream> using namespace std; #include <string> int start_index = -1; int last_index = -1; int arr_pop(int arr[]) { return arr[last_index--]; } void arr_push(int arr[], int val) { if(start_index==-1){ start_index=0; } last_index++; cout<<"Last index is :"<< last_index << endl; ...
ALGO
0.999487
4.213337
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-10-19T20:34: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": "194eb9f1595c...
78df0971-6ae1-4c2e-8160-9a7554a5c8d8
upupming/algorithm
acwing/算法竞赛进阶指南/0x12-队列/135. 最大子序和.cpp
/* 单调队列 根据数据范围,只能用线性时间的复杂度的算法 首先求一下前缀和,枚举所有右端点 i,看所有可能的左端点 [i-m, i-1],假设有两个左端点 j, k 可选,j < k 但是 s[j] > s[k] 的话,可以直接淘汰 j,因为用 k 序列长度不仅小,序列和还更大。所有可能的左端点用队列维护,那么这个队列的前缀和一定是单调递增的。也就是说队首就是最优决策。 关键在于如何维护所有可能的左端点,i 增加的时候,需要从队首删去长度大于 m 的左端点,同时从队尾开始一直删掉那些前缀和大于 s[i] 的即可。所以需要用双端队列 deque。 */ #include <deque> #include <iostream> us...
ALGO
0.99999
4.109464
{ "github_metadata": { "branch": "master", "commit_count": 1248, "repo_created_at": "2019-10-25T07:41:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 328, "forks": 38, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ea14...
e71a6e29-9512-47e3-85c7-78b72d11a626
Kawser-nerd/CLCDSA
Source Codes/AtCoder/arc079/C/1467256.cpp
#include <iostream> #include <cstdio> #include <ctime> #include <cmath> #include <cctype> #include <cstring> #include <cstdlib> #include <fstream> #include <sstream> #include <algorithm> #include <map> #include <set> #include <stack> #include <queue> #include <vector> #include <stack> #ifndef WIN32 #define Auto "%lld" ...
ALGO
0.999981
3.325162
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2019-09-30T05:38:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 8, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "4b2ac57e...
46870270-dcb0-466c-b310-3ed6765c5337
vmc-motion/AGXUnrealSamplesBP
Plugins/AGXUnreal/Source/ThirdParty/agx/include/agx/Physics/GranularBody/CalculateJacobians.h
/* Copyright 2007-2024. Algoryx Simulation AB. All AGX source code, intellectual property, documentation, sample code, tutorials, scene files and technical white papers, are copyrighted, proprietary and confidential material of Algoryx Simulation AB. You may not download, read, store, distribute, publish, copy or othe...
ALGO
0.961252
6.535106
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2024-10-01T04:17:20.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c0bba9e823c24...
aa81bcb7-af33-4bb1-b915-3dc8c0d4abcc
AdityaSinghMandrawal/Graph-Algorithms-in-cpp
LeetCode Questions/547.cpp
/* Number of provinces There are n cities. Some of them are connected, while some are not. If city a is connected directly with city b, and city b is connected directly with city c, then city a is connected indirectly with city c. A province is a group of directly or indirectly connected cities and no other cities out...
ALGO
0.99998
6.084833
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-07-03T13:47:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e8c32d8e7fd...
a73d71e8-840e-40de-9dcf-23ca79637a61
cran/Rborist
src/nodescorer.h
// This file is part of ArboristCore. /* 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 http://mozilla.org/MPL/2.0/. */ /** @file nodescorer.h @brief Scoring methods for frontier. @au...
ALGO
0.938842
6.594784
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2015-02-14T07:44:07.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5ba4a2b851...
84c9f3eb-ad14-4bb5-a36d-035ed6d26e3c
RDLLab/oppt
src/solvers/ABT/solver/BeliefTree.hpp
/** @file BeliefTree.hpp * * Contains the BeliefTree class, which represents an entire belief tree. * * Most of the work is done in the individual classes for the mappings and nodes; this class * simply owns a root node, and keeps track of a vector of all of the nodes in the entire tree * for convenient iteration...
TOOL
0.967474
7.465149
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-11-03T02:50:01.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 46, "forks": 16, "issues": 2, "pull_requests": 1 }, "file_meta": { "content_id": "4adef8ee1...
c15b7d17-5cf4-46fc-a243-bae698b04d06
Scorpion333/fmi-sda-2017
11.01.2018/BinTree.h
#pragma once template <class T> struct node { T inf; node<T> *left, *right; }; template <class T> class BinTree { private: node<T> *root; void DeleteBinTree(node<T>* &) const; void Copy(node<T> * &, node<T>* const&) const; void CopyBinTree(BinTree<T> const&); void pr(const node<T> *) const...
ALGO
0.999153
4.395515
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2017-11-30T12:52:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "55580b6e3...
a47a0745-0539-494f-aa20-084f00366d7d
mishra10008/HacktoberFest2021
LeetCode/32. Longest Valid Parentheses.cpp
int Solution::LBSlength(const string s) { if (s.length() <= 1) return 0; int curMax = 0; vector < int > longest(s.size(), 0); for (int i = 1; i < s.length(); i++) { if (s[i] == '>' || s[i] == ')' || s[i] == ']' || s[i] == '}') { if ((s[i] == '>' && s[i - 1] == '<') || (s[i] == ')' && s[i - 1] ...
ALGO
0.999069
4.437094
{ "github_metadata": { "branch": "main", "commit_count": 284, "repo_created_at": "2021-10-01T06:44:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 89, "issues": 16, "pull_requests": 22 }, "file_meta": { "content_id": "4946858...
e13133e5-b2a1-4f62-b6dc-8b7be686c9d6
aolamide/DSA
82-remove-duplicates-from-sorted-list-ii/82-remove-duplicates-from-sorted-list-ii.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* deleteDupli...
ALGO
0.999994
5.957382
{ "github_metadata": { "branch": "main", "commit_count": 1126, "repo_created_at": "2022-07-10T15:53:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3395437ad...
770a6f0c-5be6-4621-bf15-8388b7f0ea99
LSNXUV/C--
GPLT/exam/L/1-30/25-IntA+B.cpp
#include <iostream> #include <string> using namespace std; /* 其中A和B都在区间[1,1000] 输入格式: 输入在一行给出A和B,其间以空格分开。问题是A和B不一定是满足要求的正整数,有时候可能是超出范围的数字、负数、带小数点的实数、甚至是一堆乱码。 注意:我们把输入中出现的第1个空格认为是A和B的分隔。题目保证至少存在一个空格,并且B不是一个空字符串。 输出格式: 如果输入的确是两个正整数,则按格式A + B = 和输出。如果某个输入不合要求,则在相应位置输出?,显然此时和也是?。 输入样例1: 123 456 输出样例1: 123 + 456 = 579 输...
ALGO
0.999093
3.652021
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-30T03:03: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": "af021b802e24...
a695f1dd-5a8a-4162-a1b4-87ce0fa76125
w0841821/CISP400
HW1pig/pig.cpp
// pig.cpp // <NAME>, CISP 400 // 02-02-2019 #include <iostream> #include <ctime> using namespace std; class Pig { private: int die, gamescoreCPU, gamescoreUser, gamesPlayed = 0, turnPoints, userTurnCount, compTurnCount; char* userRecord = nullptr; int* turnRecord = nullptr; int* userT...
TOOL
0.969347
3.638492
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2019-01-23T21:03: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": "af9e0377c...
ad20e7bf-8739-4fd8-bf32-d46a629d4eeb
Bearsharks/dev-note
PS/kk2021_3_2.cpp
#include <iostream> #include <string> #include <sstream> #include <vector> #include <unordered_map> #include <set> #include <algorithm> using namespace std; bool dec(int& a, int& b) { return a > b; } int strToBit(string lang, string kind, string career, string soul) { int bit = 0; if (lang[0] == 'j') bit +...
ALGO
0.990106
4.617689
{ "github_metadata": { "branch": "main", "commit_count": 120, "repo_created_at": "2020-12-14T10:26:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 7, "pull_requests": 0 }, "file_meta": { "content_id": "ae89b1fe91...
7ca3fa86-c2ad-46cd-b072-f4b943f13e83
akupferb/ARLpathplanner
include/PathPlanner.hpp
/* * Distributed under our modified Boost Software License. * Version 1.0 (see accompanying file LICENSE) */ /** * @file PathPlanner.hpp * @author <NAME>, <NAME> * @copyright Copyright 2019 ARL. All rights reserved as per license. * @date 10/16/2019 * @version 1.0 * * @brief H...
ALGO
0.943291
4.976942
{ "github_metadata": { "branch": "master", "commit_count": 100, "repo_created_at": "2019-10-04T19:49:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c5ae4e23...
646b185a-9e40-4a66-b8a9-df9d4ebdf86f
thcy/CSES-Solutions
Graph Algorithms/Counting Rooms (1192)/Benq.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pii; template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistic...
ALGO
0.99968
4.323893
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2019-08-15T05:56:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 115, "forks": 50, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "fa31d3...
fe5d293d-3140-4e82-b0d7-b4a5910692b6
tillenium/Competitive-Programming
uvaProblems/data_structure_problems/11111-2ndtry.cpp
#include <iostream> #include <vector> #include <cmath> #include <stack> #include <cstring> #include <string> #include <algorithm> using namespace std; struct Toy{ int val; int rest; }; bool toys(vector<int> v){ stack<Toy> s; Toy temp; temp.val = v[0]; temp.rest = abs(v[0]); s.push(temp); for(int i=...
ALGO
0.997534
3.163937
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-01-21T13:21: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": "2d47d6d0f1...
528e573c-d231-430e-a4af-5c18d861166b
MohitAhirwar/leetcode-submissions
37.sudoku-solver.cpp
class Solution { public: bool ok(int n, vector<vector<int>> &grid, int i,int j, int r, int c){ for(int rc=0;rc<r;rc++){ // if(rc == i || rc == j) continue; if(grid[i][rc] == n || grid[rc][j] == n) return 0; } int x = (i/3)*3; int y = (j/3)*3; ...
ALGO
0.999891
6.449284
{ "github_metadata": { "branch": "main", "commit_count": 862, "repo_created_at": "2022-01-24T19:33:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 8, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "ba91b04aab...
72d3fea7-1811-480d-b21c-95d4cef3b239
y2k-shubham/dsa-in-cpp
Concepts/permutations.cpp
#include <cstdio> #include <iostream> using namespace std; #define MAX 100 void input(int [MAX], int &); void showPerms(int [MAX], int, int); void showArr(int [MAX], int); void swapEle(int [MAX], int, int); int main() { int arr[MAX], len; input(arr, len); showPerms(arr, len, 0); return 0; } void input(int arr...
ALGO
0.999686
4.459157
{ "github_metadata": { "branch": "main", "commit_count": 2061, "repo_created_at": "2020-05-23T08:08:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4cb756983...
11061d77-9d2b-46d1-9924-cc70c8711e2d
dushimsam/deep-dive-into-algorithms
algo-expert-premium/dynammic_programming/water_area.cpp
#include <bits/stdc++.h> typedef vector<int> vi; using namespace std; int waterArea(vector<int> heights) { int size = heights.size(); vi LEFT_MAX(size, 0); vi RIGHT_MAX(size, 0); // Fill the max element for each index from the left to right for (int i = 1; i < size - 1; i++) { for (i...
ALGO
0.99997
5.443908
{ "github_metadata": { "branch": "master", "commit_count": 214, "repo_created_at": "2021-10-26T06:43:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 17, "forks": 6, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "f2f47bc...
3d0bd97a-7edb-4d07-82f4-4ed89835948d
Kernel-del/SetOfSorts
sorts/merge-sort.hpp
#pragma once #include <vector> #include <math.h> namespace sorts { template <typename T> std::vector<T> MergeSort(const std::vector<T> &arr_orig) { if (arr_orig.size() <= 1) { return arr_orig; } else if (arr_orig.size() == 2) { if (arr_orig[0] > arr_orig[1]...
ALGO
0.999796
6.012656
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2025-06-18T12:51:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "60aa82c64...
22914786-6783-4866-84d6-bd7c4ba85f9d
DarnedBuzzard70/OI-Love
outgoing-training-notes/qbxt-2023-summer-noip-s/Day1/Code/B.cpp
#include<bits/stdc++.h> #define F(i,l,r) for(int i=l;i<r;++i) #define Fe(i,l,r) for(int i=l;i<=r;++i) #define Fer(i,l,r) for(int i=l;i>=r;--i) const int MEM=1<<26; char pool[MEM],*pool_p=pool; template<class T> void alloc(T *&p,int sz){ p=new T[sz]; } template<class D,class M> struct MSegTree{ struct Node{ D d...
ALGO
0.999947
3.341465
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2023-08-08T14:12: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": "f842aa32950...
66741956-1ce1-4165-be47-4983abab19f8
SuperBigFive/Charming_XCPC
AtCoder/ABC/ABC320/E.cpp
#include <bits/stdc++.h> #define ll long long #define int ll using namespace std; const int N = 2e5 + 5; int n, m; void init () {} void charming () { init (); cin >> n >> m; vector <int> tim; map <int, pair <int, int> > nod; map <ll, vector <int> > ret; for (int i = 0, T, W, S; i < m; ++i) { cin >> T...
ALGO
0.999915
3.659364
{ "github_metadata": { "branch": "main", "commit_count": 86, "repo_created_at": "2023-03-06T12:05:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f6096a7f1cd...
f7f8ca05-932f-4b72-9766-fc8fea01e7b7
RashedCSEJnU/ProblemSolving
CodeChef/How_many_arrays.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 998244353 ll power(ll x, ll y) { ll res = 1; while (y) { if (y & 1) res = (res * x) % MOD; y >>= 1; x = (x * x) % MOD; } return res; } void solve() { ll n, k; cin >> n >> k; ...
ALGO
0.999861
5.236518
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2024-11-18T15:41:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "19f1e6de3...
454d7c9c-ff6c-435d-9a9b-96992cf65662
sungjunyoung/algorithm-study
week_4/1074_jojju.cpp
#include <iostream> #include <cmath> using namespace std; int N, yy, xx; int order; void recursive(int y, int x, int size) { if (size == 1) { if (y == yy && x == xx) cout << order << endl; return; } size /= 2; int roomY = yy - (y + size); int roomX = xx - (x + size); ...
ALGO
0.999778
3.793598
{ "github_metadata": { "branch": "master", "commit_count": 716, "repo_created_at": "2017-06-29T11:16:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0cdf9097...
3aa95b1c-f1f0-4b53-a55c-e92c0fa8d250
1rcxe/CodeForces-Solutions
A. Team Olympiad.cpp
#include <bits/stdc++.h> #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define ll long long int #define db double using namespace std; ll gcd(ll a , ll b) {return b ? gcd(b , a % b) : a ;} ll lcm(ll a , ll b) {return (a * b) / gcd(a , b);} ll isprime(int n){ for(int i=2;i*i<=n;i++)if...
ALGO
0.999986
3.369059
{ "github_metadata": { "branch": "main", "commit_count": 73, "repo_created_at": "2022-12-25T17:20: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": "c0b97ad7031...
6fd9ec03-e67b-4472-9ace-1dc71868fc1c
jamesblasco/Back-From-Klondike
core/Game.cpp
// // Created by <NAME>, <NAME>, <NAME> on May 2018. // #include "Game.hpp" #include "Perspective.hpp" #include "../figures/Clouds.hpp" #include <sstream> #include <string> #include <sstream> #include <string> //Default initializers Board Game::board; Yoshi Game::yoshi; SkyBox Game::skybox; Logo Game::logo; GameM...
ALGO
0.991493
3.509608
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2018-06-07T08:18: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": "e10071faa...
d6982221-2249-46e6-8fce-fb7c2702a877
manitgupta/Codes
Practice/mincostTrain.cpp
#include <iostream> #include <vector> #include <climits> using namespace std; #define N 4 #define INF 99999 int min(int a, int b) { return (a < b)? a:b; } int minCost(int dest, int src, int cost[][N]) { if (src == dest || src+1 == dest) return cost[src][dest]; int min_val = cost[src][dest]; for (int i = src+...
ALGO
0.999857
3.802399
{ "github_metadata": { "branch": "master", "commit_count": 110, "repo_created_at": "2014-03-20T07:53: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": "df096594...
98ac491e-04ae-4ed4-adba-2bf29122c02f
TYakumo/AtCoder
abc198/D.cpp
#include <cstdio> #include <cstring> #include <algorithm> #include <iostream> #include <vector> #include <map> #include <queue> #include <set> #include <cmath> #include <queue> #include <unordered_map> #include <unordered_set> #include <sstream> #include <iomanip> using namespace std; using VI = vector <int>; using VV...
ALGO
0.999902
4.346161
{ "github_metadata": { "branch": "master", "commit_count": 288, "repo_created_at": "2020-03-15T01:24:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a40f2838...
69d0c8a8-bdf4-4011-b9e9-f9d7aa52de09
ishabhray/Competitive-Programming
codechef/APARTS.cpp
#include <bits/stdc++.h> using namespace std; #define PI 3.141592653589 #define ll long long int #define ld long double #define vi vector<int> #define vl vector<ll> #define ii pair<int,int> #define pb push_back #define mp make_pair #define ff first #define ss second #define pll pair<ll,ll> #define vv vector #define al...
ALGO
0.999981
3.497067
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2021-04-25T07: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": "b359e0caea1...
dbfdf46e-edfd-4c78-949d-6f33e73cb832
oldw4ng/LeetCode
code/321.create-maximum-number.cpp
/* * @lc app=leetcode id=321 lang=cpp * * [321] Create Maximum Number * * https://leetcode.com/problems/create-maximum-number/description/ * * algorithms * Hard (27.33%) * Likes: 826 * Dislikes: 257 * Total Accepted: 41.5K * Total Submissions: 151.8K * Testcase Example: '[3,4,6,5]\n[9,1,2,5,8,3]\n5'...
ALGO
0.99997
6.628053
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2019-02-16T10:47: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": "bfb767b87...
59b8b60a-c127-4fdb-a3d8-a39789cb4f9f
CERN-PH-CMG/cmg-cmssw
RecoVertex/PrimaryVertexProducer/src/DAClusterizerInZ.cc
#include "RecoVertex/PrimaryVertexProducer/interface/DAClusterizerInZ.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h" #include "RecoVertex/VertexPrimitives/interface/VertexException.h" using namespace std; namespace { bool recTra...
ALGO
0.96023
5.578606
{ "github_metadata": { "branch": "heppy_94X_dev", "commit_count": 185721, "repo_created_at": "2013-09-25T08:23:20.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 19, "forks": 242, "issues": 16, "pull_requests": 1 }, "file_meta": { "content_i...
81c5d044-1f73-4077-b4d3-4bfdceea082f
raincross7/code-similarity
codes/train_code/problem173/problem173_234.cpp
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define F first #define S second #define int long long //#define ll long long //#define int unsigned long long #define pb push_back #define double long double using namespace std; using namespace __gnu_pbds; typedef tree<...
ALGO
0.999923
4.194235
{ "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": "66dad5744146...
da5c6637-3b0f-4786-9739-378e050b5a3b
JeongYeonUk/Problem
PROGRAMMERS/탑.cpp
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <cstring> using namespace std; #define endl '\n' typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; vector<int> solution(vector<int> heights) { vector<int> answer; int size = (int)heights.size(); bool...
ALGO
0.999981
4.386672
{ "github_metadata": { "branch": "master", "commit_count": 220, "repo_created_at": "2019-05-25T03:18:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a932f5e1...
68bb4a2b-4671-473c-8b53-d6e974f319b3
CaptainSlowWZY/OI-Code
BZOJ/BZOJ1010.cpp
// BZOJ 1010 // HNOI 2008 #include <cstdio> const int MAXN = 5e4 + 10; typedef long long LL; struct Point { LL x, y; Point(LL x_ = 0, LL y_ = 0) : x(x_), y(y_) {} Point operator-(const Point & p) const { return Point(x - p.x, y - p.y); } LL operator*(const Point & p) const { return x * p.y - y * p.x; } LL dp() ...
ALGO
0.999912
3.493606
{ "github_metadata": { "branch": "master", "commit_count": 364, "repo_created_at": "2018-07-05T00: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": "39329ee3...
3585ea7c-4bef-4afe-82c2-25fc49898062
kmsabrin/UVaSolved
UVaSolved/Volume 100/10065.cpp
#include <math.h> #include <stdio.h> #include <stdlib.h> struct Point { int x, y; } P[111], H[111]; int comp( const void *i, const void *j ) { struct Point* p1 = (struct Point*) i; struct Point* p2 = (struct Point*) j; if ( p1->x == p2->x ) { return p1->y - p2->y; } else { return p1->x - p2->x; } } ...
ALGO
0.998053
3.912337
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2014-08-27T05:36: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": "5c44b6079f...
5f18326a-de27-477b-8668-25db3da350cb
Curzsu/PAT-Basic-Level-Practice
(需复习)1104 天长地久 (20 分).cpp
#include<bits/stdc++.h> using namespace std; #define int long long bool hashtable[111], st[111]; int gcd(int a, int b){ return b ? gcd(b, a % b) : a; } void getPrime(){ for(int i = 2; i < 111; i++){ //埃氏筛 if(!st[i]){ hashtable[i] = true; for(int j = i; j < 111; j += i) st[j] = true; } } } int getS...
ALGO
0.999868
3.719781
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2022-01-21T12:13:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d3d3b645133...
e0ffba2d-ca2c-4d80-a2db-f3dd1197b7a6
crosswalk-project/chromium-crosswalk
content/browser/accessibility/accessibility_tree_formatter.h
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TREE_FORMATTER_H_ #define CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TREE_FORMATTER_H_ #include ...
TOOL
0.937994
7.4168
{ "github_metadata": { "branch": "master", "commit_count": 524739, "repo_created_at": "2013-04-03T23:30:31.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 165, "forks": 211, "issues": 0, "pull_requests": 14 }, "file_meta": { "content_id": "0...
1c748858-b385-41da-912e-108b0460bdd6
xunkai55-ood/SolveRST
ImplementationA/SMST/SMST.h
// // SMST.h // RectilinearSteinerTree // // // TODO(Liang_Xihao) // #ifndef __RectilinearSteinerTree__SMST__ #define __RectilinearSteinerTree__SMST__ #include <vector> #include "../Headers/data_format.h" #include "PointsGenerator.h" namespace imp_a{ class LineStatus{ public: LineStatus(){}; LineStatus(cons...
ALGO
0.983141
4.819035
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2013-09-03T11:07:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "db074e319c...
f4cf96df-3eb7-40e4-bcf2-a649f5ee4325
jsanyam/Codes
Book/sum_in_Path.cpp
#include<cstdio> #include<iostream> #include<queue> using namespace std; struct node { int data; struct node *left, *right; }; void insert_node(struct node **root) { //struct node *temp = (struct node *)malloc(sizeof(struct node)); struct node *temp = new struct node; scanf("%d", &temp->data); ...
ALGO
0.999816
3.759768
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2016-01-18T14:12: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": "f248da74ec...
7050badf-f813-4c27-bb18-743a22c81a3e
qianlv/learning
cplusplusprimer/9/seq_container.cpp
/* * ===================================================================================== * * Filename: seq_container.cpp * * Description: Sequential Containers * * Version: 1.0 * Created: 2015年12月26日 14时30分40秒 CST * Revision: none * Compiler: g++ * * Autho...
TOOL
0.945502
4.077227
{ "github_metadata": { "branch": "master", "commit_count": 287, "repo_created_at": "2015-05-14T02:27:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eb5d8988...
efafaa8d-eb3d-484b-a73d-432dd0fcfe36
Mohamedsayed101/Cpp_and_OOP
Cpp_for_beginners/programming_basic_problems/Aarray-1D/EX1/problem-1.cpp
// Write a C++ program to find the most occurring element in an array of integers. // #include<iostream> // #include<string> // #include<cmath> // using namespace std; // int main() // { // int arr[]={4, 5, 9, 12, 9, 22, 45, 7,22,9,22}; // int size = sizeof(arr) / sizeof(arr[0]); // cout << "orginal array...
ALGO
0.999985
5.85129
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2025-01-22T14:15: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": "a0c9b4ff4...
5b42f580-5f29-4431-9173-b40f984c7457
WilliamQiufeng/CPPCode
CodeForces/1773/E.cpp
/* ID: william234 TASK: E LANG: C++ */ #define PROGRAM_NAME "E" #include <algorithm> #include <cstring> #include <fstream> #include <functional> #include <iostream> #include <limits> #include <map> #include <memory> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #include <iomanip> ...
ALGO
0.999867
3.628338
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2022-12-09T02:02:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f3036f91018...
e5c518e3-de3c-41a3-b8d0-3c44ffc527a1
HappyDuckCoder/leetPractice
removeNthnodefromtheend/solve.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ #include <iostream> using namespace std; struct ...
ALGO
0.999987
5.748124
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2025-01-18T13:45:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4b34feed9...
83b1d7d5-3db5-4f11-8971-95c2399762f8
tssc67/fabric-assignment1
source/main.cpp
//Computational Fabrication Assignment #1 #include <iostream> #include <vector> #include "../include/CompFab.h" #include "../include/Mesh.h" //Ray-Triangle Intersection //Returns 1 if triangle and ray intersect, 0 otherwise int rayTriangleIntersection(CompFab::Ray &ray, CompFab::Triangle &triangle) { /********* AS...
ALGO
0.988257
5.112612
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-09-04T13:22: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": "60976034fd...
e47bcd59-5502-4663-bb37-2d1e921004dc
lixxce5017/Algoritm_Weekly_Baekjoon
백준/Gold/10282. 해킹/해킹.cc
#include<iostream> #include<algorithm> #include<vector> #include<queue> #include <climits> using namespace std; typedef pair<int, int> Node; vector<int>result; vector<vector<Node>>arr; vector<bool>visitied; int n, m, start; void dixtra(int start) { fill(visitied.begin(), visitied.end(), false); fill(result.begin(), r...
ALGO
0.999979
3.7414
{ "github_metadata": { "branch": "main", "commit_count": 497, "repo_created_at": "2023-02-07T05:34: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": "6abbe89a75...
f996db3c-cce4-4340-aaeb-41019e44e7c1
raincross7/code-similarity
codes/train_code/problem179/problem179_67.cpp
#include <iostream> #include <cassert> #include <climits> #include <bitset> #include <stack> #include <queue> #include <iomanip> #include <limits> #include <string> #include <cmath> #include <set> #include <map> #include <math.h> #include <algorithm> #include <vector> #include <string.h> #include <tuple> #include <time...
ALGO
0.999956
3.752723
{ "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": "edda23709c1b...
62551577-3841-4fa2-b92b-1d75c212a9d1
kashimAstro/ofxAutoRiggingModel
src/matrix.cpp
/* This file is part of the Pinocchio automatic rigging library. Copyright (C) 2007 <NAME> (<EMAIL>) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of ...
ALGO
0.999952
4.883403
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2016-11-13T14:53:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 71, "forks": 15, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "06c17ce...
c906ad1a-b510-4274-9801-af97ab99ef62
ebi-fly13/Library
test/data_structure/Predecessor_Problem.test.cpp
#define PROBLEM "https://judge.yosupo.jp/problem/predecessor_problem" #include <iostream> #include <string> #include "../../data_structure/predecessor_set.hpp" int main() { int n, q; std::cin >> n >> q; std::string t; std::cin >> t; ebi::predecessor_set set; for (int i = 0; i < n; i++) { ...
ALGO
0.999603
4.769274
{ "github_metadata": { "branch": "main", "commit_count": 1223, "repo_created_at": "2021-01-04T14:28:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 2, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "a059a8e7f...
b64a2b2e-b861-4c3d-8501-0a0dabed6df4
ChristopherRabotin/GMAT
src/gmatutil/util/AttitudeUtil.cpp
//$Id$ //------------------------------------------------------------------------------ // RealUtilities //------------------------------------------------------------------------------ // GMAT: General Mission Analysis Tool // // Copyright (c) 2002 - 2022 United States Government as repres...
ALGO
0.995113
5.499961
{ "github_metadata": { "branch": "GMAT-R2022a", "commit_count": 1, "repo_created_at": "2017-03-09T03:09:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 52, "forks": 17, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "44a...
11e037c1-d68e-4d6a-a1fc-893487b2151b
SuperZero228/Transportation
Transportation_OOP/templates.cpp
//Гарантия того, что компилятор увидит полное определение шаблона класса Transportation #include "Transportation.h" #include "Transportation.cpp" //нарушаем правила хорошего тона в программировании, но только в этом месте (иначе методы шаблонного класса не скомпилируются) template class Transportation<int>; //явн...
ALGO
0.949636
3.442192
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2021-11-05T13:05:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 5, "pull_requests": 0 }, "file_meta": { "content_id": "3e1755840ff...
4553d34d-8f23-4f50-a775-d52400e6cc93
rzl14/-
acwing3302.cpp
#include <iostream> using namespace std; const int N = 100010; int stk[N], l[N], tt = -1, idx = 0, ttt = -1; char c[N]; bool op[N], op2[N]; bool cmpop(int A, int B) { int a = A, b = B; if (a == '*' || a == '/') a = 1; else a = 0; if (b == '*' || b == '/') b = 1; else b = 0; return (a - b) >=...
ALGO
0.999964
3.791652
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2022-08-14T10:43: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": "c6280f233b52...
07e9aa6a-c18c-491b-9cec-a31a6652f86b
janet-liu809/Sliding-
Sliding.cpp
#include <iostream> #include <cmath> using namespace std; int slideAvg(int inputVoltages[], int sampleSize, int windowSize, float slidingAverage[]){ int numAverages = sampleSize - windowSize + 1; float average = 0; for (int i = 1; i <= numAverages; i++){ for (int x = 0; x < windowSize; x++){ average += input...
TOOL
0.978447
4.873134
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-12-03T18:38: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": "21f78eae74...
314d38e2-ee7c-4418-bb79-dbb127279f0e
chesta123/DSA_fullCourse_lb
vid20_STL.cpp
// Standard template library // 1.) Array #include<iostream> #include<array> using namespace std; int main() { array<int,4>a = {1,2,35,6}; int size = a.siz...
TOOL
0.916688
3.564448
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-06-23T17:30: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": "93e38b018cf0...
5d5e4a02-a331-46ac-b68f-5a2778198947
Matheus-Monteiro/Competitive-Programming
code/data_structures/segment_tree_with_lazy_propagation.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define esq node << 1LL #define dir (node << 1) | 1LL struct SegmentTree { vector<int> tree, lazy; int size; void build(int node, int start, int end, vector<int> &a) { if(start == end) { tree[node] = a[start]; return; } int mid = (...
ALGO
0.999778
3.728895
{ "github_metadata": { "branch": "master", "commit_count": 114, "repo_created_at": "2017-12-09T00:48:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a595b0fe...
5379948a-76eb-4403-82d0-6ab004c50907
iam-rajuan/Problem-Solving
Codeforces-Problem-Solving/Live Contest/1020C.cpp
#include <iostream> #include <vector> #include <limits> using namespace std; void processTestCase() { int n; long long maxValue; cin >> n >> maxValue; vector<long long> first(n), second(n); for (int i = 0; i < n; ++i) cin >> first[i]; for (int i = 0; i < n; ++i) cin >> second[i]; bool ha...
ALGO
0.999842
5.143859
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2024-10-30T20:37:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ae15102d77...
b83c4c1d-1f2a-4738-92f6-8b9d3e99d0bf
elenaisnanocat/codetree-TILs
231128/파스칼의 삼각형/pascal's-triangle.cpp
#include <iostream> using namespace std; int n; int arr[15][15] = {}; int main() { cin >> n; for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { if(i >= j) { arr[i][0] = 1; if(i == j) { arr[i][j] = 1; } ...
ALGO
0.999955
3.919121
{ "github_metadata": { "branch": "main", "commit_count": 1042, "repo_created_at": "2023-11-08T05:45:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f4dc5f38e...
3a609010-ed9b-4b37-8197-c0cc778c0486
JSybrandt/advent-of-code-2023
src/day_3/main.cc
#include <iostream> #include <numeric> #include <string> #include "absl/container/flat_hash_set.h" #include "absl/flags/flag.h" #include "absl/flags/parse.h" #include "src/day_3/util.h" using ::day_3::Grid; using ::day_3::GridNumber; using ::day_3::Pos; int main(int argc, char **argv) { absl::ParseCommandLine(arg...
ALGO
0.976365
5.784397
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2023-12-02T03:36:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d09b71fc2ae...
f046b2f1-728f-4a8a-90cf-8723b8f223b0
xyloid/a_dive_into_ray_tracing
accelerated-rt-cuda/camera.h
#ifndef CAMERA_H #define CAMERA_H #include "rtweekend.h" #include <curand_kernel.h> __device__ vec3 random_in_unit_disk(curandState *local_rand_state) { vec3 p; do { p = 2.0f * vec3(curand_uniform(local_rand_state), curand_uniform(local_rand_state), 0) - vec3(1, 1, 0); } while (...
TOOL
0.946302
6.642662
{ "github_metadata": { "branch": "main", "commit_count": 259, "repo_created_at": "2020-11-22T04:16: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": "71f2f22e7e...
5c84f952-b245-4db3-8269-2968b1dd93c8
cozytk/programmers
dfs/1_mock_test/answer.cpp
#include <string> #include <vector> #include <iostream> using namespace std; vector<int> solution(vector<int> answers) { vector<int> answer; int i = -1; int cnt1 = 0; int cnt2 = 0; int cnt3 = 0; int max = 0; while (answers[++i]) { if (answers[i] == (i % 5 + 1)) cnt1...
ALGO
0.999948
4.451102
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2021-05-26T18:45: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": "370ad17a4...
42ff52fc-ab59-406b-acde-7e864b14f2e1
ishandutta2007/codeforces-a
akim/normal/835/B.cpp
#pragma comment(linker, "/stack:20000000") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx") #include <stdio.h> #include <bits/stdc++.h> #include <x86intrin.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; // tree<key, mapped = null_type, cmp = less<key>,...
ALGO
0.999744
3.792638
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2dcb91e47420...
9ab8e1ce-bbd3-495f-8da5-b8adc3a76b50
geniousisme/CodingInterview
leetCode/C++/96-UniqueBST.cc
#include "include/common.h" // Chris::NTR class Solution { public: int numTrees(int n) { if (n < 2){ return 1; }; vector<int> dp(n + 1, 0); dp[0] = 1; dp[1] = 1; for (int i = 2; i < dp.size(); i++) { dp[i] = catlan_result(dp, i - 1); }; ...
ALGO
0.999973
5.436707
{ "github_metadata": { "branch": "master", "commit_count": 238, "repo_created_at": "2015-10-10T02:39:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "073b9d26...