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 <iostream>
#include <iomanip>
using namespace std;
#include <vector>
vector <pair<long long,long double>> v;
long double fis,r;
long long x;
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++){
cin >> x;
cin >> r;
long double fis;
long double m = r;
while (v.size() && v[v.size()-1].second <= m){
long double o = x - v[v.size()-1].first;
fis = o * o / (4.0 * v[v.size()-1].second);
m = min(m,fis);
if (v[v.size()-1].second <= m){
v.pop_back();
}
}
if (v.empty()){
printf("%.6Lf\n",m);
v.push_back(make_pair(x,m));
continue;
}
long double o = x - v[v.size()-1].first;
fis = o * o / (4.0 * v[v.size()-1].second);
m = min(m,fis);
printf("%.6Lf\n",m);
v.push_back(make_pair(x,m));
}
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... |