Submission #1020024

#TimeUsernameProblemLanguageResultExecution timeMemory
1020024julia_08Balloons (CEOI11_bal)C++17
0 / 100
169 ms2384 KiB
#include <bits/stdc++.h> using namespace std; using ld = long double; const ld w = 0.0001; ld solve(int x1, int 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() && 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...