結果
| 問題 |
No.910 素数部分列
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 21:19:43 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 425 bytes |
| コンパイル時間 | 301 ms |
| コンパイル使用メモリ | 81,912 KB |
| 実行使用メモリ | 95,828 KB |
| 最終ジャッジ日時 | 2025-06-12 21:20:11 |
| 合計ジャッジ時間 | 4,661 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 28 |
ソースコード
n = int(input())
s = input().strip()
count_357 = 0
remaining = []
for c in s:
if c in {'3', '5', '7'}:
count_357 += 1
else:
remaining.append(c)
count_1 = 0
count_19 = 0
for c in remaining:
if c == '1':
count_1 += 1
elif c == '9':
if count_1 > 0:
count_19 += 1
count_1 -= 1
count_11 = count_1 // 2
total = count_357 + count_19 + count_11
print(total)
gew1fw