結果

問題 No.2766 Delicious Multiply Spice
ユーザー anonymouslyanonymously
提出日時 2024-05-31 21:55:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 376 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 54,100 KB
最終ジャッジ日時 2024-05-31 21:55:20
合計ジャッジ時間 3,341 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,408 KB
testcase_01 AC 40 ms
53,024 KB
testcase_02 AC 38 ms
53,452 KB
testcase_03 AC 38 ms
53,000 KB
testcase_04 AC 38 ms
52,260 KB
testcase_05 AC 38 ms
52,712 KB
testcase_06 AC 39 ms
52,284 KB
testcase_07 AC 39 ms
52,644 KB
testcase_08 AC 37 ms
52,952 KB
testcase_09 AC 38 ms
52,648 KB
testcase_10 AC 38 ms
53,484 KB
testcase_11 AC 39 ms
52,728 KB
testcase_12 AC 37 ms
52,960 KB
testcase_13 AC 41 ms
52,700 KB
testcase_14 AC 37 ms
52,132 KB
testcase_15 AC 39 ms
52,196 KB
testcase_16 AC 38 ms
52,864 KB
testcase_17 AC 38 ms
53,180 KB
testcase_18 AC 38 ms
53,420 KB
testcase_19 AC 38 ms
52,200 KB
testcase_20 AC 38 ms
52,592 KB
testcase_21 AC 38 ms
53,200 KB
testcase_22 AC 38 ms
53,404 KB
testcase_23 AC 38 ms
53,312 KB
testcase_24 AC 38 ms
52,432 KB
testcase_25 AC 39 ms
53,196 KB
testcase_26 AC 37 ms
52,896 KB
testcase_27 AC 38 ms
52,616 KB
testcase_28 AC 38 ms
52,772 KB
testcase_29 AC 38 ms
52,948 KB
testcase_30 AC 38 ms
52,376 KB
testcase_31 AC 38 ms
53,088 KB
testcase_32 AC 38 ms
52,812 KB
testcase_33 WA -
testcase_34 AC 37 ms
52,828 KB
testcase_35 WA -
testcase_36 AC 42 ms
53,688 KB
testcase_37 AC 39 ms
52,896 KB
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(100)


def dfs(n, L, S):
    if n == 1:
        S.append(''.join(L[::-1]))
    else:
        if (n-1) % 2 == 0:
            L.append('A')
            dfs((n-1)/2, L, S)
            L.pop()
        if (n-1) % 3 == 0:
            L.append('B')
            dfs((n-1)/3, L, S)
            L.pop()


L = []
S = []
dfs(int(input()), L, S)
print(*S)
0