PAT (Advanced Level) Practice
文章平均质量分 63
xu_haiao
这个作者很懒,什么都没留下…
展开
-
【PAT (Advanced Level) Practice】1011 World Cup Betting (20 分)python题解
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. Similarly, football betting fans were putting their money原创 2022-08-24 14:51:46 · 288 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1029 Median (25 分)题解【nth_element法】
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原创 2022-04-08 21:16:21 · 392 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1027 Colors in Mars (20 分)python题解
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 digits forGreen, and the last 2 digits forBlue. The only ...原创 2022-01-15 20:36:33 · 348 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】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 digits forGreen, and the last 2 digits forBlue. The only ...原创 2022-01-15 20:21:38 · 188 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1023 Have Fun with Numbers (20 分)python题解
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 consisting exactly the numbers from 1 to 9, only in a diffe原创 2021-12-25 18:35:29 · 490 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1019 General Palindromic Number (20 分)python题解
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. Although palindromic numbers are most often considere.原创 2021-12-17 19:05:42 · 659 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1015 Reversible Primes (20 分)python题解
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 prime. Now given any two positive integersN(<105) an...原创 2021-11-08 00:09:21 · 385 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】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 information of a polynomial: KN1aN1N2aN2...NKaNK...原创 2021-11-07 23:08:13 · 83 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】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 seconds to move the elevator up one floor, and 4 seconds to..原创 2021-11-07 19:04:34 · 133 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】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 are supposed to find the ones who have unlocked and loc原创 2021-10-10 21:40:37 · 104 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】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. Each case occupies one line which contains anN(≤10100). ...原创 2021-10-09 00:01:55 · 260 阅读 · 0 评论