Submission #719686

#TimeUsernameProblemLanguageResultExecution timeMemory
719686peijarMeasures (CEOI22_measures)C++17
0 / 100
1554 ms356 KiB
#include <bits/stdc++.h> #define int long long using namespace std; string to_string(string s) { return s; } template <typename T> string to_string(T v) { bool first = true; string res = "["; for (const auto &x : v) { if (!first) res += ", "; first = false; res += to_string(x); } res += "]"; return res; } void dbg_out() { cout << endl; } template <typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cout << ' ' << to_string(H); dbg_out(T...); } #ifdef DEBUG #define dbg(...) cout << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__) #else #define dbg(...) #endif signed main(void) { ios_base::sync_with_stdio(false); cin.tie(0); int nbPersonnes, nbRequetes, D; cin >> nbPersonnes >> nbRequetes >> D; vector<int> values; for (int i = 0; i < nbPersonnes; ++i) { int x; cin >> x; values.push_back(x); } for (int i = 0; i < nbRequetes; ++i) { int x; cin >> x; values.push_back(x); sort(values.begin(), values.end()); int T = 0; for (int u = 0; u < (int)values.size(); ++u) for (int v = u + 1; v < (int)values.size(); ++v) T = max(T, D * v - values[v] - (D * u - values[u])); cout << T / 2. << ' '; } cout << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...