题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3769
Diablo III
Time Limit: 2 Seconds Memory Limit: 65536 KB
Diablo III is an action role-playing video game. A fe...
分类:
其他好文 时间:
2014-05-18 18:40:35
阅读次数:
345
分析:暴力要超时,所以把每个数字转换为长度为32的0-1字符串,用字典树。因为其公共前缀的特性,空间上可以承受。因为是二叉树,用node[SIZE][2]存放。不知道new速度是否会慢很多,所以没用指针。...
分类:
其他好文 时间:
2014-05-18 18:37:37
阅读次数:
218
http://acm.hdu.edu.cn/showproblem.php?pid=2066
求多源多汇的最短路,n最大为1000,floyd三重循环会超时。继续dijkstra吧。
#include
#include
#include
#include
#include
#include
#include
#include
#define LL long long
#...
分类:
其他好文 时间:
2014-05-18 18:26:39
阅读次数:
238
求树的最大路径和(Binary Tree Maximum Path Sum)...
分类:
其他好文 时间:
2014-05-18 18:25:41
阅读次数:
235
http://acm.hdu.edu.cn/showproblem.php?pid=3790
有两个条件:距离和花费。首先要求距离最短,距离相等的条件下花费最小。
dijkstra,只是在判断条件时多考虑了花费。
注意重边。
#include
#include
#include
#include
#include
#include
#include
#incl...
分类:
其他好文 时间:
2014-05-18 15:14:22
阅读次数:
235
今天下午做了一下之前晚上的CF,晚上强哥就来了。
又见到强哥了,感受挺多的,还记得大二上学期的区域赛就是强哥带着我们打的,但是没打好,给强哥丢人了。这次强哥来,我省赛又打成那样,真是没脸见人了。。。
想想现在已经坚持做ACM三年了,一路走来,颇为艰辛。自己总是没有一个固定的队友。大一的时候,ZRQ和YST跟我一队,当时我们还是一个宿舍,讨论问题什么的都挺方便的。可是后来的时候,他们俩都退队了。...
分类:
其他好文 时间:
2014-05-18 13:36:58
阅读次数:
208
【题目】
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.
You may not alter the values in the nodes, only n...
分类:
其他好文 时间:
2014-05-18 10:22:34
阅读次数:
367
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4648
Magic Pen 6
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 1857 Accepted Submiss...
分类:
其他好文 时间:
2014-05-18 04:56:14
阅读次数:
317
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4810
思路:先把每个数字按位分离出来,存放1的个数,那么每位0的个数为n - 1的个数,然后利用组合数学和异或的原理,枚举奇数个1的情况,然后利用乘法和加法计数原理累加出来的就是该位的答案,最后乘上改为对应的数值最后加起来就是答案
代码:
#include
#include
const _...
分类:
其他好文 时间:
2014-05-18 04:30:41
阅读次数:
257
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4662
MU Puzzle
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1296 Accepted Submissio...
分类:
其他好文 时间:
2014-05-18 04:16:16
阅读次数:
407