码迷,mamicode.com
首页 >  
搜索关键字:poj3666    ( 23个结果
POJ 3666 Making the Grade (DP+离散化)
题目地址:POJ3666 dp[i][j]表示第i位时,值为j时的最小代价。因为j太大,由于要改变值的话,变到与之最近的值相同是最优的,所以可以离散化,这样,j对应了各个值得下标。复杂度O(n^2)。 代码如下:#include #include #include #include #include <algorith...
分类:其他好文   时间:2015-03-13 10:58:05    阅读次数:154
POJ3666---Making the Grade
DescriptionA straight dirt road connects two fields on FJ’s farm, but it changes elevation more than FJ would like. His cows do not mind climbing up or down a single slope, but they are not fond of an...
分类:其他好文   时间:2015-02-14 15:02:57    阅读次数:157
【POJ3666】【USACO 2008 Feb Gold】 2.Cow Game 动规
除草,水题,勿看。...
分类:其他好文   时间:2014-12-30 23:43:37    阅读次数:209
23条   上一页 1 2 3
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!