結果

問題 No.910 素数部分列
コンテスト
ユーザー rlangevin
提出日時 2023-01-27 20:40:45
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 246 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 379 ms
コンパイル使用メモリ 85,240 KB
実行使用メモリ 87,764 KB
最終ジャッジ日時 2026-03-16 17:08:09
合計ジャッジ時間 9,174 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = int(input())
S = list(input())
S = list(map(int, S))
ans = S.count(3) + S.count(5) + S.count(7)
one = 0
for s in S:
    if s == 1:
        one += 1
    elif s == 9:
        if one:
            ans += 1
            one -= 1
print(ans + one//2)
0