結果

問題 No.910 素数部分列
ユーザー tktk_snsn
提出日時 2021-01-22 10:51:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 222 bytes
コンパイル時間 1,313 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 73,344 KB
最終ジャッジ日時 2024-12-26 05:32:18
合計ジャッジ時間 4,270 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()

one = 0
ans = 0
for s in S:
    if s == "1":
        one += 1
    elif s == "9":
        if one:
            ans += 1
            one -= 1
    else:
        ans += 1
ans += one // 2
print(ans)
0