HDU-1087.Super Jumping! Jumping! Jumping!

Posted 季末Despaire

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HDU-1087.Super Jumping! Jumping! Jumping!相关的知识,希望对你有一定的参考价值。

做了动归几道题了,还是没有怎么明白需要怎么用动归解题,状态不怎么找的准,状态转移方程在确定了状态还行,还能想出来,总之还是多做题吧!

#include<iostream>
#include<cstdio>
#include<memory.h>
using namespace std;
int a[1005],d[1005];
int main()
{
   int i,j,n,value;
   while(scanf("%d",&n)&&n){
     memset(d,0,sizeof(d));
     for(i=1;i<=n;i++)
        cin >>a[i];
     value=a[0];
     for(i=1;i<=n;i++){
        for(j=0;j<i;j++){
            if(a[i]>a[j]) d[i]=max(d[i],d[j]+a[i]);
            value=max(value,d[i]);
        }
     }
     cout <<value<<endl;
   }
   return 0;
}

 

以上是关于HDU-1087.Super Jumping! Jumping! Jumping!的主要内容,如果未能解决你的问题,请参考以下文章

HDU 1087 Super Jumping! Jumping! Jumping! (DP+LIS)

HDu1087 Super Jumping! Jumping! Jumping!

HDU-1087.Super Jumping! Jumping! Jumping!

hdu 1087 Super Jumping! Jumping! Jumping! (dp最大递增字段和)

HDU - 1087 Super Jumping! Jumping! Jumping!(dp)

hdu 1087 Super Jumping! Jumping! Jumping!