- 博客(35)
- 收藏
- 关注
![](https://csdnimg.cn/release/blogv2/dist/pc/img/listFixedTop.png)
原创 PAT甲级题解目录
编号 题目 考点 1001 A+B Format 字符串处理 1002 A+B for Polynomials 数学运算 1003 Emergency 图、单源点最短路径、Dijkstra 1004 Counting Leaves 树、层序遍历 1005 Spell It Right 字符串...
2019-02-17 22:58:35
270
原创 1034 Head of a Gang
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...
2019-02-23 12:32:28
182
原创 1033 To Fill or Not to Fill
1033 To Fill or Not to Fill (25 分)With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the...
2019-02-19 12:10:22
183
原创 1032 Sharing
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...
2019-02-19 12:05:58
197
原创 1031 Hello World for U
1031 Hello World for U (20 分)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 de ll rlowoThat is...
2019-02-19 12:01:15
166
原创 1030 Travel Plan
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 d...
2019-02-19 11:57:39
365
原创 1029 Median
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,...
2019-02-19 11:52:51
178
原创 1028 List Sorting
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, t...
2019-02-19 11:44:50
143
原创 1027 Colors in Mars
1027 Colors in Mars (20 分)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, where the first 2 digits a...
2019-02-19 11:40:38
130
原创 1026 Table Tennis
1026 Table Tennis (30 分)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 open when they arrive, they w...
2019-02-15 18:28:30
222
原创 1025 PAT Ranking
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 pl...
2019-02-15 18:22:25
175
原创 1024 Palindromic Number
1024 Palindromic Number (25 分)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. All single digit...
2019-02-15 18:18:35
191
原创 1023 Have Fun with Numbers
1023 Have Fun with Numbers (20 分)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 246913578, which happe...
2019-02-15 18:05:45
230
1
原创 1022 Digital Library
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 assign...
2019-02-11 22:18:57
199
原创 1021 Deepest Root
1021 Deepest Root (25 分)A graph which is connected and acyclic can be considered a tree. The hight of the tree depends on the selected root. Now you are supposed to find the root that results in a h...
2019-02-11 14:16:00
406
原创 1020 Tree Traversals
1020 Tree Traversals (25 分)Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order ...
2019-02-11 11:05:16
157
原创 1019 General Palindromic Number
1019 General Palindromic Number (20 分)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. All sing...
2019-02-11 11:01:10
164
原创 1018 Public Bike Management
1018 Public Bike Management (30 分)There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and ret...
2019-02-10 17:06:05
213
原创 1017 Queueing at Bank
1017 Queueing at Bank (25 分)Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wai...
2019-02-10 17:00:20
162
原创 1016 Phone Bills
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 wh...
2019-02-10 16:56:27
206
原创 1015 Reversible Primes
1015 Reversible Primes (20 分)A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime beca...
2019-02-08 22:11:36
142
原创 1014 Waiting in Line
1014 Waiting in Line (30 分)Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to...
2019-02-07 22:02:18
179
原创 1013 Battle Over Cities
1013 Battle Over Cities (25 分)It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We...
2019-01-27 20:49:00
164
原创 1012 The Best Rank
1012 The Best Rank (25 分)To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or L...
2019-01-26 13:35:50
143
原创 1011 World Cup Betting
1011 World Cup Betting (20 分)With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World...
2019-01-25 23:10:01
206
原创 1010 Radix
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 pa...
2019-01-25 22:37:21
181
原创 1009 Product of Polynomials
1009 Product of Polynomials (25 分)This time, you are supposed to find A×B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines...
2019-01-24 21:15:17
163
原创 1008 Elevator
1008 Elevator (20 分)The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified...
2019-01-24 19:16:12
258
原创 1007 Maximum Subsequence Sum
1007 Maximum Subsequence Sum (25 分)Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj } where 1≤i≤j≤K. The Maximum Su...
2019-01-24 18:46:07
130
原创 1006 Sign In and Sign Out
1006 Sign In and Sign Out (25 分)At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the reco...
2019-01-24 15:22:30
215
原创 1005 Spell It Right
1005 Spell It Right (20 分)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 Specification:Each input file...
2019-01-23 22:45:19
116
原创 1004 Counting Leaves
1004 Counting Leaves (30 分)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains on...
2019-01-23 16:16:07
466
原创 1003 Emergency
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...
2019-01-23 13:37:11
232
原创 1002 A+B for Polynomials
1002 A+B for Polynomials (25 分)This time, you are supposed to find A+B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, a...
2019-01-23 13:22:52
160
原创 1001 A+B Format
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 Spe...
2019-01-23 13:08:15
162
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人