Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define loop(i,from,to) for (int i = from; i < to; ++i)
- #define qAll(q) q.begin(), q.end()
- #include <bits/stdc++.h>
- using std::cin;
- using std::cout;
- using std::endl;
- using std::vector;
- using std::string;
- using std::pair;
- using std::set;
- const int INF = 1e9+7;
- const double eps = 1e-6;
- template <typename T> void reverse(T &a) {
- long long s = a.size();
- for (long long i = 0; i < s / 2; ++i)
- std::swap(a[i], a[s - i - 1]);
- }
- signed main() {
- std::ios::sync_with_stdio(false);
- cin.tie(0);
- cout.tie();
- int n, m; cin >> n >> m;
- int res = 2;
- for (int i = 2; i <= n; ++i)
- res = (res * 2) % m;
- int res2 = 2;
- for (int i = 2; i <= res; ++i)
- res2 = (res2 * 2) % m;
- cout << res2;
- //std::cout << "Hello World!\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement