QOJ.ac

QOJ

时间限制: 1 s 内存限制: 1024 MB 总分: 100 通信

#4675. 多重通信

统计

这是一个需要运行三次的问题。

给定 200 个 1000 位的非负整数 $a_1, \dots, a_{100}$ 和 $b_1, \dots, b_{100}$。

Alice 仅获得整数 $a_i$,并可以向 Clara 发送一条 3000 位的消息 $X$。 Bob 仅获得整数 $b_i$,并可以向 Clara 发送一条 3000 位的消息 $Y$。 Clara 接收到消息 $X$ 和 $Y$,并需要回答 100 个查询。

第 $i$ 个查询包含一个非负整数 $c_i$,Clara 需要给出两个整数 $x_i$ 和 $y_i$(均在 1 到 100 之间),使得 $a_{x_i}$ 与 $b_{y_i}$ 的按位异或结果等于 $c_i$。

如果她能正确回答 96 个或更多问题,则该问题被视为已解决。

输入格式

输入的第一行包含单词 “Alice”(如果是 Alice 的输入)、“Bob”(如果是 Bob 的输入)或 “Clara”(如果是 Clara 的输入)。

如果是 Alice 或 Bob 的输入,接下来的 100 行,每行包含恰好 1000 个字符 ‘0’ 和 ‘1’;其中第 $i$ 行代表 $a_i$(对于 Alice)或 $b_i$(对于 Bob)。

如果是 Clara 的输入,第二行包含恰好 3000 个字符 ‘0’ 和 ‘1’,这是来自 Alice 的消息。第三行包含恰好 3000 个字符 ‘0’ 和 ‘1’,这是来自 Bob 的消息。接下来的 100 行,每行包含恰好 1000 个字符 ‘0’ 和 ‘1’;其中第 $i$ 行代表查询 $c_i$。

输出格式

当程序作为 Alice 或 Bob 运行时,应输出一个长度恰好为 3000 的字符串,由字符 ‘0’ 和 ‘1’ 组成,即发送给 Clara 的消息。

当程序作为 Clara 运行时,应针对每个查询输出一对整数 $x_i$ 和 $y_i$,即该查询的答案。

如果程序在 100 个查询中给出了 96 个或更多的正确答案,则该测试点的解被视为正确。

样例

输入 1

Alice
110...(total 1000 characters)...101
...(98 more lines)...
101...(total 1000 characters)...111

输出 1

111...(total 3000 characters)...111

输入 2

Bob
11001111...(total 1000 characters)...0100
... (98 more lines)
11110010...(total 1000 characters)...1010

输出 2

0000...(total 3000 characters)...0100

输入 3

Clara
11111..(total 3000 characters)...1111
00000..(total 3000 characters)...0000
10010101...(total 1000 characers)...1011
...(98 more lines)...
00000100...(total 1000 characters)...1111

输出 3

1 6
3 100
4 2
...(96 more lines)...
8 34

说明

你的程序将在每个测试点上独立运行三次:一次作为 Alice,一次作为 Bob,一次作为 Clara。如果 Alice 或 Bob 与 Clara 之间的通信格式不正确,你将立即收到 Wrong Answer 错误。

samples.zip 文件包含 Alice、Bob 和 Clara 的样例输入;在该输入中,Alice 和 Bob 分别输出全 1 和全 0;Alice、Bob 和 Clara 的其他数据与真实测试点 1 一致。

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.