AC自动机
Joyyiwei
这个作者很懒,什么都没留下…
展开
-
AC自动机算法详解
首先简要介绍一下AC自动机:Aho-Corasick automation,该算法在1975年产生于贝尔实验室,是著名的多模匹配算法之一。一个常见的例子就是给出n个单词,再给出一段包含m个字符的文章,让你找出有多少个单词在文章里出现过。要搞懂AC自动机,先得有模式树(字典树)Trie和KMP模式匹配算法的基础知识。AC自动机算法分为3步:构造一棵Trie树,构造失败指针和模式匹配过程。转载 2014-09-24 10:28:37 · 645 阅读 · 0 评论 -
HDU - 2222 Keywords Search (AC自动机)
DescriptionIn the modern time, Search engine came into the life of everybody like Google, Baidu, etc.Wiskey also wants to bring this feature to his image retrieval system. Every image have a原创 2014-09-24 15:52:52 · 910 阅读 · 0 评论 -
HDU - 3065 病毒侵袭持续中
Description小t非常感谢大家帮忙解决了他的上一个问题。然而病毒侵袭持续中。在小t的不懈努力下,他发现了网路中的“万恶之源”。这是一个庞大的病毒网站,他有着好多好多的病毒,但是这个网站包含的病毒很奇怪,这些病毒的特征码很短,而且只包含“英文大写字符”。当然小t好想好想为民除害,但是小t从来不打没有准备的战争。知己知彼,百战不殆,小t首先要做的是知道这个病毒网站特征:包含多少不同的病原创 2014-09-24 16:43:09 · 926 阅读 · 0 评论 -
HDU - 2457 DNA repair
DescriptionBiologists finally invent techniques of repairing DNA that contains segments causing kinds of inherited diseases. For the sake of simplicity, a DNA is represented as a string containing原创 2014-09-24 22:43:30 · 1701 阅读 · 0 评论 -
HDU - 2825 Wireless Password(AC自动机+DP)
DescriptionLiyuan lives in a old apartment. One day, he suddenly found that there was a wireless network in the building. Liyuan did not know the password of the network, but he got some important原创 2014-10-06 00:15:23 · 1357 阅读 · 0 评论 -
HDU - 4511 小明系列故事――女友的考验(AC自动机+DP)
Description 终于放寒假了,小明要和女朋友一起去看电影。这天,女朋友想给小明一个考验,在小明正准备出发的时候,女朋友告诉他,她在电影院等他,小明过来的路线必须满足给定的规则: 1、假设小明在的位置是1号点,女朋友在的位置是n号点,则他们之间有n-2个点可以走,小明每次走的时候只能走到比当前所在点编号大的位置; 2、小明来的时候不能按一定的顺序经过某些地方。比如,原创 2014-10-13 20:59:24 · 2134 阅读 · 0 评论 -
HDU - 4758 Walk Through Squares (AC自动机+DP)
Description On the beaming day of 60th anniversary of NJUST, as a military college which was Second Artillery Academy of Harbin Military Engineering Institute before, queue phalanx is a spe原创 2014-10-16 16:28:27 · 913 阅读 · 0 评论 -
HDU - 3341 Lost's revenge(AC自动机+DP)
DescriptionLost and AekdyCoin are friends. They always play "number game"(A boring game based on number theory) together. We all know that AekdyCoin is the man called "nuclear weapon of FZU,descen原创 2014-10-17 14:01:45 · 1527 阅读 · 0 评论 -
ZOJ - 3228 Searching the String (AC自动机)
DescriptionLittle jay really hates to deal with string. But moondy likes it very much, and she's so mischievous that she often gives jay some dull problems related to string. And one day, moondy g原创 2014-10-05 13:51:43 · 1260 阅读 · 0 评论