用unique记得要再开一个数组,不然被去重了会导致后算sum的做法错误 例如我的QAQ
sort(a,a+n); if(unique(a,a+n)-a<n-1){puts("cslnb");return 0;} …… for(int i=0;i<n;++i)cnt+=a[i]-i;