結果
| 問題 | No.637 X: Yet Another FizzBuzz Problem |
| コンテスト | |
| ユーザー |
nobigomu
|
| 提出日時 | 2018-03-25 13:42:01 |
| 言語 | Lua (LuaJit 2.1.1774638290) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 277 bytes |
| 記録 | |
| コンパイル時間 | 44 ms |
| コンパイル使用メモリ | 7,972 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-17 20:21:53 |
| 合計ジャッジ時間 | 936 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
print((function (f, s)
return f(s)
end)(function (s)
function f(n)
local isF,isB = n%3==0,n%5==0
return (isF and isB) and 8 or
(isF or isB) and 4 or #tostring(n)
end
local r = 0
for e in s:gmatch("%d+") do r=r+f(tonumber(e)) end
return r
end, io.stdin:read("*l")))
nobigomu