Editorial for April Fools' Day Contest 1 P8 - NP-Hard
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Realize that the encryption is not strong since the most significant bit (MSB) differs with Y
and N
queries.
Consider the first query:
If the answer to the first query is Y
, then the MSB will be the
If the answer to the first query is N
, then the MSB will be the
This logic can be extended for all queries except the last since the encryption is unknown for the last query.
However, since there are only
Time Complexity:
Comments