# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
768163 |
2023-06-27T15:45:40 Z |
vjudge1 |
Balloons (CEOI11_bal) |
C++17 |
|
387 ms |
9256 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) mx =i;
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 |
Correct |
1 ms |
212 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
13th numbers differ - expected: '2.3960000000', found: '6.2546948360', error = '3.8586948360' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
428 KB |
114th numbers differ - expected: '39.0180000000', found: '56.0000000000', error = '16.9820000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
39 ms |
1212 KB |
196th numbers differ - expected: '100.7250000000', found: '111.0000000000', error = '10.2750000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
98 ms |
2536 KB |
14044th numbers differ - expected: '0.4860000000', found: '0.5201798820', error = '0.0341798820' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
195 ms |
4864 KB |
7309th numbers differ - expected: '0.3220000000', found: '0.7861043780', error = '0.4641043780' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
229 ms |
5552 KB |
4790th numbers differ - expected: '0.2950000000', found: '0.8602612200', error = '0.5652612200' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
307 ms |
7356 KB |
1734th numbers differ - expected: '1856.0220000000', found: '1865.0000000000', error = '8.9780000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
387 ms |
9256 KB |
2716th numbers differ - expected: '22.1690000000', found: '43.0000000000', error = '20.8310000000' |
2 |
Halted |
0 ms |
0 KB |
- |