diff --git a/.common/cpp/skeleton.cpp b/.common/cpp/skeleton.cpp index 5ce8bb9..da8fc11 100644 --- a/.common/cpp/skeleton.cpp +++ b/.common/cpp/skeleton.cpp @@ -59,6 +59,24 @@ inline void answer(const T &ans) { inline void yes() { std::cout << "YES\n"; } inline void no() { std::cout << "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 +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 template