//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.5insert",
        "body": [
            "#include<algorithm>",
            "#include<cstdio>",
            "#define LL long long",
            "#define Re register LL",
            "using namespace std;",
            "const int N=55;",
            "LL n,x,ans,p[N];",
            "inline void in(Re &x){",
            "\tRe fu=0;x=0;char ch=getchar();",
            "\twhile(ch<'0'||ch>'9')fu|=ch=='-',ch=getchar();",
            "\twhile(ch>='0'&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();",
            "\tx=fu?-x:x;",
            "}",
            "inline void insert(Re x){",
            "\tfor(Re i=50;i>=0;--i)",
            "\t\tif((x>>i)&1){",
            "\t\t\tif(!p[i]){p[i]=x;break;}",
            "\t\t\tx^=p[i];",
            "\t\t}",
            "}",
            "int main(){",
            "//\tfreopen(\"123.txt\",\"r\",stdin);",
            "\tin(n);",
            "\tfor(Re i=1;i<=n;++i)in(x),insert(x);",
            "\tfor(Re i=50;i>=0;--i)ans=max(ans,ans^p[i]);",
            "\tprintf(\"%lld\\n\",ans);",
            "}",
            ""
        ],
        "description": "插入 线性基"
    }
}