結果

問題 No.29 パワーアップ
ユーザー nobigomu
提出日時 2018-03-21 01:52:42
言語 Lua
(LuaJit 2.1.1734355927)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 289 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-24 18:09:57
合計ジャッジ時間 1,071 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

print((function (h, n)
	function count(r)
		for _,v in pairs(h) do if v == 1 then r = r + 1 end end
		return math.floor(r / 4)
	end
	for _=1,io.stdin:read("*n")*3 do
		local t = io.stdin:read("*n")
		if h[t] == 1 then h[t],n = 0,n+1 else h[t] = 1 end
	end
	return n + count(0)
end)({}, 0))
0