#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
ll n, m, d, i, z, la;
cin >> n >> m >> d;
multiset<ll> s;
while (n--)
{
cin >> i;
s.insert(i);
}
while (m--)
{
cin >> i;
s.insert(i);
z = 0;
la = -d;
for (auto h : s)
{
z = max(z, la + d - h);
la = max(la + d, h);
}
if (z % 2)
cout << z / 2 << ".5 ";
else
cout << z / 2 << " ";
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
124 ms |
11864 KB |
Output is correct |
10 |
Correct |
79 ms |
11608 KB |
Output is correct |
11 |
Correct |
57 ms |
11604 KB |
Output is correct |
12 |
Correct |
60 ms |
11600 KB |
Output is correct |
13 |
Correct |
62 ms |
11088 KB |
Output is correct |
14 |
Correct |
49 ms |
11608 KB |
Output is correct |
15 |
Correct |
120 ms |
11084 KB |
Output is correct |
16 |
Correct |
61 ms |
11600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1563 ms |
1796 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1563 ms |
1796 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |