#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++){
if(dq.empty()){
sz[i]=v[i].s;
dq.push_back(i);
continue;
}
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 |
1 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 |
0 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 |
348 KB |
3rd numbers differ - expected: '121.0000000000', found: '121.0020000000', error = '0.0020000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
14 ms |
1560 KB |
44th numbers differ - expected: '165.0000000000', found: '165.0020000000', error = '0.0020000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
36 ms |
3164 KB |
251st numbers differ - expected: '15123.0020000000', found: '18307.0000000000', error = '3183.9980000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
73 ms |
5968 KB |
163rd numbers differ - expected: '7762.0000000000', found: '14571.0000000000', error = '6809.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
84 ms |
6844 KB |
511th numbers differ - expected: '4494.0050000000', found: '13465.0000000000', error = '8970.9950000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
112 ms |
8892 KB |
162nd numbers differ - expected: '1700.0010000000', found: '4036.0000000000', error = '2335.9990000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
141 ms |
11524 KB |
249th numbers differ - expected: '2683.0090000000', found: '8658.0000000000', error = '5974.9910000000' |
2 |
Halted |
0 ms |
0 KB |
- |