# -*- coding: UTF-8 -*- deep = 4 L = [] L.append([1]) L.append([2,3]) L.append([4,5,6]) L.append([7,8,9,10]) opt = [] opt_line = [] #递归动态规划 def search_the_best_answer(i,j): print(i,j) if i < deep: if opt[i][j] != -1: return opt[i][j] else: f1 = search_the_best_answer(i+
动态规划 python 实现 三角形最大值路径
最新推荐文章于 2024-05-15 10:31:03 发布
# -*- coding: UTF-8 -*-deep = 4L = []L.append([1])L.append([2,3])L.append([4,5,6])L.append([7,8,9,10])opt = []opt_line = []#递归动态规划def search_the_best_answer(i,j): print(i,j) if i
摘要由CSDN通过智能技术生成