結果

問題 No.2766 Delicious Multiply Spice
ユーザー ra5anchorra5anchor
提出日時 2024-06-02 16:12:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 51,968 KB
最終ジャッジ日時 2024-12-23 10:16:23
合計ジャッジ時間 3,263 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 8
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #


def func(S, x):
    global ans
    if x == 1:
        ans = S
        return
    if (x - 1) % 2 == 0:
        nx = (x - 1) // 2
        nS = 'A' + S
        func(nS, nx)
       
    if (x - 1) % 3 == 0:
        nx = (x - 1) // 3
        nS = 'B' + S
        func(nS, nx)

X = int(input())
func('', X)

print(ans)
0