Maruf_Hasan

Template_CP_updated

Jul 9th, 2021
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. //In the Name of Allah Most Gracious, Most Merciful//
  2. /*If you want something you've never had, you have to do something you never did.*/
  3.  
  4. #include<bits/stdc++.h>
  5. #include<ext/pb_ds/assoc_container.hpp>
  6. #include<ext/pb_ds/tree_policy.hpp>
  7.  
  8. using namespace std;
  9. using namespace __gnu_pbds;
  10.  
  11.  
  12.  
  13.  
  14.  
  15. #define pb push_back
  16. #define ll long long
  17. #define pii pair<int,int>
  18. #define pll pair<ll,ll>
  19. #define MaxN 201007
  20. #define INF 1e9
  21. #define INFL 1e18
  22. #define PI acos(-1)
  23. #define mp make_pair
  24.  
  25. typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
  26.  
  27. //const int fx[]= {+1,-1,+0,+0};
  28. //const int fy[]= {+0,+0,+1,-1};
  29. //const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1}; // Kings Move
  30. //const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1}; // Kings Move
  31. //const int fx[]={-2, -2, -1, -1, 1, 1, 2, 2}; // Knights Move
  32. //const int fy[]={-1, 1, -2, 2, -2, 2, -1, 1}; // Knights Move
  33.  
  34.  
  35. int gcd(int a, int b)
  36. {
  37. return b ? gcd(b, a%b) : a;
  38. }
  39.  
  40. ll bigmod(ll b,ll p,ll m)
  41. {
  42. ll res=1LL%m;
  43. ll x=b%m;
  44. while(p)
  45. {
  46. if( p & 1LL )res=(res*x) % m;
  47. x=(x*x)%m;
  48. p >>=1LL;
  49. }
  50. return res;
  51. }
  52.  
  53.  
  54.  
  55.  
  56.  
  57. int main()
  58. {
  59.  
  60. // #ifndef ONLINE_JUDGE
  61. // freopen("input.txt","r",stdin);
  62. // freopen("output.txt","w",stdout);
  63. // #endif
  64. ios_base::sync_with_stdio(false);
  65. cin.tie(NULL);
  66. //#ifdef LOCAL_DEFINE
  67. // cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
  68. // #endif
  69. ///Before submit=>
  70. /// *check for integer overflow,array bounds
  71. /// *check for n=1
  72. }
  73.  
  74.  
  75.  
  76.  
  77.  
Advertisement
Add Comment
Please, Sign In to add comment