# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
723348 | Quentolosse | Measures (CEOI22_measures) | C++14 | 1568 ms | 496 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 main() {
ios::sync_with_stdio(false), cin.tie(0);
int n, m, d;
cin >> n >> m >> d;
vector<int> points (n);
for (int i = 0; i < n; i++)
{
cin >> points[i];
}
for (int i = 0; i < m; i++)
{
int nouveau;
long long reponse = 0;
cin >> nouveau;
points.push_back(nouveau);
sort(points.begin(), points.end());
for (int a = 0; a < points.size(); a++)
{
for (int b = a+1; b < points.size(); b++)
{
reponse = max(reponse, (long long)((d * (b-a)) - (points[b] - points[a])));
}
}
cout << (reponse - reponse % 2) / 2;
if (reponse % 2) cout << ".5";
cout << ' ';
}
}
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... |