#include <iostream> using namespace std; int main(int argc, char** argv) { int n,l; cin>>n>>l; int m[n]; int Max=0,Min=0; for(int i=0;i<n;i++){ cin>>m[i]; Max=max(Max,max(l-m[i]+1,m[i])); Min=max(Min,min(l-m[i]+1,m[i])); } cout<<Max<<" "<<Min; return 0; }
标签:幽灵,Min,int,max,种子,Max From: https://www.cnblogs.com/wangyueshuo/p/17501499.html