# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
738114 |
2023-05-08T07:39:20 Z |
Toxtaq |
Balloons (CEOI11_bal) |
C++17 |
|
2000 ms |
4972 KB |
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<complex>
#include<map>
#include<iomanip>
using namespace std;
#define eps 1e-6
int n;
vector<pair<int, double>>balloons;
vector<double>res;
double dist(pair<int, double>a,pair<int,double>b){
return sqrt((a.first-b.first)*(a.first-b.first)+(a.second-b.second)*(a.second-b.second));
}
bool check(double mid, int indx){
for(int i = indx-1;i>=0;--i){
if(dist({balloons[i].first, res[i]},{balloons[indx].first, mid})-(res[i]+mid)< eps)return true;
}
return false;
}
int main(){
cin >> n;
balloons.resize(n);
for(int i = 0;i<n;++i){
cin >> balloons[i].first >> balloons[i].second;
}
res.resize(n);
res[0]=balloons[0].second;
for(int i = 1;i<n;++i){
double l = 1, r = balloons[i].second;
while(r-l>eps){
double mid = (l+r)/2;
if(check(mid, i)){
r = mid;
}
else l = mid;
}
res[i]=l;
}
for(double i : res)cout << fixed << setprecision(6)<< i << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
10th numbers differ - expected: '0.5150000000', found: '1.0000000000', error = '0.4850000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
2nd numbers differ - expected: '252735385.4379999936', found: '1.0000000000', error = '252735384.4379999936' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
212 KB |
2nd numbers differ - expected: '0.0010000000', found: '1.0000000000', error = '0.9990000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
132 ms |
340 KB |
113th numbers differ - expected: '0.2500000000', found: '1.0000000000', error = '0.7500000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2056 ms |
756 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2054 ms |
1348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2052 ms |
2512 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2052 ms |
2992 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2062 ms |
3788 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2063 ms |
4972 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |