This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |