2017年9月17日

HDU - 6208 The Dominator of Strings HDU - 6208 AC自动机 || 后缀自动机

摘要: https://vjudge.net/problem/HDU-6208 首先可以知道最长那个串肯定是答案 然后,相当于用n - 1个模式串去匹配这个主串,看看有多少个能匹配。 普通kmp的话,每次都要O(mxLen)的复杂度肯定不行。考虑AC自动机,不说这个算法了都懂。 大概就是,询问主串的时候用F 阅读全文

posted @ 2017-09-17 21:40 stupid_one 阅读(268) 评论(2) 推荐(0) 编辑

Barty's Computer 字典树

摘要: https://nanti.jisuanke.com/t/17122 Barty have a computer, it can do these two things. Add a new string to its memory, the length of this string is eve 阅读全文

posted @ 2017-09-17 09:59 stupid_one 阅读(424) 评论(0) 推荐(0) 编辑

导航