![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
curry___
这个作者很懒,什么都没留下…
展开
-
AC自动机+模板
AC自动机是一种多模匹配算法, 所谓多模就是就是给你一些单词,再给你一段字符串,问有多少个单词在字符串中出现,而KMP就是单模。 学习AC自动机首先要用到字典树的知识和KMP中求next数组的思想。 一般来说有三个步骤 第一、构建一颗字典树 没有学过字典树的可以先去看看,这里没有用二维数组模拟,用的指针,因为有一个fail指针,下面会提到它的用法。 void insert(char ...原创 2018-10-25 19:53:13 · 456 阅读 · 0 评论 -
hdu 6153 A secret(拓展KMP)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6153 Problem Description Today is the birthday of SF,so VS gives two strings S1,S2 to SF as a present,which have a big secret.SF is interested in this ...原创 2018-10-23 18:11:08 · 96 阅读 · 0 评论 -
训练赛20190304
D - Balanced Lineup For the daily milking, Farmer John'sNcows (1 ≤N≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the ...原创 2019-03-05 19:31:47 · 203 阅读 · 0 评论