hiho week 27 register

Ended

Participants:637

Verdict:Accepted
Score:100 / 100
Submitted:2015-01-10 10:59:11

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<vector>
#include<algorithm>
#define MAXN 100100
using namespace std;
struct edge {
    int a, b, w;
};
bool operator<(const edge &a, const edge &b)
{
    return a.w < b.w;
}
int p[MAXN];
int rankX[MAXN];
void initSet()
{
    for (int i = 0; i < MAXN; ++i)
        p[i] = i;
}
int findSet(int x)
{
    if (x == p[x]) return x;
    return p[x] = findSet(p[x]);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX