转载请注明出处:
http://www.cnblogs.com/hzoi-wangxh/p/7738615.html
1123: [POI2008]BLO
Description
Byteotia城市有n个 towns m条双向roads. 每条 road 连接 两个不同的 towns ,没有重复的road. 所有towns连通。Input
输入n<=100000 m<=500000及m条边Output
输出n个数,代表如果把第i个点去掉,将有多少对点不能互通。Sample Input
5 51 2
2 3
1 3
3 4
4 5
Sample Output 88
16
14
8
题解:
其实就是个tarjan求点双。 点双并不用实际求出来,只是在搜索树中传上去,遇到割点求一下即可。 注意(x,y)和(y,x)是不同对点。附上代码:
1 #include2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define int long long 9 #define mmin(a,b) (a