제출 #888617

#제출 시각아이디문제언어결과실행 시간메모리
888617a5a7Balloons (CEOI11_bal)C++14
100 / 100
217 ms8800 KiB
#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 (radius >= r1){
                s.pop();
            }else{
                break;
            }
        }
        printf("%.4f\n", radius);
        s.push(make_pair(x2, radius));
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...