Submission #925023

# Submission time Handle Problem Language Result Execution time Memory
925023 2024-02-10T13:17:02 Z VMaksimoski008 Balloons (CEOI11_bal) C++14
100 / 100
233 ms 5092 KB
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second

int main() {
    int n;
    cin >> n;

    vector<pair<double, double> > v(n);
    for(auto &x : v) cin >> x.f >> x.s;

    stack<int> st;
    for(int i=0; i<n; i++) {
        while(!st.empty()) {
            v[i].s = min(v[i].s, (v[st.top()].f - v[i].f) * (v[st.top()].f - v[i].f) / (4 * v[st.top()].s));
            if(v[st.top()].s >= v[i].s) break;
            st.pop();
        }

        st.push(i);
        cout << setprecision(3) << fixed << v[i].s << '\n';
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 2 ms 344 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Correct 21 ms 868 KB 20000 numbers
# Verdict Execution time Memory Grader output
1 Correct 60 ms 1476 KB 50000 numbers
2 Correct 63 ms 1620 KB 49912 numbers
# Verdict Execution time Memory Grader output
1 Correct 115 ms 2640 KB 100000 numbers
# Verdict Execution time Memory Grader output
1 Correct 131 ms 3156 KB 115362 numbers
2 Correct 137 ms 3068 KB 119971 numbers
# Verdict Execution time Memory Grader output
1 Correct 188 ms 4180 KB 154271 numbers
2 Correct 233 ms 4972 KB 200000 numbers
# Verdict Execution time Memory Grader output
1 Correct 224 ms 5092 KB 200000 numbers
2 Correct 229 ms 5004 KB 199945 numbers