NOI 2.6 动态规划 9270:Pku2440 DNA

题目要求计算在给定长度L的DNA序列中,不含病毒DNA(101和111)的序列数量。通过动态规划方法,以不同结尾的DNA序列长度为状态,求解不受病毒感染的生命体数量模2005的值。给出的样例输入是L=4,输出为9。解题思路包括设置4个状态来表示不同结尾的长度为i的DNA序列,并找出状态转移方程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

题目来源:http://noi.openjudge.cn/ch0206/9270/

9270:Pku2440 DNA

总时间限制: 4000ms  单个测试点时间限制: 1000ms  内存限制: 131072kB

描述

A kind of virus has attacked the Xplanet, and many lives are infected. After weeks of study, The CHO (CreatureHealthy Organization) of X planet finally finds out that this kind of virus hastwo kind of very simple DNA, and can be represented by 101 and 111.Unfortunately, the lives on the planet also have DNA formed by 0s and 1s. If acreature's DNA contains the virus' DNA, it will be affected; otherwise

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值