QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 1024 MB Puntuación total: 100 Interactivo

#15106. 修复糟糕的 Ping

Estadísticas

这是一个交互式问题。

Alber Blanc 是一家自营交易公司,为许多交易所提供流动性,特别关注新兴市场。他们还在不同的交易所提供衍生品做市商的专业服务。

作为 Alber Blanc 的一名开发人员,你的任务是优化交易所服务器与基金服务器之间的连接。共有 $10^9$ 台交易所服务器和 $10^9$ 台基金服务器,每台交易所服务器都与每台基金服务器直接相连,总共产生 $10^{18}$ 条连接。测试人员注意到有两条连接的性能低于预期。通常情况下,服务器之间的延迟为 1ms;然而,在其中两种情况下,延迟为 2ms。为了解决这个问题,测试人员需要你的帮助来确定哪些连接是慢连接。

为了找到这些慢连接,你可以测量某些连接的总延迟。具体来说,你可以选择 $e_\ell$、$e_r$、$f_\ell$ 和 $f_r$,使用这些参数运行测试,并确定编号在 $e_\ell \le i \le e_r$ 之间的交易所服务器与编号在 $f_\ell \le j \le f_r$ 之间的基金服务器之间所有连接的总延迟。

测试人员迫切需要关于慢连接的信息,因此你最多只能测量总延迟 125 次。

交互格式

交互从你的程序进行询问开始。每次询问为一行,格式为 ? e_l f_l e_r f_r(不带引号),其中 $1 \le e_\ell \le e_r \le 10^9$,$1 \le f_\ell \le f_r \le 10^9$,代表测试的参数。作为响应,评测程序会输出一个整数——所选连接的总延迟。你总共最多可以进行 125 次询问。

要输出你的答案,请打印一行 ! e_1 f_1 e_2 f_2(不带引号),其中 $e_1$ 和 $f_1$ 是构成第一条慢连接的服务器编号,$e_2$ 和 $f_2$ 是第二条慢连接的服务器编号。连接可以按任何顺序输出。请注意,输出答案不计入询问次数。

保证慢连接在交互过程中不会改变(即交互器是非自适应的)。

请记住在每次询问和输出答案后打印换行符并刷新输出缓冲区,否则你的程序将会得到 IL(Idleness Limit Exceeded)的结果。

样例

输入样例 1

1
2
9
10
4
2

输出样例 1

? 1 1 1 1
? 2 2 2 2
? 3 4 5 6
? 4 4 6 6
? 6 4 6 6
? 6 5 6 6
! 2 2 6 4

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.