区间dp
October's very own
? ? ?
展开
-
CodeForces - 1312E Array Shrinking (区间dp)
Array Shrinking题目描述You are given an array a1,a2,…,an. You can perform the following operation any number of times:Choose a pair of two neighboring equal elements ai=ai+1 (if there is at least one s...原创 2020-03-17 18:02:23 · 260 阅读 · 0 评论 -
Luogu 1140 相似基因
Luogu 1140 相似基因 (线性动态规划)又是一道线性dp,多加练习才能找到题感。题目背景大家都知道,基因可以看作一个碱基对序列。它包含了44种核苷酸,简记作A,C,G,TA,C,G,T。生物学家正致力于寻找人类基因的功能,以利用于诊断疾病和发明药物。在一个人类基因工作组的任务中,生物学家研究的是:两个基因的相似程度。因为这个研究对疾病的治疗有着非同寻常的作用。题目描述两个基因的...原创 2019-10-26 14:22:13 · 1904 阅读 · 2 评论 -
Luogu 1880 合并石子
Luogu 1880 合并石子 (线性动态规划)这是一道经典的区间型动态规划,但对于初学dp仍然思考了很久。——————————————————————————————————题干:https://www.luogu.org/problem/P1880题目描述:在一个圆形操场的四周摆放N堆石子,现要将石子有次序地合并成一堆.规定每次只能选相邻的2堆合并成新的一堆,并将新的一堆的石子数,记...原创 2019-10-26 10:29:46 · 1339 阅读 · 0 评论