//in the neme of god
#include <bits/stdc++.h>
using namespace std;
stack <int> st;
const int MAX_N = 2e5 + 10;
double n, x[MAX_N], r[MAX_N], ans[MAX_N], tmp;
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];
ans[i] = r[i];
while (st.size() && ((x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * ans[st.top()])) < r[i]) {
ans[i] = ((x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * ans[st.top()]));
st.pop();
}
st.push(i);
}
for (int i = 0; i < n; i++)
cout << ans[i] << '\n';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
5th numbers differ - expected: '17.1630000000', found: '99.0000000000', error = '81.8370000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
1st numbers differ - expected: '247294217.0000000000', found: '247294000.0000000000', error = '217.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
3rd numbers differ - expected: '0.0420000000', found: '3.0000000000', error = '2.9580000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
348 KB |
22nd numbers differ - expected: '100.0000000000', found: '1600.5800000000', error = '1500.5800000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
13 ms |
1112 KB |
53rd numbers differ - expected: '156.0000000000', found: '5617.9500000000', error = '5461.9500000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
43 ms |
2640 KB |
251st numbers differ - expected: '15123.0020000000', found: '15123.0000000000', error = '0.0020000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
64 ms |
4772 KB |
285th numbers differ - expected: '7629.0020000000', found: '7629.0000000000', error = '0.0020000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
74 ms |
5436 KB |
511th numbers differ - expected: '4494.0050000000', found: '4494.0100000000', error = '0.0050000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
124 ms |
7068 KB |
164th numbers differ - expected: '1698.0020000000', found: '1698.0000000000', error = '0.0020000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
123 ms |
9052 KB |
248th numbers differ - expected: '2694.0020000000', found: '2694.0000000000', error = '0.0020000000' |
2 |
Halted |
0 ms |
0 KB |
- |