Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
71840 孙嘉言 19老李吃水果 C++ Wrong Answer 0 MS 308 KB 693 2024-04-27 17:36:47

Tests(0/5):


Code:

# include<iostream> using namespace std; int main(){ int i,j,n,m,k,xyx=0; cin>>n; for(i=0;i<n;i++){ xyx=0; int a[10001]={0}; cin>>m; for(j=0;j<m;j++){ cin>>k; a[k]++; } for(j=0;j<10000;j++){ if(a[j]>0){ if(xyx<a[j]) xyx=a[j]; } } if(m%2==0){ cout<<"p"<<xyx; if(xyx<=m/2) cout<<"Y"<<endl; else cout<<"N"<<endl; }else if(m%2!=0){ cout<<"max"<<xyx; if(xyx<=(m/2+1)) cout<<"Y"<<endl; else cout<<"N"<<endl; } xyx=0; } return 0; } /* 2 6 1 2 4 2 2 4 5 1 1 1 2 1 */


Run Info:

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