結果
問題 |
No.509 塗りつぶしツール
|
ユーザー |
👑 |
提出日時 | 2019-05-01 21:25:04 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
WA
|
実行時間 | - |
コード長 | 269 bytes |
コンパイル時間 | 266 ms |
コンパイル使用メモリ | 6,944 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-31 12:40:52 |
合計ジャッジ時間 | 1,294 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 16 |
ソースコード
local numstr = io.read() local a, b, c = 0, 0, 0 for i = 1, #numstr do local s = numstr:sub(i, i) if(s == "0" or s == "4" or s == "6" or s == "9") then b = b + 1 elseif(s == "8") then c = c + 1 else a = a + 1 end end print(math.min(2*a+3*b+4*c+1, a+3*b+5*1+2))