Submission #723343

#TimeUsernameProblemLanguageResultExecution timeMemory
723343kilikumaMeasures (CEOI22_measures)C++14
0 / 100
1566 ms464 KiB
#include <bits/stdc++.h> using namespace std; int N, M, D; int reponse(vector<int> vals) { int n = vals.size(); int maxicur = 0; for (int i = 0; i < n; i ++) { for (int j = i; j < n; j ++) { maxicur = max(maxicur, (j - i) * D - (vals[j] - vals[i])); } } return maxicur; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cin >> N >> M >> D; vector<int> vals; for (int i = 0; i < N; i ++) { int val; cin >> val; vals.push_back(val); } for (int i = 0; i < M; i ++) { int val; cin >> val; vals.push_back(val); sort(vals.begin(), vals.end()); cout << (double) reponse(vals) / 2 << " "; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...