Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <cmath>
- #include <iostream>
- #include <map>
- #include <set>
- #include <string>
- #include <tuple>
- #include <unordered_map>
- #include <unordered_set>
- #include <vector>
- typedef long long ll;
- typedef unsigned long long ull;
- using namespace std;
- // Святослав и КЦ
- int main() {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- int n = 0, x = 0;
- cin >> n >> x;
- ull result = 1;
- --x;
- --n; // Максимальная степень двойки, которую можем использовать.
- while (x > 0) {
- result += 1ull << n;
- --n;
- --x;
- }
- cout << result << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement