Submission #484263

# Submission time Handle Problem Language Result Execution time Memory
484263 2021-11-02T18:05:48 Z Olympia Balloons (CEOI11_bal) C++17
20 / 100
276 ms 8904 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];
    }
    set<int> indices = {0};
    for (int i = 1; i < n; i++) {
        set<int> new_indices;
        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[i] >= r[j]) {
            } else {
                new_indices.insert(-j);
                break;
            }
        }
        new_indices.insert(-i);
        indices = new_indices;
    }
    for (double d: r) {
        cout << setprecision(30) << d << "\n";
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB 10 numbers
# 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 17th numbers differ - expected: '213.0000000000', found: '234.0000000000', error = '21.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 332 KB 114th numbers differ - expected: '39.0180000000', found: '56.0000000000', error = '16.9820000000'
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 1076 KB 196th numbers differ - expected: '100.7250000000', found: '111.0000000000', error = '10.2750000000'
# Verdict Execution time Memory Grader output
1 Incorrect 81 ms 2452 KB 14045th numbers differ - expected: '15399.0000000000', found: '15419.0000000000', error = '20.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 152 ms 4560 KB 7310th numbers differ - expected: '7939.8510000000', found: '7941.0000000000', error = '1.1490000000'
# Verdict Execution time Memory Grader output
1 Incorrect 169 ms 5200 KB 4793rd numbers differ - expected: '0.9540000000', found: '10.6222724122', error = '9.6682724122'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 235 ms 6856 KB 1734th numbers differ - expected: '1856.0220000000', found: '1865.0000000000', error = '8.9780000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 276 ms 8904 KB 2723rd numbers differ - expected: '859.0470000000', found: '862.0000000000', error = '2.9530000000'
2 Halted 0 ms 0 KB -