题意: 每次只能取两端,然后第 i 次取要val[ i ]*i,求一个最大值 一切都是错觉[读者省略此段] 这道题目一开始想的就是记忆化搜索,然后太天真了?好像是,一开始用一维dp[ i ]直接代表一个点的最大...额..现在想想好撒比,怎么可能一维就可以代表一个点的最大啊...因为并不能代表他那一步最大. [解析] 所以开二维数组dp[ s ] [ e ]代表一个区间上的最大,然后深搜一下就好了... 还是菜吧.. 另外还有一种写法是..从里到外的DP,也是非常棒! 记忆化搜索: #inclu…
Description FJ 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 over a given period time. The treats are interesting for…
Treats for the Cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5801 Accepted: 3003 Description FJ 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 da…
Treats for the Cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5753 Accepted: 2972 Description FJ 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 da…
Treats for the Cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7949 Accepted: 4217 Description FJ 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 da…
题目链接:http://poj.org/problem?id=3186 Treats for the Cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6548 Accepted: 3446 Description FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amount…