結果
| 問題 | No.1894 Delete AB |
| コンテスト | |
| ユーザー |
taiga0629kyopro
|
| 提出日時 | 2022-04-08 22:23:04 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 119 ms / 2,000 ms |
| コード長 | 302 bytes |
| 記録 | |
| コンパイル時間 | 312 ms |
| コンパイル使用メモリ | 85,504 KB |
| 実行使用メモリ | 82,688 KB |
| 最終ジャッジ日時 | 2026-05-22 13:31:37 |
| 合計ジャッジ時間 | 2,496 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 14 |
ソースコード
T=int(input())
for _ in range(T):
n=int(input())
s=list(input())
s.reverse()
ans=[]
for x in s:
ans.append(x)
if len(ans)>=3 and ans[-1]=="A" and ans[-2]=="B" and ans[-3]=="B":
ans.pop()
ans.pop()
ans.reverse()
print("".join(ans))
taiga0629kyopro