結果

問題 No.143 豆
ユーザー nobigomu
提出日時 2018-03-25 13:10:11
言語 Lua
(LuaJit 2.1.1734355927)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 271 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 6,816 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-23 10:56:19
合計ジャッジ時間 714 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

print((function(f, s1, s2)
	return f(s1, s2)
end)(function (s1, s2)
	local k, n = s1:match("(%d+)%s(%d+)")
	local r = tonumber(k) * tonumber(n)
	for e in s2:gmatch("%d+") do r = r - tonumber(e) end
	return r < 0 and -1 or r
end, io.stdin:read("*l"), io.stdin:read("*l")))
0