Submission #1020037

#TimeUsernameProblemLanguageResultExecution timeMemory
1020037julia_08Balloons (CEOI11_bal)C++17
100 / 100
149 ms5528 KiB
#include <bits/stdc++.h> using namespace std; using ld = long double; ld solve(ld x1, ld x2, ld r2){ return ((x2 - x1)*(x2 - x1))/(4*r2); } int main(){ cin.tie(0)->sync_with_stdio(0); int n; cin >> n; stack<pair<ld, ld>> q; for(int i=1; i<=n; i++){ ld x, r; cin >> x >> r; while(!q.empty()){ r = min(r, solve(x, q.top().first, q.top().second)); if(q.top().second > r) break; q.pop(); } cout << fixed << setprecision(3) << r << "\n"; q.push({x, r}); } 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...