Advertisement
Guest User

969

a guest
Feb 17th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. #define loop(i,from,to) for (int i = from; i < to; ++i)
  2. #define qAll(q) q.begin(), q.end()
  3. #include <bits/stdc++.h>
  4.    
  5. using std::cin;
  6. using std::cout;
  7. using std::endl;
  8. using std::vector;
  9. using std::string;
  10. using std::pair;
  11. using std::set;
  12.  
  13. const int INF = 1e9+7;
  14. const double eps = 1e-6;
  15. template <typename T> void reverse(T &a) {
  16.   long long s = a.size();
  17.   for (long long i = 0; i < s / 2; ++i)
  18.     std::swap(a[i], a[s - i - 1]);
  19. }
  20.  
  21.  
  22. signed main() {
  23.   std::ios::sync_with_stdio(false);
  24.   cin.tie(0);
  25.   cout.tie();
  26.   int n, m; cin >> n >> m;
  27.   int res = 2;
  28.   for (int i = 2; i <= n; ++i)
  29.     res = (res * 2) % m;
  30.   int res2 = 2;
  31.   for (int i = 2; i <= res; ++i)
  32.     res2 = (res2 * 2) % m;
  33.   cout << res2;
  34.   //std::cout << "Hello World!\n";
  35.   return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement