Submission #956874

# Submission time Handle Problem Language Result Execution time Memory
956874 2024-04-02T15:34:41 Z vjudge1 Balloons (CEOI11_bal) C++17
10 / 100
155 ms 19284 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn = 2e5 + 10;
struct ball {
    long double x, r;
};
int n;
ball a[maxn];
long double ra[maxn];

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for(int i = 1; i <= n; ++i) {
        cin >> a[i].x >> a[i].r;
        ra[i] = a[i].r;
    }
    deque <ball> d;
    for(int i = 1; i <= n; ++i) {
        while(!d.empty()) {
            ball tmp = d.back();
            ra[i] = min(ra[i], (a[i].x - tmp.x)*(a[i].x - tmp.x) / (4*tmp.r));
            if(ra[i] >= tmp.r) d.pop_back();
            else break;
        }
        d.push_back(a[i]);
    }
    for(int i = 1; i <= n; ++i) {
        cout << fixed << setprecision(3) << ra[i] << '\n';
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 KB 5th numbers differ - expected: '17.1630000000', found: '4.3710000000', error = '12.7920000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 KB 3rd numbers differ - expected: '0.0420000000', found: '2.0830000000', error = '2.0410000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2652 KB 3rd numbers differ - expected: '121.0000000000', found: '120.0180000000', error = '0.9820000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 5724 KB 3rd numbers differ - expected: '211.0000000000', found: '210.0110000000', error = '0.9890000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 8724 KB 3rd numbers differ - expected: '15396.0000000000', found: '9489.3930000000', error = '5906.6070000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 81 ms 11752 KB 3rd numbers differ - expected: '7936.0000000000', found: '6084.6240000000', error = '1851.3760000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 106 ms 14676 KB 6th numbers differ - expected: '5053.0000000000', found: '5052.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 133 ms 16844 KB 3rd numbers differ - expected: '1872.0000000000', found: '1871.0010000000', error = '0.9990000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 155 ms 19284 KB 3rd numbers differ - expected: '2960.0000000000', found: '2959.0010000000', error = '0.9990000000'
2 Halted 0 ms 0 KB -