| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1245285 | boyan2010 | Rack (eJOI19_rack) | C++20 | 97 ms | 408 KiB |
#include<bits/stdc++.h>
using namespace std;
long long n,k;
const long long mod=1e9+7;
long long f(long long k)
{
if(k==0)
{
return 0;
}
long long pow=0,prod=1;
while(prod<=k)
{
prod*=2;
pow++;
}
prod/=2;
pow--;
long long one=1;
for(int i=1;i<n-pow;i++)
{
one*=2;
one%=mod;
}
return (f(k-prod)+one)%mod;
}
int main()
{
cin>>n>>k;
if(k==1)
{
cout<<1;
return 0;
}
k--;
cout<<(f(k)+1)%mod;
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... | ||||
