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 MOD 1000000007
#define ll long long
#define endl "\n"
#define range(i,a,b,c) for(int i=a;i!=b;i+=c)
#define vi vector<int>
#define vll vector<ll>
long double r2(int r1, int x1, int x2){
int dis = abs(x2-x1);
return 1.0*pow(dis,2)/(4*r1);
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cout << fixed << setprecision(3);
int N;
cin >> N;
vi x(N);
vi r(N);
range(i,0,N,1){
cin >> x[i] >> r[i];
}
range(i,0,N,1){
long double minn = r[i];
range(j,0,i,1){
minn = min(minn, r2(r[j], x[j], x[i]));
}
r[i] = minn;
cout << minn << endl;
}
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... |