# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
603811 | Lextyle | Rack (eJOI19_rack) | C++17 | 7 ms | 4052 KiB |
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>
#pragma warning(disable : 4996)
#pragma warning(disable : 6031)
#define USACO freopen("clumsy.in", "r", stdin); freopen("clumsy.out", "w+", stdout);
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
int powmod[1000000];
int main() {
//USACO;
fastIO;
int n, ans = 1;
long long k;
cin >> n >> k;
powmod[0] = 1;
for (int i = 1; i < n; i++) powmod[i] = (powmod[i - 1] * 2) % 1000000007;
for (int i = n - 1, j = 0; i >= 0; i--, j++) {
if (k % 2 == 0) ans = (ans + powmod[i]) % 1000000007;
k = k / 2 + (k % 2);
}
cout << ans << "\n";
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |