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 mod 1000000007
#define ll long long
using namespace std;
int main()
{
ll n,k;
cin>>n>>k;
ll a[n+1];
a[0]=1;
for(int i=1;i<=n;i++){
a[i]=a[i-1]*2%mod;
}
ll res=0;
while(n!=0){
if(k%2==0){
res=(res+a[n-1])%mod;
}
n--;
k=(k+1)/2;
}
cout<<(res+1)%mod;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |