链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4705
题意:给出两棵二叉树A和B,问分别处于A中的子树a和处于B中的子树b结构相同的有多少对。
思路:哈希的想法,不同的数字对应的是不同的结构,比如1代表着单独的叶子结点,2代表着有左子树是叶子结点而没有右子树的子树...每出现一种新的子树情形就记录下来,记录的方式是...
分类:
其他好文 时间:
2014-09-05 18:17:11
阅读次数:
206
Cliff Climbing
Time Limit: 10 Seconds Memory Limit: 32768 KB
At 17:00, special agent Jack starts to escape from the enemy camp. There is a cliff in between the camp and the nearest safety...
分类:
其他好文 时间:
2014-09-05 18:13:01
阅读次数:
296
poj1056 & hdu1305 & zoj1808 Immediate Decodability(字典树变形)...
分类:
其他好文 时间:
2014-09-05 11:29:31
阅读次数:
292
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1315题目意思:Bill Hates 是公司的老总,她管辖着很多程序员,每个程序员都有各自的上头。现在为了庆祝2013年的到来,要向这些程序员发放新年奖金。不过要遵循一些...
分类:
其他好文 时间:
2014-09-04 23:31:50
阅读次数:
308
Easter Holidays
Time Limit: 1 Second Memory Limit: 32768 KB Special Judge
Scandinavians often make vacation during the Easter holidays in the largest ski resort Are. Are provides fan...
分类:
其他好文 时间:
2014-09-04 22:21:58
阅读次数:
275
HDU1312 / POJ1979 / ZOJ2165 Red and Black(红与黑) DFS解题报告...
分类:
其他好文 时间:
2014-09-04 10:31:49
阅读次数:
355
有时候像这种题,没有明显的思路,感觉像规律题。那么先暴力打表,再找规律就很快了。
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3798
先上我的暴力打表,这种肯定是TLE的,只用它发现规律就好了。
#include
#include
#include
#define INF 0x3f3f3f3f
#def...
分类:
其他好文 时间:
2014-09-03 22:48:57
阅读次数:
287
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1313题目意思:有 N 个人(编号依次为1~N)围成一个圆圈,要求求出最大的 K (1 ≤ K≤ N/2),表示从编号为1的人开始,将球传递给他后一个人数起的第K个人,第...
分类:
其他好文 时间:
2014-09-03 22:32:37
阅读次数:
269
题目相关: 3798相关链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5330 Alice和Bob玩数字游戏, 这次Alice和Bob玩的是绝对值游戏. (Alice和Bob以前只玩博弈类游戏, 现在开始玩数列了...
分类:
其他好文 时间:
2014-09-03 14:54:16
阅读次数:
224