結果 : contrast greedy algorithm and dynamic programming