Submission #218317

# Submission time Handle Problem Language Result Execution time Memory
218317 2020-04-02T00:56:58 Z Chancho Balloons (CEOI11_bal) C++14
0 / 100
265 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{
            while (index >= 0){
                k = min(r[i],((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;
            if(index<0){
                pila[index+1]=i;
                index++;
            }
        }
        cout << ans[i] << "\n";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB 7th numbers differ - expected: '11.4400000000', found: '81.0000000000', error = '69.5600000000'
# 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 13th numbers differ - expected: '2.3960000000', found: '6.2546900000', error = '3.8586900000'
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 512 KB 3rd numbers differ - expected: '121.0000000000', found: '123.0000000000', error = '2.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 1408 KB 3rd numbers differ - expected: '211.0000000000', found: '213.0000000000', error = '2.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 68 ms 3064 KB 5th numbers differ - expected: '15395.0000000000', found: '15396.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 129 ms 5668 KB 3rd numbers differ - expected: '7936.0000000000', found: '10352.0000000000', error = '2416.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 169 ms 6520 KB 5th numbers differ - expected: '5054.0000000000', found: '5055.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 198 ms 8440 KB 3rd numbers differ - expected: '1872.0000000000', found: '1874.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 265 ms 11000 KB 3rd numbers differ - expected: '2960.0000000000', found: '2962.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -