Shirlies
宁静专注认真的程序媛~
摘要: 不知道0ms思路是咋样的,偶滴代码15ms……就是转换成一维数组,然后求最大子序列和……代码如下: 1 #include <cstdio> 2 #include <cstring> 3 4 int n; 5 int inp[105][105]; 6 int temp[105][105]; 7 8 int get_sum(int t[]) 9 {10 int dp[105];11 12 dp[0]= t[0];13 for(int i = 1;i < n;i ++)14 {15 if(dp[i-1]>= 0)16 dp[... 阅读全文
posted @ 2012-08-15 17:35 Shirlies 阅读(167) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1078人家说是简单题,我说是神题,这个就是大大滴差距\可怜神奇的DP+记忆化搜索只要将各个方向递归退栈后得到的最大值用dp[x][y](这里的最优就是各个方向上的最大值加上此处的cheese)记录下来,以后如果再次搜索到这个地方时可以直接返回该处的值……ps一句:看了别人的题解后才弄出来的……代码如下: 1 #include <cstdio> 2 #include <cstring> 3 4 int dp[105][105]; 5 int inp[105][105]; 6 int n, 阅读全文
posted @ 2012-08-15 16:16 Shirlies 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 啥也不说,就是求最长递增子序列,就说这一题的输出,偶服了,还要分复数和单数……囧死了……代码就不贴了…… 阅读全文
posted @ 2012-08-15 00:44 Shirlies 阅读(279) 评论(0) 推荐(1) 编辑