이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n';
const int M = 1e2+15, MOD = 1000000007;
signed main() {
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
double x0, r0;
cin >> x0 >> r0;
cout << r0 << endl;
for (int i = 1; i < n; i++) {
int x, mr;
cin >> x >> mr;
double r = (x0-x)*(x0-x)/4.0/r0;
cout << fixed << setprecision(4) << min(r, double(mr)) << endl;
if (x*x/r < x0*x0/r0) {
x0 = x;
r0 = min(r, double(mr));
}
}
return 0;
}
/*
3 0 9 8 1 13 7
*/
# | 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... |