結果

問題 No.2766 Delicious Multiply Spice
ユーザー detteiuudetteiuu
提出日時 2024-05-31 21:29:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 82,440 KB
実行使用メモリ 54,000 KB
最終ジャッジ日時 2024-05-31 21:29:49
合計ジャッジ時間 2,703 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,852 KB
testcase_01 AC 37 ms
53,584 KB
testcase_02 AC 36 ms
53,564 KB
testcase_03 AC 36 ms
54,000 KB
testcase_04 AC 35 ms
52,820 KB
testcase_05 AC 36 ms
52,736 KB
testcase_06 AC 36 ms
52,872 KB
testcase_07 AC 36 ms
52,620 KB
testcase_08 AC 36 ms
53,168 KB
testcase_09 AC 37 ms
51,996 KB
testcase_10 AC 34 ms
52,052 KB
testcase_11 AC 36 ms
53,344 KB
testcase_12 AC 41 ms
52,532 KB
testcase_13 AC 37 ms
52,120 KB
testcase_14 AC 37 ms
53,404 KB
testcase_15 AC 36 ms
52,924 KB
testcase_16 AC 36 ms
52,396 KB
testcase_17 AC 36 ms
53,136 KB
testcase_18 AC 36 ms
52,152 KB
testcase_19 AC 37 ms
52,392 KB
testcase_20 AC 35 ms
52,056 KB
testcase_21 AC 35 ms
53,496 KB
testcase_22 AC 35 ms
52,400 KB
testcase_23 AC 36 ms
51,956 KB
testcase_24 AC 35 ms
52,488 KB
testcase_25 AC 36 ms
52,244 KB
testcase_26 AC 34 ms
52,820 KB
testcase_27 AC 38 ms
52,296 KB
testcase_28 AC 37 ms
53,008 KB
testcase_29 AC 35 ms
51,820 KB
testcase_30 AC 36 ms
52,744 KB
testcase_31 AC 34 ms
52,496 KB
testcase_32 AC 36 ms
52,544 KB
testcase_33 AC 36 ms
53,900 KB
testcase_34 AC 36 ms
52,476 KB
testcase_35 AC 36 ms
53,000 KB
testcase_36 AC 37 ms
52,308 KB
testcase_37 AC 36 ms
51,968 KB
testcase_38 AC 35 ms
52,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

def dfs(n):
    if n == 1:
        exit(print("".join(ans[::-1])))
    elif n < 1:
        return
    if (n-1) % 2 == 0:
        ans.append("A")
        dfs((n-1)//2)
        ans.pop()
    if (n-1) % 3 == 0:
        ans.append("B")
        dfs((n-1)//3)
        ans.pop()

ans = []
dfs(N)
0