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 <iostream>
#include <iomanip>
#include <stack>
using namespace std;
int n;
struct ballon
{ double x,r;
}b,c;
stack <ballon> s;
int main()
{ cin>>n;
for(int i=1;i<=n;i++)
{ cin>>b.x>>b.r;
while(!s.empty())
{ c=s.top();
b.r=min(b.r,(c.x-b.x)*(c.x-b.x)/(4*c.r));
if(b.r>c.r)
s.pop();
else
break;
}
s.push(b);
cout<<fixed<<setprecision(3)<<b.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... |