This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int N, numIter;
int ans = 0;
signed main() {
cin >> N >> numIter;
numIter--;
for (int i = 0; i <= 20; i++) {
bool filled = (numIter & (1 << i));
ans += (1 << (N - i - 1)) * filled;
}
cout << ans+1 << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |