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

Правка en1, от 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.

Теги need help, proof, binary search

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Neev4321 2025-05-13 15:35:22 1685 Initial revision (published)