点击打开链接
题意:有N个物品,每个物品在都有一个截止日期,如果在截止日期之前(包括截止日期)卖出将会获得相应的利润,卖出物品需要一个单位时间,问最多能获得多少利润?
思路:将利润从大到小排序,尽量在该物单位时间出售利润大的物品,这样就能使得从利润达到最大。
#include
#include
#include
#include
using namespace...
分类:
其他好文 时间:
2014-08-12 13:40:24
阅读次数:
147
Supermarket
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 9103
Accepted: 3891
Description
A supermarket has a set Prod of products on sale. It earns a pr...
分类:
其他好文 时间:
2014-08-12 00:45:03
阅读次数:
213
# include
# include
# include
using namespace std;
int fa[10010];
struct node
{
int p;
int d;
};
struct node a[10010];
bool cmp(node a1,node a2)//利润从大到小
{
return a1.p>a2.p;
}
int find(int x)
{...
分类:
其他好文 时间:
2014-08-03 10:16:25
阅读次数:
208