mirror of
https://gitlab.com/mfocko/Codeforces.git
synced 2024-12-22 07:01:21 +01:00
chore(cpp): add debugging output
Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
e9a7fb0955
commit
7c7377e138
1 changed files with 18 additions and 0 deletions
|
@ -59,6 +59,24 @@ inline void answer(const T &ans) {
|
||||||
inline void yes() { std::cout << "YES\n"; }
|
inline void yes() { std::cout << "YES\n"; }
|
||||||
inline void no() { std::cout << "NO\n"; }
|
inline void no() { std::cout << "NO\n"; }
|
||||||
inline void yesno(bool ans) { std::cout << (ans ? "YES" : "NO") << "\n"; }
|
inline void yesno(bool ans) { std::cout << (ans ? "YES" : "NO") << "\n"; }
|
||||||
|
#pragma endregion /* output */
|
||||||
|
|
||||||
|
#pragma region debug
|
||||||
|
void dbg_out() { std::cerr << std::endl; }
|
||||||
|
template <typename Head, typename... Tail>
|
||||||
|
void dbg_out(Head H, Tail... T) {
|
||||||
|
std::cerr << ' ' << H;
|
||||||
|
dbg_out(T...);
|
||||||
|
}
|
||||||
|
#ifdef LOCAL
|
||||||
|
#define dbg(...) \
|
||||||
|
std::cerr << '[' << __FILE__ << ':' << __LINE__ << "] (" << #__VA_ARGS__ \
|
||||||
|
<< "):", \
|
||||||
|
dbg_out(__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define dbg(...)
|
||||||
|
#endif
|
||||||
|
#pragma endregion debug
|
||||||
|
|
||||||
#pragma region input
|
#pragma region input
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
Loading…
Reference in a new issue