摘要: Binary TreeTime Limit:1000MSMemory Limit:65536KTotal Submissions:5399Accepted:2502DescriptionBackgroundBinary trees are a common data structure in computer science. In this problem we will look at an infinite binary tree where the nodes contain a pair of integers. The tree is constructed like this:T 阅读全文
posted @ 2013-06-16 18:43 Jack Ge 阅读(301) 评论(0) 推荐(0) 编辑
摘要: Dirichlet's Theorem on Arithmetic ProgressionsTime Limit:1000MSMemory Limit:65536KTotal Submissions:13636Accepted:6808DescriptionIfaanddare relatively prime positive integers, the arithmetic sequence beginning withaand increasing byd, i.e.,a,a+d,a+ 2d,a+ 3d,a+ 4d, ..., contains infinitely many p 阅读全文
posted @ 2013-06-16 16:55 Jack Ge 阅读(376) 评论(0) 推荐(0) 编辑
摘要: Balanced LineupTime Limit:5000MSMemory Limit:65536KTotal Submissions:27567Accepted:12955Case Time Limit:2000MSDescriptionFor the daily milking, Farmer John'sNcows (1 ≤N≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the 阅读全文
posted @ 2013-06-16 10:50 Jack Ge 阅读(404) 评论(0) 推荐(0) 编辑
摘要: Nearest Common AncestorsTime Limit:1000MSMemory Limit:10000KTotal Submissions:14221Accepted:7596DescriptionA 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-06-16 08:57 Jack Ge 阅读(308) 评论(0) 推荐(0) 编辑