首页 > Redundant Paths
头像 minux_sufe
发表于 2020-07-03 11:18:26
#include <cstring> #include <algorithm> #include <iostream> #include <stack> using namespace std; const int N=5005; const int 展开全文
头像 回归梦想
发表于 2021-01-14 16:53:35
NC51307 Redundant Paths 题目: • 给定无向连通图,求至少需要添加几条边使它变成一个边双连通图。(添多少边可以消灭所有的桥) 题解: 先用边双连通缩点• 缩点之后是一棵树• 无根树的叶子(度数为1的点)都需要再添一条边,叶子节点两两连接• 答案是是(叶子数+1)/2 代码: 展开全文

等你来战

查看全部