CF1207E.XOR Guessing

普及+/提高

通过率:0%

时间限制:1.00s

内存限制:256MB

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 xx not less than 00 and not greater than 214−12^{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 214−12^{14} - 1). In response to your query, the jury will pick one integer ii (1≤i≤1001 \le i \le 100) and tell you the value of ai⊕xa_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.

这是一个交互式问题。在与评测程序通信时,请务必刷新你的输出。你可以在 C++ 中使用 fflush(stdout),在 Java 中使用 system.out.flush(),在 Python 中使用 stdout.flush(),或在 Pascal 中使用 flush(output) 来刷新输出。如果你使用其他编程语言,请查阅其相关文档。你也可以参考交互式问题指南:https://codeforces.com/blog/entry/45307。

出题人预先选定一个整数 xx,满足 0≤x≤214−10 \le x \le 2^{14} - 1。你需要猜出这个整数。

为此,你最多可以提出 22 次询问。每次询问需包含 100100 个整数 a1,a2,…,a100a_1, a_2, \dots, a_{100}(每个整数均需满足 0≤aj≤214−10 \le a_j \le 2^{14} - 1)。对于你的每次询问,出题人将从中选择一个下标 ii(1≤i≤1001 \le i \le 100),并告诉你 ai⊕xa_i \oplus x 的值(即 aia_i 与 xx 的按位异或结果)。此外,对询问还有一个额外约束:你在两次询问中总共使用的 200200 个整数必须互不相同。

保证在每个测试用例中,xx 的值是预先固定好的;但每次询问中出题人选择的下标 ii 可能依赖于你发送的整数。

输出格式

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.

要给出答案,您的程序应打印一行 $!$ $x$,并在末尾换行。之后,程序应刷新输出并正常终止。

输入输出样例

  • 输入#1

    0
    32

    输出#1

    ? 3 5 6
    ? 32 24 37
    ! 5

说明/提示

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.

交互示例不正确——您应在每次查询中恰好提交 100 个整数。其余内容均正确。

本题禁止 Hack。

输入解题思路,AI测评打分。不知道怎么写?

首页