BOANY
Home
ProblemSet
Source/Category
Contest
Status
Ranklist
F.A.Qs
历年真题
推荐题单
Login
Register
1217: 装箱问题
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:128
Solved:49
Submit
Submit Record
Statistics
ShowOff!
Description
有一个箱子容量为 v(正整数,0≤v≤20000),同时有 n 个物品(0<n≤30),每个物品有一个体积(正整数)。
要求从 n 个物品中,任取若干个装入箱内,使箱子的剩余空间为最小。
Input
箱子的容量 v
物品数 n
接下来 n 行,分别表示这 n 个物品的体积
Output
箱子剩余空间
Sample Input
Copy
24 6 8 3 12 7 9 7
Sample Output
Copy
0
Source/Category
动态规划
背包问题
Submit
Submit Record
Statistics
ShowOff!