#Lutece2726. 最小生成树
最小生成树
Migrated from Lutece 2726 最小生成树
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
给你一个 个点 条边的无向图,求最小生成树。
这是一个非常经典的问题,我们可以采用 kruskal, prim 等算法进行求解
现在你学会了如何算最小生成树,那么来计算下最小生成树的个数吧。
Input
第一行输入两个整数
接下来 行每行三个数 ,表示一条边的两个端点和这条边的边权
Output
输出一个数,表示最小生成树个数对 取模。
Samples
Note
注意模数,数据保证无重边和自环
Resources
2022 UESTC ICPC Training for Graph