10130专题

uva 10130 简单背包

题意: 背包和 代码: #include <iostream>#include <cstdio>#include <cstdlib>#include <algorithm>#include <cstring>#include <cmath>#include <stack>#include <vector>#include <queue>#include <map>

uva 10130 超级甩卖 SuperSale

题目大意: 一个商场打促销,所有的东西都有价格和重量,你打算趁着促销的时候带着一家老小来抢购。每个人拿东西规定一样只能拿一个,问你最后全家总共拿了的物品的价值。 思路见代码下方: #include<iostream>#include<algorithm>#include<cstdio>#include<vector>#include<cstring>#include<stri

uva 10130 SuperSale

题意:有t组测试数据,有N(1<=N<=1000)个物品,每个物品都有对应的价值P(1<=P<=100)和重量W(1<=W<=30),然后有m(1<=M<=30)个人,每个人都有能背负的最大重量,问能得到的最大的价值是多少。(多个01背包) #include <iostream>#include <cstdio>#include <cstring>using namespace std