# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
218321 |
2020-04-02T01:21:43 Z |
Chancho |
Balloons (CEOI11_bal) |
C++14 |
|
285 ms |
11304 KB |
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int n; cin >> n;
int pila[n];
long double x[n];
long double r[n];
long double ans[n];
for(int i=0;i<n;i++){
cin >> x[i] >> r[i];
}
pila[0] =0;
int index = 0;
long double k;
for(int i=0;i<n;i++){
if(i==0){
ans[0] = r[0];
}
else{
bool first = true;
while (index >= 0){
if(first){
k = min(r[i],((x[i]-x[pila[index]])/(4*ans[pila[index]]))*(x[i]-x[pila[index]]));
first = false;
}
else{
k = min(k,((x[i]-x[pila[index]])/(4*ans[pila[index]]))*(x[i]-x[pila[index]]));
}
if(k<=r[index]){
break;
}
pila[index] = 0;
index--;
}
ans[i] = k;
pila[index+1] = i;
index++;
}
cout << fixed << setprecision(3) << ans[i] << "\n";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
384 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
3rd numbers differ - expected: '0.0420000000', found: '3.0000000000', error = '2.9580000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
512 KB |
114th numbers differ - expected: '39.0180000000', found: '56.0000000000', error = '16.9820000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
28 ms |
1528 KB |
196th numbers differ - expected: '100.7250000000', found: '111.0000000000', error = '10.2750000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
67 ms |
3168 KB |
13952nd numbers differ - expected: '0.1880000000', found: '1.3800000000', error = '1.1920000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
133 ms |
5880 KB |
7236th numbers differ - expected: '0.0070000000', found: '7.0000000000', error = '6.9930000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
164 ms |
6776 KB |
4645th numbers differ - expected: '0.0260000000', found: '8.0000000000', error = '7.9740000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
203 ms |
8952 KB |
1730th numbers differ - expected: '5.6890000000', found: '6.8060000000', error = '1.1170000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
285 ms |
11304 KB |
2718th numbers differ - expected: '2.2100000000', found: '3.0000000000', error = '0.7900000000' |
2 |
Halted |
0 ms |
0 KB |
- |