提交时间:2024-01-21 15:15:52
运行 ID: 121100
#include <bits/stdc++.h> using namespace std; int main(){ int n,l,max_=0,min_=0; cin>>n>>l; for(int i=1,temp;i<=n;i++) { cin>>temp; max_=max(max_,max(l-temp+1,temp)); min_=max(min_,min(l-temp+1,temp)); } cout<<min_<<" "<<max_; }