Submission #595325

# Submission time Handle Problem Language Result Execution time Memory
595325 2022-07-13T15:30:47 Z amin Balloons (CEOI11_bal) C++14
0 / 100
458 ms 5092 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(4))/b[k])*double((a[i]-a[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 Incorrect 0 ms 212 KB 3rd numbers differ - expected: '49.0000000000', found: '102.0940000000', error = '53.0940000000'
2 Halted 0 ms 0 KB -
# 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 Incorrect 2 ms 212 KB 14th numbers differ - expected: '2.6090000000', found: '7.1408500000', error = '4.5318500000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 340 KB 4th numbers differ - expected: '117.0000000000', found: '120.0020000000', error = '3.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 46 ms 680 KB 9th numbers differ - expected: '202.0000000000', found: '205.0000000000', error = '3.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 113 ms 1408 KB 3rd numbers differ - expected: '15396.0000000000', found: '15397.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 224 ms 2628 KB 10th numbers differ - expected: '7926.0000000000', found: '7929.0000000000', error = '3.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 274 ms 3008 KB 3rd numbers differ - expected: '5055.0000000000', found: '5058.0000000000', error = '3.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 343 ms 3916 KB 13th numbers differ - expected: '1861.0000000000', found: '1862.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 458 ms 5092 KB 9th numbers differ - expected: '2952.0000000000', found: '2954.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -