Investment HDU
来源:互联网 发布:制作朋友圈的软件 编辑:程序博客网 时间:2024/06/16 12:45
这个地方的dp表示的是有i×1000元可以的到的最大的利润,,
因为钱每次都会多,所以要更新。。
int dp[5000000];struct Node{ int c,val;}a[mxn];int main(){ int T;sf("%d",&T); while(T--){ int ans=0; int s,year;sf("%d%d",&s,&year);ans=s;s/=1000; int n;sf("%d",&n); rep(i,1,n){ sf("%d%d",&a[i].c,&a[i].val);a[i].c/=1000; } mem(dp,0); while(year--){ for(int i=1;i<=n;++i){ for(int j=a[i].c;j<=s;++j){ if(j>=a[i].c) dp[j]=max(dp[j],dp[j-a[i].c]+a[i].val); } } ans+=dp[s]; s=ans/1000; } pf("%d\n",ans); }}
阅读全文
0 0
- Investment HDU
- Investment HDU
- HDU 1963 Investment
- hdu 1963 Investment(完全背包)
- HDU 1963 Investment 多重背包
- HDU 1963 Investment 最大利息
- HDU 1963(Investment)完全背包
- HDU 2063 Investment 完全背包
- HDU 1963 Investment 完全背包
- hdu 1963 Investment 完全背包
- Investment
- HDU 1963 Investment (完全背包)
- HDU 2063 Investment (完全背包)
- HDU 2063 Investment(多次完全背包)
- HDU 1963 Investment(完全背包)
- hdu 1963 Investment (完全背包)
- Investment(POJ-2063 && HDU-1963)
- HDU 2063 Investment (完全背包+数据压缩)
- Keepliaved介绍
- 找规律+菊花图
- 什么是VB.NET-
- 35 个 Java 代码性能优化总结
- LJOJ 1576 Easy Problem
- Investment HDU
- 畅通工程 HDU
- 01背包
- 重签名提示:无法对jar进行签名,java.util.zip.ZipException: invalid entry compressed size
- HDU6098-Inversion
- 周末torch7闪电战(blitz)
- android toolbar menu navigationIcon
- Hibernate实例--注解配置表映射
- Ubuntu下搭建MIPS交叉编译环境