CareerCup Cost of cutting wood
来源:互联网 发布:淘宝直播要什么条件 编辑:程序博客网 时间:2024/04/28 23:15
A log of wood has n marks on it. Cost of cutting wood at a particular mark is proportional to the length of the log. The log of wood can be cut at all the marks. Find the optimal order of the marks where the log should be cut in order to minimize the total cost of cutting.
--------------------------------------------------------------------------------------
Use dynamic programming.
1) Add two auxilary marks on each end of the log (totally n+2 marks)
2) min_cost[i][j]=minimum{min_cost[i][k] + min_cost[k][j] + length[i][j]}, where k=i+1 to j-1
3) min_cost[i][i+1]=0
4) min_cost[i][i+2]=length[i][i+2]
Find min_cost[0][n+1].
0 0
- CareerCup Cost of cutting wood
- UVa 11727 - Cost Cutting
- UVa OJ 11727-Cost Cutting
- 【UVa】11727 – Cost Cutting
- UVa 11727 Cost Cutting (water ver.)
- wood
- Cost Of Carry
- CareerCup Median of three numbers
- CareerCup Facebook Number of sstrings
- Cost of goods sold (COGS)
- Debug log of Cost Management
- avoiding performance cost of ongui
- The True Cost of Calls
- CareerCup Binary Tree the Maximum of 人
- CareerCup Find the diameter of the tree
- CareerCup Fermat point of a traingle
- CareerCup Facebook Total number of substring palindrome
- Comparison of BI Software Licensing Cost
- 【Cocos2dx开发之锚点实例讲解】
- 蓝桥杯-基础练习之特殊的数字——BASIC-7
- struts2 标签详解
- GDB 调试程序
- Json资料整理
- CareerCup Cost of cutting wood
- Spring和Struts2配置文件不在默认路径下的web.xml配置方法
- 蓝桥杯-基础练习之回文数——BASIC-8
- 思戀妳的日子裏
- 克隆的理解
- 13个最狂帅炫酷的前沿科技研究项目
- 蓝桥杯-基础练习之特殊回文数——BASIC-9
- Android中RelativeLayout的使用-----------转载下----以免忘记.
- PAT_ADVANCED LEVEL 1071 C++ SLT MAP 小记