N<=500000显然wwRwwR 本身就是偶数回文串 设它为(x−2l+1,x−l),(x−l+1,x),(x+1,y),(x+l+1,x+2l) 枚举这个回文串的中点x,找最大的y使y−py≤x且x≤y≤x+px/2第一个条件可以用插入set时的顺序维护,第二个lower_bound即可#include<bits/stdc++.h>using namespace std;
4975 - Casting Spells Time limit: 3.000 seconds
裸manacher我竟然写跪了…………一个地方(偶数)没写清楚……我OOXOXOXOXXOXO#include#include#include#include#include#include#include#include#include#includeusing namespace std;#define For(i,n) for(int i=1;i<=n;
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号