Submission #956905

# Submission time Handle Problem Language Result Execution time Memory
956905 2024-04-02T16:06:46 Z dzzz Balloons (CEOI11_bal) C++17
10 / 100
154 ms 16660 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.0*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 2396 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 2392 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 21 ms 5468 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 40 ms 8024 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 10168 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 96 ms 12940 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 154 ms 14672 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 153 ms 16660 KB 3rd numbers differ - expected: '2960.0000000000', found: '2959.0010000000', error = '0.9990000000'
2 Halted 0 ms 0 KB -