Submission #1063017

# Submission time Handle Problem Language Result Execution time Memory
1063017 2024-08-17T13:23:12 Z enzy Balloons (CEOI11_bal) C++17
10 / 100
391 ms 3564 KB
#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+10;
int v[maxn], r[maxn];
int main()
{
    //freopen("art2.in", "r", stdin);
    //freopen("art2.out", "w", stdout);
    //OBS: se eu parei por causa de um balao com id y  e meu id eh x, posso ignorar todos os baloes de id entre y e x
    //OBS: se eu tenho uma altura menor que o proximo cara eu posso ser ignorado
    //pensar: como eu consigo calcular a primeira intersecção? (dado um numero limitado de caras)
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int n; cin >> n;
    for(int i=1;i<=n;i++) cin >> v[i] >> r[i];
    stack<pair<int,int>>st;
    for(int i=1;i<=n;i++){
        long double xat=v[i], resp=r[i];
        while(!st.empty()){
            auto p=st.top();
            long double xk=p.first, rk=p.second;
            long double rat=((xk-xat)*(xk-xat))/(4*rk);
            resp=min(resp,rat);
            if(resp<rk) break;
            else st.pop();
        }
        cout << fixed << setprecision(3) << resp << endl;
        st.push({xat,resp});
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 8th numbers differ - expected: '8.7410000000', found: '9.0910000000', error = '0.3500000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB 13th numbers differ - expected: '2.3960000000', found: '2.4500000000', error = '0.0540000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 348 KB 3rd numbers differ - expected: '121.0000000000', found: '121.0020000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 55 ms 672 KB 44th numbers differ - expected: '165.0000000000', found: '165.0020000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 113 ms 1224 KB 254th numbers differ - expected: '15129.9990000000', found: '15130.0010000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 227 ms 2124 KB 286th numbers differ - expected: '7633.9990000000', found: '7634.0010000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 236 ms 2256 KB 511th numbers differ - expected: '4494.0050000000', found: '4494.0070000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 336 ms 3000 KB 165th numbers differ - expected: '1698.9980000000', found: '1699.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 391 ms 3564 KB 249th numbers differ - expected: '2683.0090000000', found: '2683.0110000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -