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 <fstream>
#include <iostream>
#include <stack>
#include <queue>
#include <algorithm>
#include <vector>
#include <cassert>
#include <map>
#include <iomanip>
#define ll long long
using namespace std;
const int NMAX = 2e5;
struct Point
{
long double x, y;
void Read()
{
cin >> x >> y;
}
};
int n;
Point a[NMAX + 1];
long double answer[NMAX + 1];
Point st[NMAX + 1];
int indst;
long double Square(long double x)
{
return x * x;
}
long double Radius(Point p1, Point p2)
{
return Square(p2.x - p1.x) / (4.0 * p1.y);
}
int main()
{
cin >> n;
for (int i = 1; i <= n; i++)
a[i].Read();
for(int i = 1; i <= n; i++)
{
for(int j = 1; j <= indst; j++)
a[i].y = min(a[i].y, Radius(st[indst], a[i]));
while(indst > 0 && st[indst].y <= a[i].y)
indst--;
st[++indst] = a[i];
}
for (int i = 1; i <= n; i++)
cout << fixed << setprecision(3) << a[i].y << '\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... |