이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cycle.h"
bool move(int& cur, int end, int n) {
bool ans;
if(cur <= end) ans = jump(end - cur);
else ans = jump(n + end - cur);
cur = end;
return ans;
}
void escape(int n) {
bool ini = jump(0);
int cur = 0;
int l = 0, r = n/2 + 1;
while(l + 1 < r) {
int m = (l + r) >> 1;
if(move(cur, m, n) == ini) l = m;
else r = m;
}
if(ini) move(cur, l, n);
else {
move(cur, r + n / 2, n);
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |