#P7859. [COCI 2015/2016 #2] GEPPETTO
[COCI 2015/2016 #2] GEPPETTO
Description
Geppetto opened a pizza shop, and he is trying hard to make the best pizza in the whole city.
Geppetto uses kinds of ingredients to make pizza, and there is only one of each kind. The ingredients are numbered from to . Making a pizza is simple: just mix the ingredients and bake them in the oven. However, Geppetto found that there are pairs of ingredients that conflict. If a pair of conflicting ingredients is mixed in the same pizza, the pizza will become very bad. This causes him extra trouble.
Geppetto wants to know the maximum number of different pizzas he can make. If one pizza contains the ingredient numbered while another pizza does not, then these two pizzas are different.
Input Format
The first line contains two integers , representing the total number of ingredients and the number of conflicts.
The next lines each contain two integers , representing the numbers of the two ingredients in a conflicting pair.
Output Format
Print one integer: the maximum number of different pizzas Geppetto can make.
3 2
1 2
2 3
5
3 0
8
3 3
1 2
1 3
2 3
4
Hint
[Sample 1 Explanation]
Geppetto can make the following 4 kinds of pizzas:
1
2
3
1 3
However, since Geppetto can also choose to use no ingredients, he can make at most 5 kinds of pizzas.
[Sample 2 Explanation]
There are no ingredient conflicts, so in total he can make kinds of pizzas.
[Sample 3 Explanation]
Since all ingredients conflict with each other, Geppetto can only use one ingredient or no ingredients, so in total he can make kinds of pizzas.
[Constraints]
For of the testdata, , and it is guaranteed that .
[Notes]
The scoring of testdata follows the original problem, with a full score of 80.
Translated from COCI 2015-2016 CONTEST #2 T2 GEPPETTO.
Translated by ChatGPT 5
京公网安备 11011102002149号