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 1000000007ll
#define int long long
using namespace std;
int n, k, re;
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.precision(10);
cout << fixed;
cin >> n >> k;
--k;
re = 0;
//vom inversa pe k
for(int i = 1; i <= n; ++i)
{
re = (re * 2 % MOD + k%2) % MOD;
k /= 2;
}
cout << (re+1)%MOD << "\n";
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... |