Submission #888616

# Submission time Handle Problem Language Result Execution time Memory
888616 2023-12-18T02:51:07 Z a5a7 Balloons (CEOI11_bal) C++14
30 / 100
199 ms 5076 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;
            }
        }
        printf("%.4f\n", radius);
        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 Correct 0 ms 344 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 2 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 22 ms 852 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 Correct 50 ms 1460 KB 50000 numbers
2 Incorrect 51 ms 2324 KB 49903rd numbers differ - expected: '443977872.4679999948', found: '1000000000.0000000000', error = '556022127.5320000648'
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 101 ms 2896 KB 14857th numbers differ - expected: '7169.6020000000', found: '7176.0000000000', error = '6.3980000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 120 ms 3280 KB 23610th numbers differ - expected: '1467.9600000000', found: '1471.0000000000', error = '3.0400000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 158 ms 4100 KB 12335th numbers differ - expected: '4957.2960000000', found: '4967.0000000000', error = '9.7040000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 199 ms 5076 KB 8510th numbers differ - expected: '318.4980000000', found: '320.0000000000', error = '1.5020000000'
2 Halted 0 ms 0 KB -