![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT甲级
_云胡
这个作者很懒,什么都没留下…
展开
-
PAT甲级1049(数1)
1049 Counting Ones (30 point(s)) The task is simple: given any positive integer N, you are supposed to count the total number of 1’s in the decimal form of the integers from 1 to N. For example, giv...原创 2019-11-27 19:04:38 · 225 阅读 · 0 评论 -
PAT甲级1120(友好数)
1120 Friend Numbers (20 point(s)) Two integers are called “friend numbers” if they share the same sum of their digits, and the sum is their “friend ID”. For example, 123 and 51 are friend numbers si...原创 2019-11-27 10:10:27 · 141 阅读 · 0 评论 -
PAT甲级1104(子列之和)
1104 Sum of Number Segments (20 point(s)) Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we have ...原创 2019-11-26 14:10:55 · 412 阅读 · 2 评论 -
PAT甲级1069(数字黑洞)
1069 The Black Hole of Numbers (20 point(s)) 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-decreasi...原创 2019-11-25 16:39:06 · 179 阅读 · 0 评论 -
PAT甲级1101(快速排序)
1101 Quick Sort (25 point(s)) There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less th...原创 2019-11-25 14:32:40 · 268 阅读 · 0 评论 -
PAT甲级1093(PAT个数)
1093 Count PAT’s (25 point(s)) The string APPAPT contains two PAT’s as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4...原创 2019-11-25 10:16:43 · 144 阅读 · 0 评论 -
PAT甲级1029(中位数)
1029 Median (25 point(s)) 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 S...原创 2019-11-24 19:31:54 · 189 阅读 · 0 评论 -
PAT甲级1089(插入排序还是归并排序)
1089 Insert or Merge (25 point(s))According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort remo...原创 2019-11-24 13:53:56 · 259 阅读 · 0 评论 -
PAT甲级1044(在火星购物)
1044 Shopping in Mars (25 point(s)) Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment,...原创 2019-11-24 11:23:20 · 229 阅读 · 0 评论 -
PAT甲级1010(进制)
1010 Radix (25 point(s)) 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...原创 2019-11-23 15:07:26 · 464 阅读 · 0 评论 -
PAT甲级1085(完美数列)
1085 Perfect Sequence (25 point(s)) Given a sequence of positive integers and another positive integer p. The sequence is said to be a perfect sequence if M≤m×p where M and m are the maximum and min...原创 2019-11-23 14:02:21 · 356 阅读 · 0 评论 -
PAT甲级1038(恢复最小数字)
1038 Recover the Smallest Number (30 point(s)) 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 ca...原创 2019-11-22 13:42:06 · 287 阅读 · 0 评论 -
PAT甲级1067(用swap(0,*)排序)
1067 Sort with Swap(0, i) (25 point(s)) Given any permutation of the numbers {0, 1, 2,…, N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allow...原创 2019-11-22 12:51:34 · 171 阅读 · 0 评论 -
PAT甲级1037(有魔力的优惠券)
1037 Magic Coupon (25 point(s)) 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...原创 2019-11-21 13:16:03 · 149 阅读 · 0 评论 -
PAT甲级1033(加还是不加)
1033 To Fill or Not to Fill (25 point(s)) 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 station...原创 2019-11-20 16:33:50 · 262 阅读 · 0 评论 -
PAT甲级1070(月饼)
1070 Mooncake (25 point(s))题目原文 Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes acco...原创 2019-11-19 14:22:42 · 138 阅读 · 0 评论 -
PAT甲级1048(找硬币)
1048 Find Coins (25 point(s)) 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 kind...原创 2019-11-19 13:41:01 · 132 阅读 · 0 评论 -
PAT甲级1050(字符串减法)
1050 String Subtraction (20 point(s)) 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...原创 2019-11-18 14:56:15 · 194 阅读 · 0 评论 -
PAT甲级1041(独一无二的数字)
1041 Be Unique (20 point(s)) 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,10...原创 2019-11-18 14:00:22 · 317 阅读 · 0 评论 -
PAT甲级1092(买还是不买)
1092 To Buy or Not to Buy (20 point(s)) Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. Ho...原创 2019-11-18 13:28:12 · 109 阅读 · 0 评论 -
PAT甲级1084(坏键盘打字)
1084 Broken Keyboard (20 point(s)) 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 g...原创 2019-11-18 13:19:43 · 136 阅读 · 0 评论 -
PAT甲级1095(校园停车)
1095 Cars on Campus (30 point(s)) 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 ...原创 2019-11-18 10:41:36 · 295 阅读 · 0 评论 -
PAT甲级1080(研究生录取)
1080 Graduate Admission (30 point(s)) 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 w...原创 2019-11-16 11:47:11 · 170 阅读 · 0 评论 -
PAT甲级1083(成绩列表)
1083 List Grades (25 point(s)) 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 stu...原创 2019-11-15 14:20:49 · 207 阅读 · 0 评论 -
PAT甲级1075(PAT 评判)
1075 PAT Judge (25 point(s)) 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 Spec...原创 2019-11-15 13:42:56 · 213 阅读 · 0 评论 -
PAT甲级1055(找出给定区间的前M名富人)
1055 The World’s Richest (25 point(s)) 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 th...原创 2019-11-14 15:53:44 · 170 阅读 · 0 评论 -
PAT甲级1028(列表排序)
1028 List Sorting (25 point(s)) 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...原创 2019-11-14 15:20:14 · 164 阅读 · 0 评论 -
PAT甲级1025(PAT 排名)
1025 PAT Ranking (25 point(s)) 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 se...原创 2019-11-13 13:10:29 · 324 阅读 · 1 评论 -
PAT甲级1082
1082 Read Number in Chinese (25 point(s)) 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, -12...原创 2019-11-12 21:46:09 · 214 阅读 · 0 评论 -
PAT甲级1035
1035 Password (20 point(s)) 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 ...原创 2019-11-11 14:15:09 · 320 阅读 · 0 评论 -
PAT甲级1073
1073 Scientific Notation (20 point(s)) Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [±][1-9].[0-...原创 2019-11-11 11:16:27 · 171 阅读 · 0 评论 -
PAT甲级1058
1058 A+B in Hogwarts (20 point(s)) 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 G...原创 2019-11-10 17:09:32 · 214 阅读 · 0 评论 -
PAT甲级1027
1027 Colors in Mars (20 point(s))题目原文 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 fir...原创 2019-11-10 16:50:20 · 140 阅读 · 1 评论 -
PAT甲级1019
1019 General Palindromic Number (20 point(s)) 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. ...原创 2019-11-10 16:08:30 · 153 阅读 · 0 评论 -
PAT甲级1031
1031 Hello World for U (20 point(s))题目原文 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 rl...原创 2019-11-10 15:13:14 · 112 阅读 · 0 评论 -
PAT甲级1036
1036 Boys vs Girls (25 point(s)) 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 Specificatio...原创 2019-11-09 19:24:50 · 95 阅读 · 0 评论 -
PAT甲级1066
1066 Root of AVL Tree (25 point(s))题目原文 An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time t...原创 2019-11-08 21:30:41 · 201 阅读 · 0 评论 -
PAT甲级1065
1065 A+B and C (64bit) (20 point(s))题目原文 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 t...原创 2019-11-08 10:57:58 · 412 阅读 · 0 评论 -
PAT甲级1046
1046 Shortest Distance (20 point(s))题目原文 The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits....原创 2019-11-07 21:01:44 · 127 阅读 · 0 评论 -
PAT甲级1042
1042 Shuffling Machine (20 point(s))题目原文 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 jo...原创 2019-11-07 14:06:58 · 127 阅读 · 0 评论