传送门 zhx and contest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 145    Accepted Submission(s): 49 Problem Description As one of the most powerful brushes in the world, zhx usually takes part…
Problem Description As one of the most powerful brushes in the world, zhx usually takes part in all kinds of contests. One day, zhx takes part in an contest. He found the contest very easy for him. There are n problems in the contest. He knows that h…
传送门 zhx's contest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 575    Accepted Submission(s): 181 Problem Description As one of the most powerful brushes, zhx is required to give his juniors…
zhx and contest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 455    Accepted Submission(s): 158 Problem Description As one of the most powerful brushes in the world, zhx usually takes part i…
zhx and contest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 757    Accepted Submission(s): 282 Problem Description As one of the most powerful brushes in the world, zhx usually takes part in…
zhx's contest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 3835    Accepted Submission(s): 1255 Problem Description As one of the most powerful brushes, zhx is required to give his juniors n…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=3339 In Action Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7869    Accepted Submission(s): 2674 Problem Description Since 1945, when the first…
题目链接:https://vjudge.net/contest/103424#problem/A 题目大意: 第一行输入几组数据,第二行第一个数字代表物体个数,第二个数代表总体积.需要注意的是,第三排输入的是物品的价值,第四排的物品的体积.在不可以拆分物体的前提下,已知背包的总体积,最大能获取的价值是多少. 01背包模板题,没什么好说的.(附两种形式的dp数组解决方案) //一维dp数组实现(滚动数组) #include <iostream> #include <cstdio> #…
http://acm.hdu.edu.cn/showproblem.php?pid=6083 题意: 思路: 01背包+路径记录. 题目有点坑,我一开始逆序枚举菜品,然后一直WA,可能这样的话路径记录会有点问题. #include<iostream> #include<algorithm> #include<cstring> #include<cstdio> #include<sstream> #include<vector> #in…
题意: 要买一些东西,每件东西有价格和价值,但是买得到的前提是身上的钱要比该东西价格多出一定的量,否则不卖.给出身上的钱和所有东西的3个属性,求最大总价值. 思路: 1)WA思路:与01背包差不多,dp过程中记录每个容量所能获得的最大价值以及剩余的容量.实现是,开个二维dp数组,从左往右扫,考虑背包容量为j的可获得价值量,根据该剩余容量得知要更新后面哪个背包容量[j+?] ,如果剩余容量大于q[i]那么可以直接装进去,更新价值以及剩余容量,否则,考虑更新的是更大的背包容量.这个思路有缺陷,一直找…