結果

問題 No.509 塗りつぶしツール
ユーザー akitsugu777
提出日時 2018-11-15 13:27:04
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 200 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-12-24 13:54:14
合計ジャッジ時間 2,523 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

n = input()

c0 = c1 = c2 = 0
for i in n:
    if i in ['0', '4', '6', '9']:
        c0 += 1
    elif i == '8':
        c2 += 1
    else:
        c1 += 1

print(min(c0*3+c1*2+c2*4+1, c0*3+c1*1+c2*5+2))
0