結果
問題 | No.509 塗りつぶしツール |
ユーザー |
|
提出日時 | 2017-04-28 23:17:58 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 565 bytes |
コンパイル時間 | 179 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-09-13 18:33:28 |
合計ジャッジ時間 | 1,944 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
def main():N = list(input())count = 0for n in N:if n in ("1","2","3","5","7"):count += 0elif n in ("0","4","6","9"):count += 1elif n == "8":count += 2count += 1 + 2*len(N)count2 = 1for n in N:if n in ("1","2","3","5","7"):count2 += 0elif n in ("0","4","6","9"):count2 += 1elif n == "8":count2 += 2count2 = count2*2 + len(N)print(min(count, count2))if __name__ == "__main__":main()