# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
723335 | 2023-04-13T15:46:42 Z | Richem | Measures (CEOI22_measures) | C++14 | 1500 ms | 424 KB |
#include <iostream> #include <vector> #include <algorithm> using namespace std; const int MAX_NOMBRE = 1000; int nbDebut, nbAjout, distMin; vector<int> pos; int 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+1; fin < pos.size(); fin++) { total = max(total, (fin - deb) * distMin - pos[fin] + pos[deb]); } } cout << total/2.0 << " "; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 27 ms | 212 KB | Output is correct |
2 | Incorrect | 22 ms | 312 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 27 ms | 212 KB | Output is correct |
2 | Incorrect | 22 ms | 312 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1573 ms | 424 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1573 ms | 424 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |