# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
485115 |
2021-11-06T08:16:19 Z |
dz001 |
Balloons (CEOI11_bal) |
C++11 |
|
443 ms |
6448 KB |
#include <bits/stdc++.h>
using namespace std;
#define sqr(x) (x)*(x)
const double eps=1e-3;
const int N=2e5+10;
double ans[N];
long long x[N],R[N];
int n;
double get(int i,int j){
return (min(1.*R[i],sqr(x[i]-x[j])/(4.*ans[j])));
}
signed main()
{
ios::sync_with_stdio(NULL);
cin.tie(nullptr);
cout.precision(3);
cout<<fixed;
cin>>n;
for(int i=0;i<n;++i)cin>>x[i]>>R[i];
ans[0]=R[0];
for(int i=1;i<n;++i){
for(int j=max(0,i-500);j<i;++j){
double tmp=get(i,j);
// cout<<tmp<<endl;
if(ans[i]>=tmp||ans[i]==0)ans[i]=tmp;
}
}
for(int i=0;i<n;++i)cout<<ans[i]<<'\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
505 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
332 KB |
2000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
888 KB |
20000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
116 ms |
1824 KB |
50000 numbers |
2 |
Incorrect |
119 ms |
1684 KB |
49903rd numbers differ - expected: '443977872.4679999948', found: '1000000000.0000000000', error = '556022127.5320000648' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
218 ms |
3396 KB |
100000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
298 ms |
3912 KB |
115362 numbers |
2 |
Incorrect |
264 ms |
3800 KB |
119952nd numbers differ - expected: '444418084.8249999881', found: '1000000000.0000000000', error = '555581915.1749999523' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
356 ms |
5284 KB |
154271 numbers |
2 |
Incorrect |
424 ms |
6088 KB |
200000th numbers differ - expected: '999999998.0000000000', found: '1000000000.0000000000', error = '2.0000000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
443 ms |
6448 KB |
200000 numbers |
2 |
Incorrect |
426 ms |
6292 KB |
199941st numbers differ - expected: '80461337.7310000062', found: '1000000000.0000000000', error = '919538662.2690000534' |