Submission #846126

#TimeUsernameProblemLanguageResultExecution timeMemory
846126elotelo966Balloons (CEOI11_bal)C++17
10 / 100
223 ms6308 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define OYY 1000000005 #define mod 1000000007 #define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define mid (start+end)/2 #define lim 200005 #define ld double typedef long long ll; ld cev[lim],r[lim],p[lim]; int say[lim]; int32_t main(){ int n;cin>>n; for(int i=1;i<=n;i++)cin>>p[i]>>r[i]; int tut=0; for(int i=1;i<=n;i++){ while(tut){ int gec=say[tut]; ld tt=(p[i]-p[gec])*(p[i]-p[gec]); //cout<<tt<<endl; ld deg=tt/(4*r[gec]); //cout<<tt<<" "<<r[gec]<<" "<<4*r[gec]<<endl; r[i]=min(deg,r[i]); if(r[gec]<r[i])break; tut--; } tut++; say[tut]=i; } for(int i=1;i<=n;i++){ cout<<fixed<<setprecision(3)<<r[i]<<" "; } cout<<'\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...