# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
844702 | konber | Rack (eJOI19_rack) | C++14 | 1 ms | 600 KiB |
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 <cmath>
using namespace std;
typedef long long ll;
int main()
{
ll n; ll k;
scanf("%lld%lld", &n, &k);
ll first=1, last, mid;
if(n > 60) last = pow(10, 18);
else last = pow(2, n);
k--;
while(first != last){
mid = (first+last)/2;
if(k%2==0){
last = mid;
k /= 2;
}
else{
first = mid+1;
k /= 2;
}
}
ll mod=1e9+7;
printf("%lld\n", first%mod);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |