[jzoj 2896] 战争游戏 {tarjan+割点}

题目 解题思路 判断割点,然后对于每一个割点。 设被割的联通分量为A,剩余为B 那么统计答案为:A到B的点对数+A点内的经过A点的点对数/2+A点到其它点(n-1) 代码 #include<cstdio> #include<algorithm> #define N 50010 using namespace std; struct node{ int y,next; }a[N*4]; int
相关文章
相关标签/搜索