| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1028445 | raphaelp | Rack (eJOI19_rack) | C++14 | 8 ms | 8068 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>
using namespace std;
int main()
{
long long N, K;
cin >> N >> K;
K--;
long long x = 1;
long long MOD = 1000000007;
vector<long long> power(N);
long long base = 1;
for (long long i = 0; i < N; i++)
{
power[i] = base;
base *= 2;
base = base % MOD;
}
for (long long i = 0; i < N; i++)
{
if (K % 2)
{
x = (x + power[N - i - 1]) % MOD;
}
K /= 2;
}
cout << x;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
