結果
問題 |
No.910 素数部分列
|
ユーザー |
![]() |
提出日時 | 2025-04-15 21:28:28 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 373 bytes |
コンパイル時間 | 160 ms |
コンパイル使用メモリ | 82,400 KB |
実行使用メモリ | 96,128 KB |
最終ジャッジ日時 | 2025-04-15 21:31:23 |
合計ジャッジ時間 | 4,724 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)