Submission #441024

#TimeUsernameProblemLanguageResultExecution timeMemory
441024penguinhackerBalloons (CEOI11_bal)C++14
30 / 100
215 ms1944 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(3); int n; cin >> n; vector<pair<int, double>> v; while(n--) { int x; double r; cin >> x >> r; auto d=[x](pair<int, double> p) { double dx=x-p.first; return dx*dx/(4*p.second); }; while(v.size()>=2&&d(v.end()[-1])>=d(v.end()[-2])) v.pop_back(); double h=v.size()?min(r, d(v.back())):r; cout << h << "\n"; while(v.size()&&h>=v.back().second) v.pop_back(); v.emplace_back(x, h); } return 0; }
#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...