![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
dp动态划归
Aaron_Koyalun
这个作者很懒,什么都没留下…
展开
-
放苹果 poj
本题用dp法,dp[m][n],m为当前苹果数,n为当前盘子数。当m>=n时,有两种情况,一种是每个盘子都放了一个苹果,一种是有一个盘子没苹果,因此dp[m][n]=dp[m-n][n]+dp[m][n-1];m初始化:dp[i][1]=1;dp[0][i]=1;//// main.cpp// beginner//// Created by Aaron X原创 2017-03-26 13:22:17 · 352 阅读 · 0 评论 -
拦截导弹 poj
dp法。一维。maxint[i]表示到第i颗导弹为止最多拦截的导弹数目。技巧:temp#include #include #include #include #include #include #include #include #include #include using namespace std;int maxint[2000];int b[200原创 2017-03-26 21:43:31 · 527 阅读 · 0 评论 -
最大上升子序列和 poj
dp法。maxim[i]表示到第i位的最大上升子序列和。#include #include #include #include #include #include #include #include #include #include using namespace std;int maxsum[2000];int b[2000];int main(){原创 2017-03-26 22:17:39 · 509 阅读 · 0 评论