#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
//pos, rad
stack<pair<long double, long double>> stack;
for (int i = 0; i < n; i++){
long double loc, sz; cin >> loc >> sz;
while (!stack.empty()){
sz = min(sz, (loc*loc)/(4*stack.top().second));
if (sz >= stack.top().second) stack.pop();
else break;
}
stack.push({loc, sz});
cout<<fixed<<setprecision(3)<<sz<<endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
2nd numbers differ - expected: '4.1670000000', found: '7.0000000000', error = '2.8330000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
2nd numbers differ - expected: '252735385.4379999936', found: '1000000000.0000000000', error = '747264614.5620000362' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
204 KB |
2nd numbers differ - expected: '0.0010000000', found: '0.0050000000', error = '0.0040000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
204 KB |
3rd numbers differ - expected: '121.0000000000', found: '123.0000000000', error = '2.0000000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
75 ms |
420 KB |
3rd numbers differ - expected: '211.0000000000', found: '213.0000000000', error = '2.0000000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
196 ms |
712 KB |
5th numbers differ - expected: '15395.0000000000', found: '15396.0000000000', error = '1.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
368 ms |
1100 KB |
3rd numbers differ - expected: '7936.0000000000', found: '10352.0000000000', error = '2416.0000000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
428 ms |
1420 KB |
5th numbers differ - expected: '5054.0000000000', found: '5055.0000000000', error = '1.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
581 ms |
1740 KB |
3rd numbers differ - expected: '1872.0000000000', found: '1874.0000000000', error = '2.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
724 ms |
2020 KB |
3rd numbers differ - expected: '2960.0000000000', found: '2962.0000000000', error = '2.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |