摘要:
完全背包问题的变形,79ms,不过此题需要一个优化,就是把背包实际容量除以1000,不优化的话,数据量很大,会超时。刚开始优化直接定义成double,除了之后再乘,wa,因为有浮点误差,后来考虑了一下,改为了int,ac#include <iostream>
#include <cstdio>
using namespace std;
int amount;
int d,year;
int intere[11];
int v[11];
int f[100000];
int main()
{ int N; cin>>N; while(N--) { cin> 阅读全文
posted @ 2013-03-19 18:54
LJ_COME!!!!!
阅读(152)
评论(0)
推荐(0)

浙公网安备 33010602011771号