摘要:
#include <iostream> #include <algorithm> using namespace std; const int N = 100010; int n, m; int h[N], size; void down(int u) { int t = u; //u这个点的做儿子 阅读全文
posted @ 2019-11-07 20:14
晴屿
阅读(138)
评论(0)
推荐(0)
摘要:
#include <iostream> using namespace std; const int N = 100010; int p[N]; int find(int x) {//返回祖宗节点,同时进行路径压缩 if (p[x] != x) p[x] = find(p[x]); return p 阅读全文
posted @ 2019-11-07 20:13
晴屿
阅读(128)
评论(0)
推荐(0)
摘要:
#include <iostream> using namespace std; const int N = 100010; int n, m; int p[N], size[N]; int find(int x) { if (p[x] != x) p[x] = find(p[x]); return 阅读全文
posted @ 2019-11-07 20:13
晴屿
阅读(108)
评论(0)
推荐(0)
摘要:
#include <iostream> using namespace std; const int N = 100010; int idx;//下标 int son[N][26], cnt[N];//因为英文字母只有26个,所以二维开26个 char str[N]; void insert(cha 阅读全文
posted @ 2019-11-07 20:12
晴屿
阅读(112)
评论(0)
推荐(0)