結果
| 問題 |
No.5 数字のブロック
|
| ユーザー |
nobigomu
|
| 提出日時 | 2018-03-20 00:52:13 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 5,000 ms |
| コード長 | 400 bytes |
| コンパイル時間 | 215 ms |
| コンパイル使用メモリ | 6,820 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-18 12:09:42 |
| 合計ジャッジ時間 | 1,233 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
ソースコード
function g(s, a)
for e in s:gmatch("%d+") do
table.insert(a, tonumber(e))
end
table.sort(a)
return a
end
function count(a, l, t, c)
for i=1,#a do
t, c = t+a[i], i
if t > l then c = c - 1 break end
if t == l then break end
end
return c
end
print((function ()
local l = io.stdin:read("*n")
io.stdin:read(1, "*l")
local ws = io.stdin:read("*l")
return count(g(ws,{}), l, 0)
end)())
nobigomu