Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
109044 陈铎文 19老李吃水果 C++ Wrong Answer 1 MS 280 KB 595 2025-01-24 15:27:38

Tests(0/5):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n,m[101],a[10001],b; bool t[101]={}; cin>>n; for(int i=1;i<=n;i++){ t[i]=true; } for(int i=1;i<=n;i++){ t[i]==true; cin>>m[i]; for(int j=1;j<=m[i];j++){ cin>>b; a[b]++; } if(m[i]%2==0){ for(int j=1;j<=m[i];j++){ if(a[i]>m[i]/2){ t[i]=false; } } } else{ for(int j=1;j<=m[i];j++){ if(a[i]>m[i]/2+1){ t[i]=false; } } } } for(int i=1;i<=n;i++){ if(t[i]==true){ cout<<"Y"<<endl; } else{ cout<<"N"<<endl; } } }


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-----
Y N Y Y Y