#include "cycle.h"
#include <bits/stdc++.h>
using namespace std;
void escape(int n){
if (n==2){ jump(1); return; }
int ret = jump(n/2); if (ret==false) jump(n/2);
int l = 0,r = n,mid,now = 0,nxt;
while(abs(l-r)>1){
mid=(l+r)/2,nxt=(now+n-1)/n*n+mid,ret=jump((nxt-now)%n),now=nxt;
if (ret) l = mid;
else r = mid;
now = nxt;
}
nxt=(now+n-1)/n*n+l,nxt=jump((nxt-now)%n);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
The exit was not found. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Incorrect |
1 ms |
344 KB |
The exit was not found. |
10 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
The exit was not found. |
2 |
Halted |
0 ms |
0 KB |
- |