#P9477. [_-0 C] 猜数
[_-0 C] 猜数
Background
Little and little are playing a number guessing game, but because the wind is too loud, they cannot hear what the other person says clearly.
Problem Description
The judge randomly selects an integer uniformly from the interval . Your task is to guess this number.
Each time, you may give an integer in and ask for the comparison between and . You can ask at most times.
However, for some reason, the judge has a probability of making a mistake.
Specifically:
- If , then the judge returns
=. - If , and this is already the -th query, then the judge returns
!. - After getting either of the above two results, you should stop querying.
- If , then with probability the judge returns
>, and with probability it returns<. - If , then with probability the judge returns
<, and with probability it returns>.
For each query, you need to output an integer in to standard output, and then flush the buffer.
You may use the following statements to flush the buffer:
- For C/C++:
fflush(stdout); - For C++:
std::cout << std::flush; - For Java:
System.out.flush(); - For Python:
stdout.flush(); - For Pascal:
flush(output); - For other languages, please check the corresponding language documentation yourself.
In particular, for C++, if you output a newline using std::endl instead of '\n', it can also flush the buffer automatically.
Then you need to read a character from standard input, which represents the result returned by the judge.
Input Format
Before you start querying, one line with three integers separated by spaces.
For each query, one line with one character, which must be one of =, !, >, <.
Output Format
For each query, output one line with one integer in .
100 0 10
>
<
=
50
25
37
100 10 10
<
<
=
50
25
37
100 0 2
>
!
50
25
Hint
Explanation for Sample :
At this time, the status of this test point is AC.
Explanation for Sample :
When , we have . There is a probability to output <, and it happened to output <.
Explanation for Sample :
At this time, the status of this test point is WA.
This problem uses bundled testdata.
Each Subtask contains test points. You only need to pass at least of them to get the score for that Subtask.
This problem does not use subtask dependencies.
For all testdata, .
Constraints
| ID | Score | Time Limit | ||
|---|---|---|---|---|
Translated by ChatGPT 5