各位大脑为啥我开o2就全对但不开第九个就会wa
查看原帖
各位大脑为啥我开o2就全对但不开第九个就会wa
1014678
yang_h_x_2012楼主2023/10/24 21:48

各位大脑为啥我开o2就全对但不开第九个就会wa


/*********************************************************************
    程序名: 
    版权: 
    作者: 
    日期: 2023-10-24 21:42
    说明: 
*********************************************************************/
#include<bits/stdc++.h>
using namespace std;
int a[1000];int cc,ccc;
int main(){
    int l=0;
    cin>>l;
    int n=0;
    cin>>n;
    for(int i=0;i<n;i++)
    {
    	cin>>a[i];
	}

for(int i=0;i<n;i++)
{
cc=max(max(l+1-a[i],a[i]),cc);
ccc=max(min(l+1-a[i],a[i]),ccc);
}

cout<<ccc<<" "<<cc;
    return 0;
}
2023/10/24 21:48
加载中...