Codeforces Round #254 (Div. 2)B. DZY Loves Chemistry
DZY loves chemistry, and he enjoys mixing chemicals. DZY has n chemicals, and 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 o
DZY loves chemistry, and he enjoys mixing chemicals.
DZY has n chemicals, and 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. 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 by2. Otherwise the danger remains as it is.
Find the maximum possible danger after pouring all the chemicals one by one in optimal order.
上一篇: 分享PHP乱码问题的几种解决技巧
下一篇: 怎么不用循环删除
推荐阅读
-
Codeforces Round #254 (Div. 2)B. DZY Loves Chemistry
-
Codeforces Round #254 (Div. 2) A. DZY Loves Chessboard
-
Codeforces Beta Round #4 (Div. 2 Only) B. Before an Exam_html/css_WEB-ITnose
-
Codeforces Round #266 (Div. 2) B. Wonder Room_html/css_WEB-ITnose
-
Codeforces Round #254 (Div. 2)
-
Codeforces Round #435 (Div. 2)-B. Mahmoud and Ehab and the bipartiteness
-
Codeforces Round #553 (Div. 2) B. Dima and a Bad XOR(异或+思维)
-
Codeforces Round #246 (Div. 2) ?B. Football Kit_html/css_WEB-ITnose
-
Codeforces Round #261 (Div. 2)B. Pashmak and Flowers(容易)
-
Codeforces Round #FF (Div. 2) D. DZY Loves Modification 贪心+优先队列_html/css_WEB-ITnose