#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; _ < 200; _++) {
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;
}
}
string s = to_string(round(l * 1000) / 1000.0);
while (s.back() == '0') s.pop_back();
if (s.back() == '.') s.pop_back();
cout << s << ' ';
}
cout << '\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
348 KB |
Output is correct |
2 |
Correct |
10 ms |
472 KB |
Output is correct |
3 |
Correct |
10 ms |
348 KB |
Output is correct |
4 |
Correct |
10 ms |
348 KB |
Output is correct |
5 |
Correct |
10 ms |
348 KB |
Output is correct |
6 |
Correct |
7 ms |
348 KB |
Output is correct |
7 |
Correct |
9 ms |
480 KB |
Output is correct |
8 |
Correct |
10 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
348 KB |
Output is correct |
2 |
Correct |
10 ms |
472 KB |
Output is correct |
3 |
Correct |
10 ms |
348 KB |
Output is correct |
4 |
Correct |
10 ms |
348 KB |
Output is correct |
5 |
Correct |
10 ms |
348 KB |
Output is correct |
6 |
Correct |
7 ms |
348 KB |
Output is correct |
7 |
Correct |
9 ms |
480 KB |
Output is correct |
8 |
Correct |
10 ms |
344 KB |
Output is correct |
9 |
Correct |
962 ms |
4076 KB |
Output is correct |
10 |
Correct |
1025 ms |
4076 KB |
Output is correct |
11 |
Correct |
929 ms |
3896 KB |
Output is correct |
12 |
Correct |
1037 ms |
4056 KB |
Output is correct |
13 |
Correct |
921 ms |
3544 KB |
Output is correct |
14 |
Correct |
944 ms |
3916 KB |
Output is correct |
15 |
Correct |
967 ms |
3284 KB |
Output is correct |
16 |
Incorrect |
928 ms |
4056 KB |
Output isn't correct |
17 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1511 ms |
1488 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1511 ms |
1488 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |