Submission #1342377

#TimeUsernameProblemLanguageResultExecution timeMemory
1342377geoshowBalloons (CEOI11_bal)C++20
10 / 100
100 ms2756 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;

    vector<pair<int,double>> st; // (posição, raio final)

    for (int i = 0; i < n; i++) {
        int x;
        double r;
        cin >> x >> r;

        while (!st.empty()) {
            double d = x - st.back().first;
            double L = d * d / (4.0 * st.back().second);

            if (L >= r) break;

            r = L;
            st.pop_back();
        }

        st.push_back({x, r});
        cout << fixed << setprecision(3) << r << "\n";
    }

    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...