#include<iostream>
#include<stack>
#include<map>
#include<vector>
#include<string>
#include<unordered_map>
#include <queue>
#include<cstring>
#include<limits.h>
#include<cmath>
#include<set>
#include<algorithm>
#include<bitset>
#include <iomanip>
using namespace std;
#define ll long long
#define f first
#define endl "\n"
#define s second
#define pii pair<int,int>
#define ppii pair<pii,pii>
#define vi vector<int>
#define pb push_back
//#define p push
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define F(n) for(int i=0;i<n;i++)
#define lb lower_bound
#define ub upper_bound
#define fastio ios::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
#define int long long
#define double long double
const int mxn=1e5,inf=1e18;
double cal(int x,int r){return (double)(((x*x)*1.0)/(4*r*1.0));}
deque<int>dq;
int32_t main(){
fastio
int n;cin>>n;
vector<pair<int,double>>v(n);
vector<double>sz(n,0);
for(int i=0;i<n;i++)cin>>v[i].f>>v[i].s;
for(int i=0;i<n;i++){
while(dq.size()>1&&cal(v[i].f-v[dq.size()-1].f,sz[dq.size()-1])>cal(v[i].f-v[dq.size()-2].f,sz[dq.size()-2]))dq.pop_back();
sz[i]=min(v[i].s,cal(v[i].f-v[dq.size()-1].f,sz[dq.size()-1]));
while(!dq.empty()&&(sz[i]>sz[dq.back()]))dq.pop_back();
dq.push_back(i);
}
cout<<setprecision(3)<<fixed;
for(auto i:sz)cout<<i<<'\n';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
4th numbers differ - expected: '1.8420000000', found: '87.0000000000', error = '85.1580000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
2 numbers |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
7th numbers differ - expected: '0.0010000000', found: '9.0000000000', error = '8.9990000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
604 KB |
3rd numbers differ - expected: '121.0000000000', found: '121.0020000000', error = '0.0020000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
15 ms |
1624 KB |
44th numbers differ - expected: '165.0000000000', found: '165.0020000000', error = '0.0020000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
39 ms |
3920 KB |
251st numbers differ - expected: '15123.0020000000', found: '18307.0000000000', error = '3183.9980000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
74 ms |
7508 KB |
163rd numbers differ - expected: '7762.0000000000', found: '14571.0000000000', error = '6809.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
92 ms |
8528 KB |
511th numbers differ - expected: '4494.0050000000', found: '13465.0000000000', error = '8970.9950000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
118 ms |
11348 KB |
162nd numbers differ - expected: '1700.0010000000', found: '4036.0000000000', error = '2335.9990000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
137 ms |
14100 KB |
249th numbers differ - expected: '2683.0090000000', found: '8658.0000000000', error = '5974.9910000000' |
2 |
Halted |
0 ms |
0 KB |
- |