結果
| 問題 |
No.2766 Delicious Multiply Spice
|
| コンテスト | |
| ユーザー |
june19312
|
| 提出日時 | 2024-05-31 21:58:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 46 ms / 2,000 ms |
| コード長 | 531 bytes |
| コンパイル時間 | 292 ms |
| コンパイル使用メモリ | 82,216 KB |
| 実行使用メモリ | 53,684 KB |
| 最終ジャッジ日時 | 2024-12-20 23:21:40 |
| 合計ジャッジ時間 | 3,267 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 8 |
| other | AC * 31 |
ソースコード
import sys
sys.setrecursionlimit(10**6)
import pypyjit
pypyjit.set_param('max_unroll_recursion=-1')
N = int(input())
def dfs(x,y):
if x <= 1:
if x == 1:
print("".join(y[::-1]))
exit()
else:
return
if x%2 == 0 and (x-1)%3 == 0:
y.append("B")
dfs((x-1)//3,y)
y.pop()
if (x-1)%2 == 0:
y.append("A")
dfs((x-1)//2,y)
y.pop()
if (x-1)%3 == 0:
y.append("B")
dfs((x-1)//3,y)
y.pop()
dfs(N,[])
june19312