Kyopro Library
読み取り中…
検索中…
一致する文字列を見つけられません
template.hpp
[詳解]
1
#
pragma
once
2
#
include
<
bits
/
stdc
++
.
h
>
3
using
namespace
std;
4
#
define
ALL
(
x
)
(
x
)
.
begin
(
)
,
(
x
)
.
end
(
)
5
#
define
REP
(
i
,
n
)
for
(
ll
i
=
0
;
i
<
(
ll
)
(
n
)
;
i
++
)
6
#
define
PER
(
i
,
n
)
for
(
ll
i
=
(
ll
)
(
n
)
-
1
;
i
>=
0
;
i
--
)
7
8
template
<
typename
T>
int
LB
(
const
vector<T>& v, T x) {
return
lower_bound(
ALL
(v),x)-v.begin(); }
9
template
<
typename
T>
int
UQ
(T& v) { sort(
ALL
(v)); v.erase(unique(
ALL
(v)),v.end());
return
v.size(); }
10
template
<
typename
T>
bool
chmax
(T &a, T b) {
return
a<b ? a=b,
true
:
false
; }
11
template
<
typename
T>
bool
chmin
(T &a, T b) {
return
a>b ? a=b,
true
:
false
; }
12
template
<
typename
T>
using
rpriority_queue = priority_queue<T,vector<T>,greater<T>>;
13
using
ll=
long
long
;
const
int
INF
=1e9+10;
const
ll
INFL
=4e18;
14
using
ld=
long
double
;
using
lll=__int128_t;
using
ull=
unsigned
long
long
;
15
using
VI=vector<
int
>;
using
VVI=vector<VI>;
using
VL=vector<ll>;
using
VVL=vector<VL>;
16
using
PL=pair<ll,ll>;
using
VP=vector<PL>;
using
WG=vector<vector<pair<
int
,ll>>>;
17
18
19
#
ifdef
LOCAL
20
#
include
"./debug.hpp"
21
#
else
22
#
define
debug
(
...
)
23
#
define
print_line
24
#
endif
25
26
using
std::cout;
INF
const int INF
Definition
template.hpp:13
INFL
const ll INFL
Definition
template.hpp:13
LB
int LB(const vector< T > &v, T x)
Definition
template.hpp:8
chmax
bool chmax(T &a, T b)
Definition
template.hpp:10
ALL
#define ALL(x)
Definition
template.hpp:4
UQ
int UQ(T &v)
Definition
template.hpp:9
chmin
bool chmin(T &a, T b)
Definition
template.hpp:11
template.hpp
構築:
1.13.2