摘要: Closest Common AncestorsTime Limit:2000MSMemory Limit:10000KTotal Submissions:12745Accepted:4162DescriptionWrite a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The closest com 阅读全文
posted @ 2013-05-10 16:32 Jack Ge 阅读(1317) 评论(2) 推荐(2) 编辑
摘要: Nearest Common AncestorsTime Limit:1000MSMemory Limit:10000KTotal Submissions:13981Accepted:7454DescriptionA rooted tree is a well-known data structure in computer science and engineering. An example is shown below:In the figure, each node is labeled with an integer from {1, 2,...,16}. Node 8 is the 阅读全文
posted @ 2013-05-10 15:02 Jack Ge 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Pushing BoxesTime Limit:2000MSMemory Limit:131072KTotal Submissions:3943Accepted:1394Special JudgeDescriptionImagine you are standing inside a two-dimensional maze composed of square cells which may or may not be filled with rock. You can move north, south, east or west one cell at a step. These mov 阅读全文
posted @ 2013-05-10 09:23 Jack Ge 阅读(297) 评论(0) 推荐(0) 编辑