-
Notifications
You must be signed in to change notification settings - Fork 4
/
template-oi.cpp
26 lines (25 loc) · 907 Bytes
/
template-oi.cpp
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
#include <bits/stdc++.h>
using namespace std;
#define ALL(i) i.begin(),i.end()
#define SZ(i) int(i.size())
#define X first
#define Y second
#define eb emplace_back
#define pb push_back
#ifdef tmd
#define debug(...) fprintf(stderr,"#%d-(%s)=",__LINE__,#__VA_ARGS__);_do(__VA_ARGS__);
template<typename T> void _do(T &&x) {cerr<<x<<endl;}
template<typename T, typename ...S> void _do(T &&x, S &&...y) {cerr<<x<<",";_do(y...);}
template<typename IT> ostream& __printRng (ostream& os, IT bg, IT ed) {
os << "{";
for (IT it=bg;it!=ed;it++) {
if (it == bg) os << *it;
else os << "," << *it;
}
return os << "}";
}
template<typename T> ostream& operator << (ostream& os, const vector<T> &v) {return __printRng(os, ALL(v));}
template<typename T, typename S> ostream& operator << (ostream& os, const pair<T,S> &p) {return os<<"("<<p.X<<","<<p.Y<<")";}
#else
#define debug(...)
#endif