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;
pair<long long, double> arr[200100];
double ans[200100];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> N;
for (int i = 1; i <= N; i++){
cin >> arr[i].first >> arr[i].second;
}
stack<int> s;
for (int i = 1; i <= N; i++){
double rad = arr[i].second;
while (!s.empty()){
rad = min(rad, pow((arr[i].first-arr[s.top()].first), 2)/(4*ans[s.top()]));
rad = min(rad, arr[i].second);
if (rad > ans[s.top()])
s.pop();
else
break;
}
s.push(i);
ans[i] = rad;
}
for (int i = 1; i <= N; i++){
cout << fixed << setprecision(5) << ans[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... |