摘要: 首先,这次换了个算法来写,我用了Melkman问题就来了,不知道怎么的,POJ1113的话,代码上去倒是可以AC。。。但是在HDU的时候自己就o(╯□╰)o。。。到底是怎么疑惑ing。。。。View Code 1 #include <iostream> 2 #include <algorithm> 3 #include <stdio.h> 4 #include <math.h> 5 #include <string.h> 6 using namespace std; 7 const int maxn = 10005; 8 con... 阅读全文
posted @ 2012-10-01 21:06 YORU 阅读(348) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3030本来想的是DP的算法,但是DP的话明显要超时的。然后文哥告诉我的用树状数组的方法,我一直想怎么用树状数组来表示。。看文哥模拟,然后知道。。。想将数组离散化,然后记录第i个位置为结尾的序列的个数(就是DP的思想了)。。并且每次都要更新以 第 i 个元素为结尾的序列的当前的个数,这里用到了树状数组更新。View Code 1 #include <iostream> 2 #include <algorithm> 3 using namespace std; 4 const int ma 阅读全文
posted @ 2012-10-01 11:19 YORU 阅读(398) 评论(0) 推荐(0)