Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
131946 胡海峰老师 19老李吃水果 Python3 Accepted 63 MS 4132 KB 410 2025-10-01 20:55:24

Tests(5/5):


Code:

k = int(input()) for _ in range(k): n = int(input()) arr = list(map(int, input().split())) from collections import Counter cnt = Counter(arr) maxf = max(cnt.values()) if n == 2: # 如果两个相同,也可以改成不同,所以总是可以 print("Y") else: if maxf > (n + 1) // 2: print("N") else: print("Y")