将多边形转化为如下的环: 1到2的边,角2,2到3的边,角3,...,n-1到n的边,角n,n到1的边,角1 然后枚举对称轴,如果i是对称轴,那么[i-n,i+n]是一个回文串 用Manacher算法实现即可. 时间复杂度$O(n)$. #include<cstdio> #define N 100010 typedef long long ll; int T,n,i,r,p,f[N<<2],ans; struct P{ int x,y; P(){x=y=0;} P(int _x,i…
HDU 1029 Ignatius and the Princess IV (思维题,排序?) Description "OK, you are not too bad, em... But you can never pass the next test." feng5166 says. "I will tell you an odd number N, and then N integers. There will be a special integer among t…