Submission #595319

# Submission time Handle Problem Language Result Execution time Memory
595319 2022-07-13T15:26:28 Z amin Balloons (CEOI11_bal) C++14
30 / 100
433 ms 7528 KB
#include <bits/stdc++.h>
#include<string>
using namespace std;


int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
long n;
cin>>n;
double a[n],b[n];
stack<long>s;
for(long i=0;i<n;i++)
{
    cin>>a[i]>>b[i];
}
double r=0;
for(long i=0;i<n;i++)
{
    r=b[i];
    while(!s.empty())
    {
        long k=s.top();

        r=min(r,double((a[i]-a[k])*(a[i]-a[k])/4/b[k]));

        if(r<b[k])
        {
            break;
        }
        s.pop();
    }
    s.push(i);
    b[i]=r;
    cout<<b[i]<<endl;

}



}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 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 Correct 2 ms 212 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 53 ms 872 KB 2953rd numbers differ - expected: '1030.4380000000', found: '1030.4400000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 114 ms 2164 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 246 ms 4044 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 258 ms 4600 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 349 ms 5764 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 433 ms 7528 KB 248th numbers differ - expected: '2694.0020000000', found: '2694.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -