#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
using ll = long long;
ll findGap(int T, int N) {
ll s, t;
MinMax(0, (ll)1e18, &s, &t);
int cnt = 1;
ll ans = LLONG_MAX;
while (N > 2 && s + 1 < t) {
cnt++;
assert(cnt <= (N + 1) / 2);
ll x, y;
MinMax(s + 1, t - 1, &x, &y);
if (x == -1) break;
ans = min({ans, x - s, t - y});
s = x; t = y; N -= 2;
}
return min(ans, (s < t ? t - s : LLONG_MAX));
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Runtime error |
3 ms |
4696 KB |
Execution killed with signal 6 |
3 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
4 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
5 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
6 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
7 |
Runtime error |
2 ms |
4632 KB |
Execution killed with signal 6 |
8 |
Runtime error |
3 ms |
4696 KB |
Execution killed with signal 6 |
9 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
10 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
11 |
Runtime error |
3 ms |
4696 KB |
Execution killed with signal 6 |
12 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
13 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
14 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
15 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
16 |
Runtime error |
8 ms |
4760 KB |
Execution killed with signal 6 |
17 |
Runtime error |
7 ms |
4952 KB |
Execution killed with signal 6 |
18 |
Runtime error |
6 ms |
4952 KB |
Execution killed with signal 6 |
19 |
Runtime error |
7 ms |
4952 KB |
Execution killed with signal 6 |
20 |
Runtime error |
5 ms |
4952 KB |
Execution killed with signal 6 |
21 |
Runtime error |
21 ms |
5300 KB |
Execution killed with signal 6 |
22 |
Runtime error |
23 ms |
5464 KB |
Execution killed with signal 6 |
23 |
Runtime error |
19 ms |
5496 KB |
Execution killed with signal 6 |
24 |
Runtime error |
18 ms |
5464 KB |
Execution killed with signal 6 |
25 |
Runtime error |
15 ms |
5424 KB |
Execution killed with signal 6 |
26 |
Runtime error |
17 ms |
5464 KB |
Execution killed with signal 6 |
27 |
Runtime error |
19 ms |
5476 KB |
Execution killed with signal 6 |
28 |
Runtime error |
19 ms |
5372 KB |
Execution killed with signal 6 |
29 |
Runtime error |
22 ms |
5304 KB |
Execution killed with signal 6 |
30 |
Runtime error |
15 ms |
5464 KB |
Execution killed with signal 6 |
31 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
32 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
Output is correct |
2 |
Runtime error |
2 ms |
4772 KB |
Execution killed with signal 6 |
3 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
4 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
5 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
6 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
7 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
8 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
9 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
10 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
11 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
12 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
13 |
Runtime error |
2 ms |
4620 KB |
Execution killed with signal 6 |
14 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
15 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
16 |
Runtime error |
8 ms |
4952 KB |
Execution killed with signal 6 |
17 |
Runtime error |
8 ms |
4952 KB |
Execution killed with signal 6 |
18 |
Runtime error |
6 ms |
4832 KB |
Execution killed with signal 6 |
19 |
Runtime error |
6 ms |
4788 KB |
Execution killed with signal 6 |
20 |
Runtime error |
7 ms |
4952 KB |
Execution killed with signal 6 |
21 |
Runtime error |
20 ms |
5404 KB |
Execution killed with signal 6 |
22 |
Runtime error |
19 ms |
5460 KB |
Execution killed with signal 6 |
23 |
Runtime error |
20 ms |
5464 KB |
Execution killed with signal 6 |
24 |
Runtime error |
24 ms |
5500 KB |
Execution killed with signal 6 |
25 |
Runtime error |
17 ms |
5464 KB |
Execution killed with signal 6 |
26 |
Runtime error |
17 ms |
5508 KB |
Execution killed with signal 6 |
27 |
Runtime error |
20 ms |
5464 KB |
Execution killed with signal 6 |
28 |
Runtime error |
18 ms |
5464 KB |
Execution killed with signal 6 |
29 |
Runtime error |
18 ms |
5404 KB |
Execution killed with signal 6 |
30 |
Runtime error |
13 ms |
5428 KB |
Execution killed with signal 6 |
31 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |
32 |
Runtime error |
2 ms |
4696 KB |
Execution killed with signal 6 |