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;
stack< pair<long double, long double> > st;
int main()
{
ios_base::sync_with_stdio(false), cin.tie(0),
cout.tie(0);
cout<< fixed << setprecision(10);
int n;
cin >> n;
for(int i = 0; i < n; i++)
{
long double x, r;
cin>> x >> r;
while(!st.empty())
{
long double d = st.top().first - x;
r = min(r, d * d / 4 / st.top().second);
if (r > st.top().second)
st.pop();
else
break;
}
st.push(make_pair(x, r));
cout << r << endl;
}
}
# | 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... |