字符串
文章平均质量分 79
ToheartZhang
这个作者很懒,什么都没留下…
展开
-
3375 KMP字符串匹配
http://blog.csdn.net/qq_30974369/article/details/74276186#include<bits/stdc++.h> using namespace std; const int maxc = 1000010; char a[maxc], b[10010]; int fail[10010];//勿用next!!!那是保留字。fail[i]表示1-i这个子串原创 2017-08-07 10:25:12 · 225 阅读 · 0 评论 -
[字符串专项] Manacher算法
Manacher算法 算法过程分析 参考资料 https://subetter.com/algorithm/manacher-algorithm.html 由于回文分为偶回文(比如 bccb)和奇回文(比如 bcacb),而在处理奇偶问题上会比较繁琐,所以这里我们使用一个技巧,具体做法是:在字符串首尾,及各字符间各插入一个字符(前提这个字符未出现在串里)。举个例子:s=“abbahopxpo”,...原创 2019-03-29 22:22:59 · 141 阅读 · 0 评论 -
[字符串专项] 基本IO及函数
基础IO cin & scanf 读入以’\n’或’ '作为分割符. getline getline(cin, str); 具体情境 读入带空格字符串用gets(). 读入不带空格字符串用scanf, cin. C语言字符串处理函数 strchr 字符查找 原型 char * strrchr ( char * str, int character); 在str中查...原创 2019-03-27 19:30:28 · 182 阅读 · 0 评论 -
[字符串专项] 字符串Hash
单哈希 洛谷 3370 #include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; typedef unsigned long long ULL; const int MAXM = 1511; const int...原创 2019-03-27 20:29:40 · 167 阅读 · 0 评论