結果

問題 No.2766 Delicious Multiply Spice
ユーザー 👑 timitimi
提出日時 2024-06-02 05:12:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 471 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 82,256 KB
実行使用メモリ 54,552 KB
最終ジャッジ日時 2024-06-02 05:13:02
合計ジャッジ時間 3,068 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,152 KB
testcase_01 AC 40 ms
53,164 KB
testcase_02 AC 39 ms
52,400 KB
testcase_03 AC 39 ms
53,288 KB
testcase_04 AC 37 ms
53,012 KB
testcase_05 AC 37 ms
52,336 KB
testcase_06 AC 37 ms
52,900 KB
testcase_07 AC 38 ms
53,292 KB
testcase_08 AC 36 ms
52,272 KB
testcase_09 AC 37 ms
53,572 KB
testcase_10 AC 37 ms
52,820 KB
testcase_11 AC 36 ms
52,688 KB
testcase_12 AC 36 ms
53,068 KB
testcase_13 AC 37 ms
54,552 KB
testcase_14 AC 58 ms
54,100 KB
testcase_15 AC 37 ms
53,572 KB
testcase_16 AC 37 ms
53,020 KB
testcase_17 AC 37 ms
52,832 KB
testcase_18 AC 35 ms
53,504 KB
testcase_19 AC 37 ms
53,560 KB
testcase_20 AC 37 ms
52,616 KB
testcase_21 AC 37 ms
52,696 KB
testcase_22 AC 38 ms
53,944 KB
testcase_23 AC 37 ms
53,360 KB
testcase_24 AC 37 ms
52,820 KB
testcase_25 AC 38 ms
52,492 KB
testcase_26 AC 38 ms
52,532 KB
testcase_27 AC 36 ms
53,000 KB
testcase_28 AC 37 ms
52,756 KB
testcase_29 AC 38 ms
53,864 KB
testcase_30 AC 37 ms
53,816 KB
testcase_31 AC 38 ms
52,852 KB
testcase_32 AC 37 ms
53,892 KB
testcase_33 AC 38 ms
52,936 KB
testcase_34 AC 38 ms
53,132 KB
testcase_35 AC 37 ms
53,552 KB
testcase_36 AC 37 ms
52,952 KB
testcase_37 AC 35 ms
52,972 KB
testcase_38 AC 37 ms
54,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#ax,ay,az=map(int, input().split())
#bx,by,bz=map(int, input().split())

N=int(input())
D={}
import heapq 
A=[]
heapq.heappush(A,(N,0)) 
while A:
  x,c=heapq.heappop(A)
  D[x]=c 
  if x==1:
    break
  if (x-1)%2==0:
    p=(x-1)//2 
    q=c*3+1 
    heapq.heappush(A,(p,q))
  if (x-1)%3==0:
    p=(x-1)//3 
    q=c*3+2
    heapq.heappush(A,(p,q))
    
c=D[1]
ans=[]
while c:
  if c%3==1:
    ans.append('A')
  elif c%3==2:
    ans.append('B')
  c//=3 
print(''.join(ans))
0