网站首页
编程语言
数据库
系统相关
其他分享
编程问答
bad3
2024-07-15
G. Anya and the Mysterious String
原题链接题解对于区间全部元素\(+x\)等价于对差分数组的\(d[l]+=x\),\(d[r+1]-=x\)也就是只修改了两个点如果存在回文串,要么是\(s[i]==s[i-1]\)要么是\(s[i]==s[i-2]\),所以我们可以用\(set\)维护23回文串的右端点code#include<bits/stdc++.h>#definelllonglon