結果

問題 No.2021 Not A but B
ユーザー deepjugglingdeepjuggling
提出日時 2023-01-17 22:51:15
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 324 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 86,624 KB
実行使用メモリ 79,468 KB
最終ジャッジ日時 2023-08-31 01:19:41
合計ジャッジ時間 4,755 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,136 KB
testcase_01 AC 72 ms
71,148 KB
testcase_02 AC 70 ms
70,944 KB
testcase_03 AC 71 ms
71,044 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 70 ms
71,056 KB
testcase_07 AC 69 ms
71,048 KB
testcase_08 AC 88 ms
79,468 KB
testcase_09 AC 89 ms
79,304 KB
testcase_10 AC 88 ms
79,188 KB
testcase_11 AC 87 ms
79,136 KB
testcase_12 AC 88 ms
78,972 KB
testcase_13 AC 89 ms
78,884 KB
testcase_14 AC 89 ms
79,076 KB
testcase_15 AC 88 ms
78,764 KB
testcase_16 AC 88 ms
78,700 KB
testcase_17 AC 89 ms
78,724 KB
testcase_18 AC 89 ms
78,840 KB
testcase_19 AC 88 ms
79,140 KB
testcase_20 AC 89 ms
78,984 KB
testcase_21 AC 81 ms
75,872 KB
testcase_22 AC 81 ms
75,388 KB
testcase_23 AC 81 ms
75,488 KB
testcase_24 AC 73 ms
75,700 KB
testcase_25 AC 81 ms
75,480 KB
testcase_26 AC 81 ms
78,612 KB
testcase_27 AC 86 ms
78,860 KB
testcase_28 AC 84 ms
78,800 KB
testcase_29 AC 81 ms
78,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)

0