摘要:
/*动态规划之路第二题;求最长非递增数列条数;*/#include
int main()
{ int n,i,j,x,m,dp[1005]; while(scanf("%d",&n)!=EOF&&n) { dp[1]=0;m=0; //m代表最长递减序列个数 //dp[i]代表第i个最长递减序列中当前状态的所含元素最小值 for(i=1;im) dp[++m]=x; } printf("%d\n",m); } return 0;
} 阅读全文
posted @ 2013-03-30 20:46
简洁是智慧的灵魂
阅读(150)
评论(0)
推荐(0)
摘要:
//这算是一个历史遗留问题吧;//一直没有去尝试做动态规划的题目//说道理,就是像是心里有种恐惧//因为听说。。。听说动态规划很难//所以就连这入门的都没敢去AC//今天开始,深入看看吧。。。//菜鸟~~~#include #include #include #include #include #include #include int ta[105][105];
using namespace std;
int main(int argc, char *argv[])
{ int c,n; scanf("%d",&c); while(c--) { scanf(&q 阅读全文
posted @ 2013-03-30 12:38
简洁是智慧的灵魂
阅读(158)
评论(0)
推荐(0)

浙公网安备 33010602011771号