#include "gap.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll>num;
void nu(ll l, ll r){
ll mn,mx;
MinMax(l,r,&mn,&mx);
if(mn==-1)return;
else if(mn==mx){
num.push_back(mn);
return;
}
else{
num.push_back(mn);
num.push_back(mx);
if(mx-mn>2){
ll mid=(mn+mx)/2;
nu(mn+1, mid);
nu(mid+1, mx-1);
}
return;
}
}
long long findGap(int T, int N)
{
ll l=1, r=LLONG_MAX,z=0;
nu(l,r);
sort(num.begin(),num.end());
for(int i=1; i<N; i++){
z=max(z,num[i]-num[i-1]);
}
return z;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
10 |
Correct |
0 ms |
208 KB |
Output is correct |
11 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
15 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
16 |
Incorrect |
12 ms |
848 KB |
Output isn't correct |
17 |
Incorrect |
13 ms |
848 KB |
Output isn't correct |
18 |
Incorrect |
11 ms |
848 KB |
Output isn't correct |
19 |
Incorrect |
11 ms |
848 KB |
Output isn't correct |
20 |
Correct |
9 ms |
844 KB |
Output is correct |
21 |
Incorrect |
44 ms |
2204 KB |
Output isn't correct |
22 |
Incorrect |
50 ms |
2228 KB |
Output isn't correct |
23 |
Incorrect |
45 ms |
2244 KB |
Output isn't correct |
24 |
Incorrect |
44 ms |
2236 KB |
Output isn't correct |
25 |
Incorrect |
36 ms |
2168 KB |
Output isn't correct |
26 |
Incorrect |
57 ms |
2180 KB |
Output isn't correct |
27 |
Incorrect |
54 ms |
2184 KB |
Output isn't correct |
28 |
Incorrect |
58 ms |
2152 KB |
Output isn't correct |
29 |
Incorrect |
50 ms |
2148 KB |
Output isn't correct |
30 |
Correct |
29 ms |
2216 KB |
Output is correct |
31 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
32 |
Incorrect |
1 ms |
208 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Partially correct |
0 ms |
208 KB |
Partially correct |
3 |
Partially correct |
0 ms |
208 KB |
Partially correct |
4 |
Partially correct |
1 ms |
208 KB |
Partially correct |
5 |
Partially correct |
0 ms |
208 KB |
Partially correct |
6 |
Partially correct |
1 ms |
208 KB |
Partially correct |
7 |
Partially correct |
0 ms |
208 KB |
Partially correct |
8 |
Partially correct |
0 ms |
208 KB |
Partially correct |
9 |
Partially correct |
0 ms |
208 KB |
Partially correct |
10 |
Partially correct |
0 ms |
208 KB |
Partially correct |
11 |
Partially correct |
1 ms |
336 KB |
Partially correct |
12 |
Partially correct |
1 ms |
336 KB |
Partially correct |
13 |
Partially correct |
1 ms |
336 KB |
Partially correct |
14 |
Partially correct |
1 ms |
336 KB |
Partially correct |
15 |
Partially correct |
1 ms |
384 KB |
Partially correct |
16 |
Partially correct |
13 ms |
848 KB |
Partially correct |
17 |
Partially correct |
11 ms |
848 KB |
Partially correct |
18 |
Partially correct |
11 ms |
868 KB |
Partially correct |
19 |
Partially correct |
11 ms |
880 KB |
Partially correct |
20 |
Partially correct |
7 ms |
852 KB |
Partially correct |
21 |
Partially correct |
43 ms |
2200 KB |
Partially correct |
22 |
Partially correct |
44 ms |
2248 KB |
Partially correct |
23 |
Partially correct |
43 ms |
2252 KB |
Partially correct |
24 |
Partially correct |
44 ms |
2164 KB |
Partially correct |
25 |
Partially correct |
36 ms |
2204 KB |
Partially correct |
26 |
Partially correct |
47 ms |
2236 KB |
Partially correct |
27 |
Partially correct |
48 ms |
2208 KB |
Partially correct |
28 |
Partially correct |
50 ms |
2144 KB |
Partially correct |
29 |
Partially correct |
45 ms |
2192 KB |
Partially correct |
30 |
Partially correct |
32 ms |
2196 KB |
Partially correct |
31 |
Partially correct |
0 ms |
208 KB |
Partially correct |
32 |
Partially correct |
0 ms |
208 KB |
Partially correct |