結果 : dynamic programming algorithm time complexity