#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define ff first
#define ss second
ll findGap(int T, int N) {
ll L, R;
MinMax(0LL, (ll)1e18, &L, &R);
ll d = (R - L) / N;
ll mn[N], mx[N];
mn[0] = L, mx[N - 1] = R;
ll st = L;
for(int i = 0; i < N; i++)
MinMax(st, (i == N - 1) ? N - 1 : st + d - 1, &mn[i], &mx[i]);
ll ans = 0;
for(int i = 1; i < N; i++)
ans = max(ans, mn[i] - mx[i - 1]);
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
344 KB |
Execution failed because the return code was nonzero |
2 |
Runtime error |
0 ms |
2392 KB |
Execution failed because the return code was nonzero |
3 |
Runtime error |
1 ms |
2392 KB |
Execution failed because the return code was nonzero |
4 |
Runtime error |
0 ms |
2392 KB |
Execution failed because the return code was nonzero |
5 |
Runtime error |
0 ms |
2392 KB |
Execution failed because the return code was nonzero |
6 |
Runtime error |
0 ms |
2392 KB |
Execution failed because the return code was nonzero |
7 |
Runtime error |
0 ms |
2392 KB |
Execution failed because the return code was nonzero |
8 |
Runtime error |
0 ms |
2392 KB |
Execution failed because the return code was nonzero |
9 |
Runtime error |
0 ms |
2392 KB |
Execution failed because the return code was nonzero |
10 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
11 |
Runtime error |
1 ms |
2392 KB |
Execution failed because the return code was nonzero |
12 |
Runtime error |
1 ms |
2392 KB |
Execution failed because the return code was nonzero |
13 |
Runtime error |
1 ms |
2404 KB |
Execution failed because the return code was nonzero |
14 |
Runtime error |
1 ms |
2396 KB |
Execution failed because the return code was nonzero |
15 |
Runtime error |
1 ms |
2396 KB |
Execution failed because the return code was nonzero |
16 |
Runtime error |
9 ms |
2852 KB |
Execution failed because the return code was nonzero |
17 |
Runtime error |
10 ms |
2844 KB |
Execution failed because the return code was nonzero |
18 |
Runtime error |
7 ms |
2848 KB |
Execution failed because the return code was nonzero |
19 |
Runtime error |
6 ms |
2840 KB |
Execution failed because the return code was nonzero |
20 |
Incorrect |
5 ms |
2988 KB |
Output isn't correct |
21 |
Runtime error |
27 ms |
4432 KB |
Execution failed because the return code was nonzero |
22 |
Runtime error |
25 ms |
4432 KB |
Execution failed because the return code was nonzero |
23 |
Runtime error |
33 ms |
4364 KB |
Execution failed because the return code was nonzero |
24 |
Runtime error |
25 ms |
4336 KB |
Execution failed because the return code was nonzero |
25 |
Runtime error |
22 ms |
4388 KB |
Execution failed because the return code was nonzero |
26 |
Runtime error |
26 ms |
4652 KB |
Execution failed because the return code was nonzero |
27 |
Runtime error |
26 ms |
4408 KB |
Execution failed because the return code was nonzero |
28 |
Runtime error |
28 ms |
4656 KB |
Execution failed because the return code was nonzero |
29 |
Runtime error |
25 ms |
4432 KB |
Execution failed because the return code was nonzero |
30 |
Incorrect |
21 ms |
4396 KB |
Output isn't correct |
31 |
Incorrect |
1 ms |
2400 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
2392 KB |
Execution failed because the return code was nonzero |
2 |
Runtime error |
0 ms |
2392 KB |
Execution failed because the return code was nonzero |
3 |
Runtime error |
0 ms |
2396 KB |
Execution failed because the return code was nonzero |
4 |
Runtime error |
0 ms |
2396 KB |
Execution failed because the return code was nonzero |
5 |
Runtime error |
1 ms |
2400 KB |
Execution failed because the return code was nonzero |
6 |
Runtime error |
1 ms |
2392 KB |
Execution failed because the return code was nonzero |
7 |
Runtime error |
1 ms |
2392 KB |
Execution failed because the return code was nonzero |
8 |
Runtime error |
0 ms |
2392 KB |
Execution failed because the return code was nonzero |
9 |
Runtime error |
1 ms |
2396 KB |
Execution failed because the return code was nonzero |
10 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
11 |
Runtime error |
1 ms |
2392 KB |
Execution failed because the return code was nonzero |
12 |
Runtime error |
1 ms |
2396 KB |
Execution failed because the return code was nonzero |
13 |
Runtime error |
1 ms |
2396 KB |
Execution failed because the return code was nonzero |
14 |
Runtime error |
1 ms |
2392 KB |
Execution failed because the return code was nonzero |
15 |
Runtime error |
1 ms |
2400 KB |
Execution failed because the return code was nonzero |
16 |
Runtime error |
6 ms |
2840 KB |
Execution failed because the return code was nonzero |
17 |
Runtime error |
7 ms |
3008 KB |
Execution failed because the return code was nonzero |
18 |
Runtime error |
6 ms |
2840 KB |
Execution failed because the return code was nonzero |
19 |
Runtime error |
6 ms |
2848 KB |
Execution failed because the return code was nonzero |
20 |
Incorrect |
5 ms |
2828 KB |
Output isn't correct |
21 |
Runtime error |
25 ms |
4320 KB |
Execution failed because the return code was nonzero |
22 |
Runtime error |
25 ms |
4396 KB |
Execution failed because the return code was nonzero |
23 |
Runtime error |
30 ms |
4400 KB |
Execution failed because the return code was nonzero |
24 |
Runtime error |
25 ms |
4644 KB |
Execution failed because the return code was nonzero |
25 |
Runtime error |
22 ms |
4396 KB |
Execution failed because the return code was nonzero |
26 |
Runtime error |
29 ms |
4408 KB |
Execution failed because the return code was nonzero |
27 |
Runtime error |
26 ms |
4348 KB |
Execution failed because the return code was nonzero |
28 |
Runtime error |
25 ms |
4424 KB |
Execution failed because the return code was nonzero |
29 |
Runtime error |
25 ms |
4396 KB |
Execution failed because the return code was nonzero |
30 |
Incorrect |
21 ms |
4392 KB |
Output isn't correct |
31 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |