hiho week 171 register

Ended

Participants:443

Verdict:Accepted
Score:100 / 100
Submitted:2017-10-11 23:07:41

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<cstring>
#include<cstdio>
#include<cmath>
#include<map>
#include<algorithm>
using namespace std;
int fa[11000];
int findfa(int k)
{
    if(fa[k]!=k) fa[k] = findfa(fa[k]);
    return fa[k];
}
int join(int k1, int k2)
{
    int f1 = findfa(k1),f2 = findfa(k2);
    if(f1>f2) fa[f1] = f2;
    else fa[f2] = f1;
}
char name[11000][110];
map<string, int> mp;
struct st
{
    int id,f;
}sn[11000];
bool cmp(st a, st b)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX