51nod 1257 背包问题 V3
分数规划。
#include
using namespace std;
const int MAXN=50050;
long long resw,resp;
int n,k;
struct node
{
int w,p;
double rate;
}a[MAXN];
bool cmp(node n1,node n2)
{
return n1.rate>n2.rate;
}
bool
转载
2017-02-15 14:06:29 ·
258 阅读 ·
0 评论