| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1183095 | mmusom | Balloons (CEOI11_bal) | C++20 | 115 ms | 131072 KiB | 
#include<bits/stdc++.h>
#define int long long
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//#define ordered_multiset tree<long long, null_type,less_equal<long long>, rb_tree_tag,tree_order_statistics_node_update>
//#define ordered_set tree<long long, null_type,less<long long>, rb_tree_tag,tree_order_statistics_node_update>
//st.order_of_key
//st.find_by_order
main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
//        freopen("deleg.in", "r", stdin);
//        freopen("deleg.out", "w", stdout);
    #endif
    ios_base::sync_with_stdio(NULL);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin>>n;
    vector<int> x(n+1),h(n+1);
    for(int i=1;i<=n;++i){
        cin>>x[i]>>h[i];
    }
    vector<double> ans(n+1);
    double eps=1e-4;
    for(int i=1;i<=n;++i){
        if(i==1){
            ans[i]=h[i];
        }else{
            double l=0,r=h[i]+eps;
            while(l<r-eps){
                double mid=(l+r)/2;
                bool ok=0;
                for(int j=1;j<i;++j){
                    if((x[i]-x[j])*(x[i]-x[j])+(ans[j]-mid)*(ans[j]-mid)<(ans[j]+mid)*(ans[j]+mid)){
                        ok=1;
                        break;
                    }
                }
                if(ok){
                    r=mid;
                }else{
                    l=mid;
                }
            }
            ans[i]=l;
        }
        cout<<fixed<<setprecision(4)<<ans[i]<<"\n";
    }
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
