随笔分类 -  字符串

摘要:LCS 阅读全文
posted @ 2020-11-03 20:39 GhostCai 阅读(89) 评论(0) 推荐(0) 编辑
摘要:Trie树,DFS遍历 阅读全文
posted @ 2018-10-30 19:49 GhostCai 阅读(126) 评论(0) 推荐(0) 编辑
摘要:字符串 双Hash 阅读全文
posted @ 2018-08-19 21:34 GhostCai 阅读(84) 评论(0) 推荐(0) 编辑
摘要:字符串,DP 阅读全文
posted @ 2018-08-01 10:23 GhostCai 阅读(81) 评论(0) 推荐(0) 编辑
摘要:线性dp 字符串 阅读全文
posted @ 2018-07-04 10:23 GhostCai 阅读(98) 评论(0) 推荐(0) 编辑
摘要:HDU2222#include#include#include#include#define C(x) ((x)-('a'))using namespace std;const int MAXN=500005;int ch[MAXN][26],fail[MAXN],e... 阅读全文
posted @ 2018-06-25 20:48 GhostCai 阅读(123) 评论(1) 推荐(1) 编辑
摘要:POJ2001 求一群字符串的最短能代表该串的前缀,trie裸题#include#include#includeusing namespace std;const int MAXN=1024;const int C_SIZE=32;const int MAXNNODE... 阅读全文
posted @ 2018-06-25 11:00 GhostCai 阅读(74) 评论(0) 推荐(0) 编辑
摘要:Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 1909 Solved: 1251[Submit][Status][Discuss]Description折叠的定义如下: 1. 一个字符串可以看成它自身的折叠。记作S ... 阅读全文
posted @ 2018-06-06 15:23 GhostCai 阅读(114) 评论(0) 推荐(0) 编辑
摘要:fail 失配数组 fail[i]表示以i为结尾的非前缀子串与s的前缀的最大匹配长度 在拼接两字符串后,求fail数组的同时就能求出匹配位置(fail[i]==len_origin的i-2*len_origin) #include<iostream> #include<cstdio> #includ 阅读全文
posted @ 2018-03-14 00:34 GhostCai 阅读(113) 评论(0) 推荐(0) 编辑
摘要:求回文子串的长度,mp[i]保存以i为中心的回文子串的半径(长度一半) 利用mx和id,避免重复暴力求解,达到O(n)的时间复杂度 预先填充一些无关紧要的字符 #include<iostream> #include<cstring> #include<cstdio> using namespace 阅读全文
posted @ 2018-03-14 00:34 GhostCai 阅读(109) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示