Submission #1025587

#TimeUsernameProblemLanguageResultExecution timeMemory
1025587sanmorBalloons (CEOI11_bal)C++17
100 / 100
468 ms5524 KiB
#include "bits/stdc++.h" using namespace std; stack<pair<double, double>> st; int main(){ int n; cin >> n; for(int i = 0; i < n; i++){ double x, r; cin >> x >> r; while(!st.empty()){ auto [x1, r1] = st.top(); r = min(r, (x - x1) * (x - x1) / (4 * r1)); if(r >= r1) st.pop(); else break; } st.push({x, r}); cout << fixed << setprecision(3) << r << endl; } 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...