結果
問題 |
No.1894 Delete AB
|
ユーザー |
![]() |
提出日時 | 2022-04-09 01:23:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 216 ms / 2,000 ms |
コード長 | 283 bytes |
コンパイル時間 | 780 ms |
コンパイル使用メモリ | 82,036 KB |
実行使用メモリ | 90,892 KB |
最終ジャッジ日時 | 2024-11-28 18:27:27 |
合計ジャッジ時間 | 3,043 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 14 |
ソースコード
t = int(input()) for _ in range(t): n = int(input()) s = input() st = [] for c in s: if c == 'B': while len(st) >= 2 and st[-1] == 'B' and st[-2] == 'A': st.pop() st.pop() st.append(c) print(*st, sep='')