![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构-- KMP
devhg_
主c/Java、Golang 副前端 业余python
展开
-
KMP判断 串2在串1中出现的次数
例题学骚话Time Limit: 1000 ms Memory Limit: 65536 KiBSubmit StatisticProblem Description众所周知,青春期猪头少年梓川咲太骚话连篇。这可让众多网友羡慕不已,于是观众们纷纷尊称其为师傅,更有甚者已经开始模仿师傅学习了。现在给你两行字符,第一行是师傅梓川咲太的正宗骚话,第二行是某位**网友的模仿。...原创 2018-12-25 11:53:57 · 259 阅读 · 0 评论 -
SDUTOJ2475 Period & 2476 Power Strings
通过前缀表 求母串的子串的周期循环次数 例题:SDUTOJ2476Periodhttps://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Contest/contestproblem/cid/2710/pid/2476AC代码:#include <bits/stdc++.h>using namespace std;#...原创 2018-12-12 23:18:00 · 247 阅读 · 0 评论 -
KMP学习
KMP: 用于在目标串中查找模式串。 如果目标串中有多个模式串,输出的位置是第一个位置。 1.取得next[]数组的方法: 注意:在SDUT中next[] 数组不能起名为next,否则 Compile Error;#include <bits/stdc++.h>using namespace std;int nextt[1000005];void get_next(...原创 2018-12-08 21:54:42 · 154 阅读 · 0 评论