2025年2月20日
摘要: 比较常规的多起点搜索问题 1 class Solution { 2 public: 3 typedef pair<int, int> pii; 4 int m, n; 5 vector<pii> start; 6 vector<vector<char>> board; 7 vector<int> n 阅读全文
posted @ 2025-02-20 17:22 Coder何 阅读(18) 评论(0) 推荐(0)
摘要: 使用BFS(层序遍历)来解决该题。起点就是腐烂橘子的点位集合。 错误思路:一开始脑子没转过来,对起点集合里的每一个点进行了一次bfs,然后求最小值 1 class Solution { 2 public: 3 typedef pair<int, int> pii; 4 map<pii, int> d 阅读全文
posted @ 2025-02-20 14:21 Coder何 阅读(29) 评论(0) 推荐(0)