[CF1005F]Berland and the Shortest Paths_最短路树_堆优化dij

Berland and the Shortest Paths

题目链接:https://www.codeforces.com/contest/1005/problem/F

数据范围:略。


题解:

太鬼畜了......

就是问有多少颗不同的最短路树。

因为边权是$1$。

然后啊....只需要把可能的非树边枚举枚举,$dfs$一下就行了....

我以为是啥魔鬼神仙题。

代码:(CF崩了代码丢了)

猜你喜欢

转载自www.cnblogs.com/ShuraK/p/11787407.html