A:裸的广搜题,需要输出路径B:贪心抓住题目的特殊性,每个物品只有1 2 两种体积先按性价比排序,贪心的优先选择性价比高的,某次选了之后体积超了,就剪掉这样子遍历一遍之后还不是答案因为可能会有1体积的空位,而可能通过去掉已选集合中某个1体积的物品,再用一个2体积的物品替代达到更优解所以这里要判断一下View Code #include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int maxn = 100010;struct node { int type; in Read More
posted @ 2012-05-21 17:13 Because Of You Views(272) Comments(0) Diggs(0) Edit