Submission #399541

#TimeUsernameProblemLanguageResultExecution timeMemory
399541TrunktyBalloons (CEOI11_bal)C++14
100 / 100
739 ms5476 KiB
#include <iostream> #include <stack> #include <utility> #include <iomanip> using namespace std; int n; stack<pair<double,double>> stk; int main(){ cin >> n; cout << fixed << setprecision(3); for(int i=1;i<=n;i++){ double x,r; cin >> x >> r; while(stk.size()>0){ double x2=stk.top().first,r2=stk.top().second; r = min(r,(x2-x)*(x2-x)/4/r2); if(r<r2){ break; } else{ stk.pop(); } } stk.push({x,r}); cout << r << "\n"; } 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...