# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1027395 |
2024-07-19T05:42:26 Z |
Muhammet |
Gap (APIO16_gap) |
C++17 |
|
32 ms |
4412 KB |
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
#define ll long long
#define sz(s) (int)s.size()
const ll M = 1e9 + 7;
ll findGap(int T, int n){
vector <ll> v, v1;
for(int i = 0; i < (n+1)/2; i++){
ll s, t, mn, mx;
if(i == 0) s = 0, t = 1e18;
else s = v.back()+1, t = v1.back()-1;
if(s > t) break;
MinMax(s, t, &mn, &mx);
v.push_back(mn);
v1.push_back(mx);
}
if(n % 2 == 1) v1.pop_back();
while(sz(v1) > 0){
v.push_back(v1.back());
v1.pop_back();
}
ll ans = 0;
for(int i = 0; i < n-1; i++){
ll x = (v[i+1] - v[i]);
ans = max(ans, x);
}
return ans%M;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
5 |
Correct |
1 ms |
2392 KB |
Output is correct |
6 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
10 |
Correct |
1 ms |
2392 KB |
Output is 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 |
Correct |
1 ms |
2392 KB |
Output is correct |
16 |
Incorrect |
7 ms |
3036 KB |
Output isn't correct |
17 |
Incorrect |
7 ms |
2900 KB |
Output isn't correct |
18 |
Incorrect |
7 ms |
3008 KB |
Output isn't correct |
19 |
Incorrect |
7 ms |
2904 KB |
Output isn't correct |
20 |
Correct |
6 ms |
2904 KB |
Output is correct |
21 |
Incorrect |
27 ms |
4296 KB |
Output isn't correct |
22 |
Incorrect |
31 ms |
4212 KB |
Output isn't correct |
23 |
Incorrect |
30 ms |
4308 KB |
Output isn't correct |
24 |
Incorrect |
28 ms |
4332 KB |
Output isn't correct |
25 |
Correct |
24 ms |
4220 KB |
Output is correct |
26 |
Incorrect |
27 ms |
4212 KB |
Output isn't correct |
27 |
Incorrect |
32 ms |
4212 KB |
Output isn't correct |
28 |
Incorrect |
27 ms |
4220 KB |
Output isn't correct |
29 |
Incorrect |
27 ms |
4208 KB |
Output isn't correct |
30 |
Correct |
22 ms |
4212 KB |
Output is correct |
31 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
32 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
5 |
Partially correct |
0 ms |
2392 KB |
Partially correct |
6 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
10 |
Partially correct |
1 ms |
2392 KB |
Partially 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 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
16 |
Incorrect |
7 ms |
2904 KB |
Output isn't correct |
17 |
Incorrect |
7 ms |
2904 KB |
Output isn't correct |
18 |
Incorrect |
8 ms |
2904 KB |
Output isn't correct |
19 |
Incorrect |
7 ms |
2900 KB |
Output isn't correct |
20 |
Partially correct |
6 ms |
3156 KB |
Partially correct |
21 |
Incorrect |
27 ms |
4220 KB |
Expected int32, but "2500100000" found |
22 |
Incorrect |
28 ms |
4244 KB |
Expected int32, but "2500100000" found |
23 |
Incorrect |
27 ms |
4220 KB |
Expected int32, but "2500100000" found |
24 |
Incorrect |
31 ms |
4212 KB |
Expected int32, but "2500100000" found |
25 |
Incorrect |
24 ms |
4220 KB |
Expected int32, but "2500100000" found |
26 |
Incorrect |
27 ms |
4220 KB |
Expected int32, but "2500100000" found |
27 |
Incorrect |
30 ms |
4380 KB |
Expected int32, but "2500100000" found |
28 |
Incorrect |
26 ms |
4212 KB |
Expected int32, but "2500100000" found |
29 |
Incorrect |
27 ms |
4212 KB |
Expected int32, but "2500100000" found |
30 |
Incorrect |
29 ms |
4412 KB |
Expected int32, but "2500100000" found |
31 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |