Submission #1016360

# Submission time Handle Problem Language Result Execution time Memory
1016360 2024-07-07T23:21:35 Z cryptobunny Balloons (CEOI11_bal) C++14
20 / 100
421 ms 8276 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<long double> r(n), x(n);
    cout << fixed << setprecision(3);
    for (int i = 0; i < n; i++) cin >> x[i] >> r[i];
    stack<int> s;
    for (int i = 0; i < n; i++) {
        if (s.empty()) {
            s.push(i);
            cout << r[i] << endl;
        } else {
            long double lim = (x[i] - x[s.top()]) * (x[i] - x[s.top()]) / 4 / r[s.top()];
            r[i] = min(lim, r[i]);
            while (lim > r[i]) {
                s.pop();
                if (s.empty()) break;
                lim = (x[i] - x[s.top()]) * (x[i] - x[s.top()]) / 4 / r[s.top()];
                r[i] = min(lim, r[i]);
            }
            cout << r[i] << endl;
            s.push(i);
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB 12th numbers differ - expected: '5.1130000000', found: '5.3100000000', error = '0.1970000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 348 KB 114th numbers differ - expected: '39.0180000000', found: '56.0000000000', error = '16.9820000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 47 ms 1116 KB 196th numbers differ - expected: '100.7250000000', found: '109.4560000000', error = '8.7310000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 100 ms 2388 KB 13946th numbers differ - expected: '0.0440000000', found: '2215.6580000000', error = '2215.6140000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 189 ms 4432 KB 7238th numbers differ - expected: '0.0400000000', found: '927.9360000000', error = '927.8960000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 247 ms 4816 KB 4652nd numbers differ - expected: '0.4350000000', found: '0.5930000000', error = '0.1580000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 302 ms 6560 KB 1730th numbers differ - expected: '5.6890000000', found: '6.8060000000', error = '1.1170000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 421 ms 8276 KB 2723rd numbers differ - expected: '859.0470000000', found: '862.0000000000', error = '2.9530000000'
2 Halted 0 ms 0 KB -