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

{
    "筛质数": {
        "prefix": "acm-7.1线筛",
        "body": [
            "#include<cstdio>",
            "#include<ctime>",
            "const int N=1e6;",
            "int cnt,i,j,pri[N/3];bool pan[N+1];",
            "inline void get_pri(){",
            "\tpan[0]=pan[1]=1;",
            "\tfor(i=2;i<=N;++i){",
            "\t\tif(!pan[i])pri[++cnt]=i;",
            "\t\tfor(j=1;j<=cnt&&i*pri[j]<=N;++j){",
            "\t\t\tpan[i*pri[j]]=1;",
            "\t\t\tif(i%pri[j]==0)break;",
            "\t\t}",
            "\t}",
            "}",
            "int main(){",
            "\tget_pri();",
            "\tfor(j=0,i=1;i<=cnt;++i)printf(\"%d \",pri[i]);",
            "}"
        ],
        "description": "插入 筛质数"
    }
}