Fun fact: the approach used for problem C described in the editorial has a well known name: Hamming codes. I'm unsure why the authors chose to leave this out. Anyway, there's also an awesome 3b1b video that describes the exact algorithm needed to solve this. Here's my code for reference.
Fun fact: the approach used for problem C described in the editorial has a well known name: Hamming codes. I'm unsure why the authors chose to leave this out. Anyway, there's also an awesome 3b1b video that describes the exact algorithm needed to solve this. Here's my code for reference.
Also, a very similar idea shows up in this CSES problem, this EGOI problem, and the first suubtask of this CEOI problem.