摘要: Tourists 时间限制: 5 Sec 内存限制: 64 MB 题目描述 In Tree City, there are n tourist attractions uniquely labeled 1 to n. The attractions are connected by a set of 阅读全文
posted @ 2016-10-25 13:22 mxzf0213 阅读(568) 评论(0) 推荐(0) 编辑
摘要: 在竞赛中如果系统栈很小的话,过深的递归会让栈溢出,这个时候我们就要自己手写栈,将递归转化成手工栈。 方法其实也很简单。 基本思路上,我们就是用栈不断的pop,push。但是何时push,何时pop呢? 在《算法导论》上对深度优先遍历树的讲解中,在深度遍历中,会对每个节点进行染色,白色为没有被访问过; 阅读全文
posted @ 2016-10-25 11:41 mxzf0213 阅读(720) 评论(0) 推荐(0) 编辑
摘要: Remember the Word Neal is very curious about combinatorial problems, and now here comes a problem about words. Knowing that Ray has a photographic mem 阅读全文
posted @ 2016-10-25 00:21 mxzf0213 阅读(230) 评论(0) 推荐(0) 编辑