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 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 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... |