hiho week 55 register

Ended

Participants:378

Verdict:Accepted
Score:100 / 100
Submitted:2015-07-18 21:58:32

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <cstdio>
#include <algorithm>
using namespace std;
int N, M, Res;
int f[100005];
int son[20004], pa[20004], Ecnt, Dcnt, Dfn[20004], Low[20004], Stk[100005], Scnt;
int getf(int x)
{
    if (f[x] == x) return x;
    return f[x] = getf(f[x]);
}
inline void Merge(int x, int y)
{
    int X = getf(x), Y = getf(y);
    if (X != Y)
    {
        if (X > Y) swap(X, Y);
        f[Y] = X;
    }
}
struct Edge
{
    int next, link, id;
} ed[200005];
inline void Add(int u,int v,int i)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX