CF445B DZY Loves Chemistry

题意翻译DZY热爱化学.他有n种物质,其中m对会反应.他把它们一种一种倒到烧杯里.有一个危险值,一开始等于1.如果一种物质倒到烧杯里之后至少有一种物质能和它反应,则危险值乘以二;否则危险值不变.求所有物质倒到烧杯里之后最大的危险值.By @Fuko_Ibuki题目描述DZY loves chemistry, and he enjoys mixing chemicals.DZY ...
摘要由CSDN通过智能技术生成

题意翻译

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值