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;
int n;
stack<int>st;
struct est{
double xi,ri;
}vx[200000];
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);
cin>>n;
for(int i=0;i<n;i++){
cin>>vx[i].xi>>vx[i].ri;
while(!st.empty()){
vx[i].ri=min(vx[i].ri,((vx[i].xi-vx[st.top()].xi)*(vx[i].xi-vx[st.top()].xi))/(4*vx[st.top()].ri));
if(vx[i].ri<vx[st.top()].ri)break;
st.pop();
}
st.push(i);
}
for(int i=0;i<n;i++)printf("%3f\n",vx[i].ri);
}
# | 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... |