摘要: HDU - 3085 Nightmare Ⅱ 双向BFS,建立两个队列,让男孩女孩一起走 鬼的位置用曼哈顿距离判断一下,如果该位置与鬼的曼哈顿距离小于等于当前轮数的两倍,则已经被鬼覆盖 1 #include <cstdio> 2 #include <queue> 3 #include <algori 阅读全文
posted @ 2019-02-17 15:38 孑行 阅读(146) 评论(0) 推荐(0) 编辑
摘要: POJ2449 第K短路 改了好长时间发现读入读反了qwq A*,先在反向图上求出每个点到t的最短距离,作为估价函数即可 疑问:能不能直接记录h+g 1 #include <cstdio> 2 #include <cstring> 3 #include <cctype> 4 #include <al 阅读全文
posted @ 2019-02-17 08:48 孑行 阅读(162) 评论(0) 推荐(0) 编辑