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;
typedef long long int ll;
typedef long double ld;
int main()
{
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(0);
ll n, k;
cin >> n >> k;
vector<ll> v = {1, (1 << (n - 1)) + 1};
ll sum = (1 << (n - 2));
while (sum > 0)
{
ll sz = v.size();
for (int i = 0; i < sz; i++)
{
v.push_back(v[i] + sum);
}
sum /= 2;
}
cout << v[k - 1];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |