Submission #595323

# Submission time Handle Problem Language Result Execution time Memory
595323 2022-07-13T15:30:03 Z amin Balloons (CEOI11_bal) C++14
30 / 100
457 ms 4984 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])*double((a[i]-a[k])/double(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 1 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 1 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 46 ms 944 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 122 ms 1884 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 242 ms 2872 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 290 ms 3140 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 348 ms 3956 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 457 ms 4984 KB 248th numbers differ - expected: '2694.0020000000', found: '2694.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -