# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1137283 | Dragos1 | Rack (eJOI19_rack) | C++20 | 7 ms | 8004 KiB |
#include <iostream>
using namespace std;
const long long MOD=1e9+7;
long long n,k,ans=1;
long long putere[1000002];
int main()
{
cin>>n>>k;
putere[0]=1;
for(int i=1;i<=n;i++)
putere[i]=putere[i-1]*2 , putere[i]%=MOD;
while(k>1)
{
if(k%2==0)
ans+=(putere[n-1]) , ans%=MOD;
n--;
k++;
k/=2;
}
cout<<ans;
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... |