
KMP
一步一步地往上爬
沉心静气,默默努力
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
KMP模板
next数组表示该位置最长前缀后缀 #include <iostream> #include <math.h> #include <stdlib.h> #include <cstring> #include <stdio.h> #include <queue> #include <algorithm> #inc...原创 2020-01-27 18:14:40 · 167 阅读 · 0 评论 -
洛谷 P3375
有两种设置f数组的方式 一种是 f[i] 代表i之前的字符串的最长相同前缀后缀长度,f[0]初始化为-1 一种是 f[i] 代表1~i+1的字符串的最长相同前缀后缀长度,f[0]初始化为0 不错的KMP算法博客:https://blog.youkuaiyun.com/f1033774377/article/details/82556438 注意这道题要求输出第二种 初始化为0 #i...原创 2019-11-21 21:37:20 · 340 阅读 · 0 评论