hiho week 27 register

Ended

Participants:637

Verdict:Accepted
Score:100 / 100
Submitted:2015-01-03 22:32:08

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 <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
struct Edge
{
    int s, t;
    int v;
} e[1000000];
int parent[100001];
bool comp(const Edge &a, const Edge &b)
{
    return a.v<b.v;
}
int getparent(int x)
{
    if (parent[x]!=x) parent[x]=getparent(parent[x]);
    return parent[x];
}
int main()
{
    int n, m;
    scanf("%d %d", &n, &m);
    for (int i=0; i<m; ++i)
        scanf("%d %d %d", &e[i].s, &e[i].t, &e[i].v);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX