結果

問題 No.349 干支の置き物
ユーザー 学ぶマン
提出日時 2025-04-07 20:41:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 462 ms
コンパイル使用メモリ 82,180 KB
実行使用メモリ 55,352 KB
最終ジャッジ日時 2025-04-07 20:41:59
合計ジャッジ時間 3,068 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
N = int(input())
A = [input() for _ in range(N)]
cnt = Counter(A)

most_common_item = cnt.most_common()[0][1]
nokori = N - most_common_item

# 間:most_common_item - 1
# nokori が 間の個数以上あればよい
if nokori >= most_common_item - 1:
    print('YES')
else:
    print('NO')
    
0