Universal Cup Judging System

Universal Cup

Süre Sınırı: 1 s Bellek Sınırı: 2048 MB Toplam puan: 100 Zorluk: [göster] Etkileşimli Hack'lenebilir ✓
İstatistikler

これはインタラクティブな問題です。

Little Cyan Fish は秘密の整数 $a$($1 \le a \le 100$)を持っています。あなたはこの整数を特定する必要があります。

1 回の質問では、あなたは整数 $x$ を 1 つ選びます。Little Cyan Fish は $x$ が彼の秘密の整数と等しいかどうかを教えてくれます。高々 $100$ 回の質問で秘密の整数を特定してください。

インタラクション

質問を行うには、「$?\ x$」という形式で 1 行出力してください。ここで $x$ は整数($1 \le x \le 100$)です。質問への返答として、単一の単語 yes または no が与えられます。これらはそれぞれ $x = a$ または $x \ne a$ であることを意味します。質問を行う回数は $100$ を超えないようにしなければなりません。

答えを報告するには、「$!\ x$」という形式で 1 行出力してください。ここで $x$ は秘密の整数です。答えの報告は質問回数には含まれません。yes を受け取ってもやり取りは終了しません。必ず答えを報告する必要があります。答えを報告した後、プログラムは直ちに終了しなければなりません。質問の出力や答えの報告の後には、改行文字を出力し、出力ストリームをフラッシュすることを忘れないでください。

この問題では、ジャッジは適応的(adaptive)ではありません。秘密の整数はやり取りが始まる前に固定されており、やり取りの途中で変化することはありません。

入出力例

入力 1

no

no

yes

出力 1

? 1

? 2

? 3

! 3

注記

1 つ目のサンプルでは、秘密の整数は $3$ です。$x = 1$ と $x = 2$ の質問に対しては no が返され、$x = 3$ の質問に対しては yes が返されます。その後、プログラムは ! 3 を報告します。

2 つ目のサンプルでは、秘密の整数は $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.