Submission #768189

# Submission time Handle Problem Language Result Execution time Memory
768189 2023-06-27T16:35:48 Z vjudge1 Balloons (CEOI11_bal) C++17
10 / 100
391 ms 16720 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
const int N=2e5+1, 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];
deque<dt> q;
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;
    for (int i=1;i<=n;i++){
        double R = a[i].r;
        if (!q.empty()){
            R = min(R,(Ri(a[i],q.front())));
            if (R!=a[i].r){
                while(!q.empty() && R>=q.front().r){
                    q.pop_front(),R=min(R,(Ri(a[i],q.front())));
                }
            }
        }
        q.push_back({a[i].x,R});
        if (R != a[i].r) R-=0.000000001;
        cout <<fixed<<setprecision(9)<<R<<endl;

    }

}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB 4th numbers differ - expected: '1.8420000000', found: '87.0000000000', error = '85.1580000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB 13th numbers differ - expected: '2.3960000000', found: '6.2546948350', error = '3.8586948350'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 468 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 43 ms 2148 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 97 ms 4996 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 9000 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 229 ms 10188 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 338 ms 13304 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 391 ms 16720 KB 3rd numbers differ - expected: '2960.0000000000', found: '2962.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -