#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,double 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.000);
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[dq.size()-1]].f,sz[dq[dq.size()-1]])>cal(v[i].f-v[dq[dq.size()-2]].f,sz[dq[dq.size()-2]])))dq.pop_back();
sz[i]=min(v[i].s,cal(v[i].f-v[dq.back()].f,sz[dq.back()]));
while(!dq.empty()&&(sz[i]>=sz[dq.back()])){
sz[i]=min(sz[i],cal(v[i].f-v[dq.back()].f,sz[dq.back()]));
dq.pop_back();
}
sz[i]=min(v[i].s,cal(v[i].f-v[dq.back()].f,sz[dq.back()]));
dq.push_back(i);
}
cout<<setprecision(3)<<fixed;
for(auto i:sz)cout<<i<<'\n';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
604 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
18 ms |
1884 KB |
137th numbers differ - expected: '67.1010000000', found: '579.4170000000', error = '512.3160000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
37 ms |
3920 KB |
250th numbers differ - expected: '15134.0000000000', found: '18307.0000000000', error = '3173.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
75 ms |
8016 KB |
162nd numbers differ - expected: '7765.0000000000', found: '14571.0000000000', error = '6806.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
85 ms |
9072 KB |
510th numbers differ - expected: '4505.0010000000', found: '13465.0000000000', error = '8959.9990000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
110 ms |
12112 KB |
161st numbers differ - expected: '1703.0000000000', found: '4036.0000000000', error = '2333.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
142 ms |
14796 KB |
248th numbers differ - expected: '2694.0020000000', found: '8658.0000000000', error = '5963.9980000000' |
2 |
Halted |
0 ms |
0 KB |
- |