Submission #218320

# Submission time Handle Problem Language Result Execution time Memory
218320 2020-04-02T01:19:01 Z Chancho Balloons (CEOI11_bal) C++14
10 / 100
277 ms 11000 KB
#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n; cin >> n;
    int pila[n];
    long double x[n];
    long double r[n];
    long double ans[n];
    for(int i=0;i<n;i++){
        cin >> x[i] >> r[i];
    }
    pila[0] =0;
    int index = 0;
    long double k;
    for(int i=0;i<n;i++){
        if(i==0){
            ans[0] = r[0];
        }
        else{
            bool first = true;
            while (index >= 0){
                if(first){
                k = min(r[i],((x[i]-x[pila[index]])/(4*ans[pila[index]]))*(x[i]-x[pila[index]]));
                first = false;
                }
                else{
                k = min(k,((x[i]-x[pila[index]])/(4*ans[pila[index]]))*(x[i]-x[pila[index]]));
                }
                if(k<=r[index]){
                    break;
                }
                pila[index] = 0;
                index--;
            }
            ans[i] = k;
            pila[index+1] = i;
            index++;
        }
        cout << ans[i] << "\n";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB 1st numbers differ - expected: '247294217.0000000000', found: '247294000.0000000000', error = '217.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB 3rd numbers differ - expected: '0.0420000000', found: '3.0000000000', error = '2.9580000000'
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 512 KB 114th numbers differ - expected: '39.0180000000', found: '56.0000000000', error = '16.9820000000'
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 1400 KB 196th numbers differ - expected: '100.7250000000', found: '111.0000000000', error = '10.2750000000'
# Verdict Execution time Memory Grader output
1 Incorrect 67 ms 3064 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 132 ms 5752 KB 285th numbers differ - expected: '7629.0020000000', found: '7629.0000000000', error = '0.0020000000'
# Verdict Execution time Memory Grader output
1 Incorrect 155 ms 6392 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 206 ms 8416 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 277 ms 11000 KB 248th numbers differ - expected: '2694.0020000000', found: '2694.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -