Problem
Say that we have a string containing as an internal substring, so that there exist nonempty substrings and of such that can be written as . A t-prefix contains all of and none of ; likewise, a t-suffix contains all of and none of .
Given: A list containing positive real numbers (). The first number in is the parent mass of a peptide , and all other numbers represent the masses of some b-ions and y-ions of (in no particular order). You may assume that if the mass of a b-ion is present, then so is that of its complementary y-ion, and vice-versa.
Return: A protein string of length for which there exist two positive real numbers and such that for every prefix and suffix of , each of and is equal to an element of . (In other words, there exists a protein string whose -prefix and -suffix weights correspond to the non-parent mass values of .) If multiple solutions exist, you may output any one.
说我们有一个字符串 包含 作为内部子字符串,因此存在非空子字符串 和 的 这样 可以写成 。一个T-前缀包含了所有的 而且没有 ; 同样,t后缀包含所有 而且没有 。
给出:清单 包含 正实数()。中的第一个数字 是肽的母体质量 ,所有其他数字代表其中的某些b离子和y离子的质量 (无特定顺序)。您可以假设存在一个b离子的质量,那么它的互补y离子的质量也存在,反之亦然。
返回值:蛋白质字符串 长度 有两个正实数 和 这样对于每个前缀 和后缀 的 , 每个 和 等于的元素 。(换句话说,存在一个蛋白质串,其-前缀和 -后缀权重对应于 。)如果存在多个解决方案,则可以输出任何一个。
Sample Dataset
1988.21104821 610.391039105 738.485999105 766.492149105 863.544909105 867.528589105 992.587499105 995.623549105 1120.6824591 1124.6661391 1221.7188991 1249.7250491 1377.8200091
Sample Output
KEKEP