#include<bits/stdc++.h>
#define ll long long
#define ntr "\n"
#define mod (ll)(1e9+7)
#define taskname "APPLICATION"
#define frep freopen(taskname".inp","r",stdin); freopen(taskname".out","w",stdout);
using namespace std;
ll a[200001];
ll b[200001];
ll n=2e5,m=10,d;
bool check(ll p,vector<ll> &curr){
ll last=-2e16;
for(auto j:curr){
ll mn=max(last+d,j-p);
if(abs(j-mn)>p) return 0;
last=mn;
}
return 1;
}
void sub1(){
d*=2;
vector<ll> curr,nxt,bs;
for(int i=1;i<=n;i++) curr.push_back(2*a[i]);
for(int i=0;i<m;i++){
curr.push_back(2*b[i+1]);
sort(curr.begin(),curr.end());
ll ans=1e16;
ll lo=0,hi=1e16;
while(lo<=hi){
ll mid=(lo+hi)/2;
if(check(mid,curr)){
hi=mid-1;
ans=mid;
}
else{
lo=mid+1;
}
}
cout<<ans/2;
if(ans&1) cout<<".5";
cout<<' ';
}
}
void sub2(){
}
int main(){
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
//frep;
cin>>n>>m>>d;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=m;i++) cin>>b[i];
sort(a+1,a+n+1);
if(n) sub1();
else sub2();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2070 ms |
2384 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2070 ms |
2384 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |