結果
| 問題 |
No.910 素数部分列
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-02-27 13:12:00 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 474 bytes |
| コンパイル時間 | 72 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2024-10-13 15:52:12 |
| 合計ジャッジ時間 | 2,874 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 WA * 25 |
ソースコード
#!/usr/bin/env python3
# %%
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# %%
N = int(readline())
S = read().rstrip().decode()
# %%
S = S.replace('3', '')
S = S.replace('5', '')
S = S.replace('7', '')
answer = N - len(S)
# %%
N = len(S)
S = S.replace('19', '')
answer += (N - len(S)) // 2
x9 = S.count('9')
x1 = S.count('1')
n = min(x9 // 2, x1)
answer += n
x1 -= n
answer += x1 // 2
print(answer)
maspy