# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
788309 |
2023-07-20T05:40:08 Z |
math_pi |
Balloons (CEOI11_bal) |
C++14 |
|
167 ms |
10316 KB |
#include<bits/stdc++.h>
using namespace std;
long double calc(pair<long double, long double> p, long double x) {
return (p.first - x) * (p.first - x) / (4 * p.second);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<long double> res(n);
stack<pair<long double, long double>> st;
for(int i=0; i<n; i++) {
long double x, r;
cin >> x >> r;
long double max_r = r;
while(!st.empty()) {
pair<long double, long double> last = st.top();
long double last_r = calc(last, x);
max_r = min(max_r, last_r);
if(max_r >= last.second) {
st.pop();
continue;
} else break;
}
cout << fixed << setprecision(3) << max_r << '\n';
st.push({x, r});
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
5th numbers differ - expected: '17.1630000000', found: '4.3710000000', error = '12.7920000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
3rd numbers differ - expected: '0.0420000000', found: '2.0830000000', error = '2.0410000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
340 KB |
3rd numbers differ - expected: '121.0000000000', found: '120.0180000000', error = '0.9820000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
17 ms |
1344 KB |
3rd numbers differ - expected: '211.0000000000', found: '210.0110000000', error = '0.9890000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
42 ms |
2380 KB |
3rd numbers differ - expected: '15396.0000000000', found: '9489.3930000000', error = '5906.6070000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
87 ms |
5400 KB |
3rd numbers differ - expected: '7936.0000000000', found: '6084.6240000000', error = '1851.3760000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
98 ms |
6196 KB |
6th numbers differ - expected: '5053.0000000000', found: '5052.0000000000', error = '1.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
144 ms |
8596 KB |
3rd numbers differ - expected: '1872.0000000000', found: '1871.0010000000', error = '0.9990000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
167 ms |
10316 KB |
3rd numbers differ - expected: '2960.0000000000', found: '2959.0010000000', error = '0.9990000000' |
2 |
Halted |
0 ms |
0 KB |
- |