QOJ.ac

QOJ

时间限制: 1 s 内存限制: 64 MB 总分: 80

#13757. GEPPETTO

统计

大家最喜欢的角色和木偶制造者 Geppetto 开了一家新的比萨店,这是镇上最好的比萨店。Geppetto 正在努力制作出最好的比萨,但与此同时,他也不希望比萨的选择太少。

他用编号为 $1$ 到 $N$ 的 $N$ 种原料来制作比萨。如果他可以将任何原料与比萨上的每种原料混合,那一切都会很简单,但遗憾的是,事实并非如此。有时某些原料不能混合在一起,这给我们的比萨大师带来了额外的麻烦。

有 $M$ 对原料不能同时出现在同一个比萨上。在这些限制条件下,Geppetto 想知道他可以制作多少种不同的比萨。请帮助他回答这个问题。如果存在一种编号为 $i$ 的原料在其中一个比萨上而不在另一个比萨上,则认为这两个比萨是不同的。

输入格式

输入的第一行包含两个整数 $N$ 和 $M$($1 \le N \le 20$,$1 \le M \le 400$)。

接下来的 $M$ 行,每行包含两个不同的数字 $a$ 和 $b$,表示不能在比萨上同时混合编号为 $a$ 和 $b$ 的原料($1 \le a, b \le N$)。所有的原料对不一定两两不同,某些原料对可能会出现多次。

输出格式

输出的唯一一行应包含在任务限制下可以制作的不同比萨的数量。

样例

输入样例 1

3 2
1 2
2 3

输出样例 1

5

输入样例 2

3 0

输出样例 2

8

输入样例 3

3 3
1 2
1 3
2 3

输出样例 3

4

说明

第一个样例的说明:Geppetto 可以制作由以下原料组成的比萨:$\emptyset$、$\{1\}$、$\{1, 3\}$、$\{3\}$、$\{2\}$。注意,比萨可以不包含任何原料。

第二个样例的说明:Geppetto 可以使用原料的任意组合来制作比萨。

第三个样例的说明:Geppetto 可以制作不包含任何原料,或者仅包含一种原料的比萨。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.