Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
7127 吴承熹 19老李吃水果 C++ Wrong Answer 0 MS 300 KB 948 2025-04-05 10:38:53

Tests(0/5):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int k,n,a[10001]={},p,m=0; cin>>k; for(int i=1;i<=k;i++){ cin>>p; for(int t=1;t<=n;t++){ cin>>p; a[p]++; } for(int t=1;t<=n;t++){ if(a[t]>m){ m=a[t]; } } if(n%2==0){ if(m<=n/2){ cout<<'Y'<<endl; } else{ cout<<'N'<<endl; } } else{ if(m<=n/2+1){ cout<<'Y'<<endl; } else{ cout<<'N'<<endl; } } m=0; memset(a,0,sizeof(0)); } return 0; }


Run Info:

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