#include "gap.h"
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll i,has;
vector<ll> v;
void tanya(ll aa,ll bb)
{
if(aa==bb)
v.pb(aa);
if(aa>bb)
return ;
ll mi,ma;
MinMax(aa,bb,&mi,&ma);
if(mi!=ma)
{
ll ce=(aa+bb)/2;
tanya(mi,max(ce,mi));
tanya(min(ce+1,ma),ma);
}
else
v.pb(mi);
}
long long findGap(int T, int N)
{
ll L,R;
MinMax(0,1e18,&L,&R);
tanya(L,R);
for(i=1;i<v.size();i++)
has=max(has,v[i]-v[i-1]);
return has;
}
Compilation message
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:33:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(i=1;i<v.size();i++)
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
428 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
500 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
520 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
520 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
568 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
568 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
568 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
568 KB |
Output isn't correct |
11 |
Incorrect |
4 ms |
568 KB |
Output isn't correct |
12 |
Incorrect |
4 ms |
568 KB |
Output isn't correct |
13 |
Incorrect |
5 ms |
568 KB |
Output isn't correct |
14 |
Incorrect |
3 ms |
568 KB |
Output isn't correct |
15 |
Incorrect |
3 ms |
568 KB |
Output isn't correct |
16 |
Incorrect |
36 ms |
1332 KB |
Output isn't correct |
17 |
Incorrect |
37 ms |
1460 KB |
Output isn't correct |
18 |
Incorrect |
35 ms |
1512 KB |
Output isn't correct |
19 |
Incorrect |
36 ms |
1512 KB |
Output isn't correct |
20 |
Incorrect |
31 ms |
1512 KB |
Output isn't correct |
21 |
Incorrect |
140 ms |
3656 KB |
Output isn't correct |
22 |
Incorrect |
173 ms |
3656 KB |
Output isn't correct |
23 |
Incorrect |
144 ms |
3656 KB |
Output isn't correct |
24 |
Incorrect |
143 ms |
3656 KB |
Output isn't correct |
25 |
Incorrect |
116 ms |
3656 KB |
Output isn't correct |
26 |
Incorrect |
136 ms |
3656 KB |
Output isn't correct |
27 |
Incorrect |
139 ms |
3656 KB |
Output isn't correct |
28 |
Incorrect |
137 ms |
3656 KB |
Output isn't correct |
29 |
Incorrect |
144 ms |
3656 KB |
Output isn't correct |
30 |
Incorrect |
115 ms |
3656 KB |
Output isn't correct |
31 |
Incorrect |
1 ms |
3656 KB |
Output isn't correct |
32 |
Incorrect |
2 ms |
3656 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
3656 KB |
Partially correct |
2 |
Partially correct |
2 ms |
3656 KB |
Partially correct |
3 |
Partially correct |
2 ms |
3656 KB |
Partially correct |
4 |
Partially correct |
1 ms |
3656 KB |
Partially correct |
5 |
Partially correct |
2 ms |
3656 KB |
Partially correct |
6 |
Partially correct |
1 ms |
3656 KB |
Partially correct |
7 |
Partially correct |
2 ms |
3656 KB |
Partially correct |
8 |
Partially correct |
2 ms |
3656 KB |
Partially correct |
9 |
Partially correct |
2 ms |
3656 KB |
Partially correct |
10 |
Partially correct |
2 ms |
3656 KB |
Partially correct |
11 |
Partially correct |
3 ms |
3656 KB |
Partially correct |
12 |
Partially correct |
4 ms |
3656 KB |
Partially correct |
13 |
Partially correct |
4 ms |
3656 KB |
Partially correct |
14 |
Partially correct |
4 ms |
3656 KB |
Partially correct |
15 |
Partially correct |
3 ms |
3656 KB |
Partially correct |
16 |
Partially correct |
37 ms |
3656 KB |
Partially correct |
17 |
Partially correct |
36 ms |
3656 KB |
Partially correct |
18 |
Partially correct |
36 ms |
3656 KB |
Partially correct |
19 |
Partially correct |
36 ms |
3656 KB |
Partially correct |
20 |
Partially correct |
29 ms |
3656 KB |
Partially correct |
21 |
Partially correct |
144 ms |
3656 KB |
Partially correct |
22 |
Partially correct |
142 ms |
3656 KB |
Partially correct |
23 |
Partially correct |
157 ms |
3656 KB |
Partially correct |
24 |
Partially correct |
142 ms |
3656 KB |
Partially correct |
25 |
Partially correct |
113 ms |
3656 KB |
Partially correct |
26 |
Partially correct |
143 ms |
3656 KB |
Partially correct |
27 |
Partially correct |
142 ms |
3656 KB |
Partially correct |
28 |
Partially correct |
163 ms |
3656 KB |
Partially correct |
29 |
Partially correct |
144 ms |
3680 KB |
Partially correct |
30 |
Partially correct |
113 ms |
3680 KB |
Partially correct |
31 |
Partially correct |
2 ms |
3680 KB |
Partially correct |
32 |
Partially correct |
2 ms |
3680 KB |
Partially correct |