当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3946:Philosophy Girl’s Trail

题目描述
  Philosophy Girl Krolia was always on the go. No one could figure out where she was. It’s said that she traveled all over the world with only two kinds of items:books and staffs.
  Krolia had a knapsack which is composed of n*m grids, and every item can be fit into grids. All the books’ size is 1*2(2*1), and the staffs’ is 1*3(3*1) and each of them can be rotated 90, 180 or 270 degrees. Every item is assigned a value and Krolia wanted to go with the maximal value.
输入解释
  The first line comes with one integer T (T=100) which denotes the test cases.
  In the first line of each case, there is four integers n (1<=n<=500), m (1<=m<=500), n1 (1<=n1<=10000) and n2 (1<=n2<=10000) which indicates the size of the knapsack, the number of the optional books and staffs.
  The next line contains n1 integers which indicate the value bi (0<=bi<=1000) of every book.
  The last line contains n2 integers si (0<=si<=1000) which indicate the value of every staff.
输出解释
  For each test case, output one line.
  First, output "Case #C: ", where C is the number of test case, from 1 to T. Then output the maximal value.
输入样例
2
2 3 2 2
1 2
1 2
4 4 4 4
1 1 2 2
10 10 10 10
输出样例
Case #1: 4
Case #2: 44
提示
n,m,n1 and n2 <=100 in 20 cases.
50<=n,m<=500 and 1000<=n1,n2<=2000 in 50 cases.
100<=n,m<=200 and 9000<=n1,n2<=10000 in 30 cases.
来自杭电HDUOJ的附加信息
Author 哲学少女系列@Krolia Fans Club
Recommend xubiao

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3946

最后修改于 2020-10-25T23:08:35+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)