結果

問題 No.1894 Delete AB
ユーザー Goltermann大和Goltermann大和
提出日時 2022-04-08 22:51:21
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
RE  
実行時間 -
コード長 254 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 10,596 KB
実行使用メモリ 202,880 KB
最終ジャッジ日時 2023-08-19 01:20:38
合計ジャッジ時間 6,218 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,796 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 90 ms
7,792 KB
testcase_04 AC 90 ms
7,856 KB
testcase_05 AC 90 ms
7,912 KB
testcase_06 AC 92 ms
7,824 KB
testcase_07 AC 91 ms
7,828 KB
testcase_08 AC 97 ms
7,796 KB
testcase_09 AC 45 ms
7,896 KB
testcase_10 AC 55 ms
7,816 KB
testcase_11 AC 117 ms
9,248 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())

def erase_ab(str):
    if "ABB" in str:
        s1 = str.replace("ABB","B",1)
        str = erase_ab(s1)
        return str
    else:
        return str


for i in range(t):
    n = int(input())
    s = input()
    print(erase_ab(s))  
0