# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1237555 | zadniprovska | Xylophone (JOI18_xylophone) | C++20 | 0 ms | 392 KiB |
#include "xylophone.h"
void solve(int N) {
int pos;
for (int i=N-1; i>=1; i--) {
int val = query(i, N);
if (val == N-1) {
pos = i;
answer(i, 1);
break;
}
}
for (int i=pos-1; i>=1; i--) {
int val = query(i, pos);
answer(i, val+1);
}
for (int i=pos+1; i<=N; i++) {
int val = query(pos, i);
answer(i, val+1);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |