摘要: 这个很简单。。中间细节处理,没想清楚,乱改了一下,终于1Y了。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: zerosum 5 */ 6 #include <iostream> 7 #include <cstdio> 8 #include <cstring> 9 #include <cmath>10 #include <algorithm>11 using namespace std;12 int o[21],n;13 int judge()14 {15 int i;16 int sum = 0,tem 阅读全文
posted @ 2012-11-12 21:39 Naix_x 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 不好刷了,这个题想了会,中间还想过卡特兰数列。。。不过好在按照第一感觉就应该是DP,想出了三维的状态转移。。。又MLE,也是不知道给出的提示是神马意思。。。改了滚动数组,过了。效率也不是很高,差点挂掉。dp[i][j][k] 代表第i层,总数为j,最后一层为k个的二叉树种类,然后在这k个上继续搞i+1层。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: nocows 5 */ 6 #include <iostream> 7 #include <cstdio> 8 #include <cstring> 9 #include < 阅读全文
posted @ 2012-11-12 21:14 Naix_x 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 这个题目纠结的输入啊,根本不知道如何读入啊。借鉴一下别人的读入,然后写了个DFS,一直挂在最后一组数据上了。。。记忆化了一下还是挂了,看别人读入的时候,看过别人的思路,然后换思路+优化后,终于过了。。。用字典树应该会更快,用map水过了。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: prefix 5 */ 6 #include <iostream> 7 #include <cstdio> 8 #include <cstring> 9 #include <cmath>10 #include <algorithm 阅读全文
posted @ 2012-11-12 19:03 Naix_x 阅读(174) 评论(0) 推荐(0) 编辑