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>
#define DIM 200010
using namespace std;
struct cerc{
long long x;
long double r;
} v[DIM];
int n,i,j;
deque <int> d;
long double get_raza (int i, int j){
v[i].r = min (v[i].r, 1.0 * (v[i].x - v[j].x) * (v[i].x - v[j].x) / (4.0 * v[j].r));
return v[i].r;
}
int main (){
//ifstream cin ("date.in");
//ofstream cout ("date.out");
cin>>n;
for (i=1;i<=n;i++)
cin>>v[i].x>>v[i].r;
for (i=1;i<=n;i++){
while (!d.empty() && get_raza(i,d.back()) > v[d.back()].r)
d.pop_back();
d.push_back(i);
cout<<setprecision(3)<<fixed<<v[i].r<<"\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... |