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;
int ptr;
long double sqr(long double a1){
return a1*a1;
}
struct ballon{
long double xx,rr;
}a[200005];
int main(){
ios::sync_with_stdio(false);
int n;
cin >> n;
for (int i=1;i<=n;i++){
long double x,r;
cin >> x >> r;
if (i == 1){
cout << setprecision(3) << fixed << r << "\n";
a[++ptr]={x,r};
}
else
{
long double ans=r;
while (ptr > 0){
ans=min(ans,sqr(x-a[ptr].xx)/4.0/a[ptr].rr);
if (ans >= a[ptr].rr) ptr--;
else break;
}
cout << setprecision(3) << fixed << ans << "\n";
a[++ptr]={x,ans};
}
}
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... |