Submission #1029961

# Submission time Handle Problem Language Result Execution time Memory
1029961 2024-07-21T14:48:09 Z FatemehSalimi Balloons (CEOI11_bal) C++17
0 / 100
143 ms 7708 KB
//in the neme of god
#include <bits/stdc++.h>
using namespace std;

const int MAX_N = 2e5 + 10;
double n, x[MAX_N], r[MAX_N], ans[MAX_N], tmp;
stack <int> st;

int main(){
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> r[i];
    }
    for (int i = 0; i < n; i++) {
        tmp = 1e9;
        while (st.size() && ((x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * ans[st.top()])) < tmp && ((x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * ans[st.top()])) < r[i]) {
            tmp = ((x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * ans[st.top()]));
            st.pop();
        }
        ans[i] = min(tmp, r[i]);
        st.push(i);
    }
    for (int i = 0; i < n; i++)
        cout << ans[i] << '\n';
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB 5th numbers differ - expected: '17.1630000000', found: '99.0000000000', error = '81.8370000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB 1st numbers differ - expected: '247294217.0000000000', found: '247294000.0000000000', error = '217.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB 3rd numbers differ - expected: '0.0420000000', found: '3.0000000000', error = '2.9580000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 528 KB 114th numbers differ - expected: '39.0180000000', found: '56.0000000000', error = '16.9820000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 3160 KB 196th numbers differ - expected: '100.7250000000', found: '111.0000000000', error = '10.2750000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 2456 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 Incorrect 67 ms 4180 KB 285th numbers differ - expected: '7629.0020000000', found: '7629.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 95 ms 5956 KB 511th numbers differ - expected: '4494.0050000000', found: '4494.0100000000', error = '0.0050000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 133 ms 6224 KB 164th numbers differ - expected: '1698.0020000000', found: '1698.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 143 ms 7708 KB 248th numbers differ - expected: '2694.0020000000', found: '2694.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -