-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.template-debug.cpp
More file actions
95 lines (80 loc) · 2.31 KB
/
.template-debug.cpp
File metadata and controls
95 lines (80 loc) · 2.31 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define IF(cond, t, f) (cond ? t : f)
#define OFILE(finp, fout) freopen(finp, "r", stdin), freopen(fout, "w", stdout)
#define FAST_IO ios_base::sync_with_stdio(false), (void)cin.tie()
#define MULTI \
int t; \
cin >> t; \
while (t--)
template <class T, class V>
ostream &operator<<(ostream &o, pair<T, V> p);
#define P(T, O, C) \
template <class U> \
ostream &operator<<(ostream &o, T<U> v) \
{ \
o << O; \
int f = 0; \
for (auto &i : v) \
o << (f++ ? ", " : "") << i; \
return o << C; \
}
#define Q(T, O, C) \
template <class K, class V> \
ostream &operator<<(ostream &o, T<K, V> v) \
{ \
o << O; \
int f = 0; \
for (auto &i : v) \
o << (f++ ? ", " : "") << i; \
return o << C; \
}
P(vector, '[', ']')
P(set, '{', '}')
Q(map, '{', '}')
template <class T, class V>
ostream &operator<<(ostream &o, pair<T, V> p)
{
return o << "(" << p.first << ", " << p.second << ")";
}
template <class T, size_t N>
ostream &operator<<(ostream &o, array<T, N> v)
{
o << "[";
int f = 0;
for (auto &i : v)
o << (f++ ? ", " : "") << i;
return o << "]";
}
void dbg(const char *s) { cerr << endl; }
template <class T, class... A>
void dbg(const char *s, T v, A... a)
{
const char *c = s;
int b = 0;
while (*c && (*c != ',' || b))
b += bool(strchr("({[", *c)), b -= bool(strchr(")}]", *c)), c++;
cerr.write(s, c - s) << " = " << v << (sizeof...(a) ? " |" : "");
if (sizeof...(a))
dbg(c + 1, a...);
else
cerr << endl;
}
#ifdef LOCAL
#define debug(...) dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) 42
#endif
void solve()
{
//
}
signed main()
{
FAST_IO;
// MULTI
solve();
return 0;
}