//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 的格式要求是 "插入 [该代码片段的中文名]"

{
    "卡特兰数Catalan": {
        "prefix": "acm-7.2质因数分解 高精度",
        "body": [
            "#include<cstdio>",
            "#define R register int",
            "int n,t,x,len,ans[100000],pan[120005];",
            "void cf(int x){",
            "    R i,j;",
            "    for(i=1;i<=len;i++)ans[i]*=x;",
            "    len+=6;",
            "    for(i=1;i<=len;i++)ans[i+1]+=ans[i]/10,ans[i]%=10;",
            "    while(!ans[len])len--;",
            "}",
            "int main(){",
            "    scanf(\"%d\",&n);R i,j;len=ans[1]=1;",
            "    for(i=2;i<=2*n;i++)",
            "        if(pan[i]==0){",
            "            x=i;t=0;",
            "            while(x<=2*n){t+=2*n/x-n/x-(n+1)/x;x*=i;}",
            "            while(t--)cf(i);",
            "            for(j=i;j<=2*n/i;j++)pan[i*j]=1;",
            "        }",
            "    for(i=len;i>=1;i--)printf(\"%d\",ans[i]);",
            "}",
            ""
        ],
        "description": "插入 卡特兰数Catalan"
    }
}