Submission #441008

#TimeUsernameProblemLanguageResultExecution timeMemory
441008penguinhackerBalloons (CEOI11_bal)C++14
20 / 100
228 ms8048 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"; 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...