版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_42369449/article/details/83108887
简述题意:给出一个图,询问任意两点之间最短路,边比点多不过20。.
Pay attention to the restriction m-n<=20 !!!
反正直接跑dijkstra一定是不可以的!->TLE
所以我们就会很难想到,可以先建一棵树,在树上处理
简述题意:给出一个图,询问任意两点之间最短路,边比点多不过20。.
Pay attention to the restriction m-n<=20 !!!
反正直接跑dijkstra一定是不可以的!->TLE
所以我们就会很难想到,可以先建一棵树,在树上处理