Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
128809 罗安博 19老李吃水果 C++ Wrong Answer 5 MS 4172 KB 411 2025-08-20 09:28:17

Tests(2/5):


Code:

#include<bits/stdc++.h> using namespace std; int a[1000000]; int main(){ memset(a,0,sizeof(a)); int k,n,b,s=0; cin>>k; while(k--){ cin>>n; for(int i=1;i<=n;i++){ cin>>b; a[b]++; } int max=a[1]; for(int j=2;j<=n;j++){ if(a[j]>max){ max=a[j]; } } if(max>(n+1)/2){ cout<<"N"<<endl; } else{ cout<<"Y"<<endl; } } }


Run Info:

------Input------
3 6 1 2 4 2 2 4 5 1 1 1 2 1 6 1 2 4 2 2 4
------Answer-----
Y N Y
------Your output-----
Y N N