首页 > 代码库 > 【CF676D】Theseus and labyrinth(BFS,最短路)
【CF676D】Theseus and labyrinth(BFS,最短路)
题意:给定一张N*M的地图,每一格都是一个房间,房间之间有门。每个房间可能有四个门,例如>代表右边只有一个门在右边即只能向右走,L代表左边没有门只能除了左其他都可以走等等。现在给出起点和终点,每次你可以把全部房间旋转90度或者移动到相邻的房间,但前提是两个房间之间都有有门,现在要你求起点出发到终点的最少时间。
- «+» means this block has 4 doors (one door to each neighbouring block);
- «-» means this block has 2 doors — to the left and to the right neighbours;
- «|» means this block has 2 doors — to the top and to the bottom neighbours;
- «^» means this block has 1 door — to the top neighbour;
- «>» means this block has 1 door — to the right neighbour;
- «<» means this block has 1 door — to the left neighbour;
- «v» means this block has 1 door — to the bottom neighbour;
- «L» means this block has 3 doors — to all neighbours except left one;
- «R» means this block has 3 doors — to all neighbours except right one;
- «U» means this block has 3 doors — to all neighbours except top one;
- «D» means this block has 3 doors — to all neighbours except bottom one;
- «*» means this block is a wall and has no doors.
挖坑待填
【CF676D】Theseus and labyrinth(BFS,最短路)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。