#include "cycle.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for(int i = (int)a; i <= (int)b; i++)
#define DEC(i, a, b) for(int i = (int)a; i >= (int)b; i--)
typedef pair<int, int> pi;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
bool can;
int cur;
void escape(int n) {
can = jump(0);
if (can) {
int lower = 0, upper = n/2+1;
while (upper - lower > 1) {
int mid = (upper + lower)/2;
if (jump((mid-cur+n)%n)) lower = mid;
else upper = mid;
cur = mid;
}
} else {
int lower = -1, upper = n/2;
while (upper - lower > 1) {
int mid = (upper + lower)/2;
if (jump((mid-cur+n)%n)) upper = mid;
else lower = mid;
cur = mid;
}
jump((upper-cur+n+n/2)%n);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
4 ms |
384 KB |
Output is correct |
3 |
Correct |
4 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
5 ms |
384 KB |
Output is correct |
6 |
Correct |
4 ms |
256 KB |
Output is correct |
7 |
Correct |
4 ms |
256 KB |
Output is correct |
8 |
Correct |
4 ms |
256 KB |
Output is correct |
9 |
Correct |
5 ms |
256 KB |
Output is correct |
10 |
Correct |
4 ms |
256 KB |
Output is correct |
11 |
Correct |
4 ms |
256 KB |
Output is correct |
12 |
Correct |
5 ms |
384 KB |
Output is correct |
13 |
Correct |
4 ms |
256 KB |
Output is correct |
14 |
Correct |
4 ms |
256 KB |
Output is correct |
15 |
Incorrect |
5 ms |
256 KB |
The exit was not found. |
16 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
256 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 |
4 ms |
256 KB |
Output is correct |
6 |
Correct |
4 ms |
256 KB |
Output is correct |
7 |
Correct |
4 ms |
384 KB |
Output is correct |
8 |
Incorrect |
5 ms |
384 KB |
The exit was not found. |
9 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
4 ms |
384 KB |
Output is correct |
3 |
Correct |
4 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
5 ms |
384 KB |
Output is correct |
6 |
Correct |
4 ms |
256 KB |
Output is correct |
7 |
Correct |
4 ms |
256 KB |
Output is correct |
8 |
Correct |
4 ms |
256 KB |
Output is correct |
9 |
Correct |
5 ms |
256 KB |
Output is correct |
10 |
Correct |
4 ms |
256 KB |
Output is correct |
11 |
Correct |
4 ms |
256 KB |
Output is correct |
12 |
Correct |
5 ms |
384 KB |
Output is correct |
13 |
Correct |
4 ms |
256 KB |
Output is correct |
14 |
Correct |
4 ms |
256 KB |
Output is correct |
15 |
Incorrect |
5 ms |
256 KB |
The exit was not found. |
16 |
Halted |
0 ms |
0 KB |
- |