4 ms·
I thought about it for 5 minutes and couldn't find an answer (I found several, but they were all half-answers). I looked at the answer below, and it turned out
by pooriaazimi 15y ago
I thought about it for 5 minutes and couldn't find an answer (I found several, but they were all half-answers). I looked at the answer below, and it turned out that you'd missed an important part: The prisoners don't die immediately after drinking from a poisoned barrel... They die after 30 days (in other words, they can drink from several barrels, and if any of those barrels were poisoned, they'd die).
But thanks anyway.
- web_chops 15y agoYa, that's correct :) It doesn't make much sense otherwise I guess...
- samlittlewood 15y agoOr your allow a cocktail to be made from the contents of several barrels.
- sbov 15y agoYou also need to specify that you need to know by 30 days. Without both restrictions a simple binary search works.
- deleted 15y ago[deleted]
- deleted 15y ago[deleted]