# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
888615 | a5a7 | Balloons (CEOI11_bal) | C++14 | 172 ms | 4848 KiB |
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;
int main(){
int n;
cin >> n;
pair<double, double> v[n];
for (int i = 0; i < n; i++) cin >> v[i].first >> v[i].second;
stack<pair<double, double>> s;
for (int i = 0; i < n; i++){
double radius = v[i].second;
double x2 = v[i].first;
while (!s.empty()){
double x1 = s.top().first, r1 = s.top().second;
double r2 = (x1-x2)*(x1-x2)/(4*r1);
radius = min(r2, radius);
if (r2 > r1){
s.pop();
}else{
break;
}
}
printf("%.4Lf\n", radius);
s.push(make_pair(x2, radius));
}
}
Compilation message (stderr)
# | 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... |