摘要:
题目链接:https://www.luogu.com.cn/problem/P4052 套路题,利用 \(fail\) 指针转移 \(dp\) 首先是正难则反,计算不包含可读单词的方案数 设 \(dp[i][j]\) 表示长度为 \(i\) 的文本,当前在 \(j\) 节点,不经过单词节点的方案数 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3065 多测 卡内存 #include<iostream> #include<algorithm> #include<cstring> #include<cstdio> #include<cmath> # 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2896 注意字符集大小。。 #include<iostream> #include<algorithm> #include<cstring> #include<cstdio> #include<cmath 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2222 AC自动机板子题 #include<iostream> #include<algorithm> #include<cstring> #include<cstdio> #include<cmath> 阅读全文
摘要:
题目链接: ac自动机的精华在于 \(fail\) 指针, 为了避免暴力跳 \(fail\) 指针使得复杂度爆炸,建出 \(fail\) 图就好了 P3808 https://www.luogu.com.cn/problem/P3808 #include<iostream> #include<alg 阅读全文