Run ID:149387
提交时间:2026-03-10 20:11:43
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[10001],n,k,s,x; cin>>k; for(int i=1;i<=k;i++){ for(int j=1;j<=n;j++) a[j]=0; cin>>n; s=0; for(int j=1;j<=n;j++){ cin>>x; a[x]++; } for(int j=1;j<=n;j++) if(a[j]>s) s=a[j]; if(s>(n+1)/2) cout<<"N"; else cout<<"Y"; cout<<endl; } return 0; }