Submission #1105038

#TimeUsernameProblemLanguageResultExecution timeMemory
1105038ezzzayBalloons (CEOI11_bal)C++14
100 / 100
236 ms9820 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second #define pb push_back const int N=3e5+5; double x[N],r[N]; signed main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>x[i]>>r[i]; } vector<int>v; for(int i=1;i<=n;i++){ while(!v.empty()){ int j=v.back(); r[i]=min(r[i],(x[i]-x[j])*(x[i]-x[j])/4/r[j]); if(r[i]<r[j])break; v.pop_back(); } v.pb(i); } for(int i=1;i<=n;i++){ cout<<fixed<<setprecision(3)<<r[i]<<" "; } }
#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...