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

{
    "Mobius函数": {
        "prefix": "acm-7.1埃氏筛",
        "body": [
            "#pragma GCC optimize(3,\"Ofast\",\"inline\")",
            "#pragma GCC optimize(2)",
            "#include<cstdio>",
            "const int N=1e7+3;",
            "int i,j,n,cnt,pan[N],miu[N];",
            "inline void get_miu(){",
            "\tfor(i=1;i<=n;++i)miu[i]=1;",
            "\tfor(i=2;i<=n;++i)",
            "\t\tif(!pan[i]){",
            "\t\t\tmiu[i]=-1;",
            "\t\t\tfor(j=i<<1;j<=n;j+=i)pan[j]=1,miu[j]*=(j/i%i==0)?0:-1;",
            "\t\t}",
            "}",
            "int main(){",
            "\tn=N;",
            "\tget_miu();",
            "\tfor(i=1;i<=n;++i)printf(\"%d: %d\\n\",i,miu[i]);",
            "}",
            ""
        ],
        "description": "插入 Mobius函数"
    }
}