delete pics to save space
This commit is contained in:
16
1.1007.cpp
Normal file
16
1.1007.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include<cstdio>
|
||||
#include<algorithm>
|
||||
using namespace std;
|
||||
int n,l,p,maxv,minv;
|
||||
int main()
|
||||
{
|
||||
scanf("%d%d",&l,&n);
|
||||
for(int i=0;i<n;i++)
|
||||
{
|
||||
scanf("%d",&p);
|
||||
maxv=max(maxv,max(l-p+1,p));
|
||||
minv=max(minv,min(l-p+1,p));
|
||||
}
|
||||
printf("%d %d",minv,maxv);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user