给定一张无向图,求从点 111 到点 nnn 的最短边数。
输入图。
输出最短边数。无法到达输出 −1-1−1。
1≤n≤1001\le n\le 1001≤n≤100
4 3 1 2 2 3 3 4
3
使用您的 www.mathcoding.online 通用账户