首页 > TAG信息列表 > 864

864. 获取所有钥匙的最短路径 BFS

给定一个二维网格 grid。 "." 代表一个空房间, "#" 代表一堵墙, "@" 是起点,("a", "b", ...)代表钥匙,("A", "B", ...)代表锁。 我们从起点开始出发,一次移动是指向四个基本方向之一行走一个单位空间。我们不能在网格外面行走,也无法穿过一堵墙。如果途经一个钥匙,我们就把它捡起来

20191114成绩

本次成绩: 学号 姓名 所属团队 团队得分 每周例行报告 总分 占期末分值10% 贡献分 总分 满分分值 900 4 904 10 6 16 付宇泽 构建之法 860 4 864 9.6 4.8 14.4 肖亚男 都是为了生活 860 -4 856 9.5 7.2 16.7 康哲 构建之法 860 4 864 9.6 5.4 15.0 王可非 都是为了

[深度优先搜索] leetcode 864 Shortest Path to Get All Keys

problem:https://leetcode.com/problems/shortest-path-to-get-all-keys/        这道题其它地方都挺基础的,就是普通的宽搜,难点主要在于visit状态的维护。        如果不考虑visit数组,则会出现大量重复的来回搜索,比如刚刚从1->2,下一步又从2->1。        但是,已经访问过

LeetCode 864. Shortest Path to Get All Keys

864. Shortest Path to Get All Keys We are given a 2-dimensional grid. “.” is an empty cell, “#” is a wall, “@” is the starting point, (“a”, “b”, …) are keys, and (“A”, “B”, …) are locks. We start at the starting point, and one move consists