leetcode icon indicating copy to clipboard operation
leetcode copied to clipboard

【每日一题】- 2019-09-12 - 药不能停

Open azl397985856 opened this issue 5 years ago • 12 comments

某种药方要求非常严格,你每天需要同时服用A、B两种药片各一颗,不能多也不能少。这种药非常贵,你不希望有任何一点的浪费。一天,你打开装药片A的药瓶,倒出一粒药片放在手心;然后打开另一个药瓶,但不小心倒出了两粒药片。现在,你手心上有一颗药片A,两颗药片B,并且你无法区别哪个是A,哪个是B。你如何才能严格遵循药方服用药片,并且不能有任何的浪费?

提示:药片可以破坏,比如二等分,三等分。。。

azl397985856 avatar Sep 12 '19 01:09 azl397985856

再倒出一片A在0点服下4颗药? 跑了 跑了。。

scv057 avatar Sep 12 '19 03:09 scv057

在不破坏药片、或借助量器的情况下,无解

JumpJumpSparrow avatar Sep 12 '19 03:09 JumpJumpSparrow

在不破坏药片、或借助量器的情况下,无解

那如果可以破坏呢

azl397985856 avatar Sep 12 '19 04:09 azl397985856

在从药瓶里倒出1粒药片A,现在有4片药,把每片药都切一半,然后只吃每片药的一半,剩下的4分半片药第二天吃

Hots-J avatar Sep 12 '19 04:09 Hots-J

哈哈,可以拿出一个A在弄成粉末,分成2次就可以了

Gemiry avatar Sep 20 '19 01:09 Gemiry

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 19 '19 02:11 stale[bot]

I'm assuming that pills A and B taste differently. So take half of each, that way you will know which tastes different, and then u can half the other half from differently tasting pill. Thus you will have exact amount of dose.

chaheti89 avatar Jul 25 '23 05:07 chaheti89

这是来自QQ邮箱的自动回复邮件。您好,邮件已收到,我将会尽快给您回复。

cherie-wuyajun avatar Jul 25 '23 05:07 cherie-wuyajun

我已经收到了,会尽快查看的,谢谢

xiaosisong avatar Jul 25 '23 05:07 xiaosisong

您好,您的来信已收到,我会尽快给您回复的!

lording avatar Jul 26 '23 05:07 lording

I'm assuming that pills A and B taste differently. So take half of each, that way you will know which tastes different, and then u can half the other half from differently tasting pill. Thus you will have exact amount of dose.

pill A and pill B may have same taste. I will post my anwser below in both English and Chinese

azl397985856 avatar Jul 26 '23 05:07 azl397985856

我们可以将手中的三个药片均进行二等分,然后将其中一半放到左面,另一半放到右面。这样下来,左面和右面分别有半个A和一个B。接下来,我们再从A中拿出一片药,同样进行等分操作,即进行二等分,然后将其中一半放到左面,另一半放到右面。

这样左右两面都有一个A和一个B,吃其中一组,第二天吃剩下的一组即可。

We can divide the three pills in our hand into two parts, and then put half of them on the left side and the other half on the right side. In this way, there are half A and one B on the left and right respectively. Next, we take out a piece of pill from A, and perform the same division operation, that is, divide it into two equal parts, and then put half of it on the left side and the other half on the right side.

In this way, there is an A and a B on the left and right sides, eat one of them, and eat the rest the next day.

azl397985856 avatar Jul 26 '23 05:07 azl397985856