Submission #654509

#TimeUsernameProblemLanguageResultExecution timeMemory
654509HanksburgerBalloons (CEOI11_bal)C++17
100 / 100
233 ms5468 KiB
#include <bits/stdc++.h> using namespace std; stack<pair<long double, long double> > s; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; while (n--) { long double x, r; cin >> x >> r; while (s.size()) { r=min(r, (x-s.top().first)*(x-s.top().first)/4.0/s.top().second); if (s.top().second>r) break; s.pop(); } cout << fixed << setprecision(3) << r+0.000001 << '\n'; s.push({x, r}); } }
#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...