#include <bits/stdc++.h>
using namespace std;
const int M = 2e5 +7;
int n;
// pair<int,int> baloon[M];
const int pre = 3;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n;
vector<double> radius(n);
stack<pair<double ,double >> s;
// s.push({baloon[0].first,baloon[0].second});
double max_r;
for (int i = 0; i <n;i++){
double a, x;
cin >> a >> x;
max_r = x;
// max_r= ((a - s.top().first) * (a - s.top().first))/4 * s.top().second;
while(!s.empty()){
double last_r= ((a - s.top().first) * (a - s.top().first))/4 * s.top().second;
max_r = max(last_r,max_r);
if ( max_r > s.top().second){
s.pop();
continue;
}
else {
break;
}
s.push({a,max_r});
radius[i] = max_r;
}
}
cout << fixed << setprecision(pre);
for (double &r: radius) {cout << r << '\n';}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
1st numbers differ - expected: '24.0000000000', found: '0.0000000000', error = '24.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
1st numbers differ - expected: '247294217.0000000000', found: '0.0000000000', error = '247294217.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
1st numbers differ - expected: '213.0000000000', found: '0.0000000000', error = '213.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
340 KB |
1st numbers differ - expected: '123.0000000000', found: '0.0000000000', error = '123.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
12 ms |
488 KB |
1st numbers differ - expected: '213.0000000000', found: '0.0000000000', error = '213.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
31 ms |
1012 KB |
1st numbers differ - expected: '15399.0000000000', found: '0.0000000000', error = '15399.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
63 ms |
1580 KB |
1st numbers differ - expected: '7938.0000000000', found: '0.0000000000', error = '7938.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
83 ms |
1856 KB |
1st numbers differ - expected: '5060.0000000000', found: '0.0000000000', error = '5060.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
110 ms |
2408 KB |
1st numbers differ - expected: '1874.0000000000', found: '0.0000000000', error = '1874.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
123 ms |
3048 KB |
1st numbers differ - expected: '2962.0000000000', found: '0.0000000000', error = '2962.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |