hiho week 26 register

Ended

Participants:680

Verdict:Accepted
Score:100 / 100
Submitted:2014-12-27 22:02:29

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
/****************************************\
* Author : hzoi_ztx
* Title  : hiho   1 : ·Prim
* ALG    : 
* CMT    :
* Time   :
\****************************************/
#include <cstdio>
int CH , NEG ;
inline void read(int& ret) {
    ret = NEG = 0 ; while (CH=getchar() , CH<'!') ;
    if (CH == '-') NEG = true , CH = getchar() ;
    while (ret = ret*10+CH-'0' , CH=getchar() , CH>'!') ;
    if (NEG) ret = -ret ;
}
#include <algorithm>
#define  maxn  1010LL
#define  maxe  1000010LL
struct Edge { int u , v , w ; } e[maxe] ;
int tot ;
inline bool CmpW(const Edge& a , const Edge& b) { return a.w < b.w ; }
int n , i , j , k  , ans ;
int par[maxn] = {0} ;
inline int GetAnc(int u) { return par[u] ? par[u] = GetAnc(par[u]) : u ; }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX