Submission #484244

# Submission time Handle Problem Language Result Execution time Memory
484244 2021-11-02T17:36:18 Z Olympia Balloons (CEOI11_bal) C++17
30 / 100
2000 ms 6084 KB
#include <vector>
#include <iostream>
#include <cassert>
#include <cmath>
#include <set>
#include <map>
#include <stack>
#include <set>
#define ll long long
using namespace std;
struct interval_by_length {
    ll l, r;
    bool operator<(const interval_by_length& i1) const {
        if (i1.r - i1.l == r - l) {
            return (i1.l < l);
        }
        return (i1.r - i1.l < r - l);
    }
};
struct interval_by_left {
    ll l, r;
    bool operator<(const interval_by_left& i1) const {
        if (i1.l == l) {
            return (i1.r > r);
        }
        return (i1.l > l);
    }
};
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];
    }
    for (int i = 1; i < n; i++) {
        for (int j = 0; j < i; j++) {
            double val = ((x[i] - x[j]) * (x[i] - x[j]))/(4 * r[j]);
            r[i] = min(r[i], val);
        }
        //r[i] = rad;
    }
    for (double d: r) {
        cout << d << "\n";
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB 1st numbers differ - expected: '247294217.0000000000', found: '247294000.0000000000', error = '217.0000000000'
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 7 ms 460 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 315 ms 992 KB 2953rd numbers differ - expected: '1030.4380000000', found: '1030.4400000000', error = '0.0020000000'
# Verdict Execution time Memory Grader output
1 Incorrect 1993 ms 2056 KB 251st numbers differ - expected: '15123.0020000000', found: '15123.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2097 ms 3268 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 2048 ms 3764 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2095 ms 4900 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2088 ms 6084 KB Time limit exceeded
2 Halted 0 ms 0 KB -