![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT甲级
文章平均质量分 78
Lerbronjames
这个作者很懒,什么都没留下…
展开
-
1057 Stack (30 分)
题目描述 Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (inserting an element onto the top position) and Pop (deleting the top element). Now you are supposed原创 2021-03-09 08:55:24 · 66 阅读 · 0 评论 -
1030 Travel Plan (30 分)
题目描述 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 program to help a traveler to decide the shortest path between his/her starting city and the destination. I原创 2021-02-25 09:22:15 · 72 阅读 · 0 评论 -
1003 Emergency (25 分)
题目描述 As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair of cities are m原创 2021-02-24 15:19:33 · 65 阅读 · 0 评论 -
1076 Forwards on Weibo (30 分)
题目描述 Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations. When a user makes a post on Weibo, all his/her followers c原创 2021-02-23 14:59:15 · 63 阅读 · 0 评论 -
1060 Are They Equal (25 分)
题目描述 If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×1050.123\times 10^50.123×105with simple chopping. Now given the number of significant digits on a machine and原创 2021-02-23 11:21:53 · 54 阅读 · 0 评论 -
1059 Prime Factors (25 分)
题目描述 Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1k1×p2k2×⋯×pmkmp_1^{k_1} \times p_2^{k_2} \times\cdots \times p_m^{k_m}p1k1×p2k2×⋯×pmkm. 输入 Input Specification: Each input file原创 2021-02-23 11:14:20 · 61 阅读 · 0 评论 -
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. Now given a linked list, you are supposed to sort the struc原创 2021-02-23 10:59:41 · 58 阅读 · 0 评论 -
1032 Sharing (25 分)
题目描述 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 sublist if they share the same suffix. For example, loading and being are stored as showed in Figure 1原创 2021-02-23 10:52:38 · 61 阅读 · 0 评论 -
1025 PAT Ranking (25 分)
题目描述 Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ranklists will be merged immediately after the test. Now it is原创 2021-02-23 10:08:50 · 51 阅读 · 0 评论 -
1001 A+B Format (20 分)
题目描述 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 than four digits). 输入 Input Specification: Each input file contains one test case. Each case contains a p原创 2021-02-23 09:58:21 · 82 阅读 · 0 评论 -
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: The left subtree of a node contains only nodes with keys less than the node’s key. The right subtree of a node contains only nodes with keys greate原创 2021-02-17 10:40:54 · 88 阅读 · 0 评论 -
1053 Path of Equal Weight (30 分)
题目描述 Given a non-empty tree with root R, and with weight WiW_{i}Wi assigned to each tree node TiT_{i}Ti. The weight of a path from R to L is defined to be the sum of the weights of all the nodes along the path from R to any leaf node L. Now given any原创 2021-02-16 10:59:04 · 77 阅读 · 0 评论 -
1034 Head of a Gang (30 分)
题目描述 One way that the police finds the head of a gang is to check people’s phone calls. If there is a phone call between A and B, we say that A and B is related. The weight of a relation is defined to be the total time length of all the phone calls made be原创 2021-02-23 09:49:25 · 71 阅读 · 0 评论