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 int ll
using ll = long long;
const int MOD = 1e9 + 7;
signed main() {
std::ios_base::sync_with_stdio(0);
std::cin.tie(0);
int n, k;
std::cin >> n >> k;
int answer = 0;
k--;
for (int i = 1; i <= n; i++) {
answer = (answer * 2 % MOD + k % 2) % MOD;
k /= 2;
}
answer++;
std::cout << answer % 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... |