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
647e6172-1f64-4bcd-9aef-df9f0b6a76c6
Dhruv-Rathi/Code
cf798/c.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; typedef vector<ll> vll; typedef vector<int> vii; typedef vector<vector<int>> vvii; typedef vector<vector<ll>> vvll; typedef vector<vector<pi...
ALGO
0.999925
4.776801
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2022-07-14T17:56: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": "52baa911bf...
b11641d1-77e3-439e-9a43-15a44f2fdb96
UniversalRobots/Universal_Robots_Isaac_Driver
ur_controller/JointSegment.hpp
// -- BEGIN LICENSE BLOCK ---------------------------------------------- // Copyright 2021 Universal Robots A/S // // 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...
ALGO
0.998679
7.009604
{ "github_metadata": { "branch": "master", "commit_count": 783, "repo_created_at": "2020-09-23T08:30:11.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 45, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d281dcd...
016c47ce-b7f5-465d-ad0e-782ed469f64d
Exr0nProjects/learn_cpp
problems/cses/graph/x_cycle_finding/x_main_cycle_finding.cpp
/* * Problem cycle_finding (cses/graph/cycle_finding) * Create time: Mon 07 Dec 2020 @ 21:36 (PST) * Accept time: Mon 07 Dec 2020 @ 23:13 (PST) * apparently you need to deduplicate in the queue for spfa? */ #define nt long long #include <set> #include <map> #include <tuple> #include <queue> #include <cstdio> #in...
ALGO
0.999976
3.644493
{ "github_metadata": { "branch": "master", "commit_count": 2744, "repo_created_at": "2019-04-07T20:47:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "47a0953d...
a11296a7-e63c-4bec-b375-8e42bbcb276d
lokilang/KMMI
Simulation/counter_seven_segments/counter_seven_segments.ino
#define A 7 #define B 6 #define C 5 #define D 4 const int segs[4] = {A, B, C, D}; int CA1 = 12; int CA2 = 13; int numbers[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; void setup() { DDRD = B11110000; pinMode(CA1, OUTPUT); pinMode(CA2, OUTPUT); } void loop() { for (int digit1 = 0; digit1 < 10; digit1++) { for (i...
TOOL
0.953845
4.975222
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2021-09-07T04:15:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "27b807eeaa7...
d40f90a2-fd3f-44a3-9bc5-bc37a19c85f5
Hemanth040304/Geeks-For-Geeks
Medium/Maximum Index/maximum-index.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: // A[]: input array // N: size of array // Function to find the maximum index difference. int maxIndexDiff(int a[], int n) { // Your code here vector<int> top...
ALGO
0.999877
5.738686
{ "github_metadata": { "branch": "main", "commit_count": 427, "repo_created_at": "2023-02-25T11:12: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": "69a1a9fac8...
5fb3b197-fb0d-4d0b-8013-349c34817244
csg4786/code
Basic Maths/count_digits.cpp
#include <bits/stdc++.h> using namespace std; // count digits // reverse a number // gcd and lcm // // int count_digits(int n) // O(log(n)) // { // int c = 0; // while (n) // { // n /= 10; // c++; // } // return c; // } // int count_digits(int n) //...
ALGO
0.999901
5.187625
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-08-06T06:19:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "84c8afcf95c4...
a3df8028-4933-4177-8860-109bad85d4c3
Mctashuo/bat_algorithms
ch02/Permutation2.cpp
#include<iostream> using namespace std; //全排列非递归算法 //起点:字典序最小的排列,12345 //终点:字典序最大的排列 54321 //过程:从当前排列生成字典序刚好比它大的下一个排列 // // //步骤:后找,小大,交换,翻转 //后找:字符串中最后一个升序的位置i //小大:S[i+1....N-1]中比Ai大的最小值Sj //交换:Si,Sj; //翻转:S[i+1...N-1] void reverse(int *from,int *to){ while(from < to) { int temp = *to; *to = *fro...
ALGO
0.999922
4.493134
{ "github_metadata": { "branch": "master", "commit_count": 85, "repo_created_at": "2018-07-17T05:18: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": "2b8cca58b...
be4244e3-d781-465b-beff-9c43c798b209
MakinoRuki/Codeforces
R638/1348B.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <algorithm> #include <unordered_map> #include <cmath> #include <set> #define N 105 using namespace std; typedef long long ll; const ll mod = 1000000007LL; int t, n, k; int a[N]; bool vis[N]; int main() { cin>>t; for (int cas=1; cas<...
ALGO
0.99989
3.549624
{ "github_metadata": { "branch": "master", "commit_count": 3630, "repo_created_at": "2017-11-19T03:14: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": "3404df9...
2c2a4e38-7e2c-4494-acdc-3c3cff9d2714
azakrytnoi/uva
vol007/u705/u705.cpp
#ifdef _WIN32 #define UVA_API_EXPORT __declspec(dllexport) #else #define __cdecl #define UVA_API_EXPORT #endif #include "u705.h" #include <iostream> #include <iomanip> #include <vector> #include <string> #include <algorithm> #include <iterator> #include <numeric> #include <limits> extern "C" { UVA_AP...
ALGO
0.998572
3.789462
{ "github_metadata": { "branch": "develop", "commit_count": 752, "repo_created_at": "2016-02-10T16:17:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5498a39...
a7239975-977f-4295-9735-865ac86cc0a0
pratyushvatsalshukla/DataStructures-Using-Cpp
Sum-Of-Elements.cpp
#include<bits/stdc++.h> using namespace std ; struct Node{ int Data ; struct Node *NextNode ; }*first = NULL; void CreateNodes(int A[], int ListLength) { struct Node *LastNode, *ListNodes ; first = new Node ; first->Data = A[0] ; first->NextNode = NULL ; LastNode = first ; for( int ...
ALGO
0.999805
4.372934
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-09-27T05:57:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4dd4f5cfe9...
63a80d21-29a8-4375-94c9-e11bb7c79094
XYXBlAcG/cppcode_backup
3233.cpp
#include <cstdio> #include <vector> #include <algorithm> using std::max; const int N = 2e5 + 5; struct Node{ int v; long long w; }; int n, m; long long distan, hot; std::vector<Node> st[N]; int dep[N], fa[N][20]; long long amax[N][20], p[N], dis[N][20]; void dfs(int x, int father){ dep[x] = dep[father] + 1; ...
ALGO
0.999995
4.155683
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2023-07-22T12:36:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6951cf4c59c...
ca295ccc-6198-45db-9e01-c30fe6e83550
idosavion/fast-matrix-multiplication
v_psi_2_transform.cpp
#include "v_psi_2_transform.hpp" const int FROM_DIM = 10; const int TO_DIM = 11; static inline int transformed_block_size(int block_size, int steps_left) { int base_block_size = block_size / (pow(FROM_DIM, steps_left)); int power = pow(TO_DIM, steps_left-1); return power * base_block_size; } static vo...
ALGO
0.99976
3.871798
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2019-06-01T09:37: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": "5435be9c2...
a2de1d6d-9ccb-4ce6-96b0-1c3940891338
TrifanBogdan24/Probleme-PBINFO
pbinfo/coduri-cpp/clasa-XI/componenteconexe2.cpp
// #537 - ComponenteConexe2 #include <iostream> #include <fstream> using namespace std; ifstream f("componenteconexe2.in"); ofstream g("componenteconexe2.out"); int n, m, a[105][105], nr, NR, x, y, conexe[105], M1[10000], M2[10000], q; bool pus[105]; void dfs(int x, int nr_c_conexa) { pus[x] = 1; conexe[x] ...
ALGO
0.999838
4.159354
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-05-02T23:21:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c56d3f7d2ed...
274247fe-d60c-4884-ba78-ed0c8c27de71
Sanchitjain2003/vehicle-speed-detection
vehicle_speed/vehicle_speed.ino
#define ldrpinA A0 #define ldrpinB A1 #define distBTWlaser 25 // distance between 2 lasers in cm int laserA = 4; int laserB = 5; unsigned long currentMillis = 0; unsigned long elapsedTime = 0; double Speed = 0.0; void setup() { // put your setup code here, to run once: //pinMode (ldrA, INPUT); //change variable to...
TOOL
0.904237
4.72601
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2020-11-24T09:47:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "91c1ec91f887...
5e98f797-2788-41d9-87d8-65bf49b6b1b2
mukel/ProgrammingContests
OldStuff/SPOJ/new3/ssort.cpp
/* <NAME> SPOJ #2277 "Silly Sort" 18 - 9 - 2008 */ #include <cstdio> #include <algorithm> using namespace std; const int MAXN = 2000; int N; bool mark[MAXN]; pair< int, int > ls[MAXN]; int main() { for ( int t = 1;;t++ ) { scanf( "%d", &N ); if ( !N ) break; for ( int i = 0; i < N; i++ ) { scanf( "%d"...
ALGO
0.999895
3.111619
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2013-10-16T00:48:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 16, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5a34e5a...
25047ede-106c-4a56-a152-2928db0ddd32
valentin-stamate/Inline-Assembly-Problems
Problems/BubbleSort.cpp
void bubbleSort(int*, int) { _asm { mov eax, [ebp + 8] mov ebx, [ebp + 12] dec ebx mov esi, 0 for_1: cmp esi, ebx je return_t mov edi, ebx ; n - i - 1 sub edi, esi push esi mov esi, edi ...
ALGO
0.998424
3.80385
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-01-31T19:23: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": "0ab2f0c310...
c0fe876c-6344-48c2-824f-d880ac7d1a67
xoyojank/nebula3
code/extlibs/OGDF/src/energybased/multilevelmixer/MMMExampleNoTwistLayout.cpp
/* * $Revision: 2523 $ * * last checkin: * $Author: gutwenger $ * $Date: 2012-07-02 20:59:27 +0200 (Mon, 02 Jul 2012) $ ***************************************************************/ /** \file * \brief useable example of the Modular Multilevel Mixer * * \author <NAME> * * \par License: * This file is...
ALGO
0.937168
6.292071
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2012-11-23T19:29:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 62, "forks": 38, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e17d4bba...
622331de-5f36-491e-918b-91f3fb671467
juanjosegdoj/Ejercicios-Estructuras-de-Datos
Ejercicios estructuras de datos C++/ESTUDIANTES (est)/TDAListaEstudiantes.h
#include "TDANodoEst.h" #include <iostream> #include <string> using namespace std; using namespace std; /*Nodo Incio de la Lista*/ struct TDAListaEstudiantes{ NodoEst *inicio; NodoEst *actual; } ; /* Por <NAME>. Crea la Lista, moviendo siempre la posición actial al elemento ingresado*/ TDAListaEstudiantes *...
ALGO
0.972812
3.462469
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-06-15T04:03:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "02c7d2bda7...
fcbd198f-6f3f-47f0-97c2-b1fd14de4108
samarps31/Myrepo
Tic_Tac_ToeRough.cpp
#include<iostream> #include<string> using namespace std; int main() { char a[3][3], p, s[10], t='-', p1[20]={'P','l','a','y','e','r','1'}, p2[20]={'P','l','a','y','e','r','2'} ; int i, j, m, n, f; cout<<endl; cout<<"\t Welcome to the Game"<<endl; cout<<"\t Tick Tack Toe"<<endl<<endl<<" Game has the followi...
ALGO
0.998828
3.383103
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-10-01T13:08:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f4b8743aa5...
e8c024b2-461c-4b1d-99df-0aaa0c66de81
krishnaKSA/datastructures
sourcecode/binaryheap.h
#include <iostream> #include <vector> using namespace std; /* class binary heap (priority queue) */ /* This class implemented for MAX_HEAP */ template <typename T> class binaryheap { private: int heaptype; //Max heap or min heap. This class implemented for MAX_HEAP vector<T> heap; //heap datastructure publi...
ALGO
0.999352
4.561321
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-07-18T10:48:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3e0185962d03...
897dd063-9963-4755-8970-c8cf0abb2f7a
theOfficeCat/PRO1
Ejercicios/P9 - Data Structures (tuples)/P26141_en/P26141.cc
// Get a first rational number and then a sequence of operations and another // rational number, operating with the result of the last operation/rational // // Example: // // Input: Operation: Output: // 1 2 1/2 // add 5 2 1/2 + 5/2 3 // substract 2 1 3 - 2/1 1 // multiply 10 1 1 * 10/1 10 // divide 3 1 10...
ALGO
0.999111
4.84973
{ "github_metadata": { "branch": "master", "commit_count": 98, "repo_created_at": "2021-10-01T08:04:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a5c1d6dd...
bfa7562e-ee2e-4c52-964b-a73434fda876
shenyczz/KLibrary
KindMfc/src/新建文件夹/KFormelParser.h
// // FormulaParser.h: interface for the CFormulaParser class. // Copyright: 2004, <NAME> ////////////////////////////////////////////////////////////////////// #pragma once #include "KPhysConst.h" #define ANZFUNKTKONST 10 namespace Math { class KIND_EXT_CLASS CFormulaParser { public: CFormulaParser(); v...
TOOL
0.937169
4.391359
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-09-18T02:00:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2c352a4254...
045b2fb7-28e6-472f-9a1e-d4a18c241935
liuyubobobo/Play-Leetcode
0001-0500/0257-Binary-Tree-Paths/cpp-0257/main3.cpp
/// Source : https://leetcode.com/problems/binary-tree-paths/description/ /// Author : liuyubobobo /// Time : 2018-11-17 #include <iostream> #include <string> #include <vector> #include <stack> using namespace std; /// Definition for a binary tree node. struct TreeNode { int val; TreeNode *left; TreeN...
ALGO
0.999891
5.896687
{ "github_metadata": { "branch": "master", "commit_count": 2592, "repo_created_at": "2016-12-01T17:08:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2732, "forks": 718, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "67...
714f8c9a-3f80-46b1-a3aa-48cc1b1093da
edge555/Online-Judge-Solves
Codeforces/1089-L.cpp
#include <bits/stdc++.h> #define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define pf printf #define sc scanf #define sf(num) scanf("%d",&num) #define sff(num1,num2) scanf("%d %d",&num1,&num2) #define sfff(num1,num2,num3) scanf("%d %d %d",&num1,&num2,&num3) #define sl(num) scanf("%lld",&num) #...
ALGO
0.999886
3.075842
{ "github_metadata": { "branch": "master", "commit_count": 2256, "repo_created_at": "2018-08-23T20:41:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e4bcb1...
f791692a-fcf4-4d7f-ba63-464927cc8280
SpiRIT-Collaboration/SpiRITROOT
reco/RiemannTracking/STRiemannTrackFinder.cc
/** * @brief Track finder using the riemann circle fit * * @author <NAME> (TUM) -- original author * @author <NAME> (TUM) * @author <NAME> (Korea University) * @author <NAME> (Korea University) * * @detail * The algorithm can be configured with correlators * (see STAbsHitTrackCorrelator) * For ...
ALGO
0.998979
4.207015
{ "github_metadata": { "branch": "develop", "commit_count": 1995, "repo_created_at": "2014-05-01T01:20:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 9, "forks": 3, "issues": 7, "pull_requests": 0 }, "file_meta": { "content_id": "df57e93...
8284136b-937d-42e6-adb4-ca29a00778ca
azonalon/PeakFinder
include/SpectralModelFitter.hpp
#include <Eigen/Core> #include "SpectrumGlobalOptimizer.hpp" /** * `Class for fitting spectra with predetermined models` * @return [description] */ class SpectralModelFitter { Eigen::ArrayXd frequencies; Eigen::ArrayXd values; double goal; unsigned maxfev; unsigned nMin; unsigned nMax; publ...
ALGO
0.996529
6.142759
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2018-04-29T12:03: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": "9eb1916aa...
a2acf361-35e4-41b9-8d83-d4f10140d449
antoine-chan-lock/PolarInterpolants
CoarseSimulation/libsim/Tools.cpp
#include "Tools.h" #define PBSTR "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" #define PBWIDTH 60 #include <igl/find.h> MatrixXd Tools::clamp(const MatrixXd &H) { EigenSolver<MatrixXd> es((H + H.transpose()) / 2); MatrixXd D = es.pseudoEigenvalueMatrix(); MatrixXd V = es.pseudoEigenvector...
ALGO
0.980449
4.668936
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-09-02T14:14:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b6cbbdabc63b...
3eaee774-7bbd-41a4-bac7-f20f6433eff5
Gaurav237/CodeForceProblem
1722B.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define F first #define S second #define PB push_back #define EB emplace_back #define rep(i , j , n) for(ll i = j ; i <= n ; i++) #define per(i , j , n) for(ll i = j ; i >= n ; i--) typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector...
ALGO
0.999884
4.655054
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-12-31T09:53: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": "fba95e813839...
628aed8c-497a-45bd-8e3d-e0ac66ae5955
mcdilibob/homework
praktikum/1/matrix.cpp
#include "matrix.h" #include "matrix_io.h" #define EPS 1e-12 /* void debug_print (double *A, double *Inv, int n, int m) { printf ("Mat:\n-------------\n"); print_matrix (A, n, n, m, n); printf ("Inv:\n-------------\n"); print_matrix (Inv, n, n, m, n); printf ("-------------\n"); } */ // matrix functions in...
ALGO
0.999723
4.268848
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2024-09-24T21:40:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "efa693fc2b...
335ff9eb-a92f-449f-9ffd-c366e25203f3
tr0j4n034/SPOJ
CNTINDX2.cpp
// // main.cpp // practice // // Created by Mahmud on 7/19/18. // Copyright © 2018 Mahmud. All rights reserved. // /* O((N + Q) * sqrt(N)) solution using "Split & Rebuild" technique. */ #include <iostream> #include <cstdio> #pragma GCC optimize("-0g") using namespace std; const int S = 200005; const int ...
ALGO
0.99989
5.405277
{ "github_metadata": { "branch": "master", "commit_count": 442, "repo_created_at": "2017-03-20T11:02:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 96, "forks": 67, "issues": 0, "pull_requests": 6 }, "file_meta": { "content_id": "fa43ff...
6466cdb3-0e12-4752-8073-df0cdcbde0e5
Video-Computing-Group/research-code
Context-CRF-Tracker/Inference/c_inference/SwendsenWang.h
#include "MonteCarlo.h" #include "PottsMRF.h" #ifndef __SWENDSEN_WANG__ #define __SWENDSEN_WANG__ class SwendsenWang : public MonteCarlo { /** This class makes inference using Swendsen-Wang sampling method, where in each steps number of clusters can change their states This method is specific for q-...
ALGO
0.998428
6.208217
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2018-02-10T18:16:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 6, "forks": 8, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9b7b82399f...
691f9a58-a9c3-478f-89be-f3f402145e4d
jianglin332/codes
dg.cpp
#include <stdio.h> #include <string.h> #include <ctype.h> #include <algorithm> #include <queue> using namespace std; char buf[20202020]; char *bb = buf; int g() { int r = 0; while (!isdigit(*bb)) bb++; while (isdigit(*bb)) r = r * 10 + *(bb++) - '0'; return r; } int s1[22], sg[20202]; struct ed { int to, nx; }...
ALGO
0.999979
3.431673
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-02-05T12:47: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": "0dfd232dc0...
67ce9862-9ddf-4cee-8bb8-e14129c6d181
Shruti12130/Leetcode-Problems
Unique-BST-II/unique-bst-II.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999978
6.018983
{ "github_metadata": { "branch": "main", "commit_count": 825, "repo_created_at": "2023-08-04T07:25: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": "ea87c5e0c1...
1800e8ad-78a5-454b-b4df-5325bc9d7039
ganeshskudva/Algorithms
Leetcode/Medium/L1104.cpp
/* * 1104. Path In Zigzag Labelled Binary Tree * don't start from first level to find the correct label on the path. * we should start from the end level. * every two adjacent levels has one swapped. * we need to keep the last level for the correct label. */ class Solution { public: vector<int> pathInZigZagTree(int la...
ALGO
0.999989
4.9359
{ "github_metadata": { "branch": "master", "commit_count": 883, "repo_created_at": "2014-10-11T23:07:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "043411b1...
49eb2515-9624-4246-9526-603e264c7224
heiseish/Competitive-Programming
kattis/mia/mia.cpp
#include <bits/stdc++.h> using namespace std; bool mia(int a, int b) { return (a == 1 && b == 2) || (a == 2 && b == 1); } bool doubles(int a, int b) { return a == b; } int create(int a, int b) { return (a > b) ? a * 10 + b : b * 10 + a; } int main() { int s0, s1, r0, r1; while(scanf("%d %d %d %d", &s0, &s1, &r0,...
ALGO
0.999942
3.470116
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2019-03-16T06:47:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "70fec946b...
34141a75-ff62-4da2-b4cf-88e2901c0837
faouellet/Tostitos
TosLang/LLVMBackend/llvmgenerator.cpp
#include "llvmgenerator.h" #include "../AST/declarations.h" #include "../AST/expressions.h" #include <llvm/IR/LLVMContext.h> #include <llvm/IR/Value.h> #include <cassert> using namespace TosLang::FrontEnd; using namespace TosLang::BackEnd; static llvm::Type* ConvertToLLVMType(const TosLang::Common::Type type); st...
TOOL
0.937725
7.464784
{ "github_metadata": { "branch": "master", "commit_count": 505, "repo_created_at": "2015-07-03T00:16:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 1, "issues": 12, "pull_requests": 0 }, "file_meta": { "content_id": "d16affd...
affed0c9-0d0b-4a5e-ae23-619302d8b1c9
Mauricioduque/Parcial-Final
Parcial-Final/disparosofensivos.cpp
#include "disparosofensivos.h" disparosOfensivos::disparosOfensivos(float rdetonacion,float Xd,float Hd,float Ho,QGraphicsItem *parent): QGraphicsItem(parent) { posSprite=0; x=10; y=Ho; direccion=1; r=rdetonacion; Xd_=Xd; Hd_=Hd; Ho_=Ho; setFlag(ItemClipsToShape); sprite=QPixma...
TOOL
0.912345
4.379381
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2021-02-04T15:04: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": "9955c51da...
df8a990e-dc91-493f-b445-bc9635c5156a
luqmanarifin/cp
0-unclassified/visualgo.cpp
/** * taken from visualgo.cpp * SG Preliminary Contest */ #include <bits/stdc++.h> using namespace std; const int N = 1e4 + 5; const long long inf = 1e18; const int mod = 2010000089; long long dist[N]; long long f[N]; vector<pair<int, int>> edge[N]; int main() { int n, m, k; scanf("%d %d %d", &n, &m, &k); ...
ALGO
0.999979
4.504309
{ "github_metadata": { "branch": "master", "commit_count": 772, "repo_created_at": "2016-02-09T04:26:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "9d4a25a7...
d3981a01-0c9f-4d72-b96f-97a8815db4ec
Pigrabbit/coding-test
bfs/wallBreaker.cpp
// Problem: https://www.acmicpc.net/problem/2206 #include <iostream> #include <vector> #include <queue> #include <cstring> const int MAX_WIDTH = 1000, MAX_HEIGHT = 1000; int map[MAX_HEIGHT + 1][MAX_WIDTH + 1]; int shortestDistance[MAX_HEIGHT + 1][MAX_WIDTH + 1][2]; bool visited[MAX_HEIGHT + 1][MAX_WIDTH + 1][2]; int...
ALGO
0.999954
4.135288
{ "github_metadata": { "branch": "master", "commit_count": 174, "repo_created_at": "2020-01-23T05:29: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": "0b0bcec6...
39ed2201-e72d-47bd-a0a6-8333105b9f94
AbduRehaman/CSES-Problem-Solving
Labyrinth.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, a, b) for (int i = a; i < b; i++) typedef vector<int> vi; typedef pair<int, int> pi; typedef vector<pair<int, int>> vpi; typedef vector<vector<int>> vii; typedef vector<long long> vll; typedef vector<long long int> vlli; #define unm(a, b)...
ALGO
0.999991
4.184144
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2023-09-17T11:17:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d3347e5e0b0...
51c6db8f-03f4-4807-bb0e-2b59be3aa1f9
francis1992/AlgorithmContest
TopCoder/AB.cpp
#include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <string> #include <map> #include <set> #include <queue> #include <cmath> #include <iostream> #include <cstdlib> #include <sstream> using namespace std; class AB { public: string createString(int N, int K) { string ans=""; for...
ALGO
0.999931
4.271369
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2016-04-04T03:46:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d2a164baf...
b25608e9-140a-47d8-a768-457dc7fc0b7f
rostard/DormEngine
math/Matrix4f.cpp
// // Created by rostard on 18.12.17. // #include "Matrix4f.h" #include "Vector3f.h" Matrix4f Matrix4f::initIdentity() { m[0][0] = 1; m[0][1] = 0; m[0][2] = 0; m[0][3] = 0; m[1][0] = 0; m[1][1] = 1; m[1][2] = 0; m[1][3] = 0; m[2][0] = 0; m[2][1] = 0; m[2][2] = 1; m[2][3] = 0; m[3][0] = 0; m[3][1] = ...
ALGO
0.95323
5.230686
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2017-12-29T12:59: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": "304cc9205...
a21412a4-8a69-4a3d-b327-4a3e1bbd0d43
wdiiahk/procon-archive
atcoder.jp/arc111/arc111_c/Main.cpp
//デバッグ用オプション:-fsanitize=undefined,address //コンパイラ最適化 #pragma GCC optimize("Ofast") //インクルードなど #include <bits/stdc++.h> // #include <atcoder/all> using namespace std; // using namespace atcoder; typedef long long ll; using vint = vector<int>; using vll = vector<ll>; using vs = vector<string>; using vbool = vector<bo...
ALGO
0.999727
3.922375
{ "github_metadata": { "branch": "main", "commit_count": 544, "repo_created_at": "2021-03-07T00:32: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": "66dc24e35a...
92a74bf2-3778-4588-8123-697058862b06
OpenXRay/xray
SDK/boost_1_30_0/libs/graph/example/subgraph.cpp
//======================================================================= // Copyright 2001 University of Notre Dame. // Author: <NAME> // // This file is part of the Boost Graph Library // // You should have received a copy of the License Agreement for the // Boost Graph Library along with the software; see the file L...
ALGO
0.99738
5.949701
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2019-03-21T12:57:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 104, "forks": 25, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "9a15632b...
b5b5fff1-ec7c-4282-b324-52b2c9ff2293
csc-212-fall-2022/assignment-5
assignment5/Election.cpp
#include "Election.hpp" #include "boost/format.hpp" #include <iostream> namespace assignment5 { Election::Election(const Contest &contest, const std::vector<Candidate> &candidates, const std::vector<Ballot> &ballots) { this->contest = contest; queue = ElectionQueue(candidates...
ALGO
0.99543
5.061294
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2022-10-29T19:40:45.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "68fa6edfcbebd...
7fb8bf72-b82c-431d-93f7-90776643e2eb
lsilvamiguel/Coral.Efficiencies.r14327
src/vertex/Kalman/FindSecondaries.cc
/*! \file FindSecondaries.cc \brief Compass Vertex Pattern Class. \author <NAME> \version $Revision: 1.22 $ \date $Date: 2006/07/05 12:29:23 $ */ #include "CsAverPattern.h" #include "CsGeant3.h" #include "THlx.h" #include "CsEvent.h" #include "CsMCUtils.h" #include "CsOpt.h" using namespace ...
ALGO
0.969602
4.761164
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-04-07T11:56:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6757cb7692...
60982351-8e58-4a6d-8088-c41ad895c3d2
sajjadium/ctf-archives
ctfs/Glacier/2023/pwn/flipper/common/include/ustl/umultiset.h
// This file is part of the uSTL library, an STL implementation. // // Copyright (c) 2005 by <NAME> <<EMAIL>> // This file is free software, distributed under the MIT License. #pragma once #include "uvector.h" #include "ualgo.h" namespace ustl { /// \class multiset umultiset.h ustl.h /// \ingroup AssociativeContaine...
TOOL
0.986942
6.365028
{ "github_metadata": { "branch": "main", "commit_count": 1073, "repo_created_at": "2021-06-10T16:53:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1112, "forks": 159, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "f74c...
951fb926-e0ef-4666-8e3c-d3e1889179ae
animeshf/Competitive_Programming
Algorithms/Maths and DP/FFT/Golf_Bot.cpp
// <NAME> - Kattis #include "bits/stdc++.h" using namespace std; // Start of Integer FFT Template. // Values are computed modulo 1.6e8 // The size of the vectors you pass to the function must be a power of 2 inline long long gcd(long long a, long long b, long long &s, long long &t) { if (b == 0) { t = 0; ...
ALGO
0.999969
3.971288
{ "github_metadata": { "branch": "master", "commit_count": 90, "repo_created_at": "2016-10-12T05:23:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 18, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5ba8dd2d...
0fd00160-b231-4391-b233-53b38daf9cf3
dineshreddy2003/csa-5156-cryptography
crypto-14.cpp
#include <iostream> #include <string> #include <vector> // Function to encrypt plaintext using the key stream std::string encryptVigenereOneTimePad(const std::string& plaintext, const std::vector<int>& keyStream) { std::string ciphertext; int len = plaintext.length(); for (int i = 0; i < len; ++i) { ...
ALGO
0.999785
5.8776
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-07-17T08:08: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": "ea045aec8fb...
ec3c867b-5d2f-46d5-9227-ec3de6fcd40f
Ahmad-Irtaza/OOP_PRACTICE_QUESTION
Ahmad_Irtaza_22p-9316_practice_question/practice3/prb_8/prb8.cpp
#include <iostream> #include <string> class memberType { private: std::string name; int memberID; int numBooksBought; double amountSpent; public: memberType() { name = ""; memberID = 0; numBooksBought = 0; amountSpent = 0.0; } memberType(const std::stri...
TOOL
0.991857
6.071464
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-03-11T17:48: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": "9facd9862f1f...
97e8e8bd-e7f4-4a71-b7bd-7210b55f9909
haipng/cj
lge_cj/LGE_2023_Final1/CuttingStick.cpp
//https://codejam.lge.com/problem/27361 #include <bits/stdc++.h> using namespace std; long long n, k, a,b; long long s[111]; const long long INF = 1e18; long long dp[10010] = {}; long long cost(long long x) { if(x == 1) return 0; return a*(x-1)*(x-1)+b; } void solve() { for(int i=0; i<10010; i++) { dp[i] ...
ALGO
0.999821
3.467885
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2024-09-24T09:13: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": "4b8626b6a81...
fe9538c0-cd72-404a-bef3-36ea72959a6d
Thalisson-Alves/Competitive-Programming
submissions/CodeForces/1702/d.cpp
#include <bits/stdc++.h> using namespace std; #define dff(x) " [" #x "]: " #define df(x) dff(x) << x #define dfn(x) df(x) << '\n' #define dfv(x) dff(x); for (auto y: x) cerr << y << ' '; cerr << '\n'; #define all(x) x.begin(), x.end() using ll = long long; using pii = pair<int, int>; template<typename T=int> inline ...
ALGO
0.999936
4.014368
{ "github_metadata": { "branch": "main", "commit_count": 1114, "repo_created_at": "2023-05-15T00:16:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f4e14fe62...
66ddb8f9-46bf-4a52-885f-769a8ed71655
wolflegend99/Spider-Induction-Tasks-Team-5
Adithya_Qsort.cpp
#include<stdio.h> struct point //the variable is a structure which stores the value of the abcissa and the ordinate { int a,b; }; void swap(point&t1, point&t2) //for swapping { point temp; temp=t1; t1=t2; t2=temp; } int partition(point w[1000], int low, int high) //used to find the position to divide the array int...
ALGO
0.999948
3.87159
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2019-05-15T18:40:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 6, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "878d07003...
64167438-7d7e-4784-9e38-d70dea17e6b6
ex-MingNine9999/algorithm
Problems/boj2250.cpp
//Problem Number : 2250 //Problem Title : 트리의 높이와 너비 //Problem Link : https://www.acmicpc.net/problem/2250 #include <iostream> #include <stack> #include <queue> #include <vector> using namespace std; typedef struct { int par; int left; int right; int level; int index; } tree; int srt[10002]; tree t[10002]; int...
ALGO
0.999825
3.835536
{ "github_metadata": { "branch": "master", "commit_count": 160, "repo_created_at": "2020-03-25T07:39:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f6f5f233...
99fb1d7b-96ba-4038-9603-2ca4b8d77f42
Linby1103/mydemo
MYprojectdemo/MYprojectdemo/tmpmatch.cpp
#include "tmpmatch.h" #include <opencv2/opencv.hpp> /*source*/ using namespace std; using namespace cv; const char* sourceImage = "sourceImage"; Point pre_pt, cur_pt; Mat ReserchImg,tmpImg; Rect SquareRect,drawRect; /*函数声明区*/ void drawing_image(); void Clean(); void Image_fileter(Mat resImg, Mat &output_img); void ma...
TOOL
0.979494
3.450294
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-05-14T07:03: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": "200f8ec25b...
ba9066ca-78d8-4544-8b68-23588887a834
xunilrj/sandbox
courses/coursera-sandiego-algorithms/data-structures/assignment004/set_range_sum/set_range_sum.cpp
#include <iostream> #include <fstream> #include <functional> std::ostream* debugStream(&std::cout); std::ostream& DebugStream() { return *debugStream; } bool runPrintTree = true; std::ofstream nullStream; void BeQuiet() { runPrintTree = false; debugStream = &nullStream; } // Splay tree implementation //...
ALGO
0.99991
4.983891
{ "github_metadata": { "branch": "master", "commit_count": 878, "repo_created_at": "2016-07-31T20:12:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 9, "issues": 0, "pull_requests": 117 }, "file_meta": { "content_id": "2758b...
9077caf3-f653-431f-b435-276c1779b0f0
sunnyinha/codetree-TILs
240525/정수 명령 처리 3/process-numeric-commands-3.cpp
#include <iostream> #include <deque> using namespace std; int main() { int n ; deque <int> d; cin >> n; while(n--) { string s; cin >> s; if(s == "push_front") { int x; cin >> x; d.push_front(x); } else if(s == "pu...
ALGO
0.996913
4.426888
{ "github_metadata": { "branch": "main", "commit_count": 620, "repo_created_at": "2024-03-15T13:15: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": "7825a81a87...
1eb3d6f9-ee7a-4356-8bbd-0da3561b2fb7
ionides/531w16
midterm_project/project8/chickenpox_google_trends_NULL_model.c
// dear emacs, please treat this as -*- C++ -*- // This code was last edited by <NAME> on June 19, 2015 #include <R.h> #include <Rmath.h> #include <math.h> /////////////////////////////////////////////////////////////////// // SET UP SLOTS TO HOLD PARAMETERS, STATE VARIABLES, AND COVARIATES ///////////////////////////...
ALGO
0.994258
6.803658
{ "github_metadata": { "branch": "master", "commit_count": 208, "repo_created_at": "2015-12-17T18:06:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 13, "forks": 55, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1fbf11...
2c25bb36-36d1-4954-9578-f9ea474c6bbb
UndergroundLearning/wspolbiezne
cw1.cpp
#include <iostream> #include <mpi.h> #include <cstdlib> using namespace std; int Max(int *&tab, int n) { int max = tab[0]; for(int i=0; i<n; i++) { if(tab[i] > max) { max = tab[i]; } } return max; } int main(int argc, char **argv) { MPI_Init(&argc, &argv); int rank, size; int n = atoi(argv[1]); MPI_Com...
ALGO
0.999689
3.575727
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2014-10-14T13:14:25.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e22fc8b67a...
e982512f-d142-4ecb-a563-f7027b8126af
pratap8abhishek/Algorithm-and-DataStructure
DSA_Pattern_15/prefixSum/prob2.cpp
#include<bits/stdc++.h> using namespace std; void rangeSumQueries(int arr[],int n,vector<pair<int, int>>& queries){ vector<int> prefix(n); prefix[0] = arr[0]; for(int i = 1; i < n;i++){ prefix[i] = prefix[i-1] + arr[i];; } for(auto q: queries){ int L = q.first; int R = ...
ALGO
0.999915
5.857682
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2024-05-13T16:23: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": "868c666a832...
64f43496-0d26-4b09-af0e-2a998f3e674a
csu-anzai/GeneticLOGIC
TOLKIEN/include/graycode.h
// // TOLKIEN: Tool Kit for Genetics-based Applications // // <NAME>-<NAME>, 1992-93. // Department of Computer Science // The Chinese University of Hong Kong. // #if !defined ( __GRAYCODE_H ) #define __GRAYCODE_H #include "tdefs.h" #include "tvalues.h" class GrayCode { public: ...
ALGO
0.946046
4.513177
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2019-09-04T11:42:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c33cc8375...
9d4b86e1-ac3c-4449-84a7-ed2c850bd391
variani/RcppChoose
libChoose/choose.cpp
#include "choose.hpp" void _sample(int n, int k, vector<int> &l) { unordered_set<int> sample; std::random_device seed; std::mt19937_64 gen(seed()); for(int i = n - k; i < n; ++i) { std::uniform_int_distribution<int> distr(0, i); int s = distr(gen); if(sample.find(s) == sample.end()) { sa...
ALGO
0.999433
5.055227
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2021-02-23T21:46: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": "fece6f9c7a8...
23148865-b210-4011-ace9-60678010d28b
kminami0/AtCoder
atcoder.jp/arc028/arc028_2/Main.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++) #define all(v) v.begin(), v.end() #define sz(v) v.size() #define INF 100000000000000 //10^14 template <typename T> bool chmax(T &a, const T& b) ...
ALGO
0.999998
4.227094
{ "github_metadata": { "branch": "master", "commit_count": 1127, "repo_created_at": "2020-10-01T01:49: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": "beab152...
e2501428-51f7-490b-8c73-0429f1559b75
gilwonlee0/BOJ
16928.cpp
//simple bfs #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #include <algorithm> #include <deque> #include <queue> #include <set> #include <cmath> using namespace std; using ll = long long; const int INF = -1; vector<int> d(101, INF); int adj[101] = { 0, }; void input() { int n, m, x, y; ci...
ALGO
0.999841
3.474645
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2021-04-13T09:07:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0e0cbd88094...
9dba8720-b2ab-4a9f-9a15-1b21f34b06ea
DCTewi/CodeWorkspace
Contests/Luogu/lg1101.cc
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e2 + 5; const int dx[8] = {0, 0, 1, 1, 1, -1, -1, -1}; const int dy[8] = {1, -1, -1, 1, 0, 0, -1, 1}; const string dic = "yizhong"; string mat[MAXN], ans[MAXN]; int n; bool find(int x, int y, int k) { int nx = x, ny = y; for (int i = 0; i < 7; ...
ALGO
0.999896
3.725517
{ "github_metadata": { "branch": "master", "commit_count": 162, "repo_created_at": "2019-03-12T11:11: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": "7b545fee...
9d1ea754-2869-43ab-928c-560db3298f85
mayank7jha1/March-22
Lecture 35/Busy_man.cpp
#include<bits/stdc++.h> using namespace std; // const int N = '0'; // #define int long long #define endl '\n' class Activity { public: int starting_point; int ending_point; }; Activity a[100005]; int n; /*bool compare(Activity a, Activity b) { if (a.ending_point == b.ending_point) { return a.starting_point < ...
ALGO
0.99992
4.257218
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2022-04-16T08:56:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "747876ecbb7...
ee5138f7-48ab-4d0f-96ba-d2dd8e257d82
mzammit001/VirtualStack
VirtualStack/VM.h
#pragma once #include "Common.h" #include "BytecodeParser.h" template <class T> class RegisterFile { public: RegisterFile(int size) : m_reg(new T[size]), m_size(size) {} ~RegisterFile() { delete m_reg; } T& operator[](std::size_t idx) { if (idx > m_size - 1) { ...
TOOL
0.917434
5.592418
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2018-06-15T06:38: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": "dcd82edec3...
fad1d8b4-0281-4763-beb3-881ad6f9ed6e
gKevinK/LeetCode
0501-1000/0971_Flip_Binary_Tree_To_Match_Preorder_Traversal.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { bool f(TreeNode* root, vector<int>& v, int i1, int i2, vector<int>& res) { if (root == nullptr ...
ALGO
0.999994
5.346312
{ "github_metadata": { "branch": "master", "commit_count": 901, "repo_created_at": "2017-12-25T05:10: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": "8197096d...
c1e28ffe-1a96-4e30-917f-76e564c1f10f
mistakk/c_code
c++_mycode/leetcode/l671. Second Minimum Node In a Binary Tree.cpp
using namespace std; #include <string> #include <iostream> #include <vector> #include <algorithm> #include <map> #include <queue> #include <set> template<typename T> void show(vector<T> vec) { for (int i = 0; i < vec.size(); i++) cout << vec[i] << " "; cout << endl; } void show1(map<string, int> mp) { std::map<s...
ALGO
0.999984
4.415123
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-10-15T08:15: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": "796b9e26f6...
ad604091-eb3b-4d85-a0b4-72381be60040
Reayz/programming-and-data-structure
Programming and Data Structure/0Rajib vai/algo/matrix exp.cpp
#include<bits/stdc++.h> using namespace std; #define MOD 1000000007 struct matrix { int v[5][5]; int row,col; }; int mod; matrix multiply(matrix a,matrix b){ assert(a.col == b.row); matrix r; r.row = a.row; r.col = b.col; for(int i=0;i<r.row;i++){ for(int j=0;j<r.col;j++){ ...
ALGO
0.999965
4.064805
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2018-07-01T09:57:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "77338bc50a...
994b9728-3d23-45b1-a6ed-6a45ff3e40e7
yjjj11/algorithm-competition
模板/数据结构/线段树/线段树/扶苏的问题(区间修改+区间加+区间查询).cpp
#include<bits/stdc++.h> using namespace std; #define int long long const int N = 1e6 + 5; struct node { int l, r; int maxn,add,flag; } tr[N * 4]; int n, k, a[N]; void build(int u, int l, int r) { if (l == r) tr[u] = {l, r, a[r], 0, 0}; else { tr[u] = {l, r}; int mid = (l + r) / 2; ...
ALGO
0.999945
5.563326
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-07-10T03:33: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": "ad5db7e7290b...
64991a57-cdcb-48b6-af19-560a6bf786c2
mankul/CodingPractice
GeeksForGeeks/Google/Array/subarrays-with-sum-k_negative.cpp
#include<iostream> #include<map> #include<vector> using namespace std; // works for a unique sum k // solution 1: all suffices to all prefixes of the subarray containing ist element. // space 1, time n^2 // store the all prefixes which includes first element. // subtract all the suffixes in in a loop and try to find ...
ALGO
0.999775
4.533425
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2021-05-16T13:03:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "665b5d07f...
e75e2dc3-73f8-49c8-bf56-e0361d8356c0
raincross7/code-similarity
codes/train_code/problem343/problem343_102.cpp
#include<iostream> #include <cstdio> #include <algorithm> using namespace std; int main() { int a, b, c,d,no; int result[1000]; cin >> no; for (int i = 0; i < no; i++) { cin >> a >> b >> c; d = a; if (d < b) d = b; if (d < c) d = c; if (d == a) { if (a*a == b*b + c*c) result[i] = 1; ...
ALGO
0.999927
4.064597
{ "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": "060624f70337...
88608dcf-bf61-4b09-bf1c-f6d570160f88
yuran1811/Competitive-Programming
C++/VNOI/Practice/STNODE.cpp
// https://oj.vnoi.info/problem/stnode #include <bits/stdc++.h> using namespace std; const int N = 1e4 + 50; int n, m, s, t; vector <bool> kt(N, true); vector <int> a[N], trace(N, 0), pos(N, -1), path; void findd() { queue <int> q; q.push(s); trace[s] = -1; while (q.size()) { int u = q.front(); q.pop(); for...
ALGO
0.999803
3.68352
{ "github_metadata": { "branch": "main", "commit_count": 111, "repo_created_at": "2021-09-30T08:11:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "09b8d24793...
2f00f57d-e652-4dac-b904-ed7b023d3be2
sterjanez/NilCleanMatrices
NilClean5/src/NilClean.h
#ifndef NIL_CLEAN_H #define NIL_CLEAN_H #include <cstdint> #include <vector> #include "Matrix.h" #include "IntegerSet.h" // Methods for finding nil-clean decompositions of index 3 of matrices over F_2. namespace NilClean { // Given n x n matrix A and 0 < p < n, find idempotents E of rank p in block form // E = [I0;X...
ALGO
0.998977
4.941261
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2020-02-22T23:53:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "025c84c79...
cb274dd4-ac80-4515-a937-d7620b5963bd
Liuyi-Wang/LeetCode
src/130_Surrounded_Regions.cpp
/** * Time Complexity: * O(mn) * Space Complexity: * O(1) */ class Solution { public: void solve(vector<vector<char>>& board) { int m = board.size(), n = board[0].size(); d_directions = {{0, -1}, {0, 1}, {-1, 0}, {1, 0}}; for (int i = 0; i < m; ++i) { dfs(board, i, 0); ...
ALGO
0.999873
6.096659
{ "github_metadata": { "branch": "master", "commit_count": 1115, "repo_created_at": "2019-07-12T01:15:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "57dbf7e...
fbde2c42-7fba-41f6-b4d8-5ead1d144719
aaqwesas/MarkovChain_Solver
MarkovChain.cpp
#include "MarkovChain.hpp" MarkovChain::MarkovChain(const std::string &inputFileName, const std::string &outputFileName) : gen(std::random_device{}()), dis(0.0, 1.0) { // Open the input file inputStream.open(inputFileName); if (!inputStream.is_open()) { throw std::runtime_error("Error: Coul...
ALGO
0.999804
6.669118
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-03-28T08:55:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d673c50bcb3e...
83a0db88-afe4-4f7e-99df-f2af660505d9
ysy950803/LeetCodeCPP
tree/range_sum_of_bst.hpp
#include <iostream> #include <stack> #include <queue> #include "tree_node.h" using namespace std; class Solution938 { private: int l, r; int _sum; public: int sumOfNode(TreeNode *node) { if (node == nullptr) { return 0; } int v = node->val; return (l <= v && v <...
ALGO
0.999993
6.87051
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2020-06-27T03:47:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "603c10bd1...
805b6132-3494-4005-b309-f642c38d218e
gstegm/HE_comparison_implementation
OpenFHE_Node-API/greater_than.cc
#include <node_api.h> #include "binfhecontext.h" #include <bitset> using namespace lbcrypto; //void encryptBits(std::vector<bool> bitvector, std::vector<LWECiphertext> ctvec, BinFHEContext cc, LWEPrivateKey sk) { // for (int i=0; i<(int)bitvector.size(); i++) { // ctvec.push_back(cc.Encrypt(sk, bitv...
TOOL
0.968152
5.414924
{ "github_metadata": { "branch": "main", "commit_count": 47, "repo_created_at": "2025-03-26T10:33: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": "cae8cdfa2b3...
c4ca6655-6863-4abc-a415-aed6e9871617
harshit0703/75-days-challenge
day-20/removeNthNodeFromLastinLL.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 { private: int length(ListNode ...
ALGO
0.999954
5.935184
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2022-03-26T19:27:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b080cd64d...
ce6a090f-d8f3-40fb-a1ae-8564ea0cbee1
tzupengwang/PECaveros
contest/WorldFinals/2012/i.cpp
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef long long LL; #define N (1 << 20) #define L(X) (X<<1) #define R(X) (1+(X<<1)) #define mid ((l+r)>>1) struct SegT{ int sum[ N << 1 ] , mn[ N << 1 ]; void init( int no , int l , int r ){ sum[ no ] = 0; mn[ no ] = N; if( l == r ) ...
ALGO
0.999828
3.398711
{ "github_metadata": { "branch": "master", "commit_count": 448, "repo_created_at": "2014-08-20T16:02:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 51, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1df73f0...
1ad3cf1a-229a-4c19-bfab-3562a0142087
Yujeongju/baekjoon
1012.cpp
//1012 유기농배추 #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int arr[55][55]; int cnt=0; int weight, height, k; void egg(int x, int y) { arr[x][y] = 0; if(!(x+1<0 || y < 0 || x+1 >=weight || y>=height) && arr[x+1][y] == 1) egg(x+1, y); if(!(x-1<0 || y < 0 || x-1 >=weight || y>=hei...
ALGO
0.999768
3.540255
{ "github_metadata": { "branch": "master", "commit_count": 105, "repo_created_at": "2019-01-21T11:36:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "32498067...
beef9566-5a38-4c0e-b58f-0ccd4fb81987
ishandutta2007/codeforces-i
ivan100sic/normal/679/A.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; vector<int> p = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 }; void ans(string s) { cout << s << '\n' << flush; exit(0); } bool ...
ALGO
0.99898
3.968833
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T05:39: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": "65548c630199...
52d9c64e-03cd-4e0e-ab52-dc90280b85c5
tarv7/MaratonaDeProgramacao
URI/2243 - Isósceles/2243.cpp
#include<iostream> using namespace std; int main(){ int tam, *vet; int maior = 1; cin >> tam; vet = new int[tam]; for(int i = 0; i < tam; i++) cin >> vet[i]; for(int i = 0; i < tam; i++){ vet[i] = (vet[i] > (i+1)) ? (i+1) : vet[i]; vet[i] = (vet[i] > (tam-i)) ? (tam-i) : vet[i]; } for(int i =...
ALGO
0.999872
3.024575
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-11-08T04:40: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": "c5a56cf9d8...
17818d21-cdb4-4ed8-8e22-50506fb0fcc1
shu8Cream/algorithm
Mathematics/Eratosthenes/eratosthenes.cpp
/** * author: shu8Cream * created: 11.02.2023 12:27:29 **/ #include <bits/stdc++.h> using namespace std; #define overload3(a,b,c,d,...) d #define rep1(i,n) for (int i=0; i<(n); i++) #define rep2(i,a,n) for (int i=(a); i<(n); i++) #define rep(...) overload3(__VA_ARGS__, rep2, rep1)(__VA_ARGS__) #define rrep1(i,n...
ALGO
0.999808
4.778052
{ "github_metadata": { "branch": "main", "commit_count": 189, "repo_created_at": "2020-11-17T05:06:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "ee42a7c84e...
aebae818-7f67-4f00-a866-307bd2ac2ace
GGanj/LeetCode
57.插入区间/插入区间.cpp
/* * @lc app=leetcode.cn id=57 lang=cpp * * [57] 插入区间 * * https://leetcode.cn/problems/insert-interval/description/ * * algorithms * Medium (41.91%) * Likes: 692 * Dislikes: 0 * Total Accepted: 138.6K * Total Submissions: 330.8K * Testcase Example: '[[1,3],[6,9]]\n[2,5]' * * 给你一个 无重叠的 ,按照区间起始端点排序的...
ALGO
0.999961
6.198352
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2022-04-20T13:21: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": "966a343138...
1d82f199-d4e5-48f0-b65c-4b353c7af40c
OneZeroAndTwoZero/own-cppfile
程序/实验舱/class/JiaoLong_6/day_03/比赛/#D、地毯游戏.cpp
#include<bits/stdc++.h> using namespace std; int k,x,y; int ans = 0; int use[105][105]; int dir[4][2][2] = {{{-1,0},{0,-1}}, {{-1,0},{0,1}},{{0,-1},{1,0}},{{0,1},{1,0}}}; int t[3005],xi[3005],yi[3005]; void out(){ for(int i = 0;i < (k * k - 1) / 3;i ++){ printf("%d %d %d\n",t[i],xi[i],yi[i]); } } boo...
ALGO
0.999885
3.18191
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-10-20T03:01:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2113f0ae8df1...
6d543035-c8dc-4355-b78d-7321323a8072
Shubhii-A2Z/DSA
3913-partition-array-to-minimize-xor/partition-array-to-minimize-xor.cpp
class Solution { public: typedef long long ll; ll dp[255][255]; // standard "partition dp" technique int f(int i,int cuts,int k,vector<int> &nums){ if(i>=nums.size()) return INT_MAX; if(cuts==k-1){ // for k subarrays, atmost k-1 cuts r possible int currXor=0; for...
ALGO
0.999913
5.47376
{ "github_metadata": { "branch": "main", "commit_count": 454, "repo_created_at": "2025-02-09T07:08:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2008a2a46a...
9d19bbc0-95e2-40a5-b5be-ded43ad952a9
liusiyuxyfx/MyACM
codeforces/codeforces#387div.2/CF747C.cpp
/************************************************************************* File Name: 747C.cpp ID: Liusiyu BLOG: http://blog.csdn.net/r_o_j LANG: C++ Mail: <EMAIL> Created Time: 2017年01月06日 星期五 11时10分37秒 ************************************************************************/ #include...
ALGO
0.999756
3.482998
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2016-10-10T13:24: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": "427fb0ff2...
1dcc225b-d921-4c0e-b8eb-5e7da62b360b
emcgilliard/CPP_Class
Chapter7/SearchArray.cpp
/****************************************************************************** Search an array *******************************************************************************/ #include <iostream> void fill_array(int a[], int size, int& number_used); void sort(int a[], int number_used); void swap_values(int &v1, i...
ALGO
0.999993
5.009407
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2018-03-03T20:38: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": "4b7cd0c4c...
55798bf9-bed3-4fd5-87bd-a0f803000c08
sharmadotankit/dsa-supreme
Supreme_Two/Queue/ImpelementQueue.cpp
#include<iostream> using namespace std; class Queue{ public: int *arr; int size; int front; int rear; Queue(int size){ arr = new int [size]; front=-1; rear = -1; this->size =size; } void push(int val){ // CHeck full if(...
ALGO
0.994817
4.363962
{ "github_metadata": { "branch": "main", "commit_count": 46, "repo_created_at": "2023-08-05T17:16: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": "a123a285337...
d4c5bf0f-fc8a-43d9-8e09-0fb477bc3ecf
ZaRobot10/Code_end_sem
travelling_salesman_prob.cpp
#include <iostream> #include <climits> #include <math.h> #include <string> #include <cstring> //using strlen in char arrays #include <set> #include <algorithm> #include <vector> #include <fstream> #include <list> #include <stack> #include <queue> #include <unordered_map> #include <map> #include <set> #include <cstdlib>...
ALGO
0.99993
3.276922
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-12-07T07:59: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": "bb8c86e67089...
93812b79-33bf-4af5-899b-4658c7e2ea99
kejpmdt/backpack
Static/Workspace/CODES/algorithm/LCA/section.cpp
#include <iostream> #include <cstdio> #define MAXN 500005 #define MAXM 1000005 using namespace std; int fst[MAXN], nt[MAXM]; int to[MAXM]; int zpld[MAXN], bigc[MAXN], depth[MAXN], fa[MAXN]; int sz[MAXN]; void addline(int a, int b) { static int nw = 0; ++nw; nt[nw] = fst[a]; to[nw] = b; fst[a] = nw; ++...
ALGO
0.999986
3.714007
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-11-06T05:30:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2b7f5984958a...
75b25a55-2c12-4360-9ab4-4abbf8a5c973
InsightSoftwareConsortium/ITK
Modules/Core/Transform/include/itkElasticBodyReciprocalSplineKernelTransform.hxx
/*========================================================================= * * Copyright NumFOCUS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.o...
TOOL
0.960862
6.45128
{ "github_metadata": { "branch": "main", "commit_count": 57165, "repo_created_at": "2010-07-27T15:48:04.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1517, "forks": 701, "issues": 268, "pull_requests": 49 }, "file_meta": { "content_id": "6...
5f38a3ad-7dad-4e8b-925c-1163d5c4dff7
princekumar1291/The-Complete-FAANG-Preparation-DSA-
_03_Array/_03_Hard/_11_reversePair.cpp
#include<bits/stdc++.h> using namespace std; int revPairs(vector<int> v){ int n=v.size(); int count=0; for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ if(v[i] > 2 * v[j]) count++; } } return count; } void merge(vector<int>& v,int low,int mid,int high,int& count){ vector<int> ans; ...
ALGO
0.999973
4.989394
{ "github_metadata": { "branch": "main", "commit_count": 523, "repo_created_at": "2024-06-05T04:05:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "30e0471092...
b9bda4ff-fdc6-422f-a521-382ff40da321
jonvexNutonomy/Jonbot
qtest.cpp
#include <Eigen/Core> #include <Eigen/Geometry> #include <iostream> using namespace std; using namespace Eigen; int main() { // Eigen::Quaterniond q0(1.0, 2.0, 3.0, 4.0); // Eigen::Quaterniond q1(5.0, 6.0, 7.0, 8.0); // Eigen::Quaterniond q2(q0.toRotationMatrix() * q1.toRotationMatrix()); // //Eigen::Quaternio...
ALGO
0.995145
3.69384
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2018-05-30T15:35: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": "1973522572...
6bd55f51-dbd4-4419-bd58-08e368892c4c
shabana45/MissionRnD-CMrndTest3
src/Problem4.cpp
/* Given two Binary Search Trees ,Merge Both of them into a Single Binary Search Tree . The Resultant Binary Search Tree will be BST1 .ie Merge all elements of BST2 into BST1. Example 1: Input : 20 25 / \ / \ 5 30 10 35 Output : Bst 1 : 20 / \ 5 30 \ / \ 10 25 35...
ALGO
0.999974
5.177225
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2016-04-24T06:23:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8c2dc42b67...
9f74d80c-90d2-4d3e-a075-87997fa6db3e
rumentsolov/materials
CPP/OOP/Zadachy-23/4-7-Divisble.by.45/Divisble.by.45.cpp
/* You are given a BigInt.h file with the implementation of a BigInt class which can represent positive integers of any size, can calculate sums of such integers, and has some other useful methods and operators defined. You can use this class in your program if you want to. · The Judge system has a copy of this class ...
ALGO
0.999629
3.382655
{ "github_metadata": { "branch": "master", "commit_count": 30, "repo_created_at": "2023-02-27T13:52:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "902931b48...
33f6aac3-b0a0-4c3a-9baf-e0e616cbb755
sid2001/CodingPrac
Codeforces/round975/qb.cpp
#include <iostream> #include <vector> #include <unordered_map> #define ull unsigned long long using namespace std; void solve() { ull n,q; cin>>n>>q; vector<ull> vec(n); unordered_map<ull,ull> mp; ull points = 0; for(int i = 0;i<n;i++) { cin>>vec[i]; if(i>0) { points = vec[i] - vec[i-1] - 1...
ALGO
0.999785
3.624208
{ "github_metadata": { "branch": "master", "commit_count": 48, "repo_created_at": "2023-09-21T05:29: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": "5a52d5be6...
f254f7fc-00f4-44ce-8ed3-8fd9f4725a6f
RasPlex/OpenPHT
xbmc/utils/TextSearch.h
#pragma once /* * Copyright (C) 2005-2012 Team XBMC * http://www.xbmc.org * * This Program 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 2, or (at your option) * any later...
TOOL
0.949722
5.769524
{ "github_metadata": { "branch": "openpht-1.9", "commit_count": 25886, "repo_created_at": "2015-11-08T18:03:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 599, "forks": 106, "issues": 178, "pull_requests": 2 }, "file_meta": { "content_id...