QOJ.ac

QOJ

実行時間制限: 2 s メモリ制限: 512 MB 満点: 100

#2037. 突变疫苗

統計

Dr. Icey Peacie 正在研发一种针对 Covid-19 的疫苗。疫苗研发的难点之一在于病毒会发生变异,因此存在许多不同的流行毒株。Dr. Peacie 希望疫苗能够针对病毒基因序列中所有毒株共有的部分。你能找出在所有毒株中都出现的最长 RNA 片段吗?

输入格式

输入的第一行包含一个整数 $N$,表示病毒毒株的数量,其中 $1 \le N \le 100$。接下来的 $N$ 行,每行包含一个病毒毒株的基因序列,由字母 A、C、G 和 T 组成。每个字符串的长度在 $1$ 到 $10\,000$ 之间。

输出格式

输出一行,包含在所有毒株中都作为子串出现的最长字符串。如果存在多个这样的最长字符串,输出在第一个毒株中出现位置最早的那一个。

样例

样例输入 1

3
GACCAT
CACAT
ACCA

样例输出 1

AC

样例输入 2

4
ACG
ACGT
ACGT
TTTT

样例输出 2

```

#### 样例输入 3

2 AGGAGAAG GAAGAGGA

#### 样例输出 3

AGGA ```

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.