QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 1024 MB مجموع النقاط: 100 تفاعلية قابلة للهجوم ✓

#17933. Chocolate Treasure Hunt

الإحصائيات

Coco, who decided to go to the beach with Hanbyeol, arrived early to prepare a treasure hunt game. First, she drew a $10 \times 10$ grid on the sand, then chose two horizontally or vertically adjacent cells out of the $100$ cells and buried a $2 \times 1$ treasure chest there.

After finishing the preparations, Coco made a proposal to Hanbyeol: "If you can figure out the exact location of the treasure chest by digging at most $50$ cells, I will give you all the chocolates inside the treasure chest. You don't need to dig up both cells where the treasure chest is located; you just need to correctly identify the coordinates of the two cells." Will Hanbyeol be able to get the chocolates from the treasure chest?

Interaction

You can make a query to the interactor by printing the following on a single line:

  • ? r c : Dig at row r and column c. Row and column indices start from $0$, so the valid range is $0 \le r, c \le 9$. If you provide values outside this range, you will receive a "Wrong Answer".

The result of each query is given as a single character. The possible results are:

  • 1 : There is a part of the treasure chest at row r, column c.
  • 0 : There is no part of the treasure chest at row r, column c.

After printing a query, you must flush the standard output buffer. If the number of queries exceeds $50$, you will receive a "Wrong Answer".

Once you have determined the location of the treasure chest, you must print the following, flush the output, and terminate the program:

  • ! r1 c1 r2 c2 : The treasure chest spans across row r1, column c1 and row r2, column c2. The order of the coordinates does not matter.

The interactor may be adaptive.

Examples

Input 1

0 0 0 1

Output 1

		

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.