Run ID:109042
提交时间:2025-01-24 15:04:26
#include<bits/stdc++.h> using namespace std; int main() { int n,m[101],a[10001],b; bool t[101]={}; cin>>n; for(int i=1;i<=n;i++){ t[i]==true; cin>>m[i]; for(int j=1;j<=m[i];j++){ cin>>b; a[b]++; } if(m[i]%2==0){ for(int j=1;j<=m[i];j++){ if(a[i]>m[i]/2){ t[i]=false; } } } else{ for(int j=1;j<=m[i];j++){ if(a[i]>m[i]/2+1){ t[i]=false; } } } } for(int i=1;i<=m;i++){ if(t[i]==true){ cout<<"Y"<<endl; } else{ cout<<"N"<<endl; } } }