結果
問題 |
No.2021 Not A but B
|
ユーザー |
![]() |
提出日時 | 2023-01-17 22:51:15 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 324 bytes |
コンパイル時間 | 394 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 72,320 KB |
最終ジャッジ日時 | 2025-01-03 02:53:26 |
合計ジャッジ時間 | 3,596 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 24 RE * 2 |
ソースコード
n = int(input()) s = input() s = list(s) fra = 0 an = ["B","B",s[2]] ans = 1 if s[0] == "B" and s[1] == "B": fra = 1 for i in range(n-2): if s[i+1] == "B" and s[i+2] == "B": if fra == 0: fra = 1 else: continue if s[i] != "B" or s[i+2] != "B": ans += 1 print(ans)