# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
433141 |
2021-06-19T00:25:52 Z |
jli12345 |
Balloons (CEOI11_bal) |
C++14 |
|
210 ms |
9812 KB |
#include <bits/stdc++.h>
using namespace std;
int N;
pair<long long, double> arr[200100];
double ans[200100];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> N;
for (int i = 1; i <= N; i++){
cin >> arr[i].first >> arr[i].second;
}
stack<int> s;
for (int i = 1; i <= N; i++){
double rad = arr[i].second;
while (!s.empty()){
rad = pow((arr[i].first-arr[s.top()].first), 2)/(4*ans[s.top()]);
rad = min(rad, arr[i].second);
if (rad > ans[s.top()])
s.pop();
else
break;
}
s.push(i);
ans[i] = rad;
}
for (int i = 1; i <= N; i++){
cout << fixed << setprecision(5) << ans[i] << " ";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
324 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
328 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
14th numbers differ - expected: '2.6090000000', found: '7.1408500000', error = '4.5318500000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
332 KB |
79th numbers differ - expected: '36.0070000000', found: '2766.0000000000', error = '2729.9930000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
24 ms |
1188 KB |
137th numbers differ - expected: '67.1010000000', found: '3129.0000000000', error = '3061.8990000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
53 ms |
2672 KB |
250th numbers differ - expected: '15134.0000000000', found: '18307.0000000000', error = '3173.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
115 ms |
5132 KB |
162nd numbers differ - expected: '7765.0000000000', found: '14571.0000000000', error = '6806.0000000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
133 ms |
5880 KB |
510th numbers differ - expected: '4505.0010000000', found: '13465.0000000000', error = '8959.9990000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
172 ms |
7840 KB |
161st numbers differ - expected: '1703.0000000000', found: '4036.0000000000', error = '2333.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
210 ms |
9812 KB |
248th numbers differ - expected: '2694.0020000000', found: '8658.0000000000', error = '5963.9980000000' |
2 |
Halted |
0 ms |
0 KB |
- |