POJ1456 贪心

1 题意:有n个商品,给出它卖出的价值以及必须在第几天之前卖出去(deadline),在某一天只能卖出一种商品。请问最佳的销售计划。

2 分析:

容易想错题意,其样例可能是具有迷惑性的,即你想错了题意其样例也是可能过的。

3

#include 
#include 
#include 
#include 
#include 
using namespace std;

const int maxn=10010;
typedef long long ll;
int n;
int order[maxn];
ll ans;
struct Node{
    int value;
    int date;
}node[maxn];
priority_queue  que_temp;
bool cmp(struct Node n1,struct Node n2){
    if(n1.date>n2.date){
        return 1;//大日期在前
    }
    else if(n1.date==n2.date){
        return n1.value=1;i--){
        int bj=0;
        for(int j=cur;j<=n;j++){
            if(node[j].date>=i&&node[j].date!=node[j+1].date){
                if(!que_temp.empty()&&node[j].value=i&&node[j].date==node[j+1].date){
                //cout<<"c"<

你可能感兴趣的:(ACM,策略)