結果
| 問題 | No.1732 ~サンプルはちゃんと見て!~ 16進数と8進数(2) | 
| コンテスト | |
| ユーザー |  tamato | 
| 提出日時 | 2021-11-05 23:28:26 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 45 ms / 2,000 ms | 
| コード長 | 1,264 bytes | 
| コンパイル時間 | 331 ms | 
| コンパイル使用メモリ | 82,372 KB | 
| 実行使用メモリ | 58,588 KB | 
| 最終ジャッジ日時 | 2024-11-06 14:41:56 | 
| 合計ジャッジ時間 | 1,236 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 3 | 
ソースコード
mod = 998244353
eps = 10**-9
def main():
    import sys
    input = sys.stdin.readline
    L = {}
    L1 = {}
    L2 = {}
    for i in range(10, 16):
        n1 = i
        cnt1 = [0] * 8
        while n1:
            cnt1[n1 % 8] += 1
            n1 //= 8
        L1[tuple(cnt1)] = i
        for j in range(10, 16):
            n2 = i * 16 + j
            cnt2 = [0] * 8
            while n2:
                cnt2[n2 % 8] += 1
                n2 //= 8
            L2[tuple(cnt2)] = (i, j)
            for k in range(10, 16):
                n = i * (16**2) + j * 16 + k
                cnt = [0] * 8
                while n:
                    cnt[n%8] += 1
                    n //= 8
                L[tuple(cnt)] = (i, j, k)
    ANS7 = "CEEAC"
    ANS14 = "BBCCCFACAC"
    ANS28 = "ACCACCCCCCCCABACAAFFE"
    for _ in range(int(input())):
        N = int(input())
        M = (N // 3) * 4
        if N % 3 == 1:
            M += 2
        elif N % 3 == 2:
            M += 3
        if M % 7:
            print(-1)
            continue
        ans = [ANS28] * (M // 28)
        if M % 28 == 7:
            ans = [ANS7] + ans
        elif M % 28 == 14:
            ans = [ANS14] + ans
        print("".join(ans))
if __name__ == '__main__':
    main()
            
            
            
        