#include<iostream>
#include<algorithm>
#include "gap.h"
using namespace std;
long long mn,mx;
long long findGap(int T, int N)
{
if(T>=1)
{
long long l=0LL,r=1000000000000000000LL,prevmn=-1,prevmx=-1;
long long rem=N;
long long ans=0LL;
while(rem>0)
{
MinMax(l,r,&mn,&mx);
if(rem==2)ans=max(ans,mx-mn);
if(prevmn!=-1)
{
ans=max(ans,mn-prevmn);
ans=max(ans,prevmx-mx);
}
if(mn!=mx)rem-=2;
else rem--;
l=mn;
r=mx;
prevmn=mn;
prevmx=mx;
}
return ans;
}
else
{
}
}
Compilation message
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type]
35 | }
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
11 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
13 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
14 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
15 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
16 |
Incorrect |
5 ms |
600 KB |
Output isn't correct |
17 |
Incorrect |
5 ms |
436 KB |
Output isn't correct |
18 |
Incorrect |
8 ms |
600 KB |
Output isn't correct |
19 |
Incorrect |
5 ms |
600 KB |
Output isn't correct |
20 |
Incorrect |
4 ms |
480 KB |
Output isn't correct |
21 |
Incorrect |
18 ms |
1112 KB |
Output isn't correct |
22 |
Incorrect |
18 ms |
1112 KB |
Output isn't correct |
23 |
Incorrect |
20 ms |
1112 KB |
Output isn't correct |
24 |
Incorrect |
27 ms |
1120 KB |
Output isn't correct |
25 |
Incorrect |
16 ms |
1112 KB |
Output isn't correct |
26 |
Incorrect |
23 ms |
1112 KB |
Output isn't correct |
27 |
Incorrect |
18 ms |
1112 KB |
Output isn't correct |
28 |
Incorrect |
27 ms |
1120 KB |
Output isn't correct |
29 |
Incorrect |
18 ms |
1112 KB |
Output isn't correct |
30 |
Incorrect |
14 ms |
1112 KB |
Output isn't correct |
31 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
15 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
16 |
Incorrect |
5 ms |
432 KB |
Output isn't correct |
17 |
Incorrect |
4 ms |
600 KB |
Output isn't correct |
18 |
Incorrect |
5 ms |
600 KB |
Output isn't correct |
19 |
Incorrect |
4 ms |
600 KB |
Output isn't correct |
20 |
Incorrect |
4 ms |
600 KB |
Output isn't correct |
21 |
Incorrect |
18 ms |
1200 KB |
Expected int32, but "5000050000" found |
22 |
Incorrect |
19 ms |
1112 KB |
Expected int32, but "5000050000" found |
23 |
Incorrect |
18 ms |
1112 KB |
Expected int32, but "5000050000" found |
24 |
Incorrect |
18 ms |
1112 KB |
Expected int32, but "5000050000" found |
25 |
Incorrect |
16 ms |
1112 KB |
Expected int32, but "5000050000" found |
26 |
Incorrect |
18 ms |
1112 KB |
Expected int32, but "5000050000" found |
27 |
Incorrect |
29 ms |
1104 KB |
Expected int32, but "5000050000" found |
28 |
Incorrect |
24 ms |
1112 KB |
Expected int32, but "5000050000" found |
29 |
Incorrect |
19 ms |
1112 KB |
Expected int32, but "5000050000" found |
30 |
Incorrect |
15 ms |
1112 KB |
Expected int32, but "5000050000" found |
31 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
412 KB |
Output isn't correct |