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;
using pdd = pair<double, double>;
int32_t main() {
int n;
cin >> n;
vector<pdd> v(n);
for(pdd &x : v) cin >> x.first >> x.second;
stack<int> st;
for(int i=0; i<n; i++) {
while(!st.empty() && v[st.top()].second <= v[i].second) st.pop();
if(!st.empty()) v[i].second = min(v[i].second, (v[st.top()].first - v[i].first) * (v[st.top()].first - v[i].first) / (4 * v[st.top()].second));
st.push(i);
cout << setprecision(3) << fixed << v[i].second << '\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... |