摘要: Description Given two strings s and t, count the number of tuples (i,j,k) such that 1. 1 ≤ i ≤ j ≤ |s| 2. 1 ≤ k ≤ |t|. 3. j − i + 1 k. 4. The i th cha 阅读全文
posted @ 2020-04-03 15:05 limil 阅读(217) 评论(0) 推荐(0) 编辑
摘要: "Description" 思路 先求出最长的回文的前后缀,然后求每个最长回文区间能不能和前缀或后缀接起来,取接起来后长度最大的那个。 基本就是纯的马拉车算法了。就是要注意边界处理的细节,很容易出问题。我把前后缀的位置处理为开区间,回文区间为闭区间。这样边界相等就可以接起来。详见代码。 阅读全文
posted @ 2020-04-03 14:15 limil 阅读(174) 评论(0) 推荐(0) 编辑