思路:按高度的限制大小排序,再多重背包
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#define CL(a,b) memset(a,b,sizeof(a))
#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
#define INF 0x7ffffff
using namespace std;
const int M(40010);
const int N(410);
int f[M];
struct data{
int h,c,a;
}val[N];
bool cmp(data x,data y)
{
return x.a<y.a;
}
int main()
{
int n,i,j,k;
while......
阅读全文