結果

問題 No.2766 Delicious Multiply Spice
ユーザー tkykwtnb
提出日時 2024-06-01 20:09:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 55,368 KB
最終ジャッジ日時 2024-12-22 08:54:51
合計ジャッジ時間 2,926 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 8
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
N=int(input())
Q=deque()
Q.append((N,""))
while Q:
  N,ans=Q.popleft()
  if N==1:break
  if (N-1)%2==0:
    Q.append(((N-1)//2,"A"+ans))
  if (N-1)%3==0:
    Q.append(((N-1)//3,"B"+ans))
print(ans)
0