同上一题一样,记录dfs遍历的序列,然后再利用树状数组快速求和调了好久呢View Code #include<cstdio>#include<stack>#include<cstring>using namespace std;stack<int> ss;const int maxn = 100010;struct EDGE{ int v,next;}edge[maxn*2];int exis[maxn],head[maxn],l[maxn],r[maxn],seq[maxn*2],re[maxn],c[maxn*2],cnt;bool vis[ Read More
posted @ 2012-02-14 14:20
Because Of You
Views(230)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号