This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int N, M, D;
double compute (multiset<int> &res) {
double ans = 0;
int last = - 1;
for (int val : res) {
int del = D - (val - last);
if (del > 0 && last != -1) {
ans += del / 2.0;
}
last = val;
}
return ans;
}
int main() {
cin >> N >> M >> D;
multiset<int> res;
for (int i = 0; i < N; i ++) {
int x; cin >> x;
res.insert(x);
}
for (int i = 0; i < M; i ++) {
int x; cin >> x;
res.insert(x);
cout << compute(res) << " ";
}
cout << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |