Run ID:77404
提交时间:2024-06-09 09:52:09
#include<bits/stdc++.h> using namespace std; int a[1001]; int main(){ int k,n,m,max; cin>>k; for(int i=1;i<=k;i++){ //组数 cin>>n; max=0; for(int j=1;j<=n;j++){ //每组的水果天数 cin>>m; a[m]++; } for(int j=1;j<=n;j++){ if(max<a[j]){ max = a[j]; } a[j]=0; //清零 } if(n-max>=max-1){ cout<<"Y"<<endl; } else{ cout<<"N"<<endl; } } }