![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT甲级
Duck_Duck_
Hi~ o(* ̄▽ ̄*)ブ
展开
-
1001 A+B Format (20 分)
Calculatea+band 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 ...原创 2019-08-04 23:59:32 · 99 阅读 · 0 评论 -
1019 General Palindromic Number (20 分)
A number that will be the same when it is written forwards or backwards is known as aPalindromic Number. For example, 1234321 is a palindromic number. All single digit numbers are palindromic numbers...原创 2019-08-19 17:49:12 · 123 阅读 · 0 评论 -
1021 Deepest Root (25 分)
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 find the root that results in a highest tree. Such a root ...原创 2019-08-23 18:09:19 · 371 阅读 · 0 评论 -
1015 Reversible Primes (20 分)
Areversible primein 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 because its reverse 37 is also a pr...原创 2019-08-11 00:43:04 · 94 阅读 · 0 评论 -
1024 Palindromic Number (25 分)
A number that will be the same when it is written forwards or backwards is known as aPalindromic Number. For example, 1234321 is a palindromic number. All single digit numbers are palindromic numbers...原创 2019-08-20 19:07:17 · 140 阅读 · 0 评论 -
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 happens to be another 9-digit number con...原创 2019-08-20 23:21:31 · 95 阅读 · 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 w...原创 2019-08-21 00:23:59 · 105 阅读 · 0 评论 -
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...原创 2019-08-21 01:30:05 · 104 阅读 · 0 评论 -
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 traversal sequence of the cor...原创 2019-08-21 21:30:42 · 311 阅读 · 0 评论 -
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 a...原创 2019-08-22 02:18:08 · 141 阅读 · 0 评论 -
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...原创 2019-08-22 03:30:40 · 159 阅读 · 0 评论 -
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 are forRed, the middle 2 dig...原创 2019-08-18 14:44:43 · 78 阅读 · 0 评论 -
1014 Waiting in Line (30 分)
Suppose a bank hasNwindows 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 wait in line are:The space...原创 2019-08-10 02:16:29 · 109 阅读 · 0 评论 -
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 must know immediately if we nee...原创 2019-08-10 01:05:04 · 88 阅读 · 0 评论 -
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 Linear Algrbra), andE- Eng...原创 2019-08-09 23:45:07 · 115 阅读 · 0 评论 -
1002 A+B for Polynomials (25 分)
This time, you are supposed to findA+BwhereAandBare two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the informa...原创 2019-08-05 00:59:37 · 107 阅读 · 0 评论 -
1007 Maximum Subsequence Sum (25 分)
Given a sequence ofKintegers {N1,N2, ...,NK}. A continuous subsequence is defined to be {Ni,Ni+1, ...,Nj} where1≤i≤j≤K. The Maximum Subsequence is the continuous subseq...原创 2019-08-08 00:10:46 · 81 阅读 · 0 评论 -
1008 Elevator (20 分)
The highest building in our city has only one elevator. A request list is made up withNpositive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 sec...原创 2019-08-08 00:50:20 · 83 阅读 · 0 评论 -
1009 Product of Polynomials (25 分)
This time, you are supposed to findA×BwhereAandBare two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the informa...原创 2019-08-08 01:35:15 · 91 阅读 · 0 评论 -
1010 Radix (25 分)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer isyes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive inte...原创 2019-08-09 02:39:09 · 207 阅读 · 3 评论 -
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 Cup trophy in South Africa. Si...原创 2019-08-09 03:09:29 · 105 阅读 · 0 评论 -
1017 Queueing at Bank (25 分)
Suppose a bank hasKwindows 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 wait in line behind the yellow li...原创 2019-08-18 16:47:19 · 80 阅读 · 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 l...转载 2019-08-06 23:55:34 · 96 阅读 · 0 评论 -
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 one test case. Each case starts...原创 2019-08-07 01:07:36 · 123 阅读 · 0 评论 -
1005 Spell It Right (20 分)
Given a non-negative integerN, your task is to compute the sum of all the digits ofN, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Eac...原创 2019-08-07 01:29:34 · 91 阅读 · 0 评论 -
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 records of signing in's and out's, you...原创 2019-08-07 01:49:47 · 132 阅读 · 0 评论 -
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...原创 2019-08-18 15:31:53 · 255 阅读 · 0 评论