并查集,裸题
本题要点:
1、 n <= 50000, 把名字离散化为整数,后面就是并查集的操作。压缩路径。
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <string>
using namespace std;
const int MaxN = 5e4 + 10;
int fa[MaxN];
map<string, int> mp
并查集,裸题
本题要点:
1、 n <= 50000, 把名字离散化为整数,后面就是并查集的操作。压缩路径。
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <string>
using namespace std;
const int MaxN = 5e4 + 10;
int fa[MaxN];
map<string, int> mp