摘要:
题目大意: Consider a three-parameter recursive function w(a, b, c): if a 20 or b > 20 or c > 20, then w(a, b, c) returns: w(20, 20, 20) if a #include int a,b,c,m[22][22][22]; void init() { for(a... 阅读全文
posted @ 2009-01-07 23:45
pandy
阅读(796)
评论(0)
推荐(0)
摘要:
经典动态规划题 题目大意:对于一个有数字组成的二叉树,求由叶子到根的一条路径,使数字和最大,如: Sample Input 5 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 Sample Output 30 思路就是由下向上动态规划,保存页子节点到当前节点的最大值,最后结果就是num[0][0](num用来存放三角数据) 代码如下: Code Code h... 阅读全文
posted @ 2009-01-07 22:57
pandy
阅读(566)
评论(0)
推荐(0)
浙公网安备 33010602011771号