Advertisement
ainem

template

May 19th, 2021 (edited)
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.68 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. void __print(int x) {cerr << x;}
  5. void __print(long x) {cerr << x;}
  6. void __print(long long x) {cerr << x;}
  7. void __print(unsigned x) {cerr << x;}
  8. void __print(unsigned long x) {cerr << x;}
  9. void __print(unsigned long long x) {cerr << x;}
  10. void __print(float x) {cerr << x;}
  11. void __print(double x) {cerr << x;}
  12. void __print(long double x) {cerr << x;}
  13. void __print(char x) {cerr << '\'' << x << '\'';}
  14. void __print(const char *x) {cerr << '\"' << x << '\"';}
  15. void __print(const string &x) {cerr << '\"' << x << '\"';}
  16. void __print(bool x) {cerr << (x ? "true" : "false");}
  17.  
  18. template<typename T, typename V>
  19. void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
  20. template<typename T>
  21. void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
  22. void _print() {cerr << "]\n";}
  23. template <typename T, typename... V>
  24. void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
  25. #ifndef ONLINE_JUDGE
  26. #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
  27. #else
  28. #define debug(x...)
  29. #endif
  30.  
  31. using ll = long long;
  32. using ld = long double;
  33. typedef pair<int, int> ii;
  34.  
  35. const int N = 1e5 + 5;
  36. const int MOD = 1e9 + 7;
  37. const int oo = 1e9;
  38.  
  39. #define sz(a) (int)a.size();
  40. #define endl '\n'
  41. #define all(a) a.begin(), a.end()
  42. #define rall(a) a.rbegin(), a.rend()
  43.  
  44. void solve() {
  45.     // Do something
  46.    
  47. }
  48. int main(void) {
  49.     ios_base::sync_with_stdio(false);
  50.     cin.tie(0);
  51.  
  52.     //freopen("main.INP", "r", stdin);
  53.     //freopen("main.OUT", "w", stdout);
  54.  
  55.     int tc = 1;
  56.     // cin >> tc;
  57.     while (tc--) {
  58.         solve();
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement