Codeforces E. XOR Guessing

E. XOR Guessing

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

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 214−1214−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 a1a1, a2a2, ..., a100a100 (each integer should be not less than 00 and not greater than 214−1214−1). In response to your query, the jury will pick one integer ii (1≤i≤1001≤i≤100) and tell you the value of ai⊕xai⊕x (the bitwise XOR of aiai 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

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.

Interaction

Before giving the answer, you may submit no more than 22 queries. To ask a query, print one line in the following format: ?? a1a1 a2a2 ... a100a100, where every ajaj should be an integer from the range [0,214−1][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⊕xai⊕x for some i∈[1,100]i∈[1,100]. No integer can be used in queries more than once.

If you submit an incorrect query (or ask more than 22 queries), the answer to it will be one integer −1−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".

Example

input

Copy

0
32

output

Copy

? 3 5 6
? 32 24 37
! 5

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.

这题很简单,暴力就好,贴AC代码吧

print('?', *[(i+1) << 7 for i in range(100)], '\n', '?', *[(i+1) for i in range(100)])
print("!",((int(input()) & 0x7F)|(int(input()) & 0x3F80)))

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值