結果

問題 No.509 塗りつぶしツール
ユーザー 👑 obakyanobakyan
提出日時 2019-05-01 21:25:04
言語 Lua
(LuaJit 2.1.1696795921)
結果
WA  
実行時間 -
コード長 269 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 5,260 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-30 04:28:11
合計ジャッジ時間 1,699 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
4,384 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 1 ms
4,384 KB
testcase_12 AC 1 ms
4,384 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 1 ms
4,380 KB
testcase_16 WA -
testcase_17 AC 1 ms
4,380 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 1 ms
4,380 KB
testcase_21 WA -
testcase_22 AC 1 ms
4,380 KB
testcase_23 WA -
testcase_24 AC 1 ms
4,380 KB
testcase_25 WA -
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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))
0