結果
問題 |
No.910 素数部分列
|
ユーザー |
![]() |
提出日時 | 2025-04-15 21:22:19 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 373 bytes |
コンパイル時間 | 152 ms |
コンパイル使用メモリ | 82,132 KB |
実行使用メモリ | 95,908 KB |
最終ジャッジ日時 | 2025-04-15 21:28:17 |
合計ジャッジ時間 | 4,331 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 42 |
ソースコード
n = int(input()) s = input().strip() count_1 = 0 rest = [] for c in s: if c in {'3', '5', '7'}: count_1 += 1 else: rest.append(c) count_2 = 0 i = 0 while i < len(rest) - 1: if (rest[i] == '1' and rest[i+1] == '1') or (rest[i] == '1' and rest[i+1] == '9'): count_2 += 1 i += 2 else: i += 1 print(count_1 + count_2)