上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 40 下一页

2013年4月21日

UVa 10003 - Cutting Sticks 区间dp

摘要: Cutting SticksYou have to cut a wood stick into pieces. The most affordable company, The Analog Cutting Machinery, Inc. (ACM), charges money according to the length of the stick being cut. Their procedure of work requires that they only make one cut at a time.It is easy to notice that different sele 阅读全文

posted @ 2013-04-21 20:44 电子幼体 阅读(198) 评论(0) 推荐(0) 编辑

hdu 2757 DNA repair AC自动机dp--------完全不懂--------

摘要: DNA repairTime Limit: 5000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 872Accepted Submission(s): 473Problem DescriptionBiologists finally invent techniques of repairing DNA that contains segments causing kinds of inherited diseases. For the sake of simplicity, 阅读全文

posted @ 2013-04-21 18:23 电子幼体 阅读(170) 评论(0) 推荐(0) 编辑

ZOJ 3430 Detect the Virus AC自动机

摘要: Detect the VirusTime Limit:2 Seconds Memory Limit:65536 KBOne day, Nobita found that his computer is extremely slow. After several hours' work, he finally found that it was a virus that made his poor computer slow and the virus was activated by a misoperation of opening an attachment of an email 阅读全文

posted @ 2013-04-21 14:38 电子幼体 阅读(149) 评论(0) 推荐(0) 编辑

2013年4月20日

hdu 3695 Computer Virus on Planet Pandora AC自动机

摘要: Computer Virus on Planet PandoraTime Limit: 6000/2000 MS (Java/Others)Memory Limit: 256000/128000 K (Java/Others)Total Submission(s): 1609Accepted Submission(s): 454Problem DescriptionAliens on planet Pandora also write computer programs like us. Their programs only consist of capital letters (‘A’ t 阅读全文

posted @ 2013-04-20 20:38 电子幼体 阅读(183) 评论(0) 推荐(0) 编辑

hdu 3695 AC自动机模板题

摘要: Keywords SearchTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23502Accepted Submission(s): 7763Problem DescriptionIn the modern time, Search engine came into the life of everybody like Google, Baidu, etc.Wiskey also wants to bring this feature to 阅读全文

posted @ 2013-04-20 19:19 电子幼体 阅读(171) 评论(0) 推荐(0) 编辑

AC自动机算法与AC自动机专辑

摘要: AC自动机算法AC自动机简介:首先简要介绍一下AC自动机:Aho-Corasick automation,该算法在1975年产生于贝尔实验室,是著名的多模匹配算法之一。一个常见的例子就是给出n个单词,再给出一段包含m个字符的文章,让你找出有多少个单词在文章里出现过。要搞懂AC自动机,先得有字典树Trie和KMP模式匹配算法的基础知识。KMP算法是单模式串的字符匹配算法,AC自动机是多模式串的字符匹配算法。AC自动机的构造:1.构造一棵Trie,作为AC自动机的搜索数据结构。2.构造fail指针,使当前字符失配时跳转到具有最长公共前后缀的字符继续匹配。如同 KMP算法一样, AC自动机在匹配时如 阅读全文

posted @ 2013-04-20 19:01 电子幼体 阅读(199) 评论(0) 推荐(0) 编辑

[置顶] AC自动机算法与AC自动机专辑

摘要: AC自动机算法AC自动机简介:首先简要介绍一下AC自动机:Aho-Corasick automation,该算法在1975年产生于贝尔实验室,是著名的多模匹配算法之一。一个常见的例子就是给出n个单词,再给出一段包含m个字符的文章,让你找出有多少个单词在文章里出现过。要搞懂AC自动机,先得有字典树Trie和KMP模式匹配算法的基础知识。KMP算法是单模式串的字符匹配算法,AC自动机是多模式串的字符匹配算法。AC自动机的构造:1.构造一棵Trie,作为AC自动机的搜索数据结构。2.构造fail指针,使当前字符失配时跳转到具有最长公共前后缀的字符继续匹配。如同 KMP算法一样, AC自动机在匹配时如 阅读全文

posted @ 2013-04-20 19:01 电子幼体 阅读(277) 评论(0) 推荐(0) 编辑

AC自动机模板

摘要: 每个节点只访问一次。//子树节点是在插入时new的, //寻找失配指针中使用的队列是直接调用STL的 const int kind = 26; struct node { node *fail; node *next[kind]; int count;//记录当前前缀是完整单词出现的个数 node() { fail = NULL; count = 0; memset(next,NULL,sizeof(next)); } }; void insert(char *str,node *root) { ... 阅读全文

posted @ 2013-04-20 18:26 电子幼体 阅读(145) 评论(0) 推荐(0) 编辑

Magic Tree 水dp 错题!

摘要: Magic TreeTime Limit 1000msMemory Limit 65536Kdescription Every acmer dream for gold medal. Fotunately,there are two magic trees (which are conveniently numbered 1 and 2) in our campus, each full of gold medal. The trees are very high, so we can not touch the gold medal when they are in the tree bu. 阅读全文

posted @ 2013-04-20 18:01 电子幼体 阅读(205) 评论(0) 推荐(0) 编辑

Trip 图dp

摘要: TripTime Limit 1000msMemory Limit 65536Kdescription Xiao wang has a new car, so he wants to have a trip from his home to hefei, however, there is no road from his house directly to Hefei, so he has to go through a number of cities to get to hefei, his car takes one unit of time driving a unit dista. 阅读全文

posted @ 2013-04-20 17:54 电子幼体 阅读(110) 评论(0) 推荐(0) 编辑

上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 40 下一页

导航