結果

問題 No.509 塗りつぶしツール
ユーザー mitsushinomitsushino
提出日時 2018-04-10 14:37:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 10,584 KB
実行使用メモリ 8,528 KB
最終ジャッジ日時 2023-09-09 03:46:13
合計ジャッジ時間 1,929 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,356 KB
testcase_01 AC 21 ms
8,396 KB
testcase_02 AC 18 ms
8,356 KB
testcase_03 AC 19 ms
8,384 KB
testcase_04 AC 19 ms
8,344 KB
testcase_05 AC 19 ms
8,392 KB
testcase_06 AC 19 ms
8,336 KB
testcase_07 AC 20 ms
8,360 KB
testcase_08 AC 19 ms
8,388 KB
testcase_09 AC 19 ms
8,348 KB
testcase_10 AC 19 ms
8,444 KB
testcase_11 AC 19 ms
8,396 KB
testcase_12 AC 18 ms
8,392 KB
testcase_13 AC 19 ms
8,336 KB
testcase_14 AC 19 ms
8,488 KB
testcase_15 AC 19 ms
8,284 KB
testcase_16 AC 18 ms
8,388 KB
testcase_17 AC 18 ms
8,340 KB
testcase_18 AC 19 ms
8,392 KB
testcase_19 AC 19 ms
8,504 KB
testcase_20 AC 19 ms
8,352 KB
testcase_21 AC 18 ms
8,404 KB
testcase_22 AC 18 ms
8,352 KB
testcase_23 AC 18 ms
8,376 KB
testcase_24 AC 19 ms
8,440 KB
testcase_25 AC 18 ms
8,528 KB
testcase_26 AC 18 ms
8,392 KB
testcase_27 AC 18 ms
8,492 KB
testcase_28 AC 18 ms
8,396 KB
testcase_29 AC 19 ms
8,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

s = input()
c = Counter(s)

p1 = c['0'] * 3 + c['1'] * 2 + c['2'] * 2 + c['3'] * 2 + c['4'] * 3 + c['5'] * 2 + \
     c['6'] * 3 + c['7'] * 2 + c['8'] * 4 + c['9'] * 3 + 1

hole_num = c['0'] + c['4'] + c['6'] + c['8'] * 2 + c['9']
p2 = (1 + hole_num) * 2 + len(s)

print(min(p1, p2))
0