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 <iostream>
#include <vector>
using namespace std;
using ll = long long;
signed main(){
ll n, k;
cin >> n >> k;
--k;
if(n <= 20){
vector<ll> a = {1};
for(int sz = 1, pw = (1 << (n - 1)); sz <= k; sz *= 2, pw /= 2){
for(int i = 0; i < sz; ++i){
a.push_back(a[i] + pw);
}
}
cout << a[k] << endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |