基于特征短遗传密码构造问题研究.pdfVIP

  • 0
  • 0
  • 约2.61千字
  • 约 4页
  • 2025-10-14 发布于北京
  • 举报

问题描述:

原始生物的遗传是一个自然数的序列K=(a,...,a)。原始生物的特征是指在遗传

1n

中连续出现的数对(l,r),即存在自然数i使得l=ai且r=ai+1。在原始生物的遗传中不存

在(p,p)形式的特征。

求解任务:

请设计一个程序:

·从文件PIE.IN中读入一系列的特征。

·计算包含这些特征的最短的遗传。

·将结果写到文件PIE.OUT中。

输入:

在输入文件PIE.IN的第一行是一个整数n,表示特征的总数。在接下来的n行里,每

行都是一对由空格分隔的自然数l和r,1=l,r=1000。数对(l,r)是原始生物的特

征之一。输入文件中的特征不会有重复。

输出:

输出文件PIE.OUT的唯一一行应该包含一个整数,等于包含了PIE.IN中所有特征的遗

传的最小长度。

样例输入:

12

23

39

96

85

57

76

45

51

14

42

Question

description:

ThegeneticcodeofaprimitiveorganismisasequenceofnaturalnumbersK(a,...,a).The

1n

characteristicsofprimitiveorganismsrefertothenumberpairs(l,r)thatappearcontinuouslyi

nthegeneticcode,thatis,thereisanaturalnumberisuchthatlaandra.The(p,p)form

ii+1

featuresdonotexistinthegeneticcodeoftheprimitiveorganism.

Solvethetask:

Pleasedesignaprogram:

·ReadaseriesoffeaturesfromthefilePIE.IN.

·Calculatetheshortestgeneticcodethatcontainsthesecharacteristics.

·WritetheresultstothefilePIE.OUT.

输入:

InthefirstlineoftheinputfilePIE.INisanintegern,indicatingthetotalnumberoffeatures.In

thenextnlines,eachlineisapairofnaturalnumberslandr,1=l,r=1000separatedbyspaces.The

numberpair(l,r)isoneofthecharacteristicsofprimitiveorganisms.Therewillbenoduplication

文档评论(0)

1亿VIP精品文档

相关文档