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>
#define DEBUG 0
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
stack <pair <double, double>> stk;
for(int i = 1; i <= n; i++) {
double x, r, nr;
cin >> x >> r;
while(!stk.empty() and (nr = (stk.top().first - x) * (stk.top().first - x) / (4 * stk.top().second)) <= r) {
r = min(nr, r);
stk.pop();
}
stk.emplace(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... |