随笔分类 -  BFS

摘要:纠正我对 01 BFS 问题的错误认识。 我一直以为对于 01 BFS,每次点 u 出队时,对于 u 的邻接边表中的边,只要先松弛边权为 0 的边再松弛边权为 1 的边就能保证 每个点只入队一次 。最近我发现我错了,例子: 按照上述做法,入队序列是 1, 2, 3, 4, 5, 4, 5。4 阅读全文
posted @ 2019-11-06 07:54 Pat 阅读(330) 评论(0) 推荐(0) 编辑
摘要:传送门POUR1 - Pouring water#gcd#recursionGiven two vessels, one of which can accommodatealitres of water and the other -blitres of water, determine the n... 阅读全文
posted @ 2015-09-21 00:30 Pat 阅读(395) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示