結果
| 問題 | 
                            No.349 干支の置き物
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-11-01 17:45:32 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 28 ms / 2,000 ms | 
| コード長 | 315 bytes | 
| コンパイル時間 | 397 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-11-20 04:55:52 | 
| 合計ジャッジ時間 | 2,455 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 29 | 
ソースコード
n = int(input())
d = {}
for _ in range(n):
    x = input()
    if not x in d:
        d[x] = 1
    else:
        d[x] += 1
if n % 2 == 0:
    if max(d.values()) <= n//2:
        print('YES')
    else:
        print('NO')
else:
    if max(d.values()) <= n//2 + 1:
        print('YES')
    else:
        print('NO')