09 2013 档案

摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4768思路:解题关键是奇数+偶数=奇数,然后我们就是枚举奇数位置(奇数为就一个或者0个),然后计算左边的和是否为奇数,如果是奇数,那么该点就存在与左边,否则存在于右边#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define CL(arr, val) memset(arr, val... 阅读全文
posted @ 2013-09-30 10:59 E_star 阅读(268) 评论(0) 推荐(0) 编辑
摘要:http://acm.zju.edu.cn/changsha/showProblem.do?problemId=31题意:给你n个非负整数,然后输入n个x[i],x[i] == -1表示第i个数不知道是多少,x[i] != -1表示第i个数是x[i], 然后我们在给出每个数和他左右邻居的和,起点终点只有两个数的和a[i],输入下标x求x[i]可能取得的最大值,如果x[i]已经知道就输出x[i];思路:首先我们分析可以知道x[2],x[5],x[8] ..... 都是已经知道的(下标从零开始), 其次我们只要知道其中的除了x[2],x[5]..这种情况的数的其他任意一个我们都能够求出整个序列,所 阅读全文
posted @ 2013-09-30 10:55 E_star 阅读(268) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4745题意:有两只兔子Tom Jerry, 他们在一个用石头围城的环形的路上跳, Tom只能顺时针跳,Jerry只能逆时针跳, 要求在跳的过程中他们所在石头的权值必须相同,而且只能单向跳,中间不能有已经跳过的石头。思路:模型就是求环上的最长回文串,我们只要将原串倍增,然后每个长度为n的子串的最长回文串就是我们要求的。区间DP一下就好了, 注意要考虑起点终点是统一点的情况特殊。//#pragma comment(linker, "/STACK:1024000000,1024000000")# 阅读全文
posted @ 2013-09-20 10:02 E_star 阅读(266) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4739题意:给定100*100的矩阵中n(n#include #include #include #include #include #include #include #include #include #include #include #include #include #define CL(arr, val) memset(arr, val, sizeof(arr))#define lc l,m,rt> 1#define Min(x, y) (x) pt[M][M];//记录每个位置点的个... 阅读全文
posted @ 2013-09-19 17:29 E_star 阅读(244) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示