Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. #ifndef LOCAL
  2. #pragma GCC optimize("O3")
  3. #endif
  4. #include <bits/stdc++.h>
  5. using namespace std;
  6. #define R22(r) template <class c> typename enable_if<sizeof(dud<c>(0)) r,muu&>::type operator<<(c g)
  7. template <class c> struct rge {c b, e;};
  8. template <class c> rge<c> range(c i, c j) {return rge<c>{i, j};}
  9. template <class c> auto dud(c*r)->decltype(cerr << *r);
  10. template <class c> char dud(...);
  11. struct muu {
  12. #ifdef LOCAL
  13. stringstream a;
  14. ~muu() {cerr << a.str() << endl;}
  15. R22(>=2) {a << boolalpha << g; return *this;}
  16. R22(==1) {return *this << range(begin(g), end(g));}
  17. template <class c > muu & operator<<( rge<c> u) {
  18. a << "[";
  19. for (c i = u.b; i != u.e; ++i)
  20. *this << ", " + 2 * (i == u.b) << *i;
  21. return *this << "]";
  22. }
  23. template <class c, class m > muu & operator<<( pair <m,c> r) {return *this << "(" << r.first << ", " << r.second << ")";}
  24. #else
  25. template <class c > muu & operator<<( const c&){return *this;}
  26. #endif
  27. muu & operator()(){return *this;}
  28. };
  29. #define imie(r) "[" #r ": " << (r) << "] "
  30. #define debug (muu() << __FUNCTION__ << "#" << __LINE__ << ": ")
  31. template<typename T, typename S> pair<T, S> operator+(pair<T,S> a, pair<T,S>b) {return {a.first+b.first, a.second+b.second};}
  32. using ll = long long;
  33. using ull = unsigned long long;
  34. using ld = long double;
  35. using pld = pair<ld, ld>;
  36. using pii = pair<int, int>;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement