摘要: Binary 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: The root contains the pair (1, 1). If a node contains (a, b) then its left child contains (a + b, b) and its right child (a, a + b) 阅读全文
posted @ 2012-10-26 23:56 zerojetlag 阅读(287) 评论(0) 推荐(0) 编辑
摘要: description In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d stands for digitadition, a term coined by Kaprekar.) For example, d(75) = 75 + 7 + 5 = 87. Given any positive integer n as a starting point, you can construct the infinite increasing sequence of integers n, d(n), d(d(n)), d(d(d(n))), .... 阅读全文
posted @ 2012-10-26 23:54 zerojetlag 阅读(437) 评论(0) 推荐(0) 编辑
摘要: 水题,简单的转换2种历法就可以了,要注意2个历法的最小公倍数 阅读全文
posted @ 2012-10-26 23:53 zerojetlag 阅读(1077) 评论(0) 推荐(1) 编辑
摘要: 题目意思就是称量3次,从12个硬币中找出一个假币,可能是轻或者重。只需简单枚举就可以了。 阅读全文
posted @ 2012-10-26 23:51 zerojetlag 阅读(197) 评论(0) 推荐(0) 编辑