随笔分类 -  AC自动机

HDU 4511 小明系列故事——女友的考验 (AC自动机+DP)
摘要:小明系列故事——女友的考验Time Limit: 500/200 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 654Accepted Submission(s): 136Problem Description 终于放寒假了,小明要和女朋友一起去看电影。这天,女朋友想给小明一个考验,在小明正准备出发的时候,女朋友告诉他,她在电影院等他,小明过来的路线必须满足给定的规则: 1、假设小明在的位置是1号点,女朋友在的位置是n号点,则他们之间有n-2个点可以走,小明每次走的时候只能走到比当.. 阅读全文

posted @ 2014-03-03 08:18 kuangbin 阅读(3963) 评论(0) 推荐(1)

HDU 4758 Walk Through Squares (2013南京网络赛1011题,AC自动机+DP)
摘要:Walk Through SquaresTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 200Accepted Submission(s): 57Problem DescriptionOn the beaming day of 60th anniversary of NJUST, as a military college which was Second Artillery Academy of Harbin Military Enginee 阅读全文

posted @ 2013-09-22 12:12 kuangbin 阅读(1158) 评论(0) 推荐(0)

【原创】AC自动机小结
摘要:有了KMP和Trie的基础,就可以学习神奇的AC自动机了。AC自动机其实就是在Trie树上实现KMP,可以完成多模式串的匹配。 AC自动机 其实 就是创建了一个状态的转移图,思想很重要。 推荐的学习链接:http://acm.uestc.edu.cn/bbs/read.php?tid=4294http://blog.csdn.net/niushuai666/article/details/7002823http://hi.baidu.com/nialv7/item/ce1ce015d44a6ba7feded52d AC自动机专题训练链接:http://acm.h... 阅读全文

posted @ 2013-06-30 23:16 kuangbin 阅读(30834) 评论(5) 推荐(8)

ZOJ 3494 BCD Code(AC自动机+数位DP)
摘要:BCD CodeTime Limit:5 Seconds Memory Limit:65536 KBBinary-coded decimal (BCD) is an encoding for decimal numbers in which each digit is represented by its own binary sequence. To encode a decimal number using the common BCD encoding, each decimal digit is stored in a 4-bit nibble:Decimal: 0 1 ... 阅读全文

posted @ 2013-06-30 22:29 kuangbin 阅读(2519) 评论(0) 推荐(0)

HDU 3341 Lost's revenge(AC自动机+DP)
摘要:Lost's revengeTime Limit: 15000/5000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 2262Accepted Submission(s): 565Problem DescriptionLost and AekdyCoin are friends. They always play "number game"(A boring game based on number theory) together. We all kno 阅读全文

posted @ 2013-06-30 16:25 kuangbin 阅读(1622) 评论(0) 推荐(0)

HDU 2425 DNA repair (AC自动机+DP)
摘要:DNA repairTime Limit: 5000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 940Accepted Submission(s): 500Problem DescriptionBiologists finally invent techniques of repairing DNA that contains segments causing kinds of inherited diseases. For the sake of simplicity, 阅读全文

posted @ 2013-06-29 22:14 kuangbin 阅读(653) 评论(0) 推荐(0)

HDU 2296 Ring (AC自动机+DP)
摘要:RingTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1564Accepted Submission(s): 487Problem DescriptionFor the hope of a forever love, Steven is planning to send a ring to Jane with a romantic string engraved on. The string's length should not e 阅读全文

posted @ 2013-06-29 21:12 kuangbin 阅读(678) 评论(0) 推荐(0)

POJ 1625 Censored!(AC自动机+DP+高精度)
摘要:Censored!Time Limit:5000MSMemory Limit:10000KTotal Submissions:6956Accepted:1887DescriptionThe alphabet of Freeland consists of exactly N letters. Each sentence of Freeland language (also known as Freish) consists of exactly M letters without word breaks. So, there exist exactly N^M different Freish 阅读全文

posted @ 2013-06-27 22:41 kuangbin 阅读(1773) 评论(3) 推荐(0)

HDU 2243 考研路茫茫——单词情结(AC自动机+矩阵)
摘要:考研路茫茫——单词情结Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2687Accepted Submission(s): 744Problem Description背单词,始终是复习英语的重要环节。在荒废了3年大学生涯后,Lele也终于要开始背单词了。一天,Lele在某本单词书上看到了一个根据词根来背单词的方法。比如"ab",放在单词前一般表示"相反,变坏,离去"等。于是Lele想,如果背了N个词根 阅读全文

posted @ 2013-06-27 18:35 kuangbin 阅读(3501) 评论(3) 推荐(0)

POJ 2778 DNA Sequence(AC自动机+矩阵加速)
摘要:DNA SequenceTime Limit:1000MSMemory Limit:65536KTotal Submissions:9899Accepted:3717DescriptionIt's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For example, if a animal's DNA sequence contains segment AT 阅读全文

posted @ 2013-06-27 17:59 kuangbin 阅读(3295) 评论(3) 推荐(0)

ZOJ 4114 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-06-27 15:23 kuangbin 阅读(967) 评论(0) 推荐(0)

HDU 2896 病毒侵袭(AC自动机)
摘要:病毒侵袭Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7400Accepted Submission(s): 1945Problem Description当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋——我们能在有生之年看到500年一遇的世界奇观,那是多么幸福的事儿啊~~但网路上总有那么些网站,开始借着民众的好奇心,打着介绍日食的旗号,大肆传播病毒。小t不幸成为受害者之一。小t如此生气, 阅读全文

posted @ 2013-06-26 19:44 kuangbin 阅读(4267) 评论(1) 推荐(1)

HDU 3247 Resource Archiver(AC自动机+状态压缩DP)
摘要:Resource ArchiverTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 100000/100000 K (Java/Others)Total Submission(s): 899Accepted Submission(s): 238Problem DescriptionGreat! Your new software is almost finished! The only thing left to do is archiving all your n resource files into a big one.Wait 阅读全文

posted @ 2012-08-08 16:45 kuangbin 阅读(1419) 评论(0) 推荐(0)

HDU 2825 Wireless Password(AC自动机+状态压缩DP)
摘要:Wireless PasswordTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2189Accepted Submission(s): 610Problem DescriptionLiyuan lives in a old apartment. One day, he suddenly found that there was a wireless network in the building. Liyuan did not know th 阅读全文

posted @ 2012-08-08 10:16 kuangbin 阅读(2048) 评论(0) 推荐(0)

HDU 2222 Keywords Search(AC自动机的入门题)
摘要:Keywords SearchTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18800Accepted Submission(s): 6269Problem 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 @ 2012-08-07 14:19 kuangbin 阅读(1276) 评论(0) 推荐(1)

导航

JAVASCRIPT: