
AC自动机
文章平均质量分 84
RJ28
小学生
展开
-
bzoj-2434: [Noi2011]阿狸的打字机
2434: [Noi2011]阿狸的打字机Time Limit: 10 Sec Memory Limit: 256 MBSubmit: 1016 Solved: 572[Submit][Status]Description 阿狸喜欢收藏各种稀奇古怪的东西,最近他淘到一台老式的打字机。打字机上只有28个按键,分别印有26个小写英文字母和'B'、'P'两个字母。经阿原创 2016-02-16 20:37:49 · 349 阅读 · 0 评论 -
Uva 11019 Matrix Matcher(二维字符串匹配)
题意:给出一个n*m的字符矩阵T,你的任务是找出给定的x*y的字符矩阵P在T中出现了多少次.分析:白书原题,先把P构造成一个AC自动机,然后在T中逐行匹配。用一个数组记录以一个点为左上角能匹配到P的多少行。#include #include #include #include #include #define MAXNODE 10005using names原创 2016-05-24 15:35:00 · 666 阅读 · 0 评论 -
POJ-2778 DNA Sequence(AC自动机+矩阵快速幂)
DescriptionIt'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原创 2016-05-25 11:57:49 · 372 阅读 · 0 评论 -
Hdu-2222 Keywords Search(AC自动机)
Problem DescriptionIn the modern time, Search engine came into the life of everybody like Google, Baidu, etc.Wiskey(威士忌酒) also wants to bring thisfeature(特写) to his imageretrieval(检索) system.原创 2016-05-23 17:00:29 · 512 阅读 · 0 评论 -
Uva 11468 Substring (AC自动机)
题意:给出一些字符和各自对应的选择概率,随机选择L次后将得到一个长度为L的随机字符串S.给出K个模版串,计算S不包含任何一个串的概率.分析:构造好AC自动机后,直接在树上进行DP,dp[i[l]表示当前在i点还要匹配l长度的概率。(PS 这题精度判断好坑啊,之前保留10位疯狂WA....)#include #include #include #include #de原创 2016-05-23 21:13:07 · 435 阅读 · 0 评论 -
Hdu-6086 Rikka with String(AC自动机+DP)
As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:Yuta has n01 strings si, and he wants to原创 2017-08-10 00:25:09 · 372 阅读 · 0 评论