## Submission #300092

# Submission time Handle Problem Language Result Execution time Memory
300092 2020-09-16T14:58:21 Z a_player Gap (APIO16_gap) C++14
0 / 100
73 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;
for(int i=1;i<(N+1)/2;i++){
MinMax(mn+1,mx-1,&mn,&mx);
if(mn==-1)break;
a[i]=mn;
a[N-i-1]=mx;
}
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 1 ms 256 KB Output isn't correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Incorrect 0 ms 384 KB Output isn't correct
4 Incorrect 0 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 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 13 ms 768 KB Output isn't correct
17 Incorrect 13 ms 768 KB Output isn't correct
18 Incorrect 15 ms 768 KB Output isn't correct
19 Incorrect 13 ms 768 KB Output isn't correct
20 Incorrect 11 ms 836 KB Output isn't correct
21 Incorrect 50 ms 1896 KB Output isn't correct
22 Incorrect 51 ms 1912 KB Output isn't correct
23 Incorrect 57 ms 1912 KB Output isn't correct
24 Incorrect 53 ms 1912 KB Output isn't correct
25 Incorrect 51 ms 1912 KB Output isn't correct
26 Incorrect 52 ms 1964 KB Output isn't correct
27 Incorrect 51 ms 1912 KB Output isn't correct
28 Incorrect 52 ms 2040 KB Output isn't correct
29 Incorrect 51 ms 1912 KB Output isn't correct
30 Incorrect 39 ms 1920 KB Output isn't correct
31 Incorrect 1 ms 384 KB Output isn't correct
32 Incorrect 0 ms 384 KB Output isn't correct

#### Subtask #2 0 / 70.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 0 ms 384 KB Output isn't correct
4 Incorrect 0 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 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 544 KB Output isn't correct
17 Incorrect 16 ms 512 KB Output isn't correct
18 Incorrect 16 ms 512 KB Output isn't correct
19 Incorrect 16 ms 512 KB Output isn't correct
20 Incorrect 8 ms 512 KB Output isn't correct
21 Incorrect 67 ms 1144 KB Output isn't correct
22 Incorrect 73 ms 1096 KB Output isn't correct
23 Incorrect 66 ms 1144 KB Output isn't correct
24 Incorrect 69 ms 1144 KB Output isn't correct
25 Incorrect 61 ms 1152 KB Output isn't correct
26 Incorrect 71 ms 1144 KB Output isn't correct
27 Incorrect 67 ms 1080 KB Output isn't correct
28 Incorrect 66 ms 1056 KB Output isn't correct
29 Incorrect 68 ms 1144 KB Output isn't correct
30 Incorrect 35 ms 1144 KB Output isn't correct
31 Incorrect 1 ms 384 KB Output isn't correct
32 Incorrect 0 ms 384 KB Output isn't correct