为什么#1对,其他都错呀?
互关
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
if(b==0 || a==0)
{
cout<<"0 0";
return 0;
}
int c;
int d=10000,e=0;
for(int A=0;A<b;A++)
{
cin>>c;
if(c<d)
{
d=c;
}
if(c>e)
{
e=c;
}
}
cout<<max(d,a+1-e)<<" ";
cout<<max(a+1-d,e);
}