Submission #1121363

#TimeUsernameProblemLanguageResultExecution timeMemory
1121363LeynaBalloons (CEOI11_bal)C++17
0 / 100
474 ms6988 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> x(n), r(n); for (int i=0; i<n; i++){ cin >> x[i] >> r[i]; } vector<float> res(n); res[0] = r[0]; int last_idx = 0; for (int i=1; i<n; i++){ float r1 = float((x[i]-x[i-1]) * (x[i]-x[i-1])) / float(4 * res[i-1]); float r_last = float((x[i]-x[last_idx]) * (x[i]-x[last_idx])) / float(4 * res[last_idx]); res[i] = min(float(r[i]), min(r1, r_last)); if(r1 < r_last){ last_idx = i; } } for (float a : res) cout << fixed << setprecision(3) << a << 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...