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;
struct readInt{
readInt& operator>>(int &I){
char J = I = 0;
while(J < 48) J = getchar_unlocked();
while(J > 47) I = I * 10 + J - 48, J = getchar_unlocked();
return *this;
}
#define cin __read__
} __read__;
signed main(){
int n; cin >> n;
int x[n], st[n+1], *p = st;
double y[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], pow(x[*p]-x[i], 2)/(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... |