PAT甲
文章平均质量分 68
不想做程序猿的梦想家
这个作者很懒,什么都没留下…
展开
-
PAT甲 1047 Student List for Course (25 分)
Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.Input Specification:Each input file contains one test case. For原创 2021-09-16 13:48:54 · 87 阅读 · 0 评论 -
PAT甲 1048 Find Coins (25 分)
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special requirement of the payment: for eac原创 2021-09-16 12:37:23 · 126 阅读 · 0 评论 -
PAT甲 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-09-15 17:19:08 · 76 阅读 · 0 评论 -
PAT甲 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-09-14 20:47:30 · 107 阅读 · 0 评论 -
PAT甲 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 people in a certain range of ages. That is, given the net wor原创 2021-08-19 13:19:33 · 292 阅读 · 0 评论 -
PAT甲 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×105 with simple chopping. Now given the number of significant digits on a machine and two float numbers, you are su原创 2021-08-19 00:42:46 · 58 阅读 · 0 评论 -
PAT甲 1065 A+B and C (64bit) (20 分)
Given three integers A, B and C in (−263,263), you are supposed to tell whether A+B>C.Input Specification:The first line of the input gives the positive number of test cases, T (≤10). Then T test cases follow, each consists of a single line containing原创 2021-08-18 15:30:49 · 125 阅读 · 0 评论 -
PAT甲 1058 A+B in Hogwarts (20 分)
If you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagrid explained it to Harry, “Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it’s easy enough.” Your job is to write a program t原创 2021-08-18 13:53:59 · 67 阅读 · 0 评论 -
PAT甲 1084 Broken Keyboard (20 分)
On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen.Now given a string that you are supposed to type, and the string that you actually type out, please原创 2021-08-15 19:24:11 · 95 阅读 · 0 评论 -
PAT甲 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-08-15 19:08:38 · 308 阅读 · 0 评论 -
PAT甲 1040 Longest Symmetric String (25 分)
Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given Is PAT&TAP symmetric?, the longest symmetric sub-string is s PAT&TAP s, hence you must output 11.Input Specification:Each input file con原创 2021-08-14 19:11:15 · 78 阅读 · 0 评论 -
PAT甲 1038 Recover the Smallest Number (30 分)
Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recover many numbers such like 32-321-3214-0229-87 or 0229-32-87-321-3214 with respect to different ord原创 2021-08-14 15:27:30 · 78 阅读 · 0 评论 -
PAT甲 1037 Magic Coupon (25 分)
The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times the value of that product back! What is more, the shop also offers some bonus produ原创 2021-08-14 13:38:17 · 100 阅读 · 0 评论 -
PAT甲 1035 Password (20 分)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L in lowercase), or 0 (zero) from O (o in uppercase). One原创 2021-08-14 12:52:05 · 74 阅读 · 0 评论 -
PAT甲 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, the characters mus原创 2021-08-12 17:59:12 · 96 阅读 · 0 评论 -
PAT甲 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-08-12 16:54:01 · 60 阅读 · 0 评论 -
PAT甲 1050 String Subtraction (20 分)
Given two strings S1 and S2, S=S1−S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to calculate S1−S2 for any given strings. However, it might not be that simple to do it fast.Input Specif原创 2021-08-12 15:05:31 · 112 阅读 · 0 评论 -
PAT甲 1042 Shuffling Machine (20 分)
Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid “inside jobs” where employees collaborate with gamblers by performing inadequate shuffles, many casinos employ原创 2021-08-12 14:07:05 · 78 阅读 · 0 评论 -
PAT甲 1041 Be Unique (20 分)
Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1,104]. The first one who bets on a unique number wins. For example, if there are 7 people原创 2021-08-12 14:01:23 · 70 阅读 · 0 评论 -
PAT甲 1036 Boys vs Girls (25 分)
This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.Input Specification:Each input file contains one test case. Each case contains a positive integer N, followe原创 2021-08-12 13:53:39 · 316 阅读 · 0 评论 -
PAT甲 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 integers N (≤105) and C, where N is the number of records原创 2021-08-12 13:50:33 · 63 阅读 · 0 评论 -
PAT甲 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 for Red, the middle 2 digits for Green, and the last 2 digits for Blue. The only原创 2021-08-12 13:44:18 · 53 阅读 · 0 评论 -
PAT 甲 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 corresponding binary tree.Input Specification:Each input原创 2021-03-24 12:33:07 · 76 阅读 · 0 评论 -
PAT 甲 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 single digit numbers are palindromic numbers.Although palindromic numbers are most often considered原创 2021-02-09 16:18:37 · 54 阅读 · 0 评论 -
PAT 甲 1017 Queueing at Bank
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 wait in line behind the yellow line, until it is his/her turn to be served and there is a原创 2021-02-09 00:13:26 · 59 阅读 · 0 评论 -
PAT 甲 1016 Phone Bills
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 customer starts connecting a long-distance call, the t原创 2021-02-08 21:35:55 · 68 阅读 · 0 评论 -
PAT 甲 1015 Reversible Primes
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 because its reverse 37 is also a prime.Now given any two positive integers N (<105 ) a原创 2021-02-07 16:59:11 · 67 阅读 · 0 评论 -
PAT 甲 1013 Battle Over Cities
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 need to repair any other highways to keep the rest of the c原创 2021-02-07 00:23:10 · 58 阅读 · 0 评论 -
PAT 甲 1012 The Best Rank
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), and E - English. At the mean time, we encourage students by emphasi原创 2021-02-06 17:30:07 · 69 阅读 · 0 评论 -
PAT 甲 1010 Radix
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 N1 and N2 , your task is to find the radix of one原创 2021-02-06 13:54:41 · 62 阅读 · 0 评论 -
PAT 甲 题目列表(实时更新)
编号标题1001A+B Format1002A+B for Polynomials 10031004Counting Leaves 1005Spell It Right 1006Sign In and Sign Out 10071008Elevator 1009Product of Polynomials原创 2021-02-06 09:47:58 · 404 阅读 · 0 评论 -
PAT 甲 1011 World Cup Betting
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原创 2021-02-06 00:42:28 · 68 阅读 · 0 评论 -
PAT 甲 1009 Product of Polynomials
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, and each line contains the information of a polynomial:K N1 aN1 N2 aN2 … NK aNK原创 2021-02-05 22:52:25 · 59 阅读 · 0 评论 -
PAT 甲 1008 Elevator
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 order. It costs 6 seconds to move the elevator up one floor, and 4 seconds to原创 2021-02-05 19:45:57 · 65 阅读 · 0 评论 -
PAT 甲 1006 Sign In and Sign Out
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-02-05 19:43:37 · 74 阅读 · 0 评论 -
PAT 甲 1005 Spell It Right
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 contains one test case. Each case occupies one line which contains an N (≤10100 ).O原创 2021-02-05 19:36:27 · 61 阅读 · 0 评论 -
PAT 甲 1004 Counting Leaves
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 with a line containing 0<N<100, the number of nodes原创 2021-02-05 19:30:37 · 87 阅读 · 0 评论 -
PAT 甲 1002 A+B for Polynomials
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, and each line contains the information of a polynomial:K N1 aN1 N2 aN2 …原创 2021-02-04 15:10:31 · 69 阅读 · 0 评论 -
PAT 甲 1001 A+B Format
PAT 甲 1001 A+B FormatCalculate 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 cas原创 2021-02-04 14:30:07 · 83 阅读 · 0 评论