# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
723349 | Richem | Measures (CEOI22_measures) | C++14 | 1571 ms | 3624 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 <iostream>
#include <vector>
#include <algorithm>
#define int long long
using namespace std;
int nbDebut, nbAjout, distMin;
vector<int> pos;
signed main() {
cin >> nbDebut >> nbAjout >> distMin;
for(int i = 0; i < nbDebut; i++) {
int cur;
cin >> cur;
pos.push_back(cur);
}
for(int req = 0; req < nbAjout; req++) {
int nouv;
cin >> nouv;
pos.push_back(nouv);
sort(pos.begin(), pos.end());
int total = 0;
for(int deb = 0; deb < pos.size(); deb++) {
for(int fin = deb; fin < pos.size(); fin++) {
total = max(total, (fin - deb) * distMin - pos[fin] + pos[deb]);
}
}
cout << total/2;
if(total % 2 == 1) {
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... |