Submission #1032454

# Submission time Handle Problem Language Result Execution time Memory
1032454 2024-07-23T19:31:59 Z FatemehSalimi Balloons (CEOI11_bal) C++17
10 / 100
121 ms 6736 KB
//in the neme of god
#include <bits/stdc++.h>
using namespace std;

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


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];
        ans[i] = r[i];
        while (st.size() && ((x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * ans[st.top()])) <= r[i]) {
            ans[i] = ((x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * ans[st.top()]));
            st.pop();
        }
        st.push(i);
    }
    for (int i = 0; i < n; i++) 
        cout << fixed << setprecision(3) << ans[i] << '\n';
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2648 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 Correct 0 ms 344 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 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 348 KB 22nd numbers differ - expected: '100.0000000000', found: '1600.5820000000', error = '1500.5820000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 2800 KB 53rd numbers differ - expected: '156.0000000000', found: '5617.9490000000', error = '5461.9490000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 59 ms 3664 KB 8661st numbers differ - expected: '5830.0000000000', found: '23332.0010000000', error = '17502.0010000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 64 ms 3508 KB 3839th numbers differ - expected: '3727.0020000000', found: '14896.0010000000', error = '11168.9990000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 80 ms 4176 KB 1580th numbers differ - expected: '3316.0000000000', found: '13260.0010000000', error = '9944.0010000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 98 ms 5372 KB 326th numbers differ - expected: '1528.0010000000', found: '6104.0030000000', error = '4576.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 121 ms 6736 KB 359th numbers differ - expected: '2569.0000000000', found: '10280.0000000000', error = '7711.0000000000'
2 Halted 0 ms 0 KB -