摘要: "Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can 阅读全文
posted @ 2018-08-19 18:29 A-Little-Nut 阅读(244) 评论(0) 推荐(0) 编辑
摘要: Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are fri 阅读全文
posted @ 2018-08-19 18:28 A-Little-Nut 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and ino 阅读全文
posted @ 2018-08-19 18:26 A-Little-Nut 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are 阅读全文
posted @ 2018-08-19 18:21 A-Little-Nut 阅读(220) 评论(0) 推荐(0) 编辑
摘要: British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an "Eddington number", E that i 阅读全文
posted @ 2018-08-19 18:18 A-Little-Nut 阅读(203) 评论(0) 推荐(0) 编辑
摘要: "Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of th 阅读全文
posted @ 2018-08-19 18:12 A-Little-Nut 阅读(281) 评论(0) 推荐(0) 编辑
摘要: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes 阅读全文
posted @ 2018-08-19 18:09 A-Little-Nut 阅读(173) 评论(0) 推荐(0) 编辑
摘要: This time, you are supposed to help us collect the data for family owned property. Given each person's family members, and the estate(房产)info under hi 阅读全文
posted @ 2018-08-19 18:07 A-Little-Nut 阅读(185) 评论(0) 推荐(0) 编辑
摘要: Given a set of N ( 1) positive integers, you are supposed to partition them into two disjoint sets A1 and A2 of n1​​ and n​2 numbers, respectively. Le 阅读全文
posted @ 2018-08-19 18:03 A-Little-Nut 阅读(169) 评论(0) 推荐(0) 编辑
摘要: On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear rep 阅读全文
posted @ 2018-08-19 17:58 A-Little-Nut 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is t 阅读全文
posted @ 2018-08-19 17:53 A-Little-Nut 阅读(252) 评论(0) 推荐(0) 编辑
摘要: Given a tree, you are supposed to tell if it is a complete binary tree. Input Specification: Each input file contains one test case. For each case, th 阅读全文
posted @ 2018-08-19 17:42 A-Little-Nut 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following: The number of people in each 阅读全文
posted @ 2018-08-19 17:37 A-Little-Nut 阅读(210) 评论(0) 推荐(0) 编辑
摘要: The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input n 阅读全文
posted @ 2018-08-19 17:35 A-Little-Nut 阅读(167) 评论(0) 推荐(0) 编辑
摘要: When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A socia 阅读全文
posted @ 2018-08-19 17:33 A-Little-Nut 阅读(182) 评论(0) 推荐(0) 编辑
摘要: A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商) everyone involved in moving a product from supplier to customer. 阅读全文
posted @ 2018-08-19 17:29 A-Little-Nut 阅读(154) 评论(0) 推荐(0) 编辑
摘要: This time your job is to fill a sequence of N positive integers into a spiral matrix in non increasing order. A spiral matrix is filled in from the fi 阅读全文
posted @ 2018-08-19 17:26 A-Little-Nut 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence {0.1, 0.2, 0.3, 0.4}, we h 阅读全文
posted @ 2018-08-19 17:22 A-Little-Nut 阅读(209) 评论(0) 推荐(0) 编辑
摘要: The K P factorization of a positive integer N is to write N as the sum of the P th power of K positive integers. You are supposed to write a program t 阅读全文
posted @ 2018-08-19 17:21 A-Little-Nut 阅读(270) 评论(0) 推荐(0) 编辑
摘要: The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a 阅读全文
posted @ 2018-08-19 17:20 A-Little-Nut 阅读(130) 评论(0) 推荐(0) 编辑