UVA 11468 - Substring AC自动机+DP
摘要:
dp[i][l]表示在结点i再走l步不碰到单词结点的概率。关键一步:val[u]|=val[fail[u]];#include#include#include#include#include#include#includeusing namespace std;const int MAX_NODE=444;const int SIGMA_SIZE=62;struct ACAutomation{ int sz; int fail[MAX_NODE]; int ch[MAX_NODE][SIGMA_SIZE]; int val[MAX_NODE]; double dp... 阅读全文
posted @ 2013-10-19 10:28 BMan、 阅读(258) 评论(0) 推荐(0) 编辑