Submission #218335

#TimeUsernameProblemLanguageResultExecution timeMemory
218335ChanchoBalloons (CEOI11_bal)C++14
100 / 100
901 ms8824 KiB
#include <iostream> #include <stack> #include <iomanip> using namespace std; int main() { int n; cin >> n; stack<pair<int,long double>> s; for(int i=0;i<n;i++){ long double x,r; cin >> x >> r; while(!s.empty()){ int X = s.top().first; double R = s.top().second; r = min(r,(x-X)*(x-X)/(4*(R))); if(r < R){ break; } s.pop(); } s.push({x,r}); cout << fixed << setprecision(3) << r << "\n"; } 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...