Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <assert.h>
- #include <bits/stdc++.h>
- using namespace std;
- #define dbg(...) logger(#__VA_ARGS__, __VA_ARGS__)
- template <typename... Args> void logger(string vars, Args &&... values)
- {
- cerr << vars << " = ";
- string delim = "";
- (..., (cerr << delim << values, delim = ", "));
- cerr << endl;
- }
- #define DEBUG
- #ifdef DEBUG
- #define DEBUG_CMD(cmd) \
- do { \
- cmd; \
- } while (false)
- #else
- #define DEBUG_CMD(cmd) \
- do { \
- ; \
- } while (false)
- #endif
- #define _DEBUG_CMD(cmd) \
- do { \
- ; \
- } while (false)
- template <class T> using mpq = priority_queue<T, vector<T>, greater<T>>;
- using ll = long long;
- using pii = pair<int, int>;
- int main(int argc, char **argv)
- {
- int a = 1, b = 2, c = 3;
- dbg(a, b, c);
- DEBUG_CMD({
- static int dbg_val = 0;
- if (((dbg_val++) % 100) == 0) {
- printf("in every 100 run, a=%d b=%d c=%d\n", a, b, c);
- }
- });
- return 0;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement