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;
typedef long long ll;
#define int ll
#define endl "\n"
int N;
int32_t main(){
cin>>N;
stack<pair<long double, long double>>St;
for(int i = 0; i < N; i++){
long double pos, radius; cin>>pos>>radius;
if(i == 0){
cout<<fixed<<setprecision(10)<<radius<<endl;
St.push({pos, radius});
}
else{
while(!St.empty()){
auto cur = St.top();
long double pp = cur.first;
long double radd = cur.second;
radius = min((long double)radius, (long double)((pos - pp) * (pos - pp)) / (long double)(4 * radd));
if(radius >= radd){
St.pop();
}
else break;
}
St.push({pos, radius});
cout<<fixed<<setprecision(10)<<radius<<endl;
}
}
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... |