#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
int n, m, d;
cin >> n >> m >> d;
int a[n];
vector<int> v;
for (int i = 0; i < n; i++) {
cin >> a[i];
v.push_back(a[i]);
}
int b[m];
for (int i = 0; i < m; i++) {
cin >> b[i];
v.push_back(b[i]);
sort(v.begin(), v.end());
double l = 0, r = 1e18;
for (int _ = 0; _ < 100; _++) {
double md = (l + r) / 2;
double lst = -1e18;
bool ok = 1;
for (auto x : v) {
lst = max(lst + d, x - md);
if (lst > x + md) {
ok = 0;
break;
}
}
if (ok) {
r = md;
} else {
l = md;
}
}
cout << l << ' ';
}
cout << '\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
348 KB |
Output is correct |
2 |
Incorrect |
5 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
348 KB |
Output is correct |
2 |
Incorrect |
5 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1512 ms |
1476 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1512 ms |
1476 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |