## Submission #300091

# Submission time Handle Problem Language Result Execution time Memory
300091 2020-09-16T14:52:23 Z a_player Gap (APIO16_gap) C++14
0 / 100
82 ms 2040 KB
```#include "gap.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
long long findGap(int T, int N){
if(T==1){
ll mx, mn;
vector<ll> a(N);
MinMax(0,2e18,&mn,&mx);
a[0]=mn;
a[N-1]=mx;
int i=1;
while(mx!=mn){
MinMax(mn+1,mx-1,&mn,&mx);
if(mn==-1)break;
a[i]=mn;
a[N-i-1]=mx;
i++;
}
ll ans=0;
for(int i=1;i<N;i++)ans=max(ans,a[i]-a[i-1]);
cout<<ans;
return 0;
}
ll mn,mx;
MinMax(0,2e18,&mn,&mx);
ll d=(mx-mn+N-1)/N;
ll a=mn+1;
ll b=mn+d;
ll l=mn;
ll ans=0;
for(int i=0;i<N;i++){
if(b>=mx)b=mx-1;
if(a>b)break;
ll mnn,mxx;
MinMax(a,b,&mnn,&mxx);
if(mnn!=-1){
ans=max(ans,mnn-l);
l=mxx;
}
a+=d;
b+=d;
}
ans=max(ans,mx-l);
cout<<ans;
return 0;
}
```

#### Subtask #1 0 / 30.0

# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Incorrect 1 ms 384 KB Output isn't correct
4 Incorrect 1 ms 384 KB Output isn't correct
5 Incorrect 0 ms 384 KB Output isn't correct
6 Incorrect 0 ms 384 KB Output isn't correct
7 Incorrect 0 ms 384 KB Output isn't correct
8 Incorrect 1 ms 384 KB Output isn't correct
9 Incorrect 0 ms 384 KB Output isn't correct
10 Runtime error 1 ms 384 KB Execution failed because the return code was nonzero
11 Incorrect 1 ms 384 KB Output isn't correct
12 Incorrect 1 ms 384 KB Output isn't correct
13 Incorrect 1 ms 384 KB Output isn't correct
14 Incorrect 1 ms 384 KB Output isn't correct
15 Incorrect 1 ms 384 KB Output isn't correct
16 Incorrect 12 ms 768 KB Output isn't correct
17 Incorrect 13 ms 768 KB Output isn't correct
18 Incorrect 13 ms 768 KB Output isn't correct
19 Incorrect 13 ms 768 KB Output isn't correct
20 Runtime error 9 ms 768 KB Execution failed because the return code was nonzero
21 Incorrect 52 ms 2040 KB Output isn't correct
22 Incorrect 51 ms 1912 KB Output isn't correct
23 Incorrect 51 ms 1912 KB Output isn't correct
24 Incorrect 52 ms 1920 KB Output isn't correct
25 Incorrect 43 ms 1904 KB Output isn't correct
26 Incorrect 53 ms 1916 KB Output isn't correct
27 Incorrect 53 ms 1912 KB Output isn't correct
28 Incorrect 52 ms 1912 KB Output isn't correct
29 Incorrect 54 ms 1912 KB Output isn't correct
30 Runtime error 38 ms 1920 KB Execution failed because the return code was nonzero
31 Runtime error 0 ms 384 KB Execution failed because the return code was nonzero
32 Runtime error 0 ms 384 KB Execution failed because the return code was nonzero

#### Subtask #2 0 / 70.0

# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Incorrect 1 ms 384 KB Output isn't correct
3 Incorrect 0 ms 384 KB Output isn't correct
4 Incorrect 1 ms 384 KB Output isn't correct
5 Incorrect 1 ms 384 KB Output isn't correct
6 Incorrect 0 ms 384 KB Output isn't correct
7 Incorrect 1 ms 384 KB Output isn't correct
8 Incorrect 1 ms 384 KB Output isn't correct
9 Incorrect 1 ms 384 KB Output isn't correct
10 Incorrect 0 ms 384 KB Output isn't correct
11 Incorrect 1 ms 384 KB Output isn't correct
12 Incorrect 1 ms 384 KB Output isn't correct
13 Incorrect 1 ms 384 KB Output isn't correct
14 Incorrect 1 ms 384 KB Output isn't correct
15 Incorrect 1 ms 384 KB Output isn't correct
16 Incorrect 17 ms 512 KB Output isn't correct
17 Incorrect 17 ms 512 KB Output isn't correct
18 Incorrect 16 ms 512 KB Output isn't correct
19 Incorrect 17 ms 512 KB Output isn't correct
20 Incorrect 8 ms 512 KB Output isn't correct
21 Incorrect 68 ms 1132 KB Output isn't correct
22 Incorrect 70 ms 1060 KB Output isn't correct
23 Incorrect 66 ms 1144 KB Output isn't correct
24 Incorrect 67 ms 1136 KB Output isn't correct
25 Incorrect 61 ms 1272 KB Output isn't correct
26 Incorrect 68 ms 1144 KB Output isn't correct
27 Incorrect 67 ms 1272 KB Output isn't correct
28 Incorrect 67 ms 1144 KB Output isn't correct
29 Incorrect 82 ms 1272 KB Output isn't correct
30 Incorrect 36 ms 1272 KB Output isn't correct
31 Incorrect 1 ms 384 KB Output isn't correct
32 Incorrect 1 ms 384 KB Output isn't correct