| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 288453 | topovik | Rack (eJOI19_rack) | C++14 | 19 ms | 8684 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 <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define INF 1000000000
using namespace std;
typedef long long ll;
typedef long double ld;
const ll oo = 1e9+7;
const ll N = 1e6;
int main()
{
    ll n,k;
    cin>>n>>k;
    vector <ll> steps;
    for (ll i=0; i<n; i++)
    {
        if (!(k&1))
        {
            k>>=1;
            steps.pb(1);
        }
        else {steps.pb(0);k=(k+1)/2;}
    }
    ll ans=0;
    for (ll i=0; i<steps.size(); i++) ans=(ans*2+steps[i])%oo;
    cout<<1+ans;
}
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... | ||||
