PAT 1052 Linked List Sorting (25分) 结构体排序而已
PAT 1052 Linked List Sorting (25分) 结构体排序而已
|
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 and a Next pointer to the next structure.
PAT 1051 Pop Sequence (25分) 模拟入栈
PAT 1051 Pop Sequence (25分) 模拟入栈
|
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 sequence of numbers is a possible pop sequence of the stack.
PAT1050 String Subtraction (20分) 用布尔数组
PAT1050 String Subtraction (20分) 用布尔数组
|
Given two strings S​1​​ and S​2​​ , S=S​1​​ −S​2​​ is defined to be the remaining string after taking all the characters in S​2​​ from S​1​​ . Your task is simply to calculate S1​​​ −S​2​​ for any given strings.
PAT 1049 Counting Ones (30分) 编程之美--1的个数
PAT 1049 Counting Ones (30分) 编程之美--1的个数
|
The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. For example, given N being 12, there are five 1's in 1, 10, 11, and 12.
PAT 1048 Find Coins (25分) 硬币面值做数组下标即排序
PAT 1048 Find Coins (25分) 硬币面值做数组下标即排序
|
0 评论
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special requirement of the payment: for each bill, she could only use exactly two coins to pay the exact amount.
PAT1047 Student List for Course (25分)避免运行超时(内存溢出)
PAT1047 Student List for Course (25分)避免运行超时(内存溢出)
|
Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.
PAT 1046 Shortest Distance (20分)
PAT 1046 Shortest Distance (20分)
|
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 pair of exits.
PAT1045 Favorite Color Stripe (30分) 动态规划
PAT1045 Favorite Color Stripe (30分) 动态规划
|
Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off those unwanted pieces and sewing the remaining parts together to form her favorite color stripe.
PAT 1044 Shopping in Mars (25分) 二分法
PAT 1044 Shopping in Mars (25分) 二分法
|
Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$).
PAT 1043 Is It a Binary Search Tree (25分) 由前序遍历得到二叉搜索树的后序遍历
PAT 1043 Is It a Binary Search Tree (25分) 由前序遍历得到二叉搜索树的后序遍历
|
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: