| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 972109 | sleepntsheep | Rack (eJOI19_rack) | C11 | 29 ms | 34728 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 <stdio.h>
#define MOD 1000000007ll
#define N 1000005
int p2[N];
long long n, k;
long long a(long long k,long long l,long long r,int d)
{
if(d==n)return 1;
if(k&1) return a((k+1)/2, l, r-1, d+1) % MOD;
else return (a(k/2, l+1, r, d+1) + p2[n-1-d]) % MOD;
}
int main()
{
p2[0]=1;for(int i=1;i<N;++i)p2[i]=(p2[i-1]<<1)%MOD;
scanf("%lld%lld",&n,&k);
printf("%lld",a(k,0,n,0));
}
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... | ||||
