QOJ.ac

QOJ

Limite de temps : 1.0 s Limite de mémoire : 256 MB Points totaux : 100 Hackable ✓

#9849. 氨基酸

Statistiques

自然界中共有 20 种常见的氨基酸。在本题中,我们仅考虑其中的 10 种:丙氨酸 (Alanine)、天冬酰胺 (Asparagine)、天冬氨酸 (Aspartate)、半胱氨酸 (Cysteine)、谷氨酰胺 (Glutamine)、谷氨酸 (Glutamate)、甘氨酸 (Glycine)、甲硫氨酸 (Methionine)、丝氨酸 (Serine) 和苏氨酸 (Threonine)。

通过缩合反应,$n$ ($n \ge 2$) 个氨基酸可以通过 $n-1$ 个肽键连接成一条肽链,并同时产生 $n-1$ 个水分子。回想一下,每个水分子的分子量为 18。

展示两个氨基酸缩合形成肽键的理想化方案。

给定一组不同的氨基酸和一个数字 $N$,请打印出所有分子量不超过 $N$ 的、由给定氨基酸组成的肽链的结构式。如果肽链中氨基酸的排列顺序不同,则视为不同的链。

以下是 10 种氨基酸和肽键的结构式:

Ala: Asp: Asn: Cys: Gly: H H O H H O H H O H H O H H O | | || | | || | | || | | || | | || H-N-C-C-O-H H-N-C-C-O-H H-N-C-C-O-H H-N-C-C-O-H H-N-C-C-O-H | | | | | H-C-H H-C-H H-C-H H-C-S-H H | | | | H O=C-O-H O=C-N-H H | H

Ser: Met: Thr: Gln: Glu: Peptide bond: H H O H H O H H O H H O H H O O H | | || | | || | | || | | || | | || || | H-N-C-C-O-H H-N-C-C-O-H H-N-C-C-O-H H-N-C-C-O-H H-N-C-C-O-H -C---N- | | | | | H-C-O-H H-C-H H-C-O-H H-C-H H-C-H | | | | | H H-C-H H-C-H H-C-H H-C-H | | | | S H O=C-N-H O=C-O-H | | H-C-H H | H

下表列出了氨基酸的分子量:

氨基酸 3 字母符号 分子量
Alanine Ala 89
Asparagine Asn 132
Aspartate Asp 133
Cysteine Cys 121
Glutamine Gln 146
Glutamate Glu 147
Glycine Gly 75
Methionine Met 149
Serine Ser 105
Threonine Thr 119

输入格式

第一行包含两个整数 $M$ 和 $N$ ($1 \le M \le 10, 1 \le N \le 450$),分别表示氨基酸的种类数和分子量上限。

第二行包含 $M$ 个字符串,每个字符串由 3 个字母组成,表示一种氨基酸。

输出格式

第一行打印一个整数,表示可能的肽链数量。

然后按 3 字母序列的字典序打印每条可能的肽链的结构式,中间用空行隔开。

样例

输入 1

2 150
Ala Gly

输出 1

3
H H O H H O
| | || | | ||
H-N-C-C---N-C-C-O-H
| |
H-C-H H
|
H

H H O H H O
| | || | | ||
H-N-C-C---N-C-C-O-H
| |
H H-C-H
|
H

H H O H H O
| | || | | ||
H-N-C-C---N-C-C-O-H
| |
H H

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.