結果

問題 No.349 干支の置き物
ユーザー 👑 obakyan
提出日時 2019-03-29 22:47:15
言語 Lua
(LuaJit 2.1.1734355927)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 264 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 6,820 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 01:28:21
合計ジャッジ時間 1,228 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

t = {}
n = io.read("*n", "*l")
for i = 1, n do
    s = io.read()
    if(t[s] == nil) then t[s] = 1 else t[s] = t[s] + 1 end
end
max = 1
for k, v in pairs(t) do
    max = math.max(max, v)
end
if(max <= math.floor((n + 1) / 2)) then print("YES") else print("NO") end
0