結果
問題 |
No.509 塗りつぶしツール
|
ユーザー |
![]() |
提出日時 | 2023-03-02 11:47:11 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 506 bytes |
コンパイル時間 | 154 ms |
コンパイル使用メモリ | 82,512 KB |
実行使用メモリ | 54,376 KB |
最終ジャッジ日時 | 2024-09-17 07:38:38 |
合計ジャッジ時間 | 2,303 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 16 |
ソースコード
# 背景は共通なので背景を抜いた各数字のregion数は # 2 for [1, 2, 3, 5, 7], 3 for [0, 4, 6, 9], and 4 for [8] # 与えられたNの各数字のregion数を上に従って数え上げ、背景分の+1をしたら答えか N = input() region_count = 0 for i in range(len(N)): if int(N[i]) in [1, 2, 3, 5, 7]: region_count += 2 elif int(N[i]) in [0, 4, 6, 9]: region_count += 3 elif int(N[i]) == 8: region_count += 4 region_count += 1 print(region_count)