Submission #1020034

#TimeUsernameProblemLanguageResultExecution timeMemory
1020034julia_08Balloons (CEOI11_bal)C++17
20 / 100
191 ms7200 KiB
#include <bits/stdc++.h> using namespace std; using ld = long double; const ld w = 0.0001; ld solve(ld x1, ld x2, ld r2){ return ((x2 - x1)*(x2 - x1))/(4*r2) - w; } 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...