結果
| 問題 | No.2021 Not A but B |
| コンテスト | |
| ユーザー |
deepjuggling
|
| 提出日時 | 2023-01-17 22:52:33 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 45 ms / 2,000 ms |
| コード長 | 357 bytes |
| 記録 | |
| コンパイル時間 | 171 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 72,320 KB |
| 最終ジャッジ日時 | 2026-06-06 10:51:55 |
| 合計ジャッジ時間 | 2,379 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 |
ソースコード
n = int(input())
s = input()
s = list(s)
if n == 2:
print(1)
exit()
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)
deepjuggling