QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 1024 MB Puntuación total: 100

#3038. 更大的推箱子 40k

Estadísticas

推箱子(Sokoban)是一款著名的益智游戏,玩家在一个 $N \times M$ 的网格中移动,并将 $1 \times 1$ 大小的箱子推到 $1 \times 1$ 大小的目标位置。

Bigger Sokoban 是推箱子的一种变体,其箱子和目标位置的尺寸比 $1 \times 1$ 更大。本题中,箱子和目标位置的大小均为 $2 \times 2$。

Bigger Sokoban 的规则与推箱子相同。网格中的每个方格要么是空地,要么是墙壁。一些 $2 \times 2$ 的空地区域包含一个 $2 \times 2$ 大小的箱子,另一些 $2 \times 2$ 的空地区域被标记为 $2 \times 2$ 大小的目标位置。

玩家位于网格中,可以向上、下、左、右移动到相邻的空地,但不能穿过墙壁、箱子或走出网格边界。如果玩家试图移动到箱子所在的方格,该箱子会沿该方向被推到相邻的方格。箱子不能被推向其他箱子、墙壁或网格边界,且箱子不能被拉动。箱子的数量等于目标位置的数量。当所有箱子都位于目标位置时,谜题即告解决。

你的任务是构造一个 Bigger Sokoban 网格,使得解决该谜题至少需要 40,000 次移动。为了简化问题,网格必须满足以下约束:

  • $1 \le N, M, N + M \le 100$。
  • 网格包含一个箱子和一个目标位置。
  • 玩家、箱子和目标位置不能重叠。

输入格式

本题没有输入。

输出格式

第一行输出两个空格分隔的整数 $N, M$,描述网格的大小。

接下来的 $N$ 行,每行输出一个长度为 $M$ 的字符串,描述网格的每一行。每个字符串必须由 .#PBS 组成,分别代表空地、墙壁、玩家、箱子和目标位置。

网格必须恰好包含一个 P,恰好四个 B,以及恰好四个 SBS 必须分别组成一个 $2 \times 2$ 的正方形。当然,该网格必须是可解的。

注意,样例输出仅用于演示格式。由于该样例的解法步数少于 40,000 次,因此它不是一个正确的答案。

样例

输入 1

(无)

输出 1

5 6
....SS
....SS
.#BB#.
..BB.P
......

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.