Problem
For a weighted alphabet and a collection of positive real numbers, the spectrum graph of is a digraph constructed in the following way. First, create a node for every real number in . Then, connect a pair of nodes with a directed edge if and is equal to the weight of a single symbol in . We may then label the edge with this symbol.
In this problem, we say that a weighted string matches if there is some increasing sequence of positive real numbers in such that , , ..., and .
Given: A list (of length at most 100) containing positive real numbers.
Return: The longest protein string that matches the spectrum graph of (if multiple solutions exist, you may output any one of them). Consult the monoisotopic mass table.
对于加权字母和收集正实数的,则 频谱图的是一个有向图通过以下方式构成。首先, 为中的每个实数创建一个节点。然后, 如果和等于中的单个符号的权重,则将一对节点与一个有向边相连。然后,我们可以用该符号标记边缘。
在这个问题上,我们说一个加权字符串匹配,如果有正实数的增加一些序列中,使得, ,...,和。
给定:包含正实数的列表(长度最多为100)。
返回值:与光谱图匹配的最长蛋白质字符串 (如果存在多种溶液,则可以输出其中任何一种)。查阅单同位素质量表
Sample Dataset
3524.8542 3623.5245 3710.9335 3841.974 3929.00603 3970.0326 4026.05879 4057.0646 4083.08025
Sample Output
WMSPG