| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 72238 | 廖宸睿 | 19老李吃水果 | C++ | Wrong Answer | 0 MS | 308 KB | 703 | 2024-05-04 14:56:30 |
#include <iostream> #include <cstdio> using namespace std; int main() { int n,k,x,max=0; cin>>k; for (int i=1;i<=k;i++){ cin>>n; int a[10001]={0}; for (int j=1;j<=n;j++){ cin>>x; a[x]++; } for (int j=1;j<=n;j++){ if (a[j]>max&&a[j]>0) max=a[j]; } if (n%2==0){ if (max<=n/2) cout<<"Y"<<endl; else cout<<"N"<<endl; } else{ if (max<=n/2+1) cout<<"Y"<<endl; else cout<<"N"<<endl; } } 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