摘要: 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-03-13 14:40 王清河 阅读(129) 评论(0) 推荐(0)
摘要: To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords 阅读全文
posted @ 2018-03-13 12:35 王清河 阅读(131) 评论(0) 推荐(0)
摘要: Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specificat 阅读全文
posted @ 2018-03-13 10:50 王清河 阅读(139) 评论(0) 推荐(0)
摘要: Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each va 阅读全文
posted @ 2018-03-13 08:51 王清河 阅读(148) 评论(0) 推荐(0)
摘要: A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key 阅读全文
posted @ 2018-03-12 19:31 王清河 阅读(126) 评论(0) 推荐(0)
摘要: To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same s 阅读全文
posted @ 2018-03-12 18:58 王清河 阅读(144) 评论(0) 推荐(0)
摘要: Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, 阅读全文
posted @ 2018-03-12 16:56 王清河 阅读(147) 评论(0) 推荐(0)
摘要: Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given 阅读全文
posted @ 2018-03-12 15:06 王清河 阅读(103) 评论(0) 推荐(0)
摘要: Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given s 阅读全文
posted @ 2018-03-12 12:55 王清河 阅读(112) 评论(0) 推荐(0)
摘要: Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less t 阅读全文
posted @ 2018-03-12 10:47 王清河 阅读(117) 评论(0) 推荐(0)