![](https://img-blog.csdnimg.cn/c50a585487ae4321b52a3a065e5bf42c.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
PTA Advanced Level/甲级习题
文章平均质量分 79
PTA甲级习题
AnthonyZhangZJU
一个小丑罢了
展开
-
PAT (Advanced Level) Practice 1101 Quick Sort (25 分)
PAT A1101 Quick Sort原创 2022-03-07 10:44:53 · 163 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1038 Recover the Smallest Number (30 分)
PAT甲级 A1038 Recover the Smallest Number原创 2021-12-25 13:16:04 · 61 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1067 Sort with Swap(0, i) (25 分)
PAT甲级 A1067 Sort with Swap(0,i)原创 2021-12-23 20:03:11 · 160 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1085 Perfect Sequence (25 分)
PAT甲级练习A1085 Perfect Sequence原创 2021-12-23 08:34:11 · 371 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1069 The Black Hole of Numbers (20 分)
For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order, a new number can be obtained by taking the second number from the first one. Repeat in this m原创 2021-12-22 21:17:32 · 75 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1029 Median (25 分)
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 } is 12, and the median of S2 = { 9, 10, 15, 16, 17 } is 15. The median of two sequences is defined to be the me原创 2021-12-21 19:06:22 · 54 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1010 Radix (25 分)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive integers N1N_1N1 and N2N_2N2, your task is to find the r原创 2021-12-20 14:02:10 · 61 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1001 A+B Format (20 分)
Calculate a+ba+ba+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 pai原创 2021-12-20 11:16:57 · 115 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1097 Deduplication on a Linked List (25 分)
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 value K, only the first node of which the value or absolute value of its key equals K will be kept. At the m原创 2021-12-19 09:01:54 · 63 阅读 · 0 评论 -
PAT (Advanced Level) Practice 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 structures原创 2021-12-18 16:19:32 · 453 阅读 · 0 评论 -
PAT (Advanced Level) Practice 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.Yo原创 2021-12-18 15:20:46 · 557 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1074 Reversing Linked List (25 分)
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, if K=3, then you must output 3→2→1→6→5→4; if K=4, you must output 4→3→2→1→5→6.Input Specification:Each原创 2021-12-17 11:25:10 · 436 阅读 · 0 评论 -
PAT (Advanced Level) Practice 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. For example, if M is 5 and N is 7, we can obtain原创 2021-12-17 11:09:36 · 204 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1022 Digital Library (30 分)
A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number as its ID. Given any query from a reader, you are suppose原创 2021-12-16 23:11:41 · 191 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1071 Speech Patterns (25 分)
People often have a preference among synonyms of the same word. For example, some may prefer “the police”, while others may prefer “the cops”. Analyzing such patterns can help to narrow down a speaker’s identity, which is useful when validating, for exampl原创 2021-12-16 08:58:22 · 48 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1054 The Dominant Color (20 分)
Behind the scenes in the computer’s memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called the dominant color. A strictly dominant color takes more than原创 2021-12-15 11:14:03 · 460 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1100 Mars Numbers (20 分)
People on Mars count their numbers with base 13:Zero on Earth is called “tret” on Mars.The numbers 1 to 12 on Earth is called “jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec” on Mars, respectively.For the next higher digit, Mars people name原创 2021-12-15 10:55:45 · 665 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1095 Cars on Campus (30 分)
PAT (Advanced Level) Practice 1095 Cars on Campus (30 分)Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the gate. Now with all the information available, you原创 2021-12-14 11:19:27 · 930 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1080 Graduate Admission (30 分)
It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission procedure.Each applicant will have to provide two grad原创 2021-12-13 20:10:01 · 86 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1083 List Grades (25 分)
Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades are in a given interval.Input Specification:Each input原创 2021-12-13 01:16:27 · 627 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1075 PAT Judge (25 分)
The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT.Input Specification:Each input file contains one test case. For each case, the first line contai原创 2021-12-13 00:05:35 · 994 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1055 The World‘s Richest (25 分)
PAT (Advanced Level) Practice 1055 The World’s Richest (25 分)Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world’s wealthiest people. Now you are supposed to simulate this job, but concentrate only on the原创 2021-12-12 10:18:05 · 334 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1028 List Sorting (25 分)
PAT (Advanced Level) Practice 1028 List Sorting (25 分)Excel can sort records according to any column. Now you are supposed to imitate this function.Input Specification:Each input file contains one test case. For each case, the first line contains two in原创 2021-12-12 09:23:09 · 55 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1016 Phone Bills (25 分)
PAT (Advanced Level) Practice 1016 Phone Bills (25 分)A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is made. When a原创 2021-12-11 21:08:41 · 186 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1082 Read Number in Chinese (25 分)
PAT (Advanced Level) Practice 1082 Read Number in Chinese (25 分)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 example, -123456789 is read as Fu yi Yi er Qian原创 2021-12-10 23:51:58 · 124 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1077 Kuchiguse (20 分)
PAT (Advanced Level) Practice 1077 Kuchiguse (20 分)The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker’s personality. Such a preference is called “Kuc原创 2021-12-10 11:41:45 · 47 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1025 PAT Ranking (25 分)
PAT甲级 1025 PAT Ranking (25 分)2021年12月10日10:31:43Programming 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原创 2021-12-10 10:32:36 · 319 阅读 · 0 评论