結果

問題 No.509 塗りつぶしツール
ユーザー t8m8⛄️t8m8⛄️
提出日時 2017-04-28 22:58:02
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 305 bytes
コンパイル時間 2,985 ms
コンパイル使用メモリ 67,484 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-12 12:48:01
合計ジャッジ時間 3,769 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 2 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 2 ms
4,384 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 WA -
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'strutils' [UnusedImport]
/home/judge/data/code/Main.nim(1, 18) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #

import strutils, sequtils

when isMainModule:
  var
    n = stdin.readline
    a = [3, 2, 2, 2, 3, 2, 3, 2, 4, 3]
    b = [3, 1, 1, 1, 3, 1, 3, 1, 4, 3]
    ansA = 0
    ansB = 0

  for i in 0..n.len-1:
    ansA += a[n[i].int - '0'.int]
    ansB += b[n[i].int - '0'.int]
  
  echo min(ansA + 1, ansB + 2)
0