随笔分类 - PAT 甲级
摘要:An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the
阅读全文
摘要:About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theor
阅读全文
摘要:Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou
阅读全文
摘要:One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions
阅读全文
摘要:The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the s
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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,
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-
阅读全文
摘要:Sherlock Holmes received a note with some strange strings: "Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm". It took him only a min
阅读全文
摘要:If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver
阅读全文
摘要:People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, wher
阅读全文
摘要:A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number
阅读全文

浙公网安备 33010602011771号