摘要: 题目 枚举割掉一条边,然后用并查集看是否为会有两个(或者多个)不联通点。 #include <bits/stdc++.h> using namespace std; #define N 5010 #define ll long long template <class T> inline void 阅读全文
posted @ 2022-09-07 21:59 雪之下,树之旁 阅读(10) 评论(0) 推荐(0) 编辑
摘要: AC通道 类似 $Trie$ 树,如果前缀相同则直接下跳,否则新建节点。但是注意这里的节点所存内容较多,建议离散化后用 $pair$ 存储,便于配对。 #include <bits/stdc++.h> using namespace std; #define N 100010 template <c 阅读全文
posted @ 2022-09-07 21:21 雪之下,树之旁 阅读(22) 评论(0) 推荐(0) 编辑