# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
963650 |
2024-04-15T12:22:38 Z |
Acanikolic |
Gap (APIO16_gap) |
C++14 |
|
40 ms |
4016 KB |
#include <bits/stdc++.h>
#include "gap.h"
#define F first
#define S second
using namespace std;
const int N = 2e5 + 10;
const long long inf = 1e18;
/*long long a[N];
int n;
void MinMax(long long s,long long t,long long &mn,long long &mx) {
for(int i = 1; i <= n; i++) {
if(a[i] >= s) {
mn = a[i];
break;
}
}
for(int i = 1; i <= n; i++) {
if(a[i] <= t) mx = a[i];
}
}
*/
long long findGap(int t,int n) {
long long L = -1,R = inf + 1;
long long res = inf;
vector<long long>vec;
for(int i = 1; i <= (n + 1) / 2; i++) {
MinMax(L + 1,R - 1,&L,&R);
if(L != -1) vec.push_back(L);
if(R != -1 && L != R) vec.push_back(R);
}
sort(vec.begin(),vec.end());
for(int i = 1; i < (int)vec.size(); i++) res = min(res,vec[i] - vec[i - 1]);
return res;
}
/*signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
for(int i = 1; i <= n; i++) cin >> a[i];
cout << findGap(1,n);
return 0;
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
2420 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
2388 KB |
Output isn't correct |
5 |
Correct |
1 ms |
2392 KB |
Output is 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 |
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 |
2524 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 |
8 ms |
2844 KB |
Output isn't correct |
17 |
Incorrect |
8 ms |
2824 KB |
Output isn't correct |
18 |
Incorrect |
10 ms |
2844 KB |
Output isn't correct |
19 |
Incorrect |
9 ms |
2844 KB |
Output isn't correct |
20 |
Incorrect |
7 ms |
2824 KB |
Output isn't correct |
21 |
Incorrect |
36 ms |
4004 KB |
Output isn't correct |
22 |
Incorrect |
35 ms |
4008 KB |
Output isn't correct |
23 |
Incorrect |
33 ms |
3996 KB |
Output isn't correct |
24 |
Incorrect |
33 ms |
3932 KB |
Output isn't correct |
25 |
Correct |
29 ms |
3992 KB |
Output is correct |
26 |
Incorrect |
32 ms |
3996 KB |
Output isn't correct |
27 |
Incorrect |
32 ms |
3992 KB |
Output isn't correct |
28 |
Incorrect |
34 ms |
4000 KB |
Output isn't correct |
29 |
Incorrect |
36 ms |
4008 KB |
Output isn't correct |
30 |
Incorrect |
27 ms |
3996 KB |
Output isn't correct |
31 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
Output is correct |
2 |
Incorrect |
1 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 |
1 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 |
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 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
16 |
Incorrect |
8 ms |
2812 KB |
Output isn't correct |
17 |
Incorrect |
9 ms |
2824 KB |
Output isn't correct |
18 |
Incorrect |
8 ms |
2840 KB |
Output isn't correct |
19 |
Incorrect |
10 ms |
2844 KB |
Output isn't correct |
20 |
Incorrect |
7 ms |
2828 KB |
Output isn't correct |
21 |
Incorrect |
32 ms |
3984 KB |
Expected int32, but "2500100000" found |
22 |
Incorrect |
32 ms |
4000 KB |
Expected int32, but "2500100000" found |
23 |
Incorrect |
32 ms |
4000 KB |
Expected int32, but "2500100000" found |
24 |
Incorrect |
31 ms |
3996 KB |
Expected int32, but "2500100000" found |
25 |
Incorrect |
30 ms |
4012 KB |
Expected int32, but "2500100000" found |
26 |
Incorrect |
40 ms |
3824 KB |
Expected int32, but "2500100000" found |
27 |
Incorrect |
35 ms |
3940 KB |
Expected int32, but "2500100000" found |
28 |
Incorrect |
32 ms |
3976 KB |
Expected int32, but "2500100000" found |
29 |
Incorrect |
33 ms |
4016 KB |
Expected int32, but "2500100000" found |
30 |
Incorrect |
30 ms |
3868 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 |