結果
| 問題 | No.2766 Delicious Multiply Spice |
| コンテスト | |
| ユーザー |
june19312
|
| 提出日時 | 2024-05-31 21:58:56 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 39 ms / 2,000 ms |
| コード長 | 531 bytes |
| 記録 | |
| コンパイル時間 | 213 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 52,352 KB |
| 最終ジャッジ日時 | 2026-05-27 18:36:49 |
| 合計ジャッジ時間 | 3,110 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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