# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1084407 |
2024-09-06T08:15:25 Z |
MMihalev |
Gap (APIO16_gap) |
C++14 |
|
28 ms |
1196 KB |
#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--;
prevmn=mn;
prevmx=mx;
}
return ans;
}
else
{
}
}
Compilation message
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
33 | }
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 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 |
1 ms |
344 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
12 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
14 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
15 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
16 |
Incorrect |
5 ms |
600 KB |
Output isn't correct |
17 |
Incorrect |
6 ms |
600 KB |
Output isn't correct |
18 |
Incorrect |
4 ms |
584 KB |
Output isn't correct |
19 |
Incorrect |
5 ms |
600 KB |
Output isn't correct |
20 |
Incorrect |
6 ms |
600 KB |
Output isn't correct |
21 |
Incorrect |
18 ms |
1112 KB |
Output isn't correct |
22 |
Incorrect |
26 ms |
1116 KB |
Output isn't correct |
23 |
Incorrect |
19 ms |
1112 KB |
Output isn't correct |
24 |
Incorrect |
28 ms |
1112 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 |
19 ms |
1112 KB |
Output isn't correct |
28 |
Incorrect |
28 ms |
1028 KB |
Output isn't correct |
29 |
Incorrect |
18 ms |
1152 KB |
Output isn't correct |
30 |
Incorrect |
15 ms |
1080 KB |
Output isn't correct |
31 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
32 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
4 |
Incorrect |
1 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 |
1 ms |
344 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
452 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 |
1 ms |
344 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
15 |
Incorrect |
1 ms |
424 KB |
Output isn't correct |
16 |
Incorrect |
6 ms |
556 KB |
Output isn't correct |
17 |
Incorrect |
7 ms |
484 KB |
Output isn't correct |
18 |
Incorrect |
5 ms |
600 KB |
Output isn't correct |
19 |
Incorrect |
5 ms |
600 KB |
Output isn't correct |
20 |
Incorrect |
4 ms |
600 KB |
Output isn't correct |
21 |
Incorrect |
24 ms |
1196 KB |
Expected int32, but "5000050000" found |
22 |
Incorrect |
18 ms |
1112 KB |
Expected int32, but "5000050000" found |
23 |
Incorrect |
27 ms |
1112 KB |
Expected int32, but "5000050000" found |
24 |
Incorrect |
21 ms |
1068 KB |
Expected int32, but "5000050000" found |
25 |
Incorrect |
18 ms |
1004 KB |
Expected int32, but "5000050000" found |
26 |
Incorrect |
19 ms |
1112 KB |
Expected int32, but "5000050000" found |
27 |
Incorrect |
27 ms |
980 KB |
Expected int32, but "5000050000" found |
28 |
Incorrect |
20 ms |
1112 KB |
Expected int32, but "5000050000" found |
29 |
Incorrect |
18 ms |
1112 KB |
Expected int32, but "5000050000" found |
30 |
Incorrect |
14 ms |
1112 KB |
Expected int32, but "5000050000" found |
31 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |