XOR Guessing
题意翻译
### 题目描述
**这是一道交互题。**
为了刷新你的输出,要使用 `fflush(stdout)` (对于C++)。
jury 随便想了一个在 $[0,2^{14}-1]$ 范围内的整数 $x$,你要猜出它是多少。
你可以进行至多两次询问,每次输出 $100$ 个 $[0,2^{14}-1]$ 范围内的整数 $a_1,a_2,...a_{100}$ 。需要注意的是,你输出的所有数必须两两不同。
作为回复,jury 会从你的每次输出中选一个数(你并不知道她选了哪个),告诉你 $x$ 与其按异或的结果。
### 输入格式
这是交互题,并没有输入格式。
### 输出格式
当输出答案时,需要以 $!\space x$ 并加一个换行符的形式结束。
### 交互
当你询问时,需要以 $?\space a_1 \space a_2 ...\space a_{100}$ 的并加一个换行符的形式。在输出询问之后,刷新输出再读入,就能得到询问的答案。
如果你给出了一个非法的询问,或询问超过两次,你只会得到 $-1$ 作为结果。此时,你的程序应当立即终止。
### 说明/提示
注意:样例输出是 **不正确的**。你的每次询问必须输出刚好 $100$ 的整数。
题目描述
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 $ x $ not less than $ 0 $ and not greater than $ 2^{14} - 1 $ . You have to guess this integer.
To do so, you may ask no more than $ 2 $ queries. Each query should consist of $ 100 $ integer numbers $ a_1 $ , $ a_2 $ , ..., $ a_{100} $ (each integer should be not less than $ 0 $ and not greater than $ 2^{14} - 1 $ ). In response to your query, the jury will pick one integer $ i $ ( $ 1 \le i \le 100 $ ) and tell you the value of $ a_i \oplus x $ (the bitwise XOR of $ a_i $ and $ x $ ). There is an additional constraint on the queries: all $ 200 $ integers you use in the queries should be distinct.
It is guaranteed that the value of $ x $ is fixed beforehand in each test, but the choice of $ i $ in every query may depend on the integers you send.
Output
To give the answer, your program should print one line $ ! $ $ x $ with a line break in the end. After that, it should flush the output and terminate gracefully.
输入输出格式
输入格式
输出格式
To give the answer, your program should print one line $ ! $ $ x $ 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 $ 2 $ queries. To ask a query, print one line in the following format: $ ? $ $ a_1 $ $ a_2 $ ... $ a_{100} $ , where every $ a_j $ should be an integer from the range $ [0, 2^{14} - 1] $ . 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 $ a_i \oplus x $ for some $ i \in [1, 100] $ . No integer can be used in queries more than once.
If you submit an incorrect query (or ask more than $ 2 $ queries), the answer to it will be one integer $ -1 $ . 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".
输入输出样例
输入样例 #1
0
32
输出样例 #1
? 3 5 6
? 32 24 37
! 5
说明
The example of interaction is not correct — you should sumbit exactly $ 100 $ integers in each query. Everything else is correct.
Hacks are forbidden in this problem.