This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
using namespace std; | |
using u32=uint32_t; | |
struct xorshift32_gen | |
{ | |
const u32 default_seed = 1; | |
u32 cur; | |
using result_type=u32; | |
xorshift32_gen():cur(default_seed){} | |
xorshift32_gen(u32 sd):cur(sd){} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct sizedinput | |
{ | |
int sz; | |
template<class T> | |
operator T() | |
{ | |
T a(sz);for(auto&k:a)cin>>k;return a; | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<functional> | |
#include<map> | |
#include<tuple> | |
using namespace std; | |
// start class definition | |
template<class> | |
struct memoize{}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<algorithm> | |
#include<vector> | |
#include<cmath> | |
using namespace std; | |
struct Query | |
{ | |
size_t idx,s,e; | |
long long ord; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
#include<map> | |
#include<functional> | |
using namespace std; | |
using ll=long long; | |
template<class T> | |
vector<vector<T>> decomp(vector<T> vec) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
using namespace std; | |
//트라이 (trie) | |
struct TrieNode | |
{ | |
TrieNode* child[256]; | |
int contains[256]={0}; | |
int childcnt=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<iomanip> | |
#include<utility> | |
#include<algorithm> | |
#include<list> | |
using namespace std; | |
template<class K, class V, size_t sz> | |
struct HashTable | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<type_traits> | |
using namespace std; | |
using ll=long long; | |
template<ll val> | |
using llconst=integral_constant<ll,val>; | |
constexpr ll mod=1000000007; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
using namespace std; | |
template<class T, class Comp=greater<T> > | |
struct heap{ | |
vector<T> data; | |
Comp cmp; | |
heap(){data.push_back({});} | |
void push(T t){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<exception> | |
using namespace std; | |
//////// BEGIN STRUCT DEFINITION //////// | |
template<class T, size_t sz> | |
struct circular_buffer | |
{ | |
struct It | |
{ | |
circular_buffer<T,sz>∥ |