Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
77404 刘轻松 19老李吃水果 C++ Accepted 1 MS 272 KB 437 2024-06-09 09:52:09

Tests(5/5):


Code:

#include<bits/stdc++.h> using namespace std; int a[1001]; int main(){ int k,n,m,max; cin>>k; for(int i=1;i<=k;i++){ //组数 cin>>n; max=0; for(int j=1;j<=n;j++){ //每组的水果天数 cin>>m; a[m]++; } for(int j=1;j<=n;j++){ if(max<a[j]){ max = a[j]; } a[j]=0; //清零 } if(n-max>=max-1){ cout<<"Y"<<endl; } else{ cout<<"N"<<endl; } } }