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 <stack>
#include <iomanip>
using namespace std;
int main()
{
int n; cin >> n;
stack<pair<int,long double>> s;
for(int i=0;i<n;i++){
long double x,r; cin >> x >> r;
while(!s.empty()){
int X = s.top().first; double R = s.top().second;
r = min(r,(x-X)*(x-X)/(4*(R)));
if(r < R){
break;
}
s.pop();
}
s.push({x,r});
cout << fixed << setprecision(3) << 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... |