Submission #654509

# Submission time Handle Problem Language Result Execution time Memory
654509 2022-10-31T14:24:21 Z Hanksburger Balloons (CEOI11_bal) C++17
100 / 100
233 ms 5468 KB
#include <bits/stdc++.h>
using namespace std;
stack<pair<long double, long double> > s;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    while (n--)
    {
        long double x, r;
        cin >> x >> r;
        while (s.size())
        {
            r=min(r, (x-s.top().first)*(x-s.top().first)/4.0/s.top().second);
            if (s.top().second>r)
                break;
            s.pop();
        }
        cout << fixed << setprecision(3) << r+0.000001 << '\n';
        s.push({x, r});
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Correct 24 ms 420 KB 20000 numbers
# Verdict Execution time Memory Grader output
1 Correct 69 ms 1028 KB 50000 numbers
2 Correct 65 ms 1600 KB 49912 numbers
# Verdict Execution time Memory Grader output
1 Correct 119 ms 1384 KB 100000 numbers
# Verdict Execution time Memory Grader output
1 Correct 146 ms 1588 KB 115362 numbers
2 Correct 141 ms 3400 KB 119971 numbers
# Verdict Execution time Memory Grader output
1 Correct 187 ms 1844 KB 154271 numbers
2 Correct 233 ms 5416 KB 200000 numbers
# Verdict Execution time Memory Grader output
1 Correct 217 ms 1896 KB 200000 numbers
2 Correct 223 ms 5468 KB 199945 numbers