Advertisement
Matrix_code

chore - template

Feb 14th, 2021
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.88 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. /*------- Constants---- */
  4.  
  5. #define LL                      long long
  6. #define Ulong                   unsigned long long
  7. #define REP(i,n)                for(long long i=0; i < n ; i++ )
  8. #define mp                      make_pair
  9. #define pb                      push_back
  10. #define all(x)                  (x).begin(),(x).end()
  11. #define PI                      acos(-1.0)
  12. #define EPS                     1e-14
  13. #define F                       first
  14. #define S                       second
  15. #define di(x)                   int x; input(x)
  16. #define in(x)                   input(x)
  17. #define in2(x,y)                in(x),in(y)
  18. #define in3(x,y,z)              in(x),in2(y,z)
  19. #define lc                      ((n)<<1)
  20. #define rc                      ((n)<<1|1)
  21. #define db(x)                   cout << #x << " -> " << x << endl
  22. #define nl                      cout<<endl
  23. #define ms(ara_name,value)      memset(ara_name,value,sizeof(ara_name))
  24. #define IO                      ios_base::sync_with_stdio(0);cin.tie(0)
  25. #define READ                    freopen("/home/matrixcode/Desktop/in.txt","r",stdin)
  26. #define WRITE                   freopen("out.txt","w",stdout)
  27. template<class T> inline void input(T &x) {
  28.   register char c = getchar();x = 0;
  29.   int neg = 0;
  30.   for(; ((c<48 || c>57) && c != '-'); c = getchar());
  31.   if(c=='-'){neg = 1;c = getchar();}
  32.   for(; c>47 && c<58 ; c = getchar()){x = (x<<1) + (x<<3) + c - 48;}
  33.   if(neg) x = -x;
  34. }
  35. inline long long bigmod(long long p,long long e,long long M){
  36.   long long ret = 1;
  37.   for(; e > 0; e >>= 1){
  38.     if(e & 1) ret = (ret * p) % M;
  39.     p = (p * p) % M;
  40.   } return ret;
  41. }
  42. template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
  43. template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}
  44.  
  45. /***************************** END OF TEMPLATE *******************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement