結果

問題 No.349 干支の置き物
ユーザー 💕💖💞
提出日時 2016-09-10 13:38:37
言語 Python2
(2.7.18)
結果
AC  
実行時間 14 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 461 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2024-11-17 07:38:12
合計ジャッジ時間 1,638 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

swap = {
  "ne":"a",
  "ushi":"b",
  "tora":"c",
  "u":"d",
  "tatsu":"e",
  "mi":"f",
  "uma":"g",
  "hitsuji":"i",
  "saru":"j",
  "tori":"k",
  "inu":"l",
  "i":"n"
}
import collections
import sys
count = collections.Counter
tgts = []
for _ in range(int(raw_input())):
  i = raw_input()
  tgts.append(swap[i]) 
#print count(tgts)
noise = sorted(count(tgts).values()).pop()
ents =  sum(count(tgts).values()) - noise
if noise >= ents + 2: 
  print "NO"
  sys.exit(0)
print "YES"
0