# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1099114 | vjudge1 | Rack (eJOI19_rack) | C++17 | 1040 ms | 348 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>
#include <cmath>
#include <vector>
using namespace std;
int main()
{
int height, node;
cin >> height >> node;
int rows = 1 << height;
std::vector<int> path(height);
for (int i = 0; i < node; ++i) {
for (int j = 0; j < height; ++j) path[j] = (i >> j) & 1;
}
int leaf = 1;
int set = pow(2, height);
for (int i : path)
{
set = set/2;
if (i == 1) leaf += set;
}
cout << leaf << 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... |