C++广度优先搜索算法之Dungeon Master

本文介绍了使用C++实现的Dungeon Master问题的广度优先搜索(BFS)算法,包括问题描述、输入输出示例以及完整的代码实现。
摘要由CSDN通过智能技术生成

Dungeon Master(地下城大师)

Description(描述)

You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south, east, west, up or down. You cannot move diagonally and the maze is surrounded by solid rock on all sides.
Is an escape possible? If yes, how long will it take?
你被困在3D地下城,需要找到最快的出路!地下城由单位立方体组成,可能填充或不填充岩石。移动一个单位北,南,东,西,上或下需要一分钟。您不能对角移动,迷宫四周都是坚实的岩石。
逃避可能吗?如果是,需要多长时间?

Input(输入)

The input consists of a number of dungeons. Each dungeon description starts with a line containing three integers L, R and C (all limited to 30 in size).
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值