# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
723352 | t_holl | Measures (CEOI22_measures) | C++14 | 1571 ms | 312 KiB |
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 (vector<int> &res) {
int ans = 0;
sort(res.begin(), res.end());
for (int i = 0; i < res.size(); i ++)
for (int j = i; j < res.size(); j ++)
ans = max(ans, D * (j - i) - (res[j] - res[i]));
return ((double) ans) / 2.0;
}
int main() {
cin >> N >> M >> D;
vector<int> res;
for (int i = 0; i < N; i ++) {
int x; cin >> x;
res.push_back(x);
}
for (int i = 0; i < M; i ++) {
int x; cin >> x;
res.push_back(x);
cout << compute(res) << " ";
}
cout << endl;
return 0;
}
Compilation message (stderr)
# | 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... |