# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
712898 | | KoD | Hop (COCI21_hop) | C++17 | | 39 ms | 1296 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 <array>
#include <iostream>
#include <vector>
int main() {
int n;
std::cin >> n;
std::vector<std::array<int, 3>> a(n);
for (int i = 0; i < n; ++i) {
long long x;
std::cin >> x;
int log = 64 - __builtin_clzll(x);
for (int k = 0; k < 3; ++k) {
a[i][k] = log % 4;
log /= 4;
}
}
for (int j = 1; j < n; ++j) {
for (int i = 0; i < j; ++i) {
int k = 2;
while (k > 0 and a[i][k] == a[j][k]) {
k -= 1;
}
std::cout << k + 1 << " \n"[i == j - 1];
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |