随笔分类 - PAT
摘要:题目描述: Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as: h d
阅读全文
摘要:题目描述: 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
阅读全文
摘要:题目描述: Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a
阅读全文
摘要:题目描述: A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a
阅读全文
摘要:题目描述: Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14
阅读全文
摘要:题目描述: Excel can sort records according to any column. Now you are supposed to imitate this function. Input Specification: Each input file contains one
阅读全文
摘要:题目描述: Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to r
阅读全文
摘要:题目描述: A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables
阅读全文
摘要:题目描述: 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
阅读全文
摘要:题目描述: Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 2
阅读全文
摘要:题目描述: A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published
阅读全文
摘要:题目描述: This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female student
阅读全文
摘要:题目描述: To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing pass
阅读全文
摘要:题目描述: 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
阅读全文
摘要:题目描述: 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
阅读全文
摘要:题目描述: A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to fi
阅读全文
摘要:题目描述: Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output Fu first if it is negative. For
阅读全文
摘要:题目描述: Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed
阅读全文
摘要:题目描述: A long-distance telephone company charges its customers by the following rules: Making a long-distance call costs a certain amount per minute, d
阅读全文
摘要:题目描述: The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pai
阅读全文