Run ID:90843

提交时间:2024-09-17 10:04:30

#include<bits/stdc++.h> using namespace std; int main() { int n,i,j,max=0,d,ai,a[10001]={0}; cin>>n; for(i=0;i<n;i++){ max=0; cin>>d; for(j=0;j<d;j++){ cin>>ai; a[ai]++; } for(j=0;j<10001;j++){ if(max<a[j]) max=a[j]; } if(d%2==0){ if(max>d/2) cout<<"N"<<endl; else cout<<"Y"<<endl; } else if(d%2!=0){ if(max>d/2+1) cout<<"N"<<endl; else cout<<"Y"<<endl; } max=0; } return 0; }