摘要: 采用给出的 n 种不同的面值的货币构成 v 有多少种不同的方案。每种货币的数量不限。We use dynamic programming to count the number of ways to make n cents with the given coins. If we denote the value of the kth coin by c_k, then the recurrence is: nway(n, k) = no. of ways to make n cents with the first k types of coins nway(n, k) = nway... 阅读全文
posted @ 2013-07-23 11:12 caniggia 阅读(145) 评论(0) 推荐(0) 编辑
摘要: With i and j already chosen, we chose k, which is the number of nodes in the left subtree. Then the number of nodes in the right subtree is known, j-k-1. For depth, at least one subtree has to have depth i-1 so that the new made tree would have depth i. There are three possibilities: the left subtre 阅读全文
posted @ 2013-07-21 09:44 caniggia 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 。。 阅读全文
posted @ 2013-07-13 10:25 caniggia 阅读(134) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2013-07-06 15:48 caniggia 阅读(4) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2012-08-09 09:27 caniggia 阅读(1) 评论(0) 推荐(0) 编辑