摘要: 题目链接终于过了,边界让我wa了好几次,猥琐的用AC代码对拍,很无奈,用非常麻烦的方法。写一下,估计以后再碰到,肯定看不懂这是写的什么了。以前做过,统计1和2的,统计0比1和2麻烦多了,有前导0的情况,不太好弄。算是用统计方法,先把sp[len-1]所有的加上,长度为len-1的情况。然后就是长度为len的情况。从高位到低位,遍历。如果此位是0,judge(str+1) + 1 + dfs(str+1),是统计当前为是0的,多少情况,但是会漏解,算是受以前那个题统计1和2的影响把。如果下一位是0,那么就不用管了,交给下位统计去把。下位不是0,计算会漏掉下位是0的情况,所以定住下位是0,组合一下 阅读全文
posted @ 2013-08-09 21:08 Naix_x 阅读(364) 评论(0) 推荐(0) 编辑
摘要: 题目链接中间计算的各种细节。有的细节没处理好,就wa了。。。主要思路就是根据卡特兰数列的:h(n)= h(0)*h(n-1)+h(1)*h(n-2) + ... + h(n-1)h(0) (n>=2) 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 #define LL __int6410 LL ctl[101];11 LL sum[101];12 struct node13 {14 int l,r;15 }tree[... 阅读全文
posted @ 2013-08-09 17:05 Naix_x 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 题目链接 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define LL __int64 9 #define MOD 100000000710 #define INF 0xffffff11 int dp[101][101],g[101][101],pre[101][101];12 int ans[1001];13 int main()14 {15 int n,m,minz,i,j,k,sv,ev,w,num,temp;16 wh... 阅读全文
posted @ 2013-08-09 10:10 Naix_x 阅读(205) 评论(0) 推荐(0) 编辑