結果

問題 No.509 塗りつぶしツール
ユーザー lam6er
提出日時 2025-03-26 15:45:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2025-03-26 15:45:53
合計ジャッジ時間 2,217 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

# Define the precomputed values for each digit (B + W)
digit_fills = {
    '0': 2,
    '1': 2,
    '2': 1,
    '3': 1,
    '4': 4,
    '5': 1,
    '6': 3,
    '7': 2,
    '8': 5,
    '9': 3,
}

n = input().strip()
if not n:  # Handle edge case where input might be empty (though n >=0)
    print(1)
else:
    total = sum(digit_fills[c] for c in n)
    print(total + 1)
0