結果
| 問題 | No.1894 Delete AB |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-04-08 22:42:35 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 334 bytes |
| 記録 | |
| コンパイル時間 | 225 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 308,224 KB |
| 最終ジャッジ日時 | 2026-05-22 13:43:11 |
| 合計ジャッジ時間 | 4,067 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | TLE * 1 -- * 13 |
ソースコード
t = int(input())
for _ in range(t):
n = int(input())
S = input()
ANS = ''
res = 0
for i in range(n):
s = S[i]
if s == 'A':
ANS += s
else:
if ANS[:-1] + S[i + 1:] > ANS + S[i:]:
ANS = ANS[:-1]
else:
ANS += s
print(ANS)