Submission #768162

# Submission time Handle Problem Language Result Execution time Memory
768162 2023-06-27T15:43:40 Z vjudge1 Balloons (CEOI11_bal) C++17
10 / 100
380 ms 9408 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
const int N=2e5, pi=3.14;
int n;
struct dt{
    double x,r;
};
double Ri(dt b, dt c){
    return (b.x-c.x)*(b.x-c.x)/(4*c.r);
}
double area(dt b){
    return b.r*b.r*3.14;
}
dt a[N+10];
signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin>>n;
    for (int i=1;i<=n;i++)
        cin>>a[i].x>>a[i].r;
    int mx =1;
    cout <<fixed<<setprecision(9)<<a[1].r<<endl;
    for (int i=2;i<=n;i++){
        double R = a[i].r;
        R = min(R,Ri(a[i],a[mx]));
        if (R != a[i].r)
            R-=0.0000000001;
        a[i].r=R;
        if (a[i].x+a[i].r>=a[mx].x+a[mx].r && area(a[i])>=area(a[mx])) mx =i;
        cout <<fixed<<setprecision(9)<<R<<endl;

    }

}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 7th numbers differ - expected: '11.4400000000', found: '81.0000000000', error = '69.5600000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB 7th numbers differ - expected: '0.0010000000', found: '9.0000000000', error = '8.9990000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 432 KB 3rd numbers differ - expected: '121.0000000000', found: '123.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 38 ms 1192 KB 3rd numbers differ - expected: '211.0000000000', found: '213.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 96 ms 2500 KB 5th numbers differ - expected: '15395.0000000000', found: '15396.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 197 ms 4864 KB 3rd numbers differ - expected: '7936.0000000000', found: '10352.0000000000', error = '2416.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 221 ms 5668 KB 5th numbers differ - expected: '5054.0000000000', found: '5055.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 299 ms 7392 KB 3rd numbers differ - expected: '1872.0000000000', found: '1874.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 380 ms 9408 KB 3rd numbers differ - expected: '2960.0000000000', found: '2962.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -