-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommons.hpp
43 lines (36 loc) · 990 Bytes
/
commons.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* @file commons.hpp
* @brief Provides abbreviations and other useful functions.
*/
#ifndef COMMONS_HPP
#define COMMONS_HPP
#include <queue>
#include <utility>
#include <vector>
#include "limits.hpp"
/**
* Abbreviations for common types.
*/
using vi = std::vector<int>;
using vvi = std::vector<vi>;
using vvvi = std::vector<vvi>;
using pii = std::pair<int, int>;
using vpii = std::vector<pii>;
using ll = long long;
using vll = std::vector<long long>;
using vvll = std::vector<vll>;
using vvvll = std::vector<vvll>;
using pll = std::pair<ll, ll>;
using vpll = std::vector<pll>;
/**
* Abbreviation for the STL priority_queue with smaller element at the top.
*/
template <class T>
using min_queue = std::priority_queue<T, std::vector<T>, std::greater<T>>;
/**
* Abbreviation for infinity constant.
*/
template <class T = int> constexpr T INFTY = cp_limits<T>::infinity();
[[maybe_unused]] constexpr int INF = INFTY<>;
[[maybe_unused]] constexpr ll BINF = INFTY<ll>;
#endif