![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
区间DP
区间DP
云帆是弟弟
import torch as tf
展开
-
CodeForces - 1312E Array Shrinking【区间DP】
题意给定数组a1,a2,...,ana_1, a_2, ...,a_na1,a2,...,an,你可以对该数组进行如下操作任意次数:选择一对相邻且相等的数,ai=ai+1a_i = a_{i+1}ai=ai+1用ai+1a_i+1ai+1代替这一对数现在求数组经过几次操作后,可能的最短的长度。1≤n≤500,1≤ai≤10001\le n \le500, 1\le a_i...原创 2020-03-13 15:56:55 · 132 阅读 · 0 评论 -
POJ3186 Treats for the Cows (区间DP)
DescriptionFJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wants to maximize the money he receives ov...原创 2019-10-12 20:39:18 · 125 阅读 · 0 评论