标签:c++ inf ons space sed view none code cout
#include<bits/stdc++.h> using namespace std; #define int long long const int maxn=3e5+10; int n,x,y; int a[maxn],b[maxn]; signed main(){ ios::sync_with_stdio(false); cin>>n>>x>>y; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n;i++) cin>>b[i]; sort(a,a+n); sort(b,b+n); for(int i=0;i<x;i++) a[i]=max(a[i],y); sort(a,a+n); int ans=0; for(int i=0;i<n;i++) ans=max(ans,b[i]-a[i]); cout<<ans; }
标签:c++ inf ons space sed view none code cout
原文地址:https://www.cnblogs.com/xcfxcf/p/12819339.html