結果
問題 |
No.2021 Not A but B
|
ユーザー |
![]() |
提出日時 | 2022-07-29 21:33:51 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 136 bytes |
コンパイル時間 | 199 ms |
コンパイル使用メモリ | 81,792 KB |
実行使用メモリ | 60,416 KB |
最終ジャッジ日時 | 2024-07-19 13:19:46 |
合計ジャッジ時間 | 2,466 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 8 WA * 18 |
ソースコード
N=int(input()) S=input() ans=0 f=0 for i in range(N-1): if S[i]=="B" and S[i+1]=="B": f=1 else: ans+=1 print(ans+f-S.count("BAB"))