結果

問題 No.2614 Delete ABC
ユーザー miya145592miya145592
提出日時 2024-01-26 22:18:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 64,132 KB
最終ジャッジ日時 2024-01-26 22:18:55
合計ジャッジ時間 832 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 45 ms
62,084 KB
testcase_02 AC 45 ms
64,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
T = int(input())
N = [int(input()) for _ in range(T)]
ABC = "ABC"
for n in N:
    ans = []
    for _ in range(n):
        if len(ans)>0:
            c = ans.pop()
            ans.append(ABC[0])
            ans.append(c)
            ans.extend(list(ABC[1:]))
        else:
            ans.extend(list(ABC))
    print("".join(ans))
0