Submission #768159

#TimeUsernameProblemLanguageResultExecution timeMemory
768159vjudge1Balloons (CEOI11_bal)C++17
20 / 100
381 ms9332 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define double long double const int N=2e5; int n; struct dt{ double x,r; }; double Ri(dt b, dt c){ return (b.x-c.x)*(b.x-c.x)/(4*c.r); } dt a[N+10]; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n; for (int i=1;i<=n;i++) cin>>a[i].x>>a[i].r; int mx =1; cout <<fixed<<setprecision(9)<<a[1].r<<endl; for (int i=2;i<=n;i++){ double R = a[i].r; R = min(R,Ri(a[i],a[mx])); if (R != a[i].r) R-=0.0000000001; a[i].r=R; if (a[i].x+a[i].r>a[mx].x+a[mx].r) mx =i; cout <<fixed<<setprecision(9)<<R<<endl; } }
#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...