QOJ.ac

QOJ

Limite de temps : 1 s - 10 s Limite de mémoire : 128 MB Points totaux : 100

#5263. 货运列车

Statistiques

Bajtek 和 Bitek 喜欢观察经过他们家附近的火车。他们最喜欢货运列车,因为它们通常很长且有各种各样的车厢。男孩们决定记录下火车由哪些种类的车厢组成。为简化起见,我们将潜在的车厢种类编号为 $1$ 到 $k$。对于男孩们来说,同种类的车厢是无法区分的。

当火车经过时,两个男孩都在各自的笔记本上记录下连续车厢的种类。Bajtek 年龄较大,已经能准确地记录下所有车厢的种类。Bitek 年龄较小,书写还不熟练。有时,在他还没来得及记录下某种车厢之前,后续的车厢就已经经过了,而 Bitek 没有注意到它们。因此,在 Bitek 的列表中,有些车厢可能会被遗漏。

现在,男孩们正在分析他们的记录,并思考 Bitek 可能记录下了哪些车厢,以及哪些车厢肯定被他遗漏了。

输入格式

输入的第一行包含三个整数 $n, m$ 和 $k$ ($1 \le n, m, k \le 300\,000$),分别表示 Bajtek 列表的长度(即火车车厢的总数)、Bitek 列表的长度以及车厢种类的数量。

第二行包含一个长度为 $n$ 的序列,由区间 $[1, k]$ 内的整数组成,表示 Bajtek 列表中的连续车厢种类。第三行包含一个长度为 $m$ 的序列,格式相同,表示 Bitek 的列表。

你可以假设 Bitek 可能遗漏了 Bajtek 列表中的一些车厢,但他没有添加任何“额外”的车厢。换句话说,输入数据保证可以通过从 Bajtek 的列表中删除一定数量(可能为零)的车厢来得到 Bitek 的列表。

输出格式

输出 $n$ 个用空格分隔的整数:如果第 $i$ 个车厢可能被 Bitek 记录下来,则第 $i$ 个数字应为 $1$,否则如果它肯定没有被记录,则为 $0$。

样例

输入 1

9 4 3
1 3 2 1 2 3 1 3 2
1 3 1 2

输出 1

1 1 0 1 1 1 1 0 1

说明 1

Bitek 可能记录下的车厢编号为: 1, 2, 4 和 5, 1, 2, 4 和 9, 1, 2, 7 和 9, 1, 6, 7 和 9, * 或者 4, 6, 7 和 9。

子任务

测试集分为以下子任务。每个子任务的测试由一组或多组独立的测试用例组成。

子任务 条件 分值
1 $n, m \le 100$ 15
2 $n, m \le 2000$ 20
3 每种车厢在火车中最多出现一次 15
4 无附加条件 50

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.