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>
using namespace std;
const int MOD = 1e9 + 7;
int main()
{
int n;
long long k;
cin >> n >> k;
long long p = 1LL << (n - 1);
long long rez = 1;
k--;
while (k != 0)
{
if (k % 2 != 0)
{
rez += p;
rez %= MOD;
}
p /= 2;
k /= 2;
}
cout << rez;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |