이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <popa.h>
int solve(int N, int* Left, int* Right) {
int rt = 0, last = 0;
for (int i = 0; i < N; ++i) Left[i] = Right[i] = -1;
for (int i = 1; i < N; ++i) {
int same = query(0, rt, rt, i);
//cout << 0 << " " << rt << " vs " << rt << " " << i << " :: " << same << endl;
if (same) {
Right[last] = i;
last = i;
}
else {
Left[i] = rt;
rt = i;
last = i;
}
}
return rt;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |