# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1099130 | vjudge1 | Rack (eJOI19_rack) | C++17 | 0 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()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int height, node;
cin >> height >> node;
int rows = 1 << height;
std::vector<int> path(height);
for (int j = 0; j < height; ++j) {
path[j] = ((node - 1) >> j) & 1;
}
long long int leaf = 1;
long long 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... |