【SPOJ-PONY1】Help Dr Whooves【prufer序列】
题意:
给出一个n个点m条边的图,问添加最少的边把这个图补成连通图的方案数
用prufer序列的推论,答案为
(Π 联通块大小) * 点数 ^ (联通块个数 - 2)
/* Footprints In The Blood Soaked Snow */
#include
#include
using namespace std;
typedef unsigned
原创
2016-03-09 21:53:24 ·
560 阅读 ·
1 评论