背包问题
Let_life_stop
和强者对战才是提升自己最快的方法。
展开
-
C - Contest Setting Gym - 101982C dp 补题
题目链接:https://vjudge.net/contest/273260#problem/C 学习了一下别人的思路,首先去重,然后离散化。 dp数组开二维,每一次更新,状态转移方程,dp[ i ][ j ] = (dp[ i-1] [ j ]+dp[ i-1] [ j -1 ]*(ans[ i ]))%mod; 第i种商品第j种(j<=k)的时候,等于第i-1个商品第j种的总方法数...原创 2018-11-30 00:52:19 · 258 阅读 · 0 评论 -
背包
1, 01背包 题目:hdoj 2546 代码: #include<iostream> #include<string> #include<cstring> #include<iomanip> #include<algorithm> #include<map> #include<queue> #inclu原创 2018-07-18 17:26:48 · 174 阅读 · 0 评论