Sol 就是求割点,把贡献算一下就好...直接tarjan # include <bits/stdc++.h> # define RG register # define IL inline # define Fill(a, b) memset(a, b, sizeof(a)) using namespace std; typedef long long ll; const int _(1e5 + 10); IL ll Read(){ RG ll x = 0, z = 1; RG char c…
tarjan找割点..不是割点答案就是(N-1)*2, 是割点的话就在tarjan的时候顺便统计一下 ------------------------------------------------------------------------------- #include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef long long ll; co…
#include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define pii pair<int,int> #define piii pair<int, pair<int,int> > using namespace std; ; + ; const int inf = 0x3f3f3f3f; const LL I…
想了半天式子...最后在邓大师的帮助下想出此题....QWQ我还是太菜了 对于一个非割点,ans+=2*(n-1); 对于一个割点,ans+= #include<cstdio> #include<iostream> #define R register int using namespace std; ,M=; inline int g() { R ret=,fix=; register :fix; +(ch^); while(isdigit(ch=getchar())); ret…