# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
768159 |
2023-06-27T15:38:28 Z |
vjudge1 |
Balloons (CEOI11_bal) |
C++17 |
|
381 ms |
9332 KB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
const int N=2e5;
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);
}
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;
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 |
0 ms |
212 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 |
5 ms |
340 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 |
1116 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 |
96 ms |
2548 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 |
198 ms |
4820 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 |
222 ms |
5628 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 |
306 ms |
7360 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 |
381 ms |
9332 KB |
2716th numbers differ - expected: '22.1690000000', found: '43.0000000000', error = '20.8310000000' |
2 |
Halted |
0 ms |
0 KB |
- |