結果

問題 No.509 塗りつぶしツール
ユーザー t8m8⛄️t8m8⛄️
提出日時 2017-04-28 22:58:02
言語 Nim
(2.2.0)
結果
WA  
実行時間 -
コード長 305 bytes
コンパイル時間 2,746 ms
コンパイル使用メモリ 65,628 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-30 01:11:02
合計ジャッジ時間 3,665 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 12 WA * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
/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