摘要: 问题描述: 求出两个字符串中的最长公子序列的长度。 输入: cnblog belong 输出: max length = 4 #include #include int arr[200][200]; /* 表示str1的前i位和str2的前j位的最长公子序列的... 阅读全文
posted @ 2013-01-30 15:08 司青 阅读(199) 评论(0) 推荐(0)
摘要: 问题描述: 背包的最大容量为W,有N件物品,每件物品重量为w,价值为p,怎样选择物品能使得背包里的物品价值最大? 输入: 10 3 (W,N) 4 5 (w,p) 6 7 (w,p) 8 9 (w,p) #include #define THING 20#d... 阅读全文
posted @ 2013-01-30 12:45 司青 阅读(160) 评论(0) 推荐(0)