[算法编程]PAT-A
文章平均质量分 80
顾_wolf
人生在世需尽欢
展开
-
[ PAT-A ] 1008 Elevator (C++)
[ PAT-A ] 1008 Elevator (C++)题目描述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...原创 2018-07-24 10:56:59 · 279 阅读 · 0 评论 -
[ PAT-A ] 1025 PAT Ranking (C++)
题目描述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 rankl...原创 2018-08-08 14:09:30 · 242 阅读 · 0 评论 -
[ PAT-A ] 1020 Tree Traversals (C++)
题目描述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 t...原创 2018-08-15 23:09:39 · 257 阅读 · 0 评论 -
[ PAT-A ] 1029 Median(C++)
题目描述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, 1...原创 2018-08-13 12:26:58 · 283 阅读 · 0 评论 -
[ PAT-A ] 1031 Hello World for U (C++)
题目描述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 d e ...原创 2018-08-13 12:37:52 · 170 阅读 · 0 评论 -
[ PAT-A ] 1036 Boys vs Girls (C++)
题目描述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...原创 2018-08-18 11:43:10 · 197 阅读 · 0 评论 -
[ PAT-A ] 1033 To Fill or Not to Fill (C++)
题目描述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 way from time to time. Differ...原创 2018-08-16 10:05:00 · 234 阅读 · 0 评论 -
[ PAT-A ] 1037 Magic Coupon (C++)
题目描述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 pro...原创 2018-08-19 11:59:31 · 237 阅读 · 0 评论 -
[ PAT-A ] 1040 Longest Symmetric String (C++)
题目描述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”, ...原创 2018-08-23 13:23:43 · 293 阅读 · 0 评论 -
[ PAT-A ] 1041 Be Unique (C++)
题目描述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^4^]. The first one who ...原创 2018-08-23 14:12:16 · 253 阅读 · 0 评论 -
[ PAT-A ] 1038 Recover the Smallest Number (C++)
题目描述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-...原创 2018-08-21 17:56:39 · 221 阅读 · 0 评论 -
[ PAT-A ] 1039 Course List for Student (C++)
题目描述Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who ...原创 2018-08-21 18:00:49 · 185 阅读 · 0 评论 -
[PAT-A] 1065 A+B and C (64bit) (20)
题目链接 - 技术文档题目描述Given three integers A, B and C in [-2063,2063]. you are supposed to tell whether A+B>C.Input Specification:The first line of the input gives the positive number of test cas...原创 2018-09-26 21:48:01 · 166 阅读 · 0 评论 -
[PAT-A] 1070 Mooncake(25)
题目链接 - 技术文档题目描述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 according to the ...原创 2018-10-09 14:15:08 · 235 阅读 · 0 评论 -
[ PAT-A ] 1035 Password (C++)
题目描述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...原创 2018-08-17 21:36:11 · 214 阅读 · 0 评论 -
[ PAT-A ] Queueing at Bank (C++)
题目描述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 yel...原创 2018-08-03 15:29:07 · 196 阅读 · 0 评论 -
[ PAT-A ] 1012 The Best Rank (C++)
[ PAT-A ] 1012 The Best Rank (C++)题目描述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 Algebra), and E...原创 2018-07-29 15:49:25 · 517 阅读 · 0 评论 -
[ PAT-A ] 1009 Product of Polynomials(C++)
[ PAT-A ] 1009 Product of Polynomials(C++)题目描述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 i...原创 2018-07-26 13:29:59 · 330 阅读 · 0 评论 -
[ PAT-A ] 1013 Battle Over Cities (C++)
[ PAT-A ] 1013 Battle Over Cities (C++)题目描述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 ...原创 2018-07-30 16:33:25 · 288 阅读 · 0 评论 -
[ PAT-A ] 1010 Radix (C++)
[ PAT-A ] 1010 Radix (C++)题目描述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 posit...原创 2018-07-27 13:53:21 · 451 阅读 · 0 评论 -
[ PAT-A ] 1019 General Palindromic Number (C++)
题目描述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 n...原创 2018-08-04 11:02:26 · 227 阅读 · 0 评论 -
[ PAT-A ] 1015 Reversible Primes (C++)
题目描述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 als...原创 2018-07-31 14:22:31 · 172 阅读 · 0 评论 -
[ PAT-A ] 1011 World Cup Betting (C++)
[ PAT-A ] 1011 World Cup Betting (C++)题目描述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 Afri...原创 2018-07-28 12:06:58 · 468 阅读 · 0 评论 -
[ PAT-A ] 1023 Have Fun with Numbers (C++)
题目描述 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 nu...原创 2018-08-06 12:00:12 · 322 阅读 · 0 评论 -
[ PAT-A ] 1027 Colors in Mars (C++)
题目描述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...原创 2018-08-10 13:34:06 · 177 阅读 · 0 评论 -
[ PAT-A ] 1032 Sharing (C++)
题目描述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 suffix. For ex...原创 2018-08-14 11:34:06 · 218 阅读 · 0 评论 -
[ PAT-A ] 1028 List Sorting (C++)
题目描述Excel can sort records according to any column. Now you are supposed to imitate this function.Input Each input file contains one test case. For each case, the first line contains two integers...原创 2018-08-11 12:38:43 · 173 阅读 · 0 评论 -
[ PAT-A ] 1016 Phone Bills (C++)
题目描述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...原创 2018-08-02 17:52:14 · 221 阅读 · 0 评论 -
[ PAT-A ] 1024 Palindromic Number (C++)
题目描述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 n...原创 2018-08-07 12:10:05 · 250 阅读 · 0 评论 -
[PAT-A] 1071 Speech Patterns(25)
查看更多关于PAT的技术文档题目描述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 ...原创 2018-10-10 15:38:37 · 262 阅读 · 0 评论