結果

問題 No.2614 Delete ABC
ユーザー Nikkuniku029Nikkuniku029
提出日時 2024-02-10 09:58:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 61,724 KB
最終ジャッジ日時 2024-02-10 09:58:39
合計ジャッジ時間 1,519 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 67 ms
61,712 KB
testcase_02 AC 47 ms
61,724 KB
権限があれば一括ダウンロードができます

ソースコード

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