結果

問題 No.2766 Delicious Multiply Spice
ユーザー ButterflvButterflv
提出日時 2024-05-31 21:37:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 82,308 KB
実行使用メモリ 53,760 KB
最終ジャッジ日時 2024-05-31 21:37:46
合計ジャッジ時間 2,669 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,692 KB
testcase_01 AC 37 ms
52,372 KB
testcase_02 AC 36 ms
52,568 KB
testcase_03 AC 36 ms
53,100 KB
testcase_04 AC 37 ms
52,272 KB
testcase_05 AC 36 ms
53,060 KB
testcase_06 AC 36 ms
52,208 KB
testcase_07 AC 37 ms
52,336 KB
testcase_08 AC 35 ms
53,448 KB
testcase_09 AC 35 ms
52,340 KB
testcase_10 AC 38 ms
52,224 KB
testcase_11 AC 36 ms
52,304 KB
testcase_12 AC 35 ms
53,708 KB
testcase_13 AC 36 ms
51,824 KB
testcase_14 AC 35 ms
52,348 KB
testcase_15 AC 36 ms
52,956 KB
testcase_16 AC 36 ms
52,824 KB
testcase_17 AC 35 ms
53,084 KB
testcase_18 AC 36 ms
53,760 KB
testcase_19 AC 36 ms
53,504 KB
testcase_20 AC 36 ms
52,072 KB
testcase_21 AC 35 ms
52,548 KB
testcase_22 AC 37 ms
51,812 KB
testcase_23 AC 37 ms
52,420 KB
testcase_24 AC 37 ms
52,396 KB
testcase_25 AC 36 ms
53,020 KB
testcase_26 AC 36 ms
52,760 KB
testcase_27 AC 37 ms
51,820 KB
testcase_28 AC 37 ms
52,012 KB
testcase_29 AC 36 ms
52,640 KB
testcase_30 AC 37 ms
52,956 KB
testcase_31 AC 37 ms
52,284 KB
testcase_32 AC 37 ms
53,016 KB
testcase_33 AC 37 ms
53,220 KB
testcase_34 AC 37 ms
52,880 KB
testcase_35 AC 37 ms
52,004 KB
testcase_36 AC 37 ms
53,008 KB
testcase_37 AC 37 ms
53,104 KB
testcase_38 AC 37 ms
53,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def dfs(arr, N):
  # print(N)
  if N==1:
    for i in range(len(arr)-1, -1, -1):
      print(arr[i],end="")
    print()
    exit()
  if N%2==1:
    new_arr = arr[:]
    new_arr.append("A")
    dfs(new_arr, (N-1)//2)
  if N%3==1:
    new_arr = arr[:]
    new_arr.append("B")
    dfs(new_arr, (N-1)//3)

_N=int(input())

dfs([], _N)
0