Title: http://www.lydsy.com:808/JudgeOnline/problem.php?id=1093
Analysis:
First of all, we must first put the strong unicom into a point, and then become a DAG
Here's one thing to know: The largest semi-connected sub-graph of the original is actually the longest chain on the new Dag graph.
And then just like the topological sort (but this is the point with the out of 0 first, the topological sort to the point of the degree of 0 priority), set f[i] to indicate node I as the starting node of the longest chain length, s[i] represents the node I as the starting node of the longest chain of the number of bars, and then the same as the DP ...
Attention:
1, the contraction point when there may be a heavy edge, to pay attention to judge
2, in DP when s[] summing the time to add a side mod
[Bzoj 1093] [ZJOI2007] The largest semi-unicom sub-graph (strong link to shrink point +dp)