| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 77407 | 杨一诺 | 19老李吃水果 | C++ | Wrong Answer | 0 MS | 268 KB | 458 | 2024-06-09 09:52:50 |
#include<bits/stdc++.h> using namespace std; int k,n,ai,d,max1=0; int a[10001]; int main(){ cin>>k; for(int i=1;i<=k;i++){ cin>>n; for(int j=1;j<=n;j++){ cin>>ai; a[ai]++; } max1=0; for(int i=n;i>=1;i--){ if(a[i]>max1){ max1=a[i]; } } if(n-max1>=(max1-1)){ cout<<'Y'<<endl; } else{ cout<<"N"<<endl; } max1=0; n=0; for(int l=0;l<=n;l++){ a[l]=0; } } return 0; }
------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