Submission #549585

#TimeUsernameProblemLanguageResultExecution timeMemory
549585JomnoiBalloons (CEOI11_bal)C++17
10 / 100
228 ms5260 KiB
#include <bits/stdc++.h> #define DEBUG 0 using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); int n; cin >> n; stack <pair <double, double>> stk; for(int i = 1; i <= n; i++) { double x, r, nr; cin >> x >> r; while(!stk.empty() and (nr = (stk.top().first - x) * (stk.top().first - x) / (4 * stk.top().second)) <= r) { r = min(nr, r); stk.pop(); } stk.emplace(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...