36~~

int len,n,i,mid,x=0,y=0,max_time=0;//中间位置
scanf("%d%d",&len,&n);
int a[n];
mid=len/2;
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
if(mid-a[i]>=0)
x=a[i];
else
y=len-a[i];
int current=(x>y)?x:y;
if(current>max_time)
max_time=current;

标准 !!!!!

posted @ 2025-07-10 10:39  ervgiu28hg34y827  阅读(4)  评论(0)    收藏  举报