結果

問題 No.2766 Delicious Multiply Spice
ユーザー hiro1729
提出日時 2024-05-31 21:25:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 567 bytes
コンパイル時間 501 ms
コンパイル使用メモリ 82,388 KB
実行使用メモリ 56,984 KB
最終ジャッジ日時 2024-12-20 22:17:55
合計ジャッジ時間 3,616 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6 WA * 2
other AC * 10 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input
R = range
P = print
def I(): return int(S())
def M(): return map(int, S().split())
def L(): return list(M())
def O(): return list(map(int, open(0).read().split()))
def yn(b): print("Yes" if b else "No")
biga = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
smaa = "abcdefghijklmnopqrstuvwxyz"

from functools import cache

@cache
def f(n):
	if n == 1:
		return ""
	if n % 2 == 1:
		d = f(n // 2)
		if d == None:
			return None
		else:
			return d + "A"
	if n % 3 == 1:
		d = f(n // 3)
		if d == None:
			return None
		else:
			return d + "B"
	return None

n = I()
print(f(n))
0