#include <iostream> using namespace std; int main(int argc, char** argv) { int n,l; cin>>n>>l; int a[n],minn,maxx,x[n],s[n]; for(int i=0;i<n;i++){ cin>>a[i]; x[i]=max(l+1-a[i],1); s[i]=min(l+1-a[i],a[i]); maxx=max(x[i],maxx); minn=max(s[i],minn); } cout<<minn<<" "<<maxx; return 0; }
标签:幽灵,maxx,粒子,minn,int,max From: https://www.cnblogs.com/hanxuyao/p/17501509.html