結果

問題 No.1732 ~サンプルはちゃんと見て!~ 16進数と8進数(2)
ユーザー googol_S0googol_S0
提出日時 2021-11-05 22:46:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 255 ms
コンパイル使用メモリ 82,104 KB
実行使用メモリ 65,792 KB
最終ジャッジ日時 2024-04-24 06:40:17
合計ジャッジ時間 1,172 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,224 KB
testcase_01 AC 35 ms
52,224 KB
testcase_02 AC 41 ms
53,248 KB
testcase_03 AC 59 ms
65,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X=['ABDCC','AAFCC','ACADE']
def f(x):
  X=[0]*8
  c=0
  while x:
    X[x&7]+=1
    x>>=3
    c+=1
  if X[0]==0 and len(set(X[1:8]))==1:
    return 1
  return 0

for t in range(int(input())):
  N=int(input())
  A=''
  if N%3==1:
    A='12'
  elif N%3==2:
    A='252'
  else:
    A=''
  A+='5252'*(N//3)
  if len(A)%7:
    print(-1)
    continue
  x=len(A)
  S=''
  while x>=28:
    x-=28
    S+='ACCACCCCCCCCABACAAFFE'
  T=''
  while x:
    T+=X[x//7-1]
    x-=7
  S=T+S
  print(S)
0