随笔分类 -  字符串-其它

摘要:题意给定两个字符串 A 和 B,求下面四个问题的答案:1.在 A 的子串中,不是 B 的子串的字符串的数量。2.在 A 的子串中,不是 B 的子序列的字符串的数量。3.在 A 的子序列中,不是 B 的子串的字符串的数量。4.在 A 的子序列中,不是 B 的子序列的字符串的数量。其中子串是指本质不同... 阅读全文
posted @ 2015-11-22 18:42 iwtwiioi 阅读(325) 评论(0) 推荐(0)
摘要:题意一个长度为$n(n \le 500000)$的字符串$s$,给$q(q \le 2000000)$个询问,每个询问给一个区间$[l, r]$,求这个区间内最短的循环节。 分析分析以下可以知道:1. 假设循环节长度为$len$,则$s[l, r len]=s[l+len, r]$。2. $len... 阅读全文
posted @ 2015-11-22 13:56 iwtwiioi 阅读(340) 评论(0) 推荐(0)
摘要: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>>... 阅读全文
posted @ 2015-03-27 22:33 iwtwiioi 阅读(420) 评论(0) 推荐(0)
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1014题意:支持插入一个字符、修改一个字符,查询lcp。(总长度#include #include #include #include #include #include #include #inclu... 阅读全文
posted @ 2014-12-10 19:07 iwtwiioi 阅读(443) 评论(3) 推荐(0)
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3297这题拖了很久呢。。。很久以前写了个dfs,,但是tle了。。。。。然后一直想dp想不出来,写出来了又wa了。。然后看到一英文题解,暂时就只会这样了。。其实dp方程很简单。。。。。。f[i]=min... 阅读全文
posted @ 2014-09-25 12:39 iwtwiioi 阅读(223) 评论(1) 推荐(0)