Submission #654508

#TimeUsernameProblemLanguageResultExecution timeMemory
654508HanksburgerBalloons (CEOI11_bal)C++17
10 / 100
217 ms4588 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()) { long double k=(x-s.top().first)*(x-s.top().first)/4.0/s.top().second; if (r<k) break; r=k; s.pop(); } cout << fixed << setprecision(3) << r << '\n'; while (s.size() && s.top().second<=r) s.pop(); 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...