An Interactive Problem
Time limit2sMemory limit1024 MB
Find the largest value in a hidden n by n grid of distinct numbers by querying cells by coordinate, within n^2 + 100 queries, with n unknown up to 100.
- Level
Medium4 of 10
- Topics
- Matrix, Implementation
- Solved
- No attempts yet
문제
The jury is in trouble. NWERC is tomorrow, and the problem set still needs a good interactive problem. All jury members have an idea, and after hours of arguing they cannot decide which idea is the nicest. They decide to draw lots.
Each jury member draws a lot from a collection of unique numbers. The lots lie face-down on a table, arranged in the shape of a square. You are the independent lot-drawer. You cannot see the table, so you pick lots by shouting coordinates. The jury is in a hurry, so you must find the lot with the highest number in at most commands. You do not know the size of the square in advance, but you know .