Submission #1020015

#TimeUsernameProblemLanguageResultExecution timeMemory
1020015julia_08Balloons (CEOI11_bal)C++17
0 / 100
144 ms5200 KiB
#include <bits/stdc++.h> using namespace std; const double w = 0.0001; double solve(int x1, int x2, double r2){ return ((x2 - x1)*(x2 - x1))/(4*r2) - w; } int main(){ cin.tie(0)->sync_with_stdio(0); int n; cin >> n; stack<pair<double, double>> q; for(int i=1; i<=n; i++){ double x, r; cin >> x >> r; while(!q.empty() && q.top().second < r){ r = min(r, solve(x, q.top().first, q.top().second)); q.pop(); } if(!q.empty()) r = min(r, solve(x, q.top().first, q.top().second)); 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...