摘要: 一、题目描述Two players, Singa and Suny, play, starting with two natural numbers. Singa, the first player, subtracts any positive multiple of the l... 阅读全文
posted @ 2016-06-10 10:50 chenximcm 阅读(400) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述The N cities of Estiah are connected by N-1 roads. The roads are built in a way that it’s always possible to travel between any two cit... 阅读全文
posted @ 2016-06-09 23:03 chenximcm 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述We wish to tile a grid 4 units high and N units long with rectangles (dominoes) 2 units by one unit (in either orientation). For exampl... 阅读全文
posted @ 2016-06-09 16:53 chenximcm 阅读(411) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述There is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunat... 阅读全文
posted @ 2016-06-09 14:50 chenximcm 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述给定一个整数,请将该数各个位上数字反转得到一个新数。新数也应满足整数的常见形式,即除非给定的原数为零,否则反转后得到的新数的最高位数字不应为零(参见样例2)。二、输入输入共 1 行,一个整数N。-1,000,000,000 ≤ N≤ 1,000,000,000。三、输出... 阅读全文
posted @ 2016-06-08 00:49 chenximcm 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述In computer science and information theory, a Huffman code is an optimal prefix code algorithm.In this exercise, please use Huffman cod... 阅读全文
posted @ 2016-06-08 00:33 chenximcm 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn-1 + Fn-2 for n ≥ 2. For example, the first ten terms of the Fibonacci se... 阅读全文
posted @ 2016-06-08 00:14 chenximcm 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn-1 + Fn-2 for n ≥ 2. For example, the first ten terms of the Fibonacci se... 阅读全文
posted @ 2016-06-07 23:12 chenximcm 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如,则重建二叉树并返回。二、输入描述输入一个树的前序和中序,例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8... 阅读全文
posted @ 2016-05-30 21:01 chenximcm 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述输入一个链表,从尾到头打印链表每个节点的值。 二、输入描述输入为链表的表头三、输出描述使用vector按链表从尾到头保存节点四、牛客网提供的类框架/*** struct ListNode {* int val;* struct ListNo... 阅读全文
posted @ 2016-05-30 17:34 chenximcm 阅读(151) 评论(0) 推荐(0) 编辑