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 int long long int
struct bal {
int x, r;
};
void solve() {
int n;
cin >> n;
vector<long double> ans(n);
vector<bal> p(n);
for (int i = 0; i < n; i++) {
cin >> p[i].x >> p[i].r;
ans[i] = p[i].r;
}
for (int i = 0; i < n; i++) {
for (int j = i-1; j >= 0; j--) {
long double delta = abs(p[i].x-p[j].x);
ans[i] = min(ans[i], (long double) delta*delta/(4.0L*p[j].r));
}
}
for (int i = 0; i < n; i++) {
cout << fixed << setprecision(3) << ans[i] << endl;
}
}
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(0);
int t;
t = 1;
while(t--) {
solve();
}
}
# | 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... |