同样难度的题目:https://www.luogu.com.cn/problem/P1746
P1746 只是 BFS,这题涉及到存储邻接表和 SPFA,图论,建议提高难度。
P1746
BFS
SPFA