独木桥

#include 
#include 
using namespace std;
int read()
{
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9')
	{
	    if(c=='-')  f=-1;
	    c=getchar();
	}
	while(c>='0'&&c<='9')
	{
		x=x*10+c-'0';
		c=getchar();
	}
	return f*x;
}
const int N=6000;
int l,n,a[N],ans;
int main()
{
	l=read()+1;  n=read();
	for(int i=1;i<=n;i++)  a[i]=read();
	for(int i=1;i<=n;i++)  ans=max(ans,min(a[i],l-a[i]));
	cout<

 

你可能感兴趣的:(独木桥)