結果
| 問題 | No.3395 Range Flipping Game |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-11-24 08:37:52 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 477 ms / 2,000 ms |
| + 889µs | |
| コード長 | 410 bytes |
| 記録 | |
| コンパイル時間 | 80 ms |
| コンパイル使用メモリ | 64,372 KB |
| 実行使用メモリ | 82,940 KB |
| 最終ジャッジ日時 | 2026-11-24 08:37:58 |
| 合計ジャッジ時間 | 6,001 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge6_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 29 |
ソースコード
for _ in range(int(input())):
N = int(input())
S = list(input())
if N <= 2:
print('B' * N)
continue
if "".join(S[:2]) == "BB":
print("".join(S))
continue
l = 2
if "".join(S[:2]) == "AB":
while l < N and S[l] == 'A':
l += 1
while l < N and S[l] == 'B':
S[l] = 'A'
l += 1
S[0] = S[1] = 'B'
print("".join(S))