#include "cycle.h"
void escape(int n) {
bool result = jump(1);
if(result!=1) jump(n/2);
long long pos = 0; long long Lpos = 0; long long Rpos = n/2; long long mid;
for(;;) {
mid = (Lpos+Rpos)/2;
if(Lpos==Rpos) {
return;
}
else if (pos > mid) result = jump(n-(pos-mid));
else result = jump(mid-pos);
if (result==1) Lpos = mid+1;
else Rpos = mid;
pos = mid;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Incorrect |
0 ms |
256 KB |
The exit was not found. |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
The exit was not found. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Incorrect |
0 ms |
256 KB |
The exit was not found. |
4 |
Halted |
0 ms |
0 KB |
- |