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 ld = long double;
typedef std::pair<ld,ld> pll;
ld raio(ld d,ld r2){
return (d*d)/(4*r2);
}
int main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(0);
std::cout.tie(0);
int N;
std::cin>>N;
std::stack<pll> stack;
for(int _ = 0;_!=N;++_){
ld x,r;
std::cin>>x>>r;
while(stack.size()){
ld l = raio(stack.top().first-x,stack.top().second);
l=std::min(l,r);
if(l>=stack.top().second){
stack.pop();
r=std::min(l,r);
}else {
r=l;
break;
}
}
stack.push({x,r});
std::cout<<std::fixed<<std::setprecision(3)<<r<<"\n";
}
}
# | 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... |