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