結果

問題 No.2614 Delete ABC
ユーザー Nikkuniku029
提出日時 2024-02-10 09:58:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 82,256 KB
実行使用メモリ 62,508 KB
最終ジャッジ日時 2024-09-28 17:03:13
合計ジャッジ時間 1,007 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque


def solve(N):
    q = deque(list("ABC"))
    for _ in range(N - 1):
        C = q.pop()
        q.append("A")
        q.append(C)
        q.append("B")
        q.append("C")
    return "".join(q)


T = int(input())
ans = []
for _ in range(T):
    N = int(input())
    ans.append(solve(N))
print(*ans, sep="\n")
0