Submission #484260

# Submission time Handle Problem Language Result Execution time Memory
484260 2021-11-02T17:58:07 Z Olympia Balloons (CEOI11_bal) C++17
10 / 100
261 ms 7116 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++) {
        vector<int> new_indices;
        //int myMax = 0;
        for (int ind: indices) {
            int j = -ind;
            double val = ((x[i] - x[j]) * (x[i] - x[j])) / (4.0 * r[j]);
            r[i] = min(r[i], val);
            if (r[j] >= r[i]) {
                new_indices.push_back(-j);
            } else {
                break;
            }
        }
        new_indices.push_back(-i);
        indices = new_indices;
    }
    for (double d: r) {
        cout << setprecision(20) << d << "\n";
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB 7th numbers differ - expected: '11.4400000000', found: '81.0000000000', error = '69.5600000000'
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB 14th numbers differ - expected: '2.6090000000', found: '7.0413223140', error = '4.4323223140'
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 348 KB 8th numbers differ - expected: '114.0020000000', found: '117.0000000000', error = '2.9980000000'
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 1040 KB 4th numbers differ - expected: '210.0010000000', found: '213.0000000000', error = '2.9990000000'
# Verdict Execution time Memory Grader output
1 Incorrect 80 ms 1928 KB 7th numbers differ - expected: '15393.0000000000', found: '15396.0000000000', error = '3.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 147 ms 3540 KB 3rd numbers differ - expected: '7936.0000000000', found: '10352.0000000000', error = '2416.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 185 ms 4048 KB 7th numbers differ - expected: '5052.0000000000', found: '5055.0000000000', error = '3.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 231 ms 5284 KB 4th numbers differ - expected: '1871.0000000000', found: '1874.0000000000', error = '3.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 261 ms 7116 KB 4th numbers differ - expected: '2959.0000000000', found: '2962.0000000000', error = '3.0000000000'
2 Halted 0 ms 0 KB -