摘要: "BZOJ 3230" 相似子串 题面 题解 首先我们要知道询问的两个子串的位置。 先正常跑一遍后缀数组并求出height数组。 对于每一个后缀suffix(i),考虑以i开头的子串有多少是之前没有出现过的,也就是考虑左端点在i、右端点在什么范围内时这个子串没有出现过——答案是右端点在[i + he 阅读全文
posted @ 2017-12-16 13:57 胡小兔 阅读(269) 评论(0) 推荐(0) 编辑
摘要: "BZOJ 1031" [JSOI2007]字符加密Cipher | 后缀数组模板题 将字符串复制一遍接在原串后面,然后后缀排序即可。 c++ include include include include define space putchar(' ') define enter putchar 阅读全文
posted @ 2017-12-16 08:46 胡小兔 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://uoj.ac/problem/35 c++ include include include include define enter putchar('\n') define space putchar(' ') using namespace std; typedef lo 阅读全文
posted @ 2017-12-16 07:41 胡小兔 阅读(491) 评论(0) 推荐(1) 编辑