[hdu3466]Proud Merchants】的更多相关文章

Proud Merchants Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 5599    Accepted Submission(s): 2362 Problem Description Recently, iSea went to an ancient country. For such a long time, it was…
题目传送门 Proud Merchants Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 7536    Accepted Submission(s): 3144 Problem Description Recently, iSea went to an ancient country. For such a long time, i…
题目描述 Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the people in this country are still very proud even if their nation hasn't been so wealthy any more. The me…
https://vjudge.net/problem/HDU-3466 一开始想到了是个排序后的背包,但是排序的策略一直没对. 两个物品1和2,当p1+q2>p2+q1 => q1-p1<q2-p2时选1. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cstdlib> #include<cmath>…
题目http://acm.hdu.edu.cn/showproblem.php?pid=3466 分析:这个题目增加了变量q 因此就不能简单是使用01背包了. 网上看到一个证明: 因为如果一个物品是5 9,一个物品是5 6,对第一个进行背包的时候只有dp[9],dp[10],-,dp[m], 再对第二个进行背包的时候,如果是普通的,应该会借用前面的dp[8],dp[7]之类的 但是现在这些值都是0,所以会导致结果出错. 于是要想到只有后面要用的值前面都可以得到,那么才不会出错. 设A:p1,q1…
I - Proud Merchants Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Description Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the…
题目链接: 传送门 Proud Merchants Time Limit: 1000MS     Memory Limit: 65536K Description Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the people in this country are…
Proud Merchants Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 3557 Accepted Submission(s): 1479 Problem Description Recently, iSea went to an ancient country. For such a long time, it was the m…
Proud Merchants Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 4257    Accepted Submission(s): 1757 Problem Description Recently, iSea went to an ancient country. For such a long time, it was…
Proud Merchants Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 131072/65536K (Java/Other) Total Submission(s) : 12   Accepted Submission(s) : 5 Problem Description Recently, iSea went to an ancient country. For such a long time, it was the mo…