#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 = 1e15;
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;
}
}
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;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
348 KB |
Output is correct |
2 |
Correct |
5 ms |
464 KB |
Output is correct |
3 |
Correct |
5 ms |
348 KB |
Output is correct |
4 |
Correct |
5 ms |
500 KB |
Output is correct |
5 |
Correct |
5 ms |
500 KB |
Output is correct |
6 |
Correct |
4 ms |
348 KB |
Output is correct |
7 |
Correct |
5 ms |
348 KB |
Output is correct |
8 |
Correct |
5 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
348 KB |
Output is correct |
2 |
Correct |
5 ms |
464 KB |
Output is correct |
3 |
Correct |
5 ms |
348 KB |
Output is correct |
4 |
Correct |
5 ms |
500 KB |
Output is correct |
5 |
Correct |
5 ms |
500 KB |
Output is correct |
6 |
Correct |
4 ms |
348 KB |
Output is correct |
7 |
Correct |
5 ms |
348 KB |
Output is correct |
8 |
Correct |
5 ms |
348 KB |
Output is correct |
9 |
Correct |
519 ms |
3348 KB |
Output is correct |
10 |
Correct |
583 ms |
3284 KB |
Output is correct |
11 |
Correct |
476 ms |
3356 KB |
Output is correct |
12 |
Correct |
591 ms |
3396 KB |
Output is correct |
13 |
Correct |
478 ms |
3276 KB |
Output is correct |
14 |
Correct |
477 ms |
3292 KB |
Output is correct |
15 |
Correct |
526 ms |
2776 KB |
Output is correct |
16 |
Incorrect |
478 ms |
3284 KB |
Output isn't correct |
17 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1561 ms |
1640 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1561 ms |
1640 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |