#include <bits/stdc++.h>
using namespace std;
int n, m, d;
vector<int> a, b;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> m >> d;
a.resize(n); b.resize(m);
for (int i = 0; i < n; i++) cin >> a[i];
sort(a.begin(), a.end());
for (int i = 0; i < m; i++) {
cin >> b[i];
a.push_back(b[i]);
sort(a.begin(), a.end());
long double e = a[0], ans = 0.0;
for (int j = 1; j < (int) a.size(); j++) {
long double reach = a[j] + ans;
if (reach - e > d) {
if (a[j] > e + d) e = max(e + d, a[j] - ans);
else e += d;
} else {
long double tmp = ans;
ans += (e + d - reach) / 2;
e = a[j] + tmp + (e + d - reach) / 2;
}
}
cout << fixed << setprecision(10) << ans << ' ';
}
cout << '\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1575 ms |
1748 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1575 ms |
1748 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |