Submission #1027745

# Submission time Handle Problem Language Result Execution time Memory
1027745 2024-07-19T09:35:13 Z stdfloat Gap (APIO16_gap) C++17
0 / 100
31 ms 5464 KB
#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 || (N & 1));
		
		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));
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 2392 KB Output isn't correct
3 Incorrect 0 ms 2392 KB Output isn't correct
4 Incorrect 0 ms 2392 KB Output isn't correct
5 Correct 1 ms 2392 KB Output is correct
6 Runtime error 2 ms 4576 KB Execution killed with signal 6
7 Runtime error 2 ms 4696 KB Execution killed with signal 6
8 Runtime error 4 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 5 ms 4696 KB Execution killed with signal 6
12 Runtime error 2 ms 4696 KB Execution killed with signal 6
13 Runtime error 3 ms 4696 KB Execution killed with signal 6
14 Runtime error 3 ms 4696 KB Execution killed with signal 6
15 Runtime error 2 ms 4692 KB Execution killed with signal 6
16 Runtime error 7 ms 4952 KB Execution killed with signal 6
17 Runtime error 6 ms 4904 KB Execution killed with signal 6
18 Runtime error 6 ms 4828 KB Execution killed with signal 6
19 Runtime error 7 ms 4952 KB Execution killed with signal 6
20 Runtime error 6 ms 4896 KB Execution killed with signal 6
21 Runtime error 22 ms 5456 KB Execution killed with signal 6
22 Runtime error 20 ms 5464 KB Execution killed with signal 6
23 Runtime error 20 ms 5332 KB Execution killed with signal 6
24 Runtime error 20 ms 5464 KB Execution killed with signal 6
25 Runtime error 23 ms 5292 KB Execution killed with signal 6
26 Runtime error 21 ms 5464 KB Execution killed with signal 6
27 Runtime error 20 ms 5372 KB Execution killed with signal 6
28 Runtime error 21 ms 5464 KB Execution killed with signal 6
29 Runtime error 25 ms 5456 KB Execution killed with signal 6
30 Runtime error 15 ms 5300 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
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Incorrect 1 ms 2392 KB Output isn't correct
3 Incorrect 1 ms 2392 KB Output isn't correct
4 Incorrect 0 ms 2392 KB Output isn't correct
5 Partially correct 0 ms 2392 KB Partially correct
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 4680 KB Execution killed with signal 6
13 Runtime error 3 ms 4696 KB Execution killed with signal 6
14 Runtime error 3 ms 4696 KB Execution killed with signal 6
15 Runtime error 2 ms 4696 KB Execution killed with signal 6
16 Runtime error 7 ms 4952 KB Execution killed with signal 6
17 Runtime error 8 ms 4952 KB Execution killed with signal 6
18 Runtime error 12 ms 4952 KB Execution killed with signal 6
19 Runtime error 8 ms 4960 KB Execution killed with signal 6
20 Runtime error 5 ms 4952 KB Execution killed with signal 6
21 Runtime error 20 ms 5464 KB Execution killed with signal 6
22 Runtime error 24 ms 5288 KB Execution killed with signal 6
23 Runtime error 21 ms 5464 KB Execution killed with signal 6
24 Runtime error 26 ms 5464 KB Execution killed with signal 6
25 Runtime error 18 ms 5428 KB Execution killed with signal 6
26 Runtime error 31 ms 5464 KB Execution killed with signal 6
27 Runtime error 21 ms 5456 KB Execution killed with signal 6
28 Runtime error 23 ms 5456 KB Execution killed with signal 6
29 Runtime error 24 ms 5456 KB Execution killed with signal 6
30 Runtime error 17 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 4536 KB Execution killed with signal 6