摘要: 有N种物品,每种物品的数量为C1,C2……Cn。从中任选若干件放在容量为W的背包里,每种物品的体积为W1,W2……Wn(Wi为整数),与之相对应的价值为P1,P2……Pn(Pi为整数)。求背包能够容纳的最大价值。 Input 第1行,2个整数,N和W中间用空格隔开。N为物品的种类,W为背包的容量。( 阅读全文
posted @ 2017-08-23 21:42 #Egoist# 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Problem Description 大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了! 做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的道理一样。 话虽这样说,我还是要告诉大家,要想失败到一定程度也是不容易的。比如,我高中的时候,就有 阅读全文
posted @ 2017-08-23 15:53 #Egoist# 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concate 阅读全文
posted @ 2017-08-23 15:11 #Egoist# 阅读(209) 评论(0) 推荐(0) 编辑
摘要: The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies 阅读全文
posted @ 2017-08-23 14:43 #Egoist# 阅读(126) 评论(0) 推荐(0) 编辑