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