Submission #956882

# Submission time Handle Problem Language Result Execution time Memory
956882 2024-04-02T15:42:07 Z vjudge1 Balloons (CEOI11_bal) C++17
10 / 100
162 ms 10836 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn = 2e5 + 10;
struct ball {
    double x, r;
};
int n;
ball a[maxn];
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 2392 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 2392 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 2396 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 18 ms 3164 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 42 ms 5972 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 80 ms 7760 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 94 ms 8272 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 125 ms 9556 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 162 ms 10836 KB 3rd numbers differ - expected: '2960.0000000000', found: '2959.0010000000', error = '0.9990000000'
2 Halted 0 ms 0 KB -