//I love armpit fetish
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
#define debug(x) cerr << #x << " = " << x << '\n';
#define BP() cerr << "OK!\n";
#define PR(A, n) {cerr << #A << " = "; for (int _=1; _<=n; ++_) cerr << A[_] << ' '; cerr << '\n';}
#define PR0(A, n) {cerr << #A << " = "; for (int _=0; _<n; ++_) cerr << A[_] << ' '; cerr << '\n';}
#define FILE_NAME "data"
const long long INF = 1e18;
const int MAX_N = 100002;
int n;
long long a[MAX_N];
long long solve_subtask_1() {
int l = 1, r = n;
long long s = 1, t = INF;
while (l<=r) {
long long *mn = new long long;
long long *mx = new long long;
MinMax(s, t, mn, mx);
a[l] = *mn;
a[r] = *mx;
s = *mn + 1;
t = *mx - 1;
++l;
--r;
}
long long res = 0;
for (int i=2; i<=n; ++i)
res = max(res, a[i] - a[i-1]);
return res;
}
long long findGap(int testID, int N) {
n = N;
if (testID==1)
return solve_subtask_1();
return 0;
// else
// return solve_subtask_2();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
3 ms |
488 KB |
Output is correct |
3 |
Correct |
2 ms |
488 KB |
Output is correct |
4 |
Correct |
2 ms |
488 KB |
Output is correct |
5 |
Correct |
3 ms |
488 KB |
Output is correct |
6 |
Correct |
3 ms |
488 KB |
Output is correct |
7 |
Correct |
3 ms |
488 KB |
Output is correct |
8 |
Correct |
3 ms |
488 KB |
Output is correct |
9 |
Correct |
2 ms |
488 KB |
Output is correct |
10 |
Correct |
2 ms |
488 KB |
Output is correct |
11 |
Correct |
4 ms |
736 KB |
Output is correct |
12 |
Correct |
4 ms |
736 KB |
Output is correct |
13 |
Correct |
5 ms |
736 KB |
Output is correct |
14 |
Correct |
4 ms |
736 KB |
Output is correct |
15 |
Correct |
3 ms |
736 KB |
Output is correct |
16 |
Correct |
19 ms |
1756 KB |
Output is correct |
17 |
Correct |
18 ms |
1756 KB |
Output is correct |
18 |
Correct |
20 ms |
1756 KB |
Output is correct |
19 |
Correct |
19 ms |
1756 KB |
Output is correct |
20 |
Correct |
15 ms |
1756 KB |
Output is correct |
21 |
Correct |
77 ms |
5212 KB |
Output is correct |
22 |
Correct |
67 ms |
5212 KB |
Output is correct |
23 |
Correct |
65 ms |
5340 KB |
Output is correct |
24 |
Correct |
57 ms |
5340 KB |
Output is correct |
25 |
Correct |
66 ms |
5340 KB |
Output is correct |
26 |
Correct |
72 ms |
5364 KB |
Output is correct |
27 |
Correct |
64 ms |
5364 KB |
Output is correct |
28 |
Correct |
69 ms |
5364 KB |
Output is correct |
29 |
Correct |
78 ms |
5364 KB |
Output is correct |
30 |
Correct |
43 ms |
5364 KB |
Output is correct |
31 |
Correct |
2 ms |
5364 KB |
Output is correct |
32 |
Correct |
2 ms |
5364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
5364 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
5364 KB |
Output isn't correct |
3 |
Incorrect |
3 ms |
5364 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
5364 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
5364 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
5364 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
5364 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
5364 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
5364 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
5364 KB |
Output isn't correct |
11 |
Incorrect |
3 ms |
5364 KB |
Output isn't correct |
12 |
Incorrect |
3 ms |
5364 KB |
Output isn't correct |
13 |
Incorrect |
3 ms |
5364 KB |
Output isn't correct |
14 |
Incorrect |
2 ms |
5364 KB |
Output isn't correct |
15 |
Incorrect |
3 ms |
5364 KB |
Output isn't correct |
16 |
Incorrect |
11 ms |
5364 KB |
Output isn't correct |
17 |
Incorrect |
11 ms |
5364 KB |
Output isn't correct |
18 |
Incorrect |
12 ms |
5364 KB |
Output isn't correct |
19 |
Incorrect |
9 ms |
5364 KB |
Output isn't correct |
20 |
Incorrect |
9 ms |
5364 KB |
Output isn't correct |
21 |
Incorrect |
52 ms |
5364 KB |
Output isn't correct |
22 |
Incorrect |
37 ms |
5364 KB |
Output isn't correct |
23 |
Incorrect |
43 ms |
5364 KB |
Output isn't correct |
24 |
Incorrect |
40 ms |
5364 KB |
Output isn't correct |
25 |
Incorrect |
25 ms |
5364 KB |
Output isn't correct |
26 |
Incorrect |
30 ms |
5364 KB |
Output isn't correct |
27 |
Incorrect |
35 ms |
5364 KB |
Output isn't correct |
28 |
Incorrect |
36 ms |
5364 KB |
Output isn't correct |
29 |
Incorrect |
49 ms |
5364 KB |
Output isn't correct |
30 |
Incorrect |
16 ms |
5364 KB |
Output isn't correct |
31 |
Incorrect |
3 ms |
5364 KB |
Output isn't correct |
32 |
Incorrect |
2 ms |
5364 KB |
Output isn't correct |