結果
| 問題 | 
                            No.910 素数部分列
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-05-01 10:40:18 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 219 bytes | 
| コンパイル時間 | 562 ms | 
| コンパイル使用メモリ | 81,968 KB | 
| 実行使用メモリ | 72,016 KB | 
| 最終ジャッジ日時 | 2024-12-23 13:26:17 | 
| 合計ジャッジ時間 | 4,780 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 22 WA * 28 | 
ソースコード
N=int(input())
S=list(input())
One=0
ans=0
for i in range(N):
    if S[i]=="1":
        One+=1
    elif S[i]=="9":
        if One>0:
            ans+=1
            One-=1
    else:
        ans+=1
ans+=One//2
print(ans)