# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
237667 | tb_03 | Rack (eJOI19_rack) | C++14 | 9 ms | 384 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 <iostream>
using namespace std;
typedef unsigned long long ll;
const ll modulo = 1000000007;
ll n, k;
bool ans[1000005];
void recursiva(ll level, ll casacos)
{
if (level == n)
return;
if (casacos % 2 == 0)
recursiva(level + 1, casacos / 2);
else
{
ans[level] = true;
recursiva(level + 1, (casacos - 1) / 2);
}
}
int main()
{
cin >> n >> k;
recursiva(0, k - 1);
ll res = 0;
for (int i = 0; i < n; i++)
res = ((res << 1) | ans[i]) % modulo;
cout << res + 1 << endl;
return 0;
}
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... |