*题目描述:
Byteotia城市有n个 towns m条双向roads. 每条 road 连接 两个不同的 towns ,没有重复的road. 所有towns连通。
*输入
输入n<=100000 m<=500000及m条边
*输出:
输出n个数,代表如果把第i个点去掉,将有多少对点不能互通。
*样例输入:
5 5
1 2
2 3
1 3
3 4
4 5
*样例输出:
8
8
16
14
8
*题解:
裸的找割点。答案就是每个割点的子树的大小乘上除了子树外的点,还有子树和子树之间的对数,最后还有每个点和其他n-1个点的对数。
*代码:
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#ifdef WIN32
#define LL "%I64d"
#else
#define LL "%lld"
#endif
#ifdef CT