結果
| 問題 | 
                            No.349 干支の置き物
                             | 
                    
| コンテスト | |
| ユーザー | 
                             nohakai3
                         | 
                    
| 提出日時 | 2022-08-07 20:11:19 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 28 ms / 2,000 ms | 
| コード長 | 339 bytes | 
| コンパイル時間 | 140 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-09-17 12:32:16 | 
| 合計ジャッジ時間 | 1,936 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge6 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 29 | 
ソースコード
n=int(input())
l=[]
from collections import Counter
for i in range(n):
    s=input()
    l.append(s)
c=Counter(l)
l2=list(set(l))
p=0
for x in l2:
    p=max(p,c[x])
a=n//2
if n%2==0:
    if a>=p:
        print("YES")
    else:
        print("NO")
elif n%2==1:
    if a+1>=p or a>=p:
        print("YES")
    else:
        print("NO")
    
            
            
            
        
            
nohakai3