template.hpp
- View this file on GitHub
- Last update: 2026-04-15 22:12:04+07:00
- Include:
#include "template.hpp"
Required by
data-structure/cartesian-tree.hpp
data-structure/fast-set.hpp
graph/twosat.hpp
verify/atcoder/abc193_f.cpp
verify/atcoder/abc259_g.cpp
verify/atcoder/abc347_g.cpp
verify/kattis/thekingofthenorth.cpp
verify/spoj/FASTFLOW.cpp
Verified with
verify/yosupo/convolution/bitwise_and_convolution.test.cpp
verify/yosupo/convolution/bitwise_or_convolution.test.cpp
verify/yosupo/convolution/bitwise_xor_convolution.test.cpp
verify/yosupo/convolution/convolution_mod.test.cpp
verify/yosupo/convolution/convolution_mod_1000000007.test.cpp
verify/yosupo/convolution/gcd_convolution.test.cpp
verify/yosupo/convolution/lcm_convolution.test.cpp
verify/yosupo/convolution/min_plus_convolution_convex_arbitrary.test.cpp
verify/yosupo/data-structure/area_of_union_of_rectangles.test.cpp
verify/yosupo/data-structure/dynamic_sequence_range_affine_range_sum.test.cpp
verify/yosupo/data-structure/line_add_get_min.test.cpp
verify/yosupo/data-structure/persistent_queue.test.cpp
verify/yosupo/data-structure/point_add_range_sum.test.cpp
verify/yosupo/data-structure/point_set_range_composite.test.cpp
verify/yosupo/data-structure/point_set_tree_path_composite_sum.test.cpp
verify/yosupo/data-structure/point_set_tree_path_composite_sum_fixed_root.test.cpp
verify/yosupo/data-structure/predecessor_problem.test.cpp
verify/yosupo/data-structure/range_affine_range_sum.test.cpp
verify/yosupo/data-structure/range_affine_range_sum_lct.test.cpp
verify/yosupo/data-structure/range_reverse_range_sum.test.cpp
verify/yosupo/data-structure/segment_add_get_min.test.cpp
verify/yosupo/data-structure/segment_add_get_min_online.test.cpp
verify/yosupo/data-structure/set_xor_min.test.cpp
verify/yosupo/data-structure/staticrmq.test.cpp
verify/yosupo/data-structure/unionfind.test.cpp
verify/yosupo/data-structure/vertex_add_path_sum.test.cpp
verify/yosupo/data-structure/vertex_add_subtree_sum.test.cpp
verify/yosupo/data-structure/vertex_set_path_composite.test.cpp
verify/yosupo/graph/scc.test.cpp
verify/yosupo/number-theory/sum_of_floor_of_linear.test.cpp
verify/yosupo/other/two_sat.test.cpp
verify/yosupo/polynomial/exp_of_formal_power_series.test.cpp
verify/yosupo/polynomial/inv_of_formal_power_series.test.cpp
verify/yosupo/polynomial/log_of_formal_power_series.test.cpp
verify/yosupo/polynomial/pow_of_formal_power_series.test.cpp
verify/yosupo/string/enumerate_palindromes.test.cpp
verify/yosupo/string/number_of_substrings.test.cpp
verify/yosupo/string/number_of_substrings2.test.cpp
verify/yosupo/string/suffixarray.test.cpp
verify/yosupo/string/zalgorithm.test.cpp
verify/yosupo/tree/cartesian_tree.test.cpp
verify/yosupo/tree/jump_on_tree.test.cpp
verify/yosupo/tree/lca.test.cpp
Code
#pragma once
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define SORT(a) sort(ALL(a))
#define RSORT(a) sort(RALL(a))
#define REV(a) reverse(ALL(a))
#define UNI(a) a.erase(unique(ALL(a)),a.end())
#define SZ(a) (int)(a.size())
#define LB(a,x) (int)(lower_bound(ALL(a),x)-a.begin())
#define UB(a,x) (int)(upper_bound(ALL(a),x)-a.begin())
#define MIN(a) *min_element(ALL(a))
#define MAX(a) *max_element(ALL(a))
using ll = long long;
using db = long double;
using i128 = __int128_t;
using u32 = uint32_t;
using u64 = uint64_t;
const int INF=INT_MAX/2;
const ll LINF=LLONG_MAX/4;
const db DINF=numeric_limits<db>::infinity();
const int MOD=998244353;
const int MOD2=1000000007;
const db EPS=1e-9;
const db PI=acos(db(-1));
template<class T>
using PQ = priority_queue<T,vector<T>,greater<T>>;
#define vv(T,a,n,...) vector<vector<T>> a(n,vector<T>(__VA_ARGS__))
#define vvv(T,a,n,m,...) vector<vector<vector<T>>> a(n,vector<vector<T>>(m,vector<T>(__VA_ARGS__)))
#define vvvv(T,a,n,m,k,...) vector<vector<vector<vector<T>>>> a(n,vector<vector<vector<T>>>(m,vector<vector<T>>(k,vector<T>(__VA_ARGS__))))
template<class T,class U>
bool chmin(T &a,U b){return b<a?a=b,1:0;}
template<class T,class U>
bool chmax(T &a,U b){return a<b?a=b,1:0;}
template<class T,class U>
T SUM(const U &a){return accumulate(ALL(a),T{});}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng64(chrono::steady_clock::now().time_since_epoch().count());#line 2 "template.hpp"
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define SORT(a) sort(ALL(a))
#define RSORT(a) sort(RALL(a))
#define REV(a) reverse(ALL(a))
#define UNI(a) a.erase(unique(ALL(a)),a.end())
#define SZ(a) (int)(a.size())
#define LB(a,x) (int)(lower_bound(ALL(a),x)-a.begin())
#define UB(a,x) (int)(upper_bound(ALL(a),x)-a.begin())
#define MIN(a) *min_element(ALL(a))
#define MAX(a) *max_element(ALL(a))
using ll = long long;
using db = long double;
using i128 = __int128_t;
using u32 = uint32_t;
using u64 = uint64_t;
const int INF=INT_MAX/2;
const ll LINF=LLONG_MAX/4;
const db DINF=numeric_limits<db>::infinity();
const int MOD=998244353;
const int MOD2=1000000007;
const db EPS=1e-9;
const db PI=acos(db(-1));
template<class T>
using PQ = priority_queue<T,vector<T>,greater<T>>;
#define vv(T,a,n,...) vector<vector<T>> a(n,vector<T>(__VA_ARGS__))
#define vvv(T,a,n,m,...) vector<vector<vector<T>>> a(n,vector<vector<T>>(m,vector<T>(__VA_ARGS__)))
#define vvvv(T,a,n,m,k,...) vector<vector<vector<vector<T>>>> a(n,vector<vector<vector<T>>>(m,vector<vector<T>>(k,vector<T>(__VA_ARGS__))))
template<class T,class U>
bool chmin(T &a,U b){return b<a?a=b,1:0;}
template<class T,class U>
bool chmax(T &a,U b){return a<b?a=b,1:0;}
template<class T,class U>
T SUM(const U &a){return accumulate(ALL(a),T{});}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng64(chrono::steady_clock::now().time_since_epoch().count());