Submission #484259

# Submission time Handle Problem Language Result Execution time Memory
484259 2021-11-02T17:56:10 Z Olympia Balloons (CEOI11_bal) C++17
10 / 100
179 ms 5092 KB
#include <vector>
#include <iostream>
#include <cassert>
#include <cmath>
#include <set>
#include <map>
#include <stack>
#include <set>
#include <iomanip>
#define ll long long
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<double> x(n), r(n);
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> r[i];
    }
    vector<int> indices = {0};
    for (int i = 1; i < n; i++) {
        int myMax = 0;
        while (!indices.empty()){
            int j = indices.front();
            double val = ((x[i] - x[j]) * (x[i] - x[j])) / (4.0 * r[j]);
            r[i] = min(r[i], val);
            if (r[j] >= myMax) {
                break;
            } else {
                indices.pop_back();
            }
        }
        indices.push_back(i);
    }
    for (double d: r) {
        cout << setprecision(20) << d << "\n";
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB 4th numbers differ - expected: '1.8420000000', found: '87.0000000000', error = '85.1580000000'
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB 7th numbers differ - expected: '0.0010000000', found: '9.0000000000', error = '8.9990000000'
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 332 KB 3rd numbers differ - expected: '121.0000000000', found: '123.0000000000', error = '2.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 852 KB 3rd numbers differ - expected: '211.0000000000', found: '213.0000000000', error = '2.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 47 ms 1640 KB 5th numbers differ - expected: '15395.0000000000', found: '15396.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 94 ms 2904 KB 3rd numbers differ - expected: '7936.0000000000', found: '10352.0000000000', error = '2416.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 121 ms 3268 KB 5th numbers differ - expected: '5054.0000000000', found: '5055.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 179 ms 4264 KB 3rd numbers differ - expected: '1872.0000000000', found: '1874.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 178 ms 5092 KB 3rd numbers differ - expected: '2960.0000000000', found: '2962.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -