# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
683314 | nutella | Measures (CEOI22_measures) | C++17 | 23 ms | 3908 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;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m, D;
cin >> n >> m >> D;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
vector<int> b(m);
for (int i = 0; i < m; ++i) {
cin >> b[i];
}
if (n > 0) {
sort(a.begin(), a.end());
for (int i = 0; i < m; ++i) {
a.insert(lower_bound(a.begin(), a.end(), b[i]), b[i]);
ll ans = 0;
for (int j = 0; j < size(a); ++j) {
ans = max(ans, 1LL * D * j - a[j]);
}
ans += a[0];
if (ans % 2 == 0) {
cout << ans / 2 << ' ';
} else {
cout << ans / 2 << ".5 ";
}
}
} else {
assert(false);
}
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... |