Submission #720548

#TimeUsernameProblemLanguageResultExecution timeMemory
720548mariowongBalloons (CEOI11_bal)C++14
20 / 100
482 ms4488 KiB
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); int n; cin >> n; long double gx,gr,lx,lr; for (int i=1;i<=n;i++){ long double x,r; cin >> x >> r; if (i == 1){ cout << setprecision(3) << fixed << r << "\n"; gx=lx=x; gr=lr=r; } else { if ((gx-x)*(gx-x)*lr >= gr*(lx-x)*(lx-x)) gx=lx,gr=lr; cout << setprecision(3) << fixed << min((x-gx)*(x-gx)/4.0/gr,r) << "\n"; lx=x; lr=min((x-gx)*(x-gx)/4.0/gr,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...