上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页
摘要: Lyndon串:当且仅当字符串 \(s\) 的字典序严格小于其所有后缀的字典序时,字符串 \(s\) 是Lyndon串。当且仅当字符串 \(s\) 的字典序严格小于其所有非平凡循环同构串的字典序时,字符串 \(s\) 是Lyndon串。 Lyndon分解:字符串 \(s\) 的Lyndon分解为 \ 阅读全文
posted @ 2021-01-24 16:34 purinliang 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 无源汇上下界可行流 所有点都要满足流量平衡的可行流。每条边的流量上界为 \(F\) ,流量下界为 \(f\) ,一开始加入初始流量,对于每个点 \(i\) ,设超级源 \(S\) 和超级汇 \(T\) ,设初始入流量-初始出流量为 \(M\) , 若M=0就不用管,若M>0(入流量过大),则连接 \ 阅读全文
posted @ 2021-01-24 12:12 purinliang 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 残量网络:剩余容量大于0的边组成的子图。(注意反向边也可以有剩余容量大于0) 增广路:残量网络中,从源点到汇点的路径 阅读全文
posted @ 2021-01-23 19:49 purinliang 阅读(46) 评论(0) 推荐(0) 编辑
摘要: 验证链接:[洛谷P3386 - 二分图最大匹配] 最大流 int N = n1 + n2, S = ++N, T = ++N; dinic.Init(N, S, T); for(int i = 1; i <= n1; ++i) { int V1i = i; dinic.AddEdge(S, V1i, 阅读全文
posted @ 2021-01-23 17:29 purinliang 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 验证链接:[洛谷P3376 - 网络最大流] | [洛谷P1361 - 小M的作物] | [洛谷P3386 - 二分图最大匹配] 设点数为 \(n\) ,边数为 \(m\) ,那么Dinic算法的时间复杂度是 \(O(n^2m)\) ,在稀疏图上效率和EK算法相当,但在稠密图上效率要比EK算法高很多 阅读全文
posted @ 2021-01-23 16:54 purinliang 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 下面用 \((u,v,w)\) 表示节点 \(u\) 到节点 \(v\) 的容量为 \(w\) 的有向边。 最大权闭合子图 最大权闭合子图,指对于某个节点 \(u\) ,若选择节点 \(u\) ,则必须选择节点 \(u\) 可达的所有点集。 对于正权点u,连接S到u,并在答案中默认选择这个正权。对于 阅读全文
posted @ 2021-01-23 15:34 purinliang 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 验证链接:左偏树:https://www.luogu.com.cn/problem/P3377 验证链接:堆:https://www.luogu.com.cn/problem/P3378 维护一种数据结构,支持下列操作: 插入新元素到某个集合中 查询某个集合中的最小元素 删除某个集合中的最小元素 合 阅读全文
posted @ 2021-01-22 17:58 purinliang 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 验证链接:https://www.luogu.com.cn/problem/P5091 namespace exET { int calcA(char *a, int mod) { ll res = 0; for(int i = 1, n = strlen(a + 1); i <= n; ++i) 阅读全文
posted @ 2021-01-22 11:52 purinliang 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 验证链接:https://www.luogu.com.cn/problem/P3865 struct SparseTable { static const int MAXN = 200000 + 10; static const int MAXLOGN = 20; int n; int log2[M 阅读全文
posted @ 2021-01-21 10:33 purinliang 阅读(95) 评论(0) 推荐(0) 编辑
摘要: SG函数 const int MAXN = 600000; int n; int sg[MAXN]; int SG(int x) { // 默认值为-1 if(sg[x] != -1) return sg[x]; bool used[32] = {}; // 这里写递归到后继状态 for(int i 阅读全文
posted @ 2021-01-17 22:56 purinliang 阅读(426) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页