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

{
    "割点 tanjan": {
        "prefix": "acm-3.3min",
        "body": [
            "#include<algorithm>",
            "#include<cstring>",
            "#include<cstdio>",
            "#define Re register int",
            "const int N=2e4+3,M=2e5+3;",
            "int n,m,x,y,ans,cut[N];",
            "inline void in(Re &x){",
            "    int f=0;x=0;char c=getchar();",
            "    while(c<'0'||c>'9')f|=c=='-',c=getchar();",
            "    while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=getchar();",
            "    x=f?-x:x;",
            "}",
            "struct Cut_Point{",
            "\tint o,dfn_o,low[N],dfn[N],head[N];",
            "\tstruct QAQ{int to,next;}a[M];",
            "\tinline int min(Re a,Re b){return a<b?a:b;}",
            "\tinline void add(Re x,Re y){a[++o].to=y,a[o].next=head[x],head[x]=o;}",
            "\tinline void tarjan(Re x,Re root){",
            "\t\tRe son=0;dfn[x]=low[x]=++dfn_o;",
            "\t\tfor(Re i=head[x],to;i;i=a[i].next)",
            "\t\t\tif(!dfn[to=a[i].to]){",
            "\t\t\t\ttarjan(to,root),++son;",
            "\t\t\t\tlow[x]=min(low[x],low[to]);",
            "\t\t\t\tcut[x]|=(x!=root&&low[to]>=dfn[x]);",
            "\t\t\t}",
            "\t\t\telse low[x]=min(low[x],dfn[to]);",
            "\t\tcut[x]|=(x==root&&son>1),ans+=cut[x];",
            "\t}",
            "\tinline void cut_point(){",
            "\t\tfor(Re i=1;i<=n;++i)if(!dfn[i])tarjan(i,i);",
            "\t}",
            "}T1;",
            "int main(){",
            "\tin(n),in(m);",
            "\twhile(m--)in(x),in(y),T1.add(x,y),T1.add(y,x);",
            "\tT1.cut_point();",
            "\tprintf(\"%d\\n\",ans);",
            "\tfor(Re i=1;i<=n;++i)if(cut[i])printf(\"%d \",i);",
            "}"
        ],
        "description": "插入 割点 tanjan"
    }
}