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;
#ifdef _WIN32
#define getchar _getchar_nolock
#else
#define getchar getchar_unlocked
#endif
struct readInt{
readInt& operator>>(int &I){
char J = I = 0;
while(J < 48) J = getchar();
while(J > 47) I = I * 10 + J - 48, J = getchar();
return *this;
}
#define cin __read__
} __read__;
const int LIM = 2e5;
int n, x[LIM], st[LIM+1], *p = st;
double y[LIM];
signed main(){
cin >> n;
cout << fixed << setprecision(4);
for(int i=0, j; i<n; ++i){
cin >> x[i] >> j; y[i] = j;
while(p != st){
y[i] = min(y[i], (double(x[*p] - x[i]) * double(x[*p] - x[i])) / (4.0 * y[*p]));
if(y[*p] < y[i]) --p;
else break;
}
cout << y[*(++p) = i] << '\n';
}
}
# | 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... |