Submission #211805

#TimeUsernameProblemLanguageResultExecution timeMemory
211805MarcVanaBalloons (CEOI11_bal)C++14
100 / 100
904 ms7316 KiB
#include <iostream> #include <iomanip> #include <stack> #define x first #define r second using namespace std; int N; double X, R; stack < pair <double, double> > S; double balloon(double X, double R) { while (!S.empty()) { pair <double, double> p = S.top(); R = min(R, (p.x - X) * (p.x - X) / (4.0 * p.r)); if (R > p.r) S.pop(); else break; } S.push({X, R}); return R; } int main() { cin >> N; for (int i = 1; i <= N; ++i) { cin >> X >> R; cout << fixed << setprecision(3) << balloon(X, 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...