#include "gap.h"
#include<bits/stdc++.h>
using namespace std;
map<long long,bool> vis;
long long findGap(int T, int N)
{
long long mn,mx;
long long ans =1e18+2 ;
vector<long long> v;
long long s = 0 , e = 1e18;
for(int i=0;i<(N+1)/2;i++){
MinMax(s,e,&mn,&mx);
if(!vis[mn])
v.push_back(mn);
vis[mn] = true;
if(!vis[mx])
v.push_back(mx);
vis[mx] = 1;
s = mn+1;
e = mx-1;
}
sort(v.begin(),v.end());
int si = v.size()-1;
for(int i=0;i<si-1;i++){
ans = min(ans,v[i+1]-v[i]);
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
5 |
Correct |
0 ms |
5152 KB |
Output is correct |
6 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
11 |
Incorrect |
0 ms |
5284 KB |
Output isn't correct |
12 |
Incorrect |
0 ms |
5284 KB |
Output isn't correct |
13 |
Incorrect |
0 ms |
5284 KB |
Output isn't correct |
14 |
Incorrect |
0 ms |
5284 KB |
Output isn't correct |
15 |
Correct |
0 ms |
5284 KB |
Output is correct |
16 |
Incorrect |
33 ms |
7032 KB |
Output isn't correct |
17 |
Incorrect |
19 ms |
7032 KB |
Output isn't correct |
18 |
Incorrect |
23 ms |
7032 KB |
Output isn't correct |
19 |
Incorrect |
23 ms |
7032 KB |
Output isn't correct |
20 |
Incorrect |
16 ms |
7032 KB |
Output isn't correct |
21 |
Incorrect |
116 ms |
12420 KB |
Output isn't correct |
22 |
Incorrect |
109 ms |
12420 KB |
Output isn't correct |
23 |
Incorrect |
109 ms |
12420 KB |
Output isn't correct |
24 |
Incorrect |
116 ms |
12420 KB |
Output isn't correct |
25 |
Correct |
99 ms |
12420 KB |
Output is correct |
26 |
Incorrect |
109 ms |
12420 KB |
Output isn't correct |
27 |
Incorrect |
119 ms |
12420 KB |
Output isn't correct |
28 |
Incorrect |
99 ms |
12420 KB |
Output isn't correct |
29 |
Incorrect |
113 ms |
12420 KB |
Output isn't correct |
30 |
Incorrect |
89 ms |
12420 KB |
Output isn't correct |
31 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
5 |
Partially correct |
0 ms |
5152 KB |
Partially correct |
6 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
11 |
Incorrect |
0 ms |
5284 KB |
Output isn't correct |
12 |
Incorrect |
0 ms |
5284 KB |
Output isn't correct |
13 |
Incorrect |
0 ms |
5284 KB |
Output isn't correct |
14 |
Incorrect |
0 ms |
5284 KB |
Output isn't correct |
15 |
Partially correct |
0 ms |
5284 KB |
Partially correct |
16 |
Incorrect |
26 ms |
7032 KB |
Output isn't correct |
17 |
Incorrect |
36 ms |
7032 KB |
Output isn't correct |
18 |
Incorrect |
26 ms |
7032 KB |
Output isn't correct |
19 |
Incorrect |
29 ms |
7032 KB |
Output isn't correct |
20 |
Incorrect |
23 ms |
7032 KB |
Output isn't correct |
21 |
Incorrect |
113 ms |
12420 KB |
Expected int32, but "2500100000" found |
22 |
Incorrect |
116 ms |
12420 KB |
Expected int32, but "2500100000" found |
23 |
Incorrect |
116 ms |
12420 KB |
Expected int32, but "2500100000" found |
24 |
Incorrect |
116 ms |
12420 KB |
Expected int32, but "2500100000" found |
25 |
Incorrect |
99 ms |
12420 KB |
Expected int32, but "2500100000" found |
26 |
Incorrect |
133 ms |
12420 KB |
Expected int32, but "2500100000" found |
27 |
Incorrect |
116 ms |
12420 KB |
Expected int32, but "2500100000" found |
28 |
Incorrect |
129 ms |
12420 KB |
Expected int32, but "2500100000" found |
29 |
Incorrect |
103 ms |
12420 KB |
Expected int32, but "2500100000" found |
30 |
Incorrect |
96 ms |
12420 KB |
Expected int32, but "2500100000" found |
31 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
5152 KB |
Output isn't correct |