# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
875370 |
2023-11-19T11:10:15 Z |
ZeroCool |
Gap (APIO16_gap) |
C++14 |
|
22 ms |
3020 KB |
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
//#define int long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using ll = long long;
using ld = long double;
const int N = 1e5 + 5;
const int M = 405;
const int SQRT = 500;
const int LOG = 20;
const int INF = 1e18;
const int MOD = 1e9+7;
const ld EPS = 1e-9;
ll findGap(int t, int n){
ll mn ,mx;
MinMax(0, INF, &mn, &mx);
if(t == 1){
if(n == 2)return mx - mn;
ll l = mn;
ll r = mx;
ll ans = -INF;
for(int i = 0;i<(n - 1) / 2;i++){
MinMax(l+1, r-1, &mn, &mx);
ans = max(ans, mn - l);
ans = max(ans, r - mx);
l = mn;
r = mx;
}
return ans;
}
}
Compilation message
gap.cpp:21:17: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
21 | const int INF = 1e18;
| ^~~~
gap.cpp: In function 'll findGap(int, int)':
gap.cpp:44:1: warning: control reaches end of non-void function [-Wreturn-type]
44 | }
| ^
# |
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 |
1 ms |
2392 KB |
Output is correct |
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 |
Correct |
0 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 |
4 ms |
2592 KB |
Execution failed because the return code was nonzero |
17 |
Runtime error |
3 ms |
2572 KB |
Execution failed because the return code was nonzero |
18 |
Runtime error |
3 ms |
2752 KB |
Execution failed because the return code was nonzero |
19 |
Runtime error |
4 ms |
2836 KB |
Execution failed because the return code was nonzero |
20 |
Correct |
6 ms |
2572 KB |
Output is correct |
21 |
Runtime error |
12 ms |
2856 KB |
Execution failed because the return code was nonzero |
22 |
Runtime error |
12 ms |
2856 KB |
Execution failed because the return code was nonzero |
23 |
Runtime error |
12 ms |
2856 KB |
Execution failed because the return code was nonzero |
24 |
Runtime error |
12 ms |
2848 KB |
Execution failed because the return code was nonzero |
25 |
Runtime error |
9 ms |
2864 KB |
Execution failed because the return code was nonzero |
26 |
Runtime error |
12 ms |
2860 KB |
Execution failed because the return code was nonzero |
27 |
Runtime error |
12 ms |
2860 KB |
Execution failed because the return code was nonzero |
28 |
Runtime error |
12 ms |
2852 KB |
Execution failed because the return code was nonzero |
29 |
Runtime error |
15 ms |
2856 KB |
Execution failed because the return code was nonzero |
30 |
Correct |
22 ms |
2964 KB |
Output is correct |
31 |
Runtime error |
1 ms |
2392 KB |
Execution failed because the return code was nonzero |
32 |
Runtime error |
0 ms |
2392 KB |
Execution failed because the return code was nonzero |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2644 KB |
Output isn't correct |
2 |
Runtime error |
1 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 |
0 ms |
2392 KB |
Execution failed because the return code was nonzero |
5 |
Partially correct |
0 ms |
2392 KB |
Partially 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 |
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 |
Partially correct |
0 ms |
2492 KB |
Partially correct |
11 |
Runtime error |
1 ms |
2600 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 |
3 ms |
2584 KB |
Execution failed because the return code was nonzero |
17 |
Runtime error |
3 ms |
2796 KB |
Execution failed because the return code was nonzero |
18 |
Runtime error |
3 ms |
2588 KB |
Execution failed because the return code was nonzero |
19 |
Runtime error |
3 ms |
2588 KB |
Execution failed because the return code was nonzero |
20 |
Partially correct |
6 ms |
2740 KB |
Partially correct |
21 |
Runtime error |
12 ms |
3020 KB |
Execution failed because the return code was nonzero |
22 |
Runtime error |
17 ms |
3016 KB |
Execution failed because the return code was nonzero |
23 |
Runtime error |
17 ms |
3016 KB |
Execution failed because the return code was nonzero |
24 |
Runtime error |
13 ms |
2712 KB |
Execution failed because the return code was nonzero |
25 |
Runtime error |
10 ms |
2840 KB |
Execution failed because the return code was nonzero |
26 |
Runtime error |
15 ms |
2952 KB |
Execution failed because the return code was nonzero |
27 |
Runtime error |
12 ms |
2856 KB |
Execution failed because the return code was nonzero |
28 |
Runtime error |
12 ms |
2852 KB |
Execution failed because the return code was nonzero |
29 |
Runtime error |
12 ms |
3016 KB |
Execution failed because the return code was nonzero |
30 |
Incorrect |
22 ms |
2852 KB |
Expected int32, but "2500100000" found |
31 |
Runtime error |
0 ms |
2644 KB |
Execution failed because the return code was nonzero |
32 |
Runtime error |
0 ms |
2392 KB |
Execution failed because the return code was nonzero |