摘要: 思路:每次枚举每个工人的右边界j,维护最优的左边界k。那么dp[j]=max(dp[j],dp[k]+(j-k)*w[i].p);对于每个工人的初值k=w[i].s-1;令x=j-w[i].l,如果(k-x)*w[i].p>dp[k]-dp[x],则k=x。#include#include#include#include#include#include#include#include#include#include#include#define pb push_back#define mp make_pair#define Maxn 170010#define Maxm 200010#d 阅读全文
posted @ 2013-09-25 14:08 fangguo 阅读(242) 评论(0) 推荐(0) 编辑