摘要: 题单 https://www.luogu.com.cn/training/282126#problems P3372 线段树1 区间加,区间和 #include <bits/stdc++.h> using namespace std; typedef long long ll; int read() 阅读全文
posted @ 2023-02-15 07:57 ROOTae 阅读(24) 评论(0) 推荐(0)
摘要: 求字符串s的最长回文子串t。只考虑长度为奇数的回文串。 对于每个位置i,计算最大的r[i],表示s[i-r[i]]~s[i+r[i]]能构成回文串。 f(i)=i+r[i]表示以i为中心的字符串的右边界。 如何计算r[i],可以暴力扩展,也可以利用以下性质。 1~i-1,f(c)最大。如果f(c)> 阅读全文
posted @ 2018-10-18 18:55 ROOTae 阅读(87) 评论(0) 推荐(0)