摘要: 题目链接:https://www.luogu.com.cn/problem/P3385 解题思路:完全参考自 MoonSkyy大佬的博文 核心思想: \(cnt_u\) 表示起点到 \(u\) 的最短路所经过边数,如果 \(cnt_u \ge n\) 则说明路径至少包含 \(n\) 条边 \(n+1 阅读全文
posted @ 2024-01-03 20:13 quanjun 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://acm.hdu.edu.cn/showproblem.php?pid=2544 题目大意:一道简单的最短路。主要是记录一下 bellman-ford 算法的实现。 示例程序(bellman-ford): #include <bits/stdc++.h> using name 阅读全文
posted @ 2024-01-03 16:43 quanjun 阅读(5) 评论(0) 推荐(0) 编辑