#include<iostream>
#include<algorithm>
using namespace std;
#define int long long
const int INF = 1e18;
int n,m,d;
int a[200055];
signed main()
{
ios_base::sync_with_stdio(0);cin.tie(0);
cin>>n>>m>>d;
for(int i=1;i<=n;i++)
{
cin>>a[i];
}
for(int pas=1;pas<=m;pas++)
{
cin>>a[n+pas];
sort(a+1,a+1+n+pas);
int mxm=0;
for(int i=1;i<=n+pas;i++)
{
int aux=-INF;
for(int j=1;j<i;j++)
{
aux = max(aux, a[j]+d*(i-j));
}
mxm = max(mxm, aux-a[i]);
}
if(mxm%2==0) cout<<mxm/2<<" ";
else cout<<mxm/2<<".5 ";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
344 KB |
Output is correct |
2 |
Correct |
19 ms |
496 KB |
Output is correct |
3 |
Correct |
19 ms |
496 KB |
Output is correct |
4 |
Correct |
20 ms |
344 KB |
Output is correct |
5 |
Correct |
19 ms |
348 KB |
Output is correct |
6 |
Correct |
20 ms |
348 KB |
Output is correct |
7 |
Correct |
20 ms |
348 KB |
Output is correct |
8 |
Correct |
19 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
344 KB |
Output is correct |
2 |
Correct |
19 ms |
496 KB |
Output is correct |
3 |
Correct |
19 ms |
496 KB |
Output is correct |
4 |
Correct |
20 ms |
344 KB |
Output is correct |
5 |
Correct |
19 ms |
348 KB |
Output is correct |
6 |
Correct |
20 ms |
348 KB |
Output is correct |
7 |
Correct |
20 ms |
348 KB |
Output is correct |
8 |
Correct |
19 ms |
504 KB |
Output is correct |
9 |
Execution timed out |
1543 ms |
4148 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1531 ms |
748 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1531 ms |
748 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |