CF BUDDY
← Problems·

1207E · XOR Guessing

1900 · bitmasks, interactive, math

Problem: 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 xx not less than 00 and not greater than 21412^{14} - 1. You have to guess this integer.

To do so, you may ask no more than 22 queries. Each query should consist of 100100 integer numbers a1a_1, a2a_2, ..., a100a_{100} (each integer should be not less than 00 and not greater than 21412^{14} - 1). In response to your query, the jury will pick one integer ii (1i1001 \le i \le 100) and tell you the value of aixa_i \oplus x (the bitwise XOR of aia_i and xx). There is an additional constraint on the queries: all 200200 integers you use in the queries should be distinct.

It is guaranteed that the value of xx is fixed beforehand in each test, but the choice of ii in every query may depend on the integers you send.

Output Format: To give the answer, your program should print one line !! xx 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 100100 integers in each query. Everything else is correct.

Hacks are forbidden in this problem.

Sample Cases

Case 1

Input

0
32

Output

? 3 5 6
? 32 24 37
! 5

Similar problems

00:00:00
Loading editor…
Welcome! I'm your coding tutor for this problem. Use the chips below to reveal stored hints or get AI feedback on your code. I'll guide you step by step — never giving away the solution.

Sign in to unlock AI tutor feedback