题意翻译
DZY热爱化学.他有n种物质,其中m对会反应.他把它们一种一种倒到烧杯里.有一个危险值,一开始等于1.如果一种物质倒到烧杯里之后至少有一种物质能和它反应,则危险值乘以二;否则危险值不变.求所有物质倒到烧杯里之后最大的危险值.
By @Fuko_Ibuki
题目描述
DZY loves chemistry, and he enjoys mixing chemicals.
DZY has n n n chemicals, and m m m pairs of them will react. He wants to pour these chemicals into a test tube, and he needs to pour them in one by one, in any order.
Let's consider the danger of a test tube. Danger of an empty test tube is 1 1 1 . And every time when DZY pours a chemical, if there are already one or more chemicals in the test tube that can react with it, the danger of the test tube will be multiplied by 2 2 2 . Otherwise the danger remains as it is.
Find the maximum possible danger after pouring all the chemicals one by one in optimal order.
输入输出格式
输入格式:
The first line contains two space-separated integers n n n and m m m