CF1570G.XOR Guessing
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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 214−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 a1 , a2 , ..., a100 (each integer should be not less than 0 and not greater than 214−1 ). In response to your query, the jury will pick one integer i ( 1≤i≤100 ) and tell you the value of ai⊕x (the bitwise XOR of ai 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: ? a1 a2 ... a100 , where every aj should be an integer from the range [0,214−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 ai⊕x for some i∈[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.