HDU 1087 Super Jumping! Jumping! Jumping!
2013-09-21 21:14
357 查看
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1087
#include <stdio.h> #include <string.h> int dp[1050],x[1050],num[1050]; void main() { int n,i,j,k,max; while(scanf("%d",&n)!=EOF&&n) { memset(dp,0,sizeof(dp)); memset(num,0,sizeof(num)); k=0; for(i=1;i<n+1;i++) { memset(x,0,sizeof(x)); scanf("%d",&num[i]); max=0; for(j=i;j>0;j--) { if(num[i]>num[j-1]) x[j]=j-1; if(dp[x[j]]>max) max=dp[x[j]]; } dp[i]=max+num[i]; if(dp[i]>k) k=dp[i]; } printf("%d\n",k); } }
相关文章推荐
- HDU 1087 Super Jumping! Jumping! Jumping!
- HDU 1087 Super Jumping! Jumping! Jumping!
- HDU 1087 —— Super Jumping! Jumping! Jumping!
- HDU 1087 Super Jumping! Jumping! Jumping!(最大上升子序列和)
- hdu 1087 Super Jumping! Jumping! Jumping!
- hdu 1087 Super Jumping! Jumping! Jumping!
- HDU 1087 Super Jumping! Jumping! Jumping!(最长上升子序列,dp)
- hdu 1087 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! 最大子序列的和
- hdu 1087 Super Jumping! Jumping! Jumping!
- HDU 1087 Super Jumping! Jumping! Jumping!(dp)
- Super Jumping! Jumping! Jumping! HDU - 1087
- HDU - 1087 Super Jumping! Jumping! Jumping!(dp)
- HDU 1087 Super Jumping! Jumping! Jumping!
- HDU 1087 Super Jumping! Jumping! Jumping!【DP】
- HDU 1087 Super Jumping! Jumping! Jumping!
- HDU 1087 Super Jumping! Jumping! Jumping!