Universal Cup Judging System

Universal Cup

حد الوقت: 1 s حد الذاكرة: 2048 MB مجموع النقاط: 100 الصعوبة: [عرض] تفاعلية قابلة للهجوم ✓
الإحصائيات

这是一道交互题。

小青鱼有一个秘密整数 $a$($1 \le a \le 100$)。你需要找出这个整数。

在一次询问中,你选择一个整数 $x$。小青鱼会告诉你 $x$ 是否等于他的秘密整数。请在最多 $100$ 次询问内找出这个秘密整数。

交互

若要发起一次询问,请按以下格式输出一行:“$?\ x$”,其中 $x$ 是一个整数($1 \le x \le 100$)。作为对该询问的回应,你将得到单个单词 yes 或 no,分别表示 $x = a$ 或 $x \ne a$。你必须确保你发起的询问次数不超过 $100$。

若要报告答案,请按以下格式输出一行:“$!\ x$”,其中 $x$ 是秘密整数。报告答案不计入询问次数。收到 yes 并不会结束交互:你仍然必须报告答案。你的程序必须在报告答案后立即终止。在输出询问或报告答案后,请不要忘记输出换行符并刷新输出流。

在本题中,交互器不是自适应的。秘密整数在交互开始前就已经固定,且不会在交互过程中改变。

样例

输入格式 1

no

no

yes

输出格式 1

? 1

? 2

? 3

! 3

说明

在第一个样例中,秘密整数为 $3$。$x = 1$ 和 $x = 2$ 的询问收到 no,而 $x = 3$ 的询问收到 yes。随后程序报告 ! 3。

在第二个样例中,秘密整数为 $1$。第一次询问收到 yes,随后程序报告 ! 1。

测试工具: 本题提供了一个测试工具,以帮助选手开发和测试自己的解答。你可以从附件中下载该工具。使用 -h 选项运行该工具可以查看其使用方法说明。该工具会检查交互过程与所报告的答案,但不会强制执行时间或内存限制。

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.