Canadian Computing Olympiad: 2018 Day 2, Problem 1
Troy wants to play the following game with you.
He has a grid with
There are
Your goal is to find the minimum score of any cell in the grid. Unfortunately, Troy does not tell you how many tokens there are or where they are placed. However, you may ask him questions. You can ask Troy to tell you the score of any cell
Interaction Protocol
This problem is interactive: input will be given based on questions generated by your program.
First, read one line with three integers
After your program has read this line, your program may ask questions.
To ask a question about ? p q
. Then, read one line with one integer
Once your program determines the minimum score is ! Z
. Your program must terminate immediately after printing this line.
The output must be flushed after every line is printed, including the last line. To flush you can use: fflush(stdout)
or cout << endl
in C/C++; System.out.flush()
in Java; flush(output)
in Pascal.
If any printed line is wrongly formatted or you ask more than
For every test case, the grading system will have fixed integer values
For 5 of the 25 available marks,
For an additional 5 of the 25 available marks,
For an additional 5 of the 25 available marks,
For an additional 5 of the 25 available marks,
For the remaining 5 marks,
Sample Interaction 1
Request to grader | Feedback from Grader |
---|---|
| 1 10 90 |
? 1 3 | 9 |
? 1 7 | 11 |
? 1 4 | 8 |
! 8 |
|
Explanation of Output for Sample Input 1
This sample corresponds to tokens at cells
The score of cell
The score of cell
The score of cell
For information, here are the scores in this example:
Column | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|---|
Score | 13 | 10 | 9 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Sample Interaction 2
Request to grader | Feedback from Grader |
---|---|
| 5 4 170 |
? 2 4 | 11 |
? 1 4 | 15 |
? 3 3 | 7 |
! 7 |
|
Explanation of Output for Sample Input 2
This sample corresponds to tokens at cells
Comments
I just found out that this contest has interactive problems.