当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2384:Harder Sokoban Problem

题目描述
The game of sokoban is played in a rectangular labirinth of N by N cells with each cell either empty, denoted by '.' character (ASCII 46), or occupied by wall, denoted by '#' character (ASCII 35). There is also a single destination cell, denoted by '*' character (ASCII 42).

One player and one container are located in the empty cells of the labirinth. The player can move between the empty cells in horizontal or vertical direction. If the cell where the player tries to move is occupied by container, the container is "pushed" to the next cell in the same direction. That next cell must, of course, be empty.

The objective of the game is well-known: to place the container in the destination cell with the minimum number of moves. Your task, however, is different: given the field, select starting position for the player and the container so as to maximize the required number of moves.
输入解释
First line of input contains number N -- the field size. The following N lines consist of N characters each -- representation the field. The input field always contains at least one empty cell adjacent to the destination cell.
2 ≤ N ≤ 25
输出解释
Output must contain a single integer -- the maximal number of moves.
输入样例
3
..#
...
..*
输出样例
10

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2384

最后修改于 2020-10-29T06:31:09+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536