//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];
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 << setprecision(3) <<fixed << ans[i] << '\n';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
5th numbers differ - expected: '17.1630000000', found: '99.0000000000', error = '81.8370000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
2 numbers |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
3rd numbers differ - expected: '0.0420000000', found: '3.0000000000', error = '2.9580000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
2396 KB |
22nd numbers differ - expected: '100.0000000000', found: '1600.5820000000', error = '1500.5820000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
19 ms |
3164 KB |
53rd numbers differ - expected: '156.0000000000', found: '5617.9490000000', error = '5461.9490000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
31 ms |
4396 KB |
8661st numbers differ - expected: '5830.0000000000', found: '23332.0010000000', error = '17502.0010000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
65 ms |
6228 KB |
3839th numbers differ - expected: '3727.0020000000', found: '14896.0010000000', error = '11168.9990000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
77 ms |
6700 KB |
1580th numbers differ - expected: '3316.0000000000', found: '13260.0010000000', error = '9944.0010000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
97 ms |
7764 KB |
326th numbers differ - expected: '1528.0010000000', found: '6104.0030000000', error = '4576.0020000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
120 ms |
9044 KB |
359th numbers differ - expected: '2569.0000000000', found: '10280.0000000000', error = '7711.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |