結果
| 問題 | No.2766 Delicious Multiply Spice |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-31 21:31:55 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 2,000 ms |
| コード長 | 309 bytes |
| 記録 | |
| コンパイル時間 | 161 ms |
| コンパイル使用メモリ | 84,864 KB |
| 実行使用メモリ | 52,096 KB |
| 最終ジャッジ日時 | 2026-05-27 18:02:10 |
| 合計ジャッジ時間 | 2,943 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 8 |
| other | AC * 31 |
ソースコード
import sys
sys.setrecursionlimit(10**8)
n=int(input())
S=set()
ans=[]
def f(x):
global S,ans
if x==1:
print("".join(ans)[::-1])
exit()
if x not in S:
S.add(x)
if (x-1)%2==0:
ans.append("A")
f((x-1)//2)
ans.pop()
if (x-1)%3==0:
ans.append("B")
f((x-1)//3)
ans.pop()
f(n)