HBC205164Figureoutthesequence题解

冷默言语 算法基础篇 51 0
全网最全C++题库,助您快速提升编程技能!题库丰富多样,涵盖各个领域,让您在练习中不断成长!
The Coronavirus is evil and loves to store everything into its RNA, which is why it often has genetic mutation. One day the Coronavirus get two RNA sequences, and it decided to add them to its RNA. It will add the first sequence to the end of its current RNA, and next turn it will add the another one. For the following turns, the virus will always add the sequence it got in the previous turn to the beginning of the current sequence. Suppose the virus has nothing in its RNA initially, and two RNA sequences are: {"abc","def"}{"abc","def"}{"abc","def"} (The virus has no sanity, so the RNA sequence can be far more than "agcu" !As an expert in biochemistry, GGG has been devoting himself into analyzing this virus since its outbreak, whose task is to figure out the exact composition of this virus . However, what he can get is only how many turns the virus has changed its RNA and the initial two sequences. can you help him to solve this problem?

The Coronavirus is evil and loves to store everything into its RNA, which is why it often has genetic mutation. One day the Coronavirus get two RNA sequences, and it decided to add them to its RNA. It will add the first sequence to the end of its current RNA, and next turn it will add the another one. For the following turns, the virus will always add the sequence it got in the previous turn to the beginning of the current sequence. Suppose the virus has nothing in its RNA initially, and two RNA sequences are: {"abc","def"}{"abc","def"}{"abc","def"} (The virus has no sanity, so the RNA sequence can be far more than "agcu" ! ) , the final RNA sequence after each turn will be: F[1]=“abc”F[1] = “abc”F[1]=“abc” F[2]=“def”F[2 ] = “def”F[2]=“def” F[3]=“abcdef”F[3 ] = “abcdef”F[3]=“abcdef” F[4]=“defabcdef”F[4 ] = “defabcdef”F[4]=“defabcdef” F[5]=“abcdefdefabcdef”F[5 ] = “abcdefdefabcdef”F[5]=“abcdefdefabcdef” …… As an expert in biochemistry, GGG has been devoting himself into analyzing this virus since its outbreak, whose task is to figure out the exact composition of this virus (That is: how many times does each letter appear in the final sequence). However, what he can get is only how many turns the virus has changed its RNA and the initial two sequences. can you help him to solve this problem?

HBC205164Figureoutthesequence题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
全网最全C++题库,助您挑战自我,突破极限,成为编程领域的佼佼者!

标签: HBC205164Figureoutthesequence题解