Submission #888614

# Submission time Handle Problem Language Result Execution time Memory
888614 2023-12-18T02:47:29 Z a5a7 Balloons (CEOI11_bal) C++14
20 / 100
471 ms 7700 KB
#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;
            }
        }
        cout << setprecision(6) << radius << endl;
        s.push(make_pair(x2, radius));
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 1st numbers differ - expected: '247294217.0000000000', found: '247294000.0000000000', error = '217.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 348 KB 504th numbers differ - expected: '160.9360000000', found: '163.0000000000', error = '2.0640000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 46 ms 984 KB 653rd numbers differ - expected: '96.2810000000', found: '123.0000000000', error = '26.7190000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 120 ms 2128 KB 251st numbers differ - expected: '15123.0020000000', found: '15123.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 245 ms 3924 KB 285th numbers differ - expected: '7629.0020000000', found: '7629.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 272 ms 4432 KB 511th numbers differ - expected: '4494.0050000000', found: '4494.0100000000', error = '0.0050000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 373 ms 5708 KB 164th numbers differ - expected: '1698.0020000000', found: '1698.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 471 ms 7700 KB 248th numbers differ - expected: '2694.0020000000', found: '2694.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -