10714 - Ants
[cpp]用简单方法就可以过,不用模拟#include <cstdio>int num[100010];int main(){// freopen("a.txt","r",stdin);int n,m,t;scanf("%d",&t);while(t--){scanf("%d%d",&n,&m);int max=0,min=0;for(int i=0; i<m; i++){scanf("%d",&num[i]);int c=n-num[i]>num[i] ? num[i] : n-num[i];int d=n-c;if(c>min) min=c;if(d>max) max=d;}printf("%d %d\n",min,max);}return 0;}
补充:软件开发 , C++ ,