結果
問題 |
No.2766 Delicious Multiply Spice
|
ユーザー |
![]() |
提出日時 | 2024-06-09 23:13:29 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 380 bytes |
コンパイル時間 | 140 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-31 03:52:40 |
合計ジャッジ時間 | 2,553 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 8 |
other | AC * 31 |
ソースコード
N = int(input()) mem = {} def f(n): if n in mem: return mem[n] if n == 1: return "" if n % 2 == 1: if f(n//2) is not None: mem[n//2] = f(n//2) return mem[n//2] + "A" if n % 3 == 1: if f(n//3) is not None: mem[n//3] = f(n//3) return mem[n//3] + "B" return None print(f(N)) "🐬"