
AC自动机
文章平均质量分 64
mis_deer
Make_myself.
展开
-
[HDU 2222] Keywords Search (AC自动机)
Description In 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 lo原创 2015-11-16 19:12:51 · 466 阅读 · 0 评论 -
[POJ 2778] DNA Sequence (AC自动机+DP+矩阵加速)
Description It'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 seg原创 2015-11-16 19:00:12 · 414 阅读 · 0 评论 -
[POJ 1625] Censored! (AC自动机+DP+大整数)
Description The 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 exactl原创 2015-11-16 19:50:54 · 625 阅读 · 0 评论 -
[SCU 4507] 奶牛情书 (AC自动机)
SCU - 4507求给定长度的文本串,使得每个模式串至少出现过一次 求这样的模式串的个数AC自动机禁止模式串的裸题 这题求的是一个串至少出现过一次 只要求一次都没出现过的方案总数 再拿所有方案总数相减即可得到答案然后就拿所有模式串构造 Trie树,然后在上面跑 AC自动机 跑到单词结尾的时候不转移,这样就能求出答案#pragma comment(linker, "/STACK:10240原创 2016-05-10 23:30:36 · 621 阅读 · 0 评论 -
[Codeforces 697F] Legen... (AC自动机+取max的矩阵快速幂)
Codeforces - 697F 构造一个长度为 ll的串,其中每包含一个第 ii个单词,能获得 aia_i的价值 单词可重复,也可相互覆盖,问最大价值是多少 一看就是AC自动机,但是 ll特别大,有 101410^{14},所以要用矩阵快速幂 但是这个dp过程是取max的,所以矩阵和一般的都不一样 由于运算符的抽象性, 所以可以把矩阵乘法中的整数的乘法,即加权的方式,视作加法原创 2016-07-16 21:36:57 · 760 阅读 · 0 评论