#include <bits/stdc++.h>
#include "cycle.h"
using namespace std;
void escape(int n){
bool chk;
int half = n/2;
if (!jump(half)){
chk = jump(n-half);
}
int l=0, r=half, prevjump=n;
while (l+1<r){
int mid = (l+r)/2;
chk = jump((mid+n-prevjump)%n);
if (chk) l=mid;
else r=mid-1;
prevjump = mid;
}
chk = jump((l+n-prevjump)%n);
if (l+1 == r){
if (!jump(1)){
chk = jump(n-1);
}
}
return;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Incorrect |
4 ms |
256 KB |
The exit was not found. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
4 ms |
256 KB |
Output is correct |
3 |
Correct |
5 ms |
256 KB |
Output is correct |
4 |
Correct |
5 ms |
256 KB |
Output is correct |
5 |
Correct |
5 ms |
288 KB |
Output is correct |
6 |
Correct |
5 ms |
256 KB |
Output is correct |
7 |
Correct |
5 ms |
256 KB |
Output is correct |
8 |
Correct |
5 ms |
384 KB |
Output is correct |
9 |
Correct |
5 ms |
256 KB |
Output is correct |
10 |
Correct |
5 ms |
256 KB |
Output is correct |
11 |
Correct |
5 ms |
384 KB |
Output is correct |
12 |
Correct |
5 ms |
384 KB |
Output is correct |
13 |
Correct |
5 ms |
256 KB |
Output is correct |
14 |
Correct |
5 ms |
384 KB |
Output is correct |
15 |
Correct |
5 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Incorrect |
4 ms |
256 KB |
The exit was not found. |
3 |
Halted |
0 ms |
0 KB |
- |