QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 1024 MB مجموع النقاط: 100

#43. 遗传学

الإحصائيات

对于想要统治世界的恶棍来说,避免被抓的一种常见方法是克隆自己。你已经抓获了一名邪恶的恶棍和她的 $N - 1$ 个克隆体,现在你需要找出其中哪一个是真正的恶棍。

为了帮助你,你拥有每个人的 DNA 序列,由 $M$ 个字符组成,每个字符都是 A、C、G 或 T 中的一个。你还知道克隆体制作得并不完美;相反,它们的序列与真正恶棍的序列相比,恰好在 $K$ 个位置上不同。

你能找出真正的恶棍吗?

输入格式

第一行包含三个整数 $N$、$M$ 和 $K$,其中 $1 \le K \le M$。接下来的 $N$ 行表示 DNA 序列。每一行包含 $M$ 个字符,每个字符都是 A、C、G 或 T 中的一个。

输入中恰好有一个序列与其他所有序列在恰好 $K$ 个位置上不同。

警告:本题输入量较大,在 Java 中需要使用快速 IO。

输出格式

输出一个整数——属于恶棍的 DNA 序列的索引。序列从 1 开始编号。

数据范围

你的解法将在若干测试组上进行测试,每组测试都有相应的分数。每组测试包含若干测试用例。要获得某组测试的分数,你需要解决该组中的所有测试用例。你的最终得分为单次提交的最高得分。

组别 分数 数据范围 附加限制
1 27 $3 \le N, M \le 100$
2 19 $3 \le N, M \le 1800$ 所有字符均为 A 或 C
3 28 $3 \le N, M \le 4100$ 所有字符均为 A 或 C
4 26 $3 \le N, M \le 4100$

样例

样例输入 1

4 3 1
ACC
CCA
ACA
AAA

样例输出 1

3

样例输入 2

4 4 3
CATT
CAAA
ATGA
TCTA

样例输出 2

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.