Submission #862908

#TimeUsernameProblemLanguageResultExecution timeMemory
862908Trisanu_DasMeasures (CEOI22_measures)C++17
10 / 100
1547 ms5464 KiB
#include <bits/stdc++.h> #define int long long using namespace std; signed 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, reponse = 0; cin >> nouveau; points.push_back(nouveau); sort(points.begin(), points.end()); for (int a = 0; a < (int)points.size(); a++) for (int b = a+1; b < (int)points.size(); b++) reponse = max(reponse, ((d * (b-a)) - (points[b] - points[a]))); cout << (reponse - reponse % 2) / 2; if (reponse % 2) cout << ".5"; cout << ' '; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...