XOR Guessing
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
This is an interactive problem. Remember to flush your output while communicating with the testing program. You may use fflush(stdout) in C++, system.out.flush() in Java, stdout.flush() in Python or flush(output) in Pascal to flush the output. If you use some other programming language, consult its documentation. You may also refer to the guide on interactive problems: https://codeforces.com/blog/entry/45307.
The jury picked an integer not less than and not greater than . You have to guess this integer.
To do so, you may ask no more than queries. Each query should consist of integer numbers , , ..., (each integer should be not less than and not greater than ). In response to your query, the jury will pick one integer () and tell you the value of (the bitwise XOR of and ). There is an additional constraint on the queries: all integers you use in the queries should be distinct.
It is guaranteed that the value of is fixed beforehand in each test, but the choice of in every query may depend on the integers you send.
To give the answer, your program should print one line with a line break in the end. After that, it should flush the output and terminate gracefully.
Interaction
Before giving the answer, you may submit no more than queries. To ask a query, print one line in the following format: ... , where every should be an integer from the range . The line should be ended with a line break character. After submitting a query, flush the output and read the answer to your query — the value of for some . No integer can be used in queries more than once.
If you submit an incorrect query (or ask more than queries), the answer to it will be one integer . After receiving such an answer, your program should terminate immediately — otherwise you may receive verdict "Runtime error", "Time limit exceeded" or some other verdict instead of "Wrong answer".
Output
To give the answer, your program should print one line with a line break in the end. After that, it should flush the output and terminate gracefully.
Note
The example of interaction is not correct — you should sumbit exactly integers in each query. Everything else is correct.
Hacks are forbidden in this problem.
20240416集训
- Status
- Done
- Rule
- IOI
- Problem
- 7
- Start at
- 2024-4-16 18:30
- End at
- 2024-4-16 21:00
- Duration
- 2.5 hour(s)
- Host
- Partic.
- 13