Editorial for Back To School '19: Chemistry
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Subtask 1
For the first subtask, we can encode each beaker with a unique binary number from to . For the bit, we can easily determine if the encoding of the hydrogen cyanide beaker is a or a by pouring all of the beakers that have a in the bit into the cup. If the substance changes colours, then we know that the bit of the hydrogen cyanide beaker is also a . Otherwise, it is a . If we repeat this for each bit, then we can determine the full binary encoding of the hydrogen cyanide beaker. Determining the formula for the number of bits for beakers is an exercise for the reader.
Time Complexity:
Subtask 2
For the second subtask, we can use the same process as subtask 1, except we have minutes. We want to divide each of the required measurements into minutes while minimizing the maximum number of cups used in any minute. It can be shown that if is the number of cups required for beakers in minute, then the number of cups required for minutes is .
Time Complexity:
Be careful with precision if you decide to use floating point calculations.
Comments