随笔分类 - 字符串-其它
摘要:题意给定两个字符串 A 和 B,求下面四个问题的答案:1.在 A 的子串中,不是 B 的子串的字符串的数量。2.在 A 的子串中,不是 B 的子序列的字符串的数量。3.在 A 的子序列中,不是 B 的子串的字符串的数量。4.在 A 的子序列中,不是 B 的子序列的字符串的数量。其中子串是指本质不同...
阅读全文
摘要:题意一个长度为n(n≤500000)的字符串s,给q(q≤2000000)个询问,每个询问给一个区间[l,r],求这个区间内最短的循环节。 分析分析以下可以知道:1. 假设循环节长度为len,则s[l,rlen]=s[l+len,r]。2. $len...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3916#include using namespace std;int n, ans[3]; char s[2000005];void work(int now) { int l=1, r=n-(n>>...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1014题意:支持插入一个字符、修改一个字符,查询lcp。(总长度#include #include #include #include #include #include #include #inclu...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3297这题拖了很久呢。。。很久以前写了个dfs,,但是tle了。。。。。然后一直想dp想不出来,写出来了又wa了。。然后看到一英文题解,暂时就只会这样了。。其实dp方程很简单。。。。。。f[i]=min...
阅读全文