//in the neme of god
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2e5 + 10;
float n, x[MAX_N], r[MAX_N], ans[MAX_N], tmp;
stack <int> st;
int main(){
ios_base::sync_with_stdio(0), cin.tie(0);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x[i] >> r[i];
}
for (int i = 0; i < n; i++) {
tmp = 1e9;
while (st.size() && ((x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * r[st.top()])) < tmp &&((x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * r[st.top()])) < r[i]) {
tmp = ((x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * r[st.top()]));
st.pop();
}
ans[i] = min(tmp, r[i]);
st.push(i);
}
for (int i = 0; i < n; i++)
cout << ans[i] << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
600 KB |
5th numbers differ - expected: '17.1630000000', found: '4.3706900000', error = '12.7923100000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
1st numbers differ - expected: '247294217.0000000000', found: '247294000.0000000000', error = '217.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
3rd numbers differ - expected: '0.0420000000', found: '2.0833300000', error = '2.0413300000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
344 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 |
11 ms |
1112 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 |
39 ms |
1872 KB |
3rd numbers differ - expected: '15396.0000000000', found: '9489.3900000000', error = '5906.6100000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
58 ms |
3664 KB |
3rd numbers differ - expected: '7936.0000000000', found: '6084.6200000000', error = '1851.3800000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
68 ms |
4364 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 |
89 ms |
5716 KB |
3rd numbers differ - expected: '1872.0000000000', found: '1871.0000000000', error = '1.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
107 ms |
6740 KB |
3rd numbers differ - expected: '2960.0000000000', found: '2959.0000000000', error = '1.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |