# 【线性基】bzoj2844: albus就是要第一个出场

## HINT

1 <= N <= 10,0000

## 题目分析

 1 #include<bits/stdc++.h>
2 const int maxn = 100035;
3 const int MO = 10086;
4
5 int n,p[103],ans,legal;
6
8 {
9     char ch = getchar();
10     int num = 0, fl = 1;
11     for (; !isdigit(ch); ch = getchar())
12         if (ch=='-') fl = -1;
13     for (; isdigit(ch); ch = getchar())
14         num = (num<<1)+(num<<3)+ch-48;
15     return num*fl;
16 }
17 void insert(int x)
18 {
19     for (int i=30, chk=0; i>=0&&!chk; i--)
20         if (x>>i){
21             if (p[i]) x ^= p[i];
22             else{
23                 p[i] = x, chk = 1, ++legal;
24                 for (int j=30; j>i; j--)
25                     if (p[j]>>i) p[j] ^= p[i];
26             }
27         }
28 }
29 void query(int x)
30 {
31     int i,j;
32     for (i=0, j=0; i<=30; i++)
33         if (p[i]) p[j] = i, ++j;
34     for (i=j-1; i>=0; i--)
35         if ((1<<p[i])&x) ans += (1<<i);
36 }
37 int qmi(int a, int b)
38 {
39     int ret = 1;
40     for (a%=MO; b; b>>=1, a=a*a%MO)
41         if (b&1) ret = ret*a%MO;
42     return ret;
43 }
44 int main()
45 {
47     for (int i=1; i<=n; i++) insert(read());
52 }