結果

問題 No.2766 Delicious Multiply Spice
ユーザー H3PO4
提出日時 2024-05-31 21:25:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-20 22:20:07
合計ジャッジ時間 2,573 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 8
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

def rec(n):
    if n == 1:
        return ""
    if n % 2 == 1:
        res = rec(n // 2)
        if res is not None:
            return res + "A"
    if n % 3 == 1:
        res = rec(n // 3)
        if res is not None:
            return res + "B"
    else:
        return None


N = int(input())
print(rec(N))
0