2016年8月27日星期六

Cutting a Rod

Problem
    give a rob of length n inches, try to split into several pieces. And try to max the total value.
length   | 1   2   3   4   5   6   7   8  
--------------------------------------------
price    | 1   5   8   9  10  17  17  20
Solution
    try to enumerate the length of the last piece.

没有评论:

发表评论