Need proof of a solution for IOI 2020 practice problem: Finding Routers

Revision en1, by Neev4321, 2025-05-13 15:35:22

I was solving the problem Finding Routers in the practice session of APIO 2025. I intuited (guessed) the following solution.

code

It gives the full 100 points but I have no proof of its correctness. It has an obvious $$$n\log_2{l}$$$ upper bound on the number of use_detector calls. This accounts for the first 3 subtasks. I think this bound can be further improved to $$$2n\log_2(\frac{l}{2n})$$$. However, none of these bounds explain why it can solve subtask 4 within $$$7500$$$ queries.

I found this blog post but the commentor also had no proof of his solution. I also found this solution which caches the queries. I think (not sure) it asks the same queries as my solution. It might be easier to reason about.

Tags need help, proof, binary search

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Neev4321 2025-05-13 15:35:22 1685 Initial revision (published)