結果

問題 No.1732 ~サンプルはちゃんと見て!~ 16進数と8進数(2)
ユーザー 👑 rin204rin204
提出日時 2022-01-25 02:27:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 814 bytes
コンパイル時間 1,348 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 71,496 KB
最終ジャッジ日時 2023-08-21 17:48:45
合計ジャッジ時間 2,586 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,464 KB
testcase_01 AC 71 ms
71,100 KB
testcase_02 AC 72 ms
71,496 KB
testcase_03 AC 73 ms
71,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""
for a in "ABCDEF":
    for b in "ABCDEF":
        for c in "ABCDEF":
            for d in "ABCDEF":
                for e in "ABCDEF":
                    o = oct(int(a + b + c + d + e, 16))[2:]
                    if len(set(o)) == 7:
                        #print(o, a + b + c + d + e)
                        pass
for i in range(1, 201):
    a = i // 3 * 4
    if i % 3 == 1:
        a += 2
    elif i % 3 == 2:
        a += 3
    if a % 7 == 0:
        print(i)
"""
s5 = "ABDCC"
s10 = "BBCCCFACAC"
s21 = "ACCACCCCCCCCABACAAFFE"

def solve():
    n = int(input())
    if n % 21 == 0:
        print(s21 * (n // 21))
    elif n % 21 == 10:
        print(s10 + s21 * (n // 21))
    elif n % 21 == 5:
        print(s5 + s21 * (n // 21))
    else:
        print(-1)

for _ in range(int(input())):
    solve()


0