# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
844807 |
2023-09-06T01:27:00 Z |
dutinmeow |
Gap (APIO16_gap) |
C++17 |
|
30 ms |
3868 KB |
#include "gap.h"
#include <bits/stdc++.h>
template<typename T>
bool chmax(T &a, T b) {
if (a >= b)
return false;
a = b;
return true;
}
long long findGap(int t, int n) {
if (t == 1) {
std::vector<long long> a;
a.reserve(n);
long long bl = 0, br = 1e18;
for (int i = 0; i < (n + 1) / 2; i++) {
long long al, ar;
MinMax(bl, br, &al, &ar);
a.push_back(al);
a.push_back(ar);
bl = al + 1, br = br - 1;
}
std::sort(a.begin(), a.end());
long long r = 0;
for (int i = 1; i < n; i++)
chmax(r, a[i] - a[i - 1]);
return r;
} else {
}
}
Compilation message
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
33 | }
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
2644 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
15 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
16 |
Incorrect |
6 ms |
2584 KB |
Output isn't correct |
17 |
Incorrect |
6 ms |
2584 KB |
Output isn't correct |
18 |
Incorrect |
7 ms |
2584 KB |
Output isn't correct |
19 |
Incorrect |
6 ms |
2588 KB |
Output isn't correct |
20 |
Incorrect |
5 ms |
2572 KB |
Output isn't correct |
21 |
Incorrect |
25 ms |
3624 KB |
Output isn't correct |
22 |
Incorrect |
26 ms |
3628 KB |
Output isn't correct |
23 |
Incorrect |
26 ms |
3624 KB |
Output isn't correct |
24 |
Incorrect |
27 ms |
3576 KB |
Output isn't correct |
25 |
Incorrect |
23 ms |
3616 KB |
Output isn't correct |
26 |
Incorrect |
30 ms |
3592 KB |
Output isn't correct |
27 |
Incorrect |
26 ms |
3436 KB |
Output isn't correct |
28 |
Incorrect |
26 ms |
3616 KB |
Output isn't correct |
29 |
Incorrect |
25 ms |
3624 KB |
Output isn't correct |
30 |
Incorrect |
21 ms |
3624 KB |
Output isn't correct |
31 |
Correct |
0 ms |
2392 KB |
Output is correct |
32 |
Correct |
1 ms |
2392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2392 KB |
Output is correct |
2 |
Incorrect |
0 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 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
15 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
16 |
Incorrect |
6 ms |
2584 KB |
Output isn't correct |
17 |
Incorrect |
6 ms |
2568 KB |
Output isn't correct |
18 |
Incorrect |
7 ms |
2588 KB |
Output isn't correct |
19 |
Incorrect |
6 ms |
2584 KB |
Output isn't correct |
20 |
Incorrect |
6 ms |
2796 KB |
Output isn't correct |
21 |
Incorrect |
27 ms |
3868 KB |
Expected int32, but "3750075000" found |
22 |
Incorrect |
29 ms |
3624 KB |
Expected int32, but "3750075000" found |
23 |
Incorrect |
26 ms |
3616 KB |
Expected int32, but "3750075000" found |
24 |
Incorrect |
26 ms |
3616 KB |
Expected int32, but "3750075000" found |
25 |
Incorrect |
23 ms |
3608 KB |
Expected int32, but "3750075000" found |
26 |
Incorrect |
26 ms |
3604 KB |
Expected int32, but "3750075000" found |
27 |
Incorrect |
25 ms |
3620 KB |
Expected int32, but "3750075000" found |
28 |
Incorrect |
25 ms |
3616 KB |
Expected int32, but "3750075000" found |
29 |
Incorrect |
25 ms |
3600 KB |
Expected int32, but "3750075000" found |
30 |
Incorrect |
24 ms |
3628 KB |
Expected int32, but "3750075000" found |
31 |
Partially correct |
0 ms |
2392 KB |
Partially correct |
32 |
Partially correct |
0 ms |
2392 KB |
Partially correct |