Submission #768163

#TimeUsernameProblemLanguageResultExecution timeMemory
768163vjudge1Balloons (CEOI11_bal)C++17
20 / 100
387 ms9256 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define double long double const int N=2e5, pi=3.14; 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); } double area(dt b){ return b.r*b.r*3.14; } 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; if (a[i].x+a[i].r==a[mx].x+a[mx].r && area(a[i])>=area(a[mx])) 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...