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>
using namespace std;
#define mod 1000000007L
int main () {
int n, k;
cin >> n >> k;
int ans = 0;
k--;
for(int i = 0;i<n;i++) {
ans = ((2L*(ans%mod))%mod + (k%2 == 1))%mod;
k/=2;
}
cout<<(++ans)%mod<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |