# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
975828 |
2024-05-06T00:04:50 Z |
Isam |
Gap (APIO16_gap) |
C++17 |
|
25 ms |
3868 KB |
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;
//#define eb emplace_back
//#define int long long
constexpr int sz = 1e5 + 5;
long long findGap(int T, int N){
vector<long long> a(N+1, 0ll);
long long mn, mx;
MinMax(0ll, (int)1E18, &mn, &mx);
a[1] = mn, a[N] = mx;
for(register int i = 2; i <= N/2 + (N & 1); ++i){
long long l = a[i-1], r = a[N - (i-1) + 1];
MinMax(l+1, r-1, &mn, &mx); // called by reference
a[i] = mn, a[N - i + 1] = mx;
}
long long ans = -((long long)1E18 + 7);
for(register int i = 2; i <= N; ++i){
ans = max(ans, a[i] - a[i-1]);
}
return ans;
}
Compilation message
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:20:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
20 | for(register int i = 2; i <= N/2 + (N & 1); ++i){
| ^
gap.cpp:33:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
33 | for(register int i = 2; i <= N; ++i){
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
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 |
Correct |
0 ms |
2392 KB |
Output is correct |
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 |
1 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 |
Correct |
1 ms |
2392 KB |
Output is 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 |
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 |
6 ms |
2588 KB |
Execution failed because the return code was nonzero |
17 |
Runtime error |
4 ms |
2584 KB |
Execution failed because the return code was nonzero |
18 |
Runtime error |
4 ms |
2752 KB |
Execution failed because the return code was nonzero |
19 |
Runtime error |
4 ms |
2592 KB |
Execution failed because the return code was nonzero |
20 |
Correct |
6 ms |
2572 KB |
Output is correct |
21 |
Runtime error |
13 ms |
3616 KB |
Execution failed because the return code was nonzero |
22 |
Runtime error |
13 ms |
3788 KB |
Execution failed because the return code was nonzero |
23 |
Runtime error |
14 ms |
3616 KB |
Execution failed because the return code was nonzero |
24 |
Runtime error |
13 ms |
3620 KB |
Execution failed because the return code was nonzero |
25 |
Runtime error |
11 ms |
3624 KB |
Execution failed because the return code was nonzero |
26 |
Runtime error |
13 ms |
3616 KB |
Execution failed because the return code was nonzero |
27 |
Runtime error |
18 ms |
3620 KB |
Execution failed because the return code was nonzero |
28 |
Runtime error |
14 ms |
3628 KB |
Execution failed because the return code was nonzero |
29 |
Runtime error |
13 ms |
3616 KB |
Execution failed because the return code was nonzero |
30 |
Correct |
25 ms |
3616 KB |
Output is correct |
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 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
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 |
1 ms |
2392 KB |
Execution failed because the return code was nonzero |
5 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
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 |
1 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 |
Partially correct |
0 ms |
2392 KB |
Partially 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 |
2 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 |
4 ms |
2672 KB |
Execution failed because the return code was nonzero |
17 |
Runtime error |
4 ms |
2580 KB |
Execution failed because the return code was nonzero |
18 |
Runtime error |
4 ms |
2696 KB |
Execution failed because the return code was nonzero |
19 |
Runtime error |
4 ms |
2752 KB |
Execution failed because the return code was nonzero |
20 |
Partially correct |
6 ms |
2572 KB |
Partially correct |
21 |
Runtime error |
14 ms |
3480 KB |
Execution failed because the return code was nonzero |
22 |
Runtime error |
14 ms |
3624 KB |
Execution failed because the return code was nonzero |
23 |
Runtime error |
13 ms |
3868 KB |
Execution failed because the return code was nonzero |
24 |
Runtime error |
13 ms |
3584 KB |
Execution failed because the return code was nonzero |
25 |
Runtime error |
11 ms |
3624 KB |
Execution failed because the return code was nonzero |
26 |
Runtime error |
14 ms |
3620 KB |
Execution failed because the return code was nonzero |
27 |
Runtime error |
14 ms |
3628 KB |
Execution failed because the return code was nonzero |
28 |
Runtime error |
13 ms |
3624 KB |
Execution failed because the return code was nonzero |
29 |
Runtime error |
13 ms |
3620 KB |
Execution failed because the return code was nonzero |
30 |
Incorrect |
25 ms |
3616 KB |
Expected int32, but "2500100000" found |
31 |
Runtime error |
1 ms |
2388 KB |
Execution failed because the return code was nonzero |
32 |
Runtime error |
1 ms |
2392 KB |
Execution failed because the return code was nonzero |