摘要: 本文共三道题目,都是 $ AC $ 自动机的模板题 初学AC自动机,AC自动机可以理解为“Trie树上KMP”(所以要先学会Trie树和KMP哦!) "1.Luogu P3808 【模板】AC自动机(简单版)" Code "2.Luogu P3796 【模板】AC自动机(加强版)" Code cpp 阅读全文
posted @ 2019-09-07 11:03 Hawking_llfz 阅读(141) 评论(0) 推荐(0) 编辑
摘要: "Luogu P3375 【模板】KMP字符串匹配" Code cpp include include include include include define LL long long using namespace std; const int N=1000005; int n,m,p[N] 阅读全文
posted @ 2019-09-06 16:24 Hawking_llfz 阅读(150) 评论(0) 推荐(0) 编辑
摘要: "Luogu P1470 最长前缀 Longest Prefix" 注释 这道题与 "上一篇博客" 的题几乎一样 解析 + 有点麻烦的地方就是字符串的输入 方法一:类dp Code cpp include include include include include define LL long 阅读全文
posted @ 2019-09-06 15:35 Hawking_llfz 阅读(126) 评论(0) 推荐(0) 编辑
摘要: "Luogu P2292 [HNOI2004]L语言" 解析 + 看到单词和句子匹配,再看数据范围1M的字符串(长度大约 $ 10^6 $ 级别),所以用Trie树来处理 + 句子是没有标点符号的,所以需要我们自己断句,那么我们先将所有单词加入Trie树,然后让句子在树上匹配,匹配时可不可以匹配完一 阅读全文
posted @ 2019-09-06 10:57 Hawking_llfz 阅读(123) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-09-05 20:11 Hawking_llfz 阅读(9) 评论(2) 推荐(1) 编辑
摘要: "Luogu P3805 【模板】manacher算法" 初学 $ Manacher $ (马拉车)算法 Manacher算法用于处理回文串问题,可以求出每个字符所在的最长回文串的长度 Code 阅读全文
posted @ 2019-09-05 19:47 Hawking_llfz 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 本文共三道题目,都算是 $ Trie $ 树的模板题 "1.Libre 10049 Phone List" Code "2.Libre 10050 The XOR Largest Pair" Code cpp include include include include include defin 阅读全文
posted @ 2019-09-05 18:58 Hawking_llfz 阅读(109) 评论(0) 推荐(1) 编辑
摘要: "1.Luogu P1908 逆序对" 归并排序 cpp include include include include include include define LL long long using namespace std; const int N=1e5+5; int n,b[N],c[ 阅读全文
posted @ 2019-09-05 18:17 Hawking_llfz 阅读(137) 评论(2) 推荐(1) 编辑
该文被密码保护。 阅读全文
posted @ 2019-09-05 17:01 Hawking_llfz 阅读(13) 评论(2) 推荐(0) 编辑
摘要: Welcome to my blog!!! 本人是位名副其实的蒟蒻,因为实力太差,博客中难免会出现错误,请各位见谅 阅读全文
posted @ 2019-09-05 16:45 Hawking_llfz 阅读(116) 评论(1) 推荐(0) 编辑