CF986C.AND Graph

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given a set of size mm with integer elements between 00 and 2n12^{n}-1 inclusive. Let's build an undirected graph on these integers in the following way: connect two integers xx and yy with an edge if and only if x&y=0x \& 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 nn and mm ( 0n220 \le n \le 22 , 1m2n1 \le m \le 2^{n} ).

In the second line there are mm integers a1,a2,,ama_1, a_2, \ldots, a_m ( 0ai<2n0 \le a_{i} < 2^{n} ) — the elements of the set. All aia_{i} 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:

首页