結果
| 問題 | No.1894 Delete AB |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-04-08 23:24:23 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 789 ms / 2,000 ms |
| コード長 | 266 bytes |
| 記録 | |
| コンパイル時間 | 424 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 136,532 KB |
| 最終ジャッジ日時 | 2026-05-22 14:24:42 |
| 合計ジャッジ時間 | 3,475 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 14 |
ソースコード
t = int(input())
for _ in range(t):
n = int(input())
S = input()
ANS = ''
for i in range(n - 1, -1, -1):
ANS = S[i] + ANS
if ANS[:2] == "AB":
if len(ANS) > 2 and ANS[2] == 'B':
ANS = ANS[2:]
print(ANS)