10099_HarderSokobanProble

2022-5-16 18:16| 发布者: Hocassian| 查看: 80| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504540594700-Problem List-采集的数据-后羿采集器.html

Pro.ID

10099

Title

Harder Sokoban Problem

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10099

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    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

    输出

    Description

    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.

    Input

    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

    Output must contain a single integer --- the maximal number of moves.

    Sample Input

    3
    ..#
    ...
    ..*

    Sample Output

    10

    Source

    样例输入

    3
    ..#
    ...
    ..*

    样例输出

    10

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部