Submission #397172

# Submission time Handle Problem Language Result Execution time Memory
397172 2021-05-01T16:30:02 Z alexis_1729 Balloons (CEOI11_bal) C++14
100 / 100
203 ms 9172 KB
#include <bits/stdc++.h>

using namespace std;
int n;
    stack<int>st;
    struct est{
    double xi,ri;
    }vx[200000];
int  main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);
     cin>>n;
        for(int i=0;i<n;i++){
                cin>>vx[i].xi>>vx[i].ri;


        while(!st.empty()){
            vx[i].ri=min(vx[i].ri,((vx[i].xi-vx[st.top()].xi)*(vx[i].xi-vx[st.top()].xi))/(4*vx[st.top()].ri));
               if(vx[i].ri<vx[st.top()].ri)break;
            st.pop();
        }
        st.push(i);
        }
        for(int i=0;i<n;i++)printf("%3f\n",vx[i].ri);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 3 ms 332 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Correct 21 ms 1052 KB 20000 numbers
# Verdict Execution time Memory Grader output
1 Correct 53 ms 2356 KB 50000 numbers
2 Correct 51 ms 2500 KB 49912 numbers
# Verdict Execution time Memory Grader output
1 Correct 107 ms 4448 KB 100000 numbers
# Verdict Execution time Memory Grader output
1 Correct 126 ms 5152 KB 115362 numbers
2 Correct 116 ms 5572 KB 119971 numbers
# Verdict Execution time Memory Grader output
1 Correct 166 ms 6804 KB 154271 numbers
2 Correct 190 ms 9068 KB 200000 numbers
# Verdict Execution time Memory Grader output
1 Correct 203 ms 8260 KB 200000 numbers
2 Correct 192 ms 9172 KB 199945 numbers