Submission #882392

# Submission time Handle Problem Language Result Execution time Memory
882392 2023-12-03T06:28:56 Z dubabuba Gap (APIO16_gap) C++14
0 / 100
43 ms 4644 KB
#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 + 10, &L, &R);

	ll d = (R - L) / (ll)N;
	ll mn[N], mx[N];
	mn[0] = L, mx[N - 1] = R;

	ll st = L;
	for(int i = 0; i < N; i++) {
		MinMax(L + d * i, (i == N - 1) ? N - 1 : L + (i + 1) * d - 1, &mn[i], &mx[i]);
		st += d;
	}
		
	ll ans = 0;
	for(int i = 1; i < N; i++)
		ans = max(ans, mn[i] - mx[i - 1]);
	return ans;
}
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
2 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
3 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
4 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
5 Runtime error 1 ms 2392 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 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 1 ms 2392 KB Execution failed because the return code was nonzero
10 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
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 2392 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 2392 KB Execution failed because the return code was nonzero
16 Runtime error 10 ms 2836 KB Execution failed because the return code was nonzero
17 Runtime error 10 ms 2828 KB Execution failed because the return code was nonzero
18 Runtime error 10 ms 2824 KB Execution failed because the return code was nonzero
19 Runtime error 10 ms 2980 KB Execution failed because the return code was nonzero
20 Runtime error 5 ms 2824 KB Execution failed because the return code was nonzero
21 Runtime error 41 ms 4392 KB Execution failed because the return code was nonzero
22 Runtime error 42 ms 4644 KB Execution failed because the return code was nonzero
23 Runtime error 42 ms 4412 KB Execution failed because the return code was nonzero
24 Runtime error 41 ms 4636 KB Execution failed because the return code was nonzero
25 Runtime error 40 ms 4396 KB Execution failed because the return code was nonzero
26 Runtime error 40 ms 4408 KB Execution failed because the return code was nonzero
27 Runtime error 41 ms 4396 KB Execution failed because the return code was nonzero
28 Runtime error 41 ms 4388 KB Execution failed because the return code was nonzero
29 Runtime error 42 ms 4408 KB Execution failed because the return code was nonzero
30 Runtime error 23 ms 4388 KB Execution failed because the return code was nonzero
31 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
32 Runtime error 1 ms 2644 KB Execution failed because the return code was nonzero
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
2 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
3 Runtime error 0 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 1 ms 2392 KB Execution failed because the return code was nonzero
8 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
9 Runtime error 1 ms 2644 KB Execution failed because the return code was nonzero
10 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
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 2392 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 2484 KB Execution failed because the return code was nonzero
16 Runtime error 10 ms 2836 KB Execution failed because the return code was nonzero
17 Runtime error 11 ms 2844 KB Execution failed because the return code was nonzero
18 Runtime error 10 ms 2992 KB Execution failed because the return code was nonzero
19 Runtime error 10 ms 2836 KB Execution failed because the return code was nonzero
20 Runtime error 6 ms 2820 KB Execution failed because the return code was nonzero
21 Runtime error 41 ms 4400 KB Execution failed because the return code was nonzero
22 Runtime error 40 ms 4392 KB Execution failed because the return code was nonzero
23 Runtime error 42 ms 4396 KB Execution failed because the return code was nonzero
24 Runtime error 43 ms 4412 KB Execution failed because the return code was nonzero
25 Runtime error 40 ms 4392 KB Execution failed because the return code was nonzero
26 Runtime error 41 ms 4408 KB Execution failed because the return code was nonzero
27 Runtime error 40 ms 4404 KB Execution failed because the return code was nonzero
28 Runtime error 41 ms 4420 KB Execution failed because the return code was nonzero
29 Runtime error 40 ms 4388 KB Execution failed because the return code was nonzero
30 Runtime error 23 ms 4392 KB Execution failed because the return code was nonzero
31 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
32 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero