//Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and 
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
// same ids are connected.
// prefix 的格式要求是 acm-[一级标题编号].[二级标题编号][该代码片段的英文简称]
// description 的格式要求是 "插入 [该代码片段的中文名]"

{
    "manacher": {
        "prefix": "acm-6.2标准700ms",
        "body": [
            "// luogu-judger-enable-o2",
            "#include<algorithm>",
            "#include<cstdio>",
            "using namespace std;",
            "const int N=22000003;",
            "char a[N]={'$','|'},c=getchar();int r[N],mid,ans,R,n=1,i;",
            "int main(){",
            "    while(c>='a'&&c<='z')a[++n]=c,a[++n]='|',c=getchar();",
            "    for(i=1;i<=n;i++){",
            "        if(i<=R)r[i]=min(r[(mid<<1)-i],R-i+1);",
            "        else r[i]=1;",
            "        while(a[i-r[i]]==a[i+r[i]])r[i]++;",
            "        if(i+r[i]-1>R)mid=i,R=i+r[i]-1;",
            "        ans=max(ans,r[i]-1);",
            "    }",
            "    printf(\"%d\",ans);",
            "}",
            ""
        ],
        "description": "插入 manacher"
    }
}