Problem1212--graph's connected components

1212: graph's connected components

Time Limit: 2 Sec  Memory Limit: 128 MB
Submit: 363  Solved: 89
[Submit] [Status] [Web Board] [Creator:]

Description

Given an integers set of m integers,each integer is in the range [0, 2n-1].
A graph is build on the following constraints: if integers X and Y satisfy X&Y=0 (& is bitwise AND operation),X and Y are connected by an undirected edge.Please help PIPI count the number of connected components in the graph!

Input

Input contains multiple test cases.
Each test case starts with a number n(0 <= n <= 22) and m(1<=m<=2n) .
The next line contains m different integers: a1,a2...am ,each integer 0<=ai <2n.

Output

For each case,print connected components for each group of input data.

Sample Input

2 3
1 2 3
5 5
5 19 10 20 12
5 6
5 19 10 20 12 0

Sample Output

2
2
1