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;
typedef long double ld;
struct bal {
ld x, r;
};
ld sq(ld v) { return v * v; }
int main() {
ios::sync_with_stdio(0);
cin.tie(nullptr);
cout << fixed << setprecision(3);
int n; cin >> n;
vector<bal> ball(n);
for (bal& b : ball) cin >> b.x >> b.r;
stack<bal> pre;
for (bal& b : ball) {
while (!pre.empty()) {
b.r = min(b.r, sq(b.x - pre.top().x) / (4 * pre.top().r));
if (b.r < pre.top().r) break;
pre.pop();
}
pre.push(b);
cout << b.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... |