CF986C.AND Graph
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given a set of size m with integer elements between 0 and 2n−1 inclusive. Let's build an undirected graph on these integers in the following way: connect two integers x and y with an edge if and only if x&y=0 . Here & is the bitwise AND operation. Count the number of connected components in that graph.
输入格式
In the first line of input there are two integers n and m ( 0≤n≤22 , 1≤m≤2n ).
In the second line there are m integers a1,a2,…,am ( 0≤ai<2n ) — the elements of the set. All ai are distinct.
输出格式
Print the number of connected components.
输入输出样例
输入#1
2 3 1 2 3
输出#1
2
输入#2
5 5 5 19 10 20 12
输出#2
2
说明/提示
Graph from first sample:
Graph from second sample: